diff --git a/dist/api/getPortfolioActivityData.php b/dist/api/getPortfolioActivityData.php index 2bfea8b261..187f400e74 100644 --- a/dist/api/getPortfolioActivityData.php +++ b/dist/api/getPortfolioActivityData.php @@ -88,14 +88,6 @@ // WHERE doenetId='$doenetId' // AND courseId = (SELECT courseId FROM course WHERE portfolioCourseForUserId = '$userId') // "; - $sql = " - SELECT imagePath, - label, - userCanViewSource, - isPublic - FROM course_content - WHERE doenetId='$doenetId' - "; // $sql = " // SELECT imagePath, // label, @@ -103,12 +95,27 @@ // isPublic // FROM course_content // WHERE doenetId='$doenetId' - // AND courseId = (SELECT courseId FROM course WHERE portfolioCourseForUserId = '$userId') // "; + $sql = " + SELECT cc.imagePath, + cc.label, + cc.userCanViewSource, + cc.isPublic, + c.portfolioCourseForUserId + FROM course_content AS cc + LEFT JOIN course AS c + ON c.courseId = cc.courseId + WHERE doenetId='$doenetId' + "; + $result = $conn->query($sql); if ($result->num_rows > 0) { $row = $result->fetch_assoc(); + $isPortfolioCourse = '0'; + if ($row['portfolioCourseForUserId'] != ""){ + $isPortfolioCourse = '1'; + } $activityData = [ 'doenetId' => $doenetId, 'imagePath' => $row['imagePath'], @@ -119,6 +126,8 @@ 'isNew' => false, 'pageDoenetId' => $pageDoenetId, 'courseId' => $courseId, + 'isPortfolioCourse' => $isPortfolioCourse, + ]; } else { $success = false; diff --git a/dist/assets/AccountSettings-b92cab8a.js b/dist/assets/AccountSettings-3b4a6bf6.js similarity index 94% rename from dist/assets/AccountSettings-b92cab8a.js rename to dist/assets/AccountSettings-3b4a6bf6.js index e12c8aebcb..9977559898 100644 --- a/dist/assets/AccountSettings-b92cab8a.js +++ b/dist/assets/AccountSettings-3b4a6bf6.js @@ -1 +1 @@ -import{R as f,p,r as c,b as x,c as v,d as w,j as e,a as i,F as d,B as u}from"./index-99a56692.js";function k(l){var a;const o=f(p),[r,g]=c.useState(null);let s=c.useRef(!1);const n=x(v);if(n.state==="loading")return null;if(n.state==="hasError")return console.error(n.contents),null;let h=(a=n==null?void 0:n.contents)==null?void 0:a.email;if(s.current||(s.current=!0,w().then(({cookieRemoved:m})=>{g(m)})),r==null)return null;let t=null;return r?t=i(d,{children:[e("h2",{children:"You are NOT signed in"}),e(u,{value:"Sign in",onClick:()=>{o({page:"signout",tool:"",view:""}),window.location.href="/signin"}})]}):t=i(d,{children:[e("h2",{children:"You are signed in"}),i("p",{children:["Email: ",h]}),e(u,{dataTest:"sign out button",value:"Sign out",onClick:()=>{o({page:"signout",tool:"",view:""})}})]}),e("div",{style:l.style,children:e("div",{style:{...l.style,border:"1px solid var(--mainGray)",borderRadius:"20px",margin:"auto",marginTop:"10%",padding:"10px",width:"50%"},children:e("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",alignItems:"center",marginBottom:"20px"},children:t})})})}export{k as default}; +import{R as f,p,r as c,b as x,c as v,d as w,j as e,a as i,F as d,B as u}from"./index-7074710c.js";function k(l){var a;const o=f(p),[r,g]=c.useState(null);let s=c.useRef(!1);const n=x(v);if(n.state==="loading")return null;if(n.state==="hasError")return console.error(n.contents),null;let h=(a=n==null?void 0:n.contents)==null?void 0:a.email;if(s.current||(s.current=!0,w().then(({cookieRemoved:m})=>{g(m)})),r==null)return null;let t=null;return r?t=i(d,{children:[e("h2",{children:"You are NOT signed in"}),e(u,{value:"Sign in",onClick:()=>{o({page:"signout",tool:"",view:""}),window.location.href="/signin"}})]}):t=i(d,{children:[e("h2",{children:"You are signed in"}),i("p",{children:["Email: ",h]}),e(u,{dataTest:"sign out button",value:"Sign out",onClick:()=>{o({page:"signout",tool:"",view:""})}})]}),e("div",{style:l.style,children:e("div",{style:{...l.style,border:"1px solid var(--mainGray)",borderRadius:"20px",margin:"auto",marginTop:"10%",padding:"10px",width:"50%"},children:e("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",alignItems:"center",marginBottom:"20px"},children:t})})})}export{k as default}; diff --git a/dist/assets/ActionButton-f612d279.js b/dist/assets/ActionButton-e5ea2a2f.js similarity index 97% rename from dist/assets/ActionButton-f612d279.js rename to dist/assets/ActionButton-e5ea2a2f.js index f0432ee991..b1e0b5aae9 100644 --- a/dist/assets/ActionButton-f612d279.js +++ b/dist/assets/ActionButton-e5ea2a2f.js @@ -1,4 +1,4 @@ -import{j as o,F as h,a as u,s as d}from"./index-99a56692.js";const c=d.button` +import{j as o,F as h,a as u,s as d}from"./index-7074710c.js";const c=d.button` margin: ${e=>e.theme.margin}; height: 24px; width: ${e=>e.width}; diff --git a/dist/assets/ActionButtonGroup-a395ceaf.js b/dist/assets/ActionButtonGroup-f4ce05e4.js similarity index 97% rename from dist/assets/ActionButtonGroup-a395ceaf.js rename to dist/assets/ActionButtonGroup-f4ce05e4.js index ad11b245c9..9c9ebdb03f 100644 --- a/dist/assets/ActionButtonGroup-a395ceaf.js +++ b/dist/assets/ActionButtonGroup-f4ce05e4.js @@ -1,4 +1,4 @@ -import{s as r,av as l,j as a,F as f,a as m,aw as p}from"./index-99a56692.js";const h=r.div` +import{s as r,av as l,j as a,F as f,a as m,aw as p}from"./index-7074710c.js";const h=r.div` /* margin-left: 3px; */ display: ${e=>e.vertical?"static":"flex"}; overflow: auto; diff --git a/dist/assets/ActivityDates-784e642f.js b/dist/assets/ActivityDates-1e5c21fa.js similarity index 54% rename from dist/assets/ActivityDates-784e642f.js rename to dist/assets/ActivityDates-1e5c21fa.js index 149fde04ad..6de9db1337 100644 --- a/dist/assets/ActivityDates-784e642f.js +++ b/dist/assets/ActivityDates-1e5c21fa.js @@ -1 +1 @@ -import{l as r,m as A,w as h,j as e,F as o,a as t}from"./index-99a56692.js";import{u as g}from"./SettingComponents-67fac933.js";import{e as y}from"./RoleDropdown-5e05ae49.js";import"./DateTime-ef0be144.js";import"./moment-f5bb98f1.js";import"./IncrementMenu-aee46d2a.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";import"./RelatedItems-96588168.js";import"./ActionButtonGroup-a395ceaf.js";import"./ActionButton-f612d279.js";import"./Textfield-5d92f495.js";import"./useSaveDraft-a42d0f94.js";import"./EditorViewerRecoil-41e59102.js";function M(){const n=r(A("doenetId")),i=r(h);return e(o,{children:e(D,{doenetId:n,courseId:i})})}function D({doenetId:n,courseId:i}){const{canModifyActivitySettings:v,canViewActivitySettings:p}=r(y(i)),{value:{numberOfAttemptsAllowed:f,timeLimit:l,assignedDate:m,dueDate:a}}=g(i,n);if(p==="1")return e(o,{});let s=f;s===null&&(s="unlimited");let d=null;l!==null&&(d=t("p",{children:["Time Limit: ",l," minutes"]}));let c=null;m!==null&&(c=t("p",{style:{content:"A"},children:["Assigned: ",m]}));let u=e("p",{children:"No Due Date"});return a!==null&&(u=t("p",{children:["Due: ",a]})),e(o,{children:t("div",{children:[c,u,d,t("p",{children:["Attempts Allowed: ",s]})]})})}export{D as AssignmentSettings,M as default}; +import{l as r,m as A,w as h,j as e,F as o,a as t}from"./index-7074710c.js";import{u as g}from"./SettingComponents-3306743d.js";import{e as y}from"./RoleDropdown-cce90708.js";import"./DateTime-d0a20943.js";import"./moment-3cda1086.js";import"./IncrementMenu-2cdf9a4e.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";import"./RelatedItems-33b68fba.js";import"./ActionButtonGroup-f4ce05e4.js";import"./ActionButton-e5ea2a2f.js";import"./Textfield-9c1c2968.js";import"./useSaveDraft-5f9f3fe4.js";import"./EditorViewerRecoil-fb47fc9d.js";function M(){const n=r(A("doenetId")),i=r(h);return e(o,{children:e(D,{doenetId:n,courseId:i})})}function D({doenetId:n,courseId:i}){const{canModifyActivitySettings:v,canViewActivitySettings:p}=r(y(i)),{value:{numberOfAttemptsAllowed:f,timeLimit:l,assignedDate:m,dueDate:a}}=g(i,n);if(p==="1")return e(o,{});let s=f;s===null&&(s="unlimited");let d=null;l!==null&&(d=t("p",{children:["Time Limit: ",l," minutes"]}));let c=null;m!==null&&(c=t("p",{style:{content:"A"},children:["Assigned: ",m]}));let u=e("p",{children:"No Due Date"});return a!==null&&(u=t("p",{children:["Due: ",a]})),e(o,{children:t("div",{children:[c,u,d,t("p",{children:["Attempts Allowed: ",s]})]})})}export{D as AssignmentSettings,M as default}; diff --git a/dist/assets/ActivityNavigationButtons-a3d39ee0.js b/dist/assets/ActivityNavigationButtons-072f10de.js similarity index 83% rename from dist/assets/ActivityNavigationButtons-a3d39ee0.js rename to dist/assets/ActivityNavigationButtons-072f10de.js index 064a0354ca..8d7d2368d4 100644 --- a/dist/assets/ActivityNavigationButtons-a3d39ee0.js +++ b/dist/assets/ActivityNavigationButtons-072f10de.js @@ -1 +1 @@ -import{r as m,l as d,w as I,m as g,R as f,p as x,a as B,j as v,B as y,az as p,b5 as O,b6 as C,G as l,H as b}from"./index-99a56692.js";import{B as P}from"./ButtonGroup-ea123297.js";import{e as h}from"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";const A=p({key:"itemOrderbyCourseId",get:r=>({get:o})=>{const{canViewUnassignedContent:a}=o(h(r));return o(a==="1"?O(r):C(r))}}),F=p({key:"activityOrderByCourseId",get:r=>({get:o,getCallback:a})=>{const s=o(A(r)).filter(e=>{const t=o(l(e));return(t==null?void 0:t.type)==="activity"&&!t.proctorMakesAvailable}),n=a(({snapshot:e})=>t=>t<0||t>=s.length?{}:e.getLoadable(l(s[t])).getValue()),i=a(({snapshot:e})=>t=>{var c;return t<0||t>=s.length?null:b(((c=e.getLoadable(l(s[t])).getValue())==null?void 0:c.content)??[])});return{value:s,getInfoFromIndex:n,getFirstPageFromIndex:i}}});function j(){const[r,o]=m.useState({previous:null,next:null}),a=d(I),u=d(g("doenetId")),s=f(x),{value:n,getFirstPageFromIndex:i}=d(F(a));return m.useLayoutEffect(()=>{const e=n.indexOf(u);o(e===-1?{previous:null,next:null}:{previous:e>0?{doenetId:n[e-1],pageId:i(e-1)}:null,next:e{s(e=>({...e,params:{...e.params,...r.previous}}))},disabled:r.previous===null}),v(y,{"data-test":"Next Activity Button",value:"Next",onClick:()=>{s(e=>({...e,params:{...e.params,...r.next}}))},disabled:r.next===null})]})}export{j as default}; +import{r as m,l as d,w as I,m as g,R as f,p as x,a as B,j as v,B as y,az as p,b5 as O,b6 as C,G as l,H as b}from"./index-7074710c.js";import{B as P}from"./ButtonGroup-9136da6d.js";import{e as h}from"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";const A=p({key:"itemOrderbyCourseId",get:r=>({get:o})=>{const{canViewUnassignedContent:a}=o(h(r));return o(a==="1"?O(r):C(r))}}),F=p({key:"activityOrderByCourseId",get:r=>({get:o,getCallback:a})=>{const s=o(A(r)).filter(e=>{const t=o(l(e));return(t==null?void 0:t.type)==="activity"&&!t.proctorMakesAvailable}),n=a(({snapshot:e})=>t=>t<0||t>=s.length?{}:e.getLoadable(l(s[t])).getValue()),i=a(({snapshot:e})=>t=>{var c;return t<0||t>=s.length?null:b(((c=e.getLoadable(l(s[t])).getValue())==null?void 0:c.content)??[])});return{value:s,getInfoFromIndex:n,getFirstPageFromIndex:i}}});function j(){const[r,o]=m.useState({previous:null,next:null}),a=d(I),u=d(g("doenetId")),s=f(x),{value:n,getFirstPageFromIndex:i}=d(F(a));return m.useLayoutEffect(()=>{const e=n.indexOf(u);o(e===-1?{previous:null,next:null}:{previous:e>0?{doenetId:n[e-1],pageId:i(e-1)}:null,next:e{s(e=>({...e,params:{...e.params,...r.previous}}))},disabled:r.previous===null}),v(y,{"data-test":"Next Activity Button",value:"Next",onClick:()=>{s(e=>({...e,params:{...e.params,...r.next}}))},disabled:r.next===null})]})}export{j as default}; diff --git a/dist/assets/ActivityVariant-2316414b.js b/dist/assets/ActivityVariant-755b56b5.js similarity index 75% rename from dist/assets/ActivityVariant-2316414b.js rename to dist/assets/ActivityVariant-755b56b5.js index a8a9596bf7..23dad352c4 100644 --- a/dist/assets/ActivityVariant-2316414b.js +++ b/dist/assets/ActivityVariant-755b56b5.js @@ -1 +1 @@ -import{g as l,O as u,R as d,p,j as r}from"./index-99a56692.js";import{I as c}from"./IncrementMenu-aee46d2a.js";function V(o){const[n,s]=l(u),m=d(p);function t(){m(a=>{let e={...a};return e.params?e.params={...e.params}:e.params={},e.params.requestedVariant=n.index&&Number.isFinite(Number(n.index))?Number(n.index):1,e})}return r("div",{style:o.style,children:r(c,{min:1,value:n.index,onBlur:()=>t(),onKeyDown:a=>{a.key==="Enter"&&t()},onChange:a=>{s(e=>{let i={...e};return i.index=a,i})}})})}export{V as default}; +import{g as l,O as u,R as d,p,j as r}from"./index-7074710c.js";import{I as c}from"./IncrementMenu-2cdf9a4e.js";function V(o){const[n,s]=l(u),m=d(p);function t(){m(a=>{let e={...a};return e.params?e.params={...e.params}:e.params={},e.params.requestedVariant=n.index&&Number.isFinite(Number(n.index))?Number(n.index):1,e})}return r("div",{style:o.style,children:r(c,{min:1,value:n.index,onBlur:()=>t(),onKeyDown:a=>{a.key==="Enter"&&t()},onChange:a=>{s(e=>{let i={...e};return i.index=a,i})}})})}export{V as default}; diff --git a/dist/assets/ActivityViewer-3a815948.js b/dist/assets/ActivityViewer-becda8c0.js similarity index 98% rename from dist/assets/ActivityViewer-3a815948.js rename to dist/assets/ActivityViewer-becda8c0.js index a3229b4471..077d821ca5 100644 --- a/dist/assets/ActivityViewer-3a815948.js +++ b/dist/assets/ActivityViewer-becda8c0.js @@ -1 +1 @@ -import{y as ut,R as G,p as dt,r,g as We,ab as ft,u as gt,e as mt,ad as Be,v as vt,ae as Le,af as K,k as p,z as N,a as A,j as f,P as It,ag as Y,ah as je,ac as yt,ai as Je,i as St,aj as ht,B as T}from"./index-99a56692.js";import{p as ve,c as Ct}from"./activityUtils-c08c1686.js";import{V as wt}from"./visibility-sensor-55e75ed1.js";import{A as bt}from"./ActionButton-f612d279.js";import{B as At}from"./ButtonGroup-ea123297.js";const Ie=Y({key:"saveStateToDBTimerIdAtom",default:null}),xt=Y({key:"currentPageAtom",default:0}),Pt=Y({key:"activityAttemptNumberSetUpAtom",default:0}),Et=Y({key:"itemWeightsAtom",default:[]});function Ot(t){var Fe;const x=ut(),Me=G(dt),[ye,I]=r.useState(null),[{cidFromProps:h,activityDefinitionFromProps:C,attemptNumber:g,requestedVariantIndex:L},ze]=r.useState({cidFromProps:null,activityDefinitionFromProps:null,attemptNumber:null,requestedVariantIndex:null}),k=r.useRef(null);k.current=g;const[m,H]=r.useState(null),O=r.useRef(null);O.current=m;const Q=r.useRef(null),[P,X]=r.useState(null),[V,Z]=r.useState(null),ee=r.useRef(null);ee.current=V;const[j,w]=r.useState("initial"),Se=r.useRef(null);Se.current=j;const te=r.useRef(!0),[_e,he]=r.useState(!1),[J,ae]=r.useState(null),[ne,Ue]=r.useState(t.flags),[c,E]=r.useState(0),R=G(xt),b=r.useRef(c);b.current=c;const Ce=G(Pt),[u,ie]=r.useState(0),[M,re]=r.useState(null),[se,oe]=We(Et),$=r.useRef([]),ce=r.useRef(null),le=r.useRef(null),ue=r.useRef(!1),we=G(Ie),[qe,Ge]=We(ft),y=r.useRef(null),z=r.useRef(null),be=r.useRef(null),Ae=r.useRef(null),[S,de]=r.useState({pageIsVisible:[],pageIsActive:[],pageCoreWorker:[],waitingForPagesCore:null}),[Ke,Ye]=r.useState([]),fe=r.useRef(!1),F=r.useRef(null),ge=r.useRef(!1),D=r.useRef(null);let v=gt(),d=v.hash;const W=r.useRef({}),_=r.useRef(null),xe=r.useRef(!1),[He,Pe]=r.useState(!1),[Ee,Qe]=r.useState(!1);let Xe=mt();r.useEffect(()=>()=>{U({overrideThrottle:!0}),xe.current=!0},[]),r.useEffect(()=>{let e={...t.flags};t.userId?(e.allowLocalState=!1,e.allowSaveState=!1):e.allowSaveState&&(e.allowLoadState=!0),Ue(e)},[t.userId,t.flags]),r.useEffect(()=>{window.returnActivityData=function(){return{activityDefinition:P,requestedVariantIndex:L,variantIndex:V,cid:m,order:J,currentPage:c,nPages:u,variantsByPage:M,itemWeights:se}}},[P,L,V,m,J,c,u,M,se]),r.useEffect(()=>{if(F.current){let e=F.current.parentNode.id==="mainPanel"?F.current.parentNode:window;Ge(e),!t.paginate&&u>1&&e.addEventListener("scroll",a=>{if(ge.current)ge.current=!1;else{let i;for(let s=0;s{var e;(e=t.pageChangedCallback)==null||e.call(t,c)},[c]),r.useEffect(()=>{if(d&&u){let e=d.match(/^#page(\d+)/);if(e){let a=Math.max(1,Math.min(u,e[1]));a!==c&&(E(a),R(a))}}},[d,u]),r.useEffect(()=>{var e,a;if(c>0&&u>1){if(Number((e=d==null?void 0:d.match(/^#page(\d+)/))==null?void 0:e[1])!==c){let s=`#page${c}`,n={replace:!0};t.paginate||(n.state={doNotScroll:!0}),Xe(v.search+s,n)}D.current&&((a=document.getElementById(D.current))==null||a.scrollIntoView(),D.current=null)}},[c,u]),r.useEffect(()=>{var e;fe.current&&!t.paginate&&(d!=null&&d.match(/^#page(\d+)$/))&&(ge.current=!0,(e=document.getElementById(Be(d.slice(1))))==null||e.scrollIntoView())},[fe.current]),r.useEffect(()=>{var a,i,s,n,o;let e=!1;if(_.current!==v.key&&(((a=v.state)==null?void 0:a.previousScrollPosition)!==void 0&&_.current&&(W.current[_.current].lastScrollPosition=v.state.previousScrollPosition),W.current[v.key]&&(e=!0,((i=W.current[v.key])==null?void 0:i.lastScrollPosition)!==void 0&&qe.scroll({top:W.current[v.key].lastScrollPosition})),W.current[v.key]={...v},_.current=v.key),D.current=null,!((s=v.state)!=null&&s.doNotScroll)&&(v.key==="default"||!e)){let l=Be(d.slice(1));t.paginate&&d.match(/^#page(\d+)$/)&&(l="activityTop"),t.paginate&&Number((n=d.match(/^#page(\d+)/))==null?void 0:n[1])!==c?D.current=l:(o=document.getElementById(l))==null||o.scrollIntoView()}},[v]);const Ze=vt(({snapshot:e})=>async()=>await e.getPromise(Ie),[Ie]);function Re({changedOnDevice:e,newCid:a,newAttemptNumber:i}){console.log("resetActivity",e,a,i),i!==g?t.updateAttemptNumber?(x("Reverted activity as attempt number changed on other device",N.ERROR),t.updateAttemptNumber(i)):(t.setIsInErrorState&&t.setIsInErrorState(!0),I("how to reset attempt number when not given updateAttemptNumber function?")):a!==m&&(t.setIsInErrorState&&t.setIsInErrorState(!0),I("Content changed unexpectedly!"))}function et(){C?h?je(JSON.stringify(C)).then(e=>{if(e===h){H(h),Q.current=C;let a=ve(C);a.success?(X(a.activityJSON),w("continue")):(t.setIsInErrorState&&t.setIsInErrorState(!0),I(a.message))}else t.setIsInErrorState&&t.setIsInErrorState(!0),I(`activity definition did not match specified cid: ${h}`)}):je(JSON.stringify(C)).then(e=>{H(e),Q.current=C;let a=ve(C);a.success?(X(a.activityJSON),w("continue")):(t.setIsInErrorState&&t.setIsInErrorState(!0),I(a.message))}):yt(h,"doenet").then(e=>{H(h),Q.current=e;let a=ve(e);a.success?(X(a.activityJSON),w("continue")):(t.setIsInErrorState&&t.setIsInErrorState(!0),I(a.message))}).catch(e=>{t.setIsInErrorState&&t.setIsInErrorState(!0),I(`activity definition not found for cid: ${h}`)})}async function tt(){let e=!1,a,i,s=!1;if(t.flags.allowLocalState){let n;try{n=await Je(`${t.doenetId}|${g}|${m}`)}catch{}if(n){if(t.flags.allowSaveState){let l=await at(n);if(l.changedOnDevice){if(Number(l.newAttemptNumber)!==g){Re({changedOnDevice:l.changedOnDevice,newCid:l.newCid,newAttemptNumber:Number(l.newAttemptNumber)});return}else l.newCid!==m&&(t.setIsInErrorState&&t.setIsInErrorState(!0),I("content changed unexpectedly!"));n=l.newLocalInfo}}ce.current=n.saveId,d!=null&&d.match(/^#page(\d+)/)||(E(n.activityState.currentPage),R(n.activityState.currentPage));let o=n.activityInfo;i=n.variantIndex,Z(i),ie(o.orderWithCids.length),ae(o.orderWithCids),re(o.variantsByPage),oe(o.itemWeights),a=o.itemWeights,$.current=o.previousComponentTypeCounts||[],y.current=o,z.current=JSON.stringify(y.current),e=!0}}if(!e){const n={params:{cid:m,attemptNumber:g,doenetId:t.doenetId,userId:t.userId,allowLoadState:t.flags.allowLoadState}};let o;try{if(o=await p.get("/api/loadActivityState.php",n),!o.data.success&&t.flags.allowLoadState){t.setIsInErrorState&&t.setIsInErrorState(!0),I(`Error loading activity state: ${o.data.message}`);return}}catch(l){if(t.flags.allowLoadState){t.setIsInErrorState&&t.setIsInErrorState(!0),I(`Error loading activity state: ${l.message}`);return}}if(o.data.loadedState){let l=JSON.parse(o.data.activityInfo),De=JSON.parse(o.data.activityState);d!=null&&d.match(/^#page(\d+)/)||(E(De.currentPage),R(De.currentPage)),i=o.data.variantIndex,Z(i),ie(l.orderWithCids.length),ae(l.orderWithCids),re(l.variantsByPage),oe(l.itemWeights),a=l.itemWeights,$.current=l.previousComponentTypeCounts||[],y.current=l,z.current=JSON.stringify(y.current)}else{s=!0,d!=null&&d.match(/^#page(\d+)/)||(E(1),R(1));let l;if(l=await Ct({activityDefinition:P,requestedVariantIndex:L}),!l.success){t.setIsInErrorState&&t.setIsInErrorState(!0),I(`Error initializing activity state: ${l.message}`);return}i=l.variantIndex,Z(i),ie(l.order.length),ae(l.order),re(l.variantsByPage),oe(l.itemWeights),a=l.itemWeights,$.current=l.previousComponentTypeCounts||[],y.current=l.activityInfo,z.current=JSON.stringify(y.current)}}return{newItemWeights:a,newVariantIndex:i,loadedFromInitialState:s}}async function at(e){let a=await Je(`${t.doenetId}|${g}|${m}|ServerSaveId`),i={cid:m,activityInfo:JSON.stringify(e.activityInfo),activityState:JSON.stringify(e.activityState),variantIndex:e.variantIndex,attemptNumber:g,doenetId:t.doenetId,saveId:e.saveId,serverSaveId:a,updateDataOnContentChange:t.updateDataOnContentChange},s;try{console.log("first one saveActivityState activityStateToBeSavedToDatabase",i),s=await p.post("/api/saveActivityState.php",i)}catch{return{localInfo:e,cid:m,attemptNumber:g}}s.data.cidChanged===!0&&t.cidChangedCallback();let n=s.data;if(!n.success)return{localInfo:e,cid:m,attemptNumber:g};if(await K(`${t.doenetId}|${g}|${m}|ServerSaveId`,n.saveId),n.stateOverwritten){let o={activityState:JSON.parse(n.activityState),activityInfo:JSON.parse(n.activityInfo),saveId:n.saveId,variantIndex:n.variantIndex};return await K(`${t.doenetId}|${n.attemptNumber}|${n.cid}`,o),{changedOnDevice:n.device,newLocalInfo:o,newCid:n.cid,newAttemptNumber:n.attemptNumber}}return{localInfo:e,cid:m,attemptNumber:g}}async function U({overrideThrottle:e=!1,overrideStage:a=!1}={}){if(!t.flags.allowSaveState&&!t.flags.allowLocalState||Se.current!=="saving"&&!a||!e&&b.current===be.current||e&&b.current===Ae.current)return;be.current=b.current;let i=Le();t.flags.allowLocalState&&await K(`${t.doenetId}|${k.current}|${O.current}`,{activityInfo:y.current,activityState:{currentPage:b.current},saveId:i,variantIndex:ee.current}),t.flags.allowSaveState&&(le.current={cid:O.current,activityInfo:z.current,activityState:JSON.stringify({currentPage:b.current}),variantIndex:ee.current,attemptNumber:k.current,doenetId:t.doenetId,saveId:i,serverSaveId:ce.current,updateDataOnContentChange:t.updateDataOnContentChange},ue.current=!0,await pe(e))}async function pe(e){if(!ue.current)return;let a=await Ze();if(a!==null)if(e)clearTimeout(a);else return;ue.current=!1,Ae.current=b.current;let i=setTimeout(()=>{we(null),pe()},6e4);we(i);let s;try{console.log("activity state params",le.current),s=await p.post("/api/saveActivityState.php",le.current)}catch{console.log("sending toast: Error synchronizing data. Changes not saved to the server."),x("Error synchronizing data. Changes not saved to the server.",N.ERROR);return}if(console.log("result from saving activity to database:",s.data),s.status===null){console.log("sending toast: Error synchronizing data. Changes not saved to the server. Are you connected to the internet?"),x("Error synchronizing data. Changes not saved to the server. Are you connected to the internet?",N.ERROR);return}let n=s.data;if(!n.success){console.log(`sending toast: ${n.message}`),x(n.message,N.ERROR);return}if(ce.current=n.saveId,t.flags.allowLocalState&&await K(`${t.doenetId}|${k.current}|${O.current}|ServerSaveId`,n.saveId),n.stateOverwritten){if(k.current!==Number(n.attemptNumber))Re({changedOnDevice:n.device,newCid:n.cid,newAttemptNumber:Number(n.attemptNumber)});else if(O.current!==n.cid){t.setIsInErrorState&&t.setIsInErrorState(!0),I("Content changed unexpectedly!");return}}}async function nt(e){if(ne.allowSaveSubmissions)try{let a=await p.post("/api/initAssignmentAttempt.php",{doenetId:t.doenetId,weights:e,attemptNumber:g});a.status===null?x("Could not initialize assignment tables. Are you connected to the internet?",N.ERROR):a.data.success||x(`Could not initialize assignment tables: ${a.data.message}.`,N.ERROR)}catch(a){x(`Could not initialize assignment tables: ${a.message}.`,N.ERROR)}}async function it(){j!=="saving"&&!te.current&&w("saving");try{(await p.get("/api/checkForChangedAssignment.php",{params:{currentCid:m,doenetId:t.doenetId}})).data.cidChanged===!0&&t.cidChangedCallback()}catch{}xe.current&&await U({overrideThrottle:!0,overrideStage:!0})}function Ne(){E(a=>Math.min(u,a+1)),R(a=>Math.min(u,a+1));let e={verb:"interacted",object:{objectType:"button",objectname:"next page button"},result:{newPage:Math.min(u,c+1)},context:{oldPage:c}};ke(e)}function Te(){E(a=>Math.max(1,a-1)),R(a=>Math.max(1,a-1));let e={verb:"interacted",object:{objectType:"button",objectname:"previous page button"},result:{newPage:Math.max(1,c-1)},context:{oldPage:c}};ke(e)}function ke(e){if(!ne.allowSaveEvents)return;const a={doenetId:t.doenetId,activityCid:m,attemptNumber:g,activityVariantIndex:V,timestamp:new Date().toISOString().slice(0,19).replace("T"," "),version:"0.1.1",verb:e.verb,object:JSON.stringify(e.object),result:JSON.stringify(e.result),context:JSON.stringify(e.context)};p.post("/api/recordEvent.php",a).then(i=>{}).catch(i=>{console.error(`Error saving event: ${i.message}`)})}function rt(e,a){t.paginate||de(i=>{let s={...i},n=[...s.pageIsVisible];if(n[a]=e,s.pageIsVisible=n,!e&&s.pageIsActive[a]){let o=[...s.pageIsActive];o[a]=!1,s.pageIsActive=o,s.waitingForPagesCore===a&&(s.waitingForPagesCore=null)}return s})}function st(e,a){de(i=>{let s={...i};s.waitingForPagesCore===e&&(s.waitingForPagesCore=null);let n=[...s.pageCoreWorker];return n[e]=a,s.pageCoreWorker=n,s})}function ot(e){let a;Ye(i=>(a=[...i],a[e]=!0,a)),(a==null?void 0:a.length)===u&&a.every(i=>i)&&(fe.current=!0)}async function ct(){Qe(!0);let e=[];for(let i of S.pageCoreWorker)if(i){let s=Le(),n;e.push(new Promise((o,l)=>{n=o})),i.onmessage=function(o){o.data.messageType==="resolveAction"&&o.data.args.actionId===s?i.postMessage({messageType:"terminate"}):o.data.messageType==="terminated"&&n()},i.postMessage({messageType:"submitAllAnswers",args:{actionId:s}})}await Promise.all(e),await U({overrideThrottle:!0}),y.canViewAfterCompleted,(await p.get("/api/saveCompleted.php",{params:{doenetId:t.doenetId,isCompleted:!0}})).data.success&&(t==null||t.setActivityAsCompleted(),Me(i=>({page:i.page,tool:"endExam",view:"",params:{doenetId:t.doenetId,attemptNumber:g,itemWeights:se.join(",")}})))}if(ye!==null)return A("div",{style:{fontSize:"1.3em",marginLeft:"20px",marginTop:"20px"},children:[f("span",{style:{fontSize:"1em",color:"#C1292E"},children:f(St,{icon:ht})})," ",ye]});if(S.waitingForPagesCore===null&&c){for(let e of[c-1,...Array(u).keys()])if((S.pageIsVisible[e]||c===e+1)&&!S.pageIsActive[e]){let i=!S.pageCoreWorker[e];if(de(s=>{let n={...s},o=[...n.pageIsActive];return o[e]=!0,n.pageIsActive=o,n.pageCoreWorker[e]||(n.waitingForPagesCore=e),n}),i)break}}let B=t.attemptNumber;B===void 0&&(B=1);let q=t.requestedVariantIndex;if(q===void 0&&(q=B),C!==t.activityDefinition||h!==t.cid||B!==g||L!==q)return te.current=!0,ze({activityDefinitionFromProps:t.activityDefinition,cidFromProps:t.cid,attemptNumber:B,requestedVariantIndex:q}),w("recalcParams"),he(!0),null;if(j==="wait")return null;if(j==="recalcParams")return w("wait"),et(),null;if(((Fe=P==null?void 0:P.type)==null?void 0:Fe.toLowerCase())!=="activity")return t.setIsInErrorState&&t.setIsInErrorState(!0),I("Invalid activity definition: type is not activity"),null;if(_e)return he(!1),Ce(0),$.current=[],w("wait"),tt().then(async e=>{var a;e&&(e.loadedFromInitialState&&await nt(e.newItemWeights),w("continue"),Ce(g),(a=t.generatedVariantCallback)==null||a.call(t,e.newVariantIndex,y.current.numberOfVariants)),te.current=!1}),null;U();let lt=f("h1",{children:P.title}),Oe=[];if(J&&M)for(let[e,a]of J.entries()){let i=!1;t.paginate?(e===c-1||S.pageCoreWorker[c-1]&&e===c||S.pageCoreWorker[c-1]&&(c===u||S.pageCoreWorker[c])&&e===c-2)&&(i=!0):i=S.pageIsActive[e];let s=u>1?`page${e+1}`:"",n=f(It,{userId:t.userId,doenetId:t.doenetId,activityCid:m,cid:a.cid,doenetML:a.doenetML,pageNumber:(e+1).toString(),previousComponentTypeCounts:$.current[e],pageIsActive:i,pageIsCurrent:e===c-1,itemNumber:e+1,attemptNumber:g,forceDisable:t.forceDisable,forceShowCorrectness:t.forceShowCorrectness,forceShowSolution:t.forceShowSolution,forceUnsuppressCheckwork:t.forceUnsuppressCheckwork,flags:ne,activityVariantIndex:V,requestedVariantIndex:M[e],unbundledCore:t.unbundledCore,updateCreditAchievedCallback:t.updateCreditAchievedCallback,setIsInErrorState:t.setIsInErrorState,updateAttemptNumber:t.updateAttemptNumber,saveStateCallback:it,updateDataOnContentChange:t.updateDataOnContentChange,coreCreatedCallback:o=>st(e,o),renderersInitializedCallback:()=>ot(e),hideWhenNotCurrent:t.paginate,prefixForIds:s});t.paginate||(n=f(wt,{partialVisibility:!0,offset:{top:-200,bottom:-200},requireContentsSize:!1,onChange:o=>rt(o,e),children:f("div",{children:n})})),Oe.push(f("div",{id:`page${e+1}`,children:n},`page${e+1}`))}let Ve=null,$e=null;t.paginate&&u>1&&(Ve=A("div",{style:{display:"flex",alignItems:"center",marginLeft:"5px"},children:[f(T,{dataTest:"previous",disabled:c===1,onClick:Te,value:"Previous page"}),A("p",{style:{margin:"5px"},children:[" Page ",c," of ",u," "]}),f(T,{dataTest:"next",disabled:c===u,onClick:Ne,value:"Next page"})]}),Ke[c-1]&&($e=A("div",{style:{display:"flex",alignItems:"center",marginLeft:"5px"},children:[f(T,{dataTest:"previous-bottom",disabled:c===1,onClick:Te,value:"Previous page"}),A("p",{style:{margin:"5px"},children:[" Page ",c," of ",u," "]}),f(T,{dataTest:"next-bottom",disabled:c===u,onClick:Ne,value:"Next page"})]})));let me=null;return t.showFinishButton&&(He?me=A("div",{style:{marginLeft:"1px",marginRight:"5px",marginBottom:"5px",marginTop:"80px",border:"var(--mainBorder)",borderRadius:"var(--mainBorderRadius)",padding:"5px",display:"flex",flexFlow:"column wrap"},children:[f("div",{style:{display:"flex",justifyContent:"center",padding:"5px"},children:"Are you sure you want to finish this assessment?"}),f("div",{style:{display:"flex",justifyContent:"center",padding:"5px"},children:A(At,{children:[f(T,{onClick:ct,dataTest:"ConfirmFinishAssessment",value:"Yes",disabled:Ee}),f(T,{onClick:()=>Pe(!1),dataTest:"CancelFinishAssessment",value:"No",alert:!0,disabled:Ee})]})})]}):me=f("div",{style:{marginLeft:"1px",marginRight:"5px",marginBottom:"5px",marginTop:"80px"},children:f("div",{"data-test":"centerone",style:{display:"flex",justifyContent:"center"},children:f("div",{style:{width:"240px"},children:f(bt,{onClick:()=>Pe(!0),"data-test":"FinishAssessmentPrompt",value:"Finish assessment"})})})})),A("div",{style:{paddingBottom:"50vh"},id:"activityTop",ref:F,children:[Ve,lt,Oe,$e,me]})}export{Ot as A,Pt as a,xt as c,Et as i,Ie as s}; +import{y as ut,R as G,p as dt,r,g as We,ab as ft,u as gt,e as mt,ad as Be,v as vt,ae as Le,af as K,k as p,z as N,a as A,j as f,P as It,ag as Y,ah as je,ac as yt,ai as Je,i as St,aj as ht,B as T}from"./index-7074710c.js";import{p as ve,c as Ct}from"./activityUtils-9c5f1536.js";import{V as wt}from"./visibility-sensor-7d414852.js";import{A as bt}from"./ActionButton-e5ea2a2f.js";import{B as At}from"./ButtonGroup-9136da6d.js";const Ie=Y({key:"saveStateToDBTimerIdAtom",default:null}),xt=Y({key:"currentPageAtom",default:0}),Pt=Y({key:"activityAttemptNumberSetUpAtom",default:0}),Et=Y({key:"itemWeightsAtom",default:[]});function Ot(t){var Fe;const x=ut(),Me=G(dt),[ye,I]=r.useState(null),[{cidFromProps:h,activityDefinitionFromProps:C,attemptNumber:g,requestedVariantIndex:L},ze]=r.useState({cidFromProps:null,activityDefinitionFromProps:null,attemptNumber:null,requestedVariantIndex:null}),k=r.useRef(null);k.current=g;const[m,H]=r.useState(null),O=r.useRef(null);O.current=m;const Q=r.useRef(null),[P,X]=r.useState(null),[V,Z]=r.useState(null),ee=r.useRef(null);ee.current=V;const[j,w]=r.useState("initial"),Se=r.useRef(null);Se.current=j;const te=r.useRef(!0),[_e,he]=r.useState(!1),[J,ae]=r.useState(null),[ne,Ue]=r.useState(t.flags),[c,E]=r.useState(0),R=G(xt),b=r.useRef(c);b.current=c;const Ce=G(Pt),[u,ie]=r.useState(0),[M,re]=r.useState(null),[se,oe]=We(Et),$=r.useRef([]),ce=r.useRef(null),le=r.useRef(null),ue=r.useRef(!1),we=G(Ie),[qe,Ge]=We(ft),y=r.useRef(null),z=r.useRef(null),be=r.useRef(null),Ae=r.useRef(null),[S,de]=r.useState({pageIsVisible:[],pageIsActive:[],pageCoreWorker:[],waitingForPagesCore:null}),[Ke,Ye]=r.useState([]),fe=r.useRef(!1),F=r.useRef(null),ge=r.useRef(!1),D=r.useRef(null);let v=gt(),d=v.hash;const W=r.useRef({}),_=r.useRef(null),xe=r.useRef(!1),[He,Pe]=r.useState(!1),[Ee,Qe]=r.useState(!1);let Xe=mt();r.useEffect(()=>()=>{U({overrideThrottle:!0}),xe.current=!0},[]),r.useEffect(()=>{let e={...t.flags};t.userId?(e.allowLocalState=!1,e.allowSaveState=!1):e.allowSaveState&&(e.allowLoadState=!0),Ue(e)},[t.userId,t.flags]),r.useEffect(()=>{window.returnActivityData=function(){return{activityDefinition:P,requestedVariantIndex:L,variantIndex:V,cid:m,order:J,currentPage:c,nPages:u,variantsByPage:M,itemWeights:se}}},[P,L,V,m,J,c,u,M,se]),r.useEffect(()=>{if(F.current){let e=F.current.parentNode.id==="mainPanel"?F.current.parentNode:window;Ge(e),!t.paginate&&u>1&&e.addEventListener("scroll",a=>{if(ge.current)ge.current=!1;else{let i;for(let s=0;s{var e;(e=t.pageChangedCallback)==null||e.call(t,c)},[c]),r.useEffect(()=>{if(d&&u){let e=d.match(/^#page(\d+)/);if(e){let a=Math.max(1,Math.min(u,e[1]));a!==c&&(E(a),R(a))}}},[d,u]),r.useEffect(()=>{var e,a;if(c>0&&u>1){if(Number((e=d==null?void 0:d.match(/^#page(\d+)/))==null?void 0:e[1])!==c){let s=`#page${c}`,n={replace:!0};t.paginate||(n.state={doNotScroll:!0}),Xe(v.search+s,n)}D.current&&((a=document.getElementById(D.current))==null||a.scrollIntoView(),D.current=null)}},[c,u]),r.useEffect(()=>{var e;fe.current&&!t.paginate&&(d!=null&&d.match(/^#page(\d+)$/))&&(ge.current=!0,(e=document.getElementById(Be(d.slice(1))))==null||e.scrollIntoView())},[fe.current]),r.useEffect(()=>{var a,i,s,n,o;let e=!1;if(_.current!==v.key&&(((a=v.state)==null?void 0:a.previousScrollPosition)!==void 0&&_.current&&(W.current[_.current].lastScrollPosition=v.state.previousScrollPosition),W.current[v.key]&&(e=!0,((i=W.current[v.key])==null?void 0:i.lastScrollPosition)!==void 0&&qe.scroll({top:W.current[v.key].lastScrollPosition})),W.current[v.key]={...v},_.current=v.key),D.current=null,!((s=v.state)!=null&&s.doNotScroll)&&(v.key==="default"||!e)){let l=Be(d.slice(1));t.paginate&&d.match(/^#page(\d+)$/)&&(l="activityTop"),t.paginate&&Number((n=d.match(/^#page(\d+)/))==null?void 0:n[1])!==c?D.current=l:(o=document.getElementById(l))==null||o.scrollIntoView()}},[v]);const Ze=vt(({snapshot:e})=>async()=>await e.getPromise(Ie),[Ie]);function Re({changedOnDevice:e,newCid:a,newAttemptNumber:i}){console.log("resetActivity",e,a,i),i!==g?t.updateAttemptNumber?(x("Reverted activity as attempt number changed on other device",N.ERROR),t.updateAttemptNumber(i)):(t.setIsInErrorState&&t.setIsInErrorState(!0),I("how to reset attempt number when not given updateAttemptNumber function?")):a!==m&&(t.setIsInErrorState&&t.setIsInErrorState(!0),I("Content changed unexpectedly!"))}function et(){C?h?je(JSON.stringify(C)).then(e=>{if(e===h){H(h),Q.current=C;let a=ve(C);a.success?(X(a.activityJSON),w("continue")):(t.setIsInErrorState&&t.setIsInErrorState(!0),I(a.message))}else t.setIsInErrorState&&t.setIsInErrorState(!0),I(`activity definition did not match specified cid: ${h}`)}):je(JSON.stringify(C)).then(e=>{H(e),Q.current=C;let a=ve(C);a.success?(X(a.activityJSON),w("continue")):(t.setIsInErrorState&&t.setIsInErrorState(!0),I(a.message))}):yt(h,"doenet").then(e=>{H(h),Q.current=e;let a=ve(e);a.success?(X(a.activityJSON),w("continue")):(t.setIsInErrorState&&t.setIsInErrorState(!0),I(a.message))}).catch(e=>{t.setIsInErrorState&&t.setIsInErrorState(!0),I(`activity definition not found for cid: ${h}`)})}async function tt(){let e=!1,a,i,s=!1;if(t.flags.allowLocalState){let n;try{n=await Je(`${t.doenetId}|${g}|${m}`)}catch{}if(n){if(t.flags.allowSaveState){let l=await at(n);if(l.changedOnDevice){if(Number(l.newAttemptNumber)!==g){Re({changedOnDevice:l.changedOnDevice,newCid:l.newCid,newAttemptNumber:Number(l.newAttemptNumber)});return}else l.newCid!==m&&(t.setIsInErrorState&&t.setIsInErrorState(!0),I("content changed unexpectedly!"));n=l.newLocalInfo}}ce.current=n.saveId,d!=null&&d.match(/^#page(\d+)/)||(E(n.activityState.currentPage),R(n.activityState.currentPage));let o=n.activityInfo;i=n.variantIndex,Z(i),ie(o.orderWithCids.length),ae(o.orderWithCids),re(o.variantsByPage),oe(o.itemWeights),a=o.itemWeights,$.current=o.previousComponentTypeCounts||[],y.current=o,z.current=JSON.stringify(y.current),e=!0}}if(!e){const n={params:{cid:m,attemptNumber:g,doenetId:t.doenetId,userId:t.userId,allowLoadState:t.flags.allowLoadState}};let o;try{if(o=await p.get("/api/loadActivityState.php",n),!o.data.success&&t.flags.allowLoadState){t.setIsInErrorState&&t.setIsInErrorState(!0),I(`Error loading activity state: ${o.data.message}`);return}}catch(l){if(t.flags.allowLoadState){t.setIsInErrorState&&t.setIsInErrorState(!0),I(`Error loading activity state: ${l.message}`);return}}if(o.data.loadedState){let l=JSON.parse(o.data.activityInfo),De=JSON.parse(o.data.activityState);d!=null&&d.match(/^#page(\d+)/)||(E(De.currentPage),R(De.currentPage)),i=o.data.variantIndex,Z(i),ie(l.orderWithCids.length),ae(l.orderWithCids),re(l.variantsByPage),oe(l.itemWeights),a=l.itemWeights,$.current=l.previousComponentTypeCounts||[],y.current=l,z.current=JSON.stringify(y.current)}else{s=!0,d!=null&&d.match(/^#page(\d+)/)||(E(1),R(1));let l;if(l=await Ct({activityDefinition:P,requestedVariantIndex:L}),!l.success){t.setIsInErrorState&&t.setIsInErrorState(!0),I(`Error initializing activity state: ${l.message}`);return}i=l.variantIndex,Z(i),ie(l.order.length),ae(l.order),re(l.variantsByPage),oe(l.itemWeights),a=l.itemWeights,$.current=l.previousComponentTypeCounts||[],y.current=l.activityInfo,z.current=JSON.stringify(y.current)}}return{newItemWeights:a,newVariantIndex:i,loadedFromInitialState:s}}async function at(e){let a=await Je(`${t.doenetId}|${g}|${m}|ServerSaveId`),i={cid:m,activityInfo:JSON.stringify(e.activityInfo),activityState:JSON.stringify(e.activityState),variantIndex:e.variantIndex,attemptNumber:g,doenetId:t.doenetId,saveId:e.saveId,serverSaveId:a,updateDataOnContentChange:t.updateDataOnContentChange},s;try{console.log("first one saveActivityState activityStateToBeSavedToDatabase",i),s=await p.post("/api/saveActivityState.php",i)}catch{return{localInfo:e,cid:m,attemptNumber:g}}s.data.cidChanged===!0&&t.cidChangedCallback();let n=s.data;if(!n.success)return{localInfo:e,cid:m,attemptNumber:g};if(await K(`${t.doenetId}|${g}|${m}|ServerSaveId`,n.saveId),n.stateOverwritten){let o={activityState:JSON.parse(n.activityState),activityInfo:JSON.parse(n.activityInfo),saveId:n.saveId,variantIndex:n.variantIndex};return await K(`${t.doenetId}|${n.attemptNumber}|${n.cid}`,o),{changedOnDevice:n.device,newLocalInfo:o,newCid:n.cid,newAttemptNumber:n.attemptNumber}}return{localInfo:e,cid:m,attemptNumber:g}}async function U({overrideThrottle:e=!1,overrideStage:a=!1}={}){if(!t.flags.allowSaveState&&!t.flags.allowLocalState||Se.current!=="saving"&&!a||!e&&b.current===be.current||e&&b.current===Ae.current)return;be.current=b.current;let i=Le();t.flags.allowLocalState&&await K(`${t.doenetId}|${k.current}|${O.current}`,{activityInfo:y.current,activityState:{currentPage:b.current},saveId:i,variantIndex:ee.current}),t.flags.allowSaveState&&(le.current={cid:O.current,activityInfo:z.current,activityState:JSON.stringify({currentPage:b.current}),variantIndex:ee.current,attemptNumber:k.current,doenetId:t.doenetId,saveId:i,serverSaveId:ce.current,updateDataOnContentChange:t.updateDataOnContentChange},ue.current=!0,await pe(e))}async function pe(e){if(!ue.current)return;let a=await Ze();if(a!==null)if(e)clearTimeout(a);else return;ue.current=!1,Ae.current=b.current;let i=setTimeout(()=>{we(null),pe()},6e4);we(i);let s;try{console.log("activity state params",le.current),s=await p.post("/api/saveActivityState.php",le.current)}catch{console.log("sending toast: Error synchronizing data. Changes not saved to the server."),x("Error synchronizing data. Changes not saved to the server.",N.ERROR);return}if(console.log("result from saving activity to database:",s.data),s.status===null){console.log("sending toast: Error synchronizing data. Changes not saved to the server. Are you connected to the internet?"),x("Error synchronizing data. Changes not saved to the server. Are you connected to the internet?",N.ERROR);return}let n=s.data;if(!n.success){console.log(`sending toast: ${n.message}`),x(n.message,N.ERROR);return}if(ce.current=n.saveId,t.flags.allowLocalState&&await K(`${t.doenetId}|${k.current}|${O.current}|ServerSaveId`,n.saveId),n.stateOverwritten){if(k.current!==Number(n.attemptNumber))Re({changedOnDevice:n.device,newCid:n.cid,newAttemptNumber:Number(n.attemptNumber)});else if(O.current!==n.cid){t.setIsInErrorState&&t.setIsInErrorState(!0),I("Content changed unexpectedly!");return}}}async function nt(e){if(ne.allowSaveSubmissions)try{let a=await p.post("/api/initAssignmentAttempt.php",{doenetId:t.doenetId,weights:e,attemptNumber:g});a.status===null?x("Could not initialize assignment tables. Are you connected to the internet?",N.ERROR):a.data.success||x(`Could not initialize assignment tables: ${a.data.message}.`,N.ERROR)}catch(a){x(`Could not initialize assignment tables: ${a.message}.`,N.ERROR)}}async function it(){j!=="saving"&&!te.current&&w("saving");try{(await p.get("/api/checkForChangedAssignment.php",{params:{currentCid:m,doenetId:t.doenetId}})).data.cidChanged===!0&&t.cidChangedCallback()}catch{}xe.current&&await U({overrideThrottle:!0,overrideStage:!0})}function Ne(){E(a=>Math.min(u,a+1)),R(a=>Math.min(u,a+1));let e={verb:"interacted",object:{objectType:"button",objectname:"next page button"},result:{newPage:Math.min(u,c+1)},context:{oldPage:c}};ke(e)}function Te(){E(a=>Math.max(1,a-1)),R(a=>Math.max(1,a-1));let e={verb:"interacted",object:{objectType:"button",objectname:"previous page button"},result:{newPage:Math.max(1,c-1)},context:{oldPage:c}};ke(e)}function ke(e){if(!ne.allowSaveEvents)return;const a={doenetId:t.doenetId,activityCid:m,attemptNumber:g,activityVariantIndex:V,timestamp:new Date().toISOString().slice(0,19).replace("T"," "),version:"0.1.1",verb:e.verb,object:JSON.stringify(e.object),result:JSON.stringify(e.result),context:JSON.stringify(e.context)};p.post("/api/recordEvent.php",a).then(i=>{}).catch(i=>{console.error(`Error saving event: ${i.message}`)})}function rt(e,a){t.paginate||de(i=>{let s={...i},n=[...s.pageIsVisible];if(n[a]=e,s.pageIsVisible=n,!e&&s.pageIsActive[a]){let o=[...s.pageIsActive];o[a]=!1,s.pageIsActive=o,s.waitingForPagesCore===a&&(s.waitingForPagesCore=null)}return s})}function st(e,a){de(i=>{let s={...i};s.waitingForPagesCore===e&&(s.waitingForPagesCore=null);let n=[...s.pageCoreWorker];return n[e]=a,s.pageCoreWorker=n,s})}function ot(e){let a;Ye(i=>(a=[...i],a[e]=!0,a)),(a==null?void 0:a.length)===u&&a.every(i=>i)&&(fe.current=!0)}async function ct(){Qe(!0);let e=[];for(let i of S.pageCoreWorker)if(i){let s=Le(),n;e.push(new Promise((o,l)=>{n=o})),i.onmessage=function(o){o.data.messageType==="resolveAction"&&o.data.args.actionId===s?i.postMessage({messageType:"terminate"}):o.data.messageType==="terminated"&&n()},i.postMessage({messageType:"submitAllAnswers",args:{actionId:s}})}await Promise.all(e),await U({overrideThrottle:!0}),y.canViewAfterCompleted,(await p.get("/api/saveCompleted.php",{params:{doenetId:t.doenetId,isCompleted:!0}})).data.success&&(t==null||t.setActivityAsCompleted(),Me(i=>({page:i.page,tool:"endExam",view:"",params:{doenetId:t.doenetId,attemptNumber:g,itemWeights:se.join(",")}})))}if(ye!==null)return A("div",{style:{fontSize:"1.3em",marginLeft:"20px",marginTop:"20px"},children:[f("span",{style:{fontSize:"1em",color:"#C1292E"},children:f(St,{icon:ht})})," ",ye]});if(S.waitingForPagesCore===null&&c){for(let e of[c-1,...Array(u).keys()])if((S.pageIsVisible[e]||c===e+1)&&!S.pageIsActive[e]){let i=!S.pageCoreWorker[e];if(de(s=>{let n={...s},o=[...n.pageIsActive];return o[e]=!0,n.pageIsActive=o,n.pageCoreWorker[e]||(n.waitingForPagesCore=e),n}),i)break}}let B=t.attemptNumber;B===void 0&&(B=1);let q=t.requestedVariantIndex;if(q===void 0&&(q=B),C!==t.activityDefinition||h!==t.cid||B!==g||L!==q)return te.current=!0,ze({activityDefinitionFromProps:t.activityDefinition,cidFromProps:t.cid,attemptNumber:B,requestedVariantIndex:q}),w("recalcParams"),he(!0),null;if(j==="wait")return null;if(j==="recalcParams")return w("wait"),et(),null;if(((Fe=P==null?void 0:P.type)==null?void 0:Fe.toLowerCase())!=="activity")return t.setIsInErrorState&&t.setIsInErrorState(!0),I("Invalid activity definition: type is not activity"),null;if(_e)return he(!1),Ce(0),$.current=[],w("wait"),tt().then(async e=>{var a;e&&(e.loadedFromInitialState&&await nt(e.newItemWeights),w("continue"),Ce(g),(a=t.generatedVariantCallback)==null||a.call(t,e.newVariantIndex,y.current.numberOfVariants)),te.current=!1}),null;U();let lt=f("h1",{children:P.title}),Oe=[];if(J&&M)for(let[e,a]of J.entries()){let i=!1;t.paginate?(e===c-1||S.pageCoreWorker[c-1]&&e===c||S.pageCoreWorker[c-1]&&(c===u||S.pageCoreWorker[c])&&e===c-2)&&(i=!0):i=S.pageIsActive[e];let s=u>1?`page${e+1}`:"",n=f(It,{userId:t.userId,doenetId:t.doenetId,activityCid:m,cid:a.cid,doenetML:a.doenetML,pageNumber:(e+1).toString(),previousComponentTypeCounts:$.current[e],pageIsActive:i,pageIsCurrent:e===c-1,itemNumber:e+1,attemptNumber:g,forceDisable:t.forceDisable,forceShowCorrectness:t.forceShowCorrectness,forceShowSolution:t.forceShowSolution,forceUnsuppressCheckwork:t.forceUnsuppressCheckwork,flags:ne,activityVariantIndex:V,requestedVariantIndex:M[e],unbundledCore:t.unbundledCore,updateCreditAchievedCallback:t.updateCreditAchievedCallback,setIsInErrorState:t.setIsInErrorState,updateAttemptNumber:t.updateAttemptNumber,saveStateCallback:it,updateDataOnContentChange:t.updateDataOnContentChange,coreCreatedCallback:o=>st(e,o),renderersInitializedCallback:()=>ot(e),hideWhenNotCurrent:t.paginate,prefixForIds:s});t.paginate||(n=f(wt,{partialVisibility:!0,offset:{top:-200,bottom:-200},requireContentsSize:!1,onChange:o=>rt(o,e),children:f("div",{children:n})})),Oe.push(f("div",{id:`page${e+1}`,children:n},`page${e+1}`))}let Ve=null,$e=null;t.paginate&&u>1&&(Ve=A("div",{style:{display:"flex",alignItems:"center",marginLeft:"5px"},children:[f(T,{dataTest:"previous",disabled:c===1,onClick:Te,value:"Previous page"}),A("p",{style:{margin:"5px"},children:[" Page ",c," of ",u," "]}),f(T,{dataTest:"next",disabled:c===u,onClick:Ne,value:"Next page"})]}),Ke[c-1]&&($e=A("div",{style:{display:"flex",alignItems:"center",marginLeft:"5px"},children:[f(T,{dataTest:"previous-bottom",disabled:c===1,onClick:Te,value:"Previous page"}),A("p",{style:{margin:"5px"},children:[" Page ",c," of ",u," "]}),f(T,{dataTest:"next-bottom",disabled:c===u,onClick:Ne,value:"Next page"})]})));let me=null;return t.showFinishButton&&(He?me=A("div",{style:{marginLeft:"1px",marginRight:"5px",marginBottom:"5px",marginTop:"80px",border:"var(--mainBorder)",borderRadius:"var(--mainBorderRadius)",padding:"5px",display:"flex",flexFlow:"column wrap"},children:[f("div",{style:{display:"flex",justifyContent:"center",padding:"5px"},children:"Are you sure you want to finish this assessment?"}),f("div",{style:{display:"flex",justifyContent:"center",padding:"5px"},children:A(At,{children:[f(T,{onClick:ct,dataTest:"ConfirmFinishAssessment",value:"Yes",disabled:Ee}),f(T,{onClick:()=>Pe(!1),dataTest:"CancelFinishAssessment",value:"No",alert:!0,disabled:Ee})]})})]}):me=f("div",{style:{marginLeft:"1px",marginRight:"5px",marginBottom:"5px",marginTop:"80px"},children:f("div",{"data-test":"centerone",style:{display:"flex",justifyContent:"center"},children:f("div",{style:{width:"240px"},children:f(bt,{onClick:()=>Pe(!0),"data-test":"FinishAssessmentPrompt",value:"Finish assessment"})})})})),A("div",{style:{paddingBottom:"50vh"},id:"activityTop",ref:F,children:[Ve,lt,Oe,$e,me]})}export{Ot as A,Pt as a,xt as c,Et as i,Ie as s}; diff --git a/dist/assets/AddDriveItems-19632489.js b/dist/assets/AddDriveItems-1dc7de35.js similarity index 82% rename from dist/assets/AddDriveItems-19632489.js rename to dist/assets/AddDriveItems-1dc7de35.js index c291d9e653..2bfcdda84e 100644 --- a/dist/assets/AddDriveItems-19632489.js +++ b/dist/assets/AddDriveItems-1dc7de35.js @@ -1 +1 @@ -import{l as o,m as n,a6 as c,y as s,j as t,F as r,a as l,B as a}from"./index-99a56692.js";import{B as u}from"./ButtonGroup-ea123297.js";function v(){const d=o(n("courseId")),{create:e}=c(d),i=s();return t(r,{children:l(u,{vertical:!0,children:[t(a,{width:"menu",dataTest:"Add Activity Button",onClick:()=>e({itemType:"activity"},()=>{i("Activity Created!")}),value:"Add Activity",children:"Add Activity"}),t(a,{width:"menu",dataTest:"Add Collection Button",onClick:()=>e({itemType:"bank"},()=>{i("Collection Created!")}),value:"Add Collection"}),t(a,{width:"menu",dataTest:"Add Section Button",onClick:()=>e({itemType:"section"},()=>{i("Section Created!")}),value:"Add Section",children:"Add Section"})]})})}export{v as default}; +import{l as o,m as n,a6 as c,y as s,j as t,F as r,a as l,B as a}from"./index-7074710c.js";import{B as u}from"./ButtonGroup-9136da6d.js";function v(){const d=o(n("courseId")),{create:e}=c(d),i=s();return t(r,{children:l(u,{vertical:!0,children:[t(a,{width:"menu",dataTest:"Add Activity Button",onClick:()=>e({itemType:"activity"},()=>{i("Activity Created!")}),value:"Add Activity",children:"Add Activity"}),t(a,{width:"menu",dataTest:"Add Collection Button",onClick:()=>e({itemType:"bank"},()=>{i("Collection Created!")}),value:"Add Collection"}),t(a,{width:"menu",dataTest:"Add Section Button",onClick:()=>e({itemType:"section"},()=>{i("Section Created!")}),value:"Add Section",children:"Add Section"})]})})}export{v as default}; diff --git a/dist/assets/AssignmentBreadCrumb-1296ecc9.js b/dist/assets/AssignmentBreadCrumb-1296ecc9.js new file mode 100644 index 0000000000..5f42f7e9c7 --- /dev/null +++ b/dist/assets/AssignmentBreadCrumb-1296ecc9.js @@ -0,0 +1 @@ +import{l as a,w as u,m as i,j as s,r as c}from"./index-7074710c.js";import{B as d}from"./BreadCrumb-c4dbe368.js";import{u as b,a as C,b as p,g as f}from"./breadcrumbUtil-1e7f0dfb.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-06d28967.js";function v(){const r=a(u),o=a(i("doenetId")),e=b(),m=C(r),t=p(r,o),n=f({doenetId:o});return s(c.Suspense,{fallback:s("div",{children:"Loading Breadcrumb..."}),children:s(d,{crumbs:[e,m,...t,n],offset:226})})}export{v as default}; diff --git a/dist/assets/AssignmentBreadCrumb-321ce7e2.js b/dist/assets/AssignmentBreadCrumb-321ce7e2.js deleted file mode 100644 index 5d1917111e..0000000000 --- a/dist/assets/AssignmentBreadCrumb-321ce7e2.js +++ /dev/null @@ -1 +0,0 @@ -import{l as a,w as u,m as i,j as s,r as c}from"./index-99a56692.js";import{B as d}from"./BreadCrumb-c66b383a.js";import{u as b,a as C,b as p,g as f}from"./breadcrumbUtil-6dfe85b1.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-e81ca638.js";function v(){const r=a(u),o=a(i("doenetId")),e=b(),m=C(r),t=p(r,o),n=f({doenetId:o});return s(c.Suspense,{fallback:s("div",{children:"Loading Breadcrumb..."}),children:s(d,{crumbs:[e,m,...t,n],offset:226})})}export{v as default}; diff --git a/dist/assets/AssignmentInfoCap-5739ab74.js b/dist/assets/AssignmentInfoCap-34c7c068.js similarity index 90% rename from dist/assets/AssignmentInfoCap-5739ab74.js rename to dist/assets/AssignmentInfoCap-34c7c068.js index 69cfd33fe4..f16051d30b 100644 --- a/dist/assets/AssignmentInfoCap-5739ab74.js +++ b/dist/assets/AssignmentInfoCap-34c7c068.js @@ -1 +1 @@ -import{l as n,w as l,I as a,a as c,j as s}from"./index-99a56692.js";import{f as d,a as u}from"./util-85d105b8.js";import"./util-38d8e238.js";function b(){const t=n(l);let o=n(a(t));if(!o||Object.keys(o).length==0)return null;let e=o.color,i=o.image,r="course";return i!="none"&&(r=d(i),i="url(./drive_pictures/"+i+")"),e!="none"&&(r=u(e),e="#"+e),c("div",{children:[s("div",{style:{position:"relative",width:"100%",height:"165px",overflow:"hidden"},children:s("img",{"aria-label":r,style:{position:"absolute",width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundImage:i,backgroundColor:e}})}),s("b",{children:"Assignment"})]})}export{b as default}; +import{l as n,w as l,I as a,a as c,j as s}from"./index-7074710c.js";import{f as d,a as u}from"./util-85d105b8.js";import"./util-38d8e238.js";function b(){const t=n(l);let o=n(a(t));if(!o||Object.keys(o).length==0)return null;let e=o.color,i=o.image,r="course";return i!="none"&&(r=d(i),i="url(./drive_pictures/"+i+")"),e!="none"&&(r=u(e),e="#"+e),c("div",{children:[s("div",{style:{position:"relative",width:"100%",height:"165px",overflow:"hidden"},children:s("img",{"aria-label":r,style:{position:"absolute",width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundImage:i,backgroundColor:e}})}),s("b",{children:"Assignment"})]})}export{b as default}; diff --git a/dist/assets/AssignmentNewAttempt-bd7b8592.js b/dist/assets/AssignmentNewAttempt-d2b88afd.js similarity index 50% rename from dist/assets/AssignmentNewAttempt-bd7b8592.js rename to dist/assets/AssignmentNewAttempt-d2b88afd.js index 71030f1f3c..55b9bd2e55 100644 --- a/dist/assets/AssignmentNewAttempt-bd7b8592.js +++ b/dist/assets/AssignmentNewAttempt-d2b88afd.js @@ -1 +1 @@ -import{l as m,m as A,g as s,j as u,B as c,k as f}from"./index-99a56692.js";import{l as b}from"./CourseToolHandler-f517d0e5.js";import{numberOfAttemptsAllowedAdjustmentAtom as w,currentAttemptNumber as N,cidChangedAtom as g}from"./AssignmentViewer-f9c5976c.js";import"./index-ef9c2520.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-b3e258be.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-ea123297.js";import"./ActivityViewer-3a815948.js";import"./activityUtils-c08c1686.js";import"./visibility-sensor-55e75ed1.js";import"./ActionButton-f612d279.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";function q(){const o=m(A("doenetId")),[i,p]=s(w),[l,a]=s(N),{numberOfAttemptsAllowed:n}=m(b(o)),d=m(g);let e=null;n!==null&&(e=Number(n)+Number(i));const r=e===null||lt+1)}}})}export{q as default}; +import{l as m,m as A,g as s,j as u,B as c,k as f}from"./index-7074710c.js";import{l as b}from"./CourseToolHandler-8716455d.js";import{numberOfAttemptsAllowedAdjustmentAtom as w,currentAttemptNumber as N,cidChangedAtom as g}from"./AssignmentViewer-1be0d831.js";import"./index-67ec2c85.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-5b62de19.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-9136da6d.js";import"./ActivityViewer-becda8c0.js";import"./activityUtils-9c5f1536.js";import"./visibility-sensor-7d414852.js";import"./ActionButton-e5ea2a2f.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";function q(){const o=m(A("doenetId")),[i,p]=s(w),[l,a]=s(N),{numberOfAttemptsAllowed:n}=m(b(o)),d=m(g);let e=null;n!==null&&(e=Number(n)+Number(i));const r=e===null||lt+1)}}})}export{q as default}; diff --git a/dist/assets/AssignmentSettingsMenu-1ac5f65e.js b/dist/assets/AssignmentSettingsMenu-1ac5f65e.js new file mode 100644 index 0000000000..dd1d166384 --- /dev/null +++ b/dist/assets/AssignmentSettingsMenu-1ac5f65e.js @@ -0,0 +1 @@ +import{l as r,m,w as s,a as e,j as t}from"./index-7074710c.js";import{AssignmentSettings as n}from"./SelectedActivity-979809e9.js";import{A as p}from"./SettingComponents-3306743d.js";import"./ActionButton-e5ea2a2f.js";import"./ActionButtonGroup-f4ce05e4.js";import"./ButtonGroup-9136da6d.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";import"./Textfield-9c1c2968.js";import"./DateTime-d0a20943.js";import"./moment-3cda1086.js";import"./IncrementMenu-2cdf9a4e.js";import"./RelatedItems-33b68fba.js";import"./useSaveDraft-5f9f3fe4.js";import"./EditorViewerRecoil-fb47fc9d.js";function _(){const o=r(m("doenetId")),i=r(s);return e("div",{style:{paddingTop:"6px",paddingBottom:"6px"},children:[t(p,{doenetId:o,courseId:i}),t("br",{}),t(n,{effectiveRole:"instructor",doenetId:o,courseId:i})]})}export{_ as default}; diff --git a/dist/assets/AssignmentSettingsMenu-7c135fe6.js b/dist/assets/AssignmentSettingsMenu-7c135fe6.js deleted file mode 100644 index d084a5439f..0000000000 --- a/dist/assets/AssignmentSettingsMenu-7c135fe6.js +++ /dev/null @@ -1 +0,0 @@ -import{l as r,m,w as s,a as e,j as t}from"./index-99a56692.js";import{AssignmentSettings as n}from"./SelectedActivity-e75f87c1.js";import{A as p}from"./SettingComponents-67fac933.js";import"./ActionButton-f612d279.js";import"./ActionButtonGroup-a395ceaf.js";import"./ButtonGroup-ea123297.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";import"./Textfield-5d92f495.js";import"./DateTime-ef0be144.js";import"./moment-f5bb98f1.js";import"./IncrementMenu-aee46d2a.js";import"./RelatedItems-96588168.js";import"./useSaveDraft-a42d0f94.js";import"./EditorViewerRecoil-41e59102.js";function _(){const o=r(m("doenetId")),i=r(s);return e("div",{style:{paddingTop:"6px",paddingBottom:"6px"},children:[t(p,{doenetId:o,courseId:i}),t("br",{}),t(n,{effectiveRole:"instructor",doenetId:o,courseId:i})]})}export{_ as default}; diff --git a/dist/assets/AssignmentViewer-f9c5976c.js b/dist/assets/AssignmentViewer-1be0d831.js similarity index 96% rename from dist/assets/AssignmentViewer-f9c5976c.js rename to dist/assets/AssignmentViewer-1be0d831.js index 9aec8a6c0c..464e5e37a3 100644 --- a/dist/assets/AssignmentViewer-f9c5976c.js +++ b/dist/assets/AssignmentViewer-1be0d831.js @@ -1 +1 @@ -import{r as f,a as y,j as a,i as Me,aP as Ee,l as Q,m as ze,w as Le,R as qe,E as Ge,g as $,v as D,Q as He,S as Ue,G as de,u as Ye,e as We,b as Je,c as Ke,p as Qe,k as g,F as X,B as Z,ag as j,ac as Xe}from"./index-99a56692.js";import{s as ue,A as Ze}from"./ActivityViewer-3a815948.js";import{a as et,p as tt,d as at}from"./activityUtils-c08c1686.js";import{A as st}from"./ActionButton-f612d279.js";import{B as nt}from"./ButtonGroup-ea123297.js";import{e as it}from"./RoleDropdown-5e05ae49.js";import"./visibility-sensor-55e75ed1.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";function ce(r){const[u,d]=f.useState("flex");var m={padding:"10px",display:`${u}`,alignItems:"center"},i={flexGrow:"1",lineHeight:"1.4",fontFamily:"Open Sans",fontSize:"16px"},h={background:"none",border:"0px",marginLeft:"5px",padding:"0px",value:"Label:",fontFamily:"Open Sans",fontSize:"14px",cursor:"pointer"},e={};switch(r.type){case"ERROR":e.backgroundColor="var(--mainRed)",e.color="var(--canvas)",h.color="var(--canvas)";break;case"ALERT":e.backgroundColor="var(--lightYellow)";break;case"ACTION":e.backgroundColor="var(--lightBlue)";break;case"SUCCESS":e.backgroundColor="var(--lightGreen)";break;default:e.backgroundColor="var(--mainGreen)";break}function A(){d("none")}return r.allowClose&&(e.closeButton=a("button",{"aria-label":"Close banner",style:h,onClick:()=>{A()},children:a(Me,{icon:Ee})})),y("div",{"aria-labelledby":"banner-text",children:[a("div",{style:e,children:y("div",{style:m,children:[a("div",{style:i,id:"banner-text",children:r.value}),e.closeButton]})}),a("div",{style:{padding:"5px"}})]})}const me=j({key:"currentAttemptNumber",default:null}),rt=j({key:"creditAchievedAtom",default:{creditByItem:[],creditForAttempt:0,creditForAssignment:0,totalPointsOrPercent:0}}),pe=j({key:"numberOfAttemptsAllowedAdjustment",default:0}),lt=j({key:"cidChanged",default:!1});function ee({previousVariants:r,allPossibleVariants:u,individualize:d,userId:m,doenetId:i,attemptNumber:h}){let e=[],A=(h-1)%u.length,v=[];if(A>0)for(let c=h-A;casync()=>await s.getPromise(ue),[ue]);He(r),Ue(u);const N=Q(it(u));let[b,Ve]=$(de(r)),q=b.label,{search:Ie,hash:ae}=Ye(),ke=We();f.useEffect(()=>{const s=document.title;return q&&(document.title=`${q} - Doenet`),()=>{document.title=s}},[q]),f.useEffect(()=>{Object.keys(b).length>0&&Object.keys(N).length>0&&Se(r,b)},[b,r,N]);const Oe=Je(Ke);L.current=Oe.contents.userId;const Se=D(({snapshot:s,set:l})=>async(n,{type:p,timeLimit:o,assignedDate:V,dueDate:P,showCorrectness:R,showCreditAchievedMenu:H,paginate:w,showFinishButton:se,showFeedback:ne,showHints:ie,autoSubmit:re,showSolution:_e,proctorMakesAvailable:$e,numberOfAttemptsAllowed:le})=>{if(p===void 0)return;let U=[];o===null&&U.push("TimerMenu"),(!R||!H||N.canViewUnassignedContent!=="0")&&U.push("CreditAchieved"),d(U);let Y="button";if(!_e&&N.canViewUnassignedContent==="0"&&(Y="none"),$e){const{page:K}=await s.getPromise(Qe);if(K!=="exam"){i("Problem"),e("Assignment only available in a proctored setting.");return}else{const{data:je}=await g.get("/api/checkSEBheaders.php",{params:{doenetId:n}});if(Number(je.legitAccessKey)!==1){i("Problem"),e("Browser not configured properly to take an exam.");return}}}let _=null,t=await g.get("/api/getCidForAssignment.php",{params:{doenetId:n,latestAttemptOverrides:!0}});if(t.data.success)if(t.data.cid)_=t.data.cid;else{i("Problem"),e("Assignment is not assigned.");return}else{i("Problem"),e(`Error loading assignment: ${t.data.message}`);return}if(k(t.data.cidChanged),t=await g.get("/api/loadTakenVariants.php",{params:{doenetId:n}}),!t.data.success){i("Problem"),t.data.message?e(`Could not load assignment: ${t.data.message}`):e(`Could not load assignment: ${t.data}`);return}let I=t.data.variants.map(Number),C=Math.max(...t.data.attemptNumbers.map(Number)),W=!1;if(C<1?(C=1,W=!0):t.data.variants[t.data.variants.length-1]===null&&(W=!0),l(me,C),t=await g.get("/api/loadAttemptsAllowedAdjustment.php",{params:{doenetId:n}}),!t.data.success){i("Problem"),t.data.message?e(`Could not load assignment: ${t.data.message}`):e(`Could not load assignment: ${t.data}`);return}let De=Number(t.data.numberOfAttemptsAllowedAdjustment);l(pe,De);let J=await ot(_);if(!J.success){E({requestedVariantIndex:0,attemptNumber:C,showCorrectness:R,paginate:w,showFinishButton:se,showFeedback:ne,showHints:ie,autoSubmit:re,cid:_,doenetId:n,solutionDisplayMode:Y,baseNumberOfAttemptsAllowed:le}),i("Problem"),e(J.message);return}if(z.current=[...Array(J.numberOfVariants).keys()].map(K=>K+1),W){if(t=await g.get("/api/getIndividualizeForAssignment.php",{params:{doenetId:n}}),!t.data.success){i("Problem"),t.data.message?e(`Could not load assignment: ${t.data.message}`):e(`Could not load assignment: ${t.data}`);return}O.current=t.data.individualize==="1",I=I.slice(0,C-1),I.push(ee({previousVariants:I,allPossibleVariants:z.current,individualize:O.current,userId:L.current,doenetId:n,attemptNumber:C}))}let oe=I[I.length-1];console.log(`requestedVariantIndex: ${oe}`),E({requestedVariantIndex:oe,attemptNumber:C,showCorrectness:R,paginate:w,showFinishButton:se,showFeedback:ne,showHints:ie,autoSubmit:re,cid:_,doenetId:n,solutionDisplayMode:Y,baseNumberOfAttemptsAllowed:le}),i("Ready")},[d,N]),Pe=D(({set:s})=>async()=>{s(de(x),l=>{let n={...l};return n.completed=!0,n.completedDate=new Date,n})},[x]);async function Re(s,l){ae&&ae!=="#page1"&&ke(Ie,{replace:!0});let n=await Ne();n!==null&&clearTimeout(n);let p=null,o=await g.get("/api/getCidForAssignment.php",{params:{doenetId:l,latestAttemptOverrides:!1}});if(o.data.success)if(o.data.cid)p=o.data.cid;else{i("Problem"),e("Assignment is not assigned.");return}else{i("Problem"),e(`Error loading assignment: ${o.data.message}`);return}console.log(`retrieved cid: ${p}`);const{data:V}=await g.get("/api/loadTakenVariants.php",{params:{doenetId:l}});if(!V.success){i("Problem"),V.message?e(`Could not load assignment: ${V.message}`):e(`Could not load assignment: ${V}`);return}let P=V.variants.map(Number).slice(0,s-1);if(O.current===null){if(o=await g.get("/api/getIndividualizeForAssignment.php",{params:{doenetId:l}}),!o.data.success){i("Problem"),o.data.message?e(`Could not load assignment: ${o.data.message}`):e(`Could not load assignment: ${o.data}`);return}O.current=o.data.individualize==="1",i("Ready")}P.push(ee({previousVariants:P,allPossibleVariants:z.current,individualize:O.current,userId:L.current,doenetId:l,attemptNumber:s}));let R=P[P.length-1];E(H=>{let w={...H};return w.attemptNumber=s,w.requestedVariantIndex=R,w.cid=p,w}),k(!1)}const Be=D(({set:s})=>async({creditByItem:l,creditForAssignment:n,creditForAttempt:p,totalPointsOrPercent:o})=>{s(rt,{creditByItem:l,creditForAssignment:n,creditForAttempt:p,totalPointsOrPercent:o})});function Fe(s){console.log(`page changed to ${s}`)}async function Te(){let s=await g.post("/api/incrementAttemptsAllowedIfCidChanged.php",{doenetId:x});s.data.cidChanged&&(ye(Number(s.data.newNumberOfAttemptsAllowedAdjustment)),v(l=>l+1))}if(r==="")return null;if(console.log("stage",m),u==="__not_found__")return a("h1",{children:"Content not found or no permission to view content"});if(m==="Initializing")return null;if(A>F)return Re(A,r),null;if(m==="Problem")return a("h1",{children:h});if(!(b!=null&&b.canViewAfterCompleted)&&b.completed)return Number(b.numberOfAttemptsAllowed)+Number(Ce)>F?a(X,{children:y("div",{style:{margin:"15px"},children:[a("h1",{children:"Assessment Complete"}),a("p",{children:"You have completed this assessment. Would you like to begin another attempt?"}),a("p",{children:a(Z,{value:"Begin New Attempt",onClick:async()=>{const{data:l}=await g.get("/api/saveCompleted.php",{params:{doenetId:x}});l.success?(v(n=>n+1),Ve(n=>{let p={...n};return p.completed=!1,p})):(i("Problem"),e("Internal Error"))}})})]})}):a(X,{children:y("div",{style:{margin:"15px"},children:[a("h1",{children:"Assessment Complete"}),a("p",{children:"You have already completed this assessment and no additional attempts are available."})]})});let G=null;if(B)if(xe){let s=null;we>1&&(s=" and the number of available attempts"),G=a(ce,{type:"ACTION",value:y("div",{style:{border:"var(--mainBorder)",borderRadius:"var(--mainBorderRadius)",padding:"5px",margin:"5px",display:"flex",flexFlow:"column wrap"},children:["A new version of this activity is available. Do you want to start a new attempt using the new version? (This will reset the activity",s,".)",a("div",{style:{display:"flex",justifyContent:"center",padding:"5px"},children:y(nt,{children:[a(Z,{onClick:Te,dataTest:"ConfirmNewVersion",value:"Yes"}),a(Z,{onClick:()=>te(!1),dataTest:"CancelNewVersion",value:"No",alert:!0})]})})]})})}else G=a(ce,{type:"ACTION",value:a("div",{style:{marginLeft:"1px",marginRight:"5px"},children:a(st,{onClick:()=>te(!0),dataTest:"NewVersionAvailable",value:"New version available!"})})});const S=N.canViewUnassignedContent==="0";return y(X,{children:[G,a(Ze,{cid:Ae,doenetId:x,flags:{showCorrectness:c,readOnly:!1,solutionDisplayMode:ve,showFeedback:fe,showHints:he,autoSubmit:be,allowLoadState:S,allowSaveState:S,allowLocalState:S,allowSaveSubmissions:S,allowSaveEvents:S},attemptNumber:F,requestedVariantIndex:M,updateCreditAchievedCallback:Be,updateAttemptNumber:v,pageChangedCallback:Fe,paginate:T,showFinishButton:ge,cidChangedCallback:()=>k(!0),setActivityAsCompleted:Pe},`activityViewer${x}`)]})}async function ot(r){let u;try{u=await Xe(r)}catch{return{success:!1,message:"Could not retrieve file"}}let d=tt(u);if(!d.success)return d;try{d=await at(d.activityJSON)}catch(m){return{success:!1,message:m.message}}return{success:!0,numberOfVariants:d.numberOfVariants}}export{lt as cidChangedAtom,rt as creditAchievedAtom,me as currentAttemptNumber,At as default,pe as numberOfAttemptsAllowedAdjustmentAtom}; +import{r as f,a as y,j as a,i as Me,aP as Ee,l as Q,m as ze,w as Le,R as qe,E as Ge,g as $,v as D,Q as He,S as Ue,G as de,u as Ye,e as We,b as Je,c as Ke,p as Qe,k as g,F as X,B as Z,ag as j,ac as Xe}from"./index-7074710c.js";import{s as ue,A as Ze}from"./ActivityViewer-becda8c0.js";import{a as et,p as tt,d as at}from"./activityUtils-9c5f1536.js";import{A as st}from"./ActionButton-e5ea2a2f.js";import{B as nt}from"./ButtonGroup-9136da6d.js";import{e as it}from"./RoleDropdown-cce90708.js";import"./visibility-sensor-7d414852.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";function ce(r){const[u,d]=f.useState("flex");var m={padding:"10px",display:`${u}`,alignItems:"center"},i={flexGrow:"1",lineHeight:"1.4",fontFamily:"Open Sans",fontSize:"16px"},h={background:"none",border:"0px",marginLeft:"5px",padding:"0px",value:"Label:",fontFamily:"Open Sans",fontSize:"14px",cursor:"pointer"},e={};switch(r.type){case"ERROR":e.backgroundColor="var(--mainRed)",e.color="var(--canvas)",h.color="var(--canvas)";break;case"ALERT":e.backgroundColor="var(--lightYellow)";break;case"ACTION":e.backgroundColor="var(--lightBlue)";break;case"SUCCESS":e.backgroundColor="var(--lightGreen)";break;default:e.backgroundColor="var(--mainGreen)";break}function A(){d("none")}return r.allowClose&&(e.closeButton=a("button",{"aria-label":"Close banner",style:h,onClick:()=>{A()},children:a(Me,{icon:Ee})})),y("div",{"aria-labelledby":"banner-text",children:[a("div",{style:e,children:y("div",{style:m,children:[a("div",{style:i,id:"banner-text",children:r.value}),e.closeButton]})}),a("div",{style:{padding:"5px"}})]})}const me=j({key:"currentAttemptNumber",default:null}),rt=j({key:"creditAchievedAtom",default:{creditByItem:[],creditForAttempt:0,creditForAssignment:0,totalPointsOrPercent:0}}),pe=j({key:"numberOfAttemptsAllowedAdjustment",default:0}),lt=j({key:"cidChanged",default:!1});function ee({previousVariants:r,allPossibleVariants:u,individualize:d,userId:m,doenetId:i,attemptNumber:h}){let e=[],A=(h-1)%u.length,v=[];if(A>0)for(let c=h-A;casync()=>await s.getPromise(ue),[ue]);He(r),Ue(u);const N=Q(it(u));let[b,Ve]=$(de(r)),q=b.label,{search:Ie,hash:ae}=Ye(),ke=We();f.useEffect(()=>{const s=document.title;return q&&(document.title=`${q} - Doenet`),()=>{document.title=s}},[q]),f.useEffect(()=>{Object.keys(b).length>0&&Object.keys(N).length>0&&Se(r,b)},[b,r,N]);const Oe=Je(Ke);L.current=Oe.contents.userId;const Se=D(({snapshot:s,set:l})=>async(n,{type:p,timeLimit:o,assignedDate:V,dueDate:P,showCorrectness:R,showCreditAchievedMenu:H,paginate:w,showFinishButton:se,showFeedback:ne,showHints:ie,autoSubmit:re,showSolution:_e,proctorMakesAvailable:$e,numberOfAttemptsAllowed:le})=>{if(p===void 0)return;let U=[];o===null&&U.push("TimerMenu"),(!R||!H||N.canViewUnassignedContent!=="0")&&U.push("CreditAchieved"),d(U);let Y="button";if(!_e&&N.canViewUnassignedContent==="0"&&(Y="none"),$e){const{page:K}=await s.getPromise(Qe);if(K!=="exam"){i("Problem"),e("Assignment only available in a proctored setting.");return}else{const{data:je}=await g.get("/api/checkSEBheaders.php",{params:{doenetId:n}});if(Number(je.legitAccessKey)!==1){i("Problem"),e("Browser not configured properly to take an exam.");return}}}let _=null,t=await g.get("/api/getCidForAssignment.php",{params:{doenetId:n,latestAttemptOverrides:!0}});if(t.data.success)if(t.data.cid)_=t.data.cid;else{i("Problem"),e("Assignment is not assigned.");return}else{i("Problem"),e(`Error loading assignment: ${t.data.message}`);return}if(k(t.data.cidChanged),t=await g.get("/api/loadTakenVariants.php",{params:{doenetId:n}}),!t.data.success){i("Problem"),t.data.message?e(`Could not load assignment: ${t.data.message}`):e(`Could not load assignment: ${t.data}`);return}let I=t.data.variants.map(Number),C=Math.max(...t.data.attemptNumbers.map(Number)),W=!1;if(C<1?(C=1,W=!0):t.data.variants[t.data.variants.length-1]===null&&(W=!0),l(me,C),t=await g.get("/api/loadAttemptsAllowedAdjustment.php",{params:{doenetId:n}}),!t.data.success){i("Problem"),t.data.message?e(`Could not load assignment: ${t.data.message}`):e(`Could not load assignment: ${t.data}`);return}let De=Number(t.data.numberOfAttemptsAllowedAdjustment);l(pe,De);let J=await ot(_);if(!J.success){E({requestedVariantIndex:0,attemptNumber:C,showCorrectness:R,paginate:w,showFinishButton:se,showFeedback:ne,showHints:ie,autoSubmit:re,cid:_,doenetId:n,solutionDisplayMode:Y,baseNumberOfAttemptsAllowed:le}),i("Problem"),e(J.message);return}if(z.current=[...Array(J.numberOfVariants).keys()].map(K=>K+1),W){if(t=await g.get("/api/getIndividualizeForAssignment.php",{params:{doenetId:n}}),!t.data.success){i("Problem"),t.data.message?e(`Could not load assignment: ${t.data.message}`):e(`Could not load assignment: ${t.data}`);return}O.current=t.data.individualize==="1",I=I.slice(0,C-1),I.push(ee({previousVariants:I,allPossibleVariants:z.current,individualize:O.current,userId:L.current,doenetId:n,attemptNumber:C}))}let oe=I[I.length-1];console.log(`requestedVariantIndex: ${oe}`),E({requestedVariantIndex:oe,attemptNumber:C,showCorrectness:R,paginate:w,showFinishButton:se,showFeedback:ne,showHints:ie,autoSubmit:re,cid:_,doenetId:n,solutionDisplayMode:Y,baseNumberOfAttemptsAllowed:le}),i("Ready")},[d,N]),Pe=D(({set:s})=>async()=>{s(de(x),l=>{let n={...l};return n.completed=!0,n.completedDate=new Date,n})},[x]);async function Re(s,l){ae&&ae!=="#page1"&&ke(Ie,{replace:!0});let n=await Ne();n!==null&&clearTimeout(n);let p=null,o=await g.get("/api/getCidForAssignment.php",{params:{doenetId:l,latestAttemptOverrides:!1}});if(o.data.success)if(o.data.cid)p=o.data.cid;else{i("Problem"),e("Assignment is not assigned.");return}else{i("Problem"),e(`Error loading assignment: ${o.data.message}`);return}console.log(`retrieved cid: ${p}`);const{data:V}=await g.get("/api/loadTakenVariants.php",{params:{doenetId:l}});if(!V.success){i("Problem"),V.message?e(`Could not load assignment: ${V.message}`):e(`Could not load assignment: ${V}`);return}let P=V.variants.map(Number).slice(0,s-1);if(O.current===null){if(o=await g.get("/api/getIndividualizeForAssignment.php",{params:{doenetId:l}}),!o.data.success){i("Problem"),o.data.message?e(`Could not load assignment: ${o.data.message}`):e(`Could not load assignment: ${o.data}`);return}O.current=o.data.individualize==="1",i("Ready")}P.push(ee({previousVariants:P,allPossibleVariants:z.current,individualize:O.current,userId:L.current,doenetId:l,attemptNumber:s}));let R=P[P.length-1];E(H=>{let w={...H};return w.attemptNumber=s,w.requestedVariantIndex=R,w.cid=p,w}),k(!1)}const Be=D(({set:s})=>async({creditByItem:l,creditForAssignment:n,creditForAttempt:p,totalPointsOrPercent:o})=>{s(rt,{creditByItem:l,creditForAssignment:n,creditForAttempt:p,totalPointsOrPercent:o})});function Fe(s){console.log(`page changed to ${s}`)}async function Te(){let s=await g.post("/api/incrementAttemptsAllowedIfCidChanged.php",{doenetId:x});s.data.cidChanged&&(ye(Number(s.data.newNumberOfAttemptsAllowedAdjustment)),v(l=>l+1))}if(r==="")return null;if(console.log("stage",m),u==="__not_found__")return a("h1",{children:"Content not found or no permission to view content"});if(m==="Initializing")return null;if(A>F)return Re(A,r),null;if(m==="Problem")return a("h1",{children:h});if(!(b!=null&&b.canViewAfterCompleted)&&b.completed)return Number(b.numberOfAttemptsAllowed)+Number(Ce)>F?a(X,{children:y("div",{style:{margin:"15px"},children:[a("h1",{children:"Assessment Complete"}),a("p",{children:"You have completed this assessment. Would you like to begin another attempt?"}),a("p",{children:a(Z,{value:"Begin New Attempt",onClick:async()=>{const{data:l}=await g.get("/api/saveCompleted.php",{params:{doenetId:x}});l.success?(v(n=>n+1),Ve(n=>{let p={...n};return p.completed=!1,p})):(i("Problem"),e("Internal Error"))}})})]})}):a(X,{children:y("div",{style:{margin:"15px"},children:[a("h1",{children:"Assessment Complete"}),a("p",{children:"You have already completed this assessment and no additional attempts are available."})]})});let G=null;if(B)if(xe){let s=null;we>1&&(s=" and the number of available attempts"),G=a(ce,{type:"ACTION",value:y("div",{style:{border:"var(--mainBorder)",borderRadius:"var(--mainBorderRadius)",padding:"5px",margin:"5px",display:"flex",flexFlow:"column wrap"},children:["A new version of this activity is available. Do you want to start a new attempt using the new version? (This will reset the activity",s,".)",a("div",{style:{display:"flex",justifyContent:"center",padding:"5px"},children:y(nt,{children:[a(Z,{onClick:Te,dataTest:"ConfirmNewVersion",value:"Yes"}),a(Z,{onClick:()=>te(!1),dataTest:"CancelNewVersion",value:"No",alert:!0})]})})]})})}else G=a(ce,{type:"ACTION",value:a("div",{style:{marginLeft:"1px",marginRight:"5px"},children:a(st,{onClick:()=>te(!0),dataTest:"NewVersionAvailable",value:"New version available!"})})});const S=N.canViewUnassignedContent==="0";return y(X,{children:[G,a(Ze,{cid:Ae,doenetId:x,flags:{showCorrectness:c,readOnly:!1,solutionDisplayMode:ve,showFeedback:fe,showHints:he,autoSubmit:be,allowLoadState:S,allowSaveState:S,allowLocalState:S,allowSaveSubmissions:S,allowSaveEvents:S},attemptNumber:F,requestedVariantIndex:M,updateCreditAchievedCallback:Be,updateAttemptNumber:v,pageChangedCallback:Fe,paginate:T,showFinishButton:ge,cidChangedCallback:()=>k(!0),setActivityAsCompleted:Pe},`activityViewer${x}`)]})}async function ot(r){let u;try{u=await Xe(r)}catch{return{success:!1,message:"Could not retrieve file"}}let d=tt(u);if(!d.success)return d;try{d=await at(d.activityJSON)}catch(m){return{success:!1,message:m.message}}return{success:!0,numberOfVariants:d.numberOfVariants}}export{lt as cidChangedAtom,rt as creditAchievedAtom,me as currentAttemptNumber,At as default,pe as numberOfAttemptsAllowedAdjustmentAtom}; diff --git a/dist/assets/AutoSaves-1ceadcde.js b/dist/assets/AutoSaves-759ac78c.js similarity index 58% rename from dist/assets/AutoSaves-1ceadcde.js rename to dist/assets/AutoSaves-759ac78c.js index 1a1f65ef78..0a2de84648 100644 --- a/dist/assets/AutoSaves-1ceadcde.js +++ b/dist/assets/AutoSaves-759ac78c.js @@ -1 +1 @@ -import{j as e}from"./index-99a56692.js";function s(t){return e("div",{style:t.style,children:e("div",{children:"Autosaves here"})})}export{s as default}; +import{j as e}from"./index-7074710c.js";function s(t){return e("div",{style:t.style,children:e("div",{children:"Autosaves here"})})}export{s as default}; diff --git a/dist/assets/BackButton-050a812f.js b/dist/assets/BackButton-998fcaf2.js similarity index 56% rename from dist/assets/BackButton-050a812f.js rename to dist/assets/BackButton-998fcaf2.js index b96d96280e..10149d26ff 100644 --- a/dist/assets/BackButton-050a812f.js +++ b/dist/assets/BackButton-998fcaf2.js @@ -1 +1 @@ -import{e as t,j as e,B as n}from"./index-99a56692.js";function s(){const a=t();return e(n,{onClick:()=>a(-1),value:"Back"})}export{s as default}; +import{e as t,j as e,B as n}from"./index-7074710c.js";function s(){const a=t();return e(n,{onClick:()=>a(-1),value:"Back"})}export{s as default}; diff --git a/dist/assets/BreadCrumb-c66b383a.js b/dist/assets/BreadCrumb-c4dbe368.js similarity index 99% rename from dist/assets/BreadCrumb-c66b383a.js rename to dist/assets/BreadCrumb-c4dbe368.js index 105fd94b1b..a902f87a5b 100644 --- a/dist/assets/BreadCrumb-c66b383a.js +++ b/dist/assets/BreadCrumb-c4dbe368.js @@ -1,4 +1,4 @@ -import{s as y,r as i,l as P,b4 as V,av as W,j as d,F as _,a as J}from"./index-99a56692.js";const N=y.ul` +import{s as y,r as i,l as P,b4 as V,av as W,j as d,F as _,a as J}from"./index-7074710c.js";const N=y.ul` list-style: none; overflow: hidden; height: 21px; diff --git a/dist/assets/ButtonGroup-ea123297.js b/dist/assets/ButtonGroup-9136da6d.js similarity index 88% rename from dist/assets/ButtonGroup-ea123297.js rename to dist/assets/ButtonGroup-9136da6d.js index 8fce7b49fd..de313cc011 100644 --- a/dist/assets/ButtonGroup-ea123297.js +++ b/dist/assets/ButtonGroup-9136da6d.js @@ -1,4 +1,4 @@ -import{s as p,av as x,j as i,aw as n}from"./index-99a56692.js";const d=p.div` +import{s as p,av as x,j as i,aw as n}from"./index-7074710c.js";const d=p.div` display: ${t=>t.vertical?"static":"flex"}; width: ${t=>t.width=="menu"?"var(--menuWidth)":""}; /* flex-wrap: wrap; */ diff --git a/dist/assets/ChooseLearnerPanel-76d33139.js b/dist/assets/ChooseLearnerPanel-bdcfc317.js similarity index 98% rename from dist/assets/ChooseLearnerPanel-76d33139.js rename to dist/assets/ChooseLearnerPanel-bdcfc317.js index d8a4c57b84..8434232a46 100644 --- a/dist/assets/ChooseLearnerPanel-76d33139.js +++ b/dist/assets/ChooseLearnerPanel-bdcfc317.js @@ -1,4 +1,4 @@ -import{l as A,m as D,r as l,y as H,v as _,k as I,p as Q,a,j as e,F as B,B as p,N as W,a7 as T,a8 as ee,s as te,D as ae,d as re}from"./index-99a56692.js";import{B as F}from"./ButtonGroup-ea123297.js";const ne=te.div` +import{l as A,m as D,r as l,y as H,v as _,k as I,p as Q,a,j as e,F as B,B as p,N as W,a7 as T,a8 as ee,s as te,D as ae,d as re}from"./index-7074710c.js";import{B as F}from"./ButtonGroup-9136da6d.js";const ne=te.div` padding: 1rem; table { /* border-collapse: collapse; */ diff --git a/dist/assets/ChooserBreadCrumb-6e2de5c4.js b/dist/assets/ChooserBreadCrumb-6e2de5c4.js deleted file mode 100644 index c0e7b31d4a..0000000000 --- a/dist/assets/ChooserBreadCrumb-6e2de5c4.js +++ /dev/null @@ -1 +0,0 @@ -import{j as r,r as s}from"./index-99a56692.js";import{B as e}from"./BreadCrumb-c66b383a.js";import{u as m}from"./breadcrumbUtil-6dfe85b1.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-e81ca638.js";function n(){const o=m();return r(s.Suspense,{fallback:r("div",{children:"loading Breadcrumbs..."}),children:r(e,{crumbs:[o]})})}export{n as default}; diff --git a/dist/assets/ChooserBreadCrumb-c90f8cd6.js b/dist/assets/ChooserBreadCrumb-c90f8cd6.js new file mode 100644 index 0000000000..9027e0bace --- /dev/null +++ b/dist/assets/ChooserBreadCrumb-c90f8cd6.js @@ -0,0 +1 @@ +import{j as r,r as s}from"./index-7074710c.js";import{B as e}from"./BreadCrumb-c4dbe368.js";import{u as m}from"./breadcrumbUtil-1e7f0dfb.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-06d28967.js";function n(){const o=m();return r(s.Suspense,{fallback:r("div",{children:"loading Breadcrumbs..."}),children:r(e,{crumbs:[o]})})}export{n as default}; diff --git a/dist/assets/ClassTimes-7721f13e.js b/dist/assets/ClassTimes-c6d63413.js similarity index 86% rename from dist/assets/ClassTimes-7721f13e.js rename to dist/assets/ClassTimes-c6d63413.js index 746012a0ee..4ec8d42bdd 100644 --- a/dist/assets/ClassTimes-7721f13e.js +++ b/dist/assets/ClassTimes-c6d63413.js @@ -1 +1 @@ -import{l as g,m as j,v as w,k as f,a as c,F as y,j as a,B as C,i as D,bm as _,aP as k}from"./index-99a56692.js";import{c as m}from"./Next7Days-4c381b9d.js";import{D as B}from"./DropdownMenu-9b4c45a6.js";import{D as v}from"./DateTime-ef0be144.js";import"./CourseToolHandler-f517d0e5.js";import"./index-ef9c2520.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-b3e258be.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-ea123297.js";import"./RoleDropdown-5e05ae49.js";import"./moment-f5bb98f1.js";function E(){const A=g(m),u=g(j("courseId")),P=w(({set:t,snapshot:e})=>async n=>{let r=[...await e.getPromise(m)];r.push({dotwIndex:1,startTime:"09:00",endTime:"10:00"}),t(m,r);let d=[],s=[],i=[];for(let l of r)d.push(l.dotwIndex),s.push(l.startTime),i.push(l.endTime);await f.post("/api/updateClassTimes.php",{courseId:n,dotwIndexes:d,startTimes:s,endTimes:i})}),T=w(({set:t,snapshot:e})=>async({index:n,nextClassTime:o,courseId:r})=>{let s=[...await e.getPromise(m)];s[n]={...o},t(m,s);let i=[],l=[],p=[];for(let x of s)i.push(x.dotwIndex),l.push(x.startTime),p.push(x.endTime);await f.post("/api/updateClassTimes.php",{courseId:r,dotwIndexes:i,startTimes:l,endTimes:p})}),S=w(({set:t,snapshot:e})=>async({index:n,courseId:o})=>{let d=[...await e.getPromise(m)];d.splice(n,1),t(m,d);let s=[],i=[],l=[];for(let p of d)s.push(p.dotwIndex),i.push(p.startTime),l.push(p.endTime);await f.post("/api/updateClassTimes.php",{courseId:o,dotwIndexes:s,startTimes:i,endTimes:l})}),b=[[1,"Monday"],[2,"Tuesday"],[3,"Wednesday"],[4,"Thursday"],[5,"Friday"],[6,"Saturday"],[0,"Sunday"]];let h=[];for(let[t,e]of Object.entries(A)){const n=new Date;n.setHours(e.startTime.split(":")[0]),n.setMinutes(e.startTime.split(":")[1]);const o=new Date;o.setHours(e.endTime.split(":")[0]),o.setMinutes(e.endTime.split(":")[1]);let r=e.dotwIndex;e.dotwIndex==0&&(r=7),h.push(c(y,{children:[c("tr",{children:[a("td",{style:{width:"190px"},children:a(B,{dataTest:`DOTW Dropdown ${t}`,width:"180px",items:b,valueIndex:r,onChange:({value:d})=>{let s={...e};s.dotwIndex=d,T({courseId:u,index:t,nextClassTime:s})}})}),a(C,{dataTest:`Classtime Delete Button ${t}`,icon:a(D,{icon:k}),alert:!0,onClick:()=>{S({index:t,courseId:u})}})]}),c("tr",{style:{width:"190px",display:"flex",alignItems:"center"},children:[a("td",{children:a(v,{dataTest:`Classtime start time ${t}`,datePicker:!1,width:"74px",value:n,onBlur:(d,s)=>{let i={...e};i.startTime=new Date(d.value._d).toLocaleString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),T({courseId:u,index:t,nextClassTime:i})}})}),a("td",{style:{marginLeft:"6px",marginRight:"6px"},children:"-"}),a("td",{style:{["--menuPanelMargin"]:"-62px"},children:a(v,{dataTest:`Classtime end time ${t}`,datePicker:!1,width:"74px",value:o,onBlur:(d,s)=>{let i={...e};i.endTime=new Date(d.value._d).toLocaleString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),T({courseId:u,index:t,nextClassTime:i})}})})]}),a("div",{style:{margin:"10px"}})]}))}let I=a("div",{children:"No times set."});return h.length>0&&(I=a("table",{style:{width:"230px",margins:"5px"},children:h})),c(y,{children:[I,a(C,{dataTest:"Add Classtime",icon:a(D,{icon:_}),style:{margin:"auto"},onClick:()=>P(u)})]})}export{E as default}; +import{l as g,m as j,v as w,k as f,a as c,F as y,j as a,B as C,i as D,bo as _,aP as k}from"./index-7074710c.js";import{c as m}from"./Next7Days-ac4b7e6b.js";import{D as B}from"./DropdownMenu-f3593bed.js";import{D as v}from"./DateTime-d0a20943.js";import"./CourseToolHandler-8716455d.js";import"./index-67ec2c85.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-5b62de19.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-9136da6d.js";import"./RoleDropdown-cce90708.js";import"./moment-3cda1086.js";function E(){const A=g(m),u=g(j("courseId")),P=w(({set:t,snapshot:e})=>async n=>{let r=[...await e.getPromise(m)];r.push({dotwIndex:1,startTime:"09:00",endTime:"10:00"}),t(m,r);let d=[],s=[],i=[];for(let l of r)d.push(l.dotwIndex),s.push(l.startTime),i.push(l.endTime);await f.post("/api/updateClassTimes.php",{courseId:n,dotwIndexes:d,startTimes:s,endTimes:i})}),T=w(({set:t,snapshot:e})=>async({index:n,nextClassTime:o,courseId:r})=>{let s=[...await e.getPromise(m)];s[n]={...o},t(m,s);let i=[],l=[],p=[];for(let x of s)i.push(x.dotwIndex),l.push(x.startTime),p.push(x.endTime);await f.post("/api/updateClassTimes.php",{courseId:r,dotwIndexes:i,startTimes:l,endTimes:p})}),S=w(({set:t,snapshot:e})=>async({index:n,courseId:o})=>{let d=[...await e.getPromise(m)];d.splice(n,1),t(m,d);let s=[],i=[],l=[];for(let p of d)s.push(p.dotwIndex),i.push(p.startTime),l.push(p.endTime);await f.post("/api/updateClassTimes.php",{courseId:o,dotwIndexes:s,startTimes:i,endTimes:l})}),b=[[1,"Monday"],[2,"Tuesday"],[3,"Wednesday"],[4,"Thursday"],[5,"Friday"],[6,"Saturday"],[0,"Sunday"]];let h=[];for(let[t,e]of Object.entries(A)){const n=new Date;n.setHours(e.startTime.split(":")[0]),n.setMinutes(e.startTime.split(":")[1]);const o=new Date;o.setHours(e.endTime.split(":")[0]),o.setMinutes(e.endTime.split(":")[1]);let r=e.dotwIndex;e.dotwIndex==0&&(r=7),h.push(c(y,{children:[c("tr",{children:[a("td",{style:{width:"190px"},children:a(B,{dataTest:`DOTW Dropdown ${t}`,width:"180px",items:b,valueIndex:r,onChange:({value:d})=>{let s={...e};s.dotwIndex=d,T({courseId:u,index:t,nextClassTime:s})}})}),a(C,{dataTest:`Classtime Delete Button ${t}`,icon:a(D,{icon:k}),alert:!0,onClick:()=>{S({index:t,courseId:u})}})]}),c("tr",{style:{width:"190px",display:"flex",alignItems:"center"},children:[a("td",{children:a(v,{dataTest:`Classtime start time ${t}`,datePicker:!1,width:"74px",value:n,onBlur:(d,s)=>{let i={...e};i.startTime=new Date(d.value._d).toLocaleString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),T({courseId:u,index:t,nextClassTime:i})}})}),a("td",{style:{marginLeft:"6px",marginRight:"6px"},children:"-"}),a("td",{style:{["--menuPanelMargin"]:"-62px"},children:a(v,{dataTest:`Classtime end time ${t}`,datePicker:!1,width:"74px",value:o,onBlur:(d,s)=>{let i={...e};i.endTime=new Date(d.value._d).toLocaleString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),T({courseId:u,index:t,nextClassTime:i})}})})]}),a("div",{style:{margin:"10px"}})]}))}let I=a("div",{children:"No times set."});return h.length>0&&(I=a("table",{style:{width:"230px",margins:"5px"},children:h})),c(y,{children:[I,a(C,{dataTest:"Add Classtime",icon:a(D,{icon:_}),style:{margin:"auto"},onClick:()=>P(u)})]})}export{E as default}; diff --git a/dist/assets/CodeMirror-35f8e4ac.js b/dist/assets/CodeMirror-87ecbb8f.js similarity index 99% rename from dist/assets/CodeMirror-35f8e4ac.js rename to dist/assets/CodeMirror-87ecbb8f.js index c0c9ff70a2..bde74899cd 100644 --- a/dist/assets/CodeMirror-35f8e4ac.js +++ b/dist/assets/CodeMirror-87ecbb8f.js @@ -1,4 +1,4 @@ -import{aQ as xt,aR as le,aS as Si,aT as Ih,aU as tl,aV as Nh,aW as il,aX as $h,l as Vh,r as ye,j as dr,F as Wh,ag as zh,aY as Hh}from"./index-99a56692.js";let kt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;nn)return kt[e-1]<=n;return!1}function pr(n){return n>=127462&&n<=127487}const mr=8205;function ce(n,e,t=!0,i=!0){return(t?nl:qh)(n,e,i)}function nl(n,e,t){if(e==n.length)return e;e&&sl(n.charCodeAt(e))&&rl(n.charCodeAt(e-1))&&e--;let i=Y(n,e);for(e+=de(i);e=0&&pr(Y(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function qh(n,e,t){for(;e>0;){let i=nl(n,e-2,t);if(i=56320&&n<57344}function rl(n){return n>=55296&&n<56320}function Y(n,e){let t=n.charCodeAt(e);if(!rl(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return sl(i)?(t-55296<<10)+(i-56320)+65536:t}function Ns(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function de(n){return n<65536?1:2}function ti(n,e,t=n.length){let i=0;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=ce(n,s)}return i===!0?-1:n.length}class E{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),Oe.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),Oe.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new qt(this),r=new qt(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new qt(this,e)}iterRange(e,t=this.length){return new ol(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ll(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?E.empty:e.length<=32?new z(e):Oe.from(z.split(e,[]))}}class z extends E{constructor(e,t=Uh(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Gh(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new z(gr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Ci(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new z(l,o.length+r.length));else{let a=l.length>>1;i.push(new z(l.slice(0,a)),new z(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof z))return super.replace(e,t,i);let s=Ci(this.text,Ci(i.text,gr(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new z(s,r):Oe.from(z.split(s,[]),r)}sliceString(e,t=this.length,i=` +import{aQ as xt,aR as le,aS as Si,aT as Ih,aU as tl,aV as Nh,aW as il,aX as $h,l as Vh,r as ye,j as dr,F as Wh,ag as zh,aY as Hh}from"./index-7074710c.js";let kt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;nn)return kt[e-1]<=n;return!1}function pr(n){return n>=127462&&n<=127487}const mr=8205;function ce(n,e,t=!0,i=!0){return(t?nl:qh)(n,e,i)}function nl(n,e,t){if(e==n.length)return e;e&&sl(n.charCodeAt(e))&&rl(n.charCodeAt(e-1))&&e--;let i=Y(n,e);for(e+=de(i);e=0&&pr(Y(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function qh(n,e,t){for(;e>0;){let i=nl(n,e-2,t);if(i=56320&&n<57344}function rl(n){return n>=55296&&n<56320}function Y(n,e){let t=n.charCodeAt(e);if(!rl(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return sl(i)?(t-55296<<10)+(i-56320)+65536:t}function Ns(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function de(n){return n<65536?1:2}function ti(n,e,t=n.length){let i=0;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=ce(n,s)}return i===!0?-1:n.length}class E{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),Oe.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),Oe.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new qt(this),r=new qt(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new qt(this,e)}iterRange(e,t=this.length){return new ol(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new ll(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?E.empty:e.length<=32?new z(e):Oe.from(z.split(e,[]))}}class z extends E{constructor(e,t=Uh(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Gh(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new z(gr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Ci(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new z(l,o.length+r.length));else{let a=l.length>>1;i.push(new z(l.slice(0,a)),new z(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof z))return super.replace(e,t,i);let s=Ci(this.text,Ci(i.text,gr(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new z(s,r):Oe.from(z.split(s,[]),r)}sliceString(e,t=this.length,i=` `){let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=i),er&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new z(i,s)),i=[],s=-1);return s>-1&&t.push(new z(i,s)),t}}class Oe extends E{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if(i.lines=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[s]=a,new Oe(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` `){let s="";for(let r=0,o=0;re&&r&&(s+=i),eo&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Oe))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new z(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof Oe)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof z&&a&&(p=c[c.length-1])instanceof z&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new z(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:Oe.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new Oe(l,t)}}E.empty=new z([""],0);function Uh(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Ci(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r=t&&(a>i&&(l=l.slice(0,i-s)),s0?1:(e instanceof z?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof z?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(s instanceof z){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof z?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class ol{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new qt(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class ll{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=function(){return this.iter()},qt.prototype[Symbol.iterator]=ol.prototype[Symbol.iterator]=ll.prototype[Symbol.iterator]=function(){return this});class Gh{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}const Un=/\r\n?|\n/;var ee=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(ee||(ee={}));class Ee{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=ee.Simple&&h>=e&&(i==ee.TrackDel&&se||i==ee.TrackBefore&&se))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ee(e)}}class q extends Ee{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Gn(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return jn(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length0&&st(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?E.of(d.split(i||Un)):d:E.empty,m=p.length;if(f==u&&m==0)return;fo&&Z(s,f-o,-1),Z(s,u-f,m),st(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new q(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function st(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function jn(n,e,t,i=!1){let s=[],r=i?[]:null,o=new Kt(n),l=new Kt(e);for(let a=0,h=0;;)if(o.ins==-1)a+=o.len,o.next();else if(l.ins==-1&&h=0&&(o.done||hh&&!o.done&&a+o.len=0){let c=0,f=a+o.len;for(;;)if(l.ins>=0&&h>a&&h+l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class Kt{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?E.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?E.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class bt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new bt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return g.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return g.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return g.range(e.anchor,e.head)}}class g{constructor(e,t=0){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:g.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new g(e.ranges.map(t=>bt.fromJSON(t)),e.main)}static single(e,t=e){return new g([g.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?4:0))}}function jh(n,e=0){let t=n[e];n.sort((i,s)=>i.from-s.from),e=n.indexOf(t);for(let i=1;is.head?g.range(l,o):g.range(o,l))}}return new g(n,e)}function hl(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let $s=0;class k{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.extensions=r,this.id=$s++,this.default=e([])}static define(e={}){return new k(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Vs),!!e.static,e.enables)}of(e){return new Ai([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ai(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ai(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Vs(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Ai{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=$s++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||c.some(d=>(lt(f,d)&1)>0)){let d=i(f);if(l?!yr(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure(f,u){let d=i(f),p=u.config.address[r];if(p!=null){let m=Ei(u,p);if(l?yr(d,m,s):s(d,m))return f.values[o]=m,0}return f.values[o]=d,1}}}}function yr(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;clt(a,f)&1))return 0;let c=l(a);return e.compare(c,a.values[o])?0:(a.values[o]=c,1)},reconfigure(a,h){let c=i.some(p=>lt(a,p)&1),f=h.config.facets[e.id],u=h.facet(e);if(f&&!c&&Vs(t,f))return a.values[o]=u,0;let d=l(a);return e.compare(d,u)?(a.values[o]=u,0):(a.values[o]=d,1)}}}const br=k.define({static:!0});class _{constructor(e,t,i,s,r){this.id=e,this.createF=t,this.updateF=i,this.compareF=s,this.spec=r,this.provides=void 0}static define(e){let t=new _($s++,e.create,e.update,e.compare||((i,s)=>i===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(br).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,br.of({field:this,create:e})]}get extension(){return this}}const Pe={lowest:4,low:3,default:2,high:1,highest:0};function We(n){return e=>new cl(e,n)}const ii={lowest:We(Pe.lowest),low:We(Pe.low),default:We(Pe.default),high:We(Pe.high),highest:We(Pe.highest),fallback:We(Pe.lowest),extend:We(Pe.high),override:We(Pe.highest)};class cl{constructor(e,t){this.inner=e,this.prec=t}}class Zi{of(e){return new Kn(this,e)}reconfigure(e){return Zi.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Kn{constructor(e,t){this.compartment=e,this.inner=t}}class Ri{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of Qh(e,t,o))u instanceof _?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,m=c&&c[u]||[];if(d.every(y=>y.type==0))if(l[p.id]=a.length<<1|1,Vs(m,d))a.push(i.facet(p));else{let y=p.combine(d.map(b=>b.value));a.push(i&&p.compare(y,i.facet(p))?i.facet(p):y)}else{for(let y of d)y.type==0?(l[y.id]=a.length<<1|1,a.push(y.value)):(l[y.id]=h.length<<1,h.push(b=>y.dynamicSlot(b)));l[p.id]=h.length<<1,h.push(y=>Kh(y,p,d))}}let f=h.map(u=>u(l));return new Ri(e,o,f,l,a,r)}}function Qh(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a>=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof Kn&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof Kn){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof cl)r(o.inner,o.prec);else if(o instanceof _)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Ai)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,l);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,Pe.default),i.reduce((o,l)=>o.concat(l))}function lt(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function Ei(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const fl=k.define(),ul=k.define({combine:n=>n.some(e=>e),static:!0}),dl=k.define({combine:n=>n.length?n[0]:void 0,static:!0}),pl=k.define(),ml=k.define(),gl=k.define(),yl=k.define({combine:n=>n.length?n[0]:!1});class Je{constructor(e,t){this.type=e,this.value=t}static define(){return new Xh}}class Xh{of(e){return new Je(this,e)}}class Yh{constructor(e){this.map=e}of(e){return new A(this,e)}}class A{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new A(this.type,t)}is(e){return this.type==e}static define(e={}){return new Yh(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}A.reconfigure=A.define();A.appendConfig=A.define();class H{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&hl(i,t.newLength),r.some(l=>l.type==H.time)||(this.annotations=r.concat(H.time.of(Date.now())))}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(H.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}H.time=Je.define();H.userEvent=Je.define();H.addToHistory=Je.define();H.remote=Je.define();function Jh(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof H?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof H?n=r[0]:n=wl(e,Ot(r),!1)}return n}function Zh(n){let e=n.startState,t=e.facet(gl),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=bl(n,Qn(e,r,n.changes.newLength),!0))}return i==n?n:new H(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const ec=[];function Ot(n){return n==null?ec:Array.isArray(n)?n:[n]}var te=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(te||(te={}));const tc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Xn;try{Xn=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function ic(n){if(Xn)return Xn.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||tc.test(t)))return!0}return!1}function nc(n){return e=>{if(!/\S/.test(e))return te.Space;if(ic(e))return te.Word;for(let t=0;t-1)return te.Word;return te.Other}}class P{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(a,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(A.reconfigure)?(t=null,i=o.value):o.is(A.appendConfig)&&(t=null,i=Ot(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=Ri.resolve(i,s,this),r=new P(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,a)=>a.reconfigure(l,this),null).values),new P(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:g.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Ot(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}return P.create({doc:e.doc,selection:g.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Ri.resolve(e.extensions||[],new Map),i=e.doc instanceof E?e.doc:E.of((e.doc||"").split(t.staticFacet(P.lineSeparator)||Un)),s=e.selection?e.selection instanceof g?e.selection:g.single(e.selection.anchor,e.selection.head):g.single(0);return hl(s,i.length),t.staticFacet(ul)||(s=s.asSingle()),new P(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(P.tabSize)}get lineBreak(){return this.facet(P.lineSeparator)||` diff --git a/dist/assets/CollapseSection-a6fcd8bf.js b/dist/assets/CollapseSection-cb27678a.js similarity index 94% rename from dist/assets/CollapseSection-a6fcd8bf.js rename to dist/assets/CollapseSection-cb27678a.js index 9f06ec0f1b..1f3061fd00 100644 --- a/dist/assets/CollapseSection-a6fcd8bf.js +++ b/dist/assets/CollapseSection-cb27678a.js @@ -1,4 +1,4 @@ -import{r as g,a as s,j as i,i as v,b2 as y,s as l}from"./index-99a56692.js";const f=l.div` +import{r as g,a as s,j as i,i as v,b2 as y,s as l}from"./index-7074710c.js";const f=l.div` transition: height .25s; border-radius: .5em; margin: 0px 4px 0px 4px; diff --git a/dist/assets/ContentInfoCap-e1dc81ef.js b/dist/assets/ContentInfoCap-9714f9ea.js similarity index 93% rename from dist/assets/ContentInfoCap-e1dc81ef.js rename to dist/assets/ContentInfoCap-9714f9ea.js index 912dc6bf3c..a0e58e9408 100644 --- a/dist/assets/ContentInfoCap-e1dc81ef.js +++ b/dist/assets/ContentInfoCap-9714f9ea.js @@ -1 +1 @@ -import{l as r,w as p,m as g,a6 as u,G as h,a as n,F as l,j as i}from"./index-99a56692.js";import{f as x,a as b}from"./util-85d105b8.js";import"./util-38d8e238.js";function _(){const s=r(p),d=r(g("doenetId"));let{color:o,image:e,label:c}=u(s);const t=r(h(d));let a="course";if(!e)return null;e!="none"&&(a=x(e),e="url(./drive_pictures/"+e+")"),o!="none"&&(a=b(o),o="#"+o);let m=n(l,{children:[i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Activity"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:t==null?void 0:t.label})]});return n(l,{children:[i("div",{style:{position:"relative",width:"100%",height:"165px",overflow:"hidden"},children:i("img",{"aria-label":a,style:{position:"absolute",width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundImage:e,backgroundColor:o}})}),i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Course"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:c}),m]})}export{_ as default}; +import{l as r,w as p,m as g,a6 as u,G as h,a as n,F as l,j as i}from"./index-7074710c.js";import{f as x,a as b}from"./util-85d105b8.js";import"./util-38d8e238.js";function _(){const s=r(p),d=r(g("doenetId"));let{color:o,image:e,label:c}=u(s);const t=r(h(d));let a="course";if(!e)return null;e!="none"&&(a=x(e),e="url(./drive_pictures/"+e+")"),o!="none"&&(a=b(o),o="#"+o);let m=n(l,{children:[i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Activity"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:t==null?void 0:t.label})]});return n(l,{children:[i("div",{style:{position:"relative",width:"100%",height:"165px",overflow:"hidden"},children:i("img",{"aria-label":a,style:{position:"absolute",width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundImage:e,backgroundColor:o}})}),i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Course"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:c}),m]})}export{_ as default}; diff --git a/dist/assets/CourseCards-95d1a251.js b/dist/assets/CourseCards-8c3bc170.js similarity index 96% rename from dist/assets/CourseCards-95d1a251.js rename to dist/assets/CourseCards-8c3bc170.js index 8c3fd60b4f..102bd16f91 100644 --- a/dist/assets/CourseCards-95d1a251.js +++ b/dist/assets/CourseCards-8c3bc170.js @@ -1,4 +1,4 @@ -import{r as m,s as L,a as T,j as b,l as N,n as V,R as M,o as W,q as P,g as q,p as F,t as U,v as X,w as Y,x as G}from"./index-99a56692.js";import{d as H}from"./CourseToolHandler-f517d0e5.js";import"./index-ef9c2520.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-b3e258be.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-ea123297.js";function _(e,t,a){var o,c,d,h,p;t==null&&(t=100);function r(){var g=Date.now()-h;g=0?o=setTimeout(r,t-g):(o=null,a||(p=e.apply(d,c),d=c=null))}var w=function(){d=this,c=arguments,h=Date.now();var g=a&&!o;return o||(o=setTimeout(r,t)),g&&(p=e.apply(d,c),d=c=null),p};return w.clear=function(){o&&(clearTimeout(o),o=null)},w.flush=function(){o&&(p=e.apply(d,c),d=c=null,clearTimeout(o),o=null)},w}_.debounce=_;var $=_;function J(e){let{debounce:t,scroll:a,polyfill:o,offsetSize:c}=e===void 0?{debounce:0,scroll:!1,offsetSize:!1}:e;const d=o||(typeof window>"u"?class{}:window.ResizeObserver);if(!d)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[h,p]=m.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),r=m.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:h}),w=t?typeof t=="number"?t:t.scroll:null,g=t?typeof t=="number"?t:t.resize:null,C=m.useRef(!1);m.useEffect(()=>(C.current=!0,()=>void(C.current=!1)));const[R,y,S]=m.useMemo(()=>{const u=()=>{if(!r.current.element)return;const{left:K,top:n,width:i,height:s,bottom:f,right:v,x:l,y:A}=r.current.element.getBoundingClientRect(),z={left:K,top:n,width:i,height:s,bottom:f,right:v,x:l,y:A};r.current.element instanceof HTMLElement&&c&&(z.height=r.current.element.offsetHeight,z.width=r.current.element.offsetWidth),Object.freeze(z),C.current&&!te(r.current.lastBounds,z)&&p(r.current.lastBounds=z)};return[u,g?$(u,g):u,w?$(u,w):u]},[p,c,w,g]);function I(){r.current.scrollContainers&&(r.current.scrollContainers.forEach(u=>u.removeEventListener("scroll",S,!0)),r.current.scrollContainers=null),r.current.resizeObserver&&(r.current.resizeObserver.disconnect(),r.current.resizeObserver=null)}function k(){r.current.element&&(r.current.resizeObserver=new d(S),r.current.resizeObserver.observe(r.current.element),a&&r.current.scrollContainers&&r.current.scrollContainers.forEach(u=>u.addEventListener("scroll",S,{capture:!0,passive:!0})))}const O=u=>{!u||u===r.current.element||(I(),r.current.element=u,r.current.scrollContainers=j(u),k())};return Z(S,!!a),Q(y),m.useEffect(()=>{I(),k()},[a,S,y]),m.useEffect(()=>I,[]),[O,h,R]}function Q(e){m.useEffect(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function Z(e,t){m.useEffect(()=>{if(t){const a=e;return window.addEventListener("scroll",a,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",a,!0)}},[e,t])}function j(e){const t=[];if(!e||e===document.body)return t;const{overflow:a,overflowX:o,overflowY:c}=window.getComputedStyle(e);return[a,o,c].some(d=>d==="auto"||d==="scroll")&&t.push(e),[...t,...j(e.parentElement)]}const ee=["x","y","top","bottom","left","right","width","height"],te=(e,t)=>ee.every(a=>e[a]===t[a]),re=L.figure` +import{r as m,s as L,a as T,j as b,l as N,n as V,R as M,o as W,q as P,g as q,p as F,t as U,v as X,w as Y,x as G}from"./index-7074710c.js";import{d as H}from"./CourseToolHandler-8716455d.js";import"./index-67ec2c85.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-5b62de19.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-9136da6d.js";function _(e,t,a){var o,c,d,h,p;t==null&&(t=100);function r(){var g=Date.now()-h;g=0?o=setTimeout(r,t-g):(o=null,a||(p=e.apply(d,c),d=c=null))}var w=function(){d=this,c=arguments,h=Date.now();var g=a&&!o;return o||(o=setTimeout(r,t)),g&&(p=e.apply(d,c),d=c=null),p};return w.clear=function(){o&&(clearTimeout(o),o=null)},w.flush=function(){o&&(p=e.apply(d,c),d=c=null,clearTimeout(o),o=null)},w}_.debounce=_;var $=_;function J(e){let{debounce:t,scroll:a,polyfill:o,offsetSize:c}=e===void 0?{debounce:0,scroll:!1,offsetSize:!1}:e;const d=o||(typeof window>"u"?class{}:window.ResizeObserver);if(!d)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[h,p]=m.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),r=m.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:h}),w=t?typeof t=="number"?t:t.scroll:null,g=t?typeof t=="number"?t:t.resize:null,C=m.useRef(!1);m.useEffect(()=>(C.current=!0,()=>void(C.current=!1)));const[R,y,S]=m.useMemo(()=>{const u=()=>{if(!r.current.element)return;const{left:K,top:n,width:i,height:s,bottom:f,right:v,x:l,y:A}=r.current.element.getBoundingClientRect(),z={left:K,top:n,width:i,height:s,bottom:f,right:v,x:l,y:A};r.current.element instanceof HTMLElement&&c&&(z.height=r.current.element.offsetHeight,z.width=r.current.element.offsetWidth),Object.freeze(z),C.current&&!te(r.current.lastBounds,z)&&p(r.current.lastBounds=z)};return[u,g?$(u,g):u,w?$(u,w):u]},[p,c,w,g]);function I(){r.current.scrollContainers&&(r.current.scrollContainers.forEach(u=>u.removeEventListener("scroll",S,!0)),r.current.scrollContainers=null),r.current.resizeObserver&&(r.current.resizeObserver.disconnect(),r.current.resizeObserver=null)}function k(){r.current.element&&(r.current.resizeObserver=new d(S),r.current.resizeObserver.observe(r.current.element),a&&r.current.scrollContainers&&r.current.scrollContainers.forEach(u=>u.addEventListener("scroll",S,{capture:!0,passive:!0})))}const O=u=>{!u||u===r.current.element||(I(),r.current.element=u,r.current.scrollContainers=j(u),k())};return Z(S,!!a),Q(y),m.useEffect(()=>{I(),k()},[a,S,y]),m.useEffect(()=>I,[]),[O,h,R]}function Q(e){m.useEffect(()=>{const t=e;return window.addEventListener("resize",t),()=>void window.removeEventListener("resize",t)},[e])}function Z(e,t){m.useEffect(()=>{if(t){const a=e;return window.addEventListener("scroll",a,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",a,!0)}},[e,t])}function j(e){const t=[];if(!e||e===document.body)return t;const{overflow:a,overflowX:o,overflowY:c}=window.getComputedStyle(e);return[a,o,c].some(d=>d==="auto"||d==="scroll")&&t.push(e),[...t,...j(e.parentElement)]}const ee=["x","y","top","bottom","left","right","width","height"],te=(e,t)=>ee.every(a=>e[a]===t[a]),re=L.figure` margin: 0px; position: relative; background-size: cover; diff --git a/dist/assets/CourseChooserLeave-4b6fdccb.js b/dist/assets/CourseChooserLeave-4b6fdccb.js deleted file mode 100644 index 15a92c755f..0000000000 --- a/dist/assets/CourseChooserLeave-4b6fdccb.js +++ /dev/null @@ -1 +0,0 @@ -import{v as o,q as t}from"./index-99a56692.js";import{g as r,d as i}from"./CourseToolHandler-f517d0e5.js";import"./index-ef9c2520.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-b3e258be.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-ea123297.js";function S(){return o(({set:e})=>()=>{e(t,""),e(r,[]),e(i,[])})(),null}export{S as default}; diff --git a/dist/assets/CourseChooserLeave-ebee0fe3.js b/dist/assets/CourseChooserLeave-ebee0fe3.js new file mode 100644 index 0000000000..de438da276 --- /dev/null +++ b/dist/assets/CourseChooserLeave-ebee0fe3.js @@ -0,0 +1 @@ +import{v as o,q as t}from"./index-7074710c.js";import{g as r,d as i}from"./CourseToolHandler-8716455d.js";import"./index-67ec2c85.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-5b62de19.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-9136da6d.js";function S(){return o(({set:e})=>()=>{e(t,""),e(r,[]),e(i,[])})(),null}export{S as default}; diff --git a/dist/assets/CourseEnroll-0080511d.js b/dist/assets/CourseEnroll-14ae0e11.js similarity index 65% rename from dist/assets/CourseEnroll-0080511d.js rename to dist/assets/CourseEnroll-14ae0e11.js index 6e3ac2c5ef..7a5c1ec990 100644 --- a/dist/assets/CourseEnroll-0080511d.js +++ b/dist/assets/CourseEnroll-14ae0e11.js @@ -1 +1 @@ -import{y as e,a as l,j as t,B as n,z as s}from"./index-99a56692.js";import{B as a}from"./ButtonGroup-ea123297.js";function c(o){const r=e();return l("div",{style:o.style,children:[t("div",{children:"Enter Enrollment code"}),t(a,{vertical:!0,children:t(n,{onClick:()=>r("Stub Enrolled in Course!",s.SUCCESS),value:"Enroll",children:"Enroll"})})]})}export{c as default}; +import{y as e,a as l,j as t,B as n,z as s}from"./index-7074710c.js";import{B as a}from"./ButtonGroup-9136da6d.js";function c(o){const r=e();return l("div",{style:o.style,children:[t("div",{children:"Enter Enrollment code"}),t(a,{vertical:!0,children:t(n,{onClick:()=>r("Stub Enrolled in Course!",s.SUCCESS),value:"Enroll",children:"Enroll"})})]})}export{c as default}; diff --git a/dist/assets/CourseNavigator-119cf888.js b/dist/assets/CourseNavigator-d0c5e95b.js similarity index 98% rename from dist/assets/CourseNavigator-119cf888.js rename to dist/assets/CourseNavigator-d0c5e95b.js index 51fb0cade1..b98d14afa2 100644 --- a/dist/assets/CourseNavigator-119cf888.js +++ b/dist/assets/CourseNavigator-d0c5e95b.js @@ -1,4 +1,4 @@ -import{l as R,m as I,S as xe,r as _,R as ce,o as Be,v as W,T as H,q as se,G as g,j as i,s as $e,V as de,a as B,F as A,W as Y,X as U,Y as Q,Z as ne,_ as le,J as we,$ as pe,i as E,B as ie,a0 as N,a1 as Ce,a2 as De}from"./index-99a56692.js";import{M as Re}from"./index.esm-b3e258be.js";/* empty css */import{e as Ae}from"./RoleDropdown-5e05ae49.js";import{B as Te}from"./ButtonGroup-ea123297.js";const ae=$e.button` +import{l as R,m as I,S as xe,r as _,R as ce,o as Be,v as W,T as H,q as se,G as g,j as i,s as $e,V as de,a as B,F as A,W as Y,X as U,Y as Q,Z as ne,_ as le,J as we,$ as pe,i as E,B as ie,a0 as N,a1 as Ce,a2 as De}from"./index-7074710c.js";import{M as Re}from"./index.esm-5b62de19.js";/* empty css */import{e as Ae}from"./RoleDropdown-cce90708.js";import{B as Te}from"./ButtonGroup-9136da6d.js";const ae=$e.button` border: none; border-radius: 35px; &:focus { diff --git a/dist/assets/CourseToolHandler-f517d0e5.js b/dist/assets/CourseToolHandler-8716455d.js similarity index 99% rename from dist/assets/CourseToolHandler-f517d0e5.js rename to dist/assets/CourseToolHandler-8716455d.js index e073b04441..59dc90b10b 100644 --- a/dist/assets/CourseToolHandler-f517d0e5.js +++ b/dist/assets/CourseToolHandler-8716455d.js @@ -1,4 +1,4 @@ -import{r as B,av as _e,j as E,a as oe,v as K,ag as he,ax as Ne,ay as Y,az as q,y as Ke,aA as xt,ae as ce,k as P,z as j,N as ke,U as Lt,s as fe,l as Ie,g as ct,i as ae,J as Tt,b as Rt,a0 as Pe,F as me,B as xe,aB as _t}from"./index-99a56692.js";import{l as Je}from"./index-ef9c2520.js";import{f as We}from"./index-47ca4f11.js";import"./index.esm-b3e258be.js";/* empty css */import{B as Nt}from"./ButtonGroup-ea123297.js";const Ae=96,Se=123,Ft=97,Pt=98,Bt=122;function Ut(n,e){let t,i,r=0,s="";for(;t==i;)t=r{s===n&&t(!1)};return B.useEffect(()=>(window.addEventListener("keydown",i),window.addEventListener("keyup",r),()=>{window.removeEventListener("keydown",i),window.removeEventListener("keyup",r)}),[]),e}const $t=_e.createContext(),qt=({children:n,id:e,registerDropTarget:t,unregisterDropTarget:i,dropCallbacks:r})=>{const s=B.useRef(),{onDragOver:o,onDragHover:a,onDrop:c,onDragEnter:d,onDragExit:l}=r;return B.useEffect(()=>(t({id:e,ref:s.current,onDragOver:o,onDragHover:a,onDragEnter:d,onDragExit:l,onDrop:c}),()=>{i(e)}),[e,t,i]),E("div",{ref:s,children:n})},Xe={x:0,y:0},Vt=({children:n,id:e,className:t="",onDragStart:i,onDrag:r,onDragEnd:s,ghostElement:o=null})=>{const[a,c]=B.useState({isDragging:!1,origin:Xe,translation:Xe,actionType:null}),d=B.useRef(null),l=B.useRef(null),[v,u]=B.useState(!1),k=B.useCallback(m=>{m.button===0&&(u(!0),l.current={...m},d.current=setTimeout(()=>{var b,S;let w=l.current,p=w.clientX,f=w.clientY,D="mouse";w.type==="touchstart"&&(p=(b=w.touches[0])==null?void 0:b.clientX,f=(S=w.touches[0])==null?void 0:S.clientY,D="touch"),c(L=>({...L,isDragging:!0,origin:{x:p,y:f},actionType:D})),i==null||i({ev:l.current}),d.current=null},300))},[i,e]),y=B.useCallback(()=>{d.current?clearTimeout(d.current):(c(m=>({...m,isDragging:!1,actionType:null})),s==null||s()),u(!1)},[s]),g=B.useCallback(m=>{var D,b;if(!a.isDragging)return;let w=m.clientX,p=m.clientY;m.type==="touchmove"&&(w=(D=m.touches[0])==null?void 0:D.clientX,p=(b=m.touches[0])==null?void 0:b.clientY);const f={x:w-a.origin.x,y:p-a.origin.y};c(S=>({...S,translation:f})),r==null||r({clientX:w,clientY:p,translation:f,id:e,ev:m})},[a.origin,r,e]);B.useEffect(()=>(v?(window.addEventListener("mouseup",y),window.addEventListener("touchend",y)):(window.removeEventListener("mouseup",y),window.removeEventListener("touchend",y)),()=>{window.removeEventListener("mouseup",y),window.removeEventListener("touchend",y)}),[v,y]),B.useEffect(()=>(a.isDragging?(window.addEventListener("mousemove",g),window.addEventListener("touchmove",g)):(window.removeEventListener("mousemove",g),window.removeEventListener("touchmove",g),c(m=>({...m,translation:{x:0,y:0}}))),()=>{window.removeEventListener("mousemove",g),window.removeEventListener("touchmove",g)}),[a.isDragging,g]);const I={cursor:a.isDragging?"-webkit-grabbing":"-webkit-grab",transition:a.isDragging?"none":"transform 500ms"},A={cursor:a.isDragging?"-webkit-grabbing":"-webkit-grab",transform:a.isDragging?`translate(${a.translation.x}px, ${a.translation.y}px)`:"",transition:a.isDragging?"visibility 0s, opacity 0.2s linear":"visibility 0s, opacity 0.2s linear, transform 500ms",zIndex:a.isDragging?2:1,opacity:a.isDragging?1:0,visibility:a.isDragging?"visible":"hidden",height:a.isDragging?"auto":"0",position:a.isDragging?"absolute":"relative",left:a.origin.x,top:a.origin.y};return oe("div",{className:t,style:I,onMouseDown:k,onTouchStart:k,children:[n,E("div",{style:A,children:o})]},`draggable${e}`)},X="dragShadow",dt=()=>{const n=K(({snapshot:r})=>async()=>{const{dragShadowDriveId:s,dragShadowParentId:o}=await r.getPromise(ee),a=await r.getPromise(M);if(!s||!o)return;let c=null;s&&o&&(c=await r.getPromise(R({driveId:s,folderId:o})));let d=c==null?void 0:c.contentIds[x.DEFAULT],l=d==null?void 0:d.indexOf(X);return l<0?{}:{targetDriveId:s,targetFolderId:o,index:l,numItems:a.length}}),e=K(({snapshot:r,set:s})=>async({driveIdFolderId:o,position:a,parentId:c,itemId:d})=>{const{dragShadowDriveId:l,dragShadowParentId:v,draggedItemsId:u,copyMode:k}=await r.getPromise(ee);if(!k&&u&&(u!=null&&u.has(d))){t();return}const y={assignmentId:null,doenetId:null,cid:null,creationDate:"",isPublished:"0",itemId:X,itemType:"DragShadow",label:"",parentFolderId:c,url:null,urlDescription:null,urlId:null},g=a,I=c;let A=null;if(l&&v&&(A=await r.getPromise(R({driveId:l,folderId:v}))),A&&s(R({driveId:l,folderId:v}),m=>{let w={...m},p=[...w.contentIds[x.DEFAULT]];p=p.filter(D=>D!==X);const f={[x.DEFAULT]:p};return w.contentIds=f,w}),g==="intoCurrent"){if(u&&(u!=null&&u.has(o.folderId)))return;s(R(o),m=>{let w={...m},p={...m.contentsDictionary},f=[...w.contentIds[x.DEFAULT]];p[X]=y,v===I&&(f=f.filter(b=>b!==X)),f.splice(0,0,X);const D={[x.DEFAULT]:f};return w.contentIds=D,w.contentsDictionary=p,w}),s(ee,m=>({...m,dragShadowDriveId:o.driveId,dragShadowParentId:o.folderId}))}else{const m=({draggedItemsId:p,contentIdsArr:f,index:D})=>{if((p==null?void 0:p.size)>1)return!0;let b=!0,S=null,L=null;return f.length!==0&&(D<=0?S=f[0]:D>=f.length?L=f[f.length-1]:(L=f[D-1],S=f[D]),L&&(p!=null&&p.has(L))&&(b=!1),S&&(p!=null&&p.has(S))&&(b=!1)),b};let w=!0;s(R({driveId:o.driveId,folderId:I}),p=>{let f={...p},D={...p.contentsDictionary},b=[...f.contentIds[x.DEFAULT]];D[X]=y,v===I&&(b=b.filter(T=>T!==X));let S=b.indexOf(d);g==="afterCurrent"&&(S+=1),w=k||m({draggedItemsId:u,contentIdsArr:b,index:S}),w&&b.splice(S,0,X);const L={[x.DEFAULT]:b};return f.contentIds=L,f.contentsDictionary=D,f}),w&&s(ee,p=>({...p,dragShadowDriveId:o.driveId,dragShadowParentId:I}))}}),t=K(({snapshot:r,set:s})=>async()=>{const{dragShadowDriveId:o,dragShadowParentId:a}=await r.getPromise(ee);!o||!a||(s(R({driveId:o,folderId:a}),c=>{let d={...c},l=[...d.contentIds[x.DEFAULT]];l=l.filter(u=>u!==X);const v={[x.DEFAULT]:l};return d.contentIds=v,d}),s(ee,c=>({...c,dragShadowDriveId:null,dragShadowParentId:null})))}),i=K(({snapshot:r,set:s})=>async()=>{const{dragShadowDriveId:o,dragShadowParentId:a,openedFoldersInfo:c}=await r.getPromise(ee);let d=[...c],l=[];if(o&&a){let v=await r.getPromise($n({driveId:o,folderId:a})),u=new Set(v.map(k=>k.folderId));for(let k of d)!(k.driveId===o&&u.has(k.itemId))&&l.push(k)}else l=d;for(let v of l)s(ve(v),!1)});return{insertDragShadow:e,removeDragShadow:t,replaceDragShadow:n,cleanUpDragShadow:i}},Z=Object.create(null);Z.open="0";Z.close="1";Z.ping="2";Z.pong="3";Z.message="4";Z.upgrade="5";Z.noop="6";const Le=Object.create(null);Object.keys(Z).forEach(n=>{Le[Z[n]]=n});const Ht={type:"error",data:"parser error"},zt=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Kt=typeof ArrayBuffer=="function",Yt=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,lt=({type:n,data:e},t,i)=>zt&&e instanceof Blob?t?i(e):je(e,i):Kt&&(e instanceof ArrayBuffer||Yt(e))?t?i(e):je(new Blob([e]),i):i(Z[n]+(e||"")),je=(n,e)=>{const t=new FileReader;return t.onload=function(){const i=t.result.split(",")[1];e("b"+i)},t.readAsDataURL(n)},Qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ge=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n{let e=n.length*.75,t=n.length,i,r=0,s,o,a,c;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const d=new ArrayBuffer(e),l=new Uint8Array(d);for(i=0;i>4,l[r++]=(o&15)<<4|a>>2,l[r++]=(a&3)<<6|c&63;return d},Jt=typeof ArrayBuffer=="function",ht=(n,e)=>{if(typeof n!="string")return{type:"message",data:ft(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:Wt(n.substring(1),e)}:Le[t]?n.length>1?{type:Le[t],data:n.substring(1)}:{type:Le[t]}:Ht},Wt=(n,e)=>{if(Jt){const t=Gt(n);return ft(t,e)}else return{base64:!0,data:n}},ft=(n,e)=>{switch(e){case"blob":return n instanceof ArrayBuffer?new Blob([n]):n;case"arraybuffer":default:return n}},ut=String.fromCharCode(30),Xt=(n,e)=>{const t=n.length,i=new Array(t);let r=0;n.forEach((s,o)=>{lt(s,!1,a=>{i[o]=a,++r===t&&e(i.join(ut))})})},jt=(n,e)=>{const t=n.split(ut),i=[];for(let r=0;rtypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function mt(n,...e){return e.reduce((t,i)=>(n.hasOwnProperty(i)&&(t[i]=n[i]),t),{})}const Zt=setTimeout,en=clearTimeout;function Fe(n,e){e.useNativeTimers?(n.setTimeoutFn=Zt.bind(ie),n.clearTimeoutFn=en.bind(ie)):(n.setTimeoutFn=setTimeout.bind(ie),n.clearTimeoutFn=clearTimeout.bind(ie))}const tn=1.33;function nn(n){return typeof n=="string"?rn(n):Math.ceil((n.byteLength||n.size)*tn)}function rn(n){let e=0,t=0;for(let i=0,r=n.length;i=57344?t+=3:(i++,t+=4);return t}class sn extends Error{constructor(e,t,i){super(e),this.description=t,this.context=i,this.type="TransportError"}}class yt extends ${constructor(e){super(),this.writable=!1,Fe(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t,i){return super.emitReserved("error",new sn(e,t,i)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=ht(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}const gt="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),$e=64,on={};let Ze=0,Oe=0,et;function tt(n){let e="";do e=gt[n%$e]+e,n=Math.floor(n/$e);while(n>0);return e}function It(){const n=tt(+new Date);return n!==et?(Ze=0,et=n):n+"."+tt(Ze++)}for(;Oe<$e;Oe++)on[gt[Oe]]=Oe;function vt(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function an(n){let e={},t=n.split("&");for(let i=0,r=t.length;i{this.readyState="paused",e()};if(this.polling||!this.writable){let i=0;this.polling&&(i++,this.once("pollComplete",function(){--i||t()})),this.writable||(i++,this.once("drain",function(){--i||t()}))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=i=>{if(this.readyState==="opening"&&i.type==="open"&&this.onOpen(),i.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(i)};jt(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Xt(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let i="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=It()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(t==="https"&&Number(this.opts.port)!==443||t==="http"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port);const r=vt(e),s=this.opts.hostname.indexOf(":")!==-1;return t+"://"+(s?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new Q(this.uri(),e)}doWrite(e,t){const i=this.request({method:"POST",data:e});i.on("success",t),i.on("error",(r,s)=>{this.onError("xhr post error",r,s)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,i)=>{this.onError("xhr poll error",t,i)}),this.pollXhr=e}}class Q extends ${constructor(e,t){super(),Fe(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=t.async!==!1,this.data=t.data!==void 0?t.data:null,this.create()}create(){const e=mt(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new bt(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&t.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{t.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{t.readyState===4&&(t.status===200||t.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof t.status=="number"?t.status:0)},0))},t.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Q.requestsCount++,Q.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=dn,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Q.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Q.requestsCount=0;Q.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",nt);else if(typeof addEventListener=="function"){const n="onpagehide"in ie?"pagehide":"unload";addEventListener(n,nt,!1)}}function nt(){for(let n in Q.requests)Q.requests.hasOwnProperty(n)&&Q.requests[n].abort()}const Dt=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0))(),Ee=ie.WebSocket||ie.MozWebSocket,it=!0,fn="arraybuffer",rt=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class un extends yt{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,i=rt?{}:mt(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=it&&!rt?t?new Ee(e,t):new Ee(e):new Ee(e,t,i)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType||fn,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t{const o={};try{it&&this.ws.send(s)}catch{}r&&Dt(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let i="";this.opts.port&&(t==="wss"&&Number(this.opts.port)!==443||t==="ws"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=It()),this.supportsBinary||(e.b64=1);const r=vt(e),s=this.opts.hostname.indexOf(":")!==-1;return t+"://"+(s?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(r.length?"?"+r:"")}check(){return!!Ee}}const pn={websocket:un,polling:hn},mn=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,yn=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function qe(n){const e=n,t=n.indexOf("["),i=n.indexOf("]");t!=-1&&i!=-1&&(n=n.substring(0,t)+n.substring(t,i).replace(/:/g,";")+n.substring(i,n.length));let r=mn.exec(n||""),s={},o=14;for(;o--;)s[yn[o]]=r[o]||"";return t!=-1&&i!=-1&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=gn(s,s.path),s.queryKey=In(s,s.query),s}function gn(n,e){const t=/\/{2,9}/g,i=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&i.splice(0,1),e.slice(-1)=="/"&&i.splice(i.length-1,1),i}function In(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,r,s){r&&(t[r]=s)}),t}let kt=class le extends ${constructor(e,t={}){super(),e&&typeof e=="object"&&(t=e,e=null),e?(e=qe(e),t.hostname=e.host,t.secure=e.protocol==="https"||e.protocol==="wss",t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=qe(t.host).host),Fe(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=an(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=pt,t.transport=e,this.id&&(t.sid=this.id);const i=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new pn[e](i)}open(){let e;if(this.opts.rememberUpgrade&&le.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(e){let t=this.createTransport(e),i=!1;le.priorWebsocketSuccess=!1;const r=()=>{i||(t.send([{type:"ping",data:"probe"}]),t.once("packet",v=>{if(!i)if(v.type==="pong"&&v.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;le.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(l(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const u=new Error("probe error");u.transport=t.name,this.emitReserved("upgradeError",u)}}))};function s(){i||(i=!0,l(),t.close(),t=null)}const o=v=>{const u=new Error("probe error: "+v);u.transport=t.name,s(),this.emitReserved("upgradeError",u)};function a(){o("transport closed")}function c(){o("socket closed")}function d(v){t&&v.name!==t.name&&s()}const l=()=>{t.removeListener("open",r),t.removeListener("error",o),t.removeListener("close",a),this.off("close",c),this.off("upgrading",d)};t.once("open",r),t.once("error",o),t.once("close",a),this.once("close",c),this.once("upgrading",d),t.open()}onOpen(){if(this.readyState="open",le.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let e=0;const t=this.upgrades.length;for(;e{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let i=0;i0&&t>this.maxPayload)return this.writeBuffer.slice(0,i);t+=2}return this.writeBuffer}write(e,t,i){return this.sendPacket("message",e,t,i),this}send(e,t,i){return this.sendPacket("message",e,t,i),this}sendPacket(e,t,i,r){if(typeof t=="function"&&(r=t,t=void 0),typeof i=="function"&&(r=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;const s={type:e,data:t,options:i};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},i=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():e()}):this.upgrading?i():e()),this}onError(e){le.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let i=0;const r=e.length;for(;itypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,At=Object.prototype.toString,Dn=typeof Blob=="function"||typeof Blob<"u"&&At.call(Blob)==="[object BlobConstructor]",kn=typeof File=="function"||typeof File<"u"&&At.call(File)==="[object FileConstructor]";function Ye(n){return wn&&(n instanceof ArrayBuffer||bn(n))||Dn&&n instanceof Blob||kn&&n instanceof File}function Te(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,i=n.length;t=0&&n.num0;case C.ACK:case C.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class Cn{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=Sn(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const xn=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ge,Encoder:En,get PacketType(){return C},protocol:On},Symbol.toStringTag,{value:"Module"}));function G(n,e,t){return n.on(e,t),function(){n.off(e,t)}}const Ln=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class St extends ${constructor(e,t,i){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,i&&i.auth&&(this.auth=i.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[G(e,"open",this.onopen.bind(this)),G(e,"packet",this.onpacket.bind(this)),G(e,"error",this.onerror.bind(this)),G(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(Ln.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');t.unshift(e);const i={type:C.EVENT,data:t};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const o=this.ids++,a=t.pop();this._registerAckCallback(o,a),i.id=o}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,t){const i=this.flags.timeout;if(i===void 0){this.acks[e]=t;return}const r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let s=0;s{this.io.clearTimeoutFn(r),t.apply(this,[null,...s])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this.packet({type:C.CONNECT,data:e})}):this.packet({type:C.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case C.CONNECT:if(e.data&&e.data.sid){const r=e.data.sid;this.onconnect(r)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case C.EVENT:case C.BINARY_EVENT:this.onevent(e);break;case C.ACK:case C.BINARY_ACK:this.onack(e);break;case C.DISCONNECT:this.ondisconnect();break;case C.CONNECT_ERROR:this.destroy();const i=new Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const i of t)i.apply(this,e)}super.emit.apply(this,e)}ack(e){const t=this;let i=!1;return function(...r){i||(i=!0,t.packet({type:C.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:C.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let i=0;i0&&n.jitter<=1?n.jitter:0,this.attempts=0}ue.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=Math.floor(e*10)&1?n+t:n-t}return Math.min(n,this.max)|0};ue.prototype.reset=function(){this.attempts=0};ue.prototype.setMin=function(n){this.ms=n};ue.prototype.setMax=function(n){this.max=n};ue.prototype.setJitter=function(n){this.jitter=n};class Re extends ${constructor(e,t){var i;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,Fe(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((i=t.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new ue({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||xn;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new kt(this.uri,this.opts);const t=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;const r=G(t,"open",function(){i.onopen(),e&&e()}),s=G(t,"error",o=>{i.cleanup(),i._readyState="closed",this.emitReserved("error",o),e?e(o):i.maybeReconnectOnOpen()});if(this._timeout!==!1){const o=this._timeout;o===0&&r();const a=this.setTimeoutFn(()=>{r(),t.close(),t.emit("error",new Error("timeout"))},o);this.opts.autoUnref&&a.unref(),this.subs.push(function(){clearTimeout(a)})}return this.subs.push(r),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(G(e,"ping",this.onping.bind(this)),G(e,"data",this.ondata.bind(this)),G(e,"error",this.onerror.bind(this)),G(e,"close",this.onclose.bind(this)),G(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){Dt(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let i=this.nsps[e];return i||(i=new St(this,e,t),this.nsps[e]=i),i}_destroy(e){const t=Object.keys(this.nsps);for(const i of t)if(this.nsps[i].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let i=0;ie()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const i=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(r=>{r?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",r)):e.onreconnect()}))},t);this.opts.autoUnref&&i.unref(),this.subs.push(function(){clearTimeout(i)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const ye={};function Be(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=vn(n,e.path||"/socket.io"),i=t.source,r=t.id,s=t.path,o=ye[r]&&s in ye[r].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let c;return a?c=new Re(i,e):(ye[r]||(ye[r]=new Re(i,e)),c=ye[r]),t.query&&!e.query&&(e.query=t.queryKey),c.socket(t.path,e)}Object.assign(Be,{Manager:Re,Socket:St,io:Be,connect:Be});const Tn=he({key:"socketManger",default:Ne({key:"socketManger/Default",get:()=>new Re("http://localhost:81",{withCredentials:!0}),dangerouslyAllowMutability:!0}),dangerouslyAllowMutability:!0});Y({key:"socketStore",default:q({key:"socketStore/Default",get:n=>({get:e})=>e(Tn).socket(`/${n}`),dangerouslyAllowMutability:!0}),dangerouslyAllowMutability:!0});const Ue=Object.freeze({FOLDER:"Folder",DOENETML:"DoenetML",URL:"Url",COLLECTION:"Collection"});function Rn(n){const e=Ke(),t="dragShadow",{acceptAddItem:i,acceptDeleteItem:r,acceptMoveItems:s,acceptRenameItem:o}=_n(),a=K(({snapshot:y})=>async({driveIdFolderId:g,type:I,label:A="Untitled",selectedItemId:m=null,url:w=null})=>{const f=xt(new Date),D=ce(),b=ce(),S=ce(),L=await y.getPromise(R(g));let T=JSON.parse(JSON.stringify(L)),U=[...T.contentIds[x.DEFAULT]],V=U.indexOf(m);const N=Me({index:V,nodeObjs:T.contentsDictionary,defaultFolderChildrenIds:U});let h={driveId:g.driveId,parentFolderId:g.folderId,doenetId:b,itemId:D,versionId:S,type:I,label:A,sortOrder:N,selectedItemId:m,creationDate:f,url:w};I==="DoenetML"&&(h={...h,assignedDate:null,attemptAggregation:"m",dueDate:null,gradeCategory:"",individualize:!0,isAssigned:"0",isPublished:"0",cid:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",numberOfAttemptsAllowed:"1",showFinishButton:!1,proctorMakesAvailable:!1,autoSubmit:!1,showCorrectness:!0,showFeedback:!0,showHints:!0,showSolution:!0,showSolutionInGradebook:!0,timeLimit:null,totalPointsOrPercent:"10",assignment_isPublished:"0"}),I===Ue.COLLECTION&&(h={...h,assignedDate:null,attemptAggregation:"m",dueDate:null,gradeCategory:"",individualize:!0,isAssigned:"0",isPublished:"0",cid:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",numberOfAttemptsAllowed:"1",showFinishButton:!1,proctorMakesAvailable:!1,autoSubmit:!1,showCorrectness:!0,showFeedback:!0,showHints:!0,showSolution:!0,showSolutionInGradebook:!0,timeLimit:null,totalPointsOrPercent:"10",assignment_isPublished:"0"});try{const O=await P.post("/api/addItem.php",h);console.log("resp from add item",O),O.data.success?i(h):e(`Add item error: ${O.data.message}`,j.ERROR)}catch(O){console.error(O)}}),c=K(()=>async({driveIdFolderId:y,driveInstanceId:g=null,itemId:I,label:A})=>{const m={driveId:y.driveId,parentFolderId:y.folderId,itemId:I,label:A,driveInstanceId:g};try{const w=await P.get("/api/deleteItem.php",{params:m});w.data.success?r(m):e(`Delete item error: ${w.data.message}`,j.ERROR)}catch(w){console.log(w)}}),d=K(({snapshot:y,set:g})=>async({targetDriveId:I,targetFolderId:A,index:m})=>{var V,N;const w=await y.getPromise(M);let p=await y.getPromise(R({driveId:I,folderId:A}));if(w.length===0)throw"No items selected";for(let h of w){const O=await y.getPromise(R({driveId:h.driveId,folderId:h.parentFolderId}));if(h.itemId===A)throw"Cannot move folder into itself";if(p.folderInfo.itemType===Ue.COLLECTION&&O.contentsDictionary[h.itemId].itemType!==Ue.DOENETML)throw e(`Can not ${O.contentsDictionary[h.itemId].itemType}s into a Collection`,j.ERROR),`Can not ${O.contentsDictionary[h.itemId].itemType}s into a Collection`}let f=JSON.parse(JSON.stringify(p)),D={},b=[];const S=m??0;let L="";for(let h of w){let O={driveId:h.driveId,driveInstanceId:h.driveInstanceId,itemId:h.itemId};g(z(O),!1);const H=await y.getPromise(R({driveId:h.driveId,folderId:h.parentFolderId}));let F=(V=D[h.driveId])==null?void 0:V[h.parentFolderId];if(F||(F=JSON.parse(JSON.stringify(H))),h.parentFolderId!==A){let _=F.contentIds.defaultOrder.indexOf(h.itemId);F.contentIds.defaultOrder.splice(_,1),f.contentsDictionary[h.itemId]={...F.contentsDictionary[h.itemId]},f.contentsDictionaryByDoenetId||(f.contentsDictionaryByDoenetId={}),f.contentsDictionaryByDoenetId[F.contentsDictionary[h.itemId].doenetId]={...F.contentsDictionary[h.itemId]},delete F.contentsDictionaryByDoenetId[F.contentsDictionary[h.itemId].doenetId],delete F.contentsDictionary[h.itemId],D[h.driveId]||(D[h.driveId]={}),D[h.driveId][h.parentFolderId]=F,f.contentIds.defaultOrder.splice(S,0,h.itemId)}else f.contentIds.defaultOrder.splice(S,0,t),f.contentIds.defaultOrder=f.contentIds.defaultOrder.filter(_=>_!==h.itemId),f.contentIds.defaultOrder.splice(f.contentIds.defaultOrder.indexOf(t),1,h.itemId);const re=f.contentIds.defaultOrder.filter(_=>_!==t);if(L=Me({index:S,nodeObjs:f.contentsDictionary,defaultFolderChildrenIds:re}),f.contentsDictionary[h.itemId].sortOrder=L,f.contentsDictionary[h.itemId].parentFolderId=A,H.contentsDictionary[h.itemId].itemType==="Folder"){const _=await y.getPromise(R({driveId:h.driveId,folderId:h.itemId}));g(R({driveId:I,folderId:h.itemId}),()=>{let J={..._};return J.folderInfo={..._.folderInfo},J.folderInfo.parentFolderId=A,J})}if(h.driveId!==I&&(b.push(h.itemId),H.contentsDictionary[h.itemId].itemType==="Folder")){let _=[],J=[h.itemId];for(;J.length;){let be=J.length;for(let te=0;teasync({driveIdFolderId:y,itemId:g,itemType:I,newLabel:A})=>{const m={instruction:"rename",driveId:y.driveId,folderId:y.folderId,itemId:g,label:A,type:I};try{const w=await P.get("/api/updateItem.php",{params:m});w.data.success?o(m):e(`Rename item error: ${w.data.message}`,j.ERROR)}catch(w){console.log(w)}}),v=K(({snapshot:y,set:g})=>async({items:I=[],targetDriveId:A,targetFolderId:m,index:w})=>{if(I.length===0)throw"No items to be copied";let p=await y.getPromise(R({driveId:A,folderId:m})),f=JSON.parse(JSON.stringify(p));const D=w??0;let b="";const L=Nn(new Date);let T={},U={};for(let h of I){if(!h.driveId||!h.driveInstanceId||!h.itemId)throw"Invalid arguments error";let O={driveId:h.driveId,driveInstanceId:h.driveInstanceId,itemId:h.itemId};g(z(O),!1);const{newItemId:H,newItem:F}=await u({snapshot:y,globalDictionary:T,globalContentIds:U,creationTimestamp:L,item:h,targetDriveId:A,targetFolderId:m});if(h.driveId===A){const _=`Copy of ${F.label}`;F.label=_}const re=f.contentIds.defaultOrder.filter(_=>_!==t);b=Me({index:D,nodeObjs:f.contentsDictionary,defaultFolderChildrenIds:re}),F.sortOrder=b,f.contentsDictionary[H]=F,f.contentIds.defaultOrder.splice(D,0,H)}g(M,[]);let V=[];for(let h of Object.keys(T)){let O=T[h];const H={driveId:A,parentFolderId:O.parentFolderId,itemId:h,doenetId:O.doenetId,versionId:O.versionId,label:O.label,type:O.itemType,sortOrder:O.sortOrder,isNewCopy:"1"};if(O.itemType==="DoenetML"){const re=k({item:O,timestamp:L});V.push(P.post("/api/saveNewVersion.php",re))}const F=P.get("/api/addItem.php",{params:H});V.push(F)}return Promise.allSettled(V).then(([h])=>{var O,H;if((H=(O=h.value)==null?void 0:O.data)!=null&&H.success){g(R({driveId:A,folderId:m}),f);for(let F of Object.keys(T))if(T[F].itemType==="Folder"){let _=[F];for(;_.length;){const J=_.length;for(let be=0;be{console.error(h)}),await Promise.allSettled(V)}),u=async({snapshot:y,globalDictionary:g={},globalContentIds:I={},creationTimestamp:A,item:m,targetDriveId:w,targetFolderId:p})=>{const D=(await y.getPromise(R({driveId:m.driveId,folderId:m.parentFolderId}))).contentsDictionary[m.itemId],b={...D},S=ce();if(b.itemId=S,b.doenetId=ce(),b.versionId=ce(),b.previousDoenetId=D.doenetId,D.itemType==="Folder"){const{contentIds:L}=await y.getPromise(R({driveId:m.driveId,folderId:m.itemId}));I[S]=[];for(let T of L[x.DEFAULT]){let U={...m,parentFolderId:m.itemId,itemId:T};const N=(await u({snapshot:y,globalDictionary:g,globalContentIds:I,creationTimestamp:A,item:U,targetFolderId:S,targetDriveId:w})).newItemId;I[S].push(N)}}return b.parentFolderId=p,b.creationDate=A,g[S]=b,{newItemId:S,newItem:b}},k=({item:y,timestamp:g})=>({title:y.label,doenetId:y.doenetId,cid:y.cid,versionId:y.versionId,timestamp:g,isDraft:"0",isNamed:"1",isNewCopy:"1",doenetML:y.doenetML,previousDoenetId:y.previousDoenetId});return{addItem:a,deleteItem:c,moveItems:d,renameItem:l,copyItems:v}}function _n(){const n=Ke(),e=K(({snapshot:s,set:o})=>async({driveId:a,parentFolderId:c,doenetId:d,versionId:l,itemId:v,type:u,label:k,sortOrder:y,creationDate:g,url:I,selectedItemId:A})=>{const m={parentFolderId:c,doenetId:d,versionId:l,itemId:v,itemType:u,label:k,sortOrder:y,creationDate:g,isPublished:"0",url:I,urlDescription:null,urlId:null},w=await s.getPromise(R({driveId:a,folderId:c}));let p=JSON.parse(JSON.stringify(w)),f=[...p.contentIds[x.DEFAULT]],D=f.indexOf(A);f.splice(D+1,0,v),p.contentIds[x.DEFAULT]=f,p.contentsDictionary[v]=m,p.contentsDictionaryByDoenetId[d]=m,o(R({driveId:a,folderId:c}),p),(u==="Folder"||u==="Collection")&&o(R({driveId:a,folderId:v}),{folderInfo:m,contentsDictionary:{},contentIds:{[x.DEFAULT]:[]}}),n("Add new item 'Untitled'",j.SUCCESS)},[n]),t=K(({snapshot:s,set:o})=>async({driveId:a,parentFolderId:c,itemId:d,driveInstanceId:l,label:v})=>{const u=await s.getPromise(R({driveId:a,folderId:c})),k=await s.getPromise(M),y={driveId:a,driveInstanceId:l,itemId:d};if(await s.getPromise(z(y))){o(z(y),!1);let m=[];for(let w of k)w.itemId!==d&&m.push(w);o(M,m)}let I={...u};I.contentsDictionary={...u.contentsDictionary},I.contentsDictionaryByDoenetId={...u.contentsDictionaryByDoenetId},delete I.contentsDictionaryByDoenetId[I.contentsDictionary[d].doenetId],delete I.contentsDictionary[d],I.folderInfo={...u.folderInfo},I.contentIds={},I.contentIds[x.DEFAULT]=[...u.contentIds[x.DEFAULT]];const A=I.contentIds[x.DEFAULT].indexOf(d);I.contentIds[x.DEFAULT].splice(A,1),o(R({driveId:a,folderId:c}),I),n(`Deleted item '${v}'`,j.SUCCESS)}),i=K(({set:s})=>(o,a,c)=>{s(M,[]),s(R({driveId:o.destinationDriveId,folderId:o.destinationItemId}),a);for(let d of Object.keys(c))for(let l of Object.keys(c[d]))s(R({driveId:d,folderId:l}),c[d][l]),s(ze({driveId:d,folderId:l}),!0);s(ze({driveId:o.destinationDriveId,folderId:o.destinationItemId}),!0)},[]),r=K(({snapshot:s,set:o})=>async({driveId:a,folderId:c,itemId:d,label:l,type:v})=>{const u=await s.getPromise(R({driveId:a,folderId:c}));let k={...u};k.contentsDictionary={...u.contentsDictionary},k.contentsDictionaryByDoenetId={...u.contentsDictionaryByDoenetId},k.contentsDictionary[d]={...u.contentsDictionary[d]},k.contentsDictionary[d].label=l,k.contentsDictionaryByDoenetId[k.contentsDictionary[d].doenetId]={...u.contentsDictionary[d]},k.contentsDictionaryByDoenetId[k.contentsDictionary[d].doenetId].label=l,o(R({driveId:a,folderId:c}),k),(v==="Folder"||v==="Collection")&&o(R({driveId:a,folderId:d}),y=>{let g={...y};return g.folderInfo={...y.folderInfo},g.folderInfo.label=l,g}),n(`Renamed item to '${l}'`,j.SUCCESS)});return{acceptAddItem:e,acceptDeleteItem:t,acceptMoveItems:i,acceptRenameItem:r}}const Nn=n=>`${n.getFullYear().toString().padStart(2,"0")}-${(n.getMonth()+1).toString().padStart(2,"0")}-${n.getDate().toString().padStart(2,"0")} ${n.getHours().toString().padStart(2,"0")}:${n.getMinutes().toString().padStart(2,"0")}:${n.getSeconds().toString().padStart(2,"0")}`;B.createContext({});const st=Y({key:"loadAssignmentAtomFamily",default:q({key:"loadAssignmentAtomFamily/Default",get:n=>async()=>{const{data:e}=await P.get("/api/getAllAssignmentSettings.php",{params:{doenetId:n}});let t={...e.assignment};return t.assignedDate&&(t.assignedDate=ke(t.assignedDate).toLocaleString()),t.dueDate&&(t.dueDate=ke(t.dueDate).toLocaleString()),t.pinnedAfterDate&&(t.pinnedAfterDate=ke(t.pinnedAfterDate).toLocaleString()),t.pinnedUntilDate&&(t.pinnedUntilDate=ke(t.pinnedUntilDate).toLocaleString()),t}})}),Ot=q({key:"loadAssignmentSelector",get:n=>async({get:e})=>await e(st(n)),set:n=>({set:e},t)=>{e(st(n),t)}}),ot=Object.freeze({DOENETML:"DoenetML",FOLDER:"Folder",COLLECTION:"Collection"}),de=Y({key:"fetchDriveUsersQuery",default:q({key:"fetchDriveUsersQuery/Default",get:n=>async()=>{const e={params:{driveId:n}},{data:t}=await P.get("/api/loadDriveUsers.php",e);return t}})});q({key:"fetchDriveUsers",get:n=>({get:e})=>e(de(n)),set:n=>({get:e,set:t},i)=>{let r={params:{email:i.email,type:i.type,driveId:n,userId:i.userId}};switch(i.type){case"Add Owner":P.get("/api/saveUserToDrive.php",r).then(s=>{i.callback(s.data)});break;case"Add Owner step 2":t(de(n),s=>{let o={...s},a=[...s.owners];return a.push({email:i.email,isUser:!1,screenName:i.screenName,userId:i.userId}),o.owners=a,o});break;case"Add Admin":P.get("/api/saveUserToDrive.php",r).then(s=>{i.callback(s.data)});break;case"Add Admin step 2":t(de(n),s=>{let o={...s},a=[...s.admins];return a.push({email:i.email,isUser:!1,screenName:i.screenName,userId:i.userId}),o.admins=a,o});break;case"Remove User":t(de(n),s=>{let o={...s};if(i.userRole==="owner"){let a=[...s.owners];for(let c=0;c{let o={...s},a=[],c=[...s.admins];for(let l=0;l{let o={...s},a=[],c=[...s.owners];for(let l=0;l{s===n&&t(!1)};return B.useEffect(()=>(window.addEventListener("keydown",i),window.addEventListener("keyup",r),()=>{window.removeEventListener("keydown",i),window.removeEventListener("keyup",r)}),[]),e}const $t=_e.createContext(),qt=({children:n,id:e,registerDropTarget:t,unregisterDropTarget:i,dropCallbacks:r})=>{const s=B.useRef(),{onDragOver:o,onDragHover:a,onDrop:c,onDragEnter:d,onDragExit:l}=r;return B.useEffect(()=>(t({id:e,ref:s.current,onDragOver:o,onDragHover:a,onDragEnter:d,onDragExit:l,onDrop:c}),()=>{i(e)}),[e,t,i]),E("div",{ref:s,children:n})},Xe={x:0,y:0},Vt=({children:n,id:e,className:t="",onDragStart:i,onDrag:r,onDragEnd:s,ghostElement:o=null})=>{const[a,c]=B.useState({isDragging:!1,origin:Xe,translation:Xe,actionType:null}),d=B.useRef(null),l=B.useRef(null),[v,u]=B.useState(!1),k=B.useCallback(m=>{m.button===0&&(u(!0),l.current={...m},d.current=setTimeout(()=>{var b,S;let w=l.current,p=w.clientX,f=w.clientY,D="mouse";w.type==="touchstart"&&(p=(b=w.touches[0])==null?void 0:b.clientX,f=(S=w.touches[0])==null?void 0:S.clientY,D="touch"),c(L=>({...L,isDragging:!0,origin:{x:p,y:f},actionType:D})),i==null||i({ev:l.current}),d.current=null},300))},[i,e]),y=B.useCallback(()=>{d.current?clearTimeout(d.current):(c(m=>({...m,isDragging:!1,actionType:null})),s==null||s()),u(!1)},[s]),g=B.useCallback(m=>{var D,b;if(!a.isDragging)return;let w=m.clientX,p=m.clientY;m.type==="touchmove"&&(w=(D=m.touches[0])==null?void 0:D.clientX,p=(b=m.touches[0])==null?void 0:b.clientY);const f={x:w-a.origin.x,y:p-a.origin.y};c(S=>({...S,translation:f})),r==null||r({clientX:w,clientY:p,translation:f,id:e,ev:m})},[a.origin,r,e]);B.useEffect(()=>(v?(window.addEventListener("mouseup",y),window.addEventListener("touchend",y)):(window.removeEventListener("mouseup",y),window.removeEventListener("touchend",y)),()=>{window.removeEventListener("mouseup",y),window.removeEventListener("touchend",y)}),[v,y]),B.useEffect(()=>(a.isDragging?(window.addEventListener("mousemove",g),window.addEventListener("touchmove",g)):(window.removeEventListener("mousemove",g),window.removeEventListener("touchmove",g),c(m=>({...m,translation:{x:0,y:0}}))),()=>{window.removeEventListener("mousemove",g),window.removeEventListener("touchmove",g)}),[a.isDragging,g]);const I={cursor:a.isDragging?"-webkit-grabbing":"-webkit-grab",transition:a.isDragging?"none":"transform 500ms"},A={cursor:a.isDragging?"-webkit-grabbing":"-webkit-grab",transform:a.isDragging?`translate(${a.translation.x}px, ${a.translation.y}px)`:"",transition:a.isDragging?"visibility 0s, opacity 0.2s linear":"visibility 0s, opacity 0.2s linear, transform 500ms",zIndex:a.isDragging?2:1,opacity:a.isDragging?1:0,visibility:a.isDragging?"visible":"hidden",height:a.isDragging?"auto":"0",position:a.isDragging?"absolute":"relative",left:a.origin.x,top:a.origin.y};return oe("div",{className:t,style:I,onMouseDown:k,onTouchStart:k,children:[n,E("div",{style:A,children:o})]},`draggable${e}`)},X="dragShadow",dt=()=>{const n=K(({snapshot:r})=>async()=>{const{dragShadowDriveId:s,dragShadowParentId:o}=await r.getPromise(ee),a=await r.getPromise(M);if(!s||!o)return;let c=null;s&&o&&(c=await r.getPromise(R({driveId:s,folderId:o})));let d=c==null?void 0:c.contentIds[x.DEFAULT],l=d==null?void 0:d.indexOf(X);return l<0?{}:{targetDriveId:s,targetFolderId:o,index:l,numItems:a.length}}),e=K(({snapshot:r,set:s})=>async({driveIdFolderId:o,position:a,parentId:c,itemId:d})=>{const{dragShadowDriveId:l,dragShadowParentId:v,draggedItemsId:u,copyMode:k}=await r.getPromise(ee);if(!k&&u&&(u!=null&&u.has(d))){t();return}const y={assignmentId:null,doenetId:null,cid:null,creationDate:"",isPublished:"0",itemId:X,itemType:"DragShadow",label:"",parentFolderId:c,url:null,urlDescription:null,urlId:null},g=a,I=c;let A=null;if(l&&v&&(A=await r.getPromise(R({driveId:l,folderId:v}))),A&&s(R({driveId:l,folderId:v}),m=>{let w={...m},p=[...w.contentIds[x.DEFAULT]];p=p.filter(D=>D!==X);const f={[x.DEFAULT]:p};return w.contentIds=f,w}),g==="intoCurrent"){if(u&&(u!=null&&u.has(o.folderId)))return;s(R(o),m=>{let w={...m},p={...m.contentsDictionary},f=[...w.contentIds[x.DEFAULT]];p[X]=y,v===I&&(f=f.filter(b=>b!==X)),f.splice(0,0,X);const D={[x.DEFAULT]:f};return w.contentIds=D,w.contentsDictionary=p,w}),s(ee,m=>({...m,dragShadowDriveId:o.driveId,dragShadowParentId:o.folderId}))}else{const m=({draggedItemsId:p,contentIdsArr:f,index:D})=>{if((p==null?void 0:p.size)>1)return!0;let b=!0,S=null,L=null;return f.length!==0&&(D<=0?S=f[0]:D>=f.length?L=f[f.length-1]:(L=f[D-1],S=f[D]),L&&(p!=null&&p.has(L))&&(b=!1),S&&(p!=null&&p.has(S))&&(b=!1)),b};let w=!0;s(R({driveId:o.driveId,folderId:I}),p=>{let f={...p},D={...p.contentsDictionary},b=[...f.contentIds[x.DEFAULT]];D[X]=y,v===I&&(b=b.filter(T=>T!==X));let S=b.indexOf(d);g==="afterCurrent"&&(S+=1),w=k||m({draggedItemsId:u,contentIdsArr:b,index:S}),w&&b.splice(S,0,X);const L={[x.DEFAULT]:b};return f.contentIds=L,f.contentsDictionary=D,f}),w&&s(ee,p=>({...p,dragShadowDriveId:o.driveId,dragShadowParentId:I}))}}),t=K(({snapshot:r,set:s})=>async()=>{const{dragShadowDriveId:o,dragShadowParentId:a}=await r.getPromise(ee);!o||!a||(s(R({driveId:o,folderId:a}),c=>{let d={...c},l=[...d.contentIds[x.DEFAULT]];l=l.filter(u=>u!==X);const v={[x.DEFAULT]:l};return d.contentIds=v,d}),s(ee,c=>({...c,dragShadowDriveId:null,dragShadowParentId:null})))}),i=K(({snapshot:r,set:s})=>async()=>{const{dragShadowDriveId:o,dragShadowParentId:a,openedFoldersInfo:c}=await r.getPromise(ee);let d=[...c],l=[];if(o&&a){let v=await r.getPromise($n({driveId:o,folderId:a})),u=new Set(v.map(k=>k.folderId));for(let k of d)!(k.driveId===o&&u.has(k.itemId))&&l.push(k)}else l=d;for(let v of l)s(ve(v),!1)});return{insertDragShadow:e,removeDragShadow:t,replaceDragShadow:n,cleanUpDragShadow:i}},Z=Object.create(null);Z.open="0";Z.close="1";Z.ping="2";Z.pong="3";Z.message="4";Z.upgrade="5";Z.noop="6";const Le=Object.create(null);Object.keys(Z).forEach(n=>{Le[Z[n]]=n});const Ht={type:"error",data:"parser error"},zt=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Kt=typeof ArrayBuffer=="function",Yt=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,lt=({type:n,data:e},t,i)=>zt&&e instanceof Blob?t?i(e):je(e,i):Kt&&(e instanceof ArrayBuffer||Yt(e))?t?i(e):je(new Blob([e]),i):i(Z[n]+(e||"")),je=(n,e)=>{const t=new FileReader;return t.onload=function(){const i=t.result.split(",")[1];e("b"+i)},t.readAsDataURL(n)},Qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ge=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n{let e=n.length*.75,t=n.length,i,r=0,s,o,a,c;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const d=new ArrayBuffer(e),l=new Uint8Array(d);for(i=0;i>4,l[r++]=(o&15)<<4|a>>2,l[r++]=(a&3)<<6|c&63;return d},Jt=typeof ArrayBuffer=="function",ht=(n,e)=>{if(typeof n!="string")return{type:"message",data:ft(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:Wt(n.substring(1),e)}:Le[t]?n.length>1?{type:Le[t],data:n.substring(1)}:{type:Le[t]}:Ht},Wt=(n,e)=>{if(Jt){const t=Gt(n);return ft(t,e)}else return{base64:!0,data:n}},ft=(n,e)=>{switch(e){case"blob":return n instanceof ArrayBuffer?new Blob([n]):n;case"arraybuffer":default:return n}},ut=String.fromCharCode(30),Xt=(n,e)=>{const t=n.length,i=new Array(t);let r=0;n.forEach((s,o)=>{lt(s,!1,a=>{i[o]=a,++r===t&&e(i.join(ut))})})},jt=(n,e)=>{const t=n.split(ut),i=[];for(let r=0;rtypeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function mt(n,...e){return e.reduce((t,i)=>(n.hasOwnProperty(i)&&(t[i]=n[i]),t),{})}const Zt=setTimeout,en=clearTimeout;function Fe(n,e){e.useNativeTimers?(n.setTimeoutFn=Zt.bind(ie),n.clearTimeoutFn=en.bind(ie)):(n.setTimeoutFn=setTimeout.bind(ie),n.clearTimeoutFn=clearTimeout.bind(ie))}const tn=1.33;function nn(n){return typeof n=="string"?rn(n):Math.ceil((n.byteLength||n.size)*tn)}function rn(n){let e=0,t=0;for(let i=0,r=n.length;i=57344?t+=3:(i++,t+=4);return t}class sn extends Error{constructor(e,t,i){super(e),this.description=t,this.context=i,this.type="TransportError"}}class yt extends ${constructor(e){super(),this.writable=!1,Fe(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,t,i){return super.emitReserved("error",new sn(e,t,i)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=ht(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}const gt="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),$e=64,on={};let Ze=0,Oe=0,et;function tt(n){let e="";do e=gt[n%$e]+e,n=Math.floor(n/$e);while(n>0);return e}function It(){const n=tt(+new Date);return n!==et?(Ze=0,et=n):n+"."+tt(Ze++)}for(;Oe<$e;Oe++)on[gt[Oe]]=Oe;function vt(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function an(n){let e={},t=n.split("&");for(let i=0,r=t.length;i{this.readyState="paused",e()};if(this.polling||!this.writable){let i=0;this.polling&&(i++,this.once("pollComplete",function(){--i||t()})),this.writable||(i++,this.once("drain",function(){--i||t()}))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=i=>{if(this.readyState==="opening"&&i.type==="open"&&this.onOpen(),i.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(i)};jt(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Xt(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{};const t=this.opts.secure?"https":"http";let i="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=It()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(t==="https"&&Number(this.opts.port)!==443||t==="http"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port);const r=vt(e),s=this.opts.hostname.indexOf(":")!==-1;return t+"://"+(s?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(r.length?"?"+r:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new Q(this.uri(),e)}doWrite(e,t){const i=this.request({method:"POST",data:e});i.on("success",t),i.on("error",(r,s)=>{this.onError("xhr post error",r,s)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,i)=>{this.onError("xhr poll error",t,i)}),this.pollXhr=e}}class Q extends ${constructor(e,t){super(),Fe(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.async=t.async!==!1,this.data=t.data!==void 0?t.data:null,this.create()}create(){const e=mt(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const t=this.xhr=new bt(e);try{t.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&t.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{t.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in t&&(t.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(t.timeout=this.opts.requestTimeout),t.onreadystatechange=()=>{t.readyState===4&&(t.status===200||t.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof t.status=="number"?t.status:0)},0))},t.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Q.requestsCount++,Q.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=dn,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Q.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Q.requestsCount=0;Q.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",nt);else if(typeof addEventListener=="function"){const n="onpagehide"in ie?"pagehide":"unload";addEventListener(n,nt,!1)}}function nt(){for(let n in Q.requests)Q.requests.hasOwnProperty(n)&&Q.requests[n].abort()}const Dt=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0))(),Ee=ie.WebSocket||ie.MozWebSocket,it=!0,fn="arraybuffer",rt=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class un extends yt{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,i=rt?{}:mt(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=it&&!rt?t?new Ee(e,t):new Ee(e):new Ee(e,t,i)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType||fn,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t{const o={};try{it&&this.ws.send(s)}catch{}r&&Dt(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const t=this.opts.secure?"wss":"ws";let i="";this.opts.port&&(t==="wss"&&Number(this.opts.port)!==443||t==="ws"&&Number(this.opts.port)!==80)&&(i=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=It()),this.supportsBinary||(e.b64=1);const r=vt(e),s=this.opts.hostname.indexOf(":")!==-1;return t+"://"+(s?"["+this.opts.hostname+"]":this.opts.hostname)+i+this.opts.path+(r.length?"?"+r:"")}check(){return!!Ee}}const pn={websocket:un,polling:hn},mn=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,yn=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function qe(n){const e=n,t=n.indexOf("["),i=n.indexOf("]");t!=-1&&i!=-1&&(n=n.substring(0,t)+n.substring(t,i).replace(/:/g,";")+n.substring(i,n.length));let r=mn.exec(n||""),s={},o=14;for(;o--;)s[yn[o]]=r[o]||"";return t!=-1&&i!=-1&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=gn(s,s.path),s.queryKey=In(s,s.query),s}function gn(n,e){const t=/\/{2,9}/g,i=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&i.splice(0,1),e.slice(-1)=="/"&&i.splice(i.length-1,1),i}function In(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,r,s){r&&(t[r]=s)}),t}let kt=class le extends ${constructor(e,t={}){super(),e&&typeof e=="object"&&(t=e,e=null),e?(e=qe(e),t.hostname=e.host,t.secure=e.protocol==="https"||e.protocol==="wss",t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=qe(t.host).host),Fe(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},t),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=an(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=pt,t.transport=e,this.id&&(t.sid=this.id);const i=Object.assign({},this.opts.transportOptions[e],this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new pn[e](i)}open(){let e;if(this.opts.rememberUpgrade&&le.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(e){let t=this.createTransport(e),i=!1;le.priorWebsocketSuccess=!1;const r=()=>{i||(t.send([{type:"ping",data:"probe"}]),t.once("packet",v=>{if(!i)if(v.type==="pong"&&v.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;le.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(l(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const u=new Error("probe error");u.transport=t.name,this.emitReserved("upgradeError",u)}}))};function s(){i||(i=!0,l(),t.close(),t=null)}const o=v=>{const u=new Error("probe error: "+v);u.transport=t.name,s(),this.emitReserved("upgradeError",u)};function a(){o("transport closed")}function c(){o("socket closed")}function d(v){t&&v.name!==t.name&&s()}const l=()=>{t.removeListener("open",r),t.removeListener("error",o),t.removeListener("close",a),this.off("close",c),this.off("upgrading",d)};t.once("open",r),t.once("error",o),t.once("close",a),this.once("close",c),this.once("upgrading",d),t.open()}onOpen(){if(this.readyState="open",le.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let e=0;const t=this.upgrades.length;for(;e{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let i=0;i0&&t>this.maxPayload)return this.writeBuffer.slice(0,i);t+=2}return this.writeBuffer}write(e,t,i){return this.sendPacket("message",e,t,i),this}send(e,t,i){return this.sendPacket("message",e,t,i),this}sendPacket(e,t,i,r){if(typeof t=="function"&&(r=t,t=void 0),typeof i=="function"&&(r=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;const s={type:e,data:t,options:i};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},i=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():e()}):this.upgrading?i():e()),this}onError(e){le.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let i=0;const r=e.length;for(;itypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,At=Object.prototype.toString,Dn=typeof Blob=="function"||typeof Blob<"u"&&At.call(Blob)==="[object BlobConstructor]",kn=typeof File=="function"||typeof File<"u"&&At.call(File)==="[object FileConstructor]";function Ye(n){return wn&&(n instanceof ArrayBuffer||bn(n))||Dn&&n instanceof Blob||kn&&n instanceof File}function Te(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,i=n.length;t=0&&n.num0;case C.ACK:case C.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class Cn{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=Sn(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const xn=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Ge,Encoder:En,get PacketType(){return C},protocol:On},Symbol.toStringTag,{value:"Module"}));function G(n,e,t){return n.on(e,t),function(){n.off(e,t)}}const Ln=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class St extends ${constructor(e,t,i){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,i&&i.auth&&(this.auth=i.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[G(e,"open",this.onopen.bind(this)),G(e,"packet",this.onpacket.bind(this)),G(e,"error",this.onerror.bind(this)),G(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(Ln.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');t.unshift(e);const i={type:C.EVENT,data:t};if(i.options={},i.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const o=this.ids++,a=t.pop();this._registerAckCallback(o,a),i.id=o}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(i),this.packet(i)):this.sendBuffer.push(i)),this.flags={},this}_registerAckCallback(e,t){const i=this.flags.timeout;if(i===void 0){this.acks[e]=t;return}const r=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let s=0;s{this.io.clearTimeoutFn(r),t.apply(this,[null,...s])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this.packet({type:C.CONNECT,data:e})}):this.packet({type:C.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case C.CONNECT:if(e.data&&e.data.sid){const r=e.data.sid;this.onconnect(r)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case C.EVENT:case C.BINARY_EVENT:this.onevent(e);break;case C.ACK:case C.BINARY_ACK:this.onack(e);break;case C.DISCONNECT:this.ondisconnect();break;case C.CONNECT_ERROR:this.destroy();const i=new Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const i of t)i.apply(this,e)}super.emit.apply(this,e)}ack(e){const t=this;let i=!1;return function(...r){i||(i=!0,t.packet({type:C.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:C.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let i=0;i0&&n.jitter<=1?n.jitter:0,this.attempts=0}ue.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=Math.floor(e*10)&1?n+t:n-t}return Math.min(n,this.max)|0};ue.prototype.reset=function(){this.attempts=0};ue.prototype.setMin=function(n){this.ms=n};ue.prototype.setMax=function(n){this.max=n};ue.prototype.setJitter=function(n){this.jitter=n};class Re extends ${constructor(e,t){var i;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,Fe(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((i=t.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new ue({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||xn;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new kt(this.uri,this.opts);const t=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;const r=G(t,"open",function(){i.onopen(),e&&e()}),s=G(t,"error",o=>{i.cleanup(),i._readyState="closed",this.emitReserved("error",o),e?e(o):i.maybeReconnectOnOpen()});if(this._timeout!==!1){const o=this._timeout;o===0&&r();const a=this.setTimeoutFn(()=>{r(),t.close(),t.emit("error",new Error("timeout"))},o);this.opts.autoUnref&&a.unref(),this.subs.push(function(){clearTimeout(a)})}return this.subs.push(r),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(G(e,"ping",this.onping.bind(this)),G(e,"data",this.ondata.bind(this)),G(e,"error",this.onerror.bind(this)),G(e,"close",this.onclose.bind(this)),G(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){Dt(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let i=this.nsps[e];return i||(i=new St(this,e,t),this.nsps[e]=i),i}_destroy(e){const t=Object.keys(this.nsps);for(const i of t)if(this.nsps[i].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let i=0;ie()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const i=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(r=>{r?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",r)):e.onreconnect()}))},t);this.opts.autoUnref&&i.unref(),this.subs.push(function(){clearTimeout(i)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const ye={};function Be(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=vn(n,e.path||"/socket.io"),i=t.source,r=t.id,s=t.path,o=ye[r]&&s in ye[r].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let c;return a?c=new Re(i,e):(ye[r]||(ye[r]=new Re(i,e)),c=ye[r]),t.query&&!e.query&&(e.query=t.queryKey),c.socket(t.path,e)}Object.assign(Be,{Manager:Re,Socket:St,io:Be,connect:Be});const Tn=he({key:"socketManger",default:Ne({key:"socketManger/Default",get:()=>new Re("http://localhost:81",{withCredentials:!0}),dangerouslyAllowMutability:!0}),dangerouslyAllowMutability:!0});Y({key:"socketStore",default:q({key:"socketStore/Default",get:n=>({get:e})=>e(Tn).socket(`/${n}`),dangerouslyAllowMutability:!0}),dangerouslyAllowMutability:!0});const Ue=Object.freeze({FOLDER:"Folder",DOENETML:"DoenetML",URL:"Url",COLLECTION:"Collection"});function Rn(n){const e=Ke(),t="dragShadow",{acceptAddItem:i,acceptDeleteItem:r,acceptMoveItems:s,acceptRenameItem:o}=_n(),a=K(({snapshot:y})=>async({driveIdFolderId:g,type:I,label:A="Untitled",selectedItemId:m=null,url:w=null})=>{const f=xt(new Date),D=ce(),b=ce(),S=ce(),L=await y.getPromise(R(g));let T=JSON.parse(JSON.stringify(L)),U=[...T.contentIds[x.DEFAULT]],V=U.indexOf(m);const N=Me({index:V,nodeObjs:T.contentsDictionary,defaultFolderChildrenIds:U});let h={driveId:g.driveId,parentFolderId:g.folderId,doenetId:b,itemId:D,versionId:S,type:I,label:A,sortOrder:N,selectedItemId:m,creationDate:f,url:w};I==="DoenetML"&&(h={...h,assignedDate:null,attemptAggregation:"m",dueDate:null,gradeCategory:"",individualize:!0,isAssigned:"0",isPublished:"0",cid:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",numberOfAttemptsAllowed:"1",showFinishButton:!1,proctorMakesAvailable:!1,autoSubmit:!1,showCorrectness:!0,showFeedback:!0,showHints:!0,showSolution:!0,showSolutionInGradebook:!0,timeLimit:null,totalPointsOrPercent:"10",assignment_isPublished:"0"}),I===Ue.COLLECTION&&(h={...h,assignedDate:null,attemptAggregation:"m",dueDate:null,gradeCategory:"",individualize:!0,isAssigned:"0",isPublished:"0",cid:"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",numberOfAttemptsAllowed:"1",showFinishButton:!1,proctorMakesAvailable:!1,autoSubmit:!1,showCorrectness:!0,showFeedback:!0,showHints:!0,showSolution:!0,showSolutionInGradebook:!0,timeLimit:null,totalPointsOrPercent:"10",assignment_isPublished:"0"});try{const O=await P.post("/api/addItem.php",h);console.log("resp from add item",O),O.data.success?i(h):e(`Add item error: ${O.data.message}`,j.ERROR)}catch(O){console.error(O)}}),c=K(()=>async({driveIdFolderId:y,driveInstanceId:g=null,itemId:I,label:A})=>{const m={driveId:y.driveId,parentFolderId:y.folderId,itemId:I,label:A,driveInstanceId:g};try{const w=await P.get("/api/deleteItem.php",{params:m});w.data.success?r(m):e(`Delete item error: ${w.data.message}`,j.ERROR)}catch(w){console.log(w)}}),d=K(({snapshot:y,set:g})=>async({targetDriveId:I,targetFolderId:A,index:m})=>{var V,N;const w=await y.getPromise(M);let p=await y.getPromise(R({driveId:I,folderId:A}));if(w.length===0)throw"No items selected";for(let h of w){const O=await y.getPromise(R({driveId:h.driveId,folderId:h.parentFolderId}));if(h.itemId===A)throw"Cannot move folder into itself";if(p.folderInfo.itemType===Ue.COLLECTION&&O.contentsDictionary[h.itemId].itemType!==Ue.DOENETML)throw e(`Can not ${O.contentsDictionary[h.itemId].itemType}s into a Collection`,j.ERROR),`Can not ${O.contentsDictionary[h.itemId].itemType}s into a Collection`}let f=JSON.parse(JSON.stringify(p)),D={},b=[];const S=m??0;let L="";for(let h of w){let O={driveId:h.driveId,driveInstanceId:h.driveInstanceId,itemId:h.itemId};g(z(O),!1);const H=await y.getPromise(R({driveId:h.driveId,folderId:h.parentFolderId}));let F=(V=D[h.driveId])==null?void 0:V[h.parentFolderId];if(F||(F=JSON.parse(JSON.stringify(H))),h.parentFolderId!==A){let _=F.contentIds.defaultOrder.indexOf(h.itemId);F.contentIds.defaultOrder.splice(_,1),f.contentsDictionary[h.itemId]={...F.contentsDictionary[h.itemId]},f.contentsDictionaryByDoenetId||(f.contentsDictionaryByDoenetId={}),f.contentsDictionaryByDoenetId[F.contentsDictionary[h.itemId].doenetId]={...F.contentsDictionary[h.itemId]},delete F.contentsDictionaryByDoenetId[F.contentsDictionary[h.itemId].doenetId],delete F.contentsDictionary[h.itemId],D[h.driveId]||(D[h.driveId]={}),D[h.driveId][h.parentFolderId]=F,f.contentIds.defaultOrder.splice(S,0,h.itemId)}else f.contentIds.defaultOrder.splice(S,0,t),f.contentIds.defaultOrder=f.contentIds.defaultOrder.filter(_=>_!==h.itemId),f.contentIds.defaultOrder.splice(f.contentIds.defaultOrder.indexOf(t),1,h.itemId);const re=f.contentIds.defaultOrder.filter(_=>_!==t);if(L=Me({index:S,nodeObjs:f.contentsDictionary,defaultFolderChildrenIds:re}),f.contentsDictionary[h.itemId].sortOrder=L,f.contentsDictionary[h.itemId].parentFolderId=A,H.contentsDictionary[h.itemId].itemType==="Folder"){const _=await y.getPromise(R({driveId:h.driveId,folderId:h.itemId}));g(R({driveId:I,folderId:h.itemId}),()=>{let J={..._};return J.folderInfo={..._.folderInfo},J.folderInfo.parentFolderId=A,J})}if(h.driveId!==I&&(b.push(h.itemId),H.contentsDictionary[h.itemId].itemType==="Folder")){let _=[],J=[h.itemId];for(;J.length;){let be=J.length;for(let te=0;teasync({driveIdFolderId:y,itemId:g,itemType:I,newLabel:A})=>{const m={instruction:"rename",driveId:y.driveId,folderId:y.folderId,itemId:g,label:A,type:I};try{const w=await P.get("/api/updateItem.php",{params:m});w.data.success?o(m):e(`Rename item error: ${w.data.message}`,j.ERROR)}catch(w){console.log(w)}}),v=K(({snapshot:y,set:g})=>async({items:I=[],targetDriveId:A,targetFolderId:m,index:w})=>{if(I.length===0)throw"No items to be copied";let p=await y.getPromise(R({driveId:A,folderId:m})),f=JSON.parse(JSON.stringify(p));const D=w??0;let b="";const L=Nn(new Date);let T={},U={};for(let h of I){if(!h.driveId||!h.driveInstanceId||!h.itemId)throw"Invalid arguments error";let O={driveId:h.driveId,driveInstanceId:h.driveInstanceId,itemId:h.itemId};g(z(O),!1);const{newItemId:H,newItem:F}=await u({snapshot:y,globalDictionary:T,globalContentIds:U,creationTimestamp:L,item:h,targetDriveId:A,targetFolderId:m});if(h.driveId===A){const _=`Copy of ${F.label}`;F.label=_}const re=f.contentIds.defaultOrder.filter(_=>_!==t);b=Me({index:D,nodeObjs:f.contentsDictionary,defaultFolderChildrenIds:re}),F.sortOrder=b,f.contentsDictionary[H]=F,f.contentIds.defaultOrder.splice(D,0,H)}g(M,[]);let V=[];for(let h of Object.keys(T)){let O=T[h];const H={driveId:A,parentFolderId:O.parentFolderId,itemId:h,doenetId:O.doenetId,versionId:O.versionId,label:O.label,type:O.itemType,sortOrder:O.sortOrder,isNewCopy:"1"};if(O.itemType==="DoenetML"){const re=k({item:O,timestamp:L});V.push(P.post("/api/saveNewVersion.php",re))}const F=P.get("/api/addItem.php",{params:H});V.push(F)}return Promise.allSettled(V).then(([h])=>{var O,H;if((H=(O=h.value)==null?void 0:O.data)!=null&&H.success){g(R({driveId:A,folderId:m}),f);for(let F of Object.keys(T))if(T[F].itemType==="Folder"){let _=[F];for(;_.length;){const J=_.length;for(let be=0;be{console.error(h)}),await Promise.allSettled(V)}),u=async({snapshot:y,globalDictionary:g={},globalContentIds:I={},creationTimestamp:A,item:m,targetDriveId:w,targetFolderId:p})=>{const D=(await y.getPromise(R({driveId:m.driveId,folderId:m.parentFolderId}))).contentsDictionary[m.itemId],b={...D},S=ce();if(b.itemId=S,b.doenetId=ce(),b.versionId=ce(),b.previousDoenetId=D.doenetId,D.itemType==="Folder"){const{contentIds:L}=await y.getPromise(R({driveId:m.driveId,folderId:m.itemId}));I[S]=[];for(let T of L[x.DEFAULT]){let U={...m,parentFolderId:m.itemId,itemId:T};const N=(await u({snapshot:y,globalDictionary:g,globalContentIds:I,creationTimestamp:A,item:U,targetFolderId:S,targetDriveId:w})).newItemId;I[S].push(N)}}return b.parentFolderId=p,b.creationDate=A,g[S]=b,{newItemId:S,newItem:b}},k=({item:y,timestamp:g})=>({title:y.label,doenetId:y.doenetId,cid:y.cid,versionId:y.versionId,timestamp:g,isDraft:"0",isNamed:"1",isNewCopy:"1",doenetML:y.doenetML,previousDoenetId:y.previousDoenetId});return{addItem:a,deleteItem:c,moveItems:d,renameItem:l,copyItems:v}}function _n(){const n=Ke(),e=K(({snapshot:s,set:o})=>async({driveId:a,parentFolderId:c,doenetId:d,versionId:l,itemId:v,type:u,label:k,sortOrder:y,creationDate:g,url:I,selectedItemId:A})=>{const m={parentFolderId:c,doenetId:d,versionId:l,itemId:v,itemType:u,label:k,sortOrder:y,creationDate:g,isPublished:"0",url:I,urlDescription:null,urlId:null},w=await s.getPromise(R({driveId:a,folderId:c}));let p=JSON.parse(JSON.stringify(w)),f=[...p.contentIds[x.DEFAULT]],D=f.indexOf(A);f.splice(D+1,0,v),p.contentIds[x.DEFAULT]=f,p.contentsDictionary[v]=m,p.contentsDictionaryByDoenetId[d]=m,o(R({driveId:a,folderId:c}),p),(u==="Folder"||u==="Collection")&&o(R({driveId:a,folderId:v}),{folderInfo:m,contentsDictionary:{},contentIds:{[x.DEFAULT]:[]}}),n("Add new item 'Untitled'",j.SUCCESS)},[n]),t=K(({snapshot:s,set:o})=>async({driveId:a,parentFolderId:c,itemId:d,driveInstanceId:l,label:v})=>{const u=await s.getPromise(R({driveId:a,folderId:c})),k=await s.getPromise(M),y={driveId:a,driveInstanceId:l,itemId:d};if(await s.getPromise(z(y))){o(z(y),!1);let m=[];for(let w of k)w.itemId!==d&&m.push(w);o(M,m)}let I={...u};I.contentsDictionary={...u.contentsDictionary},I.contentsDictionaryByDoenetId={...u.contentsDictionaryByDoenetId},delete I.contentsDictionaryByDoenetId[I.contentsDictionary[d].doenetId],delete I.contentsDictionary[d],I.folderInfo={...u.folderInfo},I.contentIds={},I.contentIds[x.DEFAULT]=[...u.contentIds[x.DEFAULT]];const A=I.contentIds[x.DEFAULT].indexOf(d);I.contentIds[x.DEFAULT].splice(A,1),o(R({driveId:a,folderId:c}),I),n(`Deleted item '${v}'`,j.SUCCESS)}),i=K(({set:s})=>(o,a,c)=>{s(M,[]),s(R({driveId:o.destinationDriveId,folderId:o.destinationItemId}),a);for(let d of Object.keys(c))for(let l of Object.keys(c[d]))s(R({driveId:d,folderId:l}),c[d][l]),s(ze({driveId:d,folderId:l}),!0);s(ze({driveId:o.destinationDriveId,folderId:o.destinationItemId}),!0)},[]),r=K(({snapshot:s,set:o})=>async({driveId:a,folderId:c,itemId:d,label:l,type:v})=>{const u=await s.getPromise(R({driveId:a,folderId:c}));let k={...u};k.contentsDictionary={...u.contentsDictionary},k.contentsDictionaryByDoenetId={...u.contentsDictionaryByDoenetId},k.contentsDictionary[d]={...u.contentsDictionary[d]},k.contentsDictionary[d].label=l,k.contentsDictionaryByDoenetId[k.contentsDictionary[d].doenetId]={...u.contentsDictionary[d]},k.contentsDictionaryByDoenetId[k.contentsDictionary[d].doenetId].label=l,o(R({driveId:a,folderId:c}),k),(v==="Folder"||v==="Collection")&&o(R({driveId:a,folderId:d}),y=>{let g={...y};return g.folderInfo={...y.folderInfo},g.folderInfo.label=l,g}),n(`Renamed item to '${l}'`,j.SUCCESS)});return{acceptAddItem:e,acceptDeleteItem:t,acceptMoveItems:i,acceptRenameItem:r}}const Nn=n=>`${n.getFullYear().toString().padStart(2,"0")}-${(n.getMonth()+1).toString().padStart(2,"0")}-${n.getDate().toString().padStart(2,"0")} ${n.getHours().toString().padStart(2,"0")}:${n.getMinutes().toString().padStart(2,"0")}:${n.getSeconds().toString().padStart(2,"0")}`;B.createContext({});const st=Y({key:"loadAssignmentAtomFamily",default:q({key:"loadAssignmentAtomFamily/Default",get:n=>async()=>{const{data:e}=await P.get("/api/getAllAssignmentSettings.php",{params:{doenetId:n}});let t={...e.assignment};return t.assignedDate&&(t.assignedDate=ke(t.assignedDate).toLocaleString()),t.dueDate&&(t.dueDate=ke(t.dueDate).toLocaleString()),t.pinnedAfterDate&&(t.pinnedAfterDate=ke(t.pinnedAfterDate).toLocaleString()),t.pinnedUntilDate&&(t.pinnedUntilDate=ke(t.pinnedUntilDate).toLocaleString()),t}})}),Ot=q({key:"loadAssignmentSelector",get:n=>async({get:e})=>await e(st(n)),set:n=>({set:e},t)=>{e(st(n),t)}}),ot=Object.freeze({DOENETML:"DoenetML",FOLDER:"Folder",COLLECTION:"Collection"}),de=Y({key:"fetchDriveUsersQuery",default:q({key:"fetchDriveUsersQuery/Default",get:n=>async()=>{const e={params:{driveId:n}},{data:t}=await P.get("/api/loadDriveUsers.php",e);return t}})});q({key:"fetchDriveUsers",get:n=>({get:e})=>e(de(n)),set:n=>({get:e,set:t},i)=>{let r={params:{email:i.email,type:i.type,driveId:n,userId:i.userId}};switch(i.type){case"Add Owner":P.get("/api/saveUserToDrive.php",r).then(s=>{i.callback(s.data)});break;case"Add Owner step 2":t(de(n),s=>{let o={...s},a=[...s.owners];return a.push({email:i.email,isUser:!1,screenName:i.screenName,userId:i.userId}),o.owners=a,o});break;case"Add Admin":P.get("/api/saveUserToDrive.php",r).then(s=>{i.callback(s.data)});break;case"Add Admin step 2":t(de(n),s=>{let o={...s},a=[...s.admins];return a.push({email:i.email,isUser:!1,screenName:i.screenName,userId:i.userId}),o.admins=a,o});break;case"Remove User":t(de(n),s=>{let o={...s};if(i.userRole==="owner"){let a=[...s.owners];for(let c=0;c{let o={...s},a=[],c=[...s.admins];for(let l=0;l{let o={...s},a=[],c=[...s.owners];for(let l=0;l{const{createCourse:t}=s();return e("div",{style:r.style,children:e(a,{vertical:!0,children:e(o,{width:"menu",value:"Create New Course",onClick:t,"data-test":"createCourse",children:"Create New Course"})})})};export{n as default}; +import{bm as s,j as e,B as o}from"./index-7074710c.js";import{B as a}from"./ButtonGroup-9136da6d.js";const n=r=>{const{createCourse:t}=s();return e("div",{style:r.style,children:e(a,{vertical:!0,children:e(o,{width:"menu",value:"Create New Course",onClick:t,"data-test":"createCourse",children:"Create New Course"})})})};export{n as default}; diff --git a/dist/assets/CreditAchieved-d93f00b6.js b/dist/assets/CreditAchieved-619d3c15.js similarity index 86% rename from dist/assets/CreditAchieved-d93f00b6.js rename to dist/assets/CreditAchieved-619d3c15.js index c444d8a462..3bf324a1ae 100644 --- a/dist/assets/CreditAchieved-d93f00b6.js +++ b/dist/assets/CreditAchieved-619d3c15.js @@ -1,4 +1,4 @@ -import{l as t,m as h,G as z,u as W,e as J,r as P,v as V,k as M,j as r,a as i,s as O,y as X,g as q,R as H,B as k,z as K}from"./index-99a56692.js";import{currentAttemptNumber as Q,creditAchievedAtom as B}from"./AssignmentViewer-f9c5976c.js";import{i as Y,c as Z,a as ee}from"./ActivityViewer-3a815948.js";import{e as te}from"./RoleDropdown-5e05ae49.js";import{B as re}from"./ButtonGroup-ea123297.js";import{T as ie}from"./Textfield-5d92f495.js";import{overviewData as se}from"./Gradebook-e81ca638.js";import"./activityUtils-c08c1686.js";import"./ActionButton-f612d279.js";import"./visibility-sensor-55e75ed1.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";const ne=O.div` +import{l as t,m as h,G as z,u as W,e as J,r as P,v as V,k as M,j as r,a as i,s as O,y as X,g as q,R as H,B as k,z as K}from"./index-7074710c.js";import{currentAttemptNumber as Q,creditAchievedAtom as B}from"./AssignmentViewer-1be0d831.js";import{i as Y,c as Z,a as ee}from"./ActivityViewer-becda8c0.js";import{e as te}from"./RoleDropdown-cce90708.js";import{B as re}from"./ButtonGroup-9136da6d.js";import{T as ie}from"./Textfield-9c1c2968.js";import{overviewData as se}from"./Gradebook-06d28967.js";import"./activityUtils-9c5f1536.js";import"./ActionButton-e5ea2a2f.js";import"./visibility-sensor-7d414852.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";const ne=O.div` border-bottom: 2px solid var(--canvastext); height: 2px; width: 230px; diff --git a/dist/assets/CurrentContent-4c34f7f2.js b/dist/assets/CurrentContent-4c34f7f2.js deleted file mode 100644 index 6110210a22..0000000000 --- a/dist/assets/CurrentContent-4c34f7f2.js +++ /dev/null @@ -1 +0,0 @@ -import{g as r,a as e,j as i,A as m}from"./index-99a56692.js";import{s as n,a as c}from"./Next7Days-4c381b9d.js";import"./CourseToolHandler-f517d0e5.js";import"./index-ef9c2520.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-b3e258be.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-ea123297.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";function A(){const[o,p]=r(n),[t,s]=r(c);return e("div",{children:[e("div",{children:[i(m,{style:{marginRight:"2px"},checked:t,onClick:d=>{s(!t)}}),"Show Completed"," "]}),e("div",{children:[i(m,{style:{marginRight:"2px"},checked:o,onClick:d=>{p(!o)}}),"Show Overdue"," "]})]})}export{A as default}; diff --git a/dist/assets/CurrentContent-5c1a7444.js b/dist/assets/CurrentContent-5c1a7444.js new file mode 100644 index 0000000000..729c24d305 --- /dev/null +++ b/dist/assets/CurrentContent-5c1a7444.js @@ -0,0 +1 @@ +import{g as r,a as e,j as i,A as m}from"./index-7074710c.js";import{s as n,a as c}from"./Next7Days-ac4b7e6b.js";import"./CourseToolHandler-8716455d.js";import"./index-67ec2c85.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-5b62de19.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-9136da6d.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";function A(){const[o,p]=r(n),[t,s]=r(c);return e("div",{children:[e("div",{children:[i(m,{style:{marginRight:"2px"},checked:t,onClick:d=>{s(!t)}}),"Show Completed"," "]}),e("div",{children:[i(m,{style:{marginRight:"2px"},checked:o,onClick:d=>{p(!o)}}),"Show Overdue"," "]})]})}export{A as default}; diff --git a/dist/assets/CutCopyPasteMenu-4e591aff.js b/dist/assets/CutCopyPasteMenu-faa24159.js similarity index 72% rename from dist/assets/CutCopyPasteMenu-4e591aff.js rename to dist/assets/CutCopyPasteMenu-faa24159.js index f7208295cc..7a14b43ed1 100644 --- a/dist/assets/CutCopyPasteMenu-4e591aff.js +++ b/dist/assets/CutCopyPasteMenu-faa24159.js @@ -1 +1 @@ -import{l as e,m as p,a6 as b,y as f,ba as I,bb as h,T as k,j as s,F as j,a as y,z as u}from"./index-99a56692.js";import{A as o}from"./ActionButton-f612d279.js";import{A}from"./ActionButtonGroup-a395ceaf.js";function S(){const n=e(p("courseId")),{copyItems:F,cutItems:r,pasteItems:i}=b(n),a=f();let m=e(I),d=e(h),C=e(k),l=!0,c=!0;return m.length==0&&d.length==0&&(c=!1),C.length==0&&(l=!1),s(j,{children:y(A,{width:"menu",children:[s(o,{width:"menu",value:"Cut",disabled:!l,onClick:()=>{r({successCallback:()=>{},failureCallback:t=>{a(t,u.INFO)}})}}),s(o,{width:"menu",value:"Paste",disabled:!c,onClick:()=>{i({successCallback:()=>{},failureCallback:t=>{a(t,u.INFO)}})}})]})})}export{S as default}; +import{l as e,m as p,a6 as b,y as f,ba as I,bb as h,T as k,j as s,F as j,a as y,z as u}from"./index-7074710c.js";import{A as o}from"./ActionButton-e5ea2a2f.js";import{A}from"./ActionButtonGroup-f4ce05e4.js";function S(){const n=e(p("courseId")),{copyItems:F,cutItems:r,pasteItems:i}=b(n),a=f();let m=e(I),d=e(h),C=e(k),l=!0,c=!0;return m.length==0&&d.length==0&&(c=!1),C.length==0&&(l=!1),s(j,{children:y(A,{width:"menu",children:[s(o,{width:"menu",value:"Cut",disabled:!l,onClick:()=>{r({successCallback:()=>{},failureCallback:t=>{a(t,u.INFO)}})}}),s(o,{width:"menu",value:"Paste",disabled:!c,onClick:()=>{i({successCallback:()=>{},failureCallback:t=>{a(t,u.INFO)}})}})]})})}export{S as default}; diff --git a/dist/assets/Dashboard-2c19557a.js b/dist/assets/Dashboard-7ac6765c.js similarity index 89% rename from dist/assets/Dashboard-2c19557a.js rename to dist/assets/Dashboard-7ac6765c.js index 2ca5c567da..6c58421fab 100644 --- a/dist/assets/Dashboard-2c19557a.js +++ b/dist/assets/Dashboard-7ac6765c.js @@ -1,4 +1,4 @@ -import{j as a,a as c,s as p,R as x,p as y,l as g,m as C,E as k,b as w,c as A,r as P,I as T,i as s,J as D,K as I,L as S,M as h}from"./index-99a56692.js";import{N as G}from"./Next7Days-4c381b9d.js";import{e as R}from"./RoleDropdown-5e05ae49.js";import"./CourseToolHandler-f517d0e5.js";import"./index-ef9c2520.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-b3e258be.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-ea123297.js";import"./DropdownMenu-9b4c45a6.js";const M=p.button` +import{j as a,a as c,s as p,R as x,p as y,l as g,m as C,E as k,b as w,c as A,r as P,I as T,i as s,J as D,K as I,L as S,M as h}from"./index-7074710c.js";import{N as G}from"./Next7Days-ac4b7e6b.js";import{e as R}from"./RoleDropdown-cce90708.js";import"./CourseToolHandler-8716455d.js";import"./index-67ec2c85.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-5b62de19.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-9136da6d.js";import"./DropdownMenu-f3593bed.js";const M=p.button` background-image: linear-gradient(to bottom left, var(--canvas), var(--canvas), var(--canvas), var(--solidLightBlue)); border-radius: 5px; width: 190px; diff --git a/dist/assets/DashboardBreadCrumb-87d6da56.js b/dist/assets/DashboardBreadCrumb-87d6da56.js new file mode 100644 index 0000000000..a453a5c756 --- /dev/null +++ b/dist/assets/DashboardBreadCrumb-87d6da56.js @@ -0,0 +1 @@ +import{l as e,m,j as r,r as u}from"./index-7074710c.js";import{B as t}from"./BreadCrumb-c4dbe368.js";import{u as c,a as d}from"./breadcrumbUtil-1e7f0dfb.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-06d28967.js";function f(){const o=e(m("courseId")),s=c(),a=d(o);return r(u.Suspense,{fallback:r("div",{children:"loading Breadcrumbs..."}),children:r(t,{crumbs:[s,a]})})}export{f as default}; diff --git a/dist/assets/DashboardBreadCrumb-e2186312.js b/dist/assets/DashboardBreadCrumb-e2186312.js deleted file mode 100644 index 9b9ba8a85c..0000000000 --- a/dist/assets/DashboardBreadCrumb-e2186312.js +++ /dev/null @@ -1 +0,0 @@ -import{l as e,m,j as r,r as u}from"./index-99a56692.js";import{B as t}from"./BreadCrumb-c66b383a.js";import{u as c,a as d}from"./breadcrumbUtil-6dfe85b1.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-e81ca638.js";function f(){const o=e(m("courseId")),s=c(),a=d(o);return r(u.Suspense,{fallback:r("div",{children:"loading Breadcrumbs..."}),children:r(t,{crumbs:[s,a]})})}export{f as default}; diff --git a/dist/assets/DashboardLeave-4c716000.js b/dist/assets/DashboardLeave-4c716000.js new file mode 100644 index 0000000000..26ddd97cb2 --- /dev/null +++ b/dist/assets/DashboardLeave-4c716000.js @@ -0,0 +1 @@ +import{v as o,q as t}from"./index-7074710c.js";import{c as r,g as i}from"./CourseToolHandler-8716455d.js";import"./index-67ec2c85.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-5b62de19.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-9136da6d.js";function S(){return o(({set:e})=>()=>{e(r,null),e(i,[]),e(t,"")})(),null}export{S as default}; diff --git a/dist/assets/DashboardLeave-a2045124.js b/dist/assets/DashboardLeave-a2045124.js deleted file mode 100644 index 03ce78e51f..0000000000 --- a/dist/assets/DashboardLeave-a2045124.js +++ /dev/null @@ -1 +0,0 @@ -import{v as o,q as t}from"./index-99a56692.js";import{c as r,g as i}from"./CourseToolHandler-f517d0e5.js";import"./index-ef9c2520.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-b3e258be.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-ea123297.js";function S(){return o(({set:e})=>()=>{e(r,null),e(i,[]),e(t,"")})(),null}export{S as default}; diff --git a/dist/assets/DataBreadCrumb-9cf897ea.js b/dist/assets/DataBreadCrumb-9cf897ea.js deleted file mode 100644 index 9b9d6c8737..0000000000 --- a/dist/assets/DataBreadCrumb-9cf897ea.js +++ /dev/null @@ -1 +0,0 @@ -import{l as o,m as e,j as a,r as c}from"./index-99a56692.js";import{B as d}from"./BreadCrumb-c66b383a.js";import{u as i,a as n,d as b}from"./breadcrumbUtil-6dfe85b1.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-e81ca638.js";function I(){const r=o(e("courseId"));let s=o(e("sectionId"));s==""&&(s=r);const m=i(),t=n(r),u=b(r,s);return a(c.Suspense,{fallback:a("div",{children:"loading Breadcrumbs..."}),children:a(d,{crumbs:[m,t,...u]})})}export{I as default}; diff --git a/dist/assets/DataBreadCrumb-b56a9ca2.js b/dist/assets/DataBreadCrumb-b56a9ca2.js new file mode 100644 index 0000000000..d02344c5d7 --- /dev/null +++ b/dist/assets/DataBreadCrumb-b56a9ca2.js @@ -0,0 +1 @@ +import{l as o,m as e,j as a,r as c}from"./index-7074710c.js";import{B as d}from"./BreadCrumb-c4dbe368.js";import{u as i,a as n,d as b}from"./breadcrumbUtil-1e7f0dfb.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-06d28967.js";function I(){const r=o(e("courseId"));let s=o(e("sectionId"));s==""&&(s=r);const m=i(),t=n(r),u=b(r,s);return a(c.Suspense,{fallback:a("div",{children:"loading Breadcrumbs..."}),children:a(d,{crumbs:[m,t,...u]})})}export{I as default}; diff --git a/dist/assets/DataCap-1f8c815c.js b/dist/assets/DataCap-11084395.js similarity index 86% rename from dist/assets/DataCap-1f8c815c.js rename to dist/assets/DataCap-11084395.js index 1fd88fc612..ca67b72b8c 100644 --- a/dist/assets/DataCap-1f8c815c.js +++ b/dist/assets/DataCap-11084395.js @@ -1 +1 @@ -import{l as s,m as n,I as u,a as d,F as g,j as i}from"./index-99a56692.js";import{f as b,a as h}from"./util-85d105b8.js";import"./util-38d8e238.js";function v(){const c=s(n("courseId")),l=s(n("tool"));let e=s(u(c));if(!e||Object.keys(e).length==0)return null;let o=e.color,a=e.image,m=e.label,r="course";a!="none"&&(r=b(a),a="url(./drive_pictures/"+a+")"),o!="none"&&(r=h(o),o="#"+o);let t="";return l=="navigation"?t="Course Navigation":l=="dashboard"?t="Dashboard":l=="data"&&(t="Data"),d(g,{children:[i("div",{style:{position:"relative",width:"100%",height:"165px",overflow:"hidden"},children:i("img",{"aria-label":r,style:{position:"absolute",width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundImage:a,backgroundColor:o}})}),i("b",{children:t}),d("div",{style:{padding:"16px 12px"},children:[i("span",{style:{marginBottom:"15px"},children:m})," ",i("br",{})]})]})}export{v as default}; +import{l as s,m as n,I as u,a as d,F as g,j as i}from"./index-7074710c.js";import{f as b,a as h}from"./util-85d105b8.js";import"./util-38d8e238.js";function v(){const c=s(n("courseId")),l=s(n("tool"));let e=s(u(c));if(!e||Object.keys(e).length==0)return null;let o=e.color,a=e.image,m=e.label,r="course";a!="none"&&(r=b(a),a="url(./drive_pictures/"+a+")"),o!="none"&&(r=h(o),o="#"+o);let t="";return l=="navigation"?t="Course Navigation":l=="dashboard"?t="Dashboard":l=="data"&&(t="Data"),d(g,{children:[i("div",{style:{position:"relative",width:"100%",height:"165px",overflow:"hidden"},children:i("img",{"aria-label":r,style:{position:"absolute",width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundImage:a,backgroundColor:o}})}),i("b",{children:t}),d("div",{style:{padding:"16px 12px"},children:[i("span",{style:{marginBottom:"15px"},children:m})," ",i("br",{})]})]})}export{v as default}; diff --git a/dist/assets/DataPanel-ec5657fe.js b/dist/assets/DataPanel-212649a7.js similarity index 89% rename from dist/assets/DataPanel-ec5657fe.js rename to dist/assets/DataPanel-212649a7.js index b3e5e8d6bb..110e206eb6 100644 --- a/dist/assets/DataPanel-ec5657fe.js +++ b/dist/assets/DataPanel-212649a7.js @@ -1,4 +1,4 @@ -import{v as x,q as u,G as y,p as T,k as f,j as a,r as k,a as t,U as w,s as i}from"./index-99a56692.js";import{C as v}from"./CourseNavigator-119cf888.js";import"./index.esm-b3e258be.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./ButtonGroup-ea123297.js";const N=w` +import{v as x,q as u,G as y,p as T,k as f,j as a,r as k,a as t,U as w,s as i}from"./index-7074710c.js";import{C as v}from"./CourseNavigator-d0c5e95b.js";import"./index.esm-5b62de19.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./ButtonGroup-9136da6d.js";const N=w` 0% { background-position: -250px 0; } 100% { background-position: 250px 0; } `,S=i.table` diff --git a/dist/assets/DateTime-ef0be144.js b/dist/assets/DateTime-d0a20943.js similarity index 99% rename from dist/assets/DateTime-ef0be144.js rename to dist/assets/DateTime-d0a20943.js index df1b976a26..ac102b74f5 100644 --- a/dist/assets/DateTime-ef0be144.js +++ b/dist/assets/DateTime-d0a20943.js @@ -1,4 +1,4 @@ -import{r as F,au as it,s as Re,a as Ne,j as L}from"./index-99a56692.js";import{r as st}from"./moment-f5bb98f1.js";var ct=function(l){var O={};function d(h){if(O[h])return O[h].exports;var g=O[h]={i:h,l:!1,exports:{}};return l[h].call(g.exports,g,g.exports,d),g.l=!0,g.exports}return d.m=l,d.c=O,d.d=function(h,g,C){d.o(h,g)||Object.defineProperty(h,g,{enumerable:!0,get:C})},d.r=function(h){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(h,"__esModule",{value:!0})},d.t=function(h,g){if(1&g&&(h=d(h)),8&g||4&g&&typeof h=="object"&&h&&h.__esModule)return h;var C=Object.create(null);if(d.r(C),Object.defineProperty(C,"default",{enumerable:!0,value:h}),2&g&&typeof h!="string")for(var v in h)d.d(C,v,function(_){return h[_]}.bind(null,v));return C},d.n=function(h){var g=h&&h.__esModule?function(){return h.default}:function(){return h};return d.d(g,"a",g),g},d.o=function(h,g){return Object.prototype.hasOwnProperty.call(h,g)},d.p="",d(d.s=4)}([function(l,O){l.exports=F},function(l,O){l.exports=st},function(l,O){l.exports=it},function(l,O,d){l.exports=d(5)()},function(l,O,d){l.exports=d(7)},function(l,O,d){var h=d(6);function g(){}function C(){}C.resetWarningCache=g,l.exports=function(){function v(Y,T,R,H,B,x){if(x!==h){var S=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw S.name="Invariant Violation",S}}function _(){return v}v.isRequired=v;var u={array:v,bigint:v,bool:v,func:v,number:v,object:v,string:v,symbol:v,any:v,arrayOf:_,element:v,elementType:v,instanceOf:_,node:v,objectOf:_,oneOf:_,oneOfType:_,shape:_,exact:_,checkPropTypes:C,resetWarningCache:g};return u.PropTypes=u,u}},function(l,O,d){l.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(l,O,d){d.r(O);var h=d(3),g=d.n(h),C=d(1),v=d.n(C),_=d(0),u=d.n(_);function Y(){return(Y=Object.assign?Object.assign.bind():function(r){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var i,n=j(r);if(t){var o=j(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return q(this,i)}}function q(r,t){if(t&&(R(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return U(r)}function U(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function j(r){return(j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(r)}function I(r,t,i){return t in r?Object.defineProperty(r,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[t]=i,r}var W=function(r){(function(e,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&x(e,a)})(o,r);var t,i,n=S(o);function o(){var e;H(this,o);for(var a=arguments.length,s=new Array(a),c=0;c"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var i,n=G(r);if(t){var o=G(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ye(this,i)}}function Ye(r,t){if(t&&(ue(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fe(r)}function fe(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function G(r){return(G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(r)}function Be(r,t,i){return t in r?Object.defineProperty(r,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[t]=i,r}I(W,"defaultProps",{isValidDate:function(){return!0},renderDay:function(r,t){return u.a.createElement("td",r,t.date())}});var Ae=function(r){(function(e,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&le(e,a)})(o,r);var t,i,n=Le(o);function o(){var e;Ie(this,o);for(var a=arguments.length,s=new Array(a),c=0;c1;)if(a(s.date(c)))return!1;return!0}},{key:"getMonthText",value:function(e){var a,s=this.props.viewDate,c=s.localeData().monthsShort(s.month(e));return(a=c.substring(0,3)).charAt(0).toUpperCase()+a.slice(1)}}])&&Me(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),o}(u.a.Component);function He(r,t){return t<4?r[0]:t<8?r[1]:r[2]}function pe(r){return(pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(r)}function Ue(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function We(r,t){for(var i=0;i"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var i,n=J(r);if(t){var o=J(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ze(this,i)}}function ze(r,t){if(t&&(pe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return X(r)}function X(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function J(r){return(J=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(r)}function Q(r,t,i){return t in r?Object.defineProperty(r,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[t]=i,r}var he=function(r){(function(e,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&de(e,a)})(o,r);var t,i,n=Ze(o);function o(){var e;Ue(this,o);for(var a=arguments.length,s=new Array(a),c=0;c1;)if(s(c.dayOfYear(f)))return a[e]=!1,!1;return a[e]=!0,!0}}])&&We(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),o}(u.a.Component);function Ke(r,t){return t<3?r[0]:t<7?r[1]:r[2]}function me(r){return(me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(r)}function $e(r,t){for(var i=0;i"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var i,n=ee(r);if(t){var o=ee(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ge(this,i)}}function Ge(r,t){if(t&&(me(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}(r)}function ee(r){return(ee=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(r)}function ve(r,t){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,n)}return i}function be(r){for(var t=1;t=12?e-=12:e+=12,this.props.setTime("hours",e)}},{key:"increase",value:function(e){var a=this.constraints[e],s=parseInt(this.state[e],10)+a.step;return s>a.max&&(s=a.min+(s-(a.max+1))),M(e,s)}},{key:"decrease",value:function(e){var a=this.constraints[e],s=parseInt(this.state[e],10)-a.step;return s=0||(A[E]=w[E]);return A}(y,["excludeScrollbar"]);return r.prototype&&r.prototype.isReactComponent?p.ref=this.getRef:p.wrappedRef=this.getRef,p.disableOnClickOutside=this.disableOnClickOutside,p.enableOnClickOutside=this.enableOnClickOutside,Object(_.createElement)(r,p)},c}(_.Component),i.displayName="OnClickOutside("+o+")",i.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},i.getClass=function(){return r.getClass?r.getClass():r},n};function De(r){return(De=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(r)}function Ce(r,t){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,n)}return i}function Pe(r){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var i,n=oe(r);if(t){var o=oe(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ot(this,i)}}function ot(r,t){if(t&&(De(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P(r)}function P(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function oe(r){return(oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(r)}function k(r,t,i){return t in r?Object.defineProperty(r,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[t]=i,r}d.d(O,"default",function(){return K});var ae="years",ie="months",z="days",xe="time",m=g.a,N=function(){},se=m.oneOfType([m.instanceOf(v.a),m.instanceOf(Date),m.string]),K=function(r){Se(i,r);var t=Te(i);function i(n){var o;return _e(this,i),k(P(o=t.call(this,n)),"_renderCalendar",function(){var e=o.props,a=o.state,s={viewDate:a.viewDate.clone(),selectedDate:o.getSelectedDate(),isValidDate:e.isValidDate,updateDate:o._updateDate,navigate:o._viewNavigate,moment:v.a,showView:o._showView};switch(a.currentView){case ae:return s.renderYear=e.renderYear,u.a.createElement(he,s);case ie:return s.renderMonth=e.renderMonth,u.a.createElement(Ae,s);case z:return s.renderDay=e.renderDay,s.timeFormat=o.getFormat("time"),u.a.createElement(W,s);default:return s.dateFormat=o.getFormat("date"),s.timeFormat=o.getFormat("time"),s.timeConstraints=e.timeConstraints,s.setTime=o._setTime,u.a.createElement(Je,s)}}),k(P(o),"_showView",function(e,a){var s=(a||o.state.viewDate).clone(),c=o.props.onBeforeNavigate(e,o.state.currentView,s);c&&o.state.currentView!==c&&(o.props.onNavigate(c),o.setState({currentView:c}))}),k(P(o),"viewToMethod",{days:"date",months:"month",years:"year"}),k(P(o),"nextView",{days:"time",months:"days",years:"months"}),k(P(o),"_updateDate",function(e){var a=o.state.currentView,s=o.getUpdateOn(o.getFormat("date")),c=o.state.viewDate.clone();c[o.viewToMethod[a]](parseInt(e.target.getAttribute("data-value"),10)),a==="days"&&(c.month(parseInt(e.target.getAttribute("data-month"),10)),c.year(parseInt(e.target.getAttribute("data-year"),10)));var f={viewDate:c};a===s?(f.selectedDate=c.clone(),f.inputValue=c.format(o.getFormat("datetime")),o.props.open===void 0&&o.props.input&&o.props.closeOnSelect&&o._closeCalendar(),o.props.onChange(c.clone())):o._showView(o.nextView[a],c),o.setState(f)}),k(P(o),"_viewNavigate",function(e,a){var s=o.state.viewDate.clone();s.add(e,a),e>0?o.props.onNavigateForward(e,a):o.props.onNavigateBack(-e,a),o.setState({viewDate:s})}),k(P(o),"_setTime",function(e,a){var s=(o.getSelectedDate()||o.state.viewDate).clone();s[e](a),o.props.value||o.setState({selectedDate:s,viewDate:s.clone(),inputValue:s.format(o.getFormat("datetime"))}),o.props.onChange(s)}),k(P(o),"_openCalendar",function(){o.isOpen()||o.setState({open:!0},o.props.onOpen)}),k(P(o),"_closeCalendar",function(){o.isOpen()&&o.setState({open:!1},function(){o.props.onClose(o.state.selectedDate||o.state.inputValue)})}),k(P(o),"_handleClickOutside",function(){var e=o.props;e.input&&o.state.open&&e.open===void 0&&e.closeOnClickOutside&&o._closeCalendar()}),k(P(o),"_onInputFocus",function(e){o.callHandler(o.props.inputProps.onFocus,e)&&o._openCalendar()}),k(P(o),"_onInputChange",function(e){if(o.callHandler(o.props.inputProps.onChange,e)){var a=e.target?e.target.value:e,s=o.localMoment(a,o.getFormat("datetime")),c={inputValue:a};s.isValid()?(c.selectedDate=s,c.viewDate=s.clone().startOf("month")):c.selectedDate=null,o.setState(c,function(){o.props.onChange(s.isValid()?s:o.state.inputValue)})}}),k(P(o),"_onInputKeyDown",function(e){o.callHandler(o.props.inputProps.onKeyDown,e)&&e.which===9&&o.props.closeOnTab&&o._closeCalendar()}),k(P(o),"_onInputClick",function(e){o.callHandler(o.props.inputProps.onClick,e)&&o._openCalendar()}),o.state=o.getInitialState(),o}return je(i,[{key:"render",value:function(){return u.a.createElement(at,{className:this.getClassName(),onClickOut:this._handleClickOutside},this.renderInput(),u.a.createElement("div",{className:"rdtPicker"},this.renderView()))}},{key:"renderInput",value:function(){if(this.props.input){var n=Pe(Pe({type:"text",className:"form-control",value:this.getInputValue()},this.props.inputProps),{},{onFocus:this._onInputFocus,onChange:this._onInputChange,onKeyDown:this._onInputKeyDown,onClick:this._onInputClick});return this.props.renderInput?u.a.createElement("div",null,this.props.renderInput(n,this._openCalendar,this._closeCalendar)):u.a.createElement("input",n)}}},{key:"renderView",value:function(){return this.props.renderView(this.state.currentView,this._renderCalendar)}},{key:"getInitialState",value:function(){var n=this.props,o=this.getFormat("datetime"),e=this.parseDate(n.value||n.initialValue,o);return this.checkTZ(),{open:!n.input,currentView:n.initialViewMode||this.getInitialView(),viewDate:this.getInitialViewDate(e),selectedDate:e&&e.isValid()?e:void 0,inputValue:this.getInitialInputValue(e)}}},{key:"getInitialViewDate",value:function(n){var o,e=this.props.initialViewDate;if(e){if((o=this.parseDate(e,this.getFormat("datetime")))&&o.isValid())return o;ce('The initialViewDated given "'+e+'" is not valid. Using current date instead.')}else if(n&&n.isValid())return n.clone();return this.getInitialDate()}},{key:"getInitialDate",value:function(){var n=this.localMoment();return n.hour(0).minute(0).second(0).millisecond(0),n}},{key:"getInitialView",value:function(){var n=this.getFormat("date");return n?this.getUpdateOn(n):xe}},{key:"parseDate",value:function(n,o){var e;return n&&typeof n=="string"?e=this.localMoment(n,o):n&&(e=this.localMoment(n)),e&&!e.isValid()&&(e=null),e}},{key:"getClassName",value:function(){var n="rdt",o=this.props,e=o.className;return Array.isArray(e)?n+=" "+e.join(" "):e&&(n+=" "+e),o.input||(n+=" rdtStatic"),this.isOpen()&&(n+=" rdtOpen"),n}},{key:"isOpen",value:function(){return!this.props.input||(this.props.open===void 0?this.state.open:this.props.open)}},{key:"getUpdateOn",value:function(n){return this.props.updateOnView?this.props.updateOnView:n.match(/[lLD]/)?z:n.indexOf("M")!==-1?ie:n.indexOf("Y")!==-1?ae:z}},{key:"getLocaleData",value:function(){var n=this.props;return this.localMoment(n.value||n.defaultValue||new Date).localeData()}},{key:"getDateFormat",value:function(){var n=this.getLocaleData(),o=this.props.dateFormat;return o===!0?n.longDateFormat("L"):o||""}},{key:"getTimeFormat",value:function(){var n=this.getLocaleData(),o=this.props.timeFormat;return o===!0?n.longDateFormat("LT"):o||""}},{key:"getFormat",value:function(n){if(n==="date")return this.getDateFormat();if(n==="time")return this.getTimeFormat();var o=this.getDateFormat(),e=this.getTimeFormat();return o&&e?o+" "+e:o||e}},{key:"updateTime",value:function(n,o,e,a){var s={},c=a?"selectedDate":"viewDate";s[c]=this.state[c].clone()[n](o,e),this.setState(s)}},{key:"localMoment",value:function(n,o,e){var a=null;return a=(e=e||this.props).utc?v.a.utc(n,o,e.strictParsing):e.displayTimeZone?v.a.tz(n,o,e.displayTimeZone):v()(n,o,e.strictParsing),e.locale&&a.locale(e.locale),a}},{key:"checkTZ",value:function(){var n=this.props.displayTimeZone;!n||this.tzWarning||v.a.tz||(this.tzWarning=!0,ce('displayTimeZone prop with value "'+n+'" is used but moment.js timezone is not loaded.',"error"))}},{key:"componentDidUpdate",value:function(n){if(n!==this.props){var o=!1,e=this.props;["locale","utc","displayZone","dateFormat","timeFormat"].forEach(function(a){n[a]!==e[a]&&(o=!0)}),o&&this.regenerateDates(),e.value&&e.value!==n.value&&this.setViewDate(e.value),this.checkTZ()}}},{key:"regenerateDates",value:function(){var n=this.props,o=this.state.viewDate.clone(),e=this.state.selectedDate&&this.state.selectedDate.clone();n.locale&&(o.locale(n.locale),e&&e.locale(n.locale)),n.utc?(o.utc(),e&&e.utc()):n.displayTimeZone?(o.tz(n.displayTimeZone),e&&e.tz(n.displayTimeZone)):(o.locale(),e&&e.locale());var a={viewDate:o,selectedDate:e};e&&e.isValid()&&(a.inputValue=e.format(this.getFormat("datetime"))),this.setState(a)}},{key:"getSelectedDate",value:function(){if(this.props.value===void 0)return this.state.selectedDate;var n=this.parseDate(this.props.value,this.getFormat("datetime"));return!(!n||!n.isValid())&&n}},{key:"getInitialInputValue",value:function(n){var o=this.props;return o.inputProps.value?o.inputProps.value:n&&n.isValid()?n.format(this.getFormat("datetime")):o.value&&typeof o.value=="string"?o.value:o.initialValue&&typeof o.initialValue=="string"?o.initialValue:""}},{key:"getInputValue",value:function(){var n=this.getSelectedDate();return n?n.format(this.getFormat("datetime")):this.state.inputValue}},{key:"setViewDate",value:function(n){var o,e=function(){return ce("Invalid date passed to the `setViewDate` method: "+n)};return n&&(o=typeof n=="string"?this.localMoment(n,this.getFormat("datetime")):this.localMoment(n))&&o.isValid()?void this.setState({viewDate:o}):e()}},{key:"navigate",value:function(n){this._showView(n)}},{key:"callHandler",value:function(n,o){return!n||n(o)!==!1}}]),i}(u.a.Component);function ce(r,t){var i=typeof window<"u"&&window.console;i&&(t||(t="warn"),i[t]("***react-datetime:"+r))}k(K,"propTypes",{value:se,initialValue:se,initialViewDate:se,initialViewMode:m.oneOf([ae,ie,z,xe]),onOpen:m.func,onClose:m.func,onChange:m.func,onNavigate:m.func,onBeforeNavigate:m.func,onNavigateBack:m.func,onNavigateForward:m.func,updateOnView:m.string,locale:m.string,utc:m.bool,displayTimeZone:m.string,input:m.bool,dateFormat:m.oneOfType([m.string,m.bool]),timeFormat:m.oneOfType([m.string,m.bool]),inputProps:m.object,timeConstraints:m.object,isValidDate:m.func,open:m.bool,strictParsing:m.bool,closeOnSelect:m.bool,closeOnTab:m.bool,renderView:m.func,renderInput:m.func,renderDay:m.func,renderMonth:m.func,renderYear:m.func}),k(K,"defaultProps",{onOpen:N,onClose:N,onCalendarOpen:N,onCalendarClose:N,onChange:N,onNavigate:N,onBeforeNavigate:function(r){return r},onNavigateBack:N,onNavigateForward:N,dateFormat:!0,timeFormat:!0,utc:!1,className:"",input:!0,inputProps:{},timeConstraints:{},isValidDate:function(){return!0},strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,closeOnClickOutside:!0,renderView:function(r,t){return t()}}),k(K,"moment",v.a);var at=rt(function(r){Se(i,r);var t=Te(i);function i(){var n;_e(this,i);for(var o=arguments.length,e=new Array(o),a=0;a"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var i,n=j(r);if(t){var o=j(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return q(this,i)}}function q(r,t){if(t&&(R(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return U(r)}function U(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function j(r){return(j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(r)}function I(r,t,i){return t in r?Object.defineProperty(r,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[t]=i,r}var W=function(r){(function(e,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&x(e,a)})(o,r);var t,i,n=S(o);function o(){var e;H(this,o);for(var a=arguments.length,s=new Array(a),c=0;c"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var i,n=G(r);if(t){var o=G(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ye(this,i)}}function Ye(r,t){if(t&&(ue(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fe(r)}function fe(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function G(r){return(G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(r)}function Be(r,t,i){return t in r?Object.defineProperty(r,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[t]=i,r}I(W,"defaultProps",{isValidDate:function(){return!0},renderDay:function(r,t){return u.a.createElement("td",r,t.date())}});var Ae=function(r){(function(e,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&le(e,a)})(o,r);var t,i,n=Le(o);function o(){var e;Ie(this,o);for(var a=arguments.length,s=new Array(a),c=0;c1;)if(a(s.date(c)))return!1;return!0}},{key:"getMonthText",value:function(e){var a,s=this.props.viewDate,c=s.localeData().monthsShort(s.month(e));return(a=c.substring(0,3)).charAt(0).toUpperCase()+a.slice(1)}}])&&Me(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),o}(u.a.Component);function He(r,t){return t<4?r[0]:t<8?r[1]:r[2]}function pe(r){return(pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(r)}function Ue(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function We(r,t){for(var i=0;i"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var i,n=J(r);if(t){var o=J(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ze(this,i)}}function ze(r,t){if(t&&(pe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return X(r)}function X(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function J(r){return(J=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(r)}function Q(r,t,i){return t in r?Object.defineProperty(r,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[t]=i,r}var he=function(r){(function(e,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(a&&a.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),a&&de(e,a)})(o,r);var t,i,n=Ze(o);function o(){var e;Ue(this,o);for(var a=arguments.length,s=new Array(a),c=0;c1;)if(s(c.dayOfYear(f)))return a[e]=!1,!1;return a[e]=!0,!0}}])&&We(t.prototype,i),Object.defineProperty(t,"prototype",{writable:!1}),o}(u.a.Component);function Ke(r,t){return t<3?r[0]:t<7?r[1]:r[2]}function me(r){return(me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(r)}function $e(r,t){for(var i=0;i"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var i,n=ee(r);if(t){var o=ee(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ge(this,i)}}function Ge(r,t){if(t&&(me(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}(r)}function ee(r){return(ee=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(r)}function ve(r,t){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,n)}return i}function be(r){for(var t=1;t=12?e-=12:e+=12,this.props.setTime("hours",e)}},{key:"increase",value:function(e){var a=this.constraints[e],s=parseInt(this.state[e],10)+a.step;return s>a.max&&(s=a.min+(s-(a.max+1))),M(e,s)}},{key:"decrease",value:function(e){var a=this.constraints[e],s=parseInt(this.state[e],10)-a.step;return s=0||(A[E]=w[E]);return A}(y,["excludeScrollbar"]);return r.prototype&&r.prototype.isReactComponent?p.ref=this.getRef:p.wrappedRef=this.getRef,p.disableOnClickOutside=this.disableOnClickOutside,p.enableOnClickOutside=this.enableOnClickOutside,Object(_.createElement)(r,p)},c}(_.Component),i.displayName="OnClickOutside("+o+")",i.defaultProps={eventTypes:["mousedown","touchstart"],excludeScrollbar:t&&t.excludeScrollbar||!1,outsideClickIgnoreClass:"ignore-react-onclickoutside",preventDefault:!1,stopPropagation:!1},i.getClass=function(){return r.getClass?r.getClass():r},n};function De(r){return(De=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(r)}function Ce(r,t){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),i.push.apply(i,n)}return i}function Pe(r){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var i,n=oe(r);if(t){var o=oe(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return ot(this,i)}}function ot(r,t){if(t&&(De(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return P(r)}function P(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function oe(r){return(oe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(r)}function k(r,t,i){return t in r?Object.defineProperty(r,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[t]=i,r}d.d(O,"default",function(){return K});var ae="years",ie="months",z="days",xe="time",m=g.a,N=function(){},se=m.oneOfType([m.instanceOf(v.a),m.instanceOf(Date),m.string]),K=function(r){Se(i,r);var t=Te(i);function i(n){var o;return _e(this,i),k(P(o=t.call(this,n)),"_renderCalendar",function(){var e=o.props,a=o.state,s={viewDate:a.viewDate.clone(),selectedDate:o.getSelectedDate(),isValidDate:e.isValidDate,updateDate:o._updateDate,navigate:o._viewNavigate,moment:v.a,showView:o._showView};switch(a.currentView){case ae:return s.renderYear=e.renderYear,u.a.createElement(he,s);case ie:return s.renderMonth=e.renderMonth,u.a.createElement(Ae,s);case z:return s.renderDay=e.renderDay,s.timeFormat=o.getFormat("time"),u.a.createElement(W,s);default:return s.dateFormat=o.getFormat("date"),s.timeFormat=o.getFormat("time"),s.timeConstraints=e.timeConstraints,s.setTime=o._setTime,u.a.createElement(Je,s)}}),k(P(o),"_showView",function(e,a){var s=(a||o.state.viewDate).clone(),c=o.props.onBeforeNavigate(e,o.state.currentView,s);c&&o.state.currentView!==c&&(o.props.onNavigate(c),o.setState({currentView:c}))}),k(P(o),"viewToMethod",{days:"date",months:"month",years:"year"}),k(P(o),"nextView",{days:"time",months:"days",years:"months"}),k(P(o),"_updateDate",function(e){var a=o.state.currentView,s=o.getUpdateOn(o.getFormat("date")),c=o.state.viewDate.clone();c[o.viewToMethod[a]](parseInt(e.target.getAttribute("data-value"),10)),a==="days"&&(c.month(parseInt(e.target.getAttribute("data-month"),10)),c.year(parseInt(e.target.getAttribute("data-year"),10)));var f={viewDate:c};a===s?(f.selectedDate=c.clone(),f.inputValue=c.format(o.getFormat("datetime")),o.props.open===void 0&&o.props.input&&o.props.closeOnSelect&&o._closeCalendar(),o.props.onChange(c.clone())):o._showView(o.nextView[a],c),o.setState(f)}),k(P(o),"_viewNavigate",function(e,a){var s=o.state.viewDate.clone();s.add(e,a),e>0?o.props.onNavigateForward(e,a):o.props.onNavigateBack(-e,a),o.setState({viewDate:s})}),k(P(o),"_setTime",function(e,a){var s=(o.getSelectedDate()||o.state.viewDate).clone();s[e](a),o.props.value||o.setState({selectedDate:s,viewDate:s.clone(),inputValue:s.format(o.getFormat("datetime"))}),o.props.onChange(s)}),k(P(o),"_openCalendar",function(){o.isOpen()||o.setState({open:!0},o.props.onOpen)}),k(P(o),"_closeCalendar",function(){o.isOpen()&&o.setState({open:!1},function(){o.props.onClose(o.state.selectedDate||o.state.inputValue)})}),k(P(o),"_handleClickOutside",function(){var e=o.props;e.input&&o.state.open&&e.open===void 0&&e.closeOnClickOutside&&o._closeCalendar()}),k(P(o),"_onInputFocus",function(e){o.callHandler(o.props.inputProps.onFocus,e)&&o._openCalendar()}),k(P(o),"_onInputChange",function(e){if(o.callHandler(o.props.inputProps.onChange,e)){var a=e.target?e.target.value:e,s=o.localMoment(a,o.getFormat("datetime")),c={inputValue:a};s.isValid()?(c.selectedDate=s,c.viewDate=s.clone().startOf("month")):c.selectedDate=null,o.setState(c,function(){o.props.onChange(s.isValid()?s:o.state.inputValue)})}}),k(P(o),"_onInputKeyDown",function(e){o.callHandler(o.props.inputProps.onKeyDown,e)&&e.which===9&&o.props.closeOnTab&&o._closeCalendar()}),k(P(o),"_onInputClick",function(e){o.callHandler(o.props.inputProps.onClick,e)&&o._openCalendar()}),o.state=o.getInitialState(),o}return je(i,[{key:"render",value:function(){return u.a.createElement(at,{className:this.getClassName(),onClickOut:this._handleClickOutside},this.renderInput(),u.a.createElement("div",{className:"rdtPicker"},this.renderView()))}},{key:"renderInput",value:function(){if(this.props.input){var n=Pe(Pe({type:"text",className:"form-control",value:this.getInputValue()},this.props.inputProps),{},{onFocus:this._onInputFocus,onChange:this._onInputChange,onKeyDown:this._onInputKeyDown,onClick:this._onInputClick});return this.props.renderInput?u.a.createElement("div",null,this.props.renderInput(n,this._openCalendar,this._closeCalendar)):u.a.createElement("input",n)}}},{key:"renderView",value:function(){return this.props.renderView(this.state.currentView,this._renderCalendar)}},{key:"getInitialState",value:function(){var n=this.props,o=this.getFormat("datetime"),e=this.parseDate(n.value||n.initialValue,o);return this.checkTZ(),{open:!n.input,currentView:n.initialViewMode||this.getInitialView(),viewDate:this.getInitialViewDate(e),selectedDate:e&&e.isValid()?e:void 0,inputValue:this.getInitialInputValue(e)}}},{key:"getInitialViewDate",value:function(n){var o,e=this.props.initialViewDate;if(e){if((o=this.parseDate(e,this.getFormat("datetime")))&&o.isValid())return o;ce('The initialViewDated given "'+e+'" is not valid. Using current date instead.')}else if(n&&n.isValid())return n.clone();return this.getInitialDate()}},{key:"getInitialDate",value:function(){var n=this.localMoment();return n.hour(0).minute(0).second(0).millisecond(0),n}},{key:"getInitialView",value:function(){var n=this.getFormat("date");return n?this.getUpdateOn(n):xe}},{key:"parseDate",value:function(n,o){var e;return n&&typeof n=="string"?e=this.localMoment(n,o):n&&(e=this.localMoment(n)),e&&!e.isValid()&&(e=null),e}},{key:"getClassName",value:function(){var n="rdt",o=this.props,e=o.className;return Array.isArray(e)?n+=" "+e.join(" "):e&&(n+=" "+e),o.input||(n+=" rdtStatic"),this.isOpen()&&(n+=" rdtOpen"),n}},{key:"isOpen",value:function(){return!this.props.input||(this.props.open===void 0?this.state.open:this.props.open)}},{key:"getUpdateOn",value:function(n){return this.props.updateOnView?this.props.updateOnView:n.match(/[lLD]/)?z:n.indexOf("M")!==-1?ie:n.indexOf("Y")!==-1?ae:z}},{key:"getLocaleData",value:function(){var n=this.props;return this.localMoment(n.value||n.defaultValue||new Date).localeData()}},{key:"getDateFormat",value:function(){var n=this.getLocaleData(),o=this.props.dateFormat;return o===!0?n.longDateFormat("L"):o||""}},{key:"getTimeFormat",value:function(){var n=this.getLocaleData(),o=this.props.timeFormat;return o===!0?n.longDateFormat("LT"):o||""}},{key:"getFormat",value:function(n){if(n==="date")return this.getDateFormat();if(n==="time")return this.getTimeFormat();var o=this.getDateFormat(),e=this.getTimeFormat();return o&&e?o+" "+e:o||e}},{key:"updateTime",value:function(n,o,e,a){var s={},c=a?"selectedDate":"viewDate";s[c]=this.state[c].clone()[n](o,e),this.setState(s)}},{key:"localMoment",value:function(n,o,e){var a=null;return a=(e=e||this.props).utc?v.a.utc(n,o,e.strictParsing):e.displayTimeZone?v.a.tz(n,o,e.displayTimeZone):v()(n,o,e.strictParsing),e.locale&&a.locale(e.locale),a}},{key:"checkTZ",value:function(){var n=this.props.displayTimeZone;!n||this.tzWarning||v.a.tz||(this.tzWarning=!0,ce('displayTimeZone prop with value "'+n+'" is used but moment.js timezone is not loaded.',"error"))}},{key:"componentDidUpdate",value:function(n){if(n!==this.props){var o=!1,e=this.props;["locale","utc","displayZone","dateFormat","timeFormat"].forEach(function(a){n[a]!==e[a]&&(o=!0)}),o&&this.regenerateDates(),e.value&&e.value!==n.value&&this.setViewDate(e.value),this.checkTZ()}}},{key:"regenerateDates",value:function(){var n=this.props,o=this.state.viewDate.clone(),e=this.state.selectedDate&&this.state.selectedDate.clone();n.locale&&(o.locale(n.locale),e&&e.locale(n.locale)),n.utc?(o.utc(),e&&e.utc()):n.displayTimeZone?(o.tz(n.displayTimeZone),e&&e.tz(n.displayTimeZone)):(o.locale(),e&&e.locale());var a={viewDate:o,selectedDate:e};e&&e.isValid()&&(a.inputValue=e.format(this.getFormat("datetime"))),this.setState(a)}},{key:"getSelectedDate",value:function(){if(this.props.value===void 0)return this.state.selectedDate;var n=this.parseDate(this.props.value,this.getFormat("datetime"));return!(!n||!n.isValid())&&n}},{key:"getInitialInputValue",value:function(n){var o=this.props;return o.inputProps.value?o.inputProps.value:n&&n.isValid()?n.format(this.getFormat("datetime")):o.value&&typeof o.value=="string"?o.value:o.initialValue&&typeof o.initialValue=="string"?o.initialValue:""}},{key:"getInputValue",value:function(){var n=this.getSelectedDate();return n?n.format(this.getFormat("datetime")):this.state.inputValue}},{key:"setViewDate",value:function(n){var o,e=function(){return ce("Invalid date passed to the `setViewDate` method: "+n)};return n&&(o=typeof n=="string"?this.localMoment(n,this.getFormat("datetime")):this.localMoment(n))&&o.isValid()?void this.setState({viewDate:o}):e()}},{key:"navigate",value:function(n){this._showView(n)}},{key:"callHandler",value:function(n,o){return!n||n(o)!==!1}}]),i}(u.a.Component);function ce(r,t){var i=typeof window<"u"&&window.console;i&&(t||(t="warn"),i[t]("***react-datetime:"+r))}k(K,"propTypes",{value:se,initialValue:se,initialViewDate:se,initialViewMode:m.oneOf([ae,ie,z,xe]),onOpen:m.func,onClose:m.func,onChange:m.func,onNavigate:m.func,onBeforeNavigate:m.func,onNavigateBack:m.func,onNavigateForward:m.func,updateOnView:m.string,locale:m.string,utc:m.bool,displayTimeZone:m.string,input:m.bool,dateFormat:m.oneOfType([m.string,m.bool]),timeFormat:m.oneOfType([m.string,m.bool]),inputProps:m.object,timeConstraints:m.object,isValidDate:m.func,open:m.bool,strictParsing:m.bool,closeOnSelect:m.bool,closeOnTab:m.bool,renderView:m.func,renderInput:m.func,renderDay:m.func,renderMonth:m.func,renderYear:m.func}),k(K,"defaultProps",{onOpen:N,onClose:N,onCalendarOpen:N,onCalendarClose:N,onChange:N,onNavigate:N,onBeforeNavigate:function(r){return r},onNavigateBack:N,onNavigateForward:N,dateFormat:!0,timeFormat:!0,utc:!1,className:"",input:!0,inputProps:{},timeConstraints:{},isValidDate:function(){return!0},strictParsing:!0,closeOnSelect:!1,closeOnTab:!0,closeOnClickOutside:!0,renderView:function(r,t){return t()}}),k(K,"moment",v.a);var at=rt(function(r){Se(i,r);var t=Te(i);function i(){var n;_e(this,i);for(var o=arguments.length,e=new Array(o),a=0;al.offset?l.offset:"-50px"}; } diff --git a/dist/assets/DoenetMLEditor-cb24eb95.js b/dist/assets/DoenetMLEditor-078d36f5.js similarity index 83% rename from dist/assets/DoenetMLEditor-cb24eb95.js rename to dist/assets/DoenetMLEditor-078d36f5.js index 12cdf53d69..55edd9fb58 100644 --- a/dist/assets/DoenetMLEditor-cb24eb95.js +++ b/dist/assets/DoenetMLEditor-078d36f5.js @@ -1 +1 @@ -import{a4 as E,R as L,l as a,m,w as M,r as n,j as p}from"./index-99a56692.js";import{C as R}from"./CodeMirror-35f8e4ac.js";import{u as k}from"./useSaveDraft-a42d0f94.js";import{t as A,u as h,v as T,e as b}from"./EditorViewerRecoil-41e59102.js";function y(){let i=E();const s=i==null?void 0:i.pageDoenetId,I=L(A),g=a(h),D=a(T),P=a(m("pageId")),d=a(m("linkPageId"));let c=P,f=!1;d&&(f=!0,c=d),s&&(c=s);const o=a(M),t=a(b);let v=n.useRef(null),e=n.useRef(null),r=n.useRef(!0);const{saveDraft:u}=k();return n.useEffect(()=>()=>{t!==""&&(u({pageId:t,courseId:o,backup:r.current}),e.current!==null&&clearTimeout(e.current),e.current=null)},[t,u,o]),n.useEffect(()=>{t!==""&&(u({pageId:t,courseId:o,backup:r.current}).then(({success:l})=>{l&&(r.current=!1)}),e.current!==null&&clearTimeout(e.current),e.current=null)},[D]),c!==t?(r.current=!0,null):p("div",{children:p(R,{readOnly:f,editorRef:v,setInternalValue:g,onBeforeChange:l=>{I(l),clearTimeout(e.current),e.current=setTimeout(function(){u({pageId:t,courseId:o,backup:r.current}).then(({success:x})=>{x&&(r.current=!1)}),e.current=null},3e3)}},"codemirror")})}export{y as default}; +import{a4 as E,R as L,l as a,m,w as M,r as n,j as p}from"./index-7074710c.js";import{C as R}from"./CodeMirror-87ecbb8f.js";import{u as k}from"./useSaveDraft-5f9f3fe4.js";import{t as A,u as h,v as T,e as b}from"./EditorViewerRecoil-fb47fc9d.js";function y(){let i=E();const s=i==null?void 0:i.pageDoenetId,I=L(A),g=a(h),D=a(T),P=a(m("pageId")),d=a(m("linkPageId"));let c=P,f=!1;d&&(f=!0,c=d),s&&(c=s);const o=a(M),t=a(b);let v=n.useRef(null),e=n.useRef(null),r=n.useRef(!0);const{saveDraft:u}=k();return n.useEffect(()=>()=>{t!==""&&(u({pageId:t,courseId:o,backup:r.current}),e.current!==null&&clearTimeout(e.current),e.current=null)},[t,u,o]),n.useEffect(()=>{t!==""&&(u({pageId:t,courseId:o,backup:r.current}).then(({success:l})=>{l&&(r.current=!1)}),e.current!==null&&clearTimeout(e.current),e.current=null)},[D]),c!==t?(r.current=!0,null):p("div",{children:p(R,{readOnly:f,editorRef:v,setInternalValue:g,onBeforeChange:l=>{I(l),clearTimeout(e.current),e.current=setTimeout(function(){u({pageId:t,courseId:o,backup:r.current}).then(({success:x})=>{x&&(r.current=!1)}),e.current=null},3e3)}},"codemirror")})}export{y as default}; diff --git a/dist/assets/DoenetMLSettings-649979ff.js b/dist/assets/DoenetMLSettings-6fadfc58.js similarity index 84% rename from dist/assets/DoenetMLSettings-649979ff.js rename to dist/assets/DoenetMLSettings-6fadfc58.js index 0bb5c88ce7..0a65842275 100644 --- a/dist/assets/DoenetMLSettings-649979ff.js +++ b/dist/assets/DoenetMLSettings-6fadfc58.js @@ -1 +1 @@ -import{l as a,y as r,m as l,j as o,a as t,z as c,i as d,aB as m}from"./index-99a56692.js";import{l as p}from"./index-ef9c2520.js";import{f as h}from"./index-47ca4f11.js";import{e as f}from"./EditorViewerRecoil-41e59102.js";import"./index-fcf36459.js";function v(e){const i=a(f),n=`http://${window.location.host}/content/#/?doenetId=${i}`,s=r();return a(l("doenetId"))!==i?o("div",{style:e.style}):t("div",{style:e.style,children:[o("div",{children:"DonetML Name (soon)"}),o("div",{children:"Load time (soon) "}),o("div",{children:"Most recent release "}),t("div",{children:[o(p.CopyToClipboard,{onCopy:()=>s("Link copied to clipboard!",c.SUCCESS),text:n,children:t("button",{onClick:()=>{},children:["copy link ",o(d,{icon:h})]})}),t("button",{onClick:()=>window.open(n,"_blank"),children:["visit ",o(d,{icon:m})]})]})]})}export{v as default}; +import{l as a,y as r,m as l,j as o,a as t,z as c,i as d,aB as m}from"./index-7074710c.js";import{l as p}from"./index-67ec2c85.js";import{f as h}from"./index-47ca4f11.js";import{e as f}from"./EditorViewerRecoil-fb47fc9d.js";import"./index-fcf36459.js";function v(e){const i=a(f),n=`http://${window.location.host}/content/#/?doenetId=${i}`,s=r();return a(l("doenetId"))!==i?o("div",{style:e.style}):t("div",{style:e.style,children:[o("div",{children:"DonetML Name (soon)"}),o("div",{children:"Load time (soon) "}),o("div",{children:"Most recent release "}),t("div",{children:[o(p.CopyToClipboard,{onCopy:()=>s("Link copied to clipboard!",c.SUCCESS),text:n,children:t("button",{onClick:()=>{},children:["copy link ",o(d,{icon:h})]})}),t("button",{onClick:()=>window.open(n,"_blank"),children:["visit ",o(d,{icon:m})]})]})]})}export{v as default}; diff --git a/dist/assets/DraftActivityCap-37a8fd31.js b/dist/assets/DraftActivityCap-192dd31e.js similarity index 89% rename from dist/assets/DraftActivityCap-37a8fd31.js rename to dist/assets/DraftActivityCap-192dd31e.js index 74012344ea..f4b4c3f029 100644 --- a/dist/assets/DraftActivityCap-37a8fd31.js +++ b/dist/assets/DraftActivityCap-192dd31e.js @@ -1 +1 @@ -import{l as s,w as l,I as n,a as c,j as r}from"./index-99a56692.js";import{f as d,a as f}from"./util-85d105b8.js";import"./util-38d8e238.js";function h(){const a=s(l);let i=s(n(a));if(!i||Object.keys(i).length==0)return null;let t=i.color,e=i.image,o="course";return e!="none"&&(o=d(e),e="./drive_pictures/"+e),t!="none"&&(o=f(t),t="#"+t),c("div",{children:[r("div",{style:{position:"relative",width:"100%",height:"165px",overflow:"hidden"},children:r("img",{"aria-label":o,src:e,style:{position:"absolute",width:"100%",top:"50%",transform:"translateY(-50%)"}})}),r("b",{children:"Draft Activity"})]})}export{h as default}; +import{l as s,w as l,I as n,a as c,j as r}from"./index-7074710c.js";import{f as d,a as f}from"./util-85d105b8.js";import"./util-38d8e238.js";function h(){const a=s(l);let i=s(n(a));if(!i||Object.keys(i).length==0)return null;let t=i.color,e=i.image,o="course";return e!="none"&&(o=d(e),e="./drive_pictures/"+e),t!="none"&&(o=f(t),t="#"+t),c("div",{children:[r("div",{style:{position:"relative",width:"100%",height:"165px",overflow:"hidden"},children:r("img",{"aria-label":o,src:e,style:{position:"absolute",width:"100%",top:"50%",transform:"translateY(-50%)"}})}),r("b",{children:"Draft Activity"})]})}export{h as default}; diff --git a/dist/assets/DraftAssignmentViewer-820f180d.js b/dist/assets/DraftAssignmentViewer-a259f19d.js similarity index 88% rename from dist/assets/DraftAssignmentViewer-820f180d.js rename to dist/assets/DraftAssignmentViewer-a259f19d.js index 485df68e66..0ba597d46c 100644 --- a/dist/assets/DraftAssignmentViewer-820f180d.js +++ b/dist/assets/DraftAssignmentViewer-a259f19d.js @@ -1 +1 @@ -import{l as i,m as v,w as $,R as B,O as G,r as e,Q,S as T,G as J,v as K,k as U,j as n,F as W}from"./index-99a56692.js";import{A as X}from"./ActivityViewer-3a815948.js";import{r as Y}from"./activityUtils-c08c1686.js";import"./visibility-sensor-55e75ed1.js";import"./ActionButton-f612d279.js";import"./ButtonGroup-ea123297.js";function de(){const t=i(v("doenetId")),m=i($),o=i(v("requestedVariant")),S=o&&Number.isFinite(Number(o))?Number(o):1,y=B(G);let[f,r]=e.useState("Initializing"),[I,p]=e.useState("");const[{showCorrectness:V,paginate:A,showFeedback:C,showHints:D,autoSubmit:_,cid:F,doenetId:b,solutionDisplayMode:x},k]=e.useState({});let P=e.useRef([]);Q(t),T(m);let l=i(J(t)),u=l.label;e.useEffect(()=>{const a=document.title;return u&&(document.title=`${u} - Doenet`),()=>{document.title=a}},[u]),e.useEffect(()=>{O(t,l)},[l,t]);function M(a,g){y({index:a,numberOfVariants:g})}const O=K(({snapshot:a,set:g})=>async(w,{type:R,timeLimit:Z,assignedDate:ee,dueDate:te,showCorrectness:E,showCreditAchievedMenu:ae,paginate:L,showFeedback:N,showHints:j,autoSubmit:q,showSolution:z,proctorMakesAvailable:se})=>{if(R===void 0)return;let h="button";z||(h="none");let d=null,s=await U.get("/api/getCidForAssignment.php",{params:{doenetId:w,latestAttemptOverrides:!1,getDraft:!0}});if(!s.data.success||!s.data.cid){r("Problem"),p(`Error loading assignment: ${s.data.message}`);return}else d=s.data.cid;let c=await Y(d);if(!c.success){r("Problem"),p(c.message);return}P.current=[...Array(c.numberOfVariants).keys()].map(H=>H+1),k({showCorrectness:E,paginate:L,showFeedback:N,showHints:j,autoSubmit:q,cid:d,doenetId:w,solutionDisplayMode:h}),r("Ready")},[]);return t===""?null:m==="__not_found__"?n("h1",{children:"Content not found or no permission to view content"}):f==="Initializing"?null:f==="Problem"?n("h1",{children:I}):n(W,{children:n(X,{cid:F,doenetId:b,flags:{showCorrectness:V,readOnly:!1,solutionDisplayMode:x,showFeedback:C,showHints:D,autoSubmit:_,allowLoadState:!1,allowSaveState:!1,allowLocalState:!1,allowSaveSubmissions:!1,allowSaveEvents:!1},requestedVariantIndex:S,generatedVariantCallback:M,paginate:A},`activityViewer${b}`)})}export{de as default}; +import{l as i,m as v,w as $,R as B,O as G,r as e,Q,S as T,G as J,v as K,k as U,j as n,F as W}from"./index-7074710c.js";import{A as X}from"./ActivityViewer-becda8c0.js";import{r as Y}from"./activityUtils-9c5f1536.js";import"./visibility-sensor-7d414852.js";import"./ActionButton-e5ea2a2f.js";import"./ButtonGroup-9136da6d.js";function de(){const t=i(v("doenetId")),m=i($),o=i(v("requestedVariant")),S=o&&Number.isFinite(Number(o))?Number(o):1,y=B(G);let[f,r]=e.useState("Initializing"),[I,p]=e.useState("");const[{showCorrectness:V,paginate:A,showFeedback:C,showHints:D,autoSubmit:_,cid:F,doenetId:b,solutionDisplayMode:x},k]=e.useState({});let P=e.useRef([]);Q(t),T(m);let l=i(J(t)),u=l.label;e.useEffect(()=>{const a=document.title;return u&&(document.title=`${u} - Doenet`),()=>{document.title=a}},[u]),e.useEffect(()=>{O(t,l)},[l,t]);function M(a,g){y({index:a,numberOfVariants:g})}const O=K(({snapshot:a,set:g})=>async(w,{type:R,timeLimit:Z,assignedDate:ee,dueDate:te,showCorrectness:E,showCreditAchievedMenu:ae,paginate:L,showFeedback:N,showHints:j,autoSubmit:q,showSolution:z,proctorMakesAvailable:se})=>{if(R===void 0)return;let h="button";z||(h="none");let d=null,s=await U.get("/api/getCidForAssignment.php",{params:{doenetId:w,latestAttemptOverrides:!1,getDraft:!0}});if(!s.data.success||!s.data.cid){r("Problem"),p(`Error loading assignment: ${s.data.message}`);return}else d=s.data.cid;let c=await Y(d);if(!c.success){r("Problem"),p(c.message);return}P.current=[...Array(c.numberOfVariants).keys()].map(H=>H+1),k({showCorrectness:E,paginate:L,showFeedback:N,showHints:j,autoSubmit:q,cid:d,doenetId:w,solutionDisplayMode:h}),r("Ready")},[]);return t===""?null:m==="__not_found__"?n("h1",{children:"Content not found or no permission to view content"}):f==="Initializing"?null:f==="Problem"?n("h1",{children:I}):n(W,{children:n(X,{cid:F,doenetId:b,flags:{showCorrectness:V,readOnly:!1,solutionDisplayMode:x,showFeedback:C,showHints:D,autoSubmit:_,allowLoadState:!1,allowSaveState:!1,allowLocalState:!1,allowSaveSubmissions:!1,allowSaveEvents:!1},requestedVariantIndex:S,generatedVariantCallback:M,paginate:A},`activityViewer${b}`)})}export{de as default}; diff --git a/dist/assets/DriveInfoCap-648d1920.js b/dist/assets/DriveInfoCap-b5df74cd.js similarity index 84% rename from dist/assets/DriveInfoCap-648d1920.js rename to dist/assets/DriveInfoCap-b5df74cd.js index 179f779095..bacdcc00a7 100644 --- a/dist/assets/DriveInfoCap-648d1920.js +++ b/dist/assets/DriveInfoCap-b5df74cd.js @@ -1 +1 @@ -import{l as s,m as d,I as b,g as h,a as c,F as v,j as e}from"./index-99a56692.js";import{a as I,R as x}from"./RoleDropdown-5e05ae49.js";import{f as _,a as y}from"./util-85d105b8.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";import"./util-38d8e238.js";function D(){const n=s(d("courseId")),r=s(d("tool"));let o=s(b(n));const[m,u]=h(I(n));if(!o||Object.keys(o).length==0)return null;let f=o.roleLabel,a=o.color,i=o.image,g=o.label,t="course";i!="none"&&(t=_(i),i="url(./drive_pictures/"+i+")"),a!="none"&&(t=y(a),a="#"+a);let l="";return r=="navigation"?l="Course Navigation":r=="dashboard"?l="Dashboard":r=="data"&&(l="Data"),c(v,{children:[e("div",{style:{position:"relative",width:"100%",height:"165px",overflow:"hidden"},children:e("img",{"aria-label":t,style:{position:"absolute",width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundImage:i,backgroundColor:a}})}),e("b",{children:l}),c("div",{style:{padding:"16px 12px"},children:[e("span",{style:{marginBottom:"15px"},children:g})," ",e("br",{}),e("span",{style:{marginBottom:"15px"},children:f})," ",e("br",{}),e(x,{label:"View as",onChange:({value:p})=>u(p),valueRoleId:m??o.roleId,vertical:!0})]})]})}export{D as default}; +import{l as s,m as d,I as b,g as h,a as c,F as v,j as e}from"./index-7074710c.js";import{a as I,R as x}from"./RoleDropdown-cce90708.js";import{f as _,a as y}from"./util-85d105b8.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";import"./util-38d8e238.js";function D(){const n=s(d("courseId")),r=s(d("tool"));let o=s(b(n));const[m,u]=h(I(n));if(!o||Object.keys(o).length==0)return null;let f=o.roleLabel,a=o.color,i=o.image,g=o.label,t="course";i!="none"&&(t=_(i),i="url(./drive_pictures/"+i+")"),a!="none"&&(t=y(a),a="#"+a);let l="";return r=="navigation"?l="Course Navigation":r=="dashboard"?l="Dashboard":r=="data"&&(l="Data"),c(v,{children:[e("div",{style:{position:"relative",width:"100%",height:"165px",overflow:"hidden"},children:e("img",{"aria-label":t,style:{position:"absolute",width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundImage:i,backgroundColor:a}})}),e("b",{children:l}),c("div",{style:{padding:"16px 12px"},children:[e("span",{style:{marginBottom:"15px"},children:g})," ",e("br",{}),e("span",{style:{marginBottom:"15px"},children:f})," ",e("br",{}),e(x,{label:"View as",onChange:({value:p})=>u(p),valueRoleId:m??o.roleId,vertical:!0})]})]})}export{D as default}; diff --git a/dist/assets/DropdownMenu-9b4c45a6.js b/dist/assets/DropdownMenu-f3593bed.js similarity index 99% rename from dist/assets/DropdownMenu-9b4c45a6.js rename to dist/assets/DropdownMenu-f3593bed.js index a99f9862ec..93ad18d279 100644 --- a/dist/assets/DropdownMenu-9b4c45a6.js +++ b/dist/assets/DropdownMenu-f3593bed.js @@ -1,4 +1,4 @@ -import{r as f,aH as Bt,aI as E,aE as C,au as kt,aJ as Je,s as Ze,a as Ht,j as Ie}from"./index-99a56692.js";import{a as $t,_ as _t}from"./setPrototypeOf-51e8cf87.js";function ne(n,e,r){return e in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function Pe(n,e){var r=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})),r.push.apply(r,i)}return r}function S(n){for(var e=1;en.length)&&(e=n.length);for(var r=0,i=new Array(e);rn.length)&&(e=n.length);for(var r=0,i=new Array(e);r=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(r[i]=n[i])}return r}var jt=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Wt(n){var e=n.defaultInputValue,r=e===void 0?"":e,i=n.defaultMenuIsOpen,t=i===void 0?!1:i,a=n.defaultValue,s=a===void 0?null:a,u=n.inputValue,o=n.menuIsOpen,l=n.onChange,c=n.onInputChange,d=n.onMenuClose,p=n.onMenuOpen,g=n.value,m=Q(n,jt),b=f.useState(u!==void 0?u:r),v=W(b,2),h=v[0],D=v[1],y=f.useState(o!==void 0?o:t),F=W(y,2),A=F[0],O=F[1],V=f.useState(g!==void 0?g:s),x=W(V,2),I=x[0],B=x[1],H=f.useCallback(function(U,G){typeof l=="function"&&l(U,G),B(U)},[l]),R=f.useCallback(function(U,G){var Y;typeof c=="function"&&(Y=c(U,G)),D(Y!==void 0?Y:U)},[c]),$=f.useCallback(function(){typeof p=="function"&&p(),O(!0)},[p]),P=f.useCallback(function(){typeof d=="function"&&d(),O(!1)},[d]),w=u!==void 0?u:h,k=o!==void 0?o:A,_=g!==void 0?g:I;return S(S({},m),{},{inputValue:w,menuIsOpen:k,onChange:H,onInputChange:R,onMenuClose:P,onMenuOpen:$,value:_})}function Gt(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function we(n,e){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ce(n){return ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ce(n)}function Kt(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Jt(n,e){if(e&&(ce(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kt(n)}function Zt(n){var e=Xt();return function(){var i=le(n),t;if(e){var a=le(this).constructor;t=Reflect.construct(i,arguments,a)}else t=i.apply(this,arguments);return Jt(this,t)}}function Qt(n){if(Array.isArray(n))return Fe(n)}function en(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function tn(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function et(n){return Qt(n)||en(n)||Qe(n)||tn()}function nn(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}function rn(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}const un=["top","right","bottom","left"];un.reduce((n,e)=>n.concat(e,e+"-start",e+"-end"),[]);function j(n){var e;return((e=n.ownerDocument)==null?void 0:e.defaultView)||window}function tt(n){return j(n).getComputedStyle(n)}function nt(n){return n instanceof j(n).Node}function rt(n){return nt(n)?(n.nodeName||"").toLowerCase():""}let ie;function an(){if(ie)return ie;const n=navigator.userAgentData;return n&&Array.isArray(n.brands)?(ie=n.brands.map(e=>e.brand+"/"+e.version).join(" "),ie):navigator.userAgent}function De(n){return n instanceof j(n).HTMLElement}function Z(n){return n instanceof j(n).Element}function Le(n){return typeof ShadowRoot>"u"?!1:n instanceof j(n).ShadowRoot||n instanceof ShadowRoot}function it(n){const{overflow:e,overflowX:r,overflowY:i,display:t}=tt(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+r)&&!["inline","contents"].includes(t)}function on(){return/^((?!chrome|android).)*safari/i.test(an())}function sn(n){return["html","body","#document"].includes(rt(n))}const de=Math.round;function ln(n){const e=tt(n);let r=parseFloat(e.width),i=parseFloat(e.height);const t=De(n),a=t?n.offsetWidth:r,s=t?n.offsetHeight:i,u=de(r)!==a||de(i)!==s;return u&&(r=a,i=s),{width:r,height:i,fallback:u}}function ut(n){return Z(n)?n:n.contextElement}const at={x:1,y:1};function he(n){const e=ut(n);if(!De(e))return at;const r=e.getBoundingClientRect(),{width:i,height:t,fallback:a}=ln(e);let s=(a?de(r.width):r.width)/i,u=(a?de(r.height):r.height)/t;return s&&Number.isFinite(s)||(s=1),u&&Number.isFinite(u)||(u=1),{x:s,y:u}}function Re(n,e,r,i){var t,a;e===void 0&&(e=!1),r===void 0&&(r=!1);const s=n.getBoundingClientRect(),u=ut(n);let o=at;e&&(i?Z(i)&&(o=he(i)):o=he(n));const l=u?j(u):window,c=on()&&r;let d=(s.left+(c&&((t=l.visualViewport)==null?void 0:t.offsetLeft)||0))/o.x,p=(s.top+(c&&((a=l.visualViewport)==null?void 0:a.offsetTop)||0))/o.y,g=s.width/o.x,m=s.height/o.y;if(u){const b=j(u),v=i&&Z(i)?j(i):i;let h=b.frameElement;for(;h&&i&&v!==b;){const D=he(h),y=h.getBoundingClientRect(),F=getComputedStyle(h);y.x+=(h.clientLeft+parseFloat(F.paddingLeft))*D.x,y.y+=(h.clientTop+parseFloat(F.paddingTop))*D.y,d*=D.x,p*=D.y,g*=D.x,m*=D.y,d+=y.x,p+=y.y,h=j(h).frameElement}}return rn({width:g,height:m,x:d,y:p})}function cn(n){return((nt(n)?n.ownerDocument:n.document)||window.document).documentElement}function dn(n){if(rt(n)==="html")return n;const e=n.assignedSlot||n.parentNode||Le(n)&&n.host||cn(n);return Le(e)?e.host:e}function ot(n){const e=dn(n);return sn(e)?e.ownerDocument.body:De(e)&&it(e)?e:ot(e)}function se(n,e){var r;e===void 0&&(e=[]);const i=ot(n),t=i===((r=n.ownerDocument)==null?void 0:r.body),a=j(i);return t?e.concat(a,a.visualViewport||[],it(i)?i:[]):e.concat(i,se(i))}function fn(n,e,r,i){i===void 0&&(i={});const{ancestorScroll:t=!0,ancestorResize:a=!0,elementResize:s=!0,animationFrame:u=!1}=i,o=t&&!u,l=o||a?[...Z(n)?se(n):n.contextElement?se(n.contextElement):[],...se(e)]:[];l.forEach(g=>{o&&g.addEventListener("scroll",r,{passive:!0}),a&&g.addEventListener("resize",r)});let c,d=null;if(s){let g=!0;d=new ResizeObserver(()=>{g||r(),g=!1}),Z(n)&&!u&&d.observe(n),Z(n)||!n.contextElement||u||d.observe(n.contextElement),d.observe(e)}let p=u?Re(n):null;return u&&function g(){const m=Re(n);!p||m.x===p.x&&m.y===p.y&&m.width===p.width&&m.height===p.height||r(),p=m,c=requestAnimationFrame(g)}(),r(),()=>{var g;l.forEach(m=>{o&&m.removeEventListener("scroll",r),a&&m.removeEventListener("resize",r)}),(g=d)==null||g.disconnect(),d=null,u&&cancelAnimationFrame(c)}}var ye=f.useLayoutEffect,pn=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],fe=function(){};function vn(n,e){return e?e[0]==="-"?n+e:n+"__"+e:n}function mn(n,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),t=2;t-1}function hn(n){return me(n)?window.innerHeight:n.clientHeight}function lt(n){return me(n)?window.pageYOffset:n.scrollTop}function pe(n,e){if(me(n)){window.scrollTo(0,e);return}n.scrollTop=e}function gn(n){var e=getComputedStyle(n),r=e.position==="absolute",i=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var t=n;t=t.parentElement;)if(e=getComputedStyle(t),!(r&&e.position==="static")&&i.test(e.overflow+e.overflowY+e.overflowX))return t;return document.documentElement}function bn(n,e,r,i){return r*((n=n/i-1)*n*n+1)+e}function ue(n,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:fe,t=lt(n),a=e-t,s=10,u=0;function o(){u+=s;var l=bn(u,t,a,r);pe(n,l),ur.bottom?pe(n,Math.min(e.offsetTop+e.clientHeight-n.offsetHeight+t,n.scrollHeight)):i.top-t1?r-1:0),t=1;t=m)return{placement:"bottom",maxHeight:e};if(I>=m&&!s)return a&&ue(o,B,R),{placement:"bottom",maxHeight:e};if(!s&&I>=i||s&&V>=i){a&&ue(o,B,R);var $=s?V-F:I-F;return{placement:"bottom",maxHeight:$}}if(t==="auto"||s){var P=e,w=s?O:x;return w>=i&&(P=Math.min(w-F-u,e)),{placement:"top",maxHeight:P}}if(t==="bottom")return a&&pe(o,B),{placement:"bottom",maxHeight:e};break;case"top":if(O>=m)return{placement:"top",maxHeight:e};if(x>=m&&!s)return a&&ue(o,H,R),{placement:"top",maxHeight:e};if(!s&&x>=i||s&&O>=i){var k=e;return(!s&&x>=i||s&&O>=i)&&(k=s?O-A:x-A),a&&ue(o,H,R),{placement:"top",maxHeight:k}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(t,'".'))}return l}function Vn(n){var e={bottom:"top",top:"bottom"};return n?e[n]:"bottom"}var dt=function(e){return e==="auto"?"bottom":e},An=function(e,r){var i,t=e.placement,a=e.theme,s=a.borderRadius,u=a.spacing,o=a.colors;return S((i={label:"menu"},ne(i,Vn(t),"100%"),ne(i,"position","absolute"),ne(i,"width","100%"),ne(i,"zIndex",1),i),r?{}:{backgroundColor:o.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:u.menuGutter,marginTop:u.menuGutter})},ft=f.createContext(null),Mn=function(e){var r=e.children,i=e.minMenuHeight,t=e.maxMenuHeight,a=e.menuPlacement,s=e.menuPosition,u=e.menuShouldScrollIntoView,o=e.theme,l=f.useContext(ft)||{},c=l.setPortalPlacement,d=f.useRef(null),p=f.useState(t),g=W(p,2),m=g[0],b=g[1],v=f.useState(null),h=W(v,2),D=h[0],y=h[1],F=o.spacing.controlHeight;return ye(function(){var A=d.current;if(A){var O=s==="fixed",V=u&&!O,x=xn({maxHeight:t,menuEl:A,minHeight:i,placement:a,shouldScroll:V,isFixedPosition:O,controlHeight:F});b(x.maxHeight),y(x.placement),c==null||c(x.placement)}},[t,a,s,u,i,c,F]),r({ref:d,placerProps:S(S({},e),{},{placement:D||dt(a),maxHeight:m})})},In=function(e){var r=e.children,i=e.innerRef,t=e.innerProps;return E("div",C({},M(e,"menu",{menu:!0}),{ref:i},t),r)},Pn=function(e,r){var i=e.maxHeight,t=e.theme.spacing.baseUnit;return S({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},r?{}:{paddingBottom:t,paddingTop:t})},wn=function(e){var r=e.children,i=e.innerProps,t=e.innerRef,a=e.isMulti;return E("div",C({},M(e,"menuList",{"menu-list":!0,"menu-list--is-multi":a}),{ref:t},i),r)},pt=function(e,r){var i=e.theme,t=i.spacing.baseUnit,a=i.colors;return S({textAlign:"center"},r?{}:{color:a.neutral40,padding:"".concat(t*2,"px ").concat(t*3,"px")})},Ln=pt,Rn=pt,vt=function(e){var r=e.children,i=e.innerProps;return E("div",C({},M(e,"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)};vt.defaultProps={children:"No options"};var mt=function(e){var r=e.children,i=e.innerProps;return E("div",C({},M(e,"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)};mt.defaultProps={children:"Loading..."};var Tn=function(e){var r=e.rect,i=e.offset,t=e.position;return{left:r.left,position:t,top:i,width:r.width,zIndex:1}},Bn=function(e){var r=e.appendTo,i=e.children,t=e.controlElement,a=e.innerProps,s=e.menuPlacement,u=e.menuPosition,o=f.useRef(null),l=f.useRef(null),c=f.useState(dt(s)),d=W(c,2),p=d[0],g=d[1],m=f.useMemo(function(){return{setPortalPlacement:g}},[]),b=f.useState(null),v=W(b,2),h=v[0],D=v[1],y=f.useCallback(function(){if(t){var V=En(t),x=u==="fixed"?0:window.pageYOffset,I=V[p]+x;(I!==(h==null?void 0:h.offset)||V.left!==(h==null?void 0:h.rect.left)||V.width!==(h==null?void 0:h.rect.width))&&D({offset:I,rect:V})}},[t,u,p,h==null?void 0:h.offset,h==null?void 0:h.rect.left,h==null?void 0:h.rect.width]);ye(function(){y()},[y]);var F=f.useCallback(function(){typeof l.current=="function"&&(l.current(),l.current=null),t&&o.current&&(l.current=fn(t,o.current,y,{elementResize:"ResizeObserver"in window}))},[t,y]);ye(function(){F()},[F]);var A=f.useCallback(function(V){o.current=V,F()},[F]);if(!r&&u!=="fixed"||!h)return null;var O=E("div",C({ref:A},M(S(S({},e),{},{offset:h.offset,position:u,rect:h.rect}),"menuPortal",{"menu-portal":!0}),a),i);return E(ft.Provider,{value:m},r?kt.createPortal(O,r):O)},kn=function(e){var r=e.isDisabled,i=e.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:r?"none":void 0,position:"relative"}},Hn=function(e){var r=e.children,i=e.innerProps,t=e.isDisabled,a=e.isRtl;return E("div",C({},M(e,"container",{"--is-disabled":t,"--is-rtl":a}),i),r)},$n=function(e,r){var i=e.theme.spacing,t=e.isMulti,a=e.hasValue,s=e.selectProps.controlShouldRenderValue;return S({alignItems:"center",display:t&&a&&s?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},r?{}:{padding:"".concat(i.baseUnit/2,"px ").concat(i.baseUnit*2,"px")})},_n=function(e){var r=e.children,i=e.innerProps,t=e.isMulti,a=e.hasValue;return E("div",C({},M(e,"valueContainer",{"value-container":!0,"value-container--is-multi":t,"value-container--has-value":a}),i),r)},Un=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},Nn=function(e){var r=e.children,i=e.innerProps;return E("div",C({},M(e,"indicatorsContainer",{indicators:!0}),i),r)},He,zn=["size"],jn={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},ht=function(e){var r=e.size,i=Q(e,zn);return E("svg",C({height:r,width:r,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:jn},i))},xe=function(e){return E(ht,C({size:20},e),E("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},gt=function(e){return E(ht,C({size:20},e),E("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},bt=function(e,r){var i=e.isFocused,t=e.theme,a=t.spacing.baseUnit,s=t.colors;return S({label:"indicatorContainer",display:"flex",transition:"color 150ms"},r?{}:{color:i?s.neutral60:s.neutral20,padding:a*2,":hover":{color:i?s.neutral80:s.neutral40}})},Wn=bt,Gn=function(e){var r=e.children,i=e.innerProps;return E("div",C({},M(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),r||E(gt,null))},Yn=bt,qn=function(e){var r=e.children,i=e.innerProps;return E("div",C({},M(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),r||E(xe,null))},Xn=function(e,r){var i=e.isDisabled,t=e.theme,a=t.spacing.baseUnit,s=t.colors;return S({label:"indicatorSeparator",alignSelf:"stretch",width:1},r?{}:{backgroundColor:i?s.neutral10:s.neutral20,marginBottom:a*2,marginTop:a*2})},Kn=function(e){var r=e.innerProps;return E("span",C({},r,M(e,"indicatorSeparator",{"indicator-separator":!0})))},Jn=Bt(He||(He=nn([` 0%, 80%, 100% { opacity: 0; } diff --git a/dist/assets/EditorBreadCrumb-281f518e.js b/dist/assets/EditorBreadCrumb-281f518e.js deleted file mode 100644 index 5c28c70620..0000000000 --- a/dist/assets/EditorBreadCrumb-281f518e.js +++ /dev/null @@ -1 +0,0 @@ -import{l as r,w as c,m as o,j as s,r as b}from"./index-99a56692.js";import{B as p}from"./BreadCrumb-c66b383a.js";import{u as C,a as l,b as f,e as I}from"./breadcrumbUtil-6dfe85b1.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-e81ca638.js";function P(){const a=r(c),e=r(o("doenetId")),t=r(o("pageId")),m=r(o("linkPageId")),d=C(),i=l(a),u=f(a,e),n=I({doenetId:e,pageId:t,linkPageId:m});return s(b.Suspense,{fallback:s("div",{children:"Loading Breadcrumb..."}),children:s(p,{crumbs:[d,i,...u,...n],offset:68})})}export{P as default}; diff --git a/dist/assets/EditorBreadCrumb-b3c0d4e4.js b/dist/assets/EditorBreadCrumb-b3c0d4e4.js new file mode 100644 index 0000000000..296d33754e --- /dev/null +++ b/dist/assets/EditorBreadCrumb-b3c0d4e4.js @@ -0,0 +1 @@ +import{l as r,w as c,m as o,j as s,r as b}from"./index-7074710c.js";import{B as p}from"./BreadCrumb-c4dbe368.js";import{u as C,a as l,b as f,e as I}from"./breadcrumbUtil-1e7f0dfb.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-06d28967.js";function P(){const a=r(c),e=r(o("doenetId")),t=r(o("pageId")),m=r(o("linkPageId")),d=C(),i=l(a),u=f(a,e),n=I({doenetId:e,pageId:t,linkPageId:m});return s(b.Suspense,{fallback:s("div",{children:"Loading Breadcrumb..."}),children:s(p,{crumbs:[d,i,...u,...n],offset:68})})}export{P as default}; diff --git a/dist/assets/EditorInfoCap-87dcbfa3.js b/dist/assets/EditorInfoCap-a2e17057.js similarity index 96% rename from dist/assets/EditorInfoCap-87dcbfa3.js rename to dist/assets/EditorInfoCap-a2e17057.js index 9a5aceea99..06e9914b66 100644 --- a/dist/assets/EditorInfoCap-87dcbfa3.js +++ b/dist/assets/EditorInfoCap-a2e17057.js @@ -1 +1 @@ -import{l as n,w as v,m as s,a6 as y,G as m,a,F as l,j as i}from"./index-99a56692.js";import{f as u,a as b}from"./util-85d105b8.js";import"./util-38d8e238.js";function _(){const c=n(v),g=n(s("doenetId")),x=n(s("pageId"));let{color:t,image:e,label:h}=y(c);const r=n(m(x)),o=n(m(g));let d="course";if(!r||!e)return null;e!="none"&&(d=u(e),e="url(./drive_pictures/"+e+")"),t!="none"&&(d=b(t),t="#"+t);let p=a(l,{children:[i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Activity"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:o.label}),i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Page"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:r.label})]});return o.isSinglePage&&(p=a(l,{children:[i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Activity"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:o.label})]})),o.type=="bank"&&(p=a(l,{children:[i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Collection"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:o.label}),i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Page"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:r.label})]})),a(l,{children:[i("div",{style:{position:"relative",width:"100%",height:"165px",overflow:"hidden"},children:i("img",{"aria-label":d,style:{position:"absolute",width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundImage:e,backgroundColor:t}})}),i("b",{children:"Editor"}),i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Course"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:h}),p]})}export{_ as default}; +import{l as n,w as v,m as s,a6 as y,G as m,a,F as l,j as i}from"./index-7074710c.js";import{f as u,a as b}from"./util-85d105b8.js";import"./util-38d8e238.js";function _(){const c=n(v),g=n(s("doenetId")),x=n(s("pageId"));let{color:t,image:e,label:h}=y(c);const r=n(m(x)),o=n(m(g));let d="course";if(!r||!e)return null;e!="none"&&(d=u(e),e="url(./drive_pictures/"+e+")"),t!="none"&&(d=b(t),t="#"+t);let p=a(l,{children:[i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Activity"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:o.label}),i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Page"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:r.label})]});return o.isSinglePage&&(p=a(l,{children:[i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Activity"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:o.label})]})),o.type=="bank"&&(p=a(l,{children:[i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Collection"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:o.label}),i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Page"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:r.label})]})),a(l,{children:[i("div",{style:{position:"relative",width:"100%",height:"165px",overflow:"hidden"},children:i("img",{"aria-label":d,style:{position:"absolute",width:"100%",height:"100%",backgroundSize:"cover",backgroundPosition:"center",backgroundImage:e,backgroundColor:t}})}),i("b",{children:"Editor"}),i("div",{style:{marginBottom:"1px",marginTop:"5px"},children:"Course"}),i("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:h}),p]})}export{_ as default}; diff --git a/dist/assets/EditorViewer-55cb3454.js b/dist/assets/EditorViewer-d9b9074f.js similarity index 95% rename from dist/assets/EditorViewer-55cb3454.js rename to dist/assets/EditorViewer-d9b9074f.js index 7f97d858b5..701e8786df 100644 --- a/dist/assets/EditorViewer-55cb3454.js +++ b/dist/assets/EditorViewer-d9b9074f.js @@ -1 +1 @@ -import{r as i,a4 as ne,l,m as k,g as D,w as oe,h as se,R as w,f as ae,G as b,E as re,c as ie,ab as le,u as ue,Q as ce,S as de,v as F,k as fe,j as O,P as me}from"./index-99a56692.js";import{v as _,e as x,r as N,a as $,u as pe,t as B}from"./EditorViewerRecoil-41e59102.js";function ge(t,s,n=window){const a=i.useRef(s);i.useEffect(()=>{a.current=s},[s]),i.useEffect(()=>{if(n==null)return;const c=p=>a.current(p);return n.addEventListener(t,c),()=>n.removeEventListener(t,c)},[t,n])}const K=()=>F(({snapshot:s,set:n})=>async()=>{const a=await s.getPromise(B),c=await s.getPromise($);n(_,a),c&&n(N,p=>p+1)});function Ie(){let t=ne();const s=t==null?void 0:t.courseId,n=t==null?void 0:t.doenetId,a=t==null?void 0:t.pageDoenetId,c=l(_),p=l(k("pageId")),P=l(k("linkPageId")),y=l(k("doenetId"));let u=p,v=y;P&&(u=P,v=P),n&&(u=a,v=n);const[A,M]=D(oe),U=l(x),[z,G]=D(se),J=w(ae),V=w(x),q=l(N),H=w($),[h,Q]=D(b(u)),d=l(b(y)),C=w(re),{canUpload:T}=l(ie),W=K(),X=w(le);let o=ue();const g=i.useRef({}),E=i.useRef(null);ce(v),de(A);let L=!1,I=null;Object.keys(h).length>0&&(L=!0,d!=null&&d.isSinglePage&&!P?I=d==null?void 0:d.label:I=h.label),i.useEffect(()=>{const e=document.title;return I&&(document.title=`${I} - Doenet`),()=>{document.title=e}},[I]);let R=F(({snapshot:e,set:r})=>async f=>{let{data:S}=await fe.get(`/media/byPageId/${f}.doenet`);S=S.toString();let j=await e.getPromise(b(f)),te=await e.getPromise(b(j.containingDoenetId));r(pe,S),r(B,S),r(_,S),r(x,f);let m=[];te.type=="bank"&&m.push("AssignmentSettingsMenu"),j.type=="pageLink"&&(m.push("AssignmentSettingsMenu"),m.push("PageLink"),m.push("SupportingFilesMenu")),T!=="1"&&m.push("SupportingFilesMenu"),C(m)},[C]);if(i.useEffect(()=>(u!==""&&L?R(u):a&&(M(s),Q({containingDoenetId:n,doenetId:a,isSelected:!1,label:"Untitled",parentDoenetId:n,type:"page"})),()=>{V("")}),[s,M,R,V,a,u,L]),ge("keydown",e=>{(e.keyCode===83&&e.metaKey||e.keyCode===83&&e.ctrlKey)&&(e.preventDefault(),W())}),i.useEffect(()=>{var e,r;E.current!==o.key&&(((e=o.state)==null?void 0:e.previousScrollPosition)!==void 0&&E.current&&(g.current[E.current].lastScrollPosition=o.state.previousScrollPosition),g.current[o.key]&&((r=g.current[o.key])==null?void 0:r.lastScrollPosition)!==void 0&&document.getElementById("mainPanel").scroll({top:g.current[o.key].lastScrollPosition}),g.current[o.key]={...o},E.current=o.key)},[o]),i.useEffect(()=>{const e=document.getElementById("mainPanel");X(e)},[]),A==="__not_found__")return O("h1",{children:"Content not found or no permission to view content"});if(u!==U)return null;let Y=1,Z="button";function ee(e,r){const f=JSON.parse(JSON.stringify(e));J({index:f.index,allPossibleVariants:r}),G({index:f.index})}return O(me,{doenetML:c,flags:{showCorrectness:!0,solutionDisplayMode:Z,showFeedback:!0,showHints:!0,autoSubmit:!1,allowLoadState:!1,allowSaveState:!1,allowLocalState:!1,allowSaveSubmissions:!1,allowSaveEvents:!1},doenetId:y,attemptNumber:Y,generatedVariantCallback:ee,requestedVariantIndex:z.index,setIsInErrorState:H,pageIsActive:!0},`pageViewer${q}`)}const Pe=Object.freeze(Object.defineProperty({__proto__:null,default:Ie,useUpdateViewer:K},Symbol.toStringTag,{value:"Module"}));export{Pe as E,ge as a,K as u}; +import{r as i,a4 as ne,l,m as k,g as D,w as oe,h as se,R as w,f as ae,G as b,E as re,c as ie,ab as le,u as ue,Q as ce,S as de,v as F,k as fe,j as O,P as me}from"./index-7074710c.js";import{v as _,e as x,r as N,a as $,u as pe,t as B}from"./EditorViewerRecoil-fb47fc9d.js";function ge(t,s,n=window){const a=i.useRef(s);i.useEffect(()=>{a.current=s},[s]),i.useEffect(()=>{if(n==null)return;const c=p=>a.current(p);return n.addEventListener(t,c),()=>n.removeEventListener(t,c)},[t,n])}const K=()=>F(({snapshot:s,set:n})=>async()=>{const a=await s.getPromise(B),c=await s.getPromise($);n(_,a),c&&n(N,p=>p+1)});function Ie(){let t=ne();const s=t==null?void 0:t.courseId,n=t==null?void 0:t.doenetId,a=t==null?void 0:t.pageDoenetId,c=l(_),p=l(k("pageId")),P=l(k("linkPageId")),y=l(k("doenetId"));let u=p,v=y;P&&(u=P,v=P),n&&(u=a,v=n);const[A,M]=D(oe),U=l(x),[z,G]=D(se),J=w(ae),V=w(x),q=l(N),H=w($),[h,Q]=D(b(u)),d=l(b(y)),C=w(re),{canUpload:T}=l(ie),W=K(),X=w(le);let o=ue();const g=i.useRef({}),E=i.useRef(null);ce(v),de(A);let L=!1,I=null;Object.keys(h).length>0&&(L=!0,d!=null&&d.isSinglePage&&!P?I=d==null?void 0:d.label:I=h.label),i.useEffect(()=>{const e=document.title;return I&&(document.title=`${I} - Doenet`),()=>{document.title=e}},[I]);let R=F(({snapshot:e,set:r})=>async f=>{let{data:S}=await fe.get(`/media/byPageId/${f}.doenet`);S=S.toString();let j=await e.getPromise(b(f)),te=await e.getPromise(b(j.containingDoenetId));r(pe,S),r(B,S),r(_,S),r(x,f);let m=[];te.type=="bank"&&m.push("AssignmentSettingsMenu"),j.type=="pageLink"&&(m.push("AssignmentSettingsMenu"),m.push("PageLink"),m.push("SupportingFilesMenu")),T!=="1"&&m.push("SupportingFilesMenu"),C(m)},[C]);if(i.useEffect(()=>(u!==""&&L?R(u):a&&(M(s),Q({containingDoenetId:n,doenetId:a,isSelected:!1,label:"Untitled",parentDoenetId:n,type:"page"})),()=>{V("")}),[s,M,R,V,a,u,L]),ge("keydown",e=>{(e.keyCode===83&&e.metaKey||e.keyCode===83&&e.ctrlKey)&&(e.preventDefault(),W())}),i.useEffect(()=>{var e,r;E.current!==o.key&&(((e=o.state)==null?void 0:e.previousScrollPosition)!==void 0&&E.current&&(g.current[E.current].lastScrollPosition=o.state.previousScrollPosition),g.current[o.key]&&((r=g.current[o.key])==null?void 0:r.lastScrollPosition)!==void 0&&document.getElementById("mainPanel").scroll({top:g.current[o.key].lastScrollPosition}),g.current[o.key]={...o},E.current=o.key)},[o]),i.useEffect(()=>{const e=document.getElementById("mainPanel");X(e)},[]),A==="__not_found__")return O("h1",{children:"Content not found or no permission to view content"});if(u!==U)return null;let Y=1,Z="button";function ee(e,r){const f=JSON.parse(JSON.stringify(e));J({index:f.index,allPossibleVariants:r}),G({index:f.index})}return O(me,{doenetML:c,flags:{showCorrectness:!0,solutionDisplayMode:Z,showFeedback:!0,showHints:!0,autoSubmit:!1,allowLoadState:!1,allowSaveState:!1,allowLocalState:!1,allowSaveSubmissions:!1,allowSaveEvents:!1},doenetId:y,attemptNumber:Y,generatedVariantCallback:ee,requestedVariantIndex:z.index,setIsInErrorState:H,pageIsActive:!0},`pageViewer${q}`)}const Pe=Object.freeze(Object.defineProperty({__proto__:null,default:Ie,useUpdateViewer:K},Symbol.toStringTag,{value:"Module"}));export{Pe as E,ge as a,K as u}; diff --git a/dist/assets/EditorViewerRecoil-41e59102.js b/dist/assets/EditorViewerRecoil-fb47fc9d.js similarity index 83% rename from dist/assets/EditorViewerRecoil-41e59102.js rename to dist/assets/EditorViewerRecoil-fb47fc9d.js index f2b5008999..d1571278f8 100644 --- a/dist/assets/EditorViewerRecoil-41e59102.js +++ b/dist/assets/EditorViewerRecoil-fb47fc9d.js @@ -1 +1 @@ -import{ag as e}from"./index-99a56692.js";const o=e({key:"viewerDoenetMLAtom",default:""}),r=e({key:"textEditorDoenetMLAtom",default:""}),a=e({key:"updateTextEditorDoenetMLAtom",default:""}),d=e({key:"editorPageIdInitAtom",default:""}),i=e({key:"refreshNumberAtom",default:0}),m=e({key:"editorViewerErrorStateAtom",default:!1});export{m as a,d as e,i as r,r as t,a as u,o as v}; +import{ag as e}from"./index-7074710c.js";const o=e({key:"viewerDoenetMLAtom",default:""}),r=e({key:"textEditorDoenetMLAtom",default:""}),a=e({key:"updateTextEditorDoenetMLAtom",default:""}),d=e({key:"editorPageIdInitAtom",default:""}),i=e({key:"refreshNumberAtom",default:0}),m=e({key:"editorViewerErrorStateAtom",default:!1});export{m as a,d as e,i as r,r as t,a as u,o as v}; diff --git a/dist/assets/Empty-8983c1e6.js b/dist/assets/Empty-8983c1e6.js deleted file mode 100644 index 4078bdae93..0000000000 --- a/dist/assets/Empty-8983c1e6.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./index-99a56692.js";function s(t){return e("div",{style:t.style})}export{s as default}; diff --git a/dist/assets/Empty-92901ef6.js b/dist/assets/Empty-92901ef6.js new file mode 100644 index 0000000000..345abff72d --- /dev/null +++ b/dist/assets/Empty-92901ef6.js @@ -0,0 +1 @@ +import{j as e}from"./index-7074710c.js";function s(t){return e("div",{style:t.style})}export{s as default}; diff --git a/dist/assets/EndExamPanel-f3f7d295.js b/dist/assets/EndExamPanel-81101893.js similarity index 98% rename from dist/assets/EndExamPanel-f3f7d295.js rename to dist/assets/EndExamPanel-81101893.js index 1f52bbdae4..25c0ab5cab 100644 --- a/dist/assets/EndExamPanel-f3f7d295.js +++ b/dist/assets/EndExamPanel-81101893.js @@ -1,4 +1,4 @@ -import{l as c,m,r as y,k as b,a as e,j as t,s as p}from"./index-99a56692.js";const I=p.div` +import{l as c,m,r as y,k as b,a as e,j as t,s as p}from"./index-7074710c.js";const I=p.div` border-bottom: 2px solid var(--canvastext); height: 2px; width: 230px; diff --git a/dist/assets/EndPlacementExamPanel-0d1b65fe.js b/dist/assets/EndPlacementExamPanel-8a6e246e.js similarity index 90% rename from dist/assets/EndPlacementExamPanel-0d1b65fe.js rename to dist/assets/EndPlacementExamPanel-8a6e246e.js index dfcaec400a..e4887a52de 100644 --- a/dist/assets/EndPlacementExamPanel-0d1b65fe.js +++ b/dist/assets/EndPlacementExamPanel-8a6e246e.js @@ -1 +1 @@ -import{a as t,j as e}from"./index-99a56692.js";function a(){return t("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",justifyContent:"center",alignItems:"center",margin:"20"},children:[e("div",{style:{display:"flex",alignItems:"center"},children:e("h1",{children:"Exam is finished"})}),e("div",{style:{alignItems:"center",maxWidth:"400px"},children:e("p",{children:"You have completed the MathPlacementExam. It may take 24 hours for your results to show on the New Student Orientation Checklist. Further information about the math placement process can be found on the New Student Orientation Checklist."})})]})}export{a as default}; +import{a as t,j as e}from"./index-7074710c.js";function a(){return t("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",justifyContent:"center",alignItems:"center",margin:"20"},children:[e("div",{style:{display:"flex",alignItems:"center"},children:e("h1",{children:"Exam is finished"})}),e("div",{style:{alignItems:"center",maxWidth:"400px"},children:e("p",{children:"You have completed the MathPlacementExam. It may take 24 hours for your results to show on the New Student Orientation Checklist. Further information about the math placement process can be found on the New Student Orientation Checklist."})})]})}export{a as default}; diff --git a/dist/assets/EnrollStudents-033b160b.js b/dist/assets/EnrollStudents-140e54f0.js similarity index 64% rename from dist/assets/EnrollStudents-033b160b.js rename to dist/assets/EnrollStudents-140e54f0.js index 985aa8f821..e838697d2d 100644 --- a/dist/assets/EnrollStudents-033b160b.js +++ b/dist/assets/EnrollStudents-140e54f0.js @@ -1 +1 @@ -import{R as a,p as r,l,m as s,j as o,B as i}from"./index-99a56692.js";import{B as n}from"./ButtonGroup-ea123297.js";function p(){const e=a(r),t=l(s("courseId"));return o(n,{vertical:!0,children:o(i,{width:"menu",onClick:()=>e({page:"course",tool:"people",view:"",params:{courseId:t}}),value:"Go to People",children:"Go to People"})})}export{p as default}; +import{R as a,p as r,l,m as s,j as o,B as i}from"./index-7074710c.js";import{B as n}from"./ButtonGroup-9136da6d.js";function p(){const e=a(r),t=l(s("courseId"));return o(n,{vertical:!0,children:o(i,{width:"menu",onClick:()=>e({page:"course",tool:"people",view:"",params:{courseId:t}}),value:"Go to People",children:"Go to People"})})}export{p as default}; diff --git a/dist/assets/GradeDownload-ab9858a0.js b/dist/assets/GradeDownload-0b1ded25.js similarity index 91% rename from dist/assets/GradeDownload-ab9858a0.js rename to dist/assets/GradeDownload-0b1ded25.js index e4ef0b2409..7407c86860 100644 --- a/dist/assets/GradeDownload-ab9858a0.js +++ b/dist/assets/GradeDownload-0b1ded25.js @@ -1,3 +1,3 @@ -import{l as k,m as E,v as F,I as G,a5 as L,aF as M,j as N,B as U}from"./index-99a56692.js";import{assignmentData as W,overviewData as X,gradeCategories as q}from"./Gradebook-e81ca638.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";function Y(){const R=k(E("courseId")),D=F(({snapshot:d})=>async g=>{var h,x,S,A,T,B;const{label:O}=await d.getPromise(G(g));let V=`${O}.csv`,f,l=await d.getPromise(W),_=await d.getPromise(X);const{value:j}=await d.getPromise(L(g));let t={},I="Name,Email,External Id,Section,Withdrew,",a="Possible Points,,,,,";for(const{userId:o,email:i,roleId:v,withdrew:P,externalId:m,section:w,firstName:b,lastName:e}of j){const{isIncludedInGradebook:s}=await d.getPromise(M({courseId:g,roleId:v}));if(s!=="1")continue;const $=`${b} ${e}`.replaceAll('"','""');t[o]={courseTotal:0,csv:`"${$}",${i},${m},${w},${P==="1"?"X":""},`}}let y=0,C=Object.entries(l);C.sort((o,i)=>o[1].sortOrders-e).slice(0,v);let w=m.reduce((e,s)=>e+s,0)*i,b=Math.min(w,P);y+=b,I+=`${o} Total,`,a=`${a}${b},`;for(const e in t){let s=t[e][o];s=s.sort((r,c)=>c-r).slice(0,v);let $=s.reduce((r,c)=>r+c,0)*i,n=Math.min($,P);t[e].csv=`${t[e].csv}${n},`,t[e].courseTotal+=n}}I+="Course Total",a=`${a}${y}`,f=`${I} +import{l as k,m as E,v as F,I as G,a5 as L,aF as M,j as N,B as U}from"./index-7074710c.js";import{assignmentData as W,overviewData as X,gradeCategories as q}from"./Gradebook-06d28967.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";function Y(){const R=k(E("courseId")),D=F(({snapshot:d})=>async g=>{var h,x,S,A,T,B;const{label:O}=await d.getPromise(G(g));let V=`${O}.csv`,f,l=await d.getPromise(W),_=await d.getPromise(X);const{value:j}=await d.getPromise(L(g));let t={},I="Name,Email,External Id,Section,Withdrew,",a="Possible Points,,,,,";for(const{userId:o,email:i,roleId:v,withdrew:P,externalId:m,section:w,firstName:b,lastName:e}of j){const{isIncludedInGradebook:s}=await d.getPromise(M({courseId:g,roleId:v}));if(s!=="1")continue;const $=`${b} ${e}`.replaceAll('"','""');t[o]={courseTotal:0,csv:`"${$}",${i},${m},${w},${P==="1"?"X":""},`}}let y=0,C=Object.entries(l);C.sort((o,i)=>o[1].sortOrders-e).slice(0,v);let w=m.reduce((e,s)=>e+s,0)*i,b=Math.min(w,P);y+=b,I+=`${o} Total,`,a=`${a}${b},`;for(const e in t){let s=t[e][o];s=s.sort((r,c)=>c-r).slice(0,v);let $=s.reduce((r,c)=>r+c,0)*i,n=Math.min($,P);t[e].csv=`${t[e].csv}${n},`,t[e].courseTotal+=n}}I+="Course Total",a=`${a}${y}`,f=`${I} ${a}`;for(const o in t)f=`${f} ${t[o].csv}${t[o].courseTotal}`;var u=document.createElement("a");u.setAttribute("href","data:text/plain;charset=utf-8, "+encodeURIComponent(f)),u.setAttribute("download",V),document.body.appendChild(u),u.click(),document.body.removeChild(u)},[]);return N("div",{children:N(U,{value:"Download CSV",onClick:()=>{D(R)}})})}export{Y as default}; diff --git a/dist/assets/GradeSettings-a3b21ac2.js b/dist/assets/GradeSettings-952c5c8f.js similarity index 76% rename from dist/assets/GradeSettings-a3b21ac2.js rename to dist/assets/GradeSettings-952c5c8f.js index f790a97ef1..735b5aca5f 100644 --- a/dist/assets/GradeSettings-a3b21ac2.js +++ b/dist/assets/GradeSettings-952c5c8f.js @@ -1,8 +1,8 @@ -import{s as G,bd as N,be as z,r as c,j as l,i as J,l as b,m as O,y as P,a as f,k as v,bf as w,N as T,z as D,F as g,b0 as S,aA as X}from"./index-99a56692.js";import{D as Z}from"./DateTime-ef0be144.js";import{I as _}from"./IncrementMenu-aee46d2a.js";import"./moment-f5bb98f1.js";const M="var(--mainBlue)",W=G.button` +import{s as G,bf as N,bg as z,r as c,j as l,i as J,l as b,m as O,y as P,a as f,k as v,bh as w,N as y,z as D,F as T,b0 as S,aA as X}from"./index-7074710c.js";import{D as Z}from"./DateTime-d0a20943.js";import{I as _}from"./IncrementMenu-2cdf9a4e.js";import"./moment-3cda1086.js";const M="var(--mainBlue)",W=G.button` height: 24px; border: 2px solid; border-color: ${s=>s.color}; border-radius: 5px; color: var(--canvas); background-color: ${s=>s.color}; -`;function q(s){const d=s.checked?N:z,n=s.checked?M:"var(--mainGray)",r=c.useRef(null);return l(W,{color:n,ref:r,onClick:A=>{s.onClick(A)},children:l(J,{icon:d})})}function V(){let s=b(O("courseId")),d=b(O("doenetId")),n=b(O("userId"));const[r,A]=c.useState(null),[h,k]=c.useState(null);let[m,I]=c.useState(null),[E,j]=c.useState(null),[x,B]=c.useState(!1);const u=P();c.useEffect(()=>{async function t(a,e,o){let i=await v.get("/api/loadGradebookAdjustmentSettingsInfo.php",{params:{doenetId:a,userId:e,courseId:o}}),R=Number(i.data.numberOfAttemptsAllowedAdjustment);A(R);let p="unlimited";i.data.baseAttemptsAllowed!="unlimited"&&(p=Number(i.data.baseAttemptsAllowed)),k(p)}r==null&&t(d,n,s)},[r,d,n,s]);const $=async(t,a)=>{try{let{data:e}=await v.get("/api/loadDueDateInfo.php",{params:{courseId:s,doenetId:t,userId:a}});if(B(!0),e.success){const o=e.dueDateInfo.dueDateOverride;let i=null;o&&(i=w(T(o))),I(i);const R=e.dueDateInfo.dueDate;let p="No Due Date";R&&(p=w(T(R))),j(p)}else u(`ERROR: ${e.message}`,D.ERROR)}catch(e){u(`ERROR: ${e}`,D.ERROR)}},C=async(t,a,e)=>{e===null?e="Cancel Due Date Override":e=X(new Date(e));try{let{data:o}=await v.get("/api/saveDueDateInfo.php",{params:{doenetId:t,userId:a,newDateString:e}});if(o.success)if(e==="Cancel Due Date Override")u("Cancelled Due Date Override!",D.SUCCESS);else{const i=w(new Date(e));u(`Set Due Date Override to ${i}`,D.SUCCESS)}else u(`ERROR: ${o.message}`,D.ERROR)}catch(o){u(`ERROR: ${o}`,D.ERROR)}};if(!d||!n)return null;x||$(d,n);let U=f(g,{children:["Due Date Override:",f("div",{style:{display:"flex"},onClick:t=>{t.preventDefault()},children:[l(q,{checked:m!==null,onClick:()=>{let t=null;if(m===null){let a=new Date;a.setDate(a.getDate()+7),t=S(a)}I(t),C(d,n,t)}}),l(Z,{value:m?new Date(m):null,onBlur:({valid:t,value:a})=>{if(t){try{a=a.toDate()}catch{}new Date(S(a)).getTime()!==new Date(m).getTime()&&(I(a),C(d,n,a))}else u("Invalid Due Date")}})]})]}),F=h+r,y=l("p",{children:"Unlimited Attempts"});return h!="unlimited"&&r!=null&&(y=f(g,{children:[l("div",{children:"Base Attempts Allowed: "}),l("div",{children:h}),l("div",{children:"Attempts Allowed Adjustment: "}),l(_,{min:-h,value:r,onChange:t=>{A(t),v.get("/api/updateGradebookAdjustment.php",{params:{doenetId:d,userId:n,courseId:s,attemptsAdjustment:t}}).then(({data:a})=>{})}}),l("div",{children:"Resulting Attempts Allowed: "}),l("div",{children:F})]})),f("div",{children:[l("div",{children:"Due Date: "}),f("div",{children:[E," "]}),U,l("br",{}),y]})}export{V as default}; +`;function q(s){const d=s.checked?N:z,n=s.checked?M:"var(--mainGray)",r=c.useRef(null);return l(W,{color:n,ref:r,onClick:A=>{s.onClick(A)},children:l(J,{icon:d})})}function V(){let s=b(O("courseId")),d=b(O("doenetId")),n=b(O("userId"));const[r,A]=c.useState(null),[h,k]=c.useState(null);let[m,I]=c.useState(null),[E,j]=c.useState(null),[x,B]=c.useState(!1);const u=P();c.useEffect(()=>{async function t(a,e,o){let i=await v.get("/api/loadGradebookAdjustmentSettingsInfo.php",{params:{doenetId:a,userId:e,courseId:o}}),R=Number(i.data.numberOfAttemptsAllowedAdjustment);A(R);let p="unlimited";i.data.baseAttemptsAllowed!="unlimited"&&(p=Number(i.data.baseAttemptsAllowed)),k(p)}r==null&&t(d,n,s)},[r,d,n,s]);const $=async(t,a)=>{try{let{data:e}=await v.get("/api/loadDueDateInfo.php",{params:{courseId:s,doenetId:t,userId:a}});if(B(!0),e.success){const o=e.dueDateInfo.dueDateOverride;let i=null;o&&(i=w(y(o))),I(i);const R=e.dueDateInfo.dueDate;let p="No Due Date";R&&(p=w(y(R))),j(p)}else u(`ERROR: ${e.message}`,D.ERROR)}catch(e){u(`ERROR: ${e}`,D.ERROR)}},C=async(t,a,e)=>{e===null?e="Cancel Due Date Override":e=X(new Date(e));try{let{data:o}=await v.get("/api/saveDueDateInfo.php",{params:{doenetId:t,userId:a,newDateString:e}});if(o.success)if(e==="Cancel Due Date Override")u("Cancelled Due Date Override!",D.SUCCESS);else{const i=w(new Date(e));u(`Set Due Date Override to ${i}`,D.SUCCESS)}else u(`ERROR: ${o.message}`,D.ERROR)}catch(o){u(`ERROR: ${o}`,D.ERROR)}};if(!d||!n)return null;x||$(d,n);let U=f(T,{children:["Due Date Override:",f("div",{style:{display:"flex"},onClick:t=>{t.preventDefault()},children:[l(q,{checked:m!==null,onClick:()=>{let t=null;if(m===null){let a=new Date;a.setDate(a.getDate()+7),t=S(a)}I(t),C(d,n,t)}}),l(Z,{value:m?new Date(m):null,onBlur:({valid:t,value:a})=>{if(t){try{a=a.toDate()}catch{}new Date(S(a)).getTime()!==new Date(m).getTime()&&(I(a),C(d,n,a))}else u("Invalid Due Date")}})]})]}),F=h+r,g=l("p",{children:"Unlimited Attempts"});return h!="unlimited"&&r!=null&&(g=f(T,{children:[l("div",{children:"Base Attempts Allowed: "}),l("div",{children:h}),l("div",{children:"Attempts Allowed Adjustment: "}),l(_,{min:-h,value:r,onChange:t=>{A(t),v.get("/api/updateGradebookAdjustment.php",{params:{doenetId:d,userId:n,courseId:s,attemptsAdjustment:t}}).then(({data:a})=>{})}}),l("div",{children:"Resulting Attempts Allowed: "}),l("div",{children:F})]})),f("div",{children:[l("div",{children:"Due Date: "}),f("div",{children:[E," "]}),U,l("br",{}),g]})}export{V as default}; diff --git a/dist/assets/GradeUpload-2e665dd9.js b/dist/assets/GradeUpload-f7d9daba.js similarity index 76% rename from dist/assets/GradeUpload-2e665dd9.js rename to dist/assets/GradeUpload-f7d9daba.js index 19218c3496..cb1d94ddad 100644 --- a/dist/assets/GradeUpload-2e665dd9.js +++ b/dist/assets/GradeUpload-f7d9daba.js @@ -1 +1 @@ -import{R as i,r as h,b1 as u,a as r,j as e,B as f}from"./index-99a56692.js";import{p as g}from"./index-2e9c8a8a.js";import{processGradesAtom as b,headersGradesAtom as v,entriesGradesAtom as w}from"./GradebookAssignment-5ba543e4.js";import{B as x}from"./ButtonGroup-ea123297.js";import{C as A}from"./CollapseSection-a6fcd8bf.js";import"./Gradebook-e81ca638.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";function P(){const t=i(b),n=i(v),a=i(w),c=h.useCallback(m=>{const o=new FileReader;o.onabort=()=>{},o.onerror=()=>{},o.onload=()=>{g(o.result,{comment:"#"},function(C,s){n(s[0]),s.shift(),a(s),t("Upload Choice Table")})},o.readAsText(m[0])},[a,n,t]),{getRootProps:p,getInputProps:d,isDragActive:l}=u({onDrop:c});return l&&t("Assignment Table"),r("div",{children:[r("div",{...p(),children:[e("input",{...d()}),l?e("p",{children:"Drop the files here"}):e(x,{vertical:!0,children:e(f,{width:"menu",value:"Import CSV file",onClick:()=>t("Assignment Table")})})]},"drop"),e("br",{}),r(A,{title:"Formatting Instructions",collapsed:!0,children:[e("p",{children:"Your file needs to contain a Email column. The parser will ignore columns where the points do not match the points possible. e.g. if a assignment has 30 points possible you can only select from columns with 30 points in their second row. This is done to match canvas export formatting."}),e("div",{children:e("b",{children:"Email (required)"})}),r("div",{children:["First column is ",e("strong",{children:"Name"})]}),r("div",{children:["Second row is ",e("strong",{children:"points possible"})]})]})]})}export{P as default}; +import{R as i,r as h,b1 as u,a as r,j as e,B as f}from"./index-7074710c.js";import{p as g}from"./index-a475a6f9.js";import{processGradesAtom as b,headersGradesAtom as v,entriesGradesAtom as w}from"./GradebookAssignment-dd849113.js";import{B as x}from"./ButtonGroup-9136da6d.js";import{C as A}from"./CollapseSection-cb27678a.js";import"./Gradebook-06d28967.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";function P(){const t=i(b),n=i(v),a=i(w),c=h.useCallback(m=>{const o=new FileReader;o.onabort=()=>{},o.onerror=()=>{},o.onload=()=>{g(o.result,{comment:"#"},function(C,s){n(s[0]),s.shift(),a(s),t("Upload Choice Table")})},o.readAsText(m[0])},[a,n,t]),{getRootProps:p,getInputProps:d,isDragActive:l}=u({onDrop:c});return l&&t("Assignment Table"),r("div",{children:[r("div",{...p(),children:[e("input",{...d()}),l?e("p",{children:"Drop the files here"}):e(x,{vertical:!0,children:e(f,{width:"menu",value:"Import CSV file",onClick:()=>t("Assignment Table")})})]},"drop"),e("br",{}),r(A,{title:"Formatting Instructions",collapsed:!0,children:[e("p",{children:"Your file needs to contain a Email column. The parser will ignore columns where the points do not match the points possible. e.g. if a assignment has 30 points possible you can only select from columns with 30 points in their second row. This is done to match canvas export formatting."}),e("div",{children:e("b",{children:"Email (required)"})}),r("div",{children:["First column is ",e("strong",{children:"Name"})]}),r("div",{children:["Second row is ",e("strong",{children:"points possible"})]})]})]})}export{P as default}; diff --git a/dist/assets/Gradebook-e81ca638.js b/dist/assets/Gradebook-06d28967.js similarity index 99% rename from dist/assets/Gradebook-e81ca638.js rename to dist/assets/Gradebook-06d28967.js index c5ec34ad5c..84c69886a5 100644 --- a/dist/assets/Gradebook-e81ca638.js +++ b/dist/assets/Gradebook-06d28967.js @@ -1,4 +1,4 @@ -import{r as Zt,aa as Or,s as zr,ag as et,ax as Se,m as Ee,k as Ce,ay as tt,az as Fe,j as X,av as Kt,a as Be,i as Je,aM as Dr,aN as Mr,aO as Nr,l as Ye,R as Ut,p as jr,b as Ze,E as Lr,I as _r}from"./index-99a56692.js";import{e as Vr}from"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";var be={},Qr={get exports(){return be},set exports(E){be=E}},De={},Xr={get exports(){return De},set exports(E){De=E}};(function(E,H){(function(m,p){p(H,Zt)})(Or,function(m,p){function D(e,t,n,r,i,o,u){try{var a=e[o](u),l=a.value}catch(d){return void n(d)}a.done?t(l):Promise.resolve(l).then(r,i)}function M(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function u(l){D(o,r,i,u,a,"next",l)}function a(l){D(o,r,i,u,a,"throw",l)}u(void 0)})}}function c(){return(c=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function U(e){var t=function(n,r){if(typeof n!="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var o=i.call(n,r||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(e,"string");return typeof t=="symbol"?t:String(t)}p=p&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p;var s={init:"init"},J=function(e){var t=e.value;return t===void 0?"":t},Y=function(){return p.createElement(p.Fragment,null," ")},q={Cell:J,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function ce(){for(var e=arguments.length,t=new Array(e),n=0;n(o=typeof o=="number"?o:1/0)){var u=i;i=o,o=u}return e.filter(function(a){return t.some(function(l){var d=a.values[l];return d>=i&&d<=o})})};wt.autoRemove=function(e){return!e||typeof e[0]!="number"&&typeof e[1]!="number"};var Pe=Object.freeze({__proto__:null,text:ct,exactText:dt,exactTextCase:ft,includes:pt,includesAll:gt,includesSome:mt,includesValue:vt,exact:ht,equals:yt,between:wt});s.resetFilters="resetFilters",s.setFilter="setFilter",s.setAllFilters="setAllFilters";var Rt=function(e){e.stateReducers.push(Gn),e.useInstance.push(kn)};function Gn(e,t,n,r){if(t.type===s.init)return c({filters:[]},e);if(t.type===s.resetFilters)return c({},e,{filters:r.initialState.filters||[]});if(t.type===s.setFilter){var i=t.columnId,o=t.filterValue,u=r.allColumns,a=r.filterTypes,l=u.find(function(R){return R.id===i});if(!l)throw new Error("React-Table: Could not find a column with id: "+i);var d=xe(l.filter,a||{},Pe),y=e.filters.find(function(R){return R.id===i}),g=le(o,y&&y.value);return Ne(d.autoRemove,g,l)?c({},e,{filters:e.filters.filter(function(R){return R.id!==i})}):c({},e,y?{filters:e.filters.map(function(R){return R.id===i?{id:i,value:g}:R})}:{filters:[].concat(e.filters,[{id:i,value:g}])})}if(t.type===s.setAllFilters){var v=t.filters,f=r.allColumns,h=r.filterTypes;return c({},e,{filters:le(v,e.filters).filter(function(R){var b=f.find(function(x){return x.id===R.id});return!Ne(xe(b.filter,h||{},Pe).autoRemove,R.value,b)})})}}function kn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,u=e.filterTypes,a=e.manualFilters,l=e.defaultCanFilter,d=l!==void 0&&l,y=e.disableFilters,g=e.state.filters,v=e.dispatch,f=e.autoResetFilters,h=f===void 0||f,R=p.useCallback(function(S,G){v({type:s.setFilter,columnId:S,filterValue:G})},[v]),b=p.useCallback(function(S){v({type:s.setAllFilters,filters:S})},[v]);o.forEach(function(S){var G=S.id,W=S.accessor,I=S.defaultCanFilter,F=S.disableFilters;S.canFilter=W?he(F!==!0&&void 0,y!==!0&&void 0,!0):he(I,d,!1),S.setFilter=function(k){return R(S.id,k)};var j=g.find(function(k){return k.id===G});S.filterValue=j&&j.value});var x=p.useMemo(function(){if(a||!g.length)return[n,r,i];var S=[],G={};return[function W(I,F){F===void 0&&(F=0);var j=I;return(j=g.reduce(function(k,N){var z=N.id,V=N.value,P=o.find(function(K){return K.id===z});if(!P)return k;F===0&&(P.preFilteredRows=k);var O=xe(P.filter,u||{},Pe);return O?(P.filteredRows=O(k,[z],V),P.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+P.id+"."),k)},I)).forEach(function(k){S.push(k),G[k.id]=k,k.subRows&&(k.subRows=k.subRows&&k.subRows.length>0?W(k.subRows,F+1):k.subRows)}),j}(n),S,G]},[a,g,n,r,i,o,u]),T=x[0],C=x[1],w=x[2];p.useMemo(function(){o.filter(function(S){return!g.find(function(G){return G.id===S.id})}).forEach(function(S){S.preFilteredRows=T,S.filteredRows=T})},[T,g,o]);var A=_(h);ee(function(){A()&&v({type:s.resetFilters})},[v,a?null:t]),Object.assign(e,{preFilteredRows:n,preFilteredFlatRows:r,preFilteredRowsById:i,filteredRows:T,filteredFlatRows:C,filteredRowsById:w,rows:T,flatRows:C,rowsById:w,setFilter:R,setAllFilters:b})}Rt.pluginName="useFilters",s.resetGlobalFilter="resetGlobalFilter",s.setGlobalFilter="setGlobalFilter";var bt=function(e){e.stateReducers.push(An),e.useInstance.push(Hn)};function An(e,t,n,r){if(t.type===s.resetGlobalFilter)return c({},e,{globalFilter:r.initialState.globalFilter||void 0});if(t.type===s.setGlobalFilter){var i=t.filterValue,o=r.userFilterTypes,u=xe(r.globalFilter,o||{},Pe),a=le(i,e.globalFilter);return Ne(u.autoRemove,a)?(e.globalFilter,Z(e,["globalFilter"])):c({},e,{globalFilter:a})}}function Hn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,u=e.filterTypes,a=e.globalFilter,l=e.manualGlobalFilter,d=e.state.globalFilter,y=e.dispatch,g=e.autoResetGlobalFilter,v=g===void 0||g,f=e.disableGlobalFilter,h=p.useCallback(function(w){y({type:s.setGlobalFilter,filterValue:w})},[y]),R=p.useMemo(function(){if(l||d===void 0)return[n,r,i];var w=[],A={},S=xe(a,u||{},Pe);if(!S)return console.warn("Could not find a valid 'globalFilter' option."),n;o.forEach(function(W){var I=W.disableGlobalFilter;W.canFilter=he(I!==!0&&void 0,f!==!0&&void 0,!0)});var G=o.filter(function(W){return W.canFilter===!0});return[function W(I){return(I=S(I,G.map(function(F){return F.id}),d)).forEach(function(F){w.push(F),A[F.id]=F,F.subRows=F.subRows&&F.subRows.length?W(F.subRows):F.subRows}),I}(n),w,A]},[l,d,a,u,o,n,r,i,f]),b=R[0],x=R[1],T=R[2],C=_(v);ee(function(){C()&&y({type:s.resetGlobalFilter})},[y,l?null:t]),Object.assign(e,{preGlobalFilteredRows:n,preGlobalFilteredFlatRows:r,preGlobalFilteredRowsById:i,globalFilteredRows:b,globalFilteredFlatRows:x,globalFilteredRowsById:T,rows:b,flatRows:x,rowsById:T,setGlobalFilter:h,disableGlobalFilter:f})}function St(e,t){return t.reduce(function(n,r){return n+(typeof r=="number"?r:0)},0)}bt.pluginName="useGlobalFilter";var Ct=Object.freeze({__proto__:null,sum:St,min:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.min(t,n))}),t},max:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.max(t,n))}),t},minMax:function(e){var t=e[0]||0,n=e[0]||0;return e.forEach(function(r){typeof r=="number"&&(t=Math.min(t,r),n=Math.max(n,r))}),t+".."+n},average:function(e){return St(0,e)/e.length},median:function(e){if(!e.length)return null;var t=Math.floor(e.length/2),n=[].concat(e).sort(function(r,i){return r-i});return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},unique:function(e){return Array.from(new Set(e).values())},uniqueCount:function(e){return new Set(e).size},count:function(e){return e.length}}),Tn=[],Wn={};s.resetGroupBy="resetGroupBy",s.setGroupBy="setGroupBy",s.toggleGroupBy="toggleGroupBy";var xt=function(e){e.getGroupByToggleProps=[On],e.stateReducers.push(zn),e.visibleColumnsDeps.push(function(t,n){var r=n.instance;return[].concat(t,[r.state.groupBy])}),e.visibleColumns.push(Dn),e.useInstance.push(Nn),e.prepareRow.push(jn)};xt.pluginName="useGroupBy";var On=function(e,t){var n=t.header;return[e,{onClick:n.canGroupBy?function(r){r.persist(),n.toggleGroupBy()}:void 0,style:{cursor:n.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function zn(e,t,n,r){if(t.type===s.init)return c({groupBy:[]},e);if(t.type===s.resetGroupBy)return c({},e,{groupBy:r.initialState.groupBy||[]});if(t.type===s.setGroupBy)return c({},e,{groupBy:t.value});if(t.type===s.toggleGroupBy){var i=t.columnId,o=t.value,u=o!==void 0?o:!e.groupBy.includes(i);return c({},e,u?{groupBy:[].concat(e.groupBy,[i])}:{groupBy:e.groupBy.filter(function(a){return a!==i})})}}function Dn(e,t){var n=t.instance.state.groupBy,r=n.map(function(o){return e.find(function(u){return u.id===o})}).filter(Boolean),i=e.filter(function(o){return!n.includes(o.id)});return(e=[].concat(r,i)).forEach(function(o){o.isGrouped=n.includes(o.id),o.groupedIndex=n.indexOf(o.id)}),e}var Mn={};function Nn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,u=e.flatHeaders,a=e.groupByFn,l=a===void 0?Pt:a,d=e.manualGroupBy,y=e.aggregations,g=y===void 0?Mn:y,v=e.plugins,f=e.state.groupBy,h=e.dispatch,R=e.autoResetGroupBy,b=R===void 0||R,x=e.disableGroupBy,T=e.defaultCanGroupBy,C=e.getHooks;ie(v,["useColumnOrder","useFilters"],"useGroupBy");var w=_(e);o.forEach(function(P){var O=P.accessor,K=P.defaultGroupBy,ue=P.disableGroupBy;P.canGroupBy=O?he(P.canGroupBy,ue!==!0&&void 0,x!==!0&&void 0,!0):he(P.canGroupBy,K,T,!1),P.canGroupBy&&(P.toggleGroupBy=function(){return e.toggleGroupBy(P.id)}),P.Aggregated=P.Aggregated||P.Cell});var A=p.useCallback(function(P,O){h({type:s.toggleGroupBy,columnId:P,value:O})},[h]),S=p.useCallback(function(P){h({type:s.setGroupBy,value:P})},[h]);u.forEach(function(P){P.getGroupByToggleProps=L(C().getGroupByToggleProps,{instance:w(),header:P})});var G=p.useMemo(function(){if(d||!f.length)return[n,r,i,Tn,Wn,r,i];var P=f.filter(function(oe){return o.find(function(we){return we.id===oe})}),O=[],K={},ue=[],B={},Q=[],te={},se=function oe(we,ye,_t){if(ye===void 0&&(ye=0),ye===P.length)return we.map(function(He){return c({},He,{depth:ye})});var $e=P[ye],Fr=l(we,$e);return Object.entries(Fr).map(function(He,Gr){var Vt=He[0],Te=He[1],We=$e+":"+Vt,Qt=oe(Te,ye+1,We=_t?_t+">"+We:We),Xt=ye?ot(Te,"leafRows"):Te,kr=function(pe,Ke,Hr){var Oe={};return o.forEach(function(ne){if(P.includes(ne.id))Oe[ne.id]=Ke[0]?Ke[0].values[ne.id]:null;else{var qt=typeof ne.aggregate=="function"?ne.aggregate:g[ne.aggregate]||Ct[ne.aggregate];if(qt){var Tr=Ke.map(function(ze){return ze.values[ne.id]}),Wr=pe.map(function(ze){var Ue=ze.values[ne.id];if(!Hr&&ne.aggregateValue){var $t=typeof ne.aggregateValue=="function"?ne.aggregateValue:g[ne.aggregateValue]||Ct[ne.aggregateValue];if(!$t)throw console.info({column:ne}),new Error("React Table: Invalid column.aggregateValue option for column listed above");Ue=$t(Ue,ze,ne)}return Ue});Oe[ne.id]=qt(Wr,Tr)}else{if(ne.aggregate)throw console.info({column:ne}),new Error("React Table: Invalid column.aggregate option for column listed above");Oe[ne.id]=null}}}),Oe}(Xt,Te,ye),Ar={id:We,isGrouped:!0,groupByID:$e,groupByVal:Vt,values:kr,subRows:Qt,leafRows:Xt,depth:ye,index:Gr};return Qt.forEach(function(pe){O.push(pe),K[pe.id]=pe,pe.isGrouped?(ue.push(pe),B[pe.id]=pe):(Q.push(pe),te[pe.id]=pe)}),Ar})}(n);return se.forEach(function(oe){O.push(oe),K[oe.id]=oe,oe.isGrouped?(ue.push(oe),B[oe.id]=oe):(Q.push(oe),te[oe.id]=oe)}),[se,O,K,ue,B,Q,te]},[d,f,n,r,i,o,g,l]),W=G[0],I=G[1],F=G[2],j=G[3],k=G[4],N=G[5],z=G[6],V=_(b);ee(function(){V()&&h({type:s.resetGroupBy})},[h,d?null:t]),Object.assign(e,{preGroupedRows:n,preGroupedFlatRow:r,preGroupedRowsById:i,groupedRows:W,groupedFlatRows:I,groupedRowsById:F,onlyGroupedFlatRows:j,onlyGroupedRowsById:k,nonGroupedFlatRows:N,nonGroupedRowsById:z,rows:W,flatRows:I,rowsById:F,toggleGroupBy:A,setGroupBy:S})}function jn(e){e.allCells.forEach(function(t){var n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isPlaceholder=!t.isGrouped&&t.column.isGrouped,t.isAggregated=!t.isGrouped&&!t.isPlaceholder&&((n=e.subRows)==null?void 0:n.length)})}function Pt(e,t){return e.reduce(function(n,r,i){var o=""+r.values[t];return n[o]=Array.isArray(n[o])?n[o]:[],n[o].push(r),n},{})}var It=/([0-9]+)/gm;function Le(e,t){return e===t?0:e>t?1:-1}function Ie(e,t,n){return[e.values[n],t.values[n]]}function Bt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}var Ln=Object.freeze({__proto__:null,alphanumeric:function(e,t,n){var r=Ie(e,t,n),i=r[0],o=r[1];for(i=Bt(i),o=Bt(o),i=i.split(It).filter(Boolean),o=o.split(It).filter(Boolean);i.length&&o.length;){var u=i.shift(),a=o.shift(),l=parseInt(u,10),d=parseInt(a,10),y=[l,d].sort();if(isNaN(y[0])){if(u>a)return 1;if(a>u)return-1}else{if(isNaN(y[1]))return isNaN(l)?-1:1;if(l>d)return 1;if(d>l)return-1}}return i.length-o.length},datetime:function(e,t,n){var r=Ie(e,t,n),i=r[0],o=r[1];return Le(i=i.getTime(),o=o.getTime())},basic:function(e,t,n){var r=Ie(e,t,n);return Le(r[0],r[1])},string:function(e,t,n){var r=Ie(e,t,n),i=r[0],o=r[1];for(i=i.split("").filter(Boolean),o=o.split("").filter(Boolean);i.length&&o.length;){var u=i.shift(),a=o.shift(),l=u.toLowerCase(),d=a.toLowerCase();if(l>d)return 1;if(d>l)return-1;if(u>a)return 1;if(a>u)return-1}return i.length-o.length},number:function(e,t,n){var r=Ie(e,t,n),i=r[0],o=r[1],u=/[^0-9.]/gi;return Le(i=Number(String(i).replace(u,"")),o=Number(String(o).replace(u,"")))}});s.resetSortBy="resetSortBy",s.setSortBy="setSortBy",s.toggleSortBy="toggleSortBy",s.clearSortBy="clearSortBy",q.sortType="alphanumeric",q.sortDescFirst=!1;var Et=function(e){e.getSortByToggleProps=[_n],e.stateReducers.push(Vn),e.useInstance.push(Qn)};Et.pluginName="useSortBy";var _n=function(e,t){var n=t.instance,r=t.column,i=n.isMultiSortEvent,o=i===void 0?function(u){return u.shiftKey}:i;return[e,{onClick:r.canSort?function(u){u.persist(),r.toggleSortBy(void 0,!n.disableMultiSort&&o(u))}:void 0,style:{cursor:r.canSort?"pointer":void 0},title:r.canSort?"Toggle SortBy":void 0}]};function Vn(e,t,n,r){if(t.type===s.init)return c({sortBy:[]},e);if(t.type===s.resetSortBy)return c({},e,{sortBy:r.initialState.sortBy||[]});if(t.type===s.clearSortBy)return c({},e,{sortBy:e.sortBy.filter(function(w){return w.id!==t.columnId})});if(t.type===s.setSortBy)return c({},e,{sortBy:t.sortBy});if(t.type===s.toggleSortBy){var i,o=t.columnId,u=t.desc,a=t.multi,l=r.allColumns,d=r.disableMultiSort,y=r.disableSortRemove,g=r.disableMultiRemove,v=r.maxMultiSortColCount,f=v===void 0?Number.MAX_SAFE_INTEGER:v,h=e.sortBy,R=l.find(function(w){return w.id===o}).sortDescFirst,b=h.find(function(w){return w.id===o}),x=h.findIndex(function(w){return w.id===o}),T=u!=null,C=[];return(i=!d&&a?b?"toggle":"add":x!==h.length-1||h.length!==1?"replace":b?"toggle":"replace")!="toggle"||y||T||a&&g||!(b&&b.desc&&!R||!b.desc&&R)||(i="remove"),i==="replace"?C=[{id:o,desc:T?u:R}]:i==="add"?(C=[].concat(h,[{id:o,desc:T?u:R}])).splice(0,C.length-f):i==="toggle"?C=h.map(function(w){return w.id===o?c({},w,{desc:T?u:!b.desc}):w}):i==="remove"&&(C=h.filter(function(w){return w.id!==o})),c({},e,{sortBy:C})}}function Qn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.allColumns,o=e.orderByFn,u=o===void 0?Ft:o,a=e.sortTypes,l=e.manualSortBy,d=e.defaultCanSort,y=e.disableSortBy,g=e.flatHeaders,v=e.state.sortBy,f=e.dispatch,h=e.plugins,R=e.getHooks,b=e.autoResetSortBy,x=b===void 0||b;ie(h,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var T=p.useCallback(function(I){f({type:s.setSortBy,sortBy:I})},[f]),C=p.useCallback(function(I,F,j){f({type:s.toggleSortBy,columnId:I,desc:F,multi:j})},[f]),w=_(e);g.forEach(function(I){var F=I.accessor,j=I.canSort,k=I.disableSortBy,N=I.id,z=F?he(k!==!0&&void 0,y!==!0&&void 0,!0):he(d,j,!1);I.canSort=z,I.canSort&&(I.toggleSortBy=function(P,O){return C(I.id,P,O)},I.clearSortBy=function(){f({type:s.clearSortBy,columnId:I.id})}),I.getSortByToggleProps=L(R().getSortByToggleProps,{instance:w(),column:I});var V=v.find(function(P){return P.id===N});I.isSorted=!!V,I.sortedIndex=v.findIndex(function(P){return P.id===N}),I.isSortedDesc=I.isSorted?V.desc:void 0});var A=p.useMemo(function(){if(l||!v.length)return[n,r];var I=[],F=v.filter(function(j){return i.find(function(k){return k.id===j.id})});return[function j(k){var N=u(k,F.map(function(z){var V=i.find(function(K){return K.id===z.id});if(!V)throw new Error("React-Table: Could not find a column with id: "+z.id+" while sorting");var P=V.sortType,O=rt(P)||(a||{})[P]||Ln[P];if(!O)throw new Error("React-Table: Could not find a valid sortType of '"+P+"' for column '"+z.id+"'.");return function(K,ue){return O(K,ue,z.id,z.desc)}}),F.map(function(z){var V=i.find(function(P){return P.id===z.id});return V&&V.sortInverted?z.desc:!z.desc}));return N.forEach(function(z){I.push(z),z.subRows&&z.subRows.length!==0&&(z.subRows=j(z.subRows))}),N}(n),I]},[l,v,n,r,i,u,a]),S=A[0],G=A[1],W=_(x);ee(function(){W()&&f({type:s.resetSortBy})},[l?null:t]),Object.assign(e,{preSortedRows:n,preSortedFlatRows:r,sortedRows:S,sortedFlatRows:G,rows:S,flatRows:G,setSortBy:T,toggleSortBy:C})}function Ft(e,t,n){return[].concat(e).sort(function(r,i){for(var o=0;oe.pageIndex?a=i===-1?o.length>=e.pageSize:u-1),a?c({},e,{pageIndex:u}):e}if(t.type===s.setPageSize){var l=t.pageSize,d=e.pageSize*e.pageIndex;return c({},e,{pageIndex:Math.floor(d/l),pageSize:l})}}function qn(e){var t=e.rows,n=e.autoResetPage,r=n===void 0||n,i=e.manualExpandedKey,o=i===void 0?"expanded":i,u=e.plugins,a=e.pageCount,l=e.paginateExpandedRows,d=l===void 0||l,y=e.expandSubRows,g=y===void 0||y,v=e.state,f=v.pageSize,h=v.pageIndex,R=v.expanded,b=v.globalFilter,x=v.filters,T=v.groupBy,C=v.sortBy,w=e.dispatch,A=e.data,S=e.manualPagination;ie(u,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var G=_(r);ee(function(){G()&&w({type:s.resetPage})},[w,S?null:A,b,x,T,C]);var W=S?a:Math.ceil(t.length/f),I=p.useMemo(function(){return W>0?[].concat(new Array(W)).fill(null).map(function(O,K){return K}):[]},[W]),F=p.useMemo(function(){var O;if(S)O=t;else{var K=f*h,ue=K+f;O=t.slice(K,ue)}return d?O:it(O,{manualExpandedKey:o,expanded:R,expandSubRows:g})},[g,R,o,S,h,f,d,t]),j=h>0,k=W===-1?F.length>=f:h-1&&o.push(i.splice(l,1)[0])};i.length&&r.length;)u();return[].concat(o,i)}function vr(e){var t=e.dispatch;e.setColumnOrder=p.useCallback(function(n){return t({type:s.setColumnOrder,columnOrder:n})},[t])}zt.pluginName="useColumnOrder",q.canResize=!0,s.columnStartResizing="columnStartResizing",s.columnResizing="columnResizing",s.columnDoneResizing="columnDoneResizing",s.resetResize="resetResize";var Dt=function(e){e.getResizerProps=[hr],e.getHeaderProps.push({style:{position:"relative"}}),e.stateReducers.push(yr),e.useInstance.push(Rr),e.useInstanceBeforeDimensions.push(wr)},hr=function(e,t){var n=t.instance,r=t.header,i=n.dispatch,o=function(u,a){var l=!1;if(u.type==="touchstart"){if(u.touches&&u.touches.length>1)return;l=!0}var d,y,g=function(C){var w=[];return function A(S){S.columns&&S.columns.length&&S.columns.map(A),w.push(S)}(C),w}(a).map(function(C){return[C.id,C.totalWidth]}),v=l?Math.round(u.touches[0].clientX):u.clientX,f=function(){window.cancelAnimationFrame(d),d=null,i({type:s.columnDoneResizing})},h=function(){window.cancelAnimationFrame(d),d=null,i({type:s.columnResizing,clientX:y})},R=function(C){y=C,d||(d=window.requestAnimationFrame(h))},b={mouse:{moveEvent:"mousemove",moveHandler:function(C){return R(C.clientX)},upEvent:"mouseup",upHandler:function(C){document.removeEventListener("mousemove",b.mouse.moveHandler),document.removeEventListener("mouseup",b.mouse.upHandler),f()}},touch:{moveEvent:"touchmove",moveHandler:function(C){return C.cancelable&&(C.preventDefault(),C.stopPropagation()),R(C.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(C){document.removeEventListener(b.touch.moveEvent,b.touch.moveHandler),document.removeEventListener(b.touch.upEvent,b.touch.moveHandler),f()}}},x=l?b.touch:b.mouse,T=!!function(){if(typeof je=="boolean")return je;var C=!1;try{var w={get passive(){return C=!0,!1}};window.addEventListener("test",null,w),window.removeEventListener("test",null,w)}catch{C=!1}return je=C}()&&{passive:!1};document.addEventListener(x.moveEvent,x.moveHandler,T),document.addEventListener(x.upEvent,x.upHandler,T),i({type:s.columnStartResizing,columnId:a.id,columnWidth:a.totalWidth,headerIdWidths:g,clientX:v})};return[e,{onMouseDown:function(u){return u.persist()||o(u,r)},onTouchStart:function(u){return u.persist()||o(u,r)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function yr(e,t){if(t.type===s.init)return c({columnResizing:{columnWidths:{}}},e);if(t.type===s.resetResize)return c({},e,{columnResizing:{columnWidths:{}}});if(t.type===s.columnStartResizing){var n=t.clientX,r=t.columnId,i=t.columnWidth,o=t.headerIdWidths;return c({},e,{columnResizing:c({},e.columnResizing,{startX:n,headerIdWidths:o,columnWidth:i,isResizingColumn:r})})}if(t.type===s.columnResizing){var u=t.clientX,a=e.columnResizing,l=a.startX,d=a.columnWidth,y=a.headerIdWidths,g=(u-l)/d,v={};return(y===void 0?[]:y).forEach(function(f){var h=f[0],R=f[1];v[h]=Math.max(R+R*g,0)}),c({},e,{columnResizing:c({},e.columnResizing,{columnWidths:c({},e.columnResizing.columnWidths,{},v)})})}return t.type===s.columnDoneResizing?c({},e,{columnResizing:c({},e.columnResizing,{startX:null,isResizingColumn:null})}):void 0}Dt.pluginName="useResizeColumns";var wr=function(e){var t=e.flatHeaders,n=e.disableResizing,r=e.getHooks,i=e.state.columnResizing,o=_(e);t.forEach(function(u){var a=he(u.disableResizing!==!0&&void 0,n!==!0&&void 0,!0);u.canResize=a,u.width=i.columnWidths[u.id]||u.originalWidth||u.width,u.isResizing=i.isResizingColumn===u.id,a&&(u.getResizerProps=L(r().getResizerProps,{instance:o(),header:u}))})};function Rr(e){var t=e.plugins,n=e.dispatch,r=e.autoResetResize,i=r===void 0||r,o=e.columns;ie(t,["useAbsoluteLayout"],"useResizeColumns");var u=_(i);ee(function(){u()&&n({type:s.resetResize})},[o]);var a=p.useCallback(function(){return n({type:s.resetResize})},[n]);Object.assign(e,{resetResizing:a})}var _e={position:"absolute",top:0},Mt=function(e){e.getTableBodyProps.push(Ae),e.getRowProps.push(Ae),e.getHeaderGroupProps.push(Ae),e.getFooterGroupProps.push(Ae),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:c({},_e,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:c({},_e,{left:r.column.totalLeft+"px",width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:c({},_e,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]})};Mt.pluginName="useAbsoluteLayout";var Ae=function(e,t){return[e,{style:{position:"relative",width:t.instance.totalColumnsWidth+"px"}}]},Ve={display:"inline-block",boxSizing:"border-box"},Qe=function(e,t){return[e,{style:{display:"flex",width:t.instance.totalColumnsWidth+"px"}}]},Nt=function(e){e.getRowProps.push(Qe),e.getHeaderGroupProps.push(Qe),e.getFooterGroupProps.push(Qe),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:c({},Ve,{width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:c({},Ve,{width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:c({},Ve,{width:r.totalWidth+"px"})}]})};function jt(e){e.getTableProps.push(br),e.getRowProps.push(Xe),e.getHeaderGroupProps.push(Xe),e.getFooterGroupProps.push(Xe),e.getHeaderProps.push(Sr),e.getCellProps.push(Cr),e.getFooterProps.push(xr)}Nt.pluginName="useBlockLayout",jt.pluginName="useFlexLayout";var br=function(e,t){return[e,{style:{minWidth:t.instance.totalColumnsMinWidth+"px"}}]},Xe=function(e,t){return[e,{style:{display:"flex",flex:"1 0 auto",minWidth:t.instance.totalColumnsMinWidth+"px"}}]},Sr=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]},Cr=function(e,t){var n=t.cell;return[e,{style:{boxSizing:"border-box",flex:n.column.totalFlexWidth+" 0 auto",minWidth:n.column.totalMinWidth+"px",width:n.column.totalWidth+"px"}}]},xr=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]};function Lt(e){e.stateReducers.push(Er),e.getTableProps.push(Pr),e.getHeaderProps.push(Ir),e.getRowProps.push(Br)}s.columnStartResizing="columnStartResizing",s.columnResizing="columnResizing",s.columnDoneResizing="columnDoneResizing",s.resetResize="resetResize",Lt.pluginName="useGridLayout";var Pr=function(e,t){var n=t.instance;return[e,{style:{display:"grid",gridTemplateColumns:n.visibleColumns.map(function(r){var i;return n.state.gridLayout.columnWidths[r.id]?n.state.gridLayout.columnWidths[r.id]+"px":(i=n.state.columnResizing)!=null&&i.isResizingColumn?n.state.gridLayout.startWidths[r.id]+"px":typeof r.width=="number"?r.width+"px":r.width}).join(" ")}}]},Ir=function(e,t){var n=t.column;return[e,{id:"header-cell-"+n.id,style:{position:"sticky",gridColumn:"span "+n.totalVisibleHeaderCount}}]},Br=function(e,t){var n=t.row;return n.isExpanded?[e,{style:{gridColumn:"1 / "+(n.cells.length+1)}}]:[e,{}]};function Er(e,t,n,r){if(t.type===s.init)return c({gridLayout:{columnWidths:{}}},e);if(t.type===s.resetResize)return c({},e,{gridLayout:{columnWidths:{}}});if(t.type===s.columnStartResizing){var i=t.columnId,o=t.headerIdWidths,u=qe(i);if(u!==void 0){var a=r.visibleColumns.reduce(function(w,A){var S;return c({},w,((S={})[A.id]=qe(A.id),S))},{}),l=r.visibleColumns.reduce(function(w,A){var S;return c({},w,((S={})[A.id]=A.minWidth,S))},{}),d=r.visibleColumns.reduce(function(w,A){var S;return c({},w,((S={})[A.id]=A.maxWidth,S))},{}),y=o.map(function(w){var A=w[0];return[A,qe(A)]});return c({},e,{gridLayout:c({},e.gridLayout,{startWidths:a,minWidths:l,maxWidths:d,headerIdGridWidths:y,columnWidth:u})})}return e}if(t.type===s.columnResizing){var g=t.clientX,v=e.columnResizing.startX,f=e.gridLayout,h=f.columnWidth,R=f.minWidths,b=f.maxWidths,x=f.headerIdGridWidths,T=(g-v)/h,C={};return(x===void 0?[]:x).forEach(function(w){var A=w[0],S=w[1];C[A]=Math.min(Math.max(R[A],S+S*T),b[A])}),c({},e,{gridLayout:c({},e.gridLayout,{columnWidths:c({},e.gridLayout.columnWidths,{},C)})})}return t.type===s.columnDoneResizing?c({},e,{gridLayout:c({},e.gridLayout,{startWidths:{},minWidths:{},maxWidths:{}})}):void 0}function qe(e){var t,n=(t=document.getElementById("header-cell-"+e))==null?void 0:t.offsetWidth;if(n!==void 0)return n}m._UNSTABLE_usePivotColumns=kt,m.actions=s,m.defaultColumn=q,m.defaultGroupByFn=Pt,m.defaultOrderByFn=Ft,m.defaultRenderer=J,m.emptyRenderer=Y,m.ensurePluginOrder=ie,m.flexRender=de,m.functionalUpdate=le,m.loopHooks=ae,m.makePropGetter=L,m.makeRenderer=re,m.reduceHooks=$,m.safeUseLayoutEffect=me,m.useAbsoluteLayout=Mt,m.useAsyncDebounce=function(e,t){t===void 0&&(t=0);var n=p.useRef({}),r=_(e),i=_(t);return p.useCallback(function(){var o=M(regeneratorRuntime.mark(function u(){var a,l,d,y=arguments;return regeneratorRuntime.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:for(a=y.length,l=new Array(a),d=0;d1?t-1:0),r=1;r=0||(i[n]=e[n]);return i}function U(e){var t=function(n,r){if(typeof n!="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var o=i.call(n,r||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(e,"string");return typeof t=="symbol"?t:String(t)}p=p&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p;var s={init:"init"},J=function(e){var t=e.value;return t===void 0?"":t},Y=function(){return p.createElement(p.Fragment,null," ")},q={Cell:J,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function ce(){for(var e=arguments.length,t=new Array(e),n=0;n(o=typeof o=="number"?o:1/0)){var u=i;i=o,o=u}return e.filter(function(a){return t.some(function(l){var d=a.values[l];return d>=i&&d<=o})})};wt.autoRemove=function(e){return!e||typeof e[0]!="number"&&typeof e[1]!="number"};var Pe=Object.freeze({__proto__:null,text:ct,exactText:dt,exactTextCase:ft,includes:pt,includesAll:gt,includesSome:mt,includesValue:vt,exact:ht,equals:yt,between:wt});s.resetFilters="resetFilters",s.setFilter="setFilter",s.setAllFilters="setAllFilters";var Rt=function(e){e.stateReducers.push(Gn),e.useInstance.push(kn)};function Gn(e,t,n,r){if(t.type===s.init)return c({filters:[]},e);if(t.type===s.resetFilters)return c({},e,{filters:r.initialState.filters||[]});if(t.type===s.setFilter){var i=t.columnId,o=t.filterValue,u=r.allColumns,a=r.filterTypes,l=u.find(function(R){return R.id===i});if(!l)throw new Error("React-Table: Could not find a column with id: "+i);var d=xe(l.filter,a||{},Pe),y=e.filters.find(function(R){return R.id===i}),g=le(o,y&&y.value);return Ne(d.autoRemove,g,l)?c({},e,{filters:e.filters.filter(function(R){return R.id!==i})}):c({},e,y?{filters:e.filters.map(function(R){return R.id===i?{id:i,value:g}:R})}:{filters:[].concat(e.filters,[{id:i,value:g}])})}if(t.type===s.setAllFilters){var v=t.filters,f=r.allColumns,h=r.filterTypes;return c({},e,{filters:le(v,e.filters).filter(function(R){var b=f.find(function(x){return x.id===R.id});return!Ne(xe(b.filter,h||{},Pe).autoRemove,R.value,b)})})}}function kn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,u=e.filterTypes,a=e.manualFilters,l=e.defaultCanFilter,d=l!==void 0&&l,y=e.disableFilters,g=e.state.filters,v=e.dispatch,f=e.autoResetFilters,h=f===void 0||f,R=p.useCallback(function(S,G){v({type:s.setFilter,columnId:S,filterValue:G})},[v]),b=p.useCallback(function(S){v({type:s.setAllFilters,filters:S})},[v]);o.forEach(function(S){var G=S.id,W=S.accessor,I=S.defaultCanFilter,F=S.disableFilters;S.canFilter=W?he(F!==!0&&void 0,y!==!0&&void 0,!0):he(I,d,!1),S.setFilter=function(k){return R(S.id,k)};var j=g.find(function(k){return k.id===G});S.filterValue=j&&j.value});var x=p.useMemo(function(){if(a||!g.length)return[n,r,i];var S=[],G={};return[function W(I,F){F===void 0&&(F=0);var j=I;return(j=g.reduce(function(k,N){var z=N.id,V=N.value,P=o.find(function(K){return K.id===z});if(!P)return k;F===0&&(P.preFilteredRows=k);var O=xe(P.filter,u||{},Pe);return O?(P.filteredRows=O(k,[z],V),P.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+P.id+"."),k)},I)).forEach(function(k){S.push(k),G[k.id]=k,k.subRows&&(k.subRows=k.subRows&&k.subRows.length>0?W(k.subRows,F+1):k.subRows)}),j}(n),S,G]},[a,g,n,r,i,o,u]),T=x[0],C=x[1],w=x[2];p.useMemo(function(){o.filter(function(S){return!g.find(function(G){return G.id===S.id})}).forEach(function(S){S.preFilteredRows=T,S.filteredRows=T})},[T,g,o]);var A=_(h);ee(function(){A()&&v({type:s.resetFilters})},[v,a?null:t]),Object.assign(e,{preFilteredRows:n,preFilteredFlatRows:r,preFilteredRowsById:i,filteredRows:T,filteredFlatRows:C,filteredRowsById:w,rows:T,flatRows:C,rowsById:w,setFilter:R,setAllFilters:b})}Rt.pluginName="useFilters",s.resetGlobalFilter="resetGlobalFilter",s.setGlobalFilter="setGlobalFilter";var bt=function(e){e.stateReducers.push(An),e.useInstance.push(Hn)};function An(e,t,n,r){if(t.type===s.resetGlobalFilter)return c({},e,{globalFilter:r.initialState.globalFilter||void 0});if(t.type===s.setGlobalFilter){var i=t.filterValue,o=r.userFilterTypes,u=xe(r.globalFilter,o||{},Pe),a=le(i,e.globalFilter);return Ne(u.autoRemove,a)?(e.globalFilter,Z(e,["globalFilter"])):c({},e,{globalFilter:a})}}function Hn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,u=e.filterTypes,a=e.globalFilter,l=e.manualGlobalFilter,d=e.state.globalFilter,y=e.dispatch,g=e.autoResetGlobalFilter,v=g===void 0||g,f=e.disableGlobalFilter,h=p.useCallback(function(w){y({type:s.setGlobalFilter,filterValue:w})},[y]),R=p.useMemo(function(){if(l||d===void 0)return[n,r,i];var w=[],A={},S=xe(a,u||{},Pe);if(!S)return console.warn("Could not find a valid 'globalFilter' option."),n;o.forEach(function(W){var I=W.disableGlobalFilter;W.canFilter=he(I!==!0&&void 0,f!==!0&&void 0,!0)});var G=o.filter(function(W){return W.canFilter===!0});return[function W(I){return(I=S(I,G.map(function(F){return F.id}),d)).forEach(function(F){w.push(F),A[F.id]=F,F.subRows=F.subRows&&F.subRows.length?W(F.subRows):F.subRows}),I}(n),w,A]},[l,d,a,u,o,n,r,i,f]),b=R[0],x=R[1],T=R[2],C=_(v);ee(function(){C()&&y({type:s.resetGlobalFilter})},[y,l?null:t]),Object.assign(e,{preGlobalFilteredRows:n,preGlobalFilteredFlatRows:r,preGlobalFilteredRowsById:i,globalFilteredRows:b,globalFilteredFlatRows:x,globalFilteredRowsById:T,rows:b,flatRows:x,rowsById:T,setGlobalFilter:h,disableGlobalFilter:f})}function St(e,t){return t.reduce(function(n,r){return n+(typeof r=="number"?r:0)},0)}bt.pluginName="useGlobalFilter";var Ct=Object.freeze({__proto__:null,sum:St,min:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.min(t,n))}),t},max:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.max(t,n))}),t},minMax:function(e){var t=e[0]||0,n=e[0]||0;return e.forEach(function(r){typeof r=="number"&&(t=Math.min(t,r),n=Math.max(n,r))}),t+".."+n},average:function(e){return St(0,e)/e.length},median:function(e){if(!e.length)return null;var t=Math.floor(e.length/2),n=[].concat(e).sort(function(r,i){return r-i});return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},unique:function(e){return Array.from(new Set(e).values())},uniqueCount:function(e){return new Set(e).size},count:function(e){return e.length}}),Tn=[],Wn={};s.resetGroupBy="resetGroupBy",s.setGroupBy="setGroupBy",s.toggleGroupBy="toggleGroupBy";var xt=function(e){e.getGroupByToggleProps=[On],e.stateReducers.push(zn),e.visibleColumnsDeps.push(function(t,n){var r=n.instance;return[].concat(t,[r.state.groupBy])}),e.visibleColumns.push(Dn),e.useInstance.push(Nn),e.prepareRow.push(jn)};xt.pluginName="useGroupBy";var On=function(e,t){var n=t.header;return[e,{onClick:n.canGroupBy?function(r){r.persist(),n.toggleGroupBy()}:void 0,style:{cursor:n.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function zn(e,t,n,r){if(t.type===s.init)return c({groupBy:[]},e);if(t.type===s.resetGroupBy)return c({},e,{groupBy:r.initialState.groupBy||[]});if(t.type===s.setGroupBy)return c({},e,{groupBy:t.value});if(t.type===s.toggleGroupBy){var i=t.columnId,o=t.value,u=o!==void 0?o:!e.groupBy.includes(i);return c({},e,u?{groupBy:[].concat(e.groupBy,[i])}:{groupBy:e.groupBy.filter(function(a){return a!==i})})}}function Dn(e,t){var n=t.instance.state.groupBy,r=n.map(function(o){return e.find(function(u){return u.id===o})}).filter(Boolean),i=e.filter(function(o){return!n.includes(o.id)});return(e=[].concat(r,i)).forEach(function(o){o.isGrouped=n.includes(o.id),o.groupedIndex=n.indexOf(o.id)}),e}var Mn={};function Nn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,u=e.flatHeaders,a=e.groupByFn,l=a===void 0?Pt:a,d=e.manualGroupBy,y=e.aggregations,g=y===void 0?Mn:y,v=e.plugins,f=e.state.groupBy,h=e.dispatch,R=e.autoResetGroupBy,b=R===void 0||R,x=e.disableGroupBy,T=e.defaultCanGroupBy,C=e.getHooks;ie(v,["useColumnOrder","useFilters"],"useGroupBy");var w=_(e);o.forEach(function(P){var O=P.accessor,K=P.defaultGroupBy,ue=P.disableGroupBy;P.canGroupBy=O?he(P.canGroupBy,ue!==!0&&void 0,x!==!0&&void 0,!0):he(P.canGroupBy,K,T,!1),P.canGroupBy&&(P.toggleGroupBy=function(){return e.toggleGroupBy(P.id)}),P.Aggregated=P.Aggregated||P.Cell});var A=p.useCallback(function(P,O){h({type:s.toggleGroupBy,columnId:P,value:O})},[h]),S=p.useCallback(function(P){h({type:s.setGroupBy,value:P})},[h]);u.forEach(function(P){P.getGroupByToggleProps=L(C().getGroupByToggleProps,{instance:w(),header:P})});var G=p.useMemo(function(){if(d||!f.length)return[n,r,i,Tn,Wn,r,i];var P=f.filter(function(oe){return o.find(function(we){return we.id===oe})}),O=[],K={},ue=[],B={},Q=[],te={},se=function oe(we,ye,_t){if(ye===void 0&&(ye=0),ye===P.length)return we.map(function(He){return c({},He,{depth:ye})});var $e=P[ye],Fr=l(we,$e);return Object.entries(Fr).map(function(He,Gr){var Vt=He[0],Te=He[1],We=$e+":"+Vt,Qt=oe(Te,ye+1,We=_t?_t+">"+We:We),Xt=ye?ot(Te,"leafRows"):Te,kr=function(pe,Ke,Hr){var Oe={};return o.forEach(function(ne){if(P.includes(ne.id))Oe[ne.id]=Ke[0]?Ke[0].values[ne.id]:null;else{var qt=typeof ne.aggregate=="function"?ne.aggregate:g[ne.aggregate]||Ct[ne.aggregate];if(qt){var Tr=Ke.map(function(ze){return ze.values[ne.id]}),Wr=pe.map(function(ze){var Ue=ze.values[ne.id];if(!Hr&&ne.aggregateValue){var $t=typeof ne.aggregateValue=="function"?ne.aggregateValue:g[ne.aggregateValue]||Ct[ne.aggregateValue];if(!$t)throw console.info({column:ne}),new Error("React Table: Invalid column.aggregateValue option for column listed above");Ue=$t(Ue,ze,ne)}return Ue});Oe[ne.id]=qt(Wr,Tr)}else{if(ne.aggregate)throw console.info({column:ne}),new Error("React Table: Invalid column.aggregate option for column listed above");Oe[ne.id]=null}}}),Oe}(Xt,Te,ye),Ar={id:We,isGrouped:!0,groupByID:$e,groupByVal:Vt,values:kr,subRows:Qt,leafRows:Xt,depth:ye,index:Gr};return Qt.forEach(function(pe){O.push(pe),K[pe.id]=pe,pe.isGrouped?(ue.push(pe),B[pe.id]=pe):(Q.push(pe),te[pe.id]=pe)}),Ar})}(n);return se.forEach(function(oe){O.push(oe),K[oe.id]=oe,oe.isGrouped?(ue.push(oe),B[oe.id]=oe):(Q.push(oe),te[oe.id]=oe)}),[se,O,K,ue,B,Q,te]},[d,f,n,r,i,o,g,l]),W=G[0],I=G[1],F=G[2],j=G[3],k=G[4],N=G[5],z=G[6],V=_(b);ee(function(){V()&&h({type:s.resetGroupBy})},[h,d?null:t]),Object.assign(e,{preGroupedRows:n,preGroupedFlatRow:r,preGroupedRowsById:i,groupedRows:W,groupedFlatRows:I,groupedRowsById:F,onlyGroupedFlatRows:j,onlyGroupedRowsById:k,nonGroupedFlatRows:N,nonGroupedRowsById:z,rows:W,flatRows:I,rowsById:F,toggleGroupBy:A,setGroupBy:S})}function jn(e){e.allCells.forEach(function(t){var n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isPlaceholder=!t.isGrouped&&t.column.isGrouped,t.isAggregated=!t.isGrouped&&!t.isPlaceholder&&((n=e.subRows)==null?void 0:n.length)})}function Pt(e,t){return e.reduce(function(n,r,i){var o=""+r.values[t];return n[o]=Array.isArray(n[o])?n[o]:[],n[o].push(r),n},{})}var It=/([0-9]+)/gm;function Le(e,t){return e===t?0:e>t?1:-1}function Ie(e,t,n){return[e.values[n],t.values[n]]}function Bt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}var Ln=Object.freeze({__proto__:null,alphanumeric:function(e,t,n){var r=Ie(e,t,n),i=r[0],o=r[1];for(i=Bt(i),o=Bt(o),i=i.split(It).filter(Boolean),o=o.split(It).filter(Boolean);i.length&&o.length;){var u=i.shift(),a=o.shift(),l=parseInt(u,10),d=parseInt(a,10),y=[l,d].sort();if(isNaN(y[0])){if(u>a)return 1;if(a>u)return-1}else{if(isNaN(y[1]))return isNaN(l)?-1:1;if(l>d)return 1;if(d>l)return-1}}return i.length-o.length},datetime:function(e,t,n){var r=Ie(e,t,n),i=r[0],o=r[1];return Le(i=i.getTime(),o=o.getTime())},basic:function(e,t,n){var r=Ie(e,t,n);return Le(r[0],r[1])},string:function(e,t,n){var r=Ie(e,t,n),i=r[0],o=r[1];for(i=i.split("").filter(Boolean),o=o.split("").filter(Boolean);i.length&&o.length;){var u=i.shift(),a=o.shift(),l=u.toLowerCase(),d=a.toLowerCase();if(l>d)return 1;if(d>l)return-1;if(u>a)return 1;if(a>u)return-1}return i.length-o.length},number:function(e,t,n){var r=Ie(e,t,n),i=r[0],o=r[1],u=/[^0-9.]/gi;return Le(i=Number(String(i).replace(u,"")),o=Number(String(o).replace(u,"")))}});s.resetSortBy="resetSortBy",s.setSortBy="setSortBy",s.toggleSortBy="toggleSortBy",s.clearSortBy="clearSortBy",q.sortType="alphanumeric",q.sortDescFirst=!1;var Et=function(e){e.getSortByToggleProps=[_n],e.stateReducers.push(Vn),e.useInstance.push(Qn)};Et.pluginName="useSortBy";var _n=function(e,t){var n=t.instance,r=t.column,i=n.isMultiSortEvent,o=i===void 0?function(u){return u.shiftKey}:i;return[e,{onClick:r.canSort?function(u){u.persist(),r.toggleSortBy(void 0,!n.disableMultiSort&&o(u))}:void 0,style:{cursor:r.canSort?"pointer":void 0},title:r.canSort?"Toggle SortBy":void 0}]};function Vn(e,t,n,r){if(t.type===s.init)return c({sortBy:[]},e);if(t.type===s.resetSortBy)return c({},e,{sortBy:r.initialState.sortBy||[]});if(t.type===s.clearSortBy)return c({},e,{sortBy:e.sortBy.filter(function(w){return w.id!==t.columnId})});if(t.type===s.setSortBy)return c({},e,{sortBy:t.sortBy});if(t.type===s.toggleSortBy){var i,o=t.columnId,u=t.desc,a=t.multi,l=r.allColumns,d=r.disableMultiSort,y=r.disableSortRemove,g=r.disableMultiRemove,v=r.maxMultiSortColCount,f=v===void 0?Number.MAX_SAFE_INTEGER:v,h=e.sortBy,R=l.find(function(w){return w.id===o}).sortDescFirst,b=h.find(function(w){return w.id===o}),x=h.findIndex(function(w){return w.id===o}),T=u!=null,C=[];return(i=!d&&a?b?"toggle":"add":x!==h.length-1||h.length!==1?"replace":b?"toggle":"replace")!="toggle"||y||T||a&&g||!(b&&b.desc&&!R||!b.desc&&R)||(i="remove"),i==="replace"?C=[{id:o,desc:T?u:R}]:i==="add"?(C=[].concat(h,[{id:o,desc:T?u:R}])).splice(0,C.length-f):i==="toggle"?C=h.map(function(w){return w.id===o?c({},w,{desc:T?u:!b.desc}):w}):i==="remove"&&(C=h.filter(function(w){return w.id!==o})),c({},e,{sortBy:C})}}function Qn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.allColumns,o=e.orderByFn,u=o===void 0?Ft:o,a=e.sortTypes,l=e.manualSortBy,d=e.defaultCanSort,y=e.disableSortBy,g=e.flatHeaders,v=e.state.sortBy,f=e.dispatch,h=e.plugins,R=e.getHooks,b=e.autoResetSortBy,x=b===void 0||b;ie(h,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var T=p.useCallback(function(I){f({type:s.setSortBy,sortBy:I})},[f]),C=p.useCallback(function(I,F,j){f({type:s.toggleSortBy,columnId:I,desc:F,multi:j})},[f]),w=_(e);g.forEach(function(I){var F=I.accessor,j=I.canSort,k=I.disableSortBy,N=I.id,z=F?he(k!==!0&&void 0,y!==!0&&void 0,!0):he(d,j,!1);I.canSort=z,I.canSort&&(I.toggleSortBy=function(P,O){return C(I.id,P,O)},I.clearSortBy=function(){f({type:s.clearSortBy,columnId:I.id})}),I.getSortByToggleProps=L(R().getSortByToggleProps,{instance:w(),column:I});var V=v.find(function(P){return P.id===N});I.isSorted=!!V,I.sortedIndex=v.findIndex(function(P){return P.id===N}),I.isSortedDesc=I.isSorted?V.desc:void 0});var A=p.useMemo(function(){if(l||!v.length)return[n,r];var I=[],F=v.filter(function(j){return i.find(function(k){return k.id===j.id})});return[function j(k){var N=u(k,F.map(function(z){var V=i.find(function(K){return K.id===z.id});if(!V)throw new Error("React-Table: Could not find a column with id: "+z.id+" while sorting");var P=V.sortType,O=rt(P)||(a||{})[P]||Ln[P];if(!O)throw new Error("React-Table: Could not find a valid sortType of '"+P+"' for column '"+z.id+"'.");return function(K,ue){return O(K,ue,z.id,z.desc)}}),F.map(function(z){var V=i.find(function(P){return P.id===z.id});return V&&V.sortInverted?z.desc:!z.desc}));return N.forEach(function(z){I.push(z),z.subRows&&z.subRows.length!==0&&(z.subRows=j(z.subRows))}),N}(n),I]},[l,v,n,r,i,u,a]),S=A[0],G=A[1],W=_(x);ee(function(){W()&&f({type:s.resetSortBy})},[l?null:t]),Object.assign(e,{preSortedRows:n,preSortedFlatRows:r,sortedRows:S,sortedFlatRows:G,rows:S,flatRows:G,setSortBy:T,toggleSortBy:C})}function Ft(e,t,n){return[].concat(e).sort(function(r,i){for(var o=0;oe.pageIndex?a=i===-1?o.length>=e.pageSize:u-1),a?c({},e,{pageIndex:u}):e}if(t.type===s.setPageSize){var l=t.pageSize,d=e.pageSize*e.pageIndex;return c({},e,{pageIndex:Math.floor(d/l),pageSize:l})}}function qn(e){var t=e.rows,n=e.autoResetPage,r=n===void 0||n,i=e.manualExpandedKey,o=i===void 0?"expanded":i,u=e.plugins,a=e.pageCount,l=e.paginateExpandedRows,d=l===void 0||l,y=e.expandSubRows,g=y===void 0||y,v=e.state,f=v.pageSize,h=v.pageIndex,R=v.expanded,b=v.globalFilter,x=v.filters,T=v.groupBy,C=v.sortBy,w=e.dispatch,A=e.data,S=e.manualPagination;ie(u,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var G=_(r);ee(function(){G()&&w({type:s.resetPage})},[w,S?null:A,b,x,T,C]);var W=S?a:Math.ceil(t.length/f),I=p.useMemo(function(){return W>0?[].concat(new Array(W)).fill(null).map(function(O,K){return K}):[]},[W]),F=p.useMemo(function(){var O;if(S)O=t;else{var K=f*h,ue=K+f;O=t.slice(K,ue)}return d?O:it(O,{manualExpandedKey:o,expanded:R,expandSubRows:g})},[g,R,o,S,h,f,d,t]),j=h>0,k=W===-1?F.length>=f:h-1&&o.push(i.splice(l,1)[0])};i.length&&r.length;)u();return[].concat(o,i)}function vr(e){var t=e.dispatch;e.setColumnOrder=p.useCallback(function(n){return t({type:s.setColumnOrder,columnOrder:n})},[t])}zt.pluginName="useColumnOrder",q.canResize=!0,s.columnStartResizing="columnStartResizing",s.columnResizing="columnResizing",s.columnDoneResizing="columnDoneResizing",s.resetResize="resetResize";var Dt=function(e){e.getResizerProps=[hr],e.getHeaderProps.push({style:{position:"relative"}}),e.stateReducers.push(yr),e.useInstance.push(Rr),e.useInstanceBeforeDimensions.push(wr)},hr=function(e,t){var n=t.instance,r=t.header,i=n.dispatch,o=function(u,a){var l=!1;if(u.type==="touchstart"){if(u.touches&&u.touches.length>1)return;l=!0}var d,y,g=function(C){var w=[];return function A(S){S.columns&&S.columns.length&&S.columns.map(A),w.push(S)}(C),w}(a).map(function(C){return[C.id,C.totalWidth]}),v=l?Math.round(u.touches[0].clientX):u.clientX,f=function(){window.cancelAnimationFrame(d),d=null,i({type:s.columnDoneResizing})},h=function(){window.cancelAnimationFrame(d),d=null,i({type:s.columnResizing,clientX:y})},R=function(C){y=C,d||(d=window.requestAnimationFrame(h))},b={mouse:{moveEvent:"mousemove",moveHandler:function(C){return R(C.clientX)},upEvent:"mouseup",upHandler:function(C){document.removeEventListener("mousemove",b.mouse.moveHandler),document.removeEventListener("mouseup",b.mouse.upHandler),f()}},touch:{moveEvent:"touchmove",moveHandler:function(C){return C.cancelable&&(C.preventDefault(),C.stopPropagation()),R(C.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(C){document.removeEventListener(b.touch.moveEvent,b.touch.moveHandler),document.removeEventListener(b.touch.upEvent,b.touch.moveHandler),f()}}},x=l?b.touch:b.mouse,T=!!function(){if(typeof je=="boolean")return je;var C=!1;try{var w={get passive(){return C=!0,!1}};window.addEventListener("test",null,w),window.removeEventListener("test",null,w)}catch{C=!1}return je=C}()&&{passive:!1};document.addEventListener(x.moveEvent,x.moveHandler,T),document.addEventListener(x.upEvent,x.upHandler,T),i({type:s.columnStartResizing,columnId:a.id,columnWidth:a.totalWidth,headerIdWidths:g,clientX:v})};return[e,{onMouseDown:function(u){return u.persist()||o(u,r)},onTouchStart:function(u){return u.persist()||o(u,r)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function yr(e,t){if(t.type===s.init)return c({columnResizing:{columnWidths:{}}},e);if(t.type===s.resetResize)return c({},e,{columnResizing:{columnWidths:{}}});if(t.type===s.columnStartResizing){var n=t.clientX,r=t.columnId,i=t.columnWidth,o=t.headerIdWidths;return c({},e,{columnResizing:c({},e.columnResizing,{startX:n,headerIdWidths:o,columnWidth:i,isResizingColumn:r})})}if(t.type===s.columnResizing){var u=t.clientX,a=e.columnResizing,l=a.startX,d=a.columnWidth,y=a.headerIdWidths,g=(u-l)/d,v={};return(y===void 0?[]:y).forEach(function(f){var h=f[0],R=f[1];v[h]=Math.max(R+R*g,0)}),c({},e,{columnResizing:c({},e.columnResizing,{columnWidths:c({},e.columnResizing.columnWidths,{},v)})})}return t.type===s.columnDoneResizing?c({},e,{columnResizing:c({},e.columnResizing,{startX:null,isResizingColumn:null})}):void 0}Dt.pluginName="useResizeColumns";var wr=function(e){var t=e.flatHeaders,n=e.disableResizing,r=e.getHooks,i=e.state.columnResizing,o=_(e);t.forEach(function(u){var a=he(u.disableResizing!==!0&&void 0,n!==!0&&void 0,!0);u.canResize=a,u.width=i.columnWidths[u.id]||u.originalWidth||u.width,u.isResizing=i.isResizingColumn===u.id,a&&(u.getResizerProps=L(r().getResizerProps,{instance:o(),header:u}))})};function Rr(e){var t=e.plugins,n=e.dispatch,r=e.autoResetResize,i=r===void 0||r,o=e.columns;ie(t,["useAbsoluteLayout"],"useResizeColumns");var u=_(i);ee(function(){u()&&n({type:s.resetResize})},[o]);var a=p.useCallback(function(){return n({type:s.resetResize})},[n]);Object.assign(e,{resetResizing:a})}var _e={position:"absolute",top:0},Mt=function(e){e.getTableBodyProps.push(Ae),e.getRowProps.push(Ae),e.getHeaderGroupProps.push(Ae),e.getFooterGroupProps.push(Ae),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:c({},_e,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:c({},_e,{left:r.column.totalLeft+"px",width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:c({},_e,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]})};Mt.pluginName="useAbsoluteLayout";var Ae=function(e,t){return[e,{style:{position:"relative",width:t.instance.totalColumnsWidth+"px"}}]},Ve={display:"inline-block",boxSizing:"border-box"},Qe=function(e,t){return[e,{style:{display:"flex",width:t.instance.totalColumnsWidth+"px"}}]},Nt=function(e){e.getRowProps.push(Qe),e.getHeaderGroupProps.push(Qe),e.getFooterGroupProps.push(Qe),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:c({},Ve,{width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:c({},Ve,{width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:c({},Ve,{width:r.totalWidth+"px"})}]})};function jt(e){e.getTableProps.push(br),e.getRowProps.push(Xe),e.getHeaderGroupProps.push(Xe),e.getFooterGroupProps.push(Xe),e.getHeaderProps.push(Sr),e.getCellProps.push(Cr),e.getFooterProps.push(xr)}Nt.pluginName="useBlockLayout",jt.pluginName="useFlexLayout";var br=function(e,t){return[e,{style:{minWidth:t.instance.totalColumnsMinWidth+"px"}}]},Xe=function(e,t){return[e,{style:{display:"flex",flex:"1 0 auto",minWidth:t.instance.totalColumnsMinWidth+"px"}}]},Sr=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]},Cr=function(e,t){var n=t.cell;return[e,{style:{boxSizing:"border-box",flex:n.column.totalFlexWidth+" 0 auto",minWidth:n.column.totalMinWidth+"px",width:n.column.totalWidth+"px"}}]},xr=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]};function Lt(e){e.stateReducers.push(Er),e.getTableProps.push(Pr),e.getHeaderProps.push(Ir),e.getRowProps.push(Br)}s.columnStartResizing="columnStartResizing",s.columnResizing="columnResizing",s.columnDoneResizing="columnDoneResizing",s.resetResize="resetResize",Lt.pluginName="useGridLayout";var Pr=function(e,t){var n=t.instance;return[e,{style:{display:"grid",gridTemplateColumns:n.visibleColumns.map(function(r){var i;return n.state.gridLayout.columnWidths[r.id]?n.state.gridLayout.columnWidths[r.id]+"px":(i=n.state.columnResizing)!=null&&i.isResizingColumn?n.state.gridLayout.startWidths[r.id]+"px":typeof r.width=="number"?r.width+"px":r.width}).join(" ")}}]},Ir=function(e,t){var n=t.column;return[e,{id:"header-cell-"+n.id,style:{position:"sticky",gridColumn:"span "+n.totalVisibleHeaderCount}}]},Br=function(e,t){var n=t.row;return n.isExpanded?[e,{style:{gridColumn:"1 / "+(n.cells.length+1)}}]:[e,{}]};function Er(e,t,n,r){if(t.type===s.init)return c({gridLayout:{columnWidths:{}}},e);if(t.type===s.resetResize)return c({},e,{gridLayout:{columnWidths:{}}});if(t.type===s.columnStartResizing){var i=t.columnId,o=t.headerIdWidths,u=qe(i);if(u!==void 0){var a=r.visibleColumns.reduce(function(w,A){var S;return c({},w,((S={})[A.id]=qe(A.id),S))},{}),l=r.visibleColumns.reduce(function(w,A){var S;return c({},w,((S={})[A.id]=A.minWidth,S))},{}),d=r.visibleColumns.reduce(function(w,A){var S;return c({},w,((S={})[A.id]=A.maxWidth,S))},{}),y=o.map(function(w){var A=w[0];return[A,qe(A)]});return c({},e,{gridLayout:c({},e.gridLayout,{startWidths:a,minWidths:l,maxWidths:d,headerIdGridWidths:y,columnWidth:u})})}return e}if(t.type===s.columnResizing){var g=t.clientX,v=e.columnResizing.startX,f=e.gridLayout,h=f.columnWidth,R=f.minWidths,b=f.maxWidths,x=f.headerIdGridWidths,T=(g-v)/h,C={};return(x===void 0?[]:x).forEach(function(w){var A=w[0],S=w[1];C[A]=Math.min(Math.max(R[A],S+S*T),b[A])}),c({},e,{gridLayout:c({},e.gridLayout,{columnWidths:c({},e.gridLayout.columnWidths,{},C)})})}return t.type===s.columnDoneResizing?c({},e,{gridLayout:c({},e.gridLayout,{startWidths:{},minWidths:{},maxWidths:{}})}):void 0}function qe(e){var t,n=(t=document.getElementById("header-cell-"+e))==null?void 0:t.offsetWidth;if(n!==void 0)return n}m._UNSTABLE_usePivotColumns=kt,m.actions=s,m.defaultColumn=q,m.defaultGroupByFn=Pt,m.defaultOrderByFn=Ft,m.defaultRenderer=J,m.emptyRenderer=Y,m.ensurePluginOrder=ie,m.flexRender=de,m.functionalUpdate=le,m.loopHooks=ae,m.makePropGetter=L,m.makeRenderer=re,m.reduceHooks=$,m.safeUseLayoutEffect=me,m.useAbsoluteLayout=Mt,m.useAsyncDebounce=function(e,t){t===void 0&&(t=0);var n=p.useRef({}),r=_(e),i=_(t);return p.useCallback(function(){var o=M(regeneratorRuntime.mark(function u(){var a,l,d,y=arguments;return regeneratorRuntime.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:for(a=y.length,l=new Array(a),d=0;d1?t-1:0),r=1;r{for(let r in i)if(i[r].firstName+" "+i[r].lastName==n)return r;return-1};function ge({doenetId:i,maxAttempts:n}){var x,G;let r=C(he),d=C(be);const c=se(),m=H(L);let _=O(K),[y,k]=D.useState(null),[f,S]=D.useState(1),[o,A]=D.useState(null),[u,w]=D.useState(1);const U=ne(({set:e,snapshot:l})=>async({doenetId:b,addToast:I})=>{const j=await l.getPromise(Q("courseId")),{data:{assignmentAttemptsData:W}}=await M.get("/api/loadGradebookAssignmentAttempts.php",{params:{courseId:j,doenetId:b}}),{data:{gradebookEnrollment:X}}=await M.get("/api/loadGradebookEnrollment.php",{params:{courseId:j}}),{data:{overview:Y}}=await M.get("/api/loadGradebookOverview.php",{params:{courseId:j}});e(de(b),W),e(ce,X),e(me,Y),I("Updated scores!"),e(L,"Assignment Table")});if(_.state!=="hasValue")return null;const v=(G=(x=_.contents)==null?void 0:x[i])==null?void 0:G.totalPointsOrPercent;if(!r.includes("Email"))return c("Need a column header named 'Email' ",B.ERROR),m("Assignment Table"),null;let P=[],p=r.filter((e,l)=>{var I;let b=Number((I=d==null?void 0:d[0])==null?void 0:I[l]);return b==v&&P.push(l),b==v});if(p.length<1)return c(`Need a column with an assignment worth ${v} points in the second row`,B.ERROR),m("Assignment Table"),null;y||k(P[0]);let T=r.indexOf("Student"),V=r.indexOf("Email"),s=[],h=[],R=[];for(let e of d){let l=T===-1?null:e[T],b=e[V],I=e[y];b!==""&&(h.push(b),R.push(I),s.push(a("tr",{children:[" ",t("td",{children:l}),t("td",{children:b}),t("td",{children:I})]},b)))}let g=a("table",{children:[a("tr",{children:[t("th",{style:{width:"200px"},children:"Student"}),t("th",{style:{width:"200px"},children:"Email"}),t("th",{style:{width:"50px"},children:"Score"})]}),s]}),F=[];for(let[e,l]of Object.entries(p))F.push([e,l]);let N=[];o===null&&N.push([0,"Select Attempt Number"]);for(let e=1;e<=n;e++)N.push([e,`Attempt Number ${e}`]);N.push([Number(n)+1,"New Attempt Number"]);let E=null;return o&&(Number(n)+1===o?E=a("div",{children:["Use column ",t("b",{children:p[Number(f)-1]})," to insert a new ",a("b",{children:["Attempt Number ",o]}),"?"]}):E=a("div",{children:["Use column ",t("b",{children:p[Number(f)-1]})," to change ",a("b",{children:["Attempt Number ",o]})," scores?"]})),o&&(p[Number(f)-1],Number(n)+1),a(J,{children:[a("div",{children:[p.length," column",p.length>1?"s":null," match"," ",v," total points"," "]}),t("div",{children:t(q,{items:F,valueIndex:f,width:"400px",onChange:({value:e})=>{S(Number(e)+1),k(P[e])}})}),t("br",{}),t("div",{children:t(q,{items:N,valueIndex:u,width:"400px",onChange:({value:e})=>{w(e),A(e)}})}),t("br",{}),E,a(ue,{children:[t(z,{alert:!0,value:"Cancel",onClick:()=>{c("Override Cancelled"),m("Assignment Table")}}),o?t(z,{value:"Accept",onClick:()=>{let e={doenetId:i,attemptNumber:o,emails:h,scores:R};M.post("/api/saveOverrideGrades.php",e).catch(l=>{c(l,B.ERROR),m("Assignment Table")}).then(({data:l})=>{l.success?U({doenetId:i,addToast:c}):c(l.message,B.ERROR)})}}):null]}),t("br",{}),g]})}function Ce(){var U,v,P,p,T,V;const i=H(Z);let n=C(Q("doenetId")),r=C(Q("courseId")),d=O(ae(n)),c=O(re),m=O(le),_=C(L);const y=H(ee);let{canViewAndModifyGrades:k}=C(pe(r)),f=O(K);D.useEffect(()=>{y(k==="1"?[]:["GradeUpload"])},[k,y]);let S=C(te(r));if((S==null?void 0:S.canViewCourse)=="0")return t("h1",{children:"No Access to view this page."});if(d.state!=="hasValue"||m.state!=="hasValue"||f.state!=="hasValue")return null;const o=f.contents[n].label,A=Number((U=f.contents[n])==null?void 0:U.totalPointsOrPercent);let u={},w=0;for(let s in d.contents)if((v=d.contents[s])!=null&&v.attempts){let h=Math.max(...Object.keys(d.contents[s].attempts).map(Number));h>w&&(w=h)}if(_==="Upload Choice Table")return t(ge,{doenetId:n,maxAttempts:w});u.headers=[],u.headers.push({Header:"Student",Footer:"Possible Points",accessor:"student"});for(let s=1;s<=w;s++)u.headers.push({Header:"Attempt "+s,Footer:A,accessor:"a"+s,disableFilters:!0,Cell:h=>t("a",{onClick:()=>{let R=h.cell.row.cells[0].value.props.children,g=fe(m.contents,R);i({page:"course",tool:"gradebookStudentAssignment",view:"",params:{courseId:r,doenetId:n,userId:g,attemptNumber:s,previousCrumb:"assignment"}})},children:h.value})});u.headers.push({Header:"Assignment Total",Footer:A,accessor:"grade",disableFilters:!0}),u.rows=[];for(let s in m.contents){let h=m.contents[s].firstName,R=m.contents[s].lastName,g={},F=h+" "+R;g.student=t("a",{onClick:()=>{i({page:"course",tool:"gradebookStudentAssignment",view:"",params:{courseId:r,doenetId:n,userId:s,previousCrumb:"assignment"}})},children:F});for(let x=1;x<=w;x++){let G=(P=d.contents[s])==null?void 0:P.attempts[x],e=Math.round(G*A*100)/100;g["a"+x]=G===void 0?"":e}let N=(V=(T=(p=c==null?void 0:c.contents)==null?void 0:p[s])==null?void 0:T.assignments)==null?void 0:V[n],E=Math.round(N*A*100)/100;g.grade=N?E:"0",u.rows.push(g)}return a(J,{children:[t("div",{style:{paddingLeft:"8px"},children:t("b",{children:o})}),a("div",{style:{paddingLeft:"8px"},children:[A," Points Possible"]}),t(oe,{children:t(ie,{columns:u.headers,data:u.rows})})]})}export{Ce as default,be as entriesGradesAtom,he as headersGradesAtom,L as processGradesAtom}; +import{ag as $,R as H,p as Z,l as C,m as Q,b as O,E as ee,r as D,I as te,j as t,a,F as J,y as se,v as ne,k as M,z as B,B as z}from"./index-7074710c.js";import{attemptData as ae,overviewData as re,studentData as le,assignmentData as K,Styles as oe,Table as ie,attemptDataQuery as de,studentDataQuery as ce,overviewDataQuery as me}from"./Gradebook-06d28967.js";import{B as ue}from"./ButtonGroup-9136da6d.js";import{D as q}from"./DropdownMenu-f3593bed.js";import{e as pe}from"./RoleDropdown-cce90708.js";import"./setPrototypeOf-51e8cf87.js";const L=$({key:"processGradesAtom",default:"Assignment Table"}),he=$({key:"headersGradesAtom",default:[]}),be=$({key:"entriesGradesAtom",default:[]}),fe=(i,n)=>{for(let r in i)if(i[r].firstName+" "+i[r].lastName==n)return r;return-1};function ge({doenetId:i,maxAttempts:n}){var x,G;let r=C(he),d=C(be);const c=se(),m=H(L);let _=O(K),[y,k]=D.useState(null),[f,S]=D.useState(1),[o,A]=D.useState(null),[u,w]=D.useState(1);const U=ne(({set:e,snapshot:l})=>async({doenetId:b,addToast:I})=>{const j=await l.getPromise(Q("courseId")),{data:{assignmentAttemptsData:W}}=await M.get("/api/loadGradebookAssignmentAttempts.php",{params:{courseId:j,doenetId:b}}),{data:{gradebookEnrollment:X}}=await M.get("/api/loadGradebookEnrollment.php",{params:{courseId:j}}),{data:{overview:Y}}=await M.get("/api/loadGradebookOverview.php",{params:{courseId:j}});e(de(b),W),e(ce,X),e(me,Y),I("Updated scores!"),e(L,"Assignment Table")});if(_.state!=="hasValue")return null;const v=(G=(x=_.contents)==null?void 0:x[i])==null?void 0:G.totalPointsOrPercent;if(!r.includes("Email"))return c("Need a column header named 'Email' ",B.ERROR),m("Assignment Table"),null;let P=[],p=r.filter((e,l)=>{var I;let b=Number((I=d==null?void 0:d[0])==null?void 0:I[l]);return b==v&&P.push(l),b==v});if(p.length<1)return c(`Need a column with an assignment worth ${v} points in the second row`,B.ERROR),m("Assignment Table"),null;y||k(P[0]);let T=r.indexOf("Student"),V=r.indexOf("Email"),s=[],h=[],R=[];for(let e of d){let l=T===-1?null:e[T],b=e[V],I=e[y];b!==""&&(h.push(b),R.push(I),s.push(a("tr",{children:[" ",t("td",{children:l}),t("td",{children:b}),t("td",{children:I})]},b)))}let g=a("table",{children:[a("tr",{children:[t("th",{style:{width:"200px"},children:"Student"}),t("th",{style:{width:"200px"},children:"Email"}),t("th",{style:{width:"50px"},children:"Score"})]}),s]}),F=[];for(let[e,l]of Object.entries(p))F.push([e,l]);let N=[];o===null&&N.push([0,"Select Attempt Number"]);for(let e=1;e<=n;e++)N.push([e,`Attempt Number ${e}`]);N.push([Number(n)+1,"New Attempt Number"]);let E=null;return o&&(Number(n)+1===o?E=a("div",{children:["Use column ",t("b",{children:p[Number(f)-1]})," to insert a new ",a("b",{children:["Attempt Number ",o]}),"?"]}):E=a("div",{children:["Use column ",t("b",{children:p[Number(f)-1]})," to change ",a("b",{children:["Attempt Number ",o]})," scores?"]})),o&&(p[Number(f)-1],Number(n)+1),a(J,{children:[a("div",{children:[p.length," column",p.length>1?"s":null," match"," ",v," total points"," "]}),t("div",{children:t(q,{items:F,valueIndex:f,width:"400px",onChange:({value:e})=>{S(Number(e)+1),k(P[e])}})}),t("br",{}),t("div",{children:t(q,{items:N,valueIndex:u,width:"400px",onChange:({value:e})=>{w(e),A(e)}})}),t("br",{}),E,a(ue,{children:[t(z,{alert:!0,value:"Cancel",onClick:()=>{c("Override Cancelled"),m("Assignment Table")}}),o?t(z,{value:"Accept",onClick:()=>{let e={doenetId:i,attemptNumber:o,emails:h,scores:R};M.post("/api/saveOverrideGrades.php",e).catch(l=>{c(l,B.ERROR),m("Assignment Table")}).then(({data:l})=>{l.success?U({doenetId:i,addToast:c}):c(l.message,B.ERROR)})}}):null]}),t("br",{}),g]})}function Ce(){var U,v,P,p,T,V;const i=H(Z);let n=C(Q("doenetId")),r=C(Q("courseId")),d=O(ae(n)),c=O(re),m=O(le),_=C(L);const y=H(ee);let{canViewAndModifyGrades:k}=C(pe(r)),f=O(K);D.useEffect(()=>{y(k==="1"?[]:["GradeUpload"])},[k,y]);let S=C(te(r));if((S==null?void 0:S.canViewCourse)=="0")return t("h1",{children:"No Access to view this page."});if(d.state!=="hasValue"||m.state!=="hasValue"||f.state!=="hasValue")return null;const o=f.contents[n].label,A=Number((U=f.contents[n])==null?void 0:U.totalPointsOrPercent);let u={},w=0;for(let s in d.contents)if((v=d.contents[s])!=null&&v.attempts){let h=Math.max(...Object.keys(d.contents[s].attempts).map(Number));h>w&&(w=h)}if(_==="Upload Choice Table")return t(ge,{doenetId:n,maxAttempts:w});u.headers=[],u.headers.push({Header:"Student",Footer:"Possible Points",accessor:"student"});for(let s=1;s<=w;s++)u.headers.push({Header:"Attempt "+s,Footer:A,accessor:"a"+s,disableFilters:!0,Cell:h=>t("a",{onClick:()=>{let R=h.cell.row.cells[0].value.props.children,g=fe(m.contents,R);i({page:"course",tool:"gradebookStudentAssignment",view:"",params:{courseId:r,doenetId:n,userId:g,attemptNumber:s,previousCrumb:"assignment"}})},children:h.value})});u.headers.push({Header:"Assignment Total",Footer:A,accessor:"grade",disableFilters:!0}),u.rows=[];for(let s in m.contents){let h=m.contents[s].firstName,R=m.contents[s].lastName,g={},F=h+" "+R;g.student=t("a",{onClick:()=>{i({page:"course",tool:"gradebookStudentAssignment",view:"",params:{courseId:r,doenetId:n,userId:s,previousCrumb:"assignment"}})},children:F});for(let x=1;x<=w;x++){let G=(P=d.contents[s])==null?void 0:P.attempts[x],e=Math.round(G*A*100)/100;g["a"+x]=G===void 0?"":e}let N=(V=(T=(p=c==null?void 0:c.contents)==null?void 0:p[s])==null?void 0:T.assignments)==null?void 0:V[n],E=Math.round(N*A*100)/100;g.grade=N?E:"0",u.rows.push(g)}return a(J,{children:[t("div",{style:{paddingLeft:"8px"},children:t("b",{children:o})}),a("div",{style:{paddingLeft:"8px"},children:[A," Points Possible"]}),t(oe,{children:t(ie,{columns:u.headers,data:u.rows})})]})}export{Ce as default,be as entriesGradesAtom,he as headersGradesAtom,L as processGradesAtom}; diff --git a/dist/assets/GradebookAssignmentLeave-3f668829.js b/dist/assets/GradebookAssignmentLeave-3f668829.js new file mode 100644 index 0000000000..8a99da96a1 --- /dev/null +++ b/dist/assets/GradebookAssignmentLeave-3f668829.js @@ -0,0 +1 @@ +import{v as e}from"./index-7074710c.js";import{processGradesAtom as r}from"./GradebookAssignment-dd849113.js";import"./Gradebook-06d28967.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";import"./ButtonGroup-9136da6d.js";function l(){return e(({set:o})=>()=>{o(r,"Assignment Table")})(),null}export{l as default}; diff --git a/dist/assets/GradebookAssignmentLeave-9f4420f7.js b/dist/assets/GradebookAssignmentLeave-9f4420f7.js deleted file mode 100644 index 92929b4fe1..0000000000 --- a/dist/assets/GradebookAssignmentLeave-9f4420f7.js +++ /dev/null @@ -1 +0,0 @@ -import{v as e}from"./index-99a56692.js";import{processGradesAtom as r}from"./GradebookAssignment-5ba543e4.js";import"./Gradebook-e81ca638.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";import"./ButtonGroup-ea123297.js";function l(){return e(({set:o})=>()=>{o(r,"Assignment Table")})(),null}export{l as default}; diff --git a/dist/assets/GradebookAttempt-a6141e36.js b/dist/assets/GradebookAttempt-0fa07a03.js similarity index 62% rename from dist/assets/GradebookAttempt-a6141e36.js rename to dist/assets/GradebookAttempt-0fa07a03.js index daa8d8de94..07c8793086 100644 --- a/dist/assets/GradebookAttempt-a6141e36.js +++ b/dist/assets/GradebookAttempt-0fa07a03.js @@ -1 +1 @@ -import{l as e,m as o,b as m,j as a}from"./index-99a56692.js";import{specificAttemptData as n}from"./Gradebook-e81ca638.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";function b(p){let r=e(o("doenetId")),s=e(o("userId")),i=e(o("attemptNumber")),t=m(n({doenetId:r,userId:s,attemptNumber:i}));return console.log(t.state,t.contents),t.state,t.state==="hasValue"?a("p",{children:t.contents.doenetML}):a("p",{children:t.state})}export{b as default}; +import{l as e,m as o,b as m,j as a}from"./index-7074710c.js";import{specificAttemptData as n}from"./Gradebook-06d28967.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";function b(p){let r=e(o("doenetId")),s=e(o("userId")),i=e(o("attemptNumber")),t=m(n({doenetId:r,userId:s,attemptNumber:i}));return console.log(t.state,t.contents),t.state,t.state==="hasValue"?a("p",{children:t.contents.doenetML}):a("p",{children:t.state})}export{b as default}; diff --git a/dist/assets/GradebookBreadCrumb-4c7b8962.js b/dist/assets/GradebookBreadCrumb-4c7b8962.js deleted file mode 100644 index e1bb9ac5d1..0000000000 --- a/dist/assets/GradebookBreadCrumb-4c7b8962.js +++ /dev/null @@ -1 +0,0 @@ -import{l as m,m as u,j as r,r as t}from"./index-99a56692.js";import{B as d}from"./BreadCrumb-c66b383a.js";import{u as b,a as c,f as i}from"./breadcrumbUtil-6dfe85b1.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-e81ca638.js";function x(){const o=m(u("courseId")),s=b(),a=c(o),e=i();return r(t.Suspense,{fallback:r("div",{children:"loading Breadcrumbs..."}),children:r(d,{crumbs:[s,a,...e]})})}export{x as default}; diff --git a/dist/assets/GradebookBreadCrumb-fd1c4bab.js b/dist/assets/GradebookBreadCrumb-fd1c4bab.js new file mode 100644 index 0000000000..0a3489c926 --- /dev/null +++ b/dist/assets/GradebookBreadCrumb-fd1c4bab.js @@ -0,0 +1 @@ +import{l as m,m as u,j as r,r as t}from"./index-7074710c.js";import{B as d}from"./BreadCrumb-c4dbe368.js";import{u as b,a as c,f as i}from"./breadcrumbUtil-1e7f0dfb.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-06d28967.js";function x(){const o=m(u("courseId")),s=b(),a=c(o),e=i();return r(t.Suspense,{fallback:r("div",{children:"loading Breadcrumbs..."}),children:r(d,{crumbs:[s,a,...e]})})}export{x as default}; diff --git a/dist/assets/GradebookStudent-3db9146c.js b/dist/assets/GradebookStudent-9c718d84.js similarity index 94% rename from dist/assets/GradebookStudent-3db9146c.js rename to dist/assets/GradebookStudent-9c718d84.js index d2ef023e6f..6a7e64a779 100644 --- a/dist/assets/GradebookStudent-3db9146c.js +++ b/dist/assets/GradebookStudent-9c718d84.js @@ -1 +1 @@ -import{l as x,m as L,R as J,p as K,b as D,I as Q,j as d,N as W,a as P,F as X}from"./index-99a56692.js";import{assignmentData as Y,studentData as ee,overviewData as te,gradeCategories as se,Styles as oe,Table as re}from"./Gradebook-e81ca638.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";function ce(){var B,T;let C=x(L("courseId")),a=x(L("userId"));const k=J(K);let o=D(Y),v=D(ee),I=D(te),M=x(Q(C));if((M==null?void 0:M.canViewCourse)=="0")return d("h1",{children:"No Access to view this page."});let s={};s.headers=[{Header:"Assignment",Footer:"Course Total",accessor:"assignment",disableFilters:!0,disableSortBy:!0}],s.rows=[];let c=0,n=0;if(o.state=="hasValue"&&v.state==="hasValue"&&I.state==="hasValue"&&a!==null&&a!==""){let u=0,V=Object.entries(o.contents);V.sort((g,r)=>g[1].sortOrder0||q{k({page:"course",tool:"gradebookStudentAssignment",view:"",params:{courseId:C,userId:a,doenetId:e,previousCrumb:"student"}})},style:{paddingLeft:"15px"},children:o.contents[e].label});s.rows.push({assignment:E,possiblepoints:y,assignedpoints:j,score:F,percentage:Z})}let G=m.length;m=m.sort((e,t)=>t-e).slice(0,h),w=w.sort((e,t)=>t-e).slice(0,h);let z=m.reduce((e,t)=>e+t,0)*r,U=w.reduce((e,t)=>e+t,0)*r,b=Math.min(z,p),i=Math.min(U,p);N&&(i="-"),S=S.sort((e,t)=>t-e).slice(0,h);let _=S.reduce((e,t)=>e+t,0)*r,l=Math.min(_,p),$="0%";l!==0&&($=Math.round(b/l*1e3)/10+"%"),n+=b,u+=l,i!="-"&&(c+=i,i=Math.round(i*100)/100),b=Math.round(b*100)/100,l=Math.round(l*100)/100;let f=[];G>h&&f.push(`top ${h} scores`),r!==1&&f.push(`rescaling by ${r*100}%`),_>p&&f.push(`a cap of ${p} points`),s.rows.push({assignment:P("b",{children:[`Subtotal for ${g}`,f.length>0&&P("div",{style:{fontSize:".7em"},children:["Based on ",f.join(",")]})]}),score:b,possiblepoints:l,assignedpoints:i,percentage:$})}let R=Math.round(n/u*1e3)/10+"%";n=Math.round(n*100)/100,u=Math.round(u*100)/100,c=Math.round(c*100)/100,s.headers.push({Header:"Possible Points",Footer:u,accessor:"possiblepoints",disableFilters:!0,disableSortBy:!0},{Header:"Assigned Points",Footer:c,accessor:"assignedpoints",disableFilters:!0,disableSortBy:!0},{Header:"Score",Footer:n,accessor:"score",disableFilters:!0,disableSortBy:!0},{Header:"Percentage",Footer:R,accessor:"percentage",disableFilters:!0,disableSortBy:!0})}let O=`${(B=v.contents[a])==null?void 0:B.firstName} ${(T=v.contents[a])==null?void 0:T.lastName}`;return P(X,{children:[d("div",{style:{marginLeft:"18px"},children:P("b",{children:["Gradebook for ",O]})}),d("div",{style:{marginLeft:"18px"},children:P("b",{children:["Current Score ",n,"/",c]})}),d(oe,{children:d(re,{disableSortBy:!0,columns:s.headers,data:s.rows})})]})}export{ce as default}; +import{l as x,m as L,R as J,p as K,b as D,I as Q,j as d,N as W,a as P,F as X}from"./index-7074710c.js";import{assignmentData as Y,studentData as ee,overviewData as te,gradeCategories as se,Styles as oe,Table as re}from"./Gradebook-06d28967.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";function ce(){var B,T;let C=x(L("courseId")),a=x(L("userId"));const k=J(K);let o=D(Y),v=D(ee),I=D(te),M=x(Q(C));if((M==null?void 0:M.canViewCourse)=="0")return d("h1",{children:"No Access to view this page."});let s={};s.headers=[{Header:"Assignment",Footer:"Course Total",accessor:"assignment",disableFilters:!0,disableSortBy:!0}],s.rows=[];let c=0,n=0;if(o.state=="hasValue"&&v.state==="hasValue"&&I.state==="hasValue"&&a!==null&&a!==""){let u=0,V=Object.entries(o.contents);V.sort((g,r)=>g[1].sortOrder0||q{k({page:"course",tool:"gradebookStudentAssignment",view:"",params:{courseId:C,userId:a,doenetId:e,previousCrumb:"student"}})},style:{paddingLeft:"15px"},children:o.contents[e].label});s.rows.push({assignment:E,possiblepoints:y,assignedpoints:j,score:F,percentage:Z})}let G=m.length;m=m.sort((e,t)=>t-e).slice(0,h),w=w.sort((e,t)=>t-e).slice(0,h);let z=m.reduce((e,t)=>e+t,0)*r,U=w.reduce((e,t)=>e+t,0)*r,b=Math.min(z,p),i=Math.min(U,p);N&&(i="-"),S=S.sort((e,t)=>t-e).slice(0,h);let _=S.reduce((e,t)=>e+t,0)*r,l=Math.min(_,p),$="0%";l!==0&&($=Math.round(b/l*1e3)/10+"%"),n+=b,u+=l,i!="-"&&(c+=i,i=Math.round(i*100)/100),b=Math.round(b*100)/100,l=Math.round(l*100)/100;let f=[];G>h&&f.push(`top ${h} scores`),r!==1&&f.push(`rescaling by ${r*100}%`),_>p&&f.push(`a cap of ${p} points`),s.rows.push({assignment:P("b",{children:[`Subtotal for ${g}`,f.length>0&&P("div",{style:{fontSize:".7em"},children:["Based on ",f.join(",")]})]}),score:b,possiblepoints:l,assignedpoints:i,percentage:$})}let R=Math.round(n/u*1e3)/10+"%";n=Math.round(n*100)/100,u=Math.round(u*100)/100,c=Math.round(c*100)/100,s.headers.push({Header:"Possible Points",Footer:u,accessor:"possiblepoints",disableFilters:!0,disableSortBy:!0},{Header:"Assigned Points",Footer:c,accessor:"assignedpoints",disableFilters:!0,disableSortBy:!0},{Header:"Score",Footer:n,accessor:"score",disableFilters:!0,disableSortBy:!0},{Header:"Percentage",Footer:R,accessor:"percentage",disableFilters:!0,disableSortBy:!0})}let O=`${(B=v.contents[a])==null?void 0:B.firstName} ${(T=v.contents[a])==null?void 0:T.lastName}`;return P(X,{children:[d("div",{style:{marginLeft:"18px"},children:P("b",{children:["Gradebook for ",O]})}),d("div",{style:{marginLeft:"18px"},children:P("b",{children:["Current Score ",n,"/",c]})}),d(oe,{children:d(re,{disableSortBy:!0,columns:s.headers,data:s.rows})})]})}export{ce as default}; diff --git a/dist/assets/GradebookStudentAssignment-bd8851a3.js b/dist/assets/GradebookStudentAssignment-5a7c7d7f.js similarity index 88% rename from dist/assets/GradebookStudentAssignment-bd8851a3.js rename to dist/assets/GradebookStudentAssignment-5a7c7d7f.js index 3ec710089a..4e79c5c5b2 100644 --- a/dist/assets/GradebookStudentAssignment-bd8851a3.js +++ b/dist/assets/GradebookStudentAssignment-5a7c7d7f.js @@ -1 +1 @@ -import{R as C,p as ie,l as c,m as h,b as A,E as de,r as I,I as ce,j as n,a as m,F as W,k as Z}from"./index-99a56692.js";import{attemptData as me,studentData as ue,assignmentData as pe,overviewData as fe,Styles as be,Table as he}from"./Gradebook-e81ca638.js";import{currentAttemptNumber as ge}from"./AssignmentViewer-f9c5976c.js";import{e as we}from"./RoleDropdown-5e05ae49.js";import{A as ve}from"./ActivityViewer-3a815948.js";import"./activityUtils-c08c1686.js";import"./ActionButton-f612d279.js";import"./ButtonGroup-ea123297.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";import"./visibility-sensor-55e75ed1.js";function Le(){var O,R,j,G,H,_,$,B,U;const ee=C(ie);let g=c(h("courseId")),o=c(h("doenetId")),s=c(h("userId")),w=c(h("attemptNumber")),te=c(h("previousCrumb")),u=A(me(o)),S=A(ue);const L=C(ge);let T=A(pe),{canViewAndModifyGrades:D}=c(we(g));const N=C(de);let se=A(fe);const b=Number((O=T.contents[o])==null?void 0:O.totalPointsOrPercent),ae=(R=T.contents[o])==null?void 0:R.label,x=(G=(j=u==null?void 0:u.contents)==null?void 0:j[s])==null?void 0:G.attempts;let[a,E]=I.useState(null),[l,oe]=I.useState(null),r={},y=0;I.useEffect(()=>{if(x){let e=Object.keys(x).map(Number),t=Math.max(0,...e);w&&w>>>TODO TELL THEM YOU HAVENT TAKEN YET")},[x,E,L,w]),I.useEffect(()=>{N(D!=="1"?["GradeSettings"]:[])},[D,N]);let M=c(ce(g));if((M==null?void 0:M.canViewCourse)=="0")return n("h1",{children:"No Access to view this page."});if(!o||!s)return null;async function re(e,t,i){const{data:{success:v,message:Y,foundAttempt:p,attemptInfo:f,showSolutionInGradebook:le,paginate:q}}=await Z.get("/api/getGradebookAssignmentAttempts.php",{params:{courseId:e,doenetId:t,userId:i}});let k={},J={},P="none";le==="1"&&(P="button");for(let d of f){let K=d.attemptNumber,X=d.variantIndex,z=J[d.cid];if(z)k[K]={cid:d.cid,variantIndex:X,doenetML:z,solutionDisplayMode:P,paginate:q};else{const{data:Q}=await Z.get(`/media/${d.cid}.doenet`);J[d.cid]=Q,k[K]={cid:d.cid,variantIndex:X,doenetML:Q,solutionDisplayMode:P,paginate:q}}}oe(k)}if(l===null)return re(g,o,s),null;if(u.state=="hasValue"&&s!==null&&s!==""&&(y=Math.max(0,...Object.keys(l).map(Number))),r.headers=[{Header:"Score",Footer:"Possible Points",accessor:"score",disableFilters:!0}],r.rows=[],S.state=="hasValue"&&s!==null&&s!==""){let e={},t={};if(e.score="Percentage",t.score="Score",u.state=="hasValue"){for(let p=1;p<=y;p++){let f=u.contents[s].attempts[p];e["a"+p]=f?Math.round(f*1e3)/10+"%":"",t["a"+p]=f?Math.round(f*100*b)/100:""}let i=($=(_=(H=se.contents)==null?void 0:H[s])==null?void 0:_.assignments)==null?void 0:$[o],v=b*i,Y=Math.round(i*1e3)/10+"%";t.total=v,e.total=Y}r.rows.push(t),r.rows.push(e)}r.headers.push({Header:"Assignment Total",Footer:b,accessor:"total",disableFilters:!0});for(let e=1;e<=y;e++)r.headers.push({Header:"Attempt "+e,Footer:b,accessor:"a"+e,disableFilters:!0,Cell:t=>m("a",{onClick:()=>{ee({page:"course",tool:"gradebookStudentAssignment",view:"",params:{courseId:g,doenetId:o,userId:s,attemptNumber:e,previousCrumb:te}})},children:[" ",t.value," "]})});let F=null,V=null;if(a>0&&l[a]){let e=l[a].cid,t=l[a].variantIndex,i=l[a].solutionDisplayMode,v=l[a].paginate;F=n(ve,{cid:e,doenetId:o,userId:s,forceDisable:!0,forceShowCorrectness:!0,forceShowSolution:i!=="none",forceUnsuppressCheckwork:!0,flags:{showCorrectness:!0,readOnly:!0,solutionDisplayMode:i,showFeedback:!0,showHints:!0,autoSubmit:!1,allowLoadState:!0,allowSaveState:!1,allowLocalState:!1,allowSaveSubmissions:!1,allowSaveEvents:!1},attemptNumber:a,requestedVariantIndex:t,paginate:v},`activityViewer${o}`),V=m("div",{style:{paddingLeft:"8px"},children:["Viewing attempt number ",a]})}else V=m("div",{style:{paddingLeft:"8px"},children:["No content available for attempt number ",a]});let ne=`${(B=S.contents[s])==null?void 0:B.firstName} ${(U=S.contents[s])==null?void 0:U.lastName}`;return m(W,{children:[n("div",{style:{marginLeft:"18px"},children:m("b",{children:["Gradebook for ",ne]})}),n("div",{style:{paddingLeft:"18px"},children:n("b",{children:ae})}),m("div",{style:{paddingLeft:"18px"},children:[b," Points Possible"]}),n(be,{children:n(he,{columns:r.headers,data:r.rows})}),a>0?m(W,{children:[V,F]}):n("div",{children:"Click an attempt's grade to see your attempt"})]})}export{Le as default}; +import{R as C,p as ie,l as c,m as h,b as A,E as de,r as I,I as ce,j as n,a as m,F as W,k as Z}from"./index-7074710c.js";import{attemptData as me,studentData as ue,assignmentData as pe,overviewData as fe,Styles as be,Table as he}from"./Gradebook-06d28967.js";import{currentAttemptNumber as ge}from"./AssignmentViewer-1be0d831.js";import{e as we}from"./RoleDropdown-cce90708.js";import{A as ve}from"./ActivityViewer-becda8c0.js";import"./activityUtils-9c5f1536.js";import"./ActionButton-e5ea2a2f.js";import"./ButtonGroup-9136da6d.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";import"./visibility-sensor-7d414852.js";function Le(){var O,R,j,G,H,_,$,B,U;const ee=C(ie);let g=c(h("courseId")),o=c(h("doenetId")),s=c(h("userId")),w=c(h("attemptNumber")),te=c(h("previousCrumb")),u=A(me(o)),S=A(ue);const L=C(ge);let T=A(pe),{canViewAndModifyGrades:D}=c(we(g));const N=C(de);let se=A(fe);const b=Number((O=T.contents[o])==null?void 0:O.totalPointsOrPercent),ae=(R=T.contents[o])==null?void 0:R.label,x=(G=(j=u==null?void 0:u.contents)==null?void 0:j[s])==null?void 0:G.attempts;let[a,E]=I.useState(null),[l,oe]=I.useState(null),r={},y=0;I.useEffect(()=>{if(x){let e=Object.keys(x).map(Number),t=Math.max(0,...e);w&&w>>>TODO TELL THEM YOU HAVENT TAKEN YET")},[x,E,L,w]),I.useEffect(()=>{N(D!=="1"?["GradeSettings"]:[])},[D,N]);let M=c(ce(g));if((M==null?void 0:M.canViewCourse)=="0")return n("h1",{children:"No Access to view this page."});if(!o||!s)return null;async function re(e,t,i){const{data:{success:v,message:Y,foundAttempt:p,attemptInfo:f,showSolutionInGradebook:le,paginate:q}}=await Z.get("/api/getGradebookAssignmentAttempts.php",{params:{courseId:e,doenetId:t,userId:i}});let k={},J={},P="none";le==="1"&&(P="button");for(let d of f){let K=d.attemptNumber,X=d.variantIndex,z=J[d.cid];if(z)k[K]={cid:d.cid,variantIndex:X,doenetML:z,solutionDisplayMode:P,paginate:q};else{const{data:Q}=await Z.get(`/media/${d.cid}.doenet`);J[d.cid]=Q,k[K]={cid:d.cid,variantIndex:X,doenetML:Q,solutionDisplayMode:P,paginate:q}}}oe(k)}if(l===null)return re(g,o,s),null;if(u.state=="hasValue"&&s!==null&&s!==""&&(y=Math.max(0,...Object.keys(l).map(Number))),r.headers=[{Header:"Score",Footer:"Possible Points",accessor:"score",disableFilters:!0}],r.rows=[],S.state=="hasValue"&&s!==null&&s!==""){let e={},t={};if(e.score="Percentage",t.score="Score",u.state=="hasValue"){for(let p=1;p<=y;p++){let f=u.contents[s].attempts[p];e["a"+p]=f?Math.round(f*1e3)/10+"%":"",t["a"+p]=f?Math.round(f*100*b)/100:""}let i=($=(_=(H=se.contents)==null?void 0:H[s])==null?void 0:_.assignments)==null?void 0:$[o],v=b*i,Y=Math.round(i*1e3)/10+"%";t.total=v,e.total=Y}r.rows.push(t),r.rows.push(e)}r.headers.push({Header:"Assignment Total",Footer:b,accessor:"total",disableFilters:!0});for(let e=1;e<=y;e++)r.headers.push({Header:"Attempt "+e,Footer:b,accessor:"a"+e,disableFilters:!0,Cell:t=>m("a",{onClick:()=>{ee({page:"course",tool:"gradebookStudentAssignment",view:"",params:{courseId:g,doenetId:o,userId:s,attemptNumber:e,previousCrumb:te}})},children:[" ",t.value," "]})});let F=null,V=null;if(a>0&&l[a]){let e=l[a].cid,t=l[a].variantIndex,i=l[a].solutionDisplayMode,v=l[a].paginate;F=n(ve,{cid:e,doenetId:o,userId:s,forceDisable:!0,forceShowCorrectness:!0,forceShowSolution:i!=="none",forceUnsuppressCheckwork:!0,flags:{showCorrectness:!0,readOnly:!0,solutionDisplayMode:i,showFeedback:!0,showHints:!0,autoSubmit:!1,allowLoadState:!0,allowSaveState:!1,allowLocalState:!1,allowSaveSubmissions:!1,allowSaveEvents:!1},attemptNumber:a,requestedVariantIndex:t,paginate:v},`activityViewer${o}`),V=m("div",{style:{paddingLeft:"8px"},children:["Viewing attempt number ",a]})}else V=m("div",{style:{paddingLeft:"8px"},children:["No content available for attempt number ",a]});let ne=`${(B=S.contents[s])==null?void 0:B.firstName} ${(U=S.contents[s])==null?void 0:U.lastName}`;return m(W,{children:[n("div",{style:{marginLeft:"18px"},children:m("b",{children:["Gradebook for ",ne]})}),n("div",{style:{paddingLeft:"18px"},children:n("b",{children:ae})}),m("div",{style:{paddingLeft:"18px"},children:[b," Points Possible"]}),n(be,{children:n(he,{columns:r.headers,data:r.rows})}),a>0?m(W,{children:[V,F]}):n("div",{children:"Click an attempt's grade to see your attempt"})]})}export{Le as default}; diff --git a/dist/assets/GroupSettings-e0cd864b.js b/dist/assets/GroupSettings-72cca280.js similarity index 93% rename from dist/assets/GroupSettings-e0cd864b.js rename to dist/assets/GroupSettings-72cca280.js index f90c02283c..396e751dec 100644 --- a/dist/assets/GroupSettings-e0cd864b.js +++ b/dist/assets/GroupSettings-72cca280.js @@ -1 +1 @@ -import{l as N,m as j,bl as q,y as L,r as b,k as y,z as v,v as V,b1 as z,a as l,j as a,B as G,ay as J}from"./index-99a56692.js";import{p as U}from"./index-2e9c8a8a.js";import{B as I}from"./ButtonGroup-ea123297.js";import{C as Y}from"./CollapseSection-a6fcd8bf.js";function $(e,r){switch(r.type){case"mount":return{...r.payload};case"min":return{...e,min:r.payload.min>1?r.payload.min:1,max:e.max{try{const{data:{entries:o}}=await y.get("/api/loadCollection.php",{params:{doenetId:n}});if((o==null?void 0:o.length)>0){const p=S(o),c=S([...m]);y.post("/api/assignCollection.php",{doenetId:n,groups:JSON.stringify(c),entries:JSON.stringify(p)}),t({type:"isReleased",payload:{isReleased:"1"}})}else s("Please add at least one entry to the collection before assigning",v.ERROR)}catch(o){console.error(o)}},[s]);b.useCallback(()=>{},[]);const _=V(({set:n})=>m=>{const o=new FileReader;o.onabort=()=>{},o.onerror=()=>{},o.onload=()=>{U(o.result,{comment:"#"},function(p,c){if(p)console.error(p),s(`CSV invalid – Error: ${p}`,v.ERROR);else{const g=c.shift(),C=g.indexOf("Email"),B=g.indexOf("Group Number"),P=g.indexOf("First Name"),M=g.indexOf("Last Name"),i={namesByGroup:[],emailsByGroup:[]};if(C===-1)s('File missing "Email" column header',v.ERROR);else if(B===-1)s('File missing "Group Number" column header',v.ERROR);else for(let u in c){let x=c[u],h=x[B]-1;i.emailsByGroup[h]||(i.emailsByGroup[h]=[],i.namesByGroup[h]=[]),i.emailsByGroup[h].push(x[C]),i.namesByGroup[h].push({firstName:x[P]??"",lastName:x[M]??""})}for(let u=0;u{let n=!0;async function m(o){try{const p=await y.get("/api/loadGroupSettings.php",{params:{doenetId:o}});n&&t({type:"mount",payload:p.data})}catch(p){console.error(p)}}return e!==""&&m(e),()=>{n=!1,d()}},[e,d]),l("div",{children:[l("label",{children:["Pre-Assigned Groups:",a("input",{type:"checkbox",checked:f==="1",value:f==="1",onChange:n=>{t({type:"preAssigned",payload:{preAssigned:n.target.checked?"1":"0",doenetId:e}})}})]}),a("br",{}),f==="1"?l("div",{children:[l("div",{...F(),children:[a("input",{...T()}),D?a("p",{children:"Drop files here"}):a(I,{children:a(G,{value:"Upload CSV",width:"menu"})})]},"drop"),a("br",{}),l(Y,{title:"Formatting Instructions",collapsed:!0,children:[a("p",{children:"Your file needs to contain email address and group number columns. They can be in any order, but the headers are case sensitive."}),a("p",{children:"Name fields are displayed for convenience – only required data is used to assign the Collection"}),a("div",{children:a("b",{children:"First Name"})}),a("div",{children:a("b",{children:"Last Name"})}),a("div",{children:a("b",{children:"Email (required)"})}),a("div",{children:a("b",{children:"Group Number (required)"})}),a("p",{children:"NOTE: The parser will ignore columns which are not listed."})]})]}):l("div",{children:[l("label",{children:["Min Studnets:",a("input",{type:"number",value:A,onChange:n=>{t({type:"min",payload:{min:n.target.value}})}})]},"min"),a("br",{}),l("label",{children:["Max Students:",a("input",{type:"number",value:w,onChange:n=>{t({type:"max",payload:{max:n.target.value}})}})]},"max"),a("br",{}),l("label",{children:["Preferred Students:",a("input",{type:"number",value:E,onChange:n=>{t({type:"pref",payload:{pref:n.target.value}})}})]},"pref"),a("br",{})]}),a("br",{}),l(I,{vertical:!0,children:[f==="1"?null:a(G,{width:"menu",value:"Save",onClick:()=>{t({type:"save",payload:{doenetId:e}})}}),a(G,{alert:!0,disabled:O==="1",width:"menu",value:"Assign Collection",onClick:()=>{k(e,r)}})]})]})}export{R as csvGroups,X as default}; +import{l as N,m as j,bn as q,y as L,r as b,k as y,z as v,v as V,b1 as z,a as l,j as a,B as G,ay as J}from"./index-7074710c.js";import{p as U}from"./index-a475a6f9.js";import{B as I}from"./ButtonGroup-9136da6d.js";import{C as Y}from"./CollapseSection-cb27678a.js";function $(e,r){switch(r.type){case"mount":return{...r.payload};case"min":return{...e,min:r.payload.min>1?r.payload.min:1,max:e.max{try{const{data:{entries:o}}=await y.get("/api/loadCollection.php",{params:{doenetId:n}});if((o==null?void 0:o.length)>0){const p=S(o),c=S([...m]);y.post("/api/assignCollection.php",{doenetId:n,groups:JSON.stringify(c),entries:JSON.stringify(p)}),t({type:"isReleased",payload:{isReleased:"1"}})}else s("Please add at least one entry to the collection before assigning",v.ERROR)}catch(o){console.error(o)}},[s]);b.useCallback(()=>{},[]);const _=V(({set:n})=>m=>{const o=new FileReader;o.onabort=()=>{},o.onerror=()=>{},o.onload=()=>{U(o.result,{comment:"#"},function(p,c){if(p)console.error(p),s(`CSV invalid – Error: ${p}`,v.ERROR);else{const g=c.shift(),C=g.indexOf("Email"),B=g.indexOf("Group Number"),P=g.indexOf("First Name"),M=g.indexOf("Last Name"),i={namesByGroup:[],emailsByGroup:[]};if(C===-1)s('File missing "Email" column header',v.ERROR);else if(B===-1)s('File missing "Group Number" column header',v.ERROR);else for(let u in c){let x=c[u],h=x[B]-1;i.emailsByGroup[h]||(i.emailsByGroup[h]=[],i.namesByGroup[h]=[]),i.emailsByGroup[h].push(x[C]),i.namesByGroup[h].push({firstName:x[P]??"",lastName:x[M]??""})}for(let u=0;u{let n=!0;async function m(o){try{const p=await y.get("/api/loadGroupSettings.php",{params:{doenetId:o}});n&&t({type:"mount",payload:p.data})}catch(p){console.error(p)}}return e!==""&&m(e),()=>{n=!1,d()}},[e,d]),l("div",{children:[l("label",{children:["Pre-Assigned Groups:",a("input",{type:"checkbox",checked:f==="1",value:f==="1",onChange:n=>{t({type:"preAssigned",payload:{preAssigned:n.target.checked?"1":"0",doenetId:e}})}})]}),a("br",{}),f==="1"?l("div",{children:[l("div",{...F(),children:[a("input",{...T()}),D?a("p",{children:"Drop files here"}):a(I,{children:a(G,{value:"Upload CSV",width:"menu"})})]},"drop"),a("br",{}),l(Y,{title:"Formatting Instructions",collapsed:!0,children:[a("p",{children:"Your file needs to contain email address and group number columns. They can be in any order, but the headers are case sensitive."}),a("p",{children:"Name fields are displayed for convenience – only required data is used to assign the Collection"}),a("div",{children:a("b",{children:"First Name"})}),a("div",{children:a("b",{children:"Last Name"})}),a("div",{children:a("b",{children:"Email (required)"})}),a("div",{children:a("b",{children:"Group Number (required)"})}),a("p",{children:"NOTE: The parser will ignore columns which are not listed."})]})]}):l("div",{children:[l("label",{children:["Min Studnets:",a("input",{type:"number",value:A,onChange:n=>{t({type:"min",payload:{min:n.target.value}})}})]},"min"),a("br",{}),l("label",{children:["Max Students:",a("input",{type:"number",value:w,onChange:n=>{t({type:"max",payload:{max:n.target.value}})}})]},"max"),a("br",{}),l("label",{children:["Preferred Students:",a("input",{type:"number",value:E,onChange:n=>{t({type:"pref",payload:{pref:n.target.value}})}})]},"pref"),a("br",{})]}),a("br",{}),l(I,{vertical:!0,children:[f==="1"?null:a(G,{width:"menu",value:"Save",onClick:()=>{t({type:"save",payload:{doenetId:e}})}}),a(G,{alert:!0,disabled:O==="1",width:"menu",value:"Assign Collection",onClick:()=>{k(e,r)}})]})]})}export{R as csvGroups,X as default}; diff --git a/dist/assets/GuestDoenetMLEditor-0c6d5e54.js b/dist/assets/GuestDoenetMLEditor-0c6d5e54.js new file mode 100644 index 0000000000..de42d03fd7 --- /dev/null +++ b/dist/assets/GuestDoenetMLEditor-0c6d5e54.js @@ -0,0 +1 @@ +import{R as a,l as i,r as s,j as e}from"./index-7074710c.js";import{t as d,u as l}from"./EditorViewerRecoil-fb47fc9d.js";import{C as u}from"./CodeMirror-87ecbb8f.js";function x(m){const t=a(d),o=i(l);let r=s.useRef(null);return e("div",{children:e(u,{editorRef:r,setInternalValue:o,onBeforeChange:n=>{t(n)}},"codemirror")})}export{x as default}; diff --git a/dist/assets/GuestDoenetMLEditor-23386a22.js b/dist/assets/GuestDoenetMLEditor-23386a22.js deleted file mode 100644 index e6d20cc99e..0000000000 --- a/dist/assets/GuestDoenetMLEditor-23386a22.js +++ /dev/null @@ -1 +0,0 @@ -import{R as a,l as i,r as s,j as e}from"./index-99a56692.js";import{t as d,u as l}from"./EditorViewerRecoil-41e59102.js";import{C as u}from"./CodeMirror-35f8e4ac.js";function x(m){const t=a(d),o=i(l);let r=s.useRef(null);return e("div",{children:e(u,{editorRef:r,setInternalValue:o,onBeforeChange:n=>{t(n)}},"codemirror")})}export{x as default}; diff --git a/dist/assets/GuestEditorViewer-0594be68.js b/dist/assets/GuestEditorViewer-77c3ad69.js similarity index 90% rename from dist/assets/GuestEditorViewer-0594be68.js rename to dist/assets/GuestEditorViewer-77c3ad69.js index ee9f5aff58..3944bd9760 100644 --- a/dist/assets/GuestEditorViewer-0594be68.js +++ b/dist/assets/GuestEditorViewer-77c3ad69.js @@ -1 +1 @@ -import{l as y,m as F,g as _,h as N,R as f,f as T,r,ab as J,u as O,v as $,ac as S,j as w,P as K,k as B,H}from"./index-99a56692.js";import{u as q,a as G}from"./EditorViewer-55cb3454.js";import{p as U}from"./activityUtils-c08c1686.js";import{v as E,e as z,r as Q,a as W,u as X,t as Y}from"./EditorViewerRecoil-41e59102.js";function ie(){const i=y(E),o=y(F("doenetId")),[u,x]=_(N),P=f(T),h=f(z),A=y(Q),I=f(W),[m,C]=r.useState(null),V=q(),[p,l]=r.useState(null),L=f(J);let a=O();const c=r.useRef({}),d=r.useRef(null);r.useEffect(()=>{const e=document.title;return(async()=>{let t=await B.get("/api/getCidForAssignment.php",{params:{doenetId:o,latestAttemptOverrides:!1,publicOnly:!0,userCanViewSourceOnly:!0}}),s;if(!t.data.success||!t.data.cid){t.data.cid?l(`Error loading activity: ${t.data.message}`):l("Error loading activity: public content with public source not found");return}else s=t.data.cid;let g;try{g=await S(s,"doenet")}catch{l("Error loading activity: activity file not found");return}let v=U(g);if(!v.success){l(`Invalid activity definition: ${v.message}`);return}let R=v.activityJSON;C(Z(R.order)),p&&l(null),document.title=`${t.data.label} - Doenet`})().catch(console.error),()=>{document.title=e}},[o]),r.useEffect(()=>{var e,n;d.current!==a.key&&(((e=a.state)==null?void 0:e.previousScrollPosition)!==void 0&&d.current&&(c.current[d.current].lastScrollPosition=a.state.previousScrollPosition),c.current[a.key]&&((n=c.current[a.key])==null?void 0:n.lastScrollPosition)!==void 0&&document.getElementById("mainPanel").scroll({top:c.current[a.key].lastScrollPosition}),c.current[a.key]={...a},d.current=a.key)},[a]),r.useEffect(()=>{const e=document.getElementById("mainPanel");L(e)},[]);let k=$(({snapshot:e,set:n})=>async t=>{const s=await S(t,"doenet");n(X,s),n(Y,s),n(E,s)},[]);if(r.useEffect(()=>(m&&k(m),()=>{h("")}),[m]),G("keydown",e=>{e.keyCode===83&&(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)&&(e.preventDefault(),V())}),p)return w("h1",{children:p});let M=1,b="button";function D(e,n){const t=JSON.parse(JSON.stringify(e));P({index:t.index,allPossibleVariants:n}),x({index:t.index})}return i?w(K,{doenetML:i,flags:{showCorrectness:!0,readOnly:!1,solutionDisplayMode:b,showFeedback:!0,showHints:!0,autoSubmit:!1,allowLoadState:!1,allowSaveState:!1,allowLocalState:!1,allowSaveSubmissions:!1,allowSaveEvents:!1},doenetId:o,attemptNumber:M,generatedVariantCallback:D,requestedVariantIndex:u.index,setIsInErrorState:I,pageIsActive:!0},`pageViewer${A}`):null}function Z(i){if(!(i!=null&&i.content)||i.content.length==0)return null;for(let o of i.content){if(o.type==="page")return o.cid;{let u=H(o.content);if(u)return u}}return null}export{ie as default}; +import{l as y,m as F,g as _,h as N,R as f,f as T,r,ab as J,u as O,v as $,ac as S,j as w,P as K,k as B,H}from"./index-7074710c.js";import{u as q,a as G}from"./EditorViewer-d9b9074f.js";import{p as U}from"./activityUtils-9c5f1536.js";import{v as E,e as z,r as Q,a as W,u as X,t as Y}from"./EditorViewerRecoil-fb47fc9d.js";function ie(){const i=y(E),o=y(F("doenetId")),[u,x]=_(N),P=f(T),h=f(z),A=y(Q),I=f(W),[m,C]=r.useState(null),V=q(),[p,l]=r.useState(null),L=f(J);let a=O();const c=r.useRef({}),d=r.useRef(null);r.useEffect(()=>{const e=document.title;return(async()=>{let t=await B.get("/api/getCidForAssignment.php",{params:{doenetId:o,latestAttemptOverrides:!1,publicOnly:!0,userCanViewSourceOnly:!0}}),s;if(!t.data.success||!t.data.cid){t.data.cid?l(`Error loading activity: ${t.data.message}`):l("Error loading activity: public content with public source not found");return}else s=t.data.cid;let g;try{g=await S(s,"doenet")}catch{l("Error loading activity: activity file not found");return}let v=U(g);if(!v.success){l(`Invalid activity definition: ${v.message}`);return}let R=v.activityJSON;C(Z(R.order)),p&&l(null),document.title=`${t.data.label} - Doenet`})().catch(console.error),()=>{document.title=e}},[o]),r.useEffect(()=>{var e,n;d.current!==a.key&&(((e=a.state)==null?void 0:e.previousScrollPosition)!==void 0&&d.current&&(c.current[d.current].lastScrollPosition=a.state.previousScrollPosition),c.current[a.key]&&((n=c.current[a.key])==null?void 0:n.lastScrollPosition)!==void 0&&document.getElementById("mainPanel").scroll({top:c.current[a.key].lastScrollPosition}),c.current[a.key]={...a},d.current=a.key)},[a]),r.useEffect(()=>{const e=document.getElementById("mainPanel");L(e)},[]);let k=$(({snapshot:e,set:n})=>async t=>{const s=await S(t,"doenet");n(X,s),n(Y,s),n(E,s)},[]);if(r.useEffect(()=>(m&&k(m),()=>{h("")}),[m]),G("keydown",e=>{e.keyCode===83&&(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)&&(e.preventDefault(),V())}),p)return w("h1",{children:p});let M=1,b="button";function D(e,n){const t=JSON.parse(JSON.stringify(e));P({index:t.index,allPossibleVariants:n}),x({index:t.index})}return i?w(K,{doenetML:i,flags:{showCorrectness:!0,readOnly:!1,solutionDisplayMode:b,showFeedback:!0,showHints:!0,autoSubmit:!1,allowLoadState:!1,allowSaveState:!1,allowLocalState:!1,allowSaveSubmissions:!1,allowSaveEvents:!1},doenetId:o,attemptNumber:M,generatedVariantCallback:D,requestedVariantIndex:u.index,setIsInErrorState:I,pageIsActive:!0},`pageViewer${A}`):null}function Z(i){if(!(i!=null&&i.content)||i.content.length==0)return null;for(let o of i.content){if(o.type==="page")return o.cid;{let u=H(o.content);if(u)return u}}return null}export{ie as default}; diff --git a/dist/assets/HomeIntroVideo-4970a3d2.js b/dist/assets/HomeIntroVideo-cd1e31f9.js similarity index 88% rename from dist/assets/HomeIntroVideo-4970a3d2.js rename to dist/assets/HomeIntroVideo-cd1e31f9.js index f6a8643fea..54e032f144 100644 --- a/dist/assets/HomeIntroVideo-4970a3d2.js +++ b/dist/assets/HomeIntroVideo-cd1e31f9.js @@ -1,4 +1,4 @@ -import{r as t,j as o,s as a}from"./index-99a56692.js";const i=a.video` +import{r as t,j as o,s as a}from"./index-7074710c.js";const i=a.video` height: 350px; @media (max-width: 780px) { height: 240px; diff --git a/dist/assets/HomePanel-846b604a.js b/dist/assets/HomePanel-92cda016.js similarity index 99% rename from dist/assets/HomePanel-846b604a.js rename to dist/assets/HomePanel-92cda016.js index ef534bbe9b..a8d9fa1c1d 100644 --- a/dist/assets/HomePanel-846b604a.js +++ b/dist/assets/HomePanel-92cda016.js @@ -1,4 +1,4 @@ -import{r as a,e as $,R as V,f as H,g as L,h as P,d as B,a as t,j as e,B as d,C as h,P as E,s as i,i as v,k as j}from"./index-99a56692.js";const N=i.div` +import{r as a,e as $,R as V,f as H,g as L,h as P,d as B,a as t,j as e,B as d,C as h,P as E,s as i,i as v,k as j}from"./index-7074710c.js";const N=i.div` text-align: center; max-width: 800px; display: inline-block; diff --git a/dist/assets/IncrementMenu-aee46d2a.js b/dist/assets/IncrementMenu-2cdf9a4e.js similarity index 93% rename from dist/assets/IncrementMenu-aee46d2a.js rename to dist/assets/IncrementMenu-2cdf9a4e.js index 2a60967afd..3eb1bf915f 100644 --- a/dist/assets/IncrementMenu-aee46d2a.js +++ b/dist/assets/IncrementMenu-2cdf9a4e.js @@ -1,4 +1,4 @@ -import{r,a as y,j as c,s as u,i as w,bg as N,bh as j}from"./index-99a56692.js";const o=[8,9,10,11,12,14,18,24,30,36,48,60,72,96],E=u.div` +import{r,a as y,j as c,s as u,i as w,bi as z,bj as N}from"./index-7074710c.js";const o=[8,9,10,11,12,14,18,24,30,36,48,60,72,96],E=u.div` display: ${e=>e.label&&!e.vertical&&"flex"}; align-items: ${e=>e.label&&!e.vertical&&"center"}; `,F=u.div` @@ -75,4 +75,4 @@ import{r,a as y,j as c,s as u,i as w,bg as N,bh as j}from"./index-99a56692.js";c `,S=u.span` font-size: 14px; margin-right: 5px; -`;function L(e){let x="+",m="-";(e.values||e.font)&&(m=c(w,{icon:N}),x=c(w,{icon:j}));const l=e.values||e.font&&o||[],[n,t]=r.useState(e.value||0),[d,b]=r.useState(0),$=r.useRef(null),s=r.useRef(null),B=r.useRef(null),k=r.useRef(null);r.useEffect(()=>{e.placeholder&&n===""?t(""):(e.font||!l.length)&&!n&&t(0),(l.includes(n)||typeof n=="number")&&e.onChange&&e.onChange(n)},[n]),r.useEffect(()=>{e.value!==void 0?t(e.value):e.min!==void 0?t(e.min):e.max!==void 0?t(e.max):e.font?t(o[4]):e.values!==void 0?t(e.values[0]):e.placeholder?t(""):t(0),e.value&&e.values&&b(e.values.indexOf(e.value))},[e.value]);const C=()=>{if(s.current&&s.current.focus(),l.length&&d<=l.length-1){if(d==l.length-1)return;t(l[d+1]),b(d+1)}else(e.max===void 0||e.max!==void 0&&n{if(s.current&&s.current.focus(),l.length&&d>=0){if(d==0)return;t(l[d-1]),b(d-1)}else(e.min===void 0||e.min!==void 0&&n>e.min)&&t(e.placeholder&&!n?-1:parseInt(n)-1)},D=(a,i)=>{if(a===null)return-1;let v=0,g=isNaN(i)?Math.abs(a[0].charCodeAt(0)-i.charCodeAt(0)):Math.abs(a[0]-parseInt(i));for(let f=1;f{if(!e.font&&l.length){let i=D(l,n);b(i),t(l[i]);return}let a=parseInt(n[0]=="0"?parseInt(n.substring(1)):parseInt(n));e.min!==void 0&&ae.max?a=e.max:e.font&&(ao[o.length-1]&&(a=o[o.length-1])),t(a)},T=a=>{const i=a.currentTarget;requestAnimationFrame(()=>{i.contains(document.activeElement)||e.onBlur&&e.onBlur(isNaN(n)?n:parseInt(n))})},z=a=>{e.onKeyDown(a),a.key==="Enter"&&s.current&&s.current.blur()};let h="210px";return e.width&&(h=e.width),y(E,{label:e.label,vertical:e.vertical,children:[e.label&&c(S,{id:"increment-label",children:e.label}),e.label&&e.vertical&&c("br",{}),c(O,{width:h,children:y(F,{ref:k,onBlur:T,alert:e.alert,children:[c(K,{"aria-label":"Decrease","aria-labelledby":"increment-label","aria-disabled":!!e.disabled,ref:B,alert:e.alert,disabled:e.disabled,onClick:R,"data-test":`Decrement ${e.dataTest}`,children:m}),c(M,{"aria-labelledby":"increment-label","aria-haspopup":"true","aria-disabled":!!e.disabled,placeholder:e.placeholder,value:n,"data-test":e.dataTest,ref:s,alert:e.alert,disabled:!!e.disabled,onChange:a=>t(a.target.value),onBlur:A,onKeyDown:e.onKeyDown&&z}),c(G,{alert:e.alert,ref:$,disabled:e.disabled,onClick:C,"aria-labelledby":"increment-label","aria-label":"Increase","aria-disabled":!!e.disabled,"data-test":`Increment ${e.dataTest}`,children:x})]})})]})}export{L as I}; +`;function L(e){let x="+",m="-";(e.values||e.font)&&(m=c(w,{icon:z}),x=c(w,{icon:N}));const l=e.values||e.font&&o||[],[n,t]=r.useState(e.value||0),[d,b]=r.useState(0),$=r.useRef(null),s=r.useRef(null),B=r.useRef(null),k=r.useRef(null);r.useEffect(()=>{e.placeholder&&n===""?t(""):(e.font||!l.length)&&!n&&t(0),(l.includes(n)||typeof n=="number")&&e.onChange&&e.onChange(n)},[n]),r.useEffect(()=>{e.value!==void 0?t(e.value):e.min!==void 0?t(e.min):e.max!==void 0?t(e.max):e.font?t(o[4]):e.values!==void 0?t(e.values[0]):e.placeholder?t(""):t(0),e.value&&e.values&&b(e.values.indexOf(e.value))},[e.value]);const C=()=>{if(s.current&&s.current.focus(),l.length&&d<=l.length-1){if(d==l.length-1)return;t(l[d+1]),b(d+1)}else(e.max===void 0||e.max!==void 0&&n{if(s.current&&s.current.focus(),l.length&&d>=0){if(d==0)return;t(l[d-1]),b(d-1)}else(e.min===void 0||e.min!==void 0&&n>e.min)&&t(e.placeholder&&!n?-1:parseInt(n)-1)},D=(a,i)=>{if(a===null)return-1;let v=0,g=isNaN(i)?Math.abs(a[0].charCodeAt(0)-i.charCodeAt(0)):Math.abs(a[0]-parseInt(i));for(let f=1;f{if(!e.font&&l.length){let i=D(l,n);b(i),t(l[i]);return}let a=parseInt(n[0]=="0"?parseInt(n.substring(1)):parseInt(n));e.min!==void 0&&ae.max?a=e.max:e.font&&(ao[o.length-1]&&(a=o[o.length-1])),t(a)},T=a=>{const i=a.currentTarget;requestAnimationFrame(()=>{i.contains(document.activeElement)||e.onBlur&&e.onBlur(isNaN(n)?n:parseInt(n))})},j=a=>{e.onKeyDown(a),a.key==="Enter"&&s.current&&s.current.blur()};let h="210px";return e.width&&(h=e.width),y(E,{label:e.label,vertical:e.vertical,children:[e.label&&c(S,{id:"increment-label",children:e.label}),e.label&&e.vertical&&c("br",{}),c(O,{width:h,children:y(F,{ref:k,onBlur:T,alert:e.alert,children:[c(K,{"aria-label":"Decrease","aria-labelledby":"increment-label","aria-disabled":!!e.disabled,ref:B,alert:e.alert,disabled:e.disabled,onClick:R,"data-test":`Decrement ${e.dataTest}`,children:m}),c(M,{"aria-labelledby":"increment-label","aria-haspopup":"true","aria-disabled":!!e.disabled,placeholder:e.placeholder,value:n,"data-test":e.dataTest,ref:s,alert:e.alert,disabled:!!e.disabled,onChange:a=>t(a.target.value),onBlur:A,onKeyDown:e.onKeyDown&&j}),c(G,{alert:e.alert,ref:$,disabled:e.disabled,onClick:C,"aria-labelledby":"increment-label","aria-label":"Increase","aria-disabled":!!e.disabled,"data-test":`Increment ${e.dataTest}`,children:x})]})})]})}export{L as I}; diff --git a/dist/assets/LoadPeople-f0cdb3f5.js b/dist/assets/LoadPeople-0fec718e.js similarity index 92% rename from dist/assets/LoadPeople-f0cdb3f5.js rename to dist/assets/LoadPeople-0fec718e.js index a74942d8d6..118dc028bf 100644 --- a/dist/assets/LoadPeople-f0cdb3f5.js +++ b/dist/assets/LoadPeople-0fec718e.js @@ -1 +1 @@ -import{y as P,R as c,l as k,m as C,a6 as T,r as d,v as S,k as L,n as _,b1 as D,a as n,j as e,B as w,A as F,ag as l,z as N}from"./index-99a56692.js";import{p as j}from"./index-2e9c8a8a.js";import{B}from"./ButtonGroup-ea123297.js";import{C as z}from"./CollapseSection-a6fcd8bf.js";const J=l({key:"peopleTableDataAtom",default:[]}),V=l({key:"processAtom",default:"Idle"}),K=Object.freeze({Email:"Email",FirstName:"FirstName",LastName:"LastName",Section:"Section",ExternalId:"ExternalId"}),O=l({key:"headersAtom",default:[]}),H=l({key:"entriesAtom",default:[]}),M=l({key:"enrolllearnerAtom",default:""}),W=Object.freeze({IDLE:"idle",SELECT:"select",PREVIEW:"preview"});function Q({style:A}){const x=P(),u=c(V),m=c(O),p=c(H),h=k(C("courseId"));let{canAutoEnroll:r}=T(h);const[i,f]=d.useState(r);d.useEffect(()=>{let s=!1;r=="1"&&(s=!0),f(s)},[r]);const v=S(s=>async(t,a)=>{let o=0;a&&(o=1),await L.post("/api/modifyCourse.php",{courseId:t,canAutoEnroll:o}),s(_,R=>{let E={...R};return E.canAutoEnroll=o,E})}),y=d.useCallback(s=>{const t=new FileReader;t.onabort=()=>{},t.onerror=()=>{},t.onload=()=>{j(t.result,{comment:"#"},function(a,o){a!=null&&a.message?x(`${a.message}. Please reformat and try again`,N.ERROR):(m(o[0]),o.shift(),p(o),u(W.PREVIEW))})},t.readAsText(s[0])},[p,m,u]),{getRootProps:I,getInputProps:b,isDragActive:g}=D({onDrop:y});return n("div",{style:A,children:[n("div",{...I(),children:[e("input",{...b(),"data-test":"Import CSV file"}),g?e("p",{children:"Drop the files here"}):e(B,{vertical:!0,children:e(w,{width:"menu",value:"Import CSV file"})})]},"drop"),e("div",{style:{height:"4px"}}),n(z,{title:"Formatting Instructions",collapsed:!0,style:{marginTop:"12px"},children:[e("p",{children:"Your file needs to contain an email address. The parser will ignore columns which are not listed."}),e("div",{children:e("b",{children:"Email (required)"})}),e("div",{children:e("b",{children:"ExternalId"})}),e("div",{children:e("b",{children:"FirstName"})}),e("div",{children:e("b",{children:"LastName"})}),e("div",{children:e("b",{children:"Section"})})]}),n("p",{style:{display:"flex"},children:[e(F,{dataTest:"Auto Enroll",checked:i,onClick:()=>{f(!i),v(h,!i)}})," ",e("span",{style:{marginLeft:"10px"},children:"Auto Enrollment"})," "]})]})}export{W as csvPeopleProcess,Q as default,M as enrolllearnerAtom,H as entriesAtom,O as headersAtom,J as peopleTableDataAtom,V as processAtom,K as validHeaders}; +import{y as P,R as c,l as k,m as C,a6 as T,r as d,v as S,k as L,n as _,b1 as D,a as n,j as e,B as w,A as F,ag as l,z as N}from"./index-7074710c.js";import{p as j}from"./index-a475a6f9.js";import{B}from"./ButtonGroup-9136da6d.js";import{C as z}from"./CollapseSection-cb27678a.js";const J=l({key:"peopleTableDataAtom",default:[]}),V=l({key:"processAtom",default:"Idle"}),K=Object.freeze({Email:"Email",FirstName:"FirstName",LastName:"LastName",Section:"Section",ExternalId:"ExternalId"}),O=l({key:"headersAtom",default:[]}),H=l({key:"entriesAtom",default:[]}),M=l({key:"enrolllearnerAtom",default:""}),W=Object.freeze({IDLE:"idle",SELECT:"select",PREVIEW:"preview"});function Q({style:A}){const x=P(),u=c(V),m=c(O),p=c(H),h=k(C("courseId"));let{canAutoEnroll:r}=T(h);const[i,f]=d.useState(r);d.useEffect(()=>{let s=!1;r=="1"&&(s=!0),f(s)},[r]);const v=S(s=>async(t,a)=>{let o=0;a&&(o=1),await L.post("/api/modifyCourse.php",{courseId:t,canAutoEnroll:o}),s(_,R=>{let E={...R};return E.canAutoEnroll=o,E})}),y=d.useCallback(s=>{const t=new FileReader;t.onabort=()=>{},t.onerror=()=>{},t.onload=()=>{j(t.result,{comment:"#"},function(a,o){a!=null&&a.message?x(`${a.message}. Please reformat and try again`,N.ERROR):(m(o[0]),o.shift(),p(o),u(W.PREVIEW))})},t.readAsText(s[0])},[p,m,u]),{getRootProps:I,getInputProps:b,isDragActive:g}=D({onDrop:y});return n("div",{style:A,children:[n("div",{...I(),children:[e("input",{...b(),"data-test":"Import CSV file"}),g?e("p",{children:"Drop the files here"}):e(B,{vertical:!0,children:e(w,{width:"menu",value:"Import CSV file"})})]},"drop"),e("div",{style:{height:"4px"}}),n(z,{title:"Formatting Instructions",collapsed:!0,style:{marginTop:"12px"},children:[e("p",{children:"Your file needs to contain an email address. The parser will ignore columns which are not listed."}),e("div",{children:e("b",{children:"Email (required)"})}),e("div",{children:e("b",{children:"ExternalId"})}),e("div",{children:e("b",{children:"FirstName"})}),e("div",{children:e("b",{children:"LastName"})}),e("div",{children:e("b",{children:"Section"})})]}),n("p",{style:{display:"flex"},children:[e(F,{dataTest:"Auto Enroll",checked:i,onClick:()=>{f(!i),v(h,!i)}})," ",e("span",{style:{marginLeft:"10px"},children:"Auto Enrollment"})," "]})]})}export{W as csvPeopleProcess,Q as default,M as enrolllearnerAtom,H as entriesAtom,O as headersAtom,J as peopleTableDataAtom,V as processAtom,K as validHeaders}; diff --git a/dist/assets/ManageUsersMenu-c118c06a.js b/dist/assets/ManageUsersMenu-c118c06a.js deleted file mode 100644 index 104705d5d9..0000000000 --- a/dist/assets/ManageUsersMenu-c118c06a.js +++ /dev/null @@ -1 +0,0 @@ -import{l as o,m,j as t}from"./index-99a56692.js";import{d as i}from"./SettingComponents-ce5fbb6e.js";import"./CourseToolHandler-f517d0e5.js";import"./index-ef9c2520.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-b3e258be.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-ea123297.js";import"./CollapseSection-a6fcd8bf.js";import"./util-38d8e238.js";import"./DateTime-ef0be144.js";import"./moment-f5bb98f1.js";import"./DropdownMenu-9b4c45a6.js";import"./RelatedItems-96588168.js";import"./RoleDropdown-5e05ae49.js";import"./Textfield-5d92f495.js";function y(){const r=o(m("courseId"));return t(i,{courseId:r})}export{y as default}; diff --git a/dist/assets/ManageUsersMenu-ca3ae540.js b/dist/assets/ManageUsersMenu-ca3ae540.js new file mode 100644 index 0000000000..5d433b3d4f --- /dev/null +++ b/dist/assets/ManageUsersMenu-ca3ae540.js @@ -0,0 +1 @@ +import{l as o,m,j as t}from"./index-7074710c.js";import{d as i}from"./SettingComponents-43f86399.js";import"./CourseToolHandler-8716455d.js";import"./index-67ec2c85.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-5b62de19.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-9136da6d.js";import"./CollapseSection-cb27678a.js";import"./util-38d8e238.js";import"./DateTime-d0a20943.js";import"./moment-3cda1086.js";import"./DropdownMenu-f3593bed.js";import"./RelatedItems-33b68fba.js";import"./RoleDropdown-cce90708.js";import"./Textfield-9c1c2968.js";function y(){const r=o(m("courseId"));return t(i,{courseId:r})}export{y as default}; diff --git a/dist/assets/ManualEnrollment-685fd9c8.js b/dist/assets/ManualEnrollment-21e6c09a.js similarity index 70% rename from dist/assets/ManualEnrollment-685fd9c8.js rename to dist/assets/ManualEnrollment-21e6c09a.js index d29df9f629..2f60b5b27f 100644 --- a/dist/assets/ManualEnrollment-685fd9c8.js +++ b/dist/assets/ManualEnrollment-21e6c09a.js @@ -1 +1 @@ -import{R as t,g as u,l as x,m as h,j as a,a as i,B as v,ae as y,k as E}from"./index-99a56692.js";import{processAtom as f,enrolllearnerAtom as _,peopleTableDataAtom as g}from"./LoadPeople-f0cdb3f5.js";import"./index-2e9c8a8a.js";import"./ButtonGroup-ea123297.js";import"./CollapseSection-a6fcd8bf.js";function b(s){t(f);const[l,m]=u(_);t(g);const o=x(h("driveId")),n=(e,p)=>{if(e){let r={email:e,userId:y(),driveId:p};console.log(">>>>payload",r),E.post("/api/manualEnrollment.php",r).then(c=>{console.log(">>>>resp",c.data)})}};let d=i("div",{children:[i("label",{children:["Email",a("input",{required:!0,type:"email",name:"email",value:l,placeholder:"example@example.com",onChange:e=>m(e.currentTarget.value),onKeyDown:e=>{e.key==="Enter"&&n(l,o)}})]}),a(v,{value:"Enroll",onClick:()=>n(l,o)})]});return a("div",{style:s.style,children:d})}export{b as default}; +import{R as t,g as u,l as x,m as h,j as a,a as i,B as v,ae as y,k as E}from"./index-7074710c.js";import{processAtom as f,enrolllearnerAtom as _,peopleTableDataAtom as g}from"./LoadPeople-0fec718e.js";import"./index-a475a6f9.js";import"./ButtonGroup-9136da6d.js";import"./CollapseSection-cb27678a.js";function b(s){t(f);const[l,m]=u(_);t(g);const o=x(h("driveId")),n=(e,p)=>{if(e){let r={email:e,userId:y(),driveId:p};console.log(">>>>payload",r),E.post("/api/manualEnrollment.php",r).then(c=>{console.log(">>>>resp",c.data)})}};let d=i("div",{children:[i("label",{children:["Email",a("input",{required:!0,type:"email",name:"email",value:l,placeholder:"example@example.com",onChange:e=>m(e.currentTarget.value),onKeyDown:e=>{e.key==="Enter"&&n(l,o)}})]}),a(v,{value:"Enroll",onClick:()=>n(l,o)})]});return a("div",{style:s.style,children:d})}export{b as default}; diff --git a/dist/assets/MathInputKeyboard-592dc150.js b/dist/assets/MathInputKeyboard-a24ef99e.js similarity index 98% rename from dist/assets/MathInputKeyboard-592dc150.js rename to dist/assets/MathInputKeyboard-a24ef99e.js index 7da757a6ff..4e834f0acd 100644 --- a/dist/assets/MathInputKeyboard-592dc150.js +++ b/dist/assets/MathInputKeyboard-a24ef99e.js @@ -1,4 +1,4 @@ -import{r as C,l as E,R as V,y as W,j as i,a,i as h,b7 as J,b8 as u,b9 as r,s as d}from"./index-99a56692.js";import{T as y}from"./ToggleButton-57def544.js";import{T as Q}from"./ToggleButtonGroup-c2629620.js";import{f as ii,a as ei,p as ri}from"./MathInputSelector-58bfc077.js";const M=d.div` +import{r as C,l as E,R as V,y as W,j as i,a,i as h,b7 as J,b8 as u,b9 as r,s as d}from"./index-7074710c.js";import{T as y}from"./ToggleButton-faf565eb.js";import{T as Q}from"./ToggleButtonGroup-6decfcc6.js";import{f as ii,a as ei,p as ri}from"./MathInputSelector-50cc4d06.js";const M=d.div` height: 240px; // position: fixed; bottom: 0; diff --git a/dist/assets/MathInputSelector-58bfc077.js b/dist/assets/MathInputSelector-50cc4d06.js similarity index 78% rename from dist/assets/MathInputSelector-58bfc077.js rename to dist/assets/MathInputSelector-50cc4d06.js index 856571ea06..c2ea1ee836 100644 --- a/dist/assets/MathInputSelector-58bfc077.js +++ b/dist/assets/MathInputSelector-50cc4d06.js @@ -1 +1 @@ -import{ag as e}from"./index-99a56692.js";const a=e({key:"focusedMathField",default:()=>{}}),t=e({key:"focusedMathFieldReturn",default:()=>{}}),d=e({key:"palletRef",default:null}),f=e({key:"handleRef",default:null});e({key:"footerPanelToggle",default:!0});export{t as a,a as f,f as h,d as p}; +import{ag as e}from"./index-7074710c.js";const a=e({key:"focusedMathField",default:()=>{}}),t=e({key:"focusedMathFieldReturn",default:()=>{}}),d=e({key:"palletRef",default:null}),f=e({key:"handleRef",default:null});e({key:"footerPanelToggle",default:!0});export{t as a,a as f,f as h,d as p}; diff --git a/dist/assets/NavigationBreadCrumb-0509a6e4.js b/dist/assets/NavigationBreadCrumb-0509a6e4.js new file mode 100644 index 0000000000..e7b0a5ac99 --- /dev/null +++ b/dist/assets/NavigationBreadCrumb-0509a6e4.js @@ -0,0 +1 @@ +import{l as s,m as a,j as r,r as u}from"./index-7074710c.js";import{B as c}from"./BreadCrumb-c4dbe368.js";import{u as n,a as d,b}from"./breadcrumbUtil-1e7f0dfb.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-06d28967.js";function x(){const o=s(a("courseId")),e=s(a("sectionId")),m=n(),t=d(o),i=b(o,e);return r(u.Suspense,{fallback:r("div",{children:"Loading Breadcrumb..."}),children:r(c,{crumbs:[m,t,...i]})})}export{x as default}; diff --git a/dist/assets/NavigationBreadCrumb-40475a81.js b/dist/assets/NavigationBreadCrumb-40475a81.js deleted file mode 100644 index cad91dbe38..0000000000 --- a/dist/assets/NavigationBreadCrumb-40475a81.js +++ /dev/null @@ -1 +0,0 @@ -import{l as s,m as a,j as r,r as u}from"./index-99a56692.js";import{B as c}from"./BreadCrumb-c66b383a.js";import{u as n,a as d,b}from"./breadcrumbUtil-6dfe85b1.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-e81ca638.js";function x(){const o=s(a("courseId")),e=s(a("sectionId")),m=n(),t=d(o),i=b(o,e);return r(u.Suspense,{fallback:r("div",{children:"Loading Breadcrumb..."}),children:r(c,{crumbs:[m,t,...i]})})}export{x as default}; diff --git a/dist/assets/NavigationLeave-30aa839b.js b/dist/assets/NavigationLeave-33a19712.js similarity index 83% rename from dist/assets/NavigationLeave-30aa839b.js rename to dist/assets/NavigationLeave-33a19712.js index 5dcbe4b159..e9427902e5 100644 --- a/dist/assets/NavigationLeave-30aa839b.js +++ b/dist/assets/NavigationLeave-33a19712.js @@ -1 +1 @@ -import{v as u,T as n,G as s,q as d,ba as r,bb as f}from"./index-99a56692.js";function b(){return u(({set:e,snapshot:l})=>async()=>{let i=await l.getPromise(n);for(let o of i)e(s(o),a=>{let t={...a};return t.isSelected=!1,t});e(n,[]),e(d,"");let c=await l.getPromise(r);for(let o of c)e(s(o.doenetId),a=>{let t={...a};return t.isBeingCut=!1,t});e(r,[]),e(f,[])})(),null}export{b as default}; +import{v as u,T as n,G as s,q as d,ba as r,bb as f}from"./index-7074710c.js";function b(){return u(({set:e,snapshot:l})=>async()=>{let i=await l.getPromise(n);for(let o of i)e(s(o),a=>{let t={...a};return t.isSelected=!1,t});e(n,[]),e(d,"");let c=await l.getPromise(r);for(let o of c)e(s(o.doenetId),a=>{let t={...a};return t.isBeingCut=!1,t});e(r,[]),e(f,[])})(),null}export{b as default}; diff --git a/dist/assets/NavigationPanel-03f23df4.js b/dist/assets/NavigationPanel-ad98872c.js similarity index 89% rename from dist/assets/NavigationPanel-03f23df4.js rename to dist/assets/NavigationPanel-ad98872c.js index 966f8c0429..5ce51225e1 100644 --- a/dist/assets/NavigationPanel-03f23df4.js +++ b/dist/assets/NavigationPanel-ad98872c.js @@ -1,4 +1,4 @@ -import{l as m,m as A,R as N,E,y as L,r as w,v as b,q as t,G as _,p as d,H as B,I as G,j as i,a as l,U as M,s}from"./index-99a56692.js";import{C as D}from"./CourseNavigator-119cf888.js";import{e as k}from"./RoleDropdown-5e05ae49.js";import"./index.esm-b3e258be.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-ea123297.js";import"./DropdownMenu-9b4c45a6.js";const I=M` +import{l as m,m as A,R as N,E,y as L,r as w,v as b,q as t,G as _,p as d,H as B,I as G,j as i,a as l,U as M,s}from"./index-7074710c.js";import{C as D}from"./CourseNavigator-d0c5e95b.js";import{e as k}from"./RoleDropdown-cce90708.js";import"./index.esm-5b62de19.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-9136da6d.js";import"./DropdownMenu-f3593bed.js";const I=M` 0% { background-position: -250px 0; } 100% { background-position: 250px 0; } `,R=s.table` diff --git a/dist/assets/Next7Days-4c381b9d.js b/dist/assets/Next7Days-ac4b7e6b.js similarity index 97% rename from dist/assets/Next7Days-4c381b9d.js rename to dist/assets/Next7Days-ac4b7e6b.js index bcbfcb8c18..76b75e65f0 100644 --- a/dist/assets/Next7Days-4c381b9d.js +++ b/dist/assets/Next7Days-ac4b7e6b.js @@ -1 +1 @@ -import{R as ne,p as ae,l as j,S as oe,r as R,v as q,o as se,q as le,k as J,G as ie,H as re,j as t,N as L,a as f,F as de,B as _,i as H,aK as ce,a2 as ue,ag as E,A as ge,aL as me}from"./index-99a56692.js";import{g as pe,c as he}from"./CourseToolHandler-f517d0e5.js";import{B as fe}from"./ButtonGroup-ea123297.js";import{e as be}from"./RoleDropdown-5e05ae49.js";const K=E({key:"classTimesAtom",default:[]}),we=E({key:"showCompletedAtom",default:!0}),ye=E({key:"showOverdueAtom",default:!1});function xe(e,b,r,p){if(e=="Invalid Date"||e==null)return null;let u=e.getDay();for(let g of b)if(g.dotwIndex==u){let s=new Date(e.getTime());const[i,h]=g.startTime.split(":");s.setHours(i,h,0,0);let D=new Date(e.getTime());const[$,a]=g.endTime.split(":");if(D.setHours($,a,0,0),e>=s&&el&&e0){let D=!0,$=0;for(let a of r){let n=u.includes(a.doenetId);(i||!i&&!n)&&$++}for(let a=0;a{x.stopPropagation(),p({courseId:n.courseId,doenetId:n.doenetId})},O=u.includes(n.doenetId);if(!i&&O)continue;let C="";if(n.gradeCategory){const x=Number(n.totalPointsOrPercent);let A=Math.round(n.credit*x*100)/100;n.creditOverride&&(A=Math.round(n.creditOverride*x*100)/100),C=`${A}/${x}`}let P=t(ge,{checked:O,onClick:x=>{x.stopPropagation(),l(O?A=>{let M=[...A];return M.splice(M.indexOf(n.doenetId),1),M}:A=>[n.doenetId,...A]),J.get("/api/saveCompleted.php",{params:{doenetId:n.doenetId}})}});D?(D=!1,h.push(f("tr",{"data-test":`cbw row ${a}`,children:[t("td",{"data-test":`cbw row label ${a}`,style:{borderBottom:"2px solid black",padding:"8px"},rowSpan:$,children:B}),t("td",{"data-test":`cbw assignment label ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",cursor:"pointer"},onClick:y,children:n.label}),t("td",{"data-test":`cbw assigned date ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",cursor:"pointer"},onClick:y,children:v}),t("td",{"data-test":`cbw due date ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",cursor:"pointer"},onClick:y,children:T}),t("td",{"data-test":`cbw score ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",textAlign:"center"},children:C}),t("td",{"data-test":`cbw completed ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",textAlign:"center"},children:P})]},`${B}${n.doenetId}`))):h.push(f("tr",{"data-test":`cbw row ${a}`,children:[t("td",{"data-test":`cbw assignment label ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",cursor:"pointer"},onClick:y,children:n.label}),t("td",{"data-test":`cbw assigned date ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",cursor:"pointer"},onClick:y,children:v}),t("td",{"data-test":`cbw due date ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",cursor:"pointer"},onClick:y,children:T}),t("td",{"data-test":`cbw score ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",textAlign:"center"},children:C}),t("td",{"data-test":`cbw completed ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",textAlign:"center"},children:P})]},`${B}${n.doenetId}${a}`))}}return h}function Ie({courseId:e}){var G;const b=ne(ae),r=j(we),p=j(ye);oe(e);let[u,l]=R.useState([]),[w,g]=R.useState([]),[s,i]=R.useState([]),[h,D]=R.useState(!1),[$,a]=R.useState(""),[n,k]=R.useState(0),v=j(K),S=j(pe),T=null;((G=S[0])==null?void 0:G.driveInstanceId)==="currentContent"&&(T=S[0].itemId);let B=q(({set:c})=>async m=>{c(se,I=>[...I,{atom:he,value:null},{atom:le,value:null}]);const{data:o}=await J.get("/api/loadTODO.php",{params:{courseId:m}});if(!o.success){a(o.message);return}o.assignments&&(l(o.assignments),g(o.pinned)),o.classTimes&&c(K,o.classTimes),o.completed&&i(o.completed)});const d=q(({set:c,snapshot:m})=>async o=>{const I=o.courseId,W=o.doenetId;let{canEditContent:Z}=await m.getPromise(be(I));if(Z==="1"){let ee=await m.getPromise(ie(W)),te=re(ee.content);b({page:"course",tool:"editor",view:"",params:{doenetId:W,pageId:te}})}else b({page:"course",tool:"assignment",view:"",params:{doenetId:W}})},[]);if(!h&&e!=="")return D(!0),B(e),null;if($!=="")return t("div",{children:t("h2",{children:$})});let y=new Date,O=1-y.getDay();O===1&&(O=-6);let C=new Date(y.getTime()+1e3*60*60*24*O+1e3*60*60*24*n*7),P=new Date(C.getTime()+1e3*60*60*24*6),x=`${C.getMonth()+1}/${C.getDate()}`,A=`${P.getMonth()+1}/${P.getDate()}`,M=[],V=[],Q=f("p",{children:[t(H,{icon:me})," Pinned"]});if(n==0&&(M.push(...N({rowLabel:Q,assignments:w,clickCallback:d,completedArray:s,setCompletedArray:i,classTimes:v,weekShift:n,selectedItemId:T,showCompleted:r})),p)){const c=new Date;let m=[];for(let o of u){const I=L(o.dueDate);if(!I||I>c)break;s.includes(o.doenetId)||m.push(o)}V.push(...N({rowLabel:"Overdue",assignments:m,clickCallback:d,completedArray:s,setCompletedArray:i,classTimes:v,weekShift:n,selectedItemId:T,showCompleted:r}))}let Y=[],z=new Date(C.getTime());z.setHours(0,0,0,0);let U=new Date(P.getTime());U.setHours(23,59,59,999);let F=[[],[],[],[],[],[],[]];for(let c=0;cU)break;let I=o.getDay();F[I].push({...m})}F.push(F.shift());const X=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];for(let[c,m]of Object.entries(F))Y.push(...N({dotw:X[c],assignments:m,clickCallback:d,completedArray:s,setCompletedArray:i,classTimes:v,weekShift:n,selectedItemId:T,showCompleted:r}));return f(de,{children:[f("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-evenly",width:"850px",height:"70px"},children:[f("span",{children:[t(_,{onClick:()=>k(0),value:"This Week"})," "]}),t("h1",{children:"Content by Week"}),f("span",{style:{fontSize:"1.4em"},children:[x," - ",A]}),f(fe,{children:[t("span",{children:t(_,{dataTest:"previous week button",onClick:()=>k(c=>c-1),icon:t(H,{icon:ce})})}),t("span",{children:t(_,{dataTest:"next week button",onClick:()=>k(c=>c+1),icon:t(H,{icon:ue})})})]})]}),f("table",{style:{width:"850px",borderSpacing:"0em .2em"},children:[f("tr",{children:[t("th",{style:{width:"100px",padding:"8px",textAlign:"left",borderBottom:"2px solid black"},children:"Day"}),t("th",{style:{width:"200px",padding:"8px",textAlign:"left",borderBottom:"2px solid black"},children:"Name"}),t("th",{style:{width:"200px",padding:"8px",textAlign:"left",borderBottom:"2px solid black"},children:"Assigned"}),t("th",{style:{width:"200px",padding:"8px",textAlign:"left",borderBottom:"2px solid black"},children:"Due"}),t("th",{style:{width:"50px",padding:"8px",textAlign:"left",borderBottom:"2px solid black"},children:"Score"}),t("th",{style:{width:"100px",padding:"8px",textAlign:"center",borderBottom:"2px solid black"},children:"Completed"})]}),M,V,Y]})]})}export{Ie as N,we as a,K as c,ye as s}; +import{R as ne,p as ae,l as j,S as oe,r as R,v as q,o as se,q as le,k as J,G as ie,H as re,j as t,N as L,a as f,F as de,B as _,i as H,aK as ce,a2 as ue,ag as E,A as ge,aL as me}from"./index-7074710c.js";import{g as pe,c as he}from"./CourseToolHandler-8716455d.js";import{B as fe}from"./ButtonGroup-9136da6d.js";import{e as be}from"./RoleDropdown-cce90708.js";const K=E({key:"classTimesAtom",default:[]}),we=E({key:"showCompletedAtom",default:!0}),ye=E({key:"showOverdueAtom",default:!1});function xe(e,b,r,p){if(e=="Invalid Date"||e==null)return null;let u=e.getDay();for(let g of b)if(g.dotwIndex==u){let s=new Date(e.getTime());const[i,h]=g.startTime.split(":");s.setHours(i,h,0,0);let D=new Date(e.getTime());const[$,a]=g.endTime.split(":");if(D.setHours($,a,0,0),e>=s&&el&&e0){let D=!0,$=0;for(let a of r){let n=u.includes(a.doenetId);(i||!i&&!n)&&$++}for(let a=0;a{x.stopPropagation(),p({courseId:n.courseId,doenetId:n.doenetId})},O=u.includes(n.doenetId);if(!i&&O)continue;let C="";if(n.gradeCategory){const x=Number(n.totalPointsOrPercent);let A=Math.round(n.credit*x*100)/100;n.creditOverride&&(A=Math.round(n.creditOverride*x*100)/100),C=`${A}/${x}`}let P=t(ge,{checked:O,onClick:x=>{x.stopPropagation(),l(O?A=>{let M=[...A];return M.splice(M.indexOf(n.doenetId),1),M}:A=>[n.doenetId,...A]),J.get("/api/saveCompleted.php",{params:{doenetId:n.doenetId}})}});D?(D=!1,h.push(f("tr",{"data-test":`cbw row ${a}`,children:[t("td",{"data-test":`cbw row label ${a}`,style:{borderBottom:"2px solid black",padding:"8px"},rowSpan:$,children:B}),t("td",{"data-test":`cbw assignment label ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",cursor:"pointer"},onClick:y,children:n.label}),t("td",{"data-test":`cbw assigned date ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",cursor:"pointer"},onClick:y,children:v}),t("td",{"data-test":`cbw due date ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",cursor:"pointer"},onClick:y,children:T}),t("td",{"data-test":`cbw score ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",textAlign:"center"},children:C}),t("td",{"data-test":`cbw completed ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",textAlign:"center"},children:P})]},`${B}${n.doenetId}`))):h.push(f("tr",{"data-test":`cbw row ${a}`,children:[t("td",{"data-test":`cbw assignment label ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",cursor:"pointer"},onClick:y,children:n.label}),t("td",{"data-test":`cbw assigned date ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",cursor:"pointer"},onClick:y,children:v}),t("td",{"data-test":`cbw due date ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",cursor:"pointer"},onClick:y,children:T}),t("td",{"data-test":`cbw score ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",textAlign:"center"},children:C}),t("td",{"data-test":`cbw completed ${a}`,style:{backgroundColor:d,padding:"8px",borderBottom:"2px solid black",textAlign:"center"},children:P})]},`${B}${n.doenetId}${a}`))}}return h}function Ie({courseId:e}){var G;const b=ne(ae),r=j(we),p=j(ye);oe(e);let[u,l]=R.useState([]),[w,g]=R.useState([]),[s,i]=R.useState([]),[h,D]=R.useState(!1),[$,a]=R.useState(""),[n,k]=R.useState(0),v=j(K),S=j(pe),T=null;((G=S[0])==null?void 0:G.driveInstanceId)==="currentContent"&&(T=S[0].itemId);let B=q(({set:c})=>async m=>{c(se,I=>[...I,{atom:he,value:null},{atom:le,value:null}]);const{data:o}=await J.get("/api/loadTODO.php",{params:{courseId:m}});if(!o.success){a(o.message);return}o.assignments&&(l(o.assignments),g(o.pinned)),o.classTimes&&c(K,o.classTimes),o.completed&&i(o.completed)});const d=q(({set:c,snapshot:m})=>async o=>{const I=o.courseId,W=o.doenetId;let{canEditContent:Z}=await m.getPromise(be(I));if(Z==="1"){let ee=await m.getPromise(ie(W)),te=re(ee.content);b({page:"course",tool:"editor",view:"",params:{doenetId:W,pageId:te}})}else b({page:"course",tool:"assignment",view:"",params:{doenetId:W}})},[]);if(!h&&e!=="")return D(!0),B(e),null;if($!=="")return t("div",{children:t("h2",{children:$})});let y=new Date,O=1-y.getDay();O===1&&(O=-6);let C=new Date(y.getTime()+1e3*60*60*24*O+1e3*60*60*24*n*7),P=new Date(C.getTime()+1e3*60*60*24*6),x=`${C.getMonth()+1}/${C.getDate()}`,A=`${P.getMonth()+1}/${P.getDate()}`,M=[],V=[],Q=f("p",{children:[t(H,{icon:me})," Pinned"]});if(n==0&&(M.push(...N({rowLabel:Q,assignments:w,clickCallback:d,completedArray:s,setCompletedArray:i,classTimes:v,weekShift:n,selectedItemId:T,showCompleted:r})),p)){const c=new Date;let m=[];for(let o of u){const I=L(o.dueDate);if(!I||I>c)break;s.includes(o.doenetId)||m.push(o)}V.push(...N({rowLabel:"Overdue",assignments:m,clickCallback:d,completedArray:s,setCompletedArray:i,classTimes:v,weekShift:n,selectedItemId:T,showCompleted:r}))}let Y=[],z=new Date(C.getTime());z.setHours(0,0,0,0);let U=new Date(P.getTime());U.setHours(23,59,59,999);let F=[[],[],[],[],[],[],[]];for(let c=0;cU)break;let I=o.getDay();F[I].push({...m})}F.push(F.shift());const X=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];for(let[c,m]of Object.entries(F))Y.push(...N({dotw:X[c],assignments:m,clickCallback:d,completedArray:s,setCompletedArray:i,classTimes:v,weekShift:n,selectedItemId:T,showCompleted:r}));return f(de,{children:[f("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-evenly",width:"850px",height:"70px"},children:[f("span",{children:[t(_,{onClick:()=>k(0),value:"This Week"})," "]}),t("h1",{children:"Content by Week"}),f("span",{style:{fontSize:"1.4em"},children:[x," - ",A]}),f(fe,{children:[t("span",{children:t(_,{dataTest:"previous week button",onClick:()=>k(c=>c-1),icon:t(H,{icon:ce})})}),t("span",{children:t(_,{dataTest:"next week button",onClick:()=>k(c=>c+1),icon:t(H,{icon:ue})})})]})]}),f("table",{style:{width:"850px",borderSpacing:"0em .2em"},children:[f("tr",{children:[t("th",{style:{width:"100px",padding:"8px",textAlign:"left",borderBottom:"2px solid black"},children:"Day"}),t("th",{style:{width:"200px",padding:"8px",textAlign:"left",borderBottom:"2px solid black"},children:"Name"}),t("th",{style:{width:"200px",padding:"8px",textAlign:"left",borderBottom:"2px solid black"},children:"Assigned"}),t("th",{style:{width:"200px",padding:"8px",textAlign:"left",borderBottom:"2px solid black"},children:"Due"}),t("th",{style:{width:"50px",padding:"8px",textAlign:"left",borderBottom:"2px solid black"},children:"Score"}),t("th",{style:{width:"100px",padding:"8px",textAlign:"center",borderBottom:"2px solid black"},children:"Completed"})]}),M,V,Y]})]})}export{Ie as N,we as a,K as c,ye as s}; diff --git a/dist/assets/NotFound-9ccac229.js b/dist/assets/NotFound-bf4000be.js similarity index 76% rename from dist/assets/NotFound-9ccac229.js rename to dist/assets/NotFound-bf4000be.js index 23a28635bd..f79a73cf73 100644 --- a/dist/assets/NotFound-9ccac229.js +++ b/dist/assets/NotFound-bf4000be.js @@ -1 +1 @@ -import{u as s,j as n,a}from"./index-99a56692.js";function c(o){const e=s();let t=Object.fromEntries(new URLSearchParams(e.search));return n("div",{style:o.style,children:a("h1",{children:['Sorry! "',t==null?void 0:t.path,'" was not found.']})})}export{c as default}; +import{u as s,j as n,a}from"./index-7074710c.js";function c(o){const e=s();let t=Object.fromEntries(new URLSearchParams(e.search));return n("div",{style:o.style,children:a("h1",{children:['Sorry! "',t==null?void 0:t.path,'" was not found.']})})}export{c as default}; diff --git a/dist/assets/PageLink-f2d20c32.js b/dist/assets/PageLink-be7f079d.js similarity index 71% rename from dist/assets/PageLink-f2d20c32.js rename to dist/assets/PageLink-be7f079d.js index 82ffc679ea..a89f602da9 100644 --- a/dist/assets/PageLink-f2d20c32.js +++ b/dist/assets/PageLink-be7f079d.js @@ -1 +1 @@ -import{y as u,l as o,m as t,w as l,j as g,k as y,z as L}from"./index-99a56692.js";import{c as f}from"./index-fcf36459.js";import{A as I}from"./ActionButton-f612d279.js";import{v as k}from"./EditorViewerRecoil-41e59102.js";function w(){const s=u(),a=o(t("pageId")),n=o(t("doenetId")),i=o(l),d=o(k);async function r(){let c={doenetML:d,pageId:a,courseId:i,saveAsCid:!0};const{data:e}=await y.post("/api/saveDoenetML.php",c);if(!e.success){console.error(e.message),s(e.message,L.ERROR);return}let p=e.cid,m=``;f(m)}return g(I,{width:"menu",dataTest:"Copy Page Link",value:"Copy Page Link",onClick:r})}export{w as default}; +import{y as u,l as o,m as t,w as l,j as g,k as y,z as L}from"./index-7074710c.js";import{c as f}from"./index-fcf36459.js";import{A as I}from"./ActionButton-e5ea2a2f.js";import{v as k}from"./EditorViewerRecoil-fb47fc9d.js";function w(){const s=u(),a=o(t("pageId")),n=o(t("doenetId")),i=o(l),d=o(k);async function r(){let c={doenetML:d,pageId:a,courseId:i,saveAsCid:!0};const{data:e}=await y.post("/api/saveDoenetML.php",c);if(!e.success){console.error(e.message),s(e.message,L.ERROR);return}let p=e.cid,m=``;f(m)}return g(I,{width:"menu",dataTest:"Copy Page Link",value:"Copy Page Link",onClick:r})}export{w as default}; diff --git a/dist/assets/PageVariant-9b28b6e2.js b/dist/assets/PageVariant-897e2178.js similarity index 94% rename from dist/assets/PageVariant-9b28b6e2.js rename to dist/assets/PageVariant-897e2178.js index eedd3995b6..dfda9883b0 100644 --- a/dist/assets/PageVariant-9b28b6e2.js +++ b/dist/assets/PageVariant-897e2178.js @@ -1 +1 @@ -import{g as d,h as f,f as m,j as r,a as i}from"./index-99a56692.js";function p(u){const[c,o]=d(f),[n,v]=d(m);function s(){n.index!==c.index&&o(e=>{let a={...e};return a.index=Number.isFinite(Number(n.index))?Number(n.index):0,a})}let l=[];n.allPossibleVariants&&(l=n.allPossibleVariants);let x=l.map(function(e,a){return r("option",{value:a+1,children:e},a+1)}),b={...u.style};return i("div",{style:b,children:[i("div",{children:["Number of variants: ",l.length]}),r("div",{children:i("label",{children:["Select variant Index ",r("input",{"data-test":"Variant Index Input",type:"text",value:n.index,onKeyDown:e=>{e.key==="Enter"&&s()},onBlur:()=>s(),onChange:e=>{v(a=>{let t={...a};return t.index=e.target.value,t})}})]})}),r("div",{children:i("label",{children:["Select variant name",r("select",{"data-test":"Variant Name Input",style:{backgroundColor:"var(--canvas)",color:"var(--canvastext)",border:"var(--mainBorder)",borderRadius:"var(--mainBorderRadius)"},value:n.index,onChange:e=>{o(a=>{let t={...a};return t.index=e.target.value,t})},children:x})]})})]})}export{p as default}; +import{g as d,h as f,f as m,j as r,a as i}from"./index-7074710c.js";function p(u){const[c,o]=d(f),[n,v]=d(m);function s(){n.index!==c.index&&o(e=>{let a={...e};return a.index=Number.isFinite(Number(n.index))?Number(n.index):0,a})}let l=[];n.allPossibleVariants&&(l=n.allPossibleVariants);let x=l.map(function(e,a){return r("option",{value:a+1,children:e},a+1)}),b={...u.style};return i("div",{style:b,children:[i("div",{children:["Number of variants: ",l.length]}),r("div",{children:i("label",{children:["Select variant Index ",r("input",{"data-test":"Variant Index Input",type:"text",value:n.index,onKeyDown:e=>{e.key==="Enter"&&s()},onBlur:()=>s(),onChange:e=>{v(a=>{let t={...a};return t.index=e.target.value,t})}})]})}),r("div",{children:i("label",{children:["Select variant name",r("select",{"data-test":"Variant Name Input",style:{backgroundColor:"var(--canvas)",color:"var(--canvastext)",border:"var(--mainBorder)",borderRadius:"var(--mainBorderRadius)"},value:n.index,onChange:e=>{o(a=>{let t={...a};return t.index=e.target.value,t})},children:x})]})})]})}export{p as default}; diff --git a/dist/assets/People-969f3e38.js b/dist/assets/People-6d866472.js similarity index 87% rename from dist/assets/People-969f3e38.js rename to dist/assets/People-6d866472.js index 9db097b5f4..13c627db04 100644 --- a/dist/assets/People-969f3e38.js +++ b/dist/assets/People-6d866472.js @@ -1,4 +1,4 @@ -import{l as R,m as F,a5 as J,a6 as X,r as w,g as G,a as h,j as e,B as P,A as q,s as f}from"./index-99a56692.js";import{A as K}from"./SettingComponents-ce5fbb6e.js";import{M as L}from"./index.esm-b3e258be.js";import{R as E}from"./RoleDropdown-5e05ae49.js";import{processAtom as Q,headersAtom as Y,entriesAtom as Z,csvPeopleProcess as W,validHeaders as m}from"./LoadPeople-f0cdb3f5.js";import{B as C}from"./ButtonGroup-ea123297.js";import"./CourseToolHandler-f517d0e5.js";import"./index-ef9c2520.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";/* empty css */import"./CollapseSection-a6fcd8bf.js";import"./util-38d8e238.js";import"./DateTime-ef0be144.js";import"./moment-f5bb98f1.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";import"./RelatedItems-96588168.js";import"./Textfield-5d92f495.js";import"./index-2e9c8a8a.js";const N=f.div` +import{l as R,m as F,a5 as J,a6 as X,r as w,g as G,a as h,j as e,B as P,A as q,s as f}from"./index-7074710c.js";import{A as K}from"./SettingComponents-43f86399.js";import{M as L}from"./index.esm-5b62de19.js";import{R as E}from"./RoleDropdown-cce90708.js";import{processAtom as Q,headersAtom as Y,entriesAtom as Z,csvPeopleProcess as W,validHeaders as m}from"./LoadPeople-0fec718e.js";import{B as C}from"./ButtonGroup-9136da6d.js";import"./CourseToolHandler-8716455d.js";import"./index-67ec2c85.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";/* empty css */import"./CollapseSection-cb27678a.js";import"./util-38d8e238.js";import"./DateTime-d0a20943.js";import"./moment-3cda1086.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";import"./RelatedItems-33b68fba.js";import"./Textfield-9c1c2968.js";import"./index-a475a6f9.js";const N=f.div` margin: 0 5px 10px 5px; display: ${t=>t.flex?"flex":"block"}; align-items: ${t=>t.flex&&"center"}; diff --git a/dist/assets/PeopleBreadCrumb-1e5fc3de.js b/dist/assets/PeopleBreadCrumb-1e5fc3de.js new file mode 100644 index 0000000000..a956bf07b9 --- /dev/null +++ b/dist/assets/PeopleBreadCrumb-1e5fc3de.js @@ -0,0 +1 @@ +import{l as m,m as u,j as r,r as t}from"./index-7074710c.js";import{B as c}from"./BreadCrumb-c4dbe368.js";import{u as i,a as d,c as p}from"./breadcrumbUtil-1e7f0dfb.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-06d28967.js";function B(){const o=m(u("courseId")),s=i(),e=d(o),a=p(o);return r(t.Suspense,{fallback:r("div",{children:"loading Breadcrumbs..."}),children:r(c,{crumbs:[s,e,a]})})}export{B as default}; diff --git a/dist/assets/PeopleBreadCrumb-20144419.js b/dist/assets/PeopleBreadCrumb-20144419.js deleted file mode 100644 index 0b18c211c5..0000000000 --- a/dist/assets/PeopleBreadCrumb-20144419.js +++ /dev/null @@ -1 +0,0 @@ -import{l as m,m as u,j as r,r as t}from"./index-99a56692.js";import{B as c}from"./BreadCrumb-c66b383a.js";import{u as i,a as d,c as p}from"./breadcrumbUtil-6dfe85b1.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";import"./Gradebook-e81ca638.js";function B(){const o=m(u("courseId")),s=i(),e=d(o),a=p(o);return r(t.Suspense,{fallback:r("div",{children:"loading Breadcrumbs..."}),children:r(c,{crumbs:[s,e,a]})})}export{B as default}; diff --git a/dist/assets/PortfolioBreadCrumb-3fd96794.js b/dist/assets/PortfolioBreadCrumb-22e300a9.js similarity index 68% rename from dist/assets/PortfolioBreadCrumb-3fd96794.js rename to dist/assets/PortfolioBreadCrumb-22e300a9.js index 5f4c51c0ef..0093878ef7 100644 --- a/dist/assets/PortfolioBreadCrumb-3fd96794.js +++ b/dist/assets/PortfolioBreadCrumb-22e300a9.js @@ -1 +1 @@ -import{e as s,a4 as l,j as a,r as i}from"./index-99a56692.js";import{B as n}from"./BreadCrumb-c66b383a.js";function u(){const o=s();let e=l();const{label:r,courseId:t}=e;return a(i.Suspense,{fallback:a("div",{children:"Loading Breadcrumb..."}),children:a(n,{crumbs:[{label:"Portfolio",onClick:()=>{o(`/portfolio/${t}`)}},{label:r,onClick:()=>{console.log("Rename?")}}],offset:68})})}export{u as default}; +import{e as s,a4 as l,j as a,r as i}from"./index-7074710c.js";import{B as n}from"./BreadCrumb-c4dbe368.js";function u(){const o=s();let e=l();const{label:r,courseId:t}=e;return a(i.Suspense,{fallback:a("div",{children:"Loading Breadcrumb..."}),children:a(n,{crumbs:[{label:"Portfolio",onClick:()=>{o(`/portfolio/${t}`)}},{label:r,onClick:()=>{console.log("Rename?")}}],offset:68})})}export{u as default}; diff --git a/dist/assets/PublicActivityViewer-9764fa71.js b/dist/assets/PublicActivityViewer-c966c5e8.js similarity index 71% rename from dist/assets/PublicActivityViewer-9764fa71.js rename to dist/assets/PublicActivityViewer-c966c5e8.js index 4808e4b530..c52ceb974b 100644 --- a/dist/assets/PublicActivityViewer-9764fa71.js +++ b/dist/assets/PublicActivityViewer-c966c5e8.js @@ -1 +1 @@ -import{l as c,m as u,r as s,j as l,F as d,k as m}from"./index-99a56692.js";import{A as p}from"./ActivityViewer-3a815948.js";import"./activityUtils-c08c1686.js";import"./visibility-sensor-55e75ed1.js";import"./ActionButton-f612d279.js";import"./ButtonGroup-ea123297.js";function E(f){const e=c(u("doenetId")),[i,r]=s.useState(null),[o,a]=s.useState(null);return s.useEffect(()=>{const n=document.title;return(async()=>{let t=await m.get("/api/getCidForAssignment.php",{params:{doenetId:e,latestAttemptOverrides:!1,publicOnly:!0}});!t.data.success||!t.data.cid?(r(null),t.data.cid?a(`Error loading activity: ${t.data.message}`):a("Error loading activity: public content not found")):(r(t.data.cid),a(null),document.title=`${t.data.label} - Doenet`)})().catch(console.error),()=>{document.title=n}},e),o?l("h1",{children:o}):i?l(d,{children:l(p,{cid:i,doenetId:e,flags:{showCorrectness:!0,readOnly:!1,solutionDisplayMode:"button",showFeedback:!0,showHints:!0,autoSubmit:!1,allowLoadState:!1,allowSaveState:!1,allowLocalState:!1,allowSaveSubmissions:!1,allowSaveEvents:!1},paginate:!0},`activityViewer${e}`)}):null}export{E as default}; +import{l as c,m as u,r as s,j as l,F as d,k as m}from"./index-7074710c.js";import{A as p}from"./ActivityViewer-becda8c0.js";import"./activityUtils-9c5f1536.js";import"./visibility-sensor-7d414852.js";import"./ActionButton-e5ea2a2f.js";import"./ButtonGroup-9136da6d.js";function E(f){const e=c(u("doenetId")),[i,r]=s.useState(null),[o,a]=s.useState(null);return s.useEffect(()=>{const n=document.title;return(async()=>{let t=await m.get("/api/getCidForAssignment.php",{params:{doenetId:e,latestAttemptOverrides:!1,publicOnly:!0}});!t.data.success||!t.data.cid?(r(null),t.data.cid?a(`Error loading activity: ${t.data.message}`):a("Error loading activity: public content not found")):(r(t.data.cid),a(null),document.title=`${t.data.label} - Doenet`)})().catch(console.error),()=>{document.title=n}},e),o?l("h1",{children:o}):i?l(d,{children:l(p,{cid:i,doenetId:e,flags:{showCorrectness:!0,readOnly:!1,solutionDisplayMode:"button",showFeedback:!0,showHints:!0,autoSubmit:!1,allowLoadState:!1,allowSaveState:!1,allowLocalState:!1,allowSaveSubmissions:!1,allowSaveEvents:!1},paginate:!0},`activityViewer${e}`)}):null}export{E as default}; diff --git a/dist/assets/PublicEditorInfoCap-5cd41e47.js b/dist/assets/PublicEditorInfoCap-5cd41e47.js new file mode 100644 index 0000000000..b8e86fb9c9 --- /dev/null +++ b/dist/assets/PublicEditorInfoCap-5cd41e47.js @@ -0,0 +1 @@ +import{a4 as i,a as o,F as n,j as e,bc as d,bd as r}from"./index-7074710c.js";async function h({params:t}){const a=t.doenetId;return(await(await fetch(`/api/getPortfolioActivityData.php?doenetId=${a}`)).json()).activityData}function g(){let{activityData:t}=i(),a="/activity_default.jpg";return(t==null?void 0:t.imagePath)!=null&&(a=t==null?void 0:t.imagePath),o(n,{children:[e(d,{height:"130px",width:"100%",background:"black",overflow:"hidden",margin:"auto",children:e(r,{width:"100%",height:"100%",objectFit:"contain",src:a,alt:"Activity Image"})}),e("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:"Public Activity Editor"})]})}export{g as default,h as loader}; diff --git a/dist/assets/PublicNavigation-5bcc5aa1.js b/dist/assets/PublicNavigation-5bcc5aa1.js new file mode 100644 index 0000000000..eb728f7ade --- /dev/null +++ b/dist/assets/PublicNavigation-5bcc5aa1.js @@ -0,0 +1 @@ +import{e as l,a4 as s,j as a,r as t,a as r,B as e,F as u}from"./index-7074710c.js";function d(){const o=l(),{signedIn:i,portfolioCourseId:n}=s();return a(t.Suspense,{fallback:a("div",{children:"loading Breadcrumbs..."}),children:r("div",{style:{display:"flex",columnGap:"4px",marginRight:"16px"},children:[a(e,{value:"Home",onClick:()=>{o("/")}}),a(e,{value:"Community",onClick:()=>{o("/community")}}),i?a(u,{children:a(e,{value:"Portfolio",onClick:()=>{o(`/portfolio/${n}`)}})}):null]})})}export{d as default}; diff --git a/dist/assets/RelatedItems-96588168.js b/dist/assets/RelatedItems-33b68fba.js similarity index 96% rename from dist/assets/RelatedItems-96588168.js rename to dist/assets/RelatedItems-33b68fba.js index be47ca34de..cdfca388f3 100644 --- a/dist/assets/RelatedItems-96588168.js +++ b/dist/assets/RelatedItems-33b68fba.js @@ -1,4 +1,4 @@ -import{a as g,j as d,s as a}from"./index-99a56692.js";const x=a.div` +import{a as g,j as d,s as a}from"./index-7074710c.js";const x=a.div` display: ${e=>e.align}; width: auto; align-items: center; diff --git a/dist/assets/RoleDropdown-5e05ae49.js b/dist/assets/RoleDropdown-cce90708.js similarity index 83% rename from dist/assets/RoleDropdown-5e05ae49.js rename to dist/assets/RoleDropdown-cce90708.js index b177577238..3188572259 100644 --- a/dist/assets/RoleDropdown-5e05ae49.js +++ b/dist/assets/RoleDropdown-cce90708.js @@ -1 +1 @@ -import{ay as x,az as y,aF as R,I as p,l as t,m as _,aG as v,j as B}from"./index-99a56692.js";import{D as C}from"./DropdownMenu-9b4c45a6.js";const D=x({key:"effectiveRoleId",default:null}),j=y({key:"effectivePermissions",get:e=>({get:s})=>{const n=s(D(e));return s(n!==null?R({courseId:e,roleId:n}):p(e))}});function k({label:e,width:s="menu",maxMenuHeight:n="200px",defaultRoleId:a,valueRoleId:i,onChange:d=()=>{},vertical:l,disabled:u}){const c=t(_("courseId"))??"",r=t(v(c)),f=i?r.findIndex(({roleId:o})=>o===i):null,m=a?r.findIndex(({roleId:o})=>o===a):null;return B(C,{width:s,maxMenuHeight:n,items:r.map(({roleLabel:o,roleId:I})=>[I,o]),label:e,defaultIndex:m+1,valueIndex:f+1,onChange:d,vertical:l,disabled:u,dataTest:"RoleDropDown"})}export{k as R,D as a,j as e}; +import{ay as x,az as y,aF as R,I as p,l as t,m as _,aG as v,j as B}from"./index-7074710c.js";import{D as C}from"./DropdownMenu-f3593bed.js";const D=x({key:"effectiveRoleId",default:null}),j=y({key:"effectivePermissions",get:e=>({get:s})=>{const n=s(D(e));return s(n!==null?R({courseId:e,roleId:n}):p(e))}});function k({label:e,width:s="menu",maxMenuHeight:n="200px",defaultRoleId:a,valueRoleId:i,onChange:d=()=>{},vertical:l,disabled:u}){const c=t(_("courseId"))??"",r=t(v(c)),f=i?r.findIndex(({roleId:o})=>o===i):null,m=a?r.findIndex(({roleId:o})=>o===a):null;return B(C,{width:s,maxMenuHeight:n,items:r.map(({roleLabel:o,roleId:I})=>[I,o]),label:e,defaultIndex:m+1,valueIndex:f+1,onChange:d,vertical:l,disabled:u,dataTest:"RoleDropDown"})}export{k as R,D as a,j as e}; diff --git a/dist/assets/RoleEditor-05e83640.js b/dist/assets/RoleEditor-05e83640.js new file mode 100644 index 0000000000..dcb4f327b4 --- /dev/null +++ b/dist/assets/RoleEditor-05e83640.js @@ -0,0 +1,3 @@ +import{l as r,m as t,I as m,a as e,j as i,s as p}from"./index-7074710c.js";import{a as n,M as a}from"./SettingComponents-43f86399.js";import"./CourseToolHandler-8716455d.js";import"./index-67ec2c85.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-5b62de19.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-9136da6d.js";import"./CollapseSection-cb27678a.js";import"./util-38d8e238.js";import"./DateTime-d0a20943.js";import"./moment-3cda1086.js";import"./DropdownMenu-f3593bed.js";import"./RelatedItems-33b68fba.js";import"./RoleDropdown-cce90708.js";import"./Textfield-9c1c2968.js";const d=p.div` + padding: 10px; +`;function B(){const o=r(t("courseId")),{isAdmin:s}=r(m(o));return s!=="1"?null:e(d,{children:[i("h2",{children:"Edit Role Permissions"}),i(n,{courseId:o}),i(a,{courseId:o})]})}export{B as default}; diff --git a/dist/assets/RoleEditor-9df6b9b1.js b/dist/assets/RoleEditor-9df6b9b1.js deleted file mode 100644 index 905eeb3db1..0000000000 --- a/dist/assets/RoleEditor-9df6b9b1.js +++ /dev/null @@ -1,3 +0,0 @@ -import{l as r,m as t,I as m,a as e,j as i,s as p}from"./index-99a56692.js";import{a as n,M as a}from"./SettingComponents-ce5fbb6e.js";import"./CourseToolHandler-f517d0e5.js";import"./index-ef9c2520.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-b3e258be.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-ea123297.js";import"./CollapseSection-a6fcd8bf.js";import"./util-38d8e238.js";import"./DateTime-ef0be144.js";import"./moment-f5bb98f1.js";import"./DropdownMenu-9b4c45a6.js";import"./RelatedItems-96588168.js";import"./RoleDropdown-5e05ae49.js";import"./Textfield-5d92f495.js";const d=p.div` - padding: 10px; -`;function B(){const o=r(t("courseId")),{isAdmin:s}=r(m(o));return s!=="1"?null:e(d,{children:[i("h2",{children:"Edit Role Permissions"}),i(n,{courseId:o}),i(a,{courseId:o})]})}export{B as default}; diff --git a/dist/assets/SelectedActivity-e75f87c1.js b/dist/assets/SelectedActivity-979809e9.js similarity index 84% rename from dist/assets/SelectedActivity-e75f87c1.js rename to dist/assets/SelectedActivity-979809e9.js index fa86568fdd..fe6bd30038 100644 --- a/dist/assets/SelectedActivity-e75f87c1.js +++ b/dist/assets/SelectedActivity-979809e9.js @@ -1 +1 @@ -import{l as u,m as k,T as I,R as D,p as S,G as L,a6 as x,r as b,y as F,H as V,a as s,F as h,j as e,z as B,B as f,i as O,X as R,ag as E}from"./index-99a56692.js";import{A as G,u as M,a as _,b as j,D as X,T as J,c as N,d as z,e as H,G as U,I as q,f as K,S as W,g as Q,h as Y,i as Z,j as $,k as ee,P as te,l as ie,m as ae,n as se,M as ne,o as oe,C as le,p as re}from"./SettingComponents-67fac933.js";import{A as g}from"./ActionButton-f612d279.js";import{A as de}from"./ActionButtonGroup-a395ceaf.js";import{B as ce}from"./ButtonGroup-ea123297.js";import{e as P}from"./RoleDropdown-5e05ae49.js";import{T as me}from"./Textfield-5d92f495.js";import"./DateTime-ef0be144.js";import"./moment-f5bb98f1.js";import"./IncrementMenu-aee46d2a.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";import"./RelatedItems-96588168.js";import"./useSaveDraft-a42d0f94.js";import"./EditorViewerRecoil-41e59102.js";function Ie(){const o=u(k("courseId")),i=u(I)[0],r=D(S),{canEditContent:w}=u(P(o)),{label:n,content:p}=u(L(i)),{renameItem:A,create:d,compileActivity:y,deleteItem:t}=x(o),[l,c]=b.useState(n),v=F();b.useEffect(()=>{c(n)},[n]);const m=()=>{let a=l;l===""&&(a=n,n===""&&(a="Untitled"),c(a)),n!==a&&A(i,a)};if(i==null)return null;let T=V(p),C=s("h2",{"data-test":"infoPanelItemLabel",style:{margin:"16px 5px"},children:[e(O,{icon:R})," ",n]});return w==="1"?s(h,{children:[C,s(de,{vertical:!0,children:[e(g,{width:"menu",value:"Edit Activity",dataTest:"Edit Activity",onClick:()=>{T==null?v("ERROR: No page found in activity",B.INFO):r(a=>({page:"course",tool:"editor",view:a.view,params:{doenetId:i,pageId:T}}))}}),e(g,{width:"menu",value:"View Draft Activity",dataTest:"View Draft Activity",onClick:()=>{y({activityDoenetId:i,courseId:o,successCallback:()=>{r({page:"course",tool:"draftactivity",view:"",params:{doenetId:i,requestedVariant:1}})}})}}),e(g,{width:"menu",value:"View Assigned Activity",dataTest:"View Assigned Activity",onClick:()=>{r({page:"course",tool:"assignment",view:"",params:{doenetId:i}})}})]}),e("br",{}),e(G,{doenetId:i,courseId:o}),e(me,{label:"Label",dataTest:"Label Activity",vertical:!0,width:"menu",value:l,onChange:a=>c(a.target.value),onKeyDown:a=>{a.keyCode===13&&m()},onBlur:m}),e("br",{}),s(ce,{vertical:!0,children:[e(f,{width:"menu",onClick:()=>d({itemType:"page"}),value:"Add Page",dataTest:"Add Page"}),e(f,{width:"menu",onClick:()=>d({itemType:"order"}),value:"Add Order",dataTest:"Add Order"}),e(f,{width:"menu",onClick:()=>d({itemType:"collectionLink"}),dataTest:"Add Collection Link",value:"Add Collection Link"})]}),e("br",{}),e(ue,{doenetId:i,courseId:o}),e(f,{width:"menu",value:"Delete Activity",dataTest:"Delete Activity",alert:!0,onClick:a=>{a.preventDefault(),a.stopPropagation(),t({doenetId:i})}})]}):s(h,{children:[C,e(g,{width:"menu",dataTest:"View Activity",value:"View Activity",onClick:()=>{r({page:"course",tool:"assignment",view:"",params:{doenetId:i}})}})]})}E({key:"temporaryRestrictToAtom",default:[]});function ue({doenetId:o,courseId:i}){const{canModifyActivitySettings:r,canViewActivitySettings:w}=u(P(i)),{value:{numberOfAttemptsAllowed:n,timeLimit:p,assignedDate:A,dueDate:d,totalPointsOrPercent:y}}=M(i,o);D(S);const t={courseId:i,doenetId:o,editable:r??"0"};if(w==="1")return s(h,{children:[e(_,{...t}),e("br",{}),e(j,{...t}),e(X,{...t}),e(J,{...t}),e(N,{...t}),e(z,{...t}),e(H,{...t}),e(U,{...t}),e(q,{...t}),s("div",{style:{margin:"16px 0"},children:[e(K,{...t}),e(W,{...t}),e(Q,{...t}),e(Y,{...t}),e(Z,{...t}),e($,{...t}),e(ee,{...t}),e(te,{...t}),e(ie,{...t}),e(ae,{...t}),e(se,{...t}),e(ne,{...t}),e(oe,{...t}),e(le,{...t})]}),e(re,{...t})]});let l=n;l===null&&(l="unlimited");let c=null;p!==null&&(c=s("p",{children:["Time Limit: ",p," minutes"]}));let v=null;A!==null&&(v=s("p",{children:["Assigned: ",A]}));let m=e("p",{children:"No Due Date"});return d!==null&&(m=s("p",{children:["Due: ",d]})),e(h,{children:s("div",{children:[v,m,c,s("p",{children:["Attempts Allowed: ",l]}),s("p",{children:["Points: ",y]})]})})}export{ue as AssignmentSettings,Ie as default}; +import{l as u,m as k,T as I,R as D,p as S,G as L,a6 as x,r as b,y as F,H as V,a as s,F as h,j as e,z as B,B as f,i as O,X as R,ag as E}from"./index-7074710c.js";import{A as G,u as M,a as _,b as j,D as X,T as J,c as N,d as z,e as H,G as U,I as q,f as K,S as W,g as Q,h as Y,i as Z,j as $,k as ee,P as te,l as ie,m as ae,n as se,M as ne,o as oe,C as le,p as re}from"./SettingComponents-3306743d.js";import{A as g}from"./ActionButton-e5ea2a2f.js";import{A as de}from"./ActionButtonGroup-f4ce05e4.js";import{B as ce}from"./ButtonGroup-9136da6d.js";import{e as P}from"./RoleDropdown-cce90708.js";import{T as me}from"./Textfield-9c1c2968.js";import"./DateTime-d0a20943.js";import"./moment-3cda1086.js";import"./IncrementMenu-2cdf9a4e.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";import"./RelatedItems-33b68fba.js";import"./useSaveDraft-5f9f3fe4.js";import"./EditorViewerRecoil-fb47fc9d.js";function Ie(){const o=u(k("courseId")),i=u(I)[0],r=D(S),{canEditContent:w}=u(P(o)),{label:n,content:p}=u(L(i)),{renameItem:A,create:d,compileActivity:y,deleteItem:t}=x(o),[l,c]=b.useState(n),v=F();b.useEffect(()=>{c(n)},[n]);const m=()=>{let a=l;l===""&&(a=n,n===""&&(a="Untitled"),c(a)),n!==a&&A(i,a)};if(i==null)return null;let T=V(p),C=s("h2",{"data-test":"infoPanelItemLabel",style:{margin:"16px 5px"},children:[e(O,{icon:R})," ",n]});return w==="1"?s(h,{children:[C,s(de,{vertical:!0,children:[e(g,{width:"menu",value:"Edit Activity",dataTest:"Edit Activity",onClick:()=>{T==null?v("ERROR: No page found in activity",B.INFO):r(a=>({page:"course",tool:"editor",view:a.view,params:{doenetId:i,pageId:T}}))}}),e(g,{width:"menu",value:"View Draft Activity",dataTest:"View Draft Activity",onClick:()=>{y({activityDoenetId:i,courseId:o,successCallback:()=>{r({page:"course",tool:"draftactivity",view:"",params:{doenetId:i,requestedVariant:1}})}})}}),e(g,{width:"menu",value:"View Assigned Activity",dataTest:"View Assigned Activity",onClick:()=>{r({page:"course",tool:"assignment",view:"",params:{doenetId:i}})}})]}),e("br",{}),e(G,{doenetId:i,courseId:o}),e(me,{label:"Label",dataTest:"Label Activity",vertical:!0,width:"menu",value:l,onChange:a=>c(a.target.value),onKeyDown:a=>{a.keyCode===13&&m()},onBlur:m}),e("br",{}),s(ce,{vertical:!0,children:[e(f,{width:"menu",onClick:()=>d({itemType:"page"}),value:"Add Page",dataTest:"Add Page"}),e(f,{width:"menu",onClick:()=>d({itemType:"order"}),value:"Add Order",dataTest:"Add Order"}),e(f,{width:"menu",onClick:()=>d({itemType:"collectionLink"}),dataTest:"Add Collection Link",value:"Add Collection Link"})]}),e("br",{}),e(ue,{doenetId:i,courseId:o}),e(f,{width:"menu",value:"Delete Activity",dataTest:"Delete Activity",alert:!0,onClick:a=>{a.preventDefault(),a.stopPropagation(),t({doenetId:i})}})]}):s(h,{children:[C,e(g,{width:"menu",dataTest:"View Activity",value:"View Activity",onClick:()=>{r({page:"course",tool:"assignment",view:"",params:{doenetId:i}})}})]})}E({key:"temporaryRestrictToAtom",default:[]});function ue({doenetId:o,courseId:i}){const{canModifyActivitySettings:r,canViewActivitySettings:w}=u(P(i)),{value:{numberOfAttemptsAllowed:n,timeLimit:p,assignedDate:A,dueDate:d,totalPointsOrPercent:y}}=M(i,o);D(S);const t={courseId:i,doenetId:o,editable:r??"0"};if(w==="1")return s(h,{children:[e(_,{...t}),e("br",{}),e(j,{...t}),e(X,{...t}),e(J,{...t}),e(N,{...t}),e(z,{...t}),e(H,{...t}),e(U,{...t}),e(q,{...t}),s("div",{style:{margin:"16px 0"},children:[e(K,{...t}),e(W,{...t}),e(Q,{...t}),e(Y,{...t}),e(Z,{...t}),e($,{...t}),e(ee,{...t}),e(te,{...t}),e(ie,{...t}),e(ae,{...t}),e(se,{...t}),e(ne,{...t}),e(oe,{...t}),e(le,{...t})]}),e(re,{...t})]});let l=n;l===null&&(l="unlimited");let c=null;p!==null&&(c=s("p",{children:["Time Limit: ",p," minutes"]}));let v=null;A!==null&&(v=s("p",{children:["Assigned: ",A]}));let m=e("p",{children:"No Due Date"});return d!==null&&(m=s("p",{children:["Due: ",d]})),e(h,{children:s("div",{children:[v,m,c,s("p",{children:["Attempts Allowed: ",l]}),s("p",{children:["Points: ",y]})]})})}export{ue as AssignmentSettings,Ie as default}; diff --git a/dist/assets/SelectedBank-72801e7b.js b/dist/assets/SelectedBank-3ffbe0e5.js similarity index 78% rename from dist/assets/SelectedBank-72801e7b.js rename to dist/assets/SelectedBank-3ffbe0e5.js index be9cd1fcce..66096429f4 100644 --- a/dist/assets/SelectedBank-72801e7b.js +++ b/dist/assets/SelectedBank-3ffbe0e5.js @@ -1 +1 @@ -import{l as o,m as x,T as C,G as g,a6 as c,r as d,y as v,a as m,F as y,j as a,B as u,i as T,Z as B}from"./index-99a56692.js";import{e as L}from"./RoleDropdown-5e05ae49.js";import{T as F}from"./Textfield-5d92f495.js";import{B as P}from"./ButtonGroup-ea123297.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";function G(){const l=o(x("courseId")),n=o(C)[0],{canEditContent:f}=o(L(l)),{label:t}=o(g(n)),{renameItem:p}=c(l),[s,r]=d.useState(t);let{create:I,deleteItem:b}=c(l);d.useEffect(()=>{r(t)},[t]);const i=()=>{let e=s;s===""&&(e=t,t===""&&(e="Untitled"),r(e)),t!==e&&p(n,e)};v();let h=m("h2",{"data-test":"infoPanelItemLabel",style:{margin:"16px 5px"},children:[a(T,{icon:B})," ",t]});return f==="1"?m(y,{children:[h,a(F,{label:"Label",vertical:!0,width:"menu",value:s,onChange:e=>r(e.target.value),onKeyDown:e=>{e.keyCode===13&&i()},onBlur:i}),a("br",{}),a(P,{vertical:!0,children:a(u,{width:"menu",onClick:()=>I({itemType:"page"}),value:"Add Page",dataTest:"Add Page"})}),a("br",{}),a(u,{width:"menu",value:"Delete Collection",dataTest:"Delete Collection",alert:!0,onClick:e=>{e.preventDefault(),e.stopPropagation(),b({doenetId:n})}})]}):null}export{G as default}; +import{l as o,m as x,T as C,G as g,a6 as c,r as d,y as v,a as m,F as y,j as a,B as u,i as T,Z as B}from"./index-7074710c.js";import{e as L}from"./RoleDropdown-cce90708.js";import{T as F}from"./Textfield-9c1c2968.js";import{B as P}from"./ButtonGroup-9136da6d.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";function G(){const l=o(x("courseId")),n=o(C)[0],{canEditContent:f}=o(L(l)),{label:t}=o(g(n)),{renameItem:p}=c(l),[s,r]=d.useState(t);let{create:I,deleteItem:b}=c(l);d.useEffect(()=>{r(t)},[t]);const i=()=>{let e=s;s===""&&(e=t,t===""&&(e="Untitled"),r(e)),t!==e&&p(n,e)};v();let h=m("h2",{"data-test":"infoPanelItemLabel",style:{margin:"16px 5px"},children:[a(T,{icon:B})," ",t]});return f==="1"?m(y,{children:[h,a(F,{label:"Label",vertical:!0,width:"menu",value:s,onChange:e=>r(e.target.value),onKeyDown:e=>{e.keyCode===13&&i()},onBlur:i}),a("br",{}),a(P,{vertical:!0,children:a(u,{width:"menu",onClick:()=>I({itemType:"page"}),value:"Add Page",dataTest:"Add Page"})}),a("br",{}),a(u,{width:"menu",value:"Delete Collection",dataTest:"Delete Collection",alert:!0,onClick:e=>{e.preventDefault(),e.stopPropagation(),b({doenetId:n})}})]}):null}export{G as default}; diff --git a/dist/assets/SelectedCollectionLink-1600e763.js b/dist/assets/SelectedCollectionLink-f07c6b63.js similarity index 83% rename from dist/assets/SelectedCollectionLink-1600e763.js rename to dist/assets/SelectedCollectionLink-f07c6b63.js index 288a6d0dc9..2c5d5cf5cc 100644 --- a/dist/assets/SelectedCollectionLink-1600e763.js +++ b/dist/assets/SelectedCollectionLink-f07c6b63.js @@ -1 +1 @@ -import{l as r,T as L,G as C,m as k,r as y,a6 as x,y as M,a as m,j as t,i as S,$ as O,F as f,A,B as I,bj as B}from"./index-99a56692.js";import"./ActionButton-f612d279.js";import{T}from"./Textfield-5d92f495.js";import{R as h}from"./RelatedItems-96588168.js";import{e as j}from"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";function w({courseId:n,selectedDoenetId:e}){let o=r(B(n)),i=[];for(let[s,a]of o.entries())e==a.doenetId?i.push(t("option",{selected:!0,value:a.doenetId,children:a.label},`CollectionOptions${s}`)):i.push(t("option",{value:a.doenetId,children:a.label},`CollectionOptions${s}`));return t(f,{children:i})}function R({selected:n,i:e,pageId:o}){let i=r(C(o));return n?t("option",{selected:!0,value:o,children:i.label},`PagesInACollection${e}`):t("option",{value:o,children:i.label},`PagesInACollection${e}`)}function K(){const n=r(L)[0],e=r(C(n)),o=r(k("courseId")),{canEditContent:i}=r(j(o)),[s,a]=y.useState(e.label);let{deleteItem:F,updateCollectionLink:c,updateContentLinksToSources:v}=x(o);y.useEffect(()=>{s!==e.label&&a(e.label)},[n]);const b=()=>{let l=s;s===""&&(l=e.label,e.label===""&&(l="Untitled Collection Link"),a(l)),e.label!==l&&(console.log("Rename",n,l),c({courseId:o,doenetId:n,label:l,collectionDoenetId:e.collectionDoenetId,isManuallyFiltered:e.isManuallyFiltered,manuallyFilteredPages:e.manuallyFilteredPages}))};M();let P=m("h2",{"data-test":"infoPanelItemLabel",style:{margin:"16px 5px"},children:[t(S,{icon:O})," ",e.label]});if(i!=="1")return null;let D=t(w,{courseId:o,selectedDoenetId:e.collectionDoenetId}),g=null;if(e.collectionDoenetId){let l=[];for(let[p,d]of Object.entries(e.pagesByCollectionSource[e.collectionDoenetId])){let u=!1;e!=null&&e.manuallyFilteredPages&&e.manuallyFilteredPages.includes(d)&&(u=!0),l.push(t(R,{selected:u,i:p,pageId:d}))}g=m(f,{children:[m("div",{style:{display:"flex"},children:[t(A,{style:{marginRight:"5px"},checked:e.isManuallyFiltered,onClick:()=>{c({courseId:o,doenetId:n,collectionDoenetId:e.collectionDoenetId,isManuallyFiltered:!e.isManuallyFiltered,manuallyFilteredPages:e.manuallyFilteredPages})}}),"Filter Page Links"]}),t(h,{width:"menu",options:l,disabled:!e.isManuallyFiltered,onChange:p=>{let d=Array.from(p.target.selectedOptions,u=>u.value);c({courseId:o,doenetId:n,collectionDoenetId:e.collectionDoenetId,isManuallyFiltered:e.isManuallyFiltered,manuallyFilteredPages:d})},multiple:!0}),t("br",{})]})}return m(f,{children:[P,t(T,{label:"Label",vertical:!0,width:"menu",dataTest:"Label Collection",value:s,onChange:l=>a(l.target.value),onKeyDown:l=>{l.keyCode===13&&b()},onBlur:b}),t("br",{}),t("br",{}),t("div",{children:"collection"}),t(h,{width:"menu",options:D,onChange:l=>{c({courseId:o,doenetId:n,collectionDoenetId:l.target.value,isManuallyFiltered:!1,manuallyFilteredPages:[]})}}),t("br",{}),g,t("br",{}),t(I,{width:"menu",value:"Update Content to Sources",onClick:l=>{l.preventDefault(),l.stopPropagation(),v({collectionLinkObj:e,pages:e.pages})}}),t("br",{}),t(I,{width:"menu",value:"Delete Collection Link",alert:!0,onClick:l=>{l.preventDefault(),l.stopPropagation(),F({doenetId:n})}})]})}export{K as default}; +import{l as r,T as L,G as C,m as k,r as y,a6 as x,y as M,a as m,j as t,i as S,$ as O,F as f,A,B as I,bl as B}from"./index-7074710c.js";import"./ActionButton-e5ea2a2f.js";import{T}from"./Textfield-9c1c2968.js";import{R as h}from"./RelatedItems-33b68fba.js";import{e as w}from"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";function j({courseId:n,selectedDoenetId:e}){let o=r(B(n)),i=[];for(let[s,a]of o.entries())e==a.doenetId?i.push(t("option",{selected:!0,value:a.doenetId,children:a.label},`CollectionOptions${s}`)):i.push(t("option",{value:a.doenetId,children:a.label},`CollectionOptions${s}`));return t(f,{children:i})}function R({selected:n,i:e,pageId:o}){let i=r(C(o));return n?t("option",{selected:!0,value:o,children:i.label},`PagesInACollection${e}`):t("option",{value:o,children:i.label},`PagesInACollection${e}`)}function K(){const n=r(L)[0],e=r(C(n)),o=r(k("courseId")),{canEditContent:i}=r(w(o)),[s,a]=y.useState(e.label);let{deleteItem:F,updateCollectionLink:c,updateContentLinksToSources:v}=x(o);y.useEffect(()=>{s!==e.label&&a(e.label)},[n]);const b=()=>{let l=s;s===""&&(l=e.label,e.label===""&&(l="Untitled Collection Link"),a(l)),e.label!==l&&(console.log("Rename",n,l),c({courseId:o,doenetId:n,label:l,collectionDoenetId:e.collectionDoenetId,isManuallyFiltered:e.isManuallyFiltered,manuallyFilteredPages:e.manuallyFilteredPages}))};M();let P=m("h2",{"data-test":"infoPanelItemLabel",style:{margin:"16px 5px"},children:[t(S,{icon:O})," ",e.label]});if(i!=="1")return null;let D=t(j,{courseId:o,selectedDoenetId:e.collectionDoenetId}),g=null;if(e.collectionDoenetId){let l=[];for(let[p,d]of Object.entries(e.pagesByCollectionSource[e.collectionDoenetId])){let u=!1;e!=null&&e.manuallyFilteredPages&&e.manuallyFilteredPages.includes(d)&&(u=!0),l.push(t(R,{selected:u,i:p,pageId:d}))}g=m(f,{children:[m("div",{style:{display:"flex"},children:[t(A,{style:{marginRight:"5px"},checked:e.isManuallyFiltered,onClick:()=>{c({courseId:o,doenetId:n,collectionDoenetId:e.collectionDoenetId,isManuallyFiltered:!e.isManuallyFiltered,manuallyFilteredPages:e.manuallyFilteredPages})}}),"Filter Page Links"]}),t(h,{width:"menu",options:l,disabled:!e.isManuallyFiltered,onChange:p=>{let d=Array.from(p.target.selectedOptions,u=>u.value);c({courseId:o,doenetId:n,collectionDoenetId:e.collectionDoenetId,isManuallyFiltered:e.isManuallyFiltered,manuallyFilteredPages:d})},multiple:!0}),t("br",{})]})}return m(f,{children:[P,t(T,{label:"Label",vertical:!0,width:"menu",dataTest:"Label Collection",value:s,onChange:l=>a(l.target.value),onKeyDown:l=>{l.keyCode===13&&b()},onBlur:b}),t("br",{}),t("br",{}),t("div",{children:"collection"}),t(h,{width:"menu",options:D,onChange:l=>{c({courseId:o,doenetId:n,collectionDoenetId:l.target.value,isManuallyFiltered:!1,manuallyFilteredPages:[]})}}),t("br",{}),g,t("br",{}),t(I,{width:"menu",value:"Update Content to Sources",onClick:l=>{l.preventDefault(),l.stopPropagation(),v({collectionLinkObj:e,pages:e.pages})}}),t("br",{}),t(I,{width:"menu",value:"Delete Collection Link",alert:!0,onClick:l=>{l.preventDefault(),l.stopPropagation(),F({doenetId:n})}})]})}export{K as default}; diff --git a/dist/assets/SelectedCourse-4b0d9c71.js b/dist/assets/SelectedCourse-77b69e89.js similarity index 71% rename from dist/assets/SelectedCourse-4b0d9c71.js rename to dist/assets/SelectedCourse-77b69e89.js index 857fd00c73..2b399db827 100644 --- a/dist/assets/SelectedCourse-4b0d9c71.js +++ b/dist/assets/SelectedCourse-77b69e89.js @@ -1,4 +1,4 @@ -import{s as r,g as u,j as o,a as i,F as d,B as p,a6 as m,l as x,R as g,p as v,i as h,bc as f}from"./index-99a56692.js";import{B as b}from"./ButtonGroup-ea123297.js";import{d as C}from"./CourseToolHandler-f517d0e5.js";import{E as w,b as A,D,c as P}from"./SettingComponents-ce5fbb6e.js";import{e as k}from"./RoleDropdown-5e05ae49.js";import{A as S}from"./ActionButton-f612d279.js";import{A as B}from"./ActionButtonGroup-a395ceaf.js";import"./index-ef9c2520.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-b3e258be.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./CollapseSection-a6fcd8bf.js";import"./util-38d8e238.js";import"./DateTime-ef0be144.js";import"./moment-f5bb98f1.js";import"./DropdownMenu-9b4c45a6.js";import"./RelatedItems-96588168.js";import"./Textfield-5d92f495.js";r.button` +import{s as r,g as u,j as o,a as i,F as d,B as p,a6 as m,l as x,R as g,p as v,i as h,be as f}from"./index-7074710c.js";import{B as b}from"./ButtonGroup-9136da6d.js";import{d as C}from"./CourseToolHandler-8716455d.js";import{E as w,b as A,D,c as P}from"./SettingComponents-43f86399.js";import{e as k}from"./RoleDropdown-cce90708.js";import{A as S}from"./ActionButton-e5ea2a2f.js";import{A as B}from"./ActionButtonGroup-f4ce05e4.js";import"./index-67ec2c85.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-5b62de19.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./CollapseSection-cb27678a.js";import"./util-38d8e238.js";import"./DateTime-d0a20943.js";import"./moment-3cda1086.js";import"./DropdownMenu-f3593bed.js";import"./RelatedItems-33b68fba.js";import"./Textfield-9c1c2968.js";r.button` width: 20px; height: 20px; background: ${e=>`${e.color}`}; diff --git a/dist/assets/SelectedDataSources-9a579aaa.js b/dist/assets/SelectedDataSources-d8015028.js similarity index 88% rename from dist/assets/SelectedDataSources-9a579aaa.js rename to dist/assets/SelectedDataSources-d8015028.js index 0bbf103bb6..2f376f4685 100644 --- a/dist/assets/SelectedDataSources-9a579aaa.js +++ b/dist/assets/SelectedDataSources-d8015028.js @@ -1 +1 @@ -import{r as u,l as h,T as p,m as y,v as f,G as D,V as w,y as x,a as g,F as S,j as c,z as A,k as v}from"./index-99a56692.js";import{A as C}from"./ActionButton-f612d279.js";function B(){const[s,r]=u.useState([]),n=h(p),i=h(y("courseId")),l=f(({snapshot:t})=>async o=>{let e=[];for(let d of o){let a=await t.getPromise(D(d));if(a.type=="activity"&&a.isAssigned)e.push(d);else if(a.type=="section"&&a.isAssigned){let I=await t.getPromise(w({courseId:i,sectionId:d}));e=[...await l(I),...e]}}return e=[...new Set(e)],e},[i]);u.useEffect(()=>{n.length>0?l(n).then(t=>{r(t)}):r([])},[n]);const m=x();return g(S,{children:[c("h2",{"data-test":"selectedDataSourcesHeading",style:{margin:"16px 5px"},children:"Event Data"}),g("div",{children:[s.length," ",s.length==1?"Activity":"Activities"]}),c("br",{}),c(C,{width:"menu",value:"View on Shiny",disabled:s.length==0,onClick:async()=>{if(s.length==0)m("No activities found",A.INFO);else{let t=s.join("&data=");const o=await v.get(`/api/createSecretCode.php?courseId=${i}`),{secretCode:e}=o.data;window.open(`https://doenet.shinyapps.io/analyzer/?data=${t}&code=${e}`,"_blank")}}})]})}export{B as default}; +import{r as u,l as h,T as p,m as y,v as f,G as D,V as w,y as x,a as g,F as S,j as c,z as A,k as v}from"./index-7074710c.js";import{A as C}from"./ActionButton-e5ea2a2f.js";function B(){const[s,r]=u.useState([]),n=h(p),i=h(y("courseId")),l=f(({snapshot:t})=>async o=>{let e=[];for(let d of o){let a=await t.getPromise(D(d));if(a.type=="activity"&&a.isAssigned)e.push(d);else if(a.type=="section"&&a.isAssigned){let I=await t.getPromise(w({courseId:i,sectionId:d}));e=[...await l(I),...e]}}return e=[...new Set(e)],e},[i]);u.useEffect(()=>{n.length>0?l(n).then(t=>{r(t)}):r([])},[n]);const m=x();return g(S,{children:[c("h2",{"data-test":"selectedDataSourcesHeading",style:{margin:"16px 5px"},children:"Event Data"}),g("div",{children:[s.length," ",s.length==1?"Activity":"Activities"]}),c("br",{}),c(C,{width:"menu",value:"View on Shiny",disabled:s.length==0,onClick:async()=>{if(s.length==0)m("No activities found",A.INFO);else{let t=s.join("&data=");const o=await v.get(`/api/createSecretCode.php?courseId=${i}`),{secretCode:e}=o.data;window.open(`https://doenet.shinyapps.io/analyzer/?data=${t}&code=${e}`,"_blank")}}})]})}export{B as default}; diff --git a/dist/assets/SelectedOrder-0f287f38.js b/dist/assets/SelectedOrder-51adfbf6.js similarity index 87% rename from dist/assets/SelectedOrder-0f287f38.js rename to dist/assets/SelectedOrder-51adfbf6.js index c69406e7d4..6a68032c68 100644 --- a/dist/assets/SelectedOrder-0f287f38.js +++ b/dist/assets/SelectedOrder-51adfbf6.js @@ -1,4 +1,4 @@ -import{l as s,T as S,G as C,m as y,r as c,a6 as B,a as m,j as e,i as R,_ as A,F as I,A as D,B as u,s as N}from"./index-99a56692.js";import{B as O}from"./ButtonGroup-ea123297.js";import{I as j}from"./IncrementMenu-aee46d2a.js";import{D as F}from"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";const L=N.span` +import{l as s,T as S,G as C,m as y,r as c,a6 as B,a as m,j as e,i as R,_ as A,F as I,A as D,B as u,s as N}from"./index-7074710c.js";import{B as O}from"./ButtonGroup-9136da6d.js";import{I as j}from"./IncrementMenu-2cdf9a4e.js";import{D as F}from"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";const L=N.span` font-size: 15px; line-height: 1.1 `;function z(){const r=s(S)[0],t=s(C(r));s(C(t.parentDoenetId));const k=s(y("courseId")),[a,p]=c.useState(t.behavior),[l,b]=c.useState(t.numberToSelect),[i,f]=c.useState(t.withReplacement);let{create:d,updateOrderBehavior:h,deleteItem:T}=B(k);c.useEffect(()=>{t.behavior!=a&&p(t.behavior),t.numberToSelect!=l&&b(t.numberToSelect),t.withReplacement!=i&&f(t.withReplacement)},[t.doenetId]);let g=m("h2",{"data-test":"infoPanelItemLabel",style:{margin:"16px 5px"},children:[e(R,{icon:A})," ",t.label]}),x=[["sequence","sequence"],["shuffle","shuffle"],["select","select"]],v=0;for(let[n,o]of Object.entries(x))if(o[0]===a){v=Number(n)+1;break}let w=null;return a=="select"&&(w=m(I,{children:[e(j,{min:0,label:"Number to select",vertical:!0,value:l,onChange:n=>{let o=Number(n);isNaN(n)&&(o=0),b(o),h({doenetId:r,behavior:a,numberToSelect:o,withReplacement:i})}}),e(D,{style:{marginRight:"5px"},checked:i,onClick:n=>{f(o=>!o),h({doenetId:r,behavior:a,numberToSelect:l,withReplacement:!i})}}),e(L,{children:"with replacement"}),e("br",{}),e("br",{})]})),m(I,{children:[g,e(F,{width:"menu",items:x,defaultIndex:v,onChange:({value:n})=>{p(n),h({doenetId:r,behavior:n,numberToSelect:l,withReplacement:i})}}),e("br",{}),w,m(O,{vertical:!0,children:[e(u,{width:"menu",onClick:()=>d({itemType:"page"}),value:"Add Page"}),e(u,{width:"menu",onClick:()=>d({itemType:"order"}),value:"Add Order"}),e(u,{width:"menu",onClick:()=>d({itemType:"collectionLink"}),value:"Add Collection Link",dataTest:"Add Collection Link"})]}),e("br",{}),e(u,{width:"menu",value:"Delete Order",alert:!0,onClick:n=>{n.preventDefault(),n.stopPropagation(),T({doenetId:r})}})]})}export{z as default}; diff --git a/dist/assets/SelectedPage-a6ebfaaa.js b/dist/assets/SelectedPage-0dc42f25.js similarity index 79% rename from dist/assets/SelectedPage-a6ebfaaa.js rename to dist/assets/SelectedPage-0dc42f25.js index 2cfc1ed264..8dafec5a03 100644 --- a/dist/assets/SelectedPage-a6ebfaaa.js +++ b/dist/assets/SelectedPage-0dc42f25.js @@ -1 +1 @@ -import{R as v,p as y,l as i,T as A,G as u,m as P,a6 as x,r as p,y as w,a as d,j as t,i as C,J as B,F as D,B as r}from"./index-99a56692.js";import{T as L}from"./Textfield-5d92f495.js";import{B as F}from"./ButtonGroup-ea123297.js";import{A as j}from"./ActionButton-f612d279.js";import{A as k}from"./ActionButtonGroup-a395ceaf.js";function K(){const g=v(y),o=i(A)[0],a=i(u(o)),n=i(u(a.containingDoenetId));n.parentDoenetId;const f=n.doenetId,b=i(P("courseId")),{create:c,renameItem:I,compileActivity:E,deleteItem:T,copyItems:O,cutItems:_}=x(b),[l,s]=p.useState(a.label);w(),p.useEffect(()=>{l!==a.label&&s(a.label)},[o]);const m=()=>{let e=l;l===""&&(e=a.label,a.label===""&&(e="Untitled"),s(e)),a.label!==e&&I(o,e)};let h=d("h2",{"data-test":"infoPanelItemLabel",style:{margin:"16px 5px"},children:[t(C,{icon:B})," ",a.label]});return d(D,{children:[h,t(k,{vertical:!0,children:t(j,{width:"menu",value:"Edit Page",dataTest:"Edit Page",onClick:()=>{g({page:"course",tool:"editor",view:"",params:{pageId:o,doenetId:f}})}})}),t(L,{label:"Label",dataTest:"Label Page",vertical:!0,width:"menu",value:l,onChange:e=>s(e.target.value),onKeyDown:e=>{e.keyCode===13&&m()},onBlur:m}),t("br",{}),d(F,{vertical:!0,children:[t(r,{width:"menu",onClick:()=>c({itemType:"page"}),value:"Add Page",dataTest:"Add Page"}),n.type=="activity"?t(r,{width:"menu",onClick:()=>c({itemType:"order"}),value:"Add Order",dataTest:"Add Order"}):null]}),t("br",{}),t(r,{width:"menu",value:"Delete Page",dataTest:"Delete Page",alert:!0,onClick:e=>{e.preventDefault(),e.stopPropagation(),T({doenetId:o})}})]})}export{K as default}; +import{R as v,p as y,l as i,T as A,G as u,m as P,a6 as x,r as p,y as w,a as d,j as t,i as C,J as B,F as D,B as r}from"./index-7074710c.js";import{T as L}from"./Textfield-9c1c2968.js";import{B as F}from"./ButtonGroup-9136da6d.js";import{A as j}from"./ActionButton-e5ea2a2f.js";import{A as k}from"./ActionButtonGroup-f4ce05e4.js";function K(){const g=v(y),o=i(A)[0],a=i(u(o)),n=i(u(a.containingDoenetId));n.parentDoenetId;const f=n.doenetId,b=i(P("courseId")),{create:c,renameItem:I,compileActivity:E,deleteItem:T,copyItems:O,cutItems:_}=x(b),[l,s]=p.useState(a.label);w(),p.useEffect(()=>{l!==a.label&&s(a.label)},[o]);const m=()=>{let e=l;l===""&&(e=a.label,a.label===""&&(e="Untitled"),s(e)),a.label!==e&&I(o,e)};let h=d("h2",{"data-test":"infoPanelItemLabel",style:{margin:"16px 5px"},children:[t(C,{icon:B})," ",a.label]});return d(D,{children:[h,t(k,{vertical:!0,children:t(j,{width:"menu",value:"Edit Page",dataTest:"Edit Page",onClick:()=>{g({page:"course",tool:"editor",view:"",params:{pageId:o,doenetId:f}})}})}),t(L,{label:"Label",dataTest:"Label Page",vertical:!0,width:"menu",value:l,onChange:e=>s(e.target.value),onKeyDown:e=>{e.keyCode===13&&m()},onBlur:m}),t("br",{}),d(F,{vertical:!0,children:[t(r,{width:"menu",onClick:()=>c({itemType:"page"}),value:"Add Page",dataTest:"Add Page"}),n.type=="activity"?t(r,{width:"menu",onClick:()=>c({itemType:"order"}),value:"Add Order",dataTest:"Add Order"}):null]}),t("br",{}),t(r,{width:"menu",value:"Delete Page",dataTest:"Delete Page",alert:!0,onClick:e=>{e.preventDefault(),e.stopPropagation(),T({doenetId:o})}})]})}export{K as default}; diff --git a/dist/assets/SelectedPageLink-07a94985.js b/dist/assets/SelectedPageLink-d2df6ca3.js similarity index 81% rename from dist/assets/SelectedPageLink-07a94985.js rename to dist/assets/SelectedPageLink-d2df6ca3.js index 67a83f912f..a77a56066d 100644 --- a/dist/assets/SelectedPageLink-07a94985.js +++ b/dist/assets/SelectedPageLink-d2df6ca3.js @@ -1 +1 @@ -import{R as b,p as h,l as s,m as L,T as w,G as l,r as c,a6 as P,v as A,k as v,a as u,j as e,i as C,$ as F,F as T,B as _}from"./index-99a56692.js";import{A as B}from"./ActionButton-f612d279.js";import{A as j}from"./ActionButtonGroup-a395ceaf.js";import"./Textfield-5d92f495.js";function D(){const d=b(h),m=s(L("courseId")),t=s(w)[0],a=s(l(t)),[p,g]=c.useState(a.label);let{updateContentLinksToSources:x}=P(m);A(({set:o})=>async(k,n,i)=>{await v.get("/api/renamePageLink.php",{params:{courseId:k,doenetId:n,label:i}}),o(l(n),I=>{let r={...I};return r.label=i,r})}),c.useEffect(()=>{p!==a.label&&g(a.label)},[t]);let f=u("h2",{"data-test":"infoPanelItemLabel",style:{margin:"16px 5px"},children:[e(C,{icon:F})," Link to ",a.label]});return u(T,{children:[f,e(j,{vertical:!0,children:e(B,{width:"menu",value:"View Page Link",onClick:()=>{d({page:"course",tool:"editor",view:"",params:{linkPageId:t}})}})}),e("br",{}),e(_,{width:"menu",value:"Update Content to Source",onClick:o=>{o.preventDefault(),o.stopPropagation(),x({pages:[t]})}})]})}export{D as default}; +import{R as b,p as h,l as s,m as L,T as w,G as l,r as c,a6 as P,v as A,k as v,a as u,j as e,i as C,$ as F,F as T,B as _}from"./index-7074710c.js";import{A as B}from"./ActionButton-e5ea2a2f.js";import{A as j}from"./ActionButtonGroup-f4ce05e4.js";import"./Textfield-9c1c2968.js";function D(){const d=b(h),m=s(L("courseId")),t=s(w)[0],a=s(l(t)),[p,g]=c.useState(a.label);let{updateContentLinksToSources:x}=P(m);A(({set:o})=>async(k,n,i)=>{await v.get("/api/renamePageLink.php",{params:{courseId:k,doenetId:n,label:i}}),o(l(n),I=>{let r={...I};return r.label=i,r})}),c.useEffect(()=>{p!==a.label&&g(a.label)},[t]);let f=u("h2",{"data-test":"infoPanelItemLabel",style:{margin:"16px 5px"},children:[e(C,{icon:F})," Link to ",a.label]});return u(T,{children:[f,e(j,{vertical:!0,children:e(B,{width:"menu",value:"View Page Link",onClick:()=>{d({page:"course",tool:"editor",view:"",params:{linkPageId:t}})}})}),e("br",{}),e(_,{width:"menu",value:"Update Content to Source",onClick:o=>{o.preventDefault(),o.stopPropagation(),x({pages:[t]})}})]})}export{D as default}; diff --git a/dist/assets/SelectedSection-20efb6e3.js b/dist/assets/SelectedSection-35fca7cc.js similarity index 80% rename from dist/assets/SelectedSection-20efb6e3.js rename to dist/assets/SelectedSection-35fca7cc.js index ff25a607ce..3e45366b43 100644 --- a/dist/assets/SelectedSection-20efb6e3.js +++ b/dist/assets/SelectedSection-35fca7cc.js @@ -1 +1 @@ -import{l as n,m as S,T as A,G as C,a6 as u,r as f,y as v,a as p,F as g,j as s,z as y,B as F,i as L,W as B}from"./index-99a56692.js";import{A as w}from"./ActionButton-f612d279.js";import{e as k}from"./RoleDropdown-5e05ae49.js";import{T as D}from"./Textfield-5d92f495.js";import"./DropdownMenu-9b4c45a6.js";import"./setPrototypeOf-51e8cf87.js";function G(){const o=n(S("courseId")),a=n(A)[0],{canEditContent:I}=n(k(o)),{label:t,isAssigned:i}=n(C(a)),{renameItem:b,deleteItem:x}=u(o),[l,r]=f.useState(t),{updateAssignItem:T}=u(o);let c="Assign Section";i&&(c="Unassign Section"),f.useEffect(()=>{r(t)},[t]);const d=()=>{let e=l;l===""&&(e=t,t===""&&(e="Untitled"),r(e)),t!==e&&b(a,e)},h=v();let m=p("h2",{"data-test":"infoPanelItemLabel",style:{margin:"16px 5px"},children:[s(L,{icon:B})," ",t]});return I==="1"?p(g,{children:[m,s(w,{width:"menu",value:c,onClick:()=>{let e="Section Assigned.";i&&(e="Section Unassigned."),T({doenetId:a,isAssigned:!i,successCallback:()=>{h(e,y.INFO)}})}}),s(D,{label:"Label",vertical:!0,dataTest:"Label Section",width:"menu",value:l,onChange:e=>r(e.target.value),onKeyDown:e=>{e.keyCode===13&&d()},onBlur:d}),s("br",{}),s(F,{width:"menu",value:"Delete Section",alert:!0,onClick:e=>{e.preventDefault(),e.stopPropagation(),x({doenetId:a})}})]}):s(g,{children:m})}export{G as default}; +import{l as n,m as S,T as A,G as C,a6 as u,r as f,y as v,a as p,F as g,j as s,z as y,B as F,i as L,W as B}from"./index-7074710c.js";import{A as w}from"./ActionButton-e5ea2a2f.js";import{e as k}from"./RoleDropdown-cce90708.js";import{T as D}from"./Textfield-9c1c2968.js";import"./DropdownMenu-f3593bed.js";import"./setPrototypeOf-51e8cf87.js";function G(){const o=n(S("courseId")),a=n(A)[0],{canEditContent:I}=n(k(o)),{label:t,isAssigned:i}=n(C(a)),{renameItem:b,deleteItem:x}=u(o),[l,r]=f.useState(t),{updateAssignItem:T}=u(o);let c="Assign Section";i&&(c="Unassign Section"),f.useEffect(()=>{r(t)},[t]);const d=()=>{let e=l;l===""&&(e=t,t===""&&(e="Untitled"),r(e)),t!==e&&b(a,e)},h=v();let m=p("h2",{"data-test":"infoPanelItemLabel",style:{margin:"16px 5px"},children:[s(L,{icon:B})," ",t]});return I==="1"?p(g,{children:[m,s(w,{width:"menu",value:c,onClick:()=>{let e="Section Assigned.";i&&(e="Section Unassigned."),T({doenetId:a,isAssigned:!i,successCallback:()=>{h(e,y.INFO)}})}}),s(D,{label:"Label",vertical:!0,dataTest:"Label Section",width:"menu",value:l,onChange:e=>r(e.target.value),onKeyDown:e=>{e.keyCode===13&&d()},onBlur:d}),s("br",{}),s(F,{width:"menu",value:"Delete Section",alert:!0,onClick:e=>{e.preventDefault(),e.stopPropagation(),x({doenetId:a})}})]}):s(g,{children:m})}export{G as default}; diff --git a/dist/assets/SettingComponents-67fac933.js b/dist/assets/SettingComponents-3306743d.js similarity index 86% rename from dist/assets/SettingComponents-67fac933.js rename to dist/assets/SettingComponents-3306743d.js index 52e9e5b23f..ecab8ffe2b 100644 --- a/dist/assets/SettingComponents-67fac933.js +++ b/dist/assets/SettingComponents-3306743d.js @@ -1,4 +1,4 @@ -import{y as x,b as H,G as P,v as G,aA as M,bi as Y,k as C,s as L,ay as q,l as V,m as J,a6 as Q,r as m,g as X,a as h,j as o,A as w,i as b,bd as R,be as z,b0 as D,a5 as Z,F as K}from"./index-99a56692.js";import{D as N}from"./DateTime-ef0be144.js";import{I as B}from"./IncrementMenu-aee46d2a.js";import{D as j}from"./DropdownMenu-9b4c45a6.js";import{R as ee}from"./RelatedItems-96588168.js";import{A as te}from"./ActionButtonGroup-a395ceaf.js";import{A as U}from"./ActionButton-f612d279.js";import{T as ae}from"./Textfield-5d92f495.js";import{u as ie}from"./useSaveDraft-a42d0f94.js";const A=(e,n)=>{const d=x(),u=H(P(n)).getValue(),p=G(({set:t})=>async(...l)=>{const a=l.reduce((c,{keyToUpdate:g,value:v})=>(c[g]=v,c),{});let i={...a};if(i.assignedDate!==void 0&&i.assignedDate!==null&&(i.assignedDate=M(new Date(i.assignedDate))),i.dueDate!==void 0&&i.dueDate!==null&&(i.dueDate=Y(new Date(i.dueDate))),i.pinnedAfterDate!==void 0&&i.pinnedAfterDate!==null&&(i.pinnedAfterDate=M(new Date(i.pinnedAfterDate))),i.pinnedUntilDate!==void 0&&i.pinnedUntilDate!==null&&(i.pinnedUntilDate=M(new Date(i.pinnedUntilDate))),(await C.post("/api/updateAssignmentSettings.php",{...i,courseId:e,doenetId:n})).data.success){t(P(n),c=>({...c,...a}));for(const{description:c,valueDescription:g,value:v,keyToUpdate:f}of l);}},[d,e,n]),s=G(({set:t})=>async(...l)=>{const a=l.reduce((r,{keyToUpdate:c,value:g})=>(r[c]=g,r),{});if((await C.post("/api/updateContentFlags.php",{...a,courseId:e,doenetId:n})).data.success){t(P(n),r=>({...r,...a}));for(const{description:r,valueDescription:c,value:g,keyToUpdate:v}of l);}},[d,e,n]);return{value:u,updateAssignmentSettings:p,updateActivityFlags:s}};function ne({cid:e,doenetId:n,flags:d}){let u=new Worker("/_utils/prerenderWorker.js",{type:"module"});return u.postMessage({messageType:"prerenderActivity",args:{cid:e,doenetId:n,flags:d}}),u.onmessage=function(p){p.data.messageType==="finished"?u.terminate():p.data.messageType==="error"&&(console.error(p.data.message),u.terminate())},u}const k=L.div` +import{y as x,b as H,G as P,v as G,aA as M,bk as Y,k as C,s as L,ay as q,l as V,m as J,a6 as Q,r as m,g as X,a as h,j as o,A as w,i as b,bf as R,bg as z,b0 as D,a5 as Z,F as K}from"./index-7074710c.js";import{D as N}from"./DateTime-d0a20943.js";import{I as B}from"./IncrementMenu-2cdf9a4e.js";import{D as j}from"./DropdownMenu-f3593bed.js";import{R as ee}from"./RelatedItems-33b68fba.js";import{A as te}from"./ActionButtonGroup-f4ce05e4.js";import{A as U}from"./ActionButton-e5ea2a2f.js";import{T as ae}from"./Textfield-9c1c2968.js";import{u as ie}from"./useSaveDraft-5f9f3fe4.js";const A=(e,n)=>{const d=x(),u=H(P(n)).getValue(),p=G(({set:t})=>async(...l)=>{const a=l.reduce((c,{keyToUpdate:g,value:k})=>(c[g]=k,c),{});let i={...a};if(i.assignedDate!==void 0&&i.assignedDate!==null&&(i.assignedDate=M(new Date(i.assignedDate))),i.dueDate!==void 0&&i.dueDate!==null&&(i.dueDate=Y(new Date(i.dueDate))),i.pinnedAfterDate!==void 0&&i.pinnedAfterDate!==null&&(i.pinnedAfterDate=M(new Date(i.pinnedAfterDate))),i.pinnedUntilDate!==void 0&&i.pinnedUntilDate!==null&&(i.pinnedUntilDate=M(new Date(i.pinnedUntilDate))),(await C.post("/api/updateAssignmentSettings.php",{...i,courseId:e,doenetId:n})).data.success){t(P(n),c=>({...c,...a}));for(const{description:c,valueDescription:g,value:k,keyToUpdate:f}of l);}},[d,e,n]),s=G(({set:t})=>async(...l)=>{const a=l.reduce((r,{keyToUpdate:c,value:g})=>(r[c]=g,r),{});if((await C.post("/api/updateContentFlags.php",{...a,courseId:e,doenetId:n})).data.success){t(P(n),r=>({...r,...a}));for(const{description:r,valueDescription:c,value:g,keyToUpdate:k}of l);}},[d,e,n]);return{value:u,updateAssignmentSettings:p,updateActivityFlags:s}};function ne({cid:e,doenetId:n,flags:d}){let u=new Worker("/_utils/prerenderWorker.js",{type:"module"});return u.postMessage({messageType:"prerenderActivity",args:{cid:e,doenetId:n,flags:d}}),u.onmessage=function(p){p.data.messageType==="finished"?u.terminate():p.data.messageType==="error"&&(console.error(p.data.message),u.terminate())},u}const v=L.div` margin: 0 5px 10px 5px; display: ${e=>e.flex?"flex":"block"}; align-items: ${e=>e.flex&&"center"}; @@ -12,4 +12,4 @@ import{y as x,b as H,G as P,v as G,aA as M,bi as Y,k as C,s as L,ay as q,l as V, justify-content: space-between; align-items: center; width: calc(var(--menuWidth) - 10px); -`,se=q({key:"initializingWorkersAtom",default:null}),he=({doenetId:e,courseId:n})=>{const d=V(J("pageId")),{saveDraft:u}=ie(),{compileActivity:p,updateAssignItem:s}=Q(n),t=V(P(e)),l=t.isAssigned;x();const[a,i]=m.useState("");let r="Assign Activity";l&&(r="Update Assigned Activity");let[c,g]=X(se(e)),v=o(U,{width:"menu",dataTest:"Assign Activity",value:r,onClick:async()=>{d&&await u({pageId:d,courseId:n}),p({activityDoenetId:e,isAssigned:!0,courseId:n}),s({doenetId:e,isAssigned:!0,successCallback:()=>{}})}}),f=null,I=null;return l&&(f=o(U,{width:"menu",dataTest:"Unassign Activity",value:"Unassign Activity",alert:!0,onClick:()=>{s({doenetId:e,isAssigned:!1,successCallback:()=>{}})}}),c?I=o(U,{width:"menu",dataTest:"Cancel prerendering",value:`${a} (Cancel)`,onClick:()=>{c.terminate(),g(null)}}):I=o(U,{width:"menu",dataTest:"Prerender activity",value:"Prerender activity",onClick:async()=>{let $={showCorrectness:t.showCorrectness,readOnly:!1,solutionDisplayMode:t.showSolution?"button":"none",showFeedback:t.showFeedback,showHints:t.showHints,allowLoadState:!1,allowSaveState:!1,allowLocalState:!1,allowSaveSubmissions:!1,allowSaveEvents:!1},W=await C.get("/api/getCidForAssignment.php",{params:{doenetId:e}});if(W.data.cid){i("");let O=ne({cid:W.data.cid,doenetId:e,flags:$});g(O),O.onmessage=F=>{F.data.messageType==="status"?i(`${F.data.stage} ${Math.round(F.data.complete*100)}%`):(O.terminate(),g(null))}}}})),h(te,{vertical:!0,children:[v,f,I]})},fe=({doenetId:e,courseId:n,editable:d=!1})=>{const u=x(),{value:{assignedDate:p},updateAssignmentSettings:s}=A(n,e),[t,l]=m.useState(p);return m.useEffect(()=>{l(p)},[p]),h(k,{children:[o(y,{children:"Assigned Date"}),h(S,{onClick:a=>a.preventDefault(),children:[o(w,{style:{marginRight:"5px"},dataTest:"Assigned Date Checkbox",checkedIcon:o(b,{icon:R}),uncheckedIcon:o(b,{icon:z}),checked:t!=null,onClick:()=>{let a="None",i=null;t==null&&(a="Now",i=D(new Date)),l(i),s({keyToUpdate:"assignedDate",value:i,description:"Assigned Date",valueDescription:a})}}),o(N,{width:"176px",disabled:t==null,value:t?new Date(t):null,dataTest:"Assigned Date",disabledText:"No Assigned Date",disabledOnClick:()=>{let a="Now",i=D(new Date);s({keyToUpdate:"assignedDate",value:i,description:"Assigned Date",valueDescription:a})},onBlur:({valid:a,value:i})=>{if(a){try{i=i.toDate()}catch{}new Date(D(i)).getTime()!==new Date(t).getTime()&&(l(D(i)),s(e,{keyToUpdate:"assignedDate",value:D(i),description:"Assigned Date"}))}else u("Invalid Assigned Date")}})]})]})},Ae=({courseId:e,doenetId:n})=>{const d=x(),{value:{dueDate:u},updateAssignmentSettings:p}=A(e,n),[s,t]=m.useState();return m.useEffect(()=>{t(u)},[u]),h(k,{children:[o(y,{children:"Due Date"}),h(S,{onClick:l=>l.preventDefault(),children:[o(w,{style:{marginRight:"5px"},dataTest:"Due Date Checkbox",checkedIcon:o(b,{icon:R}),uncheckedIcon:o(b,{icon:z}),checked:s!=null,onClick:()=>{let l="None",a=null;if(s==null){l="Next Week";let i=new Date;i.setDate(i.getDate()+7),a=D(i)}t(a),p({keyToUpdate:"dueDate",value:a,description:"Due Date",valueDescription:l})}}),o(N,{width:"176px",disabled:s==null,value:s?new Date(s):null,dataTest:"Due Date",onBlur:({valid:l,value:a})=>{if(l){try{a=a.toDate()}catch{}new Date(D(a)).getTime()!==new Date(s).getTime()&&(t(D(a)),p({keyToUpdate:"dueDate",value:D(a),description:"Due Date"}))}else d("Invalid Due Date")},disabledText:"No Due Date",disabledOnClick:()=>{let l="Next Week",a=new Date;a.setDate(a.getDate()+7);let i=D(a);t(i),p({keyToUpdate:"dueDate",value:i,description:"Due Date",valueDescription:l})}})]})]})},Te=({courseId:e,doenetId:n})=>{const{value:{timeLimit:d},updateAssignmentSettings:u}=A(e,n),[p,s]=m.useState(d),[t,l]=m.useState(!!d);return h(k,{children:[o(y,{children:"Time Limit in Minutes"}),h(S,{onClick:a=>a.preventDefault(),children:[o(w,{style:{marginRight:"5px"},dataTest:"Time Limit Checkbox",checked:t,onClick:()=>{let a="Not Limited",i=null,r=!1;t||(a="60 Minutes",i=60,r=!0),s(i),l(r),u({keyToUpdate:"timeLimit",value:i,description:"Time Limit ",valueDescription:a})}}),o(B,{disabled:!t,value:p,dataTest:"Time Limit",min:1,width:"180px",onBlur:a=>{(isNaN(a)||a<1)&&(a=1),s(parseInt(a)),u({keyToUpdate:"timeLimit",value:parseInt(a),description:"Time Limit",valueDescription:`${a} Minutes`})},onChange:a=>s(parseInt(a))})]})]})},ve=({courseId:e,doenetId:n})=>{const{value:{numberOfAttemptsAllowed:d},updateAssignmentSettings:u}=A(e,n),[p,s]=m.useState(d),[t,l]=m.useState(!!d);return h(k,{children:[o(y,{children:"Attempts"}),h(S,{onClick:a=>a.preventDefault(),children:[o(w,{style:{marginRight:"5px"},dataTest:"Attempt Limit Checkbox",checked:t,onClick:()=>{let a="Not Limited",i=null,r=!1;t||(a="1",i=1,r=!0),s(i),l(r),u({keyToUpdate:"numberOfAttemptsAllowed",value:i,description:"Attempts Allowed",valueDescription:a})}}),o(B,{disabled:!t,value:p,dataTest:"Attempt Limit",width:"180px",min:1,onBlur:a=>{(isNaN(a)||a<1)&&(a=1),s(parseInt(a)),u({keyToUpdate:"numberOfAttemptsAllowed",value:parseInt(a),description:"Attempts Allowed"})},onChange:a=>s(parseInt(a))})]})]})},ke=({courseId:e,doenetId:n})=>{const{value:{attemptAggregation:d},updateAssignmentSettings:u}=A(e,n),[p,s]=m.useState();return m.useEffect(()=>{s(d)},[d]),h(k,{children:[o(y,{children:"Attempt Aggregation"}),o(S,{children:o(j,{dataTest:"Attempt Aggregation",width:"menu",valueIndex:p==="m"?1:2,items:[["m","Maximum"],["l","Last Attempt"]],onChange:({value:t})=>{let l="Maximum";t==="l"&&(l="Last Attempt"),s(t),u({keyToUpdate:"attemptAggregation",value:t,description:"Attempt Aggregation",valueDescription:l})}})})]})},ye=({courseId:e,doenetId:n})=>{const{value:{totalPointsOrPercent:d},updateAssignmentSettings:u}=A(e,n),[p,s]=m.useState();return m.useEffect(()=>{s(d)},[d]),h(k,{children:[o(y,{children:"Total Points Or Percent"}),o(S,{children:o(B,{value:p,dataTest:"Total Points Or Percent",min:0,onBlur:t=>{if(t!==d){let l=null;t<0||t===""||isNaN(t)?(s(0),l=0):(l=parseFloat(t),s(parseFloat(t))),u(n,{keyToUpdate:"totalPointsOrPercent",value:l,description:"Total Points Or Percent"})}},onChange:t=>s(t)})})]})},we=({courseId:e,doenetId:n})=>{const{value:{gradeCategory:d},updateAssignmentSettings:u}=A(e,n),[p,s]=m.useState();return m.useEffect(()=>{s(d)},[d]),h(k,{children:[o(y,{children:"Grade Category"}),o(j,{defaultIndex:"7",valueIndex:{gateway:1,exams:2,quizzes:3,"problem sets":4,projects:5,participation:6,"No Category":7}[p],items:[["gateway","Gateway"],["exams","Exams"],["quizzes","Quizzes"],["problem sets","Problem Sets"],["projects","Projects"],["participation","Participation"],["NULL","No Category"]],dataTest:"Grade Category",onChange:({value:t})=>{d!==t&&(s(t),u({keyToUpdate:"gradeCategory",value:t,description:"Grade Category"}))}})]})},Se=({courseId:e,doenetId:n})=>{const{value:{itemWeights:d},updateAssignmentSettings:u}=A(e,n),[p,s]=m.useState("");return m.useEffect(()=>{s(d==null?void 0:d.join(" "))},[d]),h(k,{children:[o(y,{children:"Item Weights"}),o(ae,{vertical:!0,width:"menu",value:p,dataTest:"Item Weights",onChange:t=>{s(t.target.value)},onBlur:()=>{let t=p.split(" ").filter(l=>l).map(Number).map(l=>l>=0?l:0);(d.length!==t.length||d.some((l,a)=>l!==t[a]))&&u({keyToUpdate:"itemWeights",value:t,description:"Item Weights"})}})]})},T=({courseId:e,doenetId:n,keyToUpdate:d,description:u,label:p,invert:s,dataTest:t})=>{const{value:{[d]:l},updateAssignmentSettings:a}=A(e,n),[i,r]=m.useState(l);return m.useEffect(()=>{r(l)},[s,l]),h(k,{flex:!0,children:[o(w,{style:{marginRight:"5px"},dataTest:t,checked:s?!i:i,onClick:()=>{let c=s?"True":"False",g=!1;i||(c=s?"False":"True",g=!0),r(g),a({keyToUpdate:d,value:g,description:u,valueDescription:c})}}),o(_,{children:p??u})]})},E=({courseId:e,doenetId:n,keyToUpdate:d,description:u,label:p,invert:s,dataTest:t})=>{const{value:{[d]:l},updateActivityFlags:a}=A(e,n),[i,r]=m.useState(l);return m.useEffect(()=>{r(l)},[l,s]),h(k,{flex:!0,children:[o(w,{style:{marginRight:"5px"},dataTest:t,checked:s?!i:i,onClick:()=>{let c=s?"True":"False",g=!1;i||(c=s?"False":"True",g=!0),r(g),a({keyToUpdate:d,value:g,description:u,valueDescription:c})}}),o(_,{children:p??u})]})},be=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"individualize",description:"Individualize",dataTest:"Individualize"}),Ce=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"showSolution",description:"Show Solution",dataTest:"Show Solution"}),xe=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"showSolutionInGradebook",description:"Show Solution In Gradebook",dataTest:"Show Solution In Gradebook"}),Ue=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"showFeedback",description:"Show Feedback",dataTest:"Show Feedback"}),Pe=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"showHints",description:"Show Hints",dataTest:"Show Hints"}),Ne=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"showCorrectness",description:"Show Correctness",dataTest:"Show Correctness"}),Le=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"showCreditAchievedMenu",description:"Show Credit Achieved Menu",dataTest:"Show Credit Achieved Menu"}),Ie=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"paginate",description:"Paginate",dataTest:"Paginate"}),Oe=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"showFinishButton",description:"Show Finish Button",dataTest:"Show Finish Button"}),Fe=({courseId:e,doenetId:n})=>o(E,{courseId:e,doenetId:n,keyToUpdate:"isPublic",description:"Make Publicly Visible",dataTest:"Make Publicly Visible"}),Me=({courseId:e,doenetId:n})=>o(E,{courseId:e,doenetId:n,keyToUpdate:"userCanViewSource",description:"Show DoenetML Source",dataTest:"Show DoenetML Source"}),Ve=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"canViewAfterCompleted",description:"Can View After Completed",dataTest:"Can View After Completed"}),Re=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"proctorMakesAvailable",description:"Proctor Makes Available",dataTest:"Proctor Makes Available"}),ze=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"autoSubmit",description:"Auto Submit",dataTest:"Auto Submit"}),Be=({courseId:e,doenetId:n})=>{const d=x(),{value:{pinnedUntilDate:u,pinnedAfterDate:p},updateAssignmentSettings:s}=A(e,n),[t,l]=m.useState(u),[a,i]=m.useState(p);return m.useEffect(()=>{l(u)},[u]),m.useEffect(()=>{i(p)},[p]),h(k,{children:[o(y,{children:"Pin Assignment"}),h(S,{onClick:r=>r.preventDefault(),children:[o(w,{style:{marginRight:"5px"},checkedIcon:o(b,{icon:R}),uncheckedIcon:o(b,{icon:z}),checked:t!=null,dataTest:"Pin Assignment Checkbox",onClick:()=>{let r="None",c=null,g=null;if(t==null){r="Now to Next Year";let v=new Date,f=new Date;f.setDate(f.getDate()+365),c=D(v),g=D(f)}i(c),l(g),s({keyToUpdate:"pinnedAfterDate",value:c,description:"Pinned Dates ",valueDescription:r},{keyToUpdate:"pinnedUntilDate",value:g})}}),h("div",{style:{display:"flex",flexDirection:"column"},children:[o(N,{width:"176px",dataTest:"Pinned After Date",disabled:a==null,disabledText:"No Pinned After Date",disabledOnClick:()=>{let r="None",c=null,g=null;if(a==null){r="Now to Next Year";let v=new Date,f=new Date;f.setDate(f.getDate()+365),c=D(v),g=D(f)}i(c),l(g),s({keyToUpdate:"pinnedAfterDate",value:c,description:"Pinned Dates ",valueDescription:r},{keyToUpdate:"pinnedUntilDate",value:g})},value:a?new Date(a):null,onBlur:({valid:r,value:c})=>{if(r){try{c=c.toDate()}catch{}new Date(D(c)).getTime()!==new Date(a).getTime()&&(i(D(c)),s({keyToUpdate:"pinnedAfterDate",value:D(c),description:"Pinned After Date"}))}else d("Invalid Pin After Date")}}),o(N,{width:"176px",dataTest:"Pinned Until Date",style:{marginTop:"5px"},disabled:t==null,disabledText:"No Pinned Until Date",disabledOnClick:()=>{let r="None",c=null,g=null;if(t==null){r="Now to Next Year";let v=new Date,f=new Date;f.setDate(f.getDate()+365),c=D(v),g=D(f)}i(c),l(g),s({keyToUpdate:"pinnedAfterDate",value:c,description:"Pinned Dates ",valueDescription:r},{keyToUpdate:"pinnedUntilDate",value:g})},value:t?new Date(t):null,onBlur:({valid:r,value:c})=>{if(r){try{c=c.toDate()}catch{}new Date(D(c)).getTime()!==new Date(t).getTime()&&(l(D(c)),s({keyToUpdate:"pinnedUntilDate",value:D(c),description:"Pinned Until Date"}))}else d("Invalid Pin Until Date")}})]})]})]})};function Ee({courseId:e,doenetId:n}){const{value:{isGloballyAssigned:d}}=A(e,n),{value:u}=V(Z(e)),[p,s]=m.useState([]);async function t({courseId:i,doenetId:r}){let c=await C.get("/api/getRestrictedTo.php",{params:{courseId:i,doenetId:r}});s(c.data.restrictedTo)}async function l({courseId:i,doenetId:r,emailAddresses:c}){(await C.post("/api/updateRestrictedTo.php",{courseId:i,doenetId:r,emailAddresses:c})).data.success&&s(c)}m.useEffect(()=>{d||t({courseId:e,doenetId:n})},[e,n,d]);let a=u.reduce((i,r)=>r.withdrew=="0"?!d&&p.includes(r.email)?[...i,h("option",{selected:!0,value:r.email,children:[r.firstName," ",r.lastName]},`enrolledOpt${r.email}`)]:[...i,h("option",{value:r.email,children:[r.firstName," ",r.lastName]},`enrolledOpt${r.email}`)]:i,[]);return h(K,{children:[o(E,{courseId:e,doenetId:n,keyToUpdate:"isGloballyAssigned",description:"Restrict Assignment",invert:!0}),o(ee,{width:"menu",options:a,disabled:d,onChange:i=>{let r=Array.from(i.target.selectedOptions,c=>c.value);l({courseId:e,doenetId:n,emailAddresses:r})},multiple:!0})]})}export{he as A,Ve as C,Ae as D,we as G,Se as I,Fe as M,Ie as P,Ce as S,Te as T,Ee as a,fe as b,ve as c,ke as d,ye as e,be as f,xe as g,Ue as h,Pe as i,Ne as j,Le as k,Oe as l,Re as m,ze as n,Me as o,Be as p,A as u}; +`,se=q({key:"initializingWorkersAtom",default:null}),he=({doenetId:e,courseId:n})=>{const d=V(J("pageId")),{saveDraft:u}=ie(),{compileActivity:p,updateAssignItem:s}=Q(n),t=V(P(e)),l=t.isAssigned;x();const[a,i]=m.useState("");let r="Assign Activity";l&&(r="Update Assigned Activity");let[c,g]=X(se(e)),k=o(U,{width:"menu",dataTest:"Assign Activity",value:r,onClick:async()=>{d&&await u({pageId:d,courseId:n}),p({activityDoenetId:e,isAssigned:!0,courseId:n}),s({doenetId:e,isAssigned:!0,successCallback:()=>{}})}}),f=null,I=null;return l&&(f=o(U,{width:"menu",dataTest:"Unassign Activity",value:"Unassign Activity",alert:!0,onClick:()=>{s({doenetId:e,isAssigned:!1,successCallback:()=>{}})}}),c?I=o(U,{width:"menu",dataTest:"Cancel prerendering",value:`${a} (Cancel)`,onClick:()=>{c.terminate(),g(null)}}):I=o(U,{width:"menu",dataTest:"Prerender activity",value:"Prerender activity",onClick:async()=>{let $={showCorrectness:t.showCorrectness,readOnly:!1,solutionDisplayMode:t.showSolution?"button":"none",showFeedback:t.showFeedback,showHints:t.showHints,allowLoadState:!1,allowSaveState:!1,allowLocalState:!1,allowSaveSubmissions:!1,allowSaveEvents:!1},W=await C.get("/api/getCidForAssignment.php",{params:{doenetId:e}});if(W.data.cid){i("");let O=ne({cid:W.data.cid,doenetId:e,flags:$});g(O),O.onmessage=F=>{F.data.messageType==="status"?i(`${F.data.stage} ${Math.round(F.data.complete*100)}%`):(O.terminate(),g(null))}}}})),h(te,{vertical:!0,children:[k,f,I]})},fe=({doenetId:e,courseId:n,editable:d=!1})=>{const u=x(),{value:{assignedDate:p},updateAssignmentSettings:s}=A(n,e),[t,l]=m.useState(p);return m.useEffect(()=>{l(p)},[p]),h(v,{children:[o(y,{children:"Assigned Date"}),h(S,{onClick:a=>a.preventDefault(),children:[o(w,{style:{marginRight:"5px"},dataTest:"Assigned Date Checkbox",checkedIcon:o(b,{icon:R}),uncheckedIcon:o(b,{icon:z}),checked:t!=null,onClick:()=>{let a="None",i=null;t==null&&(a="Now",i=D(new Date)),l(i),s({keyToUpdate:"assignedDate",value:i,description:"Assigned Date",valueDescription:a})}}),o(N,{width:"176px",disabled:t==null,value:t?new Date(t):null,dataTest:"Assigned Date",disabledText:"No Assigned Date",disabledOnClick:()=>{let a="Now",i=D(new Date);s({keyToUpdate:"assignedDate",value:i,description:"Assigned Date",valueDescription:a})},onBlur:({valid:a,value:i})=>{if(a){try{i=i.toDate()}catch{}new Date(D(i)).getTime()!==new Date(t).getTime()&&(l(D(i)),s(e,{keyToUpdate:"assignedDate",value:D(i),description:"Assigned Date"}))}else u("Invalid Assigned Date")}})]})]})},Ae=({courseId:e,doenetId:n})=>{const d=x(),{value:{dueDate:u},updateAssignmentSettings:p}=A(e,n),[s,t]=m.useState();return m.useEffect(()=>{t(u)},[u]),h(v,{children:[o(y,{children:"Due Date"}),h(S,{onClick:l=>l.preventDefault(),children:[o(w,{style:{marginRight:"5px"},dataTest:"Due Date Checkbox",checkedIcon:o(b,{icon:R}),uncheckedIcon:o(b,{icon:z}),checked:s!=null,onClick:()=>{let l="None",a=null;if(s==null){l="Next Week";let i=new Date;i.setDate(i.getDate()+7),a=D(i)}t(a),p({keyToUpdate:"dueDate",value:a,description:"Due Date",valueDescription:l})}}),o(N,{width:"176px",disabled:s==null,value:s?new Date(s):null,dataTest:"Due Date",onBlur:({valid:l,value:a})=>{if(l){try{a=a.toDate()}catch{}new Date(D(a)).getTime()!==new Date(s).getTime()&&(t(D(a)),p({keyToUpdate:"dueDate",value:D(a),description:"Due Date"}))}else d("Invalid Due Date")},disabledText:"No Due Date",disabledOnClick:()=>{let l="Next Week",a=new Date;a.setDate(a.getDate()+7);let i=D(a);t(i),p({keyToUpdate:"dueDate",value:i,description:"Due Date",valueDescription:l})}})]})]})},Te=({courseId:e,doenetId:n})=>{const{value:{timeLimit:d},updateAssignmentSettings:u}=A(e,n),[p,s]=m.useState(d),[t,l]=m.useState(!!d);return h(v,{children:[o(y,{children:"Time Limit in Minutes"}),h(S,{onClick:a=>a.preventDefault(),children:[o(w,{style:{marginRight:"5px"},dataTest:"Time Limit Checkbox",checked:t,onClick:()=>{let a="Not Limited",i=null,r=!1;t||(a="60 Minutes",i=60,r=!0),s(i),l(r),u({keyToUpdate:"timeLimit",value:i,description:"Time Limit ",valueDescription:a})}}),o(B,{disabled:!t,value:p,dataTest:"Time Limit",min:1,width:"180px",onBlur:a=>{(isNaN(a)||a<1)&&(a=1),s(parseInt(a)),u({keyToUpdate:"timeLimit",value:parseInt(a),description:"Time Limit",valueDescription:`${a} Minutes`})},onChange:a=>s(parseInt(a))})]})]})},ke=({courseId:e,doenetId:n})=>{const{value:{numberOfAttemptsAllowed:d},updateAssignmentSettings:u}=A(e,n),[p,s]=m.useState(d),[t,l]=m.useState(!!d);return h(v,{children:[o(y,{children:"Attempts"}),h(S,{onClick:a=>a.preventDefault(),children:[o(w,{style:{marginRight:"5px"},dataTest:"Attempt Limit Checkbox",checked:t,onClick:()=>{let a="Not Limited",i=null,r=!1;t||(a="1",i=1,r=!0),s(i),l(r),u({keyToUpdate:"numberOfAttemptsAllowed",value:i,description:"Attempts Allowed",valueDescription:a})}}),o(B,{disabled:!t,value:p,dataTest:"Attempt Limit",width:"180px",min:1,onBlur:a=>{(isNaN(a)||a<1)&&(a=1),s(parseInt(a)),u({keyToUpdate:"numberOfAttemptsAllowed",value:parseInt(a),description:"Attempts Allowed"})},onChange:a=>s(parseInt(a))})]})]})},ve=({courseId:e,doenetId:n})=>{const{value:{attemptAggregation:d},updateAssignmentSettings:u}=A(e,n),[p,s]=m.useState();return m.useEffect(()=>{s(d)},[d]),h(v,{children:[o(y,{children:"Attempt Aggregation"}),o(S,{children:o(j,{dataTest:"Attempt Aggregation",width:"menu",valueIndex:p==="m"?1:2,items:[["m","Maximum"],["l","Last Attempt"]],onChange:({value:t})=>{let l="Maximum";t==="l"&&(l="Last Attempt"),s(t),u({keyToUpdate:"attemptAggregation",value:t,description:"Attempt Aggregation",valueDescription:l})}})})]})},ye=({courseId:e,doenetId:n})=>{const{value:{totalPointsOrPercent:d},updateAssignmentSettings:u}=A(e,n),[p,s]=m.useState();return m.useEffect(()=>{s(d)},[d]),h(v,{children:[o(y,{children:"Total Points Or Percent"}),o(S,{children:o(B,{value:p,dataTest:"Total Points Or Percent",min:0,onBlur:t=>{if(t!==d){let l=null;t<0||t===""||isNaN(t)?(s(0),l=0):(l=parseFloat(t),s(parseFloat(t))),u(n,{keyToUpdate:"totalPointsOrPercent",value:l,description:"Total Points Or Percent"})}},onChange:t=>s(t)})})]})},we=({courseId:e,doenetId:n})=>{const{value:{gradeCategory:d},updateAssignmentSettings:u}=A(e,n),[p,s]=m.useState();return m.useEffect(()=>{s(d)},[d]),h(v,{children:[o(y,{children:"Grade Category"}),o(j,{defaultIndex:"7",valueIndex:{gateway:1,exams:2,quizzes:3,"problem sets":4,projects:5,participation:6,"No Category":7}[p],items:[["gateway","Gateway"],["exams","Exams"],["quizzes","Quizzes"],["problem sets","Problem Sets"],["projects","Projects"],["participation","Participation"],["NULL","No Category"]],dataTest:"Grade Category",onChange:({value:t})=>{d!==t&&(s(t),u({keyToUpdate:"gradeCategory",value:t,description:"Grade Category"}))}})]})},Se=({courseId:e,doenetId:n})=>{const{value:{itemWeights:d},updateAssignmentSettings:u}=A(e,n),[p,s]=m.useState("");return m.useEffect(()=>{s(d==null?void 0:d.join(" "))},[d]),h(v,{children:[o(y,{children:"Item Weights"}),o(ae,{vertical:!0,width:"menu",value:p,dataTest:"Item Weights",onChange:t=>{s(t.target.value)},onBlur:()=>{let t=p.split(" ").filter(l=>l).map(Number).map(l=>l>=0?l:0);(d.length!==t.length||d.some((l,a)=>l!==t[a]))&&u({keyToUpdate:"itemWeights",value:t,description:"Item Weights"})}})]})},T=({courseId:e,doenetId:n,keyToUpdate:d,description:u,label:p,invert:s,dataTest:t})=>{const{value:{[d]:l},updateAssignmentSettings:a}=A(e,n),[i,r]=m.useState(l);return m.useEffect(()=>{r(l)},[s,l]),h(v,{flex:!0,children:[o(w,{style:{marginRight:"5px"},dataTest:t,checked:s?!i:i,onClick:()=>{let c=s?"True":"False",g=!1;i||(c=s?"False":"True",g=!0),r(g),a({keyToUpdate:d,value:g,description:u,valueDescription:c})}}),o(_,{children:p??u})]})},E=({courseId:e,doenetId:n,keyToUpdate:d,description:u,label:p,invert:s,dataTest:t})=>{const{value:{[d]:l},updateActivityFlags:a}=A(e,n),[i,r]=m.useState(l);return m.useEffect(()=>{r(l)},[l,s]),h(v,{flex:!0,children:[o(w,{style:{marginRight:"5px"},dataTest:t,checked:s?!i:i,onClick:()=>{let c=s?"True":"False",g=!1;i||(c=s?"False":"True",g=!0),r(g),a({keyToUpdate:d,value:g,description:u,valueDescription:c})}}),o(_,{children:p??u})]})},be=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"individualize",description:"Individualize",dataTest:"Individualize"}),Ce=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"showSolution",description:"Show Solution",dataTest:"Show Solution"}),xe=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"showSolutionInGradebook",description:"Show Solution In Gradebook",dataTest:"Show Solution In Gradebook"}),Ue=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"showFeedback",description:"Show Feedback",dataTest:"Show Feedback"}),Pe=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"showHints",description:"Show Hints",dataTest:"Show Hints"}),Ne=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"showCorrectness",description:"Show Correctness",dataTest:"Show Correctness"}),Le=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"showCreditAchievedMenu",description:"Show Credit Achieved Menu",dataTest:"Show Credit Achieved Menu"}),Ie=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"paginate",description:"Paginate",dataTest:"Paginate"}),Oe=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"showFinishButton",description:"Show Finish Button",dataTest:"Show Finish Button"}),Fe=({courseId:e,doenetId:n})=>o(E,{courseId:e,doenetId:n,keyToUpdate:"isPublic",description:"Make Publicly Visible",dataTest:"Make Publicly Visible"}),Me=({courseId:e,doenetId:n})=>o(E,{courseId:e,doenetId:n,keyToUpdate:"userCanViewSource",description:"Show DoenetML Source",dataTest:"Show DoenetML Source"}),Ve=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"canViewAfterCompleted",description:"Can View After Completed",dataTest:"Can View After Completed"}),Re=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"proctorMakesAvailable",description:"Proctor Makes Available",dataTest:"Proctor Makes Available"}),ze=({courseId:e,doenetId:n})=>o(T,{courseId:e,doenetId:n,keyToUpdate:"autoSubmit",description:"Auto Submit",dataTest:"Auto Submit"}),Be=({courseId:e,doenetId:n})=>{const d=x(),{value:{pinnedUntilDate:u,pinnedAfterDate:p},updateAssignmentSettings:s}=A(e,n),[t,l]=m.useState(u),[a,i]=m.useState(p);return m.useEffect(()=>{l(u)},[u]),m.useEffect(()=>{i(p)},[p]),h(v,{children:[o(y,{children:"Pin Assignment"}),h(S,{onClick:r=>r.preventDefault(),children:[o(w,{style:{marginRight:"5px"},checkedIcon:o(b,{icon:R}),uncheckedIcon:o(b,{icon:z}),checked:t!=null,dataTest:"Pin Assignment Checkbox",onClick:()=>{let r="None",c=null,g=null;if(t==null){r="Now to Next Year";let k=new Date,f=new Date;f.setDate(f.getDate()+365),c=D(k),g=D(f)}i(c),l(g),s({keyToUpdate:"pinnedAfterDate",value:c,description:"Pinned Dates ",valueDescription:r},{keyToUpdate:"pinnedUntilDate",value:g})}}),h("div",{style:{display:"flex",flexDirection:"column"},children:[o(N,{width:"176px",dataTest:"Pinned After Date",disabled:a==null,disabledText:"No Pinned After Date",disabledOnClick:()=>{let r="None",c=null,g=null;if(a==null){r="Now to Next Year";let k=new Date,f=new Date;f.setDate(f.getDate()+365),c=D(k),g=D(f)}i(c),l(g),s({keyToUpdate:"pinnedAfterDate",value:c,description:"Pinned Dates ",valueDescription:r},{keyToUpdate:"pinnedUntilDate",value:g})},value:a?new Date(a):null,onBlur:({valid:r,value:c})=>{if(r){try{c=c.toDate()}catch{}new Date(D(c)).getTime()!==new Date(a).getTime()&&(i(D(c)),s({keyToUpdate:"pinnedAfterDate",value:D(c),description:"Pinned After Date"}))}else d("Invalid Pin After Date")}}),o(N,{width:"176px",dataTest:"Pinned Until Date",style:{marginTop:"5px"},disabled:t==null,disabledText:"No Pinned Until Date",disabledOnClick:()=>{let r="None",c=null,g=null;if(t==null){r="Now to Next Year";let k=new Date,f=new Date;f.setDate(f.getDate()+365),c=D(k),g=D(f)}i(c),l(g),s({keyToUpdate:"pinnedAfterDate",value:c,description:"Pinned Dates ",valueDescription:r},{keyToUpdate:"pinnedUntilDate",value:g})},value:t?new Date(t):null,onBlur:({valid:r,value:c})=>{if(r){try{c=c.toDate()}catch{}new Date(D(c)).getTime()!==new Date(t).getTime()&&(l(D(c)),s({keyToUpdate:"pinnedUntilDate",value:D(c),description:"Pinned Until Date"}))}else d("Invalid Pin Until Date")}})]})]})]})};function Ee({courseId:e,doenetId:n}){const{value:{isGloballyAssigned:d}}=A(e,n),{value:u}=V(Z(e)),[p,s]=m.useState([]);async function t({courseId:i,doenetId:r}){let c=await C.get("/api/getRestrictedTo.php",{params:{courseId:i,doenetId:r}});s(c.data.restrictedTo)}async function l({courseId:i,doenetId:r,emailAddresses:c}){(await C.post("/api/updateRestrictedTo.php",{courseId:i,doenetId:r,emailAddresses:c})).data.success&&s(c)}m.useEffect(()=>{d||t({courseId:e,doenetId:n})},[e,n,d]);let a=u.reduce((i,r)=>r.withdrew=="0"?!d&&p.includes(r.email)?[...i,h("option",{selected:!0,value:r.email,children:[r.firstName," ",r.lastName]},`enrolledOpt${r.email}`)]:[...i,h("option",{value:r.email,children:[r.firstName," ",r.lastName]},`enrolledOpt${r.email}`)]:i,[]);return h(K,{children:[o(E,{courseId:e,doenetId:n,keyToUpdate:"isGloballyAssigned",description:"Restrict Assignment",invert:!0}),o(ee,{width:"menu",options:a,disabled:d,onChange:i=>{let r=Array.from(i.target.selectedOptions,c=>c.value);l({courseId:e,doenetId:n,emailAddresses:r})},multiple:!0})]})}export{he as A,Ve as C,Ae as D,we as G,Se as I,Fe as M,Ie as P,Ce as S,Te as T,Ee as a,fe as b,ke as c,ve as d,ye as e,be as f,xe as g,Ue as h,Pe as i,Ne as j,Le as k,Oe as l,Re as m,ze as n,Me as o,Be as p,A as u}; diff --git a/dist/assets/SettingComponents-ce5fbb6e.js b/dist/assets/SettingComponents-43f86399.js similarity index 96% rename from dist/assets/SettingComponents-ce5fbb6e.js rename to dist/assets/SettingComponents-43f86399.js index 03594afb3b..896ae45685 100644 --- a/dist/assets/SettingComponents-ce5fbb6e.js +++ b/dist/assets/SettingComponents-43f86399.js @@ -1,4 +1,4 @@ -import{s as y,a_ as O,r as f,j as t,a as w,a6 as I,l as S,aG as E,a$ as _,B as x,y as D,a5 as $,F as N,b as U,aF as z,A as j,z as G,R as W,b0 as T}from"./index-99a56692.js";import{d as q}from"./CourseToolHandler-f517d0e5.js";import{B as A}from"./ButtonGroup-ea123297.js";import{C as H}from"./CollapseSection-a6fcd8bf.js";import{d as R,a as L}from"./util-38d8e238.js";import{D as P}from"./DateTime-ef0be144.js";import{D as B}from"./DropdownMenu-9b4c45a6.js";import{R as J}from"./RelatedItems-96588168.js";import{R as V}from"./RoleDropdown-5e05ae49.js";import{T as k}from"./Textfield-5d92f495.js";const Q=y.button` +import{s as y,a_ as O,r as f,j as t,a as w,a6 as I,l as S,aG as E,a$ as _,B as x,y as D,a5 as $,F as N,b as U,aF as z,A as j,z as G,R as W,b0 as T}from"./index-7074710c.js";import{d as q}from"./CourseToolHandler-8716455d.js";import{B as A}from"./ButtonGroup-9136da6d.js";import{C as H}from"./CollapseSection-cb27678a.js";import{d as R,a as L}from"./util-38d8e238.js";import{D as P}from"./DateTime-d0a20943.js";import{D as B}from"./DropdownMenu-f3593bed.js";import{R as J}from"./RelatedItems-33b68fba.js";import{R as V}from"./RoleDropdown-cce90708.js";import{T as k}from"./Textfield-9c1c2968.js";const Q=y.button` border-radius: var(--mainBorderRadius); border: none; height: 36px; diff --git a/dist/assets/SignIn-7d60e5d1.js b/dist/assets/SignIn-bd7fec31.js similarity index 98% rename from dist/assets/SignIn-7d60e5d1.js rename to dist/assets/SignIn-bd7fec31.js index 41251dc28d..838abe349c 100644 --- a/dist/assets/SignIn-7d60e5d1.js +++ b/dist/assets/SignIn-bd7fec31.js @@ -1,4 +1,4 @@ -import{r as a,y as K,k as U,z as D,j as e,a as R,B as L,A as M}from"./index-99a56692.js";import{T as $}from"./Textfield-5d92f495.js";var N={},V={get exports(){return N},set exports(m){N=m}};/*! +import{r as a,y as K,k as U,z as D,j as e,a as R,B as L,A as M}from"./index-7074710c.js";import{T as $}from"./Textfield-9c1c2968.js";var N={},V={get exports(){return N},set exports(m){N=m}};/*! * JavaScript Cookie v2.2.1 * https://github.com/js-cookie/js-cookie * diff --git a/dist/assets/SignInRedirector-dac636ed.js b/dist/assets/SignInRedirector-0d623eba.js similarity index 75% rename from dist/assets/SignInRedirector-dac636ed.js rename to dist/assets/SignInRedirector-0d623eba.js index 416d01a703..5b61b738fa 100644 --- a/dist/assets/SignInRedirector-dac636ed.js +++ b/dist/assets/SignInRedirector-0d623eba.js @@ -1 +1 @@ -import{l,m as s,R as n,p as i,k as r,a9 as t}from"./index-99a56692.js";function c(){const o=l(s("doenetId")),a=n(i);return r.get("/api/umn/shibToJWT.php",{params:{doenetId:o}}).then(({data:e})=>{if(console.log("data",e),e.success){if(!e.isEnrolled)return console.log("ERROR!"),null;e.needToClearOutPreviousUser?(localStorage.clear(),t().then(()=>{a({page:"placementexam",tool:"exam",view:"",params:{doenetId:o}})})):a({page:"placementexam",tool:"exam",view:"",params:{doenetId:o}})}}),null}export{c as default}; +import{l,m as s,R as n,p as i,k as r,a9 as t}from"./index-7074710c.js";function c(){const o=l(s("doenetId")),a=n(i);return r.get("/api/umn/shibToJWT.php",{params:{doenetId:o}}).then(({data:e})=>{if(console.log("data",e),e.success){if(!e.isEnrolled)return console.log("ERROR!"),null;e.needToClearOutPreviousUser?(localStorage.clear(),t().then(()=>{a({page:"placementexam",tool:"exam",view:"",params:{doenetId:o}})})):a({page:"placementexam",tool:"exam",view:"",params:{doenetId:o}})}}),null}export{c as default}; diff --git a/dist/assets/SignOut-22ad4d36.js b/dist/assets/SignOut-57113399.js similarity index 96% rename from dist/assets/SignOut-22ad4d36.js rename to dist/assets/SignOut-57113399.js index 335299c5f5..80b27e87cf 100644 --- a/dist/assets/SignOut-22ad4d36.js +++ b/dist/assets/SignOut-57113399.js @@ -1 +1 @@ -import{r as o,R as h,p,D as m,j as e,a as t,B as f,d as y}from"./index-99a56692.js";function v(){const[a,s]=o.useState(!1),[n,l]=o.useState(""),c=h(p);return o.useEffect(()=>{async function i(){let{userInformationIsCompletelyRemoved:r,messageArray:d}=await y();s(r),l(d.map((g,u)=>e("p",{children:g},`error ${u}`)))}m().then(()=>{i()}).catch(r=>{i()})},[]),a?e("div",{children:t("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"flex",justifyContent:"center",alignItems:"center",margin:"20"},children:[e("img",{style:{width:"250px",height:"250px"},src:"/Doenet_Logo_Frontpage.png",alt:"Chocolate glazed donut on a white cartoon cloud, sitting on a sky blue circle background"}),t("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[e("h2",{children:"You are Signed Out!"}),e(f,{dataTest:"homepage button",value:"Homepage",onClick:()=>{c({page:"home",tool:"",view:""})}})]})]})}):n!=""?e("div",{children:t("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"flex",justifyContent:"center",alignItems:"center",margin:"20"},children:[e("img",{style:{width:"250px",height:"250px"},src:"/Doenet_Logo_Frontpage.png",alt:"Chocolate glazed donut on a white cartoon cloud, sitting on a sky blue circle background"}),t("div",{children:[e("h2",{children:"FAILED SIGN OUT"}),e("p",{children:n}),e("p",{children:"Please manually remove your cookies."})]})]})}):e("div",{children:t("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"flex",justifyContent:"center",alignItems:"center",margin:"20"},children:[e("img",{style:{width:"250px",height:"250px"},src:"/Doenet_Logo_Frontpage.png",alt:"Chocolate glazed donut on a white cartoon cloud, sitting on a sky blue circle background"}),e("div",{children:e("h2",{children:"Signing you out..."})})]})})}export{v as default}; +import{r as o,R as h,p,D as m,j as e,a as t,B as f,d as y}from"./index-7074710c.js";function v(){const[a,s]=o.useState(!1),[n,l]=o.useState(""),c=h(p);return o.useEffect(()=>{async function i(){let{userInformationIsCompletelyRemoved:r,messageArray:d}=await y();s(r),l(d.map((g,u)=>e("p",{children:g},`error ${u}`)))}m().then(()=>{i()}).catch(r=>{i()})},[]),a?e("div",{children:t("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"flex",justifyContent:"center",alignItems:"center",margin:"20"},children:[e("img",{style:{width:"250px",height:"250px"},src:"/Doenet_Logo_Frontpage.png",alt:"Chocolate glazed donut on a white cartoon cloud, sitting on a sky blue circle background"}),t("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[e("h2",{children:"You are Signed Out!"}),e(f,{dataTest:"homepage button",value:"Homepage",onClick:()=>{c({page:"home",tool:"",view:""})}})]})]})}):n!=""?e("div",{children:t("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"flex",justifyContent:"center",alignItems:"center",margin:"20"},children:[e("img",{style:{width:"250px",height:"250px"},src:"/Doenet_Logo_Frontpage.png",alt:"Chocolate glazed donut on a white cartoon cloud, sitting on a sky blue circle background"}),t("div",{children:[e("h2",{children:"FAILED SIGN OUT"}),e("p",{children:n}),e("p",{children:"Please manually remove your cookies."})]})]})}):e("div",{children:t("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"flex",justifyContent:"center",alignItems:"center",margin:"20"},children:[e("img",{style:{width:"250px",height:"250px"},src:"/Doenet_Logo_Frontpage.png",alt:"Chocolate glazed donut on a white cartoon cloud, sitting on a sky blue circle background"}),e("div",{children:e("h2",{children:"Signing you out..."})})]})})}export{v as default}; diff --git a/dist/assets/SupportingFilesMenu-8dca5c6c.js b/dist/assets/SupportingFilesMenu-c25413f6.js similarity index 94% rename from dist/assets/SupportingFilesMenu-8dca5c6c.js rename to dist/assets/SupportingFilesMenu-c25413f6.js index 5cf14f0358..f210333fba 100644 --- a/dist/assets/SupportingFilesMenu-8dca5c6c.js +++ b/dist/assets/SupportingFilesMenu-c25413f6.js @@ -1 +1 @@ -import{y as se,l as re,m as ne,g as pe,r as x,v as N,k as b,z as f,b1 as de,a as u,F as ue,j as t,B as ce,ay as ge,az as K,i as Q}from"./index-99a56692.js";import{A as q}from"./ActionButtonGroup-a395ceaf.js";import{A as C}from"./ActionButton-f612d279.js";import{B as he}from"./ButtonGroup-ea123297.js";import{C as me}from"./CollapseSection-a6fcd8bf.js";import{l as G}from"./index-ef9c2520.js";import{f as H}from"./index-47ca4f11.js";import"./index-fcf36459.js";function L(n){var a=["Bytes","KB","MB","GB","TB"];if(n==0)return"0 Byte";var l=parseInt(Math.floor(Math.log(n)/Math.log(1024)));return Math.round(n/Math.pow(1024,l),2)+" "+a[l]}const J=ge({key:"supportingFilesAndPermissionByDoenetId",default:K({key:"supportingFilesAndPermissionByDoenetId/Default",get:n=>async()=>{let{data:a}=await b.get("/api/loadSupprtingFileInfo.php",{params:{doenetId:n}});return a}})}),A=K({get:n=>({get:a})=>a(J(n)),set:n=>({set:a},l)=>{a(J(n),l)}});function T({text:n,submit:a}){a||(a=()=>{});let[l,F]=x.useState(!1),[y,S]=x.useState(n),v=n;l||(v=y);let $={width:"110px",display:"inline-block",textOverflow:"ellipsis",whiteSpace:"nowrap"};return v===""&&(v=" *Required",$.border="solid 2px var(--mainRed)"),l?t("input",{autoFocus:!0,type:"text",style:{width:"116px"},value:y,onChange:w=>S(w.target.value),onBlur:w=>{F(!1),a(y)},onKeyDown:w=>{w.key==="Enter"&&(F(!1),a(y))}}):t("span",{style:$,onClick:()=>F(!0),children:v})}function Be(n){const a=se(),l=re(ne("doenetId")),[{canUpload:F,userQuotaBytesAvailable:y,supportingFiles:S,quotaBytes:v,canEditContent:$},w]=pe(A(l));let X=["text/csv","image/jpeg","image/png"],[V,D]=x.useState([]),R=x.useRef(0);const W=N(({set:i})=>async(r,s)=>{await b.get("/api/updateFileDescription.php",{params:{doenetId:l,cid:s,description:r}}),i(A(l),c=>{let g={...c},e=[...c.supportingFiles];return e.map((p,o)=>{p.cid===s&&(e[o]={...e[o]},e[o].description=r)}),g.supportingFiles=e,g})},[l]),_=N(({set:i})=>async(r,s)=>{await b.get("/api/updateFileAsFileName.php",{params:{doenetId:l,cid:s,asFileName:r}}),i(A(l),c=>{let g={...c},e=[...c.supportingFiles];return e.map((p,o)=>{p.cid===s&&(e[o]={...e[o]},e[o].asFileName=r)}),g.supportingFiles=e,g})},[l]),z=N(({set:i})=>async r=>{var s,c,g;try{let e=await b.get("/api/deleteFile.php",{params:{doenetId:l,cid:r}});if(e.status<300&&((s=e==null?void 0:e.data)!=null&&s.success)){a("File deleted.");let{userQuotaBytesAvailable:p}=e.data;i(A(l),o=>{let h={...o};return h.supportingFiles=o.supportingFiles.filter(d=>d.cid!==r),h.userQuotaBytesAvailable=p,h})}else if(((c=e==null?void 0:e.data)==null?void 0:c.success)==!1)a((g=e==null?void 0:e.data)==null?void 0:g.message,f.ERROR);else throw new Error(`response code: ${e.status}`)}catch(e){throw new Error(`Error deleting file ${e}`)}},[l]),Y=x.useCallback(i=>{let r=!0,s=0;i.map(e=>{X.includes(e.type)||(a(`File '${e.name}' of type '${e.type}' is not allowed. No files uploaded.`,f.ERROR),r=!1),s+=e.size});let c=L(s),g=L(s-y);s>y&&(a(`Upload size ${c} exceeds quota by ${g}. No files uploaded.`,f.ERROR),r=!1),R.current>0&&(a("Already uploading files. Please wait before sending more.",f.ERROR),r=!1),i.map(e=>{e.size>=1e6&&(a(`File '${e.name}' is larger than 1MB. No files uploaded.`,f.ERROR),r=!1)}),r&&(R.current=i.length,i.map(e=>{let p={fileName:e.name,size:e.size,progressPercent:0};D(o=>[...o,p])}),i.map((e,p)=>{const o=new FileReader;o.readAsDataURL(e),o.onabort=()=>{},o.onerror=()=>{},o.onload=()=>{const h=new FormData;h.append("file",e),h.append("doenetId",l),b.post("/api/upload.php",h,{onUploadProgress:d=>{const m=d.lengthComputable?d.total:d.target.getResponseHeader("content-length")||d.target.getResponseHeader("x-decompressed-content-length");if(m!==null){let I=Math.round(d.loaded*100/m);D(O=>{let B=[...O];return B[p].progressPercent=I,B})}}}).then(({data:d})=>{R.current=R.current-1,R.current<1&&D([]);let{success:m,fileName:I,cid:O,asFileName:B,width:ae,height:oe,msg:E,userQuotaBytesAvailable:le}=d;E&&(m?a(E,f.INFO):a(E,f.ERROR)),m&&w(U=>{let M={...U},k=[...U.supportingFiles];return k.push({cid:O,fileName:I,fileType:e.type,width:ae,height:oe,description:"",asFileName:B}),M.supportingFiles=k,M.userQuotaBytesAvailable=le,M})})}}))},[]),{getRootProps:Z,getInputProps:ee,isDragActive:te}=de({onDrop:Y});let ie=V.map(i=>u("div",{children:[i.fileName," - ",i.progressPercent,"%"]},`${i.fileName}`)),j=null;F&&(j=u(ue,{children:[u("div",{children:[y,"/",v," Bytes"]}),u("div",{...Z(),children:[t("input",{...ee()}),te?t("p",{children:"Drop the files here"}):t(he,{vertical:!0,children:t(ce,{width:"menu",value:"Upload files"})})]},"drop"),t(me,{title:"Accepted File Types",collapsed:!0,children:u("div",{children:[t("b",{children:"Image"}),".jpg .png .csv"]})}),ie]}));let P=[];return S.map(({cid:i,fileName:r,fileType:s,width:c,height:g,description:e,asFileName:p})=>{let o="Error",h=`doenet:cid=${i}`;if(s==="image/jpeg"||s==="image/png"){o=``;let d={};P.push(u("div",{children:[u("div",{children:[t("span",{style:{width:"116px"},children:"asFileName:"}),t(T,{text:p,submit:m=>{_(m,i)}})]}),u("div",{style:d,children:[t("span",{style:{width:"116px"},children:"description:"}),t(T,{text:e,submit:m=>{W(m,i)}})]}),t("div",{children:u(q,{width:"menu",children:[F?t(C,{alert:!0,value:"Delete",onClick:()=>{z(i)}}):null,t(G.CopyToClipboard,{onCopy:()=>a("Code copied to clipboard!",f.SUCCESS),text:o,children:t(C,{disabled:e=="",icon:t(Q,{icon:H}),value:"Copy Code"})})]})}),t("hr",{})]},`${i}`))}else s==="text/csv"&&(o=``,P.push(u("div",{children:[t("div",{children:u("span",{style:{width:"116px"},children:["fileName: ",t(T,{text:p,submit:d=>{_(d,i)}})]})}),t("div",{children:u(q,{width:"menu",children:[F?t(C,{alert:!0,value:"Delete",onClick:()=>{z(i)}}):null,t(G.CopyToClipboard,{onCopy:()=>a("Code copied to clipboard!",f.SUCCESS),text:o,children:t(C,{icon:t(Q,{icon:H}),value:"Copy Code"})})]})}),t("hr",{})]},`${i}`)))}),u("div",{children:[j,t("br",{}),P]})}export{Be as default}; +import{y as se,l as re,m as ne,g as pe,r as x,v as N,k as b,z as f,b1 as de,a as u,F as ue,j as t,B as ce,ay as ge,az as K,i as Q}from"./index-7074710c.js";import{A as q}from"./ActionButtonGroup-f4ce05e4.js";import{A as C}from"./ActionButton-e5ea2a2f.js";import{B as he}from"./ButtonGroup-9136da6d.js";import{C as me}from"./CollapseSection-cb27678a.js";import{l as G}from"./index-67ec2c85.js";import{f as H}from"./index-47ca4f11.js";import"./index-fcf36459.js";function L(n){var a=["Bytes","KB","MB","GB","TB"];if(n==0)return"0 Byte";var l=parseInt(Math.floor(Math.log(n)/Math.log(1024)));return Math.round(n/Math.pow(1024,l),2)+" "+a[l]}const J=ge({key:"supportingFilesAndPermissionByDoenetId",default:K({key:"supportingFilesAndPermissionByDoenetId/Default",get:n=>async()=>{let{data:a}=await b.get("/api/loadSupprtingFileInfo.php",{params:{doenetId:n}});return a}})}),A=K({get:n=>({get:a})=>a(J(n)),set:n=>({set:a},l)=>{a(J(n),l)}});function T({text:n,submit:a}){a||(a=()=>{});let[l,F]=x.useState(!1),[y,S]=x.useState(n),v=n;l||(v=y);let $={width:"110px",display:"inline-block",textOverflow:"ellipsis",whiteSpace:"nowrap"};return v===""&&(v=" *Required",$.border="solid 2px var(--mainRed)"),l?t("input",{autoFocus:!0,type:"text",style:{width:"116px"},value:y,onChange:w=>S(w.target.value),onBlur:w=>{F(!1),a(y)},onKeyDown:w=>{w.key==="Enter"&&(F(!1),a(y))}}):t("span",{style:$,onClick:()=>F(!0),children:v})}function Be(n){const a=se(),l=re(ne("doenetId")),[{canUpload:F,userQuotaBytesAvailable:y,supportingFiles:S,quotaBytes:v,canEditContent:$},w]=pe(A(l));let X=["text/csv","image/jpeg","image/png"],[V,D]=x.useState([]),R=x.useRef(0);const W=N(({set:i})=>async(r,s)=>{await b.get("/api/updateFileDescription.php",{params:{doenetId:l,cid:s,description:r}}),i(A(l),c=>{let g={...c},e=[...c.supportingFiles];return e.map((p,o)=>{p.cid===s&&(e[o]={...e[o]},e[o].description=r)}),g.supportingFiles=e,g})},[l]),_=N(({set:i})=>async(r,s)=>{await b.get("/api/updateFileAsFileName.php",{params:{doenetId:l,cid:s,asFileName:r}}),i(A(l),c=>{let g={...c},e=[...c.supportingFiles];return e.map((p,o)=>{p.cid===s&&(e[o]={...e[o]},e[o].asFileName=r)}),g.supportingFiles=e,g})},[l]),z=N(({set:i})=>async r=>{var s,c,g;try{let e=await b.get("/api/deleteFile.php",{params:{doenetId:l,cid:r}});if(e.status<300&&((s=e==null?void 0:e.data)!=null&&s.success)){a("File deleted.");let{userQuotaBytesAvailable:p}=e.data;i(A(l),o=>{let h={...o};return h.supportingFiles=o.supportingFiles.filter(d=>d.cid!==r),h.userQuotaBytesAvailable=p,h})}else if(((c=e==null?void 0:e.data)==null?void 0:c.success)==!1)a((g=e==null?void 0:e.data)==null?void 0:g.message,f.ERROR);else throw new Error(`response code: ${e.status}`)}catch(e){throw new Error(`Error deleting file ${e}`)}},[l]),Y=x.useCallback(i=>{let r=!0,s=0;i.map(e=>{X.includes(e.type)||(a(`File '${e.name}' of type '${e.type}' is not allowed. No files uploaded.`,f.ERROR),r=!1),s+=e.size});let c=L(s),g=L(s-y);s>y&&(a(`Upload size ${c} exceeds quota by ${g}. No files uploaded.`,f.ERROR),r=!1),R.current>0&&(a("Already uploading files. Please wait before sending more.",f.ERROR),r=!1),i.map(e=>{e.size>=1e6&&(a(`File '${e.name}' is larger than 1MB. No files uploaded.`,f.ERROR),r=!1)}),r&&(R.current=i.length,i.map(e=>{let p={fileName:e.name,size:e.size,progressPercent:0};D(o=>[...o,p])}),i.map((e,p)=>{const o=new FileReader;o.readAsDataURL(e),o.onabort=()=>{},o.onerror=()=>{},o.onload=()=>{const h=new FormData;h.append("file",e),h.append("doenetId",l),b.post("/api/upload.php",h,{onUploadProgress:d=>{const m=d.lengthComputable?d.total:d.target.getResponseHeader("content-length")||d.target.getResponseHeader("x-decompressed-content-length");if(m!==null){let I=Math.round(d.loaded*100/m);D(O=>{let B=[...O];return B[p].progressPercent=I,B})}}}).then(({data:d})=>{R.current=R.current-1,R.current<1&&D([]);let{success:m,fileName:I,cid:O,asFileName:B,width:ae,height:oe,msg:E,userQuotaBytesAvailable:le}=d;E&&(m?a(E,f.INFO):a(E,f.ERROR)),m&&w(U=>{let M={...U},k=[...U.supportingFiles];return k.push({cid:O,fileName:I,fileType:e.type,width:ae,height:oe,description:"",asFileName:B}),M.supportingFiles=k,M.userQuotaBytesAvailable=le,M})})}}))},[]),{getRootProps:Z,getInputProps:ee,isDragActive:te}=de({onDrop:Y});let ie=V.map(i=>u("div",{children:[i.fileName," - ",i.progressPercent,"%"]},`${i.fileName}`)),j=null;F&&(j=u(ue,{children:[u("div",{children:[y,"/",v," Bytes"]}),u("div",{...Z(),children:[t("input",{...ee()}),te?t("p",{children:"Drop the files here"}):t(he,{vertical:!0,children:t(ce,{width:"menu",value:"Upload files"})})]},"drop"),t(me,{title:"Accepted File Types",collapsed:!0,children:u("div",{children:[t("b",{children:"Image"}),".jpg .png .csv"]})}),ie]}));let P=[];return S.map(({cid:i,fileName:r,fileType:s,width:c,height:g,description:e,asFileName:p})=>{let o="Error",h=`doenet:cid=${i}`;if(s==="image/jpeg"||s==="image/png"){o=``;let d={};P.push(u("div",{children:[u("div",{children:[t("span",{style:{width:"116px"},children:"asFileName:"}),t(T,{text:p,submit:m=>{_(m,i)}})]}),u("div",{style:d,children:[t("span",{style:{width:"116px"},children:"description:"}),t(T,{text:e,submit:m=>{W(m,i)}})]}),t("div",{children:u(q,{width:"menu",children:[F?t(C,{alert:!0,value:"Delete",onClick:()=>{z(i)}}):null,t(G.CopyToClipboard,{onCopy:()=>a("Code copied to clipboard!",f.SUCCESS),text:o,children:t(C,{disabled:e=="",icon:t(Q,{icon:H}),value:"Copy Code"})})]})}),t("hr",{})]},`${i}`))}else s==="text/csv"&&(o=``,P.push(u("div",{children:[t("div",{children:u("span",{style:{width:"116px"},children:["fileName: ",t(T,{text:p,submit:d=>{_(d,i)}})]})}),t("div",{children:u(q,{width:"menu",children:[F?t(C,{alert:!0,value:"Delete",onClick:()=>{z(i)}}):null,t(G.CopyToClipboard,{onCopy:()=>a("Code copied to clipboard!",f.SUCCESS),text:o,children:t(C,{icon:t(Q,{icon:H}),value:"Copy Code"})})]})}),t("hr",{})]},`${i}`)))}),u("div",{children:[j,t("br",{}),P]})}export{Be as default}; diff --git a/dist/assets/SurveyDataViewer-e3a247b1.js b/dist/assets/SurveyDataViewer-ada0bb46.js similarity index 95% rename from dist/assets/SurveyDataViewer-e3a247b1.js rename to dist/assets/SurveyDataViewer-ada0bb46.js index 97ac3587f8..fba57a15f9 100644 --- a/dist/assets/SurveyDataViewer-e3a247b1.js +++ b/dist/assets/SurveyDataViewer-ada0bb46.js @@ -1 +1 @@ -import{l as m,m as p,r as u,a3 as b,j as a,a as v,k as I}from"./index-99a56692.js";function O(){let n=m(p("doenetId")),y=m(p("driveId")),[o,S]=u.useState(null);if(u.useEffect(()=>{async function l(t){let{data:r}=await I.get("/api/getSurveyData.php",{params:{doenetId:t}});S(r.responses)}n&&l(n)},[n]),!y||!o)return null;let i=["User's Name","Email","Student Id"];for(let l of o){let t=JSON.parse(l.stateVariables,b);for(let r of Object.keys(t))if(!i.includes(r)){let e=t[r];(e!=null&&e.immediateValue||e!=null&&e.value||e!=null&&e.allSelectedIndices)&&i.push(r)}}let c=[];for(let[l,t]of Object.entries(o)){let r=JSON.parse(t.stateVariables,b),e=[];for(let[h,x]of Object.entries(i))if(h>2){let s=r[x],d="N/A";s!=null&&s.immediateValue?d=s.immediateValue:s!=null&&s.value?d=s.value:s!=null&&s.allSelectedIndices&&(d=s.allSelectedIndices[0]),e.push(a("td",{children:d},`survey${l}-${h}`))}e.unshift(a("td",{children:t.studentId})),e.unshift(a("td",{children:t.email})),e.unshift(a("td",{children:`${t.firstName} ${t.lastName}`})),c.push(a("tr",{style:{borderBottom:"1pt solid var(--canvastext)"},children:e}))}let f=[];for(let[l,t]of Object.entries(i))f.push(a("th",{style:{width:"150px"},children:t},`surveyHead${l}`));return a("div",{style:{margin:"5px"},children:v("table",{style:{borderCollapse:"collapse"},children:[a("thead",{children:a("tr",{style:{borderBottom:"2pt solid var(--canvastext)"},children:f})}),a("tbody",{children:c})]})})}export{O as default}; +import{l as m,m as p,r as u,a3 as b,j as a,a as v,k as I}from"./index-7074710c.js";function O(){let n=m(p("doenetId")),y=m(p("driveId")),[o,S]=u.useState(null);if(u.useEffect(()=>{async function l(t){let{data:r}=await I.get("/api/getSurveyData.php",{params:{doenetId:t}});S(r.responses)}n&&l(n)},[n]),!y||!o)return null;let i=["User's Name","Email","Student Id"];for(let l of o){let t=JSON.parse(l.stateVariables,b);for(let r of Object.keys(t))if(!i.includes(r)){let e=t[r];(e!=null&&e.immediateValue||e!=null&&e.value||e!=null&&e.allSelectedIndices)&&i.push(r)}}let c=[];for(let[l,t]of Object.entries(o)){let r=JSON.parse(t.stateVariables,b),e=[];for(let[h,x]of Object.entries(i))if(h>2){let s=r[x],d="N/A";s!=null&&s.immediateValue?d=s.immediateValue:s!=null&&s.value?d=s.value:s!=null&&s.allSelectedIndices&&(d=s.allSelectedIndices[0]),e.push(a("td",{children:d},`survey${l}-${h}`))}e.unshift(a("td",{children:t.studentId})),e.unshift(a("td",{children:t.email})),e.unshift(a("td",{children:`${t.firstName} ${t.lastName}`})),c.push(a("tr",{style:{borderBottom:"1pt solid var(--canvastext)"},children:e}))}let f=[];for(let[l,t]of Object.entries(i))f.push(a("th",{style:{width:"150px"},children:t},`surveyHead${l}`));return a("div",{style:{margin:"5px"},children:v("table",{style:{borderCollapse:"collapse"},children:[a("thead",{children:a("tr",{style:{borderBottom:"2pt solid var(--canvastext)"},children:f})}),a("tbody",{children:c})]})})}export{O as default}; diff --git a/dist/assets/Textfield-5d92f495.js b/dist/assets/Textfield-9c1c2968.js similarity index 96% rename from dist/assets/Textfield-5d92f495.js rename to dist/assets/Textfield-9c1c2968.js index dd405f5a39..68f6f50fc7 100644 --- a/dist/assets/Textfield-5d92f495.js +++ b/dist/assets/Textfield-9c1c2968.js @@ -1,4 +1,4 @@ -import{r as l,j as u,F as y,a as w,s as $}from"./index-99a56692.js";const S=$.input` +import{r as l,j as u,F as y,a as w,s as $}from"./index-7074710c.js";const S=$.input` /* margin: 0px 4px 0px 0px; */ height: 24px; width: ${e=>e.width}; // Menu prop diff --git a/dist/assets/TimerMenu-640f94df.js b/dist/assets/TimerMenu-8d81de2c.js similarity index 58% rename from dist/assets/TimerMenu-640f94df.js rename to dist/assets/TimerMenu-8d81de2c.js index 736a9c9760..f8539845b7 100644 --- a/dist/assets/TimerMenu-640f94df.js +++ b/dist/assets/TimerMenu-8d81de2c.js @@ -1 +1 @@ -import{l as n,m as d,r as t,k as D,N as S,j as h}from"./index-99a56692.js";import{l as w}from"./CourseToolHandler-f517d0e5.js";import{currentAttemptNumber as x}from"./AssignmentViewer-f9c5976c.js";import"./index-ef9c2520.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-b3e258be.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-ea123297.js";import"./ActivityViewer-3a815948.js";import"./activityUtils-c08c1686.js";import"./visibility-sensor-55e75ed1.js";import"./ActionButton-f612d279.js";import"./RoleDropdown-5e05ae49.js";import"./DropdownMenu-9b4c45a6.js";function C(){const m=n(d("doenetId")),a=n(x),{timeLimit:o}=n(w(m));let[u,r]=t.useState("Unlimited");const[s,l]=t.useState(null),[c,f]=t.useState(new Date);let p=t.useRef(null);return t.useEffect(()=>{let i=new Date;D.get("/api/loadAttemptStartTime.php",{params:{doenetId:m,attemptNumber:a}}).then(({data:e})=>{e.attemptStart!==null&&(i=S(e.attemptStart));let T=new Date(i.getTime()+o*6e4*e.timeLimitMultiplier);l(T)}).catch(console.error)},[a,o,m,l]),t.useEffect(()=>{if(clearTimeout(p.current),o>0){let i=Math.floor((s-new Date)/6e4),e=(s-new Date)/6e4;e<=0?r("Time's Up"):(e<1?r("< 1 Min"):r(i===1?"1 Min":`${i} Mins`),p.current=setTimeout(()=>{e>=0&&f(new Date)},1e4))}},[c,s]),h("div",{style:{fontSize:"40px",textAlign:"center"},children:u})}export{C as default}; +import{l as n,m as d,r as t,k as D,N as S,j as h}from"./index-7074710c.js";import{l as w}from"./CourseToolHandler-8716455d.js";import{currentAttemptNumber as x}from"./AssignmentViewer-1be0d831.js";import"./index-67ec2c85.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-5b62de19.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-9136da6d.js";import"./ActivityViewer-becda8c0.js";import"./activityUtils-9c5f1536.js";import"./visibility-sensor-7d414852.js";import"./ActionButton-e5ea2a2f.js";import"./RoleDropdown-cce90708.js";import"./DropdownMenu-f3593bed.js";function C(){const m=n(d("doenetId")),a=n(x),{timeLimit:o}=n(w(m));let[u,r]=t.useState("Unlimited");const[s,l]=t.useState(null),[c,f]=t.useState(new Date);let p=t.useRef(null);return t.useEffect(()=>{let i=new Date;D.get("/api/loadAttemptStartTime.php",{params:{doenetId:m,attemptNumber:a}}).then(({data:e})=>{e.attemptStart!==null&&(i=S(e.attemptStart));let T=new Date(i.getTime()+o*6e4*e.timeLimitMultiplier);l(T)}).catch(console.error)},[a,o,m,l]),t.useEffect(()=>{if(clearTimeout(p.current),o>0){let i=Math.floor((s-new Date)/6e4),e=(s-new Date)/6e4;e<=0?r("Time's Up"):(e<1?r("< 1 Min"):r(i===1?"1 Min":`${i} Mins`),p.current=setTimeout(()=>{e>=0&&f(new Date)},1e4))}},[c,s]),h("div",{style:{fontSize:"40px",textAlign:"center"},children:u})}export{C as default}; diff --git a/dist/assets/ToggleButton-57def544.js b/dist/assets/ToggleButton-faf565eb.js similarity index 96% rename from dist/assets/ToggleButton-57def544.js rename to dist/assets/ToggleButton-faf565eb.js index 10781b98a6..077c38b07f 100644 --- a/dist/assets/ToggleButton-57def544.js +++ b/dist/assets/ToggleButton-faf565eb.js @@ -1,4 +1,4 @@ -import{r as u,j as t,F as m,a as r,s as g,b9 as h}from"./index-99a56692.js";const c=g.button` +import{r as u,j as t,F as m,a as r,s as g,b9 as h}from"./index-7074710c.js";const c=g.button` margin: ${e=>e.theme.margin}; height: 24px; border: ${e=>e.alert?"2px solid var(--mainRed)":e.disabled?"2px solid var(--mainGray)":"2px solid var(--mainBlue)"}; diff --git a/dist/assets/ToggleButtonGroup-c2629620.js b/dist/assets/ToggleButtonGroup-6decfcc6.js similarity index 90% rename from dist/assets/ToggleButtonGroup-c2629620.js rename to dist/assets/ToggleButtonGroup-6decfcc6.js index 468e386f6b..d1817f08b9 100644 --- a/dist/assets/ToggleButtonGroup-c2629620.js +++ b/dist/assets/ToggleButtonGroup-6decfcc6.js @@ -1,4 +1,4 @@ -import{s as g,r as h,av as a,j as n,aw as u}from"./index-99a56692.js";const m=g.div` +import{s as g,r as h,av as a,j as n,aw as u}from"./index-7074710c.js";const m=g.div` display: ${t=>t.vertical?"static":"flex"}; width: ${t=>t.width=="menu"?"var(--menuWidth)":""}; // height: 'fit-content'; diff --git a/dist/assets/VersionHistory-5589f4ee.js b/dist/assets/VersionHistory-c8204d25.js similarity index 93% rename from dist/assets/VersionHistory-5589f4ee.js rename to dist/assets/VersionHistory-c8204d25.js index 5c95511618..28f0c9ce68 100644 --- a/dist/assets/VersionHistory-5589f4ee.js +++ b/dist/assets/VersionHistory-c8204d25.js @@ -1 +1 @@ -import{l as x,m as J,b as re,y as de,v as B,k as b,z as g,ae as k,ah as T,aA as ce,j as c,a as E,F as le,B as A,ag as X}from"./index-99a56692.js";import{i as w,f as K,b as P,C as me,R as fe}from"./CourseToolHandler-f517d0e5.js";import{R as Q}from"./RelatedItems-96588168.js";import{e as De,t as _}from"./EditorViewerRecoil-41e59102.js";import"./index-ef9c2520.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-b3e258be.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-ea123297.js";const O=X({key:"currentDraftSelectedAtom",default:!0}),j=X({key:"selectedVersionIdAtom",default:null});function Se(Y){var q;console.log(">>>===VersionHistory");const R=x(J("doenetId")),Z=decodeURIComponent(x(J("path"))),S=re(w(R)),ee=x(De),te=x(j),h=de(),V=x(O),[F,L,U]=Z.split(":"),ne=B(({set:t,snapshot:l})=>async({doenetId:e,versionId:I,driveId:m,folderId:r,itemId:d})=>{const{data:o}=await b.get("/api/releaseVersion.php",{params:{doenetId:e,versionId:I}}),{success:f,message:u,isReleased:D,title:p}=o;let y="Retracted";D==="1"&&(y="Released"),f?h(`"${p}" is ${y}`,g.SUCCESS):h(u,g.ERROR),t(w(e),a=>{let n={...a},s=[...a.named];for(const[v,N]of s.entries()){let C={...N};N.versionId===I?(C.isReleased=D,s[v]=C):(C.isReleased="0",s[v]=C)}return n.named=s,n}),t(K({driveId:m,folderId:r}),a=>{let n={...a};for(let s of n.contentIds.defaultOrder)if(n.contentsDictionary[s].doenetId===e){d=s;break}return n.contentsDictionary={...a.contentsDictionary},n.contentsDictionary[d]={...a.contentsDictionary[d]},n.contentsDictionary[d].isReleased=D,n.contentsDictionaryByDoenetId={...a.contentsDictionaryByDoenetId},n.contentsDictionaryByDoenetId[e]={...a.contentsDictionaryByDoenetId[e]},n.contentsDictionaryByDoenetId[e].isReleased=D,n})}),ie=B(({snapshot:t,set:l})=>async({doenetId:e,versionId:I})=>{const m=await t.getPromise(w(e));let r={...m.draft};r.isDraft="0";const d=`Save (current) ${m.named.length+1}`;r.title=d,r.timestamp=P();let o={};for(let p of m.named)p.versionId===I&&(o={...p});const f=k();o.versionId=f,o.isDraft="1",o.isNamed="0",o.isReleased="0";let u={...m};u.named=[r,...m.named],u.draft=o,l(w(e),u),l(O,!0),l(j,f);let D={...o,isSetAsCurrent:"1",newDraftVersionId:f,newDraftContentId:o.cid,doenetId:e,newTitle:d};b.post("/api/saveNewVersion.php",D)}),se=B(({snapshot:t,set:l})=>async e=>{const I=await t.getPromise(_),m=P(),r=await T(I),d=k(),o=await t.getPromise(w(e));let f={...o},D={title:`Save ${o.named.length+1}`,versionId:d,timestamp:m,isReleased:"0",isDraft:"0",isNamed:"1",cid:r},p={...D,doenetML:I,doenetId:e};f.named=[D,...o.named],l(w(e),f),b.post("/api/saveNewVersion.php",p).then(y=>{var a,n;(a=y==null?void 0:y.data)!=null&&a.success?h("New Version Saved!",g.SUCCESS):(h("Version NOT Saved!",g.ERROR),console.error((n=y.data)==null?void 0:n.message))}).catch(y=>{h("Version NOT Saved!",g.ERROR)})}),oe=B(({snapshot:t,set:l})=>async({doenetId:e,driveId:I,folderId:m,itemId:r})=>{const d=await t.getPromise(_),o=ce(new Date),f=await T(d),u=k(),{data:D}=await b.post("/api/releaseDraft.php",{doenetId:e,doenetML:d,timestamp:o,versionId:u}),{success:p,message:y,title:a}=D;p?h(`"${a}" is Released.`,g.SUCCESS):h(y,g.ERROR),l(w(e),n=>{let s={...n},v=[...n.named];for(const[C,ae]of v.entries()){let G={...ae};G.isReleased="0",v[C]=G}let N={title:a,versionId:u,timestamp:o,isReleased:"1",isDraft:"0",isNamed:"1",cid:f};return v.unshift(N),s.named=v,s}),l(K({driveId:I,folderId:m}),n=>{let s={...n};for(let v of s.contentIds.defaultOrder)if(s.contentsDictionary[v].doenetId===e){r=v;break}return s.contentsDictionary={...n.contentsDictionary},s.contentsDictionary[r]={...n.contentsDictionary[r]},s.contentsDictionary[r].isReleased="1",s.contentsDictionaryByDoenetId={...n.contentsDictionaryByDoenetId},s.contentsDictionaryByDoenetId[e]={...n.contentsDictionaryByDoenetId[e]},s.contentsDictionaryByDoenetId[e].isReleased="1",s})}),$=B(({snapshot:t,set:l})=>async({doenetId:e,versionId:I,isCurrentDraft:m})=>{l(j,I),l(O,m);const r=await t.getPromise(w(e));let d={...r},o=r.draft.cid;if(!m&&await t.getPromise(O)){const u=await t.getPromise(_),D=await T(u);if(D!==o){let p={...r.draft};p.cid=D,p.timestamp=P(),d.draft=p,l(w(e),d);let y={...p,doenetML:u,doenetId:e};try{const{data:a}=await b.post("/api/saveNewVersion.php",y);a.success||console.log("ERROR",a.message)}catch(a){console.log("ERROR",a)}}}d.draft.cid;for(let f of d.named)if(f.versionId===I){f.cid;break}});if(ee!==R)return c("div",{style:Y.style});if(!((q=S==null?void 0:S.contents)!=null&&q.named))return null;let M=[],z={},H=te;for(let t of S.contents.named){z[t.versionId]=t;let l=!1;t.versionId===H&&(l=!0);let e="";t.isReleased==="1"&&(e="(Released)"),M.push(E("option",{value:t.versionId,selected:l,children:[e," ",t.title]},`option${t.versionId}`))}const i=z[H];let W="Release";return(i==null?void 0:i.isReleased)==="1"&&(W="Retract"),E(le,{children:[c("div",{style:{padding:"6px 0px 6px 0px"},children:c(Q,{size:"2",width:"menu",onChange:t=>{$({doenetId:R,versionId:t.target.value,isCurrentDraft:!0})},options:c("option",{value:S.contents.draft.versionId,selected:V,children:"Current Draft"})})}),c("div",{style:{margin:"0px 0px 6px 0px"},children:c(A,{disabled:!V,width:"menu",value:"Save Version",onClick:()=>se(R)})}),c("div",{style:{margin:"6px 0px 6px 0px"},children:c(A,{disabled:!V,width:"menu",value:"Release Current",onClick:()=>{oe({doenetId:R,driveId:F,folderId:L,itemId:U})}})}),c("div",{children:"History"}),c(Q,{size:"8",width:"menu",onChange:t=>{$({doenetId:R,versionId:t.target.value,isCurrentDraft:!1})},options:M}),E("div",{children:["Name: ",i==null?void 0:i.title]}),c(me,{disabled:V,cid:i==null?void 0:i.cid,doenetId:R}),c("div",{children:c(fe,{disabled:V,doenetId:R,title:i==null?void 0:i.title,versionId:i==null?void 0:i.versionId},i==null?void 0:i.versionId)}),c("div",{children:c(A,{disabled:V,onClick:()=>ie({doenetId:R,versionId:i.versionId}),value:"Set As Current"})}),c("div",{children:c(A,{disabled:V,onClick:()=>ne({doenetId:R,versionId:i.versionId,driveId:F,folderId:L,itemId:U}),value:W})})]})}export{O as currentDraftSelectedAtom,Se as default,j as selectedVersionIdAtom}; +import{l as x,m as J,b as re,y as de,v as B,k as b,z as g,ae as k,ah as T,aA as ce,j as c,a as E,F as le,B as A,ag as X}from"./index-7074710c.js";import{i as w,f as K,b as P,C as me,R as fe}from"./CourseToolHandler-8716455d.js";import{R as Q}from"./RelatedItems-33b68fba.js";import{e as De,t as _}from"./EditorViewerRecoil-fb47fc9d.js";import"./index-67ec2c85.js";import"./index-fcf36459.js";import"./index-47ca4f11.js";import"./index.esm-5b62de19.js";import"./setPrototypeOf-51e8cf87.js";/* empty css */import"./ButtonGroup-9136da6d.js";const O=X({key:"currentDraftSelectedAtom",default:!0}),j=X({key:"selectedVersionIdAtom",default:null});function Se(Y){var q;console.log(">>>===VersionHistory");const R=x(J("doenetId")),Z=decodeURIComponent(x(J("path"))),S=re(w(R)),ee=x(De),te=x(j),h=de(),V=x(O),[F,L,U]=Z.split(":"),ne=B(({set:t,snapshot:l})=>async({doenetId:e,versionId:I,driveId:m,folderId:r,itemId:d})=>{const{data:o}=await b.get("/api/releaseVersion.php",{params:{doenetId:e,versionId:I}}),{success:f,message:u,isReleased:D,title:p}=o;let y="Retracted";D==="1"&&(y="Released"),f?h(`"${p}" is ${y}`,g.SUCCESS):h(u,g.ERROR),t(w(e),a=>{let n={...a},s=[...a.named];for(const[v,N]of s.entries()){let C={...N};N.versionId===I?(C.isReleased=D,s[v]=C):(C.isReleased="0",s[v]=C)}return n.named=s,n}),t(K({driveId:m,folderId:r}),a=>{let n={...a};for(let s of n.contentIds.defaultOrder)if(n.contentsDictionary[s].doenetId===e){d=s;break}return n.contentsDictionary={...a.contentsDictionary},n.contentsDictionary[d]={...a.contentsDictionary[d]},n.contentsDictionary[d].isReleased=D,n.contentsDictionaryByDoenetId={...a.contentsDictionaryByDoenetId},n.contentsDictionaryByDoenetId[e]={...a.contentsDictionaryByDoenetId[e]},n.contentsDictionaryByDoenetId[e].isReleased=D,n})}),ie=B(({snapshot:t,set:l})=>async({doenetId:e,versionId:I})=>{const m=await t.getPromise(w(e));let r={...m.draft};r.isDraft="0";const d=`Save (current) ${m.named.length+1}`;r.title=d,r.timestamp=P();let o={};for(let p of m.named)p.versionId===I&&(o={...p});const f=k();o.versionId=f,o.isDraft="1",o.isNamed="0",o.isReleased="0";let u={...m};u.named=[r,...m.named],u.draft=o,l(w(e),u),l(O,!0),l(j,f);let D={...o,isSetAsCurrent:"1",newDraftVersionId:f,newDraftContentId:o.cid,doenetId:e,newTitle:d};b.post("/api/saveNewVersion.php",D)}),se=B(({snapshot:t,set:l})=>async e=>{const I=await t.getPromise(_),m=P(),r=await T(I),d=k(),o=await t.getPromise(w(e));let f={...o},D={title:`Save ${o.named.length+1}`,versionId:d,timestamp:m,isReleased:"0",isDraft:"0",isNamed:"1",cid:r},p={...D,doenetML:I,doenetId:e};f.named=[D,...o.named],l(w(e),f),b.post("/api/saveNewVersion.php",p).then(y=>{var a,n;(a=y==null?void 0:y.data)!=null&&a.success?h("New Version Saved!",g.SUCCESS):(h("Version NOT Saved!",g.ERROR),console.error((n=y.data)==null?void 0:n.message))}).catch(y=>{h("Version NOT Saved!",g.ERROR)})}),oe=B(({snapshot:t,set:l})=>async({doenetId:e,driveId:I,folderId:m,itemId:r})=>{const d=await t.getPromise(_),o=ce(new Date),f=await T(d),u=k(),{data:D}=await b.post("/api/releaseDraft.php",{doenetId:e,doenetML:d,timestamp:o,versionId:u}),{success:p,message:y,title:a}=D;p?h(`"${a}" is Released.`,g.SUCCESS):h(y,g.ERROR),l(w(e),n=>{let s={...n},v=[...n.named];for(const[C,ae]of v.entries()){let G={...ae};G.isReleased="0",v[C]=G}let N={title:a,versionId:u,timestamp:o,isReleased:"1",isDraft:"0",isNamed:"1",cid:f};return v.unshift(N),s.named=v,s}),l(K({driveId:I,folderId:m}),n=>{let s={...n};for(let v of s.contentIds.defaultOrder)if(s.contentsDictionary[v].doenetId===e){r=v;break}return s.contentsDictionary={...n.contentsDictionary},s.contentsDictionary[r]={...n.contentsDictionary[r]},s.contentsDictionary[r].isReleased="1",s.contentsDictionaryByDoenetId={...n.contentsDictionaryByDoenetId},s.contentsDictionaryByDoenetId[e]={...n.contentsDictionaryByDoenetId[e]},s.contentsDictionaryByDoenetId[e].isReleased="1",s})}),$=B(({snapshot:t,set:l})=>async({doenetId:e,versionId:I,isCurrentDraft:m})=>{l(j,I),l(O,m);const r=await t.getPromise(w(e));let d={...r},o=r.draft.cid;if(!m&&await t.getPromise(O)){const u=await t.getPromise(_),D=await T(u);if(D!==o){let p={...r.draft};p.cid=D,p.timestamp=P(),d.draft=p,l(w(e),d);let y={...p,doenetML:u,doenetId:e};try{const{data:a}=await b.post("/api/saveNewVersion.php",y);a.success||console.log("ERROR",a.message)}catch(a){console.log("ERROR",a)}}}d.draft.cid;for(let f of d.named)if(f.versionId===I){f.cid;break}});if(ee!==R)return c("div",{style:Y.style});if(!((q=S==null?void 0:S.contents)!=null&&q.named))return null;let M=[],z={},H=te;for(let t of S.contents.named){z[t.versionId]=t;let l=!1;t.versionId===H&&(l=!0);let e="";t.isReleased==="1"&&(e="(Released)"),M.push(E("option",{value:t.versionId,selected:l,children:[e," ",t.title]},`option${t.versionId}`))}const i=z[H];let W="Release";return(i==null?void 0:i.isReleased)==="1"&&(W="Retract"),E(le,{children:[c("div",{style:{padding:"6px 0px 6px 0px"},children:c(Q,{size:"2",width:"menu",onChange:t=>{$({doenetId:R,versionId:t.target.value,isCurrentDraft:!0})},options:c("option",{value:S.contents.draft.versionId,selected:V,children:"Current Draft"})})}),c("div",{style:{margin:"0px 0px 6px 0px"},children:c(A,{disabled:!V,width:"menu",value:"Save Version",onClick:()=>se(R)})}),c("div",{style:{margin:"6px 0px 6px 0px"},children:c(A,{disabled:!V,width:"menu",value:"Release Current",onClick:()=>{oe({doenetId:R,driveId:F,folderId:L,itemId:U})}})}),c("div",{children:"History"}),c(Q,{size:"8",width:"menu",onChange:t=>{$({doenetId:R,versionId:t.target.value,isCurrentDraft:!1})},options:M}),E("div",{children:["Name: ",i==null?void 0:i.title]}),c(me,{disabled:V,cid:i==null?void 0:i.cid,doenetId:R}),c("div",{children:c(fe,{disabled:V,doenetId:R,title:i==null?void 0:i.title,versionId:i==null?void 0:i.versionId},i==null?void 0:i.versionId)}),c("div",{children:c(A,{disabled:V,onClick:()=>ie({doenetId:R,versionId:i.versionId}),value:"Set As Current"})}),c("div",{children:c(A,{disabled:V,onClick:()=>ne({doenetId:R,versionId:i.versionId,driveId:F,folderId:L,itemId:U}),value:W})})]})}export{O as currentDraftSelectedAtom,Se as default,j as selectedVersionIdAtom}; diff --git a/dist/assets/ViewerUpdateButton-3825b1dd.js b/dist/assets/ViewerUpdateButton-3825b1dd.js new file mode 100644 index 0000000000..1291efde15 --- /dev/null +++ b/dist/assets/ViewerUpdateButton-3825b1dd.js @@ -0,0 +1 @@ +import{j as t,B as r}from"./index-7074710c.js";import{u as o}from"./EditorViewer-d9b9074f.js";import"./EditorViewerRecoil-fb47fc9d.js";function d(e){const a=o();return t("div",{style:e.style,children:t(r,{"data-test":"Viewer Update Button",value:"Update",onClick:a})})}export{d as default}; diff --git a/dist/assets/ViewerUpdateButton-b5a8c465.js b/dist/assets/ViewerUpdateButton-b5a8c465.js deleted file mode 100644 index d69fd875fe..0000000000 --- a/dist/assets/ViewerUpdateButton-b5a8c465.js +++ /dev/null @@ -1 +0,0 @@ -import{j as t,B as r}from"./index-99a56692.js";import{u as o}from"./EditorViewer-55cb3454.js";import"./EditorViewerRecoil-41e59102.js";function d(e){const a=o();return t("div",{style:e.style,children:t(r,{"data-test":"Viewer Update Button",value:"Update",onClick:a})})}export{d as default}; diff --git a/dist/assets/WelcomePlacementExam-00c07185.js b/dist/assets/WelcomePlacementExam-689a9033.js similarity index 99% rename from dist/assets/WelcomePlacementExam-00c07185.js rename to dist/assets/WelcomePlacementExam-689a9033.js index bbc96dc8d1..6d4a9d5e46 100644 --- a/dist/assets/WelcomePlacementExam-00c07185.js +++ b/dist/assets/WelcomePlacementExam-689a9033.js @@ -1,4 +1,4 @@ -import{aa as ae,R as a_,p as c_,l as cl,m as hl,r as Mt,j as un,F as gl,a as Ut,B as Oi,k as h_}from"./index-99a56692.js";import{B as g_}from"./ButtonGroup-ea123297.js";var Wi={},p_={get exports(){return Wi},set exports(ft){Wi=ft}};/** +import{aa as ae,R as a_,p as c_,l as cl,m as hl,r as Mt,j as un,F as gl,a as Ut,B as Oi,k as h_}from"./index-7074710c.js";import{B as g_}from"./ButtonGroup-9136da6d.js";var Wi={},p_={get exports(){return Wi},set exports(ft){Wi=ft}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors diff --git a/dist/assets/activityUtils-c08c1686.js b/dist/assets/activityUtils-9c5f1536.js similarity index 99% rename from dist/assets/activityUtils-c08c1686.js rename to dist/assets/activityUtils-9c5f1536.js index 3a1ad2b84e..b0531c2cdd 100644 --- a/dist/assets/activityUtils-c08c1686.js +++ b/dist/assets/activityUtils-9c5f1536.js @@ -1 +1 @@ -import{ak as M,al as R,ac as I,ah as $,am as L,an as x,ao as z,ap as W,aq as j,ar as q,as as F}from"./index-99a56692.js";function P(){let n=M(),t=R(),e={};for(let a in n)e[a.toLowerCase()]=a;let s={};for(let a in n)Object.defineProperty(s,a,{get:function(){let u=n[a].returnStateVariableInfo();return delete s[a],s[a]=u}.bind(this),configurable:!0});let l={};for(let a in n)Object.defineProperty(l,a,{get:function(){let u=n[a].returnStateVariableInfo({onlyPublic:!0});return delete l[a],l[a]=u}.bind(this),configurable:!0});function o({inheritedComponentType:a,baseComponentType:u}){if(a===u)return!0;if(a==="string")return u==="_base"||u==="_inline";if(u==="string")return!1;let r=n[u];return r?r.isPrototypeOf(n[a]):!1}function i({componentType:a,includeNonStandard:u=!0}){let r=n[a];return r?o({inheritedComponentType:a,baseComponentType:"_composite"})&&(u||!r.treatAsComponentForRecursiveReplacements):!1}let c=(a,u)=>o({inheritedComponentType:a,baseComponentType:u});return{allComponentClasses:n,componentTypesCreatingVariants:t,componentTypeLowerCaseMapping:e,isInheritedComponentType:o,isCompositeComponent:i,stateVariableInfo:s,publicStateVariableInfo:l,componentIsSpecifiedType:(a,u)=>{var r,p;return c(a.componentType,u)||c((p=(r=a.attributes)==null?void 0:r.createComponentOfType)==null?void 0:p.primitive,u)}}}async function T({cid:n,doenetML:t}){t===void 0?t=await I(n,"doenet"):n||(n=await $(t));let e=P(),{fullSerializedComponents:s}=await L({contentIds:[n],doenetMLs:[t],componentInfoObjects:e}),l=s[0];x(l);let o=l[0],i=z({serializedComponent:o,componentInfoObjects:e}),c=i.numberOfVariants,f;if(i.variantNames){let a=[...i.variantNames];if(a.length>=c)a=a.slice(0,c);else{let u=[...a],r=a.length,p=r,d;for(;rO(a+1));return{allPossibleVariants:f,doenetML:t,cid:n}}function O(n){return W(n,!0)}function k(n,t,e){let s=e&&e.state;s&&(typeof s=="object"&&t.copy(s,t),n.state=()=>t.copy(t,{}))}function _(n,t){let e=new B(n),s=()=>e.next();return s.double=()=>s()+(s()*2097152|0)*11102230246251565e-32,s.int32=()=>e.next()*4294967296|0,s.quick=s,k(s,e,t),s}class B{constructor(t){t==null&&(t=+new Date);let e=4022871197;this.c=1,this.s0=s(" "),this.s1=s(" "),this.s2=s(" "),this.s0-=s(t),this.s0<0&&(this.s0+=1),this.s1-=s(t),this.s1<0&&(this.s1+=1),this.s2-=s(t),this.s2<0&&(this.s2+=1);function s(l){l=String(l);for(let o=0;o>>0,i-=e,i*=e,e=i>>>0,i-=e,e+=i*4294967296}return(e>>>0)*23283064365386963e-26}}next(){let{c:t,s0:e,s1:s,s2:l}=this,o=2091639*e+t*23283064365386963e-26;return this.s0=s,this.s1=l,this.s2=o-(this.c=o|0)}copy(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}}let E=_;function U(n){let t=j(n).filter(i=>typeof i!="string"||/\S/.test(i));if(t.length!==1||t[0].componentType!=="document")return{success:!1,message:"Invalid activity definition"};t=t[0];let e={};for(let i in t.props){let c=i.toLowerCase();if(c in e)return{success:!1,message:`Invalid activity definition: duplicate attribute ${c}`};e[i.toLowerCase()]=t.props[i]}let s;if(e.type.toLowerCase()==="activity"){let i={type:"activity"};if(delete e.type,e.itemweights){if(typeof e.itemweights!="string")return{success:!1,message:"Invalid activity definition: invalid itemWeights"};i.itemWeights=e.itemweights.split(/\s+/).filter(a=>a).map(Number),delete e.itemweights}if(i.shuffleItemWeights=e.shuffleitemweights!==void 0&&(e.shuffleitemweights===!0||e.shuffleitemweights.toLowerCase()==="true"),delete e.shuffleitemweights,i.isSinglePage=e.issinglepage!==void 0&&(e.issinglepage===!0||e.issinglepage.toLowerCase()==="true"),delete e.issinglepage,e.xmlns)if(e.xmlns.slice(0,34)==="https://doenet.org/spec/doenetml/v")i.version=e.xmlns.slice(34),s=e.xmlns,delete e.xmlns;else return{success:!1,message:"Invalid activity definition: unrecognized xmlns"};else console.warn("no xmlns of activity!");if(e.numberofvariants&&(i.numberOfVariants=Number(e.numberofvariants),delete e.numberofvariants),Object.keys(e).length>0)return{success:!1,message:`Invalid activity definition: invalid document attributes: ${Object.keys(e).join(", ")}`};let c={type:"order",behavior:"sequence",children:t.children},f=l(c);return f.success?(i.order=f.order,{success:!0,activityJSON:i}):{success:!1,message:`Invalid activity definition: ${f.message}`}}else if(e.type.toLowerCase()==="page"){let c={type:"activity",order:{type:"order",behavior:"sequence",content:[{type:"page",doenetML:n}]}};if(e.xmlns)if(e.xmlns.slice(0,34)==="https://doenet.org/spec/doenetml/v")c.version=e.xmlns.slice(34),delete e.xmlns;else return{success:!1,message:"Invalid activity definition: unrecognized xmlns"};else console.warn("no xmlns of activity!");return{success:!0,activityJSON:c}}else return{success:!1,message:"Invalid activity definition"};function l(i){let c={type:"order"},f={};for(let r in i.props){let p=r.toLowerCase();if(p in f)return{success:!1,message:`duplicate attribute of order ${p}`};f[r.toLowerCase()]=i.props[r]}for(let r in f)if(r==="behavior")c.behavior=f.behavior;else if(r=="numbertoselect")c.numberToSelect=Number(f.numbertoselect);else if(r=="withreplacement")c.withReplacement=f.withreplacement!==void 0&&(f.withreplacement===!0||f.withreplacement.toLowerCase()==="true");else return{success:!1,message:`invalid order attribute: ${r}`};let a=i.children.filter(r=>typeof r!="string"||/\S/.test(r)),u=[];for(let r of a)if(r.componentType.toLowerCase()==="order"){let p=l(r);if(p.success)u.push(p.order);else return p}else if(r.componentType.toLowerCase()=="page"){let p=o(r);if(p.success)u.push(p.page);else return p}else return{success:!1,message:`invalid child of order, found type: ${r.componentType}`};return c.content=u,{success:!0,order:c}}function o(i){var a;let c={type:"page"},f={};for(let u in i.props){let r=u.toLowerCase();if(r in f)return{success:!1,message:`duplicate attribute of page ${r}`};f[u.toLowerCase()]=i.props[u]}for(let u in f)if(u==="cid")c.cid=f.cid,delete f.cid;else return{success:!1,message:`invalid page attribute: ${u}`};if(i.children.length>0){let u=n.slice(i.range.openEnd,i.range.closeBegin);if(((a=i.children[0].componentType)==null?void 0:a.toLowerCase())!=="document"){let r="";s&&(r=` xmlns="${s}"`),u=`${u}`}c.doenetML=u}return{success:!0,page:c}}}async function X({activityDefinition:n,requestedVariantIndex:t}){let e=await S(n),s=(t-1)%e.numberOfVariants+1;if(s<1&&(s+=e.numberOfVariants),!Number.isFinite(s))return{success:!1,message:"Invalid requested variant index"};let l=new E(s.toString()),o=C(n.order,l);if(!o.success)return o;let i=o.pages,c=n.itemWeights||[];if(!Array.isArray(c)||!c.every(m=>m>=0))return{success:!1,message:"Invalid itemWeights"};let f=i.length;c=c.slice(0,f),c.lengthm+g);a>0&&(c=c.map(m=>m/a));let u;if(e.pageVariants)u=[e.pageVariants];else{let m=[];for(let g of i)m.push(T({cid:g.cid,doenetML:g.doenetML}));try{u=await Promise.all(m)}catch(g){return{success:!1,message:`Error retrieving content for activity. ${g.message}`}}}let r,p=[],d=[];for(let m of u)p.push(m.allPossibleVariants),d.push(m.allPossibleVariants.length);let y=d.reduce((m,g)=>m*g,1);if(y<=e.numberOfVariants){let m=(s-1)%y+1;r=q({numberOfOptionsByIndex:d,maxNumber:m})[m-1].map(g=>g+1)}else r=[...Array(f).keys()].map(m=>Math.floor(l()*d[m])+1);let h=[],v=[];for(let[m,g]of u.entries()){let N=r[m];h.push(N);let b=i[m];b.doenetML===void 0?(b={...b},b.doenetML=g.doenetML):b.cid||(b={...b},b.cid=g.cid),v.push(b)}let w=[...i];v.forEach((m,g)=>w[g].cid=m.cid);let V=await K(v),A={orderWithCids:w,variantsByPage:h,itemWeights:c,numberOfVariants:e.numberOfVariants,previousComponentTypeCounts:V};return{success:!0,order:v,itemWeights:c,variantsByPage:h,variantIndex:s,activityInfo:A,previousComponentTypeCounts:V}}async function S(n){let t=1e3,e=null;if(n.numberOfVariants!==void 0)t=n.numberOfVariants,Number.isInteger(t)&&t>=1||(t=1e3);else if((n.order.behavior===void 0||n.order.behavior==="sequence")&&n.order.content.every(s=>s.type==="page")){let s=[];for(let l of n.order.content)s.push(T({cid:l.cid,doenetML:l.doenetML}));e=await Promise.all(s),t=e.reduce((l,o)=>l*o.allPossibleVariants.length,1),t=Math.min(1e3,t)}return{numberOfVariants:t,pageVariantsResult:e}}async function Y(n){let t=await I(n),e=U(t);return e.success?(e=await S(e.activityJSON),{success:!0,numberOfVariants:e.numberOfVariants}):e}function C(n,t){var s,l;if(((s=n==null?void 0:n.type)==null?void 0:s.toLowerCase())!=="order")return{success:!1,message:"invalid order"};let e=(l=n.behavior)==null?void 0:l.toLowerCase();switch(e===void 0&&(e="sequence"),e){case"sequence":return J(n,t);case"select":return G(n,t);case"shuffle":return H(n,t);default:return{success:!1,message:`Have not implemented behavior: ${e}`}}}function J(n,t){let e=[];for(let s of n.content){let l=s.type.toLowerCase();if(l==="page")e.push(s);else if(l==="order"){let o=C(s,t);if(o.success)e.push(...o.pages);else return o}else return{success:!1,message:"Unrecognized item in order."}}return{success:!0,pages:e}}function G(n,t){let e=n.numberToSelect,s=n.content.length;Number.isInteger(e)&&e>0||(e=1);let l=1;if(n.withReplacement||(l=e),l>s)return{success:!1,message:"Cannot select "+l+" components from only "+s};let o=n.selectWeights||[];if(!Array.isArray(o)||!o.every(r=>r>=0))return{success:!1,message:"Invalid selectWeights"};o=o.slice(0,s),o.lengthr+p);o=o.map(r=>r/i);let c=o.reduce((r,p,d)=>[...r,p+(r[d-1]||0)],[]),f=[...Array(c.length).keys()],a=[];for(let r=0;rp?y=h:d=h}a.push(n.content[f[y]]),!n.withReplacement&&rh+v),o=o.map(h=>h/i),c=o.reduce((h,v,w)=>[...h,v+(h[w-1]||0)],[]))}let u=[];for(let r of a){let p=r.type.toLowerCase();if(p==="page")u.push(r);else if(p==="order"){let d=C(r);if(d.success)u.push(...d.pages);else return d}else return{success:!1,message:"Unrecognized item in order."}}return{success:!0,pages:u}}function H(n,t){let e=[...n.content];for(let l=n.content.length-1;l>0;l--){const o=t(),i=Math.floor(o*(l+1));[e[l],e[i]]=[e[i],e[l]]}let s=[];for(let l of e){let o=l.type.toLowerCase();if(o==="page")s.push(l);else if(o==="order"){let i=C(l,t);if(i.success)s.push(...i.pages);else return i}else return{success:!1,message:"Unrecognized item in order."}}return{success:!0,pages:s}}async function K(n){let t=[{}],e=P();for(let[s,l]of n.slice(0,n.length-1).entries()){let{fullSerializedComponents:o}=await L({contentIds:[l.cid],doenetMLs:[l.doenetML],componentInfoObjects:e}),i=o[0];x(i);let c=i[0].children,f=F(c),a=t[s];for(let u in a)u in f?f[u]+=a[u]:f[u]=a[u];t.push(f)}return t}export{_ as a,X as c,S as d,U as p,Y as r}; +import{ak as M,al as R,ac as I,ah as $,am as L,an as x,ao as z,ap as W,aq as j,ar as q,as as F}from"./index-7074710c.js";function P(){let n=M(),t=R(),e={};for(let a in n)e[a.toLowerCase()]=a;let s={};for(let a in n)Object.defineProperty(s,a,{get:function(){let u=n[a].returnStateVariableInfo();return delete s[a],s[a]=u}.bind(this),configurable:!0});let l={};for(let a in n)Object.defineProperty(l,a,{get:function(){let u=n[a].returnStateVariableInfo({onlyPublic:!0});return delete l[a],l[a]=u}.bind(this),configurable:!0});function o({inheritedComponentType:a,baseComponentType:u}){if(a===u)return!0;if(a==="string")return u==="_base"||u==="_inline";if(u==="string")return!1;let r=n[u];return r?r.isPrototypeOf(n[a]):!1}function i({componentType:a,includeNonStandard:u=!0}){let r=n[a];return r?o({inheritedComponentType:a,baseComponentType:"_composite"})&&(u||!r.treatAsComponentForRecursiveReplacements):!1}let c=(a,u)=>o({inheritedComponentType:a,baseComponentType:u});return{allComponentClasses:n,componentTypesCreatingVariants:t,componentTypeLowerCaseMapping:e,isInheritedComponentType:o,isCompositeComponent:i,stateVariableInfo:s,publicStateVariableInfo:l,componentIsSpecifiedType:(a,u)=>{var r,p;return c(a.componentType,u)||c((p=(r=a.attributes)==null?void 0:r.createComponentOfType)==null?void 0:p.primitive,u)}}}async function T({cid:n,doenetML:t}){t===void 0?t=await I(n,"doenet"):n||(n=await $(t));let e=P(),{fullSerializedComponents:s}=await L({contentIds:[n],doenetMLs:[t],componentInfoObjects:e}),l=s[0];x(l);let o=l[0],i=z({serializedComponent:o,componentInfoObjects:e}),c=i.numberOfVariants,f;if(i.variantNames){let a=[...i.variantNames];if(a.length>=c)a=a.slice(0,c);else{let u=[...a],r=a.length,p=r,d;for(;rO(a+1));return{allPossibleVariants:f,doenetML:t,cid:n}}function O(n){return W(n,!0)}function k(n,t,e){let s=e&&e.state;s&&(typeof s=="object"&&t.copy(s,t),n.state=()=>t.copy(t,{}))}function _(n,t){let e=new B(n),s=()=>e.next();return s.double=()=>s()+(s()*2097152|0)*11102230246251565e-32,s.int32=()=>e.next()*4294967296|0,s.quick=s,k(s,e,t),s}class B{constructor(t){t==null&&(t=+new Date);let e=4022871197;this.c=1,this.s0=s(" "),this.s1=s(" "),this.s2=s(" "),this.s0-=s(t),this.s0<0&&(this.s0+=1),this.s1-=s(t),this.s1<0&&(this.s1+=1),this.s2-=s(t),this.s2<0&&(this.s2+=1);function s(l){l=String(l);for(let o=0;o>>0,i-=e,i*=e,e=i>>>0,i-=e,e+=i*4294967296}return(e>>>0)*23283064365386963e-26}}next(){let{c:t,s0:e,s1:s,s2:l}=this,o=2091639*e+t*23283064365386963e-26;return this.s0=s,this.s1=l,this.s2=o-(this.c=o|0)}copy(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}}let E=_;function U(n){let t=j(n).filter(i=>typeof i!="string"||/\S/.test(i));if(t.length!==1||t[0].componentType!=="document")return{success:!1,message:"Invalid activity definition"};t=t[0];let e={};for(let i in t.props){let c=i.toLowerCase();if(c in e)return{success:!1,message:`Invalid activity definition: duplicate attribute ${c}`};e[i.toLowerCase()]=t.props[i]}let s;if(e.type.toLowerCase()==="activity"){let i={type:"activity"};if(delete e.type,e.itemweights){if(typeof e.itemweights!="string")return{success:!1,message:"Invalid activity definition: invalid itemWeights"};i.itemWeights=e.itemweights.split(/\s+/).filter(a=>a).map(Number),delete e.itemweights}if(i.shuffleItemWeights=e.shuffleitemweights!==void 0&&(e.shuffleitemweights===!0||e.shuffleitemweights.toLowerCase()==="true"),delete e.shuffleitemweights,i.isSinglePage=e.issinglepage!==void 0&&(e.issinglepage===!0||e.issinglepage.toLowerCase()==="true"),delete e.issinglepage,e.xmlns)if(e.xmlns.slice(0,34)==="https://doenet.org/spec/doenetml/v")i.version=e.xmlns.slice(34),s=e.xmlns,delete e.xmlns;else return{success:!1,message:"Invalid activity definition: unrecognized xmlns"};else console.warn("no xmlns of activity!");if(e.numberofvariants&&(i.numberOfVariants=Number(e.numberofvariants),delete e.numberofvariants),Object.keys(e).length>0)return{success:!1,message:`Invalid activity definition: invalid document attributes: ${Object.keys(e).join(", ")}`};let c={type:"order",behavior:"sequence",children:t.children},f=l(c);return f.success?(i.order=f.order,{success:!0,activityJSON:i}):{success:!1,message:`Invalid activity definition: ${f.message}`}}else if(e.type.toLowerCase()==="page"){let c={type:"activity",order:{type:"order",behavior:"sequence",content:[{type:"page",doenetML:n}]}};if(e.xmlns)if(e.xmlns.slice(0,34)==="https://doenet.org/spec/doenetml/v")c.version=e.xmlns.slice(34),delete e.xmlns;else return{success:!1,message:"Invalid activity definition: unrecognized xmlns"};else console.warn("no xmlns of activity!");return{success:!0,activityJSON:c}}else return{success:!1,message:"Invalid activity definition"};function l(i){let c={type:"order"},f={};for(let r in i.props){let p=r.toLowerCase();if(p in f)return{success:!1,message:`duplicate attribute of order ${p}`};f[r.toLowerCase()]=i.props[r]}for(let r in f)if(r==="behavior")c.behavior=f.behavior;else if(r=="numbertoselect")c.numberToSelect=Number(f.numbertoselect);else if(r=="withreplacement")c.withReplacement=f.withreplacement!==void 0&&(f.withreplacement===!0||f.withreplacement.toLowerCase()==="true");else return{success:!1,message:`invalid order attribute: ${r}`};let a=i.children.filter(r=>typeof r!="string"||/\S/.test(r)),u=[];for(let r of a)if(r.componentType.toLowerCase()==="order"){let p=l(r);if(p.success)u.push(p.order);else return p}else if(r.componentType.toLowerCase()=="page"){let p=o(r);if(p.success)u.push(p.page);else return p}else return{success:!1,message:`invalid child of order, found type: ${r.componentType}`};return c.content=u,{success:!0,order:c}}function o(i){var a;let c={type:"page"},f={};for(let u in i.props){let r=u.toLowerCase();if(r in f)return{success:!1,message:`duplicate attribute of page ${r}`};f[u.toLowerCase()]=i.props[u]}for(let u in f)if(u==="cid")c.cid=f.cid,delete f.cid;else return{success:!1,message:`invalid page attribute: ${u}`};if(i.children.length>0){let u=n.slice(i.range.openEnd,i.range.closeBegin);if(((a=i.children[0].componentType)==null?void 0:a.toLowerCase())!=="document"){let r="";s&&(r=` xmlns="${s}"`),u=`${u}`}c.doenetML=u}return{success:!0,page:c}}}async function X({activityDefinition:n,requestedVariantIndex:t}){let e=await S(n),s=(t-1)%e.numberOfVariants+1;if(s<1&&(s+=e.numberOfVariants),!Number.isFinite(s))return{success:!1,message:"Invalid requested variant index"};let l=new E(s.toString()),o=C(n.order,l);if(!o.success)return o;let i=o.pages,c=n.itemWeights||[];if(!Array.isArray(c)||!c.every(m=>m>=0))return{success:!1,message:"Invalid itemWeights"};let f=i.length;c=c.slice(0,f),c.lengthm+g);a>0&&(c=c.map(m=>m/a));let u;if(e.pageVariants)u=[e.pageVariants];else{let m=[];for(let g of i)m.push(T({cid:g.cid,doenetML:g.doenetML}));try{u=await Promise.all(m)}catch(g){return{success:!1,message:`Error retrieving content for activity. ${g.message}`}}}let r,p=[],d=[];for(let m of u)p.push(m.allPossibleVariants),d.push(m.allPossibleVariants.length);let y=d.reduce((m,g)=>m*g,1);if(y<=e.numberOfVariants){let m=(s-1)%y+1;r=q({numberOfOptionsByIndex:d,maxNumber:m})[m-1].map(g=>g+1)}else r=[...Array(f).keys()].map(m=>Math.floor(l()*d[m])+1);let h=[],v=[];for(let[m,g]of u.entries()){let N=r[m];h.push(N);let b=i[m];b.doenetML===void 0?(b={...b},b.doenetML=g.doenetML):b.cid||(b={...b},b.cid=g.cid),v.push(b)}let w=[...i];v.forEach((m,g)=>w[g].cid=m.cid);let V=await K(v),A={orderWithCids:w,variantsByPage:h,itemWeights:c,numberOfVariants:e.numberOfVariants,previousComponentTypeCounts:V};return{success:!0,order:v,itemWeights:c,variantsByPage:h,variantIndex:s,activityInfo:A,previousComponentTypeCounts:V}}async function S(n){let t=1e3,e=null;if(n.numberOfVariants!==void 0)t=n.numberOfVariants,Number.isInteger(t)&&t>=1||(t=1e3);else if((n.order.behavior===void 0||n.order.behavior==="sequence")&&n.order.content.every(s=>s.type==="page")){let s=[];for(let l of n.order.content)s.push(T({cid:l.cid,doenetML:l.doenetML}));e=await Promise.all(s),t=e.reduce((l,o)=>l*o.allPossibleVariants.length,1),t=Math.min(1e3,t)}return{numberOfVariants:t,pageVariantsResult:e}}async function Y(n){let t=await I(n),e=U(t);return e.success?(e=await S(e.activityJSON),{success:!0,numberOfVariants:e.numberOfVariants}):e}function C(n,t){var s,l;if(((s=n==null?void 0:n.type)==null?void 0:s.toLowerCase())!=="order")return{success:!1,message:"invalid order"};let e=(l=n.behavior)==null?void 0:l.toLowerCase();switch(e===void 0&&(e="sequence"),e){case"sequence":return J(n,t);case"select":return G(n,t);case"shuffle":return H(n,t);default:return{success:!1,message:`Have not implemented behavior: ${e}`}}}function J(n,t){let e=[];for(let s of n.content){let l=s.type.toLowerCase();if(l==="page")e.push(s);else if(l==="order"){let o=C(s,t);if(o.success)e.push(...o.pages);else return o}else return{success:!1,message:"Unrecognized item in order."}}return{success:!0,pages:e}}function G(n,t){let e=n.numberToSelect,s=n.content.length;Number.isInteger(e)&&e>0||(e=1);let l=1;if(n.withReplacement||(l=e),l>s)return{success:!1,message:"Cannot select "+l+" components from only "+s};let o=n.selectWeights||[];if(!Array.isArray(o)||!o.every(r=>r>=0))return{success:!1,message:"Invalid selectWeights"};o=o.slice(0,s),o.lengthr+p);o=o.map(r=>r/i);let c=o.reduce((r,p,d)=>[...r,p+(r[d-1]||0)],[]),f=[...Array(c.length).keys()],a=[];for(let r=0;rp?y=h:d=h}a.push(n.content[f[y]]),!n.withReplacement&&rh+v),o=o.map(h=>h/i),c=o.reduce((h,v,w)=>[...h,v+(h[w-1]||0)],[]))}let u=[];for(let r of a){let p=r.type.toLowerCase();if(p==="page")u.push(r);else if(p==="order"){let d=C(r);if(d.success)u.push(...d.pages);else return d}else return{success:!1,message:"Unrecognized item in order."}}return{success:!0,pages:u}}function H(n,t){let e=[...n.content];for(let l=n.content.length-1;l>0;l--){const o=t(),i=Math.floor(o*(l+1));[e[l],e[i]]=[e[i],e[l]]}let s=[];for(let l of e){let o=l.type.toLowerCase();if(o==="page")s.push(l);else if(o==="order"){let i=C(l,t);if(i.success)s.push(...i.pages);else return i}else return{success:!1,message:"Unrecognized item in order."}}return{success:!0,pages:s}}async function K(n){let t=[{}],e=P();for(let[s,l]of n.slice(0,n.length-1).entries()){let{fullSerializedComponents:o}=await L({contentIds:[l.cid],doenetMLs:[l.doenetML],componentInfoObjects:e}),i=o[0];x(i);let c=i[0].children,f=F(c),a=t[s];for(let u in a)u in f?f[u]+=a[u]:f[u]=a[u];t.push(f)}return t}export{_ as a,X as c,S as d,U as p,Y as r}; diff --git a/dist/assets/alert-c90a8781.js b/dist/assets/alert-7670faad.js similarity index 71% rename from dist/assets/alert-c90a8781.js rename to dist/assets/alert-7670faad.js index 923febd1f5..03ad446428 100644 --- a/dist/assets/alert-c90a8781.js +++ b/dist/assets/alert-7670faad.js @@ -1 +1 @@ -import{av as t,bn as s,a as l,j as o}from"./index-99a56692.js";const u=t.memo(function(n){let{name:i,id:e,SVs:r,children:a}=s(n);return r.hidden?null:l("strong",{id:e,children:[o("a",{name:e}),a]})});export{u as default}; +import{av as t,bp as s,a as l,j as o}from"./index-7074710c.js";const u=t.memo(function(n){let{name:i,id:e,SVs:r,children:a}=s(n);return r.hidden?null:l("strong",{id:e,children:[o("a",{name:e}),a]})});export{u as default}; diff --git a/dist/assets/angle-30091d5d.js b/dist/assets/angle-a79a8ada.js similarity index 91% rename from dist/assets/angle-30091d5d.js rename to dist/assets/angle-a79a8ada.js index 535ed9a77c..1dd1050438 100644 --- a/dist/assets/angle-30091d5d.js +++ b/dist/assets/angle-a79a8ada.js @@ -1 +1 @@ -import{av as y,bn as C,r as i,j as o,F as f,a as v,b9 as x}from"./index-99a56692.js";import{BoardContext as G,LINE_LAYER_OFFSET as b}from"./graph-57e1e537.js";import"./css-14ccef8c.js";import"./visibility-sensor-55e75ed1.js";const L=y.memo(function(P){let{name:S,id:m,SVs:e}=C(P);const l=i.useContext(G);let a=i.useRef(null),s=i.useRef(null),c=i.useRef(null),r=i.useRef(null),h=i.useRef(null);i.useEffect(()=>()=>{p()},[]);function p(){a.current!==null&&(l.removeObject(r.current),r.current=null,l.removeObject(a.current),a.current=null,l.removeObject(s.current),s.current=null,l.removeObject(c.current),c.current=null)}function R(){if(e.numericalPoints.length!==3||e.numericalPoints.some(u=>u.length!==2)||!(Number.isFinite(e.numericalRadius)&&e.numericalRadius>0))return null;var t={name:e.labelForGraph,visible:!e.hidden,withLabel:e.showLabel&&e.labelForGraph!=="",fixed:!0,layer:10*e.layer+b,radius:e.numericalRadius,fillColor:e.selectedStyle.fillColor,strokeColor:e.selectedStyle.lineColor,highlight:!1,orthoType:e.emphasizeRightAngle?"square":"sector"};t.label={highlight:!1},e.labelHasLatex&&(t.label.useMathJax=!0),h.current=e.showLabel&&e.labelForGraph!=="";let n;e.swapPointOrder?n=[[...e.numericalPoints[2]],[...e.numericalPoints[1]],[...e.numericalPoints[0]]]:n=[[...e.numericalPoints[0]],[...e.numericalPoints[1]],[...e.numericalPoints[2]]];let d={visible:!1};return a.current=l.create("point",n[0],d),s.current=l.create("point",n[1],d),c.current=l.create("point",n[2],d),l.create("angle",[a.current,s.current,c.current],t)}if(e.hidden)return null;if(l){if(r.current===null)r.current=R();else if(e.numericalPoints.length!==3||e.numericalPoints.some(t=>t.length!==2)||!(Number.isFinite(e.numericalRadius)&&e.numericalRadius>0))p();else{let t;e.swapPointOrder?t=[[...e.numericalPoints[2]],[...e.numericalPoints[1]],[...e.numericalPoints[0]]]:t=[[...e.numericalPoints[0]],[...e.numericalPoints[1]],[...e.numericalPoints[2]]],r.current.point2.coords.setCoordinates(JXG.COORDS_BY_USER,t[0]),r.current.point1.coords.setCoordinates(JXG.COORDS_BY_USER,t[1]),r.current.point3.coords.setCoordinates(JXG.COORDS_BY_USER,t[2]),r.current.setAttribute({radius:e.numericalRadius,visible:!e.hidden});let n=10*e.layer+b;r.current.visProp.layer!==n&&r.current.setAttribute({layer:n}),r.current.visProp.fillcolor!==e.selectedStyle.fillColor&&(r.current.visProp.fillcolor=e.selectedStyle.fillColor),r.current.visProp.strokecolor!==e.selectedStyle.lineColor&&(r.current.visProp.strokecolor=e.selectedStyle.lineColor),r.current.name=e.labelForGraph;let u=e.showLabel&&e.labelForGraph!=="";u!=h.current&&(r.current.setAttribute({withlabel:u}),h.current=u),r.current.visProp.orthotype=e.emphasizeRightAngle?"square":"sector",r.current.needsUpdate=!0,r.current.update(),r.current.hasLabel&&(r.current.label.needsUpdate=!0,r.current.label.update()),l.updateRenderer()}return o(f,{children:o("a",{name:m})})}let g="\\("+e.latexForRenderer+"\\)";return v(f,{children:[o("a",{name:m}),o("span",{id:m,children:o(x.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:g})})]})});export{L as default}; +import{av as y,bp as C,r as i,j as o,F as f,a as v,b9 as x}from"./index-7074710c.js";import{BoardContext as G,LINE_LAYER_OFFSET as b}from"./graph-71cec529.js";import"./css-14ccef8c.js";import"./visibility-sensor-7d414852.js";const L=y.memo(function(P){let{name:S,id:m,SVs:e}=C(P);const l=i.useContext(G);let a=i.useRef(null),s=i.useRef(null),c=i.useRef(null),r=i.useRef(null),h=i.useRef(null);i.useEffect(()=>()=>{p()},[]);function p(){a.current!==null&&(l.removeObject(r.current),r.current=null,l.removeObject(a.current),a.current=null,l.removeObject(s.current),s.current=null,l.removeObject(c.current),c.current=null)}function R(){if(e.numericalPoints.length!==3||e.numericalPoints.some(u=>u.length!==2)||!(Number.isFinite(e.numericalRadius)&&e.numericalRadius>0))return null;var t={name:e.labelForGraph,visible:!e.hidden,withLabel:e.showLabel&&e.labelForGraph!=="",fixed:!0,layer:10*e.layer+b,radius:e.numericalRadius,fillColor:e.selectedStyle.fillColor,strokeColor:e.selectedStyle.lineColor,highlight:!1,orthoType:e.emphasizeRightAngle?"square":"sector"};t.label={highlight:!1},e.labelHasLatex&&(t.label.useMathJax=!0),h.current=e.showLabel&&e.labelForGraph!=="";let n;e.swapPointOrder?n=[[...e.numericalPoints[2]],[...e.numericalPoints[1]],[...e.numericalPoints[0]]]:n=[[...e.numericalPoints[0]],[...e.numericalPoints[1]],[...e.numericalPoints[2]]];let d={visible:!1};return a.current=l.create("point",n[0],d),s.current=l.create("point",n[1],d),c.current=l.create("point",n[2],d),l.create("angle",[a.current,s.current,c.current],t)}if(e.hidden)return null;if(l){if(r.current===null)r.current=R();else if(e.numericalPoints.length!==3||e.numericalPoints.some(t=>t.length!==2)||!(Number.isFinite(e.numericalRadius)&&e.numericalRadius>0))p();else{let t;e.swapPointOrder?t=[[...e.numericalPoints[2]],[...e.numericalPoints[1]],[...e.numericalPoints[0]]]:t=[[...e.numericalPoints[0]],[...e.numericalPoints[1]],[...e.numericalPoints[2]]],r.current.point2.coords.setCoordinates(JXG.COORDS_BY_USER,t[0]),r.current.point1.coords.setCoordinates(JXG.COORDS_BY_USER,t[1]),r.current.point3.coords.setCoordinates(JXG.COORDS_BY_USER,t[2]),r.current.setAttribute({radius:e.numericalRadius,visible:!e.hidden});let n=10*e.layer+b;r.current.visProp.layer!==n&&r.current.setAttribute({layer:n}),r.current.visProp.fillcolor!==e.selectedStyle.fillColor&&(r.current.visProp.fillcolor=e.selectedStyle.fillColor),r.current.visProp.strokecolor!==e.selectedStyle.lineColor&&(r.current.visProp.strokecolor=e.selectedStyle.lineColor),r.current.name=e.labelForGraph;let u=e.showLabel&&e.labelForGraph!=="";u!=h.current&&(r.current.setAttribute({withlabel:u}),h.current=u),r.current.visProp.orthotype=e.emphasizeRightAngle?"square":"sector",r.current.needsUpdate=!0,r.current.update(),r.current.hasLabel&&(r.current.label.needsUpdate=!0,r.current.label.update()),l.updateRenderer()}return o(f,{children:o("a",{name:m})})}let g="\\("+e.latexForRenderer+"\\)";return v(f,{children:[o("a",{name:m}),o("span",{id:m,children:o(x.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:g})})]})});export{L as default}; diff --git a/dist/assets/answer-5798aa41.js b/dist/assets/answer-ec00b2c9.js similarity index 75% rename from dist/assets/answer-5798aa41.js rename to dist/assets/answer-ec00b2c9.js index b6a1f4c922..91088f1896 100644 --- a/dist/assets/answer-5798aa41.js +++ b/dist/assets/answer-ec00b2c9.js @@ -1,4 +1,4 @@ -import{av as y,bn as A,a as n,j as a,i as s,bp as x,a0 as v,aP as w,bq as L,F as m,s as S}from"./index-99a56692.js";const l=S.button` +import{av as y,bp as A,a as n,j as a,i as l,br as x,a0 as v,aP as w,bs as L,F as m,s as S}from"./index-7074710c.js";const s=S.button` position: relative; height: 24px; display: inline-block; @@ -14,4 +14,4 @@ import{av as y,bn as A,a as n,j as a,i as s,bp as x,a0 as v,aP as w,bq as L,F as background-color: var(--lightBlue); color: black; }; -`,O=y.memo(function(g){let{name:R,id:i,SVs:e,actions:p,children:C,callAction:u}=A(g);if(e.hidden)return null;let f=e.disabled,c=()=>u({action:p.submitAnswer});e.submitAllAnswersAtAncestor&&(c=()=>u({action:p.submitAllAnswers}));let d=null;if(e.inputChildren.length>0){let o=e.inputChildren.map(t=>t.componentName);d=C.filter(t=>t&&typeof t!="string"&&o.includes(t.props.componentInstructions.componentName))}if(!e.delegateCheckWork&&!e.suppressCheckwork){let o="unvalidated";(e.justSubmitted||e.numberOfAttemptsLeft<1)&&(e.creditAchieved===1?o="correct":e.creditAchieved===0?o="incorrect":o="partialcorrect");let t={cursor:"pointer",padding:"1px 6px 1px 6px"};f&&(t.backgroundColor=getComputedStyle(document.documentElement).getPropertyValue("--mainGray"));let b=e.submitLabel;e.showCorrectness||(b=e.submitLabelNoCorrectness);let r=n(l,{id:i+"_submit",tabIndex:"0",disabled:f,style:t,onClick:c,onKeyPress:h=>{h.key==="Enter"&&c()},children:[a(s,{style:{},icon:x,transform:{rotate:90}})," ",b]});if(e.showCorrectness){if(o==="correct")t.backgroundColor=getComputedStyle(document.documentElement).getPropertyValue("--mainGreen"),r=n(l,{id:i+"_correct",style:t,children:[a(s,{icon:v}),"  Correct"]});else if(o==="incorrect")t.backgroundColor=getComputedStyle(document.documentElement).getPropertyValue("--mainRed"),r=n(l,{id:i+"_incorrect",style:t,children:[a(s,{icon:w}),"  Incorrect"]});else if(o==="partialcorrect"){t.backgroundColor="#efab34";let k=`${Math.round(e.creditAchieved*100)}% Correct`;r=a(l,{id:i+"_partial",style:t,children:k})}}else o!=="unvalidated"&&(t.backgroundColor="rgb(74, 3, 217)",r=n(l,{id:i+"_saved",style:t,children:[a(s,{icon:L}),"  Response Saved"]}));return e.numberOfAttemptsLeft<0?r=n(m,{children:[r,a("span",{children:"(no attempts remaining)"})]}):e.numberOfAttemptsLeft==1?r=n(m,{children:[r,a("span",{children:"(1 attempt remaining)"})]}):Number.isFinite(e.numberOfAttemptsLeft)&&(r=n(m,{children:[r,n("span",{children:["(",e.numberOfAttemptsLeft," attempts remaining)"]})]})),n("span",{id:i,style:{marginBottom:"4px"},children:[a("a",{name:i}),d,r]})}else return n("span",{id:i,style:{marginBottom:"4px"},children:[a("a",{name:i}),d]})});export{O as default}; +`,O=y.memo(function(g){let{name:R,id:i,SVs:e,actions:p,children:C,callAction:u}=A(g);if(e.hidden)return null;let f=e.disabled,c=()=>u({action:p.submitAnswer});e.submitAllAnswersAtAncestor&&(c=()=>u({action:p.submitAllAnswers}));let d=null;if(e.inputChildren.length>0){let o=e.inputChildren.map(t=>t.componentName);d=C.filter(t=>t&&typeof t!="string"&&o.includes(t.props.componentInstructions.componentName))}if(!e.delegateCheckWork&&!e.suppressCheckwork){let o="unvalidated";(e.justSubmitted||e.numberOfAttemptsLeft<1)&&(e.creditAchieved===1?o="correct":e.creditAchieved===0?o="incorrect":o="partialcorrect");let t={cursor:"pointer",padding:"1px 6px 1px 6px"};f&&(t.backgroundColor=getComputedStyle(document.documentElement).getPropertyValue("--mainGray"));let b=e.submitLabel;e.showCorrectness||(b=e.submitLabelNoCorrectness);let r=n(s,{id:i+"_submit",tabIndex:"0",disabled:f,style:t,onClick:c,onKeyPress:h=>{h.key==="Enter"&&c()},children:[a(l,{style:{},icon:x,transform:{rotate:90}})," ",b]});if(e.showCorrectness){if(o==="correct")t.backgroundColor=getComputedStyle(document.documentElement).getPropertyValue("--mainGreen"),r=n(s,{id:i+"_correct",style:t,children:[a(l,{icon:v}),"  Correct"]});else if(o==="incorrect")t.backgroundColor=getComputedStyle(document.documentElement).getPropertyValue("--mainRed"),r=n(s,{id:i+"_incorrect",style:t,children:[a(l,{icon:w}),"  Incorrect"]});else if(o==="partialcorrect"){t.backgroundColor="#efab34";let k=`${Math.round(e.creditAchieved*100)}% Correct`;r=a(s,{id:i+"_partial",style:t,children:k})}}else o!=="unvalidated"&&(t.backgroundColor="rgb(74, 3, 217)",r=n(s,{id:i+"_saved",style:t,children:[a(l,{icon:L}),"  Response Saved"]}));return e.numberOfAttemptsLeft<0?r=n(m,{children:[r,a("span",{children:"(no attempts remaining)"})]}):e.numberOfAttemptsLeft==1?r=n(m,{children:[r,a("span",{children:"(1 attempt remaining)"})]}):Number.isFinite(e.numberOfAttemptsLeft)&&(r=n(m,{children:[r,n("span",{children:["(",e.numberOfAttemptsLeft," attempts remaining)"]})]})),n("span",{id:i,style:{marginBottom:"4px"},children:[a("a",{name:i}),d,r]})}else return n("span",{id:i,style:{marginBottom:"4px"},children:[a("a",{name:i}),d]})});export{O as default}; diff --git a/dist/assets/asList-3a660e37.js b/dist/assets/asList-3a660e37.js new file mode 100644 index 0000000000..ff2e417de8 --- /dev/null +++ b/dist/assets/asList-3a660e37.js @@ -0,0 +1 @@ +import{av as n,bp as d,j as s,a as o}from"./index-7074710c.js";const h=n.memo(function(a){let{name:c,id:e,SVs:r,children:t}=d(a);if(r.hidden)return null;if(t.length===0)return s(n.Fragment,{},e);let i=t.slice(1).reduce((m,l)=>[...m,", ",l],[t[0]]);return o(n.Fragment,{children:[s("a",{name:e}),i]},e)});export{h as default}; diff --git a/dist/assets/asList-c29bc521.js b/dist/assets/asList-c29bc521.js deleted file mode 100644 index 1894d17dc8..0000000000 --- a/dist/assets/asList-c29bc521.js +++ /dev/null @@ -1 +0,0 @@ -import{av as t,bn as d,j as s,a as o}from"./index-99a56692.js";const h=t.memo(function(a){let{name:c,id:e,SVs:r,children:n}=d(a);if(r.hidden)return null;if(n.length===0)return s(t.Fragment,{},e);let i=n.slice(1).reduce((m,l)=>[...m,", ",l],[n[0]]);return o(t.Fragment,{children:[s("a",{name:e}),i]},e)});export{h as default}; diff --git a/dist/assets/boolean-437e292f.js b/dist/assets/boolean-437e292f.js deleted file mode 100644 index 1155f61d6e..0000000000 --- a/dist/assets/boolean-437e292f.js +++ /dev/null @@ -1 +0,0 @@ -import{av as t,bn as r,a as o,F as l,j as n}from"./index-99a56692.js";const u=t.memo(function(s){let{name:i,id:e,SVs:a}=r(s,!1);return a.hidden?null:o(l,{children:[n("a",{name:e}),n("span",{id:e,children:a.text})]})});export{u as default}; diff --git a/dist/assets/boolean-75566a42.js b/dist/assets/boolean-75566a42.js new file mode 100644 index 0000000000..5ad7f1803f --- /dev/null +++ b/dist/assets/boolean-75566a42.js @@ -0,0 +1 @@ +import{av as t,bp as r,a as o,F as l,j as n}from"./index-7074710c.js";const u=t.memo(function(s){let{name:i,id:e,SVs:a}=r(s,!1);return a.hidden?null:o(l,{children:[n("a",{name:e}),n("span",{id:e,children:a.text})]})});export{u as default}; diff --git a/dist/assets/booleanInput-5b19956a.js b/dist/assets/booleanInput-b5eb97fc.js similarity index 93% rename from dist/assets/booleanInput-5b19956a.js rename to dist/assets/booleanInput-b5eb97fc.js index 04a3f02e94..164ac0f728 100644 --- a/dist/assets/booleanInput-5b19956a.js +++ b/dist/assets/booleanInput-b5eb97fc.js @@ -1,4 +1,4 @@ -import{av as A,bn as j,r as w,R as E,br as F,j as t,i as m,bp as I,a0 as O,aP as P,bq as T,a as l,F as k,s as N,b9 as W}from"./index-99a56692.js";import{T as H}from"./ToggleButton-57def544.js";const s=N.button` +import{av as A,bp as j,r as w,R as E,bt as F,j as t,i as m,br as I,a0 as O,aP as P,bs as T,a as l,F as k,s as N,b9 as W}from"./index-7074710c.js";import{T as H}from"./ToggleButton-faf565eb.js";const s=N.button` position: relative; width: 24px; height: 24px; diff --git a/dist/assets/breadcrumbUtil-6dfe85b1.js b/dist/assets/breadcrumbUtil-1e7f0dfb.js similarity index 96% rename from dist/assets/breadcrumbUtil-6dfe85b1.js rename to dist/assets/breadcrumbUtil-1e7f0dfb.js index b985e46921..66c33afc88 100644 --- a/dist/assets/breadcrumbUtil-6dfe85b1.js +++ b/dist/assets/breadcrumbUtil-1e7f0dfb.js @@ -1 +1 @@ -import{R as f,p as a,l,I as w,az as p,G as k,H as m,g}from"./index-99a56692.js";import{e as y}from"./RoleDropdown-5e05ae49.js";import{studentData as I,assignmentData as _}from"./Gradebook-e81ca638.js";function V(){const e=f(a);return{label:"Courses",onClick:()=>{e({page:"course",tool:"courseChooser",view:""})}}}function D(e){const t=f(a),n=l(w(e));return{label:n==null?void 0:n.label,onClick:()=>{t({page:"course",tool:"dashboard",view:"",params:{courseId:e}})}}}const v=p({key:"navigationSelectorFamily/Default",get:({courseId:e,parentDoenetId:t})=>async({get:n})=>{async function s({courseId:u,parentDoenetId:o}){if(o===""||o===void 0)return[];const{label:c,parentDoenetId:r,type:b}=await n(k(o));return u===r?[{label:c,parentDoenetId:o,type:b}]:[...await s({courseId:u,parentDoenetId:r}),{label:c,parentDoenetId:o,type:b}]}return await s({courseId:e,parentDoenetId:t})}});function N(e,t){const n=f(a),s=l(v({courseId:e,parentDoenetId:t})),u=[{label:"Content",onClick:()=>{n({page:"course",tool:"navigation",view:"",params:{courseId:e}})}}];for(let{label:o,parentDoenetId:c,type:r}of s)switch(r){case"section":u.push({label:o,onClick:()=>{n({page:"course",tool:"navigation",view:"",params:{courseId:e,sectionId:c}})}});break;default:console.warn(`Unsupported navigration crumb type: ${r}`)}return u}function $({pageId:e,doenetId:t,linkPageId:n}){const s=f(a),u=l(k(e));let{label:o}=u;const c=l(k(n));n&&({label:o}=c);const r=l(k(t));let{label:b}=r,i=[{label:b??"_",onClick:()=>{s({page:"course",tool:"editor",view:"",params:{doenetId:t,pageId:e}})}}];if(!r.isSinglePage&&r.type!="bank"&&!n){let d=m(r.content);i=[{label:b??"_",onClick:()=>{s({page:"course",tool:"editor",view:"",params:{doenetId:t,pageId:d}})}},{label:o??"_",onClick:()=>{s({page:"course",tool:"editor",view:"",params:{doenetId:t,pageId:e}})}}]}return r.type=="bank"&&(i=[{label:o??"_",onClick:()=>{s({page:"course",tool:"editor",view:"",params:{doenetId:t,pageId:e}})}}]),n&&(i=[{label:o??"_",onClick:()=>{s({page:"course",tool:"editor",view:"",params:{linkPageId:n}})}}]),i}function x({doenetId:e}){const t=f(a),{label:n}=l(k(e));return{label:n??"_",onClick:()=>{t({page:"course",tool:"assignment",view:"",params:{doenetId:e}})}}}function G(e){const t=f(a);return{label:"People",onClick:()=>{t({page:"course",tool:"people",view:"",params:{courseId:e}})}}}function R(e,t){const n=f(a),s=l(v({courseId:e,parentDoenetId:t})),u=[{label:"Data",onClick:()=>{n({page:"course",tool:"data",view:"",params:{courseId:e}})}}];for(let{label:o,parentDoenetId:c,type:r}of s)switch(r){case"section":u.push({label:o,onClick:()=>{n({page:"course",tool:"data",view:"",params:{courseId:e,sectionId:c}})}});break;default:console.warn(`Unsupported navigration crumb type: ${r}`)}return u}function O(){var r,b;const[{params:e,tool:t},n]=g(a);let s=[];const{canViewAndModifyGrades:u}=l(y(e==null?void 0:e.courseId)),o=l(I),c=l(_);if(u=="1"){let i={courseId:e==null?void 0:e.courseId};s.push({label:"Gradebook",onClick:()=>{n({page:"course",tool:"gradebook",view:"",params:i})}})}if(t=="gradebook")return s;if(t=="gradebookStudent"||u!="1"&&t=="gradebookStudentAssignment"||(e==null?void 0:e.previousCrumb)=="student"&&t=="gradebookStudentAssignment"){let i="Gradebook";if(u=="1"){const C=o[e==null?void 0:e.userId];i=`${C.firstName} ${C.lastName}`}let d={courseId:e==null?void 0:e.courseId,userId:e==null?void 0:e.userId};s.push({label:i,onClick:()=>{n({page:"course",tool:"gradebookStudent",view:"",params:d})}})}if(t=="gradebookStudent")return s;if(t=="gradebookAssignment"||(e==null?void 0:e.previousCrumb)=="assignment"&&t=="gradebookStudentAssignment")if(u!="1")s.push({label:"Not Available"});else{let i=(r=c==null?void 0:c[e==null?void 0:e.doenetId])==null?void 0:r.label;i||(i="_");let d={courseId:e==null?void 0:e.courseId,doenetId:e==null?void 0:e.doenetId};s.push({label:i,onClick:()=>{n({page:"course",tool:"gradebookAssignment",view:"",params:d})}})}if(t=="gradebookAssignment")return s;if(u!="1"){let i=(b=c==null?void 0:c[e==null?void 0:e.doenetId])==null?void 0:b.label;i||(i="_");let d={courseId:e==null?void 0:e.courseId,userId:e==null?void 0:e.userId,doenetId:e==null?void 0:e.doenetId};s.push({label:i,onClick:()=>{n({page:"course",tool:"gradebookStudentAssignment",view:"",params:d})}})}else{let i="_";if((e==null?void 0:e.previousCrumb)=="student"&&(i=c[e==null?void 0:e.doenetId].label),(e==null?void 0:e.previousCrumb)=="assignment"){const C=o[e==null?void 0:e.userId];i=`${C.firstName} ${C.lastName}`}let d={courseId:e==null?void 0:e.courseId,userId:e==null?void 0:e.userId,doenetId:e==null?void 0:e.doenetId,previousCrumb:e==null?void 0:e.previousCrumb};s.push({label:i,onClick:()=>{n({page:"course",tool:"gradebookStudentAssignment",view:"",params:d})}})}return s}export{D as a,N as b,G as c,R as d,$ as e,O as f,x as g,V as u}; +import{R as f,p as a,l,I as w,az as p,G as k,H as m,g}from"./index-7074710c.js";import{e as y}from"./RoleDropdown-cce90708.js";import{studentData as I,assignmentData as _}from"./Gradebook-06d28967.js";function V(){const e=f(a);return{label:"Courses",onClick:()=>{e({page:"course",tool:"courseChooser",view:""})}}}function D(e){const t=f(a),n=l(w(e));return{label:n==null?void 0:n.label,onClick:()=>{t({page:"course",tool:"dashboard",view:"",params:{courseId:e}})}}}const v=p({key:"navigationSelectorFamily/Default",get:({courseId:e,parentDoenetId:t})=>async({get:n})=>{async function s({courseId:u,parentDoenetId:o}){if(o===""||o===void 0)return[];const{label:c,parentDoenetId:r,type:b}=await n(k(o));return u===r?[{label:c,parentDoenetId:o,type:b}]:[...await s({courseId:u,parentDoenetId:r}),{label:c,parentDoenetId:o,type:b}]}return await s({courseId:e,parentDoenetId:t})}});function N(e,t){const n=f(a),s=l(v({courseId:e,parentDoenetId:t})),u=[{label:"Content",onClick:()=>{n({page:"course",tool:"navigation",view:"",params:{courseId:e}})}}];for(let{label:o,parentDoenetId:c,type:r}of s)switch(r){case"section":u.push({label:o,onClick:()=>{n({page:"course",tool:"navigation",view:"",params:{courseId:e,sectionId:c}})}});break;default:console.warn(`Unsupported navigration crumb type: ${r}`)}return u}function $({pageId:e,doenetId:t,linkPageId:n}){const s=f(a),u=l(k(e));let{label:o}=u;const c=l(k(n));n&&({label:o}=c);const r=l(k(t));let{label:b}=r,i=[{label:b??"_",onClick:()=>{s({page:"course",tool:"editor",view:"",params:{doenetId:t,pageId:e}})}}];if(!r.isSinglePage&&r.type!="bank"&&!n){let d=m(r.content);i=[{label:b??"_",onClick:()=>{s({page:"course",tool:"editor",view:"",params:{doenetId:t,pageId:d}})}},{label:o??"_",onClick:()=>{s({page:"course",tool:"editor",view:"",params:{doenetId:t,pageId:e}})}}]}return r.type=="bank"&&(i=[{label:o??"_",onClick:()=>{s({page:"course",tool:"editor",view:"",params:{doenetId:t,pageId:e}})}}]),n&&(i=[{label:o??"_",onClick:()=>{s({page:"course",tool:"editor",view:"",params:{linkPageId:n}})}}]),i}function x({doenetId:e}){const t=f(a),{label:n}=l(k(e));return{label:n??"_",onClick:()=>{t({page:"course",tool:"assignment",view:"",params:{doenetId:e}})}}}function G(e){const t=f(a);return{label:"People",onClick:()=>{t({page:"course",tool:"people",view:"",params:{courseId:e}})}}}function R(e,t){const n=f(a),s=l(v({courseId:e,parentDoenetId:t})),u=[{label:"Data",onClick:()=>{n({page:"course",tool:"data",view:"",params:{courseId:e}})}}];for(let{label:o,parentDoenetId:c,type:r}of s)switch(r){case"section":u.push({label:o,onClick:()=>{n({page:"course",tool:"data",view:"",params:{courseId:e,sectionId:c}})}});break;default:console.warn(`Unsupported navigration crumb type: ${r}`)}return u}function O(){var r,b;const[{params:e,tool:t},n]=g(a);let s=[];const{canViewAndModifyGrades:u}=l(y(e==null?void 0:e.courseId)),o=l(I),c=l(_);if(u=="1"){let i={courseId:e==null?void 0:e.courseId};s.push({label:"Gradebook",onClick:()=>{n({page:"course",tool:"gradebook",view:"",params:i})}})}if(t=="gradebook")return s;if(t=="gradebookStudent"||u!="1"&&t=="gradebookStudentAssignment"||(e==null?void 0:e.previousCrumb)=="student"&&t=="gradebookStudentAssignment"){let i="Gradebook";if(u=="1"){const C=o[e==null?void 0:e.userId];i=`${C.firstName} ${C.lastName}`}let d={courseId:e==null?void 0:e.courseId,userId:e==null?void 0:e.userId};s.push({label:i,onClick:()=>{n({page:"course",tool:"gradebookStudent",view:"",params:d})}})}if(t=="gradebookStudent")return s;if(t=="gradebookAssignment"||(e==null?void 0:e.previousCrumb)=="assignment"&&t=="gradebookStudentAssignment")if(u!="1")s.push({label:"Not Available"});else{let i=(r=c==null?void 0:c[e==null?void 0:e.doenetId])==null?void 0:r.label;i||(i="_");let d={courseId:e==null?void 0:e.courseId,doenetId:e==null?void 0:e.doenetId};s.push({label:i,onClick:()=>{n({page:"course",tool:"gradebookAssignment",view:"",params:d})}})}if(t=="gradebookAssignment")return s;if(u!="1"){let i=(b=c==null?void 0:c[e==null?void 0:e.doenetId])==null?void 0:b.label;i||(i="_");let d={courseId:e==null?void 0:e.courseId,userId:e==null?void 0:e.userId,doenetId:e==null?void 0:e.doenetId};s.push({label:i,onClick:()=>{n({page:"course",tool:"gradebookStudentAssignment",view:"",params:d})}})}else{let i="_";if((e==null?void 0:e.previousCrumb)=="student"&&(i=c[e==null?void 0:e.doenetId].label),(e==null?void 0:e.previousCrumb)=="assignment"){const C=o[e==null?void 0:e.userId];i=`${C.firstName} ${C.lastName}`}let d={courseId:e==null?void 0:e.courseId,userId:e==null?void 0:e.userId,doenetId:e==null?void 0:e.doenetId,previousCrumb:e==null?void 0:e.previousCrumb};s.push({label:i,onClick:()=>{n({page:"course",tool:"gradebookStudentAssignment",view:"",params:d})}})}return s}export{D as a,N as b,G as c,R as d,$ as e,O as f,x as g,V as u}; diff --git a/dist/assets/c-328881f4.js b/dist/assets/c-c3cef1f1.js similarity index 73% rename from dist/assets/c-328881f4.js rename to dist/assets/c-c3cef1f1.js index e55094fbe8..316394e0ae 100644 --- a/dist/assets/c-328881f4.js +++ b/dist/assets/c-c3cef1f1.js @@ -1 +1 @@ -import{av as s,bn as t,a as d,j as i}from"./index-99a56692.js";const m=s.memo(function(n){let{name:c,id:e,SVs:a,children:r}=t(n);return a.hidden?null:d("code",{id:e,style:{margin:"12px 0"},children:[i("a",{name:e}),r]})});export{m as default}; +import{av as s,bp as t,a as d,j as i}from"./index-7074710c.js";const m=s.memo(function(n){let{name:c,id:e,SVs:a,children:r}=t(n);return a.hidden?null:d("code",{id:e,style:{margin:"12px 0"},children:[i("a",{name:e}),r]})});export{m as default}; diff --git a/dist/assets/callAction-4954fd7b.js b/dist/assets/callAction-0d868376.js similarity index 68% rename from dist/assets/callAction-4954fd7b.js rename to dist/assets/callAction-0d868376.js index 3d347aeaaa..c6cac124b7 100644 --- a/dist/assets/callAction-4954fd7b.js +++ b/dist/assets/callAction-0d868376.js @@ -1 +1 @@ -import{av as s,bn as o,a as c,j as l,B as d}from"./index-99a56692.js";const m=s.memo(function(n){let{name:u,id:e,SVs:a,actions:t,callAction:i}=o(n);return a.hidden?null:c("div",{id:e,style:{margin:"12px 0",display:"inline-block"},children:[l("a",{name:e}),l(d,{id:e+"_button",onClick:()=>i({action:t.callAction}),disabled:a.disabled,value:a.label,valueHasLatex:a.labelHasLatex})]})});export{m as default}; +import{av as s,bp as o,a as c,j as l,B as d}from"./index-7074710c.js";const m=s.memo(function(n){let{name:u,id:e,SVs:a,actions:t,callAction:i}=o(n);return a.hidden?null:c("div",{id:e,style:{margin:"12px 0",display:"inline-block"},children:[l("a",{name:e}),l(d,{id:e+"_button",onClick:()=>i({action:t.callAction}),disabled:a.disabled,value:a.label,valueHasLatex:a.labelHasLatex})]})});export{m as default}; diff --git a/dist/assets/cell-ec2c6a75.js b/dist/assets/cell-0157179d.js similarity index 91% rename from dist/assets/cell-ec2c6a75.js rename to dist/assets/cell-0157179d.js index 40a9a4632a..cdf1d5508e 100644 --- a/dist/assets/cell-ec2c6a75.js +++ b/dist/assets/cell-0157179d.js @@ -1 +1 @@ -import{av as d,bn as s,j as o}from"./index-99a56692.js";const f=d.memo(function(r){let{name:m,id:l,SVs:e,children:n}=s(r);if(e.hidden)return null;let t={style:{padding:"3px 10px"}};e.colSpan!==1&&(t.colSpan=e.colSpan),e.halign!==null&&(t.style.textAlign=e.halign),e.bottom!=="none"&&(t.style.borderBottomStyle="solid",e.bottom==="minor"?t.style.borderBottomWidth="thin":e.bottom==="medium"?t.style.borderBottomWidth="medium":t.style.borderBottomWidth="thick"),e.right!=="none"&&(t.style.borderRightStyle="solid",e.right==="minor"?t.style.borderRightWidth="thin":e.right==="medium"?t.style.borderRightWidth="medium":t.style.borderRightWidth="thick");let i=n;return i.length===0&&(i=e.text),e.inHeader?o("th",{id:l,...t,children:i}):o("td",{id:l,...t,children:i})});export{f as default}; +import{av as d,bp as s,j as o}from"./index-7074710c.js";const f=d.memo(function(r){let{name:m,id:l,SVs:e,children:n}=s(r);if(e.hidden)return null;let t={style:{padding:"3px 10px"}};e.colSpan!==1&&(t.colSpan=e.colSpan),e.halign!==null&&(t.style.textAlign=e.halign),e.bottom!=="none"&&(t.style.borderBottomStyle="solid",e.bottom==="minor"?t.style.borderBottomWidth="thin":e.bottom==="medium"?t.style.borderBottomWidth="medium":t.style.borderBottomWidth="thick"),e.right!=="none"&&(t.style.borderRightStyle="solid",e.right==="minor"?t.style.borderRightWidth="thin":e.right==="medium"?t.style.borderRightWidth="medium":t.style.borderRightWidth="thick");let i=n;return i.length===0&&(i=e.text),e.inHeader?o("th",{id:l,...t,children:i}):o("td",{id:l,...t,children:i})});export{f as default}; diff --git a/dist/assets/chart-7ea2262d.js b/dist/assets/chart-815ca470.js similarity index 50% rename from dist/assets/chart-7ea2262d.js rename to dist/assets/chart-815ca470.js index 4e4657d5ed..4d813c96e8 100644 --- a/dist/assets/chart-7ea2262d.js +++ b/dist/assets/chart-815ca470.js @@ -1 +1 @@ -import{av as c,bn as l,r,a as d,F as m,j as e}from"./index-99a56692.js";import{V as h}from"./visibility-sensor-55e75ed1.js";const C=r.createContext(),x=c.memo(function(s){let{name:b,id:i,SVs:f,actions:t,callAction:a}=l(s),n=o=>{a({action:t.recordVisibilityChange,args:{isVisible:o}})};return r.useEffect(()=>()=>{a({action:t.recordVisibilityChange,args:{isVisible:!1}})},[]),d(m,{children:[e("a",{name:i}),e(h,{partialVisibility:!0,onChange:n,children:e("div",{id:i})})]})});export{C as BoardContext,x as default}; +import{av as c,bp as l,r,a as d,F as m,j as e}from"./index-7074710c.js";import{V as h}from"./visibility-sensor-7d414852.js";const C=r.createContext(),p=c.memo(function(s){let{name:b,id:i,SVs:f,actions:t,callAction:a}=l(s),n=o=>{a({action:t.recordVisibilityChange,args:{isVisible:o}})};return r.useEffect(()=>()=>{a({action:t.recordVisibilityChange,args:{isVisible:!1}})},[]),d(m,{children:[e("a",{name:i}),e(h,{partialVisibility:!0,onChange:n,children:e("div",{id:i})})]})});export{C as BoardContext,p as default}; diff --git a/dist/assets/choiceInput-9c4307b4.js b/dist/assets/choiceInput-5177cadb.js similarity index 97% rename from dist/assets/choiceInput-9c4307b4.js rename to dist/assets/choiceInput-5177cadb.js index ede5144992..24dcb434c0 100644 --- a/dist/assets/choiceInput-9c4307b4.js +++ b/dist/assets/choiceInput-5177cadb.js @@ -1,4 +1,4 @@ -import{av as S,bn as D,r as I,R as W,br as M,j as r,i as f,bp as _,a0 as w,aP as L,bq as O,a as l,F as k,s as T}from"./index-99a56692.js";const p=T.button` +import{av as S,bp as D,r as I,R as W,bt as M,j as r,i as f,br as _,a0 as w,aP as L,bs as O,a as l,F as k,s as T}from"./index-7074710c.js";const p=T.button` position: relative; /* width: 24px; */ height: 24px; diff --git a/dist/assets/circle-e7253084.js b/dist/assets/circle-83bf1e74.js similarity index 94% rename from dist/assets/circle-e7253084.js rename to dist/assets/circle-83bf1e74.js index ce389cbae5..533fbde169 100644 --- a/dist/assets/circle-e7253084.js +++ b/dist/assets/circle-83bf1e74.js @@ -1 +1 @@ -import{av as _,bn as M,r as l,l as X,bs as E,j as J}from"./index-99a56692.js";import{BoardContext as N,LINE_LAYER_OFFSET as L}from"./graph-57e1e537.js";import"./css-14ccef8c.js";import"./visibility-sensor-55e75ed1.js";const I=_.memo(function u(F){let{name:Y,id:P,SVs:e,actions:h,callAction:p}=M(F);u.ignoreActionsWithoutCore=!0;const o=l.useContext(N);let r=l.useRef(null),C=l.useRef(!1),d=l.useRef(!1),g=l.useRef(!1),b=l.useRef(!1),v=l.useRef(!1),S=l.useRef(!1),m=l.useRef(null),R=l.useRef(null),w=l.useRef(null);R.current=e.numericalCenter,w.current=e.throughAngles;const y=X(E);l.useEffect(()=>()=>{r.current&&O()},[]);function D(){if(!(Number.isFinite(e.numericalCenter[0])&&Number.isFinite(e.numericalCenter[1])&&e.numericalRadius>0))return null;let a=!e.draggable||e.fixed,i=y==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;i=i.toLowerCase();let c=y==="dark"?e.selectedStyle.fillColorDarkMode:e.selectedStyle.fillColor;c=e.filled?c.toLowerCase():"none";var n={name:e.labelForGraph,visible:!e.hidden,withLabel:e.showLabel&&e.labelForGraph!=="",fixed:a,layer:10*e.layer+L,strokeColor:i,strokeOpacity:e.selectedStyle.lineOpacity,highlightStrokeColor:i,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,highlightStrokeOpacity:e.selectedStyle.lineOpacity*.5,dash:A(e.selectedStyle.lineStyle),fillColor:c,fillOpacity:e.selectedStyle.fillOpacity,highlightFillColor:c,highlightFillOpacity:e.selectedStyle.fillOpacity*.5,highlight:!a};e.filled&&(n.hasInnerPoints=!0),n.label={highlight:!1},e.labelHasLatex&&(n.label.useMathJax=!0),e.showLabel&&e.labelForGraph!==""&&(e.applyStyleToLabel?n.label.strokeColor=i:n.label.strokeColor="var(--canvastext)");let s=o.create("circle",[[...e.numericalCenter],e.numericalRadius],n);return s.on("drag",function(t){(Math.abs(t.x-d.current[0])>.1||Math.abs(t.y-d.current[1])>.1)&&(C.current=!0),m.current=G(t),p({action:h.moveCircle,args:{center:m.current,radius:b.current,throughAngles:v.current,transient:!0,skippable:!0}}),s.center.coords.setCoordinates(JXG.COORDS_BY_USER,[...R.current])}),s.on("up",function(t){C.current?p({action:h.moveCircle,args:{center:m.current,radius:b.current,throughAngles:v.current}}):p({action:h.circleClicked})}),s.on("down",function(t){C.current=!1,d.current=[t.x,t.y],g.current=[...s.center.coords.scrCoords],b.current=s.radius,v.current=[...w.current],p({action:h.mouseDownOnCircle})}),S.current=e.showLabel&&e.labelForGraph!=="",s}function G(a){var i=o.origin.scrCoords;let c=(g.current[1]+a.x-d.current[0]-i[1])/o.unitX,n=(i[2]-(g.current[2]+a.y-d.current[1]))/o.unitY;return[c,n]}function O(){r.current.off("drag"),r.current.off("down"),r.current.off("up"),o.removeObject(r.current),r.current=null}if(o)if(!r.current)r.current=D();else if(!(Number.isFinite(e.numericalCenter[0])&&Number.isFinite(e.numericalCenter[1])&&e.numericalRadius>0))O();else{o.updateQuality===o.BOARD_QUALITY_LOW&&(o.itemsRenderedLowQuality[P]=r.current);let a=e.numericalCenter.every(W=>Number.isFinite(W));r.current.center.coords.setCoordinates(JXG.COORDS_BY_USER,[...e.numericalCenter]),r.current.setRadius(e.numericalRadius);let i=!e.hidden;a?(r.current.visProp.visible=i,r.current.visPropCalc.visible=i):(r.current.visProp.visible=!1,r.current.visPropCalc.visible=!1);let c=!e.draggable||e.fixed;r.current.visProp.fixed=c,r.current.visProp.highlight=!c;let n=10*e.layer+L;r.current.visProp.layer!==n&&r.current.setAttribute({layer:n});let t=y==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;t=t.toLowerCase();let f=y==="dark"?e.selectedStyle.fillColorDarkMode:e.selectedStyle.fillColor;f=e.filled?f.toLowerCase():"none",r.current.visProp.strokecolor!==t&&(r.current.visProp.strokecolor=t,r.current.visProp.highlightstrokecolor=t),r.current.visProp.strokeopacity!==e.selectedStyle.lineOpacity&&(r.current.visProp.strokeopacity=e.selectedStyle.lineOpacity,r.current.visProp.highlightstrokeopacity=e.selectedStyle.lineOpacity*.5);let x=A(e.selectedStyle.lineStyle);r.current.visProp.dash!==x&&(r.current.visProp.dash=x),r.current.visProp.strokewidth!==e.selectedStyle.lineWidth&&(r.current.visProp.strokewidth=e.selectedStyle.lineWidth,r.current.visProp.highlightstrokewidth=e.selectedStyle.lineWidth),r.current.visProp.fillcolor!==f&&(r.current.visProp.fillcolor=f,r.current.visProp.highlightfillcolor=f,r.current.visProp.hasinnerpoints=e.filled),r.current.visProp.fillopacity!==e.selectedStyle.fillOpacity&&(r.current.visProp.fillopacity=e.selectedStyle.fillOpacity,r.current.visProp.highlightfillopacity=e.selectedStyle.fillOpacity*.5),r.current.name=e.labelForGraph;let k=e.showLabel&&e.labelForGraph!=="";k!=S.current&&(r.current.setAttribute({withlabel:k}),S.current=k),r.current.needsUpdate=!0,r.current.update(),r.current.hasLabel&&(e.applyStyleToLabel?r.current.label.visProp.strokecolor=t:r.current.label.visProp.strokecolor="var(--canvastext)",r.current.label.needsUpdate=!0,r.current.label.update()),o.updateRenderer()}return e.hidden?null:J("a",{name:P})});function A(u){return u==="solid"?0:u==="dashed"?2:u==="dotted"?1:0}export{I as default}; +import{av as _,bp as M,r as l,l as X,bu as E,j as J}from"./index-7074710c.js";import{BoardContext as N,LINE_LAYER_OFFSET as L}from"./graph-71cec529.js";import"./css-14ccef8c.js";import"./visibility-sensor-7d414852.js";const I=_.memo(function u(F){let{name:Y,id:P,SVs:e,actions:h,callAction:p}=M(F);u.ignoreActionsWithoutCore=!0;const o=l.useContext(N);let r=l.useRef(null),C=l.useRef(!1),d=l.useRef(!1),g=l.useRef(!1),b=l.useRef(!1),v=l.useRef(!1),S=l.useRef(!1),m=l.useRef(null),R=l.useRef(null),w=l.useRef(null);R.current=e.numericalCenter,w.current=e.throughAngles;const y=X(E);l.useEffect(()=>()=>{r.current&&O()},[]);function D(){if(!(Number.isFinite(e.numericalCenter[0])&&Number.isFinite(e.numericalCenter[1])&&e.numericalRadius>0))return null;let a=!e.draggable||e.fixed,i=y==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;i=i.toLowerCase();let c=y==="dark"?e.selectedStyle.fillColorDarkMode:e.selectedStyle.fillColor;c=e.filled?c.toLowerCase():"none";var n={name:e.labelForGraph,visible:!e.hidden,withLabel:e.showLabel&&e.labelForGraph!=="",fixed:a,layer:10*e.layer+L,strokeColor:i,strokeOpacity:e.selectedStyle.lineOpacity,highlightStrokeColor:i,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,highlightStrokeOpacity:e.selectedStyle.lineOpacity*.5,dash:A(e.selectedStyle.lineStyle),fillColor:c,fillOpacity:e.selectedStyle.fillOpacity,highlightFillColor:c,highlightFillOpacity:e.selectedStyle.fillOpacity*.5,highlight:!a};e.filled&&(n.hasInnerPoints=!0),n.label={highlight:!1},e.labelHasLatex&&(n.label.useMathJax=!0),e.showLabel&&e.labelForGraph!==""&&(e.applyStyleToLabel?n.label.strokeColor=i:n.label.strokeColor="var(--canvastext)");let s=o.create("circle",[[...e.numericalCenter],e.numericalRadius],n);return s.on("drag",function(t){(Math.abs(t.x-d.current[0])>.1||Math.abs(t.y-d.current[1])>.1)&&(C.current=!0),m.current=G(t),p({action:h.moveCircle,args:{center:m.current,radius:b.current,throughAngles:v.current,transient:!0,skippable:!0}}),s.center.coords.setCoordinates(JXG.COORDS_BY_USER,[...R.current])}),s.on("up",function(t){C.current?p({action:h.moveCircle,args:{center:m.current,radius:b.current,throughAngles:v.current}}):p({action:h.circleClicked})}),s.on("down",function(t){C.current=!1,d.current=[t.x,t.y],g.current=[...s.center.coords.scrCoords],b.current=s.radius,v.current=[...w.current],p({action:h.mouseDownOnCircle})}),S.current=e.showLabel&&e.labelForGraph!=="",s}function G(a){var i=o.origin.scrCoords;let c=(g.current[1]+a.x-d.current[0]-i[1])/o.unitX,n=(i[2]-(g.current[2]+a.y-d.current[1]))/o.unitY;return[c,n]}function O(){r.current.off("drag"),r.current.off("down"),r.current.off("up"),o.removeObject(r.current),r.current=null}if(o)if(!r.current)r.current=D();else if(!(Number.isFinite(e.numericalCenter[0])&&Number.isFinite(e.numericalCenter[1])&&e.numericalRadius>0))O();else{o.updateQuality===o.BOARD_QUALITY_LOW&&(o.itemsRenderedLowQuality[P]=r.current);let a=e.numericalCenter.every(W=>Number.isFinite(W));r.current.center.coords.setCoordinates(JXG.COORDS_BY_USER,[...e.numericalCenter]),r.current.setRadius(e.numericalRadius);let i=!e.hidden;a?(r.current.visProp.visible=i,r.current.visPropCalc.visible=i):(r.current.visProp.visible=!1,r.current.visPropCalc.visible=!1);let c=!e.draggable||e.fixed;r.current.visProp.fixed=c,r.current.visProp.highlight=!c;let n=10*e.layer+L;r.current.visProp.layer!==n&&r.current.setAttribute({layer:n});let t=y==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;t=t.toLowerCase();let f=y==="dark"?e.selectedStyle.fillColorDarkMode:e.selectedStyle.fillColor;f=e.filled?f.toLowerCase():"none",r.current.visProp.strokecolor!==t&&(r.current.visProp.strokecolor=t,r.current.visProp.highlightstrokecolor=t),r.current.visProp.strokeopacity!==e.selectedStyle.lineOpacity&&(r.current.visProp.strokeopacity=e.selectedStyle.lineOpacity,r.current.visProp.highlightstrokeopacity=e.selectedStyle.lineOpacity*.5);let x=A(e.selectedStyle.lineStyle);r.current.visProp.dash!==x&&(r.current.visProp.dash=x),r.current.visProp.strokewidth!==e.selectedStyle.lineWidth&&(r.current.visProp.strokewidth=e.selectedStyle.lineWidth,r.current.visProp.highlightstrokewidth=e.selectedStyle.lineWidth),r.current.visProp.fillcolor!==f&&(r.current.visProp.fillcolor=f,r.current.visProp.highlightfillcolor=f,r.current.visProp.hasinnerpoints=e.filled),r.current.visProp.fillopacity!==e.selectedStyle.fillOpacity&&(r.current.visProp.fillopacity=e.selectedStyle.fillOpacity,r.current.visProp.highlightfillopacity=e.selectedStyle.fillOpacity*.5),r.current.name=e.labelForGraph;let k=e.showLabel&&e.labelForGraph!=="";k!=S.current&&(r.current.setAttribute({withlabel:k}),S.current=k),r.current.needsUpdate=!0,r.current.update(),r.current.hasLabel&&(e.applyStyleToLabel?r.current.label.visProp.strokecolor=t:r.current.label.visProp.strokecolor="var(--canvastext)",r.current.label.needsUpdate=!0,r.current.label.update()),o.updateRenderer()}return e.hidden?null:J("a",{name:P})});function A(u){return u==="solid"?0:u==="dashed"?2:u==="dotted"?1:0}export{I as default}; diff --git a/dist/assets/cobwebPolyline-97c56c48.js b/dist/assets/cobwebPolyline-32ff0a06.js similarity index 95% rename from dist/assets/cobwebPolyline-97c56c48.js rename to dist/assets/cobwebPolyline-32ff0a06.js index 57a3ad6730..d0506a2156 100644 --- a/dist/assets/cobwebPolyline-97c56c48.js +++ b/dist/assets/cobwebPolyline-32ff0a06.js @@ -1 +1 @@ -import{av as J,bn as L,r as u,bt as X,j as A,F as N}from"./index-99a56692.js";import{BoardContext as I,LINE_LAYER_OFFSET as k,VERTEX_LAYER_OFFSET as U}from"./graph-57e1e537.js";import"./css-14ccef8c.js";import"./visibility-sensor-55e75ed1.js";const M=J.memo(function f(V){let{name:R,id:j,SVs:e,actions:E,sourceOfUpdate:S,callAction:_}=L(V);f.ignoreActionsWithoutCore=!0;const o=u.useContext(I);let h=u.useRef(null),x=u.useRef(null),l=u.useRef(null),t=u.useRef(null),P=u.useRef(null),C=u.useRef(null),p=u.useRef(null),c=u.useRef(null),$=u.useRef(null);$.current=e.numericalVertices,u.useEffect(()=>()=>{l.current&&D()},[]);function G(){let n={visible:!e.hidden,withLabel:!1,fixed:!0,layer:10*e.layer+k,strokeColor:"green",highlightStrokeColor:"green",strokeWidth:3,dash:F("solid")},g=X(e.fDefinition);h.current=o.create("functiongraph",[g],n);let b={visible:!e.hidden,withLabel:!1,fixed:!0,layer:10*e.layer+k,strokeColor:"gray",highlightStrokeColor:"gray",strokeWidth:2,dash:F("solid")};x.current=o.create("line",[[0,0],[1,1]],b);let m=!0;for(let i of e.numericalVertices)Number.isFinite(i[0])||(m=!1),Number.isFinite(i[1])||(m=!1);let v={name:e.labelForGraph,visible:!e.hidden&&m,withLabel:e.showLabel&&e.labelForGraph!=="",fixed:!0,layer:10*e.layer+k,strokeColor:e.selectedStyle.lineColor,highlightStrokeColor:e.selectedStyle.lineColor,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,dash:F(e.selectedStyle.lineStyle)};v.label={highlight:!1},e.labelHasLatex&&(v.label.useMathJax=!0),c.current={fixed:!e.draggable||e.fixed,visible:!e.hidden&&m&&e.draggable,withLabel:!0,name:"A",layer:10*e.layer+U,fillColor:e.selectedStyle.markerColor,strokeColor:e.selectedStyle.markerColor,size:e.selectedStyle.markerSize,face:Y(e.selectedStyle.markerStyle)},e.draggable?(c.current.highlightFillColor="#EEEEEE",c.current.highlightStrokeColor="#C3D9FF",c.current.showInfoBox=!0):(c.current.highlightFillColor=e.selectedStyle.markerColor,c.current.highlightStrokeColor=e.selectedStyle.markerColor,c.current.showInfoBox=!1),t.current=[];let a=e.variable.toString();for(let i=0;i{r.push(i[0]),s.push(i[1])});let y=o.create("curve",[r,s],v);for(let i=0;iw(i)),t.current[i].on("up",d=>O(i)),t.current[i].on("down",d=>C.current=null);return p.current=e.nPoints,y}function D(){o.removeObject(l.current),l.current=null,o.removeObject(h.current),h.current=null,o.removeObject(x.current),x.current=null;for(let n=0;np.current)for(let r=p.current;rw(r)),t.current[r].on("up",y=>O(r)),t.current[r].on("down",y=>C.current=null)}else if(e.nPoints0&&e.draggable&&(t.current[e.nPoints-1].visProp.visible=a,t.current[e.nPoints-1].visPropCalc.visible=a)}else{l.current.visProp.visible=!1,l.current.visPropCalc.visible=!1;for(let r=0;r0&&(t.current[e.nPoints-1].setAttribute({withlabel:!0}),t.current[e.nPoints-1].label.needsUpdate=!0,t.current[e.nPoints-1].label.update()),o.updateRenderer()}return e.hidden?null:A(N,{children:A("a",{name:j})})});function F(f){return f==="solid"?0:f==="dashed"?2:f==="dotted"?1:0}function Y(f){return f==="triangle"?"triangleup":f}export{M as default}; +import{av as J,bp as L,r as u,bv as X,j as A,F as N}from"./index-7074710c.js";import{BoardContext as I,LINE_LAYER_OFFSET as k,VERTEX_LAYER_OFFSET as U}from"./graph-71cec529.js";import"./css-14ccef8c.js";import"./visibility-sensor-7d414852.js";const M=J.memo(function f(V){let{name:R,id:j,SVs:e,actions:E,sourceOfUpdate:S,callAction:_}=L(V);f.ignoreActionsWithoutCore=!0;const o=u.useContext(I);let h=u.useRef(null),x=u.useRef(null),l=u.useRef(null),t=u.useRef(null),P=u.useRef(null),C=u.useRef(null),p=u.useRef(null),c=u.useRef(null),$=u.useRef(null);$.current=e.numericalVertices,u.useEffect(()=>()=>{l.current&&D()},[]);function G(){let n={visible:!e.hidden,withLabel:!1,fixed:!0,layer:10*e.layer+k,strokeColor:"green",highlightStrokeColor:"green",strokeWidth:3,dash:F("solid")},g=X(e.fDefinition);h.current=o.create("functiongraph",[g],n);let b={visible:!e.hidden,withLabel:!1,fixed:!0,layer:10*e.layer+k,strokeColor:"gray",highlightStrokeColor:"gray",strokeWidth:2,dash:F("solid")};x.current=o.create("line",[[0,0],[1,1]],b);let m=!0;for(let i of e.numericalVertices)Number.isFinite(i[0])||(m=!1),Number.isFinite(i[1])||(m=!1);let v={name:e.labelForGraph,visible:!e.hidden&&m,withLabel:e.showLabel&&e.labelForGraph!=="",fixed:!0,layer:10*e.layer+k,strokeColor:e.selectedStyle.lineColor,highlightStrokeColor:e.selectedStyle.lineColor,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,dash:F(e.selectedStyle.lineStyle)};v.label={highlight:!1},e.labelHasLatex&&(v.label.useMathJax=!0),c.current={fixed:!e.draggable||e.fixed,visible:!e.hidden&&m&&e.draggable,withLabel:!0,name:"A",layer:10*e.layer+U,fillColor:e.selectedStyle.markerColor,strokeColor:e.selectedStyle.markerColor,size:e.selectedStyle.markerSize,face:Y(e.selectedStyle.markerStyle)},e.draggable?(c.current.highlightFillColor="#EEEEEE",c.current.highlightStrokeColor="#C3D9FF",c.current.showInfoBox=!0):(c.current.highlightFillColor=e.selectedStyle.markerColor,c.current.highlightStrokeColor=e.selectedStyle.markerColor,c.current.showInfoBox=!1),t.current=[];let a=e.variable.toString();for(let i=0;i{r.push(i[0]),s.push(i[1])});let y=o.create("curve",[r,s],v);for(let i=0;iw(i)),t.current[i].on("up",d=>O(i)),t.current[i].on("down",d=>C.current=null);return p.current=e.nPoints,y}function D(){o.removeObject(l.current),l.current=null,o.removeObject(h.current),h.current=null,o.removeObject(x.current),x.current=null;for(let n=0;np.current)for(let r=p.current;rw(r)),t.current[r].on("up",y=>O(r)),t.current[r].on("down",y=>C.current=null)}else if(e.nPoints0&&e.draggable&&(t.current[e.nPoints-1].visProp.visible=a,t.current[e.nPoints-1].visPropCalc.visible=a)}else{l.current.visProp.visible=!1,l.current.visPropCalc.visible=!1;for(let r=0;r0&&(t.current[e.nPoints-1].setAttribute({withlabel:!0}),t.current[e.nPoints-1].label.needsUpdate=!0,t.current[e.nPoints-1].label.update()),o.updateRenderer()}return e.hidden?null:A(N,{children:A("a",{name:j})})});function F(f){return f==="solid"?0:f==="dashed"?2:f==="dotted"?1:0}function Y(f){return f==="triangle"?"triangleup":f}export{M as default}; diff --git a/dist/assets/codeEditor-9456a083.js b/dist/assets/codeEditor-3b7bb2dd.js similarity index 70% rename from dist/assets/codeEditor-9456a083.js rename to dist/assets/codeEditor-3b7bb2dd.js index b7fe29651a..9fead1ad28 100644 --- a/dist/assets/codeEditor-9456a083.js +++ b/dist/assets/codeEditor-3b7bb2dd.js @@ -1 +1 @@ -import{av as C,bn as T,r as l,a as s,F as S,j as a}from"./index-99a56692.js";import{s as n}from"./css-14ccef8c.js";import{C as W}from"./CodeMirror-35f8e4ac.js";import{V as B}from"./visibility-sensor-55e75ed1.js";const H=C.memo(function(p){let{name:j,id:d,SVs:e,children:g,actions:i,callAction:r}=T(p),u=l.useRef(e.immediateValue),t=l.useRef(null),y=l.useRef(null),c=l.useRef(e.immediateValue),x={...e.height},m={...e.height};e.showResults&&(m.size*=1-e.viewerRatio);let R=o=>{r({action:i.recordVisibilityChange,args:{isVisible:o}})};if(l.useEffect(()=>()=>{r({action:i.recordVisibilityChange,args:{isVisible:!1}}),t.current!==null&&(clearTimeout(t.current),r({action:i.updateValue}))},[]),e.hidden)return null;const h=d+"_editor";e.immediateValue!==u.current&&(u.current=e.immediateValue,c.current=e.immediateValue);let f=null,w=e.width,V=e.width,b={width:n(w),height:n(m),maxWidth:"100%",padding:"0px",overflowX:"hidden",overflowY:"scroll"};e.showResults&&(f=s(S,{children:[a("hr",{style:{width:n(V),maxWidth:"100%"}}),a("div",{children:g})]}));let v=a("div",{id:h,style:b,children:a(W,{editorRef:y,setInternalValue:c.current,readOnly:e.disabled,onBlur:()=>{clearTimeout(t.current),r({action:i.updateValue}),t.current=null},onFocus:()=>{},onBeforeChange:o=>{u.current=o,r({action:i.updateImmediateValue,args:{text:o}}),clearTimeout(t.current),t.current=setTimeout(function(){r({action:i.updateValue}),t.current=null},3e3)}})},h);return a(B,{partialVisibility:!0,onChange:R,children:s("div",{style:{margin:"12px 0"},children:[a("a",{name:d}),s("div",{style:{padding:"0",border:"var(--mainBorder)",borderRadius:"var(--mainBorderRadius)",height:n(x),width:n(V),maxWidth:"100%",display:"flex",flexDirection:"column"},id:d,children:[v,f]})]})})});export{H as default}; +import{av as C,bp as T,r as l,a as s,F as S,j as a}from"./index-7074710c.js";import{s as n}from"./css-14ccef8c.js";import{C as W}from"./CodeMirror-87ecbb8f.js";import{V as B}from"./visibility-sensor-7d414852.js";const H=C.memo(function(V){let{name:j,id:d,SVs:e,children:g,actions:i,callAction:r}=T(V),u=l.useRef(e.immediateValue),t=l.useRef(null),y=l.useRef(null),c=l.useRef(e.immediateValue),x={...e.height},m={...e.height};e.showResults&&(m.size*=1-e.viewerRatio);let R=o=>{r({action:i.recordVisibilityChange,args:{isVisible:o}})};if(l.useEffect(()=>()=>{r({action:i.recordVisibilityChange,args:{isVisible:!1}}),t.current!==null&&(clearTimeout(t.current),r({action:i.updateValue}))},[]),e.hidden)return null;const h=d+"_editor";e.immediateValue!==u.current&&(u.current=e.immediateValue,c.current=e.immediateValue);let f=null,w=e.width,p=e.width,b={width:n(w),height:n(m),maxWidth:"100%",padding:"0px",overflowX:"hidden",overflowY:"scroll"};e.showResults&&(f=s(S,{children:[a("hr",{style:{width:n(p),maxWidth:"100%"}}),a("div",{children:g})]}));let v=a("div",{id:h,style:b,children:a(W,{editorRef:y,setInternalValue:c.current,readOnly:e.disabled,onBlur:()=>{clearTimeout(t.current),r({action:i.updateValue}),t.current=null},onFocus:()=>{},onBeforeChange:o=>{u.current=o,r({action:i.updateImmediateValue,args:{text:o}}),clearTimeout(t.current),t.current=setTimeout(function(){r({action:i.updateValue}),t.current=null},3e3)}})},h);return a(B,{partialVisibility:!0,onChange:R,children:s("div",{style:{margin:"12px 0"},children:[a("a",{name:d}),s("div",{style:{padding:"0",border:"var(--mainBorder)",borderRadius:"var(--mainBorderRadius)",height:n(x),width:n(p),maxWidth:"100%",display:"flex",flexDirection:"column"},id:d,children:[v,f]})]})})});export{H as default}; diff --git a/dist/assets/codeViewer-b9183700.js b/dist/assets/codeViewer-74dc4db9.js similarity index 83% rename from dist/assets/codeViewer-b9183700.js rename to dist/assets/codeViewer-74dc4db9.js index 4492036df9..05024dbe88 100644 --- a/dist/assets/codeViewer-b9183700.js +++ b/dist/assets/codeViewer-74dc4db9.js @@ -1 +1 @@ -import{av as p,bn as f,r as v,a as l,j as i,B as w}from"./index-99a56692.js";import{s as t}from"./css-14ccef8c.js";import{V as x}from"./visibility-sensor-55e75ed1.js";const S=p.memo(function(h){let{name:V,id:r,SVs:e,children:c,actions:a,callAction:n}=f(h,!1),u=g=>{n({action:a.recordVisibilityChange,args:{isVisible:g}})};if(v.useEffect(()=>()=>{n({action:a.recordVisibilityChange,args:{isVisible:!1}})},[]),e.hidden)return null;let s={...e.height};s.size=s.size-30;let d={...e.width};d.size=d.size-4;let o={width:t(e.width),maxWidth:"100%"};e.hasCodeEditorParent||(o.border="var(--mainBorder)",o.borderRadius="var(--mainBorderRadius)");let m=l("div",{style:{width:t(e.width),height:t(e.height),maxWidth:"100%",padding:"12px"},children:[i("div",{style:{height:"28px"},children:i(w,{onClick:()=>n({action:a.updateComponents}),value:"update",id:r+"_updateButton"})}),i("div",{style:{overflowY:"scroll",width:t(d),maxWidth:"100%",height:t(s)},id:r+"_content",children:c})]});return i(x,{partialVisibility:!0,onChange:u,children:l("div",{style:{margin:"12px 0"},children:[i("a",{name:r}),i("div",{style:o,className:"codeViewerSurroundingBox",id:r,children:m})]})})});export{S as default}; +import{av as p,bp as f,r as v,a as l,j as i,B as w}from"./index-7074710c.js";import{s as t}from"./css-14ccef8c.js";import{V as x}from"./visibility-sensor-7d414852.js";const S=p.memo(function(h){let{name:V,id:r,SVs:e,children:c,actions:a,callAction:n}=f(h,!1),u=g=>{n({action:a.recordVisibilityChange,args:{isVisible:g}})};if(v.useEffect(()=>()=>{n({action:a.recordVisibilityChange,args:{isVisible:!1}})},[]),e.hidden)return null;let s={...e.height};s.size=s.size-30;let d={...e.width};d.size=d.size-4;let o={width:t(e.width),maxWidth:"100%"};e.hasCodeEditorParent||(o.border="var(--mainBorder)",o.borderRadius="var(--mainBorderRadius)");let m=l("div",{style:{width:t(e.width),height:t(e.height),maxWidth:"100%",padding:"12px"},children:[i("div",{style:{height:"28px"},children:i(w,{onClick:()=>n({action:a.updateComponents}),value:"update",id:r+"_updateButton"})}),i("div",{style:{overflowY:"scroll",width:t(d),maxWidth:"100%",height:t(s)},id:r+"_content",children:c})]});return i(x,{partialVisibility:!0,onChange:u,children:l("div",{style:{margin:"12px 0"},children:[i("a",{name:r}),i("div",{style:o,className:"codeViewerSurroundingBox",id:r,children:m})]})})});export{S as default}; diff --git a/dist/assets/containerBlock-cf29dd99.js b/dist/assets/containerBlock-cf29dd99.js new file mode 100644 index 0000000000..2427d6b467 --- /dev/null +++ b/dist/assets/containerBlock-cf29dd99.js @@ -0,0 +1 @@ +import{av as c,bp as d,r as f,j as a,a as h}from"./index-7074710c.js";import{V}from"./visibility-sensor-7d414852.js";const y=c.memo(function(n){let{name:u,id:e,SVs:t,children:s,actions:i,callAction:r}=d(n),o=l=>{i.recordVisibilityChange&&r({action:i.recordVisibilityChange,args:{isVisible:l}})};return f.useEffect(()=>()=>{i.recordVisibilityChange&&r({action:i.recordVisibilityChange,args:{isVisible:!1}})},[]),t.hidden?null:a(V,{partialVisibility:!0,onChange:o,children:h("div",{id:e,children:[a("a",{name:e}),s]})})});export{y as default}; diff --git a/dist/assets/containerBlock-f5e1b6af.js b/dist/assets/containerBlock-f5e1b6af.js deleted file mode 100644 index b068763155..0000000000 --- a/dist/assets/containerBlock-f5e1b6af.js +++ /dev/null @@ -1 +0,0 @@ -import{av as c,bn as d,r as f,j as n,a as h}from"./index-99a56692.js";import{V}from"./visibility-sensor-55e75ed1.js";const y=c.memo(function(a){let{name:u,id:e,SVs:t,children:s,actions:i,callAction:r}=d(a),o=l=>{i.recordVisibilityChange&&r({action:i.recordVisibilityChange,args:{isVisible:l}})};return f.useEffect(()=>()=>{i.recordVisibilityChange&&r({action:i.recordVisibilityChange,args:{isVisible:!1}})},[]),t.hidden?null:n(V,{partialVisibility:!0,onChange:o,children:h("div",{id:e,children:[n("a",{name:e}),s]})})});export{y as default}; diff --git a/dist/assets/containerInline-c98df7cf.js b/dist/assets/containerInline-c98df7cf.js deleted file mode 100644 index 9b786002e1..0000000000 --- a/dist/assets/containerInline-c98df7cf.js +++ /dev/null @@ -1 +0,0 @@ -import{av as s,bn as t,a as i,j as o}from"./index-99a56692.js";const m=s.memo(function(e){let{name:d,id:n,SVs:a,children:r}=t(e);return a.hidden?null:i("span",{id:n,children:[o("a",{name:n}),r]})});export{m as default}; diff --git a/dist/assets/containerInline-df5cd01f.js b/dist/assets/containerInline-df5cd01f.js new file mode 100644 index 0000000000..b5748aec88 --- /dev/null +++ b/dist/assets/containerInline-df5cd01f.js @@ -0,0 +1 @@ +import{av as s,bp as t,a as i,j as o}from"./index-7074710c.js";const m=s.memo(function(n){let{name:d,id:e,SVs:a,children:r}=t(n);return a.hidden?null:i("span",{id:e,children:[o("a",{name:e}),r]})});export{m as default}; diff --git a/dist/assets/curve-c366682a.js b/dist/assets/curve-a288db30.js similarity index 98% rename from dist/assets/curve-c366682a.js rename to dist/assets/curve-a288db30.js index 4bf3766732..734798c5b1 100644 --- a/dist/assets/curve-c366682a.js +++ b/dist/assets/curve-a288db30.js @@ -1 +1 @@ -import{av as ye,bn as xe,r as d,l as we,bs as Re,bt as P,j as R,F as B}from"./index-99a56692.js";import{BoardContext as Te,LINE_LAYER_OFFSET as ge,VERTEX_LAYER_OFFSET as N,CONTROL_POINT_LAYER_OFFSET as me}from"./graph-57e1e537.js";import"./css-14ccef8c.js";import"./visibility-sensor-55e75ed1.js";const De=ye.memo(function A(Q){let{name:T,id:F,SVs:e,actions:x,sourceOfUpdate:V,callAction:w}=xe(Q);A.ignoreActionsWithoutCore=!0;const l=d.useContext(Te);let o=d.useRef(null),p=d.useRef(null),i=d.useRef(null),H=d.useRef(null),O=d.useRef(null),k=d.useRef(null),Y=d.useRef(!1),oe=d.useRef(null),S=d.useRef(null),I=d.useRef(null),_=d.useRef(null),q=d.useRef(null),D=d.useRef(null),C=d.useRef(null),a=d.useRef([]),M=d.useRef(null),j=d.useRef(null),K=d.useRef(null),J=d.useRef(null),Z=d.useRef([]),U=d.useRef([]);K.current=e.vectorControlDirections;let le=d.useRef(null);le.current=e.numericalThroughPoints;let ie=d.useRef(null);ie.current=e.numericalControlPoints;const ue=we(Re);d.useEffect(()=>()=>{o.current&&$()},[]);function ce(){if(e.curveType==="bezier"&&e.numericalThroughPoints.length<2)return null;let r=ue==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;r=r.toLowerCase();var t={name:e.labelForGraph,visible:!e.hidden,withLabel:e.showLabel&&e.labelForGraph!=="",fixed:!0,layer:10*e.layer+ge,strokeColor:r,strokeOpacity:e.selectedStyle.lineOpacity,strokeWidth:e.selectedStyle.lineWidth,dash:ve(e.selectedStyle.lineStyle,e.dashed),highlight:!1,lineCap:"butt"};if(e.showLabel&&e.labelForGraph!==""){let u,c,h;e.labelPosition==="upperright"?(h="urt",c=[-5,-10],u="right"):e.labelPosition==="upperleft"?(h="ulft",c=[5,-10],u="left"):e.labelPosition==="lowerright"?(h="lrt",c=[-5,10],u="right"):e.labelPosition==="lowerleft"?(h="llft",c=[5,10],u="left"):e.labelPosition==="top"?(h="top",c=[0,-10],u="left"):e.labelPosition==="bottom"?(h="bot",c=[0,10],u="left"):e.labelPosition==="left"?(h="lft",c=[10,0],u="left"):(h="rt",c=[-10,0],u="right"),t.label={offset:c,position:h,anchorx:u,highlight:!1},e.labelHasLatex&&(t.label.useMathJax=!0),e.applyStyleToLabel?t.label.strokeColor=r:t.label.strokeColor="var(canvastext)"}else t.label={highlight:!1},e.labelHasLatex&&(t.label.useMathJax=!0);let g;if(e.curveType==="parameterization"){let u=P(e.fDefinitions[0]),c=P(e.fDefinitions[1]);g=l.create("curve",[u,c,e.parMin,e.parMax],t)}else if(e.curveType==="bezier"){let u=P(e.fDefinitions[0]),c=P(e.fDefinitions[1]);g=l.create("curve",[u,c,e.parMin,e.parMax],t)}else{let u=P(e.fDefinitions[0]);if(e.flipFunction){let c=e.graphYmin,h=e.graphYmax,m=Math.max(c-(h-c)*.1,e.parMin),L=Math.min(h+(h-c)*.1,e.parMax);g=l.create("curve",[u,re=>re,m,L],t)}else{let c=e.graphXmin,h=e.graphXmax,m=Math.max(c-(h-c)*.1,e.parMin),L=Math.min(h+(h-c)*.1,e.parMax);g=l.create("functiongraph",[u,m,L],t)}oe.current=e.flipFunction}return H.current=e.curveType,O.current=null,k.current=null,g.on("up",function(u){!Y.current&&O.current===null&&k.current===null&&(e.switchable&&!e.fixed&&w({action:x.switchCurve}),w({action:x.curveClicked,args:{name:T}}))}),e.curveType==="bezier"?(l.on("up",he),g.on("down",()=>{y(),w({action:x.mouseDownOnCurve,args:{name:T}})}),S.current={visible:!1,withLabel:!1,fixed:!0,strokeColor:"var(--mainGray)",highlightStrokeColor:"var(--mainGray)",layer:10*e.layer+N,strokeWidth:1,highlightStrokeWidth:1},I.current={visible:!e.hidden,withLabel:!1,fixed:!1,fillColor:"none",strokeColor:"none",highlightFillColor:"var(--mainGray)",highlightStrokeColor:"var(--mainGray)",strokeWidth:1,highlightStrokeWidth:1,layer:10*e.layer+N,size:3},_.current={fillcolor:"var(--mainGray)",strokecolor:"var(--mainGray)"},q.current={fillcolor:"none",strokecolor:"none"},D.current={visible:!1,withLabel:!1,fixed:!1,fillColor:"var(--mainGray)",strokeColor:"var(--mainGray)",highlightFillColor:"var(--mainGray)",highlightStrokeColor:"var(--mainGray)",strokeWidth:1,highlightStrokeWidth:1,layer:10*e.layer+me,size:2},e.draggable&&!e.fixed&&(ae(),e.bezierControlsAlwaysVisible&&(ee(),Ce()),l.updateRenderer(),C.current=e.numericalThroughPoints.length,J.current=[...e.vectorControlDirections])):g.on("down",function(u){Y.current=!1,w({action:x.mouseDownOnCurve,args:{name:T}})}),g}function $(){l.off("up",he),o.current.off("down"),o.current.off("up"),l.removeObject(o.current),o.current=null,se()}function ae(){p.current=[],i.current=[],a.current=[];for(let r=0;rfe(r)),t.on("down",m=>pe(r)),t.on("up",m=>de(r)),g.on("drag",m=>W(r,0)),u.on("drag",m=>W(r,1)),g.on("down",y),u.on("down",y),c.on("down",y),c.on("down",y),g.on("up",m=>z(r,0)),u.on("up",m=>z(r,1))}M.current=[]}function se(){a.current.length>0&&(a.current.forEach(r=>r.forEach(t=>{t&&(t.off("down"),l.removeObject(t))})),a.current=[],i.current.forEach(r=>r.forEach(t=>{t&&(t.off("drag"),t.off("down"),t.off("up"),l.removeObject(t))})),i.current=[],p.current.forEach(r=>{r.off("drag"),r.off("down"),r.off("up"),l.removeObject(r)}),p.current=[])}function fe(r){k.current=r,Z.current[r]=[p.current[r].X(),p.current[r].Y()],w({action:x.moveThroughPoint,args:{throughPoint:Z.current[r],throughPointInd:r,transient:!0,skippable:!0}}),p.current[r].coords.setCoordinates(JXG.COORDS_BY_USER,le.current[r]),l.updateInfobox(p.current[r])}function de(r){k.current===r&&w({action:x.moveThroughPoint,args:{throughPoint:Z.current[r],throughPointInd:r}})}function W(r,t){O.current=r+"_"+t,U.current[r]||(U.current[r]={}),U.current[r][t]=[i.current[r][t].X()-p.current[r].X(),i.current[r][t].Y()-p.current[r].Y()],w({action:x.moveControlVector,args:{controlVector:U.current[r][t],controlVectorInds:[r,t],transient:!0,skippable:!0}}),i.current[r][t].coords.setCoordinates(JXG.COORDS_BY_USER,[...ie.current[r][t]]),l.updateInfobox(i.current[r][t])}function z(r,t){O.current===r+"_"+t&&w({action:x.moveControlVector,args:{controlVector:U.current[r][t],controlVectorInds:[r,t]}})}function ee(){for(let r of p.current){for(let t in _.current)r.visProp[t]=_.current[t];r.needsUpdate=!0,r.update()}}function be(){for(let r of p.current){for(let t in q.current)r.visProp[t]=q.current[t];r.needsUpdate=!0,r.update()}}function Pe(){for(let r of i.current)for(let t of r)t&&(t.visProp.visible=!1,t.needsUpdate=!0,t.update());for(let r of a.current)for(let t of r)t&&(t.visProp.visible=!1,t.needsUpdate=!0,t.update());M.current=[]}function Ce(){for(let r in i.current)E(r)}function he(){!e.draggable||e.fixed||(j.current!==!0&&!e.bezierControlsAlwaysVisible&&(be(),Pe(),l.updateRenderer()),j.current=!1)}function pe(r,t){!e.draggable||e.fixed||(k.current=null,O.current=null,j.current=!0,ee(),E(r),l.updateRenderer())}function E(r){if(!e.hiddenControls[r]){if(i.current[r][0]){let t=(r>0||e.extrapolateBackward)&&["symmetric","both","previous"].includes(K.current[r]);i.current[r][0].visProp.visible=t,i.current[r][0].visPropCalc.visible=t,i.current[r][0].needsUpdate=!0,i.current[r][0].update(),a.current[r][0].visProp.visible=t,a.current[r][0].visPropCalc.visible=t,a.current[r][0].needsUpdate=!0,a.current[r][0].update()}if(i.current[r][1]){let t=(re.parMin,o.current.maxX=()=>e.parMax}else if(e.curveType==="bezier")o.current.X=P(e.fDefinitions[0]),o.current.Y=P(e.fDefinitions[1]),o.current.minX=()=>e.parMin,o.current.maxX=()=>e.parMax;else{let n=P(e.fDefinitions[0]);if(e.flipFunction){o.current.X=n;let s=e.graphYmin,f=e.graphYmax,v=Math.max(s-(f-s)*.1,e.parMin),b=Math.min(f+(f-s)*.1,e.parMax);o.current.minX=()=>v,o.current.maxX=()=>b}else{o.current.Y=n;let s=e.graphXmin,f=e.graphXmax,v=Math.max(s-(f-s)*.1,e.parMin),b=Math.min(f+(f-s)*.1,e.parMax);o.current.minX=()=>v,o.current.maxX=()=>b}}if(o.current.needsUpdate=!0,o.current.updateCurve(),o.current.hasLabel&&(o.current.label.needsUpdate=!0,o.current.label.visPropCalc.visible=e.showLabel&&e.labelForGraph!=="",e.applyStyleToLabel?o.current.label.visProp.strokecolor=m:o.current.label.visProp.strokecolor="var(canvastext)",o.current.label.update()),e.curveType!=="bezier")return l.updateRenderer(),R(B,{children:R("a",{name:F})});if(!e.draggable||e.fixed)return a.current.length>0&&se(),l.updateRenderer(),R(B,{children:R("a",{name:F})});if(a.current.length===0)return ae(),C.current=e.numericalThroughPoints.length,J.current=[...e.vectorControlDirections],l.updateRenderer(),R(B,{children:R("a",{name:F})});if(e.numericalThroughPoints.length>C.current){let n=C.current-1,s=Object.assign({},I.current);p.current[n].visProp.fillcolor===_.current.fillcolor&&Object.assign(s,_.current);for(let f=C.current;ffe(f)),v.on("down",G=>pe(f)),v.on("up",G=>de(f)),b.on("drag",G=>W(f,0)),b.on("down",y),b.on("up",G=>z(f,0)),X.on("drag",G=>W(f,1)),X.on("down",y),X.on("up",G=>z(f,1)),te.on("down",y),ne.on("down",y)}M.current[n]&&E(n)}else if(e.numericalThroughPoints.length=e.numericalThroughPoints.length;s--){a.current[s][0].off("down"),a.current[s][1].off("down"),l.removeObject(a.current[s][0]),l.removeObject(a.current[s][1]),a.current.pop(),i.current[s][0].off("drag"),i.current[s][0].off("down"),i.current[s][0].off("up"),i.current[s][1].off("drag"),i.current[s][1].off("down"),i.current[s][1].off("up"),l.removeObject(i.current[s][0]),l.removeObject(i.current[s][1]),i.current.pop();let f=p.current.pop();f.off("drag"),f.off("down"),f.off("up"),l.removeObject(f)}let n=e.numericalThroughPoints.length-1;M.current[n]&&E(n)}let re=Math.min(e.numericalThroughPoints.length,C.current);for(let n=0;n()=>{o.current&&$()},[]);function ce(){if(e.curveType==="bezier"&&e.numericalThroughPoints.length<2)return null;let r=ue==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;r=r.toLowerCase();var t={name:e.labelForGraph,visible:!e.hidden,withLabel:e.showLabel&&e.labelForGraph!=="",fixed:!0,layer:10*e.layer+ge,strokeColor:r,strokeOpacity:e.selectedStyle.lineOpacity,strokeWidth:e.selectedStyle.lineWidth,dash:ve(e.selectedStyle.lineStyle,e.dashed),highlight:!1,lineCap:"butt"};if(e.showLabel&&e.labelForGraph!==""){let u,c,h;e.labelPosition==="upperright"?(h="urt",c=[-5,-10],u="right"):e.labelPosition==="upperleft"?(h="ulft",c=[5,-10],u="left"):e.labelPosition==="lowerright"?(h="lrt",c=[-5,10],u="right"):e.labelPosition==="lowerleft"?(h="llft",c=[5,10],u="left"):e.labelPosition==="top"?(h="top",c=[0,-10],u="left"):e.labelPosition==="bottom"?(h="bot",c=[0,10],u="left"):e.labelPosition==="left"?(h="lft",c=[10,0],u="left"):(h="rt",c=[-10,0],u="right"),t.label={offset:c,position:h,anchorx:u,highlight:!1},e.labelHasLatex&&(t.label.useMathJax=!0),e.applyStyleToLabel?t.label.strokeColor=r:t.label.strokeColor="var(canvastext)"}else t.label={highlight:!1},e.labelHasLatex&&(t.label.useMathJax=!0);let g;if(e.curveType==="parameterization"){let u=P(e.fDefinitions[0]),c=P(e.fDefinitions[1]);g=l.create("curve",[u,c,e.parMin,e.parMax],t)}else if(e.curveType==="bezier"){let u=P(e.fDefinitions[0]),c=P(e.fDefinitions[1]);g=l.create("curve",[u,c,e.parMin,e.parMax],t)}else{let u=P(e.fDefinitions[0]);if(e.flipFunction){let c=e.graphYmin,h=e.graphYmax,m=Math.max(c-(h-c)*.1,e.parMin),L=Math.min(h+(h-c)*.1,e.parMax);g=l.create("curve",[u,re=>re,m,L],t)}else{let c=e.graphXmin,h=e.graphXmax,m=Math.max(c-(h-c)*.1,e.parMin),L=Math.min(h+(h-c)*.1,e.parMax);g=l.create("functiongraph",[u,m,L],t)}oe.current=e.flipFunction}return H.current=e.curveType,O.current=null,k.current=null,g.on("up",function(u){!Y.current&&O.current===null&&k.current===null&&(e.switchable&&!e.fixed&&w({action:x.switchCurve}),w({action:x.curveClicked,args:{name:T}}))}),e.curveType==="bezier"?(l.on("up",he),g.on("down",()=>{y(),w({action:x.mouseDownOnCurve,args:{name:T}})}),S.current={visible:!1,withLabel:!1,fixed:!0,strokeColor:"var(--mainGray)",highlightStrokeColor:"var(--mainGray)",layer:10*e.layer+N,strokeWidth:1,highlightStrokeWidth:1},I.current={visible:!e.hidden,withLabel:!1,fixed:!1,fillColor:"none",strokeColor:"none",highlightFillColor:"var(--mainGray)",highlightStrokeColor:"var(--mainGray)",strokeWidth:1,highlightStrokeWidth:1,layer:10*e.layer+N,size:3},_.current={fillcolor:"var(--mainGray)",strokecolor:"var(--mainGray)"},q.current={fillcolor:"none",strokecolor:"none"},D.current={visible:!1,withLabel:!1,fixed:!1,fillColor:"var(--mainGray)",strokeColor:"var(--mainGray)",highlightFillColor:"var(--mainGray)",highlightStrokeColor:"var(--mainGray)",strokeWidth:1,highlightStrokeWidth:1,layer:10*e.layer+me,size:2},e.draggable&&!e.fixed&&(ae(),e.bezierControlsAlwaysVisible&&(ee(),Ce()),l.updateRenderer(),C.current=e.numericalThroughPoints.length,J.current=[...e.vectorControlDirections])):g.on("down",function(u){Y.current=!1,w({action:x.mouseDownOnCurve,args:{name:T}})}),g}function $(){l.off("up",he),o.current.off("down"),o.current.off("up"),l.removeObject(o.current),o.current=null,se()}function ae(){p.current=[],i.current=[],a.current=[];for(let r=0;rfe(r)),t.on("down",m=>pe(r)),t.on("up",m=>de(r)),g.on("drag",m=>W(r,0)),u.on("drag",m=>W(r,1)),g.on("down",y),u.on("down",y),c.on("down",y),c.on("down",y),g.on("up",m=>z(r,0)),u.on("up",m=>z(r,1))}M.current=[]}function se(){a.current.length>0&&(a.current.forEach(r=>r.forEach(t=>{t&&(t.off("down"),l.removeObject(t))})),a.current=[],i.current.forEach(r=>r.forEach(t=>{t&&(t.off("drag"),t.off("down"),t.off("up"),l.removeObject(t))})),i.current=[],p.current.forEach(r=>{r.off("drag"),r.off("down"),r.off("up"),l.removeObject(r)}),p.current=[])}function fe(r){k.current=r,Z.current[r]=[p.current[r].X(),p.current[r].Y()],w({action:x.moveThroughPoint,args:{throughPoint:Z.current[r],throughPointInd:r,transient:!0,skippable:!0}}),p.current[r].coords.setCoordinates(JXG.COORDS_BY_USER,le.current[r]),l.updateInfobox(p.current[r])}function de(r){k.current===r&&w({action:x.moveThroughPoint,args:{throughPoint:Z.current[r],throughPointInd:r}})}function W(r,t){O.current=r+"_"+t,U.current[r]||(U.current[r]={}),U.current[r][t]=[i.current[r][t].X()-p.current[r].X(),i.current[r][t].Y()-p.current[r].Y()],w({action:x.moveControlVector,args:{controlVector:U.current[r][t],controlVectorInds:[r,t],transient:!0,skippable:!0}}),i.current[r][t].coords.setCoordinates(JXG.COORDS_BY_USER,[...ie.current[r][t]]),l.updateInfobox(i.current[r][t])}function z(r,t){O.current===r+"_"+t&&w({action:x.moveControlVector,args:{controlVector:U.current[r][t],controlVectorInds:[r,t]}})}function ee(){for(let r of p.current){for(let t in _.current)r.visProp[t]=_.current[t];r.needsUpdate=!0,r.update()}}function be(){for(let r of p.current){for(let t in q.current)r.visProp[t]=q.current[t];r.needsUpdate=!0,r.update()}}function Pe(){for(let r of i.current)for(let t of r)t&&(t.visProp.visible=!1,t.needsUpdate=!0,t.update());for(let r of a.current)for(let t of r)t&&(t.visProp.visible=!1,t.needsUpdate=!0,t.update());M.current=[]}function Ce(){for(let r in i.current)E(r)}function he(){!e.draggable||e.fixed||(j.current!==!0&&!e.bezierControlsAlwaysVisible&&(be(),Pe(),l.updateRenderer()),j.current=!1)}function pe(r,t){!e.draggable||e.fixed||(k.current=null,O.current=null,j.current=!0,ee(),E(r),l.updateRenderer())}function E(r){if(!e.hiddenControls[r]){if(i.current[r][0]){let t=(r>0||e.extrapolateBackward)&&["symmetric","both","previous"].includes(K.current[r]);i.current[r][0].visProp.visible=t,i.current[r][0].visPropCalc.visible=t,i.current[r][0].needsUpdate=!0,i.current[r][0].update(),a.current[r][0].visProp.visible=t,a.current[r][0].visPropCalc.visible=t,a.current[r][0].needsUpdate=!0,a.current[r][0].update()}if(i.current[r][1]){let t=(re.parMin,o.current.maxX=()=>e.parMax}else if(e.curveType==="bezier")o.current.X=P(e.fDefinitions[0]),o.current.Y=P(e.fDefinitions[1]),o.current.minX=()=>e.parMin,o.current.maxX=()=>e.parMax;else{let n=P(e.fDefinitions[0]);if(e.flipFunction){o.current.X=n;let s=e.graphYmin,f=e.graphYmax,v=Math.max(s-(f-s)*.1,e.parMin),b=Math.min(f+(f-s)*.1,e.parMax);o.current.minX=()=>v,o.current.maxX=()=>b}else{o.current.Y=n;let s=e.graphXmin,f=e.graphXmax,v=Math.max(s-(f-s)*.1,e.parMin),b=Math.min(f+(f-s)*.1,e.parMax);o.current.minX=()=>v,o.current.maxX=()=>b}}if(o.current.needsUpdate=!0,o.current.updateCurve(),o.current.hasLabel&&(o.current.label.needsUpdate=!0,o.current.label.visPropCalc.visible=e.showLabel&&e.labelForGraph!=="",e.applyStyleToLabel?o.current.label.visProp.strokecolor=m:o.current.label.visProp.strokecolor="var(canvastext)",o.current.label.update()),e.curveType!=="bezier")return l.updateRenderer(),R(B,{children:R("a",{name:F})});if(!e.draggable||e.fixed)return a.current.length>0&&se(),l.updateRenderer(),R(B,{children:R("a",{name:F})});if(a.current.length===0)return ae(),C.current=e.numericalThroughPoints.length,J.current=[...e.vectorControlDirections],l.updateRenderer(),R(B,{children:R("a",{name:F})});if(e.numericalThroughPoints.length>C.current){let n=C.current-1,s=Object.assign({},I.current);p.current[n].visProp.fillcolor===_.current.fillcolor&&Object.assign(s,_.current);for(let f=C.current;ffe(f)),v.on("down",G=>pe(f)),v.on("up",G=>de(f)),b.on("drag",G=>W(f,0)),b.on("down",y),b.on("up",G=>z(f,0)),X.on("drag",G=>W(f,1)),X.on("down",y),X.on("up",G=>z(f,1)),te.on("down",y),ne.on("down",y)}M.current[n]&&E(n)}else if(e.numericalThroughPoints.length=e.numericalThroughPoints.length;s--){a.current[s][0].off("down"),a.current[s][1].off("down"),l.removeObject(a.current[s][0]),l.removeObject(a.current[s][1]),a.current.pop(),i.current[s][0].off("drag"),i.current[s][0].off("down"),i.current[s][0].off("up"),i.current[s][1].off("drag"),i.current[s][1].off("down"),i.current[s][1].off("up"),l.removeObject(i.current[s][0]),l.removeObject(i.current[s][1]),i.current.pop();let f=p.current.pop();f.off("drag"),f.off("down"),f.off("up"),l.removeObject(f)}let n=e.numericalThroughPoints.length-1;M.current[n]&&E(n)}let re=Math.min(e.numericalThroughPoints.length,C.current);for(let n=0;n{c({action:n.recordVisibilityChange,args:{isVisible:l}})};if(g.useEffect(()=>()=>{c({action:n.recordVisibilityChange,args:{isVisible:!1}})},[]),g.useEffect(()=>{if(e.encodedGeogebraContent){let l=e,f=o(t),p=s(e.width),m=s(e.height);window.MathJax.Hub.Register.StartupHook("End",function(){let w={id:f,width:p,height:m,showResetIcon:!1,enableLabelDrags:!1,useBrowserForJS:!0,showMenubar:!1,errorDialogsActive:!0,showToolbar:!1,showAlgebraicInput:!1,enableShiftDragZoom:!0,enableRightClick:!0,showToolBarHelp:!1,ggbBase64:l.encodedGeogebraContent.trim(),language:"en",country:"US",isPreloader:!1,screenshotGenerator:!1,preventFocus:!1,fixApplet:!1,prerelease:!1,playButtonAutoDecide:!0,playButton:!1,canary:!1,allowUpscale:!1},h=new window.GGBApplet(w,!0);h.setHTML5Codebase("/geogebra/HTML5/5.0/web/","true"),h.inject("container_"+f,"preferhtml5")})}},[]),e.hidden)return null;let i=s(e.width),r=s(e.height);return e.geogebra?a(b,{partialVisibility:!0,onChange:d,children:S("div",{className:"geogebra",id:t,children:[a("a",{name:t}),a("iframe",{scrolling:"no",title:"",src:`https://www.geogebra.org/material/iframe/id/${e.geogebra}/width/${i}/height/${r}/border/888888/sfsb/true/smb/false/stb/false/stbh/false/ai/false/asb/false/sri/false/rc/false/ld/false/sdz/false/ctl/false`,width:i,height:r,style:{border:"0px"},children:" "})]})}):e.encodedGeogebraContent?a(b,{partialVisibility:!0,onChange:d,children:a("div",{className:"javascriptapplet",id:o(t),children:a("div",{className:"geogebrawebapplet",id:"container_"+o(t),style:{minWidth:i,minHeight:r}})})}):(console.warn("Nothing specified to embed"),null)});export{D as default}; +import{av as y,bp as C,r as g,ad as o,j as a,a as S}from"./index-7074710c.js";import{s}from"./css-14ccef8c.js";import{V as b}from"./visibility-sensor-7d414852.js";const D=y.memo(function(u){let{name:v,id:t,SVs:e,actions:n,callAction:c}=C(u),d=l=>{c({action:n.recordVisibilityChange,args:{isVisible:l}})};if(g.useEffect(()=>()=>{c({action:n.recordVisibilityChange,args:{isVisible:!1}})},[]),g.useEffect(()=>{if(e.encodedGeogebraContent){let l=e,f=o(t),p=s(e.width),m=s(e.height);window.MathJax.Hub.Register.StartupHook("End",function(){let w={id:f,width:p,height:m,showResetIcon:!1,enableLabelDrags:!1,useBrowserForJS:!0,showMenubar:!1,errorDialogsActive:!0,showToolbar:!1,showAlgebraicInput:!1,enableShiftDragZoom:!0,enableRightClick:!0,showToolBarHelp:!1,ggbBase64:l.encodedGeogebraContent.trim(),language:"en",country:"US",isPreloader:!1,screenshotGenerator:!1,preventFocus:!1,fixApplet:!1,prerelease:!1,playButtonAutoDecide:!0,playButton:!1,canary:!1,allowUpscale:!1},h=new window.GGBApplet(w,!0);h.setHTML5Codebase("/geogebra/HTML5/5.0/web/","true"),h.inject("container_"+f,"preferhtml5")})}},[]),e.hidden)return null;let i=s(e.width),r=s(e.height);return e.geogebra?a(b,{partialVisibility:!0,onChange:d,children:S("div",{className:"geogebra",id:t,children:[a("a",{name:t}),a("iframe",{scrolling:"no",title:"",src:`https://www.geogebra.org/material/iframe/id/${e.geogebra}/width/${i}/height/${r}/border/888888/sfsb/true/smb/false/stb/false/stbh/false/ai/false/asb/false/sri/false/rc/false/ld/false/sdz/false/ctl/false`,width:i,height:r,style:{border:"0px"},children:" "})]})}):e.encodedGeogebraContent?a(b,{partialVisibility:!0,onChange:d,children:a("div",{className:"javascriptapplet",id:o(t),children:a("div",{className:"geogebrawebapplet",id:"container_"+o(t),style:{minWidth:i,minHeight:r}})})}):(console.warn("Nothing specified to embed"),null)});export{D as default}; diff --git a/dist/assets/feedback-0d6d8ff8.js b/dist/assets/feedback-2ba4856e.js similarity index 84% rename from dist/assets/feedback-0d6d8ff8.js rename to dist/assets/feedback-2ba4856e.js index 9cf00f1799..9388d38f17 100644 --- a/dist/assets/feedback-0d6d8ff8.js +++ b/dist/assets/feedback-2ba4856e.js @@ -1,4 +1,4 @@ -import{av as p,bn as x,r as b,j as e,a as i,F as u,s as n,i as f}from"./index-99a56692.js";import{a as m}from"./index-47ca4f11.js";import{V as g}from"./visibility-sensor-55e75ed1.js";const h=n.aside` +import{av as p,bp as x,r as b,j as e,a as i,F as u,s as n,i as f}from"./index-7074710c.js";import{a as m}from"./index-47ca4f11.js";import{V as g}from"./visibility-sensor-7d414852.js";const h=n.aside` background-color: white; margin: 0px 4px 12px 4px; padding: 1em; diff --git a/dist/assets/figure-ef236daa.js b/dist/assets/figure-c70e4517.js similarity index 65% rename from dist/assets/figure-ef236daa.js rename to dist/assets/figure-c70e4517.js index 30b4b3c181..2715dd1253 100644 --- a/dist/assets/figure-ef236daa.js +++ b/dist/assets/figure-c70e4517.js @@ -1 +1 @@ -import{av as V,bn as A,r as u,j as n,a as h}from"./index-99a56692.js";import{V as H}from"./visibility-sensor-55e75ed1.js";import{M as E}from"./index.esm-b3e258be.js";import"./setPrototypeOf-51e8cf87.js";const j=V.memo(function(g){var m;let{name:R,id:r,SVs:a,children:l,actions:c,callAction:d}=A(g),y=e=>{d({action:c.recordVisibilityChange,args:{isVisible:e}})};if(u.useEffect(()=>()=>{d({action:c.recordVisibilityChange,args:{isVisible:!1}})},[]),a.hidden||!l)return null;let f=l,s=null,o=null;if(a.captionChildName){let e;for(let[i,t]of l.entries())if(((m=t==null?void 0:t.props)==null?void 0:m.componentInstructions.componentName)===a.captionChildName){e=i;break}o=l[e],f.splice(e,1)}if(a.suppressFigureNameInCaption)o&&(s=n("div",{children:o}));else{let e=n("strong",{children:a.figureName});o?s=h("div",{children:[e,": ",o]}):s=n("div",{children:e})}const[C,p]=u.useState("center");function v(e){var i=document.createElement(e.nodeName),t;return i.setAttribute("style","margin:0; padding:0; font-family:"+(e.style.fontFamily||"inherit")+"; font-size:"+(e.style.fontSize||"inherit")),i.innerHTML="A",e.parentNode.appendChild(i),t=i.clientHeight,i.parentNode.removeChild(i),t}function b(){var e=document.getElementById(r+"_caption"),i=e.offsetHeight,t=v(document.getElementById(r+"_caption")),x=Math.round(i/t);return x}function N(){b()>=2?p("left"):p("center")}return n(H,{partialVisibility:!0,onChange:y,children:h("figure",{id:r,style:{margin:"12px 0"},children:[n("a",{name:r}),f,n("figcaption",{id:r+"_caption",children:n(E,{onResize:N,children:({measureRef:e})=>n("div",{ref:e,style:{textAlign:C},children:s})})})]})})});export{j as default}; +import{av as V,bp as A,r as u,j as n,a as h}from"./index-7074710c.js";import{V as H}from"./visibility-sensor-7d414852.js";import{M as E}from"./index.esm-5b62de19.js";import"./setPrototypeOf-51e8cf87.js";const j=V.memo(function(g){var m;let{name:R,id:r,SVs:a,children:l,actions:c,callAction:d}=A(g),y=e=>{d({action:c.recordVisibilityChange,args:{isVisible:e}})};if(u.useEffect(()=>()=>{d({action:c.recordVisibilityChange,args:{isVisible:!1}})},[]),a.hidden||!l)return null;let p=l,s=null,o=null;if(a.captionChildName){let e;for(let[i,t]of l.entries())if(((m=t==null?void 0:t.props)==null?void 0:m.componentInstructions.componentName)===a.captionChildName){e=i;break}o=l[e],p.splice(e,1)}if(a.suppressFigureNameInCaption)o&&(s=n("div",{children:o}));else{let e=n("strong",{children:a.figureName});o?s=h("div",{children:[e,": ",o]}):s=n("div",{children:e})}const[C,f]=u.useState("center");function v(e){var i=document.createElement(e.nodeName),t;return i.setAttribute("style","margin:0; padding:0; font-family:"+(e.style.fontFamily||"inherit")+"; font-size:"+(e.style.fontSize||"inherit")),i.innerHTML="A",e.parentNode.appendChild(i),t=i.clientHeight,i.parentNode.removeChild(i),t}function b(){var e=document.getElementById(r+"_caption"),i=e.offsetHeight,t=v(document.getElementById(r+"_caption")),x=Math.round(i/t);return x}function N(){b()>=2?f("left"):f("center")}return n(H,{partialVisibility:!0,onChange:y,children:h("figure",{id:r,style:{margin:"12px 0"},children:[n("a",{name:r}),p,n("figcaption",{id:r+"_caption",children:n(E,{onResize:N,children:({measureRef:e})=>n("div",{ref:e,style:{textAlign:C},children:s})})})]})})});export{j as default}; diff --git a/dist/assets/footnote-093a9cc2.js b/dist/assets/footnote-31adff59.js similarity index 60% rename from dist/assets/footnote-093a9cc2.js rename to dist/assets/footnote-31adff59.js index ddad094265..3aa97bd1b9 100644 --- a/dist/assets/footnote-093a9cc2.js +++ b/dist/assets/footnote-31adff59.js @@ -1 +1 @@ -import{av as u,bn as b,r as h,j as t,a as o,F as p}from"./index-99a56692.js";const y=u.memo(function(a){let{name:g,id:n,SVs:e}=b(a,!1),[r,l]=h.useState(!1);if(e.hidden)return null;const i={padding:"10px",borderRadius:"5px",backgroundColor:"#e2e2e2",display:"static"};let s="";r&&(s=t("div",{style:i,children:e.text}));const d={backgroundColor:"white",border:"none"},c={textDecoration:"none",color:"#1A5A99"};return o(p,{children:[o("span",{id:n,children:[t("a",{name:n}),t("sup",{children:t("button",{style:d,onClick:()=>l(f=>!f),children:o("a",{href:"#",title:e.text,style:c,children:["[",e.footnoteTag,"]"]})})})]}),s]})});export{y as default}; +import{av as u,bp as p,r as b,j as t,a as o,F as h}from"./index-7074710c.js";const y=u.memo(function(a){let{name:g,id:n,SVs:e}=p(a,!1),[r,l]=b.useState(!1);if(e.hidden)return null;const i={padding:"10px",borderRadius:"5px",backgroundColor:"#e2e2e2",display:"static"};let s="";r&&(s=t("div",{style:i,children:e.text}));const d={backgroundColor:"white",border:"none"},c={textDecoration:"none",color:"#1A5A99"};return o(h,{children:[o("span",{id:n,children:[t("a",{name:n}),t("sup",{children:t("button",{style:d,onClick:()=>l(f=>!f),children:o("a",{href:"#",title:e.text,style:c,children:["[",e.footnoteTag,"]"]})})})]}),s]})});export{y as default}; diff --git a/dist/assets/graph-57e1e537.js b/dist/assets/graph-71cec529.js similarity index 98% rename from dist/assets/graph-57e1e537.js rename to dist/assets/graph-71cec529.js index f5faf1e2db..391ac1af0e 100644 --- a/dist/assets/graph-57e1e537.js +++ b/dist/assets/graph-71cec529.js @@ -1 +1 @@ -import{av as I,bn as q,r as f,a as F,F as W,j as m,bo as Y,ad as Q}from"./index-99a56692.js";import{s as E}from"./css-14ccef8c.js";import{V as D}from"./visibility-sensor-55e75ed1.js";function G(b){return b=Q(b,{isIdentifier:!0}),b.slice(0,2)==="\\#"&&(b=b.slice(1)),b}const K=f.createContext(),it=I.memo(function(N){let{name:Z,id:g,SVs:t,children:X,actions:L,callAction:P}=q(N);const[n,J]=f.useState(null),A=f.useRef(null),v=f.useRef(null),o=f.useRef(null),c=f.useRef(null),S=f.useRef(!1),C=f.useRef(!1),y=f.useRef(!1);let O=f.useRef(null),R=f.useRef(null),_=t.showNavigation&&!t.fixAxes,B=d=>{P({action:L.recordVisibilityChange,args:{isVisible:d}})};if(f.useEffect(()=>{if(!t.haveGraphParent)return()=>{P({action:L.recordVisibilityChange,args:{isVisible:!1}})}},[]),f.useEffect(()=>{if(t.haveGraphParent)return;let d=[t.xmin,t.ymax,t.xmax,t.ymin];v.current=d,JXG.Options.layer.numlayers=100,JXG.Options.navbar.highlightFillColor="var(--canvastext)",JXG.Options.navbar.strokeColor="var(--canvastext)";let a=!1;Array.isArray(t.grid)&&(a=!0,JXG.Options.grid.gridX=t.grid[0],JXG.Options.grid.gridY=t.grid[1]);let s=window.JXG.JSXGraph.initBoard(g,{boundingbox:d,axis:!1,showCopyright:!1,showNavigation:!1,zoom:{wheel:!t.fixAxes},pan:{enabled:!t.fixAxes},grid:a});return s.itemsRenderedLowQuality={},s.on("boundingbox",()=>{if(!S.current){let i=s.getBoundingBox(),[e,u,l,r]=i,h=Math.abs(l-e),x=Math.abs(u-r),T=i.map((z,V)=>Math.abs(z-v.current[V]));Math.max(T[0]/h,T[1]/x,T[2]/h,T[3]/x)>1e-12&&(v.current=i,P({action:L.changeAxisLimits,args:{xmin:e,xmax:l,ymin:r,ymax:u}}))}}),J(s),A.current={width:parseFloat(E(t.width)),aspectRatio:t.aspectRatio},t.displayXAxis&&j(s),t.displayYAxis&&M(s),C.current=!0,y.current=_,()=>{s.off("boundingbox")}},[]),f.useEffect(()=>{n&&_&&H()},[n]),t.haveGraphParent)return F(W,{children:[m("a",{name:g}),X]});const p={width:E(t.width),aspectRatio:String(t.aspectRatio),maxWidth:"100%"};let w={};if(t.hidden?p.display="none":t.displayMode==="inline"?w={display:"inline-block",verticalAlign:"middle"}:w={display:"flex",justifyContent:t.horizontalAlign},t.showBorder?p.border="2px solid var(--canvastext)":p.border="none",p.marginBottom="12px",p.marginTop="12px",p.backgroundColor="var(--canvas)",p.color="var(--canvastext)",!n)return m(D,{partialVisibility:!0,onChange:B,children:F("div",{style:w,children:[m("a",{name:g}),m("div",{id:g,className:"jxgbox",style:p})]})});if(C.current)C.current=!1;else{Array.isArray(t.grid)?((JXG.Options.grid.gridX!==t.grid[0]||JXG.Options.grid.gridY!==t.grid[1])&&(JXG.Options.grid.gridX=t.grid[0],JXG.Options.grid.gridY=t.grid[1],n.grids.length>0&&(n.removeObject(n.grids[0]),n.grids=[])),n.grids.length===0&&n.create("grid",[],{gridX:t.grid[0],gridY:t.grid[1]})):n.grids.length>0&&(n.removeObject(n.grids[0]),n.grids=[]),t.grid==="dense"?(o.current&&(o.current.defaultTicks.setAttribute({majorHeight:-1}),o.current.defaultTicks.setAttribute({minorHeight:-1})),c.current&&(c.current.defaultTicks.setAttribute({majorHeight:-1}),c.current.defaultTicks.setAttribute({minorHeight:-1}))):t.grid==="medium"?(o.current&&(o.current.defaultTicks.setAttribute({majorHeight:-1}),o.current.defaultTicks.setAttribute({minorHeight:10})),c.current&&(c.current.defaultTicks.setAttribute({majorHeight:-1}),c.current.defaultTicks.setAttribute({minorHeight:10}))):(o.current&&(o.current.defaultTicks.setAttribute({majorHeight:20}),o.current.defaultTicks.setAttribute({minorHeight:10})),c.current&&(c.current.defaultTicks.setAttribute({majorHeight:20}),c.current.defaultTicks.setAttribute({minorHeight:10})));let d=t.displayXAxis?!o.current:!!o.current,a=t.displayYAxis?!c.current:!!c.current;if(a&&!d&&t.displayXAxis&&(n.removeObject(o.current),o.current=null),d&&!a&&t.displayYAxis&&(n.removeObject(c.current),c.current=null),t.displayXAxis)if(o.current){let e=!!t.xlabel;if(e!==O.current&&(o.current.setAttribute({withlabel:e}),O.current=e),o.current.name=t.xlabel,o.current.defaultTicks.setAttribute({drawLabels:t.displayXAxisTickLabels}),o.current.hasLabel){let u="rt",l=[5,10],r="right";t.xlabelPosition==="left"&&(u="lft",r="left",l=[-5,10]),o.current.label.visProp.position=u,o.current.label.visProp.anchorx=r,o.current.label.visProp.offset=l,o.current.label.needsUpdate=!0,o.current.label.fullUpdate()}}else j(n);else o.current&&(n.removeObject(o.current),o.current=null);if(t.displayYAxis)if(c.current){let e=!!t.ylabel;if(e!==R.current&&(c.current.setAttribute({withlabel:e}),R.current=e),c.current.name=t.ylabel,c.current.defaultTicks.setAttribute({drawLabels:t.displayYAxisTickLabels}),c.current.hasLabel){let u="rt",l=[-10,-5],r="right";t.ylabelPosition==="bottom"&&(u="lft",l[1]=5),t.ylabelAlignment==="right"&&(r="left",l[0]=10),c.current.label.visProp.position=u,c.current.label.visProp.offset=l,c.current.label.visProp.anchorx=r,c.current.label.needsUpdate=!0,c.current.label.fullUpdate()}}else M(n);else c.current&&(n.removeObject(c.current),c.current=null);_?y.current||(H(),y.current=!0):y.current&&(U(),y.current=!1);let s={width:parseFloat(E(t.width)),aspectRatio:t.aspectRatio};(s.width!==A.current.width||s.aspectRatio!==A.current.aspectRatio)&&Number.isFinite(s.width)&&Number.isFinite(s.aspectRatio)&&(A.current=s);let i=[t.xmin,t.ymax,t.xmax,t.ymin];i.some((e,u)=>e!==v.current[u])&&(S.current=!0,n.setBoundingBox(i),S.current=!1,n.fullUpdate(),n.updateQuality===n.BOARD_QUALITY_LOW&&(n.itemsRenderedLowQuality[g]=n),v.current=i)}return m(D,{partialVisibility:!0,onChange:B,children:F("div",{style:w,children:[m("a",{name:g}),m("div",{id:g,className:"jxgbox",style:p}),m(K.Provider,{value:n,children:X})]})});function M(d){let a={highlight:!1,fixed:!0};if(t.ylabel){let s="rt",i=[-10,-5],e="right";t.ylabelPosition==="bottom"&&(s="lft",i[1]=5),t.ylabelAlignment==="right"&&(e="left",i[0]=10),a.name=t.ylabel,a.withLabel=!0,a.label={position:s,offset:i,anchorx:e,strokeColor:"var(--canvastext)",highlight:!1},t.ylabelHasLatex&&(a.label.useMathJax=!0)}if(R.current=!!t.ylabel,a.strokeColor="var(--canvastext)",a.highlight=!1,a.ticks={ticksDistance:2,label:{offset:[12,-2],layer:2,strokeColor:"var(--canvastext)",highlightStrokeColor:"var(--canvastext)",highlightStrokeOpacity:1},strokeColor:"var(--canvastext)",strokeOpacity:.5,precision:4,drawLabels:t.displayYAxisTickLabels},t.yTickScaleFactor!==null){let s=Y.fromAst(t.yTickScaleFactor),i=s.evaluate_to_constant();if(i>0){let e=s.toString();a.ticks.scale=i,a.ticks.scaleSymbol=e}}t.grid==="dense"?(a.ticks.majorHeight=-1,a.ticks.minorHeight=-1):t.grid==="medium"?(a.ticks.majorHeight=-1,a.ticks.minorHeight=10):(a.ticks.majorHeight=20,a.ticks.minorHeight=10),t.displayXAxis||(a.ticks.drawZero=!0),d.suspendUpdate(),c.current=d.create("axis",[[0,0],[0,1]],a),c.current.defaultTicks.ticksFunction=function(){var s,i,e;return i=this.getLowerAndUpperBounds(this.getZeroCoordinates(),"ticksdistance"),e=i.upper-i.lower,s=Math.pow(10,Math.floor(Math.log(.2*e)/Math.LN10)),e<=6*s&&(s*=.5),s},c.current.defaultTicks.generateEquidistantTicks=function(s,i){var e,u=1e-6,l,r=this.equidistant?this.ticksFunction(1):this.ticksDelta,h=4;if(this.visProp.minorticks=4,l=this.getXandYdeltas(),r*=this.visProp.scale,this.minTicksDistance>1e-6){r=this.adjustTickDistance(r,s,l);let x=10**Math.floor(Math.log10(r))*this.visProp.scale;Math.abs(r/x-2)<1e-14&&(h=3,this.visProp.minorticks=3),r/=h+1}if(this.ticksDelta=r,!(r<1e-6)){for(e=0,this.visProp.drawzero||(e=r);e<=i.upper+u&&(e>=i.lower-u&&this.processTickPosition(s,e,r,l),e+=r,!(i.upper-e>r*1e4)););for(e=-r;e>=i.lower-u&&(e<=i.upper+u&&this.processTickPosition(s,e,r,l),e-=r,!(e-i.lower>r*1e4)););}},d.unsuspendUpdate()}function j(d){let a={highlight:!1,fixed:!0};if(t.xlabel){let s="rt",i=[5,10],e="right";t.xlabelPosition==="left"&&(s="lft",e="left",i=[-5,10]),a.name=t.xlabel,a.withLabel=!0,a.label={position:s,offset:i,anchorx:e,strokeColor:"var(--canvastext)",highlight:!1},t.xlabelHasLatex&&(a.label.useMathJax=!0)}if(O.current=!!t.xlabel,a.ticks={ticksDistance:2,label:{offset:[-5,-15],layer:2,strokeColor:"var(--canvastext)",highlightStrokeColor:"var(--canvastext)",highlightStrokeOpacity:1},strokeColor:"var(--canvastext)",strokeOpacity:.5,precision:4,drawLabels:t.displayXAxisTickLabels},t.xTickScaleFactor!==null){let s=Y.fromAst(t.xTickScaleFactor),i=s.evaluate_to_constant();if(i>0){let e=s.toString();a.ticks.scale=i,a.ticks.scaleSymbol=e}}a.strokeColor="var(--canvastext)",a.highlight=!1,t.grid==="dense"?(a.ticks.majorHeight=-1,a.ticks.minorHeight=-1):t.grid==="medium"?(a.ticks.majorHeight=-1,a.ticks.minorHeight=10):(a.ticks.majorHeight=20,a.ticks.minorHeight=10),t.displayYAxis||(a.ticks.drawZero=!0),d.suspendUpdate(),o.current=d.create("axis",[[0,0],[1,0]],a),o.current.defaultTicks.ticksFunction=function(){var s,i,e;return i=this.getLowerAndUpperBounds(this.getZeroCoordinates(),"ticksdistance"),e=i.upper-i.lower,s=Math.pow(10,Math.floor(Math.log(.2*e)/Math.LN10)),e<=6*s&&(s*=.5),s},o.current.defaultTicks.generateEquidistantTicks=function(s,i){this.minTicksDistance=2*Math.max(2.5,Math.log10(Math.abs(i.lower)),Math.log10(Math.abs(i.upper)));var e,u=1e-6,l,r=this.equidistant?this.ticksFunction(1):this.ticksDelta,h=4;if(this.visProp.minorticks=4,l=this.getXandYdeltas(),r*=this.visProp.scale,this.minTicksDistance>1e-6){r=this.adjustTickDistance(r,s,l);let x=10**Math.floor(Math.log10(r))*this.visProp.scale;Math.abs(r/x-2)<1e-14&&(h=3,this.visProp.minorticks=3),r/=h+1}if(this.ticksDelta=r,!(r<1e-6)){for(e=0,this.visProp.drawzero||(e=r);e<=i.upper+u&&(e>=i.lower-u&&this.processTickPosition(s,e,r,l),e+=r,!(i.upper-e>r*1e4)););for(e=-r;e>=i.lower-u&&(e<=i.upper+u&&this.processTickPosition(s,e,r,l),e-=r,!(e-i.lower>r*1e4)););}},d.unsuspendUpdate()}function H(){let d=document.querySelector("#"+G(g)+"_navigationbar"),a=function(e,u,l){var r=function(){return l.apply(n,arguments)};n["x_internal"+u]=n["x_internal"+u]||[],n["x_internal"+u].push(r),e.addEventListener(u,r,!1)},s=function(e){e||(e=window.event),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},i=function(e,u){var l;l=document.createElement("span"),d.appendChild(l);let r=document.createElement("span");r.setAttribute("style","color: var(--canvastext); opacity: 0.7");let h=document.createTextNode(e);l.appendChild(r),r.appendChild(h),l.style.paddingLeft="7px",l.style.paddingRight="7px",l.classList!==void 0&&l.classList.add("JXG_navigation_button"),a(l,"click",function(x){return u.bind(n)(),!1}),a(l,"mouseup",s),a(l,"mousedown",s),a(l,"touchend",s),a(l,"touchstart",s)};n.attr.showzoom&&(i("–",n.zoomOut),i("o",n.zoom100),i("+",n.zoomIn)),i("←",n.clickLeftArrow),i("↓",n.clickUpArrow),i("↑",n.clickDownArrow),i("→",n.clickRightArrow)}function U(){for(let d=7;d>=1;d--)document.querySelector("#"+G(g)+"_navigationbar > :first-child").remove();n.internalclick=[],n.internalmousedown=[],n.internalmouseup=[],n.internaltouchend=[],n.internaltouchstart=[]}});let k=0;const rt=k++,at=k++,st=k++,nt=k++,lt=k++,ot=k++,ct=k++;export{rt as BASE_LAYER_OFFSET,K as BoardContext,lt as CONTROL_POINT_LAYER_OFFSET,at as IMAGE_LAYER_OFFSET,st as LINE_LAYER_OFFSET,ot as POINT_LAYER_OFFSET,ct as TEXT_LAYER_OFFSET,nt as VERTEX_LAYER_OFFSET,it as default}; +import{av as I,bp as q,r as f,a as F,F as W,j as m,bq as Y,ad as Q}from"./index-7074710c.js";import{s as E}from"./css-14ccef8c.js";import{V as D}from"./visibility-sensor-7d414852.js";function G(b){return b=Q(b,{isIdentifier:!0}),b.slice(0,2)==="\\#"&&(b=b.slice(1)),b}const K=f.createContext(),it=I.memo(function(N){let{name:Z,id:g,SVs:t,children:X,actions:L,callAction:P}=q(N);const[n,J]=f.useState(null),A=f.useRef(null),v=f.useRef(null),o=f.useRef(null),c=f.useRef(null),S=f.useRef(!1),C=f.useRef(!1),y=f.useRef(!1);let O=f.useRef(null),R=f.useRef(null),_=t.showNavigation&&!t.fixAxes,B=d=>{P({action:L.recordVisibilityChange,args:{isVisible:d}})};if(f.useEffect(()=>{if(!t.haveGraphParent)return()=>{P({action:L.recordVisibilityChange,args:{isVisible:!1}})}},[]),f.useEffect(()=>{if(t.haveGraphParent)return;let d=[t.xmin,t.ymax,t.xmax,t.ymin];v.current=d,JXG.Options.layer.numlayers=100,JXG.Options.navbar.highlightFillColor="var(--canvastext)",JXG.Options.navbar.strokeColor="var(--canvastext)";let a=!1;Array.isArray(t.grid)&&(a=!0,JXG.Options.grid.gridX=t.grid[0],JXG.Options.grid.gridY=t.grid[1]);let s=window.JXG.JSXGraph.initBoard(g,{boundingbox:d,axis:!1,showCopyright:!1,showNavigation:!1,zoom:{wheel:!t.fixAxes},pan:{enabled:!t.fixAxes},grid:a});return s.itemsRenderedLowQuality={},s.on("boundingbox",()=>{if(!S.current){let i=s.getBoundingBox(),[e,u,l,r]=i,h=Math.abs(l-e),x=Math.abs(u-r),T=i.map((z,V)=>Math.abs(z-v.current[V]));Math.max(T[0]/h,T[1]/x,T[2]/h,T[3]/x)>1e-12&&(v.current=i,P({action:L.changeAxisLimits,args:{xmin:e,xmax:l,ymin:r,ymax:u}}))}}),J(s),A.current={width:parseFloat(E(t.width)),aspectRatio:t.aspectRatio},t.displayXAxis&&j(s),t.displayYAxis&&M(s),C.current=!0,y.current=_,()=>{s.off("boundingbox")}},[]),f.useEffect(()=>{n&&_&&H()},[n]),t.haveGraphParent)return F(W,{children:[m("a",{name:g}),X]});const p={width:E(t.width),aspectRatio:String(t.aspectRatio),maxWidth:"100%"};let w={};if(t.hidden?p.display="none":t.displayMode==="inline"?w={display:"inline-block",verticalAlign:"middle"}:w={display:"flex",justifyContent:t.horizontalAlign},t.showBorder?p.border="2px solid var(--canvastext)":p.border="none",p.marginBottom="12px",p.marginTop="12px",p.backgroundColor="var(--canvas)",p.color="var(--canvastext)",!n)return m(D,{partialVisibility:!0,onChange:B,children:F("div",{style:w,children:[m("a",{name:g}),m("div",{id:g,className:"jxgbox",style:p})]})});if(C.current)C.current=!1;else{Array.isArray(t.grid)?((JXG.Options.grid.gridX!==t.grid[0]||JXG.Options.grid.gridY!==t.grid[1])&&(JXG.Options.grid.gridX=t.grid[0],JXG.Options.grid.gridY=t.grid[1],n.grids.length>0&&(n.removeObject(n.grids[0]),n.grids=[])),n.grids.length===0&&n.create("grid",[],{gridX:t.grid[0],gridY:t.grid[1]})):n.grids.length>0&&(n.removeObject(n.grids[0]),n.grids=[]),t.grid==="dense"?(o.current&&(o.current.defaultTicks.setAttribute({majorHeight:-1}),o.current.defaultTicks.setAttribute({minorHeight:-1})),c.current&&(c.current.defaultTicks.setAttribute({majorHeight:-1}),c.current.defaultTicks.setAttribute({minorHeight:-1}))):t.grid==="medium"?(o.current&&(o.current.defaultTicks.setAttribute({majorHeight:-1}),o.current.defaultTicks.setAttribute({minorHeight:10})),c.current&&(c.current.defaultTicks.setAttribute({majorHeight:-1}),c.current.defaultTicks.setAttribute({minorHeight:10}))):(o.current&&(o.current.defaultTicks.setAttribute({majorHeight:20}),o.current.defaultTicks.setAttribute({minorHeight:10})),c.current&&(c.current.defaultTicks.setAttribute({majorHeight:20}),c.current.defaultTicks.setAttribute({minorHeight:10})));let d=t.displayXAxis?!o.current:!!o.current,a=t.displayYAxis?!c.current:!!c.current;if(a&&!d&&t.displayXAxis&&(n.removeObject(o.current),o.current=null),d&&!a&&t.displayYAxis&&(n.removeObject(c.current),c.current=null),t.displayXAxis)if(o.current){let e=!!t.xlabel;if(e!==O.current&&(o.current.setAttribute({withlabel:e}),O.current=e),o.current.name=t.xlabel,o.current.defaultTicks.setAttribute({drawLabels:t.displayXAxisTickLabels}),o.current.hasLabel){let u="rt",l=[5,10],r="right";t.xlabelPosition==="left"&&(u="lft",r="left",l=[-5,10]),o.current.label.visProp.position=u,o.current.label.visProp.anchorx=r,o.current.label.visProp.offset=l,o.current.label.needsUpdate=!0,o.current.label.fullUpdate()}}else j(n);else o.current&&(n.removeObject(o.current),o.current=null);if(t.displayYAxis)if(c.current){let e=!!t.ylabel;if(e!==R.current&&(c.current.setAttribute({withlabel:e}),R.current=e),c.current.name=t.ylabel,c.current.defaultTicks.setAttribute({drawLabels:t.displayYAxisTickLabels}),c.current.hasLabel){let u="rt",l=[-10,-5],r="right";t.ylabelPosition==="bottom"&&(u="lft",l[1]=5),t.ylabelAlignment==="right"&&(r="left",l[0]=10),c.current.label.visProp.position=u,c.current.label.visProp.offset=l,c.current.label.visProp.anchorx=r,c.current.label.needsUpdate=!0,c.current.label.fullUpdate()}}else M(n);else c.current&&(n.removeObject(c.current),c.current=null);_?y.current||(H(),y.current=!0):y.current&&(U(),y.current=!1);let s={width:parseFloat(E(t.width)),aspectRatio:t.aspectRatio};(s.width!==A.current.width||s.aspectRatio!==A.current.aspectRatio)&&Number.isFinite(s.width)&&Number.isFinite(s.aspectRatio)&&(A.current=s);let i=[t.xmin,t.ymax,t.xmax,t.ymin];i.some((e,u)=>e!==v.current[u])&&(S.current=!0,n.setBoundingBox(i),S.current=!1,n.fullUpdate(),n.updateQuality===n.BOARD_QUALITY_LOW&&(n.itemsRenderedLowQuality[g]=n),v.current=i)}return m(D,{partialVisibility:!0,onChange:B,children:F("div",{style:w,children:[m("a",{name:g}),m("div",{id:g,className:"jxgbox",style:p}),m(K.Provider,{value:n,children:X})]})});function M(d){let a={highlight:!1,fixed:!0};if(t.ylabel){let s="rt",i=[-10,-5],e="right";t.ylabelPosition==="bottom"&&(s="lft",i[1]=5),t.ylabelAlignment==="right"&&(e="left",i[0]=10),a.name=t.ylabel,a.withLabel=!0,a.label={position:s,offset:i,anchorx:e,strokeColor:"var(--canvastext)",highlight:!1},t.ylabelHasLatex&&(a.label.useMathJax=!0)}if(R.current=!!t.ylabel,a.strokeColor="var(--canvastext)",a.highlight=!1,a.ticks={ticksDistance:2,label:{offset:[12,-2],layer:2,strokeColor:"var(--canvastext)",highlightStrokeColor:"var(--canvastext)",highlightStrokeOpacity:1},strokeColor:"var(--canvastext)",strokeOpacity:.5,precision:4,drawLabels:t.displayYAxisTickLabels},t.yTickScaleFactor!==null){let s=Y.fromAst(t.yTickScaleFactor),i=s.evaluate_to_constant();if(i>0){let e=s.toString();a.ticks.scale=i,a.ticks.scaleSymbol=e}}t.grid==="dense"?(a.ticks.majorHeight=-1,a.ticks.minorHeight=-1):t.grid==="medium"?(a.ticks.majorHeight=-1,a.ticks.minorHeight=10):(a.ticks.majorHeight=20,a.ticks.minorHeight=10),t.displayXAxis||(a.ticks.drawZero=!0),d.suspendUpdate(),c.current=d.create("axis",[[0,0],[0,1]],a),c.current.defaultTicks.ticksFunction=function(){var s,i,e;return i=this.getLowerAndUpperBounds(this.getZeroCoordinates(),"ticksdistance"),e=i.upper-i.lower,s=Math.pow(10,Math.floor(Math.log(.2*e)/Math.LN10)),e<=6*s&&(s*=.5),s},c.current.defaultTicks.generateEquidistantTicks=function(s,i){var e,u=1e-6,l,r=this.equidistant?this.ticksFunction(1):this.ticksDelta,h=4;if(this.visProp.minorticks=4,l=this.getXandYdeltas(),r*=this.visProp.scale,this.minTicksDistance>1e-6){r=this.adjustTickDistance(r,s,l);let x=10**Math.floor(Math.log10(r))*this.visProp.scale;Math.abs(r/x-2)<1e-14&&(h=3,this.visProp.minorticks=3),r/=h+1}if(this.ticksDelta=r,!(r<1e-6)){for(e=0,this.visProp.drawzero||(e=r);e<=i.upper+u&&(e>=i.lower-u&&this.processTickPosition(s,e,r,l),e+=r,!(i.upper-e>r*1e4)););for(e=-r;e>=i.lower-u&&(e<=i.upper+u&&this.processTickPosition(s,e,r,l),e-=r,!(e-i.lower>r*1e4)););}},d.unsuspendUpdate()}function j(d){let a={highlight:!1,fixed:!0};if(t.xlabel){let s="rt",i=[5,10],e="right";t.xlabelPosition==="left"&&(s="lft",e="left",i=[-5,10]),a.name=t.xlabel,a.withLabel=!0,a.label={position:s,offset:i,anchorx:e,strokeColor:"var(--canvastext)",highlight:!1},t.xlabelHasLatex&&(a.label.useMathJax=!0)}if(O.current=!!t.xlabel,a.ticks={ticksDistance:2,label:{offset:[-5,-15],layer:2,strokeColor:"var(--canvastext)",highlightStrokeColor:"var(--canvastext)",highlightStrokeOpacity:1},strokeColor:"var(--canvastext)",strokeOpacity:.5,precision:4,drawLabels:t.displayXAxisTickLabels},t.xTickScaleFactor!==null){let s=Y.fromAst(t.xTickScaleFactor),i=s.evaluate_to_constant();if(i>0){let e=s.toString();a.ticks.scale=i,a.ticks.scaleSymbol=e}}a.strokeColor="var(--canvastext)",a.highlight=!1,t.grid==="dense"?(a.ticks.majorHeight=-1,a.ticks.minorHeight=-1):t.grid==="medium"?(a.ticks.majorHeight=-1,a.ticks.minorHeight=10):(a.ticks.majorHeight=20,a.ticks.minorHeight=10),t.displayYAxis||(a.ticks.drawZero=!0),d.suspendUpdate(),o.current=d.create("axis",[[0,0],[1,0]],a),o.current.defaultTicks.ticksFunction=function(){var s,i,e;return i=this.getLowerAndUpperBounds(this.getZeroCoordinates(),"ticksdistance"),e=i.upper-i.lower,s=Math.pow(10,Math.floor(Math.log(.2*e)/Math.LN10)),e<=6*s&&(s*=.5),s},o.current.defaultTicks.generateEquidistantTicks=function(s,i){this.minTicksDistance=2*Math.max(2.5,Math.log10(Math.abs(i.lower)),Math.log10(Math.abs(i.upper)));var e,u=1e-6,l,r=this.equidistant?this.ticksFunction(1):this.ticksDelta,h=4;if(this.visProp.minorticks=4,l=this.getXandYdeltas(),r*=this.visProp.scale,this.minTicksDistance>1e-6){r=this.adjustTickDistance(r,s,l);let x=10**Math.floor(Math.log10(r))*this.visProp.scale;Math.abs(r/x-2)<1e-14&&(h=3,this.visProp.minorticks=3),r/=h+1}if(this.ticksDelta=r,!(r<1e-6)){for(e=0,this.visProp.drawzero||(e=r);e<=i.upper+u&&(e>=i.lower-u&&this.processTickPosition(s,e,r,l),e+=r,!(i.upper-e>r*1e4)););for(e=-r;e>=i.lower-u&&(e<=i.upper+u&&this.processTickPosition(s,e,r,l),e-=r,!(e-i.lower>r*1e4)););}},d.unsuspendUpdate()}function H(){let d=document.querySelector("#"+G(g)+"_navigationbar"),a=function(e,u,l){var r=function(){return l.apply(n,arguments)};n["x_internal"+u]=n["x_internal"+u]||[],n["x_internal"+u].push(r),e.addEventListener(u,r,!1)},s=function(e){e||(e=window.event),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},i=function(e,u){var l;l=document.createElement("span"),d.appendChild(l);let r=document.createElement("span");r.setAttribute("style","color: var(--canvastext); opacity: 0.7");let h=document.createTextNode(e);l.appendChild(r),r.appendChild(h),l.style.paddingLeft="7px",l.style.paddingRight="7px",l.classList!==void 0&&l.classList.add("JXG_navigation_button"),a(l,"click",function(x){return u.bind(n)(),!1}),a(l,"mouseup",s),a(l,"mousedown",s),a(l,"touchend",s),a(l,"touchstart",s)};n.attr.showzoom&&(i("–",n.zoomOut),i("o",n.zoom100),i("+",n.zoomIn)),i("←",n.clickLeftArrow),i("↓",n.clickUpArrow),i("↑",n.clickDownArrow),i("→",n.clickRightArrow)}function U(){for(let d=7;d>=1;d--)document.querySelector("#"+G(g)+"_navigationbar > :first-child").remove();n.internalclick=[],n.internalmousedown=[],n.internalmouseup=[],n.internaltouchend=[],n.internaltouchstart=[]}});let k=0;const rt=k++,at=k++,st=k++,nt=k++,lt=k++,ot=k++,ct=k++;export{rt as BASE_LAYER_OFFSET,K as BoardContext,lt as CONTROL_POINT_LAYER_OFFSET,at as IMAGE_LAYER_OFFSET,st as LINE_LAYER_OFFSET,ot as POINT_LAYER_OFFSET,ct as TEXT_LAYER_OFFSET,nt as VERTEX_LAYER_OFFSET,it as default}; diff --git a/dist/assets/hint-e6c88621.js b/dist/assets/hint-06657f21.js similarity index 67% rename from dist/assets/hint-e6c88621.js rename to dist/assets/hint-06657f21.js index 95886a88b6..1f6d28baeb 100644 --- a/dist/assets/hint-e6c88621.js +++ b/dist/assets/hint-06657f21.js @@ -1,6 +1,6 @@ -import{av as k,bn as C,r as R,j as n,a as m,s as V,i as h,bu as v}from"./index-99a56692.js";import{b as H}from"./index-47ca4f11.js";import{V as B}from"./visibility-sensor-55e75ed1.js";const L=V.span` +import{av as k,bp as C,r as R,j as n,a as m,s as V,i as h,bw as v}from"./index-7074710c.js";import{b as H}from"./index-47ca4f11.js";import{V as w}from"./visibility-sensor-7d414852.js";const B=V.span` &: focus { outline: 2px solid var(--canvastext); outline-offset: 2px; } -`,F=k.memo(function(g){var f;let{name:w,id:s,SVs:e,children:a,actions:t,callAction:o}=C(g),y=i=>{o({action:t.recordVisibilityChange,args:{isVisible:i}})};if(R.useEffect(()=>()=>{o({action:t.recordVisibilityChange,args:{isVisible:!1}})},[]),!e.showHints)return null;let r;if(e.titleChildName){for(let[i,l]of a.entries())if(((f=l==null?void 0:l.props)==null?void 0:f.componentInstructions.componentName)===e.titleChildName){r=a[i],a.splice(i,1);break}}r||(r=e.title);let p=n(h,{icon:v}),c=null,d={display:"none"},x=()=>{o({action:t.revealHint})},b=i=>{i.key==="Enter"&&o({action:t.revealHint})},u="open";return e.open&&(u="close",p=n(h,{icon:H}),c=a,d={display:"block",margin:"0px 4px 12px 4px",padding:"6px",border:"2px solid black",borderTop:"0px",borderBottomLeftRadius:"5px",borderBottomRightRadius:"5px",backgroundColor:"white"},b=i=>{i.key==="Enter"&&o({action:t.closeHint})},x=()=>{o({action:t.closeHint})}),n(B,{partialVisibility:!0,onChange:y,children:m("aside",{id:s,children:[n("a",{name:s}),m(L,{style:{display:"block",margin:e.open?"12px 4px 0px 4px":"12px 4px 12px 4px",padding:"6px",border:"2px solid black",borderTopLeftRadius:"5px",borderTopRightRadius:"5px",borderBottomLeftRadius:e.open?"0px":"5px",borderBottomRightRadius:e.open?"0px":"5px",backgroundColor:"var(--mainGray)",cursor:"pointer"},tabIndex:"0","data-test":"hint-heading",onClick:x,onKeyDown:b,children:[" ",p," ",r," (click to ",u,")"]}),n("span",{style:d,children:c})]},s)})});export{F as default}; +`,F=k.memo(function(g){var u;let{name:S,id:s,SVs:e,children:a,actions:t,callAction:o}=C(g),y=i=>{o({action:t.recordVisibilityChange,args:{isVisible:i}})};if(R.useEffect(()=>()=>{o({action:t.recordVisibilityChange,args:{isVisible:!1}})},[]),!e.showHints)return null;let r;if(e.titleChildName){for(let[i,l]of a.entries())if(((u=l==null?void 0:l.props)==null?void 0:u.componentInstructions.componentName)===e.titleChildName){r=a[i],a.splice(i,1);break}}r||(r=e.title);let p=n(h,{icon:v}),c=null,d={display:"none"},x=()=>{o({action:t.revealHint})},b=i=>{i.key==="Enter"&&o({action:t.revealHint})},f="open";return e.open&&(f="close",p=n(h,{icon:H}),c=a,d={display:"block",margin:"0px 4px 12px 4px",padding:"6px",border:"2px solid black",borderTop:"0px",borderBottomLeftRadius:"5px",borderBottomRightRadius:"5px",backgroundColor:"white"},b=i=>{i.key==="Enter"&&o({action:t.closeHint})},x=()=>{o({action:t.closeHint})}),n(w,{partialVisibility:!0,onChange:y,children:m("aside",{id:s,children:[n("a",{name:s}),m(B,{style:{display:"block",margin:e.open?"12px 4px 0px 4px":"12px 4px 12px 4px",padding:"6px",border:"2px solid black",borderTopLeftRadius:"5px",borderTopRightRadius:"5px",borderBottomLeftRadius:e.open?"0px":"5px",borderBottomRightRadius:e.open?"0px":"5px",backgroundColor:"var(--mainGray)",cursor:"pointer"},tabIndex:"0","data-test":"hint-heading",onClick:x,onKeyDown:b,children:[" ",p," ",r," (click to ",f,")"]}),n("span",{style:d,children:c})]},s)})});export{F as default}; diff --git a/dist/assets/image-da34720e.js b/dist/assets/image-c0f70d24.js similarity index 95% rename from dist/assets/image-da34720e.js rename to dist/assets/image-c0f70d24.js index 5e7cd21bf8..51618f2e85 100644 --- a/dist/assets/image-da34720e.js +++ b/dist/assets/image-c0f70d24.js @@ -1 +1 @@ -import{k as te,bv as k,av as re,bn as ie,r as o,bo as T,j as w,a as ne}from"./index-99a56692.js";import{BoardContext as oe,IMAGE_LAYER_OFFSET as $}from"./graph-57e1e537.js";import{s as ae}from"./css-14ccef8c.js";import{V as se}from"./visibility-sensor-55e75ed1.js";async function le(n,m){try{return await ce(n)}catch{}if(!m){let{data:b}=await te.get("/api/getMimeType.php",{params:{cid:n}});m=b["mime-type"]}return ue(n,m)}async function ce(n){let m=new AbortController,b=m.signal,p=setTimeout(()=>{m.abort()},1e3);try{let e=await fetch(`https://${n}.ipfs.dweb.link/`,{signal:b});if(clearTimeout(p),e.ok){let h=await e.blob();if(await k(await h.arrayBuffer())===n){let S=URL.createObjectURL(h);return{mediaBlob:h,mediaURL:S}}else return Promise.reject(new Error("cid mismatch"))}else return Promise.reject(new Error(`cid not found: ${n}`))}catch{return Promise.reject(new Error(`cid not found: ${n}`))}}async function ue(n,m){try{let b=fe(m),p=await fetch(`/media/${n}.${b}`);if(p.ok){let e=await p.blob();if(await k(await e.arrayBuffer())===n){let R=URL.createObjectURL(e);return{mediaBlob:e,mediaURL:R}}else return Promise.reject(new Error("cid mismatch"))}else return Promise.reject(new Error(`cid not found: ${n}`))}catch{return Promise.reject(new Error(`cid not found: ${n}`))}}function fe(n){return n==="image/png"?"png":n==="image/jpeg"?"jpg":n==="text/csv"?"csv":"txt"}const ge=re.memo(function(m){var D;let{name:b,id:p,SVs:e,actions:h,callAction:R}=ie(m,!1),[S,W]=o.useState(null),i=o.useRef(null),_=o.useRef(null);const c=o.useContext(oe);let A=o.useRef(!1),U=o.useRef(!1),j=o.useRef(!1),C=o.useRef(null),F=o.useRef(null),Y=o.useRef(null),B=o.useRef(null),x=o.useRef(null),v=o.useRef(null),V=o.useRef(null),M=o.useRef(e.rotate);const P=(e.cid?S:e.source)||"";let H=s=>{R({action:h.recordVisibilityChange,args:{isVisible:s}})};o.useEffect(()=>()=>{R({action:h.recordVisibilityChange,args:{isVisible:!1}})},[]),o.useEffect(()=>{e.cid&&le(e.cid,e.mimeType).then(s=>{W(s.mediaURL)}).catch(s=>{})},[]);function q(){var z;let s=!e.draggable||e.fixed,l={visible:!e.hidden,fixed:s,layer:10*e.layer+$,highlight:!s},g;try{let d=T.fromAst(e.anchor),y=[d.get_component(0).evaluate_to_constant(),d.get_component(1).evaluate_to_constant()];Number.isFinite(y[0])||(y[0]=0,l.visible=!1),Number.isFinite(y[1])||(y[1]=0,l.visible=!1),g=c.create("point",y,{visible:!1})}catch{l.visible=!1,g=c.create("point",[0,0],{visible:!1})}l.anchor=g;let f=((z=e.widthForGraph)==null?void 0:z.size)||1,u=f/(e.aspectRatio||1);Number.isFinite(f)&&Number.isFinite(u)||(f=0,u=0);let r;e.positionFromAnchor==="center"?r=[-f/2,-u/2]:e.positionFromAnchor==="lowerleft"?r=[-f,-u]:e.positionFromAnchor==="lowerright"?r=[0,-u]:e.positionFromAnchor==="upperleft"?r=[-f,0]:e.positionFromAnchor==="upperright"?r=[0,0]:e.positionFromAnchor==="bottom"?r=[-f/2,-u]:e.positionFromAnchor==="top"?r=[-f/2,0]:e.positionFromAnchor==="right"?r=[0,-u/2]:r=[-f,-u/2],v.current=r;let t=c.create("image",[P,r,[f,u]],l);var O=c.create("transform",[function(){return-t.X()-t.W()*.5},function(){return-t.Y()-t.H()*.5}],{type:"translate"}),a=c.create("transform",[function(){return t.X()+t.W()*.5},function(){return t.Y()+t.H()*.5}],{type:"translate"}),L=c.create("transform",[e.rotate],{type:"rotate"});O.bindTo(t),L.bindTo(t),a.bindTo(t),V.current=L,M.current=e.rotate,t.on("down",function(d){A.current=[d.x,d.y],U.current=[...g.coords.scrCoords],j.current=!1}),t.on("up",function(d){j.current&&R({action:h.moveImage,args:{x:C.current,y:F.current}}),j.current=!1}),t.on("drag",function(d){var y=c.origin.scrCoords;let[G,N,I,J]=c.getBoundingBox(),K=G+.01*(I-G)-v.current[0]-x.current[0],Q=I-.01*(I-G)-v.current[0],Z=J+.01*(N-J)-v.current[1]-x.current[1],ee=N-.01*(N-J)-v.current[1];C.current=(U.current[1]+d.x-A.current[0]-y[1])/c.unitX,C.current=Math.min(Q,Math.max(K,C.current)),F.current=(y[2]-(U.current[2]+d.y-A.current[1]))/c.unitY,F.current=Math.min(ee,Math.max(Z,F.current)),R({action:h.moveImage,args:{x:C.current,y:F.current,transient:!0,skippable:!0}}),t.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,v.current),g.coords.setCoordinates(JXG.COORDS_BY_USER,Y.current),(Math.abs(d.x-A.current[0])>.1||Math.abs(d.y-A.current[1])>.1)&&(j.current=!0)}),i.current=t,_.current=g,B.current=e.positionFromAnchor,x.current=[f,u],i.current.fullUpdate()}if(c){let s;try{let l=T.fromAst(e.anchor);s=[l.get_component(0).evaluate_to_constant(),l.get_component(1).evaluate_to_constant()]}catch{s=[NaN,NaN]}if(Y.current=s,i.current===null){if(e.cid&&!S)return null;q()}else{_.current.coords.setCoordinates(JXG.COORDS_BY_USER,s);let l=!e.hidden;if(Number.isFinite(s[0])&&Number.isFinite(s[1])){let a=i.current.visProp.visible!==l;i.current.visProp.visible=l,i.current.visPropCalc.visible=l,a&&i.current.setAttribute({visible:l})}else i.current.visProp.visible=!1,i.current.visPropCalc.visible=!1;let g=10*e.layer+$;i.current.visProp.layer!==g&&i.current.setAttribute({layer:g});let u=!e.draggable||e.fixed;i.current.visProp.highlight=!u,i.current.visProp.fixed=u,i.current.needsUpdate=!0;let r=((D=e.widthForGraph)==null?void 0:D.size)||1,t=r/(e.aspectRatio||1);Number.isFinite(r)&&Number.isFinite(t)||(r=0,t=0);let O=r!==x.current[0]||t!==x.current[1];if(O&&(i.current.setSize(r,t),x.current=[r,t]),e.rotate!=M.current&&(V.current.setMatrix(c,"rotate",[e.rotate]),M.current=e.rotate),e.positionFromAnchor!==B.current||O){let a;e.positionFromAnchor==="center"?a=[-r/2,-t/2]:e.positionFromAnchor==="lowerleft"?a=[-r,-t]:e.positionFromAnchor==="lowerright"?a=[0,-t]:e.positionFromAnchor==="upperleft"?a=[-r,0]:e.positionFromAnchor==="upperright"?a=[0,0]:e.positionFromAnchor==="bottom"?a=[-r/2,-t]:e.positionFromAnchor==="top"?a=[-r/2,0]:e.positionFromAnchor==="right"?a=[0,-t/2]:a=[-r,-t/2],i.current.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,a),B.current=e.positionFromAnchor,v.current=a,i.current.fullUpdate()}else i.current.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,v.current),i.current.update();_.current.needsUpdate=!0,_.current.update(),c.updateRenderer()}return w("a",{name:p})}if(e.hidden)return null;let X={};e.displayMode==="inline"?X={display:"inline-block",verticalAlign:"middle",margin:"12px 0"}:X={display:"flex",justifyContent:e.horizontalAlign,margin:"12px 0"};let E={maxWidth:"100%",width:ae(e.width)};return e.aspectRatio>0&&(E.aspectRatio=String(e.aspectRatio)),P||(E.border="var(--mainBorder)"),w(se,{partialVisibility:!0,onChange:H,children:ne("div",{style:X,children:[w("a",{name:p}),P?w("img",{id:p,src:P,style:E,alt:e.description}):w("div",{id:p,style:E,children:e.description})]})})});export{ge as default}; +import{k as te,bx as k,av as re,bp as ie,r as o,bq as T,j as w,a as ne}from"./index-7074710c.js";import{BoardContext as oe,IMAGE_LAYER_OFFSET as $}from"./graph-71cec529.js";import{s as ae}from"./css-14ccef8c.js";import{V as se}from"./visibility-sensor-7d414852.js";async function le(n,m){try{return await ce(n)}catch{}if(!m){let{data:b}=await te.get("/api/getMimeType.php",{params:{cid:n}});m=b["mime-type"]}return ue(n,m)}async function ce(n){let m=new AbortController,b=m.signal,p=setTimeout(()=>{m.abort()},1e3);try{let e=await fetch(`https://${n}.ipfs.dweb.link/`,{signal:b});if(clearTimeout(p),e.ok){let h=await e.blob();if(await k(await h.arrayBuffer())===n){let S=URL.createObjectURL(h);return{mediaBlob:h,mediaURL:S}}else return Promise.reject(new Error("cid mismatch"))}else return Promise.reject(new Error(`cid not found: ${n}`))}catch{return Promise.reject(new Error(`cid not found: ${n}`))}}async function ue(n,m){try{let b=fe(m),p=await fetch(`/media/${n}.${b}`);if(p.ok){let e=await p.blob();if(await k(await e.arrayBuffer())===n){let R=URL.createObjectURL(e);return{mediaBlob:e,mediaURL:R}}else return Promise.reject(new Error("cid mismatch"))}else return Promise.reject(new Error(`cid not found: ${n}`))}catch{return Promise.reject(new Error(`cid not found: ${n}`))}}function fe(n){return n==="image/png"?"png":n==="image/jpeg"?"jpg":n==="text/csv"?"csv":"txt"}const ge=re.memo(function(m){var D;let{name:b,id:p,SVs:e,actions:h,callAction:R}=ie(m,!1),[S,W]=o.useState(null),i=o.useRef(null),_=o.useRef(null);const c=o.useContext(oe);let A=o.useRef(!1),U=o.useRef(!1),j=o.useRef(!1),C=o.useRef(null),F=o.useRef(null),Y=o.useRef(null),B=o.useRef(null),x=o.useRef(null),v=o.useRef(null),V=o.useRef(null),M=o.useRef(e.rotate);const P=(e.cid?S:e.source)||"";let H=s=>{R({action:h.recordVisibilityChange,args:{isVisible:s}})};o.useEffect(()=>()=>{R({action:h.recordVisibilityChange,args:{isVisible:!1}})},[]),o.useEffect(()=>{e.cid&&le(e.cid,e.mimeType).then(s=>{W(s.mediaURL)}).catch(s=>{})},[]);function q(){var z;let s=!e.draggable||e.fixed,l={visible:!e.hidden,fixed:s,layer:10*e.layer+$,highlight:!s},g;try{let d=T.fromAst(e.anchor),y=[d.get_component(0).evaluate_to_constant(),d.get_component(1).evaluate_to_constant()];Number.isFinite(y[0])||(y[0]=0,l.visible=!1),Number.isFinite(y[1])||(y[1]=0,l.visible=!1),g=c.create("point",y,{visible:!1})}catch{l.visible=!1,g=c.create("point",[0,0],{visible:!1})}l.anchor=g;let f=((z=e.widthForGraph)==null?void 0:z.size)||1,u=f/(e.aspectRatio||1);Number.isFinite(f)&&Number.isFinite(u)||(f=0,u=0);let r;e.positionFromAnchor==="center"?r=[-f/2,-u/2]:e.positionFromAnchor==="lowerleft"?r=[-f,-u]:e.positionFromAnchor==="lowerright"?r=[0,-u]:e.positionFromAnchor==="upperleft"?r=[-f,0]:e.positionFromAnchor==="upperright"?r=[0,0]:e.positionFromAnchor==="bottom"?r=[-f/2,-u]:e.positionFromAnchor==="top"?r=[-f/2,0]:e.positionFromAnchor==="right"?r=[0,-u/2]:r=[-f,-u/2],v.current=r;let t=c.create("image",[P,r,[f,u]],l);var O=c.create("transform",[function(){return-t.X()-t.W()*.5},function(){return-t.Y()-t.H()*.5}],{type:"translate"}),a=c.create("transform",[function(){return t.X()+t.W()*.5},function(){return t.Y()+t.H()*.5}],{type:"translate"}),L=c.create("transform",[e.rotate],{type:"rotate"});O.bindTo(t),L.bindTo(t),a.bindTo(t),V.current=L,M.current=e.rotate,t.on("down",function(d){A.current=[d.x,d.y],U.current=[...g.coords.scrCoords],j.current=!1}),t.on("up",function(d){j.current&&R({action:h.moveImage,args:{x:C.current,y:F.current}}),j.current=!1}),t.on("drag",function(d){var y=c.origin.scrCoords;let[G,N,I,J]=c.getBoundingBox(),K=G+.01*(I-G)-v.current[0]-x.current[0],Q=I-.01*(I-G)-v.current[0],Z=J+.01*(N-J)-v.current[1]-x.current[1],ee=N-.01*(N-J)-v.current[1];C.current=(U.current[1]+d.x-A.current[0]-y[1])/c.unitX,C.current=Math.min(Q,Math.max(K,C.current)),F.current=(y[2]-(U.current[2]+d.y-A.current[1]))/c.unitY,F.current=Math.min(ee,Math.max(Z,F.current)),R({action:h.moveImage,args:{x:C.current,y:F.current,transient:!0,skippable:!0}}),t.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,v.current),g.coords.setCoordinates(JXG.COORDS_BY_USER,Y.current),(Math.abs(d.x-A.current[0])>.1||Math.abs(d.y-A.current[1])>.1)&&(j.current=!0)}),i.current=t,_.current=g,B.current=e.positionFromAnchor,x.current=[f,u],i.current.fullUpdate()}if(c){let s;try{let l=T.fromAst(e.anchor);s=[l.get_component(0).evaluate_to_constant(),l.get_component(1).evaluate_to_constant()]}catch{s=[NaN,NaN]}if(Y.current=s,i.current===null){if(e.cid&&!S)return null;q()}else{_.current.coords.setCoordinates(JXG.COORDS_BY_USER,s);let l=!e.hidden;if(Number.isFinite(s[0])&&Number.isFinite(s[1])){let a=i.current.visProp.visible!==l;i.current.visProp.visible=l,i.current.visPropCalc.visible=l,a&&i.current.setAttribute({visible:l})}else i.current.visProp.visible=!1,i.current.visPropCalc.visible=!1;let g=10*e.layer+$;i.current.visProp.layer!==g&&i.current.setAttribute({layer:g});let u=!e.draggable||e.fixed;i.current.visProp.highlight=!u,i.current.visProp.fixed=u,i.current.needsUpdate=!0;let r=((D=e.widthForGraph)==null?void 0:D.size)||1,t=r/(e.aspectRatio||1);Number.isFinite(r)&&Number.isFinite(t)||(r=0,t=0);let O=r!==x.current[0]||t!==x.current[1];if(O&&(i.current.setSize(r,t),x.current=[r,t]),e.rotate!=M.current&&(V.current.setMatrix(c,"rotate",[e.rotate]),M.current=e.rotate),e.positionFromAnchor!==B.current||O){let a;e.positionFromAnchor==="center"?a=[-r/2,-t/2]:e.positionFromAnchor==="lowerleft"?a=[-r,-t]:e.positionFromAnchor==="lowerright"?a=[0,-t]:e.positionFromAnchor==="upperleft"?a=[-r,0]:e.positionFromAnchor==="upperright"?a=[0,0]:e.positionFromAnchor==="bottom"?a=[-r/2,-t]:e.positionFromAnchor==="top"?a=[-r/2,0]:e.positionFromAnchor==="right"?a=[0,-t/2]:a=[-r,-t/2],i.current.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,a),B.current=e.positionFromAnchor,v.current=a,i.current.fullUpdate()}else i.current.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,v.current),i.current.update();_.current.needsUpdate=!0,_.current.update(),c.updateRenderer()}return w("a",{name:p})}if(e.hidden)return null;let X={};e.displayMode==="inline"?X={display:"inline-block",verticalAlign:"middle",margin:"12px 0"}:X={display:"flex",justifyContent:e.horizontalAlign,margin:"12px 0"};let E={maxWidth:"100%",width:ae(e.width)};return e.aspectRatio>0&&(E.aspectRatio=String(e.aspectRatio)),P||(E.border="var(--mainBorder)"),w(se,{partialVisibility:!0,onChange:H,children:ne("div",{style:X,children:[w("a",{name:p}),P?w("img",{id:p,src:P,style:E,alt:e.description}):w("div",{id:p,style:E,children:e.description})]})})});export{ge as default}; diff --git a/dist/assets/index-ef9c2520.js b/dist/assets/index-67ec2c85.js similarity index 98% rename from dist/assets/index-ef9c2520.js rename to dist/assets/index-67ec2c85.js index 77fbe419ed..d8fd941274 100644 --- a/dist/assets/index-ef9c2520.js +++ b/dist/assets/index-67ec2c85.js @@ -1 +1 @@ -import{r as x}from"./index-99a56692.js";import{c as R}from"./index-fcf36459.js";var l={};function s(e){return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(e)}Object.defineProperty(l,"__esModule",{value:!0});l.CopyToClipboard=void 0;var c=C(x),E=C(R),k=["text","onCopy","options","children"];function C(e){return e&&e.__esModule?e:{default:e}}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function m(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function I(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function $(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P(e,t){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},a(e)}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=function(e){B(n,e);var t=M(n);function n(){var r;$(this,n);for(var o=arguments.length,i=new Array(o),f=0;f=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function I(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function $(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function P(e,t){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},a(e)}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w=function(e){B(n,e);var t=M(n);function n(){var r;$(this,n);for(var o=arguments.length,i=new Array(o),f=0;fas===rs?"8px solid var(--mainBlue)":"none"}; @@ -1105,20 +1105,20 @@ z-index: 1; width: 100%; height: 100%; `;const CloseButton$1=styled$1.button` -background-color: #1A5A99; -height: 35px; -width: 20px; -color: white; -border: none; -// display: inline-block; -position: static; -left: 220px; -cursor: pointer; -z-index: 2; -&:focus { - outline: 2px solid var(--mainBlue); - outline-offset: 2px; -} + background-color: #1a5a99; + height: 35px; + width: 20px; + color: white; + border: none; + // display: inline-block; + position: static; + left: 220px; + cursor: pointer; + z-index: 2; + &:focus { + outline: 2px solid var(--mainBlue); + outline-offset: 2px; + } `;styled$1.button` background-color: var(--mainBlue); height: 35px; @@ -1130,7 +1130,7 @@ z-index: 2; `;const MenuPanelTitle=styled$1.button` width: 240px; height: 35px; - color:var(--canvastext); + color: var(--canvastext); background: var(--canvas); display: flex; justify-content: center; @@ -1168,22 +1168,22 @@ z-index: 2; font-size: 2em; width: 100vw; height: 100vh; -`;function MenuPanel({hide:as,menuPanelCap:rs="",menusTitles:ns=[],currentMenus:ss=[],initOpen:os=[],setMenusOpen:ls,displayProfile:us}){const cs=Recoil_index_20(searchParamAtomFamily("hideLinks")),[ds,ps]=Recoil_index_22(darkModeAtom),fs=Recoil_index_20(selectedMenuPanelAtom),hs=Recoil_index_24(pageToolViewAtom);let gs=[];const ys=reactExports.useRef({DriveInfoCap:reactExports.lazy(()=>__vitePreload(()=>import("./DriveInfoCap-648d1920.js"),["assets/DriveInfoCap-648d1920.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/util-85d105b8.js","assets/util-38d8e238.js"])),DataCap:reactExports.lazy(()=>__vitePreload(()=>import("./DataCap-1f8c815c.js"),["assets/DataCap-1f8c815c.js","assets/util-85d105b8.js","assets/util-38d8e238.js"])),EditorInfoCap:reactExports.lazy(()=>__vitePreload(()=>import("./EditorInfoCap-87dcbfa3.js"),["assets/EditorInfoCap-87dcbfa3.js","assets/util-85d105b8.js","assets/util-38d8e238.js"])),PortfilioEditorInfoCap:reactExports.lazy(()=>__vitePreload(()=>Promise.resolve().then(()=>PortfilioEditorInfoCap$1),void 0)),AssignmentInfoCap:reactExports.lazy(()=>__vitePreload(()=>import("./AssignmentInfoCap-5739ab74.js"),["assets/AssignmentInfoCap-5739ab74.js","assets/util-85d105b8.js","assets/util-38d8e238.js"])),DraftActivityCap:reactExports.lazy(()=>__vitePreload(()=>import("./DraftActivityCap-37a8fd31.js"),["assets/DraftActivityCap-37a8fd31.js","assets/util-85d105b8.js","assets/util-38d8e238.js"])),ContentInfoCap:reactExports.lazy(()=>__vitePreload(()=>import("./ContentInfoCap-e1dc81ef.js"),["assets/ContentInfoCap-e1dc81ef.js","assets/util-85d105b8.js","assets/util-38d8e238.js"]))}).current,bs=reactExports.useRef({SelectedCourse:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedCourse-4b0d9c71.js"),["assets/SelectedCourse-4b0d9c71.js","assets/ButtonGroup-ea123297.js","assets/CourseToolHandler-f517d0e5.js","assets/index-ef9c2520.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js","assets/util-10e10a40.css","assets/SettingComponents-ce5fbb6e.js","assets/CollapseSection-a6fcd8bf.js","assets/util-38d8e238.js","assets/DateTime-ef0be144.js","assets/moment-f5bb98f1.js","assets/DateTime-adf9b6b7.css","assets/DropdownMenu-9b4c45a6.js","assets/RelatedItems-96588168.js","assets/RoleDropdown-5e05ae49.js","assets/Textfield-5d92f495.js","assets/ActionButton-f612d279.js","assets/ActionButtonGroup-a395ceaf.js"])),GradeSettings:reactExports.lazy(()=>__vitePreload(()=>import("./GradeSettings-a3b21ac2.js"),["assets/GradeSettings-a3b21ac2.js","assets/DateTime-ef0be144.js","assets/moment-f5bb98f1.js","assets/DateTime-adf9b6b7.css","assets/IncrementMenu-aee46d2a.js"])),SelectedSection:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedSection-20efb6e3.js"),["assets/SelectedSection-20efb6e3.js","assets/ActionButton-f612d279.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/Textfield-5d92f495.js"])),SelectedBank:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedBank-72801e7b.js"),["assets/SelectedBank-72801e7b.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/Textfield-5d92f495.js","assets/ButtonGroup-ea123297.js"])),SelectedDataSources:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedDataSources-9a579aaa.js"),["assets/SelectedDataSources-9a579aaa.js","assets/ActionButton-f612d279.js"])),SelectedActivity:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedActivity-e75f87c1.js"),["assets/SelectedActivity-e75f87c1.js","assets/SettingComponents-67fac933.js","assets/DateTime-ef0be144.js","assets/moment-f5bb98f1.js","assets/DateTime-adf9b6b7.css","assets/IncrementMenu-aee46d2a.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/RelatedItems-96588168.js","assets/ActionButtonGroup-a395ceaf.js","assets/ActionButton-f612d279.js","assets/Textfield-5d92f495.js","assets/useSaveDraft-a42d0f94.js","assets/EditorViewerRecoil-41e59102.js","assets/ButtonGroup-ea123297.js","assets/RoleDropdown-5e05ae49.js"])),SelectedOrder:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedOrder-0f287f38.js"),["assets/SelectedOrder-0f287f38.js","assets/ButtonGroup-ea123297.js","assets/IncrementMenu-aee46d2a.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js"])),SelectedPage:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedPage-a6ebfaaa.js"),["assets/SelectedPage-a6ebfaaa.js","assets/Textfield-5d92f495.js","assets/ButtonGroup-ea123297.js","assets/ActionButton-f612d279.js","assets/ActionButtonGroup-a395ceaf.js"])),SelectedPageLink:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedPageLink-07a94985.js"),["assets/SelectedPageLink-07a94985.js","assets/ActionButton-f612d279.js","assets/ActionButtonGroup-a395ceaf.js","assets/Textfield-5d92f495.js"])),SelectedCollectionLink:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedCollectionLink-1600e763.js"),["assets/SelectedCollectionLink-1600e763.js","assets/ActionButton-f612d279.js","assets/Textfield-5d92f495.js","assets/RelatedItems-96588168.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js"])),CreateCourse:reactExports.lazy(()=>__vitePreload(()=>import("./CreateCourse-e7234635.js"),["assets/CreateCourse-e7234635.js","assets/ButtonGroup-ea123297.js"])),CourseEnroll:reactExports.lazy(()=>__vitePreload(()=>import("./CourseEnroll-0080511d.js"),["assets/CourseEnroll-0080511d.js","assets/ButtonGroup-ea123297.js"])),AddDriveItems:reactExports.lazy(()=>__vitePreload(()=>import("./AddDriveItems-19632489.js"),["assets/AddDriveItems-19632489.js","assets/ButtonGroup-ea123297.js"])),CutCopyPasteMenu:reactExports.lazy(()=>__vitePreload(()=>import("./CutCopyPasteMenu-4e591aff.js"),["assets/CutCopyPasteMenu-4e591aff.js","assets/ActionButton-f612d279.js","assets/ActionButtonGroup-a395ceaf.js"])),EnrollStudents:reactExports.lazy(()=>__vitePreload(()=>import("./EnrollStudents-033b160b.js"),["assets/EnrollStudents-033b160b.js","assets/ButtonGroup-ea123297.js"])),DoenetMLSettings:reactExports.lazy(()=>__vitePreload(()=>import("./DoenetMLSettings-649979ff.js"),["assets/DoenetMLSettings-649979ff.js","assets/index-ef9c2520.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/EditorViewerRecoil-41e59102.js"])),VersionHistory:reactExports.lazy(()=>__vitePreload(()=>import("./VersionHistory-5589f4ee.js"),["assets/VersionHistory-5589f4ee.js","assets/CourseToolHandler-f517d0e5.js","assets/index-ef9c2520.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-ea123297.js","assets/util-10e10a40.css","assets/RelatedItems-96588168.js","assets/EditorViewerRecoil-41e59102.js"])),PageVariant:reactExports.lazy(()=>__vitePreload(()=>import("./PageVariant-9b28b6e2.js"),[])),PageLink:reactExports.lazy(()=>__vitePreload(()=>import("./PageLink-f2d20c32.js"),["assets/PageLink-f2d20c32.js","assets/index-fcf36459.js","assets/ActionButton-f612d279.js","assets/EditorViewerRecoil-41e59102.js"])),ActivityVariant:reactExports.lazy(()=>__vitePreload(()=>import("./ActivityVariant-2316414b.js"),["assets/ActivityVariant-2316414b.js","assets/IncrementMenu-aee46d2a.js"])),AutoSaves:reactExports.lazy(()=>__vitePreload(()=>import("./AutoSaves-1ceadcde.js"),[])),LoadPeople:reactExports.lazy(()=>__vitePreload(()=>import("./LoadPeople-f0cdb3f5.js"),["assets/LoadPeople-f0cdb3f5.js","assets/index-2e9c8a8a.js","assets/ButtonGroup-ea123297.js","assets/CollapseSection-a6fcd8bf.js"])),GradeUpload:reactExports.lazy(()=>__vitePreload(()=>import("./GradeUpload-2e665dd9.js"),["assets/GradeUpload-2e665dd9.js","assets/index-2e9c8a8a.js","assets/GradebookAssignment-5ba543e4.js","assets/Gradebook-e81ca638.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-ea123297.js","assets/CollapseSection-a6fcd8bf.js"])),GradeDownload:reactExports.lazy(()=>__vitePreload(()=>import("./GradeDownload-ab9858a0.js"),["assets/GradeDownload-ab9858a0.js","assets/Gradebook-e81ca638.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js"])),ManualEnrollment:reactExports.lazy(()=>__vitePreload(()=>import("./ManualEnrollment-685fd9c8.js"),["assets/ManualEnrollment-685fd9c8.js","assets/LoadPeople-f0cdb3f5.js","assets/index-2e9c8a8a.js","assets/ButtonGroup-ea123297.js","assets/CollapseSection-a6fcd8bf.js"])),AssignmentSettingsMenu:reactExports.lazy(()=>__vitePreload(()=>import("./AssignmentSettingsMenu-7c135fe6.js"),["assets/AssignmentSettingsMenu-7c135fe6.js","assets/SelectedActivity-e75f87c1.js","assets/SettingComponents-67fac933.js","assets/DateTime-ef0be144.js","assets/moment-f5bb98f1.js","assets/DateTime-adf9b6b7.css","assets/IncrementMenu-aee46d2a.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/RelatedItems-96588168.js","assets/ActionButtonGroup-a395ceaf.js","assets/ActionButton-f612d279.js","assets/Textfield-5d92f495.js","assets/useSaveDraft-a42d0f94.js","assets/EditorViewerRecoil-41e59102.js","assets/ButtonGroup-ea123297.js","assets/RoleDropdown-5e05ae49.js"])),SupportingFilesMenu:reactExports.lazy(()=>__vitePreload(()=>import("./SupportingFilesMenu-8dca5c6c.js"),["assets/SupportingFilesMenu-8dca5c6c.js","assets/ActionButtonGroup-a395ceaf.js","assets/ActionButton-f612d279.js","assets/ButtonGroup-ea123297.js","assets/CollapseSection-a6fcd8bf.js","assets/index-ef9c2520.js","assets/index-fcf36459.js","assets/index-47ca4f11.js"])),GroupSettings:reactExports.lazy(()=>__vitePreload(()=>import("./GroupSettings-e0cd864b.js"),["assets/GroupSettings-e0cd864b.js","assets/index-2e9c8a8a.js","assets/ButtonGroup-ea123297.js","assets/CollapseSection-a6fcd8bf.js"])),TimerMenu:reactExports.lazy(()=>__vitePreload(()=>import("./TimerMenu-640f94df.js"),["assets/TimerMenu-640f94df.js","assets/CourseToolHandler-f517d0e5.js","assets/index-ef9c2520.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-ea123297.js","assets/util-10e10a40.css","assets/AssignmentViewer-f9c5976c.js","assets/ActivityViewer-3a815948.js","assets/activityUtils-c08c1686.js","assets/visibility-sensor-55e75ed1.js","assets/ActionButton-f612d279.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js"])),CreditAchieved:reactExports.lazy(()=>__vitePreload(()=>import("./CreditAchieved-d93f00b6.js"),["assets/CreditAchieved-d93f00b6.js","assets/AssignmentViewer-f9c5976c.js","assets/ActivityViewer-3a815948.js","assets/activityUtils-c08c1686.js","assets/visibility-sensor-55e75ed1.js","assets/ActionButton-f612d279.js","assets/ButtonGroup-ea123297.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/Textfield-5d92f495.js","assets/Gradebook-e81ca638.js"])),ActivityDates:reactExports.lazy(()=>__vitePreload(()=>import("./ActivityDates-784e642f.js"),["assets/ActivityDates-784e642f.js","assets/SettingComponents-67fac933.js","assets/DateTime-ef0be144.js","assets/moment-f5bb98f1.js","assets/DateTime-adf9b6b7.css","assets/IncrementMenu-aee46d2a.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/RelatedItems-96588168.js","assets/ActionButtonGroup-a395ceaf.js","assets/ActionButton-f612d279.js","assets/Textfield-5d92f495.js","assets/useSaveDraft-a42d0f94.js","assets/EditorViewerRecoil-41e59102.js","assets/RoleDropdown-5e05ae49.js"])),ClassTimes:reactExports.lazy(()=>__vitePreload(()=>import("./ClassTimes-7721f13e.js"),["assets/ClassTimes-7721f13e.js","assets/Next7Days-4c381b9d.js","assets/CourseToolHandler-f517d0e5.js","assets/index-ef9c2520.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-ea123297.js","assets/util-10e10a40.css","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/DateTime-ef0be144.js","assets/moment-f5bb98f1.js","assets/DateTime-adf9b6b7.css"])),CurrentContent:reactExports.lazy(()=>__vitePreload(()=>import("./CurrentContent-4c34f7f2.js"),["assets/CurrentContent-4c34f7f2.js","assets/Next7Days-4c381b9d.js","assets/CourseToolHandler-f517d0e5.js","assets/index-ef9c2520.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-ea123297.js","assets/util-10e10a40.css","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js"])),ManageUsersMenu:reactExports.lazy(()=>__vitePreload(()=>import("./ManageUsersMenu-c118c06a.js"),["assets/ManageUsersMenu-c118c06a.js","assets/SettingComponents-ce5fbb6e.js","assets/CourseToolHandler-f517d0e5.js","assets/index-ef9c2520.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-ea123297.js","assets/util-10e10a40.css","assets/CollapseSection-a6fcd8bf.js","assets/util-38d8e238.js","assets/DateTime-ef0be144.js","assets/moment-f5bb98f1.js","assets/DateTime-adf9b6b7.css","assets/DropdownMenu-9b4c45a6.js","assets/RelatedItems-96588168.js","assets/RoleDropdown-5e05ae49.js","assets/Textfield-5d92f495.js"]))}).current;let vs=null;if(fs){const Ts=bs[fs];if(Ts){const Ss=`SelectionMenu${fs}`;vs=jsx$1(SelectionMenu,{children:jsx$1(reactExports.Suspense,{fallback:jsx$1(LoadingFallback$1,{children:"loading..."}),children:React.createElement(Ts,{key:Ss})})},Ss)}}let xs=null;rs!==""&&(xs=jsx$1(MenuPanelsCapComponent,{children:jsx$1(reactExports.Suspense,{fallback:jsx$1(LoadingFallback$1,{children:"loading..."}),children:React.createElement(ys[rs])})}));for(let[Ts,Ss]of Object.entries(ss)){const Ns=`${Ss}`,As=ns[Ts];let ws=os[Ts];gs.push(jsx$1(Menu$1,{title:As,isInitOpen:ws,type:Ss,children:jsx$1(reactExports.Suspense,{fallback:jsx$1(LoadingFallback$1,{children:"loading..."}),children:React.createElement(bs[Ss],{mKey:Ns})})},Ns))}let Cs=null;return cs!="true"&&(Cs=jsx$1(SettingsButton,{onClick:()=>hs({page:"settings",tool:"",view:""}),children:jsx$1(FontAwesomeIcon,{icon:faCog})})),jsxs(MenuPanelsWrapper,{hide:as,"aria-label":"menus",children:[jsxs(MenuPanelsCap,{fix:as,role:"banner",children:[jsxs(Branding$1,{style:{marginLeft:"5px"},children:[jsx$1(Logo,{hasLink:cs!="true"}),jsx$1("p",{children:"Doenet"})]}),jsxs(IconsGroup,{children:[jsx$1(CheckboxButton,{checked:ds==="dark",onClick:()=>ps(ds==="dark"?"light":"dark"),checkedIcon:jsx$1(FontAwesomeIcon,{icon:faSun}),uncheckedIcon:jsx$1(FontAwesomeIcon,{icon:faMoon})}),Cs]}),jsx$1("span",{children:jsx$1(CloseButton$1,{onClick:()=>ls(!1),children:jsx$1(FontAwesomeIcon,{icon:faChevronLeft})})})]}),xs,vs,jsx$1("div",{children:gs})]})}function UTCDateStringToDate(as){if(!as||typeof as!="string")return null;let rs=as.split(/[- :]/);return new Date(Date.UTC(rs[0],rs[1]-1,rs[2],rs[3],rs[4],rs[5]))}function formatAMPM(as){var rs=as.getHours(),ns=as.getMinutes(),ss=rs>=12?"PM":"AM";rs=rs%12,rs=rs||12,ns=ns<10?"0"+ns:ns;var os=rs+":"+ns+" "+ss;return os}function DateToUTCDateString(as){var rs=function(ns){return("00"+ns).slice(-2)};return as.getUTCFullYear()+"-"+rs(as.getUTCMonth()+1)+"-"+rs(as.getUTCDate())+" "+rs(as.getUTCHours())+":"+rs(as.getUTCMinutes())+":"+rs(as.getUTCSeconds())}function DateToUTCDateWithoutSecondsString(as){var rs=function(ns){return("00"+ns).slice(-2)};return as.getUTCFullYear()+"-"+rs(as.getUTCMonth()+1)+"-"+rs(as.getUTCDate())+" "+rs(as.getUTCHours())+":"+rs(as.getUTCMinutes())}function DateToDateString(as){var rs=function(ns){return("00"+ns).slice(-2)};return as.getFullYear()+"-"+rs(as.getMonth()+1)+"-"+rs(as.getDate())+" "+rs(as.getHours())+":"+rs(as.getMinutes())+":"+rs(as.getSeconds())}function DateToDisplayDateString(as){var rs=function(ns){return("00"+ns).slice(-2)};return rs(as.getMonth()+1)+"/"+rs(as.getDate())+"/"+as.getFullYear()+" "+formatAMPM(as)}function useValidateEmail(){return reactExports.useCallback(rs=>/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(rs).toLowerCase()),[])}const fileByCid=Recoil_index_10({key:"fileByCid",default:Recoil_index_11({key:"fileByCid/Default",get:as=>async()=>{if(!as)return"";try{return(await axios.get(`/media/${as}.doenet`)).data}catch(rs){return rs.response?(console.log(rs.response.data),console.log(rs.response.status),console.log(rs.response.headers)):rs.request?console.log(rs.request):console.log("Error",rs.message),"Error Loading"}}})}),fileByPageId=Recoil_index_10({key:"fileByPageId",default:Recoil_index_11({key:"fileByPageId/Default",get:as=>async()=>{if(!as)return"";try{return(await axios.get(`/media/byPageId/${as}.doenet`)).data}catch(rs){return rs.response?(console.log(rs.response.data),console.log(rs.response.status),console.log(rs.response.headers)):rs.request?console.log(rs.request):console.log("Error",rs.message),"Error Loading"}}})}),peopleAtomByCourseId=Recoil_index_10({key:"peopleAtomByCourseId",default:Recoil_index_11({key:"peopleAtomByCourseId/Default",get:as=>async()=>{const{data:rs}=await axios.get("/api/loadCoursePeople.php",{params:{courseId:as}});return rs.success?rs.peopleArray:[]}})}),peopleByCourseId=Recoil_index_11({key:"peopleByCourseId",get:as=>({get:rs,getCallback:ns})=>{const ss=ns(({set:us})=>async cs=>{let ds={email:cs,courseId:as};try{let ps=await axios.post("/api/withDrawStudents.php",ds);if(ps.status<300)us(peopleAtomByCourseId(as),fs=>{let hs=[...fs];const gs=hs.findIndex(ys=>ys.email==cs);return hs[gs]={...fs[gs],withdrew:"1"},hs});else throw new Error(`response code: ${ps.status}`)}catch{}}),os=ns(({set:us})=>async cs=>{let ds={email:cs,courseId:as};try{let ps=await axios.post("/api/unWithDrawStudents.php",ds);if(ps.status<300)us(peopleAtomByCourseId(as),fs=>{let hs=[...fs];const gs=hs.findIndex(ys=>ys.email==cs);return hs[gs]={...fs[gs],withdrew:"0"},hs});else throw new Error(`response code: ${ps.status}`)}catch{}}),ls=ns(({set:us})=>async(cs,ds)=>{try{let{data:{success:ps,peopleArray:fs,message:hs}}=await axios.post("/api/mergePeopleData.php",{...cs,courseId:as});if(ps)us(peopleAtomByCourseId(as),fs),ds==null||ds();else throw new Error(hs)}catch{}});return{value:rs(peopleAtomByCourseId(as)),recoilWithdraw:ss,recoilUnWithdraw:os,recoilMergeData:ls}}});function buildDoenetIdToParentDoenetIdObj(as,rs=null){let ns={};for(let ss of as)(ss==null?void 0:ss.type)=="order"?ns={...buildDoenetIdToParentDoenetIdObj(ss.content,ss.doenetId),...ns}:rs!==null&&(ns[ss]=rs);return ns}function findFirstPageOfActivity(as=[]){let rs=null;for(let ns of as)if(typeof ns=="string"||ns instanceof String){rs=ns;break}else{let ss=findFirstPageOfActivity(ns.content);if(typeof ss=="string"||ss instanceof String){rs=ss;break}}return rs}function findOrderAndPageDoenetIdsAndSetOrderObjs({set:as,contentArray:rs,assignmentDoenetId:ns,orderDoenetId:ss=null}){let os=[];for(let ls of rs)if((ls==null?void 0:ls.type)=="order"){let us=ls.numberToSelect;us==null&&(us=1);let cs=ls.withReplacement;cs==null&&(cs=!1);let ds=ss;ss==null&&(ds=ns),as(itemByDoenetId(ls.doenetId),{type:"order",doenetId:ls.doenetId,behavior:ls.behavior,numberToSelect:us,withReplacement:cs,containingDoenetId:ns,isOpen:!1,isSelected:!1,parentDoenetId:ds}),os.push(ls.doenetId);let ps=findOrderAndPageDoenetIdsAndSetOrderObjs({set:as,contentArray:ls.content,assignmentDoenetId:ns,orderDoenetId:ls.doenetId});os=[...os,...ps]}else if((ls==null?void 0:ls.type)=="collectionLink"){let us=ss;ss==null&&(us=ns),as(itemByDoenetId(ls.doenetId),{type:"collectionLink",doenetId:ls.doenetId,containingDoenetId:ns,collectionDoenetId:ls.collectionDoenetId,isManuallyFiltered:ls.isManuallyFiltered,pages:ls.pages,pagesByCollectionSource:ls.pagesByCollectionSource,manuallyFilteredPages:ls.manuallyFilteredPages,timeOfLastUpdate:ls.timeOfLastUpdate,label:ls.label,isOpen:!1,isSelected:!1,parentDoenetId:us}),os.push(ls.doenetId);let cs=[...ls.pages];ls.isManuallyFiltered&&(cs=[...ls.manuallyFilteredPages]),os=[...os,...cs]}else os=[...os,ls];return os}function findPageDoenetIdsInAnOrder({content:as,needleOrderDoenetId:rs,foundNeedle:ns=!1}){let ss=[];for(let os of as)if((os==null?void 0:os.type)=="order"){let ls;ns||os.doenetId==rs?ls=findPageDoenetIdsInAnOrder({content:os.content,needleOrderDoenetId:rs,foundNeedle:!0}):ls=findPageDoenetIdsInAnOrder({content:os.content,needleOrderDoenetId:rs,foundNeedle:ns}),ss=[...ss,...ls]}else ns&&ss.push(os);return ss}function findCollectionLinksAndPageLinksInContentArray({content:as,needleOrderDoenentId:rs,foundNeedle:ns=!1}){let ss=[],os=[];for(let ls of as)if((ls==null?void 0:ls.type)=="order"){ls.doenetId==rs&&(ns=!0);let{pageLinkDoenetIds:us,collectionLinkDoenetIds:cs}=findCollectionLinksAndPageLinksInContentArray({content:ls.content,needleOrderDoenentId:rs,foundNeedle:ns});ss=[...ss,...us],os=[...os,...cs]}else(ls==null?void 0:ls.type)=="collectionLink"&&ns&&(ss=[...ss,...ls.pages],os=[...os,ls.doenetId]);return{pageLinkDoenetIds:ss,collectionLinkDoenetIds:os}}function findPageIdsInContentArray({content:as,needleOrderDoenetId:rs,foundNeedle:ns=!1}){let ss=[];for(let os of as)if((os==null?void 0:os.type)=="order"){let ls;ns||os.doenetId==rs?ls=findPageIdsInContentArray({content:os.content,needleOrderDoenetId:rs,foundNeedle:!0}):ls=findPageIdsInContentArray({content:os.content,needleOrderDoenetId:rs,foundNeedle:ns}),ss=[...ss,...ls]}else(os==null?void 0:os.type)!="collectionLink"&&ns&&ss.push(os);return ss}function localizeDates(as,rs){for(let ns of rs)as[ns]&&(as[ns]=UTCDateStringToDate(as[ns]).toLocaleString());return as}let dateKeys=["assignedDate","dueDate","pinnedAfterDate","pinnedUntilDate"];function useInitCourseItems(as){const rs=Recoil_index_31(({snapshot:ns,set:ss})=>async os=>{if(!os)return;if((await ns.getPromise(authorCourseItemOrderByCourseId(os))).length==0){ss(courseIdAtom,os);const{data:us}=await axios.get("/api/getCourseItems.php",{params:{courseId:os}});if(us.success){let cs={},ds=us.items.reduce((ps,fs)=>{if(fs.type!=="page"&&fs.type!=="pageLink"&&ps.push(fs.doenetId),fs.type==="activity"){let hs=buildDoenetIdToParentDoenetIdObj(fs.content,fs.doenetId);cs={...cs,...hs};let gs=findOrderAndPageDoenetIdsAndSetOrderObjs({set:ss,contentArray:fs.content,assignmentDoenetId:fs.doenetId});fs.isSinglePage||(ps=[...ps,...gs])}else fs.type==="bank"?(fs.pages.map(hs=>{cs[hs]=fs.doenetId}),ps=[...ps,...fs.pages]):fs.type==="page"&&(fs.parentDoenetId=cs[fs.doenetId]);return ss(itemByDoenetId(fs.doenetId),localizeDates(fs,dateKeys)),ps},[]);ss(authorCourseItemOrderByCourseId(os),ds)}}},[]);reactExports.useEffect(()=>{as&&rs(as)},[rs,as])}function useSetCourseIdFromDoenetId(as){const[rs,ns]=Recoil_index_22(itemByDoenetId(as)),ss=Recoil_index_24(courseIdAtom);reactExports.useEffect(()=>{Object.keys(rs).length>0||axios.get("/api/getCourseIdFromDoenetId.php",{params:{doenetId:as}}).then(({data:os})=>{os.success?(os.item&&ns(os.item),ss(os.courseId)):ss("__not_found__")}).catch(console.error)},[as])}const courseIdAtom=Recoil_index_8({key:"courseIdAtom",default:null}),authorCollectionsByCourseId=Recoil_index_11({key:"authorCollectionsByCourseId",get:as=>({get:rs})=>{let ns=rs(authorCourseItemOrderByCourseId(as)),ss=[];for(let os of ns){let ls=rs(itemByDoenetId(os));ls.type=="bank"&&ss.push({label:ls.label,doenetId:os})}return ss}}),authorCourseItemOrderByCourseId=Recoil_index_10({key:"authorCourseItemOrderByCourseId",default:[]}),authorCourseItemOrderByCourseIdBySection=Recoil_index_11({key:"authorCourseItemOrderByCourseIdBySection",get:({courseId:as,sectionId:rs})=>({get:ns})=>{let ss=ns(authorCourseItemOrderByCourseId(as));if(rs==as||!rs)return ss;let os=[],ls=!1,us=[rs];for(let cs of ss){if(cs==rs){ls=!0;continue}if(ls){let ds=ns(itemByDoenetId(cs));if(us.includes(ds.parentDoenetId))os.push(cs),ds.type!=="page"&&us.push(cs);else break}}return os}}),studentCourseItemOrderByCourseId=Recoil_index_11({key:"studentCourseItemOrderByCourseId",get:as=>({get:rs})=>rs(authorCourseItemOrderByCourseId(as)).filter(os=>{let ls=rs(itemByDoenetId(os));return ls.isAssigned&&(ls.type=="activity"||ls.type=="section")})}),studentCourseItemOrderByCourseIdBySection=Recoil_index_11({key:"studentCourseItemOrderByCourseId",get:({courseId:as,sectionId:rs})=>({get:ns})=>{let ss=ns(studentCourseItemOrderByCourseId(as)),os=[],ls=!1,us=[rs];(as==rs||!rs)&&(us=[as],ls=!0);for(let cs of ss){if(cs==rs){ls=!0;continue}if(ls){let ds=ns(itemByDoenetId(cs));if(ds.isAssigned&&us.includes(ds.parentDoenetId))os.push(cs),ds.type=="section"&&us.push(cs);else continue}}return os}}),itemByDoenetId=Recoil_index_10({key:"itemByDoenetId",default:{}}),coursePermissionsAndSettings=Recoil_index_8({key:"coursePermissionsAndSettings",default:[],effects:[async({setSelf:as,trigger:rs})=>{if(rs==="get"){const{data:ns}=await axios.get("/api/getCoursePermissionsAndSettings.php");as(ns.permissionsAndSettings)}}]}),coursePermissionsAndSettingsByCourseId=Recoil_index_11({key:"coursePermissionsAndSettingsByCourseId/Default",get:as=>({get:rs})=>rs(coursePermissionsAndSettings).find(ss=>ss.courseId==as)??{},set:as=>({set:rs},ns)=>{rs(coursePermissionsAndSettings,ss=>{const os=[...ss],ls=ss.findIndex(us=>us.courseId===as);return os[ls]={...ss[ls],...ns},os})}}),unfilteredCourseRolesByCourseId=Recoil_index_10({key:"unfilteredCourseRolesByCourseId",effects:as=>[async({setSelf:rs,trigger:ns})=>{if(ns==="get"){const{data:{roles:ss}}=await axios.get("/api/loadCourseRoles.php",{params:{courseId:as}});rs(ss)}}]}),courseRolesByCourseId=Recoil_index_11({key:"filteredCourseRolesByCourseId",get:as=>({get:rs})=>{const ns=rs(coursePermissionsAndSettingsByCourseId(as)),ss=rs(unfilteredCourseRolesByCourseId(as)),os=["isIncludedInGradebook","sectionPermissionOnly","dataAccessPermission","roleId","roleLabel"];return(ss==null?void 0:ss.filter(us=>us.roleId===ns.roleId||!Object.keys(us).every(ds=>(us[ds]??"0")===ns[ds]||os.includes(ds)||(us[ds]??"0")==="1"&&ns[ds]==="0")))??[]}}),courseRolePermissionsByCourseIdRoleId=Recoil_index_11({key:"courseRoleByCourseIdRoleId",get:({courseId:as,roleId:rs})=>({get:ns})=>{var ss;return((ss=ns(unfilteredCourseRolesByCourseId(as)))==null?void 0:ss.find(({roleId:os})=>os===rs))??{}}}),useCreateCourse=()=>({createCourse:Recoil_index_31(({set:rs})=>async()=>{let{data:{permissionsAndSettings:ns,courseId:ss,image:os,color:ls,...us}}=await axios.get("/api/createCourse.php");rs(coursePermissionsAndSettings,ns)})});Recoil_index_10({key:"courseOrderDataByCourseId",default:{completeOrder:[],orderingDataLookup:{}},effects:as=>[({setSelf:rs,onSet:ns,trigger:ss})=>{ns(({completeOrder:os},ls)=>{})}]});const selectedCourseItems=Recoil_index_8({key:"selectedCourseItems",default:[]}),copiedCourseItems=Recoil_index_8({key:"copiedCourseItems",default:[]}),cutCourseItems=Recoil_index_8({key:"cutCourseItems",default:[]});function findContentsChildIds(as){let rs=[];for(let ns of as)if((ns==null?void 0:ns.type)=="order"){let ss=findContentsChildIds(ns.content);rs=[...rs,ns.doenetId,...ss]}else if((ns==null?void 0:ns.type)=="collectionLink"){let ss=[];rs=[...rs,ns.doenetId,...ss]}else rs.push(ns);return rs}const useCourse=as=>{const{label:rs,color:ns,image:ss,defaultRoleId:os,canAutoEnroll:ls}=Recoil_index_20(coursePermissionsAndSettingsByCourseId(as)),us=useToast();function cs({content:Us,needleOrderDoenetId:js,createdItemType:Ls,createdPageDonenetId:Gs=null,createdOrderObj:Hs=null,createdCollectionLink:Ys=null}){let Zs=[...Us],Nl;for(let[yl,Dl]of Object.entries(Us)){if((Dl==null?void 0:Dl.doenetId)==js){let Rl={...Dl};if(Nl=Rl.doenetId,Rl.content.length>0&&(Nl=Rl.content[Rl.content.length-1]),(Nl==null?void 0:Nl.type)=="order"){let Ml=findContentsChildIds(Dl.content);Nl=Nl.doenetId,Ml.length>0&&(Nl=Ml[Ml.length-1])}return Ls=="page"?Rl.content=[...Rl.content,Gs]:Ls=="order"?Rl.content=[...Rl.content,{...Hs}]:Ls=="collectionLink"&&(Rl.content=[...Rl.content,{...Ys}]),Zs.splice(yl,1,Rl),{newContent:Zs,insertedAfterDoenetId:Nl}}if((Dl==null?void 0:Dl.type)=="order"){let{newContent:Rl,insertedAfterDoenetId:Ml}=cs({content:Dl.content,needleOrderDoenetId:js,createdItemType:Ls,createdPageDonenetId:Gs,createdOrderObj:Hs,createdCollectionLink:Ys});if(Rl!=null){let Ks={...Dl};return Ks.content=Rl,Zs.splice(yl,1,Ks),{newContent:Zs,insertedAfterDoenetId:Ml}}}}return{newContent:null,insertedAfterDoenetId:null}}function ds({activityOrOrderObj:Us,needleOrderOrActivityId:js,itemToAdd:Ls}){let Gs=[...Us.content];if(Us.doenetId==js){let Hs=Us.doenetId;return Us.content.length>0&&(Hs=Gs[Gs.length-1],(Hs==null?void 0:Hs.type)=="order"&&(Hs=Hs.doenetId)),Gs=[...Gs,Ls],{content:Gs,previousDoenetId:Hs}}for(let[Hs,Ys]of Object.entries(Us.content))if((Ys==null?void 0:Ys.type)=="order"){let{content:Zs,previousDoenetId:Nl}=ds({activityOrOrderObj:Ys,needleOrderOrActivityId:js,itemToAdd:Ls});if(Zs!=null){let yl={...Ys};return yl.content=Zs,Gs.splice(Hs,1,yl),{content:Gs,previousDoenetId:Nl}}}return{content:null,previousDoenetId:null}}const ps=reactExports.useCallback(Us=>{us(`${Us}`,toastType.ERROR)},[us]),fs=Recoil_index_31(({set:Us,snapshot:js})=>async({itemType:Ls,parentDoenetId:Gs,previousDoenetId:Hs,previousContainingDoenetId:Ys},Zs,Nl=ps)=>{let Dl=[...await js.getPromise(authorCourseItemOrderByCourseId(as))],Rl=await js.getPromise(searchParamAtomFamily("sectionId"));Rl==""&&(Rl=as);let Ml=await js.getPromise(selectedCourseItems);if(Ml.length==1){let Qs=Ml[0],Js=await js.getPromise(itemByDoenetId(Qs));if(Js.type=="section"){let El=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Qs})),_l=El[El.length-1];if(Gs=Qs,Hs=_l,!_l)Hs=Qs,Ys=Qs;else{let Xs=await js.getPromise(itemByDoenetId(_l));Hs=_l,Xs.type=="page"||Xs.type=="order"?Ys=Xs.containingDoenetId:(Xs.type=="bank"||Xs.type=="section")&&(Ys=_l)}}else if(Js.type=="activity"||Js.type=="bank"){Gs=Js.parentDoenetId,Ls=="page"&&Js.type=="bank"&&(Gs=Js.doenetId,console.log("page in a bank parentDoenetId:",Gs));let El=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Gs})),_l=Gs;if(El.length>0){_l=El[El.length-1];let Xs=await js.getPromise(itemByDoenetId(_l));Hs=_l,Xs.type=="page"||Xs.type=="order"?Ys=Xs.containingDoenetId:(Xs.type=="bank"||Xs.type=="section")&&(Ys=_l)}else Hs=Gs,Ys=Js.parentDoenetId}else if(Js.type=="page"||Js.type=="order"){Gs=(await js.getPromise(itemByDoenetId(Js.containingDoenetId))).parentDoenetId;let _l=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Gs})),Xs=_l[_l.length-1],xl=await js.getPromise(itemByDoenetId(Xs));Hs=Xs,xl.type=="page"||xl.type=="order"?Ys=xl.containingDoenetId:(xl.type=="bank"||xl.type=="section")&&(Ys=Xs)}}if(Hs==null){console.log("not a single selection!!!!!");let Qs=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Rl})),Js=Qs[Qs.length-1];if(Gs=Rl,Js==null)Hs=Rl,Ys=Rl;else{Hs=Js;let El=await js.getPromise(itemByDoenetId(Js));El.type=="page"||El.type=="order"||El.type=="collectionLink"||El.type=="pageLink"?Ys=El.containingDoenetId:(El.type=="activity"||El.type=="bank"||El.type=="section")&&(Ys=El.doenetId)}}console.log("WHERE IS IT GOING?"),console.log("itemType",Ls),console.log("parentDoenetId",Gs),console.log("previousDoenetId",Hs),console.log("previousContainingDoenetId",Ys);let Ks;if((await js.getPromise(coursePermissionsAndSettingsByCourseId(as))).canEditContent!="1")return null;if(Ls=="activity"){let{data:Qs}=await axios.post("/api/createCourseItem.php",{previousContainingDoenetId:Ys,courseId:as,itemType:Ls,parentDoenetId:Gs}),Js=Qs.doenetId;Ks=Js;let El={timeLimit:null,numberOfAttemptsAllowed:null,totalPointsOrPercent:null,individualize:!1,showSolution:!0,showSolutionInGradebook:!0,showFeedback:!0,showHints:!0,showCorrectness:!0,showCreditAchievedMenu:!0,paginate:!0,showFinishButton:!1,proctorMakesAvailable:!1,autoSubmit:!1,pinnedAfterDate:null,pinnedUntilDate:null,canViewAfterCompleted:"1",...Qs.itemEntered};Us(itemByDoenetId(Js),El);let _l={...Qs.pageEntered,parentDoenetId:Js};Us(itemByDoenetId(Qs.pageDoenetId),_l);let Xs=Dl.indexOf(Hs);Xs==-1?Dl.push(Js):Dl.splice(Xs+1,0,Js),Us(authorCourseItemOrderByCourseId(as),Dl)}else if(Ls=="bank"){let{data:Qs}=await axios.post("/api/createCourseItem.php",{previousContainingDoenetId:Ys,courseId:as,itemType:Ls,parentDoenetId:Gs});console.log("bankData",Qs),Ks=Qs.doenetId,Us(itemByDoenetId(Qs.doenetId),Qs.itemEntered);let Js=Dl.indexOf(Hs);Js==-1?Dl.push(Qs.doenetId):Dl.splice(Js+1,0,Qs.doenetId),Us(authorCourseItemOrderByCourseId(as),Dl)}else if(Ls=="section"){let{data:Qs}=await axios.post("/api/createCourseItem.php",{previousContainingDoenetId:Ys,courseId:as,itemType:Ls,parentDoenetId:Gs});Ks=Qs.doenetId,Us(itemByDoenetId(Qs.doenetId),Qs.itemEntered);let Js=Dl.indexOf(Hs);Js==-1?Dl.push(Qs.doenetId):Dl.splice(Js+1,0,Qs.doenetId),Us(authorCourseItemOrderByCourseId(as),Dl)}else if(Ls=="page"||Ls=="order"||Ls=="collectionLink"){let Qs=(await js.getPromise(selectedCourseItems))[0];const Js=await js.getPromise(itemByDoenetId(Qs));let El;Js.type=="activity"||Js.type=="bank"?El=Js.doenetId:(Js.type=="order"||Js.type=="page")&&(El=Js.containingDoenetId);let{data:_l}=await axios.get("/api/createPageOrOrder.php",{params:{courseId:as,itemType:Ls,containingDoenetId:El}}),{pageThatWasCreated:Xs,orderDoenetIdThatWasCreated:xl,collectionAliasDoenetIdThatWasCreated:Al}=_l,Fs={type:"order",behavior:"sequence",numberToSelect:1,withReplacement:!1,content:[],doenetId:xl},Cl={type:"collectionLink",doenetId:Al,collectionDoenetId:null,isManuallyFiltered:!1,pages:[],manuallyFilteredPages:[],pagesByCollectionSource:{object:!0},timeOfLastUpdate:null,label:"Untitled Collection Link"};if(Js.type=="activity"){let Tl={...Js.content};Ls=="page"?(Xs.parentDoenetId=Js.doenetId,Tl=[...Js.content,Xs.doenetId]):Ls=="order"?Tl=[...Js.content,Fs]:Ls=="collectionLink"&&(Tl=[...Js.content,Cl]);let zl={...Js};zl.content=Tl;let Xl=!1;zl.isSinglePage&&(Xl=!0,zl.isSinglePage=!1),await axios.post("/api/updateActivityStructure.php",{courseId:as,doenetId:zl.doenetId,newJSON:Tl,makeMultiPage:Xl}),Us(itemByDoenetId(zl.doenetId),zl),Ls=="page"?Us(itemByDoenetId(Xs.doenetId),Xs):Ls=="order"?(Fs={...Fs,isOpen:!1,isSelected:!1,containingDoenetId:Js.doenetId,parentDoenetId:Js.doenetId},Us(itemByDoenetId(Fs.doenetId),Fs)):Ls=="collectionLink"&&(Cl={...Cl,isOpen:!1,isSelected:!1,containingDoenetId:Js.doenetId,parentDoenetId:Js.doenetId},Us(itemByDoenetId(Cl.doenetId),Cl));let Pl=findContentsChildIds(Js.content),Bl=findContentsChildIds(Tl);Us(authorCourseItemOrderByCourseId(as),Wl=>{let Ll=[...Wl];return Xl||Ll.splice(Ll.indexOf(Js.doenetId)+1,Pl.length),Ll.splice(Ll.indexOf(Js.doenetId)+1,0,...Bl),Ll})}else if(Js.type=="bank"){let Tl=Js.pages[Js.pages.length-1];Js.pages.length==0&&(Tl=Js.doenetId),Xs.parentDoenetId=Js.doenetId;let zl=[...Js.pages,Xs.doenetId],Xl={...Js};Xl.pages=zl,await axios.post("/api/updateCollectionStructure.php",{courseId:as,doenetId:Xl.doenetId,newJSON:zl}),Us(itemByDoenetId(Xs.doenetId),Xs),Us(itemByDoenetId(Xl.doenetId),Xl),Us(authorCourseItemOrderByCourseId(as),Pl=>{let Bl=[...Pl];return Bl.splice(Bl.indexOf(Tl)+1,0,Xs.doenetId),Bl})}else if(Js.type=="order"){let Tl=Js.doenetId,zl=null;Ls=="page"?Xs&&(Xs.parentDoenetId=Tl):Ls=="collectionLink"&&(zl=Cl);const Xl=await js.getPromise(itemByDoenetId(Js.containingDoenetId));let{newContent:Pl,insertedAfterDoenetId:Bl}=cs({content:Xl.content,needleOrderDoenetId:Tl,createdItemType:Ls,createdPageDonenetId:Xs==null?void 0:Xs.doenetId,createdOrderObj:Fs,createdCollectionLink:zl}),Wl={...Xl};Wl.content=Pl,await axios.post("/api/updateActivityStructure.php",{courseId:as,doenetId:Wl.doenetId,newJSON:Pl}),Us(itemByDoenetId(Wl.doenetId),Wl);let Ll;Ls=="page"?(Us(itemByDoenetId(Xs.doenetId),Xs),Ll=Xs.doenetId):Ls=="order"?(Fs.isOpen=!1,Fs.isSelected=!1,Fs.containingDoenetId=Js==null?void 0:Js.containingDoenetId,Fs.parentDoenetId=Js==null?void 0:Js.doenetId,Us(itemByDoenetId(Fs.doenetId),Fs),Ll=xl):Ls=="collectionLink"&&(Cl.isOpen=!1,Cl.isSelected=!1,Cl.containingDoenetId=Js==null?void 0:Js.containingDoenetId,Cl.parentDoenetId=Js==null?void 0:Js.doenetId,Us(itemByDoenetId(Cl.doenetId),Cl),Ll=Al),Us(authorCourseItemOrderByCourseId(as),Hl=>{let Ql=[...Hl];return Ql.splice(Ql.indexOf(Bl)+1,0,Ll),Ql})}else if(Js.type=="page"){Xs&&(Xs.parentDoenetId=Js.parentDoenetId);const Tl=await js.getPromise(itemByDoenetId(Js.containingDoenetId));if(Tl.type=="bank"){let zl=Tl.pages[Tl.pages.length-1],Xl=[...Tl.pages,Xs.doenetId],Pl={...Tl};Pl.pages=Xl,await axios.post("/api/updateCollectionStructure.php",{courseId:as,doenetId:Pl.doenetId,newJSON:Xl}),Us(itemByDoenetId(Xs.doenetId),Xs),Us(itemByDoenetId(Pl.doenetId),Pl),Us(authorCourseItemOrderByCourseId(as),Bl=>{let Wl=[...Bl];return Wl.splice(Wl.indexOf(zl)+1,0,Xs.doenetId),Wl})}else if(Tl.type=="activity"){let zl,Xl;Ls=="page"?{content:Xl,previousDoenetId:zl}=ds({activityOrOrderObj:Tl,needleOrderOrActivityId:Js.parentDoenetId,itemToAdd:Xs==null?void 0:Xs.doenetId}):Ls=="order"&&({content:Xl,previousDoenetId:zl}=ds({activityOrOrderObj:Tl,needleOrderOrActivityId:Js.parentDoenetId,itemToAdd:Fs})),await axios.post("/api/updateActivityStructure.php",{courseId:as,doenetId:Tl.doenetId,newJSON:Xl});let Pl={...Tl};Pl.content=Xl,Fs.isOpen=!1,Fs.isSelected=!1,Fs.containingDoenetId=Js==null?void 0:Js.containingDoenetId,Fs.parentDoenetId=Js==null?void 0:Js.parentDoenetId;let Bl;Ls=="page"?(Us(itemByDoenetId(Xs.doenetId),Xs),Bl=Xs.doenetId):Ls=="order"&&(Us(itemByDoenetId(Fs.doenetId),Fs),Bl=xl),Us(itemByDoenetId(Pl.doenetId),Pl),Us(authorCourseItemOrderByCourseId(as),Wl=>{let Ll=[...Wl];return Ll.splice(Ll.indexOf(zl)+1,0,Bl),Ll})}}}return Ks}),hs=Recoil_index_31(({set:Us})=>async(js,Ls,Gs=ps)=>{try{let Hs=await axios.post("/api/modifyCourse.php",{courseId:as,...js});if(Hs.status<300)Us(coursePermissionsAndSettingsByCourseId(as),({prev:Ys})=>({...Ys,...js})),Ls==null||Ls();else throw new Error(`response code: ${Hs.status}`)}catch(Hs){Gs(Hs.message)}}),gs=useValidateEmail(),ys=Recoil_index_31(({set:Us})=>async(js,Ls,Gs,Hs=ps)=>{try{if(!gs(js))throw new Error("Invalid email, try again");const{data:{success:Ys,message:Zs,userData:Nl}}=await axios.post("/api/addCourseUser.php",{courseId:as,email:js,...Ls});if(Ys)Us(peopleAtomByCourseId(as),yl=>[...yl,{...Nl}]),Gs(Zs);else throw new Error(Zs)}catch(Ys){Hs(Ys.message)}}),bs=Recoil_index_31(({set:Us})=>async(js,Ls,Gs,Hs=ps)=>{try{const{data:{success:Ys,message:Zs}}=await axios.post("/api/updateUserRole.php",{courseId:as,userEmail:js,roleId:Ls});if(Ys)Us(peopleAtomByCourseId(as),Nl=>{const yl=Nl.slice(0),Dl=Nl.findIndex(({email:Rl})=>Rl===js);return yl[Dl]={...Nl[Dl],roleId:Ls},yl}),Gs();else throw new Error(Zs)}catch(Ys){Hs(Ys.message)}}),vs=Recoil_index_31(({set:Us})=>async(js,Ls,Gs,Hs=ps)=>{try{const{data:{success:Ys,message:Zs,actionType:Nl,roleId:yl,updatedPermissions:Dl}}=await axios.post("/api/updateRolePermissions.php",{courseId:as,roleId:js,permissions:{...Ls,label:Ls==null?void 0:Ls.roleLabel}});if(Ys)Us(unfilteredCourseRolesByCourseId(as),Rl=>{const Ml=[...Rl],Ks=Rl.findIndex(({roleId:Qs})=>Qs===yl);let{label:qs}=Dl;switch(qs===void 0&&(qs=Rl[Ks].roleLabel),Nl){case"add":Ml.push({...Dl,roleLabel:qs,roleId:yl});break;case"update":Ml.splice(Ks,1,{...Rl[Ks],...Dl,roleLabel:qs});break;case"delete":Ml.splice(Ks,1);break}return Ml}),Gs();else throw new Error(Zs)}catch(Ys){Hs(Ys.message)}},[as,ps]),xs=Recoil_index_31(({set:Us})=>async(js,Ls=ps)=>{try{let Gs=await axios.post("/api/deleteCourse.php",{courseId:as});if(Gs.status<300)Us(coursePermissionsAndSettings,Hs=>Hs.filter(Ys=>Ys.courseId!==as)),js==null||js();else throw new Error(`response code: ${Gs.status}`)}catch(Gs){Ls(Gs.message)}},[as,ps]),Cs=Recoil_index_31(({set:Us})=>async({dateDifference:js,newLabel:Ls},Gs,Hs=ps)=>{try{let Ys=await axios.post("/api/duplicateCourse.php",{courseId:as,dateDifference:js,newLabel:Ls});if(Ys.status<300)Us(coursePermissionsAndSettings,Ys.data.permissionsAndSettings),Gs==null||Gs();else throw new Error(`response code: ${Ys.status}`)}catch(Ys){Hs(Ys.message)}},[as,ps]),Ts=Recoil_index_31(({snapshot:Us,set:js})=>async(Ls,Gs,Hs,Ys=ps)=>{try{let Zs=await Us.getPromise(cutCourseItems);for(let Dl of Zs)js(itemByDoenetId(Dl.doenetId),Rl=>{let Ml={...Rl};return Ml.isBeingCut=!1,Ml});js(cutCourseItems,[]),js(copiedCourseItems,[]);let Nl=await Us.getPromise(itemByDoenetId(Ls)),yl=await axios.get("/api/renameCourseItem.php",{params:{courseId:as,doenetId:Ls,newLabel:Gs,type:Nl.type}});if(yl.status<300){let Dl=yl.data.item;Nl.type!=="page"&&(Dl.isOpen=Nl.isOpen),js(itemByDoenetId(Ls),Rl=>{let Ml={...Rl};return Ml.label=Dl.label,Ml}),Hs==null||Hs()}else throw new Error(`response code: ${yl.status}`)}catch(Zs){Ys(Zs.message)}},[as,ps]),Ss=Recoil_index_31(({set:Us})=>async({doenetId:js,isAssigned:Ls,successCallback:Gs,failureCallback:Hs=ps})=>{try{let Ys=await axios.get("/api/updateIsAssignedOnAnItem.php",{params:{courseId:as,doenetId:js,isAssigned:Ls}});if(Ys.status<300)Us(itemByDoenetId(js),Zs=>{let Nl={...Zs};return Nl.isAssigned=Ls,Nl}),Gs==null||Gs();else throw new Error(`response code: ${Ys.status}`)}catch(Ys){Hs(Ys.message)}},[as,ps]),Ns=Recoil_index_31(({set:Us,snapshot:js})=>async({activityDoenetId:Ls,successCallback:Gs,isAssigned:Hs=!1,courseId:Ys,failureCallback:Zs=ps})=>{async function Nl({order:Qs,indentLevel:Js=1}){let _l=["behavior","numberToSelect","withReplacement"].filter(Al=>Al in Qs).map(Al=>`${Al}="${Qs[Al]}"`).join(" "),Xs=(await Promise.all(Qs.content.map(Al=>yl({content:Al,indentLevel:Js+1})))).join(""),xl=" ".repeat(Js);return`${xl} +`;function MenuPanel({hide:as,menuPanelCap:rs="",menusTitles:ns=[],currentMenus:ss=[],initOpen:os=[],setMenusOpen:ls,displayProfile:us}){const cs=Recoil_index_20(searchParamAtomFamily("hideLinks")),[ds,ps]=Recoil_index_22(darkModeAtom),fs=Recoil_index_20(selectedMenuPanelAtom),hs=Recoil_index_24(pageToolViewAtom);let gs=[];const ys=reactExports.useRef({DriveInfoCap:reactExports.lazy(()=>__vitePreload(()=>import("./DriveInfoCap-b5df74cd.js"),["assets/DriveInfoCap-b5df74cd.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/util-85d105b8.js","assets/util-38d8e238.js"])),DataCap:reactExports.lazy(()=>__vitePreload(()=>import("./DataCap-11084395.js"),["assets/DataCap-11084395.js","assets/util-85d105b8.js","assets/util-38d8e238.js"])),EditorInfoCap:reactExports.lazy(()=>__vitePreload(()=>import("./EditorInfoCap-a2e17057.js"),["assets/EditorInfoCap-a2e17057.js","assets/util-85d105b8.js","assets/util-38d8e238.js"])),PortfilioEditorInfoCap:reactExports.lazy(()=>__vitePreload(()=>Promise.resolve().then(()=>PortfilioEditorInfoCap$1),void 0)),PublicEditorInfoCap:reactExports.lazy(()=>__vitePreload(()=>import("./PublicEditorInfoCap-5cd41e47.js"),[])),AssignmentInfoCap:reactExports.lazy(()=>__vitePreload(()=>import("./AssignmentInfoCap-34c7c068.js"),["assets/AssignmentInfoCap-34c7c068.js","assets/util-85d105b8.js","assets/util-38d8e238.js"])),DraftActivityCap:reactExports.lazy(()=>__vitePreload(()=>import("./DraftActivityCap-192dd31e.js"),["assets/DraftActivityCap-192dd31e.js","assets/util-85d105b8.js","assets/util-38d8e238.js"])),ContentInfoCap:reactExports.lazy(()=>__vitePreload(()=>import("./ContentInfoCap-9714f9ea.js"),["assets/ContentInfoCap-9714f9ea.js","assets/util-85d105b8.js","assets/util-38d8e238.js"]))}).current,bs=reactExports.useRef({SelectedCourse:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedCourse-77b69e89.js"),["assets/SelectedCourse-77b69e89.js","assets/ButtonGroup-9136da6d.js","assets/CourseToolHandler-8716455d.js","assets/index-67ec2c85.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js","assets/util-10e10a40.css","assets/SettingComponents-43f86399.js","assets/CollapseSection-cb27678a.js","assets/util-38d8e238.js","assets/DateTime-d0a20943.js","assets/moment-3cda1086.js","assets/DateTime-adf9b6b7.css","assets/DropdownMenu-f3593bed.js","assets/RelatedItems-33b68fba.js","assets/RoleDropdown-cce90708.js","assets/Textfield-9c1c2968.js","assets/ActionButton-e5ea2a2f.js","assets/ActionButtonGroup-f4ce05e4.js"])),GradeSettings:reactExports.lazy(()=>__vitePreload(()=>import("./GradeSettings-952c5c8f.js"),["assets/GradeSettings-952c5c8f.js","assets/DateTime-d0a20943.js","assets/moment-3cda1086.js","assets/DateTime-adf9b6b7.css","assets/IncrementMenu-2cdf9a4e.js"])),SelectedSection:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedSection-35fca7cc.js"),["assets/SelectedSection-35fca7cc.js","assets/ActionButton-e5ea2a2f.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/Textfield-9c1c2968.js"])),SelectedBank:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedBank-3ffbe0e5.js"),["assets/SelectedBank-3ffbe0e5.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/Textfield-9c1c2968.js","assets/ButtonGroup-9136da6d.js"])),SelectedDataSources:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedDataSources-d8015028.js"),["assets/SelectedDataSources-d8015028.js","assets/ActionButton-e5ea2a2f.js"])),SelectedActivity:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedActivity-979809e9.js"),["assets/SelectedActivity-979809e9.js","assets/SettingComponents-3306743d.js","assets/DateTime-d0a20943.js","assets/moment-3cda1086.js","assets/DateTime-adf9b6b7.css","assets/IncrementMenu-2cdf9a4e.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/RelatedItems-33b68fba.js","assets/ActionButtonGroup-f4ce05e4.js","assets/ActionButton-e5ea2a2f.js","assets/Textfield-9c1c2968.js","assets/useSaveDraft-5f9f3fe4.js","assets/EditorViewerRecoil-fb47fc9d.js","assets/ButtonGroup-9136da6d.js","assets/RoleDropdown-cce90708.js"])),SelectedOrder:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedOrder-51adfbf6.js"),["assets/SelectedOrder-51adfbf6.js","assets/ButtonGroup-9136da6d.js","assets/IncrementMenu-2cdf9a4e.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js"])),SelectedPage:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedPage-0dc42f25.js"),["assets/SelectedPage-0dc42f25.js","assets/Textfield-9c1c2968.js","assets/ButtonGroup-9136da6d.js","assets/ActionButton-e5ea2a2f.js","assets/ActionButtonGroup-f4ce05e4.js"])),SelectedPageLink:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedPageLink-d2df6ca3.js"),["assets/SelectedPageLink-d2df6ca3.js","assets/ActionButton-e5ea2a2f.js","assets/ActionButtonGroup-f4ce05e4.js","assets/Textfield-9c1c2968.js"])),SelectedCollectionLink:reactExports.lazy(()=>__vitePreload(()=>import("./SelectedCollectionLink-f07c6b63.js"),["assets/SelectedCollectionLink-f07c6b63.js","assets/ActionButton-e5ea2a2f.js","assets/Textfield-9c1c2968.js","assets/RelatedItems-33b68fba.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js"])),CreateCourse:reactExports.lazy(()=>__vitePreload(()=>import("./CreateCourse-d1fd4695.js"),["assets/CreateCourse-d1fd4695.js","assets/ButtonGroup-9136da6d.js"])),CourseEnroll:reactExports.lazy(()=>__vitePreload(()=>import("./CourseEnroll-14ae0e11.js"),["assets/CourseEnroll-14ae0e11.js","assets/ButtonGroup-9136da6d.js"])),AddDriveItems:reactExports.lazy(()=>__vitePreload(()=>import("./AddDriveItems-1dc7de35.js"),["assets/AddDriveItems-1dc7de35.js","assets/ButtonGroup-9136da6d.js"])),CutCopyPasteMenu:reactExports.lazy(()=>__vitePreload(()=>import("./CutCopyPasteMenu-faa24159.js"),["assets/CutCopyPasteMenu-faa24159.js","assets/ActionButton-e5ea2a2f.js","assets/ActionButtonGroup-f4ce05e4.js"])),EnrollStudents:reactExports.lazy(()=>__vitePreload(()=>import("./EnrollStudents-140e54f0.js"),["assets/EnrollStudents-140e54f0.js","assets/ButtonGroup-9136da6d.js"])),DoenetMLSettings:reactExports.lazy(()=>__vitePreload(()=>import("./DoenetMLSettings-6fadfc58.js"),["assets/DoenetMLSettings-6fadfc58.js","assets/index-67ec2c85.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/EditorViewerRecoil-fb47fc9d.js"])),VersionHistory:reactExports.lazy(()=>__vitePreload(()=>import("./VersionHistory-c8204d25.js"),["assets/VersionHistory-c8204d25.js","assets/CourseToolHandler-8716455d.js","assets/index-67ec2c85.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-9136da6d.js","assets/util-10e10a40.css","assets/RelatedItems-33b68fba.js","assets/EditorViewerRecoil-fb47fc9d.js"])),PageVariant:reactExports.lazy(()=>__vitePreload(()=>import("./PageVariant-897e2178.js"),[])),PageLink:reactExports.lazy(()=>__vitePreload(()=>import("./PageLink-be7f079d.js"),["assets/PageLink-be7f079d.js","assets/index-fcf36459.js","assets/ActionButton-e5ea2a2f.js","assets/EditorViewerRecoil-fb47fc9d.js"])),ActivityVariant:reactExports.lazy(()=>__vitePreload(()=>import("./ActivityVariant-755b56b5.js"),["assets/ActivityVariant-755b56b5.js","assets/IncrementMenu-2cdf9a4e.js"])),AutoSaves:reactExports.lazy(()=>__vitePreload(()=>import("./AutoSaves-759ac78c.js"),[])),LoadPeople:reactExports.lazy(()=>__vitePreload(()=>import("./LoadPeople-0fec718e.js"),["assets/LoadPeople-0fec718e.js","assets/index-a475a6f9.js","assets/ButtonGroup-9136da6d.js","assets/CollapseSection-cb27678a.js"])),GradeUpload:reactExports.lazy(()=>__vitePreload(()=>import("./GradeUpload-f7d9daba.js"),["assets/GradeUpload-f7d9daba.js","assets/index-a475a6f9.js","assets/GradebookAssignment-dd849113.js","assets/Gradebook-06d28967.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-9136da6d.js","assets/CollapseSection-cb27678a.js"])),GradeDownload:reactExports.lazy(()=>__vitePreload(()=>import("./GradeDownload-0b1ded25.js"),["assets/GradeDownload-0b1ded25.js","assets/Gradebook-06d28967.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js"])),ManualEnrollment:reactExports.lazy(()=>__vitePreload(()=>import("./ManualEnrollment-21e6c09a.js"),["assets/ManualEnrollment-21e6c09a.js","assets/LoadPeople-0fec718e.js","assets/index-a475a6f9.js","assets/ButtonGroup-9136da6d.js","assets/CollapseSection-cb27678a.js"])),AssignmentSettingsMenu:reactExports.lazy(()=>__vitePreload(()=>import("./AssignmentSettingsMenu-1ac5f65e.js"),["assets/AssignmentSettingsMenu-1ac5f65e.js","assets/SelectedActivity-979809e9.js","assets/SettingComponents-3306743d.js","assets/DateTime-d0a20943.js","assets/moment-3cda1086.js","assets/DateTime-adf9b6b7.css","assets/IncrementMenu-2cdf9a4e.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/RelatedItems-33b68fba.js","assets/ActionButtonGroup-f4ce05e4.js","assets/ActionButton-e5ea2a2f.js","assets/Textfield-9c1c2968.js","assets/useSaveDraft-5f9f3fe4.js","assets/EditorViewerRecoil-fb47fc9d.js","assets/ButtonGroup-9136da6d.js","assets/RoleDropdown-cce90708.js"])),SupportingFilesMenu:reactExports.lazy(()=>__vitePreload(()=>import("./SupportingFilesMenu-c25413f6.js"),["assets/SupportingFilesMenu-c25413f6.js","assets/ActionButtonGroup-f4ce05e4.js","assets/ActionButton-e5ea2a2f.js","assets/ButtonGroup-9136da6d.js","assets/CollapseSection-cb27678a.js","assets/index-67ec2c85.js","assets/index-fcf36459.js","assets/index-47ca4f11.js"])),GroupSettings:reactExports.lazy(()=>__vitePreload(()=>import("./GroupSettings-72cca280.js"),["assets/GroupSettings-72cca280.js","assets/index-a475a6f9.js","assets/ButtonGroup-9136da6d.js","assets/CollapseSection-cb27678a.js"])),TimerMenu:reactExports.lazy(()=>__vitePreload(()=>import("./TimerMenu-8d81de2c.js"),["assets/TimerMenu-8d81de2c.js","assets/CourseToolHandler-8716455d.js","assets/index-67ec2c85.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-9136da6d.js","assets/util-10e10a40.css","assets/AssignmentViewer-1be0d831.js","assets/ActivityViewer-becda8c0.js","assets/activityUtils-9c5f1536.js","assets/visibility-sensor-7d414852.js","assets/ActionButton-e5ea2a2f.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js"])),CreditAchieved:reactExports.lazy(()=>__vitePreload(()=>import("./CreditAchieved-619d3c15.js"),["assets/CreditAchieved-619d3c15.js","assets/AssignmentViewer-1be0d831.js","assets/ActivityViewer-becda8c0.js","assets/activityUtils-9c5f1536.js","assets/visibility-sensor-7d414852.js","assets/ActionButton-e5ea2a2f.js","assets/ButtonGroup-9136da6d.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/Textfield-9c1c2968.js","assets/Gradebook-06d28967.js"])),ActivityDates:reactExports.lazy(()=>__vitePreload(()=>import("./ActivityDates-1e5c21fa.js"),["assets/ActivityDates-1e5c21fa.js","assets/SettingComponents-3306743d.js","assets/DateTime-d0a20943.js","assets/moment-3cda1086.js","assets/DateTime-adf9b6b7.css","assets/IncrementMenu-2cdf9a4e.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/RelatedItems-33b68fba.js","assets/ActionButtonGroup-f4ce05e4.js","assets/ActionButton-e5ea2a2f.js","assets/Textfield-9c1c2968.js","assets/useSaveDraft-5f9f3fe4.js","assets/EditorViewerRecoil-fb47fc9d.js","assets/RoleDropdown-cce90708.js"])),ClassTimes:reactExports.lazy(()=>__vitePreload(()=>import("./ClassTimes-c6d63413.js"),["assets/ClassTimes-c6d63413.js","assets/Next7Days-ac4b7e6b.js","assets/CourseToolHandler-8716455d.js","assets/index-67ec2c85.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-9136da6d.js","assets/util-10e10a40.css","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/DateTime-d0a20943.js","assets/moment-3cda1086.js","assets/DateTime-adf9b6b7.css"])),CurrentContent:reactExports.lazy(()=>__vitePreload(()=>import("./CurrentContent-5c1a7444.js"),["assets/CurrentContent-5c1a7444.js","assets/Next7Days-ac4b7e6b.js","assets/CourseToolHandler-8716455d.js","assets/index-67ec2c85.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-9136da6d.js","assets/util-10e10a40.css","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js"])),ManageUsersMenu:reactExports.lazy(()=>__vitePreload(()=>import("./ManageUsersMenu-ca3ae540.js"),["assets/ManageUsersMenu-ca3ae540.js","assets/SettingComponents-43f86399.js","assets/CourseToolHandler-8716455d.js","assets/index-67ec2c85.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-9136da6d.js","assets/util-10e10a40.css","assets/CollapseSection-cb27678a.js","assets/util-38d8e238.js","assets/DateTime-d0a20943.js","assets/moment-3cda1086.js","assets/DateTime-adf9b6b7.css","assets/DropdownMenu-f3593bed.js","assets/RelatedItems-33b68fba.js","assets/RoleDropdown-cce90708.js","assets/Textfield-9c1c2968.js"]))}).current;let vs=null;if(fs){const Ts=bs[fs];if(Ts){const Ss=`SelectionMenu${fs}`;vs=jsx$1(SelectionMenu,{children:jsx$1(reactExports.Suspense,{fallback:jsx$1(LoadingFallback$1,{children:"loading..."}),children:React.createElement(Ts,{key:Ss})})},Ss)}}let xs=null;rs!==""&&(xs=jsx$1(MenuPanelsCapComponent,{children:jsx$1(reactExports.Suspense,{fallback:jsx$1(LoadingFallback$1,{children:"loading..."}),children:React.createElement(ys[rs])})}));for(let[Ts,Ss]of Object.entries(ss)){const Ns=`${Ss}`,As=ns[Ts];let ws=os[Ts];gs.push(jsx$1(Menu$1,{title:As,isInitOpen:ws,type:Ss,children:jsx$1(reactExports.Suspense,{fallback:jsx$1(LoadingFallback$1,{children:"loading..."}),children:React.createElement(bs[Ss],{mKey:Ns})})},Ns))}let Cs=null;return cs!="true"&&(Cs=jsx$1(SettingsButton,{onClick:()=>hs({page:"settings",tool:"",view:""}),children:jsx$1(FontAwesomeIcon,{icon:faCog})})),jsxs(MenuPanelsWrapper,{hide:as,"aria-label":"menus",children:[jsxs(MenuPanelsCap,{fix:as,role:"banner",children:[jsxs(Branding$1,{style:{marginLeft:"5px"},children:[jsx$1(Logo,{hasLink:cs!="true"}),jsx$1("p",{children:"Doenet"})]}),jsxs(IconsGroup,{children:[jsx$1(CheckboxButton,{checked:ds==="dark",onClick:()=>ps(ds==="dark"?"light":"dark"),checkedIcon:jsx$1(FontAwesomeIcon,{icon:faSun}),uncheckedIcon:jsx$1(FontAwesomeIcon,{icon:faMoon})}),Cs]}),jsx$1("span",{children:jsx$1(CloseButton$1,{onClick:()=>ls(!1),children:jsx$1(FontAwesomeIcon,{icon:faChevronLeft})})})]}),xs,vs,jsx$1("div",{children:gs})]})}function UTCDateStringToDate(as){if(!as||typeof as!="string")return null;let rs=as.split(/[- :]/);return new Date(Date.UTC(rs[0],rs[1]-1,rs[2],rs[3],rs[4],rs[5]))}function formatAMPM(as){var rs=as.getHours(),ns=as.getMinutes(),ss=rs>=12?"PM":"AM";rs=rs%12,rs=rs||12,ns=ns<10?"0"+ns:ns;var os=rs+":"+ns+" "+ss;return os}function DateToUTCDateString(as){var rs=function(ns){return("00"+ns).slice(-2)};return as.getUTCFullYear()+"-"+rs(as.getUTCMonth()+1)+"-"+rs(as.getUTCDate())+" "+rs(as.getUTCHours())+":"+rs(as.getUTCMinutes())+":"+rs(as.getUTCSeconds())}function DateToUTCDateWithoutSecondsString(as){var rs=function(ns){return("00"+ns).slice(-2)};return as.getUTCFullYear()+"-"+rs(as.getUTCMonth()+1)+"-"+rs(as.getUTCDate())+" "+rs(as.getUTCHours())+":"+rs(as.getUTCMinutes())}function DateToDateString(as){var rs=function(ns){return("00"+ns).slice(-2)};return as.getFullYear()+"-"+rs(as.getMonth()+1)+"-"+rs(as.getDate())+" "+rs(as.getHours())+":"+rs(as.getMinutes())+":"+rs(as.getSeconds())}function DateToDisplayDateString(as){var rs=function(ns){return("00"+ns).slice(-2)};return rs(as.getMonth()+1)+"/"+rs(as.getDate())+"/"+as.getFullYear()+" "+formatAMPM(as)}function useValidateEmail(){return reactExports.useCallback(rs=>/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(rs).toLowerCase()),[])}const fileByCid=Recoil_index_10({key:"fileByCid",default:Recoil_index_11({key:"fileByCid/Default",get:as=>async()=>{if(!as)return"";try{return(await axios.get(`/media/${as}.doenet`)).data}catch(rs){return rs.response?(console.log(rs.response.data),console.log(rs.response.status),console.log(rs.response.headers)):rs.request?console.log(rs.request):console.log("Error",rs.message),"Error Loading"}}})}),fileByPageId=Recoil_index_10({key:"fileByPageId",default:Recoil_index_11({key:"fileByPageId/Default",get:as=>async()=>{if(!as)return"";try{return(await axios.get(`/media/byPageId/${as}.doenet`)).data}catch(rs){return rs.response?(console.log(rs.response.data),console.log(rs.response.status),console.log(rs.response.headers)):rs.request?console.log(rs.request):console.log("Error",rs.message),"Error Loading"}}})}),peopleAtomByCourseId=Recoil_index_10({key:"peopleAtomByCourseId",default:Recoil_index_11({key:"peopleAtomByCourseId/Default",get:as=>async()=>{const{data:rs}=await axios.get("/api/loadCoursePeople.php",{params:{courseId:as}});return rs.success?rs.peopleArray:[]}})}),peopleByCourseId=Recoil_index_11({key:"peopleByCourseId",get:as=>({get:rs,getCallback:ns})=>{const ss=ns(({set:us})=>async cs=>{let ds={email:cs,courseId:as};try{let ps=await axios.post("/api/withDrawStudents.php",ds);if(ps.status<300)us(peopleAtomByCourseId(as),fs=>{let hs=[...fs];const gs=hs.findIndex(ys=>ys.email==cs);return hs[gs]={...fs[gs],withdrew:"1"},hs});else throw new Error(`response code: ${ps.status}`)}catch{}}),os=ns(({set:us})=>async cs=>{let ds={email:cs,courseId:as};try{let ps=await axios.post("/api/unWithDrawStudents.php",ds);if(ps.status<300)us(peopleAtomByCourseId(as),fs=>{let hs=[...fs];const gs=hs.findIndex(ys=>ys.email==cs);return hs[gs]={...fs[gs],withdrew:"0"},hs});else throw new Error(`response code: ${ps.status}`)}catch{}}),ls=ns(({set:us})=>async(cs,ds)=>{try{let{data:{success:ps,peopleArray:fs,message:hs}}=await axios.post("/api/mergePeopleData.php",{...cs,courseId:as});if(ps)us(peopleAtomByCourseId(as),fs),ds==null||ds();else throw new Error(hs)}catch{}});return{value:rs(peopleAtomByCourseId(as)),recoilWithdraw:ss,recoilUnWithdraw:os,recoilMergeData:ls}}});function buildDoenetIdToParentDoenetIdObj(as,rs=null){let ns={};for(let ss of as)(ss==null?void 0:ss.type)=="order"?ns={...buildDoenetIdToParentDoenetIdObj(ss.content,ss.doenetId),...ns}:rs!==null&&(ns[ss]=rs);return ns}function findFirstPageOfActivity(as=[]){let rs=null;for(let ns of as)if(typeof ns=="string"||ns instanceof String){rs=ns;break}else{let ss=findFirstPageOfActivity(ns.content);if(typeof ss=="string"||ss instanceof String){rs=ss;break}}return rs}function findOrderAndPageDoenetIdsAndSetOrderObjs({set:as,contentArray:rs,assignmentDoenetId:ns,orderDoenetId:ss=null}){let os=[];for(let ls of rs)if((ls==null?void 0:ls.type)=="order"){let us=ls.numberToSelect;us==null&&(us=1);let cs=ls.withReplacement;cs==null&&(cs=!1);let ds=ss;ss==null&&(ds=ns),as(itemByDoenetId(ls.doenetId),{type:"order",doenetId:ls.doenetId,behavior:ls.behavior,numberToSelect:us,withReplacement:cs,containingDoenetId:ns,isOpen:!1,isSelected:!1,parentDoenetId:ds}),os.push(ls.doenetId);let ps=findOrderAndPageDoenetIdsAndSetOrderObjs({set:as,contentArray:ls.content,assignmentDoenetId:ns,orderDoenetId:ls.doenetId});os=[...os,...ps]}else if((ls==null?void 0:ls.type)=="collectionLink"){let us=ss;ss==null&&(us=ns),as(itemByDoenetId(ls.doenetId),{type:"collectionLink",doenetId:ls.doenetId,containingDoenetId:ns,collectionDoenetId:ls.collectionDoenetId,isManuallyFiltered:ls.isManuallyFiltered,pages:ls.pages,pagesByCollectionSource:ls.pagesByCollectionSource,manuallyFilteredPages:ls.manuallyFilteredPages,timeOfLastUpdate:ls.timeOfLastUpdate,label:ls.label,isOpen:!1,isSelected:!1,parentDoenetId:us}),os.push(ls.doenetId);let cs=[...ls.pages];ls.isManuallyFiltered&&(cs=[...ls.manuallyFilteredPages]),os=[...os,...cs]}else os=[...os,ls];return os}function findPageDoenetIdsInAnOrder({content:as,needleOrderDoenetId:rs,foundNeedle:ns=!1}){let ss=[];for(let os of as)if((os==null?void 0:os.type)=="order"){let ls;ns||os.doenetId==rs?ls=findPageDoenetIdsInAnOrder({content:os.content,needleOrderDoenetId:rs,foundNeedle:!0}):ls=findPageDoenetIdsInAnOrder({content:os.content,needleOrderDoenetId:rs,foundNeedle:ns}),ss=[...ss,...ls]}else ns&&ss.push(os);return ss}function findCollectionLinksAndPageLinksInContentArray({content:as,needleOrderDoenentId:rs,foundNeedle:ns=!1}){let ss=[],os=[];for(let ls of as)if((ls==null?void 0:ls.type)=="order"){ls.doenetId==rs&&(ns=!0);let{pageLinkDoenetIds:us,collectionLinkDoenetIds:cs}=findCollectionLinksAndPageLinksInContentArray({content:ls.content,needleOrderDoenentId:rs,foundNeedle:ns});ss=[...ss,...us],os=[...os,...cs]}else(ls==null?void 0:ls.type)=="collectionLink"&&ns&&(ss=[...ss,...ls.pages],os=[...os,ls.doenetId]);return{pageLinkDoenetIds:ss,collectionLinkDoenetIds:os}}function findPageIdsInContentArray({content:as,needleOrderDoenetId:rs,foundNeedle:ns=!1}){let ss=[];for(let os of as)if((os==null?void 0:os.type)=="order"){let ls;ns||os.doenetId==rs?ls=findPageIdsInContentArray({content:os.content,needleOrderDoenetId:rs,foundNeedle:!0}):ls=findPageIdsInContentArray({content:os.content,needleOrderDoenetId:rs,foundNeedle:ns}),ss=[...ss,...ls]}else(os==null?void 0:os.type)!="collectionLink"&&ns&&ss.push(os);return ss}function localizeDates(as,rs){for(let ns of rs)as[ns]&&(as[ns]=UTCDateStringToDate(as[ns]).toLocaleString());return as}let dateKeys=["assignedDate","dueDate","pinnedAfterDate","pinnedUntilDate"];function useInitCourseItems(as){const rs=Recoil_index_31(({snapshot:ns,set:ss})=>async os=>{if(!os)return;if((await ns.getPromise(authorCourseItemOrderByCourseId(os))).length==0){ss(courseIdAtom,os);const{data:us}=await axios.get("/api/getCourseItems.php",{params:{courseId:os}});if(us.success){let cs={},ds=us.items.reduce((ps,fs)=>{if(fs.type!=="page"&&fs.type!=="pageLink"&&ps.push(fs.doenetId),fs.type==="activity"){let hs=buildDoenetIdToParentDoenetIdObj(fs.content,fs.doenetId);cs={...cs,...hs};let gs=findOrderAndPageDoenetIdsAndSetOrderObjs({set:ss,contentArray:fs.content,assignmentDoenetId:fs.doenetId});fs.isSinglePage||(ps=[...ps,...gs])}else fs.type==="bank"?(fs.pages.map(hs=>{cs[hs]=fs.doenetId}),ps=[...ps,...fs.pages]):fs.type==="page"&&(fs.parentDoenetId=cs[fs.doenetId]);return ss(itemByDoenetId(fs.doenetId),localizeDates(fs,dateKeys)),ps},[]);ss(authorCourseItemOrderByCourseId(os),ds)}}},[]);reactExports.useEffect(()=>{as&&rs(as)},[rs,as])}function useSetCourseIdFromDoenetId(as){const[rs,ns]=Recoil_index_22(itemByDoenetId(as)),ss=Recoil_index_24(courseIdAtom);reactExports.useEffect(()=>{Object.keys(rs).length>0||axios.get("/api/getCourseIdFromDoenetId.php",{params:{doenetId:as}}).then(({data:os})=>{os.success?(os.item&&ns(os.item),ss(os.courseId)):ss("__not_found__")}).catch(console.error)},[as])}const courseIdAtom=Recoil_index_8({key:"courseIdAtom",default:null}),authorCollectionsByCourseId=Recoil_index_11({key:"authorCollectionsByCourseId",get:as=>({get:rs})=>{let ns=rs(authorCourseItemOrderByCourseId(as)),ss=[];for(let os of ns){let ls=rs(itemByDoenetId(os));ls.type=="bank"&&ss.push({label:ls.label,doenetId:os})}return ss}}),authorCourseItemOrderByCourseId=Recoil_index_10({key:"authorCourseItemOrderByCourseId",default:[]}),authorCourseItemOrderByCourseIdBySection=Recoil_index_11({key:"authorCourseItemOrderByCourseIdBySection",get:({courseId:as,sectionId:rs})=>({get:ns})=>{let ss=ns(authorCourseItemOrderByCourseId(as));if(rs==as||!rs)return ss;let os=[],ls=!1,us=[rs];for(let cs of ss){if(cs==rs){ls=!0;continue}if(ls){let ds=ns(itemByDoenetId(cs));if(us.includes(ds.parentDoenetId))os.push(cs),ds.type!=="page"&&us.push(cs);else break}}return os}}),studentCourseItemOrderByCourseId=Recoil_index_11({key:"studentCourseItemOrderByCourseId",get:as=>({get:rs})=>rs(authorCourseItemOrderByCourseId(as)).filter(os=>{let ls=rs(itemByDoenetId(os));return ls.isAssigned&&(ls.type=="activity"||ls.type=="section")})}),studentCourseItemOrderByCourseIdBySection=Recoil_index_11({key:"studentCourseItemOrderByCourseId",get:({courseId:as,sectionId:rs})=>({get:ns})=>{let ss=ns(studentCourseItemOrderByCourseId(as)),os=[],ls=!1,us=[rs];(as==rs||!rs)&&(us=[as],ls=!0);for(let cs of ss){if(cs==rs){ls=!0;continue}if(ls){let ds=ns(itemByDoenetId(cs));if(ds.isAssigned&&us.includes(ds.parentDoenetId))os.push(cs),ds.type=="section"&&us.push(cs);else continue}}return os}}),itemByDoenetId=Recoil_index_10({key:"itemByDoenetId",default:{}}),coursePermissionsAndSettings=Recoil_index_8({key:"coursePermissionsAndSettings",default:[],effects:[async({setSelf:as,trigger:rs})=>{if(rs==="get"){const{data:ns}=await axios.get("/api/getCoursePermissionsAndSettings.php");as(ns.permissionsAndSettings)}}]}),coursePermissionsAndSettingsByCourseId=Recoil_index_11({key:"coursePermissionsAndSettingsByCourseId/Default",get:as=>({get:rs})=>rs(coursePermissionsAndSettings).find(ss=>ss.courseId==as)??{},set:as=>({set:rs},ns)=>{rs(coursePermissionsAndSettings,ss=>{const os=[...ss],ls=ss.findIndex(us=>us.courseId===as);return os[ls]={...ss[ls],...ns},os})}}),unfilteredCourseRolesByCourseId=Recoil_index_10({key:"unfilteredCourseRolesByCourseId",effects:as=>[async({setSelf:rs,trigger:ns})=>{if(ns==="get"){const{data:{roles:ss}}=await axios.get("/api/loadCourseRoles.php",{params:{courseId:as}});rs(ss)}}]}),courseRolesByCourseId=Recoil_index_11({key:"filteredCourseRolesByCourseId",get:as=>({get:rs})=>{const ns=rs(coursePermissionsAndSettingsByCourseId(as)),ss=rs(unfilteredCourseRolesByCourseId(as)),os=["isIncludedInGradebook","sectionPermissionOnly","dataAccessPermission","roleId","roleLabel"];return(ss==null?void 0:ss.filter(us=>us.roleId===ns.roleId||!Object.keys(us).every(ds=>(us[ds]??"0")===ns[ds]||os.includes(ds)||(us[ds]??"0")==="1"&&ns[ds]==="0")))??[]}}),courseRolePermissionsByCourseIdRoleId=Recoil_index_11({key:"courseRoleByCourseIdRoleId",get:({courseId:as,roleId:rs})=>({get:ns})=>{var ss;return((ss=ns(unfilteredCourseRolesByCourseId(as)))==null?void 0:ss.find(({roleId:os})=>os===rs))??{}}}),useCreateCourse=()=>({createCourse:Recoil_index_31(({set:rs})=>async()=>{let{data:{permissionsAndSettings:ns,courseId:ss,image:os,color:ls,...us}}=await axios.get("/api/createCourse.php");rs(coursePermissionsAndSettings,ns)})});Recoil_index_10({key:"courseOrderDataByCourseId",default:{completeOrder:[],orderingDataLookup:{}},effects:as=>[({setSelf:rs,onSet:ns,trigger:ss})=>{ns(({completeOrder:os},ls)=>{})}]});const selectedCourseItems=Recoil_index_8({key:"selectedCourseItems",default:[]}),copiedCourseItems=Recoil_index_8({key:"copiedCourseItems",default:[]}),cutCourseItems=Recoil_index_8({key:"cutCourseItems",default:[]});function findContentsChildIds(as){let rs=[];for(let ns of as)if((ns==null?void 0:ns.type)=="order"){let ss=findContentsChildIds(ns.content);rs=[...rs,ns.doenetId,...ss]}else if((ns==null?void 0:ns.type)=="collectionLink"){let ss=[];rs=[...rs,ns.doenetId,...ss]}else rs.push(ns);return rs}const useCourse=as=>{const{label:rs,color:ns,image:ss,defaultRoleId:os,canAutoEnroll:ls}=Recoil_index_20(coursePermissionsAndSettingsByCourseId(as)),us=useToast();function cs({content:Us,needleOrderDoenetId:js,createdItemType:Ls,createdPageDonenetId:Gs=null,createdOrderObj:Hs=null,createdCollectionLink:Ys=null}){let Zs=[...Us],Nl;for(let[yl,Dl]of Object.entries(Us)){if((Dl==null?void 0:Dl.doenetId)==js){let Rl={...Dl};if(Nl=Rl.doenetId,Rl.content.length>0&&(Nl=Rl.content[Rl.content.length-1]),(Nl==null?void 0:Nl.type)=="order"){let Ml=findContentsChildIds(Dl.content);Nl=Nl.doenetId,Ml.length>0&&(Nl=Ml[Ml.length-1])}return Ls=="page"?Rl.content=[...Rl.content,Gs]:Ls=="order"?Rl.content=[...Rl.content,{...Hs}]:Ls=="collectionLink"&&(Rl.content=[...Rl.content,{...Ys}]),Zs.splice(yl,1,Rl),{newContent:Zs,insertedAfterDoenetId:Nl}}if((Dl==null?void 0:Dl.type)=="order"){let{newContent:Rl,insertedAfterDoenetId:Ml}=cs({content:Dl.content,needleOrderDoenetId:js,createdItemType:Ls,createdPageDonenetId:Gs,createdOrderObj:Hs,createdCollectionLink:Ys});if(Rl!=null){let Ks={...Dl};return Ks.content=Rl,Zs.splice(yl,1,Ks),{newContent:Zs,insertedAfterDoenetId:Ml}}}}return{newContent:null,insertedAfterDoenetId:null}}function ds({activityOrOrderObj:Us,needleOrderOrActivityId:js,itemToAdd:Ls}){let Gs=[...Us.content];if(Us.doenetId==js){let Hs=Us.doenetId;return Us.content.length>0&&(Hs=Gs[Gs.length-1],(Hs==null?void 0:Hs.type)=="order"&&(Hs=Hs.doenetId)),Gs=[...Gs,Ls],{content:Gs,previousDoenetId:Hs}}for(let[Hs,Ys]of Object.entries(Us.content))if((Ys==null?void 0:Ys.type)=="order"){let{content:Zs,previousDoenetId:Nl}=ds({activityOrOrderObj:Ys,needleOrderOrActivityId:js,itemToAdd:Ls});if(Zs!=null){let yl={...Ys};return yl.content=Zs,Gs.splice(Hs,1,yl),{content:Gs,previousDoenetId:Nl}}}return{content:null,previousDoenetId:null}}const ps=reactExports.useCallback(Us=>{us(`${Us}`,toastType.ERROR)},[us]),fs=Recoil_index_31(({set:Us,snapshot:js})=>async({itemType:Ls,parentDoenetId:Gs,previousDoenetId:Hs,previousContainingDoenetId:Ys},Zs,Nl=ps)=>{let Dl=[...await js.getPromise(authorCourseItemOrderByCourseId(as))],Rl=await js.getPromise(searchParamAtomFamily("sectionId"));Rl==""&&(Rl=as);let Ml=await js.getPromise(selectedCourseItems);if(Ml.length==1){let Qs=Ml[0],Js=await js.getPromise(itemByDoenetId(Qs));if(Js.type=="section"){let El=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Qs})),_l=El[El.length-1];if(Gs=Qs,Hs=_l,!_l)Hs=Qs,Ys=Qs;else{let Xs=await js.getPromise(itemByDoenetId(_l));Hs=_l,Xs.type=="page"||Xs.type=="order"?Ys=Xs.containingDoenetId:(Xs.type=="bank"||Xs.type=="section")&&(Ys=_l)}}else if(Js.type=="activity"||Js.type=="bank"){Gs=Js.parentDoenetId,Ls=="page"&&Js.type=="bank"&&(Gs=Js.doenetId,console.log("page in a bank parentDoenetId:",Gs));let El=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Gs})),_l=Gs;if(El.length>0){_l=El[El.length-1];let Xs=await js.getPromise(itemByDoenetId(_l));Hs=_l,Xs.type=="page"||Xs.type=="order"?Ys=Xs.containingDoenetId:(Xs.type=="bank"||Xs.type=="section")&&(Ys=_l)}else Hs=Gs,Ys=Js.parentDoenetId}else if(Js.type=="page"||Js.type=="order"){Gs=(await js.getPromise(itemByDoenetId(Js.containingDoenetId))).parentDoenetId;let _l=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Gs})),Xs=_l[_l.length-1],xl=await js.getPromise(itemByDoenetId(Xs));Hs=Xs,xl.type=="page"||xl.type=="order"?Ys=xl.containingDoenetId:(xl.type=="bank"||xl.type=="section")&&(Ys=Xs)}}if(Hs==null){console.log("not a single selection!!!!!");let Qs=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Rl})),Js=Qs[Qs.length-1];if(Gs=Rl,Js==null)Hs=Rl,Ys=Rl;else{Hs=Js;let El=await js.getPromise(itemByDoenetId(Js));El.type=="page"||El.type=="order"||El.type=="collectionLink"||El.type=="pageLink"?Ys=El.containingDoenetId:(El.type=="activity"||El.type=="bank"||El.type=="section")&&(Ys=El.doenetId)}}console.log("WHERE IS IT GOING?"),console.log("itemType",Ls),console.log("parentDoenetId",Gs),console.log("previousDoenetId",Hs),console.log("previousContainingDoenetId",Ys);let Ks;if((await js.getPromise(coursePermissionsAndSettingsByCourseId(as))).canEditContent!="1")return null;if(Ls=="activity"){let{data:Qs}=await axios.post("/api/createCourseItem.php",{previousContainingDoenetId:Ys,courseId:as,itemType:Ls,parentDoenetId:Gs}),Js=Qs.doenetId;Ks=Js;let El={timeLimit:null,numberOfAttemptsAllowed:null,totalPointsOrPercent:null,individualize:!1,showSolution:!0,showSolutionInGradebook:!0,showFeedback:!0,showHints:!0,showCorrectness:!0,showCreditAchievedMenu:!0,paginate:!0,showFinishButton:!1,proctorMakesAvailable:!1,autoSubmit:!1,pinnedAfterDate:null,pinnedUntilDate:null,canViewAfterCompleted:"1",...Qs.itemEntered};Us(itemByDoenetId(Js),El);let _l={...Qs.pageEntered,parentDoenetId:Js};Us(itemByDoenetId(Qs.pageDoenetId),_l);let Xs=Dl.indexOf(Hs);Xs==-1?Dl.push(Js):Dl.splice(Xs+1,0,Js),Us(authorCourseItemOrderByCourseId(as),Dl)}else if(Ls=="bank"){let{data:Qs}=await axios.post("/api/createCourseItem.php",{previousContainingDoenetId:Ys,courseId:as,itemType:Ls,parentDoenetId:Gs});console.log("bankData",Qs),Ks=Qs.doenetId,Us(itemByDoenetId(Qs.doenetId),Qs.itemEntered);let Js=Dl.indexOf(Hs);Js==-1?Dl.push(Qs.doenetId):Dl.splice(Js+1,0,Qs.doenetId),Us(authorCourseItemOrderByCourseId(as),Dl)}else if(Ls=="section"){let{data:Qs}=await axios.post("/api/createCourseItem.php",{previousContainingDoenetId:Ys,courseId:as,itemType:Ls,parentDoenetId:Gs});Ks=Qs.doenetId,Us(itemByDoenetId(Qs.doenetId),Qs.itemEntered);let Js=Dl.indexOf(Hs);Js==-1?Dl.push(Qs.doenetId):Dl.splice(Js+1,0,Qs.doenetId),Us(authorCourseItemOrderByCourseId(as),Dl)}else if(Ls=="page"||Ls=="order"||Ls=="collectionLink"){let Qs=(await js.getPromise(selectedCourseItems))[0];const Js=await js.getPromise(itemByDoenetId(Qs));let El;Js.type=="activity"||Js.type=="bank"?El=Js.doenetId:(Js.type=="order"||Js.type=="page")&&(El=Js.containingDoenetId);let{data:_l}=await axios.get("/api/createPageOrOrder.php",{params:{courseId:as,itemType:Ls,containingDoenetId:El}}),{pageThatWasCreated:Xs,orderDoenetIdThatWasCreated:xl,collectionAliasDoenetIdThatWasCreated:Al}=_l,Fs={type:"order",behavior:"sequence",numberToSelect:1,withReplacement:!1,content:[],doenetId:xl},Cl={type:"collectionLink",doenetId:Al,collectionDoenetId:null,isManuallyFiltered:!1,pages:[],manuallyFilteredPages:[],pagesByCollectionSource:{object:!0},timeOfLastUpdate:null,label:"Untitled Collection Link"};if(Js.type=="activity"){let Tl={...Js.content};Ls=="page"?(Xs.parentDoenetId=Js.doenetId,Tl=[...Js.content,Xs.doenetId]):Ls=="order"?Tl=[...Js.content,Fs]:Ls=="collectionLink"&&(Tl=[...Js.content,Cl]);let zl={...Js};zl.content=Tl;let Xl=!1;zl.isSinglePage&&(Xl=!0,zl.isSinglePage=!1),await axios.post("/api/updateActivityStructure.php",{courseId:as,doenetId:zl.doenetId,newJSON:Tl,makeMultiPage:Xl}),Us(itemByDoenetId(zl.doenetId),zl),Ls=="page"?Us(itemByDoenetId(Xs.doenetId),Xs):Ls=="order"?(Fs={...Fs,isOpen:!1,isSelected:!1,containingDoenetId:Js.doenetId,parentDoenetId:Js.doenetId},Us(itemByDoenetId(Fs.doenetId),Fs)):Ls=="collectionLink"&&(Cl={...Cl,isOpen:!1,isSelected:!1,containingDoenetId:Js.doenetId,parentDoenetId:Js.doenetId},Us(itemByDoenetId(Cl.doenetId),Cl));let Pl=findContentsChildIds(Js.content),Bl=findContentsChildIds(Tl);Us(authorCourseItemOrderByCourseId(as),Wl=>{let Ll=[...Wl];return Xl||Ll.splice(Ll.indexOf(Js.doenetId)+1,Pl.length),Ll.splice(Ll.indexOf(Js.doenetId)+1,0,...Bl),Ll})}else if(Js.type=="bank"){let Tl=Js.pages[Js.pages.length-1];Js.pages.length==0&&(Tl=Js.doenetId),Xs.parentDoenetId=Js.doenetId;let zl=[...Js.pages,Xs.doenetId],Xl={...Js};Xl.pages=zl,await axios.post("/api/updateCollectionStructure.php",{courseId:as,doenetId:Xl.doenetId,newJSON:zl}),Us(itemByDoenetId(Xs.doenetId),Xs),Us(itemByDoenetId(Xl.doenetId),Xl),Us(authorCourseItemOrderByCourseId(as),Pl=>{let Bl=[...Pl];return Bl.splice(Bl.indexOf(Tl)+1,0,Xs.doenetId),Bl})}else if(Js.type=="order"){let Tl=Js.doenetId,zl=null;Ls=="page"?Xs&&(Xs.parentDoenetId=Tl):Ls=="collectionLink"&&(zl=Cl);const Xl=await js.getPromise(itemByDoenetId(Js.containingDoenetId));let{newContent:Pl,insertedAfterDoenetId:Bl}=cs({content:Xl.content,needleOrderDoenetId:Tl,createdItemType:Ls,createdPageDonenetId:Xs==null?void 0:Xs.doenetId,createdOrderObj:Fs,createdCollectionLink:zl}),Wl={...Xl};Wl.content=Pl,await axios.post("/api/updateActivityStructure.php",{courseId:as,doenetId:Wl.doenetId,newJSON:Pl}),Us(itemByDoenetId(Wl.doenetId),Wl);let Ll;Ls=="page"?(Us(itemByDoenetId(Xs.doenetId),Xs),Ll=Xs.doenetId):Ls=="order"?(Fs.isOpen=!1,Fs.isSelected=!1,Fs.containingDoenetId=Js==null?void 0:Js.containingDoenetId,Fs.parentDoenetId=Js==null?void 0:Js.doenetId,Us(itemByDoenetId(Fs.doenetId),Fs),Ll=xl):Ls=="collectionLink"&&(Cl.isOpen=!1,Cl.isSelected=!1,Cl.containingDoenetId=Js==null?void 0:Js.containingDoenetId,Cl.parentDoenetId=Js==null?void 0:Js.doenetId,Us(itemByDoenetId(Cl.doenetId),Cl),Ll=Al),Us(authorCourseItemOrderByCourseId(as),Hl=>{let Ql=[...Hl];return Ql.splice(Ql.indexOf(Bl)+1,0,Ll),Ql})}else if(Js.type=="page"){Xs&&(Xs.parentDoenetId=Js.parentDoenetId);const Tl=await js.getPromise(itemByDoenetId(Js.containingDoenetId));if(Tl.type=="bank"){let zl=Tl.pages[Tl.pages.length-1],Xl=[...Tl.pages,Xs.doenetId],Pl={...Tl};Pl.pages=Xl,await axios.post("/api/updateCollectionStructure.php",{courseId:as,doenetId:Pl.doenetId,newJSON:Xl}),Us(itemByDoenetId(Xs.doenetId),Xs),Us(itemByDoenetId(Pl.doenetId),Pl),Us(authorCourseItemOrderByCourseId(as),Bl=>{let Wl=[...Bl];return Wl.splice(Wl.indexOf(zl)+1,0,Xs.doenetId),Wl})}else if(Tl.type=="activity"){let zl,Xl;Ls=="page"?{content:Xl,previousDoenetId:zl}=ds({activityOrOrderObj:Tl,needleOrderOrActivityId:Js.parentDoenetId,itemToAdd:Xs==null?void 0:Xs.doenetId}):Ls=="order"&&({content:Xl,previousDoenetId:zl}=ds({activityOrOrderObj:Tl,needleOrderOrActivityId:Js.parentDoenetId,itemToAdd:Fs})),await axios.post("/api/updateActivityStructure.php",{courseId:as,doenetId:Tl.doenetId,newJSON:Xl});let Pl={...Tl};Pl.content=Xl,Fs.isOpen=!1,Fs.isSelected=!1,Fs.containingDoenetId=Js==null?void 0:Js.containingDoenetId,Fs.parentDoenetId=Js==null?void 0:Js.parentDoenetId;let Bl;Ls=="page"?(Us(itemByDoenetId(Xs.doenetId),Xs),Bl=Xs.doenetId):Ls=="order"&&(Us(itemByDoenetId(Fs.doenetId),Fs),Bl=xl),Us(itemByDoenetId(Pl.doenetId),Pl),Us(authorCourseItemOrderByCourseId(as),Wl=>{let Ll=[...Wl];return Ll.splice(Ll.indexOf(zl)+1,0,Bl),Ll})}}}return Ks}),hs=Recoil_index_31(({set:Us})=>async(js,Ls,Gs=ps)=>{try{let Hs=await axios.post("/api/modifyCourse.php",{courseId:as,...js});if(Hs.status<300)Us(coursePermissionsAndSettingsByCourseId(as),({prev:Ys})=>({...Ys,...js})),Ls==null||Ls();else throw new Error(`response code: ${Hs.status}`)}catch(Hs){Gs(Hs.message)}}),gs=useValidateEmail(),ys=Recoil_index_31(({set:Us})=>async(js,Ls,Gs,Hs=ps)=>{try{if(!gs(js))throw new Error("Invalid email, try again");const{data:{success:Ys,message:Zs,userData:Nl}}=await axios.post("/api/addCourseUser.php",{courseId:as,email:js,...Ls});if(Ys)Us(peopleAtomByCourseId(as),yl=>[...yl,{...Nl}]),Gs(Zs);else throw new Error(Zs)}catch(Ys){Hs(Ys.message)}}),bs=Recoil_index_31(({set:Us})=>async(js,Ls,Gs,Hs=ps)=>{try{const{data:{success:Ys,message:Zs}}=await axios.post("/api/updateUserRole.php",{courseId:as,userEmail:js,roleId:Ls});if(Ys)Us(peopleAtomByCourseId(as),Nl=>{const yl=Nl.slice(0),Dl=Nl.findIndex(({email:Rl})=>Rl===js);return yl[Dl]={...Nl[Dl],roleId:Ls},yl}),Gs();else throw new Error(Zs)}catch(Ys){Hs(Ys.message)}}),vs=Recoil_index_31(({set:Us})=>async(js,Ls,Gs,Hs=ps)=>{try{const{data:{success:Ys,message:Zs,actionType:Nl,roleId:yl,updatedPermissions:Dl}}=await axios.post("/api/updateRolePermissions.php",{courseId:as,roleId:js,permissions:{...Ls,label:Ls==null?void 0:Ls.roleLabel}});if(Ys)Us(unfilteredCourseRolesByCourseId(as),Rl=>{const Ml=[...Rl],Ks=Rl.findIndex(({roleId:Qs})=>Qs===yl);let{label:qs}=Dl;switch(qs===void 0&&(qs=Rl[Ks].roleLabel),Nl){case"add":Ml.push({...Dl,roleLabel:qs,roleId:yl});break;case"update":Ml.splice(Ks,1,{...Rl[Ks],...Dl,roleLabel:qs});break;case"delete":Ml.splice(Ks,1);break}return Ml}),Gs();else throw new Error(Zs)}catch(Ys){Hs(Ys.message)}},[as,ps]),xs=Recoil_index_31(({set:Us})=>async(js,Ls=ps)=>{try{let Gs=await axios.post("/api/deleteCourse.php",{courseId:as});if(Gs.status<300)Us(coursePermissionsAndSettings,Hs=>Hs.filter(Ys=>Ys.courseId!==as)),js==null||js();else throw new Error(`response code: ${Gs.status}`)}catch(Gs){Ls(Gs.message)}},[as,ps]),Cs=Recoil_index_31(({set:Us})=>async({dateDifference:js,newLabel:Ls},Gs,Hs=ps)=>{try{let Ys=await axios.post("/api/duplicateCourse.php",{courseId:as,dateDifference:js,newLabel:Ls});if(Ys.status<300)Us(coursePermissionsAndSettings,Ys.data.permissionsAndSettings),Gs==null||Gs();else throw new Error(`response code: ${Ys.status}`)}catch(Ys){Hs(Ys.message)}},[as,ps]),Ts=Recoil_index_31(({snapshot:Us,set:js})=>async(Ls,Gs,Hs,Ys=ps)=>{try{let Zs=await Us.getPromise(cutCourseItems);for(let Dl of Zs)js(itemByDoenetId(Dl.doenetId),Rl=>{let Ml={...Rl};return Ml.isBeingCut=!1,Ml});js(cutCourseItems,[]),js(copiedCourseItems,[]);let Nl=await Us.getPromise(itemByDoenetId(Ls)),yl=await axios.get("/api/renameCourseItem.php",{params:{courseId:as,doenetId:Ls,newLabel:Gs,type:Nl.type}});if(yl.status<300){let Dl=yl.data.item;Nl.type!=="page"&&(Dl.isOpen=Nl.isOpen),js(itemByDoenetId(Ls),Rl=>{let Ml={...Rl};return Ml.label=Dl.label,Ml}),Hs==null||Hs()}else throw new Error(`response code: ${yl.status}`)}catch(Zs){Ys(Zs.message)}},[as,ps]),Ss=Recoil_index_31(({set:Us})=>async({doenetId:js,isAssigned:Ls,successCallback:Gs,failureCallback:Hs=ps})=>{try{let Ys=await axios.get("/api/updateIsAssignedOnAnItem.php",{params:{courseId:as,doenetId:js,isAssigned:Ls}});if(Ys.status<300)Us(itemByDoenetId(js),Zs=>{let Nl={...Zs};return Nl.isAssigned=Ls,Nl}),Gs==null||Gs();else throw new Error(`response code: ${Ys.status}`)}catch(Ys){Hs(Ys.message)}},[as,ps]),Ns=Recoil_index_31(({set:Us,snapshot:js})=>async({activityDoenetId:Ls,successCallback:Gs,isAssigned:Hs=!1,courseId:Ys,failureCallback:Zs=ps})=>{async function Nl({order:Qs,indentLevel:Js=1}){let _l=["behavior","numberToSelect","withReplacement"].filter(Al=>Al in Qs).map(Al=>`${Al}="${Qs[Al]}"`).join(" "),Xs=(await Promise.all(Qs.content.map(Al=>yl({content:Al,indentLevel:Js+1})))).join(""),xl=" ".repeat(Js);return`${xl} ${Xs}${xl} `}async function yl({content:Qs,indentLevel:Js=1}){if(Qs.type==="order")return await Nl({order:Qs,indentLevel:Js});if(Qs.type==="collectionLink")return(await Promise.all(Qs.pages.map(El=>Dl({pageDoenetId:El,indentLevel:Js+1})))).join("");if(typeof Qs=="string")return await Dl({pageDoenetId:Qs,indentLevel:Js});throw Error("Invalid activity definition: content must be an order or a doenetId specifying a page")}async function Dl({pageDoenetId:Qs,indentLevel:Js=1}){let El=" ".repeat(Js),{data:_l}=await axios.get(`/media/byPageId/${Qs}.doenet`);_l=_l.toString();let Xs={doenetML:_l,pageId:Qs,courseId:Ys,saveAsCid:!0};const{data:xl}=await axios.post("/api/saveDoenetML.php",Xs);if(!xl.success)throw Error(xl.message);let Al=xl.cid;return Us(fileByCid(Al),_l),`${El} `}let Rl=await js.getPromise(itemByDoenetId(Ls)),Ml=` xmlns="https://doenet.org/spec/doenetml/v${Rl.version}" type="activity"`;Rl.itemWeights&&(Ml+=` itemWeights = "${Rl.itemWeights.join(" ")}"`),Rl.shuffleItemWeights&&(Ml+=" shuffleItemWeights"),Rl.numberOfVariants!==void 0&&(Ml+=` numberOfVariants="${Rl.numberOfVariants}"`),Rl.isSinglePage&&(Ml+=" isSinglePage");let Ks="";try{Ks=(await Promise.all(Rl.content.map(Qs=>yl({content:Qs,indentLevel:1})))).join("")}catch(Qs){Zs(Qs.message)}let qs=` -${Ks}`;try{let Qs=await axios.post("/api/saveCompiledActivity.php",{courseId:Ys,doenetId:Ls,isAssigned:Hs,activityDoenetML:qs});if(Qs.status<300){let{success:Js,message:El,cid:_l,assignmentSettings:Xs}=Qs.data,xl="draftCid";Hs&&(xl="assignedCid"),Us(itemByDoenetId(Ls),Al=>{let Sl={...Al};return Sl[xl]=_l,Hs&&Object.assign(Sl,localizeDates(Xs,dateKeys)),Sl}),Gs==null||Gs()}else throw new Error(`response code: ${Qs.status}`)}catch(Qs){Zs(Qs.message)}});function As({content:Us,needleDoenetId:js,changesObj:Ls}){let Gs=[...Us];for(let[Hs,Ys]of Object.entries(Us))if((Ys==null?void 0:Ys.type)=="order"){if(js==Ys.doenetId){let Nl={...Ys};return Object.assign(Nl,Ls),Gs.splice(Hs,1,Nl),Gs}let Zs=As({content:Ys.content,needleDoenetId:js,changesObj:Ls});if(Zs!=null){let Nl={...Ys};return Nl.content=Zs,Gs.splice(Hs,1,Nl),Gs}}return null}function ws({content:Us,needleDoenetId:js,changesObj:Ls}){let Gs=[...Us];for(let[Hs,Ys]of Object.entries(Us)){if((Ys==null?void 0:Ys.type)=="collectionLink"&&js==Ys.doenetId){let Zs={...Ys};return Object.assign(Zs,Ls),Gs.splice(Hs,1,Zs),Gs}if((Ys==null?void 0:Ys.type)=="order"){let Zs=ws({content:Ys.content,needleDoenetId:js,changesObj:Ls});if(Zs!=null){let Nl={...Ys};return Nl.content=Zs,Gs.splice(Hs,1,Nl),Gs}}}return null}function Es({content:Us,needleDoenetId:js}){let Ls=[...Us],Gs=null;for(let[Hs,Ys]of Object.entries(Us))if((Ys==null?void 0:Ys.type)=="order"){let Zs=Es({content:Ys.content,needleDoenetId:js});if(Zs!=null){let Nl={...Ys};return Nl.content=Zs,Ls.splice(Hs,1,Nl),Ls}}else if(js==Ys){Gs=Hs;break}return Gs!=null?(Ls.splice(Gs,1),Ls):null}function _s({content:Us,needleDoenetId:js}){let Ls=[...Us],Gs=null;for(let[Hs,Ys]of Object.entries(Us))if((Ys==null?void 0:Ys.type)=="order"){if(js==Ys.doenetId){Gs=Hs;break}let Zs=_s({content:Ys.content,needleDoenetId:js});if(Zs!=null){let Nl={...Ys};return Nl.content=[...Zs],Ls.splice(Hs,1,Nl),Ls}}return Gs!=null?(Ls.splice(Gs,1),Ls):null}function $s({content:Us,needleDoenetId:js}){let Ls=[...Us],Gs=null;for(let[Hs,Ys]of Object.entries(Us)){if(js==Ys.doenetId){Gs=Hs;break}if((Ys==null?void 0:Ys.type)=="order"){let Zs=$s({content:Ys.content,needleDoenetId:js});if(Zs!=null){let Nl={...Ys};return Nl.content=[...Zs],Ls.splice(Hs,1,Nl),Ls}}}return Gs!=null?(Ls.splice(Gs,1),Ls):null}function Rs({content:Us,needleOrderDoenetId:js,foundNeedle:Ls=!1}){let Gs=[];for(let Hs of Us)if((Hs==null?void 0:Hs.type)=="order"){let Ys;Ls||Hs.doenetId==js?(Gs.push(Hs.doenetId),Ys=Rs({content:Hs.content,needleOrderDoenetId:js,foundNeedle:!0})):Ys=Rs({content:Hs.content,needleOrderDoenetId:js,foundNeedle:Ls}),Gs=[...Gs,...Ys]}return Gs}const Ds=Recoil_index_31(({set:Us,snapshot:js})=>async({courseId:Ls,doenetId:Gs,label:Hs,collectionDoenetId:Ys,isManuallyFiltered:Zs,manuallyFilteredPages:Nl=[],successCallback:yl,failureCallback:Dl=ps})=>{let Rl=await js.getPromise(itemByDoenetId(Gs));Hs||(Hs=Rl.label);let Ml=Rl.pages;const Ks=Rl.containingDoenetId;let qs=await js.getPromise(itemByDoenetId(Ks)),Qs=Rl.timeOfLastUpdate;if(Ys!==Rl.collectionDoenetId&&!Rl.pagesByCollectionSource[Ys]){Qs=new Date;let{data:Al}=await axios.post("/api/createPageLinks.php",{courseId:Ls,containingDoenetId:Ks,collectionDoenetId:Ys,parentDoenetId:Gs});Ml=Object.keys(Al.linkPageObjs);for(let Sl of Ml){let Vl=Al.linkPageObjs[Sl].sourcePage,Fs=Al.linkPageObjs[Sl].nextLabel,Cl={type:"pageLink",doenetId:Sl,sourcePageDoenetId:Vl,containingDoenetId:Ks,parentDoenetId:Gs,isSelected:!1,label:Fs,timeOfLastUpdate:new Date};Us(itemByDoenetId(Sl),Cl)}}let Js={label:Hs,collectionDoenetId:Ys,isManuallyFiltered:Zs,pages:Ml,manuallyFilteredPages:Nl,pagesByCollectionSource:{...Rl.pagesByCollectionSource},timeOfLastUpdate:Qs},El=[],_l=[...Rl.pages];Ys!==Rl.collectionDoenetId?Rl.pagesByCollectionSource[Ys]?(El=[...Rl.pagesByCollectionSource[Ys]],Ml=[...Rl.pagesByCollectionSource[Ys]]):(El=[...Ml],Js.pagesByCollectionSource[Ys]=[...Ml]):!Rl.isManuallyFiltered&&Zs?(Ml=[...Rl.manuallyFilteredPages],Nl=[...Rl.manuallyFilteredPages]):Rl.isManuallyFiltered&&!Zs?(El=[...Rl.pagesByCollectionSource[Rl.collectionDoenetId]],Ml=[...Rl.pagesByCollectionSource[Rl.collectionDoenetId]]):(Rl.manuallyFilteredPages.length!=Nl.length||Rl.manuallyFilteredPages[0]!=Nl[0])&&(El=[...Nl],Ml=[...Nl]),Js.pages=Ml,Us(authorCourseItemOrderByCourseId(Ls),Al=>{let Sl=[...Al],Vl=Sl.indexOf(Gs);return Sl.splice(Vl+1,_l.length,...El),Sl});let Xs=ws({content:qs.content,needleDoenetId:Gs,changesObj:Js});await axios.post("/api/updateActivityStructure.php",{courseId:Ls,doenetId:Rl.containingDoenetId,newJSON:Xs});let xl={...qs};xl.content=Xs,Us(itemByDoenetId(Rl.containingDoenetId),xl),Us(itemByDoenetId(Gs),Al=>{let Sl={...Al};return Sl.isManuallyFiltered=Zs,Sl.collectionDoenetId=Ys,Sl.pages=[...Ml],Sl.manuallyFilteredPages=[...Nl],Sl.pagesByCollectionSource=Js.pagesByCollectionSource,Hs?Sl.label=Hs:Sl.label=Al.label,Sl})});function Os({content:Us,updateCollectionLink:js}){let Ls=js.doenetId,Gs=[];for(let Hs of Us){if((Hs==null?void 0:Hs.type)=="order"){let Ys=Os({content:Hs.content,updateCollectionLink:js}),Zs={...Hs};Zs.content=Ys,Hs=Zs}else(Hs==null?void 0:Hs.doenetId)==Ls&&(Hs=js);Gs.push(Hs)}return Gs}const Is=Recoil_index_31(({set:Us,snapshot:js})=>async({collectionLinkObj:Ls,pages:Gs,failureCallback:Hs=ps})=>{let Ys=new Date;if(Ls){let Nl=(await js.getPromise(itemByDoenetId(Ls.collectionDoenetId))).pages,yl=[],Dl=[];for(let Sl of Gs){let Vl=await js.getPromise(itemByDoenetId(Sl));yl.push(Vl.sourcePageDoenetId)}let Rl=[];for(let Sl of Nl)if(!yl.includes(Sl)){Rl.push(Sl);let Vl=await js.getPromise(itemByDoenetId(Sl));Dl.push(Vl.label)}let Ml=[],Ks=[];for(let[Sl,Vl]of Object.entries(yl))Nl.includes(Vl)||(Ks.push(Vl),Ml.push(Gs[Sl]));let{data:qs}=await axios.post("/api/updateCreateAndDeletePageLinks.php",{courseId:as,containingDoenetId:Ls.containingDoenetId,parentDoenetId:Ls.doenetId,sourceCollectionDoenetId:Ls.collectionDoenetId,newSourcePageDoenetIds:Rl,pageLinksToDelete:Ml,labels:Dl});for(let[Sl,Vl]of Object.entries(qs.linkPagesDoenetIds)){let Fs=qs.nextLabels[Sl];Us(itemByDoenetId(Vl),Cl=>{let Tl={...Cl};return Tl.timeOfLastUpdate=Ys,Tl.label=Fs,Tl})}let Qs={};for(let[Sl,Vl]of Object.entries(Object.keys(qs.linkPageObjs))){let Fs={...qs.linkPageObjs[Vl]};Fs.containingDoenetId=Ls.containingDoenetId,Fs.doenetId=Vl,Fs.parentDoenetId=Ls.doenetId,Fs.sourceCollectionDoenetId=Ls.collectionDoenetId,Fs.label=Dl[Sl],Fs.type="pageLink",Fs.isSelected=!1,Fs.timeOfLastUpdate=Ys,Qs[Fs.sourcePageDoenetId]=Vl,Us(itemByDoenetId(Vl),Fs)}for(let[Sl,Vl]of Object.entries(Gs)){const Fs=yl[Sl];Ks.includes(Fs)||(Qs[Fs]=Vl)}let Js=[];for(let Sl of Nl)Js.push(Qs[Sl]);let El={...Ls};El.pagesByCollectionSource={...Ls.pagesByCollectionSource},El.pagesByCollectionSource[Ls.collectionDoenetId]=Js;let _l=[];for(let Sl of El.manuallyFilteredPages)Js.includes(Sl)&&_l.push(Sl);El.manuallyFilteredPages=[..._l],El.isManuallyFiltered?El.pages=[..._l]:El.pages=Js,Us(itemByDoenetId(Ls.doenetId),El);let Xs=await js.getPromise(itemByDoenetId(Ls.containingDoenetId));const xl=Os({content:Xs.content,updateCollectionLink:El});let Al={...Xs};Al.content=xl,Us(itemByDoenetId(Al.doenetId),Al),await axios.post("/api/updateActivityStructure.php",{courseId:as,doenetId:Xs.doenetId,newJSON:xl})}else{let{data:Zs}=await axios.post("/api/updatePageLinks.php",{courseId:as,pages:Gs});if(Zs.success)for(let[Nl,yl]of Object.entries(Gs))Us(itemByDoenetId(yl),Dl=>{let Rl={...Dl};return Rl.timeOfLastUpdate=Ys,Rl.label=Zs.nextLabels[Nl],Rl});else Hs(Zs.message)}}),Vs=Recoil_index_31(({set:Us,snapshot:js})=>async({doenetId:Ls,behavior:Gs,numberToSelect:Hs,withReplacement:Ys,successCallback:Zs,failureCallback:Nl=ps})=>{let yl=await js.getPromise(itemByDoenetId(Ls)),Dl=await js.getPromise(itemByDoenetId(yl.containingDoenetId)),Rl={behavior:Gs,numberToSelect:Hs,withReplacement:Ys},Ml=As({content:Dl.content,needleDoenetId:Ls,changesObj:Rl});await axios.post("/api/updateActivityStructure.php",{courseId:as,doenetId:yl.containingDoenetId,newJSON:Ml});let Ks={...Dl};Ks.content=Ml,Us(itemByDoenetId(yl.containingDoenetId),Ks),Us(itemByDoenetId(Ls),qs=>{let Qs={...qs};return Qs.behavior=Gs,Qs.numberToSelect=Hs,Qs.withReplacement=Ys,Qs})}),ks=Recoil_index_31(({set:Us,snapshot:js})=>async({doenetId:Ls,successCallback:Gs,failureCallback:Hs=ps})=>{let Ys=await js.getPromise(itemByDoenetId(Ls)),Zs=[],Nl=[],yl=[],Dl=[],Rl=[],Ml=[],Ks=[],qs=[],Qs=[],Js=[],El=[],_l=[];if(Ys.type=="page"){let Xs=await js.getPromise(itemByDoenetId(Ys.containingDoenetId));if(Xs.type=="bank"){Ml.push(Xs.doenetId);let xl=[...Xs.pages];xl.splice(xl.indexOf(Ys.doenetId),1),Rl.push(xl),Zs.push(Ls)}else if(Xs.type=="activity"){let xl=Es({content:Xs.content,needleDoenetId:Ls});yl.push(xl),Dl.push(Xs.doenetId),Zs.push(Ls)}}else if(Ys.type=="order"){let Xs=await js.getPromise(itemByDoenetId(Ys.containingDoenetId)),xl=Xs.content,Al=findCollectionLinksAndPageLinksInContentArray({content:xl,needleOrderDoenentId:Ys.doenetId});_l=Al.pageLinkDoenetIds,El=Al.collectionLinkDoenetIds,Zs=findPageDoenetIdsInAnOrder({content:xl,needleOrderDoenetId:Ys.doenetId}),Js=Rs({content:xl,needleOrderDoenetId:Ls});let Sl=_s({content:xl,needleDoenetId:Ls});yl.push(Sl),Dl.push(Xs.doenetId)}else if(Ys.type=="collectionLink"){let Xs=await js.getPromise(itemByDoenetId(Ys.containingDoenetId));El=[Ys.doenetId],_l=[...Ys.pages];let xl=$s({content:Xs.content,needleDoenetId:Ls});yl.push(xl),Dl.push(Xs.doenetId)}else if(Ys.type=="bank")Ks.push(Ls),Zs=Ys.pages;else if(Ys.type=="activity"){let Xs=Ys.content;({pageLinkDoenetIds:_l,collectionLinkDoenetIds:El}=findCollectionLinksAndPageLinksInContentArray({content:Xs,foundNeedle:!0})),Zs=findPageIdsInContentArray({content:Xs,needleOrderDoenetId:null,foundNeedle:!0}),Js=Rs({content:Xs,needleOrderDoenetId:null,foundNeedle:!0}),qs=[Ls]}else if(Ys.type=="section"){Qs.push(Ys.doenetId);let Xs=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Ys.doenetId}));for(let xl of Xs){let Al=await js.getPromise(itemByDoenetId(xl));Al.type=="activity"?qs.push(Al.doenetId):Al.type=="order"?Js.push(Al.doenetId):Al.type=="page"?Zs.push(Al.doenetId):Al.type=="bank"?Ks.push(Al.doenetId):Al.type=="section"&&Qs.push(Al.doenetId)}}try{let Xs=await axios.post("/api/deleteItems.php",{courseId:as,pagesDoenetIds:Zs,courseContentDoenetIds:Nl,activitiesJson:yl,activitiesJsonDoenetIds:Dl,collectionsJson:Rl,collectionsJsonDoenetIds:Ml,pageLinkDoenetIds:_l,baseCollectionsDoenetIds:Ks,baseActivitiesDoenetIds:qs,baseSectionsDoenetIds:Qs});if(Xs.status<300){let{success:xl,message:Al}=Xs.data;for(let[Vl,Fs]of Object.entries(Ml)){let Cl=Rl[Vl];Us(itemByDoenetId(Fs),Tl=>{let zl={...Tl};return zl.pages=Cl,zl})}for(let[Vl,Fs]of Object.entries(Dl)){let Cl=yl[Vl];Us(itemByDoenetId(Fs),Tl=>{let zl={...Tl};return zl.content=Cl,zl})}Us(authorCourseItemOrderByCourseId(as),Vl=>{let Fs=[...Vl];for(let Cl of Zs){let Tl=Fs.indexOf(Cl);Tl!=-1&&Fs.splice(Tl,1)}for(let Cl of Js){let Tl=Fs.indexOf(Cl);Tl!=-1&&Fs.splice(Tl,1)}for(let Cl of El){let Tl=Fs.indexOf(Cl);Tl!=-1&&Fs.splice(Tl,1)}for(let Cl of _l){let Tl=Fs.indexOf(Cl);Tl!=-1&&Fs.splice(Tl,1)}for(let Cl of Ks){let Tl=Fs.indexOf(Cl);Tl!=-1&&Fs.splice(Tl,1)}for(let Cl of qs){let Tl=Fs.indexOf(Cl);Tl!=-1&&Fs.splice(Tl,1)}for(let Cl of Qs){let Tl=Fs.indexOf(Cl);Tl!=-1&&Fs.splice(Tl,1)}return Fs});let Sl=await js.getPromise(selectedCourseItems);for(let Vl of Sl)Us(itemByDoenetId(Vl),Fs=>{let Cl={...Fs};return Cl.isSelected=!1,Cl});Us(selectedCourseItems,[]),Us(selectedMenuPanelAtom,""),Gs==null||Gs()}else throw new Error(`response code: ${Xs.status}`)}catch(Xs){Hs(Xs.message)}}),Ps=Recoil_index_31(({set:Us,snapshot:js})=>async({successCallback:Ls,failureCallback:Gs=ps})=>{let Hs=await js.getPromise(selectedCourseItems),Ys=[];for(let Nl of Hs){let yl=await js.getPromise(itemByDoenetId(Nl));Ys.push(yl)}Us(copiedCourseItems,Ys);let Zs=await js.getPromise(cutCourseItems);for(let Nl of Zs)Us(itemByDoenetId(Nl.doenetId),yl=>{let Dl={...yl};return Dl.isBeingCut=!1,Dl});Us(cutCourseItems,[]),Ls()}),Bs=Recoil_index_31(({set:Us,snapshot:js})=>async({successCallback:Ls,failureCallback:Gs=ps})=>{let Hs=await js.getPromise(cutCourseItems);for(let Nl of Hs)Us(itemByDoenetId(Nl.doenetId),yl=>{let Dl={...yl};return Dl.isBeingCut=!1,Dl});Us(cutCourseItems,[]);let Ys=await js.getPromise(selectedCourseItems),Zs=[];for(let Nl of Ys){let yl=await js.getPromise(itemByDoenetId(Nl));Zs.push(yl);let Dl={...yl};Dl.isBeingCut=!0,Us(itemByDoenetId(Nl),Dl)}Us(cutCourseItems,Zs),Ls()}),Ms=Recoil_index_31(({set:Us,snapshot:js})=>async({successCallback:Ls,failureCallback:Gs=ps})=>{async function Hs(_l,Xs=null){let xl=[_l];if(Xs||(Xs=await js.getPromise(itemByDoenetId(_l))),Xs.type=="order"||Xs.type=="activity"&&!Xs.isSinglePage){let Al=[];for(let Sl of Xs.content)if((Sl==null?void 0:Sl.type)=="order"){let Vl=await Hs(Xs.doenetId,Sl);Al=[...Al,Sl.doenetId,...Vl]}else Al.push(Sl);xl=[...xl,...Al]}else if(Xs.type=="bank")xl=[...xl,...Xs.pages];else if(Xs.type=="section"){let Al=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:_l}));xl=[...xl,...Al]}return xl}async function Ys(_l){let Xs=[],xl=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:_l}));for(let Al of xl){let Sl=await js.getPromise(itemByDoenetId(Al));if(Sl.type=="bank"||Sl.type=="activity")Xs.push(Al);else if(Sl.type=="section"){let Vl=await Ys(Al);Xs=[...Xs,Al,...Vl]}}return Xs}async function Zs(_l){let Xs=await js.getPromise(itemByDoenetId(_l));if(Xs.parentDoenetId==as)return[_l];let xl=await Zs(Xs.parentDoenetId);return[_l,...xl]}let Nl=await js.getPromise(cutCourseItems),yl=await js.getPromise(copiedCourseItems),Dl=await js.getPromise(selectedCourseItems),Rl=null;if(Nl.length==0&&yl.length==0){Gs("No items pasted.");return}let Ml=await js.getPromise(searchParamAtomFamily("sectionId"));Ml==""&&(Ml=as);let Ks=Ml,qs,Qs,Js="section",El;if(Dl.length==1){if(Rl=await js.getPromise(itemByDoenetId(Dl[0])),Js=Rl.type,Rl.type=="section")Ks=Rl.doenetId,El={...Rl};else if(Rl.type=="activity"||Rl.type=="bank")El={...Rl},Ks=Rl.parentDoenetId;else if(Rl.type=="order"||Rl.type=="page"){let Al=await js.getPromise(itemByDoenetId(Rl.containingDoenetId));El={...Al},Ks=Al.parentDoenetId}let _l=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Ks})),Xs=_l[_l.length-1],xl=await js.getPromise(itemByDoenetId(Xs));qs=Xs,Xs||(Xs=Ks,xl=await js.getPromise(itemByDoenetId(Ks))),xl.type=="section"||xl.type=="bank"||xl.type=="activity"?Qs=Xs:(xl.type=="order"||xl.type=="page")&&(Qs=xl.containingDoenetId)}else if(Dl.length>1){Gs("Can only paste to one location.");return}else{let _l=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Ml})),Xs=_l[_l.length-1];qs=Xs,qs||(qs=Ml);let xl=await js.getPromise(itemByDoenetId(Xs));xl.type=="section"||xl.type=="bank"||xl.type=="activity"?Qs=Xs:(xl.type=="order"||xl.type=="page")&&(Qs=xl.containingDoenetId)}if(qs||(qs=Ks),Nl.length>0){let _l=[],Xs=[],xl=[],Al=[],Sl=[];El&&(Sl=await Zs(El.doenetId));let Vl=!1;for(let Fs of Nl)if(Fs.type=="activity"||Fs.type=="bank"||Fs.type=="section"){Vl=!0;break}for(let Fs of Nl){if(Fs.type=="collectionLink"){Gs("Pasting collection links is not yet supported");return}if(Fs.type=="pageLink"){Gs("Pasting page links is not yet supported");return}if(Js=="section"&&(Fs.type=="page"||Fs.type=="order")&&!Vl){Gs(`Pasting ${Fs.type} in a section is not supported.`);return}if(Fs.type=="order"&&!Vl){Gs("Pasting orders is not yet supported");return}if(Js=="bank"&&Fs.type=="order"){Gs("Collections can only accept pages.");return}if(Sl.includes(Fs.doenetId)){Gs("Can't paste item into itself.");return}if((Fs.type=="activity"||Fs.type=="bank")&&_l.push(Fs.doenetId),Fs.type=="section"){let Cl=await Ys(Fs.doenetId);Cl=[...new Set(Cl)],Xs=[...Xs,...Cl],_l=[..._l,Fs.doenetId,...Cl]}(Fs.type=="order"||Fs.type=="page")&&!Vl&&xl.push({...Fs}),(Fs.type=="order"||Fs.type=="page")&&Al.push({...Fs})}if(Al.length>0&&Vl){let Fs=[];for(let Cl of _l){let Tl=await Hs(Cl);Fs=[...Fs,...Tl]}for(let Cl of Al)if(!Fs.includes(Cl.doenetId)){Gs("Can't paste pages or orders with other types.");return}}if(_l.length>0)try{let Fs=await axios.post("/api/moveContent.php",{courseId:as,doenetIdsToMove:_l,destParentDoenetId:Ks,destPreviousContainingItemDoenetId:Qs,noParentUpdateDoenetIds:Xs});if(Fs.status<300){for(let Tl of Nl)Us(itemByDoenetId(Tl.doenetId),zl=>{let Xl={...zl};return Xl.isBeingCut=!1,Xl.isSelected=!1,Xl});for(let Tl of _l)Xs.includes(Tl)||Us(itemByDoenetId(Tl),zl=>{let Xl={...zl};return Xl.parentDoenetId=Ks,Xl});let Cl=[];for(let Tl of _l){let zl=await Hs(Tl);Cl=[...Cl,...zl]}Cl=[...new Set(Cl)],Us(authorCourseItemOrderByCourseId(as),Tl=>{let zl=[...Tl];zl=zl.filter(Pl=>!Cl.includes(Pl));let Xl=zl.indexOf(qs)+1;if(Xl==0){let Pl=Tl.indexOf(qs)-1,Bl=Tl[Pl];for(;Pl>0&&!zl.includes(Bl);)Pl--,Bl=Tl[Pl];Xl=Pl+1}return zl.splice(Xl,0,...Cl),zl}),Ls==null||Ls()}else throw new Error(`response code: ${Fs.status}`)}catch(Fs){Gs(Fs.message)}if(xl.length>0){let Fs=El.type,Cl=El.doenetId,Tl,zl=!1,Xl;Fs=="bank"?Tl=[...El.pages]:Fs=="activity"&&(Tl=[...El.content]),El.isSinglePage&&(zl=!0,Xl=El.content[0]);let Pl=[],Bl=[],Wl=[],Ll=[],Hl;for(let Kl of xl){let Il=Kl.containingDoenetId,$l=Bl.indexOf(Il);if($l==-1){Ll.push([Kl.doenetId]),Bl.push(Il);let Yl=await js.getPromise(itemByDoenetId(Il));Pl.push(Yl.type);let Zl={};if(Yl.type=="activity")Zl=Es({content:Yl.content,needleDoenetId:Kl.doenetId}),El.doenetId==Yl.doenetId&&(Tl=Es({content:Tl,needleDoenetId:Kl.doenetId}),El.content=Tl);else if(Yl.type=="bank"){let eu=[...Yl.pages];if(eu.splice(Yl.pages.indexOf(Kl.doenetId),1),Zl=eu,El.doenetId==Yl.doenetId){let tu=[...Tl];tu.splice(Tl.indexOf(Kl.doenetId),1),Tl=tu}}Wl.push(Zl)}else{Ll[$l].push(Kl.doenetId);let Yl=Pl[$l],Zl=Wl[$l],eu={};if(Yl=="activity")eu=Es({content:Zl,needleDoenetId:Kl.doenetId}),El.doenetId==Kl.containingDoenetId&&(Tl=Es({content:Tl,needleDoenetId:Kl.doenetId}),El.content=Tl);else if(Yl=="bank"){let tu=[...Zl];if(tu.splice(Zl.indexOf(Kl.doenetId),1),eu=tu,El.doenetId==Kl.containingDoenetId){let nu=[...Tl];nu.splice(Tl.indexOf(Kl.doenetId),1),Tl=nu}}Wl[$l]=eu}}for(let Kl of xl)if(Fs=="bank")Tl.push(Kl.doenetId);else if(Fs=="activity"){let Il=Rl.doenetId;Rl.type=="page"&&(Il=Rl.parentDoenetId);let $l=Hl;({content:Tl,previousDoenetId:Hl}=ds({activityOrOrderObj:El,needleOrderOrActivityId:Il,itemToAdd:Kl.doenetId})),El.content=Tl,$l&&(Hl=$l),zl&&(Hl=Cl)}let Ql=Hl;if(!Ql){if(Rl.type=="bank")Rl.pages.length==0?Ql=Rl.doenetId:Ql=Rl.pages[Rl.pages.length-1];else if(Rl.type=="page"){let Kl=await js.getPromise(itemByDoenetId(Rl.containingDoenetId));Kl.type=="bank"&&(Kl.pages.length==0?Ql=Kl.doenetId:Ql=Kl.pages[Kl.pages.length-1])}}try{let Kl=await axios.post("/api/cutCopyAndPasteAPage.php",{isCopy:!1,courseId:as,originalPageDoenetIds:Ll,sourceTypes:Pl,sourceDoenetIds:Bl,sourceJSONs:Wl,destinationType:Fs,destinationDoenetId:Cl,destinationJSON:Tl,destinationWasASinglePageActivity:zl});if(Kl.status<300){let Il;Rl.type=="order"||Rl.type=="bank"||Rl.type=="activity"?Il=Rl.doenetId:Rl.type=="page"&&(Il=Rl.parentDoenetId);let $l=[];for(let[Yl,Zl]of Object.entries(Pl)){let eu=Bl[Yl],tu=Wl[Yl];for(let nu of Ll[Yl])$l.push(nu),Us(itemByDoenetId(nu),ru=>{let iu={...ru};return iu.containingDoenetId=Cl,iu.parentDoenetId=Il,iu.isBeingCut=!1,iu});eu!=Cl&&(Zl=="bank"?Us(itemByDoenetId(eu),nu=>{let ru={...nu};return ru.pages=tu,ru}):Zl=="activity"&&Us(itemByDoenetId(eu),nu=>{let ru={...nu};return ru.content=tu,ru}))}Fs=="bank"?Us(itemByDoenetId(Cl),Yl=>{let Zl={...Yl};return Zl.pages=Tl,Zl}):Fs=="activity"&&Us(itemByDoenetId(Cl),Yl=>{let Zl={...Yl};return Zl.content=Tl,zl&&(Zl.isSinglePage=!1),Zl}),Us(authorCourseItemOrderByCourseId(as),Yl=>{let Zl=[...Yl];for(let tu of $l)Zl.splice(Zl.indexOf(tu),1);let eu=Zl.indexOf(Ql)+1;if(eu==0){let tu=Yl.indexOf(Ql)-1,nu=Yl[tu];for(;tu>0&&!Zl.includes(nu);)tu--,nu=Yl[tu];eu=tu+1}return zl?Zl.splice(eu,0,Xl,...$l):Zl.splice(eu,0,...$l),Zl}),Ls==null||Ls()}else throw new Error(`response code: ${Kl.status}`)}catch(Kl){Gs(Kl.message)}}Us(copiedCourseItems,[...Nl]),Us(cutCourseItems,[]);return}}),Ws=Recoil_index_31(({snapshot:Us})=>async js=>{let Ls=[];for(let Gs of js){let Hs=await Us.getPromise(itemByDoenetId(Gs));if(Hs.type=="page")Ls.push(Hs.doenetId);else if(Hs.type=="activity"){let Ys=findPageDoenetIdsInAnOrder({orderObj:Hs.order,needleOrderDoenetId:"",foundNeedle:!0});Ls=[...Ls,...Ys]}else if(Hs.type=="order"){let Ys=await Us.getPromise(itemByDoenetId(Hs.containingDoenetId)),Zs=findPageDoenetIdsInAnOrder({orderObj:Ys.order,needleOrderDoenetId:Hs.doenetId,foundNeedle:!1});Ls=[...Ls,...Zs]}else if(Hs.type=="bank")Ls=[...Ls,...Hs.pages];else if(Hs.type=="section"){let Ys=await Us.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Hs.doenetId})),Zs=await Ws(Ys);Ls=[...Ls,...Zs]}}return Ls=[...new Set(Ls)],Ls});return{label:rs,color:ns,image:ss,defaultRoleId:os,canAutoEnroll:ls,create:fs,deleteItem:ks,deleteCourse:xs,duplicateCourse:Cs,modifyCourse:hs,modifyRolePermissions:vs,renameItem:Ts,compileActivity:Ns,updateAssignItem:Ss,updateOrderBehavior:Vs,updateCollectionLink:Ds,updateContentLinksToSources:Is,copyItems:Ps,cutItems:Bs,pasteItems:Ms,findPagesFromDoenetIds:Ws,addUser:ys,modifyUserRole:bs}};async function loader$8({request:as}){const ns=new URL(as.url).searchParams.get("doenetId");return(await(await fetch(`/api/getPortfolioActivityData.php?doenetId=${ns}`)).json()).activityData}async function action$3({request:as}){const rs=await as.formData();let ns=Object.fromEntries(rs);if(ns._action=="Remix"){let os=await(await fetch(`/api/duplicatePortfolioActivity.php?doenetId=${ns.doenetId}`)).json();const{nextActivityDoenetId:ls,nextPageDoenetId:us}=os;return redirect(`/portfolioeditor/${ls}?tool=editor&doenetId=${ls}&pageId=${us}`)}return!0}const SupportWrapper=styled$1.div` +${Ks}`;try{let Qs=await axios.post("/api/saveCompiledActivity.php",{courseId:Ys,doenetId:Ls,isAssigned:Hs,activityDoenetML:qs});if(Qs.status<300){let{success:Js,message:El,cid:_l,assignmentSettings:Xs}=Qs.data,xl="draftCid";Hs&&(xl="assignedCid"),Us(itemByDoenetId(Ls),Al=>{let Sl={...Al};return Sl[xl]=_l,Hs&&Object.assign(Sl,localizeDates(Xs,dateKeys)),Sl}),Gs==null||Gs()}else throw new Error(`response code: ${Qs.status}`)}catch(Qs){Zs(Qs.message)}});function As({content:Us,needleDoenetId:js,changesObj:Ls}){let Gs=[...Us];for(let[Hs,Ys]of Object.entries(Us))if((Ys==null?void 0:Ys.type)=="order"){if(js==Ys.doenetId){let Nl={...Ys};return Object.assign(Nl,Ls),Gs.splice(Hs,1,Nl),Gs}let Zs=As({content:Ys.content,needleDoenetId:js,changesObj:Ls});if(Zs!=null){let Nl={...Ys};return Nl.content=Zs,Gs.splice(Hs,1,Nl),Gs}}return null}function ws({content:Us,needleDoenetId:js,changesObj:Ls}){let Gs=[...Us];for(let[Hs,Ys]of Object.entries(Us)){if((Ys==null?void 0:Ys.type)=="collectionLink"&&js==Ys.doenetId){let Zs={...Ys};return Object.assign(Zs,Ls),Gs.splice(Hs,1,Zs),Gs}if((Ys==null?void 0:Ys.type)=="order"){let Zs=ws({content:Ys.content,needleDoenetId:js,changesObj:Ls});if(Zs!=null){let Nl={...Ys};return Nl.content=Zs,Gs.splice(Hs,1,Nl),Gs}}}return null}function Es({content:Us,needleDoenetId:js}){let Ls=[...Us],Gs=null;for(let[Hs,Ys]of Object.entries(Us))if((Ys==null?void 0:Ys.type)=="order"){let Zs=Es({content:Ys.content,needleDoenetId:js});if(Zs!=null){let Nl={...Ys};return Nl.content=Zs,Ls.splice(Hs,1,Nl),Ls}}else if(js==Ys){Gs=Hs;break}return Gs!=null?(Ls.splice(Gs,1),Ls):null}function _s({content:Us,needleDoenetId:js}){let Ls=[...Us],Gs=null;for(let[Hs,Ys]of Object.entries(Us))if((Ys==null?void 0:Ys.type)=="order"){if(js==Ys.doenetId){Gs=Hs;break}let Zs=_s({content:Ys.content,needleDoenetId:js});if(Zs!=null){let Nl={...Ys};return Nl.content=[...Zs],Ls.splice(Hs,1,Nl),Ls}}return Gs!=null?(Ls.splice(Gs,1),Ls):null}function $s({content:Us,needleDoenetId:js}){let Ls=[...Us],Gs=null;for(let[Hs,Ys]of Object.entries(Us)){if(js==Ys.doenetId){Gs=Hs;break}if((Ys==null?void 0:Ys.type)=="order"){let Zs=$s({content:Ys.content,needleDoenetId:js});if(Zs!=null){let Nl={...Ys};return Nl.content=[...Zs],Ls.splice(Hs,1,Nl),Ls}}}return Gs!=null?(Ls.splice(Gs,1),Ls):null}function Rs({content:Us,needleOrderDoenetId:js,foundNeedle:Ls=!1}){let Gs=[];for(let Hs of Us)if((Hs==null?void 0:Hs.type)=="order"){let Ys;Ls||Hs.doenetId==js?(Gs.push(Hs.doenetId),Ys=Rs({content:Hs.content,needleOrderDoenetId:js,foundNeedle:!0})):Ys=Rs({content:Hs.content,needleOrderDoenetId:js,foundNeedle:Ls}),Gs=[...Gs,...Ys]}return Gs}const Ds=Recoil_index_31(({set:Us,snapshot:js})=>async({courseId:Ls,doenetId:Gs,label:Hs,collectionDoenetId:Ys,isManuallyFiltered:Zs,manuallyFilteredPages:Nl=[],successCallback:yl,failureCallback:Dl=ps})=>{let Rl=await js.getPromise(itemByDoenetId(Gs));Hs||(Hs=Rl.label);let Ml=Rl.pages;const Ks=Rl.containingDoenetId;let qs=await js.getPromise(itemByDoenetId(Ks)),Qs=Rl.timeOfLastUpdate;if(Ys!==Rl.collectionDoenetId&&!Rl.pagesByCollectionSource[Ys]){Qs=new Date;let{data:Al}=await axios.post("/api/createPageLinks.php",{courseId:Ls,containingDoenetId:Ks,collectionDoenetId:Ys,parentDoenetId:Gs});Ml=Object.keys(Al.linkPageObjs);for(let Sl of Ml){let Vl=Al.linkPageObjs[Sl].sourcePage,Fs=Al.linkPageObjs[Sl].nextLabel,Cl={type:"pageLink",doenetId:Sl,sourcePageDoenetId:Vl,containingDoenetId:Ks,parentDoenetId:Gs,isSelected:!1,label:Fs,timeOfLastUpdate:new Date};Us(itemByDoenetId(Sl),Cl)}}let Js={label:Hs,collectionDoenetId:Ys,isManuallyFiltered:Zs,pages:Ml,manuallyFilteredPages:Nl,pagesByCollectionSource:{...Rl.pagesByCollectionSource},timeOfLastUpdate:Qs},El=[],_l=[...Rl.pages];Ys!==Rl.collectionDoenetId?Rl.pagesByCollectionSource[Ys]?(El=[...Rl.pagesByCollectionSource[Ys]],Ml=[...Rl.pagesByCollectionSource[Ys]]):(El=[...Ml],Js.pagesByCollectionSource[Ys]=[...Ml]):!Rl.isManuallyFiltered&&Zs?(Ml=[...Rl.manuallyFilteredPages],Nl=[...Rl.manuallyFilteredPages]):Rl.isManuallyFiltered&&!Zs?(El=[...Rl.pagesByCollectionSource[Rl.collectionDoenetId]],Ml=[...Rl.pagesByCollectionSource[Rl.collectionDoenetId]]):(Rl.manuallyFilteredPages.length!=Nl.length||Rl.manuallyFilteredPages[0]!=Nl[0])&&(El=[...Nl],Ml=[...Nl]),Js.pages=Ml,Us(authorCourseItemOrderByCourseId(Ls),Al=>{let Sl=[...Al],Vl=Sl.indexOf(Gs);return Sl.splice(Vl+1,_l.length,...El),Sl});let Xs=ws({content:qs.content,needleDoenetId:Gs,changesObj:Js});await axios.post("/api/updateActivityStructure.php",{courseId:Ls,doenetId:Rl.containingDoenetId,newJSON:Xs});let xl={...qs};xl.content=Xs,Us(itemByDoenetId(Rl.containingDoenetId),xl),Us(itemByDoenetId(Gs),Al=>{let Sl={...Al};return Sl.isManuallyFiltered=Zs,Sl.collectionDoenetId=Ys,Sl.pages=[...Ml],Sl.manuallyFilteredPages=[...Nl],Sl.pagesByCollectionSource=Js.pagesByCollectionSource,Hs?Sl.label=Hs:Sl.label=Al.label,Sl})});function Os({content:Us,updateCollectionLink:js}){let Ls=js.doenetId,Gs=[];for(let Hs of Us){if((Hs==null?void 0:Hs.type)=="order"){let Ys=Os({content:Hs.content,updateCollectionLink:js}),Zs={...Hs};Zs.content=Ys,Hs=Zs}else(Hs==null?void 0:Hs.doenetId)==Ls&&(Hs=js);Gs.push(Hs)}return Gs}const Is=Recoil_index_31(({set:Us,snapshot:js})=>async({collectionLinkObj:Ls,pages:Gs,failureCallback:Hs=ps})=>{let Ys=new Date;if(Ls){let Nl=(await js.getPromise(itemByDoenetId(Ls.collectionDoenetId))).pages,yl=[],Dl=[];for(let Sl of Gs){let Vl=await js.getPromise(itemByDoenetId(Sl));yl.push(Vl.sourcePageDoenetId)}let Rl=[];for(let Sl of Nl)if(!yl.includes(Sl)){Rl.push(Sl);let Vl=await js.getPromise(itemByDoenetId(Sl));Dl.push(Vl.label)}let Ml=[],Ks=[];for(let[Sl,Vl]of Object.entries(yl))Nl.includes(Vl)||(Ks.push(Vl),Ml.push(Gs[Sl]));let{data:qs}=await axios.post("/api/updateCreateAndDeletePageLinks.php",{courseId:as,containingDoenetId:Ls.containingDoenetId,parentDoenetId:Ls.doenetId,sourceCollectionDoenetId:Ls.collectionDoenetId,newSourcePageDoenetIds:Rl,pageLinksToDelete:Ml,labels:Dl});for(let[Sl,Vl]of Object.entries(qs.linkPagesDoenetIds)){let Fs=qs.nextLabels[Sl];Us(itemByDoenetId(Vl),Cl=>{let Tl={...Cl};return Tl.timeOfLastUpdate=Ys,Tl.label=Fs,Tl})}let Qs={};for(let[Sl,Vl]of Object.entries(Object.keys(qs.linkPageObjs))){let Fs={...qs.linkPageObjs[Vl]};Fs.containingDoenetId=Ls.containingDoenetId,Fs.doenetId=Vl,Fs.parentDoenetId=Ls.doenetId,Fs.sourceCollectionDoenetId=Ls.collectionDoenetId,Fs.label=Dl[Sl],Fs.type="pageLink",Fs.isSelected=!1,Fs.timeOfLastUpdate=Ys,Qs[Fs.sourcePageDoenetId]=Vl,Us(itemByDoenetId(Vl),Fs)}for(let[Sl,Vl]of Object.entries(Gs)){const Fs=yl[Sl];Ks.includes(Fs)||(Qs[Fs]=Vl)}let Js=[];for(let Sl of Nl)Js.push(Qs[Sl]);let El={...Ls};El.pagesByCollectionSource={...Ls.pagesByCollectionSource},El.pagesByCollectionSource[Ls.collectionDoenetId]=Js;let _l=[];for(let Sl of El.manuallyFilteredPages)Js.includes(Sl)&&_l.push(Sl);El.manuallyFilteredPages=[..._l],El.isManuallyFiltered?El.pages=[..._l]:El.pages=Js,Us(itemByDoenetId(Ls.doenetId),El);let Xs=await js.getPromise(itemByDoenetId(Ls.containingDoenetId));const xl=Os({content:Xs.content,updateCollectionLink:El});let Al={...Xs};Al.content=xl,Us(itemByDoenetId(Al.doenetId),Al),await axios.post("/api/updateActivityStructure.php",{courseId:as,doenetId:Xs.doenetId,newJSON:xl})}else{let{data:Zs}=await axios.post("/api/updatePageLinks.php",{courseId:as,pages:Gs});if(Zs.success)for(let[Nl,yl]of Object.entries(Gs))Us(itemByDoenetId(yl),Dl=>{let Rl={...Dl};return Rl.timeOfLastUpdate=Ys,Rl.label=Zs.nextLabels[Nl],Rl});else Hs(Zs.message)}}),Vs=Recoil_index_31(({set:Us,snapshot:js})=>async({doenetId:Ls,behavior:Gs,numberToSelect:Hs,withReplacement:Ys,successCallback:Zs,failureCallback:Nl=ps})=>{let yl=await js.getPromise(itemByDoenetId(Ls)),Dl=await js.getPromise(itemByDoenetId(yl.containingDoenetId)),Rl={behavior:Gs,numberToSelect:Hs,withReplacement:Ys},Ml=As({content:Dl.content,needleDoenetId:Ls,changesObj:Rl});await axios.post("/api/updateActivityStructure.php",{courseId:as,doenetId:yl.containingDoenetId,newJSON:Ml});let Ks={...Dl};Ks.content=Ml,Us(itemByDoenetId(yl.containingDoenetId),Ks),Us(itemByDoenetId(Ls),qs=>{let Qs={...qs};return Qs.behavior=Gs,Qs.numberToSelect=Hs,Qs.withReplacement=Ys,Qs})}),ks=Recoil_index_31(({set:Us,snapshot:js})=>async({doenetId:Ls,successCallback:Gs,failureCallback:Hs=ps})=>{let Ys=await js.getPromise(itemByDoenetId(Ls)),Zs=[],Nl=[],yl=[],Dl=[],Rl=[],Ml=[],Ks=[],qs=[],Qs=[],Js=[],El=[],_l=[];if(Ys.type=="page"){let Xs=await js.getPromise(itemByDoenetId(Ys.containingDoenetId));if(Xs.type=="bank"){Ml.push(Xs.doenetId);let xl=[...Xs.pages];xl.splice(xl.indexOf(Ys.doenetId),1),Rl.push(xl),Zs.push(Ls)}else if(Xs.type=="activity"){let xl=Es({content:Xs.content,needleDoenetId:Ls});yl.push(xl),Dl.push(Xs.doenetId),Zs.push(Ls)}}else if(Ys.type=="order"){let Xs=await js.getPromise(itemByDoenetId(Ys.containingDoenetId)),xl=Xs.content,Al=findCollectionLinksAndPageLinksInContentArray({content:xl,needleOrderDoenentId:Ys.doenetId});_l=Al.pageLinkDoenetIds,El=Al.collectionLinkDoenetIds,Zs=findPageDoenetIdsInAnOrder({content:xl,needleOrderDoenetId:Ys.doenetId}),Js=Rs({content:xl,needleOrderDoenetId:Ls});let Sl=_s({content:xl,needleDoenetId:Ls});yl.push(Sl),Dl.push(Xs.doenetId)}else if(Ys.type=="collectionLink"){let Xs=await js.getPromise(itemByDoenetId(Ys.containingDoenetId));El=[Ys.doenetId],_l=[...Ys.pages];let xl=$s({content:Xs.content,needleDoenetId:Ls});yl.push(xl),Dl.push(Xs.doenetId)}else if(Ys.type=="bank")Ks.push(Ls),Zs=Ys.pages;else if(Ys.type=="activity"){let Xs=Ys.content;({pageLinkDoenetIds:_l,collectionLinkDoenetIds:El}=findCollectionLinksAndPageLinksInContentArray({content:Xs,foundNeedle:!0})),Zs=findPageIdsInContentArray({content:Xs,needleOrderDoenetId:null,foundNeedle:!0}),Js=Rs({content:Xs,needleOrderDoenetId:null,foundNeedle:!0}),qs=[Ls]}else if(Ys.type=="section"){Qs.push(Ys.doenetId);let Xs=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Ys.doenetId}));for(let xl of Xs){let Al=await js.getPromise(itemByDoenetId(xl));Al.type=="activity"?qs.push(Al.doenetId):Al.type=="order"?Js.push(Al.doenetId):Al.type=="page"?Zs.push(Al.doenetId):Al.type=="bank"?Ks.push(Al.doenetId):Al.type=="section"&&Qs.push(Al.doenetId)}}try{let Xs=await axios.post("/api/deleteItems.php",{courseId:as,pagesDoenetIds:Zs,courseContentDoenetIds:Nl,activitiesJson:yl,activitiesJsonDoenetIds:Dl,collectionsJson:Rl,collectionsJsonDoenetIds:Ml,pageLinkDoenetIds:_l,baseCollectionsDoenetIds:Ks,baseActivitiesDoenetIds:qs,baseSectionsDoenetIds:Qs});if(Xs.status<300){let{success:xl,message:Al}=Xs.data;for(let[Vl,Fs]of Object.entries(Ml)){let Cl=Rl[Vl];Us(itemByDoenetId(Fs),Tl=>{let zl={...Tl};return zl.pages=Cl,zl})}for(let[Vl,Fs]of Object.entries(Dl)){let Cl=yl[Vl];Us(itemByDoenetId(Fs),Tl=>{let zl={...Tl};return zl.content=Cl,zl})}Us(authorCourseItemOrderByCourseId(as),Vl=>{let Fs=[...Vl];for(let Cl of Zs){let Tl=Fs.indexOf(Cl);Tl!=-1&&Fs.splice(Tl,1)}for(let Cl of Js){let Tl=Fs.indexOf(Cl);Tl!=-1&&Fs.splice(Tl,1)}for(let Cl of El){let Tl=Fs.indexOf(Cl);Tl!=-1&&Fs.splice(Tl,1)}for(let Cl of _l){let Tl=Fs.indexOf(Cl);Tl!=-1&&Fs.splice(Tl,1)}for(let Cl of Ks){let Tl=Fs.indexOf(Cl);Tl!=-1&&Fs.splice(Tl,1)}for(let Cl of qs){let Tl=Fs.indexOf(Cl);Tl!=-1&&Fs.splice(Tl,1)}for(let Cl of Qs){let Tl=Fs.indexOf(Cl);Tl!=-1&&Fs.splice(Tl,1)}return Fs});let Sl=await js.getPromise(selectedCourseItems);for(let Vl of Sl)Us(itemByDoenetId(Vl),Fs=>{let Cl={...Fs};return Cl.isSelected=!1,Cl});Us(selectedCourseItems,[]),Us(selectedMenuPanelAtom,""),Gs==null||Gs()}else throw new Error(`response code: ${Xs.status}`)}catch(Xs){Hs(Xs.message)}}),Ps=Recoil_index_31(({set:Us,snapshot:js})=>async({successCallback:Ls,failureCallback:Gs=ps})=>{let Hs=await js.getPromise(selectedCourseItems),Ys=[];for(let Nl of Hs){let yl=await js.getPromise(itemByDoenetId(Nl));Ys.push(yl)}Us(copiedCourseItems,Ys);let Zs=await js.getPromise(cutCourseItems);for(let Nl of Zs)Us(itemByDoenetId(Nl.doenetId),yl=>{let Dl={...yl};return Dl.isBeingCut=!1,Dl});Us(cutCourseItems,[]),Ls()}),Bs=Recoil_index_31(({set:Us,snapshot:js})=>async({successCallback:Ls,failureCallback:Gs=ps})=>{let Hs=await js.getPromise(cutCourseItems);for(let Nl of Hs)Us(itemByDoenetId(Nl.doenetId),yl=>{let Dl={...yl};return Dl.isBeingCut=!1,Dl});Us(cutCourseItems,[]);let Ys=await js.getPromise(selectedCourseItems),Zs=[];for(let Nl of Ys){let yl=await js.getPromise(itemByDoenetId(Nl));Zs.push(yl);let Dl={...yl};Dl.isBeingCut=!0,Us(itemByDoenetId(Nl),Dl)}Us(cutCourseItems,Zs),Ls()}),Ms=Recoil_index_31(({set:Us,snapshot:js})=>async({successCallback:Ls,failureCallback:Gs=ps})=>{async function Hs(_l,Xs=null){let xl=[_l];if(Xs||(Xs=await js.getPromise(itemByDoenetId(_l))),Xs.type=="order"||Xs.type=="activity"&&!Xs.isSinglePage){let Al=[];for(let Sl of Xs.content)if((Sl==null?void 0:Sl.type)=="order"){let Vl=await Hs(Xs.doenetId,Sl);Al=[...Al,Sl.doenetId,...Vl]}else Al.push(Sl);xl=[...xl,...Al]}else if(Xs.type=="bank")xl=[...xl,...Xs.pages];else if(Xs.type=="section"){let Al=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:_l}));xl=[...xl,...Al]}return xl}async function Ys(_l){let Xs=[],xl=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:_l}));for(let Al of xl){let Sl=await js.getPromise(itemByDoenetId(Al));if(Sl.type=="bank"||Sl.type=="activity")Xs.push(Al);else if(Sl.type=="section"){let Vl=await Ys(Al);Xs=[...Xs,Al,...Vl]}}return Xs}async function Zs(_l){let Xs=await js.getPromise(itemByDoenetId(_l));if(Xs.parentDoenetId==as)return[_l];let xl=await Zs(Xs.parentDoenetId);return[_l,...xl]}let Nl=await js.getPromise(cutCourseItems),yl=await js.getPromise(copiedCourseItems),Dl=await js.getPromise(selectedCourseItems),Rl=null;if(Nl.length==0&&yl.length==0){Gs("No items pasted.");return}let Ml=await js.getPromise(searchParamAtomFamily("sectionId"));Ml==""&&(Ml=as);let Ks=Ml,qs,Qs,Js="section",El;if(Dl.length==1){if(Rl=await js.getPromise(itemByDoenetId(Dl[0])),Js=Rl.type,Rl.type=="section")Ks=Rl.doenetId,El={...Rl};else if(Rl.type=="activity"||Rl.type=="bank")El={...Rl},Ks=Rl.parentDoenetId;else if(Rl.type=="order"||Rl.type=="page"){let Al=await js.getPromise(itemByDoenetId(Rl.containingDoenetId));El={...Al},Ks=Al.parentDoenetId}let _l=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Ks})),Xs=_l[_l.length-1],xl=await js.getPromise(itemByDoenetId(Xs));qs=Xs,Xs||(Xs=Ks,xl=await js.getPromise(itemByDoenetId(Ks))),xl.type=="section"||xl.type=="bank"||xl.type=="activity"?Qs=Xs:(xl.type=="order"||xl.type=="page")&&(Qs=xl.containingDoenetId)}else if(Dl.length>1){Gs("Can only paste to one location.");return}else{let _l=await js.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Ml})),Xs=_l[_l.length-1];qs=Xs,qs||(qs=Ml);let xl=await js.getPromise(itemByDoenetId(Xs));xl.type=="section"||xl.type=="bank"||xl.type=="activity"?Qs=Xs:(xl.type=="order"||xl.type=="page")&&(Qs=xl.containingDoenetId)}if(qs||(qs=Ks),Nl.length>0){let _l=[],Xs=[],xl=[],Al=[],Sl=[];El&&(Sl=await Zs(El.doenetId));let Vl=!1;for(let Fs of Nl)if(Fs.type=="activity"||Fs.type=="bank"||Fs.type=="section"){Vl=!0;break}for(let Fs of Nl){if(Fs.type=="collectionLink"){Gs("Pasting collection links is not yet supported");return}if(Fs.type=="pageLink"){Gs("Pasting page links is not yet supported");return}if(Js=="section"&&(Fs.type=="page"||Fs.type=="order")&&!Vl){Gs(`Pasting ${Fs.type} in a section is not supported.`);return}if(Fs.type=="order"&&!Vl){Gs("Pasting orders is not yet supported");return}if(Js=="bank"&&Fs.type=="order"){Gs("Collections can only accept pages.");return}if(Sl.includes(Fs.doenetId)){Gs("Can't paste item into itself.");return}if((Fs.type=="activity"||Fs.type=="bank")&&_l.push(Fs.doenetId),Fs.type=="section"){let Cl=await Ys(Fs.doenetId);Cl=[...new Set(Cl)],Xs=[...Xs,...Cl],_l=[..._l,Fs.doenetId,...Cl]}(Fs.type=="order"||Fs.type=="page")&&!Vl&&xl.push({...Fs}),(Fs.type=="order"||Fs.type=="page")&&Al.push({...Fs})}if(Al.length>0&&Vl){let Fs=[];for(let Cl of _l){let Tl=await Hs(Cl);Fs=[...Fs,...Tl]}for(let Cl of Al)if(!Fs.includes(Cl.doenetId)){Gs("Can't paste pages or orders with other types.");return}}if(_l.length>0)try{let Fs=await axios.post("/api/moveContent.php",{courseId:as,doenetIdsToMove:_l,destParentDoenetId:Ks,destPreviousContainingItemDoenetId:Qs,noParentUpdateDoenetIds:Xs});if(Fs.status<300){for(let Tl of Nl)Us(itemByDoenetId(Tl.doenetId),zl=>{let Xl={...zl};return Xl.isBeingCut=!1,Xl.isSelected=!1,Xl});for(let Tl of _l)Xs.includes(Tl)||Us(itemByDoenetId(Tl),zl=>{let Xl={...zl};return Xl.parentDoenetId=Ks,Xl});let Cl=[];for(let Tl of _l){let zl=await Hs(Tl);Cl=[...Cl,...zl]}Cl=[...new Set(Cl)],Us(authorCourseItemOrderByCourseId(as),Tl=>{let zl=[...Tl];zl=zl.filter(Pl=>!Cl.includes(Pl));let Xl=zl.indexOf(qs)+1;if(Xl==0){let Pl=Tl.indexOf(qs)-1,Bl=Tl[Pl];for(;Pl>0&&!zl.includes(Bl);)Pl--,Bl=Tl[Pl];Xl=Pl+1}return zl.splice(Xl,0,...Cl),zl}),Ls==null||Ls()}else throw new Error(`response code: ${Fs.status}`)}catch(Fs){Gs(Fs.message)}if(xl.length>0){let Fs=El.type,Cl=El.doenetId,Tl,zl=!1,Xl;Fs=="bank"?Tl=[...El.pages]:Fs=="activity"&&(Tl=[...El.content]),El.isSinglePage&&(zl=!0,Xl=El.content[0]);let Pl=[],Bl=[],Wl=[],Ll=[],Hl;for(let Kl of xl){let Il=Kl.containingDoenetId,$l=Bl.indexOf(Il);if($l==-1){Ll.push([Kl.doenetId]),Bl.push(Il);let Yl=await js.getPromise(itemByDoenetId(Il));Pl.push(Yl.type);let Zl={};if(Yl.type=="activity")Zl=Es({content:Yl.content,needleDoenetId:Kl.doenetId}),El.doenetId==Yl.doenetId&&(Tl=Es({content:Tl,needleDoenetId:Kl.doenetId}),El.content=Tl);else if(Yl.type=="bank"){let eu=[...Yl.pages];if(eu.splice(Yl.pages.indexOf(Kl.doenetId),1),Zl=eu,El.doenetId==Yl.doenetId){let tu=[...Tl];tu.splice(Tl.indexOf(Kl.doenetId),1),Tl=tu}}Wl.push(Zl)}else{Ll[$l].push(Kl.doenetId);let Yl=Pl[$l],Zl=Wl[$l],eu={};if(Yl=="activity")eu=Es({content:Zl,needleDoenetId:Kl.doenetId}),El.doenetId==Kl.containingDoenetId&&(Tl=Es({content:Tl,needleDoenetId:Kl.doenetId}),El.content=Tl);else if(Yl=="bank"){let tu=[...Zl];if(tu.splice(Zl.indexOf(Kl.doenetId),1),eu=tu,El.doenetId==Kl.containingDoenetId){let nu=[...Tl];nu.splice(Tl.indexOf(Kl.doenetId),1),Tl=nu}}Wl[$l]=eu}}for(let Kl of xl)if(Fs=="bank")Tl.push(Kl.doenetId);else if(Fs=="activity"){let Il=Rl.doenetId;Rl.type=="page"&&(Il=Rl.parentDoenetId);let $l=Hl;({content:Tl,previousDoenetId:Hl}=ds({activityOrOrderObj:El,needleOrderOrActivityId:Il,itemToAdd:Kl.doenetId})),El.content=Tl,$l&&(Hl=$l),zl&&(Hl=Cl)}let Ql=Hl;if(!Ql){if(Rl.type=="bank")Rl.pages.length==0?Ql=Rl.doenetId:Ql=Rl.pages[Rl.pages.length-1];else if(Rl.type=="page"){let Kl=await js.getPromise(itemByDoenetId(Rl.containingDoenetId));Kl.type=="bank"&&(Kl.pages.length==0?Ql=Kl.doenetId:Ql=Kl.pages[Kl.pages.length-1])}}try{let Kl=await axios.post("/api/cutCopyAndPasteAPage.php",{isCopy:!1,courseId:as,originalPageDoenetIds:Ll,sourceTypes:Pl,sourceDoenetIds:Bl,sourceJSONs:Wl,destinationType:Fs,destinationDoenetId:Cl,destinationJSON:Tl,destinationWasASinglePageActivity:zl});if(Kl.status<300){let Il;Rl.type=="order"||Rl.type=="bank"||Rl.type=="activity"?Il=Rl.doenetId:Rl.type=="page"&&(Il=Rl.parentDoenetId);let $l=[];for(let[Yl,Zl]of Object.entries(Pl)){let eu=Bl[Yl],tu=Wl[Yl];for(let nu of Ll[Yl])$l.push(nu),Us(itemByDoenetId(nu),ru=>{let iu={...ru};return iu.containingDoenetId=Cl,iu.parentDoenetId=Il,iu.isBeingCut=!1,iu});eu!=Cl&&(Zl=="bank"?Us(itemByDoenetId(eu),nu=>{let ru={...nu};return ru.pages=tu,ru}):Zl=="activity"&&Us(itemByDoenetId(eu),nu=>{let ru={...nu};return ru.content=tu,ru}))}Fs=="bank"?Us(itemByDoenetId(Cl),Yl=>{let Zl={...Yl};return Zl.pages=Tl,Zl}):Fs=="activity"&&Us(itemByDoenetId(Cl),Yl=>{let Zl={...Yl};return Zl.content=Tl,zl&&(Zl.isSinglePage=!1),Zl}),Us(authorCourseItemOrderByCourseId(as),Yl=>{let Zl=[...Yl];for(let tu of $l)Zl.splice(Zl.indexOf(tu),1);let eu=Zl.indexOf(Ql)+1;if(eu==0){let tu=Yl.indexOf(Ql)-1,nu=Yl[tu];for(;tu>0&&!Zl.includes(nu);)tu--,nu=Yl[tu];eu=tu+1}return zl?Zl.splice(eu,0,Xl,...$l):Zl.splice(eu,0,...$l),Zl}),Ls==null||Ls()}else throw new Error(`response code: ${Kl.status}`)}catch(Kl){Gs(Kl.message)}}Us(copiedCourseItems,[...Nl]),Us(cutCourseItems,[]);return}}),Ws=Recoil_index_31(({snapshot:Us})=>async js=>{let Ls=[];for(let Gs of js){let Hs=await Us.getPromise(itemByDoenetId(Gs));if(Hs.type=="page")Ls.push(Hs.doenetId);else if(Hs.type=="activity"){let Ys=findPageDoenetIdsInAnOrder({orderObj:Hs.order,needleOrderDoenetId:"",foundNeedle:!0});Ls=[...Ls,...Ys]}else if(Hs.type=="order"){let Ys=await Us.getPromise(itemByDoenetId(Hs.containingDoenetId)),Zs=findPageDoenetIdsInAnOrder({orderObj:Ys.order,needleOrderDoenetId:Hs.doenetId,foundNeedle:!1});Ls=[...Ls,...Zs]}else if(Hs.type=="bank")Ls=[...Ls,...Hs.pages];else if(Hs.type=="section"){let Ys=await Us.getPromise(authorCourseItemOrderByCourseIdBySection({courseId:as,sectionId:Hs.doenetId})),Zs=await Ws(Ys);Ls=[...Ls,...Zs]}}return Ls=[...new Set(Ls)],Ls});return{label:rs,color:ns,image:ss,defaultRoleId:os,canAutoEnroll:ls,create:fs,deleteItem:ks,deleteCourse:xs,duplicateCourse:Cs,modifyCourse:hs,modifyRolePermissions:vs,renameItem:Ts,compileActivity:Ns,updateAssignItem:Ss,updateOrderBehavior:Vs,updateCollectionLink:Ds,updateContentLinksToSources:Is,copyItems:Ps,cutItems:Bs,pasteItems:Ms,findPagesFromDoenetIds:Ws,addUser:ys,modifyUserRole:bs}};function promisifyRequest(as){return new Promise((rs,ns)=>{as.oncomplete=as.onsuccess=()=>rs(as.result),as.onabort=as.onerror=()=>ns(as.error)})}function createStore$1(as,rs){const ns=indexedDB.open(as);ns.onupgradeneeded=()=>ns.result.createObjectStore(rs);const ss=promisifyRequest(ns);return(os,ls)=>ss.then(us=>ls(us.transaction(rs,os).objectStore(rs)))}let defaultGetStoreFunc;function defaultGetStore(){return defaultGetStoreFunc||(defaultGetStoreFunc=createStore$1("keyval-store","keyval")),defaultGetStoreFunc}function get$3(as,rs=defaultGetStore()){return rs("readonly",ns=>promisifyRequest(ns.get(as)))}function set(as,rs,ns=defaultGetStore()){return ns("readwrite",ss=>(ss.put(rs,as),promisifyRequest(ss.transaction)))}function clear(as=defaultGetStore()){return as("readwrite",rs=>(rs.clear(),promisifyRequest(rs.transaction)))}function eachCursor(as,rs){return as.openCursor().onsuccess=function(){this.result&&(rs(this.result),this.result.continue())},promisifyRequest(as.transaction)}function keys$4(as=defaultGetStore()){return as("readonly",rs=>{if(rs.getAllKeys)return promisifyRequest(rs.getAllKeys());const ns=[];return eachCursor(rs,ss=>ns.push(ss.key)).then(()=>ns)})}async function clearUsersInformationFromTheBrowser(){return localStorage.clear(),await axios.get("/api/signOut.php"),await clear(),!0}async function checkIfUserClearedOut(){let as=[],ns=(await keys$4()).length==0;ns||as.push("IndexedDB not removed");let ss=localStorage.length==0;ss||as.push("local storage not removed");const{data:os}=await axios.get("/api/getQuickCheckSignedIn.php"),ls=!(os!=null&&os.signedIn),us=document.cookie.split(";"),cs=us.length===1&&us[0]==="";let ds=cs&&ls;cs||as.push("cookie not removed"),ls||as.push("secure cookie not removed");let ps=!1;return ns&&ss&&ds&&(ps=!0),{userInformationIsCompletelyRemoved:ps,messageArray:as,cookieRemoved:ds}}async function loader$8({request:as}){const ns=new URL(as.url).searchParams.get("doenetId"),os=await(await fetch(`/api/getPortfolioActivityData.php?doenetId=${ns}`)).json(),ls=await checkIfUserClearedOut();let us=!0;ls.cookieRemoved&&(us=!1);let cs=null;if(us){const ps=await(await fetch("/api/getPorfolioCourseId.php")).json();cs=ps.portfolioCourseId,ps.portfolioCourseId==""&&(cs="not_created")}return{signedIn:us,portfolioCourseId:cs,activityData:os==null?void 0:os.activityData}}async function action$3({request:as}){const rs=await as.formData();let ns=Object.fromEntries(rs);if(ns._action=="Remix"){let os=await(await fetch(`/api/duplicatePortfolioActivity.php?doenetId=${ns.doenetId}`)).json();const{nextActivityDoenetId:ls,nextPageDoenetId:us}=os;return redirect(`/portfolioeditor/${ls}?tool=editor&doenetId=${ls}&pageId=${us}`)}return!0}const SupportWrapper=styled$1.div` overflow: auto; grid-area: supportPanel; background-color: var(--canvas); height: 100%; - display: ${({$hide:as})=>as?"none":"block"} + display: ${({$hide:as})=>as?"none":"block"}; `,ControlsWrapper=styled$1.div` overflow: auto; grid-area: supportControls; column-gap: 10px; display: ${({$hide:as})=>as?"none":"flex"}; - justify-content:flex-end; + justify-content: flex-end; background-color: var(--canvas); `;function SupportPanel({hide:as,children:rs}){const ns=useLoaderData(),ss=useNavigate(),os=Recoil_index_20(searchParamAtomFamily("doenetId")),ls=Recoil_index_20(pageToolViewAtom),{compileActivity:us,updateAssignItem:cs}=useCourse(ns==null?void 0:ns.courseId);let ds=!1;return(ls==null?void 0:ls.page)=="public"&&(ns==null?void 0:ns.userCanViewSource)=="1"&&(ds=!0),jsxs(Fragment,{children:[jsxs(ControlsWrapper,{$hide:as,"aria-label":"complementary controls","data-test":"Support Panel Controls",children:[(ls==null?void 0:ls.page)=="portfolioeditor"&&(ns==null?void 0:ns.public)=="1"?jsx$1(Button$2,{style:{background:"#ff7b00"},value:"Update Public Activity",onClick:()=>{us({activityDoenetId:os,isAssigned:!0,courseId:ns==null?void 0:ns.courseId}),cs({doenetId:os,isAssigned:!0,successCallback:()=>{}})}}):null,ds?jsxs(Form,{method:"post",children:[jsx$1(Button$2,{style:{marginTop:"8px"},value:"Remix"}),jsx$1("input",{type:"hidden",name:"_action",value:"Remix"}),jsx$1("input",{type:"hidden",name:"doenetId",value:os})]}):null,(ls==null?void 0:ls.page)=="portfolioeditor"?jsx$1(Button$2,{value:"Settings",onClick:()=>ss(`/portfolio/${os}/settings?referrer=portfolioeditor`)}):null,jsx$1(Button$2,{value:"Documentation",onClick:()=>window.open("/public?tool=editor&doenetId=_DG5JOeFNTc5rpWuf2uA-q")})]}),jsx$1(SupportWrapper,{$hide:as,role:"complementary","data-test":"Support Panel",children:rs})]})}function clamp$3(as,rs,ns){return Math.max(rs,Math.min(as,ns))}const V$2={toVector(as,rs){return as===void 0&&(as=rs),Array.isArray(as)?as:[as,as]},add(as,rs){return[as[0]+rs[0],as[1]+rs[1]]},sub(as,rs){return[as[0]-rs[0],as[1]-rs[1]]},addTo(as,rs){as[0]+=rs[0],as[1]+=rs[1]},subTo(as,rs){as[0]-=rs[0],as[1]-=rs[1]}};function rubberband(as,rs,ns){return rs===0||Math.abs(rs)===1/0?Math.pow(as,ns*5):as*rs*ns/(rs+ns*as)}function rubberbandIfOutOfBounds(as,rs,ns,ss=.15){return ss===0?clamp$3(as,rs,ns):asns?+rubberband(as-ns,ns-rs,ss)+ns:as}function computeRubberband(as,[rs,ns],[ss,os]){const[[ls,us],[cs,ds]]=as;return[rubberbandIfOutOfBounds(rs,ls,us,ss),rubberbandIfOutOfBounds(ns,cs,ds,os)]}function _defineProperty$3(as,rs,ns){return rs in as?Object.defineProperty(as,rs,{value:ns,enumerable:!0,configurable:!0,writable:!0}):as[rs]=ns,as}function ownKeys$3(as,rs){var ns=Object.keys(as);if(Object.getOwnPropertySymbols){var ss=Object.getOwnPropertySymbols(as);rs&&(ss=ss.filter(function(os){return Object.getOwnPropertyDescriptor(as,os).enumerable})),ns.push.apply(ns,ss)}return ns}function _objectSpread2(as){for(var rs=1;rs{var ns,ss;return rs.target===as.currentTarget||((ns=as.currentTarget)===null||ns===void 0||(ss=ns.contains)===null||ss===void 0?void 0:ss.call(ns,rs.target))})}function getTouchList(as){return as.type==="touchend"||as.type==="touchcancel"?as.changedTouches:as.targetTouches}function getValueEvent(as){return isTouch(as)?getTouchList(as)[0]:as}function touchIds(as){return getCurrentTargetTouchList(as).map(rs=>rs.identifier)}function pointerId(as){const rs=getValueEvent(as);return isTouch(as)?rs.identifier:rs.pointerId}function pointerValues(as){const rs=getValueEvent(as);return[rs.clientX,rs.clientY]}function getEventDetails(as){const rs={};if("buttons"in as&&(rs.buttons=as.buttons),"shiftKey"in as){const{shiftKey:ns,altKey:ss,metaKey:os,ctrlKey:ls}=as;Object.assign(rs,{shiftKey:ns,altKey:ss,metaKey:os,ctrlKey:ls})}return rs}function call(as,...rs){return typeof as=="function"?as(...rs):as}function noop$4(){}function chain$2(...as){return as.length===0?noop$4:as.length===1?as[0]:function(){let rs;for(const ns of as)rs=ns.apply(this,arguments)||rs;return rs}}function assignDefault(as,rs){return Object.assign({},rs,as||{})}const BEFORE_LAST_KINEMATICS_DELAY=32;class Engine{constructor(rs,ns,ss){this.ctrl=rs,this.args=ns,this.key=ss,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(rs){this.ctrl.state[this.key]=rs}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:rs,shared:ns,ingKey:ss,args:os}=this;ns[ss]=rs._active=rs.active=rs._blocked=rs._force=!1,rs._step=[!1,!1],rs.intentional=!1,rs._movement=[0,0],rs._distance=[0,0],rs._direction=[0,0],rs._delta=[0,0],rs._bounds=[[-1/0,1/0],[-1/0,1/0]],rs.args=os,rs.axis=void 0,rs.memo=void 0,rs.elapsedTime=0,rs.direction=[0,0],rs.distance=[0,0],rs.overflow=[0,0],rs._movementBound=[!1,!1],rs.velocity=[0,0],rs.movement=[0,0],rs.delta=[0,0],rs.timeStamp=0}start(rs){const ns=this.state,ss=this.config;ns._active||(this.reset(),this.computeInitial(),ns._active=!0,ns.target=rs.target,ns.currentTarget=rs.currentTarget,ns.lastOffset=ss.from?call(ss.from,ns):ns.offset,ns.offset=ns.lastOffset),ns.startTime=ns.timeStamp=rs.timeStamp}computeValues(rs){const ns=this.state;ns._values=rs,ns.values=this.config.transform(rs)}computeInitial(){const rs=this.state;rs._initial=rs._values,rs.initial=rs.values}compute(rs){const{state:ns,config:ss,shared:os}=this;ns.args=this.args;let ls=0;if(rs&&(ns.event=rs,ss.preventDefault&&rs.cancelable&&ns.event.preventDefault(),ns.type=rs.type,os.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,os.locked=!!document.pointerLockElement,Object.assign(os,getEventDetails(rs)),os.down=os.pressed=os.buttons%2===1||os.touches>0,ls=rs.timeStamp-ns.timeStamp,ns.timeStamp=rs.timeStamp,ns.elapsedTime=ns.timeStamp-ns.startTime),ns._active){const ws=ns._delta.map(Math.abs);V$2.addTo(ns._distance,ws)}this.axisIntent&&this.axisIntent(rs);const[us,cs]=ns._movement,[ds,ps]=ss.threshold,{_step:fs,values:hs}=ns;if(ss.hasCustomTransform?(fs[0]===!1&&(fs[0]=Math.abs(us)>=ds&&hs[0]),fs[1]===!1&&(fs[1]=Math.abs(cs)>=ps&&hs[1])):(fs[0]===!1&&(fs[0]=Math.abs(us)>=ds&&Math.sign(us)*ds),fs[1]===!1&&(fs[1]=Math.abs(cs)>=ps&&Math.sign(cs)*ps)),ns.intentional=fs[0]!==!1||fs[1]!==!1,!ns.intentional)return;const gs=[0,0];if(ss.hasCustomTransform){const[ws,Es]=hs;gs[0]=fs[0]!==!1?ws-fs[0]:0,gs[1]=fs[1]!==!1?Es-fs[1]:0}else gs[0]=fs[0]!==!1?us-fs[0]:0,gs[1]=fs[1]!==!1?cs-fs[1]:0;this.restrictToAxis&&!ns._blocked&&this.restrictToAxis(gs);const ys=ns.offset,bs=ns._active&&!ns._blocked||ns.active;bs&&(ns.first=ns._active&&!ns.active,ns.last=!ns._active&&ns.active,ns.active=os[this.ingKey]=ns._active,rs&&(ns.first&&("bounds"in ss&&(ns._bounds=call(ss.bounds,ns)),this.setup&&this.setup()),ns.movement=gs,this.computeOffset()));const[vs,xs]=ns.offset,[[Cs,Ts],[Ss,Ns]]=ns._bounds;ns.overflow=[vsTs?1:0,xsNs?1:0],ns._movementBound[0]=ns.overflow[0]?ns._movementBound[0]===!1?ns._movement[0]:ns._movementBound[0]:!1,ns._movementBound[1]=ns.overflow[1]?ns._movementBound[1]===!1?ns._movement[1]:ns._movementBound[1]:!1;const As=ns._active?ss.rubberband||[0,0]:[0,0];if(ns.offset=computeRubberband(ns._bounds,ns.offset,As),ns.delta=V$2.sub(ns.offset,ys),this.computeMovement(),bs&&(!ns.last||ls>BEFORE_LAST_KINEMATICS_DELAY)){ns.delta=V$2.sub(ns.offset,ys);const ws=ns.delta.map(Math.abs);V$2.addTo(ns.distance,ws),ns.direction=ns.delta.map(Math.sign),ns._direction=ns._delta.map(Math.sign),!ns.first&&ls>0&&(ns.velocity=[ws[0]/ls,ws[1]/ls])}}emit(){const rs=this.state,ns=this.shared,ss=this.config;if(rs._active||this.clean(),(rs._blocked||!rs.intentional)&&!rs._force&&!ss.triggerAllEvents)return;const os=this.handler(_objectSpread2(_objectSpread2(_objectSpread2({},ns),rs),{},{[this.aliasKey]:rs.values}));os!==void 0&&(rs.memo=os)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function selectAxis([as,rs],ns){const ss=Math.abs(as),os=Math.abs(rs);if(ss>os&&ss>ns)return"x";if(os>ss&&os>ns)return"y"}class CoordinatesEngine extends Engine{constructor(...rs){super(...rs),_defineProperty$3(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=V$2.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=V$2.sub(this.state.offset,this.state.lastOffset)}axisIntent(rs){const ns=this.state,ss=this.config;if(!ns.axis&&rs){const os=typeof ss.axisThreshold=="object"?ss.axisThreshold[getPointerType(rs)]:ss.axisThreshold;ns.axis=selectAxis(ns._movement,os)}ns._blocked=(ss.lockDirection||!!ss.axis)&&!ns.axis||!!ss.axis&&ss.axis!==ns.axis}restrictToAxis(rs){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":rs[1]=0;break;case"y":rs[0]=0;break}}}const identity$2=as=>as,DEFAULT_RUBBERBAND=.15,commonConfigResolver={enabled(as=!0){return as},eventOptions(as,rs,ns){return _objectSpread2(_objectSpread2({},ns.shared.eventOptions),as)},preventDefault(as=!1){return as},triggerAllEvents(as=!1){return as},rubberband(as=0){switch(as){case!0:return[DEFAULT_RUBBERBAND,DEFAULT_RUBBERBAND];case!1:return[0,0];default:return V$2.toVector(as)}},from(as){if(typeof as=="function")return as;if(as!=null)return V$2.toVector(as)},transform(as,rs,ns){const ss=as||ns.shared.transform;return this.hasCustomTransform=!!ss,ss||identity$2},threshold(as){return V$2.toVector(as,0)}},DEFAULT_AXIS_THRESHOLD=0,coordinatesConfigResolver=_objectSpread2(_objectSpread2({},commonConfigResolver),{},{axis(as,rs,{axis:ns}){if(this.lockDirection=ns==="lock",!this.lockDirection)return ns},axisThreshold(as=DEFAULT_AXIS_THRESHOLD){return as},bounds(as={}){if(typeof as=="function")return ls=>coordinatesConfigResolver.bounds(as(ls));if("current"in as)return()=>as.current;if(typeof HTMLElement=="function"&&as instanceof HTMLElement)return as;const{left:rs=-1/0,right:ns=1/0,top:ss=-1/0,bottom:os=1/0}=as;return[[rs,ns],[ss,os]]}}),DISPLACEMENT=10,KEYS_DELTA_MAP={ArrowRight:(as=1)=>[DISPLACEMENT*as,0],ArrowLeft:(as=1)=>[-DISPLACEMENT*as,0],ArrowUp:(as=1)=>[0,-DISPLACEMENT*as],ArrowDown:(as=1)=>[0,DISPLACEMENT*as]};class DragEngine extends CoordinatesEngine{constructor(...rs){super(...rs),_defineProperty$3(this,"ingKey","dragging")}reset(){super.reset();const rs=this.state;rs._pointerId=void 0,rs._pointerActive=!1,rs._keyboardActive=!1,rs._preventScroll=!1,rs._delayed=!1,rs.swipe=[0,0],rs.tap=!1,rs.canceled=!1,rs.cancel=this.cancel.bind(this)}setup(){const rs=this.state;if(rs._bounds instanceof HTMLElement){const ns=rs._bounds.getBoundingClientRect(),ss=rs.currentTarget.getBoundingClientRect(),os={left:ns.left-ss.left+rs.offset[0],right:ns.right-ss.right+rs.offset[0],top:ns.top-ss.top+rs.offset[1],bottom:ns.bottom-ss.bottom+rs.offset[1]};rs._bounds=coordinatesConfigResolver.bounds(os)}}cancel(){const rs=this.state;rs.canceled||(rs.canceled=!0,rs._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(rs){const ns=this.config,ss=this.state;if(rs.buttons!=null&&(Array.isArray(ns.pointerButtons)?!ns.pointerButtons.includes(rs.buttons):ns.pointerButtons!==-1&&ns.pointerButtons!==rs.buttons))return;const os=this.ctrl.setEventIds(rs);ns.pointerCapture&&rs.target.setPointerCapture(rs.pointerId),!(os&&os.size>1&&ss._pointerActive)&&(this.start(rs),this.setupPointer(rs),ss._pointerId=pointerId(rs),ss._pointerActive=!0,this.computeValues(pointerValues(rs)),this.computeInitial(),ns.preventScrollAxis&&getPointerType(rs)!=="mouse"?(ss._active=!1,this.setupScrollPrevention(rs)):ns.delay>0?(this.setupDelayTrigger(rs),ns.triggerAllEvents&&(this.compute(rs),this.emit())):this.startPointerDrag(rs))}startPointerDrag(rs){const ns=this.state;ns._active=!0,ns._preventScroll=!0,ns._delayed=!1,this.compute(rs),this.emit()}pointerMove(rs){const ns=this.state,ss=this.config;if(!ns._pointerActive||ns.type===rs.type&&rs.timeStamp===ns.timeStamp)return;const os=pointerId(rs);if(ns._pointerId!==void 0&&os!==ns._pointerId)return;const ls=pointerValues(rs);if(document.pointerLockElement===rs.target?ns._delta=[rs.movementX,rs.movementY]:(ns._delta=V$2.sub(ls,ns._values),this.computeValues(ls)),V$2.addTo(ns._movement,ns._delta),this.compute(rs),ns._delayed&&ns.intentional){this.timeoutStore.remove("dragDelay"),ns.active=!1,this.startPointerDrag(rs);return}if(ss.preventScrollAxis&&!ns._preventScroll)if(ns.axis)if(ns.axis===ss.preventScrollAxis||ss.preventScrollAxis==="xy"){ns._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(rs);return}else return;this.emit()}pointerUp(rs){this.ctrl.setEventIds(rs);try{this.config.pointerCapture&&rs.target.hasPointerCapture(rs.pointerId)&&rs.target.releasePointerCapture(rs.pointerId)}catch{}const ns=this.state,ss=this.config;if(!ns._active||!ns._pointerActive)return;const os=pointerId(rs);if(ns._pointerId!==void 0&&os!==ns._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(rs);const[ls,us]=ns._distance;if(ns.tap=ls<=ss.tapsThreshold&&us<=ss.tapsThreshold,ns.tap&&ss.filterTaps)ns._force=!0;else{const[cs,ds]=ns.direction,[ps,fs]=ns.velocity,[hs,gs]=ns.movement,[ys,bs]=ss.swipe.velocity,[vs,xs]=ss.swipe.distance,Cs=ss.swipe.duration;ns.elapsedTimeys&&Math.abs(hs)>vs&&(ns.swipe[0]=cs),Math.abs(fs)>bs&&Math.abs(gs)>xs&&(ns.swipe[1]=ds))}this.emit()}pointerClick(rs){!this.state.tap&&rs.detail>0&&(rs.preventDefault(),rs.stopPropagation())}setupPointer(rs){const ns=this.config,ss=ns.device;ns.pointerLock&&rs.currentTarget.requestPointerLock(),ns.pointerCapture||(this.eventStore.add(this.sharedConfig.window,ss,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,ss,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,ss,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(rs){this.state._preventScroll&&rs.cancelable&&rs.preventDefault()}setupScrollPrevention(rs){this.state._preventScroll=!1,persistEvent(rs);const ns=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",ns),this.eventStore.add(this.sharedConfig.window,"touch","cancel",ns),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,rs)}setupDelayTrigger(rs){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(rs)},this.config.delay)}keyDown(rs){const ns=KEYS_DELTA_MAP[rs.key];if(ns){const ss=this.state,os=rs.shiftKey?10:rs.altKey?.1:1;this.start(rs),ss._delta=ns(os),ss._keyboardActive=!0,V$2.addTo(ss._movement,ss._delta),this.compute(rs),this.emit()}}keyUp(rs){rs.key in KEYS_DELTA_MAP&&(this.state._keyboardActive=!1,this.setActive(),this.compute(rs),this.emit())}bind(rs){const ns=this.config.device;rs(ns,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(rs(ns,"change",this.pointerMove.bind(this)),rs(ns,"end",this.pointerUp.bind(this)),rs(ns,"cancel",this.pointerUp.bind(this)),rs("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(rs("key","down",this.keyDown.bind(this)),rs("key","up",this.keyUp.bind(this))),this.config.filterTaps&&rs("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function persistEvent(as){"persist"in as&&typeof as.persist=="function"&&as.persist()}const isBrowser$2=typeof window<"u"&&window.document&&window.document.createElement;function supportsTouchEvents(){return isBrowser$2&&"ontouchstart"in window}function isTouchScreen(){return supportsTouchEvents()||isBrowser$2&&window.navigator.maxTouchPoints>1}function supportsPointerEvents(){return isBrowser$2&&"onpointerdown"in window}function supportsPointerLock(){return isBrowser$2&&"exitPointerLock"in window.document}function supportsGestureEvents(){try{return"constructor"in GestureEvent}catch{return!1}}const SUPPORT={isBrowser:isBrowser$2,gesture:supportsGestureEvents(),touch:isTouchScreen(),touchscreen:isTouchScreen(),pointer:supportsPointerEvents(),pointerLock:supportsPointerLock()},DEFAULT_PREVENT_SCROLL_DELAY=250,DEFAULT_DRAG_DELAY=180,DEFAULT_SWIPE_VELOCITY=.5,DEFAULT_SWIPE_DISTANCE=50,DEFAULT_SWIPE_DURATION=250,DEFAULT_DRAG_AXIS_THRESHOLD={mouse:0,touch:0,pen:8},dragConfigResolver=_objectSpread2(_objectSpread2({},coordinatesConfigResolver),{},{device(as,rs,{pointer:{touch:ns=!1,lock:ss=!1,mouse:os=!1}={}}){return this.pointerLock=ss&&SUPPORT.pointerLock,SUPPORT.touch&&ns?"touch":this.pointerLock?"mouse":SUPPORT.pointer&&!os?"pointer":SUPPORT.touch?"touch":"mouse"},preventScrollAxis(as,rs,{preventScroll:ns}){if(this.preventScrollDelay=typeof ns=="number"?ns:ns||ns===void 0&&as?DEFAULT_PREVENT_SCROLL_DELAY:void 0,!(!SUPPORT.touchscreen||ns===!1))return as||(ns!==void 0?"y":void 0)},pointerCapture(as,rs,{pointer:{capture:ns=!0,buttons:ss=1,keys:os=!0}={}}){return this.pointerButtons=ss,this.keys=os,!this.pointerLock&&this.device==="pointer"&&ns},threshold(as,rs,{filterTaps:ns=!1,tapsThreshold:ss=3,axis:os=void 0}){const ls=V$2.toVector(as,ns?ss:os?1:0);return this.filterTaps=ns,this.tapsThreshold=ss,ls},swipe({velocity:as=DEFAULT_SWIPE_VELOCITY,distance:rs=DEFAULT_SWIPE_DISTANCE,duration:ns=DEFAULT_SWIPE_DURATION}={}){return{velocity:this.transform(V$2.toVector(as)),distance:this.transform(V$2.toVector(rs)),duration:ns}},delay(as=0){switch(as){case!0:return DEFAULT_DRAG_DELAY;case!1:return 0;default:return as}},axisThreshold(as){return as?_objectSpread2(_objectSpread2({},DEFAULT_DRAG_AXIS_THRESHOLD),as):DEFAULT_DRAG_AXIS_THRESHOLD}});_objectSpread2(_objectSpread2({},commonConfigResolver),{},{device(as,rs,{shared:ns,pointer:{touch:ss=!1}={}}){if(ns.target&&!SUPPORT.touch&&SUPPORT.gesture)return"gesture";if(SUPPORT.touch&&ss)return"touch";if(SUPPORT.touchscreen){if(SUPPORT.pointer)return"pointer";if(SUPPORT.touch)return"touch"}},bounds(as,rs,{scaleBounds:ns={},angleBounds:ss={}}){const os=us=>{const cs=assignDefault(call(ns,us),{min:-1/0,max:1/0});return[cs.min,cs.max]},ls=us=>{const cs=assignDefault(call(ss,us),{min:-1/0,max:1/0});return[cs.min,cs.max]};return typeof ns!="function"&&typeof ss!="function"?[os(),ls()]:us=>[os(us),ls(us)]},threshold(as,rs,ns){return this.lockDirection=ns.axis==="lock",V$2.toVector(as,this.lockDirection?[.1,3]:0)},modifierKey(as){return as===void 0?"ctrlKey":as},pinchOnWheel(as=!0){return as}});_objectSpread2(_objectSpread2({},coordinatesConfigResolver),{},{mouseOnly:(as=!0)=>as});_objectSpread2(_objectSpread2({},coordinatesConfigResolver),{},{mouseOnly:(as=!0)=>as});const EngineMap=new Map,ConfigResolverMap=new Map;function registerAction(as){EngineMap.set(as.key,as.engine),ConfigResolverMap.set(as.key,as.resolver)}const dragAction={key:"drag",engine:DragEngine,resolver:dragConfigResolver};function _objectWithoutPropertiesLoose$1(as,rs){if(as==null)return{};var ns={},ss=Object.keys(as),os,ls;for(ls=0;ls=0)&&(ns[os]=as[os]);return ns}function _objectWithoutProperties$1(as,rs){if(as==null)return{};var ns=_objectWithoutPropertiesLoose$1(as,rs),ss,os;if(Object.getOwnPropertySymbols){var ls=Object.getOwnPropertySymbols(as);for(os=0;os=0)&&Object.prototype.propertyIsEnumerable.call(as,ss)&&(ns[ss]=as[ss])}return ns}const sharedConfigResolver={target(as){if(as)return()=>"current"in as?as.current:as},enabled(as=!0){return as},window(as=SUPPORT.isBrowser?window:void 0){return as},eventOptions({passive:as=!0,capture:rs=!1}={}){return{passive:as,capture:rs}},transform(as){return as}},_excluded$1=["target","eventOptions","window","enabled","transform"];function resolveWith(as={},rs){const ns={};for(const[ss,os]of Object.entries(rs))switch(typeof os){case"function":ns[ss]=os.call(ns,as[ss],ss,as);break;case"object":ns[ss]=resolveWith(as[ss],os);break;case"boolean":os&&(ns[ss]=as[ss]);break}return ns}function parse$4(as,rs,ns={}){const ss=as,{target:os,eventOptions:ls,window:us,enabled:cs,transform:ds}=ss,ps=_objectWithoutProperties$1(ss,_excluded$1);if(ns.shared=resolveWith({target:os,eventOptions:ls,window:us,enabled:cs,transform:ds},sharedConfigResolver),rs){const fs=ConfigResolverMap.get(rs);ns[rs]=resolveWith(_objectSpread2({shared:ns.shared},ps),fs)}else for(const fs in ps){const hs=ConfigResolverMap.get(fs);hs&&(ns[fs]=resolveWith(_objectSpread2({shared:ns.shared},ps[fs]),hs))}return ns}class EventStore{constructor(rs,ns){_defineProperty$3(this,"_listeners",new Set),this._ctrl=rs,this._gestureKey=ns}add(rs,ns,ss,os,ls){const us=this._listeners,cs=toDomEventType(ns,ss),ds=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},ps=_objectSpread2(_objectSpread2({},ds),ls);rs.addEventListener(cs,os,ps);const fs=()=>{rs.removeEventListener(cs,os,ps),us.delete(fs)};return us.add(fs),fs}clean(){this._listeners.forEach(rs=>rs()),this._listeners.clear()}}class TimeoutStore{constructor(){_defineProperty$3(this,"_timeouts",new Map)}add(rs,ns,ss=140,...os){this.remove(rs),this._timeouts.set(rs,window.setTimeout(ns,ss,...os))}remove(rs){const ns=this._timeouts.get(rs);ns&&window.clearTimeout(ns)}clean(){this._timeouts.forEach(rs=>void window.clearTimeout(rs)),this._timeouts.clear()}}class Controller{constructor(rs){_defineProperty$3(this,"gestures",new Set),_defineProperty$3(this,"_targetEventStore",new EventStore(this)),_defineProperty$3(this,"gestureEventStores",{}),_defineProperty$3(this,"gestureTimeoutStores",{}),_defineProperty$3(this,"handlers",{}),_defineProperty$3(this,"config",{}),_defineProperty$3(this,"pointerIds",new Set),_defineProperty$3(this,"touchIds",new Set),_defineProperty$3(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),resolveGestures(this,rs)}setEventIds(rs){if(isTouch(rs))return this.touchIds=new Set(touchIds(rs)),this.touchIds;if("pointerId"in rs)return rs.type==="pointerup"||rs.type==="pointercancel"?this.pointerIds.delete(rs.pointerId):rs.type==="pointerdown"&&this.pointerIds.add(rs.pointerId),this.pointerIds}applyHandlers(rs,ns){this.handlers=rs,this.nativeHandlers=ns}applyConfig(rs,ns){this.config=parse$4(rs,ns,this.config)}clean(){this._targetEventStore.clean();for(const rs of this.gestures)this.gestureEventStores[rs].clean(),this.gestureTimeoutStores[rs].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...rs){const ns=this.config.shared,ss={};let os;if(!(ns.target&&(os=ns.target(),!os))){if(ns.enabled){for(const us of this.gestures){const cs=this.config[us],ds=bindToProps(ss,cs.eventOptions,!!os);if(cs.enabled){const ps=EngineMap.get(us);new ps(this,rs,us).bind(ds)}}const ls=bindToProps(ss,ns.eventOptions,!!os);for(const us in this.nativeHandlers)ls(us,"",cs=>this.nativeHandlers[us](_objectSpread2(_objectSpread2({},this.state.shared),{},{event:cs,args:rs})),void 0,!0)}for(const ls in ss)ss[ls]=chain$2(...ss[ls]);if(!os)return ss;for(const ls in ss){const{device:us,capture:cs,passive:ds}=parseProp(ls);this._targetEventStore.add(os,us,"",ss[ls],{capture:cs,passive:ds})}}}}function setupGesture(as,rs){as.gestures.add(rs),as.gestureEventStores[rs]=new EventStore(as,rs),as.gestureTimeoutStores[rs]=new TimeoutStore}function resolveGestures(as,rs){rs.drag&&setupGesture(as,"drag"),rs.wheel&&setupGesture(as,"wheel"),rs.scroll&&setupGesture(as,"scroll"),rs.move&&setupGesture(as,"move"),rs.pinch&&setupGesture(as,"pinch"),rs.hover&&setupGesture(as,"hover")}const bindToProps=(as,rs,ns)=>(ss,os,ls,us={},cs=!1)=>{var ds,ps;const fs=(ds=us.capture)!==null&&ds!==void 0?ds:rs.capture,hs=(ps=us.passive)!==null&&ps!==void 0?ps:rs.passive;let gs=cs?ss:toHandlerProp(ss,os,fs);ns&&hs&&(gs+="Passive"),as[gs]=as[gs]||[],as[gs].push(ls)},RE_NOT_NATIVE=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function sortHandlers(as){const rs={},ns={},ss=new Set;for(let os in as)RE_NOT_NATIVE.test(os)?(ss.add(RegExp.lastMatch),ns[os]=as[os]):rs[os]=as[os];return[ns,rs,ss]}function registerGesture(as,rs,ns,ss,os,ls){if(!as.has(ns)||!EngineMap.has(ss))return;const us=ns+"Start",cs=ns+"End",ds=ps=>{let fs;return ps.first&&us in rs&&rs[us](ps),ns in rs&&(fs=rs[ns](ps)),ps.last&&cs in rs&&rs[cs](ps),fs};os[ss]=ds,ls[ss]=ls[ss]||{}}function parseMergedHandlers(as,rs){const[ns,ss,os]=sortHandlers(as),ls={};return registerGesture(os,ns,"onDrag","drag",ls,rs),registerGesture(os,ns,"onWheel","wheel",ls,rs),registerGesture(os,ns,"onScroll","scroll",ls,rs),registerGesture(os,ns,"onPinch","pinch",ls,rs),registerGesture(os,ns,"onMove","move",ls,rs),registerGesture(os,ns,"onHover","hover",ls,rs),{handlers:ls,config:rs,nativeHandlers:ss}}function useRecognizers(as,rs={},ns,ss){const os=React.useMemo(()=>new Controller(as),[]);if(os.applyHandlers(as,ss),os.applyConfig(rs,ns),React.useEffect(os.effect.bind(os)),React.useEffect(()=>os.clean.bind(os),[]),rs.target===void 0)return os.bind.bind(os)}function createUseGesture(as){return as.forEach(registerAction),function(ns,ss){const{handlers:os,nativeHandlers:ls,config:us}=parseMergedHandlers(ns,ss||{});return useRecognizers(os,us,void 0,ls)}}const handleDirection={LEFT:{flexDir:"row-reverse",vertical:!0,rounding:"10px 0px 0px 10px",drag:["x",-1]},RIGHT:{flexDir:"row",vertical:!0,rounding:"0px 10px 10px 0px",drag:["x",1]},UP:{flexDir:"column-reverse",vertical:!1,rounding:"10px 10px 0px 0px",drag:["y",-1]},DOWN:{flexDir:"column",vertical:!1,rounding:"0px 0px 10px 10px",drag:["y",1]}},Wrapper=styled$1(animated.div)` grid-area: ${({$gridArea:as})=>as??""}; @@ -1228,7 +1228,7 @@ ${Ks}`;try{let Qs=await axios.post("/api/saveCompiledActivity.php",{c box-sizing: border-box; border: var(--canvastext); color: var(--canvastext); -`,profileAtom=Recoil_index_8({key:"profileAtom",default:Recoil_index_9({key:"profileAtom/Default",get:async()=>{try{const{data:as}=await axios.get("/api/loadProfile.php");return as.profile}catch(as){return console.error("Error loading user profile",as.message),{}}}})}),searchParamAtomFamily=Recoil_index_10({key:"searchParamAtomFamily",default:""});Recoil_index_8({key:"paramObjAtom",default:{}});function ToolRoot(){const[as,rs]=reactExports.useState({pageName:"init",menuPanelCap:"",currentMenus:[],menusTitles:[],menusInitOpen:[],currentMainPanel:"Empty",supportPanelOptions:[],supportPanelTitles:[],supportPanelIndex:0,hasNoMenuPanel:!1,hasNoHeaderPanel:!1,headerControls:[],displaySettings:!0,footer:null});let ns=null,ss=jsx$1(SupportPanel,{hide:!0,children:"null"});const[os,ls]=reactExports.useState(!0),us=reactExports.useRef({Empty:reactExports.lazy(()=>__vitePreload(()=>import("./Empty-8983c1e6.js"),[])),NotFound:reactExports.lazy(()=>__vitePreload(()=>import("./NotFound-9ccac229.js"),[])),AccountSettings:reactExports.lazy(()=>__vitePreload(()=>import("./AccountSettings-b92cab8a.js"),["assets/AccountSettings-b92cab8a.js","assets/AccountSettings-0a946905.css"])),HomePanel:reactExports.lazy(()=>__vitePreload(()=>import("./HomePanel-846b604a.js"),["assets/HomePanel-846b604a.js","assets/HomePanel-91e1d724.css"])),PublicActivityViewer:reactExports.lazy(()=>__vitePreload(()=>import("./PublicActivityViewer-9764fa71.js"),["assets/PublicActivityViewer-9764fa71.js","assets/ActivityViewer-3a815948.js","assets/activityUtils-c08c1686.js","assets/visibility-sensor-55e75ed1.js","assets/ActionButton-f612d279.js","assets/ButtonGroup-ea123297.js"])),CourseCards:reactExports.lazy(()=>__vitePreload(()=>import("./CourseCards-95d1a251.js"),["assets/CourseCards-95d1a251.js","assets/CourseToolHandler-f517d0e5.js","assets/index-ef9c2520.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-ea123297.js","assets/util-10e10a40.css","assets/CourseCards-d970b417.css"])),SignIn:reactExports.lazy(()=>__vitePreload(()=>import("./SignIn-7d60e5d1.js"),["assets/SignIn-7d60e5d1.js","assets/Textfield-5d92f495.js"])),SignOut:reactExports.lazy(()=>__vitePreload(()=>import("./SignOut-22ad4d36.js"),[])),NavigationPanel:reactExports.lazy(()=>__vitePreload(()=>import("./NavigationPanel-03f23df4.js"),["assets/NavigationPanel-03f23df4.js","assets/CourseNavigator-119cf888.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/ButtonGroup-ea123297.js","assets/util-10e10a40.css"])),Dashboard:reactExports.lazy(()=>__vitePreload(()=>import("./Dashboard-2c19557a.js"),["assets/Dashboard-2c19557a.js","assets/Next7Days-4c381b9d.js","assets/CourseToolHandler-f517d0e5.js","assets/index-ef9c2520.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-ea123297.js","assets/util-10e10a40.css","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js"])),Gradebook:reactExports.lazy(()=>__vitePreload(()=>import("./Gradebook-e81ca638.js"),["assets/Gradebook-e81ca638.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js"])),GradebookAssignment:reactExports.lazy(()=>__vitePreload(()=>import("./GradebookAssignment-5ba543e4.js"),["assets/GradebookAssignment-5ba543e4.js","assets/Gradebook-e81ca638.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-ea123297.js"])),GradebookStudent:reactExports.lazy(()=>__vitePreload(()=>import("./GradebookStudent-3db9146c.js"),["assets/GradebookStudent-3db9146c.js","assets/Gradebook-e81ca638.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js"])),GradebookStudentAssignment:reactExports.lazy(()=>__vitePreload(()=>import("./GradebookStudentAssignment-bd8851a3.js"),["assets/GradebookStudentAssignment-bd8851a3.js","assets/Gradebook-e81ca638.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/AssignmentViewer-f9c5976c.js","assets/ActivityViewer-3a815948.js","assets/activityUtils-c08c1686.js","assets/visibility-sensor-55e75ed1.js","assets/ActionButton-f612d279.js","assets/ButtonGroup-ea123297.js"])),GradebookAttempt:reactExports.lazy(()=>__vitePreload(()=>import("./GradebookAttempt-a6141e36.js"),["assets/GradebookAttempt-a6141e36.js","assets/Gradebook-e81ca638.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js"])),EditorViewer:reactExports.lazy(()=>__vitePreload(()=>import("./EditorViewer-55cb3454.js").then(bs=>bs.E),["assets/EditorViewer-55cb3454.js","assets/EditorViewerRecoil-41e59102.js"])),AssignmentViewer:reactExports.lazy(()=>__vitePreload(()=>import("./AssignmentViewer-f9c5976c.js"),["assets/AssignmentViewer-f9c5976c.js","assets/ActivityViewer-3a815948.js","assets/activityUtils-c08c1686.js","assets/visibility-sensor-55e75ed1.js","assets/ActionButton-f612d279.js","assets/ButtonGroup-ea123297.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js"])),DraftAssignmentViewer:reactExports.lazy(()=>__vitePreload(()=>import("./DraftAssignmentViewer-820f180d.js"),["assets/DraftAssignmentViewer-820f180d.js","assets/ActivityViewer-3a815948.js","assets/activityUtils-c08c1686.js","assets/visibility-sensor-55e75ed1.js","assets/ActionButton-f612d279.js","assets/ButtonGroup-ea123297.js"])),DataPanel:reactExports.lazy(()=>__vitePreload(()=>import("./DataPanel-ec5657fe.js"),["assets/DataPanel-ec5657fe.js","assets/CourseNavigator-119cf888.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/ButtonGroup-ea123297.js","assets/util-10e10a40.css"])),SurveyDataViewer:reactExports.lazy(()=>__vitePreload(()=>import("./SurveyDataViewer-e3a247b1.js"),[])),DoenetMLEditor:reactExports.lazy(()=>__vitePreload(()=>import("./DoenetMLEditor-cb24eb95.js"),["assets/DoenetMLEditor-cb24eb95.js","assets/CodeMirror-35f8e4ac.js","assets/useSaveDraft-a42d0f94.js","assets/EditorViewerRecoil-41e59102.js"])),People:reactExports.lazy(()=>__vitePreload(()=>import("./People-969f3e38.js"),["assets/People-969f3e38.js","assets/SettingComponents-ce5fbb6e.js","assets/CourseToolHandler-f517d0e5.js","assets/index-ef9c2520.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-ea123297.js","assets/util-10e10a40.css","assets/CollapseSection-a6fcd8bf.js","assets/util-38d8e238.js","assets/DateTime-ef0be144.js","assets/moment-f5bb98f1.js","assets/DateTime-adf9b6b7.css","assets/DropdownMenu-9b4c45a6.js","assets/RelatedItems-96588168.js","assets/RoleDropdown-5e05ae49.js","assets/Textfield-5d92f495.js","assets/LoadPeople-f0cdb3f5.js","assets/index-2e9c8a8a.js"])),ChooseLearnerPanel:reactExports.lazy(()=>__vitePreload(()=>import("./ChooseLearnerPanel-76d33139.js"),["assets/ChooseLearnerPanel-76d33139.js","assets/ButtonGroup-ea123297.js"])),SignInRedirector:reactExports.lazy(()=>__vitePreload(()=>import("./SignInRedirector-dac636ed.js"),[])),EndExamPanel:reactExports.lazy(()=>__vitePreload(()=>import("./EndExamPanel-f3f7d295.js"),[])),EndPlacementExamPanel:reactExports.lazy(()=>__vitePreload(()=>import("./EndPlacementExamPanel-0d1b65fe.js"),[])),WelcomePlacementExam:reactExports.lazy(()=>__vitePreload(()=>import("./WelcomePlacementExam-00c07185.js"),["assets/WelcomePlacementExam-00c07185.js","assets/ButtonGroup-ea123297.js"])),GuestDoenetMLEditor:reactExports.lazy(()=>__vitePreload(()=>import("./GuestDoenetMLEditor-23386a22.js"),["assets/GuestDoenetMLEditor-23386a22.js","assets/EditorViewerRecoil-41e59102.js","assets/CodeMirror-35f8e4ac.js"])),GuestEditorViewer:reactExports.lazy(()=>__vitePreload(()=>import("./GuestEditorViewer-0594be68.js"),["assets/GuestEditorViewer-0594be68.js","assets/EditorViewer-55cb3454.js","assets/EditorViewerRecoil-41e59102.js","assets/activityUtils-c08c1686.js"])),RolesEditor:reactExports.lazy(()=>__vitePreload(()=>import("./RoleEditor-9df6b9b1.js"),["assets/RoleEditor-9df6b9b1.js","assets/SettingComponents-ce5fbb6e.js","assets/CourseToolHandler-f517d0e5.js","assets/index-ef9c2520.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-ea123297.js","assets/util-10e10a40.css","assets/CollapseSection-a6fcd8bf.js","assets/util-38d8e238.js","assets/DateTime-ef0be144.js","assets/moment-f5bb98f1.js","assets/DateTime-adf9b6b7.css","assets/DropdownMenu-9b4c45a6.js","assets/RelatedItems-96588168.js","assets/RoleDropdown-5e05ae49.js","assets/Textfield-5d92f495.js"]))}).current,cs=reactExports.useRef({BackButton:reactExports.lazy(()=>__vitePreload(()=>import("./BackButton-050a812f.js"),[])),ViewerUpdateButton:reactExports.lazy(()=>__vitePreload(()=>import("./ViewerUpdateButton-b5a8c465.js"),["assets/ViewerUpdateButton-b5a8c465.js","assets/EditorViewer-55cb3454.js","assets/EditorViewerRecoil-41e59102.js"])),NavigationBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./NavigationBreadCrumb-40475a81.js"),["assets/NavigationBreadCrumb-40475a81.js","assets/BreadCrumb-c66b383a.js","assets/breadcrumbUtil-6dfe85b1.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-e81ca638.js"])),ChooserBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./ChooserBreadCrumb-6e2de5c4.js"),["assets/ChooserBreadCrumb-6e2de5c4.js","assets/BreadCrumb-c66b383a.js","assets/breadcrumbUtil-6dfe85b1.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-e81ca638.js"])),DashboardBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./DashboardBreadCrumb-e2186312.js"),["assets/DashboardBreadCrumb-e2186312.js","assets/BreadCrumb-c66b383a.js","assets/breadcrumbUtil-6dfe85b1.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-e81ca638.js"])),PeopleBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./PeopleBreadCrumb-20144419.js"),["assets/PeopleBreadCrumb-20144419.js","assets/BreadCrumb-c66b383a.js","assets/breadcrumbUtil-6dfe85b1.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-e81ca638.js"])),DataBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./DataBreadCrumb-9cf897ea.js"),["assets/DataBreadCrumb-9cf897ea.js","assets/BreadCrumb-c66b383a.js","assets/breadcrumbUtil-6dfe85b1.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-e81ca638.js"])),EditorBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./EditorBreadCrumb-281f518e.js"),["assets/EditorBreadCrumb-281f518e.js","assets/BreadCrumb-c66b383a.js","assets/breadcrumbUtil-6dfe85b1.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-e81ca638.js"])),PortfolioBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./PortfolioBreadCrumb-3fd96794.js"),["assets/PortfolioBreadCrumb-3fd96794.js","assets/BreadCrumb-c66b383a.js"])),GradebookBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./GradebookBreadCrumb-4c7b8962.js"),["assets/GradebookBreadCrumb-4c7b8962.js","assets/BreadCrumb-c66b383a.js","assets/breadcrumbUtil-6dfe85b1.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-e81ca638.js"])),AssignmentBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./AssignmentBreadCrumb-321ce7e2.js"),["assets/AssignmentBreadCrumb-321ce7e2.js","assets/BreadCrumb-c66b383a.js","assets/breadcrumbUtil-6dfe85b1.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-e81ca638.js"])),AssignmentNewAttempt:reactExports.lazy(()=>__vitePreload(()=>import("./AssignmentNewAttempt-bd7b8592.js"),["assets/AssignmentNewAttempt-bd7b8592.js","assets/CourseToolHandler-f517d0e5.js","assets/index-ef9c2520.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-ea123297.js","assets/util-10e10a40.css","assets/AssignmentViewer-f9c5976c.js","assets/ActivityViewer-3a815948.js","assets/activityUtils-c08c1686.js","assets/visibility-sensor-55e75ed1.js","assets/ActionButton-f612d279.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js"])),ActivityNavigationButtons:reactExports.lazy(()=>__vitePreload(()=>import("./ActivityNavigationButtons-a3d39ee0.js"),["assets/ActivityNavigationButtons-a3d39ee0.js","assets/ButtonGroup-ea123297.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js"]))}).current,ds=reactExports.useRef({MathInputKeyboard:reactExports.lazy(()=>__vitePreload(()=>import("./MathInputKeyboard-592dc150.js"),["assets/MathInputKeyboard-592dc150.js","assets/ToggleButton-57def544.js","assets/ToggleButtonGroup-c2629620.js","assets/MathInputSelector-58bfc077.js"]))}).current;let ps=`${as.pageName}-${as.currentMainPanel}`;if(ns=jsx$1(reactExports.Suspense,{fallback:jsxs(LoadingFallback,{children:[jsx$1(Svg,{viewBox:"0 0 130 140",children:jsxs(DonutG1,{children:[jsx$1(Circle$2,{id:"donut",fill:"var(--donutBody)",r:"60"}),jsx$1(Circle$2,{id:"donut-topping",fill:"var(--donutTopping)",r:"48"}),jsx$1(Circle$2,{id:"donut-hole",fill:"var(--canvas)",r:"19"})]})}),jsx$1(Svg,{viewBox:"0 0 130 140",children:jsxs(DonutG2,{children:[jsx$1(Circle$2,{id:"donut",fill:"var(--donutBody)",r:"60"}),jsx$1(Circle$2,{id:"donut-topping",fill:"var(--donutTopping)",r:"48"}),jsx$1(Circle$2,{id:"donut-hole",fill:"var(--canvas)",r:"19"})]})}),jsx$1(Svg,{viewBox:"0 0 130 140",children:jsxs(DonutG3,{children:[jsx$1(Circle$2,{id:"donut",fill:"var(--donutBody)",r:"60"}),jsx$1(Circle$2,{id:"donut-topping",fill:"var(--donutTopping)",r:"48"}),jsx$1(Circle$2,{id:"donut-hole",fill:"var(--canvas)",r:"19"})]})})]}),children:React.createElement(us[as.currentMainPanel],{MainPanelKey:ps})},ps),as!=null&&as.supportPanelOptions&&(as==null?void 0:as.supportPanelOptions.length)>0){const bs=as.supportPanelOptions[as.supportPanelIndex],vs=`${as.pageName}-${as.supportPanelOptions[as.supportPanelIndex]}-${as.supportPanelIndex}`;ss=jsx$1(SupportPanel,{hide:!1,panelTitles:as.supportPanelTitles,panelIndex:as.supportPanelIndex,children:jsx$1(reactExports.Suspense,{fallback:jsx$1(LoadingFallback,{display:"static",children:jsx$1(Table$2,{children:jsxs(TBody,{children:[jsxs(Tr$1,{children:[jsx$1(Td$1,{className:"Td2"}),jsx$1(Td$1,{className:"Td3",children:jsx$1(Td3Span,{})})]}),jsxs(Tr$1,{children:[jsx$1(Td$1,{className:"Td2"}),jsx$1(Td$1,{className:"Td3",children:jsx$1(Td3Span,{})})]}),jsxs(Tr$1,{children:[jsx$1(Td$1,{className:"Td2"}),jsx$1(Td$1,{className:"Td3",children:jsx$1(Td3Span,{})})]}),jsxs(Tr$1,{children:[jsx$1(Td$1,{className:"Td2"}),jsx$1(Td$1,{className:"Td3",children:jsx$1(Td3Span,{})})]}),jsxs(Tr$1,{children:[jsx$1(Td$1,{className:"Td2"}),jsx$1(Td$1,{className:"Td3",children:jsx$1(Td3Span,{})})]})]})})}),children:React.createElement(us[bs],{SupportPanelKey:vs})},vs)})}let fs=null;if(as.headerControls){fs=[];for(const[,bs]of Object.entries(as.headerControls)){const vs=cs[bs];if(vs){const xs=`headerControls${ps}`;fs.push(jsx$1(reactExports.Suspense,{fallback:jsx$1(LoadingFallback,{children:jsx$1(BreadcrumbContainer,{children:jsx$1(BreadcrumbOutline,{})})}),children:React.createElement(vs,{key:{key:xs}})},xs))}}}let hs=jsx$1(MenuPanel,{hide:!0},"menuPanel");os&&!as.hasNoMenuPanel&&(hs=jsx$1(MenuPanel,{hide:!1,setMenusOpen:ls,menusOpen:os,menuPanelCap:as.menuPanelCap,menusTitles:as.menusTitles,currentMenus:as.currentMenus,initOpen:as.menusInitOpen,displaySettings:as.displaySettings},"menuPanel"));let gs=!os;as.hasNoMenuPanel&&(gs=!1);let ys=null;if(as.footer){let bs="footer";ys=jsx$1(NavPanel,{id:"keyboard",isInitOpen:as.footer.open,height:as.footer.height,"aria-label":"keyboard",children:jsx$1(reactExports.Suspense,{fallback:jsx$1(LoadingFallback,{children:"loading..."}),children:React.createElement(ds[as.footer.component],{key:{footerKey:bs}})},bs)})}return jsxs(Fragment,{children:[jsxs(ToolContainer,{children:[hs,jsx$1(ContentPanel,{main:jsx$1(MainPanel,{headerControls:fs,setMenusOpen:ls,openMenuButton:gs,displaySettings:as.displaySettings,hasNoHeaderPanel:as.hasNoHeaderPanel,children:ns}),hasNoHeaderPanel:as.hasNoHeaderPanel,support:ss}),ys]}),jsx$1(Toast$1,{}),jsx$1(MemoizedRootController,{setToolRootMenusAndPanels:rs},"root_controller"),jsx$1(MemoizedOnLeave,{},"MemoizedOnLeave")]})}let navigationObj={placementexam:{default:{defaultTool:"exam"},exam:{pageName:"exam",currentMainPanel:"AssignmentViewer",currentMenus:["TimerMenu"],menusTitles:["Time Remaining"],menusInitOpen:[!0],headerControls:[],displaySettings:!1,hasNoMenuPanel:!0,hasNoHeaderPanel:!0,waitForMenuSuppression:!0,footer:{height:250,open:!1,component:"MathInputKeyboard"}},endExam:{pageName:"endExam",currentMainPanel:"EndPlacementExamPanel",displaySettings:!1,hasNoMenuPanel:!0}},umn:{default:{defaultTool:"signIn"},signIn:{pageName:"signIn",currentMainPanel:"SignInRedirector",displaySettings:!1,hasNoMenuPanel:!0}},portfolioeditor:{editor:{pageName:"PortfolioEditor",menuPanelCap:"PortfilioEditorInfoCap",currentMainPanel:"EditorViewer",currentMenus:["PageVariant","PageLink","SupportingFilesMenu"],menusTitles:["Page Variant","Page Link","Supporting Files"],menusInitOpen:[!1,!1],supportPanelOptions:["DoenetMLEditor"],supportPanelTitles:["DoenetML Editor"],supportPanelIndex:0,headerControls:["PortfolioBreadCrumb","ViewerUpdateButton"],footer:{height:250,open:!1,component:"MathInputKeyboard"},waitForMenuSuppression:!0}},exam:{default:{defaultTool:"chooseLearner"},chooseLearner:{pageName:"chooseLearner",currentMainPanel:"ChooseLearnerPanel",displaySettings:!1},assessment:{pageName:"Assessment",menuPanelCap:"AssignmentInfoCap",currentMainPanel:"AssignmentViewer",currentMenus:["TimerMenu"],menusTitles:["Time Remaining"],menusInitOpen:[!0],headerControls:[],displaySettings:!1,waitForMenuSuppression:!0,footer:{height:250,open:!1,component:"MathInputKeyboard"}},endExam:{pageName:"endExam",currentMainPanel:"EndExamPanel",displaySettings:!1,hasNoMenuPanel:!0}},course:{default:{defaultTool:"courseChooser"},assignment:{pageName:"Assignment",menuPanelCap:"AssignmentInfoCap",currentMainPanel:"AssignmentViewer",currentMenus:["CreditAchieved","TimerMenu","ActivityDates"],menusTitles:["Credit Achieved","Time Remaining","Details"],menusInitOpen:[!0,!0,!1],headerControls:["AssignmentBreadCrumb","AssignmentNewAttempt","ActivityNavigationButtons"],waitForMenuSuppression:!0,footer:{height:250,open:!1,component:"MathInputKeyboard"}},courseChooser:{pageName:"Course",currentMainPanel:"CourseCards",currentMenus:["CreateCourse"],menusTitles:["Create Course"],menusInitOpen:[!0],headerControls:["ChooserBreadCrumb"],onLeave:"CourseChooserLeave"},dashboard:{pageName:"Dashboards",currentMainPanel:"Dashboard",menuPanelCap:"DriveInfoCap",currentMenus:["ClassTimes","CurrentContent"],menusTitles:["Class Times","Content by week settings"],menusInitOpen:[!1,!1],headerControls:["DashboardBreadCrumb"],onLeave:"DashboardLeave",waitForMenuSuppression:!0,color:"var(--canvastext)"},draftactivity:{pageName:"DraftActivity",menuPanelCap:"DraftActivityCap",currentMainPanel:"DraftAssignmentViewer",currentMenus:["ActivityVariant"],menusTitles:["Activity Variant"],menusInitOpen:[],headerControls:["AssignmentBreadCrumb"],footer:{height:250,open:!1,component:"MathInputKeyboard"}},endExam:{pageName:"endExam",currentMainPanel:"EndExamPanel",menuPanelCap:"AssignmentInfoCap",currentMenus:["CreditAchieved"],menusTitles:["Credit Achieved"],menusInitOpen:[!0],headerControls:["AssignmentBreadCrumb"]},gradebook:{pageName:"Gradebook",currentMainPanel:"Gradebook",menuPanelCap:"DriveInfoCap",currentMenus:["GradeDownload"],menusTitles:["Download"],menusInitOpen:[!1],headerControls:["GradebookBreadCrumb"],waitForMenuSuppression:!0},gradebookAssignment:{pageName:"Gradebook",currentMainPanel:"GradebookAssignment",currentMenus:["GradeUpload"],menusTitles:["Upload"],menusInitOpen:[!1],menuPanelCap:"DriveInfoCap",headerControls:["GradebookBreadCrumb"],waitForMenuSuppression:!0,onLeave:"GradebookAssignmentLeave"},gradebookStudent:{pageName:"Gradebook",currentMainPanel:"GradebookStudent",currentMenus:[],menuPanelCap:"DriveInfoCap",menusTitles:[],menusInitOpen:[],headerControls:["GradebookBreadCrumb"]},gradebookStudentAssignment:{pageName:"Gradebook",currentMainPanel:"GradebookStudentAssignment",menuPanelCap:"DriveInfoCap",currentMenus:["CreditAchieved","GradeSettings"],menusTitles:["Credit Achieved","Settings"],menusInitOpen:[!0,!1],headerControls:["GradebookBreadCrumb"],waitForMenuSuppression:!0},navigation:{pageName:"Course",currentMainPanel:"NavigationPanel",menuPanelCap:"DriveInfoCap",currentMenus:["CutCopyPasteMenu","AddDriveItems"],menusTitles:["Cut, Copy and Paste","Add Items"],menusInitOpen:[!0,!0],headerControls:["NavigationBreadCrumb"],onLeave:"NavigationLeave",waitForMenuSuppression:!0},editor:{pageName:"Course",menuPanelCap:"EditorInfoCap",currentMainPanel:"EditorViewer",currentMenus:["PageVariant","PageLink","AssignmentSettingsMenu","SupportingFilesMenu"],menusTitles:["Page Variant","Page Link","Assignment Settings","Supporting Files"],menusInitOpen:[!1,!1],supportPanelOptions:["DoenetMLEditor"],supportPanelTitles:["DoenetML Editor"],supportPanelIndex:0,headerControls:["EditorBreadCrumb","ViewerUpdateButton"],footer:{height:250,open:!1,component:"MathInputKeyboard"},waitForMenuSuppression:!0},people:{pageName:"People",menuPanelCap:"DriveInfoCap",currentMenus:["LoadPeople"],menusTitles:["Import Learners"],menusInitOpen:[!1],currentMainPanel:"People",supportPanelOptions:["RolesEditor"],supportPanelTitles:["Roles Editor"],supportPanelIndex:0,headerControls:["PeopleBreadCrumb"],initialProportion:1},data:{pageName:"data",menuPanelCap:"DataCap",currentMainPanel:"DataPanel",headerControls:["DataBreadCrumb"]}},home:{default:{pageName:"Home",currentMenus:[],menusTitles:[],menusInitOpen:[],currentMainPanel:"HomePanel",supportPanelOptions:[],supportPanelTitles:[],supportPanelIndex:0,hasNoMenuPanel:!0,hasNoHeaderPanel:!0,displaySettings:!1}},notfound:{default:{pageName:"Notfound",currentMenus:[],menusInitOpen:[],currentMainPanel:"NotFound",supportPanelOptions:[],hasNoMenuPanel:!0}},public:{default:{pageName:"PublicActivityViewer",currentMenus:[],menusTitles:[],menusInitOpen:[],currentMainPanel:"PublicActivityViewer",supportPanelOptions:[],supportPanelTitles:[],supportPanelIndex:0,hasNoMenuPanel:!0},editor:{pageName:"GuestEditor",currentMainPanel:"GuestEditorViewer",currentMenus:["PageVariant"],menusTitles:["Page Variant"],menusInitOpen:[!1],supportPanelOptions:["GuestDoenetMLEditor"],supportPanelTitles:["DoenetML Editor"],supportPanelIndex:0,headerControls:["ViewerUpdateButton"],footer:{height:250,open:!1,component:"MathInputKeyboard"}}},settings:{default:{pageName:"Settings",currentMenus:[],menusTitles:[],menusInitOpen:[],currentMainPanel:"AccountSettings",supportPanelOptions:[],supportPanelTitles:[],supportPanelIndex:0,hasNoMenuPanel:!0,headerControls:["BackButton"],displaySettings:!1}},signin:{default:{pageName:"SignIn",currentMenus:[],menusTitles:[],menusInitOpen:[],currentMainPanel:"SignIn",supportPanelOptions:[],supportPanelTitles:[],supportPanelIndex:0,hasNoMenuPanel:!0,displaySettings:!1}},signout:{default:{pageName:"SignOut",currentMenus:[],menusTitles:[],menusInitOpen:[],currentMainPanel:"SignOut",supportPanelOptions:[],supportPanelTitles:[],supportPanelIndex:0,hasNoMenuPanel:!0,displaySettings:!1}}},encodeParams=as=>Object.entries(as).map(rs=>rs.map(encodeURIComponent).join("=")).join("&");const pageToolViewAtom=Recoil_index_8({key:"pageToolViewAtom",default:{page:"init",tool:"",view:""}}),onLeaveComponentStr=Recoil_index_8({key:"onLeaveComponentStr",default:{str:null,updateNum:0}});Recoil_index_8({key:"finishedOnLeave",default:null});const MemoizedOnLeave=React.memo(OnLeave);function OnLeave(){const rs=Recoil_index_20(onLeaveComponentStr).str;let ns=null;const ss=reactExports.useRef({NavigationLeave:reactExports.lazy(()=>__vitePreload(()=>import("./NavigationLeave-30aa839b.js"),[])),CourseChooserLeave:reactExports.lazy(()=>__vitePreload(()=>import("./CourseChooserLeave-4b6fdccb.js"),["assets/CourseChooserLeave-4b6fdccb.js","assets/CourseToolHandler-f517d0e5.js","assets/index-ef9c2520.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-ea123297.js","assets/util-10e10a40.css"])),DashboardLeave:reactExports.lazy(()=>__vitePreload(()=>import("./DashboardLeave-a2045124.js"),["assets/DashboardLeave-a2045124.js","assets/CourseToolHandler-f517d0e5.js","assets/index-ef9c2520.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-ea123297.js","assets/util-10e10a40.css"])),GradebookAssignmentLeave:reactExports.lazy(()=>__vitePreload(()=>import("./GradebookAssignmentLeave-9f4420f7.js"),["assets/GradebookAssignmentLeave-9f4420f7.js","assets/GradebookAssignment-5ba543e4.js","assets/Gradebook-e81ca638.js","assets/RoleDropdown-5e05ae49.js","assets/DropdownMenu-9b4c45a6.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-ea123297.js"]))}).current;if(rs){const os=`leave${rs}`;ns=jsx$1(reactExports.Suspense,{fallback:null,children:React.createElement(ss[rs])},os)}return jsx$1(Fragment,{children:ns})}const suppressMenusAtom=Recoil_index_8({key:"suppressMenusAtom",default:null});function arraysEqual(as,rs){if(as===rs)return!0;if(as==null||rs==null||as.length!==rs.length)return!1;for(var ns=0;nsks=>{for(const[Ps,Bs]of Object.entries(ks))bs.current[Ps]!==Bs&&Vs(searchParamAtomFamily(Ps),Bs);for(const Ps of Object.keys(bs.current))ks[Ps]||Vs(searchParamAtomFamily(Ps),"")});let xs=reactExports.useRef(null),Cs=reactExports.useRef([]),Ts=`${gs.pathname}${gs.search}`,Ss={page:"",tool:"",view:""},Ns=null,As=(Is=(Os=navigationObj[rs.page])==null?void 0:Os[rs.tool])==null?void 0:Is.initialProportion;reactExports.useEffect(()=>{let Vs=As;Vs||(Vs=.5),us(ks=>{let Ps={...ks};return Ps.proportion=Vs,Ps})},[As]);let ws=!arraysEqual(os,Cs.current);if(Cs.current=os,ws&&os!==null){if(Ns={...navigationObj[rs.page][rs.tool]},Ns.currentMenus=[...navigationObj[rs.page][rs.tool].currentMenus],Ns.menusTitles=[...navigationObj[rs.page][rs.tool].menusTitles],Ns.menusInitOpen=[...navigationObj[rs.page][rs.tool].menusInitOpen],os.length>0)for(let Vs of os)for(let[ks,Ps]of Object.entries(Ns.currentMenus))Ps===Vs&&(Ns.currentMenus.splice(ks,1),Ns.menusTitles.splice(ks,1),Ns.menusInitOpen.splice(ks,1));return as.setToolRootMenusAndPanels(Ns),null}let Es=!1;if(Ts!==hs.current){if(Es=!0,Ss.page=gs.pathname.split("/")[1].toLowerCase(),Ss.page===""){Ss.page="home";const ks=window.location.origin+window.location.pathname+"home";window.history.replaceState("","",ks)}let Vs=Object.fromEntries(new URLSearchParams(gs.search));Ss.tool=Vs.tool,Ss.tool||(Ss.tool="")}let _s=!1;if(JSON.stringify(cs.current)!==JSON.stringify(rs)){if(_s=!0,rs.back){ds.current.page==="init"&&(ds.current.page="home");let Vs={...ds.current,params:ps.current};return ns(Vs),null}Ss={...rs}}if(!Es&&!_s)return hs.current=Ts,null;let $s=!1,Rs=!1;cs.current.page!==Ss.page?($s=!0,Ss.tool===""?(Ns=navigationObj[Ss.page].default,Object.keys(Ns).includes("defaultTool")&&(window.location.pathname+gs.pathname+""+encodeParams({tool:Ns.defaultTool}),Ns=navigationObj[Ss.page][Ns.defaultTool])):Ns=navigationObj[Ss.page][Ss.tool]):cs.current.tool!==Ss.tool?(Rs=!0,Ns=navigationObj[Ss.page][Ss.tool]):cs.current.view!==Ss.view&&(Ns={...navigationObj[Ss.page][Ss.tool]});let Ds={};if(Es&&(Ds=Object.fromEntries(new URLSearchParams(gs.search)),vs(Ds),Ss.params={...Ds},delete Ss.params.tool,ns(Ss)),($s||Rs)&&(xs.current&&ss(Vs=>({str:xs.current,updateNum:Vs.updateNum+1})),xs.current=null,Ns&&Ns.onLeave&&(xs.current=Ns.onLeave),ls(null)),Ns&&Ns.displaySettings===void 0&&(Ns.displaySettings=!0),Ns&&JSON.stringify(Ss)!==JSON.stringify(cs.current)){ds.current=cs.current;let Vs={};if(Es?Vs=Ds:_s&&(Vs=rs.params),ps.current=fs.current,fs.current=Vs,Ns.waitForMenuSuppression){let ks={...Ns};ks.currentMenus=[],ks.menusInitOpen=[],ks.menusTitles=[],ks.headerControls=[],as.setToolRootMenusAndPanels(ks)}else as.setToolRootMenusAndPanels(Ns)}if(_s){let Vs=Ss.tool,ks="/"+rs.page;Ds={...rs.params},Vs!==""&&Vs!==void 0&&(Ds={tool:Vs,...rs.params});let Ps="";Object.keys(Ds).length>0&&(Ps="?"+encodeParams(Ds));const Bs=ks+Ps;gs.search!==Ps&&vs(Ds),(gs.pathname!==ks||gs.search!==Ps)&&ys(Bs)}return bs.current=Ds,hs.current=Ts,cs.current=Ss,null}const LoadingFallback=styled$1.div` +`,profileAtom=Recoil_index_8({key:"profileAtom",default:Recoil_index_9({key:"profileAtom/Default",get:async()=>{try{const{data:as}=await axios.get("/api/loadProfile.php");return as.profile}catch(as){return console.error("Error loading user profile",as.message),{}}}})}),searchParamAtomFamily=Recoil_index_10({key:"searchParamAtomFamily",default:""});Recoil_index_8({key:"paramObjAtom",default:{}});function ToolRoot(){const[as,rs]=reactExports.useState({pageName:"init",menuPanelCap:"",currentMenus:[],menusTitles:[],menusInitOpen:[],currentMainPanel:"Empty",supportPanelOptions:[],supportPanelTitles:[],supportPanelIndex:0,hasNoMenuPanel:!1,hasNoHeaderPanel:!1,headerControls:[],displaySettings:!0,footer:null});let ns=null,ss=jsx$1(SupportPanel,{hide:!0,children:"null"});const[os,ls]=reactExports.useState(!0),us=reactExports.useRef({Empty:reactExports.lazy(()=>__vitePreload(()=>import("./Empty-92901ef6.js"),[])),NotFound:reactExports.lazy(()=>__vitePreload(()=>import("./NotFound-bf4000be.js"),[])),AccountSettings:reactExports.lazy(()=>__vitePreload(()=>import("./AccountSettings-3b4a6bf6.js"),["assets/AccountSettings-3b4a6bf6.js","assets/AccountSettings-0a946905.css"])),HomePanel:reactExports.lazy(()=>__vitePreload(()=>import("./HomePanel-92cda016.js"),["assets/HomePanel-92cda016.js","assets/HomePanel-91e1d724.css"])),PublicActivityViewer:reactExports.lazy(()=>__vitePreload(()=>import("./PublicActivityViewer-c966c5e8.js"),["assets/PublicActivityViewer-c966c5e8.js","assets/ActivityViewer-becda8c0.js","assets/activityUtils-9c5f1536.js","assets/visibility-sensor-7d414852.js","assets/ActionButton-e5ea2a2f.js","assets/ButtonGroup-9136da6d.js"])),CourseCards:reactExports.lazy(()=>__vitePreload(()=>import("./CourseCards-8c3bc170.js"),["assets/CourseCards-8c3bc170.js","assets/CourseToolHandler-8716455d.js","assets/index-67ec2c85.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-9136da6d.js","assets/util-10e10a40.css","assets/CourseCards-d970b417.css"])),SignIn:reactExports.lazy(()=>__vitePreload(()=>import("./SignIn-bd7fec31.js"),["assets/SignIn-bd7fec31.js","assets/Textfield-9c1c2968.js"])),SignOut:reactExports.lazy(()=>__vitePreload(()=>import("./SignOut-57113399.js"),[])),NavigationPanel:reactExports.lazy(()=>__vitePreload(()=>import("./NavigationPanel-ad98872c.js"),["assets/NavigationPanel-ad98872c.js","assets/CourseNavigator-d0c5e95b.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/ButtonGroup-9136da6d.js","assets/util-10e10a40.css"])),Dashboard:reactExports.lazy(()=>__vitePreload(()=>import("./Dashboard-7ac6765c.js"),["assets/Dashboard-7ac6765c.js","assets/Next7Days-ac4b7e6b.js","assets/CourseToolHandler-8716455d.js","assets/index-67ec2c85.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-9136da6d.js","assets/util-10e10a40.css","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js"])),Gradebook:reactExports.lazy(()=>__vitePreload(()=>import("./Gradebook-06d28967.js"),["assets/Gradebook-06d28967.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js"])),GradebookAssignment:reactExports.lazy(()=>__vitePreload(()=>import("./GradebookAssignment-dd849113.js"),["assets/GradebookAssignment-dd849113.js","assets/Gradebook-06d28967.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-9136da6d.js"])),GradebookStudent:reactExports.lazy(()=>__vitePreload(()=>import("./GradebookStudent-9c718d84.js"),["assets/GradebookStudent-9c718d84.js","assets/Gradebook-06d28967.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js"])),GradebookStudentAssignment:reactExports.lazy(()=>__vitePreload(()=>import("./GradebookStudentAssignment-5a7c7d7f.js"),["assets/GradebookStudentAssignment-5a7c7d7f.js","assets/Gradebook-06d28967.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/AssignmentViewer-1be0d831.js","assets/ActivityViewer-becda8c0.js","assets/activityUtils-9c5f1536.js","assets/visibility-sensor-7d414852.js","assets/ActionButton-e5ea2a2f.js","assets/ButtonGroup-9136da6d.js"])),GradebookAttempt:reactExports.lazy(()=>__vitePreload(()=>import("./GradebookAttempt-0fa07a03.js"),["assets/GradebookAttempt-0fa07a03.js","assets/Gradebook-06d28967.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js"])),EditorViewer:reactExports.lazy(()=>__vitePreload(()=>import("./EditorViewer-d9b9074f.js").then(bs=>bs.E),["assets/EditorViewer-d9b9074f.js","assets/EditorViewerRecoil-fb47fc9d.js"])),AssignmentViewer:reactExports.lazy(()=>__vitePreload(()=>import("./AssignmentViewer-1be0d831.js"),["assets/AssignmentViewer-1be0d831.js","assets/ActivityViewer-becda8c0.js","assets/activityUtils-9c5f1536.js","assets/visibility-sensor-7d414852.js","assets/ActionButton-e5ea2a2f.js","assets/ButtonGroup-9136da6d.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js"])),DraftAssignmentViewer:reactExports.lazy(()=>__vitePreload(()=>import("./DraftAssignmentViewer-a259f19d.js"),["assets/DraftAssignmentViewer-a259f19d.js","assets/ActivityViewer-becda8c0.js","assets/activityUtils-9c5f1536.js","assets/visibility-sensor-7d414852.js","assets/ActionButton-e5ea2a2f.js","assets/ButtonGroup-9136da6d.js"])),DataPanel:reactExports.lazy(()=>__vitePreload(()=>import("./DataPanel-212649a7.js"),["assets/DataPanel-212649a7.js","assets/CourseNavigator-d0c5e95b.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/ButtonGroup-9136da6d.js","assets/util-10e10a40.css"])),SurveyDataViewer:reactExports.lazy(()=>__vitePreload(()=>import("./SurveyDataViewer-ada0bb46.js"),[])),DoenetMLEditor:reactExports.lazy(()=>__vitePreload(()=>import("./DoenetMLEditor-078d36f5.js"),["assets/DoenetMLEditor-078d36f5.js","assets/CodeMirror-87ecbb8f.js","assets/useSaveDraft-5f9f3fe4.js","assets/EditorViewerRecoil-fb47fc9d.js"])),People:reactExports.lazy(()=>__vitePreload(()=>import("./People-6d866472.js"),["assets/People-6d866472.js","assets/SettingComponents-43f86399.js","assets/CourseToolHandler-8716455d.js","assets/index-67ec2c85.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-9136da6d.js","assets/util-10e10a40.css","assets/CollapseSection-cb27678a.js","assets/util-38d8e238.js","assets/DateTime-d0a20943.js","assets/moment-3cda1086.js","assets/DateTime-adf9b6b7.css","assets/DropdownMenu-f3593bed.js","assets/RelatedItems-33b68fba.js","assets/RoleDropdown-cce90708.js","assets/Textfield-9c1c2968.js","assets/LoadPeople-0fec718e.js","assets/index-a475a6f9.js"])),ChooseLearnerPanel:reactExports.lazy(()=>__vitePreload(()=>import("./ChooseLearnerPanel-bdcfc317.js"),["assets/ChooseLearnerPanel-bdcfc317.js","assets/ButtonGroup-9136da6d.js"])),SignInRedirector:reactExports.lazy(()=>__vitePreload(()=>import("./SignInRedirector-0d623eba.js"),[])),EndExamPanel:reactExports.lazy(()=>__vitePreload(()=>import("./EndExamPanel-81101893.js"),[])),EndPlacementExamPanel:reactExports.lazy(()=>__vitePreload(()=>import("./EndPlacementExamPanel-8a6e246e.js"),[])),WelcomePlacementExam:reactExports.lazy(()=>__vitePreload(()=>import("./WelcomePlacementExam-689a9033.js"),["assets/WelcomePlacementExam-689a9033.js","assets/ButtonGroup-9136da6d.js"])),GuestDoenetMLEditor:reactExports.lazy(()=>__vitePreload(()=>import("./GuestDoenetMLEditor-0c6d5e54.js"),["assets/GuestDoenetMLEditor-0c6d5e54.js","assets/EditorViewerRecoil-fb47fc9d.js","assets/CodeMirror-87ecbb8f.js"])),GuestEditorViewer:reactExports.lazy(()=>__vitePreload(()=>import("./GuestEditorViewer-77c3ad69.js"),["assets/GuestEditorViewer-77c3ad69.js","assets/EditorViewer-d9b9074f.js","assets/EditorViewerRecoil-fb47fc9d.js","assets/activityUtils-9c5f1536.js"])),RolesEditor:reactExports.lazy(()=>__vitePreload(()=>import("./RoleEditor-05e83640.js"),["assets/RoleEditor-05e83640.js","assets/SettingComponents-43f86399.js","assets/CourseToolHandler-8716455d.js","assets/index-67ec2c85.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-9136da6d.js","assets/util-10e10a40.css","assets/CollapseSection-cb27678a.js","assets/util-38d8e238.js","assets/DateTime-d0a20943.js","assets/moment-3cda1086.js","assets/DateTime-adf9b6b7.css","assets/DropdownMenu-f3593bed.js","assets/RelatedItems-33b68fba.js","assets/RoleDropdown-cce90708.js","assets/Textfield-9c1c2968.js"]))}).current,cs=reactExports.useRef({BackButton:reactExports.lazy(()=>__vitePreload(()=>import("./BackButton-998fcaf2.js"),[])),ViewerUpdateButton:reactExports.lazy(()=>__vitePreload(()=>import("./ViewerUpdateButton-3825b1dd.js"),["assets/ViewerUpdateButton-3825b1dd.js","assets/EditorViewer-d9b9074f.js","assets/EditorViewerRecoil-fb47fc9d.js"])),NavigationBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./NavigationBreadCrumb-0509a6e4.js"),["assets/NavigationBreadCrumb-0509a6e4.js","assets/BreadCrumb-c4dbe368.js","assets/breadcrumbUtil-1e7f0dfb.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-06d28967.js"])),ChooserBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./ChooserBreadCrumb-c90f8cd6.js"),["assets/ChooserBreadCrumb-c90f8cd6.js","assets/BreadCrumb-c4dbe368.js","assets/breadcrumbUtil-1e7f0dfb.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-06d28967.js"])),DashboardBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./DashboardBreadCrumb-87d6da56.js"),["assets/DashboardBreadCrumb-87d6da56.js","assets/BreadCrumb-c4dbe368.js","assets/breadcrumbUtil-1e7f0dfb.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-06d28967.js"])),PeopleBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./PeopleBreadCrumb-1e5fc3de.js"),["assets/PeopleBreadCrumb-1e5fc3de.js","assets/BreadCrumb-c4dbe368.js","assets/breadcrumbUtil-1e7f0dfb.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-06d28967.js"])),DataBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./DataBreadCrumb-b56a9ca2.js"),["assets/DataBreadCrumb-b56a9ca2.js","assets/BreadCrumb-c4dbe368.js","assets/breadcrumbUtil-1e7f0dfb.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-06d28967.js"])),EditorBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./EditorBreadCrumb-b3c0d4e4.js"),["assets/EditorBreadCrumb-b3c0d4e4.js","assets/BreadCrumb-c4dbe368.js","assets/breadcrumbUtil-1e7f0dfb.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-06d28967.js"])),PortfolioBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./PortfolioBreadCrumb-22e300a9.js"),["assets/PortfolioBreadCrumb-22e300a9.js","assets/BreadCrumb-c4dbe368.js"])),PublicNavigation:reactExports.lazy(()=>__vitePreload(()=>import("./PublicNavigation-5bcc5aa1.js"),[])),GradebookBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./GradebookBreadCrumb-fd1c4bab.js"),["assets/GradebookBreadCrumb-fd1c4bab.js","assets/BreadCrumb-c4dbe368.js","assets/breadcrumbUtil-1e7f0dfb.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-06d28967.js"])),AssignmentBreadCrumb:reactExports.lazy(()=>__vitePreload(()=>import("./AssignmentBreadCrumb-1296ecc9.js"),["assets/AssignmentBreadCrumb-1296ecc9.js","assets/BreadCrumb-c4dbe368.js","assets/breadcrumbUtil-1e7f0dfb.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/Gradebook-06d28967.js"])),AssignmentNewAttempt:reactExports.lazy(()=>__vitePreload(()=>import("./AssignmentNewAttempt-d2b88afd.js"),["assets/AssignmentNewAttempt-d2b88afd.js","assets/CourseToolHandler-8716455d.js","assets/index-67ec2c85.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-9136da6d.js","assets/util-10e10a40.css","assets/AssignmentViewer-1be0d831.js","assets/ActivityViewer-becda8c0.js","assets/activityUtils-9c5f1536.js","assets/visibility-sensor-7d414852.js","assets/ActionButton-e5ea2a2f.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js"])),ActivityNavigationButtons:reactExports.lazy(()=>__vitePreload(()=>import("./ActivityNavigationButtons-072f10de.js"),["assets/ActivityNavigationButtons-072f10de.js","assets/ButtonGroup-9136da6d.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js"]))}).current,ds=reactExports.useRef({MathInputKeyboard:reactExports.lazy(()=>__vitePreload(()=>import("./MathInputKeyboard-a24ef99e.js"),["assets/MathInputKeyboard-a24ef99e.js","assets/ToggleButton-faf565eb.js","assets/ToggleButtonGroup-6decfcc6.js","assets/MathInputSelector-50cc4d06.js"]))}).current;let ps=`${as.pageName}-${as.currentMainPanel}`;if(ns=jsx$1(reactExports.Suspense,{fallback:jsxs(LoadingFallback,{children:[jsx$1(Svg,{viewBox:"0 0 130 140",children:jsxs(DonutG1,{children:[jsx$1(Circle$2,{id:"donut",fill:"var(--donutBody)",r:"60"}),jsx$1(Circle$2,{id:"donut-topping",fill:"var(--donutTopping)",r:"48"}),jsx$1(Circle$2,{id:"donut-hole",fill:"var(--canvas)",r:"19"})]})}),jsx$1(Svg,{viewBox:"0 0 130 140",children:jsxs(DonutG2,{children:[jsx$1(Circle$2,{id:"donut",fill:"var(--donutBody)",r:"60"}),jsx$1(Circle$2,{id:"donut-topping",fill:"var(--donutTopping)",r:"48"}),jsx$1(Circle$2,{id:"donut-hole",fill:"var(--canvas)",r:"19"})]})}),jsx$1(Svg,{viewBox:"0 0 130 140",children:jsxs(DonutG3,{children:[jsx$1(Circle$2,{id:"donut",fill:"var(--donutBody)",r:"60"}),jsx$1(Circle$2,{id:"donut-topping",fill:"var(--donutTopping)",r:"48"}),jsx$1(Circle$2,{id:"donut-hole",fill:"var(--canvas)",r:"19"})]})})]}),children:React.createElement(us[as.currentMainPanel],{MainPanelKey:ps})},ps),as!=null&&as.supportPanelOptions&&(as==null?void 0:as.supportPanelOptions.length)>0){const bs=as.supportPanelOptions[as.supportPanelIndex],vs=`${as.pageName}-${as.supportPanelOptions[as.supportPanelIndex]}-${as.supportPanelIndex}`;ss=jsx$1(SupportPanel,{hide:!1,panelTitles:as.supportPanelTitles,panelIndex:as.supportPanelIndex,children:jsx$1(reactExports.Suspense,{fallback:jsx$1(LoadingFallback,{display:"static",children:jsx$1(Table$2,{children:jsxs(TBody,{children:[jsxs(Tr$1,{children:[jsx$1(Td$1,{className:"Td2"}),jsx$1(Td$1,{className:"Td3",children:jsx$1(Td3Span,{})})]}),jsxs(Tr$1,{children:[jsx$1(Td$1,{className:"Td2"}),jsx$1(Td$1,{className:"Td3",children:jsx$1(Td3Span,{})})]}),jsxs(Tr$1,{children:[jsx$1(Td$1,{className:"Td2"}),jsx$1(Td$1,{className:"Td3",children:jsx$1(Td3Span,{})})]}),jsxs(Tr$1,{children:[jsx$1(Td$1,{className:"Td2"}),jsx$1(Td$1,{className:"Td3",children:jsx$1(Td3Span,{})})]}),jsxs(Tr$1,{children:[jsx$1(Td$1,{className:"Td2"}),jsx$1(Td$1,{className:"Td3",children:jsx$1(Td3Span,{})})]})]})})}),children:React.createElement(us[bs],{SupportPanelKey:vs})},vs)})}let fs=null;if(as.headerControls){fs=[];for(const[,bs]of Object.entries(as.headerControls)){const vs=cs[bs];if(vs){const xs=`headerControls${ps}`;fs.push(jsx$1(reactExports.Suspense,{fallback:jsx$1(LoadingFallback,{children:jsx$1(BreadcrumbContainer,{children:jsx$1(BreadcrumbOutline,{})})}),children:React.createElement(vs,{key:{key:xs}})},xs))}}}let hs=jsx$1(MenuPanel,{hide:!0},"menuPanel");os&&!as.hasNoMenuPanel&&(hs=jsx$1(MenuPanel,{hide:!1,setMenusOpen:ls,menusOpen:os,menuPanelCap:as.menuPanelCap,menusTitles:as.menusTitles,currentMenus:as.currentMenus,initOpen:as.menusInitOpen,displaySettings:as.displaySettings},"menuPanel"));let gs=!os;as.hasNoMenuPanel&&(gs=!1);let ys=null;if(as.footer){let bs="footer";ys=jsx$1(NavPanel,{id:"keyboard",isInitOpen:as.footer.open,height:as.footer.height,"aria-label":"keyboard",children:jsx$1(reactExports.Suspense,{fallback:jsx$1(LoadingFallback,{children:"loading..."}),children:React.createElement(ds[as.footer.component],{key:{footerKey:bs}})},bs)})}return jsxs(Fragment,{children:[jsxs(ToolContainer,{children:[hs,jsx$1(ContentPanel,{main:jsx$1(MainPanel,{headerControls:fs,setMenusOpen:ls,openMenuButton:gs,displaySettings:as.displaySettings,hasNoHeaderPanel:as.hasNoHeaderPanel,children:ns}),hasNoHeaderPanel:as.hasNoHeaderPanel,support:ss}),ys]}),jsx$1(Toast$1,{}),jsx$1(MemoizedRootController,{setToolRootMenusAndPanels:rs},"root_controller"),jsx$1(MemoizedOnLeave,{},"MemoizedOnLeave")]})}let navigationObj={placementexam:{default:{defaultTool:"exam"},exam:{pageName:"exam",currentMainPanel:"AssignmentViewer",currentMenus:["TimerMenu"],menusTitles:["Time Remaining"],menusInitOpen:[!0],headerControls:[],displaySettings:!1,hasNoMenuPanel:!0,hasNoHeaderPanel:!0,waitForMenuSuppression:!0,footer:{height:250,open:!1,component:"MathInputKeyboard"}},endExam:{pageName:"endExam",currentMainPanel:"EndPlacementExamPanel",displaySettings:!1,hasNoMenuPanel:!0}},umn:{default:{defaultTool:"signIn"},signIn:{pageName:"signIn",currentMainPanel:"SignInRedirector",displaySettings:!1,hasNoMenuPanel:!0}},portfolioeditor:{editor:{pageName:"PortfolioEditor",menuPanelCap:"PortfilioEditorInfoCap",currentMainPanel:"EditorViewer",currentMenus:["PageVariant","PageLink","SupportingFilesMenu"],menusTitles:["Page Variant","Page Link","Supporting Files"],menusInitOpen:[!1,!1],supportPanelOptions:["DoenetMLEditor"],supportPanelTitles:["DoenetML Editor"],supportPanelIndex:0,headerControls:["PortfolioBreadCrumb","ViewerUpdateButton"],footer:{height:250,open:!1,component:"MathInputKeyboard"},waitForMenuSuppression:!0}},exam:{default:{defaultTool:"chooseLearner"},chooseLearner:{pageName:"chooseLearner",currentMainPanel:"ChooseLearnerPanel",displaySettings:!1},assessment:{pageName:"Assessment",menuPanelCap:"AssignmentInfoCap",currentMainPanel:"AssignmentViewer",currentMenus:["TimerMenu"],menusTitles:["Time Remaining"],menusInitOpen:[!0],headerControls:[],displaySettings:!1,waitForMenuSuppression:!0,footer:{height:250,open:!1,component:"MathInputKeyboard"}},endExam:{pageName:"endExam",currentMainPanel:"EndExamPanel",displaySettings:!1,hasNoMenuPanel:!0}},course:{default:{defaultTool:"courseChooser"},assignment:{pageName:"Assignment",menuPanelCap:"AssignmentInfoCap",currentMainPanel:"AssignmentViewer",currentMenus:["CreditAchieved","TimerMenu","ActivityDates"],menusTitles:["Credit Achieved","Time Remaining","Details"],menusInitOpen:[!0,!0,!1],headerControls:["AssignmentBreadCrumb","AssignmentNewAttempt","ActivityNavigationButtons"],waitForMenuSuppression:!0,footer:{height:250,open:!1,component:"MathInputKeyboard"}},courseChooser:{pageName:"Course",currentMainPanel:"CourseCards",currentMenus:["CreateCourse"],menusTitles:["Create Course"],menusInitOpen:[!0],headerControls:["ChooserBreadCrumb"],onLeave:"CourseChooserLeave"},dashboard:{pageName:"Dashboards",currentMainPanel:"Dashboard",menuPanelCap:"DriveInfoCap",currentMenus:["ClassTimes","CurrentContent"],menusTitles:["Class Times","Content by week settings"],menusInitOpen:[!1,!1],headerControls:["DashboardBreadCrumb"],onLeave:"DashboardLeave",waitForMenuSuppression:!0,color:"var(--canvastext)"},draftactivity:{pageName:"DraftActivity",menuPanelCap:"DraftActivityCap",currentMainPanel:"DraftAssignmentViewer",currentMenus:["ActivityVariant"],menusTitles:["Activity Variant"],menusInitOpen:[],headerControls:["AssignmentBreadCrumb"],footer:{height:250,open:!1,component:"MathInputKeyboard"}},endExam:{pageName:"endExam",currentMainPanel:"EndExamPanel",menuPanelCap:"AssignmentInfoCap",currentMenus:["CreditAchieved"],menusTitles:["Credit Achieved"],menusInitOpen:[!0],headerControls:["AssignmentBreadCrumb"]},gradebook:{pageName:"Gradebook",currentMainPanel:"Gradebook",menuPanelCap:"DriveInfoCap",currentMenus:["GradeDownload"],menusTitles:["Download"],menusInitOpen:[!1],headerControls:["GradebookBreadCrumb"],waitForMenuSuppression:!0},gradebookAssignment:{pageName:"Gradebook",currentMainPanel:"GradebookAssignment",currentMenus:["GradeUpload"],menusTitles:["Upload"],menusInitOpen:[!1],menuPanelCap:"DriveInfoCap",headerControls:["GradebookBreadCrumb"],waitForMenuSuppression:!0,onLeave:"GradebookAssignmentLeave"},gradebookStudent:{pageName:"Gradebook",currentMainPanel:"GradebookStudent",currentMenus:[],menuPanelCap:"DriveInfoCap",menusTitles:[],menusInitOpen:[],headerControls:["GradebookBreadCrumb"]},gradebookStudentAssignment:{pageName:"Gradebook",currentMainPanel:"GradebookStudentAssignment",menuPanelCap:"DriveInfoCap",currentMenus:["CreditAchieved","GradeSettings"],menusTitles:["Credit Achieved","Settings"],menusInitOpen:[!0,!1],headerControls:["GradebookBreadCrumb"],waitForMenuSuppression:!0},navigation:{pageName:"Course",currentMainPanel:"NavigationPanel",menuPanelCap:"DriveInfoCap",currentMenus:["CutCopyPasteMenu","AddDriveItems"],menusTitles:["Cut, Copy and Paste","Add Items"],menusInitOpen:[!0,!0],headerControls:["NavigationBreadCrumb"],onLeave:"NavigationLeave",waitForMenuSuppression:!0},editor:{pageName:"Course",menuPanelCap:"EditorInfoCap",currentMainPanel:"EditorViewer",currentMenus:["PageVariant","PageLink","AssignmentSettingsMenu","SupportingFilesMenu"],menusTitles:["Page Variant","Page Link","Assignment Settings","Supporting Files"],menusInitOpen:[!1,!1],supportPanelOptions:["DoenetMLEditor"],supportPanelTitles:["DoenetML Editor"],supportPanelIndex:0,headerControls:["EditorBreadCrumb","ViewerUpdateButton"],footer:{height:250,open:!1,component:"MathInputKeyboard"},waitForMenuSuppression:!0},people:{pageName:"People",menuPanelCap:"DriveInfoCap",currentMenus:["LoadPeople"],menusTitles:["Import Learners"],menusInitOpen:[!1],currentMainPanel:"People",supportPanelOptions:["RolesEditor"],supportPanelTitles:["Roles Editor"],supportPanelIndex:0,headerControls:["PeopleBreadCrumb"],initialProportion:1},data:{pageName:"data",menuPanelCap:"DataCap",currentMainPanel:"DataPanel",headerControls:["DataBreadCrumb"]}},home:{default:{pageName:"Home",currentMenus:[],menusTitles:[],menusInitOpen:[],currentMainPanel:"HomePanel",supportPanelOptions:[],supportPanelTitles:[],supportPanelIndex:0,hasNoMenuPanel:!0,hasNoHeaderPanel:!0,displaySettings:!1}},notfound:{default:{pageName:"Notfound",currentMenus:[],menusInitOpen:[],currentMainPanel:"NotFound",supportPanelOptions:[],hasNoMenuPanel:!0}},public:{default:{pageName:"PublicActivityViewer",currentMenus:[],menusTitles:[],menusInitOpen:[],currentMainPanel:"PublicActivityViewer",supportPanelOptions:[],supportPanelTitles:[],supportPanelIndex:0,hasNoMenuPanel:!0},editor:{pageName:"GuestEditor",menuPanelCap:"PublicEditorInfoCap",currentMainPanel:"GuestEditorViewer",currentMenus:["PageVariant"],menusTitles:["Page Variant"],menusInitOpen:[!1],supportPanelOptions:["GuestDoenetMLEditor"],supportPanelTitles:["DoenetML Editor"],supportPanelIndex:0,headerControls:["PublicNavigation","ViewerUpdateButton"],footer:{height:250,open:!1,component:"MathInputKeyboard"}}},settings:{default:{pageName:"Settings",currentMenus:[],menusTitles:[],menusInitOpen:[],currentMainPanel:"AccountSettings",supportPanelOptions:[],supportPanelTitles:[],supportPanelIndex:0,hasNoMenuPanel:!0,headerControls:["BackButton"],displaySettings:!1}},signin:{default:{pageName:"SignIn",currentMenus:[],menusTitles:[],menusInitOpen:[],currentMainPanel:"SignIn",supportPanelOptions:[],supportPanelTitles:[],supportPanelIndex:0,hasNoMenuPanel:!0,displaySettings:!1}},signout:{default:{pageName:"SignOut",currentMenus:[],menusTitles:[],menusInitOpen:[],currentMainPanel:"SignOut",supportPanelOptions:[],supportPanelTitles:[],supportPanelIndex:0,hasNoMenuPanel:!0,displaySettings:!1}}},encodeParams=as=>Object.entries(as).map(rs=>rs.map(encodeURIComponent).join("=")).join("&");const pageToolViewAtom=Recoil_index_8({key:"pageToolViewAtom",default:{page:"init",tool:"",view:""}}),onLeaveComponentStr=Recoil_index_8({key:"onLeaveComponentStr",default:{str:null,updateNum:0}});Recoil_index_8({key:"finishedOnLeave",default:null});const MemoizedOnLeave=React.memo(OnLeave);function OnLeave(){const rs=Recoil_index_20(onLeaveComponentStr).str;let ns=null;const ss=reactExports.useRef({NavigationLeave:reactExports.lazy(()=>__vitePreload(()=>import("./NavigationLeave-33a19712.js"),[])),CourseChooserLeave:reactExports.lazy(()=>__vitePreload(()=>import("./CourseChooserLeave-ebee0fe3.js"),["assets/CourseChooserLeave-ebee0fe3.js","assets/CourseToolHandler-8716455d.js","assets/index-67ec2c85.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-9136da6d.js","assets/util-10e10a40.css"])),DashboardLeave:reactExports.lazy(()=>__vitePreload(()=>import("./DashboardLeave-4c716000.js"),["assets/DashboardLeave-4c716000.js","assets/CourseToolHandler-8716455d.js","assets/index-67ec2c85.js","assets/index-fcf36459.js","assets/index-47ca4f11.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-9136da6d.js","assets/util-10e10a40.css"])),GradebookAssignmentLeave:reactExports.lazy(()=>__vitePreload(()=>import("./GradebookAssignmentLeave-3f668829.js"),["assets/GradebookAssignmentLeave-3f668829.js","assets/GradebookAssignment-dd849113.js","assets/Gradebook-06d28967.js","assets/RoleDropdown-cce90708.js","assets/DropdownMenu-f3593bed.js","assets/setPrototypeOf-51e8cf87.js","assets/ButtonGroup-9136da6d.js"]))}).current;if(rs){const os=`leave${rs}`;ns=jsx$1(reactExports.Suspense,{fallback:null,children:React.createElement(ss[rs])},os)}return jsx$1(Fragment,{children:ns})}const suppressMenusAtom=Recoil_index_8({key:"suppressMenusAtom",default:null});function arraysEqual(as,rs){if(as===rs)return!0;if(as==null||rs==null||as.length!==rs.length)return!1;for(var ns=0;nsks=>{for(const[Ps,Bs]of Object.entries(ks))bs.current[Ps]!==Bs&&Vs(searchParamAtomFamily(Ps),Bs);for(const Ps of Object.keys(bs.current))ks[Ps]||Vs(searchParamAtomFamily(Ps),"")});let xs=reactExports.useRef(null),Cs=reactExports.useRef([]),Ts=`${gs.pathname}${gs.search}`,Ss={page:"",tool:"",view:""},Ns=null,As=(Is=(Os=navigationObj[rs.page])==null?void 0:Os[rs.tool])==null?void 0:Is.initialProportion;reactExports.useEffect(()=>{let Vs=As;Vs||(Vs=.5),us(ks=>{let Ps={...ks};return Ps.proportion=Vs,Ps})},[As]);let ws=!arraysEqual(os,Cs.current);if(Cs.current=os,ws&&os!==null){if(Ns={...navigationObj[rs.page][rs.tool]},Ns.currentMenus=[...navigationObj[rs.page][rs.tool].currentMenus],Ns.menusTitles=[...navigationObj[rs.page][rs.tool].menusTitles],Ns.menusInitOpen=[...navigationObj[rs.page][rs.tool].menusInitOpen],os.length>0)for(let Vs of os)for(let[ks,Ps]of Object.entries(Ns.currentMenus))Ps===Vs&&(Ns.currentMenus.splice(ks,1),Ns.menusTitles.splice(ks,1),Ns.menusInitOpen.splice(ks,1));return as.setToolRootMenusAndPanels(Ns),null}let Es=!1;if(Ts!==hs.current){if(Es=!0,Ss.page=gs.pathname.split("/")[1].toLowerCase(),Ss.page===""){Ss.page="home";const ks=window.location.origin+window.location.pathname+"home";window.history.replaceState("","",ks)}let Vs=Object.fromEntries(new URLSearchParams(gs.search));Ss.tool=Vs.tool,Ss.tool||(Ss.tool="")}let _s=!1;if(JSON.stringify(cs.current)!==JSON.stringify(rs)){if(_s=!0,rs.back){ds.current.page==="init"&&(ds.current.page="home");let Vs={...ds.current,params:ps.current};return ns(Vs),null}Ss={...rs}}if(!Es&&!_s)return hs.current=Ts,null;let $s=!1,Rs=!1;cs.current.page!==Ss.page?($s=!0,Ss.tool===""?(Ns=navigationObj[Ss.page].default,Object.keys(Ns).includes("defaultTool")&&(window.location.pathname+gs.pathname+""+encodeParams({tool:Ns.defaultTool}),Ns=navigationObj[Ss.page][Ns.defaultTool])):Ns=navigationObj[Ss.page][Ss.tool]):cs.current.tool!==Ss.tool?(Rs=!0,Ns=navigationObj[Ss.page][Ss.tool]):cs.current.view!==Ss.view&&(Ns={...navigationObj[Ss.page][Ss.tool]});let Ds={};if(Es&&(Ds=Object.fromEntries(new URLSearchParams(gs.search)),vs(Ds),Ss.params={...Ds},delete Ss.params.tool,ns(Ss)),($s||Rs)&&(xs.current&&ss(Vs=>({str:xs.current,updateNum:Vs.updateNum+1})),xs.current=null,Ns&&Ns.onLeave&&(xs.current=Ns.onLeave),ls(null)),Ns&&Ns.displaySettings===void 0&&(Ns.displaySettings=!0),Ns&&JSON.stringify(Ss)!==JSON.stringify(cs.current)){ds.current=cs.current;let Vs={};if(Es?Vs=Ds:_s&&(Vs=rs.params),ps.current=fs.current,fs.current=Vs,Ns.waitForMenuSuppression){let ks={...Ns};ks.currentMenus=[],ks.menusInitOpen=[],ks.menusTitles=[],ks.headerControls=[],as.setToolRootMenusAndPanels(ks)}else as.setToolRootMenusAndPanels(Ns)}if(_s){let Vs=Ss.tool,ks="/"+rs.page;Ds={...rs.params},Vs!==""&&Vs!==void 0&&(Ds={tool:Vs,...rs.params});let Ps="";Object.keys(Ds).length>0&&(Ps="?"+encodeParams(Ds));const Bs=ks+Ps;gs.search!==Ps&&vs(Ds),(gs.pathname!==ks||gs.search!==Ps)&&ys(Bs)}return bs.current=Ds,hs.current=Ts,cs.current=Ss,null}const LoadingFallback=styled$1.div` background-color: var(--canvas); border-radius: 4px; display: ${as=>as.display?as.display:"flex"}; @@ -1300,7 +1300,12 @@ ${Ks}`;try{let Qs=await axios.post("/api/saveCompiledActivity.php",{c animation-name: ${shimmerAnimation}; animation-timing-function: linear; background: var(--canvas); - background: linear-gradient(to right, var(--mainGray) 8%, var(--mainGray) 18%, var(--mainGray) 33%); + background: linear-gradient( + to right, + var(--mainGray) 8%, + var(--mainGray) 18%, + var(--mainGray) 33% + ); background-size: 1000px 640px; position: relative; `,movingGradient=Ue$1` @@ -1317,12 +1322,16 @@ ${Ks}`;try{let Qs=await axios.post("/api/saveCompiledActivity.php",{c &.Td3 { width: 100%; } - `,TBody=styled$1.tbody``,Td3Span=styled$1.span` display: block; height: 14px; border-radius: 5px; - background: linear-gradient(to right, var(--mainGray) 20%, var(--mainGray) 50%, var(--mainGray) 80%); + background: linear-gradient( + to right, + var(--mainGray) 20%, + var(--mainGray) 50%, + var(--mainGray) 80% + ); background-size: 500px 100px; animation-name: ${movingGradient}; animation-duration: 1s; @@ -1561,7 +1570,7 @@ return `+C+`; `);var rs,ns,ss,os,ls=0,us=["Initial state","NAME","ROWS","COLUMNS","RHS","BOUNDS","ENDATA"],cs=as.length,ds=0,ps={},fs=[],hs=0,gs={},ys=0,bs=[],vs=[],xs=[];function Cs(ws){throw new Error("MPStoLP: "+ws+` Line `+rs+": "+as[rs]+` Current state: `+us[ls]+` -`)}for(rs=0;rs=ls;)vs/=2,xs/=2,Cs>>>=1;return(vs+Cs)/xs},hs},us=rs.pow(ns,ss),os=rs.pow(2,os),ls=2*os,ps(rs.random(),as)}([],numeric.seedrandom,256,6,52),function(as){function rs(os){if(typeof os!="object")return os;var ls,us=[],cs=os.length;for(ls=0;lsbs)Ts[ws]=Ws;else if(Ts[ws]=-Math.abs(Ws),Ws>0){for(As=1;As<=cs;As+=1)fs[As][Ns]=-fs[As][Ns];hs[Ns]=-hs[Ns]}}for(Ns=1;Ns<=xs;Ns+=1)Ts[Is+vs[Ns]]=0;for(ks=0,Ms=0,Ns=1;Ns<=ys;Ns+=1)Ts[Is+Ns]=1;Ns-=1){for(Ws=Ts[Ns],Es=(ws=Os+Ns*(Ns+3)/2)-Ns,As=Ns+1;As<=xs;As+=1)Ws-=Ts[ws]*Ts[Ds+As],ws+=As;if(Ws/=Ts[Es],Ts[Ds+Ns]=Ws,vs[Ns]bs)Ts[Is+ks]=Ws;else if(Ts[Is+ks]=-Math.abs(Ws),Ws>0){for(As=1;As<=cs;As+=1)fs[As][ks]=-fs[As][ks];hs[ks]=-hs[ks]}return 700}for(vs[xs+=1]=ks,ws=Os+(xs-1)*xs/2+1,Ns=1;Ns<=xs-1;Ns+=1)Ts[ws]=Ts[Ns],ws+=1;if(xs===cs)Ts[ws]=Ts[cs];else{for(Ns=cs;Ns>=xs+1&&Ts[Ns]!==0&&(Ls=Math.max(Math.abs(Ts[Ns-1]),Math.abs(Ts[Ns])),Gs=Math.min(Math.abs(Ts[Ns-1]),Math.abs(Ts[Ns])),Ms=Ts[Ns-1]>=0?Math.abs(Ls*Math.sqrt(1+Gs*Gs/(Ls*Ls))):-Math.abs(Ls*Math.sqrt(1+Gs*Gs/(Ls*Ls))),Ls=Ts[Ns-1]/Ms,Gs=Ts[Ns]/Ms,Ls!==1);Ns-=1)if(Ls===0)for(Ts[Ns-1]=Gs*Ms,As=1;As<=cs;As+=1)Ms=os[As][Ns-1],os[As][Ns-1]=os[As][Ns],os[As][Ns]=Ms;else for(Ts[Ns-1]=Ms,Hs=Gs/(1+Ls),As=1;As<=cs;As+=1)Ms=Ls*os[As][Ns-1]+Gs*os[As][Ns],os[As][Ns]=Hs*(os[As][Ns-1]+Ms)-os[As][Ns],os[As][Ns-1]=Ms;Ts[ws]=Ts[xs]}return 0}function qs(){if(Ts[Es=(ws=Os+$s*($s+1)/2+1)+$s]===0||(Ls=Math.max(Math.abs(Ts[Es-1]),Math.abs(Ts[Es])),Gs=Math.min(Math.abs(Ts[Es-1]),Math.abs(Ts[Es])),Ms=Ts[Es-1]>=0?Math.abs(Ls*Math.sqrt(1+Gs*Gs/(Ls*Ls))):-Math.abs(Ls*Math.sqrt(1+Gs*Gs/(Ls*Ls))),Ls=Ts[Es-1]/Ms,Gs=Ts[Es]/Ms,Ls===1))return 798;if(Ls===0){for(Ns=$s+1;Ns<=xs;Ns+=1)Ms=Ts[Es-1],Ts[Es-1]=Ts[Es],Ts[Es]=Ms,Es+=Ns;for(Ns=1;Ns<=cs;Ns+=1)Ms=os[Ns][$s],os[Ns][$s]=os[Ns][$s+1],os[Ns][$s+1]=Ms}else{for(Hs=Gs/(1+Ls),Ns=$s+1;Ns<=xs;Ns+=1)Ms=Ls*Ts[Es-1]+Gs*Ts[Es],Ts[Es]=Hs*(Ts[Es-1]+Ms)-Ts[Es],Ts[Es-1]=Ms,Es+=Ns;for(Ns=1;Ns<=cs;Ns+=1)Ms=Ls*os[Ns][$s]+Gs*os[Ns][$s+1],os[Ns][$s+1]=Hs*(os[Ns][$s]+Ms)-os[Ns][$s+1],os[Ns][$s]=Ms}return 0}function Qs(){for(Es=ws-$s,Ns=1;Ns<=$s;Ns+=1)Ts[Es]=Ts[ws],ws+=1,Es+=1;return Ts[Vs+$s]=Ts[Vs+$s+1],vs[$s]=vs[$s+1],($s+=1)(Ds=Math.abs(Ds))?Rs*Math.sqrt(1+Ds*Ds/Rs/Rs):Ds==0?Rs:Ds*Math.sqrt(1+Rs*Rs/Ds/Ds)}var xs=0,Cs=0,Ts=0,Ss=0,Ns=0,As=0,ws=0;for(ls=0;ls=0&&(Cs=-Cs),Ts=xs*Cs-ws,ps[ls][ls]=xs-Cs,us=ds;us=0&&(Cs=-Cs),Ts=xs*Cs-ws,ps[ls][ls+1]=xs-Cs,us=ds;usSs&&(Ss=Ns)}for(ls=hs-1;ls!=-1;ls+=-1){if(Cs!=0){for(Ts=Cs*ps[ls][ls+1],us=ds;us=49)throw"Error: no convergence.";for(Ss=ys[ds],Cs=vs(xs=(((Ns=ys[cs-1])-As)*(Ns+As)+((Cs=gs[cs-1])-(Ts=gs[cs]))*(Cs+Ts))/(2*Ts*Ns),1),xs=xs<0?((Ss-As)*(Ss+As)+Ts*(Ns/(xs-Cs)-Ts))/Ss:((Ss-As)*(Ss+As)+Ts*(Ns/(xs+Cs)-Ts))/Ss,os=1,ws=1,ls=ds+1;ls=0;us--)if(ys[us]=0&&ns<=MAX_ARRAY_INDEX}}function shallowProperty(as){return function(rs){return rs==null?void 0:rs[as]}}var getByteLength=shallowProperty("byteLength"),isBufferLike=createSizePropertyCheck(getByteLength),typedArrayPattern=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function isTypedArray(as){return nativeIsView?nativeIsView(as)&&!isDataView$1(as):isBufferLike(as)&&typedArrayPattern.test(toString$1.call(as))}var isTypedArray$1=supportsArrayBuffer?isTypedArray:constant(!1),getLength=shallowProperty("length");function emulatedSet(as){for(var rs={},ns=as.length,ss=0;ss":">",'"':""","'":"'","`":"`"},escape$3=createEscaper(escapeMap),unescapeMap=invert(escapeMap),unescape$1=createEscaper(unescapeMap),templateSettings=_$1$1.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},noMatch=/(.)^/,escapes={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},escapeRegExp$1=/\\|'|\r|\n|\u2028|\u2029/g;function escapeChar(as){return"\\"+escapes[as]}var bareIdentifier=/^\s*(\w|\$)+\s*$/;function template(as,rs,ns){!rs&&ns&&(rs=ns),rs=defaults$3({},rs,_$1$1.templateSettings);var ss=RegExp([(rs.escape||noMatch).source,(rs.interpolate||noMatch).source,(rs.evaluate||noMatch).source].join("|")+"|$","g"),os=0,ls="__p+='";as.replace(ss,function(ps,fs,hs,gs,ys){return ls+=as.slice(os,ys).replace(escapeRegExp$1,escapeChar),os=ys+ps.length,fs?ls+=`'+ +`)}for(rs=0;rs=ls;)vs/=2,xs/=2,Cs>>>=1;return(vs+Cs)/xs},hs},us=rs.pow(ns,ss),os=rs.pow(2,os),ls=2*os,ps(rs.random(),as)}([],numeric.seedrandom,256,6,52),function(as){function rs(os){if(typeof os!="object")return os;var ls,us=[],cs=os.length;for(ls=0;lsbs)Ts[ws]=Ws;else if(Ts[ws]=-Math.abs(Ws),Ws>0){for(As=1;As<=cs;As+=1)fs[As][Ns]=-fs[As][Ns];hs[Ns]=-hs[Ns]}}for(Ns=1;Ns<=xs;Ns+=1)Ts[Is+vs[Ns]]=0;for(ks=0,Ms=0,Ns=1;Ns<=ys;Ns+=1)Ts[Is+Ns]=1;Ns-=1){for(Ws=Ts[Ns],Es=(ws=Os+Ns*(Ns+3)/2)-Ns,As=Ns+1;As<=xs;As+=1)Ws-=Ts[ws]*Ts[Ds+As],ws+=As;if(Ws/=Ts[Es],Ts[Ds+Ns]=Ws,vs[Ns]bs)Ts[Is+ks]=Ws;else if(Ts[Is+ks]=-Math.abs(Ws),Ws>0){for(As=1;As<=cs;As+=1)fs[As][ks]=-fs[As][ks];hs[ks]=-hs[ks]}return 700}for(vs[xs+=1]=ks,ws=Os+(xs-1)*xs/2+1,Ns=1;Ns<=xs-1;Ns+=1)Ts[ws]=Ts[Ns],ws+=1;if(xs===cs)Ts[ws]=Ts[cs];else{for(Ns=cs;Ns>=xs+1&&Ts[Ns]!==0&&(Ls=Math.max(Math.abs(Ts[Ns-1]),Math.abs(Ts[Ns])),Gs=Math.min(Math.abs(Ts[Ns-1]),Math.abs(Ts[Ns])),Ms=Ts[Ns-1]>=0?Math.abs(Ls*Math.sqrt(1+Gs*Gs/(Ls*Ls))):-Math.abs(Ls*Math.sqrt(1+Gs*Gs/(Ls*Ls))),Ls=Ts[Ns-1]/Ms,Gs=Ts[Ns]/Ms,Ls!==1);Ns-=1)if(Ls===0)for(Ts[Ns-1]=Gs*Ms,As=1;As<=cs;As+=1)Ms=os[As][Ns-1],os[As][Ns-1]=os[As][Ns],os[As][Ns]=Ms;else for(Ts[Ns-1]=Ms,Hs=Gs/(1+Ls),As=1;As<=cs;As+=1)Ms=Ls*os[As][Ns-1]+Gs*os[As][Ns],os[As][Ns]=Hs*(os[As][Ns-1]+Ms)-os[As][Ns],os[As][Ns-1]=Ms;Ts[ws]=Ts[xs]}return 0}function qs(){if(Ts[Es=(ws=Os+$s*($s+1)/2+1)+$s]===0||(Ls=Math.max(Math.abs(Ts[Es-1]),Math.abs(Ts[Es])),Gs=Math.min(Math.abs(Ts[Es-1]),Math.abs(Ts[Es])),Ms=Ts[Es-1]>=0?Math.abs(Ls*Math.sqrt(1+Gs*Gs/(Ls*Ls))):-Math.abs(Ls*Math.sqrt(1+Gs*Gs/(Ls*Ls))),Ls=Ts[Es-1]/Ms,Gs=Ts[Es]/Ms,Ls===1))return 798;if(Ls===0){for(Ns=$s+1;Ns<=xs;Ns+=1)Ms=Ts[Es-1],Ts[Es-1]=Ts[Es],Ts[Es]=Ms,Es+=Ns;for(Ns=1;Ns<=cs;Ns+=1)Ms=os[Ns][$s],os[Ns][$s]=os[Ns][$s+1],os[Ns][$s+1]=Ms}else{for(Hs=Gs/(1+Ls),Ns=$s+1;Ns<=xs;Ns+=1)Ms=Ls*Ts[Es-1]+Gs*Ts[Es],Ts[Es]=Hs*(Ts[Es-1]+Ms)-Ts[Es],Ts[Es-1]=Ms,Es+=Ns;for(Ns=1;Ns<=cs;Ns+=1)Ms=Ls*os[Ns][$s]+Gs*os[Ns][$s+1],os[Ns][$s+1]=Hs*(os[Ns][$s]+Ms)-os[Ns][$s+1],os[Ns][$s]=Ms}return 0}function Qs(){for(Es=ws-$s,Ns=1;Ns<=$s;Ns+=1)Ts[Es]=Ts[ws],ws+=1,Es+=1;return Ts[Vs+$s]=Ts[Vs+$s+1],vs[$s]=vs[$s+1],($s+=1)(Ds=Math.abs(Ds))?Rs*Math.sqrt(1+Ds*Ds/Rs/Rs):Ds==0?Rs:Ds*Math.sqrt(1+Rs*Rs/Ds/Ds)}var xs=0,Cs=0,Ts=0,Ss=0,Ns=0,As=0,ws=0;for(ls=0;ls=0&&(Cs=-Cs),Ts=xs*Cs-ws,ps[ls][ls]=xs-Cs,us=ds;us=0&&(Cs=-Cs),Ts=xs*Cs-ws,ps[ls][ls+1]=xs-Cs,us=ds;usSs&&(Ss=Ns)}for(ls=hs-1;ls!=-1;ls+=-1){if(Cs!=0){for(Ts=Cs*ps[ls][ls+1],us=ds;us=49)throw"Error: no convergence.";for(Ss=ys[ds],Cs=vs(xs=(((Ns=ys[cs-1])-As)*(Ns+As)+((Cs=gs[cs-1])-(Ts=gs[cs]))*(Cs+Ts))/(2*Ts*Ns),1),xs=xs<0?((Ss-As)*(Ss+As)+Ts*(Ns/(xs-Cs)-Ts))/Ss:((Ss-As)*(Ss+As)+Ts*(Ns/(xs+Cs)-Ts))/Ss,os=1,ws=1,ls=ds+1;ls=0;us--)if(ys[us]=0&&ns<=MAX_ARRAY_INDEX}}function shallowProperty(as){return function(rs){return rs==null?void 0:rs[as]}}var getByteLength=shallowProperty("byteLength"),isBufferLike=createSizePropertyCheck(getByteLength),typedArrayPattern=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function isTypedArray(as){return nativeIsView?nativeIsView(as)&&!isDataView$1(as):isBufferLike(as)&&typedArrayPattern.test(toString$1.call(as))}var isTypedArray$1=supportsArrayBuffer?isTypedArray:constant(!1),getLength=shallowProperty("length");function emulatedSet(as){for(var rs={},ns=as.length,ss=0;ss":">",'"':""","'":"'","`":"`"},escape$3=createEscaper(escapeMap),unescapeMap=invert(escapeMap),unescape$1=createEscaper(unescapeMap),templateSettings=_$1$1.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},noMatch=/(.)^/,escapes={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},escapeRegExp$1=/\\|'|\r|\n|\u2028|\u2029/g;function escapeChar(as){return"\\"+escapes[as]}var bareIdentifier=/^\s*(\w|\$)+\s*$/;function template(as,rs,ns){!rs&&ns&&(rs=ns),rs=defaults$3({},rs,_$1$1.templateSettings);var ss=RegExp([(rs.escape||noMatch).source,(rs.interpolate||noMatch).source,(rs.evaluate||noMatch).source].join("|")+"|$","g"),os=0,ls="__p+='";as.replace(ss,function(ps,fs,hs,gs,ys){return ls+=as.slice(os,ys).replace(escapeRegExp$1,escapeChar),os=ys+ps.length,fs?ls+=`'+ ((__t=(`+fs+`))==null?'':_.escape(__t))+ '`:hs?ls+=`'+ ((__t=(`+hs+`))==null?'':__t)+ @@ -1573,7 +1582,7 @@ __p+='`),ps}),ls+=`'; `,cs="obj";ls=`var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');}; `+ls+`return __p; `;try{us=new Function(cs,"_",ls)}catch(ps){throw ps.source=ls,ps}var ds=function(ps){return us.call(this,ps,_$1$1)};return ds.source="function("+cs+`){ -`+ls+"}",ds}function result(as,rs,ns){var ss=(rs=toPath(rs)).length;if(!ss)return isFunction$1$1(ns)?ns.call(as):ns;for(var os=0;os1)flatten$2$1(cs,rs-1,ns,ss),os=ss.length;else for(var ds=0,ps=cs.length;dsrs?(ss&&(clearTimeout(ss),ss=null),cs=fs,us=as.apply(os,ls),ss||(os=ls=null)):ss||ns.trailing===!1||(ss=setTimeout(ds,hs)),us};return ps.cancel=function(){clearTimeout(ss),cs=0,ss=os=ls=null},ps}function debounce$1(as,rs,ns){var ss,os,ls,us,cs,ds=function(){var fs=now$1()-os;rs>fs?ss=setTimeout(ds,rs-fs):(ss=null,ns||(us=as.apply(cs,ls)),ss||(ls=cs=null))},ps=restArguments(function(fs){return cs=this,ls=fs,os=now$1(),ss||(ss=setTimeout(ds,rs),ns&&(us=as.apply(cs,ls))),us});return ps.cancel=function(){clearTimeout(ss),ss=ls=cs=null},ps}function wrap$1(as,rs){return partial(rs,as)}function negate$2(as){return function(){return!as.apply(this,arguments)}}function compose(){var as=arguments,rs=as.length-1;return function(){for(var ns=rs,ss=as[rs].apply(this,arguments);ns--;)ss=as[ns].call(this,ss);return ss}}function after(as,rs){return function(){if(--as<1)return rs.apply(this,arguments)}}function before(as,rs){var ns;return function(){return--as>0&&(ns=rs.apply(this,arguments)),as<=1&&(rs=null),ns}}var once$1=partial(before,2);function findKey(as,rs,ns){rs=cb(rs,ns);for(var ss,os=keys$4(as),ls=0,us=os.length;ls0?0:os-1;ls>=0&&ls0?us=ls>=0?ls:Math.max(ls+cs,us):cs=ls>=0?Math.min(ls+1,cs):ls+cs+1;else if(ns&&ls&&cs)return ss[ls=ns(ss,os)]===os?ls:-1;if(os!=os)return(ls=rs(slice$1.call(ss,us,cs),isNaN$1))>=0?ls+us:-1;for(ls=as>0?us:cs-1;ls>=0&&ls0?0:cs-1;for(ls||(os=ns[us?us[ds]:ds],ds+=as);ds>=0&&ds=3;return rs(ns,optimizeCb(ss,ls,4),os,us)}}var reduce$1=createReduce(1),reduceRight=createReduce(-1);function filter$3(as,rs,ns){var ss=[];return rs=cb(rs,ns),each(as,function(os,ls,us){rs(os,ls,us)&&ss.push(os)}),ss}function reject$1(as,rs,ns){return filter$3(as,negate$2(cb(rs)),ns)}function every$1(as,rs,ns){rs=cb(rs,ns);for(var ss=!isArrayLike(as)&&keys$4(as),os=(ss||as).length,ls=0;ls=0}var invoke=restArguments(function(as,rs,ns){var ss,os;return isFunction$1$1(rs)?os=rs:(rs=toPath(rs),ss=rs.slice(0,-1),rs=rs[rs.length-1]),map$3(as,function(ls){var us=os;if(!us){if(ss&&ss.length&&(ls=deepGet(ls,ss)),ls==null)return;us=ls[rs]}return us==null?us:us.apply(ls,ns)})});function pluck(as,rs){return map$3(as,property(rs))}function where(as,rs){return filter$3(as,matcher(rs))}function max$3(as,rs,ns){var ss,os,ls=-1/0,us=-1/0;if(rs==null||typeof rs=="number"&&typeof as[0]!="object"&&as!=null)for(var cs=0,ds=(as=isArrayLike(as)?as:values$2(as)).length;csls&&(ls=ss);else rs=cb(rs,ns),each(as,function(ps,fs,hs){((os=rs(ps,fs,hs))>us||os===-1/0&&ls===-1/0)&&(ls=ps,us=os)});return ls}function min$3(as,rs,ns){var ss,os,ls=1/0,us=1/0;if(rs==null||typeof rs=="number"&&typeof as[0]!="object"&&as!=null)for(var cs=0,ds=(as=isArrayLike(as)?as:values$2(as)).length;cscs||us===void 0)return 1;if(us1&&(ss=optimizeCb(ss,rs[1])),rs=allKeys(as)):(ss=keyInObj,rs=flatten$2$1(rs,!1,!1),as=Object(as));for(var os=0,ls=rs.length;os1&&(ns=rs[1])):(rs=map$3(flatten$2$1(rs,!1,!1),String),ss=function(os,ls){return!contains$3(rs,ls)}),pick$3(as,ss,ns)});function initial(as,rs,ns){return slice$1.call(as,0,Math.max(0,as.length-(rs==null||ns?1:rs)))}function first$2(as,rs,ns){return as==null||as.length<1?rs==null||ns?void 0:[]:rs==null||ns?as[0]:initial(as,as.length-rs)}function rest(as,rs,ns){return slice$1.call(as,rs==null||ns?1:rs)}function last$1(as,rs,ns){return as==null||as.length<1?rs==null||ns?void 0:[]:rs==null||ns?as[as.length-1]:rest(as,Math.max(0,as.length-rs))}function compact$2(as){return filter$3(as,Boolean)}function flatten$1$1(as,rs){return flatten$2$1(as,rs,!1)}var difference$1=restArguments(function(as,rs){return rs=flatten$2$1(rs,!0,!0),filter$3(as,function(ns){return!contains$3(rs,ns)})}),without=restArguments(function(as,rs){return difference$1(as,rs)});function uniq$1(as,rs,ns,ss){isBoolean$2(rs)||(ss=ns,ns=rs,rs=!1),ns!=null&&(ns=cb(ns,ss));for(var os=[],ls=[],us=0,cs=getLength(as);usps&&(ps=ns)):(ns>ps&&(ps=ns),ps*=fs),Math.abs(as-rs)<=ps}return as===rs}var ls=as[0],us=as.slice(1),cs=rs[0],ds=rs.slice(1);return ls!==cs||us.length!==ds.length?!1:ns>0&&!ss&&ls==="^"?!!equal$2(us[0],ds[0],{allowed_error_in_numbers:ns,include_error_in_number_exponents:ss,allowed_error_is_absolute:os})&&equal$2(us[1],ds[1]):_$2.every(_$2.zip(us,ds),function(ps){return equal$2(ps[0],ps[1],{allowed_error_in_numbers:ns,include_error_in_number_exponents:ss,allowed_error_is_absolute:os})})},match$2=function(as,rs,ns){var ss=!1;ns===void 0?ns={}:ns.allow_extended_match&&(ss=!0,delete(ns=Object.assign({},ns)).allow_extended_match);var os=ns.variables;if(os===void 0){os={};let ps=variables(rs);for(let fs=0;fsObject()),us=ns.length,cs=!1;function ds(hs,gs,ys){let bs,vs=1,xs=1;if((is_associative$1[as]||["tuple","vector","altvector"].includes(as))&&(vs=hs.length-(us-gs-1),xs=hs.length),ss.max_group!==void 0&&(vs=ss.max_group1?[as].concat(ws):ws[0],Ts=match$2(ws,ns[gs],ss),ls[gs][Cs]=Ts}if(!Ts||!_$2.every(_$2.intersection(Object.keys(ys),Object.keys(Ts)),function(ws){return equal$2(ys[ws],Ts[ws])}))continue;let Ss=Object.assign({},Ts);Object.assign(Ss,ys);let Ns=hs.filter(ws=>!Cs.includes(ws));if(gs===us-1)return{matches:Ss,skipped:Ns.reduce(function(ws,Es){return ws.concat([rs[Es]])},[])};let As=ds(Ns,gs+1,Ss);if(As)return As}return!1}ss.allow_permutations&&(as==="*"?cs=![...rs,...ns].some(hs=>["tuple","list","vector","altvector","interval","set","array","matrix"].includes(hs[0])):as!=="+"&&as!=="="&&as!=="and"&&as!=="or"&&as!=="ne"&&as!=="union"&&as!=="intersect"||(cs=!0));var ps={},fs=[...Array(rs.length).keys()];if(cs){let hs=ds(fs,0,{});return!!hs&&(ps=hs.matches,hs.skipped.length>0&&(ps._skipped=hs.skipped),ps)}{let hs,gs=os?rs.length-us:0,ys=[];for(let bs=0;bs<=gs&&(hs=ds(fs,0,{}),!hs);bs++)fs=fs.slice(1),ys.push(rs[bs]);return!!hs&&(ps=hs.matches,hs.skipped.length>0&&(ps._skipped=hs.skipped),ys.length>0&&(ps._skipped_before=ys),ps)}}function matchImplicitIdentity(as,rs,ns){var ss=rs[0],os=rs.slice(1);if(ss!=="+"&&ss!=="*"&&ss!=="^")return!1;var ls=[];for(let us=0;us0;ns--){ss=os;for(let ls=0;ls0||gs.length>0)&&(Array.isArray(hs)&&(hs=hs[0]===us[0]?hs.slice(1):[hs]),hs=[us[0]].concat(ys,hs,gs)),ds.evaluate_numbers&&(hs=evaluate_numbers(hs,{max_digits:ds.max_digits})),hs}return ps})}if(equal$2(ss,os))return os}return os};var math=math$1;const operators$2={"+":function(as){return as.length===1?as[0]:new math.OperatorNode("+","add",as)},"*":function(as){return new math.OperatorNode("*","multiply",as)},"/":function(as){return new math.OperatorNode("/","divide",as)},"-":function(as){return new math.OperatorNode("-","unaryMinus",[as[0]])},"^":function(as){return new math.OperatorNode("^","pow",as)},vector:function(as){return new math.ArrayNode(as)},altvector:function(as){return new math.ArrayNode(as)},and:function(as){return new math.OperatorNode("and","and",as)},or:function(as){return new math.OperatorNode("or","or",as)},not:function(as){return new math.OperatorNode("not","not",[as[0]])},"<":function(as){return new math.OperatorNode("<","smaller",as)},">":function(as){return new math.OperatorNode(">","larger",as)},le:function(as){return new math.OperatorNode("<=","smallerEq",as)},ge:function(as){return new math.OperatorNode(">=","largerEq",as)},ne:function(as){return new math.OperatorNode("!=","unequal",as)},binom:function(as){const rs=new math.SymbolNode("combinations");return new math.FunctionNode(rs,as)}},functionConverstions={nCr:"combinations",nPr:"permutations",binom:"combinations"};class astToMathjs$1{constructor({mathjs:rs=null}={}){rs&&(math=rs)}convert(rs){if(typeof rs=="number")return Number.isFinite(rs)?new math.ConstantNode(rs):Number.isNaN(rs)?new math.SymbolNode("NaN"):rs<0?operators$2["-"]([new math.SymbolNode("Infinity")]):new math.SymbolNode("Infinity");if(typeof rs=="string")return new math.SymbolNode(rs);if(typeof rs=="boolean")throw Error("no support for boolean");if(!Array.isArray(rs))throw Error("Invalid ast");const ns=rs[0],ss=rs.slice(1);if(ns==="apply"){if(typeof ss[0]!="string")throw Error("Non string functions not implemented for conversion to mathjs");if(ss[0]==="factorial")return new math.OperatorNode("!","factorial",[this.convert(ss[1])]);let os=functionConverstions[ss[0]];os||(os=ss[0]);const ls=new math.SymbolNode(os),us=ss[1];let cs;return cs=us[0]==="tuple"?us.slice(1).map(function(ds,ps){return this.convert(ds)}.bind(this)):[this.convert(us)],new math.FunctionNode(ls,cs)}if(ns==="lts"||ns==="gts"){const os=ss[0],ls=ss[1];if(os[0]!=="tuple"||ls[0]!=="tuple")throw new Error("Badly formed ast");const us=os.slice(1).map(function(ps,fs){return this.convert(ps)}.bind(this));let cs=[];for(let ps=1;ps","larger",us.slice(ps-1,ps+1))):ns==="lts"?cs.push(new math.OperatorNode("<=","smallerEq",us.slice(ps-1,ps+1))):cs.push(new math.OperatorNode(">=","largerEq",us.slice(ps-1,ps+1)));let ds=new math.OperatorNode("and","and",cs.slice(0,2));for(let ps=2;ps=","largerEq",[os,ds])):fs.push(new math.OperatorNode(">","larger",[os,ds])),cs[2]?fs.push(new math.OperatorNode("<=","smallerEq",[os,ps])):fs.push(new math.OperatorNode("<","smaller",[os,ps]));let hs=new math.OperatorNode("and","and",fs);return ns!=="notin"&&ns!=="notni"||(hs=new math.OperatorNode("not","not",[hs])),hs}if(ns==="subset"||ns==="notsubset"||ns==="superset"||ns==="notsuperset"){let os,ls;if(ns==="subset"||ns==="notsubset"?(ls=ss[0],os=ss[1]):(ls=ss[1],os=ss[0]),ls[0]!=="interval"||os[0]!=="interval")throw Error("Set containment of non-intervals not implemented for conversion to mathjs");let us=ls[1],cs=ls[2],ds=os[1],ps=os[2];if(us[0]!=="tuple"||cs[0]!=="tuple"||ds[0]!=="tuple"||ps[0]!=="tuple")throw Error("Badly formed ast");let fs=this.convert(us[1]),hs=this.convert(us[2]),gs=this.convert(ds[1]),ys=this.convert(ds[2]),bs=[];cs[1]&&!ps[1]?bs.push(new math.OperatorNode(">","larger",[fs,gs])):bs.push(new math.OperatorNode(">=","largerEq",[fs,gs])),cs[2]&&!ps[2]?bs.push(new math.OperatorNode("<","smaller",[hs,ys])):bs.push(new math.OperatorNode("<=","smallerEq",[hs,ys]));let vs=new math.OperatorNode("and","and",bs);return ns!=="notsubset"&&ns!=="notsuperset"||(vs=new math.OperatorNode("not","not",[vs])),vs}if(ns==="matrix"){let os=ss[0],ls=os[1],us=os[2],cs=ss[1];if(!Number.isInteger(ls)||!Number.isInteger(us))throw Error("Matrix must have integer dimensions");let ds=[];for(let ps=1;ps<=ls;ps++){let fs=[];for(let hs=1;hs<=us;hs++)fs.push(this.convert(cs[ps][hs]));ds.push(new math.ArrayNode(fs))}return new math.ArrayNode(ds)}if(ns in operators$2)return operators$2[ns](ss.map(function(os,ls){return this.convert(os)}.bind(this)));throw Error("Operator "+ns+" not implemented for conversion to mathjs")}}var function_normalizations={ln:"log",arccos:"acos",arccosh:"acosh",arcsin:"asin",arcsinh:"asinh",arctan:"atan",arctanh:"atanh",arcsec:"asec",arcsech:"asech",arccsc:"acsc",arccsch:"acsch",arccot:"acot",arccoth:"acoth",cosec:"csc"},create_trig_inverses_for=["cos","cosh","sin","sinh","tan","tanh","sec","sech","csc","csch","cot","coth"],move_exponents_outside_for=["cos","cosh","sin","sinh","tan","tanh","sec","sech","csc","csch","cot","coth"];function normalize_function_names(as){var rs=get_tree(as);if(!Array.isArray(rs))return rs;var ns=rs[0],ss=rs.slice(1);if(ns==="apply"){if(ss[0]==="sqrt")return["^",normalize_function_names(ss[1]),.5];var os=normalize_function_names_sub(ss[0]);os=["apply",os];var ls=ss.slice(1).map(function(us){return normalize_function_names(us)});return ls=ls.length>1?["tuple"].concat(ls):ls[0],os.push(ls),os}return ns==="^"&&ss[0]==="e"&&math$1.define_e?["apply","exp",normalize_function_names(ss[1])]:ns==="binom"?["apply","nCr",["tuple",normalize_function_names(ss[0]),normalize_function_names(ss[1])]]:[ns].concat(ss.map(function(us){return normalize_function_names(us)}))}function normalize_function_names_sub(as){if(typeof as=="string")return as in function_normalizations?function_normalizations[as]:as;if(!Array.isArray(as))return as;var rs=as[0],ns=as.slice(1);if(rs==="^"&&ns.length===2&&ns[1]===-1){let ss=normalize_function_names_sub(ns[0]);if(create_trig_inverses_for.includes(ss))return"a"+ss}return[rs].concat(ns.map(function(ss){return normalize_function_names_sub(ss)}))}function normalize_applied_functions(as){var rs=get_tree(as);if(!Array.isArray(rs))return rs;var ns=rs[0],ss=rs.slice(1);if(ns==="apply"){let os=ss[0];if(os[0]==="^"){let cs=os[1],ds=os[2];return ds!==-1&&move_exponents_outside_for.includes(cs)?["^",["apply",cs,normalize_applied_functions(ss[1])],ds]:["apply",os,normalize_applied_functions(ss[1])]}let ls=0;for(;os[0]==="prime";)ls+=1,os=os[1];let us=["apply",os,normalize_applied_functions(ss[1])];for(let cs=0;cs2&&(os=unflattenRight(os),cs=os.slice(1)),simple_assumption_combination(us,is_integer_ast(as,cs[0],ns),is_integer_ast(as,cs[1],ns)))}if(Array.isArray(as)){let os;os=Array.isArray(rs)?rs:rs.get_assumptions([variables(as)]);let ls=as[0],us=as.slice(1);if(ls==="-")return is_integer_ast(us[0],os,ns);if(ls==="*")return!!us.every(function(cs){return is_integer_ast(cs,os,ns)})||void 0;if(ls==="^"){let cs=is_nonzero_ast(us[0],os,ns);if(cs){if(is_nonzero_ast(us[1],os,ns)===!1)return us[0]!==1/0&&us[0]!==-1/0}else{if(Number.isNaN(us[0]))return!1;if(!is_positive_ast(us[1],os,!0,ns))return;if(cs===!1)return!0}let ds=is_integer_ast(us[0],os,ns),ps=is_integer_ast(us[1],os,ns);return ds&&(ps&&!!is_positive_ast(us[1],os,!1,ns)||void 0)}if(ls==="+"){let cs=0;for(let ds=0;ds0)return;cs+=1}if(ps===void 0)return}return cs===0}return ls==="apply"?!!(functions.C.Z&&functions.C.Z.includes(us[0])&&is_complex_ast(us[1],os,ns))||!!(functions.R.Z&&functions.R.Z.includes(us[0])&&is_real_ast(us[1],os,ns))||!!(functions.nonzeroC.Z&&functions.nonzeroC.Z.includes(us[0])&&is_nonzero_ast(us[1],os,ns)&&is_complex_ast(us[1],os,ns))||!!(functions.nonneg.Z&&functions.nonneg.Z.includes(us[0])&&is_positive_ast(us[1],os,!1,ns))||!!(functions.pos.Z&&functions.pos.Z.includes(us[0])&&is_positive_ast(us[1],os,!0,ns))||void 0:ls==="/"||ls==="prime"?void 0:!1}return!1}function is_real_ast(as,rs,ns){if(typeof rs!="object"&&(rs=[]),ns===void 0&&(ns=rs),typeof as=="number")return Number.isFinite(as);var ss=evaluate_to_constant(as,!1);if(ss!==null)return typeof ss=="number"&&Number.isFinite(ss);if(typeof as=="string"){let os;if(os=Array.isArray(rs)?rs:rs.get_assumptions(as),!Array.isArray(os))return;let ls=os,us=os[0],cs=os.slice(1),ds=!1;for(;us==="not";){if(ds=!ds,os=cs[0],!Array.isArray(os))return;us=os[0],cs=os.slice(1)}if(us==="in"&&cs[0]===as&&cs[1]==="R")return negate_adjust(!0,ds);if(us==="notin"&&cs[0]===as&&cs[1]==="R")return negate_adjust(!1,ds);if(ds===!1){if(us==="in"&&cs[0]===as&&cs[1]==="Z")return!0}else if(us==="notin"&&cs[0]===as&&cs[1]==="Z")return!0;if(us==="<"||us==="le"){let ps=variables(os),fs=functions$2(os);if(ps.indexOf(as)!==-1&&fs.length===0)return!0}if(us==="="&&!ds||us==="ne"&&ds){let ps=narrow_assumptions(ls,ns);if(cs[0]===as)return is_real_ast(cs[1],ps);if(cs[1]===as)return is_real_ast(cs[0],ps)}return us!=="and"&&us!=="or"||ds?void 0:(cs.length>2&&(os=unflattenRight(os),cs=os.slice(1)),simple_assumption_combination(us,is_real_ast(as,cs[0],ns),is_real_ast(as,cs[1],ns)))}if(Array.isArray(as)){let os;os=Array.isArray(rs)?rs:rs.get_assumptions([variables(as)]);let ls=as[0],us=as.slice(1);if(ls==="-")return is_real_ast(us[0],os,ns);if(ls==="*"||ls==="+"){if(us.length>2&&(us=(as=unflattenRight(as)).slice(1)),ls==="*"&&(is_nonzero_ast(us[0],os,ns)===!1||is_nonzero_ast(us[1],os,ns)===!1))return!0;let cs=is_real_ast(us[0],os,ns),ds=is_real_ast(us[1],os,ns);return!(!cs||!ds)||!(cs&&ds===!1||ds&&cs===!1)&&void 0}if(ls==="^"){let cs=is_nonzero_ast(us[0],os,ns),ds=is_positive_ast(us[1],os,!0,ns);if(cs){if(is_nonzero_ast(us[1],os,ns)===!1)return us[0]!==1/0&&us[0]!==-1/0}else{if(Number.isNaN(us[0]))return!1;if(!ds)return;if(cs===!1)return!0}let ps=is_real_ast(us[0],os,ns),fs=is_real_ast(us[1],os,ns);return!ps||!fs?void 0:is_positive_ast(us[0],os,!1,ns)?!!is_positive_ast(us[0],os,!0,ns)||!!ds||void 0:!!is_integer_ast(us[1],os,ns)||void 0}return ls==="/"?is_nonzero_ast(us[1],os,ns)?is_nonzero_ast(us[0],os,ns)===!1?!0:!is_real_ast(us[0],os,ns)||!is_real_ast(us[1],os,ns)?void 0:!0:void 0:ls==="apply"?!!(functions.C.R&&functions.C.R.includes(us[0])&&is_complex_ast(us[1],os,ns))||!!(functions.R.R&&functions.R.R.includes(us[0])&&is_real_ast(us[1],os,ns))||!!(functions.nonzeroC.R&&functions.nonzeroC.R.includes(us[0])&&is_nonzero_ast(us[1],os,ns)&&is_complex_ast(us[1],os,ns))||!!(functions.nonneg.R&&functions.nonneg.R.includes(us[0])&&is_positive_ast(us[1],os,!1,ns))||!!(functions.pos.R&&functions.pos.R.includes(us[0])&&is_positive_ast(us[1],os,!0,ns))||void 0:ls==="prime"?void 0:!1}return!1}function is_complex_ast(as,rs,ns){if(typeof rs!="object"&&(rs=[]),ns===void 0&&(ns=rs),typeof as=="number")return Number.isFinite(as);var ss=evaluate_to_constant(as,!1);if(ss!==null)return typeof ss=="number"?Number.isFinite(ss):!(ss.re===void 0||!Number.isFinite(ss.re)||ss.im===void 0||!Number.isFinite(ss.im));if(typeof as=="string"){let os;if(os=Array.isArray(rs)?rs:rs.get_assumptions(as),!Array.isArray(os))return;let ls=os,us=os[0],cs=os.slice(1),ds=!1;for(;us==="not";){if(ds=!ds,os=cs[0],!Array.isArray(os))return;us=os[0],cs=os.slice(1)}if(us==="in"&&cs[0]===as&&cs[1]==="C")return negate_adjust(!0,ds);if(us==="notin"&&cs[0]===as&&cs[1]==="C")return negate_adjust(!1,ds);if(ds===!1){if(us==="in"&&(cs[0]===as&&cs[1]==="Z"||cs[0]===as&&cs[1]==="R"))return!0}else if(us==="notin"&&(cs[0]===as&&cs[1]==="Z"||cs[0]===as&&cs[1]==="R"))return!0;if(us==="<"||us==="le"){let ps=variables(os),fs=functions$2(os);if(ps.indexOf(as)!==-1&&fs.length===0)return!0}if(us==="="&&!ds||us==="ne"&&ds){let ps=narrow_assumptions(ls,ns);if(cs[0]===as)return is_complex_ast(cs[1],ps);if(cs[1]===as)return is_complex_ast(cs[0],ps)}return us!=="and"&&us!=="or"||ds?void 0:(cs.length>2&&(os=unflattenRight(os),cs=os.slice(1)),simple_assumption_combination(us,is_complex_ast(as,cs[0],ns),is_complex_ast(as,cs[1],ns)))}if(Array.isArray(as)){let os;os=Array.isArray(rs)?rs:rs.get_assumptions([variables(as)]);let ls=as[0],us=as.slice(1);if(ls==="-")return is_complex_ast(us[0],os,ns);if(ls==="*"||ls==="+")return ls==="*"&&!us.every(cs=>is_nonzero_ast(cs,os,ns)!==!1)?!0:!!us.every(cs=>is_complex_ast(cs,os,ns))||void 0;if(ls==="^"){let cs=is_nonzero_ast(us[0],os,ns),ds=is_positive_ast(us[1],os,!0,ns);if(cs){if(is_nonzero_ast(us[1],os,ns)===!1)return us[0]!==1/0&&us[0]!==-1/0}else{if(Number.isNaN(us[0]))return!1;if(!ds)return;if(cs===!1)return!0}let ps=is_complex_ast(us[0],os,ns),fs=is_complex_ast(us[1],os,ns);return!(!ps||!fs)||void 0}return ls==="/"?is_nonzero_ast(us[1],os,ns)?is_nonzero_ast(us[0],os,ns)===!1?!0:!is_complex_ast(us[0],os,ns)||!is_complex_ast(us[1],os,ns)?void 0:!0:void 0:ls==="apply"?!!(functions.C.C&&functions.C.C.includes(us[0])&&is_complex_ast(us[1],os,ns))||!!(functions.R.C&&functions.R.C.includes(us[0])&&is_real_ast(us[1],os,ns))||!!(functions.nonzeroC.C&&functions.nonzeroC.C.includes(us[0])&&is_nonzero_ast(us[1],os,ns)&&is_complex_ast(us[1],os,ns))||!!(functions.nonneg.C&&functions.nonneg.C.includes(us[0])&&is_positive_ast(us[1],os,!1,ns))||!!(functions.pos.C&&functions.pos.C.includes(us[0])&&is_positive_ast(us[1],os,!0,ns))||void 0:ls==="prime"?void 0:!1}return!1}function is_nonzero_ast(as,rs,ns){if(typeof rs!="object"&&(rs=[]),ns===void 0&&(ns=rs),typeof as=="number")return Number.isFinite(as)?as!==0:Number.isNaN(as)?void 0:!0;var ss=evaluate_to_constant(as,!1);if(ss!==null)return typeof ss=="number"?Number.isFinite(ss)?ss!==0:Number.isNaN(ss)?void 0:!0:ss.re!==void 0&&ss.im!==void 0&&(ss.re!==0||ss.im!==0)||void 0;if(typeof as=="string"){let os;if(os=Array.isArray(rs)?rs:rs.get_assumptions(as),!Array.isArray(os))return;let ls=os,us=os[0],cs=os.slice(1),ds=!1;for(;us==="not";){if(ds=!ds,os=cs[0],!Array.isArray(os))return;us=os[0],cs=os.slice(1)}let ps=narrow_assumptions(ls,ns);if(us==="="&&!ds||us==="ne"&&ds){if(cs[0]===as)return is_nonzero_ast(cs[1],ps);if(cs[1]===as)return is_nonzero_ast(cs[0],ps)}if((us==="ne"&&!ds||us==="="&&ds)&&(cs[0]===as&&is_nonzero_ast(cs[1],ps)===!1||cs[1]===as&&is_nonzero_ast(cs[0],ps)===!1))return!0;if(us==="<"){if(ds){if(cs[0]===as&&is_positive_ast(cs[1],ps,!0)||cs[1]===as&&is_negative_ast(cs[0],ps,!0))return!0}else if(cs[0]===as&&is_negative_ast(cs[1],ps,!1)||cs[1]===as&&is_positive_ast(cs[0],ps,!1))return!0}if(us==="le"){if(ds){if(cs[0]===as&&is_positive_ast(cs[1],ps,!1)||cs[1]===as&&is_negative_ast(cs[0],ps,!1))return!0}else if(cs[0]===as&&is_negative_ast(cs[1],ps,!0)||cs[1]===as&&is_positive_ast(cs[0],ps,!0))return!0}return us!=="and"&&us!=="or"||ds?void 0:(cs.length>2&&(os=unflattenRight(os),cs=os.slice(1)),simple_assumption_combination(us,is_nonzero_ast(as,cs[0],ns),is_nonzero_ast(as,cs[1],ns)))}if(Array.isArray(as)){let os;os=Array.isArray(rs)?rs:rs.get_assumptions([variables(as)]);let ls=as[0],us=as.slice(1);if(ls==="-")return is_nonzero_ast(us[0],os,ns);if(ls==="+"){if(us.length>2&&(us=(as=unflattenRight(as)).slice(1)),equal$2(us[0],simplify(["-",us[1]],ns)))return!1;let cs=is_nonzero_ast(us[0],os,ns),ds=is_nonzero_ast(us[1],os,ns);if(cs===!1)return ds;if(ds===!1)return cs;let ps=is_real_ast(us[0],os,ns),fs=is_real_ast(us[1],os,ns);if(!ps||!fs)return ps===!0?fs===!1||void 0:fs===!0&&ps===!1||void 0;let hs=is_positive_ast(us[0],os,!1,ns),gs=is_positive_ast(us[1],os,!1,ns),ys=is_positive_ast(us[0],os,!0,ns),bs=is_positive_ast(us[1],os,!0,ns);return!!(hs&&bs||ys&&gs)||hs===!1&&bs===!1||ys===!1&&gs===!1||void 0}if(ls==="*"){let cs=!0;for(let ds=0;ds0:as>=0);var os=is_real_ast(as,rs,ss);if(!os)return os;var ls=evaluate_to_constant(as,!1);if(ls!==null)return typeof ls=="number"&&!!Number.isFinite(ls)&&(ns?ls>0:ls>=0);if(typeof as=="string"){let us;if(us=Array.isArray(rs)?rs:rs.get_assumptions(as),!Array.isArray(us))return;let cs=us,ds=us[0],ps=us.slice(1),fs=!1;for(;ds==="not";){if(fs=!fs,us=ps[0],!Array.isArray(us))return;ds=us[0],ps=us.slice(1)}let hs=narrow_assumptions(cs,ss);if(ds==="="&&!fs||ds==="ne"&&fs){if(ps[0]===as)return is_positive_ast(ps[1],hs,ns);if(ps[1]===as)return is_positive_ast(ps[0],hs,ns)}if(ds==="<")if(fs){if(ps[0]===as&&is_positive_ast(ps[1],hs,ns))return!0;if(ps[1]===as&&is_negative_ast(ps[0],hs,!ns))return!1}else{if(ps[0]===as&&is_negative_ast(ps[1],hs,!1))return!1;if(ps[1]===as&&is_positive_ast(ps[0],hs,!1))return!0}if(ds==="le")if(fs){if(ps[0]===as&&is_positive_ast(ps[1],hs,!1))return!0;if(ps[1]===as&&is_negative_ast(ps[0],hs,!1))return!1}else{if(ps[0]===as&&is_negative_ast(ps[1],hs,!ns))return!1;if(ps[1]===as&&is_positive_ast(ps[0],hs,ns))return!0}return ds!=="and"&&ds!=="or"||fs?void 0:(ps.length>2&&(us=unflattenRight(us),ps=us.slice(1)),simple_assumption_combination(ds,is_positive_ast(as,ps[0],ns,ss),is_positive_ast(as,ps[1],ns,ss)))}if(Array.isArray(as)){let us;us=Array.isArray(rs)?rs:rs.get_assumptions([variables(as)]);let cs=as[0],ds=as.slice(1);if(cs==="-")return is_negative_ast(ds[0],us,ns,ss);if(cs==="+"){ds.length>2&&(ds=(as=unflattenRight(as)).slice(1));let ps=is_positive_ast(ds[0],us,!1,ss),fs=is_positive_ast(ds[1],us,!1,ss),hs=is_positive_ast(ds[0],us,!0,ss),gs=is_positive_ast(ds[1],us,!0,ss);if(ns){if(ps&&gs||hs&&fs)return!0}else if(ps&&fs)return!0;if(ns){if(hs===!1&&gs===!1)return!1}else if(ps===!1&&gs===!1||hs===!1&&fs===!1)return!1;return}if(cs==="*"){if(!ds.every(vs=>is_nonzero_ast(vs,us,ss)!==!1))return!ns;ds.length>2&&(ds=(as=unflattenRight(as)).slice(1));let ps=is_real_ast(ds[0],us,ss),fs=is_real_ast(ds[1],us,ss);if(ps===void 0||fs===void 0)return;if(ps===!1)return fs===!1&&void 0;if(fs===!1)return!1;let hs=is_positive_ast(ds[0],us,!1,ss),gs=is_positive_ast(ds[1],us,!1,ss),ys=is_positive_ast(ds[0],us,!0,ss),bs=is_positive_ast(ds[1],us,!0,ss);if(ns){if(ys&&bs||hs===!1&&gs===!1)return!0;if(ys===!1&&gs||hs&&bs===!1)return!1}else{if(hs&&gs||ys===!1&&bs===!1)return!0;if(ys&&gs===!1||hs===!1&&bs)return!1}return}if(cs==="/"){if(!is_nonzero_ast(ds[1],us,ss))return;if(is_nonzero_ast(ds[0],us,ss)===!1)return!ns;let ps=is_positive_ast(ds[1],us,!0,ss);if(ps===void 0)return;let fs=ps?ns:!ns,hs=is_positive_ast(ds[0],us,fs,ss);return hs===void 0?void 0:hs===!0?ps===!0:ps!==!0}if(cs==="^"){let ps=is_nonzero_ast(ds[0],us,ss);if(ps){if(is_nonzero_ast(ds[1],us,ss)===!1)return ds[0]===1/0||ds[0]===-1/0?void 0:!0}else{if(!is_positive_ast(ds[1],us,!0,ss))return;if(ps===!1)return!ns;if(ns)return}return is_real_ast(ds[0],us,ss)!==!0?void 0:is_positive_ast(ds[0],us,ns,ss)?!!is_real_ast(ds[1],us,ss)||void 0:!!is_integer_ast(simplify(["/",ds[1],2],ss),us,ss)||void 0}return cs==="apply"&&!ns?!!(functions.C.nonneg&&functions.C.nonneg.includes(ds[0])&&is_complex_ast(ds[1],us,ss))||!!(functions.R.nonneg&&functions.R.nonneg.includes(ds[0])&&is_real_ast(ds[1],us,ss))||!!(functions.nonzeroC.nonneg&&functions.nonzeroC.nonneg.includes(ds[0])&&is_nonzero_ast(ds[1],us,ss)&&is_complex_ast(ds[1],us,ss))||!!(functions.nonneg.nonneg&&functions.nonneg.nonneg.includes(ds[0])&&is_positive_ast(ds[1],us,!1,ss))||!!(functions.pos.nonneg&&functions.pos.nonneg.includes(ds[0])&&is_positive_ast(ds[1],us,!0,ss))||void 0:cs==="apply"&&ns?!!(functions.C.pos&&functions.C.pos.includes(ds[0])&&is_complex_ast(ds[1],us,ss))||!!(functions.R.pos&&functions.R.pos.includes(ds[0])&&is_real_ast(ds[1],us,ss))||!!(functions.nonzeroC.pos&&functions.nonzeroC.pos.includes(ds[0])&&is_nonzero_ast(ds[1],us,ss)&&is_complex_ast(ds[1],us,ss))||!!(functions.nonneg.pos&&functions.nonneg.pos.includes(ds[0])&&is_positive_ast(ds[1],us,!1,ss))||!!(functions.pos.pos&&functions.pos.pos.includes(ds[0])&&is_positive_ast(ds[1],us,!0,ss))||void 0:cs==="prime"?void 0:!1}return!1}function is_negative_ast(as,rs,ns,ss){ns===void 0&&(ns=!0);var os=is_real_ast(as,rs,ss);if(os===!0){let ls=is_positive_ast(as,rs,!ns,ss);return ls===!1||ls!==!0&&void 0}return os}function tuples_to_vectors(as){var rs=get_tree(as);if(!Array.isArray(rs))return rs;var ns=rs[0],ss=rs.slice(1);if(ns==="tuple")return["vector"].concat(ss.map(function(os,ls){return tuples_to_vectors(os)}));if(ns==="apply"){if(ss[1][0]==="tuple"){let os=tuples_to_vectors(ss[0]),ls=ss[1].slice(1);return["apply",os,["tuple"].concat(ls.map(function(us,cs){return tuples_to_vectors(us)}))]}}else if(ns==="gts"||ns==="lts"||ns==="interval"){let os=ss[0],ls=ss[1];if(os[0]!=="tuple"||ls[0]!=="tuple")throw new Error("Badly formed ast");return[ns,["tuple"].concat(os.slice(1).map(function(us,cs){return tuples_to_vectors(us)})),ls]}return[ns].concat(ss.map(function(os,ls){return tuples_to_vectors(os)}))}function to_intervals(as){var rs=get_tree(as);if(!Array.isArray(rs))return rs;var ns=rs[0],ss=rs.slice(1);if(ns==="tuple"&&ss.length===2){let os=["tuple"].concat(ss.map(function(ls,us){return to_intervals(ls)}));return os=["interval",os,["tuple",!1,!1]],os}if(ns==="array"&&ss.length===2){let os=["tuple"].concat(ss.map(function(ls,us){return to_intervals(ls)}));return os=["interval",os,["tuple",!0,!0]],os}if(ns==="apply"){if(ss[1][0]==="tuple"){let os=to_intervals(ss[0]),ls=ss[1].slice(1);return["apply",os,["tuple"].concat(ls.map(function(us,cs){return to_intervals(us)}))]}}else if(ns==="gts"||ns==="lts"||ns==="interval"){let os=ss[0],ls=ss[1];if(os[0]!=="tuple"||ls[0]!=="tuple")throw new Error("Badly formed ast");return[ns,["tuple"].concat(os.slice(1).map(function(us,cs){return to_intervals(us)})),ls]}return[ns].concat(ss.map(function(os,ls){return to_intervals(os)}))}function altvectors_to_vectors(as){var rs=get_tree(as);if(!Array.isArray(rs))return rs;var ns=rs[0],ss=rs.slice(1);return ns==="altvector"?["vector"].concat(ss.map(function(os,ls){return altvectors_to_vectors(os)})):[ns].concat(ss.map(function(os,ls){return altvectors_to_vectors(os)}))}function ParseError(as,rs){this.name="ParseError",this.message=as||"Error parsing input",this.stack=new Error().stack,this.location=rs}functions.C.nonneg=["abs"],functions.C.nonzero=["exp"],functions.C.R=["abs","arg"],functions.C.C=["abs","arg","exp","sign","cos","cosh","sin","sinh","erf","sqrt","log","ln","log10"],functions.R.pos=["exp"],functions.R.nonneg=["abs","exp","arg"],functions.R.R=["abs","arg","exp","sign","cos","cosh","sin","sinh","erf"],functions.R.Z=["sign"],functions.nonzeroC.pos=["abs"],functions.nonneg.nonneg=["abs","exp","arg","sqrt","erf"],functions.nonzeroC.nonzero=["abs"],functions.nonneg.R=[...new Set(functions.R.R.concat(functions.nonneg.nonneg))],functions.pos.pos=["abs","exp","sqrt","erf"],functions.pos.nonneg=functions.pos.pos,functions.pos.nonzero=["abs","exp","sqrt","erf"],functions.pos.R=functions.nonneg.R.concat(["log","ln","log10"]),ParseError.prototype=Object.create(Error.prototype),ParseError.prototype.constructor=ParseError;class lexer{constructor(rs,ns="\\s"){this.input="",this.location=0,this.token_rules=[],this.initial_whitespace=new RegExp("^("+ns+")+");for(let ss of rs)this.token_rules.push([new RegExp("^"+ss[0])].concat(ss.slice(1)))}set_input(rs){if(typeof rs!="string")throw new Error("Input must be a string");this.input=rs,this.location=0}return_state(){return{input:this.input,location:this.location}}set_state({input:rs=null,location:ns=0}={}){rs!==null&&(this.input=rs,this.location=ns)}advance({remove_initial_space:rs=!0}={}){let ns=this.initial_whitespace.exec(this.input);if(ns){let os=ns[0].length;if(this.input=this.input.slice(os),this.location+=os,!rs)return{token_type:"SPACE",token_text:ns[0],original_text:ns[0]}}if(this.input.length===0)return{token_type:"EOF",token_text:"",original_text:""};for(var ss of(ns=null,this.token_rules))if(ns=ss[0].exec(this.input),ns){let os=ns[0].length;this.input=this.input.slice(os),this.location+=os;break}return ns===null?{token_type:"INVALID",token_text:this.input[0],original_text:this.input[0]}:ss.length>2?{token_type:ss[1],token_text:ss[2],original_text:ns[0]}:{token_type:ss[1],token_text:ns[0],original_text:ns[0]}}unput(rs){if(typeof rs!="string")throw new Error("Input must be a string");this.location-=rs.length,this.input=rs+this.input}}var is_associative={"+":!0,"*":!0,and:!0,or:!0,union:!0,intersect:!0};function flatten$6(as){if(!Array.isArray(as))return as;var rs=as[0],ns=as.slice(1);if(ns=ns.map(function(ls,us){return flatten$6(ls)}),is_associative[rs]){for(var ss=[],os=0;os2?ss=ss.concat(ns[os].slice(1)):ss.push(ns[os]);ns=ss}return[rs].concat(ns)}const sci_notat_exp_regex$1="(E[+\\-]?[0-9]+\\s*($|(?=\\,|\\||\\)|\\}|\\])))?",number_rules_sci$1=[["[0-9]+(\\.[0-9]*)?"+sci_notat_exp_regex$1,"NUMBER"],["\\.[0-9]+"+sci_notat_exp_regex$1,"NUMBER"]],number_rules_non_sci$1=[["[0-9]+(\\.[0-9]*)?","NUMBER"],["\\.[0-9]+","NUMBER"]],base_text_rules=[["\\*\\*","^"],["\\*","*"],["\\xB7","*"],["·","*"],["•","*"],["⋅","*"],["×","*"],["/","/"],["-","-"],["֊","-"],["־","-"],["᠆","-"],["‐","-"],["‑","-"],["‒","-"],["–","-"],["—","-"],["―","-"],["⁻","-"],["₋","-"],["−","-"],["⸺","-"],["⸻","-"],["﹘","-"],["﹣","-"],["-","-"],["\\+","+"],["\\^","^"],["‸","^"],["ʌ","^"],["\\|","|"],["\\(","("],["\\)",")"],["\\[","["],["\\]","]"],["\\{","{"],["\\}","}"],["⟨","LANGLE"],["⟩","RANGLE"],["〈","LANGLE"],["〉","RANGLE"],[",",","],[":",":"],["α","VARMULTICHAR","alpha"],["β","VARMULTICHAR","beta"],["ϐ","VARMULTICHAR","beta"],["Γ","VARMULTICHAR","Gamma"],["γ","VARMULTICHAR","gamma"],["Δ","VARMULTICHAR","Delta"],["δ","VARMULTICHAR","delta"],["ε","VARMULTICHAR","epsilon"],["ϵ","VARMULTICHAR","epsilon"],["ζ","VARMULTICHAR","zeta"],["η","VARMULTICHAR","eta"],["Θ","VARMULTICHAR","Theta"],["ϴ","VARMULTICHAR","Theta"],["θ","VARMULTICHAR","theta"],["ᶿ","VARMULTICHAR","theta"],["ϑ","VARMULTICHAR","theta"],["ι","VARMULTICHAR","iota"],["κ","VARMULTICHAR","kappa"],["Λ","VARMULTICHAR","Lambda"],["λ","VARMULTICHAR","lambda"],["μ","VARMULTICHAR","mu"],["µ","VARMULTICHAR","mu"],["ν","VARMULTICHAR","nu"],["Ξ","VARMULTICHAR","Xi"],["ξ","VARMULTICHAR","xi"],["Π","VARMULTICHAR","Pi"],["π","VARMULTICHAR","pi"],["ϖ","VARMULTICHAR","pi"],["ρ","VARMULTICHAR","rho"],["ϱ","VARMULTICHAR","rho"],["Σ","VARMULTICHAR","Sigma"],["σ","VARMULTICHAR","sigma"],["ς","VARMULTICHAR","sigma"],["τ","VARMULTICHAR","tau"],["Υ","VARMULTICHAR","Upsilon"],["υ","VARMULTICHAR","upsilon"],["Φ","VARMULTICHAR","Phi"],["φ","VARMULTICHAR","phi"],["ϕ","VARMULTICHAR","phi"],["Ψ","VARMULTICHAR","Psi"],["ψ","VARMULTICHAR","psi"],["Ω","VARMULTICHAR","Omega"],["ω","VARMULTICHAR","omega"],["oo(?![a-zA-Z0-9])","INFINITY"],["OO(?![a-zA-Z0-9])","INFINITY"],["infty(?![a-zA-Z0-9])","INFINITY"],["infinity(?![a-zA-Z0-9])","INFINITY"],["Infinity(?![a-zA-Z0-9])","INFINITY"],["∞","INFINITY"],["ℯ","VAR","e"],["♠","VARMULTICHAR","spade"],["♡","VARMULTICHAR","heart"],["♢","VARMULTICHAR","diamond"],["♣","VARMULTICHAR","club"],["★","VARMULTICHAR","bigstar"],["◯","VARMULTICHAR","bigcirc"],["◊","VARMULTICHAR","lozenge"],["△","VARMULTICHAR","bigtriangleup"],["▽","VARMULTICHAR","bigtriangledown"],["⧫","VARMULTICHAR","blacklozenge"],["■","VARMULTICHAR","blacksquare"],["▲","VARMULTICHAR","blacktriangle"],["▼","VARMULTICHAR","blacktriangledown"],["◀","VARMULTICHAR","blacktriangleleft"],["▶","VARMULTICHAR","blacktriangleright"],["□","VARMULTICHAR","Box"],["∘","VARMULTICHAR","circ"],["⋆","VARMULTICHAR","star"],["and(?![a-zA-Z0-9])","AND"],["\\&\\&?","AND"],["∧","AND"],["or(?![a-zA-Z0-9])","OR"],["∨","OR"],["not(?![a-zA-Z0-9])","NOT"],["¬","NOT"],["=","="],["᐀","="],["゠","="],["!=","NE"],["≠","NE"],["<=","LE"],["≤","LE"],[">=","GE"],["≥","GE"],["<","<"],[">",">"],["forall(?![a-zA-Z0-9])","FORALL"],["∀","FORALL"],["exists(?![a-zA-Z0-9])","EXISTS"],["∃","EXISTS"],["elementof(?![a-zA-Z0-9])","IN"],["∈","IN"],["notelementof(?![a-zA-Z0-9])","NOTIN"],["∉","NOTIN"],["containselement(?![a-zA-Z0-9])","NI"],["∋","NI"],["notcontainselement(?![a-zA-Z0-9])","NOTNI"],["∌","NOTNI"],["subset(?![a-zA-Z0-9])","SUBSET"],["⊂","SUBSET"],["subseteq(?![a-zA-Z0-9])","SUBSETEQ"],["⊆","SUBSETEQ"],["notsubset(?![a-zA-Z0-9])","NOTSUBSET"],["⊄","NOTSUBSET"],["notsubseteq(?![a-zA-Z0-9])","NOTSUBSETEQ"],["⊈","NOTSUBSETEQ"],["superset(?![a-zA-Z0-9])","SUPERSET"],["⊃","SUPERSET"],["superseteq(?![a-zA-Z0-9])","SUPERSETEQ"],["⊇","SUPERSETEQ"],["notsuperset(?![a-zA-Z0-9])","NOTSUPERSET"],["⊅","NOTSUPERSET"],["notsuperseteq(?![a-zA-Z0-9])","NOTSUPERSETEQ"],["⊉","NOTSUPERSETEQ"],["union(?![a-zA-Z0-9])","UNION"],["∪","UNION"],["intersect(?![a-zA-Z0-9])","INTERSECT"],["∩","INTERSECT"],["perp(?![a-zA-Z0-9])","PERP"],["⟂","PERP"],["parallel(?![a-zA-Z0-9])","PARALLEL"],["∥","PARALLEL"],["angle(?![a-zA-Z0-9])","ANGLE"],["∠","ANGLE"],["int(?![a-zA-Z0-9])","INT"],["∫","INT"],["!","!"],["'","'"],["_","_"],["\\.\\.\\.","LDOTS"],["[a-zA-Z∂][a-zA-Z∂0-9]*","VAR"],["[_$%]","VAR"]],allowSimplifiedFunctionApplicationDefault$1=!0,splitSymbolsDefault=!0,unsplitSymbolsDefault=["alpha","beta","gamma","Gamma","delta","Delta","epsilon","zeta","eta","theta","Theta","iota","kappa","lambda","Lambda","mu","nu","xi","Xi","pi","Pi","rho","sigma","Sigma","tau","Tau","upsilon","Upsilon","phi","Phi","chi","psi","Psi","omega","Omega","angle","deg"],appliedFunctionSymbolsDefault$1=["abs","exp","log","ln","log10","sign","sqrt","erf","cos","cosh","acos","acosh","arccos","arccosh","cot","coth","acot","acoth","arccot","arccoth","csc","csch","acsc","acsch","arccsc","arccsch","sec","sech","asec","asech","arcsec","arcsech","sin","sinh","asin","asinh","arcsin","arcsinh","tan","tanh","atan","atan2","atanh","arctan","arctanh","arg","conj","re","im","det","trace","nPr","nCr","floor","ceil","round"],functionSymbolsDefault$1=["f","g"],operatorSymbolsDefault$1=["binom","vec","linesegment"],unitsDefault$1=get_all_units(),parseLeibnizNotationDefault$1=!0;class textToAst$4{constructor({allowSimplifiedFunctionApplication:rs=allowSimplifiedFunctionApplicationDefault$1,splitSymbols:ns=splitSymbolsDefault,unsplitSymbols:ss=unsplitSymbolsDefault,appliedFunctionSymbols:os=appliedFunctionSymbolsDefault$1,functionSymbols:ls=functionSymbolsDefault$1,operatorSymbols:us=operatorSymbolsDefault$1,units:cs=unitsDefault$1,parseLeibnizNotation:ds=parseLeibnizNotationDefault$1,parseScientificNotation:ps=!0}={}){this.allowSimplifiedFunctionApplication=rs,this.splitSymbols=ns,this.unsplitSymbols=ss,this.appliedFunctionSymbols=os,this.functionSymbols=ls,this.operatorSymbols=us,this.units=cs,this.parseLeibnizNotation=ds;let fs=base_text_rules;fs=ps?[...number_rules_sci$1,...fs]:[...number_rules_non_sci$1,...fs],this.lexer=new lexer(fs)}advance(rs){if(this.token=this.lexer.advance(rs),this.token.token_type==="INVALID")throw new ParseError("Invalid symbol '"+this.token.original_text+"'",this.lexer.location)}return_state(){return{lexer_state:this.lexer.return_state(),token:Object.assign({},this.token)}}set_state(rs){this.lexer.set_state(rs.lexer_state),this.token=Object.assign({},rs.token)}convert(rs){this.lexer.set_input(rs),this.advance();var ns=this.statement_list();if(this.token.token_type!=="EOF")throw new ParseError("Invalid location of '"+this.token.original_text+"'",this.lexer.location);return flatten$6(ns)}statement_list(){for(var rs=[this.statement()];this.token.token_type===",";)this.advance(),rs.push(this.statement());return rs=rs.length>1?["list"].concat(rs):rs[0]}statement({inside_absolute_value:rs=0}={}){if(this.token.token_type==="LDOTS")return this.advance(),["ldots"];var ns;try{ns=this.return_state();let ss=this.statement_a({inside_absolute_value:rs});return this.token.token_type!==":"?ss:(this.advance(),[":",ss,this.statement_a()])}catch(ss){try{this.set_state(ns);let os=this.statement_a({parse_absolute_value:!1});if(this.token.token_type!=="|")throw ss;return this.advance(),["|",os,this.statement_a({parse_absolute_value:!1})]}catch{throw ss}}}statement_a({inside_absolute_value:rs=0,parse_absolute_value:ns=!0}={}){for(var ss=this.statement_b({inside_absolute_value:rs,parse_absolute_value:ns});this.token.token_type==="OR";){let os=this.token.token_type.toLowerCase();this.advance(),ss=[os,ss,this.statement_b({inside_absolute_value:rs,parse_absolute_value:ns})]}return ss}statement_b(rs){for(var ns=this.relation(rs);this.token.token_type==="AND";){let ss=this.token.token_type.toLowerCase();this.advance(),ns=[ss,ns,this.relation(rs)]}return ns}relation(rs){if(this.token.token_type==="NOT"||this.token.token_type==="!")return this.advance(),["not",this.relation(rs)];if(this.token.token_type==="FORALL"||this.token.token_type==="EXISTS"){let ss=this.token.token_type.toLowerCase();return this.advance(),[ss,this.relation(rs)]}for(var ns=this.expression(rs);this.token.token_type==="="||this.token.token_type==="NE"||this.token.token_type==="<"||this.token.token_type===">"||this.token.token_type==="LE"||this.token.token_type==="GE"||this.token.token_type==="IN"||this.token.token_type==="NOTIN"||this.token.token_type==="NI"||this.token.token_type==="NOTNI"||this.token.token_type==="SUBSET"||this.token.token_type==="NOTSUBSET"||this.token.token_type==="SUBSETEQ"||this.token.token_type==="NOTSUBSETEQ"||this.token.token_type==="SUPERSET"||this.token.token_type==="NOTSUPERSET"||this.token.token_type==="SUPERSETEQ"||this.token.token_type==="NOTSUPERSETEQ";){let ss=this.token.token_type.toLowerCase(),os=0;this.token.token_type==="<"||this.token.token_type==="LE"?os=-1:this.token.token_type!==">"&&this.token.token_type!=="GE"||(os=1),this.advance();let ls=this.expression(rs);if(os===-1)if(this.token.token_type==="<"||this.token.token_type==="LE"){let us=["tuple"];ss==="<"?us.push(!0):us.push(!1);let cs=["tuple",ns,ls];for(;this.token.token_type==="<"||this.token.token_type==="LE";)this.token.token_type==="<"?us.push(!0):us.push(!1),this.advance(),cs.push(this.expression(rs));ns=["lts",cs,us]}else ns=[ss,ns,ls];else if(os===1)if(this.token.token_type===">"||this.token.token_type==="GE"){let us=["tuple"];ss===">"?us.push(!0):us.push(!1);let cs=["tuple",ns,ls];for(;this.token.token_type===">"||this.token.token_type==="GE";)this.token.token_type===">"?us.push(!0):us.push(!1),this.advance(),cs.push(this.expression(rs));ns=["gts",cs,us]}else ns=[ss,ns,ls];else if(ss==="=")for(ns=["=",ns,ls];this.token.token_type==="=";)this.advance(),ns.push(this.expression(rs));else ns=[ss,ns,ls]}return ns}expression(rs){let ns=!1;this.token.token_type==="+"&&(ns=!0,this.advance());let ss=!1;this.token.token_type==="-"&&(ss=!0,this.advance());var os=this.term(rs);if(ss||ns){if(os===!1)return(ns?"+":"")+(ss?"-":"");if(typeof os=="string"&&[...os].every(ls=>["+","-"].includes(ls)))return(ns?"+":"")+(ss?"-":"")+os}for(os===!1&&(os="_"),ss&&(os=os>0?-os:["-",os]),ns&&(os=["+",os]);["+","-","UNION","INTERSECT","PERP","PARALLEL"].includes(this.token.token_type);){let ls=this.token.token_type.toLowerCase(),us=!1,cs=!1;this.token.token_type==="-"?(ls="+",us=!0,this.advance()):(this.advance(),ls==="+"&&this.token.token_type==="-"&&(us=!0,cs=!0,this.advance()));let ds=this.term(rs);if(ls==="+"){if(ds===!1&&(typeof os=="number"||typeof os=="string"))return cs?os+"+-":us?os+"-":os+"+";if(typeof ds=="string"&&[...ds].every(ps=>["+","-"].includes(ps))&&(typeof os=="number"||typeof os=="string"))return cs?os+"+-"+ds:us?os+"-"+ds:os+"+"+ds}ds===!1&&(ds="_"),us&&(ds=ds>0?-ds:["-",ds]),os=[ls,os,ds]}return os}term(rs){var ns=this.factor(rs),ss=!1;do if(ss=!1,this.token.token_type==="*"){this.advance(),ns===!1&&(ns="_");let os=this.factor(rs);os===!1&&(os="_"),ns=["*",ns,os],ss=!0}else if(this.token.token_type==="/"){this.advance(),ns===!1&&(ns="_");let os=this.factor(rs);os===!1&&(os="_"),ns=["/",ns,os],ss=!0}else{let os=Object.assign({},rs);os.allow_absolute_value_closing=!0;let ls=this.nonMinusFactor(os);ls!==!1&&(ns===!1&&(ns="_"),ns=["*",ns,ls],ss=!0)}while(ss);return this.convert_units_in_term(flatten$6(ns))}convert_units_in_term(rs){if(!Array.isArray(rs))return rs;let ns=rs[0],ss=rs.slice(1);if(ns==="*"){let os=ss.length;for(let[ls,us]of ss.entries()){let cs=this.units[us];if(cs){if(cs.prefix&&ls0){let ds,ps=us;return cs.substitute&&(ps=cs.substitute),ds=ls===1?["unit",ss[0],ps]:["unit",["*",...ss.slice(0,ls)],ps],ls===os-1?ds:this.convert_units_in_term(["*",ds,...ss.slice(ls+1)])}}}return rs}return ns==="/"?["/",this.convert_units_in_term(ss[0]),this.convert_units_in_term(ss[1])]:rs}factor(rs){if(this.token.token_text==="+"){this.advance();let ss=this.factor(rs);return ss===!1?"+":typeof ss=="string"&&[...ss].every(os=>["+","-"].includes(os))?"+"+ss:["+",ss]}if(this.token.token_type==="-"){this.advance();let ss=this.factor(rs);return ss>0?-ss:ss===!1?"-":typeof ss=="string"&&[...ss].every(os=>["+","-"].includes(os))?"-"+ss:["-",ss]}let ns=this.nonMinusFactor(rs);return ns===!1&&this.token.token_type==="PERP"&&(ns="perp",this.advance()),ns}nonMinusFactor(rs){for(var ns=this.baseFactor(rs);this.token.token_type==="^"||this.token.token_type==="!"||this.token.token_type==="'";)ns===!1&&(ns="_"),this.token.token_type==="^"?(this.advance(),ns=["^",ns,this.get_subsuperscript(rs)]):this.token.token_type==="!"?(ns=["apply","factorial",ns],this.advance()):(ns=["prime",ns],this.advance());return ns}get_subsuperscript({parse_absolute_value:rs}){if(["+","-","PERP"].includes(this.token.token_type)){let ns=this.token.token_type.toLowerCase();return this.advance(),ns}{let ns=this.baseFactor({parse_absolute_value:rs,in_subsuperscript_with_no_delimiters:!0});return ns===!1&&(ns="_"),ns}}baseFactor({inside_absolute_value:rs=0,parse_absolute_value:ns=!0,allow_absolute_value_closing:ss=!1,in_subsuperscript_with_no_delimiters:os=!1}={}){var ls=!1;if(this.token.token_type==="NUMBER")ls=parseFloat(this.token.token_text),this.advance();else if(this.token.token_type==="INFINITY")ls=1/0,this.advance();else if(this.token.token_type==="VAR"||this.token.token_type==="VARMULTICHAR"){if(ls=this.token.token_text,this.appliedFunctionSymbols.includes(ls)||this.functionSymbols.includes(ls)){let us=!1;if(this.appliedFunctionSymbols.includes(ls)&&(us=!0),this.advance(),this.token.token_type==="_"){this.advance();let cs=this.get_subsuperscript({parse_absolute_value:ns});ls=ls==="log"&&cs===10?"log10":["_",ls,cs]}if(os)us&&(ls=["apply",ls,"_"]);else{for(;this.token.token_type==="'";)ls=["prime",ls],this.advance();for(;this.token.token_type==="^";)this.advance(),ls=["^",ls,this.get_subsuperscript({parse_absolute_value:ns})];if(this.token.token_type==="("){this.advance();let cs=this.statement_list();if(this.token.token_type!==")")throw new ParseError("Expecting )",this.lexer.location);this.advance(),cs[0]==="list"&&(cs[0]="tuple"),ls=["apply",ls,cs]}else if(us){if(!this.allowSimplifiedFunctionApplication)throw new ParseError("Expecting ( after function",this.lexer.location);let cs=this.factor({parse_absolute_value:ns});cs===!1&&(cs="_"),ls=["apply",ls,cs]}}return ls}if(this.operatorSymbols.includes(ls))if(this.advance(),this.token.token_type==="("){this.advance();let us=this.statement_list();if(this.token.token_type!==")")throw new ParseError("Expecting )",this.lexer.location);this.advance(),ls=us[0]==="list"?[ls,...us.slice(1)]:[ls,us]}else{let us=this.factor({parse_absolute_value:ns});us===!1&&(us="_"),ls=[ls,us]}else{if(this.parseLeibnizNotation){let cs=this.return_state(),ds=this.leibniz_notation();if(ds)return ds;this.set_state(cs)}let us=this.splitSymbols;if(us&&(this.token.token_type==="VARMULTICHAR"||this.unsplitSymbols.includes(ls)||ls.length===1||ls.match(/[\d]/g))&&(us=!1),us){for(let cs=ls.length-1;cs>=0;cs--)this.lexer.unput(" "),this.lexer.unput(ls[cs]);return this.advance(),this.baseFactor({inside_absolute_value:rs,parse_absolute_value:ns,allow_absolute_value_closing:ss})}this.advance()}}else if(this.token.token_type==="("||this.token.token_type==="["||this.token.token_type==="{"||this.token.token_type==="LANGLE"){let us,cs,ds=this.token.token_type;this.token.token_type==="("?(us=")",cs="]"):this.token.token_type==="["?(us="]",cs=")"):this.token.token_type==="{"?(us="}",cs=null):(us="RANGLE",cs=null),this.advance();let ps=1;if((ls=this.statement_list())[0]==="list"&&(ps=ls.length-1),this.token.token_type!==us){if(ps!==2||cs===null)throw new ParseError("Expecting "+us,this.lexer.location);if(this.token.token_type!==cs)throw new ParseError("Expecting ) or ]",this.lexer.location);let fs;ls[0]="tuple",fs=ds==="("?["tuple",!1,!0]:["tuple",!0,!1],(ls=["interval",ls]).push(fs)}else ps>=2?ls[0]=ds==="("?"tuple":ds==="["?"array":ds==="{"?"set":"altvector":ds==="{"&&(ls=(ls[0]==="|"||ls[0],["set",ls]));this.advance()}else if(this.token.token_type!=="|"||!ns||rs!==0&&ss){if(this.token.token_type==="ANGLE")if(this.advance(),this.token.token_type==="("){this.advance();let us=this.statement_list();if(this.token.token_type!==")")throw new ParseError("Expecting )",this.lexer.location);this.advance(),us[0]==="list"?ls=["angle",...us.slice(1)]:us[0]==="*"&&(ls=["angle",us])}else{let us=[],cs=this.nonMinusFactor({parse_absolute_value:ns});for(;cs!==!1;)us.push(cs),cs=this.nonMinusFactor({parse_absolute_value:ns});ls=us.length===0?"angle":["angle",...us]}else if(this.token.token_type==="INT"){this.advance();let us="int";this.token.token_type==="_"&&(this.advance(),us=["_",us,this.get_subsuperscript({parse_absolute_value:ns})]),this.token.token_type==="^"&&(this.advance(),us=["^",us,this.get_subsuperscript({parse_absolute_value:ns})]);let cs=flatten$6(this.term({parse_absolute_value:ns}));if(Array.isArray(cs)&&cs[0]==="*"){let ds=[];for(let ps=0;ps2&&(this.lexer.unput(this.token.token_text.slice(2)),this.token.token_text=this.token.token_text.slice(0,2));let ds=this.token.token_text;if(ds.length===2){if(!/[a-zA-Z]/.exec(ds[1]))return!1;ls.push(ds[1])}else{if(this.advance(),(this.token.token_type!=="VAR"||this.token.token_text.includes("∂"))&&this.token.token_type!=="VARMULTICHAR")return!1;ls.push(this.token.token_text)}let ps=1,fs=!1;if(this.advance({remove_initial_space:!1}),this.token.token_type==="SPACE"&&(fs=!0,this.advance()),this.token.token_type==="^"){if(this.advance(),this.token.token_type!=="NUMBER"||(ps=parseFloat(this.token.token_text),!Number.isInteger(ps)))return!1;fs=!1,this.advance({remove_initial_space:!1}),this.token.token_type==="SPACE"&&(fs=!0,this.advance())}if(us.push(ps),cs+=ps,cs>ss)return!1;if(cs===ss){if(!fs&&(this.token.token_type==="VAR"||this.token.token_type==="VARMULTICHAR"))return!1;this.token.token_type==="SPACE"&&this.advance();let hs="derivative_leibniz";ns==="∂"&&(hs="partial_"+hs),rs=[hs],ss===1?rs.push(os):rs.push(["tuple",os,ss]);let gs=[];for(let ys=0;ysws[Ss+1]);if(Cs.length!==hs||Ns.length!==hs)return subtree;let As=["+",...Cs.map((ws,Es)=>["*",ws,Ns[Es]])];Ts.push(As)}vs.push(Ts)}return{success:!0,newMatrix:["matrix",["tuple",fs,gs],vs]}}function ls(ds,ps){let fs=ds[1][1],hs=ds[1][2],gs=ds[2],ys=["tuple"];for(let bs=0;bs=0;ys--){let bs=hs[ys][0];if(bs==="matrix"){let vs=os(hs[ys],fs);if(!vs.success)break;fs=vs.newMatrix,hs.pop()}else{if(["tuple","list","vector","altvector","interval","set","array"].includes(bs))break;hs[ys]!==1&&(fs=ls(fs,hs[ys])),hs.pop()}}for(;gs.length>0;){let ys=gs[0][0];if(ys==="matrix"){let bs=os(fs,gs[0]);if(!bs.success)break;fs=bs.newMatrix,gs.splice(0,1)}else{if(["tuple","list","vector","altvector","interval","set","array"].includes(ys))break;gs[0]!==1&&(fs=ls(fs,gs[0])),gs.splice(0,1)}}return hs.length>0||gs.length>0?["*",...hs,fs,...gs]:fs}return ds}),(rs||ns)&&(us=["*",["matrix",["tuple","m","n"],"matrixData"],"b"],cs={variables:{n:Number.isInteger,m:Number.isInteger,matrixData:!0,b:!0}},ss=transform$1(ss,function(ds){let ps=match$2(ds,us,cs);if(ps){let fs,hs=ps.m,gs=ps.n,ys=ps.b,bs=ps.matrixData,vs=[];rs&&(vs.push("vector"),vs.push("altvector")),ns&&vs.push("tuple");let xs=[];if(vs.includes(ys[0]))fs=ys;else{if(!Array.isArray(ys)||ys[0]!=="*"||!vs.includes(ys[1][0]))return ds;fs=ys[1],xs=ys.slice(2)}let Cs=fs.slice(1);if(Cs.length!==gs)return ds;let Ts=[fs[0]];for(let Ss=0;Ss["*",As,Cs[ws]])];Ts.push(Ns)}return xs.length>0?["*",Ts,...xs]:Ts}return ds})),ss}function perform_vector_scalar_multiplications(as,rs=!0){var ns=get_tree(as);let ss=function(os,ls){let us=["*","a",[ls,"vectorData"],"b"],cs={allow_implicit_identities:["a","b"]};return os=transform$1(os,function(ds){let ps=match$2(ds,us,cs);if(ps){if(ps.a===1&&ps.b===1)return ds;let fs=ps.vectorData;fs=Array.isArray(fs)&&fs[0]===ls?fs.slice(1):[fs];let hs=[],gs=[];Array.isArray(ps.a)&&ps.a[0]==="*"?hs.push(...ps.a.slice(1)):hs.push(ps.a),Array.isArray(ps.b)&&ps.b[0]==="*"?gs.push(...ps.b.slice(1)):gs.push(ps.b);for(let bs=hs.length-1;bs>=0;bs--){let vs=hs[bs][0];if(["tuple","list","vector","altvector","interval","set","array","matrix"].includes(vs))break;hs[bs]!==1&&(fs=fs.map(xs=>["*",xs,hs[bs]])),hs.pop()}for(;gs.length>0;){let bs=gs[0][0];if(["tuple","list","vector","altvector","interval","set","array","matrix"].includes(bs))break;gs[0]!==1&&(fs=fs.map(vs=>["*",vs,gs[0]])),gs.splice(0,1)}let ys=[ls,...fs];return hs.length>0||gs.length>0?["*",...hs,ys,...gs]:ys}return ds}),os};return ns=ss(ns,"vector"),ns=ss(ns,"altvector"),rs&&(ns=ss(ns,"tuple")),ns}function perform_matrix_scalar_multiplications(as){var rs=get_tree(as);let ns=["*","a",["matrix","size","matrixData"],"b"],ss={allow_implicit_identities:["a","b"]};return rs=transform$1(rs,function(os){let ls=match$2(os,ns,ss);if(ls){if(ls.a===1&&ls.b===1)return os;let us=ls.matrixData,cs=[],ds=[];Array.isArray(ls.a)&&ls.a[0]==="*"?cs.push(...ls.a.slice(1)):cs.push(ls.a),Array.isArray(ls.b)&&ls.b[0]==="*"?ds.push(...ls.b.slice(1)):ds.push(ls.b);for(let fs=cs.length-1;fs>=0;fs--){let hs=cs[fs][0];if(["tuple","list","vector","altvector","interval","set","array","matrix"].includes(hs))break;cs[fs]!==1&&(us=us.map(gs=>gs==="tuple"?gs:gs.map(ys=>ys==="tuple"?ys:["*",ys,cs[fs]]))),cs.pop()}for(;ds.length>0;){let fs=ds[0][0];if(["tuple","list","vector","altvector","interval","set","array","matrix"].includes(fs))break;ds[0]!==1&&(us=us.map(hs=>hs==="tuple"?hs:hs.map(gs=>gs==="tuple"?gs:["*",gs,ds[0]]))),ds.splice(0,1)}let ps=["matrix",ls.size,us];return cs.length>0||ds.length>0?["*",...cs,ps,...ds]:ps}return os}),rs}function expand_relations(as){var rs=get_tree(as);return transform$1(rs,expand_relations_transform)}function expand_relations_transform(as){if(!Array.isArray(as))return as;var rs=as[0],ns=as.slice(1);if(rs==="="){if(ns.length<=2)return as;let ss=["and"];for(let os=0;os":rs==="lts"?"le":"ge",ls.push([ds,ss[cs],ss[cs+1]])}let us=["and",ls[0],ls[1]];for(let cs=2;cs",ss,ps]),cs[2]?ls?hs.push([">",ss,fs]):hs.push(["le",ss,fs]):ls?hs.push(["ge",ss,fs]):hs.push(["<",ss,fs]),ds=ls?["or"].concat(hs):["and"].concat(hs),ds}if(rs==="subset"||rs==="notsubset"||rs==="superset"||rs==="notsuperset"){let ss,os,ls=!1;if(rs!=="notsubset"&&rs!=="notsuperset"||(ls=!0),rs==="subset"||rs==="notsubset"?(ss=ns[0],os=ns[1]):(ss=ns[1],os=ns[0]),ss=to_intervals(ss),os=to_intervals(os),ss[0]!=="interval"||os[0]!=="interval")return as;let us=ss[1],cs=ss[2],ds=os[1],ps=os[2];if(us[0]!=="tuple"||cs[0]!=="tuple"||ds[0]!=="tuple"||ps[0]!=="tuple")throw new Error("Badly formed ast");let fs,hs=us[1],gs=us[2],ys=ds[1],bs=ds[2],vs=[];return cs[1]&&!ps[1]?ls?vs.push(["le",hs,ys]):vs.push([">",hs,ys]):ls?vs.push(["<",hs,ys]):vs.push(["ge",hs,ys]),cs[2]&&!ps[2]?ls?vs.push(["ge",gs,bs]):vs.push(["<",gs,bs]):ls?vs.push([">",gs,bs]):vs.push(["le",gs,bs]),fs=ls?["or"].concat(vs):["and"].concat(vs),fs}return as}function substitute(as,rs){var ns=get_tree(as),ss={};for(let os in rs)ss[os]=get_tree(rs[os]);return substitute$1(ns,ss)}function substitute_component(as,rs,ns){let ss=get_tree(as);if(get_tree(ns),typeof rs=="number")rs=[rs];else if(!Array.isArray(rs))throw Error("Invalid substitute_component: "+rs);let os=["list","tuple","vector","altvector","array"];return function ls(us,cs,ds){if(cs.length===0)return ns;if(!Array.isArray(us))throw Error("Invalid substitute_component: expected list, tuple, vector, or array");let ps=us[0],fs=us.slice(1);if(!os.includes(ps))throw Error("Invalid substitute_component: expected list, tuple, vector, or array");let hs=cs[0];if(hs<0||hs>fs.length-1)throw Error("Invalid substitute_component: component out of range");let gs=cs.slice(1),ys=ls(fs[hs],gs);return[ps,...fs.slice(0,hs),ys,...fs.slice(hs+1)]}(ss,rs)}function get_component(as,rs){let ns=get_tree(as);if(typeof rs=="number")rs=[rs];else if(!Array.isArray(rs))throw Error("Invalid get_component: "+rs);let ss=["list","tuple","vector","altvector","array"];return function os(ls,us){if(us.length===0)return ls;if(!Array.isArray(ls))throw Error("Invalid get_component: expected list, tuple, vector, or array");let cs=ls[0],ds=ls.slice(1);if(!ss.includes(cs))throw Error("Invalid get_component: expected list, tuple, vector, or array");let ps=us[0];if(ps<0||ps>ds.length-1)throw Error("Invalid get_component: component out of range");let fs=us.slice(1);return os(ds[ps],fs)}(ns,rs)}var transformation=Object.freeze({__proto__:null,expand,expand_relations,substitute,substitute_component,get_component,perform_vector_scalar_multiplications,perform_matrix_scalar_multiplications,perform_matrix_multiplications});function clean(as){return flatten$5(get_tree(as))}function evalf(as,rs){return parseFloat(math$1.format(as,{notation:"exponential",precision:rs}))}function collapse_unary_minus(as){var rs=get_tree(as);if(!Array.isArray(rs))return rs;var ns=rs[0],ss=rs.slice(1);if(ss=ss.map(os=>collapse_unary_minus(os)),ns==="-"){if(typeof ss[0]=="number")return-ss[0];if(Array.isArray(ss[0])&&ss[0][0]==="*"&&typeof ss[0][1]=="number")return["*",-ss[0][1]].concat(ss[0].slice(2));if(Array.isArray(ss[0])&&ss[0][0]==="/"){if(typeof ss[0][1]=="number")return["/",-ss[0][1],ss[0][2]];if(Array.isArray(ss[0][1])&&ss[0][1][0]==="*"&&typeof ss[0][1][1]=="number")return["/",["*",-ss[0][1][1]].concat(ss[0][1].slice(2)),ss[0][2]]}}return[ns].concat(ss)}function simplify(as,rs,ns){var ss=get_tree(as);return contains_blank(ss)?ss:(rs===void 0&&as.context!==void 0&&as.context.get_assumptions!==void 0&&(rs=as.context.get_assumptions([as.variables()])),ss=evaluate_numbers(ss,{assumptions:rs,max_digits:ns,evaluate_functions:!0}),Array.isArray(ss)?ss=collect_like_terms_factors(ss=perform_vector_matrix_additions_scalar_multiplications(ss=simplify_logical(ss,rs)),rs,ns):ss)}function simplify_logical(as,rs){var ns=get_tree(as);if(contains_blank(ns))return ns;rs===void 0&&as.context!==void 0&&as.context.get_assumptions!==void 0&&(rs=as.context.get_assumptions([as.variables()])),ns=evaluate_numbers(ns,{assumptions:rs}),ns=unflattenRight(ns);var ss=[];return ss.push([["not",["not","a"]],"a"]),ss.push([["not",["and","a","b"]],["or",["not","a"],["not","b"]]]),ss.push([["not",["or","a","b"]],["and",["not","a"],["not","b"]]]),ss.push([["not",["=","a","b"]],["ne","a","b"]]),ss.push([["not",["ne","a","b"]],["=","a","b"]]),ss.push([["not",["<","a","b"]],["le","b","a"]]),ss.push([["not",["le","a","b"]],["not",["le","a","b"]]]),ss.push([["not",["in","a","b"]],["notin","a","b"]]),ss.push([["not",["subset","a","b"]],["notsubset","a","b"]]),ns=flatten$5(ns=applyAllTransformations(ns,ss,20))}function perform_vector_matrix_additions_scalar_multiplications(as,rs=!0){var ns=get_tree(as);ns=perform_vector_scalar_multiplications(ns=perform_matrix_scalar_multiplications(ns),rs);let ss=["+","a","b"];return ns=transform$1(ns,function(os){let ls=match$2(os,ss,{allow_permutations:!0});if(ls){let us=["vector","altvector"];rs&&us.push("tuple");let cs={},ds={},ps=[];if(us.includes(ls.a[0])){let hs=ls.a.length-1;cs[hs]||(cs[hs]=[]),cs[hs].push(ls.a)}else if(ls.a[0]==="matrix"){let hs=ls.a[1].slice(1).toString();ds[hs]||(ds[hs]=[]),ds[hs].push(ls.a)}else ps.push(ls.a);if(us.includes(ls.b[0])){let hs=ls.b.length-1;cs[hs]||(cs[hs]=[]),cs[hs].push(ls.b)}else if(ls.b[0]==="matrix"){let hs=ls.b[1].slice(1).toString();ds[hs]||(ds[hs]=[]),ds[hs].push(ls.b)}else if(ls.b[0]==="+")for(let hs of ls.b.slice(1))if(us.includes(hs[0])){let gs=hs.length-1;cs[gs]||(cs[gs]=[]),cs[gs].push(hs)}else if(hs[0]==="matrix"){let gs=hs[1].slice(1).toString();ds[gs]||(ds[gs]=[]),ds[gs].push(hs)}else ps.push(hs);else ps.push(ls.b);if(Object.values(cs).every(hs=>hs.length<2)&&Object.values(ds).every(hs=>hs.length<2))return os;let fs=ps;for(let hs in cs)if(cs[hs].length<2)fs.push(...cs[hs]);else{let gs,ys=cs[hs].some(xs=>xs[0]==="vector"),bs=cs[hs].some(xs=>xs[0]==="tuple"),vs=cs[hs].some(xs=>xs[0]==="altvector");gs=ys||bs&&vs?["vector"]:vs?["altvector"]:["tuple"];for(let xs=0;xsCs[xs+1])]);fs.push(gs)}for(let hs in ds)if(ds[hs].length<2)fs.push(...ds[hs]);else{let[gs,ys]=hs.split(",").map(Number),bs=["tuple"];for(let xs=0;xsSs[2][xs+1][Ts+1])]);bs.push(Cs)}let vs=["matrix",["tuple",gs,ys],bs];fs.push(vs)}return fs.length===1?fs[0]:["+",...fs]}return os}),ns}function contains_decimal_number(as){return typeof as!="string"&&(typeof as=="number"?!(!Number.isFinite(as)||Number.isInteger(as)):!!Array.isArray(as)&&as.slice(1).some(rs=>contains_decimal_number(rs)))}function contains_only_numbers(as,{include_number_symbols:rs=!1,evaluate_functions:ns=!1}={}){return typeof as=="string"?rs&&(as==="e"&&math$1.define_e||as==="pi"&&math$1.define_pi)?!0:!(as!=="i"||!math$1.define_i):typeof as=="number"||!!Array.isArray(as)&&(ns&&as[0]==="apply"?as.slice(2).every(ss=>contains_only_numbers(ss,{include_number_symbols:rs})):as.slice(1).every(ss=>contains_only_numbers(ss,{include_number_symbols:rs})))}function try_evaluate_sum_of_numbers(as,rs,ns){if(typeof as=="number"){if(as===0)return rs;if(typeof rs=="number")return as+rs;if(Array.isArray(rs)&&rs[0]==="+"&&typeof rs[1]=="number")return["+",as+rs[1],rs[2]];if(!ns&&Array.isArray(rs)&&rs[0]==="+"&&typeof rs[2]=="number")return["+",as+rs[2],rs[1]]}return typeof rs=="number"&&rs===0?as:null}function try_evaluate_negate_number(as){if(typeof as=="number")return-as;if(Array.isArray(as)&&as[0]==="*"&&typeof as[1]=="number")return["*",-as[1]].concat(as.slice(2));if(Array.isArray(as)&&as[0]==="/"){if(typeof as[1]=="number")return["/",-as[1],as[2]];if(Array.isArray(as[1])&&as[1][0]==="*"&&typeof as[1][1]=="number")return["/",["*",-as[1][1]].concat(as[1].slice(2)),as[2]]}return null}function try_evaluate_product_of_numbers(as,rs){if(typeof as=="number"){if(isNaN(as))return NaN;if(typeof rs=="number")return as*rs;if(!isFinite(as))return as===1/0&&is_negative_ast(rs)||as===-1/0&&is_positive_ast(rs)?-1/0:is_nonzero_ast(rs)===!1?NaN:1/0;if(as===0)return 0;if(as===1)return rs;if(as===-1)return["-",rs];if(Array.isArray(rs)&&rs[0]==="*"&&typeof rs[1]=="number")return as*=rs[1],rs=rs[2],as===1?rs:as===-1?["-",rs]:["*",as,rs]}if(typeof rs=="number"){if(isNaN(rs))return NaN;if(!isFinite(rs))return rs===1/0&&is_negative_ast(as)||rs===-1/0&&is_positive_ast(as)?-1/0:is_nonzero_ast(as)===!1?NaN:1/0;if(rs===0)return 0;if(rs===1)return as;if(rs===-1)return["-",as];if(Array.isArray(as)&&as[0]==="*"&&typeof as[1]=="number")return rs*=as[1],as=as[2],rs===1?as:rs===-1?["-",as]:["*",as,rs]}if(math$1.define_i&&as==="i"){if(rs==="i")return-1;if(Array.isArray(rs)&&rs[0]==="*"&&rs[1]==="i")return["-",rs[2]]}else if(math$1.define_i&&rs==="i"&&Array.isArray(as)&&as[0]==="*"&&as[1]==="i")return["-",as[2]];return null}function try_evaluate_quotient_of_numbers(as,rs,ns,ss){if(typeof as=="number"){if(as===0){let os=is_nonzero_ast(rs,ns);if(os)return 0;if(os===!1)return NaN}if(typeof rs=="number"){let os=as/rs;if(ss===1/0||math$1.round(os,ss)===os)return os;if(rs<0)return["/",-as,-rs]}if(Array.isArray(rs)&&rs[0]==="*"&&typeof rs[1]=="number"){let os=as/rs[1];if(ss===1/0||math$1.round(os,ss)===os)return["/",os,rs[2]]}}else if(typeof rs=="number"){if(Array.isArray(as)&&as[0]==="*"&&typeof as[1]=="number"){let ls=as[1]/rs;if(ss===1/0||math$1.round(ls,ss)===ls)return ls===1?as[2]:["*",ls,as[2]];if(rs<0)return["/",["*",-as[1],as[2]],-rs]}let os=1/rs;if(ss===1/0||math$1.round(os,ss)===os)return["*",os,as];if(rs<0)return Array.isArray(as)&&as[0]==="-"?["/",as[1],-rs]:["-",["/",as,-rs]]}return null}function evaluate_numbers_sub(as,rs,ns,ss,os,ls){if(as===void 0)return as;if(typeof as=="number")return ls>0&&math$1.abs(as)0&&math$1.abs(fs)evaluate_numbers_sub(ps,rs,ns,ss,os,ls));if(cs==="+"){let ps=ds[0],fs=ds[1];if(fs===void 0)return ps;let hs=try_evaluate_sum_of_numbers(ps,fs,ss);if(hs!==null)return hs;if(ps[0]==="unit"&&fs[0]==="unit"){let gs=get_unit_of_tree(ps),ys=get_unit_of_tree(fs);if(gs&&gs===ys){let bs=try_evaluate_sum_of_numbers(remove_units(ps,!1),remove_units(fs,!1),ss);if(bs!==null)return add_unit(bs,gs)}}return[cs].concat(ds)}if(cs==="-"){let ps=try_evaluate_negate_number(ds[0]);if(ps!==null)return ps;if(ds[0][0]==="unit"){let fs=get_unit_of_tree(ds[0]);if(fs){let hs=try_evaluate_negate_number(remove_units(ds[0],!1));if(hs!==null)return add_unit(hs,fs)}}return[cs].concat(ds)}if(cs==="*"){let ps=ds[0],fs=ds[1];if(fs===void 0)return ps;let hs=try_evaluate_product_of_numbers(ps,fs);if(hs!==null)return hs;if(ps[0]==="unit"&&fs[0]!=="unit"){let gs=get_unit_of_tree(ps);if(gs){let ys=try_evaluate_product_of_numbers(remove_units(ps,!1),fs);if(ys!==null)return add_unit(ys,gs)}}if(ps[0]!=="unit"&&fs[0]==="unit"){let gs=get_unit_of_tree(fs);if(gs){let ys=try_evaluate_product_of_numbers(ps,remove_units(fs,!1));if(ys!==null)return add_unit(ys,gs)}}return[cs].concat(ds)}if(cs==="/"){let ps=ds[0],fs=ds[1],hs=try_evaluate_quotient_of_numbers(ps,fs,rs,ns);if(hs!==null)return hs;if(ps[0]==="unit"&&fs[0]!=="unit"){let gs=get_unit_of_tree(ps);if(gs){let ys=try_evaluate_quotient_of_numbers(remove_units(ps,!1),fs,rs,ns);if(ys!==null)return add_unit(ys,gs)}}return[cs].concat(ds)}if(cs==="^"){let ps=ds[0],fs=ds[1];if(typeof fs=="number")if(fs===0){if(!math$1.pow_strict)return 1;let hs=is_nonzero_ast(ps,rs);if(hs&&ps!==1/0&&ps!==-1/0)return 1;if(hs===!1)return NaN}else{if(fs===1)return ps;if(typeof ps=="number"){let hs=math$1.pow(ps,fs);if(ns===1/0||math$1.round(hs,ns)===hs)return hs}}else if(ps===1)return 1;return[cs].concat(ds)}return[cs].concat(ds)}function evaluate_numbers(as,{assumptions:rs,max_digits:ns,skip_ordering:ss=!1,evaluate_functions:os=!1,set_small_zero:ls=0}={}){(ns===void 0||!Number.isInteger(ns)&&ns!==1/0)&&(ns=0),ls===!0&&(ls=1e-14);var us,cs=get_tree(as);return contains_blank(cs)?cs:(rs===void 0&&as.context!==void 0&&as.context.get_assumptions!==void 0&&(rs=as.context.get_assumptions([as.variables()])),ss?us=evaluate_numbers_sub(cs=unflattenRight(flatten$5(cs)),rs,ns,ss,os,ls):(cs=move_units_outside_products(cs),cs=unflattenRight(default_order(flatten$5(cs))),us=default_order(evaluate_numbers_sub(cs,rs,ns,ss,os,ls)),us=default_order(evaluate_numbers_sub(unflattenRight(us),rs,ns,ss,os,ls))),flatten$5(us=set_negative_zeros_to_zero(us)))}function set_negative_zeros_to_zero(as){return as===0?0:Array.isArray(as)?[as[0],...as.slice(1).map(set_negative_zeros_to_zero)]:as}function collect_like_terms_factors(as,rs,ns){function ss(ds){return typeof ds=="number"||!(!Array.isArray(ds)||ds[0]!=="-"||typeof ds[1]!="number")}function os(ds){return typeof ds=="number"&&ds<0||!(!Array.isArray(ds)||ds[0]!=="-"||typeof ds[1]!="number")}function ls(ds){if(typeof ds=="number"||Array.isArray(ds)&&ds[0]==="-"&&typeof ds[1]=="number")return!0;let ps=evaluate_to_constant(ds,!1);return!(typeof ps!="number"||!Number.isFinite(ps))}var us=get_tree(as);if(contains_blank(us))return us;rs===void 0&&as.context!==void 0&&as.context.get_assumptions!==void 0&&(rs=as.context.get_assumptions([as.variables()])),us=evaluate_numbers(us,{assumptions:rs,max_digits:ns,evaluate_functions:!0});var cs=[];cs.push([["/","x",["^","y","a"]],["*","x",["^","y",["-","a"]]],{evaluate_numbers:!0,max_digits:ns}]),cs.push([["/","x",["apply","exp","a"]],["*","x",["apply","exp",["-","a"]]],{evaluate_numbers:!0,max_digits:ns,variables:{x:!0,a:!0}}]),cs.push([["/","x","y"],["*","x",["^","y",["-",1]]],{evaluate_numbers:!0,max_digits:ns}]),us=applyAllTransformations(us,cs,40),cs=[];for(let ds in all_units)all_units[ds].prefix?(cs.push([["+",["unit",ds,"x"],["unit",ds,"y"]],["unit",ds,["+","x","y"]],{variables:{x:!0,y:!0},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["unit",ds,"x"],["-",["unit",ds,"y"]]],["unit",ds,["+","x",["-","y"]]],{variables:{x:!0,y:!0},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}])):(cs.push([["+",["unit","x",ds],["unit","y",ds]],["unit",["+","x","y"],ds],{variables:{x:!0,y:!0},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["unit","x",ds],["-",["unit","y",ds]]],["unit",["+","x",["-","y"]],ds],{variables:{x:!0,y:!0},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}]));return cs.push([["*",["^","x","n"],["^","x","m"]],["^","x",["+","n","m"]],{variables:{x:ds=>is_nonzero_ast(ds,rs),n:ss,m:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m","n"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["*",["^","x","n"],["^","x","m"]],["^","x",["+","n","m"]],{variables:{x:!0,n:ds=>ss(ds)&&is_positive_ast(ds,rs),m:ds=>ss(ds)&&is_positive_ast(ds,rs)},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m","n"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["*",["^","x","n"],["^","x","m"]],["^","x",["+","n","m"]],{variables:{x:!0,n:ds=>ss(ds)&&is_negative_ast(ds,rs),m:ds=>ss(ds)&&is_negative_ast(ds,rs)},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["*",["apply","exp","n"],["apply","exp","m"]],["apply","exp",["+","n","m"]],{variables:{n:ss,m:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m","n"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["*","n","x"],["*","m","x"]],["*",["+","n","m"],"x"],{variables:{x:!0,n:ss,m:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m","n"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["*","n1","x"],["*",["/","n2","m2"],"x"]],["*",["+","n1",["/","n2","m2"]],"x"],{variables:{x:!0,n1:ss,n2:ss,m2:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m2","n1","n2"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["*","n1","x"],["*",["-",["/","n2","m2"]],"x"]],["*",["+","n1",["-",["/","n2","m2"]]],"x"],{variables:{x:!0,n1:ss,n2:ss,m2:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m2","n1","n2"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["*",["/","n1","m1"],"x"],["*",["/","n2","m2"],"x"]],["*",["+",["/","n1","m1"],["/","n2","m2"]],"x"],{variables:{x:!0,n1:ss,m1:ss,n2:ss,m2:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m1","m2","n1","n2"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["*",["/","n1","m1"],"x"],["*",["-",["/","n2","m2"]],"x"]],["*",["+",["/","n1","m1"],["-",["/","n2","m2"]]],"x"],{variables:{x:!0,n1:ss,m1:ss,n2:ss,m2:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m1","m2","n1","n2"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["*","n","x"],["-",["*","m","x"]]],["*",["+","n",["-","m"]],"x"],{variables:{x:!0,n:ss,m:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m","n"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["^",["*","x","y"],"a"],["*",["^","x","a"],["^","y","a"]],{allow_permutations:!0}]),cs.push([["^",["^","x","n"],"m"],["^","x",["*","n","m"]],{variables:{x:!0,n:ss,m:ss},evaluate_numbers:!0,max_digits:ns,allow_permutations:!0}]),cs.push([["-",["+","a","b"]],["+",["-","a"],["-","b"]]]),cs.push([["*","x","y"],["*","x","y"],{variables:{x:ls,y:ls},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}]),us=applyAllTransformations(us,cs,40),(cs=[]).push([["*","x",["^","y",["-","a"]]],["/","x",["^","y","a"]],{allow_extended_match:!0,allow_permutations:!0,evaluate_numbers:!0,max_digits:ns,max_group:1}]),cs.push([["*","x",["apply","exp",["-","a"]]],["/","x",["apply","exp","a"]],{allow_extended_match:!0,allow_permutations:!0,evaluate_numbers:!0,max_digits:ns,max_group:1,variables:{x:!0,a:!0}}]),cs.push([["*","x",["^","y","n"]],["/","x",["^","y",["-","n"]]],{variables:{x:!0,y:!0,n:os},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["*","x",["apply","exp","n"]],["/","x",["apply","exp",["-","n"]]],{variables:{x:!0,n:os},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}]),us=applyAllTransformations(us,cs,40),(cs=[]).push([["^","y","n"],["/",1,["^","y",["-","n"]]],{variables:{y:!0,n:os},evaluate_numbers:!0,max_digits:ns}]),cs.push([["apply","exp","n"],["/",1,["apply","exp",["-","n"]]],{variables:{n:os},evaluate_numbers:!0,max_digits:ns}]),us=applyAllTransformations(us,cs,40),(cs=[]).push([["*","x",["/","y","z"]],["/",["*","x","y"],"z"],{allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["/",["/","x","y"],"z"],["/","x",["*","y","z"]],{allow_extended_match:!0,allow_permutations:!0}]),cs.push([["/","x",["/","y","z"]],["/",["*","x","z"],"y"],{allow_extended_match:!0,allow_permutations:!0}]),us=evaluate_numbers(us=applyAllTransformations(us,cs,40),{assumptions:rs,max_digits:ns})}function simplify_ratios(as,rs){function ns(os){var ls=1;return os=os.map(function(us){if(typeof us=="number")return us<0?(ls*=-1,-us):us;if(!Array.isArray(us))return us;if(us[0]==="-")return ls*=-1,us[1];if(us[0]!=="+")return us;var cs=!1;if((typeof us[1]=="number"&&us[1]<0||Array.isArray(us[1])&&us[1][0]==="-"||Array.isArray(us[1])&&us[1][0]==="*"&&Number(us[1][1])<0)&&(cs=!0),cs){ls*=-1;var ds=us.slice(1).map(ps=>["-",ps]);return evaluate_numbers(["+"].concat(ds))}return us}),{factors:os,sign_change:ls}}var ss=get_tree(as);return contains_blank(ss)?ss:(rs===void 0&&as.context!==void 0&&as.context.get_assumptions!==void 0&&(rs=as.context.get_assumptions([as.variables()])),function os(ls,us){if(!Array.isArray(ls))return us?["-",ls]:ls;var cs=ls[0];if(cs==="-")return os(ls[1],us=!0);var ds=ls.slice(1).map(vs=>os(vs));if(cs!=="/")return us?["-",[cs,...ds]]:[cs,...ds];var ps,fs=ds[0],hs=ds[1];fs=default_order(fs,{ignore_negatives:!0});var gs,ys=ns(ps=Array.isArray(fs)&&fs[0]==="*"?fs.slice(1):[fs]);ps=ys.factors,us&&(ys.sign_change*=-1),hs=default_order(hs,{ignore_negatives:!0});var bs=ns(gs=Array.isArray(hs)&&hs[0]==="*"?hs.slice(1):[hs]);return gs=bs.factors,ys.sign_change*bs.sign_change<0&&(ps[0]=["-",ps[0]]),["/",fs=ps.length===1?ps[0]:["*"].concat(ps),hs=gs.length===1?gs[0]:["*"].concat(gs)]}(ss))}function contains_blank(as){return as==="_"||!!Array.isArray(as)&&as.some(contains_blank)}let all_units=get_all_units();function remove_units(as,rs=!0){var ns=get_tree(as);if(!Array.isArray(ns))return ns;let ss=ns[0],os=ns.slice(1);if(ss==="unit"){let ls=all_units[get_unit_of_tree(ns)];if(!ls)return ns;let us=remove_units(ls.prefix?os[1]:os[0],rs);return rs?ls.scale(us):us}return[ss,...os.map(ls=>remove_units(ls,rs))]}function remove_scaling_units(as){var rs=get_tree(as);if(!Array.isArray(rs))return rs;let ns=rs[0],ss=rs.slice(1);if(ns==="unit"){let os=all_units[get_unit_of_tree(rs)];if(!os||!os.only_scales)return rs;let ls=remove_scaling_units(os.prefix?ss[1]:ss[0]);return os.scale(ls)}return[ns,...ss.map(os=>remove_scaling_units(os))]}function add_unit(as,rs){var ns=get_tree(as);let ss=all_units[rs];return ss?ss.prefix?["unit",rs,ns]:["unit",ns,rs]:ns}function move_units_outside_products(as){if(!Array.isArray(as))return as;let rs=as[0],ns=as.slice(1);if(rs==="*"){let ss=[],os=[];for(let us of ns){let cs=get_unit_value_of_tree(us);cs?(ss.push(cs[0]),os.push(cs[1])):os.push(us)}let ls=["*",...os];for(let us of ss)ls=add_unit(ls,us);return ls}return[rs,...ns.map(move_units_outside_products)]}var simplify$1=Object.freeze({__proto__:null,clean,simplify,simplify_logical,evaluate_numbers,collect_like_terms_factors,collapse_unary_minus,simplify_ratios,default_order,perform_vector_matrix_additions_scalar_multiplications,remove_units,add_unit,remove_scaling_units});function solve_linear(as,rs,ns){if(typeof rs=="string"){ns===void 0&&as.context!==void 0&&as.context.get_assumptions!==void 0&&(ns=as.context.get_assumptions([as.variables()]));var ss=simplify(get_tree(as),ns);if(Array.isArray(ss)){var os=ss[0],ls=ss.slice(1);if(os==="="||os==="ne"||os==="<"||os==="le"||os===">"||os==="ge"){var us=simplify(["+",ls[0],["-",ls[1]]],ns),cs=gs=>!variables(gs).includes(rs);if(variables(us=simplify(applyAllTransformations(us,[[["+",["*","_a",rs],["*","_b",rs]],["*",["+","_a","_b"],rs],{variables:{_a:cs,_b:cs},allow_permutations:!0,allow_extended_match:!0,allow_implicit_identities:["_a","_b"],evaluate_numbers:!0}]],20))).includes(rs)){var ds=match$2(us,["+",["*","_a",rs],"_b"],{variables:{_a:cs,_b:cs},allow_permutations:!0,allow_implicit_identities:["_a","_b"]});if(ds){var ps=simplify(ds._a),fs=simplify(ds._b);if(is_nonzero_ast(ps,ns)){if(os==="="||os==="ne"||is_positive_ast(ps,ns)){let gs=simplify(["/",["-",fs],ps]);return[os,rs,gs]}if(is_negative_ast(ps,ns)){var hs=simplify(["/",["-",fs],ps]);return[os=os==="<"?">":os==="le"?"ge":os===">"?"<":"le",rs,hs]}}}}}}}}var solve=Object.freeze({__proto__:null,solve_linear});function clean_assumptions(as,rs){if(!Array.isArray(as)||as.length===0)return as;var ns=(as=flatten$5(default_order(simplify_logical(expand_relations(as)))))[0],ss=as.slice(1);if(ns==="and"||ns==="or"){if(ss=ss.reduce(function(os,ls){return os.every(function(us){return!equal$2(us,ls)})&&os.push(ls),os},[]),ns==="and"&&rs&&Array.isArray(rs)){let os;os=rs[0]==="and"?rs.slice(1):[rs],ss=ss.filter(ls=>os.every(us=>!equal$2(us,ls)))}as=ss.length===1?ss[0]:[ns].concat(ss)}if(ns!=="and"&&rs&&Array.isArray(rs)){let os;if(os=rs[0]==="and"?rs.slice(1):[rs],!os.every(ls=>!equal$2(ls,as)))return}return as}function calculate_derived_assumptions(as,rs){if(rs===void 0){rs=[];for(let ds in as.byvar){let ps=as.byvar[ds];ps.length>0&&rs.push(ps)}if(rs.length===0)return{};rs=clean_assumptions(rs=rs.length===1?rs[0]:["and"].concat(rs))}if(!Array.isArray(rs)||rs.length===0)return{};var ns=rs[0],ss=rs.slice(1);if(ns==="and"||ns==="or"){let ds=ss.map(function(hs){return calculate_derived_assumptions(as,hs)}),ps=[...new Set(ds.reduce((hs,gs)=>[...hs,...Object.keys(gs)],[]))],fs={};for(let hs of ps){let gs=ds.reduce(function(ys,bs){return bs[hs]!==void 0&&ys.push(bs[hs]),ys},[]);if(ns==="and"||gs.length===ds.length){let ys=fs[hs];ys=ys===void 0?gs.length>1?[ns].concat(gs):gs[0]:gs.length>1?["and",ys,[ns].concat(gs)]:["and",ys,gs[0]],fs[hs]=clean_assumptions(ys,get_assumptions(as,hs,{omit_derived:!0}))}}return fs}let os={};if(ns==="="||ns==="ne"||ns==="<"||ns==="le"||ns==="in"||ns==="subset"||ns==="notin"||ns==="notsubset"){var ls=!1;for(let ds=0;ds<2;ds++){let ps=ss[ds],fs=ss[1-ds],hs=variables(fs);if(typeof ps!="string"||hs.length===0||hs.includes(ps))continue;ls=!0;var us=ns;ds===1&&(ns==="<"?us=">":ns==="le"?us="ge":ns==="in"?us="ni":ns==="subset"?us="superset":ns==="notin"?us="notni":ns==="notsubset"&&(us="notsuperset"));let gs=get_assumptions_for_expr(as,fs,[ps]);if(gs=combine_assumptions(ps,us,fs,gs),gs!==void 0){let ys=os[ps];ys=ys===void 0?gs:["and",ys,gs],os[ps]=clean_assumptions(ys,get_assumptions(as,ps,{omit_derived:!0}))}}if(ls)return os}let cs=[];for(let ds of ss){let ps=get_assumptions_for_expr(as,ds,[]);ps!==void 0&&cs.push(ps)}if(cs.length===0)return{};cs=cs.length===1?cs[0]:["and"].concat(cs);for(let ds of variables(rs))os[ds]=clean_assumptions(cs,get_assumptions(as,ds,{omit_derived:!0}));return os}function get_assumptions_for_expr(as,rs,ns){let ss=variables(rs);if(ss=ss.filter(gs=>!ns.includes(gs)),ss.length===0)return;function os(gs){return typeof gs=="number"||!(!Array.isArray(gs)||gs[0]!=="-"||typeof gs[1]!="number")}var ls=["_b"],us=["_b"],cs={_b:os},ds={};for(let gs=0;gsEs!==void 0);return ws.length===0?void 0:bs==="or"?ws.length===vs.length?["or"].concat(ws):void 0:ws.length===1?ws[0]:["and"].concat(ws)}if(!(["=","ne","<","le"].includes(bs)||["in","notin","subset","notsubset"].includes(bs)&&fs)){let ws=ns.concat(variables(rs)),Es=[];for(let _s of variables(ys)){if(ws.includes(_s))continue;let $s=get_assumptions_for_expr(as,_s,ws);$s!==void 0&&Es.push($s)}return Es.length===0?ys:Es.length===1?["and",ys,Es[0]]:["and",ys].concat(Es)}let xs=[];for(let ws=0;ws<=1;ws++){let Es=vs[ws],_s=vs[1-ws];if(typeof Es=="string"&&ss.includes(Es)){var Cs={};Cs[Es]=_s;var Ts=simplify(substitute$1(rs,Cs)),Ss=!1,Ns=bs;(ws===1&&ds[Es]>0||ws===0&&ds[Es]<0)&&(bs==="<"?(Ss=!0,Ns=">"):bs==="le"?(Ss=!0,Ns="ge"):bs==="in"?(Ss=!0,Ns="ni"):bs==="subset"?(Ss=!0,Ns="superset"):bs==="notin"?(Ss=!0,Ns="notni"):bs==="notsubset"&&(Ss=!0,Ns="notsuperset")),Ss?xs.push([bs,Ts,rs]):xs.push([bs,rs,Ts]);let $s=ns.concat([Es]),Rs=get_assumptions_for_expr(as,Ts,$s);Rs=combine_assumptions(rs,Ns,Ts,Rs),Rs!==void 0&&xs.push(Rs)}}if(xs.length===1)return xs[0];if(xs.length>1)return["and"].concat(xs);let As=ns.concat(variables(rs));xs=[];for(let ws of variables(ys)){if(As.includes(ws))continue;let Es=get_assumptions_for_expr(as,ws,As);Es!==void 0&&xs.push(Es)}return xs.length===0?ys:xs.length===1?["and",ys,xs[0]]:["and",ys].concat(xs)}(hs))}function combine_assumptions(as,rs,ns,ss){if(!["=","ne","<","le",">","ge","in","notin","ni","notni","subset","notsubset","superset","notsuperset"].includes(rs))return ss;if(Array.isArray(ss)){var os=ss[0],ls=ss.slice(1);if(os==="and"||os==="or"){let ps=ls.map(fs=>combine_assumptions(as,rs,ns,fs)).filter(fs=>fs!==void 0);return ps.length===0?void 0:os==="or"?ps.length===ls.length?[["or"].concat(ps)]:void 0:ps.length===1?ps[0]:["and"].concat(ps)}if(!["=","ne","<","le","in","notin","subset","notsubset"].includes(os))return ss;var us,cs,ds=os;if(equal$2(ls[0],ns))us=ls[1];else{if(!equal$2(ls[1],ns))return ss;us=ls[0],os==="<"?ds=">":os==="le"?ds="ge":os==="in"?ds="ni":os==="notin"?ds="notni":os==="subset"?ds="superset":os==="notsubset"&&(ds="notsuperset")}if(rs==="=")cs=ds;else if(ds==="=")cs=rs;else if(rs==="<"){if(ds!=="<"&&ds!=="le")return ds==="in"||ds==="notin"?ss:void 0;cs="<"}else if(rs==="le")if(ds==="<")cs="<";else{if(ds!=="le")return ds==="in"||ds==="notin"?ss:void 0;cs="le"}else if(rs===">"){if(ds!==">"&&ds!=="ge")return ds==="in"||ds==="notin"?ss:void 0;cs=">"}else if(rs==="ge")if(ds===">")cs=">";else{if(ds!=="ge")return ds==="in"||ds==="notin"?ss:void 0;cs="ge"}else if(rs==="in"){if(ds!=="subset")return;cs="in"}else if(rs==="notin"){if(ds!=="superset")return;cs="notin"}else if(rs==="ni"){if(ds!=="notin")return;cs="notsubset"}else if(rs==="notni"){if(ds!=="in")return;cs="notsuperset"}else if(rs==="subset")if(ds==="subset")cs="subset";else if(ds==="notni")cs="notni";else{if(ds!=="notsuperset")return;cs="notsuperset"}else if(rs==="notsubset"){if(ds!=="superset")return;cs="notsubset"}else if(rs==="superset")if(ds==="superset")cs="superset";else if(ds==="ni")cs="ni";else{if(ds!=="notsubset")return;cs="notsubset"}else{if(rs!=="notsuperset"||ds!=="subset")return;cs="notsuperset"}return cs===">"?["<",us,as]:cs==="ge"?["le",us,as]:cs==="ni"?["in",us,as]:cs==="notni"?["notin",us,as]:cs==="superset"?["subset",us,as]:cs==="notsuperset"?["notsubset",us,as]:[cs,as,us]}}function filter_assumptions_from_tree(as,rs){if(Array.isArray(as)&&as.length!==0){Array.isArray(rs)||(rs=[rs]);var ns=as[0],ss=as.slice(1);if(ns==="and"){var os=ss.map(function(us){return filter_assumptions_from_tree(us,rs)});return(os=os.filter(us=>us!==void 0)).length===0?void 0:os.length===1?os[0]:["and"].concat(os)}var ls=variables(as);return rs.filter(us=>ls.includes(us)).length>0?void 0:as}}function get_assumptions_sub(as,rs,ns,ss){Array.isArray(rs)||(rs=[rs]);var os=[];return rs.forEach(function(ls){if(as.byvar[ls]||as.derived[ls]){if(as.byvar[ls]&&as.byvar[ls].length>0){var us=filter_assumptions_from_tree(as.byvar[ls],ns);us!==void 0&&os.push(us)}if(as.derived[ls]&&as.derived[ls].length>0&&!ss){var cs=filter_assumptions_from_tree(as.derived[ls],ns);cs!==void 0&&os.push(cs)}}else as.generic.length>0&&(ls!=="x"&&variables(as.generic).includes(ls)||os.push(substitute$1(as.generic,{x:ls})))}),os.length===1?os=os[0]:os.length>1&&(os=["and"].concat(os)),os.length>0?clean_assumptions(os):void 0}function get_assumptions(as,rs,ns){ns===void 0&&(ns={});var ss,os=ns.exclude_variables;os===void 0?os=[]:Array.isArray(os)||(os=[os]);var ls=get_tree(rs);if(typeof ls=="string")ss=[ls];else{if(!Array.isArray(ls))return;Array.isArray(ls[0])&&(ss=ls[0])}return ss?get_assumptions_sub(as,ss,os,ns.omit_derived):get_assumptions_for_expr(as,ls,os)}function add_assumption(as,rs,ns){var ss=get_tree(rs);if(!Array.isArray(ss))return 0;var os=add_assumption_sub(as,ss=clean_assumptions(simplify(ss,as)),ns);return os&&(as.derived=calculate_derived_assumptions(as)),os}function add_assumption_sub(as,rs,ns){if(rs[0]==="and")return rs.slice(1).map(ls=>add_assumption_sub(as,ls,ns)).reduce(function(ls,us){return ls+us});var ss=variables(rs);if(ss.length===0)return 0;let os=0;!ns&&as.generic.length>0&&ss.forEach(function(ls){as.byvar[ls]===void 0&&(ls!=="x"&&variables(as.generic).includes(ls)||(add_assumption_sub(as,substitute$1(as.generic,{x:ls}),!0),os+=1))});for(let ls of ss){let us=solve_linear(rs,ls,as),cs=rs;us&&(cs=us);let ds=as.byvar[ls];ds!==void 0&&ds.length!==0&&(cs=["and",ds,cs]),cs=clean_assumptions(cs),equal$2(cs,ds)||(as.byvar[ls]=cs,os+=1)}return os}function add_generic_assumption(as,rs){var ns=get_tree(rs);if(!Array.isArray(ns))return 0;var ss=add_generic_assumption_sub(as,ns=clean_assumptions(simplify(ns,as)));return ss&&(as.derived=calculate_derived_assumptions(as)),ss}function add_generic_assumption_sub(as,rs){if(rs[0]==="and")return rs.slice(1).map(ls=>add_generic_assumption_sub(as,ls)).reduce(function(ls,us){return ls+us});if(!variables(rs).includes("x"))return 0;let ns=solve_linear(rs,"x",as),ss=rs;ns&&(ss=ns);let os=as.generic;return os.length!==0&&(ss=["and",os,ss]),ss=clean_assumptions(ss),equal$2(ss,os)?0:(as.generic=ss,1)}function remove_assumption(as,rs){var ns=get_tree(rs);if(!Array.isArray(ns))return 0;var ss=remove_assumption_sub(as,ns=clean_assumptions(simplify(ns,as)));return ss&&(as.derived=calculate_derived_assumptions(as)),ss}function remove_assumption_sub(as,rs){if(rs[0]==="and")return rs.slice(1).map(os=>remove_assumption_sub(as,os)).reduce(function(os,ls){return os+ls});var ns=variables(rs);if(ns.length===0)return 0;var ss=0;for(let os of ns){let ls=solve_linear(rs,os,as),us=as.byvar[os];if(!us||us.length===0)continue;let cs,ds=us[0],ps=us.slice(1),fs=ps.length;if(ds==="and")if(ps=ps.filter(hs=>!(equal$2(hs,rs)||equal$2(hs,ls))),ps.length===0)cs=[];else if(ps.length===1)cs=ps[0];else{if(!(ps.lengthremove_generic_assumption_sub(as,ds)).reduce(function(ds,ps){return ds+ps});if(!variables(rs).includes("x"))return 0;var ns=as.generic;if(ns.length===0)return 0;let ss=solve_linear(rs,"x",as);var os,ls=ns[0],us=ns.slice(1),cs=us.length;if(ls==="and")if((us=us.filter(ds=>!(equal$2(ds,rs)||equal$2(ds,ss)))).length===0)os=[];else if(us.length===1)os=us[0];else{if(!(us.length0){if(as.includes(".")){if(as[0]!=="0"?ns++:ns+=as.match(/^0\.0*/)[0].length,as.length0)if(as.includes(".")){let ss=as.match(/\.\d*$/)[0].length-1;ss":function(as){return as.join(" > ")},lts:function(as){return as.join(" < ")},gts:function(as){return as.join(" > ")},le:function(as){return as.join(" \\le ")},ge:function(as){return as.join(" \\ge ")},ne:function(as){return as.join(" \\ne ")},forall:function(as){return"\\forall "+as[0]},exists:function(as){return"\\exists "+as[0]},in:function(as){return as[0]+" \\in "+as[1]},notin:function(as){return as[0]+" \\notin "+as[1]},ni:function(as){return as[0]+" \\ni "+as[1]},notni:function(as){return as[0]+" \\not\\ni "+as[1]},subset:function(as){return as[0]+" \\subset "+as[1]},subseteq:function(as){return as[0]+" \\subseteq "+as[1]},notsubset:function(as){return as[0]+" \\not\\subset "+as[1]},notsubseteq:function(as){return as[0]+" \\not\\subseteq "+as[1]},superset:function(as){return as[0]+" \\supset "+as[1]},superseteq:function(as){return as[0]+" \\supseteq "+as[1]},notsuperset:function(as){return as[0]+" \\not\\supset "+as[1]},notsuperseteq:function(as){return as[0]+" \\not\\supseteq "+as[1]},union:function(as){return as.join(" \\cup ")},intersect:function(as){return as.join(" \\cap ")},perp:function(as){return as.join(" \\perp ")},parallel:function(as){return as.join(" \\parallel ")},derivative_leibniz:function(as){return"\\frac{d"+as[0]+"}{d"+as[1]+"}"},partial_derivative_leibniz:function(as){return"\\frac{d"+as[0]+"}{d"+as[1]+"}"},"|":function(as){return as[0]+" \\mid "+as[1]},":":function(as){return as[0]+" : "+as[1]},binom:function(as){return"\\binom{"+as[0]+"}{"+as[1]+"}"},vec:function(as){return"\\vec{"+as[0]+"}"},linesegment:function(as){return"\\overline{"+as.join(" ")+"}"},angle:function(as,rs){return rs?"\\angle "+as.join(""):"\\angle\\left( "+as.join(", ")+" \\right)"},unit:function(as){return as[1]==="\\circ"?as[0]+"^{\\circ}":as[0]+" "+as[1]}},allowedLatexSymbolsDefault$1=["alpha","beta","gamma","Gamma","delta","Delta","epsilon","zeta","eta","theta","Theta","iota","kappa","lambda","Lambda","mu","nu","xi","Xi","pi","Pi","rho","sigma","Sigma","tau","Tau","upsilon","Upsilon","phi","Phi","chi","psi","Psi","omega","Omega","partial","abs","exp","log","ln","log10","sign","sqrt","erf","cos","cosh","cot","coth","csc","csch","sec","sech","sin","sinh","tan","tanh","arcsin","arccos","arctan","arccsc","arcsec","arccot","arg","Re","Im","det","angle","perp","circ","%","$","int"],convertLatexSymbolsDefault={acos:"arccos",acosh:"arccosh",acot:"arccot",acoth:"arccoth",acsc:"arccsc",acsch:"arccsch",asec:"arcsec",asech:"arcsech",asin:"arcsin",asinh:"arcsinh",atan:"arctan",atanh:"arctanh",deg:"circ"},matrixEnvironmentDefault="bmatrix";class astToLatex$1{constructor({allowedLatexSymbols:rs=allowedLatexSymbolsDefault$1,convertLatexSymbols:ns=convertLatexSymbolsDefault,matrixEnvironment:ss=matrixEnvironmentDefault,padToDigits:os=null,padToDecimals:ls=null,showBlanks:us=!0}={}){this.allowedLatexSymbols=rs,this.convertLatexSymbols=ns,this.matrixEnvironment=ss,this.padToDigits=os,this.padToDecimals=ls,this.showBlanks=us}convert(rs){return this.statement(rs)}statement(rs){if(!Array.isArray(rs))return this.single_statement(rs);var ns=rs[0],ss=rs.slice(1);if(ns==="ldots")return"\\ldots";if(!(ns in operators$1)&&ns!=="apply")throw new Error("Badly formed ast: operator "+ns+" not recognized.");return ns==="and"||ns==="or"?operators$1[ns](ss.map(function(os,ls){let us=this.single_statement(os);return us.match(/ /)&&!us.match(/^\\left\(.*\\right\)$/)?"\\left("+us+"\\right)":us}.bind(this))):this.single_statement(rs)}single_statement(rs){if(!Array.isArray(rs))return this.expression(rs);var ns=rs[0],ss=rs.slice(1);if(ns==="not")return operators$1[ns](ss.map(function(os,ls){let us=this.single_statement(os);return us.match(/ /)&&!us.match(/^\\left\(.*\\right\)$/)?"\\left("+us+"\\right)":us}.bind(this)));if(ns==="exists"||ns==="forall")return operators$1[ns]([this.single_statement(ss[0])]);if(ns==="="||ns==="ne"||ns==="<"||ns===">"||ns==="le"||ns==="ge"||ns==="in"||ns==="notin"||ns==="ni"||ns==="notni"||ns==="subset"||ns==="notsubset"||ns==="subseteq"||ns==="notsubseteq"||ns==="superset"||ns==="notsuperset"||ns==="superseteq"||ns==="notsuperseteq")return operators$1[ns](ss.map(function(os,ls){return this.expression(os)}.bind(this)));if(ns==="lts"||ns==="gts"){let os=ss[0],ls=ss[1];if(os[0]!=="tuple"||ls[0]!=="tuple")throw new Error("Badly formed ast");let us=this.expression(os[1]);for(let cs=1;cs ":us+=ns==="lts"?" \\le ":" \\ge ",us+=this.expression(os[cs+1]);return us}return this.expression(rs)}expression(rs){if(!Array.isArray(rs))return this.term(rs);var ns=rs[0],ss=rs.slice(1);return ns==="+"?ss.length===1?"+"+this.term(ss[0]):operators$1[ns](ss.map(function(os,ls){return ls>0?this.termWithPlusIfNotNegated(os):this.term(os)}.bind(this))):["union","intersect","perp","parallel"].includes(ns)?operators$1[ns](ss.map(function(os,ls){return this.term(os)}.bind(this))):this.term(rs)}term(rs){if(!Array.isArray(rs))return this.factor(rs);var ns=rs[0],ss=rs.slice(1);return ns==="-"?operators$1[ns](ss.map(function(os,ls){return this.term(os)}.bind(this))):ns==="*"?operators$1[ns](ss.map(function(os,ls){let us;return ls>0?(us=this.factorWithParenthesesIfNegatedOrExplicitPlus(os),us.match(/^[0-9]/)?"\\cdot "+us:os[0]==="angle"&&ss.length>1?"\\left( "+us+" \\right)":us):(us=this.factor(os),os[0]==="angle"&&ss.length>1?"\\left( "+us+" \\right)":us)}.bind(this))):ns==="/"||ns==="unit"?operators$1[ns](ss.map(function(os,ls){return this.expression(os)}.bind(this))):this.factor(rs)}simple_factor_or_function_or_parens(rs){var ns=this.factor(rs);return!!(ns.length<=1||typeof rs=="string"&&rs.match(/^\w+$/)||Array.isArray(rs)&&rs[0]==="apply"&&rs[1]!=="sqrt"||ns.match(/^\\left\(.*\\right\)$/)||ns.match(/^\\left\\langle.*\\right\\rangle$/))||typeof rs=="number"&&rs>=0&&!rs.toString().includes("e")}stringConvert(rs){return rs.length>1?(this.convertLatexSymbols[rs]&&(rs=this.convertLatexSymbols[rs]),this.allowedLatexSymbols.includes(rs)?"\\"+rs:"\\operatorname{"+rs+"}"):this.allowedLatexSymbols.includes(rs)?"\\"+rs:rs!=="_"||this.showBlanks?rs:""}factor(rs){if(typeof rs=="string")return this.stringConvert(rs);if(typeof rs=="number"){if(rs===1/0)return"\\infty";if(rs===-1/0)return"-\\infty";if(Number.isNaN(rs))return"NaN";{let os=rs.toString(),ls=os.indexOf("e");if(ls===-1)return this.padToDigits!==null?os=padNumberStringToDigits(os,this.padToDigits):this.padToDecimals!==null&&(os=padNumberStringToDecimals(os,this.padToDecimals)),os;let us=os.substring(0,ls),cs=os.substring(ls+1);if(cs[0]==="+"&&(cs=cs.slice(1)),this.padToDigits!==null)us=padNumberStringToDigits(us,this.padToDigits);else if(this.padToDecimals!==null){let ds=Number(cs);if(ds>0)return os=rs.toLocaleString("fullwide",{useGrouping:!1}),padNumberStringToDecimals(os,this.padToDecimals);us=padNumberStringToDecimals(us,this.padToDecimals+ds)}return us+" \\cdot 10^{"+cs+"}"}}if(!Array.isArray(rs))return"";var ns=rs[0],ss=rs.slice(1);if(ns==="^"){if(Number.isInteger(ss[0])&&Number.isInteger(ss[1]))return ss[0]<0?"\\left("+ss[0].toString()+"\\right)^{"+ss[1].toString()+"}":ss[0].toString()+"^{"+ss[1].toString()+"}";let os=this.factor(ss[0]),ls=ss[0];for(;ls[0]==="prime";)ls=ls[1];return this.simple_factor_or_function_or_parens(ls)||ls[0]==="_"&&typeof ls[1]=="string"||(os="\\left("+os.toString()+"\\right)"),os+"^{"+this.statement(ss[1])+"}"}if(ns==="_"){let os=this.factor(ss[0]);return this.simple_factor_or_function_or_parens(ss[0])||(os="\\left("+os.toString()+"\\right)"),os+"_{"+this.statement(ss[1])+"}"}if(ns==="prime"){let os=ss[0],ls=1;for(;os[0]==="prime";)ls+=1,os=os[1];let us=this.factor(os);this.simple_factor_or_function_or_parens(os)||os[0]==="_"&&typeof os[1]=="string"||(us="\\left("+us+"\\right)");for(let cs=0;cs1?ps=ps.trimRight()+"^{"+cs+"}"+this.stringConvert(ds):ps+=this.stringConvert(ds),ps="\\frac{ "+ps+" }{ ";let fs=1;Array.isArray(us)&&(fs=us.length-1);for(let hs=1;hs<=fs;hs++){let gs=us[hs],ys=1,bs="";Array.isArray(gs)?(bs=gs[1],ys=gs[2]):bs=gs,ps=ps+os+this.stringConvert(bs),ys>1&&(ps=ps+"^{"+ys+"}"),ps+=" "}return ps+="}",ps}if(ns==="apply"){if(ss[0]==="abs")return"\\left|"+this.statement(ss[1])+"\\right|";if(ss[0]==="floor")return"\\left\\lfloor "+this.statement(ss[1])+" \\right\\rfloor";if(ss[0]==="ceil")return"\\left\\lceil "+this.statement(ss[1])+" \\right\\rceil";if(ss[0]==="factorial"){let cs=this.factor(ss[1]);return this.simple_factor_or_function_or_parens(ss[1])||ss[1][0]==="_"&&typeof ss[1][1]=="string"?cs+"!":"\\left("+cs+"\\right)!"}if(ss[0]==="sqrt")return"\\sqrt{"+this.statement(ss[1])+"}";let os,ls=ss[0];if(ls[0]==="^"&&(ls=ls[1]),ls[0]==="_"&&(ls=ls[1]),ls==="int"){let cs,ds=this.factor(ss[0]),ps=ss[1];if(Array.isArray(ps)&&ps[0]==="*"){let fs=[],hs=["*"];for(let gs=1;gs0&&(cs[cs.length-1].match(/[a-zA-Z]/)&&(cs+="\\,"),cs+=fs.map(gs=>"d"+this.factor(gs[1])).join("\\,"))}return cs||(cs=this.term(ss[1])),ds+" "+cs}os=ss[0]==="log10"?"\\log_{10}":ss[0]==="re"?"\\Re":ss[0]==="im"?"\\Im":this.factor(ss[0]);let us=this.statement(ss[1]);return ss[1][0]!=="tuple"&&(us="\\left("+us+"\\right)"),os+us}if(ns==="angle"){let os=ss.every(ls=>{if(typeof ls=="string"&&ls.length===1)return!0;if(!Array.isArray(ls))return!1;let us=ls[0];return us==="_"||us==="^"||us==="prime"});return operators$1[ns](ss.map(function(ls,us){return this.statement(ls)}.bind(this)),os)}return ns==="+"&&rs.length===2?"+ "+this.factor(rs[1]):"\\left("+this.statement(rs)+"\\right)"}factorWithParenthesesIfNegatedOrExplicitPlus(rs){var ns=this.factor(rs);return ns.match(/^-/)||ns.match(/^\+/)?"\\left("+ns+"\\right)":ns}termWithPlusIfNotNegated(rs){var ns=this.term(rs);return ns.match(/^-/)?ns.match(/^-[^ ]/)?"- "+ns.slice(1):ns:"+ "+ns}}const textToAst$2=new textToAst$4,astToLatex=new astToLatex$1;var derivatives={sin:textToAst$2.convert("cos x"),cos:textToAst$2.convert("-(sin x)"),tan:textToAst$2.convert("(sec x)^2"),cot:textToAst$2.convert("-((csc x)^2)"),sec:textToAst$2.convert("(sec x)*(tan x)"),csc:textToAst$2.convert("-(csc x)*(cot x)"),sqrt:textToAst$2.convert("1/(2*sqrt(x))"),log:textToAst$2.convert("1/x"),ln:textToAst$2.convert("1/x"),exp:textToAst$2.convert("exp(x)"),arcsin:textToAst$2.convert("1/sqrt(1 - x^2)"),arccos:textToAst$2.convert("-1/sqrt(1 - x^2)"),arctan:textToAst$2.convert("1/(1 + x^2)"),arccsc:textToAst$2.convert("-1/(sqrt(-1/x^2 + 1)*x^2)"),arcsec:textToAst$2.convert("1/(sqrt(-1/x^2 + 1)*x^2)"),arccot:textToAst$2.convert("-1/(1 + x^2)"),abs:textToAst$2.convert("abs(x)/x")};function derivative(as,rs,ns=[]){var ss=get_tree(as),os="\\frac{d}{d"+rs+"} ";if(typeof ss=="number"||variables(ss).indexOf(rs)<0)return ns.push("The derivative of a constant is zero, that is, \\("+os+astToLatex.convert(ss)+" = 0\\)."),0;if(typeof ss=="string")return rs===ss?(ns.push("We know the derivative of the identity function is one, that is, \\("+os+astToLatex.convert(ss)+" = 1\\)."),1):(ns.push("As far as \\("+astToLatex.convert(rs)+"\\) is concerned, \\("+astToLatex.convert(ss)+"\\) is constant, so "+os+astToLatex.convert(ss)+" = 0\\)."),0);if(!Array.isArray(ss))return null;var ls=ss[0],us=ss.slice(1);if(ls==="+"||ls==="-"||ls==="~"){ns.push("Using the sum rule, \\("+os+astToLatex.convert(ss)+" = "+us.map(function(ds,ps){return os+astToLatex.convert(ds)}).join(" + ")+"\\).");let cs=[ls].concat(us.map(function(ds,ps){return derivative(ds,rs,ns)}));return cs=simplify(cs),ns.push("So using the sum rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(cs)+"\\)."),cs}if(ls==="*"){let cs=[],ds=[];for(let hs=0;hs0){if(cs.length===0)return ns.push("Since the derivative of a constant is zero, \\("+os+astToLatex.convert(ss)+" = 0.\\)"),0;let hs=["*"].concat(cs);if(cs.length===1&&(hs=cs[0]),hs===rs){ns.push("By the constant multiple rule, \\("+os+astToLatex.convert(ss)+" = "+ds.map(function(vs,xs){return astToLatex.convert(vs)}).join(" \\cdot ")+"\\).");let bs=["*"].concat(ds);return bs=simplify(bs),bs}ns.push("By the constant multiple rule, \\("+os+astToLatex.convert(ss)+" = "+ds.map(function(bs,vs){return astToLatex.convert(bs)}).join(" \\cdot ")+" \\cdot "+os+"\\left("+astToLatex.convert(hs)+"\\right)\\).");let gs=derivative(hs,rs,ns),ys=["*"].concat(ds.concat([gs]));return ys=simplify(ys),ns.push("And so \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ys)+"\\)."),ys}ns.push("Using the product rule, \\("+os+astToLatex.convert(ss)+" = "+us.map(function(hs,gs){return us.map(function(ys,bs){return gs===bs?os+"\\left("+astToLatex.convert(hs)+"\\right)":astToLatex.convert(ys)}).join(" \\cdot ")}).join(" + ")+"\\).");let ps=us.slice(),fs=["+"].concat(us.map(function(hs,gs){return["*"].concat(ps.map(function(ys,bs){if(gs===bs){let vs=derivative(ys,rs,ns);return vs===1?null:vs}return ys}).filter(function(ys){return ys!=null}))}));return fs=simplify(fs),ns.push("So using the product rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(fs)+"\\)."),fs}if(ls==="/"){let cs=us[0],ds=us[1];if(variables(ds).indexOf(rs)<0){ns.push("By the constant multiple rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(["/",1,ds])+" \\cdot "+os+"\\left("+astToLatex.convert(cs)+"\\right)\\).");let ys=derivative(cs,rs,ns),bs=textToAst$2.convert("(1/g)*d"),vs=substitute$1(bs,{d:ys,g:ds});return vs=simplify(vs),ns.push("So \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(vs)+"\\)."),vs}if(variables(cs).indexOf(rs)<0){cs!==1&&ns.push("By the constant multiple rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(cs)+" \\cdot "+os+"\\left("+astToLatex.convert(["/",1,ds])+"\\right)\\)."),ns.push("Since \\(\\frac{d}{du} \\frac{1}{u}\\) is \\(\\frac{-1}{u^2}\\), the chain rule gives \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(cs)+"\\cdot \\frac{-1}{ "+astToLatex.convert(ds)+"^2} \\cdot "+os+astToLatex.convert(ds)+"\\).");let ys=derivative(ds,rs,ns),bs=textToAst$2.convert("f * (-a/(g^2))"),vs=substitute$1(bs,{f:cs,a:ys,g:ds});return vs=simplify(vs),ns.push("So since \\(\\frac{d}{du} \\frac{1}{u}\\) is \\(\\frac{-1}{u^2}\\), the chain rule gives \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(vs)+"\\)."),vs}ns.push("Using the quotient rule, \\("+os+astToLatex.convert(ss)+" = \\frac{"+os+"\\left("+astToLatex.convert(cs)+"\\right) \\cdot "+astToLatex.convert(ds)+" - "+astToLatex.convert(cs)+"\\cdot "+os+"\\left("+astToLatex.convert(ds)+"\\right)}{ \\left( "+astToLatex.convert(ds)+" \\right)^2} \\).");let ps=derivative(cs,rs,ns),fs=derivative(ds,rs,ns),hs=textToAst$2.convert("(a * g - f * b)/(g^2)"),gs=substitute$1(hs,{a:ps,b:fs,f:cs,g:ds});return gs=simplify(gs),ns.push("So using the quotient rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(gs)+"\\)."),gs}if(ls==="^"){let cs=us[0],ds=us[1];if(variables(ds).indexOf(rs)<0){if(typeof cs=="string"&&cs==="x"){if(typeof ds=="number"){let Ns=textToAst$2.convert("n * (f^m)"),As=substitute$1(Ns,{n:ds,m:ds-1,f:cs});return As=simplify(As),ns.push("By the power rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ds)+" \\cdot \\left("+astToLatex.convert(cs)+"\\right)^{"+astToLatex.convert(["-",ds,1])+"}\\)."),As}let Ts=textToAst$2.convert("n * (f^(n-1))"),Ss=substitute$1(Ts,{n:ds,f:cs});return Ss=simplify(Ss),ns.push("By the power rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ds)+" \\cdot \\left("+astToLatex.convert(cs)+"\\right)^{"+astToLatex.convert(["-",ds,1])+"}\\)."),Ss}ds!==1&&ns.push("By the power rule and the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ds)+" \\cdot \\left("+astToLatex.convert(cs)+"\\right)^{"+astToLatex.convert(["-",ds,1])+"} \\cdot "+os+astToLatex.convert(cs)+"\\).");let vs=derivative(cs,rs,ns);if(ds===1)return vs;if(typeof ds=="number"){let Ts=textToAst$2.convert("n * (f^m) * a"),Ss=substitute$1(Ts,{n:ds,m:ds-1,f:cs,a:vs});return Ss=simplify(Ss),ns.push("So by the power rule and the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(Ss)+"\\)."),Ss}let xs=textToAst$2.convert("n * (f^(n-1)) * a"),Cs=substitute$1(xs,{n:ds,f:cs,a:vs});return Cs=simplify(Cs),ns.push("So by the power rule and the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(Cs)+"\\)."),Cs}if(cs==="e"&&math$1.define_e){if(typeof ds=="string"&&ds===rs){let Ts=textToAst$2.convert("e^(f)"),Ss=substitute$1(Ts,{f:ds});return Ss=simplify(Ss),ns.push("The derivative of \\(e^"+astToLatex.convert(rs)+"\\) is itself, that is, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ss)+"\\)."),Ss}ns.push("Using the rule for \\(e^x\\) and the chain rule, we know \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ss)+" \\cdot "+os+astToLatex.convert(ds)+"\\).");let vs=textToAst$2.convert("e^(f)*d"),xs=derivative(ds,rs,ns),Cs=substitute$1(vs,{f:ds,d:xs});return Cs=simplify(Cs),ns.push("So using the rule for \\(e^x\\) and the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(Cs)+"\\)."),Cs}if(typeof cs=="number"){if(typeof ds=="string"&&ds===rs){let Ns=textToAst$2.convert("a^(f) * log(a)"),As=substitute$1(Ns,{a:cs,f:ds});return As=simplify(As),ns.push("The derivative of \\(a^"+astToLatex.convert(rs)+"\\) is \\(a^{"+astToLatex.convert(rs)+"} \\, \\log a\\), that is, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(As)+"\\)."),As}let vs=textToAst$2.convert("a^(f) * log(a)"),xs=substitute$1(vs,{a:cs,f:ds});ns.push("Using the rule for \\(a^x\\) and the chain rule, we know \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(xs)+" \\cdot "+os+astToLatex.convert(ds)+"\\).");let Cs=textToAst$2.convert("a^(b)*log(a)*d"),Ts=derivative(ds,rs,ns),Ss=substitute$1(Cs,{a:cs,b:ds,d:Ts});return Ss=simplify(Ss),ns.push("So using the rule for \\(a^x\\) and the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(Ss)+"\\)."),Ss}let ps=cs,fs=ds;ns.push("Recall the general rule for exponents, namely that \\(\\frac{d}{dx} u(x)^{v(x)} = u(x)^{v(x)} \\cdot \\left( v'(x) \\cdot \\log u(x) + \\frac{v(x) \\cdot u'(x)}{u(x)} \\right)\\). In this case, \\(u(x) = "+astToLatex.convert(ps)+"\\) and \\(v(x) = "+astToLatex.convert(fs)+"\\).");let hs=derivative(ps,rs,ns),gs=derivative(fs,rs,ns),ys=textToAst$2.convert("(f^g)*(b * log(f) + (g * a)/f)"),bs=substitute$1(ys,{a:hs,b:gs,f:ps,g:fs});return bs=simplify(bs),ns.push("So by the general rule for exponents, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(bs)+"\\)."),bs}if(ls==="apply"&&!(us[0]in derivatives)){let cs=us[1];ns.push("By the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(substitute$1(["apply",us[0]+"'","x"],{x:cs}))+" \\cdot "+os+astToLatex.convert(cs)+"\\).");let ds=["*",substitute$1(["apply",us[0]+"'","x"],{x:cs}),derivative(cs,rs,ns)];return ds=simplify(ds),ns.push("So by the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ds)+"\\)."),ds}if(ls==="apply"&&us[0]in derivatives||ls in derivatives){let cs=!1;ls==="apply"&&(ls=us[0],us=us.slice(1),cs=!0);let ds=us[0];if(typeof ds=="number"){let ps=0;return ns.push("The derivative of a constant is zero so \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ps)+"\\)."),ps}if(typeof ds=="string"&&ds===rs){let ps=["*",substitute$1(derivatives[ls],{x:ds})];return ps=simplify(ps),ns.push("It is the case that \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ps)+"\\)."),ps}if(typeof ds=="string"&&ds!==rs){let ps=0;return ns.push("Since the derivative of a constant is zero, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ps)+"\\)."),ps}{let ps=[ls,"u"];cs&&(ps=["apply"].concat(ps)),ns.push("Recall \\(\\frac{d}{du}"+astToLatex.convert(ps)+" = "+astToLatex.convert(derivative(ps,"u",[]))+"\\)."),ns.push("By the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(substitute$1(derivatives[ls],{x:ds}))+" \\cdot "+os+astToLatex.convert(ds)+"\\).");let fs=["*",substitute$1(derivatives[ls],{x:ds}),derivative(ds,rs,ns)];return fs=simplify(fs),ns.push("So by the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(fs)+"\\)."),fs}}return 0}function lowercaseFirstLetter(as){return as.charAt(0).toLowerCase()+as.slice(1)}function simplify_story(as){for(let rs=as.length-1;rs>=1;rs--)as[rs]===as[rs-1]&&as.splice(rs,1);for(let rs=0;rs":function(as){return as.join(" > ")},lts:function(as){return as.join(" < ")},gts:function(as){return as.join(" > ")},le:function(as){return as.join(" ≤ ")},ge:function(as){return as.join(" ≥ ")},ne:function(as){return as.join(" ≠ ")},forall:function(as){return"∀ "+as[0]},exists:function(as){return"∃ "+as[0]},in:function(as){return as[0]+" ∈ "+as[1]},notin:function(as){return as[0]+" ∉ "+as[1]},ni:function(as){return as[0]+" ∋ "+as[1]},notni:function(as){return as[0]+" ∌ "+as[1]},subset:function(as){return as[0]+" ⊂ "+as[1]},subseteq:function(as){return as[0]+" ⊆ "+as[1]},notsubset:function(as){return as[0]+" ⊄ "+as[1]},notsubseteq:function(as){return as[0]+" ⊈ "+as[1]},superset:function(as){return as[0]+" ⊃ "+as[1]},superseteq:function(as){return as[0]+" ⊇ "+as[1]},notsuperset:function(as){return as[0]+" ⊅ "+as[1]},notsuperseteq:function(as){return as[0]+" ⊉ "+as[1]},union:function(as){return as.join(" ∪ ")},intersect:function(as){return as.join(" ∩ ")},perp:function(as){return as.join(" ⟂ ")},parallel:function(as){return as.join(" ∥ ")},derivative_leibniz:function(as){return"d"+as[0]+"/d"+as[1]},partial_derivative_leibniz:function(as){return"∂"+as[0]+"/∂"+as[1]},"|":function(as){return as[0]+" | "+as[1]},":":function(as){return as[0]+" : "+as[1]},binom:function(as){return"binom( "+as[0]+", "+as[1]+" )"},vec:function(as){return"vec("+as[0]+")"},linesegment:function(as){return"linesegment( "+as.join(", ")+" )"},angle:function(as,rs){return rs?"∠"+as.join(""):"∠( "+as.join(", ")+" )"},unit:function(as){return as[0]+" "+as[1]}},nonunicode_operators={"+":function(as){return as.join(" ")},"-":function(as){return"-"+as[0]},"*":function(as){return as.join(" ")},"/":function(as){return as[0]+"/"+as[1]},_:function(as){return as[0]+"_"+as[1]},"^":function(as){return as[0]+"^"+as[1]},prime:function(as){return as[0]+"'"},tuple:function(as){return"( "+as.join(", ")+" )"},array:function(as){return"[ "+as.join(", ")+" ]"},list:function(as){return as.join(", ")},set:function(as){return"{ "+as.join(", ")+" }"},vector:function(as){return"( "+as.join(", ")+" )"},altvector:function(as){return"( "+as.join(", ")+" )"},interval:function(as){return"( "+as.join(", ")+" )"},matrix:function(as){return"( "+as.join(", ")+" )"},and:function(as){return as.join(" and ")},or:function(as){return as.join(" or ")},not:function(as){return"not "+as[0]},"=":function(as){return as.join(" = ")},"<":function(as){return as.join(" < ")},">":function(as){return as.join(" > ")},lts:function(as){return as.join(" < ")},gts:function(as){return as.join(" > ")},le:function(as){return as.join(" <= ")},ge:function(as){return as.join(" >= ")},ne:function(as){return as.join(" ne ")},forall:function(as){return"forall "+as[0]},exists:function(as){return"exists "+as[0]},in:function(as){return as[0]+" elementof "+as[1]},notin:function(as){return as[0]+" notelementof "+as[1]},ni:function(as){return as[0]+" containselement "+as[1]},notni:function(as){return as[0]+" notcontainselement "+as[1]},subset:function(as){return as[0]+" subset "+as[1]},subseteq:function(as){return as[0]+" subseteq "+as[1]},notsubset:function(as){return as[0]+" notsubset "+as[1]},notsubseteq:function(as){return as[0]+" notsubseteq "+as[1]},superset:function(as){return as[0]+" superset "+as[1]},superseteq:function(as){return as[0]+" superseteq "+as[1]},notsuperset:function(as){return as[0]+" notsuperset "+as[1]},notsuperseteq:function(as){return as[0]+" notsuperseteq "+as[1]},union:function(as){return as.join(" union ")},intersect:function(as){return as.join(" intersect ")},perp:function(as){return as.join(" perp ")},parallel:function(as){return as.join(" parallel ")},derivative_leibniz:function(as){return"d"+as[0]+"/d"+as[1]},partial_derivative_leibniz:function(as){return"∂"+as[0]+"/∂"+as[1]},"|":function(as){return as[0]+" | "+as[1]},":":function(as){return as[0]+" : "+as[1]},binom:function(as){return"binom( "+as[0]+", "+as[1]+" )"},vec:function(as){return"vec("+as[0]+")"},linesegment:function(as){return"linesegment( "+as.join(", ")+" )"},angle:function(as,rs){return rs?"angle "+as.join(""):"angle( "+as.join(", ")+" )"},unit:function(as){return as[0]+" "+as[1]}},output_unicodeDefault=!0;class astToText$2{constructor({output_unicode:rs=output_unicodeDefault,padToDigits:ns=null,padToDecimals:ss=null,showBlanks:os=!0}={}){this.output_unicode=rs,this.operators=unicode_operators,rs||(this.operators=nonunicode_operators),this.padToDigits=ns,this.padToDecimals=ss,this.showBlanks=os}convert(rs){return this.statement(rs)}statement(rs){if(!Array.isArray(rs))return this.single_statement(rs);let ns=rs[0],ss=rs.slice(1);if(ns==="ldots")return"...";if(!(ns in this.operators)&&ns!=="apply")throw new Error("Badly formed ast: operator "+ns+" not recognized.");return ns==="and"||ns==="or"?this.operators[ns](ss.map(function(os,ls){let us=this.single_statement(os);return us.match(/ /)&&!us.match(/^\(.*\)$/)?"("+us+")":us}.bind(this))):this.single_statement(rs)}single_statement(rs){if(!Array.isArray(rs))return this.expression(rs);let ns=rs[0],ss=rs.slice(1);if(ns==="not")return this.operators[ns](ss.map(function(os,ls){let us=this.single_statement(os);return us.match(/ /)&&!us.match(/^\(.*\)$/)?"("+us+")":us}.bind(this)));if(ns==="exists"||ns==="forall")return this.operators[ns]([this.single_statement(ss[0])]);if(ns==="="||ns==="ne"||ns==="<"||ns===">"||ns==="le"||ns==="ge"||ns==="in"||ns==="notin"||ns==="ni"||ns==="notni"||ns==="subset"||ns==="notsubset"||ns==="subseteq"||ns==="notsubseteq"||ns==="superset"||ns==="notsuperset"||ns==="superseteq"||ns==="notsuperseteq")return this.operators[ns](ss.map(function(os,ls){return this.expression(os)}.bind(this)));if(ns==="lts"||ns==="gts"){let os=ss[0],ls=ss[1];if(os[0]!=="tuple"||ls[0]!=="tuple")throw new Error("Badly formed ast");let us=this.expression(os[1]);for(let cs=1;cs ":ns==="lts"?this.output_unicode?us+=" ≤ ":us+=" <= ":this.output_unicode?us+=" ≥ ":us+=" >= ",us+=this.expression(os[cs+1]);return us}return this.expression(rs)}expression(rs){if(!Array.isArray(rs))return this.term(rs);let ns=rs[0],ss=rs.slice(1);return ns==="+"?ss.length===1?"+"+this.term(ss[0]):this.operators[ns](ss.map(function(os,ls){return ls>0?this.termWithPlusIfNotNegated(os):this.term(os)}.bind(this))):["union","intersect","perp","parallel"].includes(ns)?this.operators[ns](ss.map(function(os,ls){return this.term(os)}.bind(this))):this.term(rs)}term(rs){if(!Array.isArray(rs))return this.factor(rs);let ns=rs[0],ss=rs.slice(1);if(ns==="-")return this.operators[ns](ss.map(function(os,ls){return this.term(os)}.bind(this)));if(ns==="*")return this.operators[ns](ss.map(function(os,ls){let us;return ls>0?(us=this.factorWithParenthesesIfNegatedOrExplicitPlus(os),us.match(/^[0-9]/)?"* "+us:os[0]==="angle"&&ss.length>1?"( "+us+" )":us):(us=this.factor(os),os[0]==="angle"&&ss.length>1?"( "+us+" )":us)}.bind(this)));if(ns==="/"){let os=this.factor(ss[0]),ls=this.factor(ss[1]);return this.simple_factor_or_function_or_parens(ss[0])||(os="("+os+")"),this.simple_factor_or_function_or_parens(ss[1])||(ls="("+ls+")"),this.operators[ns]([os,ls])}return ns==="unit"?this.operators[ns](ss.map(function(os,ls){return this.expression(os)}.bind(this))):this.factor(rs)}symbolConvert(rs){let ns={alpha:"α",beta:"β",Gamma:"Γ",gamma:"γ",Delta:"Δ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",Theta:"ϴ",theta:"θ",iota:"ι",kappa:"κ",Lambda:"Λ",lambda:"λ",mu:"μ",nu:"ν",Xi:"Ξ",xi:"ξ",Pi:"Π",pi:"π",rho:"ρ",Sigma:"Σ",sigma:"σ",tau:"τ",Upsilon:"Υ",upsilon:"υ",Phi:"Φ",phi:"ϕ",Psi:"Ψ",psi:"ψ",Omega:"Ω",omega:"ω",perp:"⟂",int:"∫"};return this.output_unicode&&rs in ns?ns[rs]:this.showBlanks||rs!=="_"?rs:""}simple_factor_or_function_or_parens(rs){let ns=this.factor(rs);return!!(ns.length<=1||typeof rs=="string"&&rs.match(/^\w+$/)||Array.isArray(rs)&&rs[0]==="apply"||ns.match(/^\(.*\)$/)||ns.match(/^⟨.*⟩$/))||typeof rs=="number"&&rs>=0&&!rs.toString().includes("e")}factor(rs){if(typeof rs=="string")return this.symbolConvert(rs);if(typeof rs=="number"){if(rs===1/0)return this.output_unicode?"∞":"infinity";if(rs===-1/0)return this.output_unicode?"-∞":"-infinity";if(Number.isNaN(rs))return"NaN";{let os=rs.toString(),ls=os.indexOf("e");if(ls===-1)return this.padToDigits!==null?os=padNumberStringToDigits(os,this.padToDigits):this.padToDecimals!==null&&(os=padNumberStringToDecimals(os,this.padToDecimals)),os;let us=os.substring(0,ls),cs=os.substring(ls+1);if(this.padToDigits!==null)us=padNumberStringToDigits(us,this.padToDigits);else if(this.padToDecimals!==null){let ds=Number(cs);if(ds>0)return os=rs.toLocaleString("fullwide",{useGrouping:!1}),padNumberStringToDecimals(os,this.padToDecimals);us=padNumberStringToDecimals(us,this.padToDecimals+ds)}return cs[0]==="+"?us+" * 10^"+cs.substring(1):us+" * 10^("+cs+")"}}if(!Array.isArray(rs))return"";let ns=rs[0],ss=rs.slice(1);if(ns==="^"){if(Number.isInteger(ss[0])&&Number.isInteger(ss[1])){let cs;return cs=ss[0]<0?"("+ss[0].toString()+")":ss[0].toString(),ss[1]<0?cs+"^("+ss[1].toString()+")":cs+"^"+ss[1].toString()}let os=this.factor(ss[0]),ls=ss[0];for(;ls[0]==="prime";)ls=ls[1];this.simple_factor_or_function_or_parens(ls)||ls[0]==="_"&&typeof ls[1]=="string"||(os="("+os.toString()+")");let us=this.factor(ss[1]);return this.simple_factor_or_function_or_parens(ss[1])||(us="("+us.toString()+")"),os+"^"+us}if(ns==="_")return this.operators[ns](ss.map(function(os,ls){let us=this.factor(os);return this.simple_factor_or_function_or_parens(os)?us:"("+us+")"}.bind(this)));if(ns==="prime"){let os=ss[0],ls=1;for(;os[0]==="prime";)ls+=1,os=os[1];let us=this.factor(os);this.simple_factor_or_function_or_parens(os)||os[0]==="_"&&typeof os[1]=="string"||(us="("+us+")");for(let cs=0;cs1&&(ps=ps+"^"+cs),ps=ps+this.symbolConvert(ds)+"/";let fs=1;Array.isArray(us)&&(fs=us.length-1);for(let hs=1;hs<=fs;hs++){let gs=us[hs],ys=1,bs="";Array.isArray(gs)?(bs=gs[1],ys=gs[2]):bs=gs,ps=ps+os+this.symbolConvert(bs),ys>1&&(ps=ps+"^"+ys)}return ps}if(ns==="apply"){if(ss[0]==="abs")return"|"+this.statement(ss[1])+"|";if(ss[0]==="factorial"){let cs=this.factor(ss[1]);return this.simple_factor_or_function_or_parens(ss[1])||ss[1][0]==="_"&&typeof ss[1][1]=="string"?cs+"!":"("+cs+")!"}let os=ss[0];if(os[0]==="^"&&(os=os[1]),os[0]==="_"&&(os=os[1]),os==="int"){let cs,ds=this.factor(ss[0]),ps=ss[1];if(Array.isArray(ps)&&ps[0]==="*"){let fs=[],hs=["*"];for(let gs=1;gs0&&(cs+=" "+fs.map(gs=>"d"+this.factor(gs[1])).join(" "))}return cs||(cs=this.term(ss[1])),ds+" "+cs}let ls=this.factor(ss[0]),us=this.statement(ss[1]);return ss[1][0]!=="tuple"&&(us="("+us+")"),ls+us}if(ns==="angle"){let os=ss.every(ls=>{if(typeof ls=="string"&&ls.length===1)return!0;if(!Array.isArray(ls))return!1;let us=ls[0];return us==="_"||us==="^"||us==="prime"});return this.operators[ns](ss.map(function(ls,us){return this.statement(ls)}.bind(this)),os)}return ns==="+"&&rs.length===2?"+ "+this.factor(rs[1]):"("+this.statement(rs)+")"}factorWithParenthesesIfNegatedOrExplicitPlus(rs){var ns=this.factor(rs);return ns.match(/^-/)||ns.match(/^\+/)?"("+ns+")":ns}termWithPlusIfNotNegated(rs){let ns=this.term(rs);return ns.match(/^-/)?ns.match(/^-[^ ]/)?"- "+ns.slice(1):ns:"+ "+ns}}var astToText$1=new astToText$2;function subscripts_to_strings(as,rs=!1){var ns=get_tree(as);if(!Array.isArray(ns))return ns;let ss=ns[0],os=ns.slice(1);return ss==="_"&&(rs||os.every(ls=>["number","string"].includes(typeof ls)))?astToText$1.convert(ns):[ss].concat(os.map(ls=>subscripts_to_strings(ls,rs)))}function strings_to_subscripts(as){var rs=get_tree(as);if(typeof rs=="string"){let os=rs.match(/^([0-9a-zA-Z]+)_([a-zA-Z]+|[0-9]+)$/);if(os){let ls=Number(os[1]);isNaN(ls)&&(ls=os[1]);let us=Number(os[2]);return isNaN(us)&&(us=os[2]),["_",ls,us]}return rs}if(!Array.isArray(rs))return rs;let ns=rs[0],ss=rs.slice(1);return[ns].concat(ss.map(strings_to_subscripts))}var normalization=Object.freeze({__proto__:null,normalize_function_names,normalize_applied_functions,log_subscript_to_two_arg_log,substitute_abs,default_order,constants_to_floats,normalize_angle_linesegment_arg_order,tuples_to_vectors,to_intervals,altvectors_to_vectors,subscripts_to_strings,strings_to_subscripts}),astToText=new astToText$2;function generate_random_integer(as,rs,ns){return as=math$1.ceil(as),rs=math$1.floor(rs),math$1.floor(ns()*(rs-as+1))+as}const equals$5=function({expr:as,other:rs,randomBindings:ns,expr_context:ss,other_context:os,relative_tolerance:ls=1e-12,absolute_tolerance:us=0,tolerance_for_zero:cs=1e-15,allowed_error_in_numbers:ds=0,include_error_in_number_exponents:ps=!1,allowed_error_is_absolute:fs=!1,rng:hs}){if(Array.isArray(as.tree)&&Array.isArray(rs.tree)){let gs=as.tree[0],ys=as.tree.slice(1),bs=rs.tree[0],vs=rs.tree.slice(1);if(gs==="tuple"||gs==="vector"||gs==="altvector"||gs==="list"||gs==="array"||gs==="matrix"||gs==="interval"){if(bs!==gs||vs.length!==ys.length)return!1;for(let xs=0;xs","<","ge","le"].includes(gs)){if(vs.length!==2||(gs===">"?(gs="<",ys=[ys[1],ys[0]]):gs==="ge"&&(gs="le",ys=[ys[1],ys[0]]),bs===">"?(bs="<",vs=[vs[1],vs[0]]):bs==="ge"&&(bs="le",vs=[vs[1],vs[0]]),gs!==bs))return!1;let xs=["+",ys[0],["-",ys[1]]],Cs=["+",vs[0],["-",vs[1]]],Ts=gs!=="=";return component_equals({expr:ss.fromAst(xs),other:os.fromAst(Cs),randomBindings:ns,expr_context:ss,other_context:os,allow_proportional:!0,require_positive_proportion:Ts,relative_tolerance:ls,absolute_tolerance:us,tolerance_for_zero:cs,allowed_error_in_numbers:ds,include_error_in_number_exponents:ps,allowed_error_is_absolute:fs,rng:hs})}}return component_equals({expr:as,other:rs,randomBindings:ns,expr_context:ss,other_context:os,relative_tolerance:ls,absolute_tolerance:us,tolerance_for_zero:cs,allowed_error_in_numbers:ds,include_error_in_number_exponents:ps,allowed_error_is_absolute:fs,rng:hs})},component_equals=function({expr:as,other:rs,randomBindings:ns,expr_context:ss,other_context:os,allow_proportional:ls=!1,require_positive_proportion:us=!1,relative_tolerance:cs,absolute_tolerance:ds,tolerance_for_zero:ps,allowed_error_in_numbers:fs,include_error_in_number_exponents:hs,allowed_error_is_absolute:gs,rng:ys}){var bs=1e-20*Number.MAX_VALUE,vs=0,xs=10;as=as.normalize_function_names(),rs=rs.normalize_function_names(),as=as.log_subscript_to_two_arg_log(),rs=rs.log_subscript_to_two_arg_log(),as=as.subscripts_to_strings(),rs=rs.subscripts_to_strings(),as=as.normalize_applied_functions(),rs=rs.normalize_applied_functions();let Cs=rename_functions_with_exponents(as.tree),Ts=rename_functions_with_exponents(rs.tree);as=ss.fromAst(rename_vecs(Cs)),rs=os.fromAst(rename_vecs(Ts));var Ss=[...new Set([...as.variables(),...rs.variables()])];math$1.define_pi&&(Ss=Ss.filter(function(Us){return Us!=="pi"})),math$1.define_i&&(Ss=Ss.filter(function(Us){return Us!=="i"})),math$1.define_e&&(Ss=Ss.filter(function(Us){return Us!=="e"}));var Ns=[];for(let Us=0;UsUs.length===1||Us.includes("_")||Us.includes("^")),ws=As.filter(Us=>Ss.includes(Us));if(As=As.filter(Us=>!Ss.includes(Us)),ws.length>0){let Us=as.tree,js=rs.tree,Ls="x1";for(;[...As,...Ss].includes(Ls);)Ls+="x1";let Gs="x2";for(;[...As,...Ss].includes(Gs);)Gs+="x2";for(let Hs of ws){let Ys=Hs+Hs;for(;[...As,...Ss].includes(Ys);)Ys+=Hs;let Zs=[[["apply",Hs,Ls],["apply",Ys,Ls],{variables:{[Ls]:!0}}]];Us=applyAllTransformations(Us,Zs),js=applyAllTransformations(js,Zs),As.push(Ys)}as=ss.fromAst(Us),rs=os.fromAst(js)}try{var Es=as.f(),_s=rs.f()}catch{return as.equalsViaSyntax(rs,{allow_blanks:!0})}let $s,Rs,Ds;if(fs>0){let Us=replace_numbers_with_parameters({expr:as,variables:Ss,include_exponents:hs});$s=ss.fromAst(Us.expr_with_params),Rs=Us.parameters;let js=Object.keys(Rs);if(js.length>0){let Ls=$s.derivative(js[0]);if(gs||(Ls=Ls.multiply(Rs[js[0]])),js.length>1)for(let Hs of js.slice(1)){let Ys=$s.derivative(Hs);gs||(Ys=Ys.multiply(Rs[Hs])),Ls=Ls.add(Ys)}let Gs=Ls.multiply(fs);try{Ds=Gs.f()}catch{}}}var Os=1,Is=[10,1,100,.1,1e3,.01],Vs=0;let ks=0,Ps=!0,Bs=0;for(let Us=0;Us<1e3;Us++){try{var Ms=Ws(Is[Vs],ys)}catch{continue}if(Ms.always_zero===!1&&(Ps=!1),!Ms.equal&&!Ms.out_of_bounds&&!Ms.always_zero&&Ms.sufficient_finite_values!==!1&&(Bs++,Bs>100))return!1;if(Ms.equal){if(Ms.always_zero){if(!Ps)continue;if(ks+=1,ks>5&&(Vs+=1,ks=0),Vs>=Is.length)return!0;continue}return!0}}return!1;function Ws(Us,js){var Ls,Gs=ns(js,Ss,Us);for(let El=0;Elvs)||!(Nl===0||Nl>vs))return{out_of_bounds:!0,always_zero:!1};var yl=Math.min(Zs,Nl),Dl=Math.max(Zs,Nl),Rl=1;let Ml=0;if(Ds){try{Ml=math$1.abs(Ds(Ls))}catch{return{equal_at_start:!1,always_zero:!1}}if(!Number.isFinite(Ml))return{equal_at_start:!1,always_zero:!1}}if(Ml+=yl*cs,Ml=Math.min(Ml,.1*yl),Ml+=Ml!==0||Hs!==0&&Ys!==0?ds:ps,!(Dl===0||math$1.abs(math$1.subtract(Hs,Ys))0))return{equal_at_start:!1,always_zero:!1}}var Ks=Dl===0,qs=0;for(let El=0;El<100;El++){var Qs,Js=ns(js,Ss,Os/100,Gs);for(let _l=0;_l=xs)return{equal:!0,always_zero:Ks}}}return{sufficient_finite_values:!1,always_zero:Ks}}};function replace_numbers_with_parameters({expr:as,variables:rs,include_exponents:ns=!1}){let ss={},os=0;function ls(){os++;let us="par"+os;for(;rs.includes(us);)os++,us="par"+os;return us}return{expr_with_params:function us(cs){if(typeof cs=="number"){if(cs===0)return cs;{let fs=ls();return ss[fs]=cs,fs}}if(typeof cs=="string"){if(cs==="pi"){if(math$1.define_pi){let fs=ls();return ss[fs]=math$1.PI,fs}}else if(cs==="e"&&math$1.define_e){let fs=ls();return ss[fs]=math$1.e,fs}return cs}if(!Array.isArray(cs))return cs;let ds=cs[0],ps=cs.slice(1);return ds!=="^"||ns?[ds,...ps.map(us)]:[ds,us(ps[0]),ps[1]]}((as=as.evaluate_numbers({max_digits:1/0})).tree),parameters:ss}}function rename_functions_with_exponents(as){if(!Array.isArray(as))return as;let rs=as[0],ns=as.slice(1);if(rs==="apply"){let ss=ns[0];return Array.isArray(ss)&&ss[0]==="^"&&ss.slice(1).every(os=>["number","string"].includes(typeof os))&&(ss=astToText.convert(ss)),["apply",ss,ns[1]]}return[rs,...ns.map(rename_functions_with_exponents)]}function rename_vecs(as){if(!Array.isArray(as))return as;let rs=as[0],ns=as.slice(1);return rs==="vec"&&ns.length===1?"__vec_"+astToText.convert(ns[0]):[rs,...ns.map(rename_vecs)]}function randomComplexBindings(as,rs,ns,ss){var os={};return ss===void 0?rs.forEach(function(ls){os[ls]=math$1.complex(2*as()*ns-ns,2*as()*ns-ns)}):rs.forEach(function(ls){os[ls]=math$1.complex(ss[ls].re+2*as()*ns-ns,ss[ls].im+2*as()*ns-ns)}),os}const equals$4=function(as,rs,{relative_tolerance:ns=1e-12,absolute_tolerance:ss=0,tolerance_for_zero:os=1e-15,allowed_error_in_numbers:ls=0,include_error_in_number_exponents:us=!1,allowed_error_is_absolute:cs=!1,allow_blanks:ds=!1}={}){if(!ds&&(as.variables().includes("_")||rs.variables().includes("_")))return!1;let ps=seedrandom$1("complex_seed");return as=as.remove_scaling_units(),rs=rs.remove_scaling_units(),!(!as.isAnalytic({allow_abs:!0,allow_arg:!0,allow_relation:!0})||!rs.isAnalytic({allow_abs:!0,allow_arg:!0,allow_relation:!0}))&&equals$5({expr:as,other:rs,randomBindings:randomComplexBindings,expr_context:as.context,other_context:rs.context,relative_tolerance:ns,absolute_tolerance:ss,tolerance_for_zero:os,allowed_error_in_numbers:ls,include_error_in_number_exponents:us,allowed_error_is_absolute:cs,rng:ps})};function randomRealBindings(as,rs,ns,ss){var os={};return ss===void 0?rs.forEach(function(ls){os[ls]=2*as()*ns-ns}):rs.forEach(function(ls){os[ls]=ss[ls]+2*as()*ns-ns}),os}const equals$3=function(as,rs,{relative_tolerance:ns=1e-12,absolute_tolerance:ss=0,tolerance_for_zero:os=1e-15,allowed_error_in_numbers:ls=0,include_error_in_number_exponents:us=!1,allowed_error_is_absolute:cs=!1}={}){if(!as.isAnalytic()||!rs.isAnalytic())return!1;let ds=seedrandom("real_seed");return equals$5({expr:as,other:rs,randomBindings:randomRealBindings,expr_context:as.context,other_content:rs.context,relative_tolerance:ns,absolute_tolerance:ss,tolerance_for_zero:os,allowed_error_in_numbers:ls,include_error_in_number_exponents:us,allowed_error_is_absolute:cs,rng:ds})},equals$2=function(as,rs,{allowed_error_in_numbers:ns=0,include_error_in_number_exponents:ss=!1,allowed_error_is_absolute:os=!1,allow_blanks:ls=!1}={}){if(!ls&&(as.variables().includes("_")||rs.variables().includes("_")))return!1;let us=as.normalize_function_names().normalize_applied_functions().normalize_angle_linesegment_arg_order(),cs=rs.normalize_function_names().normalize_applied_functions().normalize_angle_linesegment_arg_order();return equal$2(us.tree,cs.tree,{allowed_error_in_numbers:ns,include_error_in_number_exponents:ss,allowed_error_is_absolute:os})},equals$1=function(as,rs,{min_elements_match:ns=3,match_partial:ss=!1}={}){if(!is_discrete_infinite_set(as))return!1;if(is_discrete_infinite_set(rs)){var os=[];let ls=as.context.get_assumptions(as);if(ls!==void 0&&os.push(ls),ls=rs.context.get_assumptions(rs),ls!==void 0&&os.push(ls),os=os.length===0?void 0:os.length===1?os[0]:clean_assumptions(["and"].concat(os)),ss){let us=contained_in$1(as.tree,rs.tree,os,ss);if(us===!1)return 0;let cs=contained_in$1(rs.tree,as.tree,os,ss);return cs===!1?0:us===!0?cs===!0?1:cs:cs===!0?us:Math.min(us,cs)}return contained_in$1(as.tree,rs.tree,os,ss)&&contained_in$1(rs.tree,as.tree,os,ss)}{let ls=rs.tree;if(ls[0]!=="list")return!1;let us=ls.length-2;if(ls[us+1][0]!=="ldots"||uscontained_in$1(gs,rs,ns))}var os=as[1],ls=as[2],us=as[3],cs=as[4];if(!Array.isArray(us)||us[0]!=="-"||us[1]!==1/0||cs!==1/0)return!1;os=simplify(["/",os,ls],ns,1/0);var ds=rs.slice(1),ps=[];for(let gs=0;gsgs[0]))];let hs=0;for(let gs of fs){let ys=ps.map(function(vs,xs){let Cs=gs/vs[0];return Number.isInteger(Cs)?[vs[0],Cs,xs]:void 0}).filter(vs=>vs),bs=[];for(let vs of ys){let xs=vs[0],Cs=vs[1],Ts=vs[2],Ss=ps[Ts][2],Ns=ps[Ts][3];for(let As=0;Ashs&&(hs=vs)}}return!!(ss&&hs>0)&&hs}function sequence_from_discrete_infinite(as,rs){var ns=as.tree.slice(1);if(ns.length>1)return;let ss=ns[0][1],os=ns[0][2],ls=evaluate_numbers(ns[0][3]),us=ns[0][4];if(!Number.isInteger(ls)||us!==1/0)return;let cs=[];for(let ds=0;ds0))throw Error(`Have not implemented equality check with ${ss} sign errors.`);if(ss>1){let fs=ns;ns=function(hs,gs){return equalSpecifiedSignErrors(hs,gs,{equalityFunction:fs,n_sign_errors:ss-1})}}var os,ls,us=as.tree,cs=[[us]],ds=0;as.tree=["-",us];var ps=ns(as,rs);if(as.tree=us,ps)return!0;for(;os=cs[ds++];)if(os=os[0],Array.isArray(os)){for(ls=1;ls"];function isAnalytic(as,{allow_abs:rs=!1,allow_arg:ns=!1,allow_relation:ss=!1}={}){var os=normalize_applied_functions(normalize_function_names(as)),ls=operators$3(os=subscripts_to_strings(os));for(let cs=0;cs+")},"-":function(rs){return"-"+rs.join("-")+""},"*":function(rs){return rs.join('\\cdot*')},"/":function(rs){return astToGuppy$1.dfrac(rs[0],rs[1])},"^":function(rs){return astToGuppy$1.power(rs[0],rs[1])},sin:function(rs){return astToGuppy$1.trig("sin",rs[0])},cos:function(rs){return astToGuppy$1.trig("cos",rs[0])},tan:function(rs){return astToGuppy$1.trig("tan",rs[0])},arcsin:function(rs){return astToGuppy$1.trig("arcsin",rs[0])},arccos:function(rs){return astToGuppy$1.trig("arccos",rs[0])},arctan:function(rs){return astToGuppy$1.trig("arctan",rs[0])},arccsc:function(rs){return astToGuppy$1.trig("arccsc",rs[0])},arcsec:function(rs){return astToGuppy$1.trig("arcsec",rs[0])},arccot:function(rs){return astToGuppy$1.trig("arccot",rs[0])},csc:function(rs){return astToGuppy$1.trig("csc",rs[0])},sec:function(rs){return astToGuppy$1.trig("sec",rs[0])},cot:function(rs){return astToGuppy$1.trig("cot",rs[0])},log:function(rs){return astToGuppy$1.trig("log",rs[0])},exp:function(rs){return astToGuppy$1.trig("exp",rs[0])},ln:function(rs){return astToGuppy$1.trig("ln",rs[0])},sqrt:function(rs){return astToGuppy$1.sqrt(rs[0])},abs:function(rs){return astToGuppy$1.abs(rs[0])}}}static dfrac(rs,ns){return'\\dfrac{}{}\\frac{}{}()/()'+rs+''+ns+""}static trig(rs,ns){return'\\'+rs+'\\left(\\right) '+rs+'()'+ns+""}static sqrt(rs){return'\\sqrt{}sqrt()'+rs+""}static power(rs,ns){return'{}^{}()^()'+rs+''+ns+""}static abs(rs){return'\\left|\\right|abs()'+rs+""}static paren(rs){return'\\left(\\right)()'+rs+""}static isFunctionSymbol(rs){return["sin","cos","tan","csc","sec","cot","arcsin","arccos","arctan","arccsc","arcsec","arccot","log","ln","exp","sqrt","abs","this.factorial"].indexOf(rs)!==-1}static isGreekLetterSymbol(rs){return["pi","theta","theta","Theta","alpha","nu","beta","xi","Xi","gamma","Gamma","delta","Delta","pi","Pi","epsilon","epsilon","rho","rho","zeta","sigma","Sigma","eta","tau","upsilon","Upsilon","iota","phi","phi","Phi","kappa","chi","lambda","Lambda","psi","Psi","omega","Omega"].indexOf(rs)!==-1}factorWithParenthesesIfNegated(rs){var ns=this.factor(rs);return ns.toString().match(/^-/)?astToGuppy$1.paren(ns.toString()):ns}factor(rs){if(typeof rs=="string")return astToGuppy$1.isGreekLetterSymbol(rs)?'\\'+rs+' $'+rs+"":""+rs+"";if(typeof rs=="number")return""+rs+"";if(!Array.isArray(rs))return"";var ns=rs[0],ss=rs.slice(1);return ns==="apply"&&(ns=rs[1],ss=rs.slice(2)),ns==="abs"?this.operators[ns](ss.map(function(os,ls){return this.expression(os)}.bind(this))):astToGuppy$1.isFunctionSymbol(ns)?ns!=="this.factorial"||ss[0].toString().length!==1&&!ss[0].toString().match(/^[0-9]*$/)?this.operators[ns](ss.map(function(os,ls){return this.factor(os)}.bind(this))):this.operators[ns](ss):ns==="^"||ns==="~"?this.operators[ns](ss.map(function(os,ls){return this.factor(os)}.bind(this))):astToGuppy$1.paren(this.expression(rs))}term(rs){if(!Array.isArray(rs))return this.factor(rs);var ns=rs[0],ss=rs.slice(1);return ns==="*"?this.operators[ns](ss.map(function(os,ls){var us=this.factorWithParenthesesIfNegated(os);return us.toString().match(/^[0-9]/)&&ls>0?" * "+us:us}.bind(this))):ns==="/"?this.operators[ns](ss.map(function(os,ls){return this.factor(os)}.bind(this))):this.factor(rs)}expression(rs){if(!Array.isArray(rs))return this.term(rs);var ns=rs[0],ss=rs.slice(1);return ns==="+"||ns==="-"?this.operators[ns](ss.map(function(os,ls){return this.factorWithParenthesesIfNegated(os)}.bind(this))):this.term(rs)}convert(rs){return(""+this.expression(rs)+"").replace(/<\/e>/g,"")}}const glslOperators={"+":function(as){var rs=as[0];return as.slice(1).forEach(function(ns){rs=rs+"+"+ns}),rs},"-":function(as){var rs="-"+as[0];return as.slice(1).forEach(function(ns){rs=rs+"-"+ns}),rs},"~":function(as){var rs="vec2(0.0,0.0)";return as.forEach(function(ns){rs=rs+"-"+ns}),rs},"*":function(as){var rs=as[0];return as.slice(1).forEach(function(ns){rs="cmul("+rs+","+ns+")"}),rs},"/":function(as){var rs=as[0];return as.slice(1).forEach(function(ns){rs="cdiv("+rs+","+ns+")"}),rs},sin:function(as){return"csin("+as[0]+")"},cos:function(as){return"ccos("+as[0]+")"},tan:function(as){return"ctan("+as[0]+")"},sinh:function(as){return"csinh("+as[0]+")"},cosh:function(as){return"ccosh("+as[0]+")"},arcsin:function(as){return"carcsin("+as[0]+")"},arccos:function(as){return"carccos("+as[0]+")"},arctan:function(as){return"carctan("+as[0]+")"},arccsc:function(as){return"carcsin(cdiv(vec2(1.0,0),"+as[0]+"))"},arcsec:function(as){return"carccos(cdiv(vec2(1.0,0),"+as[0]+"))"},arccot:function(as){return"carctan(cdiv(vec2(1.0,0),"+as[0]+"))"},csc:function(as){return"ccsc("+as[0]+")"},sec:function(as){return"csec("+as[0]+")"},cot:function(as){return"ccot("+as[0]+")"},exp:function(as){return"cexp("+as[0]+")"},conj:function(as){return"conjugate("+as[0]+")"},sqrt:function(as){return"cpower("+as[0]+",vec2(0.5,0.0))"},log:function(as){return"clog("+as[0]+")"},ln:function(as){return"clog("+as[0]+")"},"^":function(as){return"cpower("+as[0]+","+as[1]+")"},abs:function(as){return"cabs("+as[0]+")"},apply:function(as){return"vec2(NaN,NaN)"}};class astToGLSL$1{constructor(){}convert(rs){if(typeof rs=="boolean")throw Error("no support for boolean");if(typeof rs=="string")return rs==="e"?"vec2(2.71828182845905,0.0)":rs==="pi"?"vec2(3.14159265358979,0.0)":rs==="i"?"vec2(0.0,1.0)":String(rs);if(typeof rs=="number")return"vec2("+String(rs)+",0.0)";if("real"in rs&&"imaginary"in rs)return rs;if(!Array.isArray(rs))throw Error("Invalid ast");var ns=rs[0],ss=rs.slice(1);if(ns==="apply"){if(typeof ss[0]!="string")throw Error("Non string functions not implemented for conversion to GLSL");return ns=ss[0],ss=ss.slice(1),glslOperators[ns](ss.map(function(os,ls){return this.convert(os)}.bind(this)))}if(ns in glslOperators)return glslOperators[ns](ss.map(function(os,ls){return this.convert(os)}.bind(this)));throw Error("Operator "+ns+" not implemented for conversion to mathjs")}}var astToGuppy=new astToGuppy$1,astToGLSL=new astToGLSL$1;const tex=function(as,rs){return new astToLatex$1(rs).convert(as.tree)},toLatex=tex,toString=function(as,rs){return new astToText$2(rs).convert(as.tree)},toGLSL=function(as){return astToGLSL.convert(as.tree)},toXML=function(as){return astToGuppy.convert(as.tree)};var printing=Object.freeze({__proto__:null,tex,toLatex,toString,toXML,toGLSL});const integrateNumerically=function(as,rs,ns,ss){for(var os=0,ls={},us=0;us<100;us++){var cs=ns+(ss-ns)*(us+.5)/100;ls[rs]=cs,os+=as.evaluate(ls)}return os*(ss-ns)/100};var integration=Object.freeze({__proto__:null,integrateNumerically});function expression_to_polynomial(as){var rs=get_tree(as);if(typeof rs=="string")return rs==="pi"&&math$1.define_pi||rs==="i"&&math$1.define_i||rs==="e"&&math$1.define_e?rs:["polynomial",rs,[[1,1]]];if(typeof rs=="number")return rs;let ns=evaluate_to_constant(rs,!1);if(ns!==null&&Number.isFinite(ns))return simplify(rs);if(!Array.isArray(rs)||!operators$3(rs).every(ds=>["+","-","*","^","/","_","prime"].includes(ds)))return!1;var ss=rs[0],os=rs.slice(1);if(ss==="+"){let ds=os.map(expression_to_polynomial);return!!ds.every(ps=>ps!==!1)&&ds.reduce((ps,fs)=>polynomial_add(ps,fs))}if(ss==="-"){let ds=expression_to_polynomial(os[0]);return!!ds&&polynomial_neg(ds)}if(ss==="*"){let ds=os.map(expression_to_polynomial);return!!ds.every(ps=>ps!==!1)&&ds.reduce((ps,fs)=>polynomial_mul(ps,fs))}if(ss==="^"){let ds=os[0],ps=expression_to_polynomial(ds);if(ps===!1)return!1;let fs=simplify(os[1]);if(typeof fs!="number"||fs<0||!Number.isInteger(fs)){let hs=evaluate_to_constant(fs,!1);if(hs!==null||Number.isFinite(hs)){let gs=math$1.fraction(hs);if(gs.d<=100){ds=gs.s<0?["^",ds,["/",-1,gs.d]]:["^",ds,["/",1,gs.d]];var ls=["polynomial",simplify(ds),[]];return ls[2].push([gs.n,1]),ls}}return["polynomial",rs,[[1,1]]]}return fs===0?1:fs===1?ps:polynomial_pow(ps,fs)}if(ss==="/"){var us=os[1],cs=evaluate_to_constant(us,!1);return cs!==null&&Number.isFinite(cs)?polynomial_mul(expression_to_polynomial(os[0]),["/",1,cs]):["polynomial",rs,[[1,1]]]}return["polynomial",rs,[[1,1]]]}function polynomials_in_same_leading_variable(as,rs){return as[1]!==rs[1]&&(compare_function(as[1],rs[1])<0?rs=["polynomial",as[1],[[0,rs]]]:as=["polynomial",rs[1],[[0,as]]]),[as,rs]}function polynomial_add(as,rs){if(as[0]!=="polynomial"){if(rs[0]!=="polynomial")return simplify(["+",as,rs]);as=["polynomial",rs[1],[[0,as]]]}else if(rs[0]!=="polynomial")rs=["polynomial",as[1],[[0,rs]]];else{let fs=polynomials_in_same_leading_variable(as,rs);as=fs[0],rs=fs[1]}let ns=["polynomial",as[1],[]],ss=as[2],os=rs[2],ls=ns[2],us=ss.length,cs=os.length,ds=0,ps=0;for(;ds0;)1&rs&&(ns=polynomial_mul(ns,as)),as=polynomial_mul(as,as),rs>>=1;return ns}function polynomial_to_expression(as){if(!Array.isArray(as)||as[0]!=="polynomial")return as;let rs=as[1],ns=as[2],ss=[],os=ns.length;for(var ls=0;lsss[cs][1])return!1}return os!==ls&&us!==ls}function mono_gcd(as,rs){if(!Array.isArray(as)||!Array.isArray(rs)||as[0]!=="monomial"||rs[0]!=="monomial")return 1;let ns=as[2],ss=rs[2],os=[],ls=ns.length,us=ss.length,cs=0,ds=0;for(;cs1)flatten$2$1(cs,rs-1,ns,ss),os=ss.length;else for(var ds=0,ps=cs.length;dsrs?(ss&&(clearTimeout(ss),ss=null),cs=fs,us=as.apply(os,ls),ss||(os=ls=null)):ss||ns.trailing===!1||(ss=setTimeout(ds,hs)),us};return ps.cancel=function(){clearTimeout(ss),cs=0,ss=os=ls=null},ps}function debounce$1(as,rs,ns){var ss,os,ls,us,cs,ds=function(){var fs=now$1()-os;rs>fs?ss=setTimeout(ds,rs-fs):(ss=null,ns||(us=as.apply(cs,ls)),ss||(ls=cs=null))},ps=restArguments(function(fs){return cs=this,ls=fs,os=now$1(),ss||(ss=setTimeout(ds,rs),ns&&(us=as.apply(cs,ls))),us});return ps.cancel=function(){clearTimeout(ss),ss=ls=cs=null},ps}function wrap$1(as,rs){return partial(rs,as)}function negate$2(as){return function(){return!as.apply(this,arguments)}}function compose(){var as=arguments,rs=as.length-1;return function(){for(var ns=rs,ss=as[rs].apply(this,arguments);ns--;)ss=as[ns].call(this,ss);return ss}}function after(as,rs){return function(){if(--as<1)return rs.apply(this,arguments)}}function before(as,rs){var ns;return function(){return--as>0&&(ns=rs.apply(this,arguments)),as<=1&&(rs=null),ns}}var once$1=partial(before,2);function findKey(as,rs,ns){rs=cb(rs,ns);for(var ss,os=keys$3(as),ls=0,us=os.length;ls0?0:os-1;ls>=0&&ls0?us=ls>=0?ls:Math.max(ls+cs,us):cs=ls>=0?Math.min(ls+1,cs):ls+cs+1;else if(ns&&ls&&cs)return ss[ls=ns(ss,os)]===os?ls:-1;if(os!=os)return(ls=rs(slice$1.call(ss,us,cs),isNaN$1))>=0?ls+us:-1;for(ls=as>0?us:cs-1;ls>=0&&ls0?0:cs-1;for(ls||(os=ns[us?us[ds]:ds],ds+=as);ds>=0&&ds=3;return rs(ns,optimizeCb(ss,ls,4),os,us)}}var reduce$1=createReduce(1),reduceRight=createReduce(-1);function filter$3(as,rs,ns){var ss=[];return rs=cb(rs,ns),each(as,function(os,ls,us){rs(os,ls,us)&&ss.push(os)}),ss}function reject$1(as,rs,ns){return filter$3(as,negate$2(cb(rs)),ns)}function every$1(as,rs,ns){rs=cb(rs,ns);for(var ss=!isArrayLike(as)&&keys$3(as),os=(ss||as).length,ls=0;ls=0}var invoke=restArguments(function(as,rs,ns){var ss,os;return isFunction$1$1(rs)?os=rs:(rs=toPath(rs),ss=rs.slice(0,-1),rs=rs[rs.length-1]),map$3(as,function(ls){var us=os;if(!us){if(ss&&ss.length&&(ls=deepGet(ls,ss)),ls==null)return;us=ls[rs]}return us==null?us:us.apply(ls,ns)})});function pluck(as,rs){return map$3(as,property(rs))}function where(as,rs){return filter$3(as,matcher(rs))}function max$3(as,rs,ns){var ss,os,ls=-1/0,us=-1/0;if(rs==null||typeof rs=="number"&&typeof as[0]!="object"&&as!=null)for(var cs=0,ds=(as=isArrayLike(as)?as:values$2(as)).length;csls&&(ls=ss);else rs=cb(rs,ns),each(as,function(ps,fs,hs){((os=rs(ps,fs,hs))>us||os===-1/0&&ls===-1/0)&&(ls=ps,us=os)});return ls}function min$3(as,rs,ns){var ss,os,ls=1/0,us=1/0;if(rs==null||typeof rs=="number"&&typeof as[0]!="object"&&as!=null)for(var cs=0,ds=(as=isArrayLike(as)?as:values$2(as)).length;cscs||us===void 0)return 1;if(us1&&(ss=optimizeCb(ss,rs[1])),rs=allKeys(as)):(ss=keyInObj,rs=flatten$2$1(rs,!1,!1),as=Object(as));for(var os=0,ls=rs.length;os1&&(ns=rs[1])):(rs=map$3(flatten$2$1(rs,!1,!1),String),ss=function(os,ls){return!contains$3(rs,ls)}),pick$3(as,ss,ns)});function initial(as,rs,ns){return slice$1.call(as,0,Math.max(0,as.length-(rs==null||ns?1:rs)))}function first$2(as,rs,ns){return as==null||as.length<1?rs==null||ns?void 0:[]:rs==null||ns?as[0]:initial(as,as.length-rs)}function rest(as,rs,ns){return slice$1.call(as,rs==null||ns?1:rs)}function last$1(as,rs,ns){return as==null||as.length<1?rs==null||ns?void 0:[]:rs==null||ns?as[as.length-1]:rest(as,Math.max(0,as.length-rs))}function compact$2(as){return filter$3(as,Boolean)}function flatten$1$1(as,rs){return flatten$2$1(as,rs,!1)}var difference$1=restArguments(function(as,rs){return rs=flatten$2$1(rs,!0,!0),filter$3(as,function(ns){return!contains$3(rs,ns)})}),without=restArguments(function(as,rs){return difference$1(as,rs)});function uniq$1(as,rs,ns,ss){isBoolean$2(rs)||(ss=ns,ns=rs,rs=!1),ns!=null&&(ns=cb(ns,ss));for(var os=[],ls=[],us=0,cs=getLength(as);usps&&(ps=ns)):(ns>ps&&(ps=ns),ps*=fs),Math.abs(as-rs)<=ps}return as===rs}var ls=as[0],us=as.slice(1),cs=rs[0],ds=rs.slice(1);return ls!==cs||us.length!==ds.length?!1:ns>0&&!ss&&ls==="^"?!!equal$2(us[0],ds[0],{allowed_error_in_numbers:ns,include_error_in_number_exponents:ss,allowed_error_is_absolute:os})&&equal$2(us[1],ds[1]):_$2.every(_$2.zip(us,ds),function(ps){return equal$2(ps[0],ps[1],{allowed_error_in_numbers:ns,include_error_in_number_exponents:ss,allowed_error_is_absolute:os})})},match$2=function(as,rs,ns){var ss=!1;ns===void 0?ns={}:ns.allow_extended_match&&(ss=!0,delete(ns=Object.assign({},ns)).allow_extended_match);var os=ns.variables;if(os===void 0){os={};let ps=variables(rs);for(let fs=0;fsObject()),us=ns.length,cs=!1;function ds(hs,gs,ys){let bs,vs=1,xs=1;if((is_associative$1[as]||["tuple","vector","altvector"].includes(as))&&(vs=hs.length-(us-gs-1),xs=hs.length),ss.max_group!==void 0&&(vs=ss.max_group1?[as].concat(ws):ws[0],Ts=match$2(ws,ns[gs],ss),ls[gs][Cs]=Ts}if(!Ts||!_$2.every(_$2.intersection(Object.keys(ys),Object.keys(Ts)),function(ws){return equal$2(ys[ws],Ts[ws])}))continue;let Ss=Object.assign({},Ts);Object.assign(Ss,ys);let Ns=hs.filter(ws=>!Cs.includes(ws));if(gs===us-1)return{matches:Ss,skipped:Ns.reduce(function(ws,Es){return ws.concat([rs[Es]])},[])};let As=ds(Ns,gs+1,Ss);if(As)return As}return!1}ss.allow_permutations&&(as==="*"?cs=![...rs,...ns].some(hs=>["tuple","list","vector","altvector","interval","set","array","matrix"].includes(hs[0])):as!=="+"&&as!=="="&&as!=="and"&&as!=="or"&&as!=="ne"&&as!=="union"&&as!=="intersect"||(cs=!0));var ps={},fs=[...Array(rs.length).keys()];if(cs){let hs=ds(fs,0,{});return!!hs&&(ps=hs.matches,hs.skipped.length>0&&(ps._skipped=hs.skipped),ps)}{let hs,gs=os?rs.length-us:0,ys=[];for(let bs=0;bs<=gs&&(hs=ds(fs,0,{}),!hs);bs++)fs=fs.slice(1),ys.push(rs[bs]);return!!hs&&(ps=hs.matches,hs.skipped.length>0&&(ps._skipped=hs.skipped),ys.length>0&&(ps._skipped_before=ys),ps)}}function matchImplicitIdentity(as,rs,ns){var ss=rs[0],os=rs.slice(1);if(ss!=="+"&&ss!=="*"&&ss!=="^")return!1;var ls=[];for(let us=0;us0;ns--){ss=os;for(let ls=0;ls0||gs.length>0)&&(Array.isArray(hs)&&(hs=hs[0]===us[0]?hs.slice(1):[hs]),hs=[us[0]].concat(ys,hs,gs)),ds.evaluate_numbers&&(hs=evaluate_numbers(hs,{max_digits:ds.max_digits})),hs}return ps})}if(equal$2(ss,os))return os}return os};var math=math$1;const operators$2={"+":function(as){return as.length===1?as[0]:new math.OperatorNode("+","add",as)},"*":function(as){return new math.OperatorNode("*","multiply",as)},"/":function(as){return new math.OperatorNode("/","divide",as)},"-":function(as){return new math.OperatorNode("-","unaryMinus",[as[0]])},"^":function(as){return new math.OperatorNode("^","pow",as)},vector:function(as){return new math.ArrayNode(as)},altvector:function(as){return new math.ArrayNode(as)},and:function(as){return new math.OperatorNode("and","and",as)},or:function(as){return new math.OperatorNode("or","or",as)},not:function(as){return new math.OperatorNode("not","not",[as[0]])},"<":function(as){return new math.OperatorNode("<","smaller",as)},">":function(as){return new math.OperatorNode(">","larger",as)},le:function(as){return new math.OperatorNode("<=","smallerEq",as)},ge:function(as){return new math.OperatorNode(">=","largerEq",as)},ne:function(as){return new math.OperatorNode("!=","unequal",as)},binom:function(as){const rs=new math.SymbolNode("combinations");return new math.FunctionNode(rs,as)}},functionConverstions={nCr:"combinations",nPr:"permutations",binom:"combinations"};class astToMathjs$1{constructor({mathjs:rs=null}={}){rs&&(math=rs)}convert(rs){if(typeof rs=="number")return Number.isFinite(rs)?new math.ConstantNode(rs):Number.isNaN(rs)?new math.SymbolNode("NaN"):rs<0?operators$2["-"]([new math.SymbolNode("Infinity")]):new math.SymbolNode("Infinity");if(typeof rs=="string")return new math.SymbolNode(rs);if(typeof rs=="boolean")throw Error("no support for boolean");if(!Array.isArray(rs))throw Error("Invalid ast");const ns=rs[0],ss=rs.slice(1);if(ns==="apply"){if(typeof ss[0]!="string")throw Error("Non string functions not implemented for conversion to mathjs");if(ss[0]==="factorial")return new math.OperatorNode("!","factorial",[this.convert(ss[1])]);let os=functionConverstions[ss[0]];os||(os=ss[0]);const ls=new math.SymbolNode(os),us=ss[1];let cs;return cs=us[0]==="tuple"?us.slice(1).map(function(ds,ps){return this.convert(ds)}.bind(this)):[this.convert(us)],new math.FunctionNode(ls,cs)}if(ns==="lts"||ns==="gts"){const os=ss[0],ls=ss[1];if(os[0]!=="tuple"||ls[0]!=="tuple")throw new Error("Badly formed ast");const us=os.slice(1).map(function(ps,fs){return this.convert(ps)}.bind(this));let cs=[];for(let ps=1;ps","larger",us.slice(ps-1,ps+1))):ns==="lts"?cs.push(new math.OperatorNode("<=","smallerEq",us.slice(ps-1,ps+1))):cs.push(new math.OperatorNode(">=","largerEq",us.slice(ps-1,ps+1)));let ds=new math.OperatorNode("and","and",cs.slice(0,2));for(let ps=2;ps=","largerEq",[os,ds])):fs.push(new math.OperatorNode(">","larger",[os,ds])),cs[2]?fs.push(new math.OperatorNode("<=","smallerEq",[os,ps])):fs.push(new math.OperatorNode("<","smaller",[os,ps]));let hs=new math.OperatorNode("and","and",fs);return ns!=="notin"&&ns!=="notni"||(hs=new math.OperatorNode("not","not",[hs])),hs}if(ns==="subset"||ns==="notsubset"||ns==="superset"||ns==="notsuperset"){let os,ls;if(ns==="subset"||ns==="notsubset"?(ls=ss[0],os=ss[1]):(ls=ss[1],os=ss[0]),ls[0]!=="interval"||os[0]!=="interval")throw Error("Set containment of non-intervals not implemented for conversion to mathjs");let us=ls[1],cs=ls[2],ds=os[1],ps=os[2];if(us[0]!=="tuple"||cs[0]!=="tuple"||ds[0]!=="tuple"||ps[0]!=="tuple")throw Error("Badly formed ast");let fs=this.convert(us[1]),hs=this.convert(us[2]),gs=this.convert(ds[1]),ys=this.convert(ds[2]),bs=[];cs[1]&&!ps[1]?bs.push(new math.OperatorNode(">","larger",[fs,gs])):bs.push(new math.OperatorNode(">=","largerEq",[fs,gs])),cs[2]&&!ps[2]?bs.push(new math.OperatorNode("<","smaller",[hs,ys])):bs.push(new math.OperatorNode("<=","smallerEq",[hs,ys]));let vs=new math.OperatorNode("and","and",bs);return ns!=="notsubset"&&ns!=="notsuperset"||(vs=new math.OperatorNode("not","not",[vs])),vs}if(ns==="matrix"){let os=ss[0],ls=os[1],us=os[2],cs=ss[1];if(!Number.isInteger(ls)||!Number.isInteger(us))throw Error("Matrix must have integer dimensions");let ds=[];for(let ps=1;ps<=ls;ps++){let fs=[];for(let hs=1;hs<=us;hs++)fs.push(this.convert(cs[ps][hs]));ds.push(new math.ArrayNode(fs))}return new math.ArrayNode(ds)}if(ns in operators$2)return operators$2[ns](ss.map(function(os,ls){return this.convert(os)}.bind(this)));throw Error("Operator "+ns+" not implemented for conversion to mathjs")}}var function_normalizations={ln:"log",arccos:"acos",arccosh:"acosh",arcsin:"asin",arcsinh:"asinh",arctan:"atan",arctanh:"atanh",arcsec:"asec",arcsech:"asech",arccsc:"acsc",arccsch:"acsch",arccot:"acot",arccoth:"acoth",cosec:"csc"},create_trig_inverses_for=["cos","cosh","sin","sinh","tan","tanh","sec","sech","csc","csch","cot","coth"],move_exponents_outside_for=["cos","cosh","sin","sinh","tan","tanh","sec","sech","csc","csch","cot","coth"];function normalize_function_names(as){var rs=get_tree(as);if(!Array.isArray(rs))return rs;var ns=rs[0],ss=rs.slice(1);if(ns==="apply"){if(ss[0]==="sqrt")return["^",normalize_function_names(ss[1]),.5];var os=normalize_function_names_sub(ss[0]);os=["apply",os];var ls=ss.slice(1).map(function(us){return normalize_function_names(us)});return ls=ls.length>1?["tuple"].concat(ls):ls[0],os.push(ls),os}return ns==="^"&&ss[0]==="e"&&math$1.define_e?["apply","exp",normalize_function_names(ss[1])]:ns==="binom"?["apply","nCr",["tuple",normalize_function_names(ss[0]),normalize_function_names(ss[1])]]:[ns].concat(ss.map(function(us){return normalize_function_names(us)}))}function normalize_function_names_sub(as){if(typeof as=="string")return as in function_normalizations?function_normalizations[as]:as;if(!Array.isArray(as))return as;var rs=as[0],ns=as.slice(1);if(rs==="^"&&ns.length===2&&ns[1]===-1){let ss=normalize_function_names_sub(ns[0]);if(create_trig_inverses_for.includes(ss))return"a"+ss}return[rs].concat(ns.map(function(ss){return normalize_function_names_sub(ss)}))}function normalize_applied_functions(as){var rs=get_tree(as);if(!Array.isArray(rs))return rs;var ns=rs[0],ss=rs.slice(1);if(ns==="apply"){let os=ss[0];if(os[0]==="^"){let cs=os[1],ds=os[2];return ds!==-1&&move_exponents_outside_for.includes(cs)?["^",["apply",cs,normalize_applied_functions(ss[1])],ds]:["apply",os,normalize_applied_functions(ss[1])]}let ls=0;for(;os[0]==="prime";)ls+=1,os=os[1];let us=["apply",os,normalize_applied_functions(ss[1])];for(let cs=0;cs2&&(os=unflattenRight(os),cs=os.slice(1)),simple_assumption_combination(us,is_integer_ast(as,cs[0],ns),is_integer_ast(as,cs[1],ns)))}if(Array.isArray(as)){let os;os=Array.isArray(rs)?rs:rs.get_assumptions([variables(as)]);let ls=as[0],us=as.slice(1);if(ls==="-")return is_integer_ast(us[0],os,ns);if(ls==="*")return!!us.every(function(cs){return is_integer_ast(cs,os,ns)})||void 0;if(ls==="^"){let cs=is_nonzero_ast(us[0],os,ns);if(cs){if(is_nonzero_ast(us[1],os,ns)===!1)return us[0]!==1/0&&us[0]!==-1/0}else{if(Number.isNaN(us[0]))return!1;if(!is_positive_ast(us[1],os,!0,ns))return;if(cs===!1)return!0}let ds=is_integer_ast(us[0],os,ns),ps=is_integer_ast(us[1],os,ns);return ds&&(ps&&!!is_positive_ast(us[1],os,!1,ns)||void 0)}if(ls==="+"){let cs=0;for(let ds=0;ds0)return;cs+=1}if(ps===void 0)return}return cs===0}return ls==="apply"?!!(functions.C.Z&&functions.C.Z.includes(us[0])&&is_complex_ast(us[1],os,ns))||!!(functions.R.Z&&functions.R.Z.includes(us[0])&&is_real_ast(us[1],os,ns))||!!(functions.nonzeroC.Z&&functions.nonzeroC.Z.includes(us[0])&&is_nonzero_ast(us[1],os,ns)&&is_complex_ast(us[1],os,ns))||!!(functions.nonneg.Z&&functions.nonneg.Z.includes(us[0])&&is_positive_ast(us[1],os,!1,ns))||!!(functions.pos.Z&&functions.pos.Z.includes(us[0])&&is_positive_ast(us[1],os,!0,ns))||void 0:ls==="/"||ls==="prime"?void 0:!1}return!1}function is_real_ast(as,rs,ns){if(typeof rs!="object"&&(rs=[]),ns===void 0&&(ns=rs),typeof as=="number")return Number.isFinite(as);var ss=evaluate_to_constant(as,!1);if(ss!==null)return typeof ss=="number"&&Number.isFinite(ss);if(typeof as=="string"){let os;if(os=Array.isArray(rs)?rs:rs.get_assumptions(as),!Array.isArray(os))return;let ls=os,us=os[0],cs=os.slice(1),ds=!1;for(;us==="not";){if(ds=!ds,os=cs[0],!Array.isArray(os))return;us=os[0],cs=os.slice(1)}if(us==="in"&&cs[0]===as&&cs[1]==="R")return negate_adjust(!0,ds);if(us==="notin"&&cs[0]===as&&cs[1]==="R")return negate_adjust(!1,ds);if(ds===!1){if(us==="in"&&cs[0]===as&&cs[1]==="Z")return!0}else if(us==="notin"&&cs[0]===as&&cs[1]==="Z")return!0;if(us==="<"||us==="le"){let ps=variables(os),fs=functions$2(os);if(ps.indexOf(as)!==-1&&fs.length===0)return!0}if(us==="="&&!ds||us==="ne"&&ds){let ps=narrow_assumptions(ls,ns);if(cs[0]===as)return is_real_ast(cs[1],ps);if(cs[1]===as)return is_real_ast(cs[0],ps)}return us!=="and"&&us!=="or"||ds?void 0:(cs.length>2&&(os=unflattenRight(os),cs=os.slice(1)),simple_assumption_combination(us,is_real_ast(as,cs[0],ns),is_real_ast(as,cs[1],ns)))}if(Array.isArray(as)){let os;os=Array.isArray(rs)?rs:rs.get_assumptions([variables(as)]);let ls=as[0],us=as.slice(1);if(ls==="-")return is_real_ast(us[0],os,ns);if(ls==="*"||ls==="+"){if(us.length>2&&(us=(as=unflattenRight(as)).slice(1)),ls==="*"&&(is_nonzero_ast(us[0],os,ns)===!1||is_nonzero_ast(us[1],os,ns)===!1))return!0;let cs=is_real_ast(us[0],os,ns),ds=is_real_ast(us[1],os,ns);return!(!cs||!ds)||!(cs&&ds===!1||ds&&cs===!1)&&void 0}if(ls==="^"){let cs=is_nonzero_ast(us[0],os,ns),ds=is_positive_ast(us[1],os,!0,ns);if(cs){if(is_nonzero_ast(us[1],os,ns)===!1)return us[0]!==1/0&&us[0]!==-1/0}else{if(Number.isNaN(us[0]))return!1;if(!ds)return;if(cs===!1)return!0}let ps=is_real_ast(us[0],os,ns),fs=is_real_ast(us[1],os,ns);return!ps||!fs?void 0:is_positive_ast(us[0],os,!1,ns)?!!is_positive_ast(us[0],os,!0,ns)||!!ds||void 0:!!is_integer_ast(us[1],os,ns)||void 0}return ls==="/"?is_nonzero_ast(us[1],os,ns)?is_nonzero_ast(us[0],os,ns)===!1?!0:!is_real_ast(us[0],os,ns)||!is_real_ast(us[1],os,ns)?void 0:!0:void 0:ls==="apply"?!!(functions.C.R&&functions.C.R.includes(us[0])&&is_complex_ast(us[1],os,ns))||!!(functions.R.R&&functions.R.R.includes(us[0])&&is_real_ast(us[1],os,ns))||!!(functions.nonzeroC.R&&functions.nonzeroC.R.includes(us[0])&&is_nonzero_ast(us[1],os,ns)&&is_complex_ast(us[1],os,ns))||!!(functions.nonneg.R&&functions.nonneg.R.includes(us[0])&&is_positive_ast(us[1],os,!1,ns))||!!(functions.pos.R&&functions.pos.R.includes(us[0])&&is_positive_ast(us[1],os,!0,ns))||void 0:ls==="prime"?void 0:!1}return!1}function is_complex_ast(as,rs,ns){if(typeof rs!="object"&&(rs=[]),ns===void 0&&(ns=rs),typeof as=="number")return Number.isFinite(as);var ss=evaluate_to_constant(as,!1);if(ss!==null)return typeof ss=="number"?Number.isFinite(ss):!(ss.re===void 0||!Number.isFinite(ss.re)||ss.im===void 0||!Number.isFinite(ss.im));if(typeof as=="string"){let os;if(os=Array.isArray(rs)?rs:rs.get_assumptions(as),!Array.isArray(os))return;let ls=os,us=os[0],cs=os.slice(1),ds=!1;for(;us==="not";){if(ds=!ds,os=cs[0],!Array.isArray(os))return;us=os[0],cs=os.slice(1)}if(us==="in"&&cs[0]===as&&cs[1]==="C")return negate_adjust(!0,ds);if(us==="notin"&&cs[0]===as&&cs[1]==="C")return negate_adjust(!1,ds);if(ds===!1){if(us==="in"&&(cs[0]===as&&cs[1]==="Z"||cs[0]===as&&cs[1]==="R"))return!0}else if(us==="notin"&&(cs[0]===as&&cs[1]==="Z"||cs[0]===as&&cs[1]==="R"))return!0;if(us==="<"||us==="le"){let ps=variables(os),fs=functions$2(os);if(ps.indexOf(as)!==-1&&fs.length===0)return!0}if(us==="="&&!ds||us==="ne"&&ds){let ps=narrow_assumptions(ls,ns);if(cs[0]===as)return is_complex_ast(cs[1],ps);if(cs[1]===as)return is_complex_ast(cs[0],ps)}return us!=="and"&&us!=="or"||ds?void 0:(cs.length>2&&(os=unflattenRight(os),cs=os.slice(1)),simple_assumption_combination(us,is_complex_ast(as,cs[0],ns),is_complex_ast(as,cs[1],ns)))}if(Array.isArray(as)){let os;os=Array.isArray(rs)?rs:rs.get_assumptions([variables(as)]);let ls=as[0],us=as.slice(1);if(ls==="-")return is_complex_ast(us[0],os,ns);if(ls==="*"||ls==="+")return ls==="*"&&!us.every(cs=>is_nonzero_ast(cs,os,ns)!==!1)?!0:!!us.every(cs=>is_complex_ast(cs,os,ns))||void 0;if(ls==="^"){let cs=is_nonzero_ast(us[0],os,ns),ds=is_positive_ast(us[1],os,!0,ns);if(cs){if(is_nonzero_ast(us[1],os,ns)===!1)return us[0]!==1/0&&us[0]!==-1/0}else{if(Number.isNaN(us[0]))return!1;if(!ds)return;if(cs===!1)return!0}let ps=is_complex_ast(us[0],os,ns),fs=is_complex_ast(us[1],os,ns);return!(!ps||!fs)||void 0}return ls==="/"?is_nonzero_ast(us[1],os,ns)?is_nonzero_ast(us[0],os,ns)===!1?!0:!is_complex_ast(us[0],os,ns)||!is_complex_ast(us[1],os,ns)?void 0:!0:void 0:ls==="apply"?!!(functions.C.C&&functions.C.C.includes(us[0])&&is_complex_ast(us[1],os,ns))||!!(functions.R.C&&functions.R.C.includes(us[0])&&is_real_ast(us[1],os,ns))||!!(functions.nonzeroC.C&&functions.nonzeroC.C.includes(us[0])&&is_nonzero_ast(us[1],os,ns)&&is_complex_ast(us[1],os,ns))||!!(functions.nonneg.C&&functions.nonneg.C.includes(us[0])&&is_positive_ast(us[1],os,!1,ns))||!!(functions.pos.C&&functions.pos.C.includes(us[0])&&is_positive_ast(us[1],os,!0,ns))||void 0:ls==="prime"?void 0:!1}return!1}function is_nonzero_ast(as,rs,ns){if(typeof rs!="object"&&(rs=[]),ns===void 0&&(ns=rs),typeof as=="number")return Number.isFinite(as)?as!==0:Number.isNaN(as)?void 0:!0;var ss=evaluate_to_constant(as,!1);if(ss!==null)return typeof ss=="number"?Number.isFinite(ss)?ss!==0:Number.isNaN(ss)?void 0:!0:ss.re!==void 0&&ss.im!==void 0&&(ss.re!==0||ss.im!==0)||void 0;if(typeof as=="string"){let os;if(os=Array.isArray(rs)?rs:rs.get_assumptions(as),!Array.isArray(os))return;let ls=os,us=os[0],cs=os.slice(1),ds=!1;for(;us==="not";){if(ds=!ds,os=cs[0],!Array.isArray(os))return;us=os[0],cs=os.slice(1)}let ps=narrow_assumptions(ls,ns);if(us==="="&&!ds||us==="ne"&&ds){if(cs[0]===as)return is_nonzero_ast(cs[1],ps);if(cs[1]===as)return is_nonzero_ast(cs[0],ps)}if((us==="ne"&&!ds||us==="="&&ds)&&(cs[0]===as&&is_nonzero_ast(cs[1],ps)===!1||cs[1]===as&&is_nonzero_ast(cs[0],ps)===!1))return!0;if(us==="<"){if(ds){if(cs[0]===as&&is_positive_ast(cs[1],ps,!0)||cs[1]===as&&is_negative_ast(cs[0],ps,!0))return!0}else if(cs[0]===as&&is_negative_ast(cs[1],ps,!1)||cs[1]===as&&is_positive_ast(cs[0],ps,!1))return!0}if(us==="le"){if(ds){if(cs[0]===as&&is_positive_ast(cs[1],ps,!1)||cs[1]===as&&is_negative_ast(cs[0],ps,!1))return!0}else if(cs[0]===as&&is_negative_ast(cs[1],ps,!0)||cs[1]===as&&is_positive_ast(cs[0],ps,!0))return!0}return us!=="and"&&us!=="or"||ds?void 0:(cs.length>2&&(os=unflattenRight(os),cs=os.slice(1)),simple_assumption_combination(us,is_nonzero_ast(as,cs[0],ns),is_nonzero_ast(as,cs[1],ns)))}if(Array.isArray(as)){let os;os=Array.isArray(rs)?rs:rs.get_assumptions([variables(as)]);let ls=as[0],us=as.slice(1);if(ls==="-")return is_nonzero_ast(us[0],os,ns);if(ls==="+"){if(us.length>2&&(us=(as=unflattenRight(as)).slice(1)),equal$2(us[0],simplify(["-",us[1]],ns)))return!1;let cs=is_nonzero_ast(us[0],os,ns),ds=is_nonzero_ast(us[1],os,ns);if(cs===!1)return ds;if(ds===!1)return cs;let ps=is_real_ast(us[0],os,ns),fs=is_real_ast(us[1],os,ns);if(!ps||!fs)return ps===!0?fs===!1||void 0:fs===!0&&ps===!1||void 0;let hs=is_positive_ast(us[0],os,!1,ns),gs=is_positive_ast(us[1],os,!1,ns),ys=is_positive_ast(us[0],os,!0,ns),bs=is_positive_ast(us[1],os,!0,ns);return!!(hs&&bs||ys&&gs)||hs===!1&&bs===!1||ys===!1&&gs===!1||void 0}if(ls==="*"){let cs=!0;for(let ds=0;ds0:as>=0);var os=is_real_ast(as,rs,ss);if(!os)return os;var ls=evaluate_to_constant(as,!1);if(ls!==null)return typeof ls=="number"&&!!Number.isFinite(ls)&&(ns?ls>0:ls>=0);if(typeof as=="string"){let us;if(us=Array.isArray(rs)?rs:rs.get_assumptions(as),!Array.isArray(us))return;let cs=us,ds=us[0],ps=us.slice(1),fs=!1;for(;ds==="not";){if(fs=!fs,us=ps[0],!Array.isArray(us))return;ds=us[0],ps=us.slice(1)}let hs=narrow_assumptions(cs,ss);if(ds==="="&&!fs||ds==="ne"&&fs){if(ps[0]===as)return is_positive_ast(ps[1],hs,ns);if(ps[1]===as)return is_positive_ast(ps[0],hs,ns)}if(ds==="<")if(fs){if(ps[0]===as&&is_positive_ast(ps[1],hs,ns))return!0;if(ps[1]===as&&is_negative_ast(ps[0],hs,!ns))return!1}else{if(ps[0]===as&&is_negative_ast(ps[1],hs,!1))return!1;if(ps[1]===as&&is_positive_ast(ps[0],hs,!1))return!0}if(ds==="le")if(fs){if(ps[0]===as&&is_positive_ast(ps[1],hs,!1))return!0;if(ps[1]===as&&is_negative_ast(ps[0],hs,!1))return!1}else{if(ps[0]===as&&is_negative_ast(ps[1],hs,!ns))return!1;if(ps[1]===as&&is_positive_ast(ps[0],hs,ns))return!0}return ds!=="and"&&ds!=="or"||fs?void 0:(ps.length>2&&(us=unflattenRight(us),ps=us.slice(1)),simple_assumption_combination(ds,is_positive_ast(as,ps[0],ns,ss),is_positive_ast(as,ps[1],ns,ss)))}if(Array.isArray(as)){let us;us=Array.isArray(rs)?rs:rs.get_assumptions([variables(as)]);let cs=as[0],ds=as.slice(1);if(cs==="-")return is_negative_ast(ds[0],us,ns,ss);if(cs==="+"){ds.length>2&&(ds=(as=unflattenRight(as)).slice(1));let ps=is_positive_ast(ds[0],us,!1,ss),fs=is_positive_ast(ds[1],us,!1,ss),hs=is_positive_ast(ds[0],us,!0,ss),gs=is_positive_ast(ds[1],us,!0,ss);if(ns){if(ps&&gs||hs&&fs)return!0}else if(ps&&fs)return!0;if(ns){if(hs===!1&&gs===!1)return!1}else if(ps===!1&&gs===!1||hs===!1&&fs===!1)return!1;return}if(cs==="*"){if(!ds.every(vs=>is_nonzero_ast(vs,us,ss)!==!1))return!ns;ds.length>2&&(ds=(as=unflattenRight(as)).slice(1));let ps=is_real_ast(ds[0],us,ss),fs=is_real_ast(ds[1],us,ss);if(ps===void 0||fs===void 0)return;if(ps===!1)return fs===!1&&void 0;if(fs===!1)return!1;let hs=is_positive_ast(ds[0],us,!1,ss),gs=is_positive_ast(ds[1],us,!1,ss),ys=is_positive_ast(ds[0],us,!0,ss),bs=is_positive_ast(ds[1],us,!0,ss);if(ns){if(ys&&bs||hs===!1&&gs===!1)return!0;if(ys===!1&&gs||hs&&bs===!1)return!1}else{if(hs&&gs||ys===!1&&bs===!1)return!0;if(ys&&gs===!1||hs===!1&&bs)return!1}return}if(cs==="/"){if(!is_nonzero_ast(ds[1],us,ss))return;if(is_nonzero_ast(ds[0],us,ss)===!1)return!ns;let ps=is_positive_ast(ds[1],us,!0,ss);if(ps===void 0)return;let fs=ps?ns:!ns,hs=is_positive_ast(ds[0],us,fs,ss);return hs===void 0?void 0:hs===!0?ps===!0:ps!==!0}if(cs==="^"){let ps=is_nonzero_ast(ds[0],us,ss);if(ps){if(is_nonzero_ast(ds[1],us,ss)===!1)return ds[0]===1/0||ds[0]===-1/0?void 0:!0}else{if(!is_positive_ast(ds[1],us,!0,ss))return;if(ps===!1)return!ns;if(ns)return}return is_real_ast(ds[0],us,ss)!==!0?void 0:is_positive_ast(ds[0],us,ns,ss)?!!is_real_ast(ds[1],us,ss)||void 0:!!is_integer_ast(simplify(["/",ds[1],2],ss),us,ss)||void 0}return cs==="apply"&&!ns?!!(functions.C.nonneg&&functions.C.nonneg.includes(ds[0])&&is_complex_ast(ds[1],us,ss))||!!(functions.R.nonneg&&functions.R.nonneg.includes(ds[0])&&is_real_ast(ds[1],us,ss))||!!(functions.nonzeroC.nonneg&&functions.nonzeroC.nonneg.includes(ds[0])&&is_nonzero_ast(ds[1],us,ss)&&is_complex_ast(ds[1],us,ss))||!!(functions.nonneg.nonneg&&functions.nonneg.nonneg.includes(ds[0])&&is_positive_ast(ds[1],us,!1,ss))||!!(functions.pos.nonneg&&functions.pos.nonneg.includes(ds[0])&&is_positive_ast(ds[1],us,!0,ss))||void 0:cs==="apply"&&ns?!!(functions.C.pos&&functions.C.pos.includes(ds[0])&&is_complex_ast(ds[1],us,ss))||!!(functions.R.pos&&functions.R.pos.includes(ds[0])&&is_real_ast(ds[1],us,ss))||!!(functions.nonzeroC.pos&&functions.nonzeroC.pos.includes(ds[0])&&is_nonzero_ast(ds[1],us,ss)&&is_complex_ast(ds[1],us,ss))||!!(functions.nonneg.pos&&functions.nonneg.pos.includes(ds[0])&&is_positive_ast(ds[1],us,!1,ss))||!!(functions.pos.pos&&functions.pos.pos.includes(ds[0])&&is_positive_ast(ds[1],us,!0,ss))||void 0:cs==="prime"?void 0:!1}return!1}function is_negative_ast(as,rs,ns,ss){ns===void 0&&(ns=!0);var os=is_real_ast(as,rs,ss);if(os===!0){let ls=is_positive_ast(as,rs,!ns,ss);return ls===!1||ls!==!0&&void 0}return os}function tuples_to_vectors(as){var rs=get_tree(as);if(!Array.isArray(rs))return rs;var ns=rs[0],ss=rs.slice(1);if(ns==="tuple")return["vector"].concat(ss.map(function(os,ls){return tuples_to_vectors(os)}));if(ns==="apply"){if(ss[1][0]==="tuple"){let os=tuples_to_vectors(ss[0]),ls=ss[1].slice(1);return["apply",os,["tuple"].concat(ls.map(function(us,cs){return tuples_to_vectors(us)}))]}}else if(ns==="gts"||ns==="lts"||ns==="interval"){let os=ss[0],ls=ss[1];if(os[0]!=="tuple"||ls[0]!=="tuple")throw new Error("Badly formed ast");return[ns,["tuple"].concat(os.slice(1).map(function(us,cs){return tuples_to_vectors(us)})),ls]}return[ns].concat(ss.map(function(os,ls){return tuples_to_vectors(os)}))}function to_intervals(as){var rs=get_tree(as);if(!Array.isArray(rs))return rs;var ns=rs[0],ss=rs.slice(1);if(ns==="tuple"&&ss.length===2){let os=["tuple"].concat(ss.map(function(ls,us){return to_intervals(ls)}));return os=["interval",os,["tuple",!1,!1]],os}if(ns==="array"&&ss.length===2){let os=["tuple"].concat(ss.map(function(ls,us){return to_intervals(ls)}));return os=["interval",os,["tuple",!0,!0]],os}if(ns==="apply"){if(ss[1][0]==="tuple"){let os=to_intervals(ss[0]),ls=ss[1].slice(1);return["apply",os,["tuple"].concat(ls.map(function(us,cs){return to_intervals(us)}))]}}else if(ns==="gts"||ns==="lts"||ns==="interval"){let os=ss[0],ls=ss[1];if(os[0]!=="tuple"||ls[0]!=="tuple")throw new Error("Badly formed ast");return[ns,["tuple"].concat(os.slice(1).map(function(us,cs){return to_intervals(us)})),ls]}return[ns].concat(ss.map(function(os,ls){return to_intervals(os)}))}function altvectors_to_vectors(as){var rs=get_tree(as);if(!Array.isArray(rs))return rs;var ns=rs[0],ss=rs.slice(1);return ns==="altvector"?["vector"].concat(ss.map(function(os,ls){return altvectors_to_vectors(os)})):[ns].concat(ss.map(function(os,ls){return altvectors_to_vectors(os)}))}function ParseError(as,rs){this.name="ParseError",this.message=as||"Error parsing input",this.stack=new Error().stack,this.location=rs}functions.C.nonneg=["abs"],functions.C.nonzero=["exp"],functions.C.R=["abs","arg"],functions.C.C=["abs","arg","exp","sign","cos","cosh","sin","sinh","erf","sqrt","log","ln","log10"],functions.R.pos=["exp"],functions.R.nonneg=["abs","exp","arg"],functions.R.R=["abs","arg","exp","sign","cos","cosh","sin","sinh","erf"],functions.R.Z=["sign"],functions.nonzeroC.pos=["abs"],functions.nonneg.nonneg=["abs","exp","arg","sqrt","erf"],functions.nonzeroC.nonzero=["abs"],functions.nonneg.R=[...new Set(functions.R.R.concat(functions.nonneg.nonneg))],functions.pos.pos=["abs","exp","sqrt","erf"],functions.pos.nonneg=functions.pos.pos,functions.pos.nonzero=["abs","exp","sqrt","erf"],functions.pos.R=functions.nonneg.R.concat(["log","ln","log10"]),ParseError.prototype=Object.create(Error.prototype),ParseError.prototype.constructor=ParseError;class lexer{constructor(rs,ns="\\s"){this.input="",this.location=0,this.token_rules=[],this.initial_whitespace=new RegExp("^("+ns+")+");for(let ss of rs)this.token_rules.push([new RegExp("^"+ss[0])].concat(ss.slice(1)))}set_input(rs){if(typeof rs!="string")throw new Error("Input must be a string");this.input=rs,this.location=0}return_state(){return{input:this.input,location:this.location}}set_state({input:rs=null,location:ns=0}={}){rs!==null&&(this.input=rs,this.location=ns)}advance({remove_initial_space:rs=!0}={}){let ns=this.initial_whitespace.exec(this.input);if(ns){let os=ns[0].length;if(this.input=this.input.slice(os),this.location+=os,!rs)return{token_type:"SPACE",token_text:ns[0],original_text:ns[0]}}if(this.input.length===0)return{token_type:"EOF",token_text:"",original_text:""};for(var ss of(ns=null,this.token_rules))if(ns=ss[0].exec(this.input),ns){let os=ns[0].length;this.input=this.input.slice(os),this.location+=os;break}return ns===null?{token_type:"INVALID",token_text:this.input[0],original_text:this.input[0]}:ss.length>2?{token_type:ss[1],token_text:ss[2],original_text:ns[0]}:{token_type:ss[1],token_text:ns[0],original_text:ns[0]}}unput(rs){if(typeof rs!="string")throw new Error("Input must be a string");this.location-=rs.length,this.input=rs+this.input}}var is_associative={"+":!0,"*":!0,and:!0,or:!0,union:!0,intersect:!0};function flatten$6(as){if(!Array.isArray(as))return as;var rs=as[0],ns=as.slice(1);if(ns=ns.map(function(ls,us){return flatten$6(ls)}),is_associative[rs]){for(var ss=[],os=0;os2?ss=ss.concat(ns[os].slice(1)):ss.push(ns[os]);ns=ss}return[rs].concat(ns)}const sci_notat_exp_regex$1="(E[+\\-]?[0-9]+\\s*($|(?=\\,|\\||\\)|\\}|\\])))?",number_rules_sci$1=[["[0-9]+(\\.[0-9]*)?"+sci_notat_exp_regex$1,"NUMBER"],["\\.[0-9]+"+sci_notat_exp_regex$1,"NUMBER"]],number_rules_non_sci$1=[["[0-9]+(\\.[0-9]*)?","NUMBER"],["\\.[0-9]+","NUMBER"]],base_text_rules=[["\\*\\*","^"],["\\*","*"],["\\xB7","*"],["·","*"],["•","*"],["⋅","*"],["×","*"],["/","/"],["-","-"],["֊","-"],["־","-"],["᠆","-"],["‐","-"],["‑","-"],["‒","-"],["–","-"],["—","-"],["―","-"],["⁻","-"],["₋","-"],["−","-"],["⸺","-"],["⸻","-"],["﹘","-"],["﹣","-"],["-","-"],["\\+","+"],["\\^","^"],["‸","^"],["ʌ","^"],["\\|","|"],["\\(","("],["\\)",")"],["\\[","["],["\\]","]"],["\\{","{"],["\\}","}"],["⟨","LANGLE"],["⟩","RANGLE"],["〈","LANGLE"],["〉","RANGLE"],[",",","],[":",":"],["α","VARMULTICHAR","alpha"],["β","VARMULTICHAR","beta"],["ϐ","VARMULTICHAR","beta"],["Γ","VARMULTICHAR","Gamma"],["γ","VARMULTICHAR","gamma"],["Δ","VARMULTICHAR","Delta"],["δ","VARMULTICHAR","delta"],["ε","VARMULTICHAR","epsilon"],["ϵ","VARMULTICHAR","epsilon"],["ζ","VARMULTICHAR","zeta"],["η","VARMULTICHAR","eta"],["Θ","VARMULTICHAR","Theta"],["ϴ","VARMULTICHAR","Theta"],["θ","VARMULTICHAR","theta"],["ᶿ","VARMULTICHAR","theta"],["ϑ","VARMULTICHAR","theta"],["ι","VARMULTICHAR","iota"],["κ","VARMULTICHAR","kappa"],["Λ","VARMULTICHAR","Lambda"],["λ","VARMULTICHAR","lambda"],["μ","VARMULTICHAR","mu"],["µ","VARMULTICHAR","mu"],["ν","VARMULTICHAR","nu"],["Ξ","VARMULTICHAR","Xi"],["ξ","VARMULTICHAR","xi"],["Π","VARMULTICHAR","Pi"],["π","VARMULTICHAR","pi"],["ϖ","VARMULTICHAR","pi"],["ρ","VARMULTICHAR","rho"],["ϱ","VARMULTICHAR","rho"],["Σ","VARMULTICHAR","Sigma"],["σ","VARMULTICHAR","sigma"],["ς","VARMULTICHAR","sigma"],["τ","VARMULTICHAR","tau"],["Υ","VARMULTICHAR","Upsilon"],["υ","VARMULTICHAR","upsilon"],["Φ","VARMULTICHAR","Phi"],["φ","VARMULTICHAR","phi"],["ϕ","VARMULTICHAR","phi"],["Ψ","VARMULTICHAR","Psi"],["ψ","VARMULTICHAR","psi"],["Ω","VARMULTICHAR","Omega"],["ω","VARMULTICHAR","omega"],["oo(?![a-zA-Z0-9])","INFINITY"],["OO(?![a-zA-Z0-9])","INFINITY"],["infty(?![a-zA-Z0-9])","INFINITY"],["infinity(?![a-zA-Z0-9])","INFINITY"],["Infinity(?![a-zA-Z0-9])","INFINITY"],["∞","INFINITY"],["ℯ","VAR","e"],["♠","VARMULTICHAR","spade"],["♡","VARMULTICHAR","heart"],["♢","VARMULTICHAR","diamond"],["♣","VARMULTICHAR","club"],["★","VARMULTICHAR","bigstar"],["◯","VARMULTICHAR","bigcirc"],["◊","VARMULTICHAR","lozenge"],["△","VARMULTICHAR","bigtriangleup"],["▽","VARMULTICHAR","bigtriangledown"],["⧫","VARMULTICHAR","blacklozenge"],["■","VARMULTICHAR","blacksquare"],["▲","VARMULTICHAR","blacktriangle"],["▼","VARMULTICHAR","blacktriangledown"],["◀","VARMULTICHAR","blacktriangleleft"],["▶","VARMULTICHAR","blacktriangleright"],["□","VARMULTICHAR","Box"],["∘","VARMULTICHAR","circ"],["⋆","VARMULTICHAR","star"],["and(?![a-zA-Z0-9])","AND"],["\\&\\&?","AND"],["∧","AND"],["or(?![a-zA-Z0-9])","OR"],["∨","OR"],["not(?![a-zA-Z0-9])","NOT"],["¬","NOT"],["=","="],["᐀","="],["゠","="],["!=","NE"],["≠","NE"],["<=","LE"],["≤","LE"],[">=","GE"],["≥","GE"],["<","<"],[">",">"],["forall(?![a-zA-Z0-9])","FORALL"],["∀","FORALL"],["exists(?![a-zA-Z0-9])","EXISTS"],["∃","EXISTS"],["elementof(?![a-zA-Z0-9])","IN"],["∈","IN"],["notelementof(?![a-zA-Z0-9])","NOTIN"],["∉","NOTIN"],["containselement(?![a-zA-Z0-9])","NI"],["∋","NI"],["notcontainselement(?![a-zA-Z0-9])","NOTNI"],["∌","NOTNI"],["subset(?![a-zA-Z0-9])","SUBSET"],["⊂","SUBSET"],["subseteq(?![a-zA-Z0-9])","SUBSETEQ"],["⊆","SUBSETEQ"],["notsubset(?![a-zA-Z0-9])","NOTSUBSET"],["⊄","NOTSUBSET"],["notsubseteq(?![a-zA-Z0-9])","NOTSUBSETEQ"],["⊈","NOTSUBSETEQ"],["superset(?![a-zA-Z0-9])","SUPERSET"],["⊃","SUPERSET"],["superseteq(?![a-zA-Z0-9])","SUPERSETEQ"],["⊇","SUPERSETEQ"],["notsuperset(?![a-zA-Z0-9])","NOTSUPERSET"],["⊅","NOTSUPERSET"],["notsuperseteq(?![a-zA-Z0-9])","NOTSUPERSETEQ"],["⊉","NOTSUPERSETEQ"],["union(?![a-zA-Z0-9])","UNION"],["∪","UNION"],["intersect(?![a-zA-Z0-9])","INTERSECT"],["∩","INTERSECT"],["perp(?![a-zA-Z0-9])","PERP"],["⟂","PERP"],["parallel(?![a-zA-Z0-9])","PARALLEL"],["∥","PARALLEL"],["angle(?![a-zA-Z0-9])","ANGLE"],["∠","ANGLE"],["int(?![a-zA-Z0-9])","INT"],["∫","INT"],["!","!"],["'","'"],["_","_"],["\\.\\.\\.","LDOTS"],["[a-zA-Z∂][a-zA-Z∂0-9]*","VAR"],["[_$%]","VAR"]],allowSimplifiedFunctionApplicationDefault$1=!0,splitSymbolsDefault=!0,unsplitSymbolsDefault=["alpha","beta","gamma","Gamma","delta","Delta","epsilon","zeta","eta","theta","Theta","iota","kappa","lambda","Lambda","mu","nu","xi","Xi","pi","Pi","rho","sigma","Sigma","tau","Tau","upsilon","Upsilon","phi","Phi","chi","psi","Psi","omega","Omega","angle","deg"],appliedFunctionSymbolsDefault$1=["abs","exp","log","ln","log10","sign","sqrt","erf","cos","cosh","acos","acosh","arccos","arccosh","cot","coth","acot","acoth","arccot","arccoth","csc","csch","acsc","acsch","arccsc","arccsch","sec","sech","asec","asech","arcsec","arcsech","sin","sinh","asin","asinh","arcsin","arcsinh","tan","tanh","atan","atan2","atanh","arctan","arctanh","arg","conj","re","im","det","trace","nPr","nCr","floor","ceil","round"],functionSymbolsDefault$1=["f","g"],operatorSymbolsDefault$1=["binom","vec","linesegment"],unitsDefault$1=get_all_units(),parseLeibnizNotationDefault$1=!0;class textToAst$4{constructor({allowSimplifiedFunctionApplication:rs=allowSimplifiedFunctionApplicationDefault$1,splitSymbols:ns=splitSymbolsDefault,unsplitSymbols:ss=unsplitSymbolsDefault,appliedFunctionSymbols:os=appliedFunctionSymbolsDefault$1,functionSymbols:ls=functionSymbolsDefault$1,operatorSymbols:us=operatorSymbolsDefault$1,units:cs=unitsDefault$1,parseLeibnizNotation:ds=parseLeibnizNotationDefault$1,parseScientificNotation:ps=!0}={}){this.allowSimplifiedFunctionApplication=rs,this.splitSymbols=ns,this.unsplitSymbols=ss,this.appliedFunctionSymbols=os,this.functionSymbols=ls,this.operatorSymbols=us,this.units=cs,this.parseLeibnizNotation=ds;let fs=base_text_rules;fs=ps?[...number_rules_sci$1,...fs]:[...number_rules_non_sci$1,...fs],this.lexer=new lexer(fs)}advance(rs){if(this.token=this.lexer.advance(rs),this.token.token_type==="INVALID")throw new ParseError("Invalid symbol '"+this.token.original_text+"'",this.lexer.location)}return_state(){return{lexer_state:this.lexer.return_state(),token:Object.assign({},this.token)}}set_state(rs){this.lexer.set_state(rs.lexer_state),this.token=Object.assign({},rs.token)}convert(rs){this.lexer.set_input(rs),this.advance();var ns=this.statement_list();if(this.token.token_type!=="EOF")throw new ParseError("Invalid location of '"+this.token.original_text+"'",this.lexer.location);return flatten$6(ns)}statement_list(){for(var rs=[this.statement()];this.token.token_type===",";)this.advance(),rs.push(this.statement());return rs=rs.length>1?["list"].concat(rs):rs[0]}statement({inside_absolute_value:rs=0}={}){if(this.token.token_type==="LDOTS")return this.advance(),["ldots"];var ns;try{ns=this.return_state();let ss=this.statement_a({inside_absolute_value:rs});return this.token.token_type!==":"?ss:(this.advance(),[":",ss,this.statement_a()])}catch(ss){try{this.set_state(ns);let os=this.statement_a({parse_absolute_value:!1});if(this.token.token_type!=="|")throw ss;return this.advance(),["|",os,this.statement_a({parse_absolute_value:!1})]}catch{throw ss}}}statement_a({inside_absolute_value:rs=0,parse_absolute_value:ns=!0}={}){for(var ss=this.statement_b({inside_absolute_value:rs,parse_absolute_value:ns});this.token.token_type==="OR";){let os=this.token.token_type.toLowerCase();this.advance(),ss=[os,ss,this.statement_b({inside_absolute_value:rs,parse_absolute_value:ns})]}return ss}statement_b(rs){for(var ns=this.relation(rs);this.token.token_type==="AND";){let ss=this.token.token_type.toLowerCase();this.advance(),ns=[ss,ns,this.relation(rs)]}return ns}relation(rs){if(this.token.token_type==="NOT"||this.token.token_type==="!")return this.advance(),["not",this.relation(rs)];if(this.token.token_type==="FORALL"||this.token.token_type==="EXISTS"){let ss=this.token.token_type.toLowerCase();return this.advance(),[ss,this.relation(rs)]}for(var ns=this.expression(rs);this.token.token_type==="="||this.token.token_type==="NE"||this.token.token_type==="<"||this.token.token_type===">"||this.token.token_type==="LE"||this.token.token_type==="GE"||this.token.token_type==="IN"||this.token.token_type==="NOTIN"||this.token.token_type==="NI"||this.token.token_type==="NOTNI"||this.token.token_type==="SUBSET"||this.token.token_type==="NOTSUBSET"||this.token.token_type==="SUBSETEQ"||this.token.token_type==="NOTSUBSETEQ"||this.token.token_type==="SUPERSET"||this.token.token_type==="NOTSUPERSET"||this.token.token_type==="SUPERSETEQ"||this.token.token_type==="NOTSUPERSETEQ";){let ss=this.token.token_type.toLowerCase(),os=0;this.token.token_type==="<"||this.token.token_type==="LE"?os=-1:this.token.token_type!==">"&&this.token.token_type!=="GE"||(os=1),this.advance();let ls=this.expression(rs);if(os===-1)if(this.token.token_type==="<"||this.token.token_type==="LE"){let us=["tuple"];ss==="<"?us.push(!0):us.push(!1);let cs=["tuple",ns,ls];for(;this.token.token_type==="<"||this.token.token_type==="LE";)this.token.token_type==="<"?us.push(!0):us.push(!1),this.advance(),cs.push(this.expression(rs));ns=["lts",cs,us]}else ns=[ss,ns,ls];else if(os===1)if(this.token.token_type===">"||this.token.token_type==="GE"){let us=["tuple"];ss===">"?us.push(!0):us.push(!1);let cs=["tuple",ns,ls];for(;this.token.token_type===">"||this.token.token_type==="GE";)this.token.token_type===">"?us.push(!0):us.push(!1),this.advance(),cs.push(this.expression(rs));ns=["gts",cs,us]}else ns=[ss,ns,ls];else if(ss==="=")for(ns=["=",ns,ls];this.token.token_type==="=";)this.advance(),ns.push(this.expression(rs));else ns=[ss,ns,ls]}return ns}expression(rs){let ns=!1;this.token.token_type==="+"&&(ns=!0,this.advance());let ss=!1;this.token.token_type==="-"&&(ss=!0,this.advance());var os=this.term(rs);if(ss||ns){if(os===!1)return(ns?"+":"")+(ss?"-":"");if(typeof os=="string"&&[...os].every(ls=>["+","-"].includes(ls)))return(ns?"+":"")+(ss?"-":"")+os}for(os===!1&&(os="_"),ss&&(os=os>0?-os:["-",os]),ns&&(os=["+",os]);["+","-","UNION","INTERSECT","PERP","PARALLEL"].includes(this.token.token_type);){let ls=this.token.token_type.toLowerCase(),us=!1,cs=!1;this.token.token_type==="-"?(ls="+",us=!0,this.advance()):(this.advance(),ls==="+"&&this.token.token_type==="-"&&(us=!0,cs=!0,this.advance()));let ds=this.term(rs);if(ls==="+"){if(ds===!1&&(typeof os=="number"||typeof os=="string"))return cs?os+"+-":us?os+"-":os+"+";if(typeof ds=="string"&&[...ds].every(ps=>["+","-"].includes(ps))&&(typeof os=="number"||typeof os=="string"))return cs?os+"+-"+ds:us?os+"-"+ds:os+"+"+ds}ds===!1&&(ds="_"),us&&(ds=ds>0?-ds:["-",ds]),os=[ls,os,ds]}return os}term(rs){var ns=this.factor(rs),ss=!1;do if(ss=!1,this.token.token_type==="*"){this.advance(),ns===!1&&(ns="_");let os=this.factor(rs);os===!1&&(os="_"),ns=["*",ns,os],ss=!0}else if(this.token.token_type==="/"){this.advance(),ns===!1&&(ns="_");let os=this.factor(rs);os===!1&&(os="_"),ns=["/",ns,os],ss=!0}else{let os=Object.assign({},rs);os.allow_absolute_value_closing=!0;let ls=this.nonMinusFactor(os);ls!==!1&&(ns===!1&&(ns="_"),ns=["*",ns,ls],ss=!0)}while(ss);return this.convert_units_in_term(flatten$6(ns))}convert_units_in_term(rs){if(!Array.isArray(rs))return rs;let ns=rs[0],ss=rs.slice(1);if(ns==="*"){let os=ss.length;for(let[ls,us]of ss.entries()){let cs=this.units[us];if(cs){if(cs.prefix&&ls0){let ds,ps=us;return cs.substitute&&(ps=cs.substitute),ds=ls===1?["unit",ss[0],ps]:["unit",["*",...ss.slice(0,ls)],ps],ls===os-1?ds:this.convert_units_in_term(["*",ds,...ss.slice(ls+1)])}}}return rs}return ns==="/"?["/",this.convert_units_in_term(ss[0]),this.convert_units_in_term(ss[1])]:rs}factor(rs){if(this.token.token_text==="+"){this.advance();let ss=this.factor(rs);return ss===!1?"+":typeof ss=="string"&&[...ss].every(os=>["+","-"].includes(os))?"+"+ss:["+",ss]}if(this.token.token_type==="-"){this.advance();let ss=this.factor(rs);return ss>0?-ss:ss===!1?"-":typeof ss=="string"&&[...ss].every(os=>["+","-"].includes(os))?"-"+ss:["-",ss]}let ns=this.nonMinusFactor(rs);return ns===!1&&this.token.token_type==="PERP"&&(ns="perp",this.advance()),ns}nonMinusFactor(rs){for(var ns=this.baseFactor(rs);this.token.token_type==="^"||this.token.token_type==="!"||this.token.token_type==="'";)ns===!1&&(ns="_"),this.token.token_type==="^"?(this.advance(),ns=["^",ns,this.get_subsuperscript(rs)]):this.token.token_type==="!"?(ns=["apply","factorial",ns],this.advance()):(ns=["prime",ns],this.advance());return ns}get_subsuperscript({parse_absolute_value:rs}){if(["+","-","PERP"].includes(this.token.token_type)){let ns=this.token.token_type.toLowerCase();return this.advance(),ns}{let ns=this.baseFactor({parse_absolute_value:rs,in_subsuperscript_with_no_delimiters:!0});return ns===!1&&(ns="_"),ns}}baseFactor({inside_absolute_value:rs=0,parse_absolute_value:ns=!0,allow_absolute_value_closing:ss=!1,in_subsuperscript_with_no_delimiters:os=!1}={}){var ls=!1;if(this.token.token_type==="NUMBER")ls=parseFloat(this.token.token_text),this.advance();else if(this.token.token_type==="INFINITY")ls=1/0,this.advance();else if(this.token.token_type==="VAR"||this.token.token_type==="VARMULTICHAR"){if(ls=this.token.token_text,this.appliedFunctionSymbols.includes(ls)||this.functionSymbols.includes(ls)){let us=!1;if(this.appliedFunctionSymbols.includes(ls)&&(us=!0),this.advance(),this.token.token_type==="_"){this.advance();let cs=this.get_subsuperscript({parse_absolute_value:ns});ls=ls==="log"&&cs===10?"log10":["_",ls,cs]}if(os)us&&(ls=["apply",ls,"_"]);else{for(;this.token.token_type==="'";)ls=["prime",ls],this.advance();for(;this.token.token_type==="^";)this.advance(),ls=["^",ls,this.get_subsuperscript({parse_absolute_value:ns})];if(this.token.token_type==="("){this.advance();let cs=this.statement_list();if(this.token.token_type!==")")throw new ParseError("Expecting )",this.lexer.location);this.advance(),cs[0]==="list"&&(cs[0]="tuple"),ls=["apply",ls,cs]}else if(us){if(!this.allowSimplifiedFunctionApplication)throw new ParseError("Expecting ( after function",this.lexer.location);let cs=this.factor({parse_absolute_value:ns});cs===!1&&(cs="_"),ls=["apply",ls,cs]}}return ls}if(this.operatorSymbols.includes(ls))if(this.advance(),this.token.token_type==="("){this.advance();let us=this.statement_list();if(this.token.token_type!==")")throw new ParseError("Expecting )",this.lexer.location);this.advance(),ls=us[0]==="list"?[ls,...us.slice(1)]:[ls,us]}else{let us=this.factor({parse_absolute_value:ns});us===!1&&(us="_"),ls=[ls,us]}else{if(this.parseLeibnizNotation){let cs=this.return_state(),ds=this.leibniz_notation();if(ds)return ds;this.set_state(cs)}let us=this.splitSymbols;if(us&&(this.token.token_type==="VARMULTICHAR"||this.unsplitSymbols.includes(ls)||ls.length===1||ls.match(/[\d]/g))&&(us=!1),us){for(let cs=ls.length-1;cs>=0;cs--)this.lexer.unput(" "),this.lexer.unput(ls[cs]);return this.advance(),this.baseFactor({inside_absolute_value:rs,parse_absolute_value:ns,allow_absolute_value_closing:ss})}this.advance()}}else if(this.token.token_type==="("||this.token.token_type==="["||this.token.token_type==="{"||this.token.token_type==="LANGLE"){let us,cs,ds=this.token.token_type;this.token.token_type==="("?(us=")",cs="]"):this.token.token_type==="["?(us="]",cs=")"):this.token.token_type==="{"?(us="}",cs=null):(us="RANGLE",cs=null),this.advance();let ps=1;if((ls=this.statement_list())[0]==="list"&&(ps=ls.length-1),this.token.token_type!==us){if(ps!==2||cs===null)throw new ParseError("Expecting "+us,this.lexer.location);if(this.token.token_type!==cs)throw new ParseError("Expecting ) or ]",this.lexer.location);let fs;ls[0]="tuple",fs=ds==="("?["tuple",!1,!0]:["tuple",!0,!1],(ls=["interval",ls]).push(fs)}else ps>=2?ls[0]=ds==="("?"tuple":ds==="["?"array":ds==="{"?"set":"altvector":ds==="{"&&(ls=(ls[0]==="|"||ls[0],["set",ls]));this.advance()}else if(this.token.token_type!=="|"||!ns||rs!==0&&ss){if(this.token.token_type==="ANGLE")if(this.advance(),this.token.token_type==="("){this.advance();let us=this.statement_list();if(this.token.token_type!==")")throw new ParseError("Expecting )",this.lexer.location);this.advance(),us[0]==="list"?ls=["angle",...us.slice(1)]:us[0]==="*"&&(ls=["angle",us])}else{let us=[],cs=this.nonMinusFactor({parse_absolute_value:ns});for(;cs!==!1;)us.push(cs),cs=this.nonMinusFactor({parse_absolute_value:ns});ls=us.length===0?"angle":["angle",...us]}else if(this.token.token_type==="INT"){this.advance();let us="int";this.token.token_type==="_"&&(this.advance(),us=["_",us,this.get_subsuperscript({parse_absolute_value:ns})]),this.token.token_type==="^"&&(this.advance(),us=["^",us,this.get_subsuperscript({parse_absolute_value:ns})]);let cs=flatten$6(this.term({parse_absolute_value:ns}));if(Array.isArray(cs)&&cs[0]==="*"){let ds=[];for(let ps=0;ps2&&(this.lexer.unput(this.token.token_text.slice(2)),this.token.token_text=this.token.token_text.slice(0,2));let ds=this.token.token_text;if(ds.length===2){if(!/[a-zA-Z]/.exec(ds[1]))return!1;ls.push(ds[1])}else{if(this.advance(),(this.token.token_type!=="VAR"||this.token.token_text.includes("∂"))&&this.token.token_type!=="VARMULTICHAR")return!1;ls.push(this.token.token_text)}let ps=1,fs=!1;if(this.advance({remove_initial_space:!1}),this.token.token_type==="SPACE"&&(fs=!0,this.advance()),this.token.token_type==="^"){if(this.advance(),this.token.token_type!=="NUMBER"||(ps=parseFloat(this.token.token_text),!Number.isInteger(ps)))return!1;fs=!1,this.advance({remove_initial_space:!1}),this.token.token_type==="SPACE"&&(fs=!0,this.advance())}if(us.push(ps),cs+=ps,cs>ss)return!1;if(cs===ss){if(!fs&&(this.token.token_type==="VAR"||this.token.token_type==="VARMULTICHAR"))return!1;this.token.token_type==="SPACE"&&this.advance();let hs="derivative_leibniz";ns==="∂"&&(hs="partial_"+hs),rs=[hs],ss===1?rs.push(os):rs.push(["tuple",os,ss]);let gs=[];for(let ys=0;ysws[Ss+1]);if(Cs.length!==hs||Ns.length!==hs)return subtree;let As=["+",...Cs.map((ws,Es)=>["*",ws,Ns[Es]])];Ts.push(As)}vs.push(Ts)}return{success:!0,newMatrix:["matrix",["tuple",fs,gs],vs]}}function ls(ds,ps){let fs=ds[1][1],hs=ds[1][2],gs=ds[2],ys=["tuple"];for(let bs=0;bs=0;ys--){let bs=hs[ys][0];if(bs==="matrix"){let vs=os(hs[ys],fs);if(!vs.success)break;fs=vs.newMatrix,hs.pop()}else{if(["tuple","list","vector","altvector","interval","set","array"].includes(bs))break;hs[ys]!==1&&(fs=ls(fs,hs[ys])),hs.pop()}}for(;gs.length>0;){let ys=gs[0][0];if(ys==="matrix"){let bs=os(fs,gs[0]);if(!bs.success)break;fs=bs.newMatrix,gs.splice(0,1)}else{if(["tuple","list","vector","altvector","interval","set","array"].includes(ys))break;gs[0]!==1&&(fs=ls(fs,gs[0])),gs.splice(0,1)}}return hs.length>0||gs.length>0?["*",...hs,fs,...gs]:fs}return ds}),(rs||ns)&&(us=["*",["matrix",["tuple","m","n"],"matrixData"],"b"],cs={variables:{n:Number.isInteger,m:Number.isInteger,matrixData:!0,b:!0}},ss=transform$1(ss,function(ds){let ps=match$2(ds,us,cs);if(ps){let fs,hs=ps.m,gs=ps.n,ys=ps.b,bs=ps.matrixData,vs=[];rs&&(vs.push("vector"),vs.push("altvector")),ns&&vs.push("tuple");let xs=[];if(vs.includes(ys[0]))fs=ys;else{if(!Array.isArray(ys)||ys[0]!=="*"||!vs.includes(ys[1][0]))return ds;fs=ys[1],xs=ys.slice(2)}let Cs=fs.slice(1);if(Cs.length!==gs)return ds;let Ts=[fs[0]];for(let Ss=0;Ss["*",As,Cs[ws]])];Ts.push(Ns)}return xs.length>0?["*",Ts,...xs]:Ts}return ds})),ss}function perform_vector_scalar_multiplications(as,rs=!0){var ns=get_tree(as);let ss=function(os,ls){let us=["*","a",[ls,"vectorData"],"b"],cs={allow_implicit_identities:["a","b"]};return os=transform$1(os,function(ds){let ps=match$2(ds,us,cs);if(ps){if(ps.a===1&&ps.b===1)return ds;let fs=ps.vectorData;fs=Array.isArray(fs)&&fs[0]===ls?fs.slice(1):[fs];let hs=[],gs=[];Array.isArray(ps.a)&&ps.a[0]==="*"?hs.push(...ps.a.slice(1)):hs.push(ps.a),Array.isArray(ps.b)&&ps.b[0]==="*"?gs.push(...ps.b.slice(1)):gs.push(ps.b);for(let bs=hs.length-1;bs>=0;bs--){let vs=hs[bs][0];if(["tuple","list","vector","altvector","interval","set","array","matrix"].includes(vs))break;hs[bs]!==1&&(fs=fs.map(xs=>["*",xs,hs[bs]])),hs.pop()}for(;gs.length>0;){let bs=gs[0][0];if(["tuple","list","vector","altvector","interval","set","array","matrix"].includes(bs))break;gs[0]!==1&&(fs=fs.map(vs=>["*",vs,gs[0]])),gs.splice(0,1)}let ys=[ls,...fs];return hs.length>0||gs.length>0?["*",...hs,ys,...gs]:ys}return ds}),os};return ns=ss(ns,"vector"),ns=ss(ns,"altvector"),rs&&(ns=ss(ns,"tuple")),ns}function perform_matrix_scalar_multiplications(as){var rs=get_tree(as);let ns=["*","a",["matrix","size","matrixData"],"b"],ss={allow_implicit_identities:["a","b"]};return rs=transform$1(rs,function(os){let ls=match$2(os,ns,ss);if(ls){if(ls.a===1&&ls.b===1)return os;let us=ls.matrixData,cs=[],ds=[];Array.isArray(ls.a)&&ls.a[0]==="*"?cs.push(...ls.a.slice(1)):cs.push(ls.a),Array.isArray(ls.b)&&ls.b[0]==="*"?ds.push(...ls.b.slice(1)):ds.push(ls.b);for(let fs=cs.length-1;fs>=0;fs--){let hs=cs[fs][0];if(["tuple","list","vector","altvector","interval","set","array","matrix"].includes(hs))break;cs[fs]!==1&&(us=us.map(gs=>gs==="tuple"?gs:gs.map(ys=>ys==="tuple"?ys:["*",ys,cs[fs]]))),cs.pop()}for(;ds.length>0;){let fs=ds[0][0];if(["tuple","list","vector","altvector","interval","set","array","matrix"].includes(fs))break;ds[0]!==1&&(us=us.map(hs=>hs==="tuple"?hs:hs.map(gs=>gs==="tuple"?gs:["*",gs,ds[0]]))),ds.splice(0,1)}let ps=["matrix",ls.size,us];return cs.length>0||ds.length>0?["*",...cs,ps,...ds]:ps}return os}),rs}function expand_relations(as){var rs=get_tree(as);return transform$1(rs,expand_relations_transform)}function expand_relations_transform(as){if(!Array.isArray(as))return as;var rs=as[0],ns=as.slice(1);if(rs==="="){if(ns.length<=2)return as;let ss=["and"];for(let os=0;os":rs==="lts"?"le":"ge",ls.push([ds,ss[cs],ss[cs+1]])}let us=["and",ls[0],ls[1]];for(let cs=2;cs",ss,ps]),cs[2]?ls?hs.push([">",ss,fs]):hs.push(["le",ss,fs]):ls?hs.push(["ge",ss,fs]):hs.push(["<",ss,fs]),ds=ls?["or"].concat(hs):["and"].concat(hs),ds}if(rs==="subset"||rs==="notsubset"||rs==="superset"||rs==="notsuperset"){let ss,os,ls=!1;if(rs!=="notsubset"&&rs!=="notsuperset"||(ls=!0),rs==="subset"||rs==="notsubset"?(ss=ns[0],os=ns[1]):(ss=ns[1],os=ns[0]),ss=to_intervals(ss),os=to_intervals(os),ss[0]!=="interval"||os[0]!=="interval")return as;let us=ss[1],cs=ss[2],ds=os[1],ps=os[2];if(us[0]!=="tuple"||cs[0]!=="tuple"||ds[0]!=="tuple"||ps[0]!=="tuple")throw new Error("Badly formed ast");let fs,hs=us[1],gs=us[2],ys=ds[1],bs=ds[2],vs=[];return cs[1]&&!ps[1]?ls?vs.push(["le",hs,ys]):vs.push([">",hs,ys]):ls?vs.push(["<",hs,ys]):vs.push(["ge",hs,ys]),cs[2]&&!ps[2]?ls?vs.push(["ge",gs,bs]):vs.push(["<",gs,bs]):ls?vs.push([">",gs,bs]):vs.push(["le",gs,bs]),fs=ls?["or"].concat(vs):["and"].concat(vs),fs}return as}function substitute(as,rs){var ns=get_tree(as),ss={};for(let os in rs)ss[os]=get_tree(rs[os]);return substitute$1(ns,ss)}function substitute_component(as,rs,ns){let ss=get_tree(as);if(get_tree(ns),typeof rs=="number")rs=[rs];else if(!Array.isArray(rs))throw Error("Invalid substitute_component: "+rs);let os=["list","tuple","vector","altvector","array"];return function ls(us,cs,ds){if(cs.length===0)return ns;if(!Array.isArray(us))throw Error("Invalid substitute_component: expected list, tuple, vector, or array");let ps=us[0],fs=us.slice(1);if(!os.includes(ps))throw Error("Invalid substitute_component: expected list, tuple, vector, or array");let hs=cs[0];if(hs<0||hs>fs.length-1)throw Error("Invalid substitute_component: component out of range");let gs=cs.slice(1),ys=ls(fs[hs],gs);return[ps,...fs.slice(0,hs),ys,...fs.slice(hs+1)]}(ss,rs)}function get_component(as,rs){let ns=get_tree(as);if(typeof rs=="number")rs=[rs];else if(!Array.isArray(rs))throw Error("Invalid get_component: "+rs);let ss=["list","tuple","vector","altvector","array"];return function os(ls,us){if(us.length===0)return ls;if(!Array.isArray(ls))throw Error("Invalid get_component: expected list, tuple, vector, or array");let cs=ls[0],ds=ls.slice(1);if(!ss.includes(cs))throw Error("Invalid get_component: expected list, tuple, vector, or array");let ps=us[0];if(ps<0||ps>ds.length-1)throw Error("Invalid get_component: component out of range");let fs=us.slice(1);return os(ds[ps],fs)}(ns,rs)}var transformation=Object.freeze({__proto__:null,expand,expand_relations,substitute,substitute_component,get_component,perform_vector_scalar_multiplications,perform_matrix_scalar_multiplications,perform_matrix_multiplications});function clean(as){return flatten$5(get_tree(as))}function evalf(as,rs){return parseFloat(math$1.format(as,{notation:"exponential",precision:rs}))}function collapse_unary_minus(as){var rs=get_tree(as);if(!Array.isArray(rs))return rs;var ns=rs[0],ss=rs.slice(1);if(ss=ss.map(os=>collapse_unary_minus(os)),ns==="-"){if(typeof ss[0]=="number")return-ss[0];if(Array.isArray(ss[0])&&ss[0][0]==="*"&&typeof ss[0][1]=="number")return["*",-ss[0][1]].concat(ss[0].slice(2));if(Array.isArray(ss[0])&&ss[0][0]==="/"){if(typeof ss[0][1]=="number")return["/",-ss[0][1],ss[0][2]];if(Array.isArray(ss[0][1])&&ss[0][1][0]==="*"&&typeof ss[0][1][1]=="number")return["/",["*",-ss[0][1][1]].concat(ss[0][1].slice(2)),ss[0][2]]}}return[ns].concat(ss)}function simplify(as,rs,ns){var ss=get_tree(as);return contains_blank(ss)?ss:(rs===void 0&&as.context!==void 0&&as.context.get_assumptions!==void 0&&(rs=as.context.get_assumptions([as.variables()])),ss=evaluate_numbers(ss,{assumptions:rs,max_digits:ns,evaluate_functions:!0}),Array.isArray(ss)?ss=collect_like_terms_factors(ss=perform_vector_matrix_additions_scalar_multiplications(ss=simplify_logical(ss,rs)),rs,ns):ss)}function simplify_logical(as,rs){var ns=get_tree(as);if(contains_blank(ns))return ns;rs===void 0&&as.context!==void 0&&as.context.get_assumptions!==void 0&&(rs=as.context.get_assumptions([as.variables()])),ns=evaluate_numbers(ns,{assumptions:rs}),ns=unflattenRight(ns);var ss=[];return ss.push([["not",["not","a"]],"a"]),ss.push([["not",["and","a","b"]],["or",["not","a"],["not","b"]]]),ss.push([["not",["or","a","b"]],["and",["not","a"],["not","b"]]]),ss.push([["not",["=","a","b"]],["ne","a","b"]]),ss.push([["not",["ne","a","b"]],["=","a","b"]]),ss.push([["not",["<","a","b"]],["le","b","a"]]),ss.push([["not",["le","a","b"]],["not",["le","a","b"]]]),ss.push([["not",["in","a","b"]],["notin","a","b"]]),ss.push([["not",["subset","a","b"]],["notsubset","a","b"]]),ns=flatten$5(ns=applyAllTransformations(ns,ss,20))}function perform_vector_matrix_additions_scalar_multiplications(as,rs=!0){var ns=get_tree(as);ns=perform_vector_scalar_multiplications(ns=perform_matrix_scalar_multiplications(ns),rs);let ss=["+","a","b"];return ns=transform$1(ns,function(os){let ls=match$2(os,ss,{allow_permutations:!0});if(ls){let us=["vector","altvector"];rs&&us.push("tuple");let cs={},ds={},ps=[];if(us.includes(ls.a[0])){let hs=ls.a.length-1;cs[hs]||(cs[hs]=[]),cs[hs].push(ls.a)}else if(ls.a[0]==="matrix"){let hs=ls.a[1].slice(1).toString();ds[hs]||(ds[hs]=[]),ds[hs].push(ls.a)}else ps.push(ls.a);if(us.includes(ls.b[0])){let hs=ls.b.length-1;cs[hs]||(cs[hs]=[]),cs[hs].push(ls.b)}else if(ls.b[0]==="matrix"){let hs=ls.b[1].slice(1).toString();ds[hs]||(ds[hs]=[]),ds[hs].push(ls.b)}else if(ls.b[0]==="+")for(let hs of ls.b.slice(1))if(us.includes(hs[0])){let gs=hs.length-1;cs[gs]||(cs[gs]=[]),cs[gs].push(hs)}else if(hs[0]==="matrix"){let gs=hs[1].slice(1).toString();ds[gs]||(ds[gs]=[]),ds[gs].push(hs)}else ps.push(hs);else ps.push(ls.b);if(Object.values(cs).every(hs=>hs.length<2)&&Object.values(ds).every(hs=>hs.length<2))return os;let fs=ps;for(let hs in cs)if(cs[hs].length<2)fs.push(...cs[hs]);else{let gs,ys=cs[hs].some(xs=>xs[0]==="vector"),bs=cs[hs].some(xs=>xs[0]==="tuple"),vs=cs[hs].some(xs=>xs[0]==="altvector");gs=ys||bs&&vs?["vector"]:vs?["altvector"]:["tuple"];for(let xs=0;xsCs[xs+1])]);fs.push(gs)}for(let hs in ds)if(ds[hs].length<2)fs.push(...ds[hs]);else{let[gs,ys]=hs.split(",").map(Number),bs=["tuple"];for(let xs=0;xsSs[2][xs+1][Ts+1])]);bs.push(Cs)}let vs=["matrix",["tuple",gs,ys],bs];fs.push(vs)}return fs.length===1?fs[0]:["+",...fs]}return os}),ns}function contains_decimal_number(as){return typeof as!="string"&&(typeof as=="number"?!(!Number.isFinite(as)||Number.isInteger(as)):!!Array.isArray(as)&&as.slice(1).some(rs=>contains_decimal_number(rs)))}function contains_only_numbers(as,{include_number_symbols:rs=!1,evaluate_functions:ns=!1}={}){return typeof as=="string"?rs&&(as==="e"&&math$1.define_e||as==="pi"&&math$1.define_pi)?!0:!(as!=="i"||!math$1.define_i):typeof as=="number"||!!Array.isArray(as)&&(ns&&as[0]==="apply"?as.slice(2).every(ss=>contains_only_numbers(ss,{include_number_symbols:rs})):as.slice(1).every(ss=>contains_only_numbers(ss,{include_number_symbols:rs})))}function try_evaluate_sum_of_numbers(as,rs,ns){if(typeof as=="number"){if(as===0)return rs;if(typeof rs=="number")return as+rs;if(Array.isArray(rs)&&rs[0]==="+"&&typeof rs[1]=="number")return["+",as+rs[1],rs[2]];if(!ns&&Array.isArray(rs)&&rs[0]==="+"&&typeof rs[2]=="number")return["+",as+rs[2],rs[1]]}return typeof rs=="number"&&rs===0?as:null}function try_evaluate_negate_number(as){if(typeof as=="number")return-as;if(Array.isArray(as)&&as[0]==="*"&&typeof as[1]=="number")return["*",-as[1]].concat(as.slice(2));if(Array.isArray(as)&&as[0]==="/"){if(typeof as[1]=="number")return["/",-as[1],as[2]];if(Array.isArray(as[1])&&as[1][0]==="*"&&typeof as[1][1]=="number")return["/",["*",-as[1][1]].concat(as[1].slice(2)),as[2]]}return null}function try_evaluate_product_of_numbers(as,rs){if(typeof as=="number"){if(isNaN(as))return NaN;if(typeof rs=="number")return as*rs;if(!isFinite(as))return as===1/0&&is_negative_ast(rs)||as===-1/0&&is_positive_ast(rs)?-1/0:is_nonzero_ast(rs)===!1?NaN:1/0;if(as===0)return 0;if(as===1)return rs;if(as===-1)return["-",rs];if(Array.isArray(rs)&&rs[0]==="*"&&typeof rs[1]=="number")return as*=rs[1],rs=rs[2],as===1?rs:as===-1?["-",rs]:["*",as,rs]}if(typeof rs=="number"){if(isNaN(rs))return NaN;if(!isFinite(rs))return rs===1/0&&is_negative_ast(as)||rs===-1/0&&is_positive_ast(as)?-1/0:is_nonzero_ast(as)===!1?NaN:1/0;if(rs===0)return 0;if(rs===1)return as;if(rs===-1)return["-",as];if(Array.isArray(as)&&as[0]==="*"&&typeof as[1]=="number")return rs*=as[1],as=as[2],rs===1?as:rs===-1?["-",as]:["*",as,rs]}if(math$1.define_i&&as==="i"){if(rs==="i")return-1;if(Array.isArray(rs)&&rs[0]==="*"&&rs[1]==="i")return["-",rs[2]]}else if(math$1.define_i&&rs==="i"&&Array.isArray(as)&&as[0]==="*"&&as[1]==="i")return["-",as[2]];return null}function try_evaluate_quotient_of_numbers(as,rs,ns,ss){if(typeof as=="number"){if(as===0){let os=is_nonzero_ast(rs,ns);if(os)return 0;if(os===!1)return NaN}if(typeof rs=="number"){let os=as/rs;if(ss===1/0||math$1.round(os,ss)===os)return os;if(rs<0)return["/",-as,-rs]}if(Array.isArray(rs)&&rs[0]==="*"&&typeof rs[1]=="number"){let os=as/rs[1];if(ss===1/0||math$1.round(os,ss)===os)return["/",os,rs[2]]}}else if(typeof rs=="number"){if(Array.isArray(as)&&as[0]==="*"&&typeof as[1]=="number"){let ls=as[1]/rs;if(ss===1/0||math$1.round(ls,ss)===ls)return ls===1?as[2]:["*",ls,as[2]];if(rs<0)return["/",["*",-as[1],as[2]],-rs]}let os=1/rs;if(ss===1/0||math$1.round(os,ss)===os)return["*",os,as];if(rs<0)return Array.isArray(as)&&as[0]==="-"?["/",as[1],-rs]:["-",["/",as,-rs]]}return null}function evaluate_numbers_sub(as,rs,ns,ss,os,ls){if(as===void 0)return as;if(typeof as=="number")return ls>0&&math$1.abs(as)0&&math$1.abs(fs)evaluate_numbers_sub(ps,rs,ns,ss,os,ls));if(cs==="+"){let ps=ds[0],fs=ds[1];if(fs===void 0)return ps;let hs=try_evaluate_sum_of_numbers(ps,fs,ss);if(hs!==null)return hs;if(ps[0]==="unit"&&fs[0]==="unit"){let gs=get_unit_of_tree(ps),ys=get_unit_of_tree(fs);if(gs&&gs===ys){let bs=try_evaluate_sum_of_numbers(remove_units(ps,!1),remove_units(fs,!1),ss);if(bs!==null)return add_unit(bs,gs)}}return[cs].concat(ds)}if(cs==="-"){let ps=try_evaluate_negate_number(ds[0]);if(ps!==null)return ps;if(ds[0][0]==="unit"){let fs=get_unit_of_tree(ds[0]);if(fs){let hs=try_evaluate_negate_number(remove_units(ds[0],!1));if(hs!==null)return add_unit(hs,fs)}}return[cs].concat(ds)}if(cs==="*"){let ps=ds[0],fs=ds[1];if(fs===void 0)return ps;let hs=try_evaluate_product_of_numbers(ps,fs);if(hs!==null)return hs;if(ps[0]==="unit"&&fs[0]!=="unit"){let gs=get_unit_of_tree(ps);if(gs){let ys=try_evaluate_product_of_numbers(remove_units(ps,!1),fs);if(ys!==null)return add_unit(ys,gs)}}if(ps[0]!=="unit"&&fs[0]==="unit"){let gs=get_unit_of_tree(fs);if(gs){let ys=try_evaluate_product_of_numbers(ps,remove_units(fs,!1));if(ys!==null)return add_unit(ys,gs)}}return[cs].concat(ds)}if(cs==="/"){let ps=ds[0],fs=ds[1],hs=try_evaluate_quotient_of_numbers(ps,fs,rs,ns);if(hs!==null)return hs;if(ps[0]==="unit"&&fs[0]!=="unit"){let gs=get_unit_of_tree(ps);if(gs){let ys=try_evaluate_quotient_of_numbers(remove_units(ps,!1),fs,rs,ns);if(ys!==null)return add_unit(ys,gs)}}return[cs].concat(ds)}if(cs==="^"){let ps=ds[0],fs=ds[1];if(typeof fs=="number")if(fs===0){if(!math$1.pow_strict)return 1;let hs=is_nonzero_ast(ps,rs);if(hs&&ps!==1/0&&ps!==-1/0)return 1;if(hs===!1)return NaN}else{if(fs===1)return ps;if(typeof ps=="number"){let hs=math$1.pow(ps,fs);if(ns===1/0||math$1.round(hs,ns)===hs)return hs}}else if(ps===1)return 1;return[cs].concat(ds)}return[cs].concat(ds)}function evaluate_numbers(as,{assumptions:rs,max_digits:ns,skip_ordering:ss=!1,evaluate_functions:os=!1,set_small_zero:ls=0}={}){(ns===void 0||!Number.isInteger(ns)&&ns!==1/0)&&(ns=0),ls===!0&&(ls=1e-14);var us,cs=get_tree(as);return contains_blank(cs)?cs:(rs===void 0&&as.context!==void 0&&as.context.get_assumptions!==void 0&&(rs=as.context.get_assumptions([as.variables()])),ss?us=evaluate_numbers_sub(cs=unflattenRight(flatten$5(cs)),rs,ns,ss,os,ls):(cs=move_units_outside_products(cs),cs=unflattenRight(default_order(flatten$5(cs))),us=default_order(evaluate_numbers_sub(cs,rs,ns,ss,os,ls)),us=default_order(evaluate_numbers_sub(unflattenRight(us),rs,ns,ss,os,ls))),flatten$5(us=set_negative_zeros_to_zero(us)))}function set_negative_zeros_to_zero(as){return as===0?0:Array.isArray(as)?[as[0],...as.slice(1).map(set_negative_zeros_to_zero)]:as}function collect_like_terms_factors(as,rs,ns){function ss(ds){return typeof ds=="number"||!(!Array.isArray(ds)||ds[0]!=="-"||typeof ds[1]!="number")}function os(ds){return typeof ds=="number"&&ds<0||!(!Array.isArray(ds)||ds[0]!=="-"||typeof ds[1]!="number")}function ls(ds){if(typeof ds=="number"||Array.isArray(ds)&&ds[0]==="-"&&typeof ds[1]=="number")return!0;let ps=evaluate_to_constant(ds,!1);return!(typeof ps!="number"||!Number.isFinite(ps))}var us=get_tree(as);if(contains_blank(us))return us;rs===void 0&&as.context!==void 0&&as.context.get_assumptions!==void 0&&(rs=as.context.get_assumptions([as.variables()])),us=evaluate_numbers(us,{assumptions:rs,max_digits:ns,evaluate_functions:!0});var cs=[];cs.push([["/","x",["^","y","a"]],["*","x",["^","y",["-","a"]]],{evaluate_numbers:!0,max_digits:ns}]),cs.push([["/","x",["apply","exp","a"]],["*","x",["apply","exp",["-","a"]]],{evaluate_numbers:!0,max_digits:ns,variables:{x:!0,a:!0}}]),cs.push([["/","x","y"],["*","x",["^","y",["-",1]]],{evaluate_numbers:!0,max_digits:ns}]),us=applyAllTransformations(us,cs,40),cs=[];for(let ds in all_units)all_units[ds].prefix?(cs.push([["+",["unit",ds,"x"],["unit",ds,"y"]],["unit",ds,["+","x","y"]],{variables:{x:!0,y:!0},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["unit",ds,"x"],["-",["unit",ds,"y"]]],["unit",ds,["+","x",["-","y"]]],{variables:{x:!0,y:!0},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}])):(cs.push([["+",["unit","x",ds],["unit","y",ds]],["unit",["+","x","y"],ds],{variables:{x:!0,y:!0},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["unit","x",ds],["-",["unit","y",ds]]],["unit",["+","x",["-","y"]],ds],{variables:{x:!0,y:!0},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}]));return cs.push([["*",["^","x","n"],["^","x","m"]],["^","x",["+","n","m"]],{variables:{x:ds=>is_nonzero_ast(ds,rs),n:ss,m:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m","n"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["*",["^","x","n"],["^","x","m"]],["^","x",["+","n","m"]],{variables:{x:!0,n:ds=>ss(ds)&&is_positive_ast(ds,rs),m:ds=>ss(ds)&&is_positive_ast(ds,rs)},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m","n"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["*",["^","x","n"],["^","x","m"]],["^","x",["+","n","m"]],{variables:{x:!0,n:ds=>ss(ds)&&is_negative_ast(ds,rs),m:ds=>ss(ds)&&is_negative_ast(ds,rs)},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["*",["apply","exp","n"],["apply","exp","m"]],["apply","exp",["+","n","m"]],{variables:{n:ss,m:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m","n"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["*","n","x"],["*","m","x"]],["*",["+","n","m"],"x"],{variables:{x:!0,n:ss,m:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m","n"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["*","n1","x"],["*",["/","n2","m2"],"x"]],["*",["+","n1",["/","n2","m2"]],"x"],{variables:{x:!0,n1:ss,n2:ss,m2:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m2","n1","n2"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["*","n1","x"],["*",["-",["/","n2","m2"]],"x"]],["*",["+","n1",["-",["/","n2","m2"]]],"x"],{variables:{x:!0,n1:ss,n2:ss,m2:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m2","n1","n2"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["*",["/","n1","m1"],"x"],["*",["/","n2","m2"],"x"]],["*",["+",["/","n1","m1"],["/","n2","m2"]],"x"],{variables:{x:!0,n1:ss,m1:ss,n2:ss,m2:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m1","m2","n1","n2"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["*",["/","n1","m1"],"x"],["*",["-",["/","n2","m2"]],"x"]],["*",["+",["/","n1","m1"],["-",["/","n2","m2"]]],"x"],{variables:{x:!0,n1:ss,m1:ss,n2:ss,m2:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m1","m2","n1","n2"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["+",["*","n","x"],["-",["*","m","x"]]],["*",["+","n",["-","m"]],"x"],{variables:{x:!0,n:ss,m:ss},evaluate_numbers:!0,max_digits:ns,allow_implicit_identities:["m","n"],allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["^",["*","x","y"],"a"],["*",["^","x","a"],["^","y","a"]],{allow_permutations:!0}]),cs.push([["^",["^","x","n"],"m"],["^","x",["*","n","m"]],{variables:{x:!0,n:ss,m:ss},evaluate_numbers:!0,max_digits:ns,allow_permutations:!0}]),cs.push([["-",["+","a","b"]],["+",["-","a"],["-","b"]]]),cs.push([["*","x","y"],["*","x","y"],{variables:{x:ls,y:ls},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}]),us=applyAllTransformations(us,cs,40),(cs=[]).push([["*","x",["^","y",["-","a"]]],["/","x",["^","y","a"]],{allow_extended_match:!0,allow_permutations:!0,evaluate_numbers:!0,max_digits:ns,max_group:1}]),cs.push([["*","x",["apply","exp",["-","a"]]],["/","x",["apply","exp","a"]],{allow_extended_match:!0,allow_permutations:!0,evaluate_numbers:!0,max_digits:ns,max_group:1,variables:{x:!0,a:!0}}]),cs.push([["*","x",["^","y","n"]],["/","x",["^","y",["-","n"]]],{variables:{x:!0,y:!0,n:os},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["*","x",["apply","exp","n"]],["/","x",["apply","exp",["-","n"]]],{variables:{x:!0,n:os},evaluate_numbers:!0,max_digits:ns,allow_extended_match:!0,allow_permutations:!0,max_group:1}]),us=applyAllTransformations(us,cs,40),(cs=[]).push([["^","y","n"],["/",1,["^","y",["-","n"]]],{variables:{y:!0,n:os},evaluate_numbers:!0,max_digits:ns}]),cs.push([["apply","exp","n"],["/",1,["apply","exp",["-","n"]]],{variables:{n:os},evaluate_numbers:!0,max_digits:ns}]),us=applyAllTransformations(us,cs,40),(cs=[]).push([["*","x",["/","y","z"]],["/",["*","x","y"],"z"],{allow_extended_match:!0,allow_permutations:!0,max_group:1}]),cs.push([["/",["/","x","y"],"z"],["/","x",["*","y","z"]],{allow_extended_match:!0,allow_permutations:!0}]),cs.push([["/","x",["/","y","z"]],["/",["*","x","z"],"y"],{allow_extended_match:!0,allow_permutations:!0}]),us=evaluate_numbers(us=applyAllTransformations(us,cs,40),{assumptions:rs,max_digits:ns})}function simplify_ratios(as,rs){function ns(os){var ls=1;return os=os.map(function(us){if(typeof us=="number")return us<0?(ls*=-1,-us):us;if(!Array.isArray(us))return us;if(us[0]==="-")return ls*=-1,us[1];if(us[0]!=="+")return us;var cs=!1;if((typeof us[1]=="number"&&us[1]<0||Array.isArray(us[1])&&us[1][0]==="-"||Array.isArray(us[1])&&us[1][0]==="*"&&Number(us[1][1])<0)&&(cs=!0),cs){ls*=-1;var ds=us.slice(1).map(ps=>["-",ps]);return evaluate_numbers(["+"].concat(ds))}return us}),{factors:os,sign_change:ls}}var ss=get_tree(as);return contains_blank(ss)?ss:(rs===void 0&&as.context!==void 0&&as.context.get_assumptions!==void 0&&(rs=as.context.get_assumptions([as.variables()])),function os(ls,us){if(!Array.isArray(ls))return us?["-",ls]:ls;var cs=ls[0];if(cs==="-")return os(ls[1],us=!0);var ds=ls.slice(1).map(vs=>os(vs));if(cs!=="/")return us?["-",[cs,...ds]]:[cs,...ds];var ps,fs=ds[0],hs=ds[1];fs=default_order(fs,{ignore_negatives:!0});var gs,ys=ns(ps=Array.isArray(fs)&&fs[0]==="*"?fs.slice(1):[fs]);ps=ys.factors,us&&(ys.sign_change*=-1),hs=default_order(hs,{ignore_negatives:!0});var bs=ns(gs=Array.isArray(hs)&&hs[0]==="*"?hs.slice(1):[hs]);return gs=bs.factors,ys.sign_change*bs.sign_change<0&&(ps[0]=["-",ps[0]]),["/",fs=ps.length===1?ps[0]:["*"].concat(ps),hs=gs.length===1?gs[0]:["*"].concat(gs)]}(ss))}function contains_blank(as){return as==="_"||!!Array.isArray(as)&&as.some(contains_blank)}let all_units=get_all_units();function remove_units(as,rs=!0){var ns=get_tree(as);if(!Array.isArray(ns))return ns;let ss=ns[0],os=ns.slice(1);if(ss==="unit"){let ls=all_units[get_unit_of_tree(ns)];if(!ls)return ns;let us=remove_units(ls.prefix?os[1]:os[0],rs);return rs?ls.scale(us):us}return[ss,...os.map(ls=>remove_units(ls,rs))]}function remove_scaling_units(as){var rs=get_tree(as);if(!Array.isArray(rs))return rs;let ns=rs[0],ss=rs.slice(1);if(ns==="unit"){let os=all_units[get_unit_of_tree(rs)];if(!os||!os.only_scales)return rs;let ls=remove_scaling_units(os.prefix?ss[1]:ss[0]);return os.scale(ls)}return[ns,...ss.map(os=>remove_scaling_units(os))]}function add_unit(as,rs){var ns=get_tree(as);let ss=all_units[rs];return ss?ss.prefix?["unit",rs,ns]:["unit",ns,rs]:ns}function move_units_outside_products(as){if(!Array.isArray(as))return as;let rs=as[0],ns=as.slice(1);if(rs==="*"){let ss=[],os=[];for(let us of ns){let cs=get_unit_value_of_tree(us);cs?(ss.push(cs[0]),os.push(cs[1])):os.push(us)}let ls=["*",...os];for(let us of ss)ls=add_unit(ls,us);return ls}return[rs,...ns.map(move_units_outside_products)]}var simplify$1=Object.freeze({__proto__:null,clean,simplify,simplify_logical,evaluate_numbers,collect_like_terms_factors,collapse_unary_minus,simplify_ratios,default_order,perform_vector_matrix_additions_scalar_multiplications,remove_units,add_unit,remove_scaling_units});function solve_linear(as,rs,ns){if(typeof rs=="string"){ns===void 0&&as.context!==void 0&&as.context.get_assumptions!==void 0&&(ns=as.context.get_assumptions([as.variables()]));var ss=simplify(get_tree(as),ns);if(Array.isArray(ss)){var os=ss[0],ls=ss.slice(1);if(os==="="||os==="ne"||os==="<"||os==="le"||os===">"||os==="ge"){var us=simplify(["+",ls[0],["-",ls[1]]],ns),cs=gs=>!variables(gs).includes(rs);if(variables(us=simplify(applyAllTransformations(us,[[["+",["*","_a",rs],["*","_b",rs]],["*",["+","_a","_b"],rs],{variables:{_a:cs,_b:cs},allow_permutations:!0,allow_extended_match:!0,allow_implicit_identities:["_a","_b"],evaluate_numbers:!0}]],20))).includes(rs)){var ds=match$2(us,["+",["*","_a",rs],"_b"],{variables:{_a:cs,_b:cs},allow_permutations:!0,allow_implicit_identities:["_a","_b"]});if(ds){var ps=simplify(ds._a),fs=simplify(ds._b);if(is_nonzero_ast(ps,ns)){if(os==="="||os==="ne"||is_positive_ast(ps,ns)){let gs=simplify(["/",["-",fs],ps]);return[os,rs,gs]}if(is_negative_ast(ps,ns)){var hs=simplify(["/",["-",fs],ps]);return[os=os==="<"?">":os==="le"?"ge":os===">"?"<":"le",rs,hs]}}}}}}}}var solve=Object.freeze({__proto__:null,solve_linear});function clean_assumptions(as,rs){if(!Array.isArray(as)||as.length===0)return as;var ns=(as=flatten$5(default_order(simplify_logical(expand_relations(as)))))[0],ss=as.slice(1);if(ns==="and"||ns==="or"){if(ss=ss.reduce(function(os,ls){return os.every(function(us){return!equal$2(us,ls)})&&os.push(ls),os},[]),ns==="and"&&rs&&Array.isArray(rs)){let os;os=rs[0]==="and"?rs.slice(1):[rs],ss=ss.filter(ls=>os.every(us=>!equal$2(us,ls)))}as=ss.length===1?ss[0]:[ns].concat(ss)}if(ns!=="and"&&rs&&Array.isArray(rs)){let os;if(os=rs[0]==="and"?rs.slice(1):[rs],!os.every(ls=>!equal$2(ls,as)))return}return as}function calculate_derived_assumptions(as,rs){if(rs===void 0){rs=[];for(let ds in as.byvar){let ps=as.byvar[ds];ps.length>0&&rs.push(ps)}if(rs.length===0)return{};rs=clean_assumptions(rs=rs.length===1?rs[0]:["and"].concat(rs))}if(!Array.isArray(rs)||rs.length===0)return{};var ns=rs[0],ss=rs.slice(1);if(ns==="and"||ns==="or"){let ds=ss.map(function(hs){return calculate_derived_assumptions(as,hs)}),ps=[...new Set(ds.reduce((hs,gs)=>[...hs,...Object.keys(gs)],[]))],fs={};for(let hs of ps){let gs=ds.reduce(function(ys,bs){return bs[hs]!==void 0&&ys.push(bs[hs]),ys},[]);if(ns==="and"||gs.length===ds.length){let ys=fs[hs];ys=ys===void 0?gs.length>1?[ns].concat(gs):gs[0]:gs.length>1?["and",ys,[ns].concat(gs)]:["and",ys,gs[0]],fs[hs]=clean_assumptions(ys,get_assumptions(as,hs,{omit_derived:!0}))}}return fs}let os={};if(ns==="="||ns==="ne"||ns==="<"||ns==="le"||ns==="in"||ns==="subset"||ns==="notin"||ns==="notsubset"){var ls=!1;for(let ds=0;ds<2;ds++){let ps=ss[ds],fs=ss[1-ds],hs=variables(fs);if(typeof ps!="string"||hs.length===0||hs.includes(ps))continue;ls=!0;var us=ns;ds===1&&(ns==="<"?us=">":ns==="le"?us="ge":ns==="in"?us="ni":ns==="subset"?us="superset":ns==="notin"?us="notni":ns==="notsubset"&&(us="notsuperset"));let gs=get_assumptions_for_expr(as,fs,[ps]);if(gs=combine_assumptions(ps,us,fs,gs),gs!==void 0){let ys=os[ps];ys=ys===void 0?gs:["and",ys,gs],os[ps]=clean_assumptions(ys,get_assumptions(as,ps,{omit_derived:!0}))}}if(ls)return os}let cs=[];for(let ds of ss){let ps=get_assumptions_for_expr(as,ds,[]);ps!==void 0&&cs.push(ps)}if(cs.length===0)return{};cs=cs.length===1?cs[0]:["and"].concat(cs);for(let ds of variables(rs))os[ds]=clean_assumptions(cs,get_assumptions(as,ds,{omit_derived:!0}));return os}function get_assumptions_for_expr(as,rs,ns){let ss=variables(rs);if(ss=ss.filter(gs=>!ns.includes(gs)),ss.length===0)return;function os(gs){return typeof gs=="number"||!(!Array.isArray(gs)||gs[0]!=="-"||typeof gs[1]!="number")}var ls=["_b"],us=["_b"],cs={_b:os},ds={};for(let gs=0;gsEs!==void 0);return ws.length===0?void 0:bs==="or"?ws.length===vs.length?["or"].concat(ws):void 0:ws.length===1?ws[0]:["and"].concat(ws)}if(!(["=","ne","<","le"].includes(bs)||["in","notin","subset","notsubset"].includes(bs)&&fs)){let ws=ns.concat(variables(rs)),Es=[];for(let _s of variables(ys)){if(ws.includes(_s))continue;let $s=get_assumptions_for_expr(as,_s,ws);$s!==void 0&&Es.push($s)}return Es.length===0?ys:Es.length===1?["and",ys,Es[0]]:["and",ys].concat(Es)}let xs=[];for(let ws=0;ws<=1;ws++){let Es=vs[ws],_s=vs[1-ws];if(typeof Es=="string"&&ss.includes(Es)){var Cs={};Cs[Es]=_s;var Ts=simplify(substitute$1(rs,Cs)),Ss=!1,Ns=bs;(ws===1&&ds[Es]>0||ws===0&&ds[Es]<0)&&(bs==="<"?(Ss=!0,Ns=">"):bs==="le"?(Ss=!0,Ns="ge"):bs==="in"?(Ss=!0,Ns="ni"):bs==="subset"?(Ss=!0,Ns="superset"):bs==="notin"?(Ss=!0,Ns="notni"):bs==="notsubset"&&(Ss=!0,Ns="notsuperset")),Ss?xs.push([bs,Ts,rs]):xs.push([bs,rs,Ts]);let $s=ns.concat([Es]),Rs=get_assumptions_for_expr(as,Ts,$s);Rs=combine_assumptions(rs,Ns,Ts,Rs),Rs!==void 0&&xs.push(Rs)}}if(xs.length===1)return xs[0];if(xs.length>1)return["and"].concat(xs);let As=ns.concat(variables(rs));xs=[];for(let ws of variables(ys)){if(As.includes(ws))continue;let Es=get_assumptions_for_expr(as,ws,As);Es!==void 0&&xs.push(Es)}return xs.length===0?ys:xs.length===1?["and",ys,xs[0]]:["and",ys].concat(xs)}(hs))}function combine_assumptions(as,rs,ns,ss){if(!["=","ne","<","le",">","ge","in","notin","ni","notni","subset","notsubset","superset","notsuperset"].includes(rs))return ss;if(Array.isArray(ss)){var os=ss[0],ls=ss.slice(1);if(os==="and"||os==="or"){let ps=ls.map(fs=>combine_assumptions(as,rs,ns,fs)).filter(fs=>fs!==void 0);return ps.length===0?void 0:os==="or"?ps.length===ls.length?[["or"].concat(ps)]:void 0:ps.length===1?ps[0]:["and"].concat(ps)}if(!["=","ne","<","le","in","notin","subset","notsubset"].includes(os))return ss;var us,cs,ds=os;if(equal$2(ls[0],ns))us=ls[1];else{if(!equal$2(ls[1],ns))return ss;us=ls[0],os==="<"?ds=">":os==="le"?ds="ge":os==="in"?ds="ni":os==="notin"?ds="notni":os==="subset"?ds="superset":os==="notsubset"&&(ds="notsuperset")}if(rs==="=")cs=ds;else if(ds==="=")cs=rs;else if(rs==="<"){if(ds!=="<"&&ds!=="le")return ds==="in"||ds==="notin"?ss:void 0;cs="<"}else if(rs==="le")if(ds==="<")cs="<";else{if(ds!=="le")return ds==="in"||ds==="notin"?ss:void 0;cs="le"}else if(rs===">"){if(ds!==">"&&ds!=="ge")return ds==="in"||ds==="notin"?ss:void 0;cs=">"}else if(rs==="ge")if(ds===">")cs=">";else{if(ds!=="ge")return ds==="in"||ds==="notin"?ss:void 0;cs="ge"}else if(rs==="in"){if(ds!=="subset")return;cs="in"}else if(rs==="notin"){if(ds!=="superset")return;cs="notin"}else if(rs==="ni"){if(ds!=="notin")return;cs="notsubset"}else if(rs==="notni"){if(ds!=="in")return;cs="notsuperset"}else if(rs==="subset")if(ds==="subset")cs="subset";else if(ds==="notni")cs="notni";else{if(ds!=="notsuperset")return;cs="notsuperset"}else if(rs==="notsubset"){if(ds!=="superset")return;cs="notsubset"}else if(rs==="superset")if(ds==="superset")cs="superset";else if(ds==="ni")cs="ni";else{if(ds!=="notsubset")return;cs="notsubset"}else{if(rs!=="notsuperset"||ds!=="subset")return;cs="notsuperset"}return cs===">"?["<",us,as]:cs==="ge"?["le",us,as]:cs==="ni"?["in",us,as]:cs==="notni"?["notin",us,as]:cs==="superset"?["subset",us,as]:cs==="notsuperset"?["notsubset",us,as]:[cs,as,us]}}function filter_assumptions_from_tree(as,rs){if(Array.isArray(as)&&as.length!==0){Array.isArray(rs)||(rs=[rs]);var ns=as[0],ss=as.slice(1);if(ns==="and"){var os=ss.map(function(us){return filter_assumptions_from_tree(us,rs)});return(os=os.filter(us=>us!==void 0)).length===0?void 0:os.length===1?os[0]:["and"].concat(os)}var ls=variables(as);return rs.filter(us=>ls.includes(us)).length>0?void 0:as}}function get_assumptions_sub(as,rs,ns,ss){Array.isArray(rs)||(rs=[rs]);var os=[];return rs.forEach(function(ls){if(as.byvar[ls]||as.derived[ls]){if(as.byvar[ls]&&as.byvar[ls].length>0){var us=filter_assumptions_from_tree(as.byvar[ls],ns);us!==void 0&&os.push(us)}if(as.derived[ls]&&as.derived[ls].length>0&&!ss){var cs=filter_assumptions_from_tree(as.derived[ls],ns);cs!==void 0&&os.push(cs)}}else as.generic.length>0&&(ls!=="x"&&variables(as.generic).includes(ls)||os.push(substitute$1(as.generic,{x:ls})))}),os.length===1?os=os[0]:os.length>1&&(os=["and"].concat(os)),os.length>0?clean_assumptions(os):void 0}function get_assumptions(as,rs,ns){ns===void 0&&(ns={});var ss,os=ns.exclude_variables;os===void 0?os=[]:Array.isArray(os)||(os=[os]);var ls=get_tree(rs);if(typeof ls=="string")ss=[ls];else{if(!Array.isArray(ls))return;Array.isArray(ls[0])&&(ss=ls[0])}return ss?get_assumptions_sub(as,ss,os,ns.omit_derived):get_assumptions_for_expr(as,ls,os)}function add_assumption(as,rs,ns){var ss=get_tree(rs);if(!Array.isArray(ss))return 0;var os=add_assumption_sub(as,ss=clean_assumptions(simplify(ss,as)),ns);return os&&(as.derived=calculate_derived_assumptions(as)),os}function add_assumption_sub(as,rs,ns){if(rs[0]==="and")return rs.slice(1).map(ls=>add_assumption_sub(as,ls,ns)).reduce(function(ls,us){return ls+us});var ss=variables(rs);if(ss.length===0)return 0;let os=0;!ns&&as.generic.length>0&&ss.forEach(function(ls){as.byvar[ls]===void 0&&(ls!=="x"&&variables(as.generic).includes(ls)||(add_assumption_sub(as,substitute$1(as.generic,{x:ls}),!0),os+=1))});for(let ls of ss){let us=solve_linear(rs,ls,as),cs=rs;us&&(cs=us);let ds=as.byvar[ls];ds!==void 0&&ds.length!==0&&(cs=["and",ds,cs]),cs=clean_assumptions(cs),equal$2(cs,ds)||(as.byvar[ls]=cs,os+=1)}return os}function add_generic_assumption(as,rs){var ns=get_tree(rs);if(!Array.isArray(ns))return 0;var ss=add_generic_assumption_sub(as,ns=clean_assumptions(simplify(ns,as)));return ss&&(as.derived=calculate_derived_assumptions(as)),ss}function add_generic_assumption_sub(as,rs){if(rs[0]==="and")return rs.slice(1).map(ls=>add_generic_assumption_sub(as,ls)).reduce(function(ls,us){return ls+us});if(!variables(rs).includes("x"))return 0;let ns=solve_linear(rs,"x",as),ss=rs;ns&&(ss=ns);let os=as.generic;return os.length!==0&&(ss=["and",os,ss]),ss=clean_assumptions(ss),equal$2(ss,os)?0:(as.generic=ss,1)}function remove_assumption(as,rs){var ns=get_tree(rs);if(!Array.isArray(ns))return 0;var ss=remove_assumption_sub(as,ns=clean_assumptions(simplify(ns,as)));return ss&&(as.derived=calculate_derived_assumptions(as)),ss}function remove_assumption_sub(as,rs){if(rs[0]==="and")return rs.slice(1).map(os=>remove_assumption_sub(as,os)).reduce(function(os,ls){return os+ls});var ns=variables(rs);if(ns.length===0)return 0;var ss=0;for(let os of ns){let ls=solve_linear(rs,os,as),us=as.byvar[os];if(!us||us.length===0)continue;let cs,ds=us[0],ps=us.slice(1),fs=ps.length;if(ds==="and")if(ps=ps.filter(hs=>!(equal$2(hs,rs)||equal$2(hs,ls))),ps.length===0)cs=[];else if(ps.length===1)cs=ps[0];else{if(!(ps.lengthremove_generic_assumption_sub(as,ds)).reduce(function(ds,ps){return ds+ps});if(!variables(rs).includes("x"))return 0;var ns=as.generic;if(ns.length===0)return 0;let ss=solve_linear(rs,"x",as);var os,ls=ns[0],us=ns.slice(1),cs=us.length;if(ls==="and")if((us=us.filter(ds=>!(equal$2(ds,rs)||equal$2(ds,ss)))).length===0)os=[];else if(us.length===1)os=us[0];else{if(!(us.length0){if(as.includes(".")){if(as[0]!=="0"?ns++:ns+=as.match(/^0\.0*/)[0].length,as.length0)if(as.includes(".")){let ss=as.match(/\.\d*$/)[0].length-1;ss":function(as){return as.join(" > ")},lts:function(as){return as.join(" < ")},gts:function(as){return as.join(" > ")},le:function(as){return as.join(" \\le ")},ge:function(as){return as.join(" \\ge ")},ne:function(as){return as.join(" \\ne ")},forall:function(as){return"\\forall "+as[0]},exists:function(as){return"\\exists "+as[0]},in:function(as){return as[0]+" \\in "+as[1]},notin:function(as){return as[0]+" \\notin "+as[1]},ni:function(as){return as[0]+" \\ni "+as[1]},notni:function(as){return as[0]+" \\not\\ni "+as[1]},subset:function(as){return as[0]+" \\subset "+as[1]},subseteq:function(as){return as[0]+" \\subseteq "+as[1]},notsubset:function(as){return as[0]+" \\not\\subset "+as[1]},notsubseteq:function(as){return as[0]+" \\not\\subseteq "+as[1]},superset:function(as){return as[0]+" \\supset "+as[1]},superseteq:function(as){return as[0]+" \\supseteq "+as[1]},notsuperset:function(as){return as[0]+" \\not\\supset "+as[1]},notsuperseteq:function(as){return as[0]+" \\not\\supseteq "+as[1]},union:function(as){return as.join(" \\cup ")},intersect:function(as){return as.join(" \\cap ")},perp:function(as){return as.join(" \\perp ")},parallel:function(as){return as.join(" \\parallel ")},derivative_leibniz:function(as){return"\\frac{d"+as[0]+"}{d"+as[1]+"}"},partial_derivative_leibniz:function(as){return"\\frac{d"+as[0]+"}{d"+as[1]+"}"},"|":function(as){return as[0]+" \\mid "+as[1]},":":function(as){return as[0]+" : "+as[1]},binom:function(as){return"\\binom{"+as[0]+"}{"+as[1]+"}"},vec:function(as){return"\\vec{"+as[0]+"}"},linesegment:function(as){return"\\overline{"+as.join(" ")+"}"},angle:function(as,rs){return rs?"\\angle "+as.join(""):"\\angle\\left( "+as.join(", ")+" \\right)"},unit:function(as){return as[1]==="\\circ"?as[0]+"^{\\circ}":as[0]+" "+as[1]}},allowedLatexSymbolsDefault$1=["alpha","beta","gamma","Gamma","delta","Delta","epsilon","zeta","eta","theta","Theta","iota","kappa","lambda","Lambda","mu","nu","xi","Xi","pi","Pi","rho","sigma","Sigma","tau","Tau","upsilon","Upsilon","phi","Phi","chi","psi","Psi","omega","Omega","partial","abs","exp","log","ln","log10","sign","sqrt","erf","cos","cosh","cot","coth","csc","csch","sec","sech","sin","sinh","tan","tanh","arcsin","arccos","arctan","arccsc","arcsec","arccot","arg","Re","Im","det","angle","perp","circ","%","$","int"],convertLatexSymbolsDefault={acos:"arccos",acosh:"arccosh",acot:"arccot",acoth:"arccoth",acsc:"arccsc",acsch:"arccsch",asec:"arcsec",asech:"arcsech",asin:"arcsin",asinh:"arcsinh",atan:"arctan",atanh:"arctanh",deg:"circ"},matrixEnvironmentDefault="bmatrix";class astToLatex$1{constructor({allowedLatexSymbols:rs=allowedLatexSymbolsDefault$1,convertLatexSymbols:ns=convertLatexSymbolsDefault,matrixEnvironment:ss=matrixEnvironmentDefault,padToDigits:os=null,padToDecimals:ls=null,showBlanks:us=!0}={}){this.allowedLatexSymbols=rs,this.convertLatexSymbols=ns,this.matrixEnvironment=ss,this.padToDigits=os,this.padToDecimals=ls,this.showBlanks=us}convert(rs){return this.statement(rs)}statement(rs){if(!Array.isArray(rs))return this.single_statement(rs);var ns=rs[0],ss=rs.slice(1);if(ns==="ldots")return"\\ldots";if(!(ns in operators$1)&&ns!=="apply")throw new Error("Badly formed ast: operator "+ns+" not recognized.");return ns==="and"||ns==="or"?operators$1[ns](ss.map(function(os,ls){let us=this.single_statement(os);return us.match(/ /)&&!us.match(/^\\left\(.*\\right\)$/)?"\\left("+us+"\\right)":us}.bind(this))):this.single_statement(rs)}single_statement(rs){if(!Array.isArray(rs))return this.expression(rs);var ns=rs[0],ss=rs.slice(1);if(ns==="not")return operators$1[ns](ss.map(function(os,ls){let us=this.single_statement(os);return us.match(/ /)&&!us.match(/^\\left\(.*\\right\)$/)?"\\left("+us+"\\right)":us}.bind(this)));if(ns==="exists"||ns==="forall")return operators$1[ns]([this.single_statement(ss[0])]);if(ns==="="||ns==="ne"||ns==="<"||ns===">"||ns==="le"||ns==="ge"||ns==="in"||ns==="notin"||ns==="ni"||ns==="notni"||ns==="subset"||ns==="notsubset"||ns==="subseteq"||ns==="notsubseteq"||ns==="superset"||ns==="notsuperset"||ns==="superseteq"||ns==="notsuperseteq")return operators$1[ns](ss.map(function(os,ls){return this.expression(os)}.bind(this)));if(ns==="lts"||ns==="gts"){let os=ss[0],ls=ss[1];if(os[0]!=="tuple"||ls[0]!=="tuple")throw new Error("Badly formed ast");let us=this.expression(os[1]);for(let cs=1;cs ":us+=ns==="lts"?" \\le ":" \\ge ",us+=this.expression(os[cs+1]);return us}return this.expression(rs)}expression(rs){if(!Array.isArray(rs))return this.term(rs);var ns=rs[0],ss=rs.slice(1);return ns==="+"?ss.length===1?"+"+this.term(ss[0]):operators$1[ns](ss.map(function(os,ls){return ls>0?this.termWithPlusIfNotNegated(os):this.term(os)}.bind(this))):["union","intersect","perp","parallel"].includes(ns)?operators$1[ns](ss.map(function(os,ls){return this.term(os)}.bind(this))):this.term(rs)}term(rs){if(!Array.isArray(rs))return this.factor(rs);var ns=rs[0],ss=rs.slice(1);return ns==="-"?operators$1[ns](ss.map(function(os,ls){return this.term(os)}.bind(this))):ns==="*"?operators$1[ns](ss.map(function(os,ls){let us;return ls>0?(us=this.factorWithParenthesesIfNegatedOrExplicitPlus(os),us.match(/^[0-9]/)?"\\cdot "+us:os[0]==="angle"&&ss.length>1?"\\left( "+us+" \\right)":us):(us=this.factor(os),os[0]==="angle"&&ss.length>1?"\\left( "+us+" \\right)":us)}.bind(this))):ns==="/"||ns==="unit"?operators$1[ns](ss.map(function(os,ls){return this.expression(os)}.bind(this))):this.factor(rs)}simple_factor_or_function_or_parens(rs){var ns=this.factor(rs);return!!(ns.length<=1||typeof rs=="string"&&rs.match(/^\w+$/)||Array.isArray(rs)&&rs[0]==="apply"&&rs[1]!=="sqrt"||ns.match(/^\\left\(.*\\right\)$/)||ns.match(/^\\left\\langle.*\\right\\rangle$/))||typeof rs=="number"&&rs>=0&&!rs.toString().includes("e")}stringConvert(rs){return rs.length>1?(this.convertLatexSymbols[rs]&&(rs=this.convertLatexSymbols[rs]),this.allowedLatexSymbols.includes(rs)?"\\"+rs:"\\operatorname{"+rs+"}"):this.allowedLatexSymbols.includes(rs)?"\\"+rs:rs!=="_"||this.showBlanks?rs:""}factor(rs){if(typeof rs=="string")return this.stringConvert(rs);if(typeof rs=="number"){if(rs===1/0)return"\\infty";if(rs===-1/0)return"-\\infty";if(Number.isNaN(rs))return"NaN";{let os=rs.toString(),ls=os.indexOf("e");if(ls===-1)return this.padToDigits!==null?os=padNumberStringToDigits(os,this.padToDigits):this.padToDecimals!==null&&(os=padNumberStringToDecimals(os,this.padToDecimals)),os;let us=os.substring(0,ls),cs=os.substring(ls+1);if(cs[0]==="+"&&(cs=cs.slice(1)),this.padToDigits!==null)us=padNumberStringToDigits(us,this.padToDigits);else if(this.padToDecimals!==null){let ds=Number(cs);if(ds>0)return os=rs.toLocaleString("fullwide",{useGrouping:!1}),padNumberStringToDecimals(os,this.padToDecimals);us=padNumberStringToDecimals(us,this.padToDecimals+ds)}return us+" \\cdot 10^{"+cs+"}"}}if(!Array.isArray(rs))return"";var ns=rs[0],ss=rs.slice(1);if(ns==="^"){if(Number.isInteger(ss[0])&&Number.isInteger(ss[1]))return ss[0]<0?"\\left("+ss[0].toString()+"\\right)^{"+ss[1].toString()+"}":ss[0].toString()+"^{"+ss[1].toString()+"}";let os=this.factor(ss[0]),ls=ss[0];for(;ls[0]==="prime";)ls=ls[1];return this.simple_factor_or_function_or_parens(ls)||ls[0]==="_"&&typeof ls[1]=="string"||(os="\\left("+os.toString()+"\\right)"),os+"^{"+this.statement(ss[1])+"}"}if(ns==="_"){let os=this.factor(ss[0]);return this.simple_factor_or_function_or_parens(ss[0])||(os="\\left("+os.toString()+"\\right)"),os+"_{"+this.statement(ss[1])+"}"}if(ns==="prime"){let os=ss[0],ls=1;for(;os[0]==="prime";)ls+=1,os=os[1];let us=this.factor(os);this.simple_factor_or_function_or_parens(os)||os[0]==="_"&&typeof os[1]=="string"||(us="\\left("+us+"\\right)");for(let cs=0;cs1?ps=ps.trimRight()+"^{"+cs+"}"+this.stringConvert(ds):ps+=this.stringConvert(ds),ps="\\frac{ "+ps+" }{ ";let fs=1;Array.isArray(us)&&(fs=us.length-1);for(let hs=1;hs<=fs;hs++){let gs=us[hs],ys=1,bs="";Array.isArray(gs)?(bs=gs[1],ys=gs[2]):bs=gs,ps=ps+os+this.stringConvert(bs),ys>1&&(ps=ps+"^{"+ys+"}"),ps+=" "}return ps+="}",ps}if(ns==="apply"){if(ss[0]==="abs")return"\\left|"+this.statement(ss[1])+"\\right|";if(ss[0]==="floor")return"\\left\\lfloor "+this.statement(ss[1])+" \\right\\rfloor";if(ss[0]==="ceil")return"\\left\\lceil "+this.statement(ss[1])+" \\right\\rceil";if(ss[0]==="factorial"){let cs=this.factor(ss[1]);return this.simple_factor_or_function_or_parens(ss[1])||ss[1][0]==="_"&&typeof ss[1][1]=="string"?cs+"!":"\\left("+cs+"\\right)!"}if(ss[0]==="sqrt")return"\\sqrt{"+this.statement(ss[1])+"}";let os,ls=ss[0];if(ls[0]==="^"&&(ls=ls[1]),ls[0]==="_"&&(ls=ls[1]),ls==="int"){let cs,ds=this.factor(ss[0]),ps=ss[1];if(Array.isArray(ps)&&ps[0]==="*"){let fs=[],hs=["*"];for(let gs=1;gs0&&(cs[cs.length-1].match(/[a-zA-Z]/)&&(cs+="\\,"),cs+=fs.map(gs=>"d"+this.factor(gs[1])).join("\\,"))}return cs||(cs=this.term(ss[1])),ds+" "+cs}os=ss[0]==="log10"?"\\log_{10}":ss[0]==="re"?"\\Re":ss[0]==="im"?"\\Im":this.factor(ss[0]);let us=this.statement(ss[1]);return ss[1][0]!=="tuple"&&(us="\\left("+us+"\\right)"),os+us}if(ns==="angle"){let os=ss.every(ls=>{if(typeof ls=="string"&&ls.length===1)return!0;if(!Array.isArray(ls))return!1;let us=ls[0];return us==="_"||us==="^"||us==="prime"});return operators$1[ns](ss.map(function(ls,us){return this.statement(ls)}.bind(this)),os)}return ns==="+"&&rs.length===2?"+ "+this.factor(rs[1]):"\\left("+this.statement(rs)+"\\right)"}factorWithParenthesesIfNegatedOrExplicitPlus(rs){var ns=this.factor(rs);return ns.match(/^-/)||ns.match(/^\+/)?"\\left("+ns+"\\right)":ns}termWithPlusIfNotNegated(rs){var ns=this.term(rs);return ns.match(/^-/)?ns.match(/^-[^ ]/)?"- "+ns.slice(1):ns:"+ "+ns}}const textToAst$2=new textToAst$4,astToLatex=new astToLatex$1;var derivatives={sin:textToAst$2.convert("cos x"),cos:textToAst$2.convert("-(sin x)"),tan:textToAst$2.convert("(sec x)^2"),cot:textToAst$2.convert("-((csc x)^2)"),sec:textToAst$2.convert("(sec x)*(tan x)"),csc:textToAst$2.convert("-(csc x)*(cot x)"),sqrt:textToAst$2.convert("1/(2*sqrt(x))"),log:textToAst$2.convert("1/x"),ln:textToAst$2.convert("1/x"),exp:textToAst$2.convert("exp(x)"),arcsin:textToAst$2.convert("1/sqrt(1 - x^2)"),arccos:textToAst$2.convert("-1/sqrt(1 - x^2)"),arctan:textToAst$2.convert("1/(1 + x^2)"),arccsc:textToAst$2.convert("-1/(sqrt(-1/x^2 + 1)*x^2)"),arcsec:textToAst$2.convert("1/(sqrt(-1/x^2 + 1)*x^2)"),arccot:textToAst$2.convert("-1/(1 + x^2)"),abs:textToAst$2.convert("abs(x)/x")};function derivative(as,rs,ns=[]){var ss=get_tree(as),os="\\frac{d}{d"+rs+"} ";if(typeof ss=="number"||variables(ss).indexOf(rs)<0)return ns.push("The derivative of a constant is zero, that is, \\("+os+astToLatex.convert(ss)+" = 0\\)."),0;if(typeof ss=="string")return rs===ss?(ns.push("We know the derivative of the identity function is one, that is, \\("+os+astToLatex.convert(ss)+" = 1\\)."),1):(ns.push("As far as \\("+astToLatex.convert(rs)+"\\) is concerned, \\("+astToLatex.convert(ss)+"\\) is constant, so "+os+astToLatex.convert(ss)+" = 0\\)."),0);if(!Array.isArray(ss))return null;var ls=ss[0],us=ss.slice(1);if(ls==="+"||ls==="-"||ls==="~"){ns.push("Using the sum rule, \\("+os+astToLatex.convert(ss)+" = "+us.map(function(ds,ps){return os+astToLatex.convert(ds)}).join(" + ")+"\\).");let cs=[ls].concat(us.map(function(ds,ps){return derivative(ds,rs,ns)}));return cs=simplify(cs),ns.push("So using the sum rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(cs)+"\\)."),cs}if(ls==="*"){let cs=[],ds=[];for(let hs=0;hs0){if(cs.length===0)return ns.push("Since the derivative of a constant is zero, \\("+os+astToLatex.convert(ss)+" = 0.\\)"),0;let hs=["*"].concat(cs);if(cs.length===1&&(hs=cs[0]),hs===rs){ns.push("By the constant multiple rule, \\("+os+astToLatex.convert(ss)+" = "+ds.map(function(vs,xs){return astToLatex.convert(vs)}).join(" \\cdot ")+"\\).");let bs=["*"].concat(ds);return bs=simplify(bs),bs}ns.push("By the constant multiple rule, \\("+os+astToLatex.convert(ss)+" = "+ds.map(function(bs,vs){return astToLatex.convert(bs)}).join(" \\cdot ")+" \\cdot "+os+"\\left("+astToLatex.convert(hs)+"\\right)\\).");let gs=derivative(hs,rs,ns),ys=["*"].concat(ds.concat([gs]));return ys=simplify(ys),ns.push("And so \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ys)+"\\)."),ys}ns.push("Using the product rule, \\("+os+astToLatex.convert(ss)+" = "+us.map(function(hs,gs){return us.map(function(ys,bs){return gs===bs?os+"\\left("+astToLatex.convert(hs)+"\\right)":astToLatex.convert(ys)}).join(" \\cdot ")}).join(" + ")+"\\).");let ps=us.slice(),fs=["+"].concat(us.map(function(hs,gs){return["*"].concat(ps.map(function(ys,bs){if(gs===bs){let vs=derivative(ys,rs,ns);return vs===1?null:vs}return ys}).filter(function(ys){return ys!=null}))}));return fs=simplify(fs),ns.push("So using the product rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(fs)+"\\)."),fs}if(ls==="/"){let cs=us[0],ds=us[1];if(variables(ds).indexOf(rs)<0){ns.push("By the constant multiple rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(["/",1,ds])+" \\cdot "+os+"\\left("+astToLatex.convert(cs)+"\\right)\\).");let ys=derivative(cs,rs,ns),bs=textToAst$2.convert("(1/g)*d"),vs=substitute$1(bs,{d:ys,g:ds});return vs=simplify(vs),ns.push("So \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(vs)+"\\)."),vs}if(variables(cs).indexOf(rs)<0){cs!==1&&ns.push("By the constant multiple rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(cs)+" \\cdot "+os+"\\left("+astToLatex.convert(["/",1,ds])+"\\right)\\)."),ns.push("Since \\(\\frac{d}{du} \\frac{1}{u}\\) is \\(\\frac{-1}{u^2}\\), the chain rule gives \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(cs)+"\\cdot \\frac{-1}{ "+astToLatex.convert(ds)+"^2} \\cdot "+os+astToLatex.convert(ds)+"\\).");let ys=derivative(ds,rs,ns),bs=textToAst$2.convert("f * (-a/(g^2))"),vs=substitute$1(bs,{f:cs,a:ys,g:ds});return vs=simplify(vs),ns.push("So since \\(\\frac{d}{du} \\frac{1}{u}\\) is \\(\\frac{-1}{u^2}\\), the chain rule gives \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(vs)+"\\)."),vs}ns.push("Using the quotient rule, \\("+os+astToLatex.convert(ss)+" = \\frac{"+os+"\\left("+astToLatex.convert(cs)+"\\right) \\cdot "+astToLatex.convert(ds)+" - "+astToLatex.convert(cs)+"\\cdot "+os+"\\left("+astToLatex.convert(ds)+"\\right)}{ \\left( "+astToLatex.convert(ds)+" \\right)^2} \\).");let ps=derivative(cs,rs,ns),fs=derivative(ds,rs,ns),hs=textToAst$2.convert("(a * g - f * b)/(g^2)"),gs=substitute$1(hs,{a:ps,b:fs,f:cs,g:ds});return gs=simplify(gs),ns.push("So using the quotient rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(gs)+"\\)."),gs}if(ls==="^"){let cs=us[0],ds=us[1];if(variables(ds).indexOf(rs)<0){if(typeof cs=="string"&&cs==="x"){if(typeof ds=="number"){let Ns=textToAst$2.convert("n * (f^m)"),As=substitute$1(Ns,{n:ds,m:ds-1,f:cs});return As=simplify(As),ns.push("By the power rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ds)+" \\cdot \\left("+astToLatex.convert(cs)+"\\right)^{"+astToLatex.convert(["-",ds,1])+"}\\)."),As}let Ts=textToAst$2.convert("n * (f^(n-1))"),Ss=substitute$1(Ts,{n:ds,f:cs});return Ss=simplify(Ss),ns.push("By the power rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ds)+" \\cdot \\left("+astToLatex.convert(cs)+"\\right)^{"+astToLatex.convert(["-",ds,1])+"}\\)."),Ss}ds!==1&&ns.push("By the power rule and the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ds)+" \\cdot \\left("+astToLatex.convert(cs)+"\\right)^{"+astToLatex.convert(["-",ds,1])+"} \\cdot "+os+astToLatex.convert(cs)+"\\).");let vs=derivative(cs,rs,ns);if(ds===1)return vs;if(typeof ds=="number"){let Ts=textToAst$2.convert("n * (f^m) * a"),Ss=substitute$1(Ts,{n:ds,m:ds-1,f:cs,a:vs});return Ss=simplify(Ss),ns.push("So by the power rule and the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(Ss)+"\\)."),Ss}let xs=textToAst$2.convert("n * (f^(n-1)) * a"),Cs=substitute$1(xs,{n:ds,f:cs,a:vs});return Cs=simplify(Cs),ns.push("So by the power rule and the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(Cs)+"\\)."),Cs}if(cs==="e"&&math$1.define_e){if(typeof ds=="string"&&ds===rs){let Ts=textToAst$2.convert("e^(f)"),Ss=substitute$1(Ts,{f:ds});return Ss=simplify(Ss),ns.push("The derivative of \\(e^"+astToLatex.convert(rs)+"\\) is itself, that is, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ss)+"\\)."),Ss}ns.push("Using the rule for \\(e^x\\) and the chain rule, we know \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ss)+" \\cdot "+os+astToLatex.convert(ds)+"\\).");let vs=textToAst$2.convert("e^(f)*d"),xs=derivative(ds,rs,ns),Cs=substitute$1(vs,{f:ds,d:xs});return Cs=simplify(Cs),ns.push("So using the rule for \\(e^x\\) and the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(Cs)+"\\)."),Cs}if(typeof cs=="number"){if(typeof ds=="string"&&ds===rs){let Ns=textToAst$2.convert("a^(f) * log(a)"),As=substitute$1(Ns,{a:cs,f:ds});return As=simplify(As),ns.push("The derivative of \\(a^"+astToLatex.convert(rs)+"\\) is \\(a^{"+astToLatex.convert(rs)+"} \\, \\log a\\), that is, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(As)+"\\)."),As}let vs=textToAst$2.convert("a^(f) * log(a)"),xs=substitute$1(vs,{a:cs,f:ds});ns.push("Using the rule for \\(a^x\\) and the chain rule, we know \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(xs)+" \\cdot "+os+astToLatex.convert(ds)+"\\).");let Cs=textToAst$2.convert("a^(b)*log(a)*d"),Ts=derivative(ds,rs,ns),Ss=substitute$1(Cs,{a:cs,b:ds,d:Ts});return Ss=simplify(Ss),ns.push("So using the rule for \\(a^x\\) and the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(Ss)+"\\)."),Ss}let ps=cs,fs=ds;ns.push("Recall the general rule for exponents, namely that \\(\\frac{d}{dx} u(x)^{v(x)} = u(x)^{v(x)} \\cdot \\left( v'(x) \\cdot \\log u(x) + \\frac{v(x) \\cdot u'(x)}{u(x)} \\right)\\). In this case, \\(u(x) = "+astToLatex.convert(ps)+"\\) and \\(v(x) = "+astToLatex.convert(fs)+"\\).");let hs=derivative(ps,rs,ns),gs=derivative(fs,rs,ns),ys=textToAst$2.convert("(f^g)*(b * log(f) + (g * a)/f)"),bs=substitute$1(ys,{a:hs,b:gs,f:ps,g:fs});return bs=simplify(bs),ns.push("So by the general rule for exponents, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(bs)+"\\)."),bs}if(ls==="apply"&&!(us[0]in derivatives)){let cs=us[1];ns.push("By the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(substitute$1(["apply",us[0]+"'","x"],{x:cs}))+" \\cdot "+os+astToLatex.convert(cs)+"\\).");let ds=["*",substitute$1(["apply",us[0]+"'","x"],{x:cs}),derivative(cs,rs,ns)];return ds=simplify(ds),ns.push("So by the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ds)+"\\)."),ds}if(ls==="apply"&&us[0]in derivatives||ls in derivatives){let cs=!1;ls==="apply"&&(ls=us[0],us=us.slice(1),cs=!0);let ds=us[0];if(typeof ds=="number"){let ps=0;return ns.push("The derivative of a constant is zero so \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ps)+"\\)."),ps}if(typeof ds=="string"&&ds===rs){let ps=["*",substitute$1(derivatives[ls],{x:ds})];return ps=simplify(ps),ns.push("It is the case that \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ps)+"\\)."),ps}if(typeof ds=="string"&&ds!==rs){let ps=0;return ns.push("Since the derivative of a constant is zero, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(ps)+"\\)."),ps}{let ps=[ls,"u"];cs&&(ps=["apply"].concat(ps)),ns.push("Recall \\(\\frac{d}{du}"+astToLatex.convert(ps)+" = "+astToLatex.convert(derivative(ps,"u",[]))+"\\)."),ns.push("By the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(substitute$1(derivatives[ls],{x:ds}))+" \\cdot "+os+astToLatex.convert(ds)+"\\).");let fs=["*",substitute$1(derivatives[ls],{x:ds}),derivative(ds,rs,ns)];return fs=simplify(fs),ns.push("So by the chain rule, \\("+os+astToLatex.convert(ss)+" = "+astToLatex.convert(fs)+"\\)."),fs}}return 0}function lowercaseFirstLetter(as){return as.charAt(0).toLowerCase()+as.slice(1)}function simplify_story(as){for(let rs=as.length-1;rs>=1;rs--)as[rs]===as[rs-1]&&as.splice(rs,1);for(let rs=0;rs":function(as){return as.join(" > ")},lts:function(as){return as.join(" < ")},gts:function(as){return as.join(" > ")},le:function(as){return as.join(" ≤ ")},ge:function(as){return as.join(" ≥ ")},ne:function(as){return as.join(" ≠ ")},forall:function(as){return"∀ "+as[0]},exists:function(as){return"∃ "+as[0]},in:function(as){return as[0]+" ∈ "+as[1]},notin:function(as){return as[0]+" ∉ "+as[1]},ni:function(as){return as[0]+" ∋ "+as[1]},notni:function(as){return as[0]+" ∌ "+as[1]},subset:function(as){return as[0]+" ⊂ "+as[1]},subseteq:function(as){return as[0]+" ⊆ "+as[1]},notsubset:function(as){return as[0]+" ⊄ "+as[1]},notsubseteq:function(as){return as[0]+" ⊈ "+as[1]},superset:function(as){return as[0]+" ⊃ "+as[1]},superseteq:function(as){return as[0]+" ⊇ "+as[1]},notsuperset:function(as){return as[0]+" ⊅ "+as[1]},notsuperseteq:function(as){return as[0]+" ⊉ "+as[1]},union:function(as){return as.join(" ∪ ")},intersect:function(as){return as.join(" ∩ ")},perp:function(as){return as.join(" ⟂ ")},parallel:function(as){return as.join(" ∥ ")},derivative_leibniz:function(as){return"d"+as[0]+"/d"+as[1]},partial_derivative_leibniz:function(as){return"∂"+as[0]+"/∂"+as[1]},"|":function(as){return as[0]+" | "+as[1]},":":function(as){return as[0]+" : "+as[1]},binom:function(as){return"binom( "+as[0]+", "+as[1]+" )"},vec:function(as){return"vec("+as[0]+")"},linesegment:function(as){return"linesegment( "+as.join(", ")+" )"},angle:function(as,rs){return rs?"∠"+as.join(""):"∠( "+as.join(", ")+" )"},unit:function(as){return as[0]+" "+as[1]}},nonunicode_operators={"+":function(as){return as.join(" ")},"-":function(as){return"-"+as[0]},"*":function(as){return as.join(" ")},"/":function(as){return as[0]+"/"+as[1]},_:function(as){return as[0]+"_"+as[1]},"^":function(as){return as[0]+"^"+as[1]},prime:function(as){return as[0]+"'"},tuple:function(as){return"( "+as.join(", ")+" )"},array:function(as){return"[ "+as.join(", ")+" ]"},list:function(as){return as.join(", ")},set:function(as){return"{ "+as.join(", ")+" }"},vector:function(as){return"( "+as.join(", ")+" )"},altvector:function(as){return"( "+as.join(", ")+" )"},interval:function(as){return"( "+as.join(", ")+" )"},matrix:function(as){return"( "+as.join(", ")+" )"},and:function(as){return as.join(" and ")},or:function(as){return as.join(" or ")},not:function(as){return"not "+as[0]},"=":function(as){return as.join(" = ")},"<":function(as){return as.join(" < ")},">":function(as){return as.join(" > ")},lts:function(as){return as.join(" < ")},gts:function(as){return as.join(" > ")},le:function(as){return as.join(" <= ")},ge:function(as){return as.join(" >= ")},ne:function(as){return as.join(" ne ")},forall:function(as){return"forall "+as[0]},exists:function(as){return"exists "+as[0]},in:function(as){return as[0]+" elementof "+as[1]},notin:function(as){return as[0]+" notelementof "+as[1]},ni:function(as){return as[0]+" containselement "+as[1]},notni:function(as){return as[0]+" notcontainselement "+as[1]},subset:function(as){return as[0]+" subset "+as[1]},subseteq:function(as){return as[0]+" subseteq "+as[1]},notsubset:function(as){return as[0]+" notsubset "+as[1]},notsubseteq:function(as){return as[0]+" notsubseteq "+as[1]},superset:function(as){return as[0]+" superset "+as[1]},superseteq:function(as){return as[0]+" superseteq "+as[1]},notsuperset:function(as){return as[0]+" notsuperset "+as[1]},notsuperseteq:function(as){return as[0]+" notsuperseteq "+as[1]},union:function(as){return as.join(" union ")},intersect:function(as){return as.join(" intersect ")},perp:function(as){return as.join(" perp ")},parallel:function(as){return as.join(" parallel ")},derivative_leibniz:function(as){return"d"+as[0]+"/d"+as[1]},partial_derivative_leibniz:function(as){return"∂"+as[0]+"/∂"+as[1]},"|":function(as){return as[0]+" | "+as[1]},":":function(as){return as[0]+" : "+as[1]},binom:function(as){return"binom( "+as[0]+", "+as[1]+" )"},vec:function(as){return"vec("+as[0]+")"},linesegment:function(as){return"linesegment( "+as.join(", ")+" )"},angle:function(as,rs){return rs?"angle "+as.join(""):"angle( "+as.join(", ")+" )"},unit:function(as){return as[0]+" "+as[1]}},output_unicodeDefault=!0;class astToText$2{constructor({output_unicode:rs=output_unicodeDefault,padToDigits:ns=null,padToDecimals:ss=null,showBlanks:os=!0}={}){this.output_unicode=rs,this.operators=unicode_operators,rs||(this.operators=nonunicode_operators),this.padToDigits=ns,this.padToDecimals=ss,this.showBlanks=os}convert(rs){return this.statement(rs)}statement(rs){if(!Array.isArray(rs))return this.single_statement(rs);let ns=rs[0],ss=rs.slice(1);if(ns==="ldots")return"...";if(!(ns in this.operators)&&ns!=="apply")throw new Error("Badly formed ast: operator "+ns+" not recognized.");return ns==="and"||ns==="or"?this.operators[ns](ss.map(function(os,ls){let us=this.single_statement(os);return us.match(/ /)&&!us.match(/^\(.*\)$/)?"("+us+")":us}.bind(this))):this.single_statement(rs)}single_statement(rs){if(!Array.isArray(rs))return this.expression(rs);let ns=rs[0],ss=rs.slice(1);if(ns==="not")return this.operators[ns](ss.map(function(os,ls){let us=this.single_statement(os);return us.match(/ /)&&!us.match(/^\(.*\)$/)?"("+us+")":us}.bind(this)));if(ns==="exists"||ns==="forall")return this.operators[ns]([this.single_statement(ss[0])]);if(ns==="="||ns==="ne"||ns==="<"||ns===">"||ns==="le"||ns==="ge"||ns==="in"||ns==="notin"||ns==="ni"||ns==="notni"||ns==="subset"||ns==="notsubset"||ns==="subseteq"||ns==="notsubseteq"||ns==="superset"||ns==="notsuperset"||ns==="superseteq"||ns==="notsuperseteq")return this.operators[ns](ss.map(function(os,ls){return this.expression(os)}.bind(this)));if(ns==="lts"||ns==="gts"){let os=ss[0],ls=ss[1];if(os[0]!=="tuple"||ls[0]!=="tuple")throw new Error("Badly formed ast");let us=this.expression(os[1]);for(let cs=1;cs ":ns==="lts"?this.output_unicode?us+=" ≤ ":us+=" <= ":this.output_unicode?us+=" ≥ ":us+=" >= ",us+=this.expression(os[cs+1]);return us}return this.expression(rs)}expression(rs){if(!Array.isArray(rs))return this.term(rs);let ns=rs[0],ss=rs.slice(1);return ns==="+"?ss.length===1?"+"+this.term(ss[0]):this.operators[ns](ss.map(function(os,ls){return ls>0?this.termWithPlusIfNotNegated(os):this.term(os)}.bind(this))):["union","intersect","perp","parallel"].includes(ns)?this.operators[ns](ss.map(function(os,ls){return this.term(os)}.bind(this))):this.term(rs)}term(rs){if(!Array.isArray(rs))return this.factor(rs);let ns=rs[0],ss=rs.slice(1);if(ns==="-")return this.operators[ns](ss.map(function(os,ls){return this.term(os)}.bind(this)));if(ns==="*")return this.operators[ns](ss.map(function(os,ls){let us;return ls>0?(us=this.factorWithParenthesesIfNegatedOrExplicitPlus(os),us.match(/^[0-9]/)?"* "+us:os[0]==="angle"&&ss.length>1?"( "+us+" )":us):(us=this.factor(os),os[0]==="angle"&&ss.length>1?"( "+us+" )":us)}.bind(this)));if(ns==="/"){let os=this.factor(ss[0]),ls=this.factor(ss[1]);return this.simple_factor_or_function_or_parens(ss[0])||(os="("+os+")"),this.simple_factor_or_function_or_parens(ss[1])||(ls="("+ls+")"),this.operators[ns]([os,ls])}return ns==="unit"?this.operators[ns](ss.map(function(os,ls){return this.expression(os)}.bind(this))):this.factor(rs)}symbolConvert(rs){let ns={alpha:"α",beta:"β",Gamma:"Γ",gamma:"γ",Delta:"Δ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",Theta:"ϴ",theta:"θ",iota:"ι",kappa:"κ",Lambda:"Λ",lambda:"λ",mu:"μ",nu:"ν",Xi:"Ξ",xi:"ξ",Pi:"Π",pi:"π",rho:"ρ",Sigma:"Σ",sigma:"σ",tau:"τ",Upsilon:"Υ",upsilon:"υ",Phi:"Φ",phi:"ϕ",Psi:"Ψ",psi:"ψ",Omega:"Ω",omega:"ω",perp:"⟂",int:"∫"};return this.output_unicode&&rs in ns?ns[rs]:this.showBlanks||rs!=="_"?rs:""}simple_factor_or_function_or_parens(rs){let ns=this.factor(rs);return!!(ns.length<=1||typeof rs=="string"&&rs.match(/^\w+$/)||Array.isArray(rs)&&rs[0]==="apply"||ns.match(/^\(.*\)$/)||ns.match(/^⟨.*⟩$/))||typeof rs=="number"&&rs>=0&&!rs.toString().includes("e")}factor(rs){if(typeof rs=="string")return this.symbolConvert(rs);if(typeof rs=="number"){if(rs===1/0)return this.output_unicode?"∞":"infinity";if(rs===-1/0)return this.output_unicode?"-∞":"-infinity";if(Number.isNaN(rs))return"NaN";{let os=rs.toString(),ls=os.indexOf("e");if(ls===-1)return this.padToDigits!==null?os=padNumberStringToDigits(os,this.padToDigits):this.padToDecimals!==null&&(os=padNumberStringToDecimals(os,this.padToDecimals)),os;let us=os.substring(0,ls),cs=os.substring(ls+1);if(this.padToDigits!==null)us=padNumberStringToDigits(us,this.padToDigits);else if(this.padToDecimals!==null){let ds=Number(cs);if(ds>0)return os=rs.toLocaleString("fullwide",{useGrouping:!1}),padNumberStringToDecimals(os,this.padToDecimals);us=padNumberStringToDecimals(us,this.padToDecimals+ds)}return cs[0]==="+"?us+" * 10^"+cs.substring(1):us+" * 10^("+cs+")"}}if(!Array.isArray(rs))return"";let ns=rs[0],ss=rs.slice(1);if(ns==="^"){if(Number.isInteger(ss[0])&&Number.isInteger(ss[1])){let cs;return cs=ss[0]<0?"("+ss[0].toString()+")":ss[0].toString(),ss[1]<0?cs+"^("+ss[1].toString()+")":cs+"^"+ss[1].toString()}let os=this.factor(ss[0]),ls=ss[0];for(;ls[0]==="prime";)ls=ls[1];this.simple_factor_or_function_or_parens(ls)||ls[0]==="_"&&typeof ls[1]=="string"||(os="("+os.toString()+")");let us=this.factor(ss[1]);return this.simple_factor_or_function_or_parens(ss[1])||(us="("+us.toString()+")"),os+"^"+us}if(ns==="_")return this.operators[ns](ss.map(function(os,ls){let us=this.factor(os);return this.simple_factor_or_function_or_parens(os)?us:"("+us+")"}.bind(this)));if(ns==="prime"){let os=ss[0],ls=1;for(;os[0]==="prime";)ls+=1,os=os[1];let us=this.factor(os);this.simple_factor_or_function_or_parens(os)||os[0]==="_"&&typeof os[1]=="string"||(us="("+us+")");for(let cs=0;cs1&&(ps=ps+"^"+cs),ps=ps+this.symbolConvert(ds)+"/";let fs=1;Array.isArray(us)&&(fs=us.length-1);for(let hs=1;hs<=fs;hs++){let gs=us[hs],ys=1,bs="";Array.isArray(gs)?(bs=gs[1],ys=gs[2]):bs=gs,ps=ps+os+this.symbolConvert(bs),ys>1&&(ps=ps+"^"+ys)}return ps}if(ns==="apply"){if(ss[0]==="abs")return"|"+this.statement(ss[1])+"|";if(ss[0]==="factorial"){let cs=this.factor(ss[1]);return this.simple_factor_or_function_or_parens(ss[1])||ss[1][0]==="_"&&typeof ss[1][1]=="string"?cs+"!":"("+cs+")!"}let os=ss[0];if(os[0]==="^"&&(os=os[1]),os[0]==="_"&&(os=os[1]),os==="int"){let cs,ds=this.factor(ss[0]),ps=ss[1];if(Array.isArray(ps)&&ps[0]==="*"){let fs=[],hs=["*"];for(let gs=1;gs0&&(cs+=" "+fs.map(gs=>"d"+this.factor(gs[1])).join(" "))}return cs||(cs=this.term(ss[1])),ds+" "+cs}let ls=this.factor(ss[0]),us=this.statement(ss[1]);return ss[1][0]!=="tuple"&&(us="("+us+")"),ls+us}if(ns==="angle"){let os=ss.every(ls=>{if(typeof ls=="string"&&ls.length===1)return!0;if(!Array.isArray(ls))return!1;let us=ls[0];return us==="_"||us==="^"||us==="prime"});return this.operators[ns](ss.map(function(ls,us){return this.statement(ls)}.bind(this)),os)}return ns==="+"&&rs.length===2?"+ "+this.factor(rs[1]):"("+this.statement(rs)+")"}factorWithParenthesesIfNegatedOrExplicitPlus(rs){var ns=this.factor(rs);return ns.match(/^-/)||ns.match(/^\+/)?"("+ns+")":ns}termWithPlusIfNotNegated(rs){let ns=this.term(rs);return ns.match(/^-/)?ns.match(/^-[^ ]/)?"- "+ns.slice(1):ns:"+ "+ns}}var astToText$1=new astToText$2;function subscripts_to_strings(as,rs=!1){var ns=get_tree(as);if(!Array.isArray(ns))return ns;let ss=ns[0],os=ns.slice(1);return ss==="_"&&(rs||os.every(ls=>["number","string"].includes(typeof ls)))?astToText$1.convert(ns):[ss].concat(os.map(ls=>subscripts_to_strings(ls,rs)))}function strings_to_subscripts(as){var rs=get_tree(as);if(typeof rs=="string"){let os=rs.match(/^([0-9a-zA-Z]+)_([a-zA-Z]+|[0-9]+)$/);if(os){let ls=Number(os[1]);isNaN(ls)&&(ls=os[1]);let us=Number(os[2]);return isNaN(us)&&(us=os[2]),["_",ls,us]}return rs}if(!Array.isArray(rs))return rs;let ns=rs[0],ss=rs.slice(1);return[ns].concat(ss.map(strings_to_subscripts))}var normalization=Object.freeze({__proto__:null,normalize_function_names,normalize_applied_functions,log_subscript_to_two_arg_log,substitute_abs,default_order,constants_to_floats,normalize_angle_linesegment_arg_order,tuples_to_vectors,to_intervals,altvectors_to_vectors,subscripts_to_strings,strings_to_subscripts}),astToText=new astToText$2;function generate_random_integer(as,rs,ns){return as=math$1.ceil(as),rs=math$1.floor(rs),math$1.floor(ns()*(rs-as+1))+as}const equals$5=function({expr:as,other:rs,randomBindings:ns,expr_context:ss,other_context:os,relative_tolerance:ls=1e-12,absolute_tolerance:us=0,tolerance_for_zero:cs=1e-15,allowed_error_in_numbers:ds=0,include_error_in_number_exponents:ps=!1,allowed_error_is_absolute:fs=!1,rng:hs}){if(Array.isArray(as.tree)&&Array.isArray(rs.tree)){let gs=as.tree[0],ys=as.tree.slice(1),bs=rs.tree[0],vs=rs.tree.slice(1);if(gs==="tuple"||gs==="vector"||gs==="altvector"||gs==="list"||gs==="array"||gs==="matrix"||gs==="interval"){if(bs!==gs||vs.length!==ys.length)return!1;for(let xs=0;xs","<","ge","le"].includes(gs)){if(vs.length!==2||(gs===">"?(gs="<",ys=[ys[1],ys[0]]):gs==="ge"&&(gs="le",ys=[ys[1],ys[0]]),bs===">"?(bs="<",vs=[vs[1],vs[0]]):bs==="ge"&&(bs="le",vs=[vs[1],vs[0]]),gs!==bs))return!1;let xs=["+",ys[0],["-",ys[1]]],Cs=["+",vs[0],["-",vs[1]]],Ts=gs!=="=";return component_equals({expr:ss.fromAst(xs),other:os.fromAst(Cs),randomBindings:ns,expr_context:ss,other_context:os,allow_proportional:!0,require_positive_proportion:Ts,relative_tolerance:ls,absolute_tolerance:us,tolerance_for_zero:cs,allowed_error_in_numbers:ds,include_error_in_number_exponents:ps,allowed_error_is_absolute:fs,rng:hs})}}return component_equals({expr:as,other:rs,randomBindings:ns,expr_context:ss,other_context:os,relative_tolerance:ls,absolute_tolerance:us,tolerance_for_zero:cs,allowed_error_in_numbers:ds,include_error_in_number_exponents:ps,allowed_error_is_absolute:fs,rng:hs})},component_equals=function({expr:as,other:rs,randomBindings:ns,expr_context:ss,other_context:os,allow_proportional:ls=!1,require_positive_proportion:us=!1,relative_tolerance:cs,absolute_tolerance:ds,tolerance_for_zero:ps,allowed_error_in_numbers:fs,include_error_in_number_exponents:hs,allowed_error_is_absolute:gs,rng:ys}){var bs=1e-20*Number.MAX_VALUE,vs=0,xs=10;as=as.normalize_function_names(),rs=rs.normalize_function_names(),as=as.log_subscript_to_two_arg_log(),rs=rs.log_subscript_to_two_arg_log(),as=as.subscripts_to_strings(),rs=rs.subscripts_to_strings(),as=as.normalize_applied_functions(),rs=rs.normalize_applied_functions();let Cs=rename_functions_with_exponents(as.tree),Ts=rename_functions_with_exponents(rs.tree);as=ss.fromAst(rename_vecs(Cs)),rs=os.fromAst(rename_vecs(Ts));var Ss=[...new Set([...as.variables(),...rs.variables()])];math$1.define_pi&&(Ss=Ss.filter(function(Us){return Us!=="pi"})),math$1.define_i&&(Ss=Ss.filter(function(Us){return Us!=="i"})),math$1.define_e&&(Ss=Ss.filter(function(Us){return Us!=="e"}));var Ns=[];for(let Us=0;UsUs.length===1||Us.includes("_")||Us.includes("^")),ws=As.filter(Us=>Ss.includes(Us));if(As=As.filter(Us=>!Ss.includes(Us)),ws.length>0){let Us=as.tree,js=rs.tree,Ls="x1";for(;[...As,...Ss].includes(Ls);)Ls+="x1";let Gs="x2";for(;[...As,...Ss].includes(Gs);)Gs+="x2";for(let Hs of ws){let Ys=Hs+Hs;for(;[...As,...Ss].includes(Ys);)Ys+=Hs;let Zs=[[["apply",Hs,Ls],["apply",Ys,Ls],{variables:{[Ls]:!0}}]];Us=applyAllTransformations(Us,Zs),js=applyAllTransformations(js,Zs),As.push(Ys)}as=ss.fromAst(Us),rs=os.fromAst(js)}try{var Es=as.f(),_s=rs.f()}catch{return as.equalsViaSyntax(rs,{allow_blanks:!0})}let $s,Rs,Ds;if(fs>0){let Us=replace_numbers_with_parameters({expr:as,variables:Ss,include_exponents:hs});$s=ss.fromAst(Us.expr_with_params),Rs=Us.parameters;let js=Object.keys(Rs);if(js.length>0){let Ls=$s.derivative(js[0]);if(gs||(Ls=Ls.multiply(Rs[js[0]])),js.length>1)for(let Hs of js.slice(1)){let Ys=$s.derivative(Hs);gs||(Ys=Ys.multiply(Rs[Hs])),Ls=Ls.add(Ys)}let Gs=Ls.multiply(fs);try{Ds=Gs.f()}catch{}}}var Os=1,Is=[10,1,100,.1,1e3,.01],Vs=0;let ks=0,Ps=!0,Bs=0;for(let Us=0;Us<1e3;Us++){try{var Ms=Ws(Is[Vs],ys)}catch{continue}if(Ms.always_zero===!1&&(Ps=!1),!Ms.equal&&!Ms.out_of_bounds&&!Ms.always_zero&&Ms.sufficient_finite_values!==!1&&(Bs++,Bs>100))return!1;if(Ms.equal){if(Ms.always_zero){if(!Ps)continue;if(ks+=1,ks>5&&(Vs+=1,ks=0),Vs>=Is.length)return!0;continue}return!0}}return!1;function Ws(Us,js){var Ls,Gs=ns(js,Ss,Us);for(let El=0;Elvs)||!(Nl===0||Nl>vs))return{out_of_bounds:!0,always_zero:!1};var yl=Math.min(Zs,Nl),Dl=Math.max(Zs,Nl),Rl=1;let Ml=0;if(Ds){try{Ml=math$1.abs(Ds(Ls))}catch{return{equal_at_start:!1,always_zero:!1}}if(!Number.isFinite(Ml))return{equal_at_start:!1,always_zero:!1}}if(Ml+=yl*cs,Ml=Math.min(Ml,.1*yl),Ml+=Ml!==0||Hs!==0&&Ys!==0?ds:ps,!(Dl===0||math$1.abs(math$1.subtract(Hs,Ys))0))return{equal_at_start:!1,always_zero:!1}}var Ks=Dl===0,qs=0;for(let El=0;El<100;El++){var Qs,Js=ns(js,Ss,Os/100,Gs);for(let _l=0;_l=xs)return{equal:!0,always_zero:Ks}}}return{sufficient_finite_values:!1,always_zero:Ks}}};function replace_numbers_with_parameters({expr:as,variables:rs,include_exponents:ns=!1}){let ss={},os=0;function ls(){os++;let us="par"+os;for(;rs.includes(us);)os++,us="par"+os;return us}return{expr_with_params:function us(cs){if(typeof cs=="number"){if(cs===0)return cs;{let fs=ls();return ss[fs]=cs,fs}}if(typeof cs=="string"){if(cs==="pi"){if(math$1.define_pi){let fs=ls();return ss[fs]=math$1.PI,fs}}else if(cs==="e"&&math$1.define_e){let fs=ls();return ss[fs]=math$1.e,fs}return cs}if(!Array.isArray(cs))return cs;let ds=cs[0],ps=cs.slice(1);return ds!=="^"||ns?[ds,...ps.map(us)]:[ds,us(ps[0]),ps[1]]}((as=as.evaluate_numbers({max_digits:1/0})).tree),parameters:ss}}function rename_functions_with_exponents(as){if(!Array.isArray(as))return as;let rs=as[0],ns=as.slice(1);if(rs==="apply"){let ss=ns[0];return Array.isArray(ss)&&ss[0]==="^"&&ss.slice(1).every(os=>["number","string"].includes(typeof os))&&(ss=astToText.convert(ss)),["apply",ss,ns[1]]}return[rs,...ns.map(rename_functions_with_exponents)]}function rename_vecs(as){if(!Array.isArray(as))return as;let rs=as[0],ns=as.slice(1);return rs==="vec"&&ns.length===1?"__vec_"+astToText.convert(ns[0]):[rs,...ns.map(rename_vecs)]}function randomComplexBindings(as,rs,ns,ss){var os={};return ss===void 0?rs.forEach(function(ls){os[ls]=math$1.complex(2*as()*ns-ns,2*as()*ns-ns)}):rs.forEach(function(ls){os[ls]=math$1.complex(ss[ls].re+2*as()*ns-ns,ss[ls].im+2*as()*ns-ns)}),os}const equals$4=function(as,rs,{relative_tolerance:ns=1e-12,absolute_tolerance:ss=0,tolerance_for_zero:os=1e-15,allowed_error_in_numbers:ls=0,include_error_in_number_exponents:us=!1,allowed_error_is_absolute:cs=!1,allow_blanks:ds=!1}={}){if(!ds&&(as.variables().includes("_")||rs.variables().includes("_")))return!1;let ps=seedrandom$1("complex_seed");return as=as.remove_scaling_units(),rs=rs.remove_scaling_units(),!(!as.isAnalytic({allow_abs:!0,allow_arg:!0,allow_relation:!0})||!rs.isAnalytic({allow_abs:!0,allow_arg:!0,allow_relation:!0}))&&equals$5({expr:as,other:rs,randomBindings:randomComplexBindings,expr_context:as.context,other_context:rs.context,relative_tolerance:ns,absolute_tolerance:ss,tolerance_for_zero:os,allowed_error_in_numbers:ls,include_error_in_number_exponents:us,allowed_error_is_absolute:cs,rng:ps})};function randomRealBindings(as,rs,ns,ss){var os={};return ss===void 0?rs.forEach(function(ls){os[ls]=2*as()*ns-ns}):rs.forEach(function(ls){os[ls]=ss[ls]+2*as()*ns-ns}),os}const equals$3=function(as,rs,{relative_tolerance:ns=1e-12,absolute_tolerance:ss=0,tolerance_for_zero:os=1e-15,allowed_error_in_numbers:ls=0,include_error_in_number_exponents:us=!1,allowed_error_is_absolute:cs=!1}={}){if(!as.isAnalytic()||!rs.isAnalytic())return!1;let ds=seedrandom("real_seed");return equals$5({expr:as,other:rs,randomBindings:randomRealBindings,expr_context:as.context,other_content:rs.context,relative_tolerance:ns,absolute_tolerance:ss,tolerance_for_zero:os,allowed_error_in_numbers:ls,include_error_in_number_exponents:us,allowed_error_is_absolute:cs,rng:ds})},equals$2=function(as,rs,{allowed_error_in_numbers:ns=0,include_error_in_number_exponents:ss=!1,allowed_error_is_absolute:os=!1,allow_blanks:ls=!1}={}){if(!ls&&(as.variables().includes("_")||rs.variables().includes("_")))return!1;let us=as.normalize_function_names().normalize_applied_functions().normalize_angle_linesegment_arg_order(),cs=rs.normalize_function_names().normalize_applied_functions().normalize_angle_linesegment_arg_order();return equal$2(us.tree,cs.tree,{allowed_error_in_numbers:ns,include_error_in_number_exponents:ss,allowed_error_is_absolute:os})},equals$1=function(as,rs,{min_elements_match:ns=3,match_partial:ss=!1}={}){if(!is_discrete_infinite_set(as))return!1;if(is_discrete_infinite_set(rs)){var os=[];let ls=as.context.get_assumptions(as);if(ls!==void 0&&os.push(ls),ls=rs.context.get_assumptions(rs),ls!==void 0&&os.push(ls),os=os.length===0?void 0:os.length===1?os[0]:clean_assumptions(["and"].concat(os)),ss){let us=contained_in$1(as.tree,rs.tree,os,ss);if(us===!1)return 0;let cs=contained_in$1(rs.tree,as.tree,os,ss);return cs===!1?0:us===!0?cs===!0?1:cs:cs===!0?us:Math.min(us,cs)}return contained_in$1(as.tree,rs.tree,os,ss)&&contained_in$1(rs.tree,as.tree,os,ss)}{let ls=rs.tree;if(ls[0]!=="list")return!1;let us=ls.length-2;if(ls[us+1][0]!=="ldots"||uscontained_in$1(gs,rs,ns))}var os=as[1],ls=as[2],us=as[3],cs=as[4];if(!Array.isArray(us)||us[0]!=="-"||us[1]!==1/0||cs!==1/0)return!1;os=simplify(["/",os,ls],ns,1/0);var ds=rs.slice(1),ps=[];for(let gs=0;gsgs[0]))];let hs=0;for(let gs of fs){let ys=ps.map(function(vs,xs){let Cs=gs/vs[0];return Number.isInteger(Cs)?[vs[0],Cs,xs]:void 0}).filter(vs=>vs),bs=[];for(let vs of ys){let xs=vs[0],Cs=vs[1],Ts=vs[2],Ss=ps[Ts][2],Ns=ps[Ts][3];for(let As=0;Ashs&&(hs=vs)}}return!!(ss&&hs>0)&&hs}function sequence_from_discrete_infinite(as,rs){var ns=as.tree.slice(1);if(ns.length>1)return;let ss=ns[0][1],os=ns[0][2],ls=evaluate_numbers(ns[0][3]),us=ns[0][4];if(!Number.isInteger(ls)||us!==1/0)return;let cs=[];for(let ds=0;ds0))throw Error(`Have not implemented equality check with ${ss} sign errors.`);if(ss>1){let fs=ns;ns=function(hs,gs){return equalSpecifiedSignErrors(hs,gs,{equalityFunction:fs,n_sign_errors:ss-1})}}var os,ls,us=as.tree,cs=[[us]],ds=0;as.tree=["-",us];var ps=ns(as,rs);if(as.tree=us,ps)return!0;for(;os=cs[ds++];)if(os=os[0],Array.isArray(os)){for(ls=1;ls"];function isAnalytic(as,{allow_abs:rs=!1,allow_arg:ns=!1,allow_relation:ss=!1}={}){var os=normalize_applied_functions(normalize_function_names(as)),ls=operators$3(os=subscripts_to_strings(os));for(let cs=0;cs+")},"-":function(rs){return"-"+rs.join("-")+""},"*":function(rs){return rs.join('\\cdot*')},"/":function(rs){return astToGuppy$1.dfrac(rs[0],rs[1])},"^":function(rs){return astToGuppy$1.power(rs[0],rs[1])},sin:function(rs){return astToGuppy$1.trig("sin",rs[0])},cos:function(rs){return astToGuppy$1.trig("cos",rs[0])},tan:function(rs){return astToGuppy$1.trig("tan",rs[0])},arcsin:function(rs){return astToGuppy$1.trig("arcsin",rs[0])},arccos:function(rs){return astToGuppy$1.trig("arccos",rs[0])},arctan:function(rs){return astToGuppy$1.trig("arctan",rs[0])},arccsc:function(rs){return astToGuppy$1.trig("arccsc",rs[0])},arcsec:function(rs){return astToGuppy$1.trig("arcsec",rs[0])},arccot:function(rs){return astToGuppy$1.trig("arccot",rs[0])},csc:function(rs){return astToGuppy$1.trig("csc",rs[0])},sec:function(rs){return astToGuppy$1.trig("sec",rs[0])},cot:function(rs){return astToGuppy$1.trig("cot",rs[0])},log:function(rs){return astToGuppy$1.trig("log",rs[0])},exp:function(rs){return astToGuppy$1.trig("exp",rs[0])},ln:function(rs){return astToGuppy$1.trig("ln",rs[0])},sqrt:function(rs){return astToGuppy$1.sqrt(rs[0])},abs:function(rs){return astToGuppy$1.abs(rs[0])}}}static dfrac(rs,ns){return'\\dfrac{}{}\\frac{}{}()/()'+rs+''+ns+""}static trig(rs,ns){return'\\'+rs+'\\left(\\right) '+rs+'()'+ns+""}static sqrt(rs){return'\\sqrt{}sqrt()'+rs+""}static power(rs,ns){return'{}^{}()^()'+rs+''+ns+""}static abs(rs){return'\\left|\\right|abs()'+rs+""}static paren(rs){return'\\left(\\right)()'+rs+""}static isFunctionSymbol(rs){return["sin","cos","tan","csc","sec","cot","arcsin","arccos","arctan","arccsc","arcsec","arccot","log","ln","exp","sqrt","abs","this.factorial"].indexOf(rs)!==-1}static isGreekLetterSymbol(rs){return["pi","theta","theta","Theta","alpha","nu","beta","xi","Xi","gamma","Gamma","delta","Delta","pi","Pi","epsilon","epsilon","rho","rho","zeta","sigma","Sigma","eta","tau","upsilon","Upsilon","iota","phi","phi","Phi","kappa","chi","lambda","Lambda","psi","Psi","omega","Omega"].indexOf(rs)!==-1}factorWithParenthesesIfNegated(rs){var ns=this.factor(rs);return ns.toString().match(/^-/)?astToGuppy$1.paren(ns.toString()):ns}factor(rs){if(typeof rs=="string")return astToGuppy$1.isGreekLetterSymbol(rs)?'\\'+rs+' $'+rs+"":""+rs+"";if(typeof rs=="number")return""+rs+"";if(!Array.isArray(rs))return"";var ns=rs[0],ss=rs.slice(1);return ns==="apply"&&(ns=rs[1],ss=rs.slice(2)),ns==="abs"?this.operators[ns](ss.map(function(os,ls){return this.expression(os)}.bind(this))):astToGuppy$1.isFunctionSymbol(ns)?ns!=="this.factorial"||ss[0].toString().length!==1&&!ss[0].toString().match(/^[0-9]*$/)?this.operators[ns](ss.map(function(os,ls){return this.factor(os)}.bind(this))):this.operators[ns](ss):ns==="^"||ns==="~"?this.operators[ns](ss.map(function(os,ls){return this.factor(os)}.bind(this))):astToGuppy$1.paren(this.expression(rs))}term(rs){if(!Array.isArray(rs))return this.factor(rs);var ns=rs[0],ss=rs.slice(1);return ns==="*"?this.operators[ns](ss.map(function(os,ls){var us=this.factorWithParenthesesIfNegated(os);return us.toString().match(/^[0-9]/)&&ls>0?" * "+us:us}.bind(this))):ns==="/"?this.operators[ns](ss.map(function(os,ls){return this.factor(os)}.bind(this))):this.factor(rs)}expression(rs){if(!Array.isArray(rs))return this.term(rs);var ns=rs[0],ss=rs.slice(1);return ns==="+"||ns==="-"?this.operators[ns](ss.map(function(os,ls){return this.factorWithParenthesesIfNegated(os)}.bind(this))):this.term(rs)}convert(rs){return(""+this.expression(rs)+"").replace(/<\/e>/g,"")}}const glslOperators={"+":function(as){var rs=as[0];return as.slice(1).forEach(function(ns){rs=rs+"+"+ns}),rs},"-":function(as){var rs="-"+as[0];return as.slice(1).forEach(function(ns){rs=rs+"-"+ns}),rs},"~":function(as){var rs="vec2(0.0,0.0)";return as.forEach(function(ns){rs=rs+"-"+ns}),rs},"*":function(as){var rs=as[0];return as.slice(1).forEach(function(ns){rs="cmul("+rs+","+ns+")"}),rs},"/":function(as){var rs=as[0];return as.slice(1).forEach(function(ns){rs="cdiv("+rs+","+ns+")"}),rs},sin:function(as){return"csin("+as[0]+")"},cos:function(as){return"ccos("+as[0]+")"},tan:function(as){return"ctan("+as[0]+")"},sinh:function(as){return"csinh("+as[0]+")"},cosh:function(as){return"ccosh("+as[0]+")"},arcsin:function(as){return"carcsin("+as[0]+")"},arccos:function(as){return"carccos("+as[0]+")"},arctan:function(as){return"carctan("+as[0]+")"},arccsc:function(as){return"carcsin(cdiv(vec2(1.0,0),"+as[0]+"))"},arcsec:function(as){return"carccos(cdiv(vec2(1.0,0),"+as[0]+"))"},arccot:function(as){return"carctan(cdiv(vec2(1.0,0),"+as[0]+"))"},csc:function(as){return"ccsc("+as[0]+")"},sec:function(as){return"csec("+as[0]+")"},cot:function(as){return"ccot("+as[0]+")"},exp:function(as){return"cexp("+as[0]+")"},conj:function(as){return"conjugate("+as[0]+")"},sqrt:function(as){return"cpower("+as[0]+",vec2(0.5,0.0))"},log:function(as){return"clog("+as[0]+")"},ln:function(as){return"clog("+as[0]+")"},"^":function(as){return"cpower("+as[0]+","+as[1]+")"},abs:function(as){return"cabs("+as[0]+")"},apply:function(as){return"vec2(NaN,NaN)"}};class astToGLSL$1{constructor(){}convert(rs){if(typeof rs=="boolean")throw Error("no support for boolean");if(typeof rs=="string")return rs==="e"?"vec2(2.71828182845905,0.0)":rs==="pi"?"vec2(3.14159265358979,0.0)":rs==="i"?"vec2(0.0,1.0)":String(rs);if(typeof rs=="number")return"vec2("+String(rs)+",0.0)";if("real"in rs&&"imaginary"in rs)return rs;if(!Array.isArray(rs))throw Error("Invalid ast");var ns=rs[0],ss=rs.slice(1);if(ns==="apply"){if(typeof ss[0]!="string")throw Error("Non string functions not implemented for conversion to GLSL");return ns=ss[0],ss=ss.slice(1),glslOperators[ns](ss.map(function(os,ls){return this.convert(os)}.bind(this)))}if(ns in glslOperators)return glslOperators[ns](ss.map(function(os,ls){return this.convert(os)}.bind(this)));throw Error("Operator "+ns+" not implemented for conversion to mathjs")}}var astToGuppy=new astToGuppy$1,astToGLSL=new astToGLSL$1;const tex=function(as,rs){return new astToLatex$1(rs).convert(as.tree)},toLatex=tex,toString=function(as,rs){return new astToText$2(rs).convert(as.tree)},toGLSL=function(as){return astToGLSL.convert(as.tree)},toXML=function(as){return astToGuppy.convert(as.tree)};var printing=Object.freeze({__proto__:null,tex,toLatex,toString,toXML,toGLSL});const integrateNumerically=function(as,rs,ns,ss){for(var os=0,ls={},us=0;us<100;us++){var cs=ns+(ss-ns)*(us+.5)/100;ls[rs]=cs,os+=as.evaluate(ls)}return os*(ss-ns)/100};var integration=Object.freeze({__proto__:null,integrateNumerically});function expression_to_polynomial(as){var rs=get_tree(as);if(typeof rs=="string")return rs==="pi"&&math$1.define_pi||rs==="i"&&math$1.define_i||rs==="e"&&math$1.define_e?rs:["polynomial",rs,[[1,1]]];if(typeof rs=="number")return rs;let ns=evaluate_to_constant(rs,!1);if(ns!==null&&Number.isFinite(ns))return simplify(rs);if(!Array.isArray(rs)||!operators$3(rs).every(ds=>["+","-","*","^","/","_","prime"].includes(ds)))return!1;var ss=rs[0],os=rs.slice(1);if(ss==="+"){let ds=os.map(expression_to_polynomial);return!!ds.every(ps=>ps!==!1)&&ds.reduce((ps,fs)=>polynomial_add(ps,fs))}if(ss==="-"){let ds=expression_to_polynomial(os[0]);return!!ds&&polynomial_neg(ds)}if(ss==="*"){let ds=os.map(expression_to_polynomial);return!!ds.every(ps=>ps!==!1)&&ds.reduce((ps,fs)=>polynomial_mul(ps,fs))}if(ss==="^"){let ds=os[0],ps=expression_to_polynomial(ds);if(ps===!1)return!1;let fs=simplify(os[1]);if(typeof fs!="number"||fs<0||!Number.isInteger(fs)){let hs=evaluate_to_constant(fs,!1);if(hs!==null||Number.isFinite(hs)){let gs=math$1.fraction(hs);if(gs.d<=100){ds=gs.s<0?["^",ds,["/",-1,gs.d]]:["^",ds,["/",1,gs.d]];var ls=["polynomial",simplify(ds),[]];return ls[2].push([gs.n,1]),ls}}return["polynomial",rs,[[1,1]]]}return fs===0?1:fs===1?ps:polynomial_pow(ps,fs)}if(ss==="/"){var us=os[1],cs=evaluate_to_constant(us,!1);return cs!==null&&Number.isFinite(cs)?polynomial_mul(expression_to_polynomial(os[0]),["/",1,cs]):["polynomial",rs,[[1,1]]]}return["polynomial",rs,[[1,1]]]}function polynomials_in_same_leading_variable(as,rs){return as[1]!==rs[1]&&(compare_function(as[1],rs[1])<0?rs=["polynomial",as[1],[[0,rs]]]:as=["polynomial",rs[1],[[0,as]]]),[as,rs]}function polynomial_add(as,rs){if(as[0]!=="polynomial"){if(rs[0]!=="polynomial")return simplify(["+",as,rs]);as=["polynomial",rs[1],[[0,as]]]}else if(rs[0]!=="polynomial")rs=["polynomial",as[1],[[0,rs]]];else{let fs=polynomials_in_same_leading_variable(as,rs);as=fs[0],rs=fs[1]}let ns=["polynomial",as[1],[]],ss=as[2],os=rs[2],ls=ns[2],us=ss.length,cs=os.length,ds=0,ps=0;for(;ds0;)1&rs&&(ns=polynomial_mul(ns,as)),as=polynomial_mul(as,as),rs>>=1;return ns}function polynomial_to_expression(as){if(!Array.isArray(as)||as[0]!=="polynomial")return as;let rs=as[1],ns=as[2],ss=[],os=ns.length;for(var ls=0;lsss[cs][1])return!1}return os!==ls&&us!==ls}function mono_gcd(as,rs){if(!Array.isArray(as)||!Array.isArray(rs)||as[0]!=="monomial"||rs[0]!=="monomial")return 1;let ns=as[2],ss=rs[2],os=[],ls=ns.length,us=ss.length,cs=0,ds=0;for(;cs=0;){var ss=[];ss.push([as[2][rs][1],ns]),ns=["polynomial",as[2][rs][0],ss],rs-=1}return ns}function max_div_init(as,rs){if(as===0)return 0;let ns=as,ss=[];for(;Array.isArray(ns)&&ns[0]==="polynomial";){let cs=ns[1],ds=ns[2],ps=ds[ds.length-1][0];ns=ds[ds.length-1][1],ss.push([cs,ps])}let os=["monomial",ns,ss],ls=rs.length;for(var us=0;us0?choice_lowest_degree(ls):0}function update_hij_table(as,rs,ns){let ss=rs.length;rs.push(ns);let os=0,ls=1,us=[];for(;ls0?choice_lowest_degree(us):0}function choice_lowest_degree(as){let rs=[],ns=as.length;for(os=0;os15?ns:(rs=Math.round(rs),round_numbers_to_precision_sub(ns,rs))}const round_numbers_to_precision_sub=function(as,rs=14){if(typeof as=="number"&&Number.isFinite(as)&&as!==0){const ns=math$1.floor(math$1.log10(math$1.abs(as))),ss=rs-ns-1;return ss<0?parseFloat(toFixed(as,ss)+"0".repeat(math$1.abs(ss))):parseFloat(toFixed(as,ss))}return Array.isArray(as)?[as[0],...as.slice(1).map(ns=>round_numbers_to_precision_sub(ns,rs))]:as};function round_numbers_to_decimals(as,rs=14){var ns=get_tree(as);if(!Number.isFinite(rs))throw Error("For round_numbers_to_decimals, ndecimals must be a number");return rs=Math.round(rs),rs=Math.max(-330,Math.min(330,rs)),round_numbers_to_decimals_sub(ns,rs)}const round_numbers_to_decimals_sub=function(as,rs=0){return typeof as=="number"?rs<0?parseFloat(toFixed(as,rs)+"0".repeat(math$1.abs(rs))):parseFloat(toFixed(as,rs)):Array.isArray(as)?[as[0],...as.slice(1).map(ns=>round_numbers_to_decimals_sub(ns,rs))]:as};var round$3=Object.freeze({__proto__:null,round_numbers_to_precision,round_numbers_to_decimals});const match$1=function(as,rs,ns){let ss=get_tree(as),os=get_tree(rs);return match$2(ss,os,ns)};var match$1$1=Object.freeze({__proto__:null,match:match$1});const expression_to_tree$1=[simplify$1,differentiation,normalization,arithmetic,transformation,solve,sets,matrix$1,rational,round$3],expression_to_other=[variables$1,printing,equality,integration,evaluation,analytic,sign_error,match$1$1];function abs$3(as){return["apply","abs",get_tree(as)]}function exp$3(as){return["apply","exp",get_tree(as)]}function log(as){return["apply","log",get_tree(as)]}function log10(as){return["apply","log10",get_tree(as)]}function sign(as){return["apply","sign",get_tree(as)]}function sqrt(as){return["apply","sqrt",get_tree(as)]}function conj(as){return["apply","conj",get_tree(as)]}function im(as){return["apply","im",get_tree(as)]}function re$2(as){return["apply","re",get_tree(as)]}function factorial$2(as){return["apply","factorial",get_tree(as)]}function gamma$2(as){return["apply","gamma",get_tree(as)]}function erf$2(as){return["apply","erf",get_tree(as)]}function acos(as){return["apply","acos",get_tree(as)]}function acosh(as){return["apply","acosh",get_tree(as)]}function acot(as){return["apply","acot",get_tree(as)]}function acoth(as){return["apply","acoth",get_tree(as)]}function acsc(as){return["apply","acsc",get_tree(as)]}function acsch(as){return["apply","acsch",get_tree(as)]}function asec(as){return["apply","asec",get_tree(as)]}function asech(as){return["apply","asech",get_tree(as)]}function asin(as){return["apply","asin",get_tree(as)]}function asinh(as){return["apply","asinh",get_tree(as)]}function atan(as){return["apply","atan",get_tree(as)]}function atanh(as){return["apply","atanh",get_tree(as)]}function cos$3(as){return["apply","cos",get_tree(as)]}function cosh$4(as){return["apply","cosh",get_tree(as)]}function cot(as){return["apply","cot",get_tree(as)]}function coth(as){return["apply","coth",get_tree(as)]}function csc(as){return["apply","csc",get_tree(as)]}function csch(as){return["apply","csch",get_tree(as)]}function sec(as){return["apply","sec",get_tree(as)]}function sech(as){return["apply","sech",get_tree(as)]}function sin$3(as){return["apply","sin",get_tree(as)]}function sinh$4(as){return["apply","sinh",get_tree(as)]}function tan(as){return["apply","tan",get_tree(as)]}function tanh(as){return["apply","tanh",get_tree(as)]}function atan2(as,rs){return["apply","atan2",["tuple",get_tree(as),get_tree(rs)]]}var standard=Object.freeze({__proto__:null,abs:abs$3,exp:exp$3,log,log10,sign,sqrt,conj,im,re:re$2,factorial:factorial$2,gamma:gamma$2,erf:erf$2,acos,acosh,acot,acoth,acsc,acsch,asec,asech,asin,asinh,atan,atanh,cos:cos$3,cosh:cosh$4,cot,coth,csc,csch,sec,sech,sin:sin$3,sinh:sinh$4,tan,tanh,atan2});const expression_to_tree=[standard],whitespace_rule="\\s|\\\\,|\\\\!|\\\\ |\\\\>|\\\\;|\\\\:|\\\\quad\\b|\\\\qquad\\b",sci_notat_exp_regex="(E[+\\-]?[0-9]+\\s*($|(?=\\,|&|\\||\\\\\\||\\)|\\}|\\\\}|\\]|\\\\\\\\|\\\\end)))?",number_rules_sci=[["[0-9]+(\\.[0-9]*)?"+sci_notat_exp_regex,"NUMBER"],["\\.[0-9]+"+sci_notat_exp_regex,"NUMBER"]],number_rules_non_sci=[["[0-9]+(\\.[0-9]*)?","NUMBER"],["\\.[0-9]+","NUMBER"]],base_latex_rules=[["\\*","*"],["\\/","/"],["-","-"],["\\+","+"],["\\^","^"],["\\(","("],["\\\\left\\s*\\(","("],["\\\\bigl\\s*\\(","("],["\\\\Bigl\\s*\\(","("],["\\\\biggl\\s*\\(","("],["\\\\Biggl\\s*\\(","("],["\\)",")"],["\\\\right\\s*\\)",")"],["\\\\bigr\\s*\\)",")"],["\\\\Bigr\\s*\\)",")"],["\\\\biggr\\s*\\)",")"],["\\\\Biggr\\s*\\)",")"],["\\[","["],["\\\\left\\s*\\[","["],["\\\\bigl\\s*\\[","["],["\\\\Bigl\\s*\\[","["],["\\\\biggl\\s*\\[","["],["\\\\Biggl\\s*\\[","["],["\\]","]"],["\\\\right\\s*\\]","]"],["\\\\bigr\\s*\\]","]"],["\\\\Bigr\\s*\\]","]"],["\\\\biggr\\s*\\]","]"],["\\\\Biggr\\s*\\]","]"],["\\|","|"],["\\\\left\\s*\\|","|L"],["\\\\bigl\\s*\\|","|L"],["\\\\Bigl\\s*\\|","|L"],["\\\\biggl\\s*\\|","|L"],["\\\\Biggl\\s*\\|","|L"],["\\\\right\\s*\\|","|"],["\\\\bigr\\s*\\|","|"],["\\\\Bigr\\s*\\|","|"],["\\\\biggr\\s*\\|","|"],["\\\\Biggr\\s*\\|","|"],["\\\\big\\s*\\|","|"],["\\\\Big\\s*\\|","|"],["\\\\bigg\\s*\\|","|"],["\\\\Bigg\\s*\\|","|"],["{","{"],["}","}"],["\\\\{","LBRACE"],["\\\\left\\s*\\\\{","LBRACE"],["\\\\bigl\\s*\\\\{","LBRACE"],["\\\\Bigl\\s*\\\\{","LBRACE"],["\\\\biggl\\s*\\\\{","LBRACE"],["\\\\Biggl\\s*\\\\{","LBRACE"],["\\\\}","RBRACE"],["\\\\right\\s*\\\\}","RBRACE"],["\\\\bigr\\s*\\\\}","RBRACE"],["\\\\Bigr\\s*\\\\}","RBRACE"],["\\\\biggr\\s*\\\\}","RBRACE"],["\\\\Biggr\\s*\\\\}","RBRACE"],["\\\\lfloor(?![a-zA-Z])","LFLOOR"],["\\\\left\\s*\\\\lfloor(?![a-zA-Z])","LFLOOR"],["\\\\bigl\\s*\\\\lfloor(?![a-zA-Z])","LFLOOR"],["\\\\Bigl\\s*\\\\lfloor(?![a-zA-Z])","LFLOOR"],["\\\\biggl\\s*\\\\lfloor(?![a-zA-Z])","LFLOOR"],["\\\\Biggl\\s*\\\\lfloor(?![a-zA-Z])","LFLOOR"],["\\\\rfloor(?![a-zA-Z])","RFLOOR"],["\\\\right\\s*\\\\rfloor(?![a-zA-Z])","RFLOOR"],["\\\\bigr\\s*\\\\rfloor(?![a-zA-Z])","RFLOOR"],["\\\\Bigr\\s*\\\\rfloor(?![a-zA-Z])","RFLOOR"],["\\\\biggr\\s*\\\\rfloor(?![a-zA-Z])","RFLOOR"],["\\\\Biggr\\s*\\\\rfloor(?![a-zA-Z])","RFLOOR"],["\\\\lceil(?![a-zA-Z])","LCEIL"],["\\\\left\\s*\\\\lceil(?![a-zA-Z])","LCEIL"],["\\\\bigl\\s*\\\\lceil(?![a-zA-Z])","LCEIL"],["\\\\Bigl\\s*\\\\lceil(?![a-zA-Z])","LCEIL"],["\\\\biggl\\s*\\\\lceil(?![a-zA-Z])","LCEIL"],["\\\\Biggl\\s*\\\\lceil(?![a-zA-Z])","LCEIL"],["\\\\rceil(?![a-zA-Z])","RCEIL"],["\\\\right\\s*\\\\rceil(?![a-zA-Z])","RCEIL"],["\\\\bigr\\s*\\\\rceil(?![a-zA-Z])","RCEIL"],["\\\\Bigr\\s*\\\\rceil(?![a-zA-Z])","RCEIL"],["\\\\biggr\\s*\\\\rceil(?![a-zA-Z])","RCEIL"],["\\\\Biggr\\s*\\\\rceil(?![a-zA-Z])","RCEIL"],["\\\\langle(?![a-zA-Z])","LANGLE"],["\\\\left\\s*\\\\langle(?![a-zA-Z])","LANGLE"],["\\\\bigl\\s*\\\\langle(?![a-zA-Z])","LANGLE"],["\\\\Bigl\\s*\\\\langle(?![a-zA-Z])","LANGLE"],["\\\\biggl\\s*\\\\langle(?![a-zA-Z])","LANGLE"],["\\\\Biggl\\s*\\\\langle(?![a-zA-Z])","LANGLE"],["\\\\rangle(?![a-zA-Z])","RANGLE"],["\\\\right\\s*\\\\rangle(?![a-zA-Z])","RANGLE"],["\\\\bigr\\s*\\\\rangle(?![a-zA-Z])","RANGLE"],["\\\\Bigr\\s*\\\\rangle(?![a-zA-Z])","RANGLE"],["\\\\biggr\\s*\\\\rangle(?![a-zA-Z])","RANGLE"],["\\\\Biggr\\s*\\\\rangle(?![a-zA-Z])","RANGLE"],["\\\\cdot(?![a-zA-Z])","*"],["\\\\div(?![a-zA-Z])","/"],["\\\\times(?![a-zA-Z])","*"],[",",","],[":",":"],["\\\\mid(?![a-zA-Z])","MID"],["\\\\vartheta(?![a-zA-Z])","LATEXCOMMAND","\\theta"],["\\\\varepsilon(?![a-zA-Z])","LATEXCOMMAND","\\epsilon"],["\\\\varrho(?![a-zA-Z])","LATEXCOMMAND","\\rho"],["\\\\varphi(?![a-zA-Z])","LATEXCOMMAND","\\phi"],["\\\\infty(?![a-zA-Z])","INFINITY"],["\\\\asin(?![a-zA-Z])","LATEXCOMMAND","\\arcsin"],["\\\\acos(?![a-zA-Z])","LATEXCOMMAND","\\arccos"],["\\\\atan(?![a-zA-Z])","LATEXCOMMAND","\\arctan"],["\\\\sqrt(?![a-zA-Z])","SQRT"],["\\\\land(?![a-zA-Z])","AND"],["\\\\wedge(?![a-zA-Z])","AND"],["\\\\lor(?![a-zA-Z])","OR"],["\\\\vee(?![a-zA-Z])","OR"],["\\\\lnot(?![a-zA-Z])","NOT"],["=","="],["\\\\neq(?![a-zA-Z])","NE"],["\\\\ne(?![a-zA-Z])","NE"],["\\\\not\\s*=","NE"],["\\\\leq(?![a-zA-Z])","LE"],["\\\\le(?![a-zA-Z])","LE"],["\\\\geq(?![a-zA-Z])","GE"],["\\\\ge(?![a-zA-Z])","GE"],["<","<"],["\\\\lt(?![a-zA-Z])","<"],[">",">"],["\\\\gt(?![a-zA-Z])",">"],["\\\\forall(?![a-zA-Z])","FORALL"],["\\\\exists(?![a-zA-Z])","EXISTS"],["\\\\in(?![a-zA-Z])","IN"],["\\\\notin(?![a-zA-Z])","NOTIN"],["\\\\not\\s*\\\\in(?![a-zA-Z])","NOTIN"],["\\\\ni(?![a-zA-Z])","NI"],["\\\\not\\s*\\\\ni(?![a-zA-Z])","NOTNI"],["\\\\subset(?![a-zA-Z])","SUBSET"],["\\\\subseteq(?![a-zA-Z])","SUBSETEQ"],["\\\\not\\s*\\\\subset(?![a-zA-Z])","NOTSUBSET"],["\\\\not\\s*\\\\subseteq(?![a-zA-Z])","NOTSUBSETEQ"],["\\\\supset(?![a-zA-Z])","SUPERSET"],["\\\\supseteq(?![a-zA-Z])","SUPERSETEQ"],["\\\\not\\s*\\\\supset(?![a-zA-Z])","NOTSUPERSET"],["\\\\not\\s*\\\\supseteq(?![a-zA-Z])","NOTSUPERSETEQ"],["\\\\cup(?![a-zA-Z])","UNION"],["\\\\cap(?![a-zA-Z])","INTERSECT"],["\\\\perp(?![a-zA-Z])","PERP"],["\\\\bot(?![a-zA-Z])","PERP"],["\\\\parallel(?![a-zA-Z])","PARALLEL"],["\\\\\\|","PARALLEL"],["\\\\angle(?![a-zA-Z])","ANGLE"],["\\\\int(?![a-zA-Z])","INT"],["!","!"],["'","'"],["_","_"],["&","&"],["\\\\ldots(?![a-zA-Z])","LDOTS"],["\\\\\\\\","LINEBREAK"],["\\\\begin\\s*{\\s*[a-zA-Z0-9]+\\s*}","BEGINENVIRONMENT"],["\\\\end\\s*{\\s*[a-zA-Z0-9]+\\s*}","ENDENVIRONMENT"],["\\\\operatorname\\s*{\\s*[a-zA-Z0-9\\+\\-]+\\s*}","VARMULTICHAR"],["\\\\[a-zA-Z]+(?![a-zA-Z])","LATEXCOMMAND"],["\\\\[$%]","LATEXCOMMAND"],["[a-zA-Z_$%]","VAR"]],allowSimplifiedFunctionApplicationDefault=!0,allowedLatexSymbolsDefault=["alpha","beta","gamma","Gamma","delta","Delta","epsilon","zeta","eta","theta","Theta","iota","kappa","lambda","Lambda","mu","nu","xi","Xi","pi","Pi","rho","sigma","Sigma","tau","Tau","upsilon","Upsilon","phi","Phi","chi","psi","Psi","omega","Omega","partial","angle","circ","%","$"],appliedFunctionSymbolsDefault$2=["abs","exp","log","ln","log10","sign","sqrt","erf","cos","cosh","acos","acosh","arccos","arccosh","cot","coth","acot","acoth","arccot","arccoth","csc","csch","acsc","acsch","arccsc","arccsch","sec","sech","asec","asech","arcsec","arcsech","sin","sinh","asin","asinh","arcsin","arcsinh","tan","tanh","atan","atan2","atanh","arctan","arctanh","arg","conj","Re","Im","det","trace","nPr","nCr","floor","ceil","round"],functionSymbolsDefault=["f","g"],operatorSymbolsDefault={frac:{nargs:2,substitute:"/"},binom:{nargs:2},vec:{nargs:1},overline:{nargs:1,substitute:"linesegment",remove_products:!0}},unitsDefault=get_all_units();unitsDefault.circ=unitsDefault.deg,unitsDefault.circ.substitute="deg",unitsDefault.circ.isExponent=!0,delete unitsDefault.deg;const parseLeibnizNotationDefault=!0;class latexToAst$1{constructor({allowSimplifiedFunctionApplication:rs=allowSimplifiedFunctionApplicationDefault,allowedLatexSymbols:ns=allowedLatexSymbolsDefault,appliedFunctionSymbols:ss=appliedFunctionSymbolsDefault$2,functionSymbols:os=functionSymbolsDefault,operatorSymbols:ls=operatorSymbolsDefault,units:us=unitsDefault,parseLeibnizNotation:cs=parseLeibnizNotationDefault,parseScientificNotation:ds=!0}={}){this.allowSimplifiedFunctionApplication=rs,this.allowedLatexSymbols=ns,this.appliedFunctionSymbols=ss,this.functionSymbols=os,this.operatorSymbols=ls,this.units=us,this.parseLeibnizNotation=cs;let ps=base_latex_rules;ps=ds?[...number_rules_sci,...ps]:[...number_rules_non_sci,...ps],this.lexer=new lexer(ps,whitespace_rule)}advance(rs){if(this.token=this.lexer.advance(rs),this.token.token_type==="INVALID")throw new ParseError("Invalid symbol '"+this.token.original_text+"'",this.lexer.location)}return_state(){return{lexer_state:this.lexer.return_state(),token:Object.assign({},this.token)}}set_state(rs){this.lexer.set_state(rs.lexer_state),this.token=Object.assign({},rs.token)}convert(rs){this.lexer.set_input(rs),this.advance();var ns=this.statement_list();if(this.token.token_type!=="EOF")throw new ParseError("Invalid location of '"+this.token.original_text+"'",this.lexer.location);return flatten$6(ns)}statement_list(){for(var rs=[this.statement()];this.token.token_type===",";)this.advance(),rs.push(this.statement());return rs=rs.length>1?["list"].concat(rs):rs[0]}statement({inside_absolute_value:rs=0}={}){if(this.token.token_type==="LDOTS")return this.advance(),["ldots"];var ns;try{ns=this.return_state();let ss=this.statement_a({inside_absolute_value:rs});if(this.token.token_type!==":"&&this.token.token_type!=="MID")return ss;let os=this.token.token_type===":"?":":"|";return this.advance(),[os,ss,this.statement_a()]}catch(ss){try{this.set_state(ns);let os=this.statement_a({parse_absolute_value:!1});if(this.token.token_type[0]!=="|")throw ss;return this.advance(),["|",os,this.statement_a({parse_absolute_value:!1})]}catch{throw ss}}}statement_a({inside_absolute_value:rs=0,parse_absolute_value:ns=!0}={}){for(var ss=this.statement_b({inside_absolute_value:rs,parse_absolute_value:ns});this.token.token_type==="OR";){let os=this.token.token_type.toLowerCase();this.advance(),ss=[os,ss,this.statement_b({inside_absolute_value:rs,parse_absolute_value:ns})]}return ss}statement_b(rs){for(var ns=this.relation(rs);this.token.token_type==="AND";){let ss=this.token.token_type.toLowerCase();this.advance(),ns=[ss,ns,this.relation(rs)]}return ns}relation(rs){if(this.token.token_type==="NOT"||this.token.token_type==="!")return this.advance(),["not",this.relation(rs)];if(this.token.token_type==="FORALL"||this.token.token_type==="EXISTS"){let ss=this.token.token_type.toLowerCase();return this.advance(),[ss,this.relation(rs)]}for(var ns=this.expression(rs);this.token.token_type==="="||this.token.token_type==="NE"||this.token.token_type==="<"||this.token.token_type===">"||this.token.token_type==="LE"||this.token.token_type==="GE"||this.token.token_type==="IN"||this.token.token_type==="NOTIN"||this.token.token_type==="NI"||this.token.token_type==="NOTNI"||this.token.token_type==="SUBSET"||this.token.token_type==="NOTSUBSET"||this.token.token_type==="SUBSETEQ"||this.token.token_type==="NOTSUBSETEQ"||this.token.token_type==="SUPERSET"||this.token.token_type==="NOTSUPERSET"||this.token.token_type==="SUPERSETEQ"||this.token.token_type==="NOTSUPERSETEQ";){let ss=this.token.token_type.toLowerCase(),os=0;this.token.token_type==="<"||this.token.token_type==="LE"?os=-1:this.token.token_type!==">"&&this.token.token_type!=="GE"||(os=1),this.advance();let ls=this.expression(rs);if(os===-1)if(this.token.token_type==="<"||this.token.token_type==="LE"){let us=["tuple"];ss==="<"?us.push(!0):us.push(!1);let cs=["tuple",ns,ls];for(;this.token.token_type==="<"||this.token.token_type==="LE";)this.token.token_type==="<"?us.push(!0):us.push(!1),this.advance(),cs.push(this.expression(rs));ns=["lts",cs,us]}else ns=[ss,ns,ls];else if(os===1)if(this.token.token_type===">"||this.token.token_type==="GE"){let us=["tuple"];ss===">"?us.push(!0):us.push(!1);let cs=["tuple",ns,ls];for(;this.token.token_type===">"||this.token.token_type==="GE";)this.token.token_type===">"?us.push(!0):us.push(!1),this.advance(),cs.push(this.expression(rs));ns=["gts",cs,us]}else ns=[ss,ns,ls];else if(ss==="=")for(ns=["=",ns,ls];this.token.token_type==="=";)this.advance(),ns.push(this.expression(rs));else ns=[ss,ns,ls]}return ns}expression(rs){let ns=!1;this.token.token_type==="+"&&(ns=!0,this.advance());let ss=!1;this.token.token_type==="-"&&(ss=!0,this.advance());var os=this.term(rs);if(ss||ns){if(os===!1)return(ns?"+":"")+(ss?"-":"");if(typeof os=="string"&&[...os].every(ls=>["+","-"].includes(ls)))return(ns?"+":"")+(ss?"-":"")+os}for(os===!1&&(os="_"),ss&&(os=os>0?-os:["-",os]),ns&&(os=["+",os]);["+","-","UNION","INTERSECT","PERP","PARALLEL"].includes(this.token.token_type);){let ls=this.token.token_type.toLowerCase(),us=!1,cs=!1;this.token.token_type==="-"?(ls="+",us=!0,this.advance()):(this.advance(),ls==="+"&&this.token.token_type==="-"&&(us=!0,cs=!0,this.advance()));let ds=this.term(rs);if(ls==="+"){if(ds===!1&&(typeof os=="number"||typeof os=="string"))return cs?os+"+-":us?os+"-":os+"+";if(typeof ds=="string"&&[...ds].every(ps=>["+","-"].includes(ps))&&(typeof os=="number"||typeof os=="string"))return cs?os+"+-"+ds:us?os+"-"+ds:os+"+"+ds}ds===!1&&(ds="_"),us&&(ds=ds>0?-ds:["-",ds]),os=[ls,os,ds]}return os}term(rs){var ns=this.factor(rs),ss=!1;do if(ss=!1,this.token.token_type==="*"){this.advance(),ns===!1&&(ns="_");let os=this.factor(rs);os===!1&&(os="_"),ns=["*",ns,os],ss=!0}else if(this.token.token_type==="/"){this.advance(),ns===!1&&(ns="_");let os=this.factor(rs);os===!1&&(os="_"),ns=["/",ns,os],ss=!0}else{let os=Object.assign({},rs);os.allow_absolute_value_closing=!0;let ls=this.nonMinusFactor(os);ls!==!1&&(ns===!1&&(ns="_"),ns=["*",ns,ls],ss=!0)}while(ss);return this.convert_units_in_term(flatten$6(ns))}convert_units_in_term(rs){if(!Array.isArray(rs))return rs;let ns=rs[0],ss=rs.slice(1);if(ns==="*"){let os=ss.length;for(let[ls,us]of ss.entries()){let cs=this.units[us];if(cs){if(cs.prefix&&ls0){let ds,ps=us;return cs.substitute&&(ps=cs.substitute),ds=ls===1?["unit",ss[0],ps]:["unit",["*",...ss.slice(0,ls).map(this.convert_units_in_term.bind(this))],ps],ls===os-1?ds:this.convert_units_in_term(["*",ds,...ss.slice(ls+1)])}}}return[ns,...ss.map(this.convert_units_in_term.bind(this))]}if(ns==="/")return["/",this.convert_units_in_term(ss[0]),this.convert_units_in_term(ss[1])];if(ns==="^"){let os=this.units[ss[1]];if(os&&os.isExponent){let ls=ss[1];return os.substitute&&(ls=os.substitute),["unit",ss[0],ls]}return[ns,...ss.map(this.convert_units_in_term.bind(this))]}return[ns,...ss.map(this.convert_units_in_term.bind(this))]}factor(rs){if(this.token.token_text==="+"){this.advance();let ss=this.factor(rs);return ss===!1?"+":typeof ss=="string"&&[...ss].every(os=>["+","-"].includes(os))?"+"+ss:["+",ss]}if(this.token.token_type==="-"){this.advance();let ss=this.factor(rs);return ss>0?-ss:ss===!1?"-":typeof ss=="string"&&[...ss].every(os=>["+","-"].includes(os))?"-"+ss:["-",ss]}let ns=this.nonMinusFactor(rs);return ns===!1&&this.token.token_type==="PERP"&&(ns="perp",this.advance()),ns}nonMinusFactor(rs){for(var ns=this.baseFactor(rs);this.token.token_type==="^"||this.token.token_type==="!"||this.token.token_type==="'";)ns===!1&&(ns="_"),this.token.token_type==="^"?(this.advance(),ns=["^",ns,this.get_subsuperscript(rs)]):this.token.token_type==="!"?(ns=["apply","factorial",ns],this.advance()):(ns=["prime",ns],this.advance());return ns}get_single_digit_as_number(){if(this.token.token_type==="NUMBER"&&this.token.token_text[0]!=="."){let rs=Number(this.token.token_text[0]);return this.token.token_text.length>1&&this.lexer.unput(this.token.token_text.slice(1)),this.advance(),rs}return null}get_subsuperscript({parse_absolute_value:rs}){let ns=this.get_single_digit_as_number();if(ns!==null)return ns;if(["+","-","PERP"].includes(this.token.token_type)){let ss=this.token.token_type.toLowerCase();return this.advance(),ss}{let ss=this.baseFactor({parse_absolute_value:rs,in_subsuperscript_with_no_delimiters:!0});return ss===!1&&(ss="_"),ss}}baseFactor({inside_absolute_value:rs=0,parse_absolute_value:ns=!0,allow_absolute_value_closing:ss=!1,in_subsuperscript_with_no_delimiters:os=!1}={}){var ls=!1;if(this.token.token_type==="BEGINENVIRONMENT"){let us=/\\begin\s*{\s*([a-zA-Z0-9]+)\s*}/.exec(this.token.token_text)[1];if(["matrix","pmatrix","bmatrix"].includes(us)){let cs=0,ds=0,ps=[],fs=[],hs=0,gs=this.token.token_type;for(this.advance();this.token.token_type!=="ENDENVIRONMENT";)this.token.token_type==="&"?(gs!=="&"&&gs!=="LINEBREAK"||(fs.push(0),hs+=1),gs=this.token.token_type,this.advance()):this.token.token_type==="LINEBREAK"?(gs!=="&"&&gs!=="LINEBREAK"||(fs.push(0),hs+=1),ps.push(fs),hs>ds&&(ds=hs),cs+=1,hs=0,fs=[],gs=this.token.token_type,this.advance()):(fs.push(this.statement({parse_absolute_value:ns})),hs+=1,gs=" ");if(/\\end\s*{\s*([a-zA-Z0-9]+)\s*}/.exec(this.token.token_text)[1]!==us)throw new ParseError("Expecting \\end{"+us+"}",this.lexer.location);gs==="&"&&(fs.push(0),hs+=1),ps.push(fs),hs>ds&&(ds=hs),cs+=1,this.advance(),ls=["matrix",["tuple",cs,ds]];let ys=["tuple"];for(let bs of ps){let vs=["tuple"].concat(bs);for(let xs=bs.length;xs=2?ls[0]=ds==="("||ds==="{"?"tuple":ds==="["?"array":ds==="LBRACE"?"set":"altvector":ds==="LBRACE"&&(ls=(ls[0]==="|"||ls[0],["set",ls]));this.advance()}else if(this.token.token_type[0]!=="|"||!ns||rs!==0&&ss&&this.token.token_type[1]!=="L"){if(this.token.token_type==="LFLOOR"||this.token.token_type==="LCEIL"){let us,cs;if(this.token.token_type==="LFLOOR"?(us="RFLOOR",cs="floor"):this.token.token_type==="LCEIL"&&(us="RCEIL",cs="ceil"),this.advance(),ls=["apply",cs,ls=this.statement()],this.token.token_type!==us)throw new ParseError("Expecting "+us,this.lexer.location);this.advance()}else if(this.token.token_type==="ANGLE")if(this.advance(),this.token.token_type==="{"||this.token.token_type==="("){let us;us=this.token.token_type==="{"?"}":")",this.advance();let cs=this.statement_list();if(this.token.token_type!==us)throw new ParseError("Expecting "+us,this.lexer.location);this.advance(),cs[0]==="list"?ls=["angle",...cs.slice(1)]:cs[0]==="*"&&(ls=["angle",cs])}else{let us=[],cs=this.nonMinusFactor({parse_absolute_value:ns});for(;cs!==!1;)us.push(cs),cs=this.nonMinusFactor({parse_absolute_value:ns});ls=us.length===0?"angle":["angle",...us]}else if(this.token.token_type==="INT"){this.advance();let us="int";this.token.token_type==="_"&&(this.advance(),us=["_",us,this.get_subsuperscript({parse_absolute_value:ns})]),this.token.token_type==="^"&&(this.advance(),us=["^",us,this.get_subsuperscript({parse_absolute_value:ns})]);let cs=flatten$6(this.term({parse_absolute_value:ns}));if(Array.isArray(cs)&&cs[0]==="*"){let ds=[];for(let ps=0;psss)return!1;if(cs===ss){if(this.token.token_type!=="}")return!1;this.advance();let ps="derivative_leibniz";ns==="∂"&&(ps="partial_"+ps),rs=[ps],ss===1?rs.push(os):rs.push(["tuple",os,ss]);let fs=[];for(let hs=0;hs,larger":function(as){return[">",as[0],as[1]]},"<=,smallerEq":function(as){return["le",as[0],as[1]]},">=,largerEq":function(as){return["ge",as[0],as[1]]},"!=,unequal":function(as){return["ne",as[0],as[1]]},"!,factorial":function(as){return["apply","factorial",as[0]]}};class mathjsToAst{convert(rs){if(rs.isConstantNode)return rs.value;if(rs.isSymbolNode)return rs.name;if(rs.isOperatorNode){var ns=[rs.op,rs.fn].join(",");if(ns in operators)return operators[ns](rs.args.map(function(ls,us){return this.convert(ls)}.bind(this)));throw Error("Unsupported operator: "+rs.op+", "+rs.fn)}if(rs.isFunctionNode){var ss=rs.args.map(function(ls,us){return this.convert(ls)}.bind(this));ss=ss.length>1?["tuple"].concat(ss):ss[0];var os=["apply",rs.name];return os.push(ss),os}if(rs.isArrayNode)return["vector"].concat(rs.args.map(function(ls,us){return this.convert(ls)}.bind(this)));if(rs.isParenthesisNode)return this.convert(rs.content);throw Error("Unsupported node type: "+rs.type)}}class mathjsToGuppy{constructor(){this.mathjsToAst=new mathjsToAst,this.astToGuppy=new astToGuppy$1}convert(rs){return this.astToGuppy.convert(this.mathjsToAst.convert(rs))}}class mathjsToLatex{constructor(){this.mathjsToAst=new mathjsToAst,this.astToLatex=new astToLatex$1}convert(rs){return this.astToLatex.convert(this.mathjsToAst.convert(rs))}}class mathjsToText{constructor(){this.mathjsToAst=new mathjsToAst,this.astToText=new astToText$2}convert(rs){return this.astToText.convert(this.mathjsToAst.convert(rs))}}function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var cachedSetTimeout=defaultSetTimout,cachedClearTimeout=defaultClearTimeout;function runTimeout(as){if(cachedSetTimeout===setTimeout)return setTimeout(as,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(as,0);try{return cachedSetTimeout(as,0)}catch{try{return cachedSetTimeout.call(null,as,0)}catch{return cachedSetTimeout.call(this,as,0)}}}function runClearTimeout(as){if(cachedClearTimeout===clearTimeout)return clearTimeout(as);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(as);try{return cachedClearTimeout(as)}catch{try{return cachedClearTimeout.call(null,as)}catch{return cachedClearTimeout.call(this,as)}}}typeof global$1.setTimeout=="function"&&(cachedSetTimeout=setTimeout),typeof global$1.clearTimeout=="function"&&(cachedClearTimeout=clearTimeout);var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var as=runTimeout(cleanUpNextTick);draining=!0;for(var rs=queue.length;rs;){for(currentQueue=queue,queue=[];++queueIndex1)for(var ns=1;ns0)return parse$1$1(as);if(ns==="number"&&isNaN(as)===!1)return rs.long?fmtLong(as):fmtShort(as);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(as))};function parse$1$1(as){if(!((as=String(as)).length>100)){var rs=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(as);if(rs){var ns=parseFloat(rs[1]);switch((rs[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return ns*y$2;case"days":case"day":case"d":return ns*d$2;case"hours":case"hour":case"hrs":case"hr":case"h":return ns*h$2;case"minutes":case"minute":case"mins":case"min":case"m":return ns*m$2;case"seconds":case"second":case"secs":case"sec":case"s":return ns*s$2;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return ns;default:return}}}}function fmtShort(as){return as>=d$2?Math.round(as/d$2)+"d":as>=h$2?Math.round(as/h$2)+"h":as>=m$2?Math.round(as/m$2)+"m":as>=s$2?Math.round(as/s$2)+"s":as+"ms"}function fmtLong(as){return plural(as,d$2,"day")||plural(as,h$2,"hour")||plural(as,m$2,"minute")||plural(as,s$2,"second")||as+" ms"}function plural(as,rs,ns){if(!(as=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},rs.storage=typeof chrome<"u"&&chrome.storage!==void 0?chrome.storage.local:function(){try{return window.localStorage}catch{}}(),rs.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],rs.formatters.j=function(ss){try{return JSON.stringify(ss)}catch(os){return"[UnexpectedJSONParseError]: "+os.message}},rs.enable(ns())}(browser$2,browser$2.exports);var debug=browser$2.exports("xml-parser"),xmlParser=parse$3;function parse$3(as){return as=(as=as.trim()).replace(//g,""),{declaration:rs(),root:ns()};function rs(){if(os(/^<\?xml\s*/)){for(var cs={attributes:{}};!ls()&&!us("?>");){var ds=ss();if(!ds)return cs;cs.attributes[ds.name]=ds.value}return os(/\?>\s*/),cs}}function ns(){debug("tag %j",as);var cs=os(/^<([\w-:.]+)\s*/);if(cs){for(var ds,ps={name:cs[1],attributes:{},children:[]};!(ls()||us(">")||us("?>")||us("/>"));){var fs=ss();if(!fs)return ps;ps.attributes[fs.name]=fs.value}if(os(/^\s*\/>\s*/))return ps;for(os(/\??>\s*/),ps.content=function(){debug("content %j",as);var hs=os(/^([^<]*)/);return hs?hs[1]:""}();ds=ns();)ps.children.push(ds);return os(/^<\/[\w-:.]+>\s*/),ps}}function ss(){debug("attribute %j",as);var cs,ds=os(/([\w:-]+)\s*=\s*("[^"]*"|'[^']*'|\w+)\s*/);if(ds)return{name:ds[1],value:(cs=ds[2],cs.replace(/^['"]|['"]$/g,""))}}function os(cs){var ds=as.match(cs);if(ds)return as=as.slice(ds[0].length),ds}function ls(){return as.length==0}function us(cs){return as.indexOf(cs)==0}}const entities={"Α":"\\Alpha","Α":"\\Alpha","Α":"\\Alpha","\\u0391;":"\\Alpha","Β":"\\Beta","Β":"\\Beta","Β":"\\Beta","\\u0392;":"\\Beta","Γ":"\\Gamma","Γ":"\\Gamma","Γ":"\\Gamma","\\u0393;":"\\Gamma","Δ":"\\Delta","Δ":"\\Delta","Δ":"\\Delta","\\u0394;":"\\Delta","Ε":"\\Epsilon","Ε":"\\Epsilon","Ε":"\\Epsilon","\\u0395;":"\\Epsilon","Ζ":"\\Zeta","Ζ":"\\Zeta","Ζ":"\\Zeta","\\u0396;":"\\Zeta","Η":"\\Eta","Η":"\\Eta","Η":"\\Eta","\\u0397;":"\\Eta","Θ":"\\Theta","Θ":"\\Theta","Θ":"\\Theta","\\u0398;":"\\Theta","Ι":"\\Iota","Ι":"\\Iota","Ι":"\\Iota","\\u0399;":"\\Iota","Κ":"\\Kappa","Κ":"\\Kappa","Κ":"\\Kappa","\\u039A;":"\\Kappa","Λ":"\\Lambda","Λ":"\\Lambda","Λ":"\\Lambda","\\u039B;":"\\Lambda","Μ":"\\Mu","Μ":"\\Mu","Μ":"\\Mu","\\u039C;":"\\Mu","Ν":"\\Nu","Ν":"\\Nu","Ν":"\\Nu","\\u039D;":"\\Nu","Ξ":"\\Xi","Ξ":"\\Xi","Ξ":"\\Xi","\\u039E;":"\\Xi","Ο":"\\Omicron","Ο":"\\Omicron","Ο":"\\Omicron","\\u039F;":"\\Omicron","Π":"\\Pi","Π":"\\Pi","Π":"\\Pi","\\u03A0;":"\\Pi","Ρ":"\\Rho","Ρ":"\\Rho","Ρ":"\\Rho","\\u03A1;":"\\Rho","Σ":"\\Sigma","Σ":"\\Sigma","Σ":"\\Sigma","\\u03A3;":"\\Sigma","Τ":"\\Tau","Τ":"\\Tau","Τ":"\\Tau","\\u03A4;":"\\Tau","Υ":"\\Upsilon","Υ":"\\Upsilon","Υ":"\\Upsilon","\\u03A5;":"\\Upsilon","Φ":"\\Phi","Φ":"\\Phi","Φ":"\\Phi","\\u03A6;":"\\Phi","Χ":"\\Chi","Χ":"\\Chi","Χ":"\\Chi","\\u03A7;":"\\Chi","Ψ":"\\Psi","Ψ":"\\Psi","Ψ":"\\Psi","\\u03A8;":"\\Psi","Ω":"\\Omega","Ω":"\\Omega","Ω":"\\Omega","\\u03A9;":"\\Omega","α":"\\alpha","α":"\\alpha","α":"\\alpha","\\u03B1;":"\\alpha","β":"\\beta","β":"\\beta","β":"\\beta","\\u03B2;":"\\beta","γ":"\\gamma","γ":"\\gamma","γ":"\\gamma","\\u03B3;":"\\gamma","δ":"\\delta","δ":"\\delta","δ":"\\delta","\\u03B4;":"\\delta","ε":"\\epsilon","ε":"\\epsilon","ε":"\\epsilon","\\u03B5;":"\\epsilon","ζ":"\\zeta","ζ":"\\zeta","ζ":"\\zeta","\\u03B6;":"\\zeta","η":"\\eta","η":"\\eta","η":"\\eta","\\u03B7;":"\\eta","θ":"\\theta","θ":"\\theta","θ":"\\theta","\\u03B8;":"\\theta","ι":"\\iota","ι":"\\iota","ι":"\\iota","\\u03B9;":"\\iota","κ":"\\kappa","κ":"\\kappa","κ":"\\kappa","\\u03BA;":"\\kappa","λ":"\\lambda","λ":"\\lambda","λ":"\\lambda","\\u03BB;":"\\lambda","μ":"\\mu","μ":"\\mu","μ":"\\mu","\\u03BC;":"\\mu","ν":"\\nu","ν":"\\nu","ν":"\\nu","\\u03BD;":"\\nu","ξ":"\\xi","ξ":"\\xi","ξ":"\\xi","\\u03BE;":"\\xi","ο":"\\omicron","ο":"\\omicron","ο":"\\omicron","\\u03BF;":"\\omicron","π":"\\pi","π":"\\pi","π":"\\pi","\\u03C0;":"\\pi","ρ":"\\rho","ρ":"\\rho","ρ":"\\rho","\\u03C1;":"\\rho","ς":"\\sigma",";":"\\sigma","ς":"\\sigma","\\u03C2;":"\\sigma","σ":"\\sigma","σ":"\\sigma","σ":"\\sigma","\\u03C3;":"\\sigma","τ":"\\tau","τ":"\\tau","τ":"\\tau","\\u03C4;":"\\tau","υ":"\\upsilon","υ":"\\upsilon","υ":"\\upsilon","\\u03C5;":"\\upsilon","φ":"\\phi","φ":"\\phi","φ":"\\phi","\\u03C6;":"\\phi","χ":"\\chi","χ":"\\chi","χ":"\\chi","\\u03C7;":"\\chi","ψ":"\\psi","ψ":"\\psi","ψ":"\\psi","\\u03C8;":"\\psi","ω":"\\omega","ω":"\\omega","ω":"\\omega","\\u03C9;":"\\omega","−":"-","−":"-","∞":"\\infty","∞":"\\infty","∞":"\\infty","⋅":"\\cdot","⋅":"\\cdot","⋅":"\\cdot","×":"\\times","×":"\\times","×":"\\times"};class mmlToLatex{parse(rs){return rs.name==="mi"?entities[rs.content]?entities[rs.content]:rs.content.length>1?"\\"+rs.content:rs.content:rs.name==="mn"?rs.content:rs.name==="msup"?this.parse(rs.children[0])+"^{"+this.parse(rs.children[1])+"}":rs.name==="mroot"?"\\sqrt["+this.parse(rs.children[1])+"]{"+this.parse(rs.children[1])+"}":rs.name==="mfrac"?"\\frac{"+this.parse(rs.children[0])+"}{"+this.parse(rs.children[1])+"}":rs.name==="msqrt"?"\\sqrt{"+rs.children.map(function(ns,ss){return this.parse(ns)}.bind(this)).join(" ")+"}":rs.name==="mo"?entities[rs.content]?entities[rs.content]:rs.content==="⁡"?" ":rs.content:rs.name==="mrow"&&rs.attributes.class==="MJX-TeXAtom-ORD"?rs.children.map(function(ns,ss){return this.parse(ns)}.bind(this)).join(" "):rs.name==="math"||rs.name==="mrow"?"("+rs.children.map(function(ns,ss){return this.parse(ns)}.bind(this)).join(" ")+")":void 0}convert(rs){return this.parse(xmlParser(rs).root)}}class mmlToAst$1{constructor(){this.mmlToLatex=new mmlToLatex,this.latexToAst=new latexToAst$1}convert(rs){return this.latexToAst.convert(this.mmlToLatex.convert(rs))}}class mmlToGuppy{constructor(){this.mmlToLatex=new mmlToLatex,this.latexToAst=new latexToAst$1,this.astToGuppy=new astToGuppy$1}convert(rs){return this.astToGuppy.convert(this.latexToAst.convert(this.mmlToLatex.convert(rs)))}}class mmlToMathjs{constructor(){this.mmlToLatex=new mmlToLatex,this.latexToAst=new latexToAst$1,this.astToMathjs=new astToMathjs$1}convert(rs){return this.astToMathjs.convert(this.latexToAst.convert(this.mmlToLatex.convert(rs)))}}class mmlToText{constructor(){this.mmlToLatex=new mmlToLatex,this.latexToAst=new latexToAst$1,this.astToText=new astToText$2}convert(rs){return this.astToText.convert(this.latexToAst.convert(this.mmlToLatex.convert(rs)))}}class textToGuppy{constructor(){this.textToAst=new textToAst$4,this.astToGuppy=new astToGuppy$1}convert(rs){return this.astToGuppy.convert(this.textToAst.convert(rs))}}class textToLatex{constructor(){this.textToAst=new textToAst$4,this.astToLatex=new astToLatex$1}convert(rs){return this.astToLatex.convert(this.textToAst.convert(rs))}}class textToMathjs{constructor(){this.textToAst=new textToAst$4,this.astToMathjs=new astToMathjs$1}convert(rs){return this.astToMathjs.convert(this.textToAst.convert(rs))}}var converters=Object.freeze({__proto__:null,astToLatexObj:astToLatex$1,astToTextObj:astToText$2,astToGuppyObj:astToGuppy$1,astToMathjsObj:astToMathjs$1,latexToAstObj:latexToAst$1,latexToGuppyObj:latexToGuppy,latexToMathjsObj:latexToMathjs,latexToTextObj:latexToText,mathjsToAstObj:mathjsToAst,mathjsToGuppyObj:mathjsToGuppy,mathjsToLatexObj:mathjsToLatex,mathjsToTextObj:mathjsToText,mmlToAstObj:mmlToAst$1,mmlToGuppyObj:mmlToGuppy,mmlToLatexObj:mmlToLatex,mmlToMathjsObj:mmlToMathjs,mmlToTextObj:mmlToText,textToAstObj:textToAst$4,textToGuppyObj:textToGuppy,textToLatexObj:textToLatex,textToMathjsObj:textToMathjs,astToGLSL:astToGLSL$1}),textToAst$5=new textToAst$4,latexToAst$2=new latexToAst$1,mmlToAst=new mmlToAst$1,utils={match:match$2,flatten:flatten$5,unflattenLeft,unflattenRight};function Expression(as,rs){this.tree=flatten$5(as),this.context=rs,this.toJSON=function(){let ns={objectType:"math-expression",tree:this.tree},ss={};for(let os in this.context.assumptions)Object.keys(this.context.assumptions[os]).length>0&&(ss[os]=this.context.assumptions[os]);return Object.keys(ss).length>0&&(ns.assumptions=ss),ns}}function extend$3(as,rs){return flatten_array(Array.prototype.slice.call(arguments,2)).forEach(function(ns){if(ns)for(var ss in ns)rs?function(){var os=ss;as[os]=function(){return this.fromAst(ns[os].apply(null,arguments))}}():as[ss]=ns[ss]}),as}function extend_prototype(as,rs){return flatten_array(Array.prototype.slice.call(arguments,2)).forEach(function(ns){if(ns)for(var ss in ns)(function(){var os=ss;as[os]=function(){var ls=[this].concat(Array.prototype.slice.call(arguments));return rs?this.context.fromAst(ns[os].apply(null,ls)):ns[os].apply(null,ls)}})()}),as}function create_from_multiple(as,rs){if(Array.isArray(as)||typeof as=="number")return new Expression(as,Context);if(typeof as=="string")try{return new Expression(textToAst$5.convert(as),Context)}catch(ns){try{return new Expression(latexToAst$2.convert(as),Context)}catch(ss){try{return new Expression(mmlToAst.convert(as),Context)}catch(os){throw as.indexOf("\\")!==-1?ss:as.indexOf("Context.fromAst(new Context.converters.textToAstObj({appliedFunctionSymbols:rs,functionSymbols:as,splitSymbols:ns,parseScientificNotation:ss}).convert(os))}var latexToAst=new Context.converters.latexToAstObj({appliedFunctionSymbols:appliedFunctionSymbolsDefaultLatex,allowedLatexSymbols});function getFromLatex({functionSymbols:as,appliedFunctionSymbols:rs=appliedFunctionSymbolsDefaultLatex,splitSymbols:ns=!0,parseScientificNotation:ss=!1}){return ns?os=>Context.fromAst(new Context.converters.latexToAstObj({appliedFunctionSymbols:rs,functionSymbols:as,allowedLatexSymbols,parseScientificNotation:ss}).convert(wrapWordIncludingNumberWithVar(os,ss))):os=>Context.fromAst(new Context.converters.latexToAstObj({appliedFunctionSymbols:rs,functionSymbols:as,allowedLatexSymbols,parseScientificNotation:ss}).convert(wrapWordWithVar(os,ss)))}function normalizeMathExpression({value:as,simplify:rs,expand:ns=!1,createVectors:ss=!1,createIntervals:os=!1}){return ss&&(as=as.tuples_to_vectors()),os&&(as=as.to_intervals()),ns&&(as=as.expand()),rs==="full"?as.simplify():rs==="numbers"?as.evaluate_numbers():rs==="numberspreserveorder"?as.evaluate_numbers({skip_ordering:!0}):as}function findFiniteNumericalValue(as){if(as!==void 0)return Number.isFinite(as)||as.evaluate_to_constant!==void 0&&(as=as.evaluate_to_constant(),Number.isFinite(as))?as:null}function convertValueToMathExpression(as){return as instanceof Context.class?as:typeof as=="number"||typeof as=="string"||Array.isArray(as)?Context.fromAst(as):Context.fromAst("_")}function returnNVariables(as,rs){if(!Number.isInteger(as)||as<1)return[];let ns=rs.length;if(ns===0){if(as===1)return[Context.fromAst("x")];if(as===2)return[Context.fromAst("x"),Context.fromAst("y")];if(as===3)return[Context.fromAst("x"),Context.fromAst("y"),Context.fromAst("z")];{let ls=[];for(let us=1;us<=as;us++)ls.push(Context.fromAst(textToAst.convert(`x_${us}`)));return ls}}if(new Set(rs.map(ls=>ls.toString())).sizels.toString())],os=[...rs];for(let ls=ns+1;ls<=as;ls++){let us;ls==1?as>3?us=["x_1"]:us=["x"]:ls==2?as>3?us=["x_2","y_2"]:us=["y","x_2"]:ls==3?as>3?us=["x_3","y_3","z_3"]:us=["z","x_3","z_3"]:us=["x","y","z","u","v","w","X","Y","Z"].map(ds=>`${ds}_${ls}`);let cs=!1;for(let ds of us)if(!ss.includes(ds)){os.push(Context.fromAst(textToAst.convert(ds))),ss.push(ds),cs=!0;break}if(!cs){let ds=us[0];os.push(Context.fromAst(textToAst.convert(ds))),ss.push(ds),console.warn("Variables added were not unique")}}return os}async function preprocessMathInverseDefinition({desiredValue:as,stateValues:rs,variableName:ns="value",arrayKey:ss,workspace:os}){if(!vectorOperators.includes(as.tree[0])||!as.tree.includes())return{desiredValue:as};let ls,us=ns+"Ast";if(ss!==void 0&&(us+=`_${ss}`),os[us])ls=os[us].slice(0,as.tree.length);else{let cs=await rs[ns];cs&&ss!==void 0&&(cs=cs[ss]),cs&&vectorOperators.includes(cs.tree[0])&&(ls=cs.tree.slice(0,as.tree.length))}if(ls){let cs=[],ds=!1;for(let[ps,fs]of as.tree.entries())fs===void 0?(ds=!0,cs.push(ps)):ls[ps]=fs;return as=Context.fromAst(ls),os[us]=ls,ds?{desiredValue:as,vectorComponentsNotAffected:cs}:{desiredValue:as}}else{let cs=[];for(let ds of as.tree.slice(1))ds===void 0?cs.push("_"):cs.push(ds);return as=Context.fromAst([as.tree[0],...cs]),{desiredValue:as}}}function normalizeLatexString(as,{unionFromU:rs=!1}={}){let ns=[["α","\\alpha "],["β","\\beta "],["ϐ","\\beta "],["Γ","\\Gamma "],["γ","\\gamma "],["Δ","\\Delta "],["δ","\\delta "],["ε","\\epsilon "],["ϵ","\\epsilon "],["ζ","\\zeta "],["η","\\eta "],["Θ","\\Theta "],["ϴ","\\Theta "],["θ","\\theta "],["ᶿ","\\theta "],["ϑ","\\theta "],["ι","\\iota "],["κ","\\kappa "],["Λ","\\Lambda "],["λ","\\lambda "],["μ","\\mu "],["µ","\\mu "],["ν","\\nu "],["Ξ","\\Xi "],["ξ","\\xi "],["Π","\\Pi "],["π","\\pi "],["ϖ","\\pi "],["ρ","\\rho "],["ϱ","\\rho "],["Σ","\\Sigma "],["σ","\\sigma "],["ς","\\sigma "],["τ","\\tau "],["Υ","\\Upsilon "],["υ","\\upsilon "],["Φ","\\Phi "],["φ","\\phi "],["ϕ","\\phi "],["Ψ","\\Psi "],["ψ","\\psi "],["Ω","\\Omega "],["ω","\\omega "],["−","-"],["⋅"," \\cdot "],["·"," \\cdot "],["∪"," \\cup "],["∩"," \\cap "],["∞"," \\infty "],["∅"," \\emptyset "]];for(let ls of ns)as=as.replaceAll(ls[0],ls[1]);let ss=as.match(/^(\\ )*(\\ldots|\.(\\ )*\.(\\ )*\.)(\\ )*(.*)$/);if(ss){let ls=ss[6];ls[0]!==","?as="\\ldots,"+ls:as="\\ldots"+ls}let os=as.match(/^(.*?)(\\ )*(\\ldots|\.(\\ )*\.(\\ )*\.)(\\ )*$/);if(os){let ls=os[1];ls[ls.length-1]!==","?as=ls+",\\ldots":as=ls+"\\ldots"}return as=as.replaceAll(/(\b|\\ )or(\b|\\ )/g,"$1\\lor$2"),as=as.replaceAll(/(\b|\\ )and(\b|\\ )/g,"$1\\land$2"),rs&&(as=as.replaceAll(/(\b|\\ )U(\b|\\ )/g,"$1\\cup$2")),as}function isValidVariable(as){let rs=as.tree,ns=!0;return typeof rs=="string"?rs==="_"&&(ns=!1):(!Array.isArray(rs)||rs[0]!=="_"||typeof rs[1]!="string"||typeof rs[2]!="string"&&typeof rs[2]!="number")&&(ns=!1),ns}function mathStateVariableFromNumberStateVariable({numberVariableName:as="number",mathVariableName:rs="math",isPublic:ns=!1}={}){let ss={returnDependencies:()=>({number:{dependencyType:"stateVariable",variableName:as}}),definition:function({dependencyValues:os}){return{setValue:{[rs]:numberToMathExpression(os.number)}}},inverseDefinition:function({desiredStateVariableValues:os}){return{success:!0,instructions:[{setDependency:"number",desiredValue:os[rs].evaluate_to_constant()}]}}};return ns&&(ss.public=!0,ss.shadowingInstructions={createComponentOfType:"math"}),ss}function numberToMathExpression(as){let rs;if(typeof(as==null?void 0:as.re)=="number"&&typeof(as==null?void 0:as.im)=="number")if(as.im===0)rs=as.re;else{let ns;as.im===1?ns="i":as.im===-1?ns=["-","i"]:ns=["*",as.im,"i"],as.re===0?rs=ns:rs=["+",as.re,ns]}else rs=as;return Context.fromAst(rs)}function roundForDisplay({value:as,dependencyValues:rs,usedDefault:ns}){let ss;return(ns.displayDigits||!(rs.displayDigits>=1))&&!ns.displayDecimals&&Number.isFinite(rs.displayDecimals)?ss=Context.round_numbers_to_decimals(as,rs.displayDecimals):(rs.displayDigits>=1?ss=Context.round_numbers_to_precision(as,rs.displayDigits):ss=Context.round_numbers_to_precision(as,10),rs.displaySmallAsZero>0&&(ss=Context.evaluate_numbers(ss,{skip_ordering:!0,set_small_zero:rs.displaySmallAsZero}))),ss}function mergeListsWithOtherContainers(as){if(!Array.isArray(as))return as;let rs=as[0],ns=as.slice(1);return[...vectorOperators,"list","set"].includes(rs)&&(ns=ns.reduce((ss,os)=>Array.isArray(os)&&os[0]==="list"?[...ss,...os.slice(1)]:[...ss,os],[])),ns=ns.map(ss=>mergeListsWithOtherContainers(ss)),[rs,...ns]}function wrapWordWithVar(as,rs){let ns="",ss=/\\operatorname\s*{[^{}]*}/,os=as.match(ss);for(;os;){let ls=os.index,us=ls+os[0].length;ns+=wrapWordWithVarSub(as.substring(0,ls),rs),ns+=as.substring(ls,us),as=as.substring(us),os=as.match(ss)}return ns+=wrapWordWithVarSub(as,rs),ns}function wrapWordWithVarSub(as,rs){let ns="";const ss=/([^a-zA-Z0-9]?)([a-zA-Z][a-zA-Z0-9]+)([^a-zA-Z0-9]?)/;let os;if(rs){const us="(E[+\\-]?[0-9]+\\s*($|(?=\\,|&|\\||\\\\\\||\\)|\\}|\\\\}|\\]|\\\\\\\\|\\\\end)))";os=new RegExp("([0-9]+(\\.[0-9]*)?"+us+")|(\\.[0-9]+"+us+")")}let ls=as.match(ss);for(;ls;){let us=ls.index,cs=us+ls[0].length-ls[3].length;if(rs){let ds=as.match(os);if(ds&&ds.indexus){ns+=as.substring(0,cs),as=as.substring(cs),ls=as.match(ss);continue}}if(ls[1]==="\\")ns+=as.substring(0,cs),as=as.substring(cs);else{let ds=us+ls[1].length;ns+=as.substring(0,ds),ns+=`\\operatorname{${ls[2]}}`,as=as.substring(cs)}ls=as.match(ss)}return ns+=as,ns}function wrapWordIncludingNumberWithVar(as,rs){let ns="",ss=/\\operatorname\s*{[^{}]*}/,os=as.match(ss);for(;os;){let ls=os.index,us=ls+os[0].length;ns+=wrapWordIncludingNumberWithVarSub(as.substring(0,ls),rs),ns+=as.substring(ls,us),as=as.substring(us),os=as.match(ss)}return ns+=wrapWordIncludingNumberWithVarSub(as,rs),ns}function wrapWordIncludingNumberWithVarSub(as,rs){let ns="";const ss=/([^a-zA-Z0-9\s]?\s*)([a-zA-Z][a-zA-Z0-9]*[0-9][a-zA-Z0-9]*)([^a-zA-Z0-9]?)/;let os;if(rs){const us="(E[+\\-]?[0-9]+\\s*($|(?=\\,|&|\\||\\\\\\||\\)|\\}|\\\\}|\\]|\\\\\\\\|\\\\end)))";os=new RegExp("([0-9]+(\\.[0-9]*)?"+us+")|(\\.[0-9]+"+us+")")}let ls=as.match(ss);for(;ls;){let us=ls.index,cs=us+ls[0].length-ls[3].length;if(rs){let ds=as.match(os);if(ds&&ds.indexus){ns+=as.substring(0,cs),as=as.substring(cs),ls=as.match(ss);continue}}if(ls[1]==="\\"||ls[1][0]==="^"||ls[1][0]==="_")ns+=as.substring(0,cs),as=as.substring(cs);else{let ds=us+ls[1].length;ns+=as.substring(0,ds),ns+=`\\operatorname{${ls[2]}}`,as=as.substring(cs)}ls=as.match(ss)}return ns+=as,ns}function stripLatex(as){return as.replaceAll("\\,","").replaceAll(/\\operatorname{([^{}]*)}/g,"$1")}function superSubscriptsToUnicode(as){let rs={0:"₀",1:"₁",2:"₂",3:"₃",4:"₄",5:"₅",6:"₆",7:"₇",8:"₈",9:"₉","+":"₊","-":"₋"," ":""},ns={0:"⁰",1:"¹",2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹","+":"⁺","-":"⁻"," ":""};function ss(ls,us){let cs="";for(let ds of us)cs+=rs[ds];return cs}function os(ls,us){let cs="";for(let ds of us)cs+=ns[ds];return cs}return as=as.replaceAll(/_(\d+)/g,ss),as=as.replaceAll(/_\(([\d +-]+)\)/g,ss),as=as.replaceAll(/\^(\d+)/g,os),as=as.replaceAll(/\^\(([\d +-]+)\)/g,os),as}function unicodeToSuperSubscripts(as){let rs={"₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","₊":"+","₋":"-"},ns={"⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","⁺":"+","⁻":"-"};function ss(ls,us){let cs="";for(let ds of us)cs+=rs[ds];return"_("+cs+")"}function os(ls,us){let cs="";for(let ds of us)cs+=ns[ds];return"^("+cs+")"}return as=as.replaceAll(/([\u2080\u2081\u2082\u2083\u2084\u2085\u2086\u2087\u2088\u2089\u208A\u208B]+)/g,ss),as=as.replaceAll(/([\u2070\u00B9\u00B2\u00B3\u2074\u2075\u2076\u2077\u2078\u2079\u207A\u207B]+)/g,os),as}const mathjaxConfig={showProcessingMessages:!1,"fast-preview":{disabled:!0},jax:["input/TeX","output/CommonHTML"],extensions:["tex2jax.js","MathMenu.js","MathZoom.js","AssistiveMML.js","a11y/accessibility-menu.js"],TeX:{extensions:["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"],equationNumbers:{autoNumber:"AMS"},Macros:{lt:"<",gt:">",amp:"&",var:["\\mathrm{#1}",1],csch:"\\operatorname{csch}",sech:"\\operatorname{sech}"}},tex2jax:{displayMath:[["\\[","\\]"]]}},vectorOperators=["vector","altvector","tuple"];function sheetForTag(as){if(as.sheet)return as.sheet;for(var rs=0;rs0?charat(characters,--position$1):0,column--,character===10&&(column=1,line--),character}function next(){return character=position$12||token(character)>3?"":" "}function escaping(as,rs){for(;--rs&&next()&&!(character<48||character>102||character>57&&character<65||character>70&&character<97););return slice(as,caret()+(rs<6&&peek$1()==32&&next()==32))}function delimiter(as){for(;next();)switch(character){case as:return position$1;case 34:case 39:as!==34&&as!==39&&delimiter(character);break;case 40:as===41&&delimiter(as);break;case 92:next();break}return position$1}function commenter(as,rs){for(;next()&&as+character!==47+10;)if(as+character===42+42&&peek$1()===47)break;return"/*"+slice(rs,position$1-1)+"*"+from(as===47?as:next())}function identifier(as){for(;!token(peek$1());)next();return slice(as,position$1)}function compile(as){return dealloc(parse$2("",null,null,null,[""],as=alloc(as),0,[0],as))}function parse$2(as,rs,ns,ss,os,ls,us,cs,ds){for(var ps=0,fs=0,hs=us,gs=0,ys=0,bs=0,vs=1,xs=1,Cs=1,Ts=0,Ss="",Ns=os,As=ls,ws=ss,Es=Ss;xs;)switch(bs=Ts,Ts=next()){case 40:if(bs!=108&&charat(Es,hs-1)==58){indexof(Es+=replace(delimit(Ts),"&","&\f"),"&\f")!=-1&&(Cs=-1);break}case 34:case 39:case 91:Es+=delimit(Ts);break;case 9:case 10:case 13:case 32:Es+=whitespace(bs);break;case 92:Es+=escaping(caret()-1,7);continue;case 47:switch(peek$1()){case 42:case 47:append(comment(commenter(next(),caret()),rs,ns),ds);break;default:Es+="/"}break;case 123*vs:cs[ps++]=strlen(Es)*Cs;case 125*vs:case 59:case 0:switch(Ts){case 0:case 125:xs=0;case 59+fs:ys>0&&strlen(Es)-hs&&append(ys>32?declaration(Es+";",ss,ns,hs-1):declaration(replace(Es," ","")+";",ss,ns,hs-2),ds);break;case 59:Es+=";";default:if(append(ws=ruleset(Es,rs,ns,ps,fs,os,cs,Ss,Ns=[],As=[],hs),ls),Ts===123)if(fs===0)parse$2(Es,rs,ws,ws,Ns,ls,hs,cs,As);else switch(gs===99&&charat(Es,3)===110?100:gs){case 100:case 109:case 115:parse$2(as,ws,ws,ss&&append(ruleset(as,ws,ws,0,0,os,cs,Ss,os,Ns=[],hs),As),os,As,hs,cs,ss?Ns:As);break;default:parse$2(Es,ws,ws,ws,[""],As,0,cs,As)}}ps=fs=ys=0,vs=Cs=1,Ss=Es="",hs=us;break;case 58:hs=1+strlen(Es),ys=bs;default:if(vs<1){if(Ts==123)--vs;else if(Ts==125&&vs++==0&&prev()==125)continue}switch(Es+=from(Ts),Ts*vs){case 38:Cs=fs>0?1:(Es+="\f",-1);break;case 44:cs[ps++]=(strlen(Es)-1)*Cs,Cs=1;break;case 64:peek$1()===45&&(Es+=delimit(next())),gs=peek$1(),fs=hs=strlen(Ss=Es+=identifier(caret())),Ts++;break;case 45:bs===45&&strlen(Es)==2&&(vs=0)}}return ls}function ruleset(as,rs,ns,ss,os,ls,us,cs,ds,ps,fs){for(var hs=os-1,gs=os===0?ls:[""],ys=sizeof(gs),bs=0,vs=0,xs=0;bs0?gs[Cs]+" "+Ts:replace(Ts,/&\f/g,gs[Cs])))&&(ds[xs++]=Ss);return node(as,rs,ns,os===0?RULESET:cs,ds,ps,fs)}function comment(as,rs,ns){return node(as,rs,ns,COMMENT,from(char()),substr(as,2,-2),0)}function declaration(as,rs,ns,ss){return node(as,rs,ns,DECLARATION,substr(as,0,ss),substr(as,ss+1,-1),ss)}function serialize$1(as,rs){for(var ns="",ss=sizeof(as),os=0;os6)switch(charat(as,rs+1)){case 109:if(charat(as,rs+4)!==45)break;case 102:return replace(as,/(.+:)(.+)-([^]+)/,"$1"+WEBKIT+"$2-$3$1"+MOZ+(charat(as,rs+3)==108?"$3":"$2-$3"))+as;case 115:return~indexof(as,"stretch")?prefix(replace(as,"stretch","fill-available"),rs)+as:as}break;case 4949:if(charat(as,rs+1)!==115)break;case 6444:switch(charat(as,strlen(as)-3-(~indexof(as,"!important")&&10))){case 107:return replace(as,":",":"+WEBKIT)+as;case 101:return replace(as,/(.+:)([^;!]+)(;|!.+)?/,"$1"+WEBKIT+(charat(as,14)===45?"inline-":"")+"box$3$1"+WEBKIT+"$2$3$1"+MS+"$2box$3")+as}break;case 5936:switch(charat(as,rs+11)){case 114:return WEBKIT+as+MS+replace(as,/[svh]\w+-[tblr]{2}/,"tb")+as;case 108:return WEBKIT+as+MS+replace(as,/[svh]\w+-[tblr]{2}/,"tb-rl")+as;case 45:return WEBKIT+as+MS+replace(as,/[svh]\w+-[tblr]{2}/,"lr")+as}return WEBKIT+as+MS+as+as}return as}var prefixer=function as(rs,ns,ss,os){if(rs.length>-1&&!rs.return)switch(rs.type){case DECLARATION:rs.return=prefix(rs.value,rs.length);break;case KEYFRAMES:return serialize$1([copy(rs,{value:replace(rs.value,"@","@"+WEBKIT)})],os);case RULESET:if(rs.length)return combine(rs.props,function(ls){switch(match(ls,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return serialize$1([copy(rs,{props:[replace(ls,/:(read-\w+)/,":"+MOZ+"$1")]})],os);case"::placeholder":return serialize$1([copy(rs,{props:[replace(ls,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy(rs,{props:[replace(ls,/:(plac\w+)/,":"+MOZ+"$1")]}),copy(rs,{props:[replace(ls,/:(plac\w+)/,MS+"input-$1")]})],os)}return""})}},defaultStylisPlugins=[prefixer],createCache=function as(rs){var ns=rs.key;if(ns==="css"){var ss=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(ss,function(vs){var xs=vs.getAttribute("data-emotion");xs.indexOf(" ")!==-1&&(document.head.appendChild(vs),vs.setAttribute("data-s",""))})}var os=rs.stylisPlugins||defaultStylisPlugins,ls={},us,cs=[];us=rs.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+ns+' "]'),function(vs){for(var xs=vs.getAttribute("data-emotion").split(" "),Cs=1;Cs=4;++ss,os-=4)ns=as.charCodeAt(ss)&255|(as.charCodeAt(++ss)&255)<<8|(as.charCodeAt(++ss)&255)<<16|(as.charCodeAt(++ss)&255)<<24,ns=(ns&65535)*1540483477+((ns>>>16)*59797<<16),ns^=ns>>>24,rs=(ns&65535)*1540483477+((ns>>>16)*59797<<16)^(rs&65535)*1540483477+((rs>>>16)*59797<<16);switch(os){case 3:rs^=(as.charCodeAt(ss+2)&255)<<16;case 2:rs^=(as.charCodeAt(ss+1)&255)<<8;case 1:rs^=as.charCodeAt(ss)&255,rs=(rs&65535)*1540483477+((rs>>>16)*59797<<16)}return rs^=rs>>>13,rs=(rs&65535)*1540483477+((rs>>>16)*59797<<16),((rs^rs>>>15)>>>0).toString(36)}var unitlessKeys={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},hyphenateRegex=/[A-Z]|^ms/g,animationRegex=/_EMO_([^_]+?)_([^]*?)_EMO_/g,isCustomProperty=function as(rs){return rs.charCodeAt(1)===45},isProcessableValue=function as(rs){return rs!=null&&typeof rs!="boolean"},processStyleName=memoize$2(function(as){return isCustomProperty(as)?as:as.replace(hyphenateRegex,"-$&").toLowerCase()}),processStyleValue=function as(rs,ns){switch(rs){case"animation":case"animationName":if(typeof ns=="string")return ns.replace(animationRegex,function(ss,os,ls){return cursor={name:os,styles:ls,next:cursor},os})}return unitlessKeys[rs]!==1&&!isCustomProperty(rs)&&typeof ns=="number"&&ns!==0?ns+"px":ns},noComponentSelectorMessage="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function handleInterpolation(as,rs,ns){if(ns==null)return"";if(ns.__emotion_styles!==void 0)return ns;switch(typeof ns){case"boolean":return"";case"object":{if(ns.anim===1)return cursor={name:ns.name,styles:ns.styles,next:cursor},ns.name;if(ns.styles!==void 0){var ss=ns.next;if(ss!==void 0)for(;ss!==void 0;)cursor={name:ss.name,styles:ss.styles,next:cursor},ss=ss.next;var os=ns.styles+";";return os}return createStringFromObject(as,rs,ns)}case"function":{if(as!==void 0){var ls=cursor,us=ns(as);return cursor=ls,handleInterpolation(as,rs,us)}break}}if(rs==null)return ns;var cs=rs[ns];return cs!==void 0?cs:ns}function createStringFromObject(as,rs,ns){var ss="";if(Array.isArray(ns))for(var os=0;osjsx$1("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:as.zIndex,top:0,left:0,right:0},children:as.children}),DefaultPortal=as=>{const{appendToParentPortal:rs,children:ns}=as,[ss,os]=reactExports.useState(null),ls=reactExports.useRef(null),[,us]=reactExports.useState({});reactExports.useEffect(()=>us({}),[]);const cs=usePortalContext(),ds=usePortalManager();useSafeLayoutEffect$1(()=>{if(!ss)return;const fs=ss.ownerDocument,hs=rs?cs??fs.body:fs.body;if(!hs)return;ls.current=fs.createElement("div"),ls.current.className=PORTAL_CLASSNAME,hs.appendChild(ls.current),us({});const gs=ls.current;return()=>{hs.contains(gs)&&hs.removeChild(gs)}},[ss]);const ps=ds!=null&&ds.zIndex?jsx$1(Container,{zIndex:ds==null?void 0:ds.zIndex,children:ns}):ns;return ls.current?reactDomExports.createPortal(jsx$1(PortalContextProvider,{value:ls.current,children:ps}),ls.current):jsx$1("span",{ref:fs=>{fs&&os(fs)}})},ContainerPortal=as=>{const{children:rs,containerRef:ns,appendToParentPortal:ss}=as,os=ns.current,ls=os??(typeof window<"u"?document.body:void 0),us=reactExports.useMemo(()=>{const ds=os==null?void 0:os.ownerDocument.createElement("div");return ds&&(ds.className=PORTAL_CLASSNAME),ds},[os]),[,cs]=reactExports.useState({});return useSafeLayoutEffect$1(()=>cs({}),[]),useSafeLayoutEffect$1(()=>{if(!(!us||!ls))return ls.appendChild(us),()=>{ls.removeChild(us)}},[us,ls]),ls&&us?reactDomExports.createPortal(jsx$1(PortalContextProvider,{value:ss?us:null,children:rs}),us):null};function Portal(as){const rs={appendToParentPortal:!0,...as},{containerRef:ns,...ss}=rs;return ns?jsx$1(ContainerPortal,{containerRef:ns,...ss}):jsx$1(DefaultPortal,{...ss})}Portal.className=PORTAL_CLASSNAME;Portal.selector=PORTAL_SELECTOR;Portal.displayName="Portal";function useTheme(){const as=reactExports.useContext(ThemeContext);if(!as)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return as}var ColorModeContext=reactExports.createContext({});ColorModeContext.displayName="ColorModeContext";function useColorMode(){const as=reactExports.useContext(ColorModeContext);if(as===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return as}var classNames={light:"chakra-ui-light",dark:"chakra-ui-dark"};function getColorModeUtils(as={}){const{preventTransition:rs=!0}=as,ns={setDataset:ss=>{const os=rs?ns.preventTransition():void 0;document.documentElement.dataset.theme=ss,document.documentElement.style.colorScheme=ss,os==null||os()},setClassName(ss){document.body.classList.add(ss?classNames.dark:classNames.light),document.body.classList.remove(ss?classNames.light:classNames.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(ss){var os;return((os=ns.query().matches)!=null?os:ss==="dark")?"dark":"light"},addListener(ss){const os=ns.query(),ls=us=>{ss(us.matches?"dark":"light")};return typeof os.addListener=="function"?os.addListener(ls):os.addEventListener("change",ls),()=>{typeof os.removeListener=="function"?os.removeListener(ls):os.removeEventListener("change",ls)}},preventTransition(){const ss=document.createElement("style");return ss.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(ss),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(ss)})})}}};return ns}var STORAGE_KEY="chakra-ui-color-mode";function createLocalStorageManager(as){return{ssr:!1,type:"localStorage",get(rs){if(!(globalThis!=null&&globalThis.document))return rs;let ns;try{ns=localStorage.getItem(as)||rs}catch{}return ns||rs},set(rs){try{localStorage.setItem(as,rs)}catch{}}}}var localStorageManager=createLocalStorageManager(STORAGE_KEY),noop$2=()=>{};function getTheme(as,rs){return as.type==="cookie"&&as.ssr?as.get(rs):rs}function ColorModeProvider(as){const{value:rs,children:ns,options:{useSystemColorMode:ss,initialColorMode:os,disableTransitionOnChange:ls}={},colorModeManager:us=localStorageManager}=as,cs=os==="dark"?"dark":"light",[ds,ps]=reactExports.useState(()=>getTheme(us,cs)),[fs,hs]=reactExports.useState(()=>getTheme(us)),{getSystemTheme:gs,setClassName:ys,setDataset:bs,addListener:vs}=reactExports.useMemo(()=>getColorModeUtils({preventTransition:ls}),[ls]),xs=os==="system"&&!ds?fs:ds,Cs=reactExports.useCallback(Ns=>{const As=Ns==="system"?gs():Ns;ps(As),ys(As==="dark"),bs(As),us.set(As)},[us,gs,ys,bs]);useSafeLayoutEffect$1(()=>{os==="system"&&hs(gs())},[]),reactExports.useEffect(()=>{const Ns=us.get();if(Ns){Cs(Ns);return}if(os==="system"){Cs("system");return}Cs(cs)},[us,cs,os,Cs]);const Ts=reactExports.useCallback(()=>{Cs(xs==="dark"?"light":"dark")},[xs,Cs]);reactExports.useEffect(()=>{if(ss)return vs(Cs)},[ss,vs,Cs]);const Ss=reactExports.useMemo(()=>({colorMode:rs??xs,toggleColorMode:rs?noop$2:Ts,setColorMode:rs?noop$2:Cs,forced:rs!==void 0}),[xs,Ts,Cs,rs]);return jsx$1(ColorModeContext.Provider,{value:Ss,children:ns})}ColorModeProvider.displayName="ColorModeProvider";function useChakra(){const as=useColorMode(),rs=useTheme();return{...as,theme:rs}}var cx=(...as)=>as.filter(Boolean).join(" ");function isObject$6(as){const rs=typeof as;return as!=null&&(rs==="object"||rs==="function")&&!Array.isArray(as)}function runIfFn$2(as,...rs){return isFunction$5(as)?as(...rs):as}var isFunction$5=as=>typeof as=="function",dataAttr=as=>as?"":void 0,ariaAttr=as=>as?!0:void 0;function callAllHandlers(...as){return function(ns){as.some(ss=>(ss==null||ss(ns),ns==null?void 0:ns.defaultPrevented))}}function callAll(...as){return function(ns){as.forEach(ss=>{ss==null||ss(ns)})}}var lodash_mergewithExports={},lodash_mergewith={get exports(){return lodash_mergewithExports},set exports(as){lodash_mergewithExports=as}};(function(as,rs){var ns=200,ss="__lodash_hash_undefined__",os=800,ls=16,us=9007199254740991,cs="[object Arguments]",ds="[object Array]",ps="[object AsyncFunction]",fs="[object Boolean]",hs="[object Date]",gs="[object Error]",ys="[object Function]",bs="[object GeneratorFunction]",vs="[object Map]",xs="[object Number]",Cs="[object Null]",Ts="[object Object]",Ss="[object Proxy]",Ns="[object RegExp]",As="[object Set]",ws="[object String]",Es="[object Undefined]",_s="[object WeakMap]",$s="[object ArrayBuffer]",Rs="[object DataView]",Ds="[object Float32Array]",Os="[object Float64Array]",Is="[object Int8Array]",Vs="[object Int16Array]",ks="[object Int32Array]",Ps="[object Uint8Array]",Bs="[object Uint8ClampedArray]",Ms="[object Uint16Array]",Ws="[object Uint32Array]",Us=/[\\^$.*+?()[\]{}|]/g,js=/^\[object .+?Constructor\]$/,Ls=/^(?:0|[1-9]\d*)$/,Gs={};Gs[Ds]=Gs[Os]=Gs[Is]=Gs[Vs]=Gs[ks]=Gs[Ps]=Gs[Bs]=Gs[Ms]=Gs[Ws]=!0,Gs[cs]=Gs[ds]=Gs[$s]=Gs[fs]=Gs[Rs]=Gs[hs]=Gs[gs]=Gs[ys]=Gs[vs]=Gs[xs]=Gs[Ts]=Gs[Ns]=Gs[As]=Gs[ws]=Gs[_s]=!1;var Hs=typeof commonjsGlobal$1=="object"&&commonjsGlobal$1&&commonjsGlobal$1.Object===Object&&commonjsGlobal$1,Ys=typeof self=="object"&&self&&self.Object===Object&&self,Zs=Hs||Ys||Function("return this")(),Nl=rs&&!rs.nodeType&&rs,yl=Nl&&!0&&as&&!as.nodeType&&as,Dl=yl&&yl.exports===Nl,Rl=Dl&&Hs.process,Ml=function(){try{var Fl=yl&&yl.require&&yl.require("util").types;return Fl||Rl&&Rl.binding&&Rl.binding("util")}catch{}}(),Ks=Ml&&Ml.isTypedArray;function qs(Fl,Gl,Jl){switch(Jl.length){case 0:return Fl.call(Gl);case 1:return Fl.call(Gl,Jl[0]);case 2:return Fl.call(Gl,Jl[0],Jl[1]);case 3:return Fl.call(Gl,Jl[0],Jl[1],Jl[2])}return Fl.apply(Gl,Jl)}function Qs(Fl,Gl){for(var Jl=-1,au=Array(Fl);++Jl-1}function Tu(Fl,Gl){var Jl=this.__data__,au=Wu(Jl,Fl);return au<0?(++this.size,Jl.push([Fl,Gl])):Jl[au][1]=Gl,this}hu.prototype.clear=Cu,hu.prototype.delete=Su,hu.prototype.get=Nu,hu.prototype.has=gu,hu.prototype.set=Tu;function Au(Fl){var Gl=-1,Jl=Fl==null?0:Fl.length;for(this.clear();++Gl1?Jl[pu-1]:void 0,vu=pu>2?Jl[2]:void 0;for(yu=Fl.length>3&&typeof yu=="function"?(pu--,yu):void 0,vu&&Qp(Jl[0],Jl[1],vu)&&(yu=pu<3?void 0:yu,pu=1),Gl=Object(Gl);++au-1&&Fl%1==0&&Fl0){if(++Gl>=os)return arguments[0]}else Gl=0;return Fl.apply(void 0,arguments)}}function om(Fl){if(Fl!=null){try{return Vl.call(Fl)}catch{}try{return Fl+""}catch{}}return""}function qu(Fl,Gl){return Fl===Gl||Fl!==Fl&&Gl!==Gl}var ip=vp(function(){return arguments}())?vp:function(Fl){return Bu(Fl)&&Fs.call(Fl,"callee")&&!Kl.call(Fl,"callee")},ap=Array.isArray;function sp(Fl){return Fl!=null&&Np(Fl.length)&&!op(Fl)}function lm(Fl){return Bu(Fl)&&sp(Fl)}var Sp=Zl||fm;function op(Fl){if(!Pu(Fl))return!1;var Gl=Gu(Fl);return Gl==ys||Gl==bs||Gl==ps||Gl==Ss}function Np(Fl){return typeof Fl=="number"&&Fl>-1&&Fl%1==0&&Fl<=us}function Pu(Fl){var Gl=typeof Fl;return Fl!=null&&(Gl=="object"||Gl=="function")}function Bu(Fl){return Fl!=null&&typeof Fl=="object"}function um(Fl){if(!Bu(Fl)||Gu(Fl)!=Ts)return!1;var Gl=Hl(Fl);if(Gl===null)return!0;var Jl=Fs.call(Gl,"constructor")&&Gl.constructor;return typeof Jl=="function"&&Jl instanceof Jl&&Vl.call(Jl)==zl}var Ap=Ks?Js(Ks):Fp;function cm(Fl){return qp(Fl,wp(Fl))}function wp(Fl){return sp(Fl)?Vp(Fl,!0):Lp(Fl)}var dm=Kp(function(Fl,Gl,Jl,au){xp(Fl,Gl,Jl,au)});function pm(Fl){return function(){return Fl}}function Ep(Fl){return Fl}function fm(){return!1}as.exports=dm})(lodash_mergewith,lodash_mergewithExports);const mergeWith=lodash_mergewithExports;var isImportant=as=>/!(important)?$/.test(as),withoutImportant=as=>typeof as=="string"?as.replace(/!(important)?$/,"").trim():as,tokenToCSSVar=(as,rs)=>ns=>{const ss=String(rs),os=isImportant(ss),ls=withoutImportant(ss),us=as?`${as}.${ls}`:ls;let cs=isObject$6(ns.__cssMap)&&us in ns.__cssMap?ns.__cssMap[us].varRef:rs;return cs=withoutImportant(cs),os?`${cs} !important`:cs};function createTransform(as){const{scale:rs,transform:ns,compose:ss}=as;return(ls,us)=>{var cs;const ds=tokenToCSSVar(rs,ls)(us);let ps=(cs=ns==null?void 0:ns(ds,us))!=null?cs:ds;return ss&&(ps=ss(ps,us)),ps}}var pipe$2=(...as)=>rs=>as.reduce((ns,ss)=>ss(ns),rs);function toConfig(as,rs){return ns=>{const ss={property:ns,scale:as};return ss.transform=createTransform({scale:as,transform:rs}),ss}}var getRtl=({rtl:as,ltr:rs})=>ns=>ns.direction==="rtl"?as:rs;function logical(as){const{property:rs,scale:ns,transform:ss}=as;return{scale:ns,property:getRtl(rs),transform:ns?createTransform({scale:ns,compose:ss}):ss}}var transformTemplate=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function getTransformTemplate(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...transformTemplate].join(" ")}function getTransformGpuTemplate(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...transformTemplate].join(" ")}var filterTemplate={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},backdropFilterTemplate={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function getRingTemplate(as){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":as,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var flexDirectionTemplate={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},directionMap={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},valueSet=new Set(Object.values(directionMap)),globalSet=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),trimSpace=as=>as.trim();function parseGradient(as,rs){if(as==null||globalSet.has(as))return as;const ss=/(^[a-z-A-Z]+)\((.*)\)/g.exec(as),os=ss==null?void 0:ss[1],ls=ss==null?void 0:ss[2];if(!os||!ls)return as;const us=os.includes("-gradient")?os:`${os}-gradient`,[cs,...ds]=ls.split(",").map(trimSpace).filter(Boolean);if((ds==null?void 0:ds.length)===0)return as;const ps=cs in directionMap?directionMap[cs]:cs;ds.unshift(ps);const fs=ds.map(hs=>{if(valueSet.has(hs))return hs;const gs=hs.indexOf(" "),[ys,bs]=gs!==-1?[hs.substr(0,gs),hs.substr(gs+1)]:[hs],vs=isCSSFunction(bs)?bs:bs&&bs.split(" "),xs=`colors.${ys}`,Cs=xs in rs.__cssMap?rs.__cssMap[xs].varRef:ys;return vs?[Cs,...Array.isArray(vs)?vs:[vs]].join(" "):Cs});return`${us}(${fs.join(", ")})`}var isCSSFunction=as=>typeof as=="string"&&as.includes("(")&&as.includes(")"),gradientTransform=(as,rs)=>parseGradient(as,rs??{});function isCssVar(as){return/^var\(--.+\)$/.test(as)}var analyzeCSSValue=as=>{const rs=parseFloat(as.toString()),ns=as.toString().replace(String(rs),"");return{unitless:!ns,value:rs,unit:ns}},wrap=as=>rs=>`${as}(${rs})`,transformFunctions={filter(as){return as!=="auto"?as:filterTemplate},backdropFilter(as){return as!=="auto"?as:backdropFilterTemplate},ring(as){return getRingTemplate(transformFunctions.px(as))},bgClip(as){return as==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:as}},transform(as){return as==="auto"?getTransformTemplate():as==="auto-gpu"?getTransformGpuTemplate():as},vh(as){return as==="$100vh"?"var(--chakra-vh)":as},px(as){if(as==null)return as;const{unitless:rs}=analyzeCSSValue(as);return rs||typeof as=="number"?`${as}px`:as},fraction(as){return typeof as!="number"||as>1?as:`${as*100}%`},float(as,rs){const ns={left:"right",right:"left"};return rs.direction==="rtl"?ns[as]:as},degree(as){if(isCssVar(as)||as==null)return as;const rs=typeof as=="string"&&!as.endsWith("deg");return typeof as=="number"||rs?`${as}deg`:as},gradient:gradientTransform,blur:wrap("blur"),opacity:wrap("opacity"),brightness:wrap("brightness"),contrast:wrap("contrast"),dropShadow:wrap("drop-shadow"),grayscale:wrap("grayscale"),hueRotate:wrap("hue-rotate"),invert:wrap("invert"),saturate:wrap("saturate"),sepia:wrap("sepia"),bgImage(as){return as==null||isCSSFunction(as)||globalSet.has(as)?as:`url(${as})`},outline(as){const rs=String(as)==="0"||String(as)==="none";return as!==null&&rs?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:as}},flexDirection(as){var rs;const{space:ns,divide:ss}=(rs=flexDirectionTemplate[as])!=null?rs:{},os={flexDirection:as};return ns&&(os[ns]=1),ss&&(os[ss]=1),os}},t$2={borderWidths:toConfig("borderWidths"),borderStyles:toConfig("borderStyles"),colors:toConfig("colors"),borders:toConfig("borders"),radii:toConfig("radii",transformFunctions.px),space:toConfig("space",pipe$2(transformFunctions.vh,transformFunctions.px)),spaceT:toConfig("space",pipe$2(transformFunctions.vh,transformFunctions.px)),degreeT(as){return{property:as,transform:transformFunctions.degree}},prop(as,rs,ns){return{property:as,scale:rs,...rs&&{transform:createTransform({scale:rs,transform:ns})}}},propT(as,rs){return{property:as,transform:rs}},sizes:toConfig("sizes",pipe$2(transformFunctions.vh,transformFunctions.px)),sizesT:toConfig("sizes",pipe$2(transformFunctions.vh,transformFunctions.fraction)),shadows:toConfig("shadows"),logical,blur:toConfig("blur",transformFunctions.blur)},background={background:t$2.colors("background"),backgroundColor:t$2.colors("backgroundColor"),backgroundImage:t$2.propT("backgroundImage",transformFunctions.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:transformFunctions.bgClip},bgSize:t$2.prop("backgroundSize"),bgPosition:t$2.prop("backgroundPosition"),bg:t$2.colors("background"),bgColor:t$2.colors("backgroundColor"),bgPos:t$2.prop("backgroundPosition"),bgRepeat:t$2.prop("backgroundRepeat"),bgAttachment:t$2.prop("backgroundAttachment"),bgGradient:t$2.propT("backgroundImage",transformFunctions.gradient),bgClip:{transform:transformFunctions.bgClip}};Object.assign(background,{bgImage:background.backgroundImage,bgImg:background.backgroundImage});var border={border:t$2.borders("border"),borderWidth:t$2.borderWidths("borderWidth"),borderStyle:t$2.borderStyles("borderStyle"),borderColor:t$2.colors("borderColor"),borderRadius:t$2.radii("borderRadius"),borderTop:t$2.borders("borderTop"),borderBlockStart:t$2.borders("borderBlockStart"),borderTopLeftRadius:t$2.radii("borderTopLeftRadius"),borderStartStartRadius:t$2.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:t$2.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:t$2.radii("borderTopRightRadius"),borderStartEndRadius:t$2.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:t$2.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:t$2.borders("borderRight"),borderInlineEnd:t$2.borders("borderInlineEnd"),borderBottom:t$2.borders("borderBottom"),borderBlockEnd:t$2.borders("borderBlockEnd"),borderBottomLeftRadius:t$2.radii("borderBottomLeftRadius"),borderBottomRightRadius:t$2.radii("borderBottomRightRadius"),borderLeft:t$2.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:t$2.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:t$2.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:t$2.borders(["borderLeft","borderRight"]),borderInline:t$2.borders("borderInline"),borderY:t$2.borders(["borderTop","borderBottom"]),borderBlock:t$2.borders("borderBlock"),borderTopWidth:t$2.borderWidths("borderTopWidth"),borderBlockStartWidth:t$2.borderWidths("borderBlockStartWidth"),borderTopColor:t$2.colors("borderTopColor"),borderBlockStartColor:t$2.colors("borderBlockStartColor"),borderTopStyle:t$2.borderStyles("borderTopStyle"),borderBlockStartStyle:t$2.borderStyles("borderBlockStartStyle"),borderBottomWidth:t$2.borderWidths("borderBottomWidth"),borderBlockEndWidth:t$2.borderWidths("borderBlockEndWidth"),borderBottomColor:t$2.colors("borderBottomColor"),borderBlockEndColor:t$2.colors("borderBlockEndColor"),borderBottomStyle:t$2.borderStyles("borderBottomStyle"),borderBlockEndStyle:t$2.borderStyles("borderBlockEndStyle"),borderLeftWidth:t$2.borderWidths("borderLeftWidth"),borderInlineStartWidth:t$2.borderWidths("borderInlineStartWidth"),borderLeftColor:t$2.colors("borderLeftColor"),borderInlineStartColor:t$2.colors("borderInlineStartColor"),borderLeftStyle:t$2.borderStyles("borderLeftStyle"),borderInlineStartStyle:t$2.borderStyles("borderInlineStartStyle"),borderRightWidth:t$2.borderWidths("borderRightWidth"),borderInlineEndWidth:t$2.borderWidths("borderInlineEndWidth"),borderRightColor:t$2.colors("borderRightColor"),borderInlineEndColor:t$2.colors("borderInlineEndColor"),borderRightStyle:t$2.borderStyles("borderRightStyle"),borderInlineEndStyle:t$2.borderStyles("borderInlineEndStyle"),borderTopRadius:t$2.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:t$2.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:t$2.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:t$2.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(border,{rounded:border.borderRadius,roundedTop:border.borderTopRadius,roundedTopLeft:border.borderTopLeftRadius,roundedTopRight:border.borderTopRightRadius,roundedTopStart:border.borderStartStartRadius,roundedTopEnd:border.borderStartEndRadius,roundedBottom:border.borderBottomRadius,roundedBottomLeft:border.borderBottomLeftRadius,roundedBottomRight:border.borderBottomRightRadius,roundedBottomStart:border.borderEndStartRadius,roundedBottomEnd:border.borderEndEndRadius,roundedLeft:border.borderLeftRadius,roundedRight:border.borderRightRadius,roundedStart:border.borderInlineStartRadius,roundedEnd:border.borderInlineEndRadius,borderStart:border.borderInlineStart,borderEnd:border.borderInlineEnd,borderTopStartRadius:border.borderStartStartRadius,borderTopEndRadius:border.borderStartEndRadius,borderBottomStartRadius:border.borderEndStartRadius,borderBottomEndRadius:border.borderEndEndRadius,borderStartRadius:border.borderInlineStartRadius,borderEndRadius:border.borderInlineEndRadius,borderStartWidth:border.borderInlineStartWidth,borderEndWidth:border.borderInlineEndWidth,borderStartColor:border.borderInlineStartColor,borderEndColor:border.borderInlineEndColor,borderStartStyle:border.borderInlineStartStyle,borderEndStyle:border.borderInlineEndStyle});var color$1={color:t$2.colors("color"),textColor:t$2.colors("color"),fill:t$2.colors("fill"),stroke:t$2.colors("stroke")},effect$3={boxShadow:t$2.shadows("boxShadow"),mixBlendMode:!0,blendMode:t$2.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:t$2.prop("backgroundBlendMode"),opacity:!0};Object.assign(effect$3,{shadow:effect$3.boxShadow});var filter$2={filter:{transform:transformFunctions.filter},blur:t$2.blur("--chakra-blur"),brightness:t$2.propT("--chakra-brightness",transformFunctions.brightness),contrast:t$2.propT("--chakra-contrast",transformFunctions.contrast),hueRotate:t$2.degreeT("--chakra-hue-rotate"),invert:t$2.propT("--chakra-invert",transformFunctions.invert),saturate:t$2.propT("--chakra-saturate",transformFunctions.saturate),dropShadow:t$2.propT("--chakra-drop-shadow",transformFunctions.dropShadow),backdropFilter:{transform:transformFunctions.backdropFilter},backdropBlur:t$2.blur("--chakra-backdrop-blur"),backdropBrightness:t$2.propT("--chakra-backdrop-brightness",transformFunctions.brightness),backdropContrast:t$2.propT("--chakra-backdrop-contrast",transformFunctions.contrast),backdropHueRotate:t$2.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:t$2.propT("--chakra-backdrop-invert",transformFunctions.invert),backdropSaturate:t$2.propT("--chakra-backdrop-saturate",transformFunctions.saturate)},flexbox={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:transformFunctions.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:t$2.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:t$2.space("gap"),rowGap:t$2.space("rowGap"),columnGap:t$2.space("columnGap")};Object.assign(flexbox,{flexDir:flexbox.flexDirection});var grid={gridGap:t$2.space("gridGap"),gridColumnGap:t$2.space("gridColumnGap"),gridRowGap:t$2.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},interactivity={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:transformFunctions.outline},outlineOffset:!0,outlineColor:t$2.colors("outlineColor")},layout$1={width:t$2.sizesT("width"),inlineSize:t$2.sizesT("inlineSize"),height:t$2.sizes("height"),blockSize:t$2.sizes("blockSize"),boxSize:t$2.sizes(["width","height"]),minWidth:t$2.sizes("minWidth"),minInlineSize:t$2.sizes("minInlineSize"),minHeight:t$2.sizes("minHeight"),minBlockSize:t$2.sizes("minBlockSize"),maxWidth:t$2.sizes("maxWidth"),maxInlineSize:t$2.sizes("maxInlineSize"),maxHeight:t$2.sizes("maxHeight"),maxBlockSize:t$2.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,hideFrom:{scale:"breakpoints",transform:(as,rs)=>{var ns,ss,os;return{[(os=(ss=(ns=rs.__breakpoints)==null?void 0:ns.get(as))==null?void 0:ss.minWQuery)!=null?os:`@media screen and (min-width: ${as})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(as,rs)=>{var ns,ss,os;return{[(os=(ss=(ns=rs.__breakpoints)==null?void 0:ns.get(as))==null?void 0:ss.maxWQuery)!=null?os:`@media screen and (max-width: ${as})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:t$2.propT("float",transformFunctions.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(layout$1,{w:layout$1.width,h:layout$1.height,minW:layout$1.minWidth,maxW:layout$1.maxWidth,minH:layout$1.minHeight,maxH:layout$1.maxHeight,overscroll:layout$1.overscrollBehavior,overscrollX:layout$1.overscrollBehaviorX,overscrollY:layout$1.overscrollBehaviorY});var list={listStyleType:!0,listStylePosition:!0,listStylePos:t$2.prop("listStylePosition"),listStyleImage:!0,listStyleImg:t$2.prop("listStyleImage")};function get$2(as,rs,ns,ss){const os=typeof rs=="string"?rs.split("."):[rs];for(ss=0;ss{const rs=new WeakMap;return(ss,os,ls,us)=>{if(typeof ss>"u")return as(ss,os,ls);rs.has(ss)||rs.set(ss,new Map);const cs=rs.get(ss);if(cs.has(os))return cs.get(os);const ds=as(ss,os,ls,us);return cs.set(os,ds),ds}},memoizedGet$1=memoize$1(get$2),srOnly={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},srFocusable={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},getWithPriority=(as,rs,ns)=>{const ss={},os=memoizedGet$1(as,rs,{});for(const ls in os)ls in ns&&ns[ls]!=null||(ss[ls]=os[ls]);return ss},others={srOnly:{transform(as){return as===!0?srOnly:as==="focusable"?srFocusable:{}}},layerStyle:{processResult:!0,transform:(as,rs,ns)=>getWithPriority(rs,`layerStyles.${as}`,ns)},textStyle:{processResult:!0,transform:(as,rs,ns)=>getWithPriority(rs,`textStyles.${as}`,ns)},apply:{processResult:!0,transform:(as,rs,ns)=>getWithPriority(rs,as,ns)}},position={position:!0,pos:t$2.prop("position"),zIndex:t$2.prop("zIndex","zIndices"),inset:t$2.spaceT("inset"),insetX:t$2.spaceT(["left","right"]),insetInline:t$2.spaceT("insetInline"),insetY:t$2.spaceT(["top","bottom"]),insetBlock:t$2.spaceT("insetBlock"),top:t$2.spaceT("top"),insetBlockStart:t$2.spaceT("insetBlockStart"),bottom:t$2.spaceT("bottom"),insetBlockEnd:t$2.spaceT("insetBlockEnd"),left:t$2.spaceT("left"),insetInlineStart:t$2.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:t$2.spaceT("right"),insetInlineEnd:t$2.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(position,{insetStart:position.insetInlineStart,insetEnd:position.insetInlineEnd});var ring={ring:{transform:transformFunctions.ring},ringColor:t$2.colors("--chakra-ring-color"),ringOffset:t$2.prop("--chakra-ring-offset-width"),ringOffsetColor:t$2.colors("--chakra-ring-offset-color"),ringInset:t$2.prop("--chakra-ring-inset")},space={margin:t$2.spaceT("margin"),marginTop:t$2.spaceT("marginTop"),marginBlockStart:t$2.spaceT("marginBlockStart"),marginRight:t$2.spaceT("marginRight"),marginInlineEnd:t$2.spaceT("marginInlineEnd"),marginBottom:t$2.spaceT("marginBottom"),marginBlockEnd:t$2.spaceT("marginBlockEnd"),marginLeft:t$2.spaceT("marginLeft"),marginInlineStart:t$2.spaceT("marginInlineStart"),marginX:t$2.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:t$2.spaceT("marginInline"),marginY:t$2.spaceT(["marginTop","marginBottom"]),marginBlock:t$2.spaceT("marginBlock"),padding:t$2.space("padding"),paddingTop:t$2.space("paddingTop"),paddingBlockStart:t$2.space("paddingBlockStart"),paddingRight:t$2.space("paddingRight"),paddingBottom:t$2.space("paddingBottom"),paddingBlockEnd:t$2.space("paddingBlockEnd"),paddingLeft:t$2.space("paddingLeft"),paddingInlineStart:t$2.space("paddingInlineStart"),paddingInlineEnd:t$2.space("paddingInlineEnd"),paddingX:t$2.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:t$2.space("paddingInline"),paddingY:t$2.space(["paddingTop","paddingBottom"]),paddingBlock:t$2.space("paddingBlock")};Object.assign(space,{m:space.margin,mt:space.marginTop,mr:space.marginRight,me:space.marginInlineEnd,marginEnd:space.marginInlineEnd,mb:space.marginBottom,ml:space.marginLeft,ms:space.marginInlineStart,marginStart:space.marginInlineStart,mx:space.marginX,my:space.marginY,p:space.padding,pt:space.paddingTop,py:space.paddingY,px:space.paddingX,pb:space.paddingBottom,pl:space.paddingLeft,ps:space.paddingInlineStart,paddingStart:space.paddingInlineStart,pr:space.paddingRight,pe:space.paddingInlineEnd,paddingEnd:space.paddingInlineEnd});var textDecoration={textDecorationColor:t$2.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:t$2.shadows("textShadow")},transform={clipPath:!0,transform:t$2.propT("transform",transformFunctions.transform),transformOrigin:!0,translateX:t$2.spaceT("--chakra-translate-x"),translateY:t$2.spaceT("--chakra-translate-y"),skewX:t$2.degreeT("--chakra-skew-x"),skewY:t$2.degreeT("--chakra-skew-y"),scaleX:t$2.prop("--chakra-scale-x"),scaleY:t$2.prop("--chakra-scale-y"),scale:t$2.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:t$2.degreeT("--chakra-rotate")},transition$2={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:t$2.prop("transitionDuration","transition.duration"),transitionProperty:t$2.prop("transitionProperty","transition.property"),transitionTimingFunction:t$2.prop("transitionTimingFunction","transition.easing")},typography$1={fontFamily:t$2.prop("fontFamily","fonts"),fontSize:t$2.prop("fontSize","fontSizes",transformFunctions.px),fontWeight:t$2.prop("fontWeight","fontWeights"),lineHeight:t$2.prop("lineHeight","lineHeights"),letterSpacing:t$2.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(as){if(as===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},scroll={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:t$2.spaceT("scrollMargin"),scrollMarginTop:t$2.spaceT("scrollMarginTop"),scrollMarginBottom:t$2.spaceT("scrollMarginBottom"),scrollMarginLeft:t$2.spaceT("scrollMarginLeft"),scrollMarginRight:t$2.spaceT("scrollMarginRight"),scrollMarginX:t$2.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:t$2.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:t$2.spaceT("scrollPadding"),scrollPaddingTop:t$2.spaceT("scrollPaddingTop"),scrollPaddingBottom:t$2.spaceT("scrollPaddingBottom"),scrollPaddingLeft:t$2.spaceT("scrollPaddingLeft"),scrollPaddingRight:t$2.spaceT("scrollPaddingRight"),scrollPaddingX:t$2.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:t$2.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function resolveReference(as){return isObject$6(as)&&as.reference?as.reference:String(as)}var toExpression=(as,...rs)=>rs.map(resolveReference).join(` ${as} `).replace(/calc/g,""),add$2=(...as)=>`calc(${toExpression("+",...as)})`,subtract$1=(...as)=>`calc(${toExpression("-",...as)})`,multiply$1=(...as)=>`calc(${toExpression("*",...as)})`,divide$1=(...as)=>`calc(${toExpression("/",...as)})`,negate$1=as=>{const rs=resolveReference(as);return rs!=null&&!Number.isNaN(parseFloat(rs))?String(rs).startsWith("-")?String(rs).slice(1):`-${rs}`:multiply$1(rs,-1)},calc$1=Object.assign(as=>({add:(...rs)=>calc$1(add$2(as,...rs)),subtract:(...rs)=>calc$1(subtract$1(as,...rs)),multiply:(...rs)=>calc$1(multiply$1(as,...rs)),divide:(...rs)=>calc$1(divide$1(as,...rs)),negate:()=>calc$1(negate$1(as)),toString:()=>as.toString()}),{add:add$2,subtract:subtract$1,multiply:multiply$1,divide:divide$1,negate:negate$1});function replaceWhiteSpace$1(as,rs="-"){return as.replace(/\s+/g,rs)}function escape$2(as){const rs=replaceWhiteSpace$1(as.toString());return escapeSymbol(escapeDot(rs))}function escapeDot(as){return as.includes("\\.")?as:!Number.isInteger(parseFloat(as.toString()))?as.replace(".","\\."):as}function escapeSymbol(as){return as.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function addPrefix$1(as,rs=""){return[rs,as].filter(Boolean).join("-")}function toVarReference(as,rs){return`var(${as}${rs?`, ${rs}`:""})`}function toVarDefinition(as,rs=""){return escape$2(`--${addPrefix$1(as,rs)}`)}function cssVar$1(as,rs,ns){const ss=toVarDefinition(as,ns);return{variable:ss,reference:toVarReference(ss,rs)}}function getLastItem(as){const rs=as==null?0:as.length;return rs?as[rs-1]:void 0}function analyzeCSSValue2(as){const rs=parseFloat(as.toString()),ns=as.toString().replace(String(rs),"");return{unitless:!ns,value:rs,unit:ns}}function px$2(as){if(as==null)return as;const{unitless:rs}=analyzeCSSValue2(as);return rs||typeof as=="number"?`${as}px`:as}var sortByBreakpointValue=(as,rs)=>parseInt(as[1],10)>parseInt(rs[1],10)?1:-1,sortBps=as=>Object.fromEntries(Object.entries(as).sort(sortByBreakpointValue));function normalize(as){const rs=sortBps(as);return Object.assign(Object.values(rs),rs)}function keys$3(as){const rs=Object.keys(sortBps(as));return new Set(rs)}function subtract2(as){var rs;if(!as)return as;as=(rs=px$2(as))!=null?rs:as;const ns=-.02;return typeof as=="number"?`${as+ns}`:as.replace(/(\d+\.?\d*)/u,ss=>`${parseFloat(ss)+ns}`)}function toMediaQueryString(as,rs){const ns=["@media screen"];return as&&ns.push("and",`(min-width: ${px$2(as)})`),rs&&ns.push("and",`(max-width: ${px$2(rs)})`),ns.join(" ")}function analyzeBreakpoints(as){var rs;if(!as)return null;as.base=(rs=as.base)!=null?rs:"0px";const ns=normalize(as),ss=Object.entries(as).sort(sortByBreakpointValue).map(([us,cs],ds,ps)=>{var fs;let[,hs]=(fs=ps[ds+1])!=null?fs:[];return hs=parseFloat(hs)>0?subtract2(hs):void 0,{_minW:subtract2(cs),breakpoint:us,minW:cs,maxW:hs,maxWQuery:toMediaQueryString(null,hs),minWQuery:toMediaQueryString(cs),minMaxQuery:toMediaQueryString(cs,hs)}}),os=keys$3(as),ls=Array.from(os.values());return{keys:os,normalized:ns,isResponsive(us){const cs=Object.keys(us);return cs.length>0&&cs.every(ds=>os.has(ds))},asObject:sortBps(as),asArray:normalize(as),details:ss,get(us){return ss.find(cs=>cs.breakpoint===us)},media:[null,...ns.map(us=>toMediaQueryString(us)).slice(1)],toArrayValue(us){if(!isObject$6(us))throw new Error("toArrayValue: value must be an object");const cs=ls.map(ds=>{var ps;return(ps=us[ds])!=null?ps:null});for(;getLastItem(cs)===null;)cs.pop();return cs},toObjectValue(us){if(!Array.isArray(us))throw new Error("toObjectValue: value must be an array");return us.reduce((cs,ds,ps)=>{const fs=ls[ps];return fs!=null&&ds!=null&&(cs[fs]=ds),cs},{})}}}var state={hover:(as,rs)=>`${as}:hover ${rs}, ${as}[data-hover] ${rs}`,focus:(as,rs)=>`${as}:focus ${rs}, ${as}[data-focus] ${rs}`,focusVisible:(as,rs)=>`${as}:focus-visible ${rs}`,focusWithin:(as,rs)=>`${as}:focus-within ${rs}`,active:(as,rs)=>`${as}:active ${rs}, ${as}[data-active] ${rs}`,disabled:(as,rs)=>`${as}:disabled ${rs}, ${as}[data-disabled] ${rs}`,invalid:(as,rs)=>`${as}:invalid ${rs}, ${as}[data-invalid] ${rs}`,checked:(as,rs)=>`${as}:checked ${rs}, ${as}[data-checked] ${rs}`,indeterminate:(as,rs)=>`${as}:indeterminate ${rs}, ${as}[aria-checked=mixed] ${rs}, ${as}[data-indeterminate] ${rs}`,readOnly:(as,rs)=>`${as}:read-only ${rs}, ${as}[readonly] ${rs}, ${as}[data-read-only] ${rs}`,expanded:(as,rs)=>`${as}:read-only ${rs}, ${as}[aria-expanded=true] ${rs}, ${as}[data-expanded] ${rs}`,placeholderShown:(as,rs)=>`${as}:placeholder-shown ${rs}`},toGroup=as=>merge$2(rs=>as(rs,"&"),"[role=group]","[data-group]",".group"),toPeer=as=>merge$2(rs=>as(rs,"~ &"),"[data-peer]",".peer"),merge$2=(as,...rs)=>rs.map(as).join(", "),pseudoSelectors={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:toGroup(state.hover),_peerHover:toPeer(state.hover),_groupFocus:toGroup(state.focus),_peerFocus:toPeer(state.focus),_groupFocusVisible:toGroup(state.focusVisible),_peerFocusVisible:toPeer(state.focusVisible),_groupActive:toGroup(state.active),_peerActive:toPeer(state.active),_groupDisabled:toGroup(state.disabled),_peerDisabled:toPeer(state.disabled),_groupInvalid:toGroup(state.invalid),_peerInvalid:toPeer(state.invalid),_groupChecked:toGroup(state.checked),_peerChecked:toPeer(state.checked),_groupFocusWithin:toGroup(state.focusWithin),_peerFocusWithin:toPeer(state.focusWithin),_peerPlaceholderShown:toPeer(state.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]"},pseudoPropNames=Object.keys(pseudoSelectors);function tokenToCssVar(as,rs){return cssVar$1(String(as).replace(/\./g,"-"),void 0,rs)}function createThemeVars(as,rs){let ns={};const ss={};for(const[os,ls]of Object.entries(as)){const{isSemantic:us,value:cs}=ls,{variable:ds,reference:ps}=tokenToCssVar(os,rs==null?void 0:rs.cssVarPrefix);if(!us){if(os.startsWith("space")){const gs=os.split("."),[ys,...bs]=gs,vs=`${ys}.-${bs.join(".")}`,xs=calc$1.negate(cs),Cs=calc$1.negate(ps);ss[vs]={value:xs,var:ds,varRef:Cs}}ns[ds]=cs,ss[os]={value:cs,var:ds,varRef:ps};continue}const fs=gs=>{const bs=[String(os).split(".")[0],gs].join(".");if(!as[bs])return gs;const{reference:xs}=tokenToCssVar(bs,rs==null?void 0:rs.cssVarPrefix);return xs},hs=isObject$6(cs)?cs:{default:cs};ns=mergeWith(ns,Object.entries(hs).reduce((gs,[ys,bs])=>{var vs,xs;const Cs=fs(bs);if(ys==="default")return gs[ds]=Cs,gs;const Ts=(xs=(vs=pseudoSelectors)==null?void 0:vs[ys])!=null?xs:ys;return gs[Ts]={[ds]:Cs},gs},{})),ss[os]={value:ps,var:ds,varRef:ps}}return{cssVars:ns,cssMap:ss}}function omit$4(as,rs=[]){const ns=Object.assign({},as);for(const ss of rs)ss in ns&&delete ns[ss];return ns}function pick$2(as,rs){const ns={};for(const ss of rs)ss in as&&(ns[ss]=as[ss]);return ns}var tokens=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function extractTokens(as){return pick$2(as,tokens)}function extractSemanticTokens(as){return as.semanticTokens}function omitVars(as){const{__cssMap:rs,__cssVars:ns,__breakpoints:ss,...os}=as;return os}function flattenTokens({tokens:as,semanticTokens:rs}){var ns,ss;const os=Object.entries((ns=flatten$2(as))!=null?ns:{}).map(([us,cs])=>[us,{isSemantic:!1,value:cs}]),ls=Object.entries((ss=flatten$2(rs,1))!=null?ss:{}).map(([us,cs])=>[us,{isSemantic:!0,value:cs}]);return Object.fromEntries([...os,...ls])}function flatten$2(as,rs=1/0){return!isObject$6(as)&&!Array.isArray(as)||!rs?as:Object.entries(as).reduce((ns,[ss,os])=>(isObject$6(os)||Array.isArray(os)?Object.entries(flatten$2(os,rs-1)).forEach(([ls,us])=>{ns[`${ss}.${ls}`]=us}):ns[ss]=os,ns),{})}function toCSSVar(as){var rs;const ns=omitVars(as),ss=extractTokens(ns),os=extractSemanticTokens(ns),ls=flattenTokens({tokens:ss,semanticTokens:os}),us=(rs=ns.config)==null?void 0:rs.cssVarPrefix,{cssMap:cs,cssVars:ds}=createThemeVars(ls,{cssVarPrefix:us});return Object.assign(ns,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...ds},__cssMap:cs,__breakpoints:analyzeBreakpoints(ns.breakpoints)}),ns}var systemProps=mergeWith({},background,border,color$1,flexbox,layout$1,filter$2,ring,interactivity,grid,others,position,effect$3,space,scroll,typography$1,textDecoration,transform,list,transition$2);Object.assign({},space,layout$1,flexbox,grid,position);var propNames=[...Object.keys(systemProps),...pseudoPropNames],styleProps={...systemProps,...pseudoSelectors},isStyleProp=as=>as in styleProps,expandResponsive=as=>rs=>{if(!rs.__breakpoints)return as;const{isResponsive:ns,toArrayValue:ss,media:os}=rs.__breakpoints,ls={};for(const us in as){let cs=runIfFn$2(as[us],rs);if(cs==null)continue;if(cs=isObject$6(cs)&&ns(cs)?ss(cs):cs,!Array.isArray(cs)){ls[us]=cs;continue}const ds=cs.slice(0,os.length).length;for(let ps=0;psas.startsWith("--")&&typeof rs=="string"&&!isCssVar2(rs),resolveTokenValue=(as,rs)=>{var ns,ss;if(rs==null)return rs;const os=ds=>{var ps,fs;return(fs=(ps=as.__cssMap)==null?void 0:ps[ds])==null?void 0:fs.varRef},ls=ds=>{var ps;return(ps=os(ds))!=null?ps:ds},[us,cs]=splitByComma(rs);return rs=(ss=(ns=os(us))!=null?ns:ls(cs))!=null?ss:ls(rs),rs};function getCss(as){const{configs:rs={},pseudos:ns={},theme:ss}=as,os=(ls,us=!1)=>{var cs,ds,ps;const fs=runIfFn$2(ls,ss),hs=expandResponsive(fs)(ss);let gs={};for(let ys in hs){const bs=hs[ys];let vs=runIfFn$2(bs,ss);ys in ns&&(ys=ns[ys]),isCSSVariableTokenValue(ys,vs)&&(vs=resolveTokenValue(ss,vs));let xs=rs[ys];if(xs===!0&&(xs={property:ys}),isObject$6(vs)){gs[ys]=(cs=gs[ys])!=null?cs:{},gs[ys]=mergeWith({},gs[ys],os(vs,!0));continue}let Cs=(ps=(ds=xs==null?void 0:xs.transform)==null?void 0:ds.call(xs,vs,ss,fs))!=null?ps:vs;Cs=xs!=null&&xs.processResult?os(Cs,!0):Cs;const Ts=runIfFn$2(xs==null?void 0:xs.property,ss);if(!us&&(xs!=null&&xs.static)){const Ss=runIfFn$2(xs.static,ss);gs=mergeWith({},gs,Ss)}if(Ts&&Array.isArray(Ts)){for(const Ss of Ts)gs[Ss]=Cs;continue}if(Ts){Ts==="&"&&isObject$6(Cs)?gs=mergeWith({},gs,Cs):gs[Ts]=Cs;continue}if(isObject$6(Cs)){gs=mergeWith({},gs,Cs);continue}gs[ys]=Cs}return gs};return os}var css=as=>rs=>getCss({theme:rs,pseudos:pseudoSelectors,configs:systemProps})(as);function defineStyle(as){return as}function defineStyleConfig(as){return as}function createMultiStyleConfigHelpers(as){return{definePartsStyle(rs){return rs},defineMultiStyleConfig(rs){return{parts:as,...rs}}}}function normalize2(as,rs){if(Array.isArray(as))return as;if(isObject$6(as))return rs(as);if(as!=null)return[as]}function getNextIndex$1(as,rs){for(let ns=rs+1;ns{mergeWith(ps,{[Ss]:gs?Ts[Ss]:{[Cs]:Ts[Ss]}})});continue}if(!ys){gs?mergeWith(ps,Ts):ps[Cs]=Ts;continue}ps[Cs]=Ts}}return ps}}function resolveStyleConfig(as){return rs=>{var ns;const{variant:ss,size:os,theme:ls}=rs,us=createResolver(ls);return mergeWith({},runIfFn$2((ns=as.baseStyle)!=null?ns:{},rs),us(as,"sizes",os,rs),us(as,"variants",ss,rs))}}function getCSSVar(as,rs,ns){var ss,os,ls;return(ls=(os=(ss=as.__cssMap)==null?void 0:ss[`${rs}.${ns}`])==null?void 0:os.varRef)!=null?ls:ns}function omitThemingProps(as){return omit$4(as,["styleConfig","size","variant","colorScheme"])}var requiredChakraThemeKeys=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function isChakraTheme(as){return isObject$6(as)?requiredChakraThemeKeys.every(rs=>Object.prototype.hasOwnProperty.call(as,rs)):!1}var zIndices={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},z_index_default=zIndices,breakpoints$1={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},breakpoints_default=breakpoints$1,colors={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},colors_default=colors,radii={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},radius_default=radii,shadows={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},shadows_default=shadows,transitionProperty={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},transitionTimingFunction={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},transitionDuration={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},transition$1={property:transitionProperty,easing:transitionTimingFunction,duration:transitionDuration},transition_default=transition$1,blur={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},blur_default=blur,borders$1={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},borders_default=borders$1,typography={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},typography_default=typography,spacing={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},largeSizes={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},container={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},sizes$m={...spacing,...largeSizes,container},sizes_default=sizes$m,foundations={breakpoints:breakpoints_default,zIndices:z_index_default,radii:radius_default,blur:blur_default,colors:colors_default,...typography_default,sizes:sizes_default,shadows:shadows_default,space:spacing,borders:borders_default,transition:transition_default};function anatomy(as,rs={}){let ns=!1;function ss(){if(!ns){ns=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function os(...fs){ss();for(const hs of fs)rs[hs]=ds(hs);return anatomy(as,rs)}function ls(...fs){for(const hs of fs)hs in rs||(rs[hs]=ds(hs));return anatomy(as,rs)}function us(){return Object.fromEntries(Object.entries(rs).map(([hs,gs])=>[hs,gs.selector]))}function cs(){return Object.fromEntries(Object.entries(rs).map(([hs,gs])=>[hs,gs.className]))}function ds(fs){const ys=`chakra-${(["container","root"].includes(fs??"")?[as]:[as,fs]).filter(Boolean).join("__")}`;return{className:ys,selector:`.${ys}`,toString:()=>fs}}return{parts:os,toPart:ds,extend:ls,selectors:us,classnames:cs,get keys(){return Object.keys(rs)},__type:{}}}var accordionAnatomy=anatomy("accordion").parts("root","container","button","panel").extend("icon"),alertAnatomy=anatomy("alert").parts("title","description","container").extend("icon","spinner"),avatarAnatomy=anatomy("avatar").parts("label","badge","container").extend("excessLabel","group"),breadcrumbAnatomy=anatomy("breadcrumb").parts("link","item","container").extend("separator");anatomy("button").parts();var checkboxAnatomy=anatomy("checkbox").parts("control","icon","container").extend("label");anatomy("progress").parts("track","filledTrack").extend("label");var drawerAnatomy=anatomy("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),editableAnatomy=anatomy("editable").parts("preview","input","textarea"),formAnatomy=anatomy("form").parts("container","requiredIndicator","helperText"),formErrorAnatomy=anatomy("formError").parts("text","icon"),inputAnatomy=anatomy("input").parts("addon","field","element"),listAnatomy=anatomy("list").parts("container","item","icon"),menuAnatomy=anatomy("menu").parts("button","list","item").extend("groupTitle","command","divider"),modalAnatomy=anatomy("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),numberInputAnatomy=anatomy("numberinput").parts("root","field","stepperGroup","stepper");anatomy("pininput").parts("field");var popoverAnatomy=anatomy("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),progressAnatomy=anatomy("progress").parts("label","filledTrack","track"),radioAnatomy=anatomy("radio").parts("container","control","label"),selectAnatomy=anatomy("select").parts("field","icon"),sliderAnatomy=anatomy("slider").parts("container","track","thumb","filledTrack","mark"),statAnatomy=anatomy("stat").parts("container","label","helpText","number","icon"),switchAnatomy=anatomy("switch").parts("container","track","thumb"),tableAnatomy=anatomy("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),tabsAnatomy=anatomy("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),tagAnatomy=anatomy("tag").parts("container","label","closeButton"),cardAnatomy=anatomy("card").parts("container","header","body","footer");function guard(as,rs,ns){return Math.min(Math.max(as,ns),rs)}class ColorError extends Error{constructor(rs){super(`Failed to parse color: "${rs}"`)}}var ColorError$1=ColorError;function parseToRgba(as){if(typeof as!="string")throw new ColorError$1(as);if(as.trim().toLowerCase()==="transparent")return[0,0,0,0];let rs=as.trim();rs=namedColorRegex.test(as)?nameToHex(as):as;const ns=reducedHexRegex.exec(rs);if(ns){const us=Array.from(ns).slice(1);return[...us.slice(0,3).map(cs=>parseInt(r$2(cs,2),16)),parseInt(r$2(us[3]||"f",2),16)/255]}const ss=hexRegex.exec(rs);if(ss){const us=Array.from(ss).slice(1);return[...us.slice(0,3).map(cs=>parseInt(cs,16)),parseInt(us[3]||"ff",16)/255]}const os=rgbaRegex.exec(rs);if(os){const us=Array.from(os).slice(1);return[...us.slice(0,3).map(cs=>parseInt(cs,10)),parseFloat(us[3]||"1")]}const ls=hslaRegex.exec(rs);if(ls){const[us,cs,ds,ps]=Array.from(ls).slice(1).map(parseFloat);if(guard(0,100,cs)!==cs)throw new ColorError$1(as);if(guard(0,100,ds)!==ds)throw new ColorError$1(as);return[...hslToRgb(us,cs,ds),Number.isNaN(ps)?1:ps]}throw new ColorError$1(as)}function hash$2(as){let rs=5381,ns=as.length;for(;ns;)rs=rs*33^as.charCodeAt(--ns);return(rs>>>0)%2341}const colorToInt=as=>parseInt(as.replace(/_/g,""),36),compressedColorMap="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((as,rs)=>{const ns=colorToInt(rs.substring(0,3)),ss=colorToInt(rs.substring(3)).toString(16);let os="";for(let ls=0;ls<6-ss.length;ls++)os+="0";return as[ns]=`${os}${ss}`,as},{});function nameToHex(as){const rs=as.toLowerCase().trim(),ns=compressedColorMap[hash$2(rs)];if(!ns)throw new ColorError$1(as);return`#${ns}`}const r$2=(as,rs)=>Array.from(Array(rs)).map(()=>as).join(""),reducedHexRegex=new RegExp(`^#${r$2("([a-f0-9])",3)}([a-f0-9])?$`,"i"),hexRegex=new RegExp(`^#${r$2("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),rgbaRegex=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${r$2(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),hslaRegex=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,namedColorRegex=/^[a-z]+$/i,roundColor=as=>Math.round(as*255),hslToRgb=(as,rs,ns)=>{let ss=ns/100;if(rs===0)return[ss,ss,ss].map(roundColor);const os=(as%360+360)%360/60,ls=(1-Math.abs(2*ss-1))*(rs/100),us=ls*(1-Math.abs(os%2-1));let cs=0,ds=0,ps=0;os>=0&&os<1?(cs=ls,ds=us):os>=1&&os<2?(cs=us,ds=ls):os>=2&&os<3?(ds=ls,ps=us):os>=3&&os<4?(ds=us,ps=ls):os>=4&&os<5?(cs=us,ps=ls):os>=5&&os<6&&(cs=ls,ps=us);const fs=ss-ls/2,hs=cs+fs,gs=ds+fs,ys=ps+fs;return[hs,gs,ys].map(roundColor)};function rgba$1(as,rs,ns,ss){return`rgba(${guard(0,255,as).toFixed()}, ${guard(0,255,rs).toFixed()}, ${guard(0,255,ns).toFixed()}, ${parseFloat(guard(0,1,ss).toFixed(3))})`}function transparentize$1(as,rs){const[ns,ss,os,ls]=parseToRgba(as);return rgba$1(ns,ss,os,ls-rs)}function toHex(as){const[rs,ns,ss,os]=parseToRgba(as);let ls=us=>{const cs=guard(0,255,us).toString(16);return cs.length===1?`0${cs}`:cs};return`#${ls(rs)}${ls(ns)}${ls(ss)}${os<1?ls(Math.round(os*255)):""}`}function dlv_es_default(as,rs,ns,ss,os){for(rs=rs.split?rs.split("."):rs,ss=0;ssObject.keys(as).length===0,getColor=(as,rs,ns)=>{const ss=dlv_es_default(as,`colors.${rs}`,rs);try{return toHex(ss),ss}catch{return ns??"#000000"}},getBrightness=as=>{const[rs,ns,ss]=parseToRgba(as);return(rs*299+ns*587+ss*114)/1e3},tone=as=>rs=>{const ns=getColor(rs,as);return getBrightness(ns)<128?"dark":"light"},isDark=as=>rs=>tone(as)(rs)==="dark",transparentize=(as,rs)=>ns=>{const ss=getColor(ns,as);return transparentize$1(ss,1-rs)};function generateStripe(as="1rem",rs="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( + `});function getErrorMessage(as,rs){return`${as} returned \`undefined\`. Seems you forgot to wrap component within ${rs}`}function createContext$1(as={}){const{name:rs,strict:ns=!0,hookName:ss="useContext",providerName:os="Provider",errorMessage:ls,defaultValue:us}=as,cs=reactExports.createContext(us);cs.displayName=rs;function ds(){var ps;const fs=reactExports.useContext(cs);if(!fs&&ns){const hs=new Error(ls??getErrorMessage(ss,os));throw hs.name="ContextError",(ps=Error.captureStackTrace)==null||ps.call(Error,hs,ds),hs}return fs}return[cs.Provider,ds,cs]}var[PortalManagerContextProvider,usePortalManager]=createContext$1({strict:!1,name:"PortalManagerContext"});function PortalManager(as){const{children:rs,zIndex:ns}=as;return jsx$1(PortalManagerContextProvider,{value:{zIndex:ns},children:rs})}PortalManager.displayName="PortalManager";var useSafeLayoutEffect$1=globalThis!=null&&globalThis.document?reactExports.useLayoutEffect:reactExports.useEffect,[PortalContextProvider,usePortalContext]=createContext$1({strict:!1,name:"PortalContext"}),PORTAL_CLASSNAME="chakra-portal",PORTAL_SELECTOR=".chakra-portal",Container=as=>jsx$1("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:as.zIndex,top:0,left:0,right:0},children:as.children}),DefaultPortal=as=>{const{appendToParentPortal:rs,children:ns}=as,[ss,os]=reactExports.useState(null),ls=reactExports.useRef(null),[,us]=reactExports.useState({});reactExports.useEffect(()=>us({}),[]);const cs=usePortalContext(),ds=usePortalManager();useSafeLayoutEffect$1(()=>{if(!ss)return;const fs=ss.ownerDocument,hs=rs?cs??fs.body:fs.body;if(!hs)return;ls.current=fs.createElement("div"),ls.current.className=PORTAL_CLASSNAME,hs.appendChild(ls.current),us({});const gs=ls.current;return()=>{hs.contains(gs)&&hs.removeChild(gs)}},[ss]);const ps=ds!=null&&ds.zIndex?jsx$1(Container,{zIndex:ds==null?void 0:ds.zIndex,children:ns}):ns;return ls.current?reactDomExports.createPortal(jsx$1(PortalContextProvider,{value:ls.current,children:ps}),ls.current):jsx$1("span",{ref:fs=>{fs&&os(fs)}})},ContainerPortal=as=>{const{children:rs,containerRef:ns,appendToParentPortal:ss}=as,os=ns.current,ls=os??(typeof window<"u"?document.body:void 0),us=reactExports.useMemo(()=>{const ds=os==null?void 0:os.ownerDocument.createElement("div");return ds&&(ds.className=PORTAL_CLASSNAME),ds},[os]),[,cs]=reactExports.useState({});return useSafeLayoutEffect$1(()=>cs({}),[]),useSafeLayoutEffect$1(()=>{if(!(!us||!ls))return ls.appendChild(us),()=>{ls.removeChild(us)}},[us,ls]),ls&&us?reactDomExports.createPortal(jsx$1(PortalContextProvider,{value:ss?us:null,children:rs}),us):null};function Portal(as){const rs={appendToParentPortal:!0,...as},{containerRef:ns,...ss}=rs;return ns?jsx$1(ContainerPortal,{containerRef:ns,...ss}):jsx$1(DefaultPortal,{...ss})}Portal.className=PORTAL_CLASSNAME;Portal.selector=PORTAL_SELECTOR;Portal.displayName="Portal";function useTheme(){const as=reactExports.useContext(ThemeContext);if(!as)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return as}var ColorModeContext=reactExports.createContext({});ColorModeContext.displayName="ColorModeContext";function useColorMode(){const as=reactExports.useContext(ColorModeContext);if(as===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return as}var classNames={light:"chakra-ui-light",dark:"chakra-ui-dark"};function getColorModeUtils(as={}){const{preventTransition:rs=!0}=as,ns={setDataset:ss=>{const os=rs?ns.preventTransition():void 0;document.documentElement.dataset.theme=ss,document.documentElement.style.colorScheme=ss,os==null||os()},setClassName(ss){document.body.classList.add(ss?classNames.dark:classNames.light),document.body.classList.remove(ss?classNames.light:classNames.dark)},query(){return window.matchMedia("(prefers-color-scheme: dark)")},getSystemTheme(ss){var os;return((os=ns.query().matches)!=null?os:ss==="dark")?"dark":"light"},addListener(ss){const os=ns.query(),ls=us=>{ss(us.matches?"dark":"light")};return typeof os.addListener=="function"?os.addListener(ls):os.addEventListener("change",ls),()=>{typeof os.removeListener=="function"?os.removeListener(ls):os.removeEventListener("change",ls)}},preventTransition(){const ss=document.createElement("style");return ss.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(ss),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.head.removeChild(ss)})})}}};return ns}var STORAGE_KEY="chakra-ui-color-mode";function createLocalStorageManager(as){return{ssr:!1,type:"localStorage",get(rs){if(!(globalThis!=null&&globalThis.document))return rs;let ns;try{ns=localStorage.getItem(as)||rs}catch{}return ns||rs},set(rs){try{localStorage.setItem(as,rs)}catch{}}}}var localStorageManager=createLocalStorageManager(STORAGE_KEY),noop$2=()=>{};function getTheme(as,rs){return as.type==="cookie"&&as.ssr?as.get(rs):rs}function ColorModeProvider(as){const{value:rs,children:ns,options:{useSystemColorMode:ss,initialColorMode:os,disableTransitionOnChange:ls}={},colorModeManager:us=localStorageManager}=as,cs=os==="dark"?"dark":"light",[ds,ps]=reactExports.useState(()=>getTheme(us,cs)),[fs,hs]=reactExports.useState(()=>getTheme(us)),{getSystemTheme:gs,setClassName:ys,setDataset:bs,addListener:vs}=reactExports.useMemo(()=>getColorModeUtils({preventTransition:ls}),[ls]),xs=os==="system"&&!ds?fs:ds,Cs=reactExports.useCallback(Ns=>{const As=Ns==="system"?gs():Ns;ps(As),ys(As==="dark"),bs(As),us.set(As)},[us,gs,ys,bs]);useSafeLayoutEffect$1(()=>{os==="system"&&hs(gs())},[]),reactExports.useEffect(()=>{const Ns=us.get();if(Ns){Cs(Ns);return}if(os==="system"){Cs("system");return}Cs(cs)},[us,cs,os,Cs]);const Ts=reactExports.useCallback(()=>{Cs(xs==="dark"?"light":"dark")},[xs,Cs]);reactExports.useEffect(()=>{if(ss)return vs(Cs)},[ss,vs,Cs]);const Ss=reactExports.useMemo(()=>({colorMode:rs??xs,toggleColorMode:rs?noop$2:Ts,setColorMode:rs?noop$2:Cs,forced:rs!==void 0}),[xs,Ts,Cs,rs]);return jsx$1(ColorModeContext.Provider,{value:Ss,children:ns})}ColorModeProvider.displayName="ColorModeProvider";function useChakra(){const as=useColorMode(),rs=useTheme();return{...as,theme:rs}}var cx=(...as)=>as.filter(Boolean).join(" ");function isObject$6(as){const rs=typeof as;return as!=null&&(rs==="object"||rs==="function")&&!Array.isArray(as)}function runIfFn$2(as,...rs){return isFunction$5(as)?as(...rs):as}var isFunction$5=as=>typeof as=="function",dataAttr=as=>as?"":void 0,ariaAttr=as=>as?!0:void 0;function callAllHandlers(...as){return function(ns){as.some(ss=>(ss==null||ss(ns),ns==null?void 0:ns.defaultPrevented))}}function callAll(...as){return function(ns){as.forEach(ss=>{ss==null||ss(ns)})}}var lodash_mergewithExports={},lodash_mergewith={get exports(){return lodash_mergewithExports},set exports(as){lodash_mergewithExports=as}};(function(as,rs){var ns=200,ss="__lodash_hash_undefined__",os=800,ls=16,us=9007199254740991,cs="[object Arguments]",ds="[object Array]",ps="[object AsyncFunction]",fs="[object Boolean]",hs="[object Date]",gs="[object Error]",ys="[object Function]",bs="[object GeneratorFunction]",vs="[object Map]",xs="[object Number]",Cs="[object Null]",Ts="[object Object]",Ss="[object Proxy]",Ns="[object RegExp]",As="[object Set]",ws="[object String]",Es="[object Undefined]",_s="[object WeakMap]",$s="[object ArrayBuffer]",Rs="[object DataView]",Ds="[object Float32Array]",Os="[object Float64Array]",Is="[object Int8Array]",Vs="[object Int16Array]",ks="[object Int32Array]",Ps="[object Uint8Array]",Bs="[object Uint8ClampedArray]",Ms="[object Uint16Array]",Ws="[object Uint32Array]",Us=/[\\^$.*+?()[\]{}|]/g,js=/^\[object .+?Constructor\]$/,Ls=/^(?:0|[1-9]\d*)$/,Gs={};Gs[Ds]=Gs[Os]=Gs[Is]=Gs[Vs]=Gs[ks]=Gs[Ps]=Gs[Bs]=Gs[Ms]=Gs[Ws]=!0,Gs[cs]=Gs[ds]=Gs[$s]=Gs[fs]=Gs[Rs]=Gs[hs]=Gs[gs]=Gs[ys]=Gs[vs]=Gs[xs]=Gs[Ts]=Gs[Ns]=Gs[As]=Gs[ws]=Gs[_s]=!1;var Hs=typeof commonjsGlobal$1=="object"&&commonjsGlobal$1&&commonjsGlobal$1.Object===Object&&commonjsGlobal$1,Ys=typeof self=="object"&&self&&self.Object===Object&&self,Zs=Hs||Ys||Function("return this")(),Nl=rs&&!rs.nodeType&&rs,yl=Nl&&!0&&as&&!as.nodeType&&as,Dl=yl&&yl.exports===Nl,Rl=Dl&&Hs.process,Ml=function(){try{var Fl=yl&&yl.require&&yl.require("util").types;return Fl||Rl&&Rl.binding&&Rl.binding("util")}catch{}}(),Ks=Ml&&Ml.isTypedArray;function qs(Fl,Gl,Jl){switch(Jl.length){case 0:return Fl.call(Gl);case 1:return Fl.call(Gl,Jl[0]);case 2:return Fl.call(Gl,Jl[0],Jl[1]);case 3:return Fl.call(Gl,Jl[0],Jl[1],Jl[2])}return Fl.apply(Gl,Jl)}function Qs(Fl,Gl){for(var Jl=-1,au=Array(Fl);++Jl-1}function Tu(Fl,Gl){var Jl=this.__data__,au=Wu(Jl,Fl);return au<0?(++this.size,Jl.push([Fl,Gl])):Jl[au][1]=Gl,this}hu.prototype.clear=Cu,hu.prototype.delete=Su,hu.prototype.get=Nu,hu.prototype.has=gu,hu.prototype.set=Tu;function Au(Fl){var Gl=-1,Jl=Fl==null?0:Fl.length;for(this.clear();++Gl1?Jl[pu-1]:void 0,vu=pu>2?Jl[2]:void 0;for(yu=Fl.length>3&&typeof yu=="function"?(pu--,yu):void 0,vu&&Qp(Jl[0],Jl[1],vu)&&(yu=pu<3?void 0:yu,pu=1),Gl=Object(Gl);++au-1&&Fl%1==0&&Fl0){if(++Gl>=os)return arguments[0]}else Gl=0;return Fl.apply(void 0,arguments)}}function om(Fl){if(Fl!=null){try{return Vl.call(Fl)}catch{}try{return Fl+""}catch{}}return""}function qu(Fl,Gl){return Fl===Gl||Fl!==Fl&&Gl!==Gl}var ip=vp(function(){return arguments}())?vp:function(Fl){return Bu(Fl)&&Fs.call(Fl,"callee")&&!Kl.call(Fl,"callee")},ap=Array.isArray;function sp(Fl){return Fl!=null&&Np(Fl.length)&&!op(Fl)}function lm(Fl){return Bu(Fl)&&sp(Fl)}var Sp=Zl||fm;function op(Fl){if(!Pu(Fl))return!1;var Gl=Gu(Fl);return Gl==ys||Gl==bs||Gl==ps||Gl==Ss}function Np(Fl){return typeof Fl=="number"&&Fl>-1&&Fl%1==0&&Fl<=us}function Pu(Fl){var Gl=typeof Fl;return Fl!=null&&(Gl=="object"||Gl=="function")}function Bu(Fl){return Fl!=null&&typeof Fl=="object"}function um(Fl){if(!Bu(Fl)||Gu(Fl)!=Ts)return!1;var Gl=Hl(Fl);if(Gl===null)return!0;var Jl=Fs.call(Gl,"constructor")&&Gl.constructor;return typeof Jl=="function"&&Jl instanceof Jl&&Vl.call(Jl)==zl}var Ap=Ks?Js(Ks):Fp;function cm(Fl){return qp(Fl,wp(Fl))}function wp(Fl){return sp(Fl)?Vp(Fl,!0):Lp(Fl)}var dm=Kp(function(Fl,Gl,Jl,au){xp(Fl,Gl,Jl,au)});function pm(Fl){return function(){return Fl}}function Ep(Fl){return Fl}function fm(){return!1}as.exports=dm})(lodash_mergewith,lodash_mergewithExports);const mergeWith=lodash_mergewithExports;var isImportant=as=>/!(important)?$/.test(as),withoutImportant=as=>typeof as=="string"?as.replace(/!(important)?$/,"").trim():as,tokenToCSSVar=(as,rs)=>ns=>{const ss=String(rs),os=isImportant(ss),ls=withoutImportant(ss),us=as?`${as}.${ls}`:ls;let cs=isObject$6(ns.__cssMap)&&us in ns.__cssMap?ns.__cssMap[us].varRef:rs;return cs=withoutImportant(cs),os?`${cs} !important`:cs};function createTransform(as){const{scale:rs,transform:ns,compose:ss}=as;return(ls,us)=>{var cs;const ds=tokenToCSSVar(rs,ls)(us);let ps=(cs=ns==null?void 0:ns(ds,us))!=null?cs:ds;return ss&&(ps=ss(ps,us)),ps}}var pipe$2=(...as)=>rs=>as.reduce((ns,ss)=>ss(ns),rs);function toConfig(as,rs){return ns=>{const ss={property:ns,scale:as};return ss.transform=createTransform({scale:as,transform:rs}),ss}}var getRtl=({rtl:as,ltr:rs})=>ns=>ns.direction==="rtl"?as:rs;function logical(as){const{property:rs,scale:ns,transform:ss}=as;return{scale:ns,property:getRtl(rs),transform:ns?createTransform({scale:ns,compose:ss}):ss}}var transformTemplate=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function getTransformTemplate(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...transformTemplate].join(" ")}function getTransformGpuTemplate(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...transformTemplate].join(" ")}var filterTemplate={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},backdropFilterTemplate={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function getRingTemplate(as){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":as,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var flexDirectionTemplate={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},directionMap={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},valueSet=new Set(Object.values(directionMap)),globalSet=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),trimSpace=as=>as.trim();function parseGradient(as,rs){if(as==null||globalSet.has(as))return as;const ss=/(^[a-z-A-Z]+)\((.*)\)/g.exec(as),os=ss==null?void 0:ss[1],ls=ss==null?void 0:ss[2];if(!os||!ls)return as;const us=os.includes("-gradient")?os:`${os}-gradient`,[cs,...ds]=ls.split(",").map(trimSpace).filter(Boolean);if((ds==null?void 0:ds.length)===0)return as;const ps=cs in directionMap?directionMap[cs]:cs;ds.unshift(ps);const fs=ds.map(hs=>{if(valueSet.has(hs))return hs;const gs=hs.indexOf(" "),[ys,bs]=gs!==-1?[hs.substr(0,gs),hs.substr(gs+1)]:[hs],vs=isCSSFunction(bs)?bs:bs&&bs.split(" "),xs=`colors.${ys}`,Cs=xs in rs.__cssMap?rs.__cssMap[xs].varRef:ys;return vs?[Cs,...Array.isArray(vs)?vs:[vs]].join(" "):Cs});return`${us}(${fs.join(", ")})`}var isCSSFunction=as=>typeof as=="string"&&as.includes("(")&&as.includes(")"),gradientTransform=(as,rs)=>parseGradient(as,rs??{});function isCssVar(as){return/^var\(--.+\)$/.test(as)}var analyzeCSSValue=as=>{const rs=parseFloat(as.toString()),ns=as.toString().replace(String(rs),"");return{unitless:!ns,value:rs,unit:ns}},wrap=as=>rs=>`${as}(${rs})`,transformFunctions={filter(as){return as!=="auto"?as:filterTemplate},backdropFilter(as){return as!=="auto"?as:backdropFilterTemplate},ring(as){return getRingTemplate(transformFunctions.px(as))},bgClip(as){return as==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:as}},transform(as){return as==="auto"?getTransformTemplate():as==="auto-gpu"?getTransformGpuTemplate():as},vh(as){return as==="$100vh"?"var(--chakra-vh)":as},px(as){if(as==null)return as;const{unitless:rs}=analyzeCSSValue(as);return rs||typeof as=="number"?`${as}px`:as},fraction(as){return typeof as!="number"||as>1?as:`${as*100}%`},float(as,rs){const ns={left:"right",right:"left"};return rs.direction==="rtl"?ns[as]:as},degree(as){if(isCssVar(as)||as==null)return as;const rs=typeof as=="string"&&!as.endsWith("deg");return typeof as=="number"||rs?`${as}deg`:as},gradient:gradientTransform,blur:wrap("blur"),opacity:wrap("opacity"),brightness:wrap("brightness"),contrast:wrap("contrast"),dropShadow:wrap("drop-shadow"),grayscale:wrap("grayscale"),hueRotate:wrap("hue-rotate"),invert:wrap("invert"),saturate:wrap("saturate"),sepia:wrap("sepia"),bgImage(as){return as==null||isCSSFunction(as)||globalSet.has(as)?as:`url(${as})`},outline(as){const rs=String(as)==="0"||String(as)==="none";return as!==null&&rs?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:as}},flexDirection(as){var rs;const{space:ns,divide:ss}=(rs=flexDirectionTemplate[as])!=null?rs:{},os={flexDirection:as};return ns&&(os[ns]=1),ss&&(os[ss]=1),os}},t$2={borderWidths:toConfig("borderWidths"),borderStyles:toConfig("borderStyles"),colors:toConfig("colors"),borders:toConfig("borders"),radii:toConfig("radii",transformFunctions.px),space:toConfig("space",pipe$2(transformFunctions.vh,transformFunctions.px)),spaceT:toConfig("space",pipe$2(transformFunctions.vh,transformFunctions.px)),degreeT(as){return{property:as,transform:transformFunctions.degree}},prop(as,rs,ns){return{property:as,scale:rs,...rs&&{transform:createTransform({scale:rs,transform:ns})}}},propT(as,rs){return{property:as,transform:rs}},sizes:toConfig("sizes",pipe$2(transformFunctions.vh,transformFunctions.px)),sizesT:toConfig("sizes",pipe$2(transformFunctions.vh,transformFunctions.fraction)),shadows:toConfig("shadows"),logical,blur:toConfig("blur",transformFunctions.blur)},background={background:t$2.colors("background"),backgroundColor:t$2.colors("backgroundColor"),backgroundImage:t$2.propT("backgroundImage",transformFunctions.bgImage),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:transformFunctions.bgClip},bgSize:t$2.prop("backgroundSize"),bgPosition:t$2.prop("backgroundPosition"),bg:t$2.colors("background"),bgColor:t$2.colors("backgroundColor"),bgPos:t$2.prop("backgroundPosition"),bgRepeat:t$2.prop("backgroundRepeat"),bgAttachment:t$2.prop("backgroundAttachment"),bgGradient:t$2.propT("backgroundImage",transformFunctions.gradient),bgClip:{transform:transformFunctions.bgClip}};Object.assign(background,{bgImage:background.backgroundImage,bgImg:background.backgroundImage});var border={border:t$2.borders("border"),borderWidth:t$2.borderWidths("borderWidth"),borderStyle:t$2.borderStyles("borderStyle"),borderColor:t$2.colors("borderColor"),borderRadius:t$2.radii("borderRadius"),borderTop:t$2.borders("borderTop"),borderBlockStart:t$2.borders("borderBlockStart"),borderTopLeftRadius:t$2.radii("borderTopLeftRadius"),borderStartStartRadius:t$2.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:t$2.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:t$2.radii("borderTopRightRadius"),borderStartEndRadius:t$2.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:t$2.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:t$2.borders("borderRight"),borderInlineEnd:t$2.borders("borderInlineEnd"),borderBottom:t$2.borders("borderBottom"),borderBlockEnd:t$2.borders("borderBlockEnd"),borderBottomLeftRadius:t$2.radii("borderBottomLeftRadius"),borderBottomRightRadius:t$2.radii("borderBottomRightRadius"),borderLeft:t$2.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:t$2.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:t$2.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:t$2.borders(["borderLeft","borderRight"]),borderInline:t$2.borders("borderInline"),borderY:t$2.borders(["borderTop","borderBottom"]),borderBlock:t$2.borders("borderBlock"),borderTopWidth:t$2.borderWidths("borderTopWidth"),borderBlockStartWidth:t$2.borderWidths("borderBlockStartWidth"),borderTopColor:t$2.colors("borderTopColor"),borderBlockStartColor:t$2.colors("borderBlockStartColor"),borderTopStyle:t$2.borderStyles("borderTopStyle"),borderBlockStartStyle:t$2.borderStyles("borderBlockStartStyle"),borderBottomWidth:t$2.borderWidths("borderBottomWidth"),borderBlockEndWidth:t$2.borderWidths("borderBlockEndWidth"),borderBottomColor:t$2.colors("borderBottomColor"),borderBlockEndColor:t$2.colors("borderBlockEndColor"),borderBottomStyle:t$2.borderStyles("borderBottomStyle"),borderBlockEndStyle:t$2.borderStyles("borderBlockEndStyle"),borderLeftWidth:t$2.borderWidths("borderLeftWidth"),borderInlineStartWidth:t$2.borderWidths("borderInlineStartWidth"),borderLeftColor:t$2.colors("borderLeftColor"),borderInlineStartColor:t$2.colors("borderInlineStartColor"),borderLeftStyle:t$2.borderStyles("borderLeftStyle"),borderInlineStartStyle:t$2.borderStyles("borderInlineStartStyle"),borderRightWidth:t$2.borderWidths("borderRightWidth"),borderInlineEndWidth:t$2.borderWidths("borderInlineEndWidth"),borderRightColor:t$2.colors("borderRightColor"),borderInlineEndColor:t$2.colors("borderInlineEndColor"),borderRightStyle:t$2.borderStyles("borderRightStyle"),borderInlineEndStyle:t$2.borderStyles("borderInlineEndStyle"),borderTopRadius:t$2.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:t$2.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:t$2.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:t$2.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(border,{rounded:border.borderRadius,roundedTop:border.borderTopRadius,roundedTopLeft:border.borderTopLeftRadius,roundedTopRight:border.borderTopRightRadius,roundedTopStart:border.borderStartStartRadius,roundedTopEnd:border.borderStartEndRadius,roundedBottom:border.borderBottomRadius,roundedBottomLeft:border.borderBottomLeftRadius,roundedBottomRight:border.borderBottomRightRadius,roundedBottomStart:border.borderEndStartRadius,roundedBottomEnd:border.borderEndEndRadius,roundedLeft:border.borderLeftRadius,roundedRight:border.borderRightRadius,roundedStart:border.borderInlineStartRadius,roundedEnd:border.borderInlineEndRadius,borderStart:border.borderInlineStart,borderEnd:border.borderInlineEnd,borderTopStartRadius:border.borderStartStartRadius,borderTopEndRadius:border.borderStartEndRadius,borderBottomStartRadius:border.borderEndStartRadius,borderBottomEndRadius:border.borderEndEndRadius,borderStartRadius:border.borderInlineStartRadius,borderEndRadius:border.borderInlineEndRadius,borderStartWidth:border.borderInlineStartWidth,borderEndWidth:border.borderInlineEndWidth,borderStartColor:border.borderInlineStartColor,borderEndColor:border.borderInlineEndColor,borderStartStyle:border.borderInlineStartStyle,borderEndStyle:border.borderInlineEndStyle});var color$1={color:t$2.colors("color"),textColor:t$2.colors("color"),fill:t$2.colors("fill"),stroke:t$2.colors("stroke")},effect$3={boxShadow:t$2.shadows("boxShadow"),mixBlendMode:!0,blendMode:t$2.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:t$2.prop("backgroundBlendMode"),opacity:!0};Object.assign(effect$3,{shadow:effect$3.boxShadow});var filter$2={filter:{transform:transformFunctions.filter},blur:t$2.blur("--chakra-blur"),brightness:t$2.propT("--chakra-brightness",transformFunctions.brightness),contrast:t$2.propT("--chakra-contrast",transformFunctions.contrast),hueRotate:t$2.degreeT("--chakra-hue-rotate"),invert:t$2.propT("--chakra-invert",transformFunctions.invert),saturate:t$2.propT("--chakra-saturate",transformFunctions.saturate),dropShadow:t$2.propT("--chakra-drop-shadow",transformFunctions.dropShadow),backdropFilter:{transform:transformFunctions.backdropFilter},backdropBlur:t$2.blur("--chakra-backdrop-blur"),backdropBrightness:t$2.propT("--chakra-backdrop-brightness",transformFunctions.brightness),backdropContrast:t$2.propT("--chakra-backdrop-contrast",transformFunctions.contrast),backdropHueRotate:t$2.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:t$2.propT("--chakra-backdrop-invert",transformFunctions.invert),backdropSaturate:t$2.propT("--chakra-backdrop-saturate",transformFunctions.saturate)},flexbox={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:transformFunctions.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:t$2.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:t$2.space("gap"),rowGap:t$2.space("rowGap"),columnGap:t$2.space("columnGap")};Object.assign(flexbox,{flexDir:flexbox.flexDirection});var grid={gridGap:t$2.space("gridGap"),gridColumnGap:t$2.space("gridColumnGap"),gridRowGap:t$2.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0},interactivity={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:transformFunctions.outline},outlineOffset:!0,outlineColor:t$2.colors("outlineColor")},layout$1={width:t$2.sizesT("width"),inlineSize:t$2.sizesT("inlineSize"),height:t$2.sizes("height"),blockSize:t$2.sizes("blockSize"),boxSize:t$2.sizes(["width","height"]),minWidth:t$2.sizes("minWidth"),minInlineSize:t$2.sizes("minInlineSize"),minHeight:t$2.sizes("minHeight"),minBlockSize:t$2.sizes("minBlockSize"),maxWidth:t$2.sizes("maxWidth"),maxInlineSize:t$2.sizes("maxInlineSize"),maxHeight:t$2.sizes("maxHeight"),maxBlockSize:t$2.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,hideFrom:{scale:"breakpoints",transform:(as,rs)=>{var ns,ss,os;return{[(os=(ss=(ns=rs.__breakpoints)==null?void 0:ns.get(as))==null?void 0:ss.minWQuery)!=null?os:`@media screen and (min-width: ${as})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(as,rs)=>{var ns,ss,os;return{[(os=(ss=(ns=rs.__breakpoints)==null?void 0:ns.get(as))==null?void 0:ss.maxWQuery)!=null?os:`@media screen and (max-width: ${as})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:t$2.propT("float",transformFunctions.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(layout$1,{w:layout$1.width,h:layout$1.height,minW:layout$1.minWidth,maxW:layout$1.maxWidth,minH:layout$1.minHeight,maxH:layout$1.maxHeight,overscroll:layout$1.overscrollBehavior,overscrollX:layout$1.overscrollBehaviorX,overscrollY:layout$1.overscrollBehaviorY});var list={listStyleType:!0,listStylePosition:!0,listStylePos:t$2.prop("listStylePosition"),listStyleImage:!0,listStyleImg:t$2.prop("listStyleImage")};function get$1(as,rs,ns,ss){const os=typeof rs=="string"?rs.split("."):[rs];for(ss=0;ss{const rs=new WeakMap;return(ss,os,ls,us)=>{if(typeof ss>"u")return as(ss,os,ls);rs.has(ss)||rs.set(ss,new Map);const cs=rs.get(ss);if(cs.has(os))return cs.get(os);const ds=as(ss,os,ls,us);return cs.set(os,ds),ds}},memoizedGet$1=memoize$1(get$1),srOnly={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},srFocusable={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},getWithPriority=(as,rs,ns)=>{const ss={},os=memoizedGet$1(as,rs,{});for(const ls in os)ls in ns&&ns[ls]!=null||(ss[ls]=os[ls]);return ss},others={srOnly:{transform(as){return as===!0?srOnly:as==="focusable"?srFocusable:{}}},layerStyle:{processResult:!0,transform:(as,rs,ns)=>getWithPriority(rs,`layerStyles.${as}`,ns)},textStyle:{processResult:!0,transform:(as,rs,ns)=>getWithPriority(rs,`textStyles.${as}`,ns)},apply:{processResult:!0,transform:(as,rs,ns)=>getWithPriority(rs,as,ns)}},position={position:!0,pos:t$2.prop("position"),zIndex:t$2.prop("zIndex","zIndices"),inset:t$2.spaceT("inset"),insetX:t$2.spaceT(["left","right"]),insetInline:t$2.spaceT("insetInline"),insetY:t$2.spaceT(["top","bottom"]),insetBlock:t$2.spaceT("insetBlock"),top:t$2.spaceT("top"),insetBlockStart:t$2.spaceT("insetBlockStart"),bottom:t$2.spaceT("bottom"),insetBlockEnd:t$2.spaceT("insetBlockEnd"),left:t$2.spaceT("left"),insetInlineStart:t$2.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:t$2.spaceT("right"),insetInlineEnd:t$2.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(position,{insetStart:position.insetInlineStart,insetEnd:position.insetInlineEnd});var ring={ring:{transform:transformFunctions.ring},ringColor:t$2.colors("--chakra-ring-color"),ringOffset:t$2.prop("--chakra-ring-offset-width"),ringOffsetColor:t$2.colors("--chakra-ring-offset-color"),ringInset:t$2.prop("--chakra-ring-inset")},space={margin:t$2.spaceT("margin"),marginTop:t$2.spaceT("marginTop"),marginBlockStart:t$2.spaceT("marginBlockStart"),marginRight:t$2.spaceT("marginRight"),marginInlineEnd:t$2.spaceT("marginInlineEnd"),marginBottom:t$2.spaceT("marginBottom"),marginBlockEnd:t$2.spaceT("marginBlockEnd"),marginLeft:t$2.spaceT("marginLeft"),marginInlineStart:t$2.spaceT("marginInlineStart"),marginX:t$2.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:t$2.spaceT("marginInline"),marginY:t$2.spaceT(["marginTop","marginBottom"]),marginBlock:t$2.spaceT("marginBlock"),padding:t$2.space("padding"),paddingTop:t$2.space("paddingTop"),paddingBlockStart:t$2.space("paddingBlockStart"),paddingRight:t$2.space("paddingRight"),paddingBottom:t$2.space("paddingBottom"),paddingBlockEnd:t$2.space("paddingBlockEnd"),paddingLeft:t$2.space("paddingLeft"),paddingInlineStart:t$2.space("paddingInlineStart"),paddingInlineEnd:t$2.space("paddingInlineEnd"),paddingX:t$2.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:t$2.space("paddingInline"),paddingY:t$2.space(["paddingTop","paddingBottom"]),paddingBlock:t$2.space("paddingBlock")};Object.assign(space,{m:space.margin,mt:space.marginTop,mr:space.marginRight,me:space.marginInlineEnd,marginEnd:space.marginInlineEnd,mb:space.marginBottom,ml:space.marginLeft,ms:space.marginInlineStart,marginStart:space.marginInlineStart,mx:space.marginX,my:space.marginY,p:space.padding,pt:space.paddingTop,py:space.paddingY,px:space.paddingX,pb:space.paddingBottom,pl:space.paddingLeft,ps:space.paddingInlineStart,paddingStart:space.paddingInlineStart,pr:space.paddingRight,pe:space.paddingInlineEnd,paddingEnd:space.paddingInlineEnd});var textDecoration={textDecorationColor:t$2.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:t$2.shadows("textShadow")},transform={clipPath:!0,transform:t$2.propT("transform",transformFunctions.transform),transformOrigin:!0,translateX:t$2.spaceT("--chakra-translate-x"),translateY:t$2.spaceT("--chakra-translate-y"),skewX:t$2.degreeT("--chakra-skew-x"),skewY:t$2.degreeT("--chakra-skew-y"),scaleX:t$2.prop("--chakra-scale-x"),scaleY:t$2.prop("--chakra-scale-y"),scale:t$2.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:t$2.degreeT("--chakra-rotate")},transition$2={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:t$2.prop("transitionDuration","transition.duration"),transitionProperty:t$2.prop("transitionProperty","transition.property"),transitionTimingFunction:t$2.prop("transitionTimingFunction","transition.easing")},typography$1={fontFamily:t$2.prop("fontFamily","fonts"),fontSize:t$2.prop("fontSize","fontSizes",transformFunctions.px),fontWeight:t$2.prop("fontWeight","fontWeights"),lineHeight:t$2.prop("lineHeight","lineHeights"),letterSpacing:t$2.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(as){if(as===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},scroll={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:t$2.spaceT("scrollMargin"),scrollMarginTop:t$2.spaceT("scrollMarginTop"),scrollMarginBottom:t$2.spaceT("scrollMarginBottom"),scrollMarginLeft:t$2.spaceT("scrollMarginLeft"),scrollMarginRight:t$2.spaceT("scrollMarginRight"),scrollMarginX:t$2.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:t$2.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:t$2.spaceT("scrollPadding"),scrollPaddingTop:t$2.spaceT("scrollPaddingTop"),scrollPaddingBottom:t$2.spaceT("scrollPaddingBottom"),scrollPaddingLeft:t$2.spaceT("scrollPaddingLeft"),scrollPaddingRight:t$2.spaceT("scrollPaddingRight"),scrollPaddingX:t$2.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:t$2.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function resolveReference(as){return isObject$6(as)&&as.reference?as.reference:String(as)}var toExpression=(as,...rs)=>rs.map(resolveReference).join(` ${as} `).replace(/calc/g,""),add$2=(...as)=>`calc(${toExpression("+",...as)})`,subtract$1=(...as)=>`calc(${toExpression("-",...as)})`,multiply$1=(...as)=>`calc(${toExpression("*",...as)})`,divide$1=(...as)=>`calc(${toExpression("/",...as)})`,negate$1=as=>{const rs=resolveReference(as);return rs!=null&&!Number.isNaN(parseFloat(rs))?String(rs).startsWith("-")?String(rs).slice(1):`-${rs}`:multiply$1(rs,-1)},calc$1=Object.assign(as=>({add:(...rs)=>calc$1(add$2(as,...rs)),subtract:(...rs)=>calc$1(subtract$1(as,...rs)),multiply:(...rs)=>calc$1(multiply$1(as,...rs)),divide:(...rs)=>calc$1(divide$1(as,...rs)),negate:()=>calc$1(negate$1(as)),toString:()=>as.toString()}),{add:add$2,subtract:subtract$1,multiply:multiply$1,divide:divide$1,negate:negate$1});function replaceWhiteSpace$1(as,rs="-"){return as.replace(/\s+/g,rs)}function escape$2(as){const rs=replaceWhiteSpace$1(as.toString());return escapeSymbol(escapeDot(rs))}function escapeDot(as){return as.includes("\\.")?as:!Number.isInteger(parseFloat(as.toString()))?as.replace(".","\\."):as}function escapeSymbol(as){return as.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function addPrefix$1(as,rs=""){return[rs,as].filter(Boolean).join("-")}function toVarReference(as,rs){return`var(${as}${rs?`, ${rs}`:""})`}function toVarDefinition(as,rs=""){return escape$2(`--${addPrefix$1(as,rs)}`)}function cssVar$1(as,rs,ns){const ss=toVarDefinition(as,ns);return{variable:ss,reference:toVarReference(ss,rs)}}function getLastItem(as){const rs=as==null?0:as.length;return rs?as[rs-1]:void 0}function analyzeCSSValue2(as){const rs=parseFloat(as.toString()),ns=as.toString().replace(String(rs),"");return{unitless:!ns,value:rs,unit:ns}}function px$2(as){if(as==null)return as;const{unitless:rs}=analyzeCSSValue2(as);return rs||typeof as=="number"?`${as}px`:as}var sortByBreakpointValue=(as,rs)=>parseInt(as[1],10)>parseInt(rs[1],10)?1:-1,sortBps=as=>Object.fromEntries(Object.entries(as).sort(sortByBreakpointValue));function normalize(as){const rs=sortBps(as);return Object.assign(Object.values(rs),rs)}function keys$2(as){const rs=Object.keys(sortBps(as));return new Set(rs)}function subtract2(as){var rs;if(!as)return as;as=(rs=px$2(as))!=null?rs:as;const ns=-.02;return typeof as=="number"?`${as+ns}`:as.replace(/(\d+\.?\d*)/u,ss=>`${parseFloat(ss)+ns}`)}function toMediaQueryString(as,rs){const ns=["@media screen"];return as&&ns.push("and",`(min-width: ${px$2(as)})`),rs&&ns.push("and",`(max-width: ${px$2(rs)})`),ns.join(" ")}function analyzeBreakpoints(as){var rs;if(!as)return null;as.base=(rs=as.base)!=null?rs:"0px";const ns=normalize(as),ss=Object.entries(as).sort(sortByBreakpointValue).map(([us,cs],ds,ps)=>{var fs;let[,hs]=(fs=ps[ds+1])!=null?fs:[];return hs=parseFloat(hs)>0?subtract2(hs):void 0,{_minW:subtract2(cs),breakpoint:us,minW:cs,maxW:hs,maxWQuery:toMediaQueryString(null,hs),minWQuery:toMediaQueryString(cs),minMaxQuery:toMediaQueryString(cs,hs)}}),os=keys$2(as),ls=Array.from(os.values());return{keys:os,normalized:ns,isResponsive(us){const cs=Object.keys(us);return cs.length>0&&cs.every(ds=>os.has(ds))},asObject:sortBps(as),asArray:normalize(as),details:ss,get(us){return ss.find(cs=>cs.breakpoint===us)},media:[null,...ns.map(us=>toMediaQueryString(us)).slice(1)],toArrayValue(us){if(!isObject$6(us))throw new Error("toArrayValue: value must be an object");const cs=ls.map(ds=>{var ps;return(ps=us[ds])!=null?ps:null});for(;getLastItem(cs)===null;)cs.pop();return cs},toObjectValue(us){if(!Array.isArray(us))throw new Error("toObjectValue: value must be an array");return us.reduce((cs,ds,ps)=>{const fs=ls[ps];return fs!=null&&ds!=null&&(cs[fs]=ds),cs},{})}}}var state={hover:(as,rs)=>`${as}:hover ${rs}, ${as}[data-hover] ${rs}`,focus:(as,rs)=>`${as}:focus ${rs}, ${as}[data-focus] ${rs}`,focusVisible:(as,rs)=>`${as}:focus-visible ${rs}`,focusWithin:(as,rs)=>`${as}:focus-within ${rs}`,active:(as,rs)=>`${as}:active ${rs}, ${as}[data-active] ${rs}`,disabled:(as,rs)=>`${as}:disabled ${rs}, ${as}[data-disabled] ${rs}`,invalid:(as,rs)=>`${as}:invalid ${rs}, ${as}[data-invalid] ${rs}`,checked:(as,rs)=>`${as}:checked ${rs}, ${as}[data-checked] ${rs}`,indeterminate:(as,rs)=>`${as}:indeterminate ${rs}, ${as}[aria-checked=mixed] ${rs}, ${as}[data-indeterminate] ${rs}`,readOnly:(as,rs)=>`${as}:read-only ${rs}, ${as}[readonly] ${rs}, ${as}[data-read-only] ${rs}`,expanded:(as,rs)=>`${as}:read-only ${rs}, ${as}[aria-expanded=true] ${rs}, ${as}[data-expanded] ${rs}`,placeholderShown:(as,rs)=>`${as}:placeholder-shown ${rs}`},toGroup=as=>merge$2(rs=>as(rs,"&"),"[role=group]","[data-group]",".group"),toPeer=as=>merge$2(rs=>as(rs,"~ &"),"[data-peer]",".peer"),merge$2=(as,...rs)=>rs.map(as).join(", "),pseudoSelectors={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty",_expanded:"&[aria-expanded=true], &[data-expanded]",_checked:"&[aria-checked=true], &[data-checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate]",_groupHover:toGroup(state.hover),_peerHover:toPeer(state.hover),_groupFocus:toGroup(state.focus),_peerFocus:toPeer(state.focus),_groupFocusVisible:toGroup(state.focusVisible),_peerFocusVisible:toPeer(state.focusVisible),_groupActive:toGroup(state.active),_peerActive:toPeer(state.active),_groupDisabled:toGroup(state.disabled),_peerDisabled:toPeer(state.disabled),_groupInvalid:toGroup(state.invalid),_peerInvalid:toPeer(state.invalid),_groupChecked:toGroup(state.checked),_peerChecked:toPeer(state.checked),_groupFocusWithin:toGroup(state.focusWithin),_peerFocusWithin:toPeer(state.focusWithin),_peerPlaceholderShown:toPeer(state.placeholderShown),_placeholder:"&::placeholder",_placeholderShown:"&:placeholder-shown",_fullScreen:"&:fullscreen",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]"},pseudoPropNames=Object.keys(pseudoSelectors);function tokenToCssVar(as,rs){return cssVar$1(String(as).replace(/\./g,"-"),void 0,rs)}function createThemeVars(as,rs){let ns={};const ss={};for(const[os,ls]of Object.entries(as)){const{isSemantic:us,value:cs}=ls,{variable:ds,reference:ps}=tokenToCssVar(os,rs==null?void 0:rs.cssVarPrefix);if(!us){if(os.startsWith("space")){const gs=os.split("."),[ys,...bs]=gs,vs=`${ys}.-${bs.join(".")}`,xs=calc$1.negate(cs),Cs=calc$1.negate(ps);ss[vs]={value:xs,var:ds,varRef:Cs}}ns[ds]=cs,ss[os]={value:cs,var:ds,varRef:ps};continue}const fs=gs=>{const bs=[String(os).split(".")[0],gs].join(".");if(!as[bs])return gs;const{reference:xs}=tokenToCssVar(bs,rs==null?void 0:rs.cssVarPrefix);return xs},hs=isObject$6(cs)?cs:{default:cs};ns=mergeWith(ns,Object.entries(hs).reduce((gs,[ys,bs])=>{var vs,xs;const Cs=fs(bs);if(ys==="default")return gs[ds]=Cs,gs;const Ts=(xs=(vs=pseudoSelectors)==null?void 0:vs[ys])!=null?xs:ys;return gs[Ts]={[ds]:Cs},gs},{})),ss[os]={value:ps,var:ds,varRef:ps}}return{cssVars:ns,cssMap:ss}}function omit$4(as,rs=[]){const ns=Object.assign({},as);for(const ss of rs)ss in ns&&delete ns[ss];return ns}function pick$2(as,rs){const ns={};for(const ss of rs)ss in as&&(ns[ss]=as[ss]);return ns}var tokens=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function extractTokens(as){return pick$2(as,tokens)}function extractSemanticTokens(as){return as.semanticTokens}function omitVars(as){const{__cssMap:rs,__cssVars:ns,__breakpoints:ss,...os}=as;return os}function flattenTokens({tokens:as,semanticTokens:rs}){var ns,ss;const os=Object.entries((ns=flatten$2(as))!=null?ns:{}).map(([us,cs])=>[us,{isSemantic:!1,value:cs}]),ls=Object.entries((ss=flatten$2(rs,1))!=null?ss:{}).map(([us,cs])=>[us,{isSemantic:!0,value:cs}]);return Object.fromEntries([...os,...ls])}function flatten$2(as,rs=1/0){return!isObject$6(as)&&!Array.isArray(as)||!rs?as:Object.entries(as).reduce((ns,[ss,os])=>(isObject$6(os)||Array.isArray(os)?Object.entries(flatten$2(os,rs-1)).forEach(([ls,us])=>{ns[`${ss}.${ls}`]=us}):ns[ss]=os,ns),{})}function toCSSVar(as){var rs;const ns=omitVars(as),ss=extractTokens(ns),os=extractSemanticTokens(ns),ls=flattenTokens({tokens:ss,semanticTokens:os}),us=(rs=ns.config)==null?void 0:rs.cssVarPrefix,{cssMap:cs,cssVars:ds}=createThemeVars(ls,{cssVarPrefix:us});return Object.assign(ns,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...ds},__cssMap:cs,__breakpoints:analyzeBreakpoints(ns.breakpoints)}),ns}var systemProps=mergeWith({},background,border,color$1,flexbox,layout$1,filter$2,ring,interactivity,grid,others,position,effect$3,space,scroll,typography$1,textDecoration,transform,list,transition$2);Object.assign({},space,layout$1,flexbox,grid,position);var propNames=[...Object.keys(systemProps),...pseudoPropNames],styleProps={...systemProps,...pseudoSelectors},isStyleProp=as=>as in styleProps,expandResponsive=as=>rs=>{if(!rs.__breakpoints)return as;const{isResponsive:ns,toArrayValue:ss,media:os}=rs.__breakpoints,ls={};for(const us in as){let cs=runIfFn$2(as[us],rs);if(cs==null)continue;if(cs=isObject$6(cs)&&ns(cs)?ss(cs):cs,!Array.isArray(cs)){ls[us]=cs;continue}const ds=cs.slice(0,os.length).length;for(let ps=0;psas.startsWith("--")&&typeof rs=="string"&&!isCssVar2(rs),resolveTokenValue=(as,rs)=>{var ns,ss;if(rs==null)return rs;const os=ds=>{var ps,fs;return(fs=(ps=as.__cssMap)==null?void 0:ps[ds])==null?void 0:fs.varRef},ls=ds=>{var ps;return(ps=os(ds))!=null?ps:ds},[us,cs]=splitByComma(rs);return rs=(ss=(ns=os(us))!=null?ns:ls(cs))!=null?ss:ls(rs),rs};function getCss(as){const{configs:rs={},pseudos:ns={},theme:ss}=as,os=(ls,us=!1)=>{var cs,ds,ps;const fs=runIfFn$2(ls,ss),hs=expandResponsive(fs)(ss);let gs={};for(let ys in hs){const bs=hs[ys];let vs=runIfFn$2(bs,ss);ys in ns&&(ys=ns[ys]),isCSSVariableTokenValue(ys,vs)&&(vs=resolveTokenValue(ss,vs));let xs=rs[ys];if(xs===!0&&(xs={property:ys}),isObject$6(vs)){gs[ys]=(cs=gs[ys])!=null?cs:{},gs[ys]=mergeWith({},gs[ys],os(vs,!0));continue}let Cs=(ps=(ds=xs==null?void 0:xs.transform)==null?void 0:ds.call(xs,vs,ss,fs))!=null?ps:vs;Cs=xs!=null&&xs.processResult?os(Cs,!0):Cs;const Ts=runIfFn$2(xs==null?void 0:xs.property,ss);if(!us&&(xs!=null&&xs.static)){const Ss=runIfFn$2(xs.static,ss);gs=mergeWith({},gs,Ss)}if(Ts&&Array.isArray(Ts)){for(const Ss of Ts)gs[Ss]=Cs;continue}if(Ts){Ts==="&"&&isObject$6(Cs)?gs=mergeWith({},gs,Cs):gs[Ts]=Cs;continue}if(isObject$6(Cs)){gs=mergeWith({},gs,Cs);continue}gs[ys]=Cs}return gs};return os}var css=as=>rs=>getCss({theme:rs,pseudos:pseudoSelectors,configs:systemProps})(as);function defineStyle(as){return as}function defineStyleConfig(as){return as}function createMultiStyleConfigHelpers(as){return{definePartsStyle(rs){return rs},defineMultiStyleConfig(rs){return{parts:as,...rs}}}}function normalize2(as,rs){if(Array.isArray(as))return as;if(isObject$6(as))return rs(as);if(as!=null)return[as]}function getNextIndex$1(as,rs){for(let ns=rs+1;ns{mergeWith(ps,{[Ss]:gs?Ts[Ss]:{[Cs]:Ts[Ss]}})});continue}if(!ys){gs?mergeWith(ps,Ts):ps[Cs]=Ts;continue}ps[Cs]=Ts}}return ps}}function resolveStyleConfig(as){return rs=>{var ns;const{variant:ss,size:os,theme:ls}=rs,us=createResolver(ls);return mergeWith({},runIfFn$2((ns=as.baseStyle)!=null?ns:{},rs),us(as,"sizes",os,rs),us(as,"variants",ss,rs))}}function getCSSVar(as,rs,ns){var ss,os,ls;return(ls=(os=(ss=as.__cssMap)==null?void 0:ss[`${rs}.${ns}`])==null?void 0:os.varRef)!=null?ls:ns}function omitThemingProps(as){return omit$4(as,["styleConfig","size","variant","colorScheme"])}var requiredChakraThemeKeys=["borders","breakpoints","colors","components","config","direction","fonts","fontSizes","fontWeights","letterSpacings","lineHeights","radii","shadows","sizes","space","styles","transition","zIndices"];function isChakraTheme(as){return isObject$6(as)?requiredChakraThemeKeys.every(rs=>Object.prototype.hasOwnProperty.call(as,rs)):!1}var zIndices={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},z_index_default=zIndices,breakpoints$1={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},breakpoints_default=breakpoints$1,colors={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},colors_default=colors,radii={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},radius_default=radii,shadows={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},shadows_default=shadows,transitionProperty={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},transitionTimingFunction={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},transitionDuration={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},transition$1={property:transitionProperty,easing:transitionTimingFunction,duration:transitionDuration},transition_default=transition$1,blur={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},blur_default=blur,borders$1={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},borders_default=borders$1,typography={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},typography_default=typography,spacing={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},largeSizes={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},container={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},sizes$m={...spacing,...largeSizes,container},sizes_default=sizes$m,foundations={breakpoints:breakpoints_default,zIndices:z_index_default,radii:radius_default,blur:blur_default,colors:colors_default,...typography_default,sizes:sizes_default,shadows:shadows_default,space:spacing,borders:borders_default,transition:transition_default};function anatomy(as,rs={}){let ns=!1;function ss(){if(!ns){ns=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function os(...fs){ss();for(const hs of fs)rs[hs]=ds(hs);return anatomy(as,rs)}function ls(...fs){for(const hs of fs)hs in rs||(rs[hs]=ds(hs));return anatomy(as,rs)}function us(){return Object.fromEntries(Object.entries(rs).map(([hs,gs])=>[hs,gs.selector]))}function cs(){return Object.fromEntries(Object.entries(rs).map(([hs,gs])=>[hs,gs.className]))}function ds(fs){const ys=`chakra-${(["container","root"].includes(fs??"")?[as]:[as,fs]).filter(Boolean).join("__")}`;return{className:ys,selector:`.${ys}`,toString:()=>fs}}return{parts:os,toPart:ds,extend:ls,selectors:us,classnames:cs,get keys(){return Object.keys(rs)},__type:{}}}var accordionAnatomy=anatomy("accordion").parts("root","container","button","panel").extend("icon"),alertAnatomy=anatomy("alert").parts("title","description","container").extend("icon","spinner"),avatarAnatomy=anatomy("avatar").parts("label","badge","container").extend("excessLabel","group"),breadcrumbAnatomy=anatomy("breadcrumb").parts("link","item","container").extend("separator");anatomy("button").parts();var checkboxAnatomy=anatomy("checkbox").parts("control","icon","container").extend("label");anatomy("progress").parts("track","filledTrack").extend("label");var drawerAnatomy=anatomy("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),editableAnatomy=anatomy("editable").parts("preview","input","textarea"),formAnatomy=anatomy("form").parts("container","requiredIndicator","helperText"),formErrorAnatomy=anatomy("formError").parts("text","icon"),inputAnatomy=anatomy("input").parts("addon","field","element"),listAnatomy=anatomy("list").parts("container","item","icon"),menuAnatomy=anatomy("menu").parts("button","list","item").extend("groupTitle","command","divider"),modalAnatomy=anatomy("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),numberInputAnatomy=anatomy("numberinput").parts("root","field","stepperGroup","stepper");anatomy("pininput").parts("field");var popoverAnatomy=anatomy("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),progressAnatomy=anatomy("progress").parts("label","filledTrack","track"),radioAnatomy=anatomy("radio").parts("container","control","label"),selectAnatomy=anatomy("select").parts("field","icon"),sliderAnatomy=anatomy("slider").parts("container","track","thumb","filledTrack","mark"),statAnatomy=anatomy("stat").parts("container","label","helpText","number","icon"),switchAnatomy=anatomy("switch").parts("container","track","thumb"),tableAnatomy=anatomy("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),tabsAnatomy=anatomy("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),tagAnatomy=anatomy("tag").parts("container","label","closeButton"),cardAnatomy=anatomy("card").parts("container","header","body","footer");function guard(as,rs,ns){return Math.min(Math.max(as,ns),rs)}class ColorError extends Error{constructor(rs){super(`Failed to parse color: "${rs}"`)}}var ColorError$1=ColorError;function parseToRgba(as){if(typeof as!="string")throw new ColorError$1(as);if(as.trim().toLowerCase()==="transparent")return[0,0,0,0];let rs=as.trim();rs=namedColorRegex.test(as)?nameToHex(as):as;const ns=reducedHexRegex.exec(rs);if(ns){const us=Array.from(ns).slice(1);return[...us.slice(0,3).map(cs=>parseInt(r$2(cs,2),16)),parseInt(r$2(us[3]||"f",2),16)/255]}const ss=hexRegex.exec(rs);if(ss){const us=Array.from(ss).slice(1);return[...us.slice(0,3).map(cs=>parseInt(cs,16)),parseInt(us[3]||"ff",16)/255]}const os=rgbaRegex.exec(rs);if(os){const us=Array.from(os).slice(1);return[...us.slice(0,3).map(cs=>parseInt(cs,10)),parseFloat(us[3]||"1")]}const ls=hslaRegex.exec(rs);if(ls){const[us,cs,ds,ps]=Array.from(ls).slice(1).map(parseFloat);if(guard(0,100,cs)!==cs)throw new ColorError$1(as);if(guard(0,100,ds)!==ds)throw new ColorError$1(as);return[...hslToRgb(us,cs,ds),Number.isNaN(ps)?1:ps]}throw new ColorError$1(as)}function hash$2(as){let rs=5381,ns=as.length;for(;ns;)rs=rs*33^as.charCodeAt(--ns);return(rs>>>0)%2341}const colorToInt=as=>parseInt(as.replace(/_/g,""),36),compressedColorMap="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((as,rs)=>{const ns=colorToInt(rs.substring(0,3)),ss=colorToInt(rs.substring(3)).toString(16);let os="";for(let ls=0;ls<6-ss.length;ls++)os+="0";return as[ns]=`${os}${ss}`,as},{});function nameToHex(as){const rs=as.toLowerCase().trim(),ns=compressedColorMap[hash$2(rs)];if(!ns)throw new ColorError$1(as);return`#${ns}`}const r$2=(as,rs)=>Array.from(Array(rs)).map(()=>as).join(""),reducedHexRegex=new RegExp(`^#${r$2("([a-f0-9])",3)}([a-f0-9])?$`,"i"),hexRegex=new RegExp(`^#${r$2("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),rgbaRegex=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${r$2(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),hslaRegex=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,namedColorRegex=/^[a-z]+$/i,roundColor=as=>Math.round(as*255),hslToRgb=(as,rs,ns)=>{let ss=ns/100;if(rs===0)return[ss,ss,ss].map(roundColor);const os=(as%360+360)%360/60,ls=(1-Math.abs(2*ss-1))*(rs/100),us=ls*(1-Math.abs(os%2-1));let cs=0,ds=0,ps=0;os>=0&&os<1?(cs=ls,ds=us):os>=1&&os<2?(cs=us,ds=ls):os>=2&&os<3?(ds=ls,ps=us):os>=3&&os<4?(ds=us,ps=ls):os>=4&&os<5?(cs=us,ps=ls):os>=5&&os<6&&(cs=ls,ps=us);const fs=ss-ls/2,hs=cs+fs,gs=ds+fs,ys=ps+fs;return[hs,gs,ys].map(roundColor)};function rgba$1(as,rs,ns,ss){return`rgba(${guard(0,255,as).toFixed()}, ${guard(0,255,rs).toFixed()}, ${guard(0,255,ns).toFixed()}, ${parseFloat(guard(0,1,ss).toFixed(3))})`}function transparentize$1(as,rs){const[ns,ss,os,ls]=parseToRgba(as);return rgba$1(ns,ss,os,ls-rs)}function toHex(as){const[rs,ns,ss,os]=parseToRgba(as);let ls=us=>{const cs=guard(0,255,us).toString(16);return cs.length===1?`0${cs}`:cs};return`#${ls(rs)}${ls(ns)}${ls(ss)}${os<1?ls(Math.round(os*255)):""}`}function dlv_es_default(as,rs,ns,ss,os){for(rs=rs.split?rs.split("."):rs,ss=0;ssObject.keys(as).length===0,getColor=(as,rs,ns)=>{const ss=dlv_es_default(as,`colors.${rs}`,rs);try{return toHex(ss),ss}catch{return ns??"#000000"}},getBrightness=as=>{const[rs,ns,ss]=parseToRgba(as);return(rs*299+ns*587+ss*114)/1e3},tone=as=>rs=>{const ns=getColor(rs,as);return getBrightness(ns)<128?"dark":"light"},isDark=as=>rs=>tone(as)(rs)==="dark",transparentize=(as,rs)=>ns=>{const ss=getColor(ns,as);return transparentize$1(ss,1-rs)};function generateStripe(as="1rem",rs="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( 45deg, ${rs} 25%, transparent 25%, @@ -1870,7 +1879,7 @@ let ns=poly_div(as,[rs]),ss=0,os=ns[0].length;for(var ls=0;ls({bg:mode("gray.100","whiteAlpha.300")(as)}),baseStyleFilledTrack$1=as=>({transitionProperty:"common",transitionDuration:"slow",...filledStyle(as)}),baseStyle$x=definePartsStyle$j(as=>({label:baseStyleLabel$2,filledTrack:baseStyleFilledTrack$1(as),track:baseStyleTrack$1(as)})),sizes$f={xs:definePartsStyle$j({track:{h:"1"}}),sm:definePartsStyle$j({track:{h:"2"}}),md:definePartsStyle$j({track:{h:"3"}}),lg:definePartsStyle$j({track:{h:"4"}})},progressTheme=defineMultiStyleConfig$j({sizes:sizes$f,baseStyle:baseStyle$x,defaultProps:{size:"md",colorScheme:"blue"}}),isFunction$4=as=>typeof as=="function";function runIfFn$1(as,...rs){return isFunction$4(as)?as(...rs):as}var{definePartsStyle:definePartsStyle$i,defineMultiStyleConfig:defineMultiStyleConfig$i}=createMultiStyleConfigHelpers(checkboxAnatomy.keys),$size$2=cssVar$1("checkbox-size"),baseStyleControl$1=as=>{const{colorScheme:rs}=as;return{w:$size$2.reference,h:$size$2.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:mode(`${rs}.500`,`${rs}.200`)(as),borderColor:mode(`${rs}.500`,`${rs}.200`)(as),color:mode("white","gray.900")(as),_hover:{bg:mode(`${rs}.600`,`${rs}.300`)(as),borderColor:mode(`${rs}.600`,`${rs}.300`)(as)},_disabled:{borderColor:mode("gray.200","transparent")(as),bg:mode("gray.200","whiteAlpha.300")(as),color:mode("gray.500","whiteAlpha.500")(as)}},_indeterminate:{bg:mode(`${rs}.500`,`${rs}.200`)(as),borderColor:mode(`${rs}.500`,`${rs}.200`)(as),color:mode("white","gray.900")(as)},_disabled:{bg:mode("gray.100","whiteAlpha.100")(as),borderColor:mode("gray.100","transparent")(as)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:mode("red.500","red.300")(as)}}},baseStyleContainer$3={_disabled:{cursor:"not-allowed"}},baseStyleLabel$1={userSelect:"none",_disabled:{opacity:.4}},baseStyleIcon$5={transitionProperty:"transform",transitionDuration:"normal"},baseStyle$w=definePartsStyle$i(as=>({icon:baseStyleIcon$5,container:baseStyleContainer$3,control:runIfFn$1(baseStyleControl$1,as),label:baseStyleLabel$1})),sizes$e={sm:definePartsStyle$i({control:{[$size$2.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:definePartsStyle$i({control:{[$size$2.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:definePartsStyle$i({control:{[$size$2.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},checkboxTheme=defineMultiStyleConfig$i({baseStyle:baseStyle$w,sizes:sizes$e,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$h,definePartsStyle:definePartsStyle$h}=createMultiStyleConfigHelpers(radioAnatomy.keys),baseStyleControl=as=>{var rs;const ns=(rs=runIfFn$1(checkboxTheme.baseStyle,as))==null?void 0:rs.control;return{...ns,borderRadius:"full",_checked:{...ns==null?void 0:ns._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},baseStyle$v=definePartsStyle$h(as=>{var rs,ns,ss,os;return{label:(ns=(rs=checkboxTheme).baseStyle)==null?void 0:ns.call(rs,as).label,container:(os=(ss=checkboxTheme).baseStyle)==null?void 0:os.call(ss,as).container,control:baseStyleControl(as)}}),sizes$d={md:definePartsStyle$h({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:definePartsStyle$h({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:definePartsStyle$h({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},radioTheme=defineMultiStyleConfig$h({baseStyle:baseStyle$v,sizes:sizes$d,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$g,definePartsStyle:definePartsStyle$g}=createMultiStyleConfigHelpers(selectAnatomy.keys),$bg$b=cssVar$1("select-bg"),_a$3,baseStyleField$1={...(_a$3=inputTheme.baseStyle)==null?void 0:_a$3.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:$bg$b.reference,[$bg$b.variable]:"colors.white",_dark:{[$bg$b.variable]:"colors.gray.700"},"> option, > optgroup":{bg:$bg$b.reference}},baseStyleIcon$4={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},baseStyle$u=definePartsStyle$g({field:baseStyleField$1,icon:baseStyleIcon$4}),iconSpacing={paddingInlineEnd:"8"},_a2$1,_b$1,_c,_d,_e$1,_f,_g,_h,sizes$c={lg:{...(_a2$1=inputTheme.sizes)==null?void 0:_a2$1.lg,field:{...(_b$1=inputTheme.sizes)==null?void 0:_b$1.lg.field,...iconSpacing}},md:{...(_c=inputTheme.sizes)==null?void 0:_c.md,field:{...(_d=inputTheme.sizes)==null?void 0:_d.md.field,...iconSpacing}},sm:{...(_e$1=inputTheme.sizes)==null?void 0:_e$1.sm,field:{...(_f=inputTheme.sizes)==null?void 0:_f.sm.field,...iconSpacing}},xs:{...(_g=inputTheme.sizes)==null?void 0:_g.xs,field:{...(_h=inputTheme.sizes)==null?void 0:_h.xs.field,...iconSpacing},icon:{insetEnd:"1"}}},selectTheme=defineMultiStyleConfig$g({baseStyle:baseStyle$u,sizes:sizes$c,variants:inputTheme.variants,defaultProps:inputTheme.defaultProps}),$startColor=cssVar$1("skeleton-start-color"),$endColor=cssVar$1("skeleton-end-color"),baseStyle$t={[$startColor.variable]:"colors.gray.100",[$endColor.variable]:"colors.gray.400",_dark:{[$startColor.variable]:"colors.gray.800",[$endColor.variable]:"colors.gray.600"},background:$startColor.reference,borderColor:$endColor.reference,opacity:.7,borderRadius:"sm"},skeletonTheme={baseStyle:baseStyle$t},$bg$a=cssVar$1("skip-link-bg"),baseStyle$s={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[$bg$a.variable]:"colors.white",_dark:{[$bg$a.variable]:"colors.gray.700"},bg:$bg$a.reference}},skipLinkTheme={baseStyle:baseStyle$s},{defineMultiStyleConfig:defineMultiStyleConfig$f,definePartsStyle:definePartsStyle$f}=createMultiStyleConfigHelpers(sliderAnatomy.keys),$thumbSize=cssVar$1("slider-thumb-size"),$trackSize=cssVar$1("slider-track-size"),$bg$9=cssVar$1("slider-bg"),baseStyleContainer$2=as=>{const{orientation:rs}=as;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...orient({orientation:rs,vertical:{h:"100%"},horizontal:{w:"100%"}})}},baseStyleTrack=as=>({...orient({orientation:as.orientation,horizontal:{h:$trackSize.reference},vertical:{w:$trackSize.reference}}),overflow:"hidden",borderRadius:"sm",[$bg$9.variable]:"colors.gray.200",_dark:{[$bg$9.variable]:"colors.whiteAlpha.200"},_disabled:{[$bg$9.variable]:"colors.gray.300",_dark:{[$bg$9.variable]:"colors.whiteAlpha.300"}},bg:$bg$9.reference}),baseStyleThumb=as=>{const{orientation:rs}=as;return{...orient({orientation:rs,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:$thumbSize.reference,h:$thumbSize.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},baseStyleFilledTrack=as=>{const{colorScheme:rs}=as;return{width:"inherit",height:"inherit",[$bg$9.variable]:`colors.${rs}.500`,_dark:{[$bg$9.variable]:`colors.${rs}.200`},bg:$bg$9.reference}},baseStyle$r=definePartsStyle$f(as=>({container:baseStyleContainer$2(as),track:baseStyleTrack(as),thumb:baseStyleThumb(as),filledTrack:baseStyleFilledTrack(as)})),sizeLg=definePartsStyle$f({container:{[$thumbSize.variable]:"sizes.4",[$trackSize.variable]:"sizes.1"}}),sizeMd=definePartsStyle$f({container:{[$thumbSize.variable]:"sizes.3.5",[$trackSize.variable]:"sizes.1"}}),sizeSm=definePartsStyle$f({container:{[$thumbSize.variable]:"sizes.2.5",[$trackSize.variable]:"sizes.0.5"}}),sizes$b={lg:sizeLg,md:sizeMd,sm:sizeSm},sliderTheme=defineMultiStyleConfig$f({baseStyle:baseStyle$r,sizes:sizes$b,defaultProps:{size:"md",colorScheme:"blue"}}),$size$1=cssVar("spinner-size"),baseStyle$q={width:[$size$1.reference],height:[$size$1.reference]},sizes$a={xs:{[$size$1.variable]:"sizes.3"},sm:{[$size$1.variable]:"sizes.4"},md:{[$size$1.variable]:"sizes.6"},lg:{[$size$1.variable]:"sizes.8"},xl:{[$size$1.variable]:"sizes.12"}},spinnerTheme={baseStyle:baseStyle$q,sizes:sizes$a,defaultProps:{size:"md"}},{defineMultiStyleConfig:defineMultiStyleConfig$e,definePartsStyle:definePartsStyle$e}=createMultiStyleConfigHelpers(statAnatomy.keys),baseStyleLabel={fontWeight:"medium"},baseStyleHelpText={opacity:.8,marginBottom:"2"},baseStyleNumber={verticalAlign:"baseline",fontWeight:"semibold"},baseStyleIcon$3={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},baseStyle$p=definePartsStyle$e({container:{},label:baseStyleLabel,helpText:baseStyleHelpText,number:baseStyleNumber,icon:baseStyleIcon$3}),sizes$9={md:definePartsStyle$e({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},statTheme=defineMultiStyleConfig$e({baseStyle:baseStyle$p,sizes:sizes$9,defaultProps:{size:"md"}}),$bg$8=cssVar$1("kbd-bg"),baseStyle$o={[$bg$8.variable]:"colors.gray.100",_dark:{[$bg$8.variable]:"colors.whiteAlpha.100"},bg:$bg$8.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},kbdTheme={baseStyle:baseStyle$o},baseStyle$n={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},linkTheme={baseStyle:baseStyle$n},{defineMultiStyleConfig:defineMultiStyleConfig$d,definePartsStyle:definePartsStyle$d}=createMultiStyleConfigHelpers(listAnatomy.keys),baseStyleIcon$2={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},baseStyle$m=definePartsStyle$d({icon:baseStyleIcon$2}),listTheme=defineMultiStyleConfig$d({baseStyle:baseStyle$m}),{defineMultiStyleConfig:defineMultiStyleConfig$c,definePartsStyle:definePartsStyle$c}=createMultiStyleConfigHelpers(menuAnatomy.keys),$bg$7=cssVar$1("menu-bg"),$shadow$2=cssVar$1("menu-shadow"),baseStyleList={[$bg$7.variable]:"#fff",[$shadow$2.variable]:"shadows.sm",_dark:{[$bg$7.variable]:"colors.gray.700",[$shadow$2.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:$bg$7.reference,boxShadow:$shadow$2.reference},baseStyleItem={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[$bg$7.variable]:"colors.gray.100",_dark:{[$bg$7.variable]:"colors.whiteAlpha.100"}},_active:{[$bg$7.variable]:"colors.gray.200",_dark:{[$bg$7.variable]:"colors.whiteAlpha.200"}},_expanded:{[$bg$7.variable]:"colors.gray.100",_dark:{[$bg$7.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:$bg$7.reference},baseStyleGroupTitle={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},baseStyleCommand={opacity:.6},baseStyleDivider={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},baseStyleButton$1={transitionProperty:"common",transitionDuration:"normal"},baseStyle$l=definePartsStyle$c({button:baseStyleButton$1,list:baseStyleList,item:baseStyleItem,groupTitle:baseStyleGroupTitle,command:baseStyleCommand,divider:baseStyleDivider}),menuTheme=defineMultiStyleConfig$c({baseStyle:baseStyle$l}),{defineMultiStyleConfig:defineMultiStyleConfig$b,definePartsStyle:definePartsStyle$b}=createMultiStyleConfigHelpers(modalAnatomy.keys),$bg$6=cssVar$1("modal-bg"),$shadow$1=cssVar$1("modal-shadow"),baseStyleOverlay$1={bg:"blackAlpha.600",zIndex:"modal"},baseStyleDialogContainer$1=as=>{const{isCentered:rs,scrollBehavior:ns}=as;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:rs?"center":"flex-start",overflow:ns==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},baseStyleDialog$1=as=>{const{scrollBehavior:rs}=as;return{borderRadius:"md",color:"inherit",my:"16",zIndex:"modal",maxH:rs==="inside"?"calc(100% - 7.5rem)":void 0,[$bg$6.variable]:"colors.white",[$shadow$1.variable]:"shadows.lg",_dark:{[$bg$6.variable]:"colors.gray.700",[$shadow$1.variable]:"shadows.dark-lg"},bg:$bg$6.reference,boxShadow:$shadow$1.reference}},baseStyleHeader$2={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},baseStyleCloseButton$2={position:"absolute",top:"2",insetEnd:"3"},baseStyleBody$2=as=>{const{scrollBehavior:rs}=as;return{px:"6",py:"2",flex:"1",overflow:rs==="inside"?"auto":void 0}},baseStyleFooter$2={px:"6",py:"4"},baseStyle$k=definePartsStyle$b(as=>({overlay:baseStyleOverlay$1,dialogContainer:runIfFn$1(baseStyleDialogContainer$1,as),dialog:runIfFn$1(baseStyleDialog$1,as),header:baseStyleHeader$2,closeButton:baseStyleCloseButton$2,body:runIfFn$1(baseStyleBody$2,as),footer:baseStyleFooter$2}));function getSize$3(as){return definePartsStyle$b(as==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:as}})}var sizes$8={xs:getSize$3("xs"),sm:getSize$3("sm"),md:getSize$3("md"),lg:getSize$3("lg"),xl:getSize$3("xl"),"2xl":getSize$3("2xl"),"3xl":getSize$3("3xl"),"4xl":getSize$3("4xl"),"5xl":getSize$3("5xl"),"6xl":getSize$3("6xl"),full:getSize$3("full")},modalTheme=defineMultiStyleConfig$b({baseStyle:baseStyle$k,sizes:sizes$8,defaultProps:{size:"md"}}),{defineMultiStyleConfig:defineMultiStyleConfig$a,definePartsStyle:definePartsStyle$a}=createMultiStyleConfigHelpers(numberInputAnatomy.keys),$stepperWidth=cssVar("number-input-stepper-width"),$inputPadding=cssVar("number-input-input-padding"),inputPaddingValue=calc($stepperWidth).add("0.5rem").toString(),$bg$5=cssVar("number-input-bg"),$fg$3=cssVar("number-input-color"),$border$2=cssVar("number-input-border-color"),baseStyleRoot={[$stepperWidth.variable]:"sizes.6",[$inputPadding.variable]:inputPaddingValue},baseStyleField=as=>{var rs,ns;return(ns=(rs=runIfFn$1(inputTheme.baseStyle,as))==null?void 0:rs.field)!=null?ns:{}},baseStyleStepperGroup={width:$stepperWidth.reference},baseStyleStepper={borderStart:"1px solid",borderStartColor:$border$2.reference,color:$fg$3.reference,bg:$bg$5.reference,[$fg$3.variable]:"colors.chakra-body-text",[$border$2.variable]:"colors.chakra-border-color",_dark:{[$fg$3.variable]:"colors.whiteAlpha.800",[$border$2.variable]:"colors.whiteAlpha.300"},_active:{[$bg$5.variable]:"colors.gray.200",_dark:{[$bg$5.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},baseStyle$j=definePartsStyle$a(as=>{var rs;return{root:baseStyleRoot,field:(rs=runIfFn$1(baseStyleField,as))!=null?rs:{},stepperGroup:baseStyleStepperGroup,stepper:baseStyleStepper}});function getSize$2(as){var rs,ns,ss;const os=(rs=inputTheme.sizes)==null?void 0:rs[as],ls={lg:"md",md:"md",sm:"sm",xs:"sm"},us=(ss=(ns=os.field)==null?void 0:ns.fontSize)!=null?ss:"md",cs=typography_default.fontSizes[us];return definePartsStyle$a({field:{...os.field,paddingInlineEnd:$inputPadding.reference,verticalAlign:"top"},stepper:{fontSize:calc(cs).multiply(.75).toString(),_first:{borderTopEndRadius:ls[as]},_last:{borderBottomEndRadius:ls[as],mt:"-1px",borderTopWidth:1}}})}var sizes$7={xs:getSize$2("xs"),sm:getSize$2("sm"),md:getSize$2("md"),lg:getSize$2("lg")},numberInputTheme=defineMultiStyleConfig$a({baseStyle:baseStyle$j,sizes:sizes$7,variants:inputTheme.variants,defaultProps:inputTheme.defaultProps}),_a$2,baseStyle$i={...(_a$2=inputTheme.baseStyle)==null?void 0:_a$2.field,textAlign:"center"},sizes$6={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},_a2,_b,variants$5={outline:as=>{var rs,ns,ss;return(ss=(ns=runIfFn$1((rs=inputTheme.variants)==null?void 0:rs.outline,as))==null?void 0:ns.field)!=null?ss:{}},flushed:as=>{var rs,ns,ss;return(ss=(ns=runIfFn$1((rs=inputTheme.variants)==null?void 0:rs.flushed,as))==null?void 0:ns.field)!=null?ss:{}},filled:as=>{var rs,ns,ss;return(ss=(ns=runIfFn$1((rs=inputTheme.variants)==null?void 0:rs.filled,as))==null?void 0:ns.field)!=null?ss:{}},unstyled:(_b=(_a2=inputTheme.variants)==null?void 0:_a2.unstyled.field)!=null?_b:{}},pinInputTheme={baseStyle:baseStyle$i,sizes:sizes$6,variants:variants$5,defaultProps:inputTheme.defaultProps},{defineMultiStyleConfig:defineMultiStyleConfig$9,definePartsStyle:definePartsStyle$9}=createMultiStyleConfigHelpers(popoverAnatomy.keys),$popperBg=cssVar("popper-bg"),$arrowBg=cssVar("popper-arrow-bg"),$arrowShadowColor=cssVar("popper-arrow-shadow-color"),baseStylePopper={zIndex:10},baseStyleContent={[$popperBg.variable]:"colors.white",bg:$popperBg.reference,[$arrowBg.variable]:$popperBg.reference,[$arrowShadowColor.variable]:"colors.gray.200",_dark:{[$popperBg.variable]:"colors.gray.700",[$arrowShadowColor.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},baseStyleHeader$1={px:3,py:2,borderBottomWidth:"1px"},baseStyleBody$1={px:3,py:2},baseStyleFooter$1={px:3,py:2,borderTopWidth:"1px"},baseStyleCloseButton$1={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},baseStyle$h=definePartsStyle$9({popper:baseStylePopper,content:baseStyleContent,header:baseStyleHeader$1,body:baseStyleBody$1,footer:baseStyleFooter$1,closeButton:baseStyleCloseButton$1}),popoverTheme=defineMultiStyleConfig$9({baseStyle:baseStyle$h}),{definePartsStyle:definePartsStyle$8,defineMultiStyleConfig:defineMultiStyleConfig$8}=createMultiStyleConfigHelpers(drawerAnatomy.keys),$bg$4=cssVar$1("drawer-bg"),$bs=cssVar$1("drawer-box-shadow");function getSize$1(as){return definePartsStyle$8(as==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:as}})}var baseStyleOverlay={bg:"blackAlpha.600",zIndex:"overlay"},baseStyleDialogContainer={display:"flex",zIndex:"modal",justifyContent:"center"},baseStyleDialog=as=>{const{isFullHeight:rs}=as;return{...rs&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[$bg$4.variable]:"colors.white",[$bs.variable]:"shadows.lg",_dark:{[$bg$4.variable]:"colors.gray.700",[$bs.variable]:"shadows.dark-lg"},bg:$bg$4.reference,boxShadow:$bs.reference}},baseStyleHeader={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},baseStyleCloseButton={position:"absolute",top:"2",insetEnd:"3"},baseStyleBody={px:"6",py:"2",flex:"1",overflow:"auto"},baseStyleFooter={px:"6",py:"4"},baseStyle$g=definePartsStyle$8(as=>({overlay:baseStyleOverlay,dialogContainer:baseStyleDialogContainer,dialog:runIfFn$1(baseStyleDialog,as),header:baseStyleHeader,closeButton:baseStyleCloseButton,body:baseStyleBody,footer:baseStyleFooter})),sizes$5={xs:getSize$1("xs"),sm:getSize$1("md"),md:getSize$1("lg"),lg:getSize$1("2xl"),xl:getSize$1("4xl"),full:getSize$1("full")},drawerTheme=defineMultiStyleConfig$8({baseStyle:baseStyle$g,sizes:sizes$5,defaultProps:{size:"xs"}}),{definePartsStyle:definePartsStyle$7,defineMultiStyleConfig:defineMultiStyleConfig$7}=createMultiStyleConfigHelpers(editableAnatomy.keys),baseStylePreview={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},baseStyleInput={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},baseStyleTextarea={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},baseStyle$f=definePartsStyle$7({preview:baseStylePreview,input:baseStyleInput,textarea:baseStyleTextarea}),editableTheme=defineMultiStyleConfig$7({baseStyle:baseStyle$f}),{definePartsStyle:definePartsStyle$6,defineMultiStyleConfig:defineMultiStyleConfig$6}=createMultiStyleConfigHelpers(formAnatomy.keys),$fg$2=cssVar$1("form-control-color"),baseStyleRequiredIndicator={marginStart:"1",[$fg$2.variable]:"colors.red.500",_dark:{[$fg$2.variable]:"colors.red.300"},color:$fg$2.reference},baseStyleHelperText={mt:"2",[$fg$2.variable]:"colors.gray.600",_dark:{[$fg$2.variable]:"colors.whiteAlpha.600"},color:$fg$2.reference,lineHeight:"normal",fontSize:"sm"},baseStyle$e=definePartsStyle$6({container:{width:"100%",position:"relative"},requiredIndicator:baseStyleRequiredIndicator,helperText:baseStyleHelperText}),formTheme=defineMultiStyleConfig$6({baseStyle:baseStyle$e}),{definePartsStyle:definePartsStyle$5,defineMultiStyleConfig:defineMultiStyleConfig$5}=createMultiStyleConfigHelpers(formErrorAnatomy.keys),$fg$1=cssVar$1("form-error-color"),baseStyleText={[$fg$1.variable]:"colors.red.500",_dark:{[$fg$1.variable]:"colors.red.300"},color:$fg$1.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},baseStyleIcon$1={marginEnd:"0.5em",[$fg$1.variable]:"colors.red.500",_dark:{[$fg$1.variable]:"colors.red.300"},color:$fg$1.reference},baseStyle$d=definePartsStyle$5({text:baseStyleText,icon:baseStyleIcon$1}),formErrorTheme=defineMultiStyleConfig$5({baseStyle:baseStyle$d}),baseStyle$c={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},formLabelTheme={baseStyle:baseStyle$c},baseStyle$b={fontFamily:"heading",fontWeight:"bold"},sizes$4={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},headingTheme={baseStyle:baseStyle$b,sizes:sizes$4,defaultProps:{size:"xl"}},{defineMultiStyleConfig:defineMultiStyleConfig$4,definePartsStyle:definePartsStyle$4}=createMultiStyleConfigHelpers(breadcrumbAnatomy.keys),baseStyleLink={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},baseStyle$a=definePartsStyle$4({link:baseStyleLink}),breadcrumbTheme=defineMultiStyleConfig$4({baseStyle:baseStyle$a}),baseStyle$9={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},variantGhost=as=>{const{colorScheme:rs,theme:ns}=as;if(rs==="gray")return{color:mode("inherit","whiteAlpha.900")(as),_hover:{bg:mode("gray.100","whiteAlpha.200")(as)},_active:{bg:mode("gray.200","whiteAlpha.300")(as)}};const ss=transparentize(`${rs}.200`,.12)(ns),os=transparentize(`${rs}.200`,.24)(ns);return{color:mode(`${rs}.600`,`${rs}.200`)(as),bg:"transparent",_hover:{bg:mode(`${rs}.50`,ss)(as)},_active:{bg:mode(`${rs}.100`,os)(as)}}},variantOutline=as=>{const{colorScheme:rs}=as,ns=mode("gray.200","whiteAlpha.300")(as);return{border:"1px solid",borderColor:rs==="gray"?ns:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...runIfFn$1(variantGhost,as)}},accessibleColorMap={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},variantSolid$2=as=>{var rs;const{colorScheme:ns}=as;if(ns==="gray"){const ds=mode("gray.100","whiteAlpha.200")(as);return{bg:ds,_hover:{bg:mode("gray.200","whiteAlpha.300")(as),_disabled:{bg:ds}},_active:{bg:mode("gray.300","whiteAlpha.400")(as)}}}const{bg:ss=`${ns}.500`,color:os="white",hoverBg:ls=`${ns}.600`,activeBg:us=`${ns}.700`}=(rs=accessibleColorMap[ns])!=null?rs:{},cs=mode(ss,`${ns}.200`)(as);return{bg:cs,color:mode(os,"gray.800")(as),_hover:{bg:mode(ls,`${ns}.300`)(as),_disabled:{bg:cs}},_active:{bg:mode(us,`${ns}.400`)(as)}}},variantLink=as=>{const{colorScheme:rs}=as;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:mode(`${rs}.500`,`${rs}.200`)(as),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:mode(`${rs}.700`,`${rs}.500`)(as)}}},variantUnstyled={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},variants$4={ghost:variantGhost,outline:variantOutline,solid:variantSolid$2,link:variantLink,unstyled:variantUnstyled},sizes$3={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},buttonTheme={baseStyle:baseStyle$9,variants:variants$4,sizes:sizes$3,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:definePartsStyle$3,defineMultiStyleConfig:defineMultiStyleConfig$3}=createMultiStyleConfigHelpers(cardAnatomy.keys),$bg$3=cssVar$1("card-bg"),$padding=cssVar$1("card-padding"),$shadow=cssVar$1("card-shadow"),$radius=cssVar$1("card-radius"),$border$1=cssVar$1("card-border-width","0"),$borderColor=cssVar$1("card-border-color"),baseStyle$8=definePartsStyle$3({container:{[$bg$3.variable]:"colors.chakra-body-bg",backgroundColor:$bg$3.reference,boxShadow:$shadow.reference,borderRadius:$radius.reference,color:"chakra-body-text",borderWidth:$border$1.reference,borderColor:$borderColor.reference},body:{padding:$padding.reference,flex:"1 1 0%"},header:{padding:$padding.reference},footer:{padding:$padding.reference}}),sizes$2={sm:definePartsStyle$3({container:{[$radius.variable]:"radii.base",[$padding.variable]:"space.3"}}),md:definePartsStyle$3({container:{[$radius.variable]:"radii.md",[$padding.variable]:"space.5"}}),lg:definePartsStyle$3({container:{[$radius.variable]:"radii.xl",[$padding.variable]:"space.7"}})},variants$3={elevated:definePartsStyle$3({container:{[$shadow.variable]:"shadows.base",_dark:{[$bg$3.variable]:"colors.gray.700"}}}),outline:definePartsStyle$3({container:{[$border$1.variable]:"1px",[$borderColor.variable]:"colors.chakra-border-color"}}),filled:definePartsStyle$3({container:{[$bg$3.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[$padding.variable]:0},header:{[$padding.variable]:0},footer:{[$padding.variable]:0}}},cardTheme=defineMultiStyleConfig$3({baseStyle:baseStyle$8,variants:variants$3,sizes:sizes$2,defaultProps:{variant:"elevated",size:"md"}}),$size=cssVar("close-button-size"),$bg$2=cssVar("close-button-bg"),baseStyle$7={w:[$size.reference],h:[$size.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[$bg$2.variable]:"colors.blackAlpha.100",_dark:{[$bg$2.variable]:"colors.whiteAlpha.100"}},_active:{[$bg$2.variable]:"colors.blackAlpha.200",_dark:{[$bg$2.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:$bg$2.reference},sizes$1={lg:{[$size.variable]:"sizes.10",fontSize:"md"},md:{[$size.variable]:"sizes.8",fontSize:"xs"},sm:{[$size.variable]:"sizes.6",fontSize:"2xs"}},closeButtonTheme={baseStyle:baseStyle$7,sizes:sizes$1,defaultProps:{size:"md"}},{variants:variants$2,defaultProps:defaultProps$1}=badgeTheme,baseStyle$6={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},codeTheme={baseStyle:baseStyle$6,variants:variants$2,defaultProps:defaultProps$1},baseStyle$5={w:"100%",mx:"auto",maxW:"prose",px:"4"},containerTheme={baseStyle:baseStyle$5},baseStyle$4={opacity:.6,borderColor:"inherit"},variantSolid$1={borderStyle:"solid"},variantDashed={borderStyle:"dashed"},variants$1={solid:variantSolid$1,dashed:variantDashed},dividerTheme={baseStyle:baseStyle$4,variants:variants$1,defaultProps:{variant:"solid"}},{definePartsStyle:definePartsStyle$2,defineMultiStyleConfig:defineMultiStyleConfig$2}=createMultiStyleConfigHelpers(accordionAnatomy.keys),baseStyleContainer$1={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},baseStyleButton={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},baseStylePanel={pt:"2",px:"4",pb:"5"},baseStyleIcon={fontSize:"1.25em"},baseStyle$3=definePartsStyle$2({container:baseStyleContainer$1,button:baseStyleButton,panel:baseStylePanel,icon:baseStyleIcon}),accordionTheme=defineMultiStyleConfig$2({baseStyle:baseStyle$3}),{definePartsStyle:definePartsStyle$1,defineMultiStyleConfig:defineMultiStyleConfig$1}=createMultiStyleConfigHelpers(alertAnatomy.keys),$fg=cssVar$1("alert-fg"),$bg$1=cssVar$1("alert-bg"),baseStyle$2=definePartsStyle$1({container:{bg:$bg$1.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:$fg.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:$fg.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function getBg(as){const{theme:rs,colorScheme:ns}=as,ss=transparentize(`${ns}.200`,.16)(rs);return{light:`colors.${ns}.100`,dark:ss}}var variantSubtle=definePartsStyle$1(as=>{const{colorScheme:rs}=as,ns=getBg(as);return{container:{[$fg.variable]:`colors.${rs}.500`,[$bg$1.variable]:ns.light,_dark:{[$fg.variable]:`colors.${rs}.200`,[$bg$1.variable]:ns.dark}}}}),variantLeftAccent=definePartsStyle$1(as=>{const{colorScheme:rs}=as,ns=getBg(as);return{container:{[$fg.variable]:`colors.${rs}.500`,[$bg$1.variable]:ns.light,_dark:{[$fg.variable]:`colors.${rs}.200`,[$bg$1.variable]:ns.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:$fg.reference}}}),variantTopAccent=definePartsStyle$1(as=>{const{colorScheme:rs}=as,ns=getBg(as);return{container:{[$fg.variable]:`colors.${rs}.500`,[$bg$1.variable]:ns.light,_dark:{[$fg.variable]:`colors.${rs}.200`,[$bg$1.variable]:ns.dark},pt:"2",borderTopWidth:"4px",borderTopColor:$fg.reference}}}),variantSolid=definePartsStyle$1(as=>{const{colorScheme:rs}=as;return{container:{[$fg.variable]:"colors.white",[$bg$1.variable]:`colors.${rs}.500`,_dark:{[$fg.variable]:"colors.gray.900",[$bg$1.variable]:`colors.${rs}.200`},color:$fg.reference}}}),variants={subtle:variantSubtle,"left-accent":variantLeftAccent,"top-accent":variantTopAccent,solid:variantSolid},alertTheme=defineMultiStyleConfig$1({baseStyle:baseStyle$2,variants,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle,defineMultiStyleConfig}=createMultiStyleConfigHelpers(avatarAnatomy.keys),$border=cssVar$1("avatar-border-color"),$bg=cssVar$1("avatar-bg"),baseStyleBadge={borderRadius:"full",border:"0.2em solid",[$border.variable]:"white",_dark:{[$border.variable]:"colors.gray.800"},borderColor:$border.reference},baseStyleExcessLabel={[$bg.variable]:"colors.gray.200",_dark:{[$bg.variable]:"colors.whiteAlpha.400"},bgColor:$bg.reference},$avatarBg=cssVar$1("avatar-background"),baseStyleContainer=as=>{const{name:rs,theme:ns}=as,ss=rs?randomColor({string:rs}):"colors.gray.400",os=isDark(ss)(ns);let ls="white";return os||(ls="gray.800"),{bg:$avatarBg.reference,"&:not([data-loaded])":{[$avatarBg.variable]:ss},color:ls,[$border.variable]:"colors.white",_dark:{[$border.variable]:"colors.gray.800"},borderColor:$border.reference,verticalAlign:"top"}},baseStyle$1=definePartsStyle(as=>({badge:runIfFn$1(baseStyleBadge,as),excessLabel:runIfFn$1(baseStyleExcessLabel,as),container:runIfFn$1(baseStyleContainer,as)}));function getSize(as){const rs=as!=="100%"?sizes_default[as]:void 0;return definePartsStyle({container:{width:as,height:as,fontSize:`calc(${rs??as} / 2.5)`},excessLabel:{width:as,height:as},label:{fontSize:`calc(${rs??as} / 2.5)`,lineHeight:as!=="100%"?rs??as:void 0}})}var sizes={"2xs":getSize(4),xs:getSize(6),sm:getSize(8),md:getSize(12),lg:getSize(16),xl:getSize(24),"2xl":getSize(32),full:getSize("100%")},avatarTheme=defineMultiStyleConfig({baseStyle:baseStyle$1,sizes,defaultProps:{size:"md"}}),components={Accordion:accordionTheme,Alert:alertTheme,Avatar:avatarTheme,Badge:badgeTheme,Breadcrumb:breadcrumbTheme,Button:buttonTheme,Checkbox:checkboxTheme,CloseButton:closeButtonTheme,Code:codeTheme,Container:containerTheme,Divider:dividerTheme,Drawer:drawerTheme,Editable:editableTheme,Form:formTheme,FormError:formErrorTheme,FormLabel:formLabelTheme,Heading:headingTheme,Input:inputTheme,Kbd:kbdTheme,Link:linkTheme,List:listTheme,Menu:menuTheme,Modal:modalTheme,NumberInput:numberInputTheme,PinInput:pinInputTheme,Popover:popoverTheme,Progress:progressTheme,Radio:radioTheme,Select:selectTheme,Skeleton:skeletonTheme,SkipLink:skipLinkTheme,Slider:sliderTheme,Spinner:spinnerTheme,Stat:statTheme,Switch:switchTheme,Table:tableTheme,Tabs:tabsTheme,Tag:tagTheme,Textarea:textareaTheme,Tooltip:tooltipTheme,Card:cardTheme},semanticTokens={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},styles={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},direction="ltr",config={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},theme$1={semanticTokens,direction,...foundations,components,styles,config};function isFunction$3(as){return typeof as=="function"}function pipe$1(...as){return rs=>as.reduce((ns,ss)=>ss(ns),rs)}var createExtendTheme=as=>function(...ns){let ss=[...ns],os=ns[ns.length-1];return isChakraTheme(os)&&ss.length>1?ss=ss.slice(0,ss.length-1):os=as,pipe$1(...ss.map(ls=>us=>isFunction$3(ls)?ls(us):mergeThemeOverride(us,ls)))(os)},extendTheme=createExtendTheme(theme$1);function mergeThemeOverride(...as){return mergeWith({},...as,mergeThemeCustomizer)}function mergeThemeCustomizer(as,rs,ns,ss){if((isFunction$3(as)||isFunction$3(rs))&&Object.prototype.hasOwnProperty.call(ss,ns))return(...os)=>{const ls=isFunction$3(as)?as(...os):as,us=isFunction$3(rs)?rs(...os):rs;return mergeWith({},ls,us,mergeThemeCustomizer)}}function omit$3(as,rs){const ns={};return Object.keys(as).forEach(ss=>{rs.includes(ss)||(ns[ss]=as[ss])}),ns}function get$1(as,rs,ns,ss){const os=typeof rs=="string"?rs.split("."):[rs];for(ss=0;ss{const rs=new WeakMap;return(ss,os,ls,us)=>{if(typeof ss>"u")return as(ss,os,ls);rs.has(ss)||rs.set(ss,new Map);const cs=rs.get(ss);if(cs.has(os))return cs.get(os);const ds=as(ss,os,ls,us);return cs.set(os,ds),ds}},memoizedGet=memoize(get$1);function objectFilter(as,rs){const ns={};return Object.keys(as).forEach(ss=>{const os=as[ss];rs(os,ss,as)&&(ns[ss]=os)}),ns}var filterUndefined=as=>objectFilter(as,rs=>rs!=null);function isFunction$2(as){return typeof as=="function"}function runIfFn(as,...rs){return isFunction$2(as)?as(...rs):as}var hasElementType=typeof Element<"u",hasMap=typeof Map=="function",hasSet=typeof Set=="function",hasArrayBuffer=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function equal(as,rs){if(as===rs)return!0;if(as&&rs&&typeof as=="object"&&typeof rs=="object"){if(as.constructor!==rs.constructor)return!1;var ns,ss,os;if(Array.isArray(as)){if(ns=as.length,ns!=rs.length)return!1;for(ss=ns;ss--!==0;)if(!equal(as[ss],rs[ss]))return!1;return!0}var ls;if(hasMap&&as instanceof Map&&rs instanceof Map){if(as.size!==rs.size)return!1;for(ls=as.entries();!(ss=ls.next()).done;)if(!rs.has(ss.value[0]))return!1;for(ls=as.entries();!(ss=ls.next()).done;)if(!equal(ss.value[1],rs.get(ss.value[0])))return!1;return!0}if(hasSet&&as instanceof Set&&rs instanceof Set){if(as.size!==rs.size)return!1;for(ls=as.entries();!(ss=ls.next()).done;)if(!rs.has(ss.value[0]))return!1;return!0}if(hasArrayBuffer&&ArrayBuffer.isView(as)&&ArrayBuffer.isView(rs)){if(ns=as.length,ns!=rs.length)return!1;for(ss=ns;ss--!==0;)if(as[ss]!==rs[ss])return!1;return!0}if(as.constructor===RegExp)return as.source===rs.source&&as.flags===rs.flags;if(as.valueOf!==Object.prototype.valueOf)return as.valueOf()===rs.valueOf();if(as.toString!==Object.prototype.toString)return as.toString()===rs.toString();if(os=Object.keys(as),ns=os.length,ns!==Object.keys(rs).length)return!1;for(ss=ns;ss--!==0;)if(!Object.prototype.hasOwnProperty.call(rs,os[ss]))return!1;if(hasElementType&&as instanceof Element)return!1;for(ss=ns;ss--!==0;)if(!((os[ss]==="_owner"||os[ss]==="__v"||os[ss]==="__o")&&as.$$typeof)&&!equal(as[os[ss]],rs[os[ss]]))return!1;return!0}return as!==as&&rs!==rs}var reactFastCompare=function as(rs,ns){try{return equal(rs,ns)}catch(ss){if((ss.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw ss}};function useStyleConfigImpl(as,rs={}){var ns;const{styleConfig:ss,...os}=rs,{theme:ls,colorMode:us}=useChakra(),cs=as?memoizedGet(ls,`components.${as}`):void 0,ds=ss||cs,ps=mergeWith({theme:ls,colorMode:us},(ns=ds==null?void 0:ds.defaultProps)!=null?ns:{},filterUndefined(omit$3(os,["children"]))),fs=reactExports.useRef({});if(ds){const gs=resolveStyleConfig(ds)(ps);reactFastCompare(fs.current,gs)||(fs.current=gs)}return fs.current}function useStyleConfig(as,rs={}){return useStyleConfigImpl(as,rs)}function useMultiStyleConfig(as,rs={}){return useStyleConfigImpl(as,rs)}var allPropNames=new Set([...propNames,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),validHTMLProps=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function shouldForwardProp(as){return validHTMLProps.has(as)||!allPropNames.has(as)}function compact$1(as){const rs=Object.assign({},as);for(let ns in rs)rs[ns]===void 0&&delete rs[ns];return rs}function assignAfter(as,...rs){if(as==null)throw new TypeError("Cannot convert undefined or null to object");const ns={...as};for(const ss of rs)if(ss!=null)for(const os in ss)Object.prototype.hasOwnProperty.call(ss,os)&&(os in ns&&delete ns[os],ns[os]=ss[os]);return ns}var reactPropsRegex=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,isPropValid=memoize$2(function(as){return reactPropsRegex.test(as)||as.charCodeAt(0)===111&&as.charCodeAt(1)===110&&as.charCodeAt(2)<91}),testOmitPropsOnStringTag=isPropValid,testOmitPropsOnComponent=function as(rs){return rs!=="theme"},getDefaultShouldForwardProp=function as(rs){return typeof rs=="string"&&rs.charCodeAt(0)>96?testOmitPropsOnStringTag:testOmitPropsOnComponent},composeShouldForwardProps=function as(rs,ns,ss){var os;if(ns){var ls=ns.shouldForwardProp;os=rs.__emotion_forwardProp&&ls?function(us){return rs.__emotion_forwardProp(us)&&ls(us)}:ls}return typeof os!="function"&&ss&&(os=rs.__emotion_forwardProp),os},Insertion=function as(rs){var ns=rs.cache,ss=rs.serialized,os=rs.isStringTag;return registerStyles(ns,ss,os),useInsertionEffectAlwaysWithSyncFallback(function(){return insertStyles(ns,ss,os)}),null},createStyled=function as(rs,ns){var ss=rs.__emotion_real===rs,os=ss&&rs.__emotion_base||rs,ls,us;ns!==void 0&&(ls=ns.label,us=ns.target);var cs=composeShouldForwardProps(rs,ns,ss),ds=cs||getDefaultShouldForwardProp(os),ps=!ds("as");return function(){var fs=arguments,hs=ss&&rs.__emotion_styles!==void 0?rs.__emotion_styles.slice(0):[];if(ls!==void 0&&hs.push("label:"+ls+";"),fs[0]==null||fs[0].raw===void 0)hs.push.apply(hs,fs);else{hs.push(fs[0][0]);for(var gs=fs.length,ys=1;ysrs=>{const{theme:ns,css:ss,__css:os,sx:ls,...us}=rs,cs=objectFilter(us,(hs,gs)=>isStyleProp(gs)),ds=runIfFn(as,rs),ps=assignAfter({},os,ds,filterUndefined(cs),ls),fs=css(ps)(rs.theme);return ss?[fs,ss]:fs};function styled(as,rs){const{baseStyle:ns,...ss}=rs??{};ss.shouldForwardProp||(ss.shouldForwardProp=shouldForwardProp);const os=toCSSObject({baseStyle:ns}),ls=emotion_styled(as,ss)(os);return React.forwardRef(function(ds,ps){const{colorMode:fs,forced:hs}=useColorMode();return React.createElement(ls,{ref:ps,"data-theme":hs?fs:void 0,...ds})})}function factory(){const as=new Map;return new Proxy(styled,{apply(rs,ns,ss){return styled(...ss)},get(rs,ns){return as.has(ns)||as.set(ns,styled(ns)),as.get(ns)}})}var chakra=factory();function forwardRef(as){return reactExports.forwardRef(as)}function createContext(as={}){const{strict:rs=!0,errorMessage:ns="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:ss}=as,os=reactExports.createContext(void 0);os.displayName=ss;function ls(){var us;const cs=reactExports.useContext(os);if(!cs&&rs){const ds=new Error(ns);throw ds.name="ContextError",(us=Error.captureStackTrace)==null||us.call(Error,ds,ls),ds}return cs}return[os.Provider,ls,os]}function ThemeProvider(as){const{cssVarsRoot:rs,theme:ns,children:ss}=as,os=reactExports.useMemo(()=>toCSSVar(ns),[ns]);return jsxs(ThemeProvider$1,{theme:os,children:[jsx$1(CSSVars,{root:rs}),ss]})}function CSSVars({root:as=":host, :root"}){const rs=[as,"[data-theme]"].join(",");return jsx$1(Global,{styles:ns=>({[rs]:ns.__cssVars})})}createContext({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function GlobalStyle(){const{colorMode:as}=useColorMode();return jsx$1(Global,{styles:rs=>{const ns=memoizedGet(rs,"styles.global"),ss=runIfFn(ns,{theme:rs,colorMode:as});return ss?css(ss)(rs):void 0}})}var EnvironmentContext=reactExports.createContext({getDocument(){return document},getWindow(){return window}});EnvironmentContext.displayName="EnvironmentContext";function EnvironmentProvider(as){const{children:rs,environment:ns,disabled:ss}=as,os=reactExports.useRef(null),ls=reactExports.useMemo(()=>ns||{getDocument:()=>{var cs,ds;return(ds=(cs=os.current)==null?void 0:cs.ownerDocument)!=null?ds:document},getWindow:()=>{var cs,ds;return(ds=(cs=os.current)==null?void 0:cs.ownerDocument.defaultView)!=null?ds:window}},[ns]),us=!ss||!ns;return jsxs(EnvironmentContext.Provider,{value:ls,children:[rs,us&&jsx$1("span",{id:"__chakra_env",hidden:!0,ref:os})]})}EnvironmentProvider.displayName="EnvironmentProvider";var ChakraProvider$1=as=>{const{children:rs,colorModeManager:ns,portalZIndex:ss,resetScope:os,resetCSS:ls=!0,theme:us={},environment:cs,cssVarsRoot:ds,disableEnvironment:ps}=as,fs=jsx$1(EnvironmentProvider,{environment:cs,disabled:ps,children:rs});return jsx$1(ThemeProvider,{theme:us,cssVarsRoot:ds,children:jsxs(ColorModeProvider,{colorModeManager:ns,options:us.config,children:[ls?jsx$1(CSSReset,{scope:os}):jsx$1(CSSPolyfill,{}),jsx$1(GlobalStyle,{}),ss?jsx$1(PortalManager,{zIndex:ss,children:fs}):fs]})})},findById=(as,rs)=>as.find(ns=>ns.id===rs);function findToast(as,rs){const ns=getToastPosition(as,rs),ss=ns?as[ns].findIndex(os=>os.id===rs):-1;return{position:ns,index:ss}}function getToastPosition(as,rs){for(const[ns,ss]of Object.entries(as))if(findById(ss,rs))return ns}function getToastStyle(as){const rs=as.includes("right"),ns=as.includes("left");let ss="center";return rs&&(ss="flex-end"),ns&&(ss="flex-start"),{display:"flex",flexDirection:"column",alignItems:ss}}function getToastListStyle(as){const ns=as==="top"||as==="bottom"?"0 auto":void 0,ss=as.includes("top")?"env(safe-area-inset-top, 0px)":void 0,os=as.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,ls=as.includes("left")?void 0:"env(safe-area-inset-right, 0px)",us=as.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:ns,top:ss,bottom:os,right:ls,left:us}}function useCallbackRef(as,rs=[]){const ns=reactExports.useRef(as);return reactExports.useEffect(()=>{ns.current=as}),reactExports.useCallback((...ss)=>{var os;return(os=ns.current)==null?void 0:os.call(ns,...ss)},rs)}function useTimeout(as,rs){const ns=useCallbackRef(as);reactExports.useEffect(()=>{if(rs==null)return;let ss=null;return ss=window.setTimeout(()=>{ns()},rs),()=>{ss&&window.clearTimeout(ss)}},[rs,ns])}function useUpdateEffect(as,rs){const ns=reactExports.useRef(!1),ss=reactExports.useRef(!1);reactExports.useEffect(()=>{if(ns.current&&ss.current)return as();ss.current=!0},rs),reactExports.useEffect(()=>(ns.current=!0,()=>{ns.current=!1}),[])}const MotionConfigContext=reactExports.createContext({transformPagePoint:as=>as,isStatic:!1,reducedMotion:"never"}),MotionContext=reactExports.createContext({}),PresenceContext=reactExports.createContext(null),isBrowser=typeof document<"u",useIsomorphicLayoutEffect$1=isBrowser?reactExports.useLayoutEffect:reactExports.useEffect,LazyContext=reactExports.createContext({strict:!1});function useVisualElement(as,rs,ns,ss){const{visualElement:os}=reactExports.useContext(MotionContext),ls=reactExports.useContext(LazyContext),us=reactExports.useContext(PresenceContext),cs=reactExports.useContext(MotionConfigContext).reducedMotion,ds=reactExports.useRef();ss=ss||ls.renderer,!ds.current&&ss&&(ds.current=ss(as,{visualState:rs,parent:os,props:ns,presenceContext:us,blockInitialAnimation:us?us.initial===!1:!1,reducedMotionConfig:cs}));const ps=ds.current;return reactExports.useInsertionEffect(()=>{ps&&ps.update(ns,us)}),useIsomorphicLayoutEffect$1(()=>{ps&&ps.render()}),reactExports.useEffect(()=>{ps&&ps.updateFeatures()}),(window.HandoffAppearAnimations?useIsomorphicLayoutEffect$1:reactExports.useEffect)(()=>{ps&&ps.animationState&&ps.animationState.animateChanges()}),ps}function isRefObject(as){return typeof as=="object"&&Object.prototype.hasOwnProperty.call(as,"current")}function useMotionRef(as,rs,ns){return reactExports.useCallback(ss=>{ss&&as.mount&&as.mount(ss),rs&&(ss?rs.mount(ss):rs.unmount()),ns&&(typeof ns=="function"?ns(ss):isRefObject(ns)&&(ns.current=ss))},[rs])}function isVariantLabel(as){return typeof as=="string"||Array.isArray(as)}function isAnimationControls(as){return typeof as=="object"&&typeof as.start=="function"}const variantPriorityOrder=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],variantProps=["initial",...variantPriorityOrder];function isControllingVariants(as){return isAnimationControls(as.animate)||variantProps.some(rs=>isVariantLabel(as[rs]))}function isVariantNode(as){return!!(isControllingVariants(as)||as.variants)}function getCurrentTreeVariants(as,rs){if(isControllingVariants(as)){const{initial:ns,animate:ss}=as;return{initial:ns===!1||isVariantLabel(ns)?ns:void 0,animate:isVariantLabel(ss)?ss:void 0}}return as.inherit!==!1?rs:{}}function useCreateMotionContext(as){const{initial:rs,animate:ns}=getCurrentTreeVariants(as,reactExports.useContext(MotionContext));return reactExports.useMemo(()=>({initial:rs,animate:ns}),[variantLabelsAsDependency(rs),variantLabelsAsDependency(ns)])}function variantLabelsAsDependency(as){return Array.isArray(as)?as.join(" "):as}const featureProps={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},featureDefinitions={};for(const as in featureProps)featureDefinitions[as]={isEnabled:rs=>featureProps[as].some(ns=>!!rs[ns])};function loadFeatures(as){for(const rs in as)featureDefinitions[rs]={...featureDefinitions[rs],...as[rs]}}function useConstant(as){const rs=reactExports.useRef(null);return rs.current===null&&(rs.current=as()),rs.current}const globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let id$3=1;function useProjectionId(){return useConstant(()=>{if(globalProjectionState.hasEverUpdated)return id$3++})}const LayoutGroupContext=reactExports.createContext({}),SwitchLayoutGroupContext=reactExports.createContext({}),motionComponentSymbol=Symbol.for("motionComponentSymbol");function createMotionComponent({preloadedFeatures:as,createVisualElement:rs,useRender:ns,useVisualState:ss,Component:os}){as&&loadFeatures(as);function ls(cs,ds){let ps;const fs={...reactExports.useContext(MotionConfigContext),...cs,layoutId:useLayoutId(cs)},{isStatic:hs}=fs,gs=useCreateMotionContext(cs),ys=hs?void 0:useProjectionId(),bs=ss(cs,hs);if(!hs&&isBrowser){gs.visualElement=useVisualElement(os,bs,fs,rs);const vs=reactExports.useContext(SwitchLayoutGroupContext),xs=reactExports.useContext(LazyContext).strict;gs.visualElement&&(ps=gs.visualElement.loadFeatures(fs,xs,as,ys,vs))}return reactExports.createElement(MotionContext.Provider,{value:gs},ps&&gs.visualElement?reactExports.createElement(ps,{visualElement:gs.visualElement,...fs}):null,ns(os,cs,ys,useMotionRef(bs,gs.visualElement,ds),bs,hs,gs.visualElement))}const us=reactExports.forwardRef(ls);return us[motionComponentSymbol]=os,us}function useLayoutId({layoutId:as}){const rs=reactExports.useContext(LayoutGroupContext).id;return rs&&as!==void 0?rs+"-"+as:as}function createMotionProxy(as){function rs(ss,os={}){return createMotionComponent(as(ss,os))}if(typeof Proxy>"u")return rs;const ns=new Map;return new Proxy(rs,{get:(ss,os)=>(ns.has(os)||ns.set(os,rs(os)),ns.get(os))})}const lowercaseSVGElements=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function isSVGComponent(as){return typeof as!="string"||as.includes("-")?!1:!!(lowercaseSVGElements.indexOf(as)>-1||/[A-Z]/.test(as))}const scaleCorrectors={};function addScaleCorrector(as){Object.assign(scaleCorrectors,as)}const transformPropOrder=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],transformProps=new Set(transformPropOrder);function isForcedMotionValue(as,{layout:rs,layoutId:ns}){return transformProps.has(as)||as.startsWith("origin")||(rs||ns!==void 0)&&(!!scaleCorrectors[as]||as==="opacity")}const isMotionValue=as=>!!(as&&as.getVelocity),translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},numTransforms=transformPropOrder.length;function buildTransform(as,{enableHardwareAcceleration:rs=!0,allowTransformNone:ns=!0},ss,os){let ls="";for(let us=0;usrs=>typeof rs=="string"&&rs.startsWith(as),isCSSVariableName=checkStringStartsWith("--"),isCSSVariableToken=checkStringStartsWith("var(--"),getValueAsType=(as,rs)=>rs&&typeof as=="number"?rs.transform(as):as,clamp$1=(as,rs,ns)=>Math.min(Math.max(ns,as),rs),number={test:as=>typeof as=="number",parse:parseFloat,transform:as=>as},alpha={...number,transform:as=>clamp$1(0,1,as)},scale$1={...number,default:1},sanitize=as=>Math.round(as*1e5)/1e5,floatRegex=/(-)?([\d]*\.?[\d])+/g,colorRegex=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,singleColorRegex=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function isString$1(as){return typeof as=="string"}const createUnitType=as=>({test:rs=>isString$1(rs)&&rs.endsWith(as)&&rs.split(" ").length===1,parse:parseFloat,transform:rs=>`${rs}${as}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px$1=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage={...percent,parse:as=>percent.parse(as)/100,transform:as=>percent.transform(as*100)},int={...number,transform:Math.round},numberValueTypes={borderWidth:px$1,borderTopWidth:px$1,borderRightWidth:px$1,borderBottomWidth:px$1,borderLeftWidth:px$1,borderRadius:px$1,radius:px$1,borderTopLeftRadius:px$1,borderTopRightRadius:px$1,borderBottomRightRadius:px$1,borderBottomLeftRadius:px$1,width:px$1,maxWidth:px$1,height:px$1,maxHeight:px$1,size:px$1,top:px$1,right:px$1,bottom:px$1,left:px$1,padding:px$1,paddingTop:px$1,paddingRight:px$1,paddingBottom:px$1,paddingLeft:px$1,margin:px$1,marginTop:px$1,marginRight:px$1,marginBottom:px$1,marginLeft:px$1,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale:scale$1,scaleX:scale$1,scaleY:scale$1,scaleZ:scale$1,skew:degrees,skewX:degrees,skewY:degrees,distance:px$1,translateX:px$1,translateY:px$1,translateZ:px$1,x:px$1,y:px$1,z:px$1,perspective:px$1,transformPerspective:px$1,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px$1,zIndex:int,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int};function buildHTMLStyles(as,rs,ns,ss){const{style:os,vars:ls,transform:us,transformOrigin:cs}=as;let ds=!1,ps=!1,fs=!0;for(const hs in rs){const gs=rs[hs];if(isCSSVariableName(hs)){ls[hs]=gs;continue}const ys=numberValueTypes[hs],bs=getValueAsType(gs,ys);if(transformProps.has(hs)){if(ds=!0,us[hs]=bs,!fs)continue;gs!==(ys.default||0)&&(fs=!1)}else hs.startsWith("origin")?(ps=!0,cs[hs]=bs):os[hs]=bs}if(rs.transform||(ds||ss?os.transform=buildTransform(as.transform,ns,fs,ss):os.transform&&(os.transform="none")),ps){const{originX:hs="50%",originY:gs="50%",originZ:ys=0}=cs;os.transformOrigin=`${hs} ${gs} ${ys}`}}const createHtmlRenderState=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function copyRawValuesOnly(as,rs,ns){for(const ss in rs)!isMotionValue(rs[ss])&&!isForcedMotionValue(ss,ns)&&(as[ss]=rs[ss])}function useInitialMotionValues({transformTemplate:as},rs,ns){return reactExports.useMemo(()=>{const ss=createHtmlRenderState();return buildHTMLStyles(ss,rs,{enableHardwareAcceleration:!ns},as),Object.assign({},ss.vars,ss.style)},[rs])}function useStyle(as,rs,ns){const ss=as.style||{},os={};return copyRawValuesOnly(os,ss,as),Object.assign(os,useInitialMotionValues(as,rs,ns)),as.transformValues?as.transformValues(os):os}function useHTMLProps(as,rs,ns){const ss={},os=useStyle(as,rs,ns);return as.drag&&as.dragListener!==!1&&(ss.draggable=!1,os.userSelect=os.WebkitUserSelect=os.WebkitTouchCallout="none",os.touchAction=as.drag===!0?"none":`pan-${as.drag==="x"?"y":"x"}`),as.tabIndex===void 0&&(as.onTap||as.onTapStart||as.whileTap)&&(ss.tabIndex=0),ss.style=os,ss}const validMotionProps=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function isValidMotionProp(as){return as.startsWith("while")||as.startsWith("drag")&&as!=="draggable"||as.startsWith("layout")||as.startsWith("onTap")||as.startsWith("onPan")||validMotionProps.has(as)}let shouldForward=as=>!isValidMotionProp(as);function loadExternalIsValidProp(as){as&&(shouldForward=rs=>rs.startsWith("on")?!isValidMotionProp(rs):as(rs))}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch(as){}function filterProps(as,rs,ns){const ss={};for(const os in as)os==="values"&&typeof as.values=="object"||(shouldForward(os)||ns===!0&&isValidMotionProp(os)||!rs&&!isValidMotionProp(os)||as.draggable&&os.startsWith("onDrag"))&&(ss[os]=as[os]);return ss}function calcOrigin$1(as,rs,ns){return typeof as=="string"?as:px$1.transform(rs+ns*as)}function calcSVGTransformOrigin(as,rs,ns){const ss=calcOrigin$1(rs,as.x,as.width),os=calcOrigin$1(ns,as.y,as.height);return`${ss} ${os}`}const dashKeys={offset:"stroke-dashoffset",array:"stroke-dasharray"},camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(as,rs,ns=1,ss=0,os=!0){as.pathLength=1;const ls=os?dashKeys:camelKeys;as[ls.offset]=px$1.transform(-ss);const us=px$1.transform(rs),cs=px$1.transform(ns);as[ls.array]=`${us} ${cs}`}function buildSVGAttrs(as,{attrX:rs,attrY:ns,originX:ss,originY:os,pathLength:ls,pathSpacing:us=1,pathOffset:cs=0,...ds},ps,fs,hs){if(buildHTMLStyles(as,ds,ps,hs),fs){as.style.viewBox&&(as.attrs.viewBox=as.style.viewBox);return}as.attrs=as.style,as.style={};const{attrs:gs,style:ys,dimensions:bs}=as;gs.transform&&(bs&&(ys.transform=gs.transform),delete gs.transform),bs&&(ss!==void 0||os!==void 0||ys.transform)&&(ys.transformOrigin=calcSVGTransformOrigin(bs,ss!==void 0?ss:.5,os!==void 0?os:.5)),rs!==void 0&&(gs.x=rs),ns!==void 0&&(gs.y=ns),ls!==void 0&&buildSVGPath(gs,ls,us,cs,!1)}const createSvgRenderState=()=>({...createHtmlRenderState(),attrs:{}}),isSVGTag=as=>typeof as=="string"&&as.toLowerCase()==="svg";function useSVGProps(as,rs,ns,ss){const os=reactExports.useMemo(()=>{const ls=createSvgRenderState();return buildSVGAttrs(ls,rs,{enableHardwareAcceleration:!1},isSVGTag(ss),as.transformTemplate),{...ls.attrs,style:{...ls.style}}},[rs]);if(as.style){const ls={};copyRawValuesOnly(ls,as.style,as),os.style={...ls,...os.style}}return os}function createUseRender(as=!1){return(ns,ss,os,ls,{latestValues:us},cs)=>{const ps=(isSVGComponent(ns)?useSVGProps:useHTMLProps)(ss,us,cs,ns),hs={...filterProps(ss,typeof ns=="string",as),...ps,ref:ls},{children:gs}=ss,ys=reactExports.useMemo(()=>isMotionValue(gs)?gs.get():gs,[gs]);return os&&(hs["data-projection-id"]=os),reactExports.createElement(ns,{...hs,children:ys})}}const camelToDash=as=>as.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function renderHTML(as,{style:rs,vars:ns},ss,os){Object.assign(as.style,rs,os&&os.getProjectionStyles(ss));for(const ls in ns)as.style.setProperty(ls,ns[ls])}const camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function renderSVG(as,rs,ns,ss){renderHTML(as,rs,void 0,ss);for(const os in rs.attrs)as.setAttribute(camelCaseAttributes.has(os)?os:camelToDash(os),rs.attrs[os])}function scrapeMotionValuesFromProps$1(as,rs){const{style:ns}=as,ss={};for(const os in ns)(isMotionValue(ns[os])||rs.style&&isMotionValue(rs.style[os])||isForcedMotionValue(os,as))&&(ss[os]=ns[os]);return ss}function scrapeMotionValuesFromProps(as,rs){const ns=scrapeMotionValuesFromProps$1(as,rs);for(const ss in as)if(isMotionValue(as[ss])||isMotionValue(rs[ss])){const os=ss==="x"||ss==="y"?"attr"+ss.toUpperCase():ss;ns[os]=as[ss]}return ns}function resolveVariantFromProps(as,rs,ns,ss={},os={}){return typeof rs=="function"&&(rs=rs(ns!==void 0?ns:as.custom,ss,os)),typeof rs=="string"&&(rs=as.variants&&as.variants[rs]),typeof rs=="function"&&(rs=rs(ns!==void 0?ns:as.custom,ss,os)),rs}const isKeyframesTarget=as=>Array.isArray(as),isCustomValue=as=>!!(as&&typeof as=="object"&&as.mix&&as.toValue),resolveFinalValueInKeyframes=as=>isKeyframesTarget(as)?as[as.length-1]||0:as;function resolveMotionValue(as){const rs=isMotionValue(as)?as.get():as;return isCustomValue(rs)?rs.toValue():rs}function makeState({scrapeMotionValuesFromProps:as,createRenderState:rs,onMount:ns},ss,os,ls){const us={latestValues:makeLatestValues(ss,os,ls,as),renderState:rs()};return ns&&(us.mount=cs=>ns(ss,cs,us)),us}const makeUseVisualState=as=>(rs,ns)=>{const ss=reactExports.useContext(MotionContext),os=reactExports.useContext(PresenceContext),ls=()=>makeState(as,rs,ss,os);return ns?ls():useConstant(ls)};function makeLatestValues(as,rs,ns,ss){const os={},ls=ss(as,{});for(const gs in ls)os[gs]=resolveMotionValue(ls[gs]);let{initial:us,animate:cs}=as;const ds=isControllingVariants(as),ps=isVariantNode(as);rs&&ps&&!ds&&as.inherit!==!1&&(us===void 0&&(us=rs.initial),cs===void 0&&(cs=rs.animate));let fs=ns?ns.initial===!1:!1;fs=fs||us===!1;const hs=fs?cs:us;return hs&&typeof hs!="boolean"&&!isAnimationControls(hs)&&(Array.isArray(hs)?hs:[hs]).forEach(ys=>{const bs=resolveVariantFromProps(as,ys);if(!bs)return;const{transitionEnd:vs,transition:xs,...Cs}=bs;for(const Ts in Cs){let Ss=Cs[Ts];if(Array.isArray(Ss)){const Ns=fs?Ss.length-1:0;Ss=Ss[Ns]}Ss!==null&&(os[Ts]=Ss)}for(const Ts in vs)os[Ts]=vs[Ts]}),os}const svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:(as,rs,{renderState:ns,latestValues:ss})=>{try{ns.dimensions=typeof rs.getBBox=="function"?rs.getBBox():rs.getBoundingClientRect()}catch{ns.dimensions={x:0,y:0,width:0,height:0}}buildSVGAttrs(ns,ss,{enableHardwareAcceleration:!1},isSVGTag(rs.tagName),as.transformTemplate),renderSVG(rs,ns)}})},htmlMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function createDomMotionConfig(as,{forwardMotionProps:rs=!1},ns,ss){return{...isSVGComponent(as)?svgMotionConfig:htmlMotionConfig,preloadedFeatures:ns,useRender:createUseRender(rs),createVisualElement:ss,Component:as}}function addDomEvent(as,rs,ns,ss={passive:!0}){return as.addEventListener(rs,ns,ss),()=>as.removeEventListener(rs,ns)}const isPrimaryPointer=as=>as.pointerType==="mouse"?typeof as.button!="number"||as.button<=0:as.isPrimary!==!1;function extractEventInfo(as,rs="page"){return{point:{x:as[rs+"X"],y:as[rs+"Y"]}}}const addPointerInfo=as=>rs=>isPrimaryPointer(rs)&&as(rs,extractEventInfo(rs));function addPointerEvent(as,rs,ns,ss){return addDomEvent(as,rs,addPointerInfo(ns),ss)}const combineFunctions=(as,rs)=>ns=>rs(as(ns)),pipe=(...as)=>as.reduce(combineFunctions);function createLock(as){let rs=null;return()=>{const ns=()=>{rs=null};return rs===null?(rs=as,ns):!1}}const globalHorizontalLock=createLock("dragHorizontal"),globalVerticalLock=createLock("dragVertical");function getGlobalLock(as){let rs=!1;if(as==="y")rs=globalVerticalLock();else if(as==="x")rs=globalHorizontalLock();else{const ns=globalHorizontalLock(),ss=globalVerticalLock();ns&&ss?rs=()=>{ns(),ss()}:(ns&&ns(),ss&&ss())}return rs}function isDragActive(){const as=getGlobalLock(!0);return as?(as(),!1):!0}class Feature{constructor(rs){this.isMounted=!1,this.node=rs}update(){}}function createRenderStep(as){let rs=[],ns=[],ss=0,os=!1,ls=!1;const us=new WeakSet,cs={schedule:(ds,ps=!1,fs=!1)=>{const hs=fs&&os,gs=hs?rs:ns;return ps&&us.add(ds),gs.indexOf(ds)===-1&&(gs.push(ds),hs&&os&&(ss=rs.length)),ds},cancel:ds=>{const ps=ns.indexOf(ds);ps!==-1&&ns.splice(ps,1),us.delete(ds)},process:ds=>{if(os){ls=!0;return}if(os=!0,[rs,ns]=[ns,rs],ns.length=0,ss=rs.length,ss)for(let ps=0;ps(as[rs]=createRenderStep(()=>runNextFrame=!0),as),{}),sync=stepsOrder.reduce((as,rs)=>{const ns=steps[rs];return as[rs]=(ss,os=!1,ls=!1)=>(runNextFrame||startLoop(),ns.schedule(ss,os,ls)),as},{}),cancelSync=stepsOrder.reduce((as,rs)=>(as[rs]=steps[rs].cancel,as),{}),flushSync=stepsOrder.reduce((as,rs)=>(as[rs]=()=>steps[rs].process(frameData),as),{}),processStep=as=>steps[as].process(frameData),processFrame=as=>{runNextFrame=!1,frameData.delta=useDefaultElapsed?1e3/60:Math.max(Math.min(as-frameData.timestamp,maxElapsed),1),frameData.timestamp=as,frameData.isProcessing=!0,stepsOrder.forEach(processStep),frameData.isProcessing=!1,runNextFrame&&(useDefaultElapsed=!1,requestAnimationFrame(processFrame))},startLoop=()=>{runNextFrame=!0,useDefaultElapsed=!0,frameData.isProcessing||requestAnimationFrame(processFrame)};function addHoverEvent(as,rs){const ns="pointer"+(rs?"enter":"leave"),ss="onHover"+(rs?"Start":"End"),os=(ls,us)=>{if(ls.type==="touch"||isDragActive())return;const cs=as.getProps();as.animationState&&cs.whileHover&&as.animationState.setActive("whileHover",rs),cs[ss]&&sync.update(()=>cs[ss](ls,us))};return addPointerEvent(as.current,ns,os,{passive:!as.getProps()[ss]})}class HoverGesture extends Feature{mount(){this.unmount=pipe(addHoverEvent(this.node,!0),addHoverEvent(this.node,!1))}unmount(){}}class FocusGesture extends Feature{constructor(){super(...arguments),this.isActive=!1}onFocus(){let rs=!1;try{rs=this.node.current.matches(":focus-visible")}catch{rs=!0}!rs||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pipe(addDomEvent(this.node.current,"focus",()=>this.onFocus()),addDomEvent(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const isNodeOrChild=(as,rs)=>rs?as===rs?!0:isNodeOrChild(as,rs.parentElement):!1,noop$1=as=>as;function fireSyntheticPointerEvent(as,rs){if(!rs)return;const ns=new PointerEvent("pointer"+as);rs(ns,extractEventInfo(ns))}class PressGesture extends Feature{constructor(){super(...arguments),this.removeStartListeners=noop$1,this.removeEndListeners=noop$1,this.removeAccessibleListeners=noop$1,this.startPointerPress=(rs,ns)=>{if(this.removeEndListeners(),this.isPressing)return;const ss=this.node.getProps(),ls=addPointerEvent(window,"pointerup",(cs,ds)=>{if(!this.checkPressEnd())return;const{onTap:ps,onTapCancel:fs}=this.node.getProps();sync.update(()=>{isNodeOrChild(this.node.current,cs.target)?ps&&ps(cs,ds):fs&&fs(cs,ds)})},{passive:!(ss.onTap||ss.onPointerUp)}),us=addPointerEvent(window,"pointercancel",(cs,ds)=>this.cancelPress(cs,ds),{passive:!(ss.onTapCancel||ss.onPointerCancel)});this.removeEndListeners=pipe(ls,us),this.startPress(rs,ns)},this.startAccessiblePress=()=>{const rs=ls=>{if(ls.key!=="Enter"||this.isPressing)return;const us=cs=>{cs.key!=="Enter"||!this.checkPressEnd()||fireSyntheticPointerEvent("up",(ds,ps)=>{const{onTap:fs}=this.node.getProps();fs&&sync.update(()=>fs(ds,ps))})};this.removeEndListeners(),this.removeEndListeners=addDomEvent(this.node.current,"keyup",us),fireSyntheticPointerEvent("down",(cs,ds)=>{this.startPress(cs,ds)})},ns=addDomEvent(this.node.current,"keydown",rs),ss=()=>{this.isPressing&&fireSyntheticPointerEvent("cancel",(ls,us)=>this.cancelPress(ls,us))},os=addDomEvent(this.node.current,"blur",ss);this.removeAccessibleListeners=pipe(ns,os)}}startPress(rs,ns){this.isPressing=!0;const{onTapStart:ss,whileTap:os}=this.node.getProps();os&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),ss&&sync.update(()=>ss(rs,ns))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!isDragActive()}cancelPress(rs,ns){if(!this.checkPressEnd())return;const{onTapCancel:ss}=this.node.getProps();ss&&sync.update(()=>ss(rs,ns))}mount(){const rs=this.node.getProps(),ns=addPointerEvent(this.node.current,"pointerdown",this.startPointerPress,{passive:!(rs.onTapStart||rs.onPointerStart)}),ss=addDomEvent(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=pipe(ns,ss)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const observerCallbacks=new WeakMap,observers=new WeakMap,fireObserverCallback=as=>{const rs=observerCallbacks.get(as.target);rs&&rs(as)},fireAllObserverCallbacks=as=>{as.forEach(fireObserverCallback)};function initIntersectionObserver({root:as,...rs}){const ns=as||document;observers.has(ns)||observers.set(ns,{});const ss=observers.get(ns),os=JSON.stringify(rs);return ss[os]||(ss[os]=new IntersectionObserver(fireAllObserverCallbacks,{root:as,...rs})),ss[os]}function observeIntersection(as,rs,ns){const ss=initIntersectionObserver(rs);return observerCallbacks.set(as,ns),ss.observe(as),()=>{observerCallbacks.delete(as),ss.unobserve(as)}}const thresholdNames={some:0,all:1};class InViewFeature extends Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:rs={}}=this.node.getProps(),{root:ns,margin:ss,amount:os="some",once:ls}=rs,us={root:ns?ns.current:void 0,rootMargin:ss,threshold:typeof os=="number"?os:thresholdNames[os]},cs=ds=>{const{isIntersecting:ps}=ds;if(this.isInView===ps||(this.isInView=ps,ls&&!ps&&this.hasEnteredView))return;ps&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",ps);const{onViewportEnter:fs,onViewportLeave:hs}=this.node.getProps(),gs=ps?fs:hs;gs&&gs(ds)};return observeIntersection(this.node.current,us,cs)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:rs,prevProps:ns}=this.node;["amount","margin","root"].some(hasViewportOptionChanged(rs,ns))&&this.startObserver()}unmount(){}}function hasViewportOptionChanged({viewport:as={}},{viewport:rs={}}={}){return ns=>as[ns]!==rs[ns]}const gestureAnimations={inView:{Feature:InViewFeature},tap:{Feature:PressGesture},focus:{Feature:FocusGesture},hover:{Feature:HoverGesture}};function shallowCompare(as,rs){if(!Array.isArray(rs))return!1;const ns=rs.length;if(ns!==as.length)return!1;for(let ss=0;ssrs[ss]=ns.get()),rs}function getVelocity$1(as){const rs={};return as.values.forEach((ns,ss)=>rs[ss]=ns.getVelocity()),rs}function resolveVariant(as,rs,ns){const ss=as.getProps();return resolveVariantFromProps(ss,rs,ns!==void 0?ns:ss.custom,getCurrent(as),getVelocity$1(as))}const optimizedAppearDataId="framerAppearId",optimizedAppearDataAttribute="data-"+camelToDash(optimizedAppearDataId);let warning=noop$1,invariant=noop$1;const secondsToMilliseconds=as=>as*1e3,millisecondsToSeconds=as=>as/1e3,instantAnimationState={current:!1},isBezierDefinition=as=>Array.isArray(as)&&typeof as[0]=="number";function isWaapiSupportedEasing(as){return!!(!as||typeof as=="string"&&supportedWaapiEasing[as]||isBezierDefinition(as)||Array.isArray(as)&&as.every(isWaapiSupportedEasing))}const cubicBezierAsString=([as,rs,ns,ss])=>`cubic-bezier(${as}, ${rs}, ${ns}, ${ss})`,supportedWaapiEasing={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cubicBezierAsString([0,.65,.55,1]),circOut:cubicBezierAsString([.55,0,1,.45]),backIn:cubicBezierAsString([.31,.01,.66,-.59]),backOut:cubicBezierAsString([.33,1.53,.69,.99])};function mapEasingToNativeEasing(as){if(as)return isBezierDefinition(as)?cubicBezierAsString(as):Array.isArray(as)?as.map(mapEasingToNativeEasing):supportedWaapiEasing[as]}function animateStyle(as,rs,ns,{delay:ss=0,duration:os,repeat:ls=0,repeatType:us="loop",ease:cs,times:ds}={}){const ps={[rs]:ns};ds&&(ps.offset=ds);const fs=mapEasingToNativeEasing(cs);return Array.isArray(fs)&&(ps.easing=fs),as.animate(ps,{delay:ss,duration:os,easing:Array.isArray(fs)?"linear":fs,fill:"both",iterations:ls+1,direction:us==="reverse"?"alternate":"normal"})}const featureTests={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},results={},supports={};for(const as in featureTests)supports[as]=()=>(results[as]===void 0&&(results[as]=featureTests[as]()),results[as]);function getFinalKeyframe(as,{repeat:rs,repeatType:ns="loop"}){const ss=rs&&ns!=="loop"&&rs%2===1?0:as.length-1;return as[ss]}const calcBezier=(as,rs,ns)=>(((1-3*ns+3*rs)*as+(3*ns-6*rs))*as+3*rs)*as,subdivisionPrecision=1e-7,subdivisionMaxIterations=12;function binarySubdivide(as,rs,ns,ss,os){let ls,us,cs=0;do us=rs+(ns-rs)/2,ls=calcBezier(us,ss,os)-as,ls>0?ns=us:rs=us;while(Math.abs(ls)>subdivisionPrecision&&++csbinarySubdivide(ls,0,1,as,ns);return ls=>ls===0||ls===1?ls:calcBezier(os(ls),rs,ss)}const easeIn=cubicBezier(.42,0,1,1),easeOut=cubicBezier(0,0,.58,1),easeInOut=cubicBezier(.42,0,.58,1),isColorString=(as,rs)=>ns=>!!(isString$1(ns)&&singleColorRegex.test(ns)&&ns.startsWith(as)||rs&&Object.prototype.hasOwnProperty.call(ns,rs)),splitColor=(as,rs,ns)=>ss=>{if(!isString$1(ss))return ss;const[os,ls,us,cs]=ss.match(floatRegex);return{[as]:parseFloat(os),[rs]:parseFloat(ls),[ns]:parseFloat(us),alpha:cs!==void 0?parseFloat(cs):1}},clampRgbUnit=as=>clamp$1(0,255,as),rgbUnit={...number,transform:as=>Math.round(clampRgbUnit(as))},rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:as,green:rs,blue:ns,alpha:ss=1})=>"rgba("+rgbUnit.transform(as)+", "+rgbUnit.transform(rs)+", "+rgbUnit.transform(ns)+", "+sanitize(alpha.transform(ss))+")"};function parseHex(as){let rs="",ns="",ss="",os="";return as.length>5?(rs=as.substring(1,3),ns=as.substring(3,5),ss=as.substring(5,7),os=as.substring(7,9)):(rs=as.substring(1,2),ns=as.substring(2,3),ss=as.substring(3,4),os=as.substring(4,5),rs+=rs,ns+=ns,ss+=ss,os+=os),{red:parseInt(rs,16),green:parseInt(ns,16),blue:parseInt(ss,16),alpha:os?parseInt(os,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex,transform:rgba.transform},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:as,saturation:rs,lightness:ns,alpha:ss=1})=>"hsla("+Math.round(as)+", "+percent.transform(sanitize(rs))+", "+percent.transform(sanitize(ns))+", "+sanitize(alpha.transform(ss))+")"},color={test:as=>rgba.test(as)||hex.test(as)||hsla.test(as),parse:as=>rgba.test(as)?rgba.parse(as):hsla.test(as)?hsla.parse(as):hex.parse(as),transform:as=>isString$1(as)?as:as.hasOwnProperty("red")?rgba.transform(as):hsla.transform(as)},mix=(as,rs,ns)=>-ns*as+ns*rs+as;function hueToRgb(as,rs,ns){return ns<0&&(ns+=1),ns>1&&(ns-=1),ns<1/6?as+(rs-as)*6*ns:ns<1/2?rs:ns<2/3?as+(rs-as)*(2/3-ns)*6:as}function hslaToRgba({hue:as,saturation:rs,lightness:ns,alpha:ss}){as/=360,rs/=100,ns/=100;let os=0,ls=0,us=0;if(!rs)os=ls=us=ns;else{const cs=ns<.5?ns*(1+rs):ns+rs-ns*rs,ds=2*ns-cs;os=hueToRgb(ds,cs,as+1/3),ls=hueToRgb(ds,cs,as),us=hueToRgb(ds,cs,as-1/3)}return{red:Math.round(os*255),green:Math.round(ls*255),blue:Math.round(us*255),alpha:ss}}const mixLinearColor=(as,rs,ns)=>{const ss=as*as;return Math.sqrt(Math.max(0,ns*(rs*rs-ss)+ss))},colorTypes=[hex,rgba,hsla],getColorType=as=>colorTypes.find(rs=>rs.test(as));function asRGBA(as){const rs=getColorType(as);let ns=rs.parse(as);return rs===hsla&&(ns=hslaToRgba(ns)),ns}const mixColor=(as,rs)=>{const ns=asRGBA(as),ss=asRGBA(rs),os={...ns};return ls=>(os.red=mixLinearColor(ns.red,ss.red,ls),os.green=mixLinearColor(ns.green,ss.green,ls),os.blue=mixLinearColor(ns.blue,ss.blue,ls),os.alpha=mix(ns.alpha,ss.alpha,ls),rgba.transform(os))},colorToken="${c}",numberToken="${n}";function test(as){var rs,ns;return isNaN(as)&&isString$1(as)&&(((rs=as.match(floatRegex))===null||rs===void 0?void 0:rs.length)||0)+(((ns=as.match(colorRegex))===null||ns===void 0?void 0:ns.length)||0)>0}function analyseComplexValue(as){typeof as=="number"&&(as=`${as}`);const rs=[];let ns=0,ss=0;const os=as.match(colorRegex);os&&(ns=os.length,as=as.replace(colorRegex,colorToken),rs.push(...os.map(color.parse)));const ls=as.match(floatRegex);return ls&&(ss=ls.length,as=as.replace(floatRegex,numberToken),rs.push(...ls.map(number.parse))),{values:rs,numColors:ns,numNumbers:ss,tokenised:as}}function parse$1(as){return analyseComplexValue(as).values}function createTransformer(as){const{values:rs,numColors:ns,tokenised:ss}=analyseComplexValue(as),os=rs.length;return ls=>{let us=ss;for(let cs=0;cstypeof as=="number"?0:as;function getAnimatableNone$1(as){const rs=parse$1(as);return createTransformer(as)(rs.map(convertNumbersToZero))}const complex={test,parse:parse$1,createTransformer,getAnimatableNone:getAnimatableNone$1};function getMixer(as,rs){return typeof as=="number"?ns=>mix(as,rs,ns):color.test(as)?mixColor(as,rs):mixComplex(as,rs)}const mixArray=(as,rs)=>{const ns=[...as],ss=ns.length,os=as.map((ls,us)=>getMixer(ls,rs[us]));return ls=>{for(let us=0;us{const ns={...as,...rs},ss={};for(const os in ns)as[os]!==void 0&&rs[os]!==void 0&&(ss[os]=getMixer(as[os],rs[os]));return os=>{for(const ls in ss)ns[ls]=ss[ls](os);return ns}},mixComplex=(as,rs)=>{const ns=complex.createTransformer(rs),ss=analyseComplexValue(as),os=analyseComplexValue(rs);return ss.numColors===os.numColors&&ss.numNumbers>=os.numNumbers?pipe(mixArray(ss.values,os.values),ns):us=>`${us>0?rs:as}`},progress=(as,rs,ns)=>{const ss=rs-as;return ss===0?1:(ns-as)/ss},mixNumber=(as,rs)=>ns=>mix(as,rs,ns);function detectMixerFactory(as){return typeof as=="number"?mixNumber:typeof as=="string"?color.test(as)?mixColor:mixComplex:Array.isArray(as)?mixArray:typeof as=="object"?mixObject:mixNumber}function createMixers(as,rs,ns){const ss=[],os=ns||detectMixerFactory(as[0]),ls=as.length-1;for(let us=0;usrs[0];as[0]>as[ls-1]&&(as=[...as].reverse(),rs=[...rs].reverse());const us=createMixers(rs,ss,os),cs=us.length,ds=ps=>{let fs=0;if(cs>1)for(;fsds(clamp$1(as[0],as[ls-1],ps)):ds}function fillOffset(as,rs){const ns=as[as.length-1];for(let ss=1;ss<=rs;ss++){const os=progress(0,rs,ss);as.push(mix(ns,1,os))}}function defaultOffset(as){const rs=[0];return fillOffset(rs,as.length-1),rs}function convertOffsetToTimes(as,rs){return as.map(ns=>ns*rs)}const mirrorEasing=as=>rs=>rs<=.5?as(2*rs)/2:(2-as(2*(1-rs)))/2,reverseEasing=as=>rs=>1-as(1-rs),circIn=as=>1-Math.sin(Math.acos(as)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circOut),backOut=cubicBezier(.33,1.53,.69,.99),backIn=reverseEasing(backOut),backInOut=mirrorEasing(backIn),anticipate=as=>(as*=2)<1?.5*backIn(as):.5*(2-Math.pow(2,-10*(as-1))),easingLookup={linear:noop$1,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate},easingDefinitionToFunction=as=>{if(Array.isArray(as)){invariant(as.length===4);const[rs,ns,ss,os]=as;return cubicBezier(rs,ns,ss,os)}else if(typeof as=="string")return easingLookup[as];return as},isEasingArray=as=>Array.isArray(as)&&typeof as[0]!="number";function defaultEasing(as,rs){return as.map(()=>rs||easeInOut).splice(0,as.length-1)}function keyframes({duration:as=300,keyframes:rs,times:ns,ease:ss="easeInOut"}){const os=isEasingArray(ss)?ss.map(easingDefinitionToFunction):easingDefinitionToFunction(ss),ls={done:!1,value:rs[0]},us=convertOffsetToTimes(ns&&ns.length===rs.length?ns:defaultOffset(rs),as),cs=interpolate(us,rs,{ease:Array.isArray(os)?os:defaultEasing(rs,os)});return{calculatedDuration:as,next:ds=>(ls.value=cs(ds),ls.done=ds>=as,ls)}}function velocityPerSecond(as,rs){return rs?as*(1e3/rs):0}const velocitySampleDuration=5;function calcGeneratorVelocity(as,rs,ns){const ss=Math.max(rs-velocitySampleDuration,0);return velocityPerSecond(ns-as(ss),rs-ss)}const safeMin=.001,minDuration=.01,maxDuration$2=10,minDamping=.05,maxDamping=1;function findSpring({duration:as=800,bounce:rs=.25,velocity:ns=0,mass:ss=1}){let os,ls;warning(as<=secondsToMilliseconds(maxDuration$2));let us=1-rs;us=clamp$1(minDamping,maxDamping,us),as=clamp$1(minDuration,maxDuration$2,millisecondsToSeconds(as)),us<1?(os=ps=>{const fs=ps*us,hs=fs*as,gs=fs-ns,ys=calcAngularFreq(ps,us),bs=Math.exp(-hs);return safeMin-gs/ys*bs},ls=ps=>{const hs=ps*us*as,gs=hs*ns+ns,ys=Math.pow(us,2)*Math.pow(ps,2)*as,bs=Math.exp(-hs),vs=calcAngularFreq(Math.pow(ps,2),us);return(-os(ps)+safeMin>0?-1:1)*((gs-ys)*bs)/vs}):(os=ps=>{const fs=Math.exp(-ps*as),hs=(ps-ns)*as+1;return-safeMin+fs*hs},ls=ps=>{const fs=Math.exp(-ps*as),hs=(ns-ps)*(as*as);return fs*hs});const cs=5/as,ds=approximateRoot(os,ls,cs);if(as=secondsToMilliseconds(as),isNaN(ds))return{stiffness:100,damping:10,duration:as};{const ps=Math.pow(ds,2)*ss;return{stiffness:ps,damping:us*2*Math.sqrt(ss*ps),duration:as}}}const rootIterations=12;function approximateRoot(as,rs,ns){let ss=ns;for(let os=1;osas[ns]!==void 0)}function getSpringOptions(as){let rs={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...as};if(!isSpringType(as,physicsKeys)&&isSpringType(as,durationKeys)){const ns=findSpring(as);rs={...rs,...ns,velocity:0,mass:1},rs.isResolvedFromDuration=!0}return rs}function spring({keyframes:as,restDelta:rs,restSpeed:ns,...ss}){const os=as[0],ls=as[as.length-1],us={done:!1,value:os},{stiffness:cs,damping:ds,mass:ps,velocity:fs,duration:hs,isResolvedFromDuration:gs}=getSpringOptions(ss),ys=fs?-millisecondsToSeconds(fs):0,bs=ds/(2*Math.sqrt(cs*ps)),vs=ls-os,xs=millisecondsToSeconds(Math.sqrt(cs/ps)),Cs=Math.abs(vs)<5;ns||(ns=Cs?.01:2),rs||(rs=Cs?.005:.5);let Ts;if(bs<1){const Ss=calcAngularFreq(xs,bs);Ts=Ns=>{const As=Math.exp(-bs*xs*Ns);return ls-As*((ys+bs*xs*vs)/Ss*Math.sin(Ss*Ns)+vs*Math.cos(Ss*Ns))}}else if(bs===1)Ts=Ss=>ls-Math.exp(-xs*Ss)*(vs+(ys+xs*vs)*Ss);else{const Ss=xs*Math.sqrt(bs*bs-1);Ts=Ns=>{const As=Math.exp(-bs*xs*Ns),ws=Math.min(Ss*Ns,300);return ls-As*((ys+bs*xs*vs)*Math.sinh(ws)+Ss*vs*Math.cosh(ws))/Ss}}return{calculatedDuration:gs&&hs||null,next:Ss=>{const Ns=Ts(Ss);if(gs)us.done=Ss>=hs;else{let As=ys;Ss!==0&&(bs<1?As=calcGeneratorVelocity(Ts,Ss,Ns):As=0);const ws=Math.abs(As)<=ns,Es=Math.abs(ls-Ns)<=rs;us.done=ws&&Es}return us.value=us.done?ls:Ns,us}}}function inertia({keyframes:as,velocity:rs=0,power:ns=.8,timeConstant:ss=325,bounceDamping:os=10,bounceStiffness:ls=500,modifyTarget:us,min:cs,max:ds,restDelta:ps=.5,restSpeed:fs}){const hs=as[0],gs={done:!1,value:hs},ys=_s=>cs!==void 0&&_sds,bs=_s=>cs===void 0?ds:ds===void 0||Math.abs(cs-_s)-vs*Math.exp(-_s/ss),Ss=_s=>Cs+Ts(_s),Ns=_s=>{const $s=Ts(_s),Rs=Ss(_s);gs.done=Math.abs($s)<=ps,gs.value=gs.done?Cs:Rs};let As,ws;const Es=_s=>{ys(gs.value)&&(As=_s,ws=spring({keyframes:[gs.value,bs(gs.value)],velocity:calcGeneratorVelocity(Ss,_s,gs.value),damping:os,stiffness:ls,restDelta:ps,restSpeed:fs}))};return Es(0),{calculatedDuration:null,next:_s=>{let $s=!1;return!ws&&As===void 0&&($s=!0,Ns(_s),Es(_s)),As!==void 0&&_s>As?ws.next(_s-As):(!$s&&Ns(_s),gs)}}}const frameloopDriver=as=>{const rs=({timestamp:ns})=>as(ns);return{start:()=>sync.update(rs,!0),stop:()=>cancelSync.update(rs),now:()=>frameData.isProcessing?frameData.timestamp:performance.now()}},types={decay:inertia,inertia,tween:keyframes,keyframes,spring},maxDuration$1=2e4;function calculateDuration(as){let rs=0;const ns=50;let ss=as.next(rs);for(;!ss.done&&rs{vs&&vs(),xs=new Promise(js=>{vs=js})};Cs();let Ts;const Ss=types[os]||keyframes;let Ns;Ss!==keyframes&&typeof ss[0]!="number"&&(Ns=interpolate([0,100],ss,{clamp:!1}),ss=[0,100]);const As=Ss({...gs,keyframes:ss});let ws;cs==="mirror"&&(ws=Ss({...gs,keyframes:[...ss].reverse(),velocity:-(gs.velocity||0)}));let Es="idle",_s=null,$s=null,Rs=null;As.calculatedDuration===null&&ls&&(As.calculatedDuration=calculateDuration(As));const{calculatedDuration:Ds}=As;let Os=1/0,Is=1/0;Ds!==null&&(Os=Ds+us,Is=Os*(ls+1)-us);let Vs=0;const ks=js=>{if($s===null)return;_s!==null?Vs=_s:Vs=(js-$s)*ys,Vs=Math.max(Vs-rs,0),Es==="finished"&&_s===null&&(Vs=Is);let Ls=Vs,Gs=As;if(ls){const Nl=Vs/Os;let yl=Math.floor(Nl),Dl=Nl%1;!Dl&&Nl>=1&&(Dl=1),Dl===1&&yl--,yl=Math.min(yl,ls+1);const Rl=!!(yl%2);Rl&&(cs==="reverse"?(Dl=1-Dl,us&&(Dl-=us/Os)):cs==="mirror"&&(Gs=ws));let Ml=clamp$1(0,1,Dl);Vs>Is&&(Ml=cs==="reverse"&&Rl?1:0),Ls=Ml*Os}const Hs=Gs.next(Ls);Ns&&(Hs.value=Ns(Hs.value));let{done:Ys}=Hs;Ds!==null&&(Ys=Vs>=Is);const Zs=_s===null&&(Es==="finished"||Es==="running"&&Ys||ys<0&&Vs<=0);return hs&&hs(Hs.value),Zs&&Ms(),Hs},Ps=()=>{Ts&&Ts.stop(),Ts=void 0},Bs=()=>{Es="idle",Ps(),Cs(),$s=Rs=null},Ms=()=>{Es="finished",fs&&fs(),Ps(),Cs()},Ws=()=>{if(bs)return;Ts||(Ts=ns(ks));const js=Ts.now();ds&&ds(),Es="running",_s!==null?$s=js-_s:$s||($s=js),Rs=$s,_s=null,Ts.start()};as&&Ws();const Us={then(js,Ls){return xs.then(js,Ls)},get time(){return millisecondsToSeconds(Vs)},set time(js){js=secondsToMilliseconds(js),Vs=js,_s!==null||!Ts||ys===0?_s=js:$s=Ts.now()-js/ys},get speed(){return ys},set speed(js){js===ys||!Ts||(ys=js,Us.time=millisecondsToSeconds(Vs))},get state(){return Es},play:Ws,pause:()=>{Es="paused",_s=Vs},stop:()=>{bs=!0,Es!=="idle"&&(Es="idle",ps&&ps(),Bs())},cancel:()=>{Rs!==null&&ks(Rs),Bs()},complete:()=>{Es="finished"},sample:js=>($s=0,ks(js))};return Us}const acceleratedValues=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),sampleDelta=10,maxDuration=2e4,requiresPregeneratedKeyframes=(as,rs)=>rs.type==="spring"||as==="backgroundColor"||!isWaapiSupportedEasing(rs.ease);function createAcceleratedAnimation(as,rs,{onUpdate:ns,onComplete:ss,...os}){if(!(supports.waapi()&&acceleratedValues.has(rs)&&!os.repeatDelay&&os.repeatType!=="mirror"&&os.damping!==0&&os.type!=="inertia"))return!1;let us=!1,cs,ds;const ps=()=>{ds=new Promise(vs=>{cs=vs})};ps();let{keyframes:fs,duration:hs=300,ease:gs}=os;if(requiresPregeneratedKeyframes(rs,os)){const vs=animateValue({...os,repeat:0,delay:0});let xs={done:!1,value:fs[0]};const Cs=[];let Ts=0;for(;!xs.done&&Ts{sync.update(()=>ys.cancel()),cs(),ps()};return ys.onfinish=()=>{as.set(getFinalKeyframe(fs,os)),ss&&ss(),bs()},{then(vs,xs){return ds.then(vs,xs)},get time(){return millisecondsToSeconds(ys.currentTime||0)},set time(vs){ys.currentTime=secondsToMilliseconds(vs)},get speed(){return ys.playbackRate},set speed(vs){ys.playbackRate=vs},play:()=>{us||ys.play()},pause:()=>ys.pause(),stop:()=>{if(us=!0,ys.playState==="idle")return;const{currentTime:vs}=ys;if(vs){const xs=animateValue({...os,autoplay:!1});as.setWithVelocity(xs.sample(vs-sampleDelta).value,xs.sample(vs).value,sampleDelta)}bs()},complete:()=>ys.finish(),cancel:bs}}function createInstantAnimation({keyframes:as,delay:rs,onUpdate:ns,onComplete:ss}){const os=()=>(ns&&ns(as[as.length-1]),ss&&ss(),{time:0,speed:1,play:noop$1,pause:noop$1,stop:noop$1,then:ls=>(ls(),Promise.resolve()),cancel:noop$1,complete:noop$1});return rs?animateValue({keyframes:[0,1],duration:rs,onComplete:os}):os()}const underDampedSpring={type:"spring",stiffness:500,damping:25,restSpeed:10},criticallyDampedSpring=as=>({type:"spring",stiffness:550,damping:as===0?2*Math.sqrt(550):30,restSpeed:10}),keyframesTransition={type:"keyframes",duration:.8},ease={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},getDefaultTransition=(as,{keyframes:rs})=>rs.length>2?keyframesTransition:transformProps.has(as)?as.startsWith("scale")?criticallyDampedSpring(rs[1]):underDampedSpring:ease,isAnimatable=(as,rs)=>as==="zIndex"?!1:!!(typeof rs=="number"||Array.isArray(rs)||typeof rs=="string"&&complex.test(rs)&&!rs.startsWith("url(")),maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(as){const[rs,ns]=as.slice(0,-1).split("(");if(rs==="drop-shadow")return as;const[ss]=ns.match(floatRegex)||[];if(!ss)return as;const os=ns.replace(ss,"");let ls=maxDefaults.has(rs)?1:0;return ss!==ns&&(ls*=100),rs+"("+ls+os+")"}const functionRegex=/([a-z-]*)\(.*?\)/g,filter$1={...complex,getAnimatableNone:as=>{const rs=as.match(functionRegex);return rs?rs.map(applyDefaultFilter).join(" "):as}},defaultValueTypes={...numberValueTypes,color,backgroundColor:color,outlineColor:color,fill:color,stroke:color,borderColor:color,borderTopColor:color,borderRightColor:color,borderBottomColor:color,borderLeftColor:color,filter:filter$1,WebkitFilter:filter$1},getDefaultValueType=as=>defaultValueTypes[as];function getAnimatableNone(as,rs){let ns=getDefaultValueType(as);return ns!==filter$1&&(ns=complex),ns.getAnimatableNone?ns.getAnimatableNone(rs):void 0}function isTransitionDefined({when:as,delay:rs,delayChildren:ns,staggerChildren:ss,staggerDirection:os,repeat:ls,repeatType:us,repeatDelay:cs,from:ds,elapsed:ps,...fs}){return!!Object.keys(fs).length}function isZero(as){return as===0||typeof as=="string"&&parseFloat(as)===0&&as.indexOf(" ")===-1}function getZeroUnit(as){return typeof as=="number"?0:getAnimatableNone("",as)}function getValueTransition(as,rs){return as[rs]||as.default||as}function getKeyframes(as,rs,ns,ss){const os=isAnimatable(rs,ns);let ls=ss.from!==void 0?ss.from:as.get();return ls==="none"&&os&&typeof ns=="string"?ls=getAnimatableNone(rs,ns):isZero(ls)&&typeof ns=="string"?ls=getZeroUnit(ns):!Array.isArray(ns)&&isZero(ns)&&typeof ls=="string"&&(ns=getZeroUnit(ls)),Array.isArray(ns)?(ns[0]===null&&(ns[0]=ls),ns):[ls,ns]}const animateMotionValue=(as,rs,ns,ss={})=>os=>{const ls=getValueTransition(ss,as)||{},us=ls.delay||ss.delay||0;let{elapsed:cs=0}=ss;cs=cs-secondsToMilliseconds(us);const ds=getKeyframes(rs,as,ns,ls),ps=ds[0],fs=ds[ds.length-1],hs=isAnimatable(as,ps),gs=isAnimatable(as,fs);let ys={keyframes:ds,velocity:rs.getVelocity(),ease:"easeOut",...ls,delay:-cs,onUpdate:bs=>{rs.set(bs),ls.onUpdate&&ls.onUpdate(bs)},onComplete:()=>{os(),ls.onComplete&&ls.onComplete()}};if(!hs||!gs||instantAnimationState.current||ls.type===!1)return createInstantAnimation(ys);if(isTransitionDefined(ls)||(ys={...ys,...getDefaultTransition(as,ys)}),ys.duration&&(ys.duration=secondsToMilliseconds(ys.duration)),ys.repeatDelay&&(ys.repeatDelay=secondsToMilliseconds(ys.repeatDelay)),rs.owner&&rs.owner.current instanceof HTMLElement&&!rs.owner.getProps().onUpdate){const bs=createAcceleratedAnimation(rs,as,ys);if(bs)return bs}return animateValue(ys)};function isWillChangeMotionValue(as){return!!(isMotionValue(as)&&as.add)}const isNumericalString=as=>/^\-?\d*\.?\d+$/.test(as),isZeroValueString=as=>/^0[^.\s]+$/.test(as);function addUniqueItem(as,rs){as.indexOf(rs)===-1&&as.push(rs)}function removeItem(as,rs){const ns=as.indexOf(rs);ns>-1&&as.splice(ns,1)}class SubscriptionManager{constructor(){this.subscriptions=[]}add(rs){return addUniqueItem(this.subscriptions,rs),()=>removeItem(this.subscriptions,rs)}notify(rs,ns,ss){const os=this.subscriptions.length;if(os)if(os===1)this.subscriptions[0](rs,ns,ss);else for(let ls=0;ls!isNaN(parseFloat(as));class MotionValue{constructor(rs,ns={}){this.version="10.8.5",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(ss,os=!0)=>{this.prev=this.current,this.current=ss;const{delta:ls,timestamp:us}=frameData;this.lastUpdated!==us&&(this.timeDelta=ls,this.lastUpdated=us,sync.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),os&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>sync.postRender(this.velocityCheck),this.velocityCheck=({timestamp:ss})=>{ss!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=rs,this.canTrackVelocity=isFloat(this.current),this.owner=ns.owner}onChange(rs){return this.on("change",rs)}on(rs,ns){this.events[rs]||(this.events[rs]=new SubscriptionManager);const ss=this.events[rs].add(ns);return rs==="change"?()=>{ss(),sync.read(()=>{this.events.change.getSize()||this.stop()})}:ss}clearListeners(){for(const rs in this.events)this.events[rs].clear()}attach(rs,ns){this.passiveEffect=rs,this.stopPassiveEffect=ns}set(rs,ns=!0){!ns||!this.passiveEffect?this.updateAndNotify(rs,ns):this.passiveEffect(rs,this.updateAndNotify)}setWithVelocity(rs,ns,ss){this.set(ns),this.prev=rs,this.timeDelta=ss}jump(rs){this.updateAndNotify(rs),this.prev=rs,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?velocityPerSecond(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(rs){return this.stop(),new Promise(ns=>{this.hasAnimated=!0,this.animation=rs(ns),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function motionValue(as,rs){return new MotionValue(as,rs)}const testValueType=as=>rs=>rs.test(as),auto$1={test:as=>as==="auto",parse:as=>as},dimensionValueTypes=[number,px$1,percent,degrees,vw,vh,auto$1],findDimensionValueType=as=>dimensionValueTypes.find(testValueType(as)),valueTypes=[...dimensionValueTypes,color,complex],findValueType=as=>valueTypes.find(testValueType(as));function setMotionValue(as,rs,ns){as.hasValue(rs)?as.getValue(rs).set(ns):as.addValue(rs,motionValue(ns))}function setTarget(as,rs){const ns=resolveVariant(as,rs);let{transitionEnd:ss={},transition:os={},...ls}=ns?as.makeTargetAnimatable(ns,!1):{};ls={...ls,...ss};for(const us in ls){const cs=resolveFinalValueInKeyframes(ls[us]);setMotionValue(as,us,cs)}}function checkTargetForNewValues(as,rs,ns){var ss,os;const ls=Object.keys(rs).filter(cs=>!as.hasValue(cs)),us=ls.length;if(us)for(let cs=0;csds.remove(hs))),ps.push(vs)}return us&&Promise.all(ps).then(()=>{us&&setTarget(as,us)}),ps}function animateVariant(as,rs,ns={}){const ss=resolveVariant(as,rs,ns.custom);let{transition:os=as.getDefaultTransition()||{}}=ss||{};ns.transitionOverride&&(os=ns.transitionOverride);const ls=ss?()=>Promise.all(animateTarget(as,ss,ns)):()=>Promise.resolve(),us=as.variantChildren&&as.variantChildren.size?(ds=0)=>{const{delayChildren:ps=0,staggerChildren:fs,staggerDirection:hs}=os;return animateChildren(as,rs,ps+ds,fs,hs,ns)}:()=>Promise.resolve(),{when:cs}=os;if(cs){const[ds,ps]=cs==="beforeChildren"?[ls,us]:[us,ls];return ds().then(()=>ps())}else return Promise.all([ls(),us(ns.delay)])}function animateChildren(as,rs,ns=0,ss=0,os=1,ls){const us=[],cs=(as.variantChildren.size-1)*ss,ds=os===1?(ps=0)=>ps*ss:(ps=0)=>cs-ps*ss;return Array.from(as.variantChildren).sort(sortByTreeOrder).forEach((ps,fs)=>{ps.notify("AnimationStart",rs),us.push(animateVariant(ps,rs,{...ls,delay:ns+ds(fs)}).then(()=>ps.notify("AnimationComplete",rs)))}),Promise.all(us)}function sortByTreeOrder(as,rs){return as.sortNodePosition(rs)}function animateVisualElement(as,rs,ns={}){as.notify("AnimationStart",rs);let ss;if(Array.isArray(rs)){const os=rs.map(ls=>animateVariant(as,ls,ns));ss=Promise.all(os)}else if(typeof rs=="string")ss=animateVariant(as,rs,ns);else{const os=typeof rs=="function"?resolveVariant(as,rs,ns.custom):rs;ss=Promise.all(animateTarget(as,os,ns))}return ss.then(()=>as.notify("AnimationComplete",rs))}const reversePriorityOrder=[...variantPriorityOrder].reverse(),numAnimationTypes=variantPriorityOrder.length;function animateList(as){return rs=>Promise.all(rs.map(({animation:ns,options:ss})=>animateVisualElement(as,ns,ss)))}function createAnimationState(as){let rs=animateList(as);const ns=createState();let ss=!0;const os=(ds,ps)=>{const fs=resolveVariant(as,ps);if(fs){const{transition:hs,transitionEnd:gs,...ys}=fs;ds={...ds,...ys,...gs}}return ds};function ls(ds){rs=ds(as)}function us(ds,ps){const fs=as.getProps(),hs=as.getVariantContext(!0)||{},gs=[],ys=new Set;let bs={},vs=1/0;for(let Cs=0;Csvs&&As;const Rs=Array.isArray(Ns)?Ns:[Ns];let Ds=Rs.reduce(os,{});ws===!1&&(Ds={});const{prevResolvedValues:Os={}}=Ss,Is={...Os,...Ds},Vs=ks=>{$s=!0,ys.delete(ks),Ss.needsAnimating[ks]=!0};for(const ks in Is){const Ps=Ds[ks],Bs=Os[ks];bs.hasOwnProperty(ks)||(Ps!==Bs?isKeyframesTarget(Ps)&&isKeyframesTarget(Bs)?!shallowCompare(Ps,Bs)||_s?Vs(ks):Ss.protectedKeys[ks]=!0:Ps!==void 0?Vs(ks):ys.add(ks):Ps!==void 0&&ys.has(ks)?Vs(ks):Ss.protectedKeys[ks]=!0)}Ss.prevProp=Ns,Ss.prevResolvedValues=Ds,Ss.isActive&&(bs={...bs,...Ds}),ss&&as.blockInitialAnimation&&($s=!1),$s&&!Es&&gs.push(...Rs.map(ks=>({animation:ks,options:{type:Ts,...ds}})))}if(ys.size){const Cs={};ys.forEach(Ts=>{const Ss=as.getBaseTarget(Ts);Ss!==void 0&&(Cs[Ts]=Ss)}),gs.push({animation:Cs})}let xs=!!gs.length;return ss&&fs.initial===!1&&!as.manuallyAnimateOnMount&&(xs=!1),ss=!1,xs?rs(gs):Promise.resolve()}function cs(ds,ps,fs){var hs;if(ns[ds].isActive===ps)return Promise.resolve();(hs=as.variantChildren)===null||hs===void 0||hs.forEach(ys=>{var bs;return(bs=ys.animationState)===null||bs===void 0?void 0:bs.setActive(ds,ps)}),ns[ds].isActive=ps;const gs=us(fs,ds);for(const ys in ns)ns[ys].protectedKeys={};return gs}return{animateChanges:us,setActive:cs,setAnimateFunction:ls,getState:()=>ns}}function checkVariantsDidChange(as,rs){return typeof rs=="string"?rs!==as:Array.isArray(rs)?!shallowCompare(rs,as):!1}function createTypeState(as=!1){return{isActive:as,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function createState(){return{animate:createTypeState(!0),whileInView:createTypeState(),whileHover:createTypeState(),whileTap:createTypeState(),whileDrag:createTypeState(),whileFocus:createTypeState(),exit:createTypeState()}}class AnimationFeature extends Feature{constructor(rs){super(rs),rs.animationState||(rs.animationState=createAnimationState(rs))}updateAnimationControlsSubscription(){const{animate:rs}=this.node.getProps();this.unmount(),isAnimationControls(rs)&&(this.unmount=rs.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:rs}=this.node.getProps(),{animate:ns}=this.node.prevProps||{};rs!==ns&&this.updateAnimationControlsSubscription()}unmount(){}}let id$2=0;class ExitAnimationFeature extends Feature{constructor(){super(...arguments),this.id=id$2++}update(){if(!this.node.presenceContext)return;const{isPresent:rs,onExitComplete:ns,custom:ss}=this.node.presenceContext,{isPresent:os}=this.node.prevPresenceContext||{};if(!this.node.animationState||rs===os)return;const ls=this.node.animationState.setActive("exit",!rs,{custom:ss??this.node.getProps().custom});ns&&!rs&&ls.then(()=>ns(this.id))}mount(){const{register:rs}=this.node.presenceContext||{};rs&&(this.unmount=rs(this.id))}unmount(){}}const animations={animation:{Feature:AnimationFeature},exit:{Feature:ExitAnimationFeature}},distance=(as,rs)=>Math.abs(as-rs);function distance2D(as,rs){const ns=distance(as.x,rs.x),ss=distance(as.y,rs.y);return Math.sqrt(ns**2+ss**2)}class PanSession{constructor(rs,ns,{transformPagePoint:ss}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const ps=getPanInfo(this.lastMoveEventInfo,this.history),fs=this.startEvent!==null,hs=distance2D(ps.offset,{x:0,y:0})>=3;if(!fs&&!hs)return;const{point:gs}=ps,{timestamp:ys}=frameData;this.history.push({...gs,timestamp:ys});const{onStart:bs,onMove:vs}=this.handlers;fs||(bs&&bs(this.lastMoveEvent,ps),this.startEvent=this.lastMoveEvent),vs&&vs(this.lastMoveEvent,ps)},this.handlePointerMove=(ps,fs)=>{this.lastMoveEvent=ps,this.lastMoveEventInfo=transformPoint(fs,this.transformPagePoint),sync.update(this.updatePoint,!0)},this.handlePointerUp=(ps,fs)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:hs,onSessionEnd:gs}=this.handlers,ys=getPanInfo(ps.type==="pointercancel"?this.lastMoveEventInfo:transformPoint(fs,this.transformPagePoint),this.history);this.startEvent&&hs&&hs(ps,ys),gs&&gs(ps,ys)},!isPrimaryPointer(rs))return;this.handlers=ns,this.transformPagePoint=ss;const os=extractEventInfo(rs),ls=transformPoint(os,this.transformPagePoint),{point:us}=ls,{timestamp:cs}=frameData;this.history=[{...us,timestamp:cs}];const{onSessionStart:ds}=ns;ds&&ds(rs,getPanInfo(ls,this.history)),this.removeListeners=pipe(addPointerEvent(window,"pointermove",this.handlePointerMove),addPointerEvent(window,"pointerup",this.handlePointerUp),addPointerEvent(window,"pointercancel",this.handlePointerUp))}updateHandlers(rs){this.handlers=rs}end(){this.removeListeners&&this.removeListeners(),cancelSync.update(this.updatePoint)}}function transformPoint(as,rs){return rs?{point:rs(as.point)}:as}function subtractPoint(as,rs){return{x:as.x-rs.x,y:as.y-rs.y}}function getPanInfo({point:as},rs){return{point:as,delta:subtractPoint(as,lastDevicePoint(rs)),offset:subtractPoint(as,startDevicePoint(rs)),velocity:getVelocity(rs,.1)}}function startDevicePoint(as){return as[0]}function lastDevicePoint(as){return as[as.length-1]}function getVelocity(as,rs){if(as.length<2)return{x:0,y:0};let ns=as.length-1,ss=null;const os=lastDevicePoint(as);for(;ns>=0&&(ss=as[ns],!(os.timestamp-ss.timestamp>secondsToMilliseconds(rs)));)ns--;if(!ss)return{x:0,y:0};const ls=millisecondsToSeconds(os.timestamp-ss.timestamp);if(ls===0)return{x:0,y:0};const us={x:(os.x-ss.x)/ls,y:(os.y-ss.y)/ls};return us.x===1/0&&(us.x=0),us.y===1/0&&(us.y=0),us}function calcLength(as){return as.max-as.min}function isNear(as,rs=0,ns=.01){return Math.abs(as-rs)<=ns}function calcAxisDelta(as,rs,ns,ss=.5){as.origin=ss,as.originPoint=mix(rs.min,rs.max,as.origin),as.scale=calcLength(ns)/calcLength(rs),(isNear(as.scale,1,1e-4)||isNaN(as.scale))&&(as.scale=1),as.translate=mix(ns.min,ns.max,as.origin)-as.originPoint,(isNear(as.translate)||isNaN(as.translate))&&(as.translate=0)}function calcBoxDelta(as,rs,ns,ss){calcAxisDelta(as.x,rs.x,ns.x,ss?ss.originX:void 0),calcAxisDelta(as.y,rs.y,ns.y,ss?ss.originY:void 0)}function calcRelativeAxis(as,rs,ns){as.min=ns.min+rs.min,as.max=as.min+calcLength(rs)}function calcRelativeBox(as,rs,ns){calcRelativeAxis(as.x,rs.x,ns.x),calcRelativeAxis(as.y,rs.y,ns.y)}function calcRelativeAxisPosition(as,rs,ns){as.min=rs.min-ns.min,as.max=as.min+calcLength(rs)}function calcRelativePosition(as,rs,ns){calcRelativeAxisPosition(as.x,rs.x,ns.x),calcRelativeAxisPosition(as.y,rs.y,ns.y)}function applyConstraints(as,{min:rs,max:ns},ss){return rs!==void 0&&asns&&(as=ss?mix(ns,as,ss.max):Math.min(as,ns)),as}function calcRelativeAxisConstraints(as,rs,ns){return{min:rs!==void 0?as.min+rs:void 0,max:ns!==void 0?as.max+ns-(as.max-as.min):void 0}}function calcRelativeConstraints(as,{top:rs,left:ns,bottom:ss,right:os}){return{x:calcRelativeAxisConstraints(as.x,ns,os),y:calcRelativeAxisConstraints(as.y,rs,ss)}}function calcViewportAxisConstraints(as,rs){let ns=rs.min-as.min,ss=rs.max-as.max;return rs.max-rs.minss?ns=progress(rs.min,rs.max-ss,as.min):ss>os&&(ns=progress(as.min,as.max-os,rs.min)),clamp$1(0,1,ns)}function rebaseAxisConstraints(as,rs){const ns={};return rs.min!==void 0&&(ns.min=rs.min-as.min),rs.max!==void 0&&(ns.max=rs.max-as.min),ns}const defaultElastic=.35;function resolveDragElastic(as=defaultElastic){return as===!1?as=0:as===!0&&(as=defaultElastic),{x:resolveAxisElastic(as,"left","right"),y:resolveAxisElastic(as,"top","bottom")}}function resolveAxisElastic(as,rs,ns){return{min:resolvePointElastic(as,rs),max:resolvePointElastic(as,ns)}}function resolvePointElastic(as,rs){return typeof as=="number"?as:as[rs]||0}const createAxisDelta=()=>({translate:0,scale:1,origin:0,originPoint:0}),createDelta=()=>({x:createAxisDelta(),y:createAxisDelta()}),createAxis=()=>({min:0,max:0}),createBox=()=>({x:createAxis(),y:createAxis()});function eachAxis(as){return[as("x"),as("y")]}function convertBoundingBoxToBox({top:as,left:rs,right:ns,bottom:ss}){return{x:{min:rs,max:ns},y:{min:as,max:ss}}}function convertBoxToBoundingBox({x:as,y:rs}){return{top:rs.min,right:as.max,bottom:rs.max,left:as.min}}function transformBoxPoints(as,rs){if(!rs)return as;const ns=rs({x:as.left,y:as.top}),ss=rs({x:as.right,y:as.bottom});return{top:ns.y,left:ns.x,bottom:ss.y,right:ss.x}}function isIdentityScale(as){return as===void 0||as===1}function hasScale({scale:as,scaleX:rs,scaleY:ns}){return!isIdentityScale(as)||!isIdentityScale(rs)||!isIdentityScale(ns)}function hasTransform(as){return hasScale(as)||has2DTranslate(as)||as.z||as.rotate||as.rotateX||as.rotateY}function has2DTranslate(as){return is2DTranslate(as.x)||is2DTranslate(as.y)}function is2DTranslate(as){return as&&as!=="0%"}function scalePoint(as,rs,ns){const ss=as-ns,os=rs*ss;return ns+os}function applyPointDelta(as,rs,ns,ss,os){return os!==void 0&&(as=scalePoint(as,os,ss)),scalePoint(as,ns,ss)+rs}function applyAxisDelta(as,rs=0,ns=1,ss,os){as.min=applyPointDelta(as.min,rs,ns,ss,os),as.max=applyPointDelta(as.max,rs,ns,ss,os)}function applyBoxDelta(as,{x:rs,y:ns}){applyAxisDelta(as.x,rs.translate,rs.scale,rs.originPoint),applyAxisDelta(as.y,ns.translate,ns.scale,ns.originPoint)}function applyTreeDeltas(as,rs,ns,ss=!1){const os=ns.length;if(!os)return;rs.x=rs.y=1;let ls,us;for(let cs=0;cs1.0000000000001||as<.999999999999?as:1}function translateAxis(as,rs){as.min=as.min+rs,as.max=as.max+rs}function transformAxis(as,rs,[ns,ss,os]){const ls=rs[os]!==void 0?rs[os]:.5,us=mix(as.min,as.max,ls);applyAxisDelta(as,rs[ns],rs[ss],us,rs.scale)}const xKeys$1=["x","scaleX","originX"],yKeys$1=["y","scaleY","originY"];function transformBox(as,rs){transformAxis(as.x,rs,xKeys$1),transformAxis(as.y,rs,yKeys$1)}function measureViewportBox(as,rs){return convertBoundingBoxToBox(transformBoxPoints(as.getBoundingClientRect(),rs))}function measurePageBox(as,rs,ns){const ss=measureViewportBox(as,ns),{scroll:os}=rs;return os&&(translateAxis(ss.x,os.offset.x),translateAxis(ss.y,os.offset.y)),ss}const elementDragControls=new WeakMap;class VisualElementDragControls{constructor(rs){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=createBox(),this.visualElement=rs}start(rs,{snapToCursor:ns=!1}={}){const{presenceContext:ss}=this.visualElement;if(ss&&ss.isPresent===!1)return;const os=ds=>{this.stopAnimation(),ns&&this.snapToCursor(extractEventInfo(ds,"page").point)},ls=(ds,ps)=>{const{drag:fs,dragPropagation:hs,onDragStart:gs}=this.getProps();if(fs&&!hs&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=getGlobalLock(fs),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),eachAxis(bs=>{let vs=this.getAxisMotionValue(bs).get()||0;if(percent.test(vs)){const{projection:xs}=this.visualElement;if(xs&&xs.layout){const Cs=xs.layout.layoutBox[bs];Cs&&(vs=calcLength(Cs)*(parseFloat(vs)/100))}}this.originPoint[bs]=vs}),gs&&sync.update(()=>gs(ds,ps));const{animationState:ys}=this.visualElement;ys&&ys.setActive("whileDrag",!0)},us=(ds,ps)=>{const{dragPropagation:fs,dragDirectionLock:hs,onDirectionLock:gs,onDrag:ys}=this.getProps();if(!fs&&!this.openGlobalLock)return;const{offset:bs}=ps;if(hs&&this.currentDirection===null){this.currentDirection=getCurrentDirection(bs),this.currentDirection!==null&&gs&&gs(this.currentDirection);return}this.updateAxis("x",ps.point,bs),this.updateAxis("y",ps.point,bs),this.visualElement.render(),ys&&ys(ds,ps)},cs=(ds,ps)=>this.stop(ds,ps);this.panSession=new PanSession(rs,{onSessionStart:os,onStart:ls,onMove:us,onSessionEnd:cs},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(rs,ns){const ss=this.isDragging;if(this.cancel(),!ss)return;const{velocity:os}=ns;this.startAnimation(os);const{onDragEnd:ls}=this.getProps();ls&&sync.update(()=>ls(rs,ns))}cancel(){this.isDragging=!1;const{projection:rs,animationState:ns}=this.visualElement;rs&&(rs.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:ss}=this.getProps();!ss&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),ns&&ns.setActive("whileDrag",!1)}updateAxis(rs,ns,ss){const{drag:os}=this.getProps();if(!ss||!shouldDrag(rs,os,this.currentDirection))return;const ls=this.getAxisMotionValue(rs);let us=this.originPoint[rs]+ss[rs];this.constraints&&this.constraints[rs]&&(us=applyConstraints(us,this.constraints[rs],this.elastic[rs])),ls.set(us)}resolveConstraints(){const{dragConstraints:rs,dragElastic:ns}=this.getProps(),{layout:ss}=this.visualElement.projection||{},os=this.constraints;rs&&isRefObject(rs)?this.constraints||(this.constraints=this.resolveRefConstraints()):rs&&ss?this.constraints=calcRelativeConstraints(ss.layoutBox,rs):this.constraints=!1,this.elastic=resolveDragElastic(ns),os!==this.constraints&&ss&&this.constraints&&!this.hasMutatedConstraints&&eachAxis(ls=>{this.getAxisMotionValue(ls)&&(this.constraints[ls]=rebaseAxisConstraints(ss.layoutBox[ls],this.constraints[ls]))})}resolveRefConstraints(){const{dragConstraints:rs,onMeasureDragConstraints:ns}=this.getProps();if(!rs||!isRefObject(rs))return!1;const ss=rs.current,{projection:os}=this.visualElement;if(!os||!os.layout)return!1;const ls=measurePageBox(ss,os.root,this.visualElement.getTransformPagePoint());let us=calcViewportConstraints(os.layout.layoutBox,ls);if(ns){const cs=ns(convertBoxToBoundingBox(us));this.hasMutatedConstraints=!!cs,cs&&(us=convertBoundingBoxToBox(cs))}return us}startAnimation(rs){const{drag:ns,dragMomentum:ss,dragElastic:os,dragTransition:ls,dragSnapToOrigin:us,onDragTransitionEnd:cs}=this.getProps(),ds=this.constraints||{},ps=eachAxis(fs=>{if(!shouldDrag(fs,ns,this.currentDirection))return;let hs=ds&&ds[fs]||{};us&&(hs={min:0,max:0});const gs=os?200:1e6,ys=os?40:1e7,bs={type:"inertia",velocity:ss?rs[fs]:0,bounceStiffness:gs,bounceDamping:ys,timeConstant:750,restDelta:1,restSpeed:10,...ls,...hs};return this.startAxisValueAnimation(fs,bs)});return Promise.all(ps).then(cs)}startAxisValueAnimation(rs,ns){const ss=this.getAxisMotionValue(rs);return ss.start(animateMotionValue(rs,ss,0,ns))}stopAnimation(){eachAxis(rs=>this.getAxisMotionValue(rs).stop())}getAxisMotionValue(rs){const ns="_drag"+rs.toUpperCase(),ss=this.visualElement.getProps(),os=ss[ns];return os||this.visualElement.getValue(rs,(ss.initial?ss.initial[rs]:void 0)||0)}snapToCursor(rs){eachAxis(ns=>{const{drag:ss}=this.getProps();if(!shouldDrag(ns,ss,this.currentDirection))return;const{projection:os}=this.visualElement,ls=this.getAxisMotionValue(ns);if(os&&os.layout){const{min:us,max:cs}=os.layout.layoutBox[ns];ls.set(rs[ns]-mix(us,cs,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:rs,dragConstraints:ns}=this.getProps(),{projection:ss}=this.visualElement;if(!isRefObject(ns)||!ss||!this.constraints)return;this.stopAnimation();const os={x:0,y:0};eachAxis(us=>{const cs=this.getAxisMotionValue(us);if(cs){const ds=cs.get();os[us]=calcOrigin({min:ds,max:ds},this.constraints[us])}});const{transformTemplate:ls}=this.visualElement.getProps();this.visualElement.current.style.transform=ls?ls({},""):"none",ss.root&&ss.root.updateScroll(),ss.updateLayout(),this.resolveConstraints(),eachAxis(us=>{if(!shouldDrag(us,rs,null))return;const cs=this.getAxisMotionValue(us),{min:ds,max:ps}=this.constraints[us];cs.set(mix(ds,ps,os[us]))})}addListeners(){if(!this.visualElement.current)return;elementDragControls.set(this.visualElement,this);const rs=this.visualElement.current,ns=addPointerEvent(rs,"pointerdown",ds=>{const{drag:ps,dragListener:fs=!0}=this.getProps();ps&&fs&&this.start(ds)}),ss=()=>{const{dragConstraints:ds}=this.getProps();isRefObject(ds)&&(this.constraints=this.resolveRefConstraints())},{projection:os}=this.visualElement,ls=os.addEventListener("measure",ss);os&&!os.layout&&(os.root&&os.root.updateScroll(),os.updateLayout()),ss();const us=addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints()),cs=os.addEventListener("didUpdate",({delta:ds,hasLayoutChanged:ps})=>{this.isDragging&&ps&&(eachAxis(fs=>{const hs=this.getAxisMotionValue(fs);hs&&(this.originPoint[fs]+=ds[fs].translate,hs.set(hs.get()+ds[fs].translate))}),this.visualElement.render())});return()=>{us(),ns(),ls(),cs&&cs()}}getProps(){const rs=this.visualElement.getProps(),{drag:ns=!1,dragDirectionLock:ss=!1,dragPropagation:os=!1,dragConstraints:ls=!1,dragElastic:us=defaultElastic,dragMomentum:cs=!0}=rs;return{...rs,drag:ns,dragDirectionLock:ss,dragPropagation:os,dragConstraints:ls,dragElastic:us,dragMomentum:cs}}}function shouldDrag(as,rs,ns){return(rs===!0||rs===as)&&(ns===null||ns===as)}function getCurrentDirection(as,rs=10){let ns=null;return Math.abs(as.y)>rs?ns="y":Math.abs(as.x)>rs&&(ns="x"),ns}class DragGesture extends Feature{constructor(rs){super(rs),this.removeGroupControls=noop$1,this.removeListeners=noop$1,this.controls=new VisualElementDragControls(rs)}mount(){const{dragControls:rs}=this.node.getProps();rs&&(this.removeGroupControls=rs.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||noop$1}unmount(){this.removeGroupControls(),this.removeListeners()}}const asyncHandler=as=>(rs,ns)=>{as&&sync.update(()=>as(rs,ns))};class PanGesture extends Feature{constructor(){super(...arguments),this.removePointerDownListener=noop$1}onPointerDown(rs){this.session=new PanSession(rs,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:rs,onPanStart:ns,onPan:ss,onPanEnd:os}=this.node.getProps();return{onSessionStart:asyncHandler(rs),onStart:asyncHandler(ns),onMove:ss,onEnd:(ls,us)=>{delete this.session,os&&sync.update(()=>os(ls,us))}}}mount(){this.removePointerDownListener=addPointerEvent(this.node.current,"pointerdown",rs=>this.onPointerDown(rs))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function usePresence(){const as=reactExports.useContext(PresenceContext);if(as===null)return[!0,null];const{isPresent:rs,onExitComplete:ns,register:ss}=as,os=reactExports.useId();return reactExports.useEffect(()=>ss(os),[]),!rs&&ns?[!1,()=>ns&&ns(os)]:[!0]}function useIsPresent(){return isPresent(reactExports.useContext(PresenceContext))}function isPresent(as){return as===null?!0:as.isPresent}function pixelsToPercent(as,rs){return rs.max===rs.min?0:as/(rs.max-rs.min)*100}const correctBorderRadius={correct:(as,rs)=>{if(!rs.target)return as;if(typeof as=="string")if(px$1.test(as))as=parseFloat(as);else return as;const ns=pixelsToPercent(as,rs.target.x),ss=pixelsToPercent(as,rs.target.y);return`${ns}% ${ss}%`}},cssVariableRegex=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function parseCSSVariable(as){const rs=cssVariableRegex.exec(as);if(!rs)return[,];const[,ns,ss]=rs;return[ns,ss]}function getVariableValue(as,rs,ns=1){const[ss,os]=parseCSSVariable(as);if(!ss)return;const ls=window.getComputedStyle(rs).getPropertyValue(ss);return ls?ls.trim():isCSSVariableToken(os)?getVariableValue(os,rs,ns+1):os}function resolveCSSVariables(as,{...rs},ns){const ss=as.current;if(!(ss instanceof Element))return{target:rs,transitionEnd:ns};ns&&(ns={...ns}),as.values.forEach(os=>{const ls=os.get();if(!isCSSVariableToken(ls))return;const us=getVariableValue(ls,ss);us&&os.set(us)});for(const os in rs){const ls=rs[os];if(!isCSSVariableToken(ls))continue;const us=getVariableValue(ls,ss);us&&(rs[os]=us,ns||(ns={}),ns[os]===void 0&&(ns[os]=ls))}return{target:rs,transitionEnd:ns}}const varToken="_$css",correctBoxShadow={correct:(as,{treeScale:rs,projectionDelta:ns})=>{const ss=as,os=as.includes("var("),ls=[];os&&(as=as.replace(cssVariableRegex,ys=>(ls.push(ys),varToken)));const us=complex.parse(as);if(us.length>5)return ss;const cs=complex.createTransformer(as),ds=typeof us[0]!="number"?1:0,ps=ns.x.scale*rs.x,fs=ns.y.scale*rs.y;us[0+ds]/=ps,us[1+ds]/=fs;const hs=mix(ps,fs,.5);typeof us[2+ds]=="number"&&(us[2+ds]/=hs),typeof us[3+ds]=="number"&&(us[3+ds]/=hs);let gs=cs(us);if(os){let ys=0;gs=gs.replace(varToken,()=>{const bs=ls[ys];return ys++,bs})}return gs}};class MeasureLayoutWithContext extends React.Component{componentDidMount(){const{visualElement:rs,layoutGroup:ns,switchLayoutGroup:ss,layoutId:os}=this.props,{projection:ls}=rs;addScaleCorrector(defaultScaleCorrectors),ls&&(ns.group&&ns.group.add(ls),ss&&ss.register&&os&&ss.register(ls),ls.root.didUpdate(),ls.addEventListener("animationComplete",()=>{this.safeToRemove()}),ls.setOptions({...ls.options,onExitComplete:()=>this.safeToRemove()})),globalProjectionState.hasEverUpdated=!0}getSnapshotBeforeUpdate(rs){const{layoutDependency:ns,visualElement:ss,drag:os,isPresent:ls}=this.props,us=ss.projection;return us&&(us.isPresent=ls,os||rs.layoutDependency!==ns||ns===void 0?us.willUpdate():this.safeToRemove(),rs.isPresent!==ls&&(ls?us.promote():us.relegate()||sync.postRender(()=>{const cs=us.getStack();(!cs||!cs.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:rs}=this.props.visualElement;rs&&(rs.root.didUpdate(),!rs.currentAnimation&&rs.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:rs,layoutGroup:ns,switchLayoutGroup:ss}=this.props,{projection:os}=rs;os&&(os.scheduleCheckAfterUnmount(),ns&&ns.group&&ns.group.remove(os),ss&&ss.deregister&&ss.deregister(os))}safeToRemove(){const{safeToRemove:rs}=this.props;rs&&rs()}render(){return null}}function MeasureLayout(as){const[rs,ns]=usePresence(),ss=reactExports.useContext(LayoutGroupContext);return React.createElement(MeasureLayoutWithContext,{...as,layoutGroup:ss,switchLayoutGroup:reactExports.useContext(SwitchLayoutGroupContext),isPresent:rs,safeToRemove:ns})}const defaultScaleCorrectors={borderRadius:{...correctBorderRadius,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=as=>typeof as=="string"?parseFloat(as):as,isPx=as=>typeof as=="number"||px$1.test(as);function mixValues(as,rs,ns,ss,os,ls){os?(as.opacity=mix(0,ns.opacity!==void 0?ns.opacity:1,easeCrossfadeIn(ss)),as.opacityExit=mix(rs.opacity!==void 0?rs.opacity:1,0,easeCrossfadeOut(ss))):ls&&(as.opacity=mix(rs.opacity!==void 0?rs.opacity:1,ns.opacity!==void 0?ns.opacity:1,ss));for(let us=0;usssrs?1:ns(progress(as,rs,ss))}function copyAxisInto(as,rs){as.min=rs.min,as.max=rs.max}function copyBoxInto(as,rs){copyAxisInto(as.x,rs.x),copyAxisInto(as.y,rs.y)}function removePointDelta(as,rs,ns,ss,os){return as-=rs,as=scalePoint(as,1/ns,ss),os!==void 0&&(as=scalePoint(as,1/os,ss)),as}function removeAxisDelta(as,rs=0,ns=1,ss=.5,os,ls=as,us=as){if(percent.test(rs)&&(rs=parseFloat(rs),rs=mix(us.min,us.max,rs/100)-us.min),typeof rs!="number")return;let cs=mix(ls.min,ls.max,ss);as===ls&&(cs-=rs),as.min=removePointDelta(as.min,rs,ns,cs,os),as.max=removePointDelta(as.max,rs,ns,cs,os)}function removeAxisTransforms(as,rs,[ns,ss,os],ls,us){removeAxisDelta(as,rs[ns],rs[ss],rs[os],rs.scale,ls,us)}const xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(as,rs,ns,ss){removeAxisTransforms(as.x,rs,xKeys,ns?ns.x:void 0,ss?ss.x:void 0),removeAxisTransforms(as.y,rs,yKeys,ns?ns.y:void 0,ss?ss.y:void 0)}function isAxisDeltaZero(as){return as.translate===0&&as.scale===1}function isDeltaZero(as){return isAxisDeltaZero(as.x)&&isAxisDeltaZero(as.y)}function boxEquals(as,rs){return as.x.min===rs.x.min&&as.x.max===rs.x.max&&as.y.min===rs.y.min&&as.y.max===rs.y.max}function aspectRatio(as){return calcLength(as.x)/calcLength(as.y)}class NodeStack{constructor(){this.members=[]}add(rs){addUniqueItem(this.members,rs),rs.scheduleRender()}remove(rs){if(removeItem(this.members,rs),rs===this.prevLead&&(this.prevLead=void 0),rs===this.lead){const ns=this.members[this.members.length-1];ns&&this.promote(ns)}}relegate(rs){const ns=this.members.findIndex(os=>rs===os);if(ns===0)return!1;let ss;for(let os=ns;os>=0;os--){const ls=this.members[os];if(ls.isPresent!==!1){ss=ls;break}}return ss?(this.promote(ss),!0):!1}promote(rs,ns){const ss=this.lead;if(rs!==ss&&(this.prevLead=ss,this.lead=rs,rs.show(),ss)){ss.instance&&ss.scheduleRender(),rs.scheduleRender(),rs.resumeFrom=ss,ns&&(rs.resumeFrom.preserveOpacity=!0),ss.snapshot&&(rs.snapshot=ss.snapshot,rs.snapshot.latestValues=ss.animationValues||ss.latestValues),rs.root&&rs.root.isUpdating&&(rs.isLayoutDirty=!0);const{crossfade:os}=rs.options;os===!1&&ss.hide()}}exitAnimationComplete(){this.members.forEach(rs=>{const{options:ns,resumingFrom:ss}=rs;ns.onExitComplete&&ns.onExitComplete(),ss&&ss.options.onExitComplete&&ss.options.onExitComplete()})}scheduleRender(){this.members.forEach(rs=>{rs.instance&&rs.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function buildProjectionTransform(as,rs,ns){let ss="";const os=as.x.translate/rs.x,ls=as.y.translate/rs.y;if((os||ls)&&(ss=`translate3d(${os}px, ${ls}px, 0) `),(rs.x!==1||rs.y!==1)&&(ss+=`scale(${1/rs.x}, ${1/rs.y}) `),ns){const{rotate:ds,rotateX:ps,rotateY:fs}=ns;ds&&(ss+=`rotate(${ds}deg) `),ps&&(ss+=`rotateX(${ps}deg) `),fs&&(ss+=`rotateY(${fs}deg) `)}const us=as.x.scale*rs.x,cs=as.y.scale*rs.y;return(us!==1||cs!==1)&&(ss+=`scale(${us}, ${cs})`),ss||"none"}const compareByDepth=(as,rs)=>as.depth-rs.depth;class FlatTree{constructor(){this.children=[],this.isDirty=!1}add(rs){addUniqueItem(this.children,rs),this.isDirty=!0}remove(rs){removeItem(this.children,rs),this.isDirty=!0}forEach(rs){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(rs)}}function delay(as,rs){const ns=performance.now(),ss=({timestamp:os})=>{const ls=os-ns;ls>=rs&&(cancelSync.read(ss),as(ls-rs))};return sync.read(ss,!0),()=>cancelSync.read(ss)}function record(as){window.MotionDebug&&window.MotionDebug.record(as)}function isSVGElement(as){return as instanceof SVGElement&&as.tagName!=="svg"}function animateSingleValue(as,rs,ns){const ss=isMotionValue(as)?as:motionValue(as);return ss.start(animateMotionValue("",ss,rs,ns)),ss.animation}const transformAxes=["","X","Y","Z"],animationTarget=1e3;let id$1=0;const projectionFrameData={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function createProjectionNode({attachResizeListener:as,defaultParent:rs,measureScroll:ns,checkIsScrollRoot:ss,resetTransform:os}){return class{constructor(us,cs={},ds=rs==null?void 0:rs()){this.id=id$1++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{projectionFrameData.totalNodes=projectionFrameData.resolvedTargetDeltas=projectionFrameData.recalculatedProjection=0,this.nodes.forEach(propagateDirtyNodes),this.nodes.forEach(resolveTargetDelta),this.nodes.forEach(calcProjection),this.nodes.forEach(cleanDirtyNodes),record(projectionFrameData)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=us,this.latestValues=cs,this.root=ds?ds.root||ds:this,this.path=ds?[...ds.path,ds]:[],this.parent=ds,this.depth=ds?ds.depth+1:0,us&&this.root.registerPotentialNode(us,this);for(let ps=0;psthis.root.updateBlockedByResize=!1;as(us,()=>{this.root.updateBlockedByResize=!0,hs&&hs(),hs=delay(gs,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,this.nodes.forEach(finishAnimation))})}ds&&this.root.registerSharedNode(ds,this),this.options.animate!==!1&&fs&&(ds||ps)&&this.addEventListener("didUpdate",({delta:hs,hasLayoutChanged:gs,hasRelativeTargetChanged:ys,layout:bs})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const vs=this.options.transition||fs.getDefaultTransition()||defaultLayoutTransition,{onLayoutAnimationStart:xs,onLayoutAnimationComplete:Cs}=fs.getProps(),Ts=!this.targetLayout||!boxEquals(this.targetLayout,bs)||ys,Ss=!gs&&ys;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||Ss||gs&&(Ts||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(hs,Ss);const Ns={...getValueTransition(vs,"layout"),onPlay:xs,onComplete:Cs};(fs.shouldReduceMotion||this.options.layoutRoot)&&(Ns.delay=0,Ns.type=!1),this.startAnimation(Ns)}else!gs&&this.animationProgress===0&&finishAnimation(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=bs})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const us=this.getStack();us&&us.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cancelSync.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(resetRotation),this.animationId++)}getTransformTemplate(){const{visualElement:us}=this.options;return us&&us.getProps().transformTemplate}willUpdate(us=!0){if(this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let fs=0;fs{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let ds=0;ds{const As=Ns/1e3;mixAxisDelta(hs.x,us.x,As),mixAxisDelta(hs.y,us.y,As),this.setTargetDelta(hs),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(calcRelativePosition(gs,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mixBox(this.relativeTarget,this.relativeTargetOrigin,gs,As),Ss&&boxEquals(this.relativeTarget,Ss)&&(this.isProjectionDirty=!1),Ss||(Ss=createBox()),copyBoxInto(Ss,this.relativeTarget)),vs&&(this.animationValues=fs,mixValues(fs,ps,this.latestValues,As,Ts,Cs)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=As},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(us){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cancelSync.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=sync.update(()=>{globalProjectionState.hasAnimatedSinceResize=!0,this.currentAnimation=animateSingleValue(0,animationTarget,{...us,onUpdate:cs=>{this.mixTargetDelta(cs),us.onUpdate&&us.onUpdate(cs)},onComplete:()=>{us.onComplete&&us.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const us=this.getStack();us&&us.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(animationTarget),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const us=this.getLead();let{targetWithTransforms:cs,target:ds,layout:ps,latestValues:fs}=us;if(!(!cs||!ds||!ps)){if(this!==us&&this.layout&&ps&&shouldAnimatePositionOnly(this.options.animationType,this.layout.layoutBox,ps.layoutBox)){ds=this.target||createBox();const hs=calcLength(this.layout.layoutBox.x);ds.x.min=us.target.x.min,ds.x.max=ds.x.min+hs;const gs=calcLength(this.layout.layoutBox.y);ds.y.min=us.target.y.min,ds.y.max=ds.y.min+gs}copyBoxInto(cs,ds),transformBox(cs,fs),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,cs,fs)}}registerSharedNode(us,cs){this.sharedNodes.has(us)||this.sharedNodes.set(us,new NodeStack),this.sharedNodes.get(us).add(cs);const ps=cs.options.initialPromotionConfig;cs.promote({transition:ps?ps.transition:void 0,preserveFollowOpacity:ps&&ps.shouldPreserveFollowOpacity?ps.shouldPreserveFollowOpacity(cs):void 0})}isLead(){const us=this.getStack();return us?us.lead===this:!0}getLead(){var us;const{layoutId:cs}=this.options;return cs?((us=this.getStack())===null||us===void 0?void 0:us.lead)||this:this}getPrevLead(){var us;const{layoutId:cs}=this.options;return cs?(us=this.getStack())===null||us===void 0?void 0:us.prevLead:void 0}getStack(){const{layoutId:us}=this.options;if(us)return this.root.sharedNodes.get(us)}promote({needsReset:us,transition:cs,preserveFollowOpacity:ds}={}){const ps=this.getStack();ps&&ps.promote(this,ds),us&&(this.projectionDelta=void 0,this.needsReset=!0),cs&&this.setOptions({transition:cs})}relegate(){const us=this.getStack();return us?us.relegate(this):!1}resetRotation(){const{visualElement:us}=this.options;if(!us)return;let cs=!1;const{latestValues:ds}=us;if((ds.rotate||ds.rotateX||ds.rotateY||ds.rotateZ)&&(cs=!0),!cs)return;const ps={};for(let fs=0;fs{var cs;return(cs=us.currentAnimation)===null||cs===void 0?void 0:cs.stop()}),this.root.nodes.forEach(clearMeasurements),this.root.sharedNodes.clear()}}}function updateLayout(as){as.updateLayout()}function notifyLayoutUpdate(as){var rs;const ns=((rs=as.resumeFrom)===null||rs===void 0?void 0:rs.snapshot)||as.snapshot;if(as.isLead()&&as.layout&&ns&&as.hasListeners("didUpdate")){const{layoutBox:ss,measuredBox:os}=as.layout,{animationType:ls}=as.options,us=ns.source!==as.layout.source;ls==="size"?eachAxis(hs=>{const gs=us?ns.measuredBox[hs]:ns.layoutBox[hs],ys=calcLength(gs);gs.min=ss[hs].min,gs.max=gs.min+ys}):shouldAnimatePositionOnly(ls,ns.layoutBox,ss)&&eachAxis(hs=>{const gs=us?ns.measuredBox[hs]:ns.layoutBox[hs],ys=calcLength(ss[hs]);gs.max=gs.min+ys});const cs=createDelta();calcBoxDelta(cs,ss,ns.layoutBox);const ds=createDelta();us?calcBoxDelta(ds,as.applyTransform(os,!0),ns.measuredBox):calcBoxDelta(ds,ss,ns.layoutBox);const ps=!isDeltaZero(cs);let fs=!1;if(!as.resumeFrom){const hs=as.getClosestProjectingParent();if(hs&&!hs.resumeFrom){const{snapshot:gs,layout:ys}=hs;if(gs&&ys){const bs=createBox();calcRelativePosition(bs,ns.layoutBox,gs.layoutBox);const vs=createBox();calcRelativePosition(vs,ss,ys.layoutBox),boxEquals(bs,vs)||(fs=!0),hs.options.layoutRoot&&(as.relativeTarget=vs,as.relativeTargetOrigin=bs,as.relativeParent=hs)}}}as.notifyListeners("didUpdate",{layout:ss,snapshot:ns,delta:ds,layoutDelta:cs,hasLayoutChanged:ps,hasRelativeTargetChanged:fs})}else if(as.isLead()){const{onExitComplete:ss}=as.options;ss&&ss()}as.options.transition=void 0}function propagateDirtyNodes(as){projectionFrameData.totalNodes++,as.parent&&(as.isProjecting()||(as.isProjectionDirty=as.parent.isProjectionDirty),as.isSharedProjectionDirty||(as.isSharedProjectionDirty=!!(as.isProjectionDirty||as.parent.isProjectionDirty||as.parent.isSharedProjectionDirty)),as.isTransformDirty||(as.isTransformDirty=as.parent.isTransformDirty))}function cleanDirtyNodes(as){as.isProjectionDirty=as.isSharedProjectionDirty=as.isTransformDirty=!1}function clearSnapshot(as){as.clearSnapshot()}function clearMeasurements(as){as.clearMeasurements()}function resetTransformStyle(as){const{visualElement:rs}=as.options;rs&&rs.getProps().onBeforeLayoutMeasure&&rs.notify("BeforeLayoutMeasure"),as.resetTransform()}function finishAnimation(as){as.finishAnimation(),as.targetDelta=as.relativeTarget=as.target=void 0}function resolveTargetDelta(as){as.resolveTargetDelta()}function calcProjection(as){as.calcProjection()}function resetRotation(as){as.resetRotation()}function removeLeadSnapshots(as){as.removeLeadSnapshot()}function mixAxisDelta(as,rs,ns){as.translate=mix(rs.translate,0,ns),as.scale=mix(rs.scale,1,ns),as.origin=rs.origin,as.originPoint=rs.originPoint}function mixAxis(as,rs,ns,ss){as.min=mix(rs.min,ns.min,ss),as.max=mix(rs.max,ns.max,ss)}function mixBox(as,rs,ns,ss){mixAxis(as.x,rs.x,ns.x,ss),mixAxis(as.y,rs.y,ns.y,ss)}function hasOpacityCrossfade(as){return as.animationValues&&as.animationValues.opacityExit!==void 0}const defaultLayoutTransition={duration:.45,ease:[.4,0,.1,1]};function mountNodeEarly(as,rs){let ns=as.root;for(let ls=as.path.length-1;ls>=0;ls--)if(as.path[ls].instance){ns=as.path[ls];break}const os=(ns&&ns!==as.root?ns.instance:document).querySelector(`[data-projection-id="${rs}"]`);os&&as.mount(os,!0)}function roundAxis(as){as.min=Math.round(as.min),as.max=Math.round(as.max)}function roundBox(as){roundAxis(as.x),roundAxis(as.y)}function shouldAnimatePositionOnly(as,rs,ns){return as==="position"||as==="preserve-aspect"&&!isNear(aspectRatio(rs),aspectRatio(ns),.2)}const DocumentProjectionNode=createProjectionNode({attachResizeListener:(as,rs)=>addDomEvent(as,"resize",rs),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode({measureScroll:as=>({x:as.scrollLeft,y:as.scrollTop}),defaultParent:()=>{if(!rootProjectionNode.current){const as=new DocumentProjectionNode(0,{});as.mount(window),as.setOptions({layoutScroll:!0}),rootProjectionNode.current=as}return rootProjectionNode.current},resetTransform:(as,rs)=>{as.style.transform=rs!==void 0?rs:"none"},checkIsScrollRoot:as=>window.getComputedStyle(as).position==="fixed"}),drag={pan:{Feature:PanGesture},drag:{Feature:DragGesture,ProjectionNode:HTMLProjectionNode,MeasureLayout}},positionalKeys=new Set(["width","height","top","left","right","bottom","x","y"]),isPositionalKey=as=>positionalKeys.has(as),hasPositionalKey=as=>Object.keys(as).some(isPositionalKey),isNumOrPxType=as=>as===number||as===px$1,getPosFromMatrix=(as,rs)=>parseFloat(as.split(", ")[rs]),getTranslateFromMatrix=(as,rs)=>(ns,{transform:ss})=>{if(ss==="none"||!ss)return 0;const os=ss.match(/^matrix3d\((.+)\)$/);if(os)return getPosFromMatrix(os[1],rs);{const ls=ss.match(/^matrix\((.+)\)$/);return ls?getPosFromMatrix(ls[1],as):0}},transformKeys=new Set(["x","y","z"]),nonTranslationalTransformKeys=transformPropOrder.filter(as=>!transformKeys.has(as));function removeNonTranslationalTransform(as){const rs=[];return nonTranslationalTransformKeys.forEach(ns=>{const ss=as.getValue(ns);ss!==void 0&&(rs.push([ns,ss.get()]),ss.set(ns.startsWith("scale")?1:0))}),rs.length&&as.render(),rs}const positionalValues={width:({x:as},{paddingLeft:rs="0",paddingRight:ns="0"})=>as.max-as.min-parseFloat(rs)-parseFloat(ns),height:({y:as},{paddingTop:rs="0",paddingBottom:ns="0"})=>as.max-as.min-parseFloat(rs)-parseFloat(ns),top:(as,{top:rs})=>parseFloat(rs),left:(as,{left:rs})=>parseFloat(rs),bottom:({y:as},{top:rs})=>parseFloat(rs)+(as.max-as.min),right:({x:as},{left:rs})=>parseFloat(rs)+(as.max-as.min),x:getTranslateFromMatrix(4,13),y:getTranslateFromMatrix(5,14)},convertChangedValueTypes=(as,rs,ns)=>{const ss=rs.measureViewportBox(),os=rs.current,ls=getComputedStyle(os),{display:us}=ls,cs={};us==="none"&&rs.setStaticValue("display",as.display||"block"),ns.forEach(ps=>{cs[ps]=positionalValues[ps](ss,ls)}),rs.render();const ds=rs.measureViewportBox();return ns.forEach(ps=>{const fs=rs.getValue(ps);fs&&fs.jump(cs[ps]),as[ps]=positionalValues[ps](ds,ls)}),as},checkAndConvertChangedValueTypes=(as,rs,ns={},ss={})=>{rs={...rs},ss={...ss};const os=Object.keys(rs).filter(isPositionalKey);let ls=[],us=!1;const cs=[];if(os.forEach(ds=>{const ps=as.getValue(ds);if(!as.hasValue(ds))return;let fs=ns[ds],hs=findDimensionValueType(fs);const gs=rs[ds];let ys;if(isKeyframesTarget(gs)){const bs=gs.length,vs=gs[0]===null?1:0;fs=gs[vs],hs=findDimensionValueType(fs);for(let xs=vs;xs=0?window.pageYOffset:null,ps=convertChangedValueTypes(rs,as,cs);return ls.length&&ls.forEach(([fs,hs])=>{as.getValue(fs).set(hs)}),as.render(),isBrowser&&ds!==null&&window.scrollTo({top:ds}),{target:ps,transitionEnd:ss}}else return{target:rs,transitionEnd:ss}};function unitConversion(as,rs,ns,ss){return hasPositionalKey(rs)?checkAndConvertChangedValueTypes(as,rs,ns,ss):{target:rs,transitionEnd:ss}}const parseDomVariant=(as,rs,ns,ss)=>{const os=resolveCSSVariables(as,rs,ss);return rs=os.target,ss=os.transitionEnd,unitConversion(as,rs,ns,ss)},prefersReducedMotion={current:null},hasReducedMotionListener={current:!1};function initPrefersReducedMotion(){if(hasReducedMotionListener.current=!0,!!isBrowser)if(window.matchMedia){const as=window.matchMedia("(prefers-reduced-motion)"),rs=()=>prefersReducedMotion.current=as.matches;as.addListener(rs),rs()}else prefersReducedMotion.current=!1}function updateMotionValuesFromProps(as,rs,ns){const{willChange:ss}=rs;for(const os in rs){const ls=rs[os],us=ns[os];if(isMotionValue(ls))as.addValue(os,ls),isWillChangeMotionValue(ss)&&ss.add(os);else if(isMotionValue(us))as.addValue(os,motionValue(ls,{owner:as})),isWillChangeMotionValue(ss)&&ss.remove(os);else if(us!==ls)if(as.hasValue(os)){const cs=as.getValue(os);!cs.hasAnimated&&cs.set(ls)}else{const cs=as.getStaticValue(os);as.addValue(os,motionValue(cs!==void 0?cs:ls,{owner:as}))}}for(const os in ns)rs[os]===void 0&&as.removeValue(os);return rs}const visualElementStore=new WeakMap,featureNames=Object.keys(featureDefinitions),numFeatures=featureNames.length,propEventHandlers=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],numVariantProps=variantProps.length;class VisualElement{constructor({parent:rs,props:ns,presenceContext:ss,reducedMotionConfig:os,visualState:ls},us={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>sync.render(this.render,!1,!0);const{latestValues:cs,renderState:ds}=ls;this.latestValues=cs,this.baseTarget={...cs},this.initialValues=ns.initial?{...cs}:{},this.renderState=ds,this.parent=rs,this.props=ns,this.presenceContext=ss,this.depth=rs?rs.depth+1:0,this.reducedMotionConfig=os,this.options=us,this.isControllingVariants=isControllingVariants(ns),this.isVariantNode=isVariantNode(ns),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(rs&&rs.current);const{willChange:ps,...fs}=this.scrapeMotionValuesFromProps(ns,{});for(const hs in fs){const gs=fs[hs];cs[hs]!==void 0&&isMotionValue(gs)&&(gs.set(cs[hs],!1),isWillChangeMotionValue(ps)&&ps.add(hs))}}scrapeMotionValuesFromProps(rs,ns){return{}}mount(rs){this.current=rs,visualElementStore.set(rs,this),this.projection&&this.projection.mount(rs),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((ns,ss)=>this.bindToMotionValue(ss,ns)),hasReducedMotionListener.current||initPrefersReducedMotion(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:prefersReducedMotion.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){visualElementStore.delete(this.current),this.projection&&this.projection.unmount(),cancelSync.update(this.notifyUpdate),cancelSync.render(this.render),this.valueSubscriptions.forEach(rs=>rs()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const rs in this.events)this.events[rs].clear();for(const rs in this.features)this.features[rs].unmount();this.current=null}bindToMotionValue(rs,ns){const ss=transformProps.has(rs),os=ns.on("change",us=>{this.latestValues[rs]=us,this.props.onUpdate&&sync.update(this.notifyUpdate,!1,!0),ss&&this.projection&&(this.projection.isTransformDirty=!0)}),ls=ns.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(rs,()=>{os(),ls()})}sortNodePosition(rs){return!this.current||!this.sortInstanceNodePosition||this.type!==rs.type?0:this.sortInstanceNodePosition(this.current,rs.current)}loadFeatures({children:rs,...ns},ss,os,ls,us){let cs,ds;for(let ps=0;psthis.scheduleRender(),animationType:typeof fs=="string"?fs:"both",initialPromotionConfig:us,layoutScroll:ys,layoutRoot:bs})}return ds}updateFeatures(){for(const rs in this.features){const ns=this.features[rs];ns.isMounted?ns.update(this.props,this.prevProps):(ns.mount(),ns.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):createBox()}getStaticValue(rs){return this.latestValues[rs]}setStaticValue(rs,ns){this.latestValues[rs]=ns}makeTargetAnimatable(rs,ns=!0){return this.makeTargetAnimatableFromInstance(rs,this.props,ns)}update(rs,ns){(rs.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=rs,this.prevPresenceContext=this.presenceContext,this.presenceContext=ns;for(let ss=0;ssns.variantChildren.delete(rs)}addValue(rs,ns){ns!==this.values.get(rs)&&(this.removeValue(rs),this.bindToMotionValue(rs,ns)),this.values.set(rs,ns),this.latestValues[rs]=ns.get()}removeValue(rs){this.values.delete(rs);const ns=this.valueSubscriptions.get(rs);ns&&(ns(),this.valueSubscriptions.delete(rs)),delete this.latestValues[rs],this.removeValueFromRenderState(rs,this.renderState)}hasValue(rs){return this.values.has(rs)}getValue(rs,ns){if(this.props.values&&this.props.values[rs])return this.props.values[rs];let ss=this.values.get(rs);return ss===void 0&&ns!==void 0&&(ss=motionValue(ns,{owner:this}),this.addValue(rs,ss)),ss}readValue(rs){return this.latestValues[rs]!==void 0||!this.current?this.latestValues[rs]:this.readValueFromInstance(this.current,rs,this.options)}setBaseTarget(rs,ns){this.baseTarget[rs]=ns}getBaseTarget(rs){var ns;const{initial:ss}=this.props,os=typeof ss=="string"||typeof ss=="object"?(ns=resolveVariantFromProps(this.props,ss))===null||ns===void 0?void 0:ns[rs]:void 0;if(ss&&os!==void 0)return os;const ls=this.getBaseTargetFromProps(this.props,rs);return ls!==void 0&&!isMotionValue(ls)?ls:this.initialValues[rs]!==void 0&&os===void 0?void 0:this.baseTarget[rs]}on(rs,ns){return this.events[rs]||(this.events[rs]=new SubscriptionManager),this.events[rs].add(ns)}notify(rs,...ns){this.events[rs]&&this.events[rs].notify(...ns)}}class DOMVisualElement extends VisualElement{sortInstanceNodePosition(rs,ns){return rs.compareDocumentPosition(ns)&2?1:-1}getBaseTargetFromProps(rs,ns){return rs.style?rs.style[ns]:void 0}removeValueFromRenderState(rs,{vars:ns,style:ss}){delete ns[rs],delete ss[rs]}makeTargetAnimatableFromInstance({transition:rs,transitionEnd:ns,...ss},{transformValues:os},ls){let us=getOrigin(ss,rs||{},this);if(os&&(ns&&(ns=os(ns)),ss&&(ss=os(ss)),us&&(us=os(us))),ls){checkTargetForNewValues(this,ss,us);const cs=parseDomVariant(this,ss,us,ns);ns=cs.transitionEnd,ss=cs.target}return{transition:rs,transitionEnd:ns,...ss}}}function getComputedStyle$3(as){return window.getComputedStyle(as)}class HTMLVisualElement extends DOMVisualElement{readValueFromInstance(rs,ns){if(transformProps.has(ns)){const ss=getDefaultValueType(ns);return ss&&ss.default||0}else{const ss=getComputedStyle$3(rs),os=(isCSSVariableName(ns)?ss.getPropertyValue(ns):ss[ns])||0;return typeof os=="string"?os.trim():os}}measureInstanceViewportBox(rs,{transformPagePoint:ns}){return measureViewportBox(rs,ns)}build(rs,ns,ss,os){buildHTMLStyles(rs,ns,ss,os.transformTemplate)}scrapeMotionValuesFromProps(rs,ns){return scrapeMotionValuesFromProps$1(rs,ns)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:rs}=this.props;isMotionValue(rs)&&(this.childSubscription=rs.on("change",ns=>{this.current&&(this.current.textContent=`${ns}`)}))}renderInstance(rs,ns,ss,os){renderHTML(rs,ns,ss,os)}}class SVGVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(rs,ns){return rs[ns]}readValueFromInstance(rs,ns){if(transformProps.has(ns)){const ss=getDefaultValueType(ns);return ss&&ss.default||0}return ns=camelCaseAttributes.has(ns)?ns:camelToDash(ns),rs.getAttribute(ns)}measureInstanceViewportBox(){return createBox()}scrapeMotionValuesFromProps(rs,ns){return scrapeMotionValuesFromProps(rs,ns)}build(rs,ns,ss,os){buildSVGAttrs(rs,ns,ss,this.isSVGTag,os.transformTemplate)}renderInstance(rs,ns,ss,os){renderSVG(rs,ns,ss,os)}mount(rs){this.isSVGTag=isSVGTag(rs.tagName),super.mount(rs)}}const createDomVisualElement=(as,rs)=>isSVGComponent(as)?new SVGVisualElement(rs,{enableHardwareAcceleration:!1}):new HTMLVisualElement(rs,{enableHardwareAcceleration:!0}),layout={layout:{ProjectionNode:HTMLProjectionNode,MeasureLayout}},preloadedFeatures={...animations,...gestureAnimations,...drag,...layout},motion=createMotionProxy((as,rs)=>createDomMotionConfig(as,rs,preloadedFeatures,createDomVisualElement));function useIsMounted(){const as=reactExports.useRef(!1);return useIsomorphicLayoutEffect$1(()=>(as.current=!0,()=>{as.current=!1}),[]),as}function useForceUpdate(){const as=useIsMounted(),[rs,ns]=reactExports.useState(0),ss=reactExports.useCallback(()=>{as.current&&ns(rs+1)},[rs]);return[reactExports.useCallback(()=>sync.postRender(ss),[ss]),rs]}class PopChildMeasure extends reactExports.Component{getSnapshotBeforeUpdate(rs){const ns=this.props.childRef.current;if(ns&&rs.isPresent&&!this.props.isPresent){const ss=this.props.sizeRef.current;ss.height=ns.offsetHeight||0,ss.width=ns.offsetWidth||0,ss.top=ns.offsetTop,ss.left=ns.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function PopChild({children:as,isPresent:rs}){const ns=reactExports.useId(),ss=reactExports.useRef(null),os=reactExports.useRef({width:0,height:0,top:0,left:0});return reactExports.useInsertionEffect(()=>{const{width:ls,height:us,top:cs,left:ds}=os.current;if(rs||!ss.current||!ls||!us)return;ss.current.dataset.motionPopId=ns;const ps=document.createElement("style");return document.head.appendChild(ps),ps.sheet&&ps.sheet.insertRule(` + )`;return{...!ss&&os&&ls,...ss?{bgImage:cs}:{bgColor:us}}},baseStyleLabel$2={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},baseStyleTrack$1=as=>({bg:mode("gray.100","whiteAlpha.300")(as)}),baseStyleFilledTrack$1=as=>({transitionProperty:"common",transitionDuration:"slow",...filledStyle(as)}),baseStyle$x=definePartsStyle$j(as=>({label:baseStyleLabel$2,filledTrack:baseStyleFilledTrack$1(as),track:baseStyleTrack$1(as)})),sizes$f={xs:definePartsStyle$j({track:{h:"1"}}),sm:definePartsStyle$j({track:{h:"2"}}),md:definePartsStyle$j({track:{h:"3"}}),lg:definePartsStyle$j({track:{h:"4"}})},progressTheme=defineMultiStyleConfig$j({sizes:sizes$f,baseStyle:baseStyle$x,defaultProps:{size:"md",colorScheme:"blue"}}),isFunction$4=as=>typeof as=="function";function runIfFn$1(as,...rs){return isFunction$4(as)?as(...rs):as}var{definePartsStyle:definePartsStyle$i,defineMultiStyleConfig:defineMultiStyleConfig$i}=createMultiStyleConfigHelpers(checkboxAnatomy.keys),$size$2=cssVar$1("checkbox-size"),baseStyleControl$1=as=>{const{colorScheme:rs}=as;return{w:$size$2.reference,h:$size$2.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:mode(`${rs}.500`,`${rs}.200`)(as),borderColor:mode(`${rs}.500`,`${rs}.200`)(as),color:mode("white","gray.900")(as),_hover:{bg:mode(`${rs}.600`,`${rs}.300`)(as),borderColor:mode(`${rs}.600`,`${rs}.300`)(as)},_disabled:{borderColor:mode("gray.200","transparent")(as),bg:mode("gray.200","whiteAlpha.300")(as),color:mode("gray.500","whiteAlpha.500")(as)}},_indeterminate:{bg:mode(`${rs}.500`,`${rs}.200`)(as),borderColor:mode(`${rs}.500`,`${rs}.200`)(as),color:mode("white","gray.900")(as)},_disabled:{bg:mode("gray.100","whiteAlpha.100")(as),borderColor:mode("gray.100","transparent")(as)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:mode("red.500","red.300")(as)}}},baseStyleContainer$3={_disabled:{cursor:"not-allowed"}},baseStyleLabel$1={userSelect:"none",_disabled:{opacity:.4}},baseStyleIcon$5={transitionProperty:"transform",transitionDuration:"normal"},baseStyle$w=definePartsStyle$i(as=>({icon:baseStyleIcon$5,container:baseStyleContainer$3,control:runIfFn$1(baseStyleControl$1,as),label:baseStyleLabel$1})),sizes$e={sm:definePartsStyle$i({control:{[$size$2.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:definePartsStyle$i({control:{[$size$2.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:definePartsStyle$i({control:{[$size$2.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},checkboxTheme=defineMultiStyleConfig$i({baseStyle:baseStyle$w,sizes:sizes$e,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$h,definePartsStyle:definePartsStyle$h}=createMultiStyleConfigHelpers(radioAnatomy.keys),baseStyleControl=as=>{var rs;const ns=(rs=runIfFn$1(checkboxTheme.baseStyle,as))==null?void 0:rs.control;return{...ns,borderRadius:"full",_checked:{...ns==null?void 0:ns._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},baseStyle$v=definePartsStyle$h(as=>{var rs,ns,ss,os;return{label:(ns=(rs=checkboxTheme).baseStyle)==null?void 0:ns.call(rs,as).label,container:(os=(ss=checkboxTheme).baseStyle)==null?void 0:os.call(ss,as).container,control:baseStyleControl(as)}}),sizes$d={md:definePartsStyle$h({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:definePartsStyle$h({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:definePartsStyle$h({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},radioTheme=defineMultiStyleConfig$h({baseStyle:baseStyle$v,sizes:sizes$d,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:defineMultiStyleConfig$g,definePartsStyle:definePartsStyle$g}=createMultiStyleConfigHelpers(selectAnatomy.keys),$bg$b=cssVar$1("select-bg"),_a$3,baseStyleField$1={...(_a$3=inputTheme.baseStyle)==null?void 0:_a$3.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:$bg$b.reference,[$bg$b.variable]:"colors.white",_dark:{[$bg$b.variable]:"colors.gray.700"},"> option, > optgroup":{bg:$bg$b.reference}},baseStyleIcon$4={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},baseStyle$u=definePartsStyle$g({field:baseStyleField$1,icon:baseStyleIcon$4}),iconSpacing={paddingInlineEnd:"8"},_a2$1,_b$1,_c,_d,_e$1,_f,_g,_h,sizes$c={lg:{...(_a2$1=inputTheme.sizes)==null?void 0:_a2$1.lg,field:{...(_b$1=inputTheme.sizes)==null?void 0:_b$1.lg.field,...iconSpacing}},md:{...(_c=inputTheme.sizes)==null?void 0:_c.md,field:{...(_d=inputTheme.sizes)==null?void 0:_d.md.field,...iconSpacing}},sm:{...(_e$1=inputTheme.sizes)==null?void 0:_e$1.sm,field:{...(_f=inputTheme.sizes)==null?void 0:_f.sm.field,...iconSpacing}},xs:{...(_g=inputTheme.sizes)==null?void 0:_g.xs,field:{...(_h=inputTheme.sizes)==null?void 0:_h.xs.field,...iconSpacing},icon:{insetEnd:"1"}}},selectTheme=defineMultiStyleConfig$g({baseStyle:baseStyle$u,sizes:sizes$c,variants:inputTheme.variants,defaultProps:inputTheme.defaultProps}),$startColor=cssVar$1("skeleton-start-color"),$endColor=cssVar$1("skeleton-end-color"),baseStyle$t={[$startColor.variable]:"colors.gray.100",[$endColor.variable]:"colors.gray.400",_dark:{[$startColor.variable]:"colors.gray.800",[$endColor.variable]:"colors.gray.600"},background:$startColor.reference,borderColor:$endColor.reference,opacity:.7,borderRadius:"sm"},skeletonTheme={baseStyle:baseStyle$t},$bg$a=cssVar$1("skip-link-bg"),baseStyle$s={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[$bg$a.variable]:"colors.white",_dark:{[$bg$a.variable]:"colors.gray.700"},bg:$bg$a.reference}},skipLinkTheme={baseStyle:baseStyle$s},{defineMultiStyleConfig:defineMultiStyleConfig$f,definePartsStyle:definePartsStyle$f}=createMultiStyleConfigHelpers(sliderAnatomy.keys),$thumbSize=cssVar$1("slider-thumb-size"),$trackSize=cssVar$1("slider-track-size"),$bg$9=cssVar$1("slider-bg"),baseStyleContainer$2=as=>{const{orientation:rs}=as;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...orient({orientation:rs,vertical:{h:"100%"},horizontal:{w:"100%"}})}},baseStyleTrack=as=>({...orient({orientation:as.orientation,horizontal:{h:$trackSize.reference},vertical:{w:$trackSize.reference}}),overflow:"hidden",borderRadius:"sm",[$bg$9.variable]:"colors.gray.200",_dark:{[$bg$9.variable]:"colors.whiteAlpha.200"},_disabled:{[$bg$9.variable]:"colors.gray.300",_dark:{[$bg$9.variable]:"colors.whiteAlpha.300"}},bg:$bg$9.reference}),baseStyleThumb=as=>{const{orientation:rs}=as;return{...orient({orientation:rs,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:$thumbSize.reference,h:$thumbSize.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},baseStyleFilledTrack=as=>{const{colorScheme:rs}=as;return{width:"inherit",height:"inherit",[$bg$9.variable]:`colors.${rs}.500`,_dark:{[$bg$9.variable]:`colors.${rs}.200`},bg:$bg$9.reference}},baseStyle$r=definePartsStyle$f(as=>({container:baseStyleContainer$2(as),track:baseStyleTrack(as),thumb:baseStyleThumb(as),filledTrack:baseStyleFilledTrack(as)})),sizeLg=definePartsStyle$f({container:{[$thumbSize.variable]:"sizes.4",[$trackSize.variable]:"sizes.1"}}),sizeMd=definePartsStyle$f({container:{[$thumbSize.variable]:"sizes.3.5",[$trackSize.variable]:"sizes.1"}}),sizeSm=definePartsStyle$f({container:{[$thumbSize.variable]:"sizes.2.5",[$trackSize.variable]:"sizes.0.5"}}),sizes$b={lg:sizeLg,md:sizeMd,sm:sizeSm},sliderTheme=defineMultiStyleConfig$f({baseStyle:baseStyle$r,sizes:sizes$b,defaultProps:{size:"md",colorScheme:"blue"}}),$size$1=cssVar("spinner-size"),baseStyle$q={width:[$size$1.reference],height:[$size$1.reference]},sizes$a={xs:{[$size$1.variable]:"sizes.3"},sm:{[$size$1.variable]:"sizes.4"},md:{[$size$1.variable]:"sizes.6"},lg:{[$size$1.variable]:"sizes.8"},xl:{[$size$1.variable]:"sizes.12"}},spinnerTheme={baseStyle:baseStyle$q,sizes:sizes$a,defaultProps:{size:"md"}},{defineMultiStyleConfig:defineMultiStyleConfig$e,definePartsStyle:definePartsStyle$e}=createMultiStyleConfigHelpers(statAnatomy.keys),baseStyleLabel={fontWeight:"medium"},baseStyleHelpText={opacity:.8,marginBottom:"2"},baseStyleNumber={verticalAlign:"baseline",fontWeight:"semibold"},baseStyleIcon$3={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},baseStyle$p=definePartsStyle$e({container:{},label:baseStyleLabel,helpText:baseStyleHelpText,number:baseStyleNumber,icon:baseStyleIcon$3}),sizes$9={md:definePartsStyle$e({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},statTheme=defineMultiStyleConfig$e({baseStyle:baseStyle$p,sizes:sizes$9,defaultProps:{size:"md"}}),$bg$8=cssVar$1("kbd-bg"),baseStyle$o={[$bg$8.variable]:"colors.gray.100",_dark:{[$bg$8.variable]:"colors.whiteAlpha.100"},bg:$bg$8.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},kbdTheme={baseStyle:baseStyle$o},baseStyle$n={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},linkTheme={baseStyle:baseStyle$n},{defineMultiStyleConfig:defineMultiStyleConfig$d,definePartsStyle:definePartsStyle$d}=createMultiStyleConfigHelpers(listAnatomy.keys),baseStyleIcon$2={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},baseStyle$m=definePartsStyle$d({icon:baseStyleIcon$2}),listTheme=defineMultiStyleConfig$d({baseStyle:baseStyle$m}),{defineMultiStyleConfig:defineMultiStyleConfig$c,definePartsStyle:definePartsStyle$c}=createMultiStyleConfigHelpers(menuAnatomy.keys),$bg$7=cssVar$1("menu-bg"),$shadow$2=cssVar$1("menu-shadow"),baseStyleList={[$bg$7.variable]:"#fff",[$shadow$2.variable]:"shadows.sm",_dark:{[$bg$7.variable]:"colors.gray.700",[$shadow$2.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:$bg$7.reference,boxShadow:$shadow$2.reference},baseStyleItem={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[$bg$7.variable]:"colors.gray.100",_dark:{[$bg$7.variable]:"colors.whiteAlpha.100"}},_active:{[$bg$7.variable]:"colors.gray.200",_dark:{[$bg$7.variable]:"colors.whiteAlpha.200"}},_expanded:{[$bg$7.variable]:"colors.gray.100",_dark:{[$bg$7.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:$bg$7.reference},baseStyleGroupTitle={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},baseStyleCommand={opacity:.6},baseStyleDivider={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},baseStyleButton$1={transitionProperty:"common",transitionDuration:"normal"},baseStyle$l=definePartsStyle$c({button:baseStyleButton$1,list:baseStyleList,item:baseStyleItem,groupTitle:baseStyleGroupTitle,command:baseStyleCommand,divider:baseStyleDivider}),menuTheme=defineMultiStyleConfig$c({baseStyle:baseStyle$l}),{defineMultiStyleConfig:defineMultiStyleConfig$b,definePartsStyle:definePartsStyle$b}=createMultiStyleConfigHelpers(modalAnatomy.keys),$bg$6=cssVar$1("modal-bg"),$shadow$1=cssVar$1("modal-shadow"),baseStyleOverlay$1={bg:"blackAlpha.600",zIndex:"modal"},baseStyleDialogContainer$1=as=>{const{isCentered:rs,scrollBehavior:ns}=as;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:rs?"center":"flex-start",overflow:ns==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},baseStyleDialog$1=as=>{const{scrollBehavior:rs}=as;return{borderRadius:"md",color:"inherit",my:"16",zIndex:"modal",maxH:rs==="inside"?"calc(100% - 7.5rem)":void 0,[$bg$6.variable]:"colors.white",[$shadow$1.variable]:"shadows.lg",_dark:{[$bg$6.variable]:"colors.gray.700",[$shadow$1.variable]:"shadows.dark-lg"},bg:$bg$6.reference,boxShadow:$shadow$1.reference}},baseStyleHeader$2={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},baseStyleCloseButton$2={position:"absolute",top:"2",insetEnd:"3"},baseStyleBody$2=as=>{const{scrollBehavior:rs}=as;return{px:"6",py:"2",flex:"1",overflow:rs==="inside"?"auto":void 0}},baseStyleFooter$2={px:"6",py:"4"},baseStyle$k=definePartsStyle$b(as=>({overlay:baseStyleOverlay$1,dialogContainer:runIfFn$1(baseStyleDialogContainer$1,as),dialog:runIfFn$1(baseStyleDialog$1,as),header:baseStyleHeader$2,closeButton:baseStyleCloseButton$2,body:runIfFn$1(baseStyleBody$2,as),footer:baseStyleFooter$2}));function getSize$3(as){return definePartsStyle$b(as==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:as}})}var sizes$8={xs:getSize$3("xs"),sm:getSize$3("sm"),md:getSize$3("md"),lg:getSize$3("lg"),xl:getSize$3("xl"),"2xl":getSize$3("2xl"),"3xl":getSize$3("3xl"),"4xl":getSize$3("4xl"),"5xl":getSize$3("5xl"),"6xl":getSize$3("6xl"),full:getSize$3("full")},modalTheme=defineMultiStyleConfig$b({baseStyle:baseStyle$k,sizes:sizes$8,defaultProps:{size:"md"}}),{defineMultiStyleConfig:defineMultiStyleConfig$a,definePartsStyle:definePartsStyle$a}=createMultiStyleConfigHelpers(numberInputAnatomy.keys),$stepperWidth=cssVar("number-input-stepper-width"),$inputPadding=cssVar("number-input-input-padding"),inputPaddingValue=calc($stepperWidth).add("0.5rem").toString(),$bg$5=cssVar("number-input-bg"),$fg$3=cssVar("number-input-color"),$border$2=cssVar("number-input-border-color"),baseStyleRoot={[$stepperWidth.variable]:"sizes.6",[$inputPadding.variable]:inputPaddingValue},baseStyleField=as=>{var rs,ns;return(ns=(rs=runIfFn$1(inputTheme.baseStyle,as))==null?void 0:rs.field)!=null?ns:{}},baseStyleStepperGroup={width:$stepperWidth.reference},baseStyleStepper={borderStart:"1px solid",borderStartColor:$border$2.reference,color:$fg$3.reference,bg:$bg$5.reference,[$fg$3.variable]:"colors.chakra-body-text",[$border$2.variable]:"colors.chakra-border-color",_dark:{[$fg$3.variable]:"colors.whiteAlpha.800",[$border$2.variable]:"colors.whiteAlpha.300"},_active:{[$bg$5.variable]:"colors.gray.200",_dark:{[$bg$5.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},baseStyle$j=definePartsStyle$a(as=>{var rs;return{root:baseStyleRoot,field:(rs=runIfFn$1(baseStyleField,as))!=null?rs:{},stepperGroup:baseStyleStepperGroup,stepper:baseStyleStepper}});function getSize$2(as){var rs,ns,ss;const os=(rs=inputTheme.sizes)==null?void 0:rs[as],ls={lg:"md",md:"md",sm:"sm",xs:"sm"},us=(ss=(ns=os.field)==null?void 0:ns.fontSize)!=null?ss:"md",cs=typography_default.fontSizes[us];return definePartsStyle$a({field:{...os.field,paddingInlineEnd:$inputPadding.reference,verticalAlign:"top"},stepper:{fontSize:calc(cs).multiply(.75).toString(),_first:{borderTopEndRadius:ls[as]},_last:{borderBottomEndRadius:ls[as],mt:"-1px",borderTopWidth:1}}})}var sizes$7={xs:getSize$2("xs"),sm:getSize$2("sm"),md:getSize$2("md"),lg:getSize$2("lg")},numberInputTheme=defineMultiStyleConfig$a({baseStyle:baseStyle$j,sizes:sizes$7,variants:inputTheme.variants,defaultProps:inputTheme.defaultProps}),_a$2,baseStyle$i={...(_a$2=inputTheme.baseStyle)==null?void 0:_a$2.field,textAlign:"center"},sizes$6={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},_a2,_b,variants$5={outline:as=>{var rs,ns,ss;return(ss=(ns=runIfFn$1((rs=inputTheme.variants)==null?void 0:rs.outline,as))==null?void 0:ns.field)!=null?ss:{}},flushed:as=>{var rs,ns,ss;return(ss=(ns=runIfFn$1((rs=inputTheme.variants)==null?void 0:rs.flushed,as))==null?void 0:ns.field)!=null?ss:{}},filled:as=>{var rs,ns,ss;return(ss=(ns=runIfFn$1((rs=inputTheme.variants)==null?void 0:rs.filled,as))==null?void 0:ns.field)!=null?ss:{}},unstyled:(_b=(_a2=inputTheme.variants)==null?void 0:_a2.unstyled.field)!=null?_b:{}},pinInputTheme={baseStyle:baseStyle$i,sizes:sizes$6,variants:variants$5,defaultProps:inputTheme.defaultProps},{defineMultiStyleConfig:defineMultiStyleConfig$9,definePartsStyle:definePartsStyle$9}=createMultiStyleConfigHelpers(popoverAnatomy.keys),$popperBg=cssVar("popper-bg"),$arrowBg=cssVar("popper-arrow-bg"),$arrowShadowColor=cssVar("popper-arrow-shadow-color"),baseStylePopper={zIndex:10},baseStyleContent={[$popperBg.variable]:"colors.white",bg:$popperBg.reference,[$arrowBg.variable]:$popperBg.reference,[$arrowShadowColor.variable]:"colors.gray.200",_dark:{[$popperBg.variable]:"colors.gray.700",[$arrowShadowColor.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},baseStyleHeader$1={px:3,py:2,borderBottomWidth:"1px"},baseStyleBody$1={px:3,py:2},baseStyleFooter$1={px:3,py:2,borderTopWidth:"1px"},baseStyleCloseButton$1={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},baseStyle$h=definePartsStyle$9({popper:baseStylePopper,content:baseStyleContent,header:baseStyleHeader$1,body:baseStyleBody$1,footer:baseStyleFooter$1,closeButton:baseStyleCloseButton$1}),popoverTheme=defineMultiStyleConfig$9({baseStyle:baseStyle$h}),{definePartsStyle:definePartsStyle$8,defineMultiStyleConfig:defineMultiStyleConfig$8}=createMultiStyleConfigHelpers(drawerAnatomy.keys),$bg$4=cssVar$1("drawer-bg"),$bs=cssVar$1("drawer-box-shadow");function getSize$1(as){return definePartsStyle$8(as==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:as}})}var baseStyleOverlay={bg:"blackAlpha.600",zIndex:"overlay"},baseStyleDialogContainer={display:"flex",zIndex:"modal",justifyContent:"center"},baseStyleDialog=as=>{const{isFullHeight:rs}=as;return{...rs&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[$bg$4.variable]:"colors.white",[$bs.variable]:"shadows.lg",_dark:{[$bg$4.variable]:"colors.gray.700",[$bs.variable]:"shadows.dark-lg"},bg:$bg$4.reference,boxShadow:$bs.reference}},baseStyleHeader={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},baseStyleCloseButton={position:"absolute",top:"2",insetEnd:"3"},baseStyleBody={px:"6",py:"2",flex:"1",overflow:"auto"},baseStyleFooter={px:"6",py:"4"},baseStyle$g=definePartsStyle$8(as=>({overlay:baseStyleOverlay,dialogContainer:baseStyleDialogContainer,dialog:runIfFn$1(baseStyleDialog,as),header:baseStyleHeader,closeButton:baseStyleCloseButton,body:baseStyleBody,footer:baseStyleFooter})),sizes$5={xs:getSize$1("xs"),sm:getSize$1("md"),md:getSize$1("lg"),lg:getSize$1("2xl"),xl:getSize$1("4xl"),full:getSize$1("full")},drawerTheme=defineMultiStyleConfig$8({baseStyle:baseStyle$g,sizes:sizes$5,defaultProps:{size:"xs"}}),{definePartsStyle:definePartsStyle$7,defineMultiStyleConfig:defineMultiStyleConfig$7}=createMultiStyleConfigHelpers(editableAnatomy.keys),baseStylePreview={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},baseStyleInput={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},baseStyleTextarea={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},baseStyle$f=definePartsStyle$7({preview:baseStylePreview,input:baseStyleInput,textarea:baseStyleTextarea}),editableTheme=defineMultiStyleConfig$7({baseStyle:baseStyle$f}),{definePartsStyle:definePartsStyle$6,defineMultiStyleConfig:defineMultiStyleConfig$6}=createMultiStyleConfigHelpers(formAnatomy.keys),$fg$2=cssVar$1("form-control-color"),baseStyleRequiredIndicator={marginStart:"1",[$fg$2.variable]:"colors.red.500",_dark:{[$fg$2.variable]:"colors.red.300"},color:$fg$2.reference},baseStyleHelperText={mt:"2",[$fg$2.variable]:"colors.gray.600",_dark:{[$fg$2.variable]:"colors.whiteAlpha.600"},color:$fg$2.reference,lineHeight:"normal",fontSize:"sm"},baseStyle$e=definePartsStyle$6({container:{width:"100%",position:"relative"},requiredIndicator:baseStyleRequiredIndicator,helperText:baseStyleHelperText}),formTheme=defineMultiStyleConfig$6({baseStyle:baseStyle$e}),{definePartsStyle:definePartsStyle$5,defineMultiStyleConfig:defineMultiStyleConfig$5}=createMultiStyleConfigHelpers(formErrorAnatomy.keys),$fg$1=cssVar$1("form-error-color"),baseStyleText={[$fg$1.variable]:"colors.red.500",_dark:{[$fg$1.variable]:"colors.red.300"},color:$fg$1.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},baseStyleIcon$1={marginEnd:"0.5em",[$fg$1.variable]:"colors.red.500",_dark:{[$fg$1.variable]:"colors.red.300"},color:$fg$1.reference},baseStyle$d=definePartsStyle$5({text:baseStyleText,icon:baseStyleIcon$1}),formErrorTheme=defineMultiStyleConfig$5({baseStyle:baseStyle$d}),baseStyle$c={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},formLabelTheme={baseStyle:baseStyle$c},baseStyle$b={fontFamily:"heading",fontWeight:"bold"},sizes$4={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},headingTheme={baseStyle:baseStyle$b,sizes:sizes$4,defaultProps:{size:"xl"}},{defineMultiStyleConfig:defineMultiStyleConfig$4,definePartsStyle:definePartsStyle$4}=createMultiStyleConfigHelpers(breadcrumbAnatomy.keys),baseStyleLink={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},baseStyle$a=definePartsStyle$4({link:baseStyleLink}),breadcrumbTheme=defineMultiStyleConfig$4({baseStyle:baseStyle$a}),baseStyle$9={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},variantGhost=as=>{const{colorScheme:rs,theme:ns}=as;if(rs==="gray")return{color:mode("inherit","whiteAlpha.900")(as),_hover:{bg:mode("gray.100","whiteAlpha.200")(as)},_active:{bg:mode("gray.200","whiteAlpha.300")(as)}};const ss=transparentize(`${rs}.200`,.12)(ns),os=transparentize(`${rs}.200`,.24)(ns);return{color:mode(`${rs}.600`,`${rs}.200`)(as),bg:"transparent",_hover:{bg:mode(`${rs}.50`,ss)(as)},_active:{bg:mode(`${rs}.100`,os)(as)}}},variantOutline=as=>{const{colorScheme:rs}=as,ns=mode("gray.200","whiteAlpha.300")(as);return{border:"1px solid",borderColor:rs==="gray"?ns:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...runIfFn$1(variantGhost,as)}},accessibleColorMap={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},variantSolid$2=as=>{var rs;const{colorScheme:ns}=as;if(ns==="gray"){const ds=mode("gray.100","whiteAlpha.200")(as);return{bg:ds,_hover:{bg:mode("gray.200","whiteAlpha.300")(as),_disabled:{bg:ds}},_active:{bg:mode("gray.300","whiteAlpha.400")(as)}}}const{bg:ss=`${ns}.500`,color:os="white",hoverBg:ls=`${ns}.600`,activeBg:us=`${ns}.700`}=(rs=accessibleColorMap[ns])!=null?rs:{},cs=mode(ss,`${ns}.200`)(as);return{bg:cs,color:mode(os,"gray.800")(as),_hover:{bg:mode(ls,`${ns}.300`)(as),_disabled:{bg:cs}},_active:{bg:mode(us,`${ns}.400`)(as)}}},variantLink=as=>{const{colorScheme:rs}=as;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:mode(`${rs}.500`,`${rs}.200`)(as),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:mode(`${rs}.700`,`${rs}.500`)(as)}}},variantUnstyled={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},variants$4={ghost:variantGhost,outline:variantOutline,solid:variantSolid$2,link:variantLink,unstyled:variantUnstyled},sizes$3={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},buttonTheme={baseStyle:baseStyle$9,variants:variants$4,sizes:sizes$3,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:definePartsStyle$3,defineMultiStyleConfig:defineMultiStyleConfig$3}=createMultiStyleConfigHelpers(cardAnatomy.keys),$bg$3=cssVar$1("card-bg"),$padding=cssVar$1("card-padding"),$shadow=cssVar$1("card-shadow"),$radius=cssVar$1("card-radius"),$border$1=cssVar$1("card-border-width","0"),$borderColor=cssVar$1("card-border-color"),baseStyle$8=definePartsStyle$3({container:{[$bg$3.variable]:"colors.chakra-body-bg",backgroundColor:$bg$3.reference,boxShadow:$shadow.reference,borderRadius:$radius.reference,color:"chakra-body-text",borderWidth:$border$1.reference,borderColor:$borderColor.reference},body:{padding:$padding.reference,flex:"1 1 0%"},header:{padding:$padding.reference},footer:{padding:$padding.reference}}),sizes$2={sm:definePartsStyle$3({container:{[$radius.variable]:"radii.base",[$padding.variable]:"space.3"}}),md:definePartsStyle$3({container:{[$radius.variable]:"radii.md",[$padding.variable]:"space.5"}}),lg:definePartsStyle$3({container:{[$radius.variable]:"radii.xl",[$padding.variable]:"space.7"}})},variants$3={elevated:definePartsStyle$3({container:{[$shadow.variable]:"shadows.base",_dark:{[$bg$3.variable]:"colors.gray.700"}}}),outline:definePartsStyle$3({container:{[$border$1.variable]:"1px",[$borderColor.variable]:"colors.chakra-border-color"}}),filled:definePartsStyle$3({container:{[$bg$3.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[$padding.variable]:0},header:{[$padding.variable]:0},footer:{[$padding.variable]:0}}},cardTheme=defineMultiStyleConfig$3({baseStyle:baseStyle$8,variants:variants$3,sizes:sizes$2,defaultProps:{variant:"elevated",size:"md"}}),$size=cssVar("close-button-size"),$bg$2=cssVar("close-button-bg"),baseStyle$7={w:[$size.reference],h:[$size.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[$bg$2.variable]:"colors.blackAlpha.100",_dark:{[$bg$2.variable]:"colors.whiteAlpha.100"}},_active:{[$bg$2.variable]:"colors.blackAlpha.200",_dark:{[$bg$2.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:$bg$2.reference},sizes$1={lg:{[$size.variable]:"sizes.10",fontSize:"md"},md:{[$size.variable]:"sizes.8",fontSize:"xs"},sm:{[$size.variable]:"sizes.6",fontSize:"2xs"}},closeButtonTheme={baseStyle:baseStyle$7,sizes:sizes$1,defaultProps:{size:"md"}},{variants:variants$2,defaultProps:defaultProps$1}=badgeTheme,baseStyle$6={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm"},codeTheme={baseStyle:baseStyle$6,variants:variants$2,defaultProps:defaultProps$1},baseStyle$5={w:"100%",mx:"auto",maxW:"prose",px:"4"},containerTheme={baseStyle:baseStyle$5},baseStyle$4={opacity:.6,borderColor:"inherit"},variantSolid$1={borderStyle:"solid"},variantDashed={borderStyle:"dashed"},variants$1={solid:variantSolid$1,dashed:variantDashed},dividerTheme={baseStyle:baseStyle$4,variants:variants$1,defaultProps:{variant:"solid"}},{definePartsStyle:definePartsStyle$2,defineMultiStyleConfig:defineMultiStyleConfig$2}=createMultiStyleConfigHelpers(accordionAnatomy.keys),baseStyleContainer$1={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},baseStyleButton={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},baseStylePanel={pt:"2",px:"4",pb:"5"},baseStyleIcon={fontSize:"1.25em"},baseStyle$3=definePartsStyle$2({container:baseStyleContainer$1,button:baseStyleButton,panel:baseStylePanel,icon:baseStyleIcon}),accordionTheme=defineMultiStyleConfig$2({baseStyle:baseStyle$3}),{definePartsStyle:definePartsStyle$1,defineMultiStyleConfig:defineMultiStyleConfig$1}=createMultiStyleConfigHelpers(alertAnatomy.keys),$fg=cssVar$1("alert-fg"),$bg$1=cssVar$1("alert-bg"),baseStyle$2=definePartsStyle$1({container:{bg:$bg$1.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:$fg.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:$fg.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function getBg(as){const{theme:rs,colorScheme:ns}=as,ss=transparentize(`${ns}.200`,.16)(rs);return{light:`colors.${ns}.100`,dark:ss}}var variantSubtle=definePartsStyle$1(as=>{const{colorScheme:rs}=as,ns=getBg(as);return{container:{[$fg.variable]:`colors.${rs}.500`,[$bg$1.variable]:ns.light,_dark:{[$fg.variable]:`colors.${rs}.200`,[$bg$1.variable]:ns.dark}}}}),variantLeftAccent=definePartsStyle$1(as=>{const{colorScheme:rs}=as,ns=getBg(as);return{container:{[$fg.variable]:`colors.${rs}.500`,[$bg$1.variable]:ns.light,_dark:{[$fg.variable]:`colors.${rs}.200`,[$bg$1.variable]:ns.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:$fg.reference}}}),variantTopAccent=definePartsStyle$1(as=>{const{colorScheme:rs}=as,ns=getBg(as);return{container:{[$fg.variable]:`colors.${rs}.500`,[$bg$1.variable]:ns.light,_dark:{[$fg.variable]:`colors.${rs}.200`,[$bg$1.variable]:ns.dark},pt:"2",borderTopWidth:"4px",borderTopColor:$fg.reference}}}),variantSolid=definePartsStyle$1(as=>{const{colorScheme:rs}=as;return{container:{[$fg.variable]:"colors.white",[$bg$1.variable]:`colors.${rs}.500`,_dark:{[$fg.variable]:"colors.gray.900",[$bg$1.variable]:`colors.${rs}.200`},color:$fg.reference}}}),variants={subtle:variantSubtle,"left-accent":variantLeftAccent,"top-accent":variantTopAccent,solid:variantSolid},alertTheme=defineMultiStyleConfig$1({baseStyle:baseStyle$2,variants,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle,defineMultiStyleConfig}=createMultiStyleConfigHelpers(avatarAnatomy.keys),$border=cssVar$1("avatar-border-color"),$bg=cssVar$1("avatar-bg"),baseStyleBadge={borderRadius:"full",border:"0.2em solid",[$border.variable]:"white",_dark:{[$border.variable]:"colors.gray.800"},borderColor:$border.reference},baseStyleExcessLabel={[$bg.variable]:"colors.gray.200",_dark:{[$bg.variable]:"colors.whiteAlpha.400"},bgColor:$bg.reference},$avatarBg=cssVar$1("avatar-background"),baseStyleContainer=as=>{const{name:rs,theme:ns}=as,ss=rs?randomColor({string:rs}):"colors.gray.400",os=isDark(ss)(ns);let ls="white";return os||(ls="gray.800"),{bg:$avatarBg.reference,"&:not([data-loaded])":{[$avatarBg.variable]:ss},color:ls,[$border.variable]:"colors.white",_dark:{[$border.variable]:"colors.gray.800"},borderColor:$border.reference,verticalAlign:"top"}},baseStyle$1=definePartsStyle(as=>({badge:runIfFn$1(baseStyleBadge,as),excessLabel:runIfFn$1(baseStyleExcessLabel,as),container:runIfFn$1(baseStyleContainer,as)}));function getSize(as){const rs=as!=="100%"?sizes_default[as]:void 0;return definePartsStyle({container:{width:as,height:as,fontSize:`calc(${rs??as} / 2.5)`},excessLabel:{width:as,height:as},label:{fontSize:`calc(${rs??as} / 2.5)`,lineHeight:as!=="100%"?rs??as:void 0}})}var sizes={"2xs":getSize(4),xs:getSize(6),sm:getSize(8),md:getSize(12),lg:getSize(16),xl:getSize(24),"2xl":getSize(32),full:getSize("100%")},avatarTheme=defineMultiStyleConfig({baseStyle:baseStyle$1,sizes,defaultProps:{size:"md"}}),components={Accordion:accordionTheme,Alert:alertTheme,Avatar:avatarTheme,Badge:badgeTheme,Breadcrumb:breadcrumbTheme,Button:buttonTheme,Checkbox:checkboxTheme,CloseButton:closeButtonTheme,Code:codeTheme,Container:containerTheme,Divider:dividerTheme,Drawer:drawerTheme,Editable:editableTheme,Form:formTheme,FormError:formErrorTheme,FormLabel:formLabelTheme,Heading:headingTheme,Input:inputTheme,Kbd:kbdTheme,Link:linkTheme,List:listTheme,Menu:menuTheme,Modal:modalTheme,NumberInput:numberInputTheme,PinInput:pinInputTheme,Popover:popoverTheme,Progress:progressTheme,Radio:radioTheme,Select:selectTheme,Skeleton:skeletonTheme,SkipLink:skipLinkTheme,Slider:sliderTheme,Spinner:spinnerTheme,Stat:statTheme,Switch:switchTheme,Table:tableTheme,Tabs:tabsTheme,Tag:tagTheme,Textarea:textareaTheme,Tooltip:tooltipTheme,Card:cardTheme},semanticTokens={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},styles={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},direction="ltr",config={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},theme$1={semanticTokens,direction,...foundations,components,styles,config};function isFunction$3(as){return typeof as=="function"}function pipe$1(...as){return rs=>as.reduce((ns,ss)=>ss(ns),rs)}var createExtendTheme=as=>function(...ns){let ss=[...ns],os=ns[ns.length-1];return isChakraTheme(os)&&ss.length>1?ss=ss.slice(0,ss.length-1):os=as,pipe$1(...ss.map(ls=>us=>isFunction$3(ls)?ls(us):mergeThemeOverride(us,ls)))(os)},extendTheme=createExtendTheme(theme$1);function mergeThemeOverride(...as){return mergeWith({},...as,mergeThemeCustomizer)}function mergeThemeCustomizer(as,rs,ns,ss){if((isFunction$3(as)||isFunction$3(rs))&&Object.prototype.hasOwnProperty.call(ss,ns))return(...os)=>{const ls=isFunction$3(as)?as(...os):as,us=isFunction$3(rs)?rs(...os):rs;return mergeWith({},ls,us,mergeThemeCustomizer)}}function omit$3(as,rs){const ns={};return Object.keys(as).forEach(ss=>{rs.includes(ss)||(ns[ss]=as[ss])}),ns}function get(as,rs,ns,ss){const os=typeof rs=="string"?rs.split("."):[rs];for(ss=0;ss{const rs=new WeakMap;return(ss,os,ls,us)=>{if(typeof ss>"u")return as(ss,os,ls);rs.has(ss)||rs.set(ss,new Map);const cs=rs.get(ss);if(cs.has(os))return cs.get(os);const ds=as(ss,os,ls,us);return cs.set(os,ds),ds}},memoizedGet=memoize(get);function objectFilter(as,rs){const ns={};return Object.keys(as).forEach(ss=>{const os=as[ss];rs(os,ss,as)&&(ns[ss]=os)}),ns}var filterUndefined=as=>objectFilter(as,rs=>rs!=null);function isFunction$2(as){return typeof as=="function"}function runIfFn(as,...rs){return isFunction$2(as)?as(...rs):as}var hasElementType=typeof Element<"u",hasMap=typeof Map=="function",hasSet=typeof Set=="function",hasArrayBuffer=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function equal(as,rs){if(as===rs)return!0;if(as&&rs&&typeof as=="object"&&typeof rs=="object"){if(as.constructor!==rs.constructor)return!1;var ns,ss,os;if(Array.isArray(as)){if(ns=as.length,ns!=rs.length)return!1;for(ss=ns;ss--!==0;)if(!equal(as[ss],rs[ss]))return!1;return!0}var ls;if(hasMap&&as instanceof Map&&rs instanceof Map){if(as.size!==rs.size)return!1;for(ls=as.entries();!(ss=ls.next()).done;)if(!rs.has(ss.value[0]))return!1;for(ls=as.entries();!(ss=ls.next()).done;)if(!equal(ss.value[1],rs.get(ss.value[0])))return!1;return!0}if(hasSet&&as instanceof Set&&rs instanceof Set){if(as.size!==rs.size)return!1;for(ls=as.entries();!(ss=ls.next()).done;)if(!rs.has(ss.value[0]))return!1;return!0}if(hasArrayBuffer&&ArrayBuffer.isView(as)&&ArrayBuffer.isView(rs)){if(ns=as.length,ns!=rs.length)return!1;for(ss=ns;ss--!==0;)if(as[ss]!==rs[ss])return!1;return!0}if(as.constructor===RegExp)return as.source===rs.source&&as.flags===rs.flags;if(as.valueOf!==Object.prototype.valueOf)return as.valueOf()===rs.valueOf();if(as.toString!==Object.prototype.toString)return as.toString()===rs.toString();if(os=Object.keys(as),ns=os.length,ns!==Object.keys(rs).length)return!1;for(ss=ns;ss--!==0;)if(!Object.prototype.hasOwnProperty.call(rs,os[ss]))return!1;if(hasElementType&&as instanceof Element)return!1;for(ss=ns;ss--!==0;)if(!((os[ss]==="_owner"||os[ss]==="__v"||os[ss]==="__o")&&as.$$typeof)&&!equal(as[os[ss]],rs[os[ss]]))return!1;return!0}return as!==as&&rs!==rs}var reactFastCompare=function as(rs,ns){try{return equal(rs,ns)}catch(ss){if((ss.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw ss}};function useStyleConfigImpl(as,rs={}){var ns;const{styleConfig:ss,...os}=rs,{theme:ls,colorMode:us}=useChakra(),cs=as?memoizedGet(ls,`components.${as}`):void 0,ds=ss||cs,ps=mergeWith({theme:ls,colorMode:us},(ns=ds==null?void 0:ds.defaultProps)!=null?ns:{},filterUndefined(omit$3(os,["children"]))),fs=reactExports.useRef({});if(ds){const gs=resolveStyleConfig(ds)(ps);reactFastCompare(fs.current,gs)||(fs.current=gs)}return fs.current}function useStyleConfig(as,rs={}){return useStyleConfigImpl(as,rs)}function useMultiStyleConfig(as,rs={}){return useStyleConfigImpl(as,rs)}var allPropNames=new Set([...propNames,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),validHTMLProps=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function shouldForwardProp(as){return validHTMLProps.has(as)||!allPropNames.has(as)}function compact$1(as){const rs=Object.assign({},as);for(let ns in rs)rs[ns]===void 0&&delete rs[ns];return rs}function assignAfter(as,...rs){if(as==null)throw new TypeError("Cannot convert undefined or null to object");const ns={...as};for(const ss of rs)if(ss!=null)for(const os in ss)Object.prototype.hasOwnProperty.call(ss,os)&&(os in ns&&delete ns[os],ns[os]=ss[os]);return ns}var reactPropsRegex=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,isPropValid=memoize$2(function(as){return reactPropsRegex.test(as)||as.charCodeAt(0)===111&&as.charCodeAt(1)===110&&as.charCodeAt(2)<91}),testOmitPropsOnStringTag=isPropValid,testOmitPropsOnComponent=function as(rs){return rs!=="theme"},getDefaultShouldForwardProp=function as(rs){return typeof rs=="string"&&rs.charCodeAt(0)>96?testOmitPropsOnStringTag:testOmitPropsOnComponent},composeShouldForwardProps=function as(rs,ns,ss){var os;if(ns){var ls=ns.shouldForwardProp;os=rs.__emotion_forwardProp&&ls?function(us){return rs.__emotion_forwardProp(us)&&ls(us)}:ls}return typeof os!="function"&&ss&&(os=rs.__emotion_forwardProp),os},Insertion=function as(rs){var ns=rs.cache,ss=rs.serialized,os=rs.isStringTag;return registerStyles(ns,ss,os),useInsertionEffectAlwaysWithSyncFallback(function(){return insertStyles(ns,ss,os)}),null},createStyled=function as(rs,ns){var ss=rs.__emotion_real===rs,os=ss&&rs.__emotion_base||rs,ls,us;ns!==void 0&&(ls=ns.label,us=ns.target);var cs=composeShouldForwardProps(rs,ns,ss),ds=cs||getDefaultShouldForwardProp(os),ps=!ds("as");return function(){var fs=arguments,hs=ss&&rs.__emotion_styles!==void 0?rs.__emotion_styles.slice(0):[];if(ls!==void 0&&hs.push("label:"+ls+";"),fs[0]==null||fs[0].raw===void 0)hs.push.apply(hs,fs);else{hs.push(fs[0][0]);for(var gs=fs.length,ys=1;ysrs=>{const{theme:ns,css:ss,__css:os,sx:ls,...us}=rs,cs=objectFilter(us,(hs,gs)=>isStyleProp(gs)),ds=runIfFn(as,rs),ps=assignAfter({},os,ds,filterUndefined(cs),ls),fs=css(ps)(rs.theme);return ss?[fs,ss]:fs};function styled(as,rs){const{baseStyle:ns,...ss}=rs??{};ss.shouldForwardProp||(ss.shouldForwardProp=shouldForwardProp);const os=toCSSObject({baseStyle:ns}),ls=emotion_styled(as,ss)(os);return React.forwardRef(function(ds,ps){const{colorMode:fs,forced:hs}=useColorMode();return React.createElement(ls,{ref:ps,"data-theme":hs?fs:void 0,...ds})})}function factory(){const as=new Map;return new Proxy(styled,{apply(rs,ns,ss){return styled(...ss)},get(rs,ns){return as.has(ns)||as.set(ns,styled(ns)),as.get(ns)}})}var chakra=factory();function forwardRef(as){return reactExports.forwardRef(as)}function createContext(as={}){const{strict:rs=!0,errorMessage:ns="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:ss}=as,os=reactExports.createContext(void 0);os.displayName=ss;function ls(){var us;const cs=reactExports.useContext(os);if(!cs&&rs){const ds=new Error(ns);throw ds.name="ContextError",(us=Error.captureStackTrace)==null||us.call(Error,ds,ls),ds}return cs}return[os.Provider,ls,os]}function ThemeProvider(as){const{cssVarsRoot:rs,theme:ns,children:ss}=as,os=reactExports.useMemo(()=>toCSSVar(ns),[ns]);return jsxs(ThemeProvider$1,{theme:os,children:[jsx$1(CSSVars,{root:rs}),ss]})}function CSSVars({root:as=":host, :root"}){const rs=[as,"[data-theme]"].join(",");return jsx$1(Global,{styles:ns=>({[rs]:ns.__cssVars})})}createContext({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `` "});function GlobalStyle(){const{colorMode:as}=useColorMode();return jsx$1(Global,{styles:rs=>{const ns=memoizedGet(rs,"styles.global"),ss=runIfFn(ns,{theme:rs,colorMode:as});return ss?css(ss)(rs):void 0}})}var EnvironmentContext=reactExports.createContext({getDocument(){return document},getWindow(){return window}});EnvironmentContext.displayName="EnvironmentContext";function EnvironmentProvider(as){const{children:rs,environment:ns,disabled:ss}=as,os=reactExports.useRef(null),ls=reactExports.useMemo(()=>ns||{getDocument:()=>{var cs,ds;return(ds=(cs=os.current)==null?void 0:cs.ownerDocument)!=null?ds:document},getWindow:()=>{var cs,ds;return(ds=(cs=os.current)==null?void 0:cs.ownerDocument.defaultView)!=null?ds:window}},[ns]),us=!ss||!ns;return jsxs(EnvironmentContext.Provider,{value:ls,children:[rs,us&&jsx$1("span",{id:"__chakra_env",hidden:!0,ref:os})]})}EnvironmentProvider.displayName="EnvironmentProvider";var ChakraProvider$1=as=>{const{children:rs,colorModeManager:ns,portalZIndex:ss,resetScope:os,resetCSS:ls=!0,theme:us={},environment:cs,cssVarsRoot:ds,disableEnvironment:ps}=as,fs=jsx$1(EnvironmentProvider,{environment:cs,disabled:ps,children:rs});return jsx$1(ThemeProvider,{theme:us,cssVarsRoot:ds,children:jsxs(ColorModeProvider,{colorModeManager:ns,options:us.config,children:[ls?jsx$1(CSSReset,{scope:os}):jsx$1(CSSPolyfill,{}),jsx$1(GlobalStyle,{}),ss?jsx$1(PortalManager,{zIndex:ss,children:fs}):fs]})})},findById=(as,rs)=>as.find(ns=>ns.id===rs);function findToast(as,rs){const ns=getToastPosition(as,rs),ss=ns?as[ns].findIndex(os=>os.id===rs):-1;return{position:ns,index:ss}}function getToastPosition(as,rs){for(const[ns,ss]of Object.entries(as))if(findById(ss,rs))return ns}function getToastStyle(as){const rs=as.includes("right"),ns=as.includes("left");let ss="center";return rs&&(ss="flex-end"),ns&&(ss="flex-start"),{display:"flex",flexDirection:"column",alignItems:ss}}function getToastListStyle(as){const ns=as==="top"||as==="bottom"?"0 auto":void 0,ss=as.includes("top")?"env(safe-area-inset-top, 0px)":void 0,os=as.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,ls=as.includes("left")?void 0:"env(safe-area-inset-right, 0px)",us=as.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:5500,pointerEvents:"none",display:"flex",flexDirection:"column",margin:ns,top:ss,bottom:os,right:ls,left:us}}function useCallbackRef(as,rs=[]){const ns=reactExports.useRef(as);return reactExports.useEffect(()=>{ns.current=as}),reactExports.useCallback((...ss)=>{var os;return(os=ns.current)==null?void 0:os.call(ns,...ss)},rs)}function useTimeout(as,rs){const ns=useCallbackRef(as);reactExports.useEffect(()=>{if(rs==null)return;let ss=null;return ss=window.setTimeout(()=>{ns()},rs),()=>{ss&&window.clearTimeout(ss)}},[rs,ns])}function useUpdateEffect(as,rs){const ns=reactExports.useRef(!1),ss=reactExports.useRef(!1);reactExports.useEffect(()=>{if(ns.current&&ss.current)return as();ss.current=!0},rs),reactExports.useEffect(()=>(ns.current=!0,()=>{ns.current=!1}),[])}const MotionConfigContext=reactExports.createContext({transformPagePoint:as=>as,isStatic:!1,reducedMotion:"never"}),MotionContext=reactExports.createContext({}),PresenceContext=reactExports.createContext(null),isBrowser=typeof document<"u",useIsomorphicLayoutEffect$1=isBrowser?reactExports.useLayoutEffect:reactExports.useEffect,LazyContext=reactExports.createContext({strict:!1});function useVisualElement(as,rs,ns,ss){const{visualElement:os}=reactExports.useContext(MotionContext),ls=reactExports.useContext(LazyContext),us=reactExports.useContext(PresenceContext),cs=reactExports.useContext(MotionConfigContext).reducedMotion,ds=reactExports.useRef();ss=ss||ls.renderer,!ds.current&&ss&&(ds.current=ss(as,{visualState:rs,parent:os,props:ns,presenceContext:us,blockInitialAnimation:us?us.initial===!1:!1,reducedMotionConfig:cs}));const ps=ds.current;return reactExports.useInsertionEffect(()=>{ps&&ps.update(ns,us)}),useIsomorphicLayoutEffect$1(()=>{ps&&ps.render()}),reactExports.useEffect(()=>{ps&&ps.updateFeatures()}),(window.HandoffAppearAnimations?useIsomorphicLayoutEffect$1:reactExports.useEffect)(()=>{ps&&ps.animationState&&ps.animationState.animateChanges()}),ps}function isRefObject(as){return typeof as=="object"&&Object.prototype.hasOwnProperty.call(as,"current")}function useMotionRef(as,rs,ns){return reactExports.useCallback(ss=>{ss&&as.mount&&as.mount(ss),rs&&(ss?rs.mount(ss):rs.unmount()),ns&&(typeof ns=="function"?ns(ss):isRefObject(ns)&&(ns.current=ss))},[rs])}function isVariantLabel(as){return typeof as=="string"||Array.isArray(as)}function isAnimationControls(as){return typeof as=="object"&&typeof as.start=="function"}const variantPriorityOrder=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],variantProps=["initial",...variantPriorityOrder];function isControllingVariants(as){return isAnimationControls(as.animate)||variantProps.some(rs=>isVariantLabel(as[rs]))}function isVariantNode(as){return!!(isControllingVariants(as)||as.variants)}function getCurrentTreeVariants(as,rs){if(isControllingVariants(as)){const{initial:ns,animate:ss}=as;return{initial:ns===!1||isVariantLabel(ns)?ns:void 0,animate:isVariantLabel(ss)?ss:void 0}}return as.inherit!==!1?rs:{}}function useCreateMotionContext(as){const{initial:rs,animate:ns}=getCurrentTreeVariants(as,reactExports.useContext(MotionContext));return reactExports.useMemo(()=>({initial:rs,animate:ns}),[variantLabelsAsDependency(rs),variantLabelsAsDependency(ns)])}function variantLabelsAsDependency(as){return Array.isArray(as)?as.join(" "):as}const featureProps={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},featureDefinitions={};for(const as in featureProps)featureDefinitions[as]={isEnabled:rs=>featureProps[as].some(ns=>!!rs[ns])};function loadFeatures(as){for(const rs in as)featureDefinitions[rs]={...featureDefinitions[rs],...as[rs]}}function useConstant(as){const rs=reactExports.useRef(null);return rs.current===null&&(rs.current=as()),rs.current}const globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let id$3=1;function useProjectionId(){return useConstant(()=>{if(globalProjectionState.hasEverUpdated)return id$3++})}const LayoutGroupContext=reactExports.createContext({}),SwitchLayoutGroupContext=reactExports.createContext({}),motionComponentSymbol=Symbol.for("motionComponentSymbol");function createMotionComponent({preloadedFeatures:as,createVisualElement:rs,useRender:ns,useVisualState:ss,Component:os}){as&&loadFeatures(as);function ls(cs,ds){let ps;const fs={...reactExports.useContext(MotionConfigContext),...cs,layoutId:useLayoutId(cs)},{isStatic:hs}=fs,gs=useCreateMotionContext(cs),ys=hs?void 0:useProjectionId(),bs=ss(cs,hs);if(!hs&&isBrowser){gs.visualElement=useVisualElement(os,bs,fs,rs);const vs=reactExports.useContext(SwitchLayoutGroupContext),xs=reactExports.useContext(LazyContext).strict;gs.visualElement&&(ps=gs.visualElement.loadFeatures(fs,xs,as,ys,vs))}return reactExports.createElement(MotionContext.Provider,{value:gs},ps&&gs.visualElement?reactExports.createElement(ps,{visualElement:gs.visualElement,...fs}):null,ns(os,cs,ys,useMotionRef(bs,gs.visualElement,ds),bs,hs,gs.visualElement))}const us=reactExports.forwardRef(ls);return us[motionComponentSymbol]=os,us}function useLayoutId({layoutId:as}){const rs=reactExports.useContext(LayoutGroupContext).id;return rs&&as!==void 0?rs+"-"+as:as}function createMotionProxy(as){function rs(ss,os={}){return createMotionComponent(as(ss,os))}if(typeof Proxy>"u")return rs;const ns=new Map;return new Proxy(rs,{get:(ss,os)=>(ns.has(os)||ns.set(os,rs(os)),ns.get(os))})}const lowercaseSVGElements=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function isSVGComponent(as){return typeof as!="string"||as.includes("-")?!1:!!(lowercaseSVGElements.indexOf(as)>-1||/[A-Z]/.test(as))}const scaleCorrectors={};function addScaleCorrector(as){Object.assign(scaleCorrectors,as)}const transformPropOrder=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],transformProps=new Set(transformPropOrder);function isForcedMotionValue(as,{layout:rs,layoutId:ns}){return transformProps.has(as)||as.startsWith("origin")||(rs||ns!==void 0)&&(!!scaleCorrectors[as]||as==="opacity")}const isMotionValue=as=>!!(as&&as.getVelocity),translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},numTransforms=transformPropOrder.length;function buildTransform(as,{enableHardwareAcceleration:rs=!0,allowTransformNone:ns=!0},ss,os){let ls="";for(let us=0;usrs=>typeof rs=="string"&&rs.startsWith(as),isCSSVariableName=checkStringStartsWith("--"),isCSSVariableToken=checkStringStartsWith("var(--"),getValueAsType=(as,rs)=>rs&&typeof as=="number"?rs.transform(as):as,clamp$1=(as,rs,ns)=>Math.min(Math.max(ns,as),rs),number={test:as=>typeof as=="number",parse:parseFloat,transform:as=>as},alpha={...number,transform:as=>clamp$1(0,1,as)},scale$1={...number,default:1},sanitize=as=>Math.round(as*1e5)/1e5,floatRegex=/(-)?([\d]*\.?[\d])+/g,colorRegex=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,singleColorRegex=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function isString$1(as){return typeof as=="string"}const createUnitType=as=>({test:rs=>isString$1(rs)&&rs.endsWith(as)&&rs.split(" ").length===1,parse:parseFloat,transform:rs=>`${rs}${as}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px$1=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage={...percent,parse:as=>percent.parse(as)/100,transform:as=>percent.transform(as*100)},int={...number,transform:Math.round},numberValueTypes={borderWidth:px$1,borderTopWidth:px$1,borderRightWidth:px$1,borderBottomWidth:px$1,borderLeftWidth:px$1,borderRadius:px$1,radius:px$1,borderTopLeftRadius:px$1,borderTopRightRadius:px$1,borderBottomRightRadius:px$1,borderBottomLeftRadius:px$1,width:px$1,maxWidth:px$1,height:px$1,maxHeight:px$1,size:px$1,top:px$1,right:px$1,bottom:px$1,left:px$1,padding:px$1,paddingTop:px$1,paddingRight:px$1,paddingBottom:px$1,paddingLeft:px$1,margin:px$1,marginTop:px$1,marginRight:px$1,marginBottom:px$1,marginLeft:px$1,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale:scale$1,scaleX:scale$1,scaleY:scale$1,scaleZ:scale$1,skew:degrees,skewX:degrees,skewY:degrees,distance:px$1,translateX:px$1,translateY:px$1,translateZ:px$1,x:px$1,y:px$1,z:px$1,perspective:px$1,transformPerspective:px$1,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px$1,zIndex:int,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int};function buildHTMLStyles(as,rs,ns,ss){const{style:os,vars:ls,transform:us,transformOrigin:cs}=as;let ds=!1,ps=!1,fs=!0;for(const hs in rs){const gs=rs[hs];if(isCSSVariableName(hs)){ls[hs]=gs;continue}const ys=numberValueTypes[hs],bs=getValueAsType(gs,ys);if(transformProps.has(hs)){if(ds=!0,us[hs]=bs,!fs)continue;gs!==(ys.default||0)&&(fs=!1)}else hs.startsWith("origin")?(ps=!0,cs[hs]=bs):os[hs]=bs}if(rs.transform||(ds||ss?os.transform=buildTransform(as.transform,ns,fs,ss):os.transform&&(os.transform="none")),ps){const{originX:hs="50%",originY:gs="50%",originZ:ys=0}=cs;os.transformOrigin=`${hs} ${gs} ${ys}`}}const createHtmlRenderState=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function copyRawValuesOnly(as,rs,ns){for(const ss in rs)!isMotionValue(rs[ss])&&!isForcedMotionValue(ss,ns)&&(as[ss]=rs[ss])}function useInitialMotionValues({transformTemplate:as},rs,ns){return reactExports.useMemo(()=>{const ss=createHtmlRenderState();return buildHTMLStyles(ss,rs,{enableHardwareAcceleration:!ns},as),Object.assign({},ss.vars,ss.style)},[rs])}function useStyle(as,rs,ns){const ss=as.style||{},os={};return copyRawValuesOnly(os,ss,as),Object.assign(os,useInitialMotionValues(as,rs,ns)),as.transformValues?as.transformValues(os):os}function useHTMLProps(as,rs,ns){const ss={},os=useStyle(as,rs,ns);return as.drag&&as.dragListener!==!1&&(ss.draggable=!1,os.userSelect=os.WebkitUserSelect=os.WebkitTouchCallout="none",os.touchAction=as.drag===!0?"none":`pan-${as.drag==="x"?"y":"x"}`),as.tabIndex===void 0&&(as.onTap||as.onTapStart||as.whileTap)&&(ss.tabIndex=0),ss.style=os,ss}const validMotionProps=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function isValidMotionProp(as){return as.startsWith("while")||as.startsWith("drag")&&as!=="draggable"||as.startsWith("layout")||as.startsWith("onTap")||as.startsWith("onPan")||validMotionProps.has(as)}let shouldForward=as=>!isValidMotionProp(as);function loadExternalIsValidProp(as){as&&(shouldForward=rs=>rs.startsWith("on")?!isValidMotionProp(rs):as(rs))}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch(as){}function filterProps(as,rs,ns){const ss={};for(const os in as)os==="values"&&typeof as.values=="object"||(shouldForward(os)||ns===!0&&isValidMotionProp(os)||!rs&&!isValidMotionProp(os)||as.draggable&&os.startsWith("onDrag"))&&(ss[os]=as[os]);return ss}function calcOrigin$1(as,rs,ns){return typeof as=="string"?as:px$1.transform(rs+ns*as)}function calcSVGTransformOrigin(as,rs,ns){const ss=calcOrigin$1(rs,as.x,as.width),os=calcOrigin$1(ns,as.y,as.height);return`${ss} ${os}`}const dashKeys={offset:"stroke-dashoffset",array:"stroke-dasharray"},camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(as,rs,ns=1,ss=0,os=!0){as.pathLength=1;const ls=os?dashKeys:camelKeys;as[ls.offset]=px$1.transform(-ss);const us=px$1.transform(rs),cs=px$1.transform(ns);as[ls.array]=`${us} ${cs}`}function buildSVGAttrs(as,{attrX:rs,attrY:ns,originX:ss,originY:os,pathLength:ls,pathSpacing:us=1,pathOffset:cs=0,...ds},ps,fs,hs){if(buildHTMLStyles(as,ds,ps,hs),fs){as.style.viewBox&&(as.attrs.viewBox=as.style.viewBox);return}as.attrs=as.style,as.style={};const{attrs:gs,style:ys,dimensions:bs}=as;gs.transform&&(bs&&(ys.transform=gs.transform),delete gs.transform),bs&&(ss!==void 0||os!==void 0||ys.transform)&&(ys.transformOrigin=calcSVGTransformOrigin(bs,ss!==void 0?ss:.5,os!==void 0?os:.5)),rs!==void 0&&(gs.x=rs),ns!==void 0&&(gs.y=ns),ls!==void 0&&buildSVGPath(gs,ls,us,cs,!1)}const createSvgRenderState=()=>({...createHtmlRenderState(),attrs:{}}),isSVGTag=as=>typeof as=="string"&&as.toLowerCase()==="svg";function useSVGProps(as,rs,ns,ss){const os=reactExports.useMemo(()=>{const ls=createSvgRenderState();return buildSVGAttrs(ls,rs,{enableHardwareAcceleration:!1},isSVGTag(ss),as.transformTemplate),{...ls.attrs,style:{...ls.style}}},[rs]);if(as.style){const ls={};copyRawValuesOnly(ls,as.style,as),os.style={...ls,...os.style}}return os}function createUseRender(as=!1){return(ns,ss,os,ls,{latestValues:us},cs)=>{const ps=(isSVGComponent(ns)?useSVGProps:useHTMLProps)(ss,us,cs,ns),hs={...filterProps(ss,typeof ns=="string",as),...ps,ref:ls},{children:gs}=ss,ys=reactExports.useMemo(()=>isMotionValue(gs)?gs.get():gs,[gs]);return os&&(hs["data-projection-id"]=os),reactExports.createElement(ns,{...hs,children:ys})}}const camelToDash=as=>as.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function renderHTML(as,{style:rs,vars:ns},ss,os){Object.assign(as.style,rs,os&&os.getProjectionStyles(ss));for(const ls in ns)as.style.setProperty(ls,ns[ls])}const camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function renderSVG(as,rs,ns,ss){renderHTML(as,rs,void 0,ss);for(const os in rs.attrs)as.setAttribute(camelCaseAttributes.has(os)?os:camelToDash(os),rs.attrs[os])}function scrapeMotionValuesFromProps$1(as,rs){const{style:ns}=as,ss={};for(const os in ns)(isMotionValue(ns[os])||rs.style&&isMotionValue(rs.style[os])||isForcedMotionValue(os,as))&&(ss[os]=ns[os]);return ss}function scrapeMotionValuesFromProps(as,rs){const ns=scrapeMotionValuesFromProps$1(as,rs);for(const ss in as)if(isMotionValue(as[ss])||isMotionValue(rs[ss])){const os=ss==="x"||ss==="y"?"attr"+ss.toUpperCase():ss;ns[os]=as[ss]}return ns}function resolveVariantFromProps(as,rs,ns,ss={},os={}){return typeof rs=="function"&&(rs=rs(ns!==void 0?ns:as.custom,ss,os)),typeof rs=="string"&&(rs=as.variants&&as.variants[rs]),typeof rs=="function"&&(rs=rs(ns!==void 0?ns:as.custom,ss,os)),rs}const isKeyframesTarget=as=>Array.isArray(as),isCustomValue=as=>!!(as&&typeof as=="object"&&as.mix&&as.toValue),resolveFinalValueInKeyframes=as=>isKeyframesTarget(as)?as[as.length-1]||0:as;function resolveMotionValue(as){const rs=isMotionValue(as)?as.get():as;return isCustomValue(rs)?rs.toValue():rs}function makeState({scrapeMotionValuesFromProps:as,createRenderState:rs,onMount:ns},ss,os,ls){const us={latestValues:makeLatestValues(ss,os,ls,as),renderState:rs()};return ns&&(us.mount=cs=>ns(ss,cs,us)),us}const makeUseVisualState=as=>(rs,ns)=>{const ss=reactExports.useContext(MotionContext),os=reactExports.useContext(PresenceContext),ls=()=>makeState(as,rs,ss,os);return ns?ls():useConstant(ls)};function makeLatestValues(as,rs,ns,ss){const os={},ls=ss(as,{});for(const gs in ls)os[gs]=resolveMotionValue(ls[gs]);let{initial:us,animate:cs}=as;const ds=isControllingVariants(as),ps=isVariantNode(as);rs&&ps&&!ds&&as.inherit!==!1&&(us===void 0&&(us=rs.initial),cs===void 0&&(cs=rs.animate));let fs=ns?ns.initial===!1:!1;fs=fs||us===!1;const hs=fs?cs:us;return hs&&typeof hs!="boolean"&&!isAnimationControls(hs)&&(Array.isArray(hs)?hs:[hs]).forEach(ys=>{const bs=resolveVariantFromProps(as,ys);if(!bs)return;const{transitionEnd:vs,transition:xs,...Cs}=bs;for(const Ts in Cs){let Ss=Cs[Ts];if(Array.isArray(Ss)){const Ns=fs?Ss.length-1:0;Ss=Ss[Ns]}Ss!==null&&(os[Ts]=Ss)}for(const Ts in vs)os[Ts]=vs[Ts]}),os}const svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:(as,rs,{renderState:ns,latestValues:ss})=>{try{ns.dimensions=typeof rs.getBBox=="function"?rs.getBBox():rs.getBoundingClientRect()}catch{ns.dimensions={x:0,y:0,width:0,height:0}}buildSVGAttrs(ns,ss,{enableHardwareAcceleration:!1},isSVGTag(rs.tagName),as.transformTemplate),renderSVG(rs,ns)}})},htmlMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function createDomMotionConfig(as,{forwardMotionProps:rs=!1},ns,ss){return{...isSVGComponent(as)?svgMotionConfig:htmlMotionConfig,preloadedFeatures:ns,useRender:createUseRender(rs),createVisualElement:ss,Component:as}}function addDomEvent(as,rs,ns,ss={passive:!0}){return as.addEventListener(rs,ns,ss),()=>as.removeEventListener(rs,ns)}const isPrimaryPointer=as=>as.pointerType==="mouse"?typeof as.button!="number"||as.button<=0:as.isPrimary!==!1;function extractEventInfo(as,rs="page"){return{point:{x:as[rs+"X"],y:as[rs+"Y"]}}}const addPointerInfo=as=>rs=>isPrimaryPointer(rs)&&as(rs,extractEventInfo(rs));function addPointerEvent(as,rs,ns,ss){return addDomEvent(as,rs,addPointerInfo(ns),ss)}const combineFunctions=(as,rs)=>ns=>rs(as(ns)),pipe=(...as)=>as.reduce(combineFunctions);function createLock(as){let rs=null;return()=>{const ns=()=>{rs=null};return rs===null?(rs=as,ns):!1}}const globalHorizontalLock=createLock("dragHorizontal"),globalVerticalLock=createLock("dragVertical");function getGlobalLock(as){let rs=!1;if(as==="y")rs=globalVerticalLock();else if(as==="x")rs=globalHorizontalLock();else{const ns=globalHorizontalLock(),ss=globalVerticalLock();ns&&ss?rs=()=>{ns(),ss()}:(ns&&ns(),ss&&ss())}return rs}function isDragActive(){const as=getGlobalLock(!0);return as?(as(),!1):!0}class Feature{constructor(rs){this.isMounted=!1,this.node=rs}update(){}}function createRenderStep(as){let rs=[],ns=[],ss=0,os=!1,ls=!1;const us=new WeakSet,cs={schedule:(ds,ps=!1,fs=!1)=>{const hs=fs&&os,gs=hs?rs:ns;return ps&&us.add(ds),gs.indexOf(ds)===-1&&(gs.push(ds),hs&&os&&(ss=rs.length)),ds},cancel:ds=>{const ps=ns.indexOf(ds);ps!==-1&&ns.splice(ps,1),us.delete(ds)},process:ds=>{if(os){ls=!0;return}if(os=!0,[rs,ns]=[ns,rs],ns.length=0,ss=rs.length,ss)for(let ps=0;ps(as[rs]=createRenderStep(()=>runNextFrame=!0),as),{}),sync=stepsOrder.reduce((as,rs)=>{const ns=steps[rs];return as[rs]=(ss,os=!1,ls=!1)=>(runNextFrame||startLoop(),ns.schedule(ss,os,ls)),as},{}),cancelSync=stepsOrder.reduce((as,rs)=>(as[rs]=steps[rs].cancel,as),{}),flushSync=stepsOrder.reduce((as,rs)=>(as[rs]=()=>steps[rs].process(frameData),as),{}),processStep=as=>steps[as].process(frameData),processFrame=as=>{runNextFrame=!1,frameData.delta=useDefaultElapsed?1e3/60:Math.max(Math.min(as-frameData.timestamp,maxElapsed),1),frameData.timestamp=as,frameData.isProcessing=!0,stepsOrder.forEach(processStep),frameData.isProcessing=!1,runNextFrame&&(useDefaultElapsed=!1,requestAnimationFrame(processFrame))},startLoop=()=>{runNextFrame=!0,useDefaultElapsed=!0,frameData.isProcessing||requestAnimationFrame(processFrame)};function addHoverEvent(as,rs){const ns="pointer"+(rs?"enter":"leave"),ss="onHover"+(rs?"Start":"End"),os=(ls,us)=>{if(ls.type==="touch"||isDragActive())return;const cs=as.getProps();as.animationState&&cs.whileHover&&as.animationState.setActive("whileHover",rs),cs[ss]&&sync.update(()=>cs[ss](ls,us))};return addPointerEvent(as.current,ns,os,{passive:!as.getProps()[ss]})}class HoverGesture extends Feature{mount(){this.unmount=pipe(addHoverEvent(this.node,!0),addHoverEvent(this.node,!1))}unmount(){}}class FocusGesture extends Feature{constructor(){super(...arguments),this.isActive=!1}onFocus(){let rs=!1;try{rs=this.node.current.matches(":focus-visible")}catch{rs=!0}!rs||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pipe(addDomEvent(this.node.current,"focus",()=>this.onFocus()),addDomEvent(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const isNodeOrChild=(as,rs)=>rs?as===rs?!0:isNodeOrChild(as,rs.parentElement):!1,noop$1=as=>as;function fireSyntheticPointerEvent(as,rs){if(!rs)return;const ns=new PointerEvent("pointer"+as);rs(ns,extractEventInfo(ns))}class PressGesture extends Feature{constructor(){super(...arguments),this.removeStartListeners=noop$1,this.removeEndListeners=noop$1,this.removeAccessibleListeners=noop$1,this.startPointerPress=(rs,ns)=>{if(this.removeEndListeners(),this.isPressing)return;const ss=this.node.getProps(),ls=addPointerEvent(window,"pointerup",(cs,ds)=>{if(!this.checkPressEnd())return;const{onTap:ps,onTapCancel:fs}=this.node.getProps();sync.update(()=>{isNodeOrChild(this.node.current,cs.target)?ps&&ps(cs,ds):fs&&fs(cs,ds)})},{passive:!(ss.onTap||ss.onPointerUp)}),us=addPointerEvent(window,"pointercancel",(cs,ds)=>this.cancelPress(cs,ds),{passive:!(ss.onTapCancel||ss.onPointerCancel)});this.removeEndListeners=pipe(ls,us),this.startPress(rs,ns)},this.startAccessiblePress=()=>{const rs=ls=>{if(ls.key!=="Enter"||this.isPressing)return;const us=cs=>{cs.key!=="Enter"||!this.checkPressEnd()||fireSyntheticPointerEvent("up",(ds,ps)=>{const{onTap:fs}=this.node.getProps();fs&&sync.update(()=>fs(ds,ps))})};this.removeEndListeners(),this.removeEndListeners=addDomEvent(this.node.current,"keyup",us),fireSyntheticPointerEvent("down",(cs,ds)=>{this.startPress(cs,ds)})},ns=addDomEvent(this.node.current,"keydown",rs),ss=()=>{this.isPressing&&fireSyntheticPointerEvent("cancel",(ls,us)=>this.cancelPress(ls,us))},os=addDomEvent(this.node.current,"blur",ss);this.removeAccessibleListeners=pipe(ns,os)}}startPress(rs,ns){this.isPressing=!0;const{onTapStart:ss,whileTap:os}=this.node.getProps();os&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),ss&&sync.update(()=>ss(rs,ns))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!isDragActive()}cancelPress(rs,ns){if(!this.checkPressEnd())return;const{onTapCancel:ss}=this.node.getProps();ss&&sync.update(()=>ss(rs,ns))}mount(){const rs=this.node.getProps(),ns=addPointerEvent(this.node.current,"pointerdown",this.startPointerPress,{passive:!(rs.onTapStart||rs.onPointerStart)}),ss=addDomEvent(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=pipe(ns,ss)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const observerCallbacks=new WeakMap,observers=new WeakMap,fireObserverCallback=as=>{const rs=observerCallbacks.get(as.target);rs&&rs(as)},fireAllObserverCallbacks=as=>{as.forEach(fireObserverCallback)};function initIntersectionObserver({root:as,...rs}){const ns=as||document;observers.has(ns)||observers.set(ns,{});const ss=observers.get(ns),os=JSON.stringify(rs);return ss[os]||(ss[os]=new IntersectionObserver(fireAllObserverCallbacks,{root:as,...rs})),ss[os]}function observeIntersection(as,rs,ns){const ss=initIntersectionObserver(rs);return observerCallbacks.set(as,ns),ss.observe(as),()=>{observerCallbacks.delete(as),ss.unobserve(as)}}const thresholdNames={some:0,all:1};class InViewFeature extends Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:rs={}}=this.node.getProps(),{root:ns,margin:ss,amount:os="some",once:ls}=rs,us={root:ns?ns.current:void 0,rootMargin:ss,threshold:typeof os=="number"?os:thresholdNames[os]},cs=ds=>{const{isIntersecting:ps}=ds;if(this.isInView===ps||(this.isInView=ps,ls&&!ps&&this.hasEnteredView))return;ps&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",ps);const{onViewportEnter:fs,onViewportLeave:hs}=this.node.getProps(),gs=ps?fs:hs;gs&&gs(ds)};return observeIntersection(this.node.current,us,cs)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:rs,prevProps:ns}=this.node;["amount","margin","root"].some(hasViewportOptionChanged(rs,ns))&&this.startObserver()}unmount(){}}function hasViewportOptionChanged({viewport:as={}},{viewport:rs={}}={}){return ns=>as[ns]!==rs[ns]}const gestureAnimations={inView:{Feature:InViewFeature},tap:{Feature:PressGesture},focus:{Feature:FocusGesture},hover:{Feature:HoverGesture}};function shallowCompare(as,rs){if(!Array.isArray(rs))return!1;const ns=rs.length;if(ns!==as.length)return!1;for(let ss=0;ssrs[ss]=ns.get()),rs}function getVelocity$1(as){const rs={};return as.values.forEach((ns,ss)=>rs[ss]=ns.getVelocity()),rs}function resolveVariant(as,rs,ns){const ss=as.getProps();return resolveVariantFromProps(ss,rs,ns!==void 0?ns:ss.custom,getCurrent(as),getVelocity$1(as))}const optimizedAppearDataId="framerAppearId",optimizedAppearDataAttribute="data-"+camelToDash(optimizedAppearDataId);let warning=noop$1,invariant=noop$1;const secondsToMilliseconds=as=>as*1e3,millisecondsToSeconds=as=>as/1e3,instantAnimationState={current:!1},isBezierDefinition=as=>Array.isArray(as)&&typeof as[0]=="number";function isWaapiSupportedEasing(as){return!!(!as||typeof as=="string"&&supportedWaapiEasing[as]||isBezierDefinition(as)||Array.isArray(as)&&as.every(isWaapiSupportedEasing))}const cubicBezierAsString=([as,rs,ns,ss])=>`cubic-bezier(${as}, ${rs}, ${ns}, ${ss})`,supportedWaapiEasing={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cubicBezierAsString([0,.65,.55,1]),circOut:cubicBezierAsString([.55,0,1,.45]),backIn:cubicBezierAsString([.31,.01,.66,-.59]),backOut:cubicBezierAsString([.33,1.53,.69,.99])};function mapEasingToNativeEasing(as){if(as)return isBezierDefinition(as)?cubicBezierAsString(as):Array.isArray(as)?as.map(mapEasingToNativeEasing):supportedWaapiEasing[as]}function animateStyle(as,rs,ns,{delay:ss=0,duration:os,repeat:ls=0,repeatType:us="loop",ease:cs,times:ds}={}){const ps={[rs]:ns};ds&&(ps.offset=ds);const fs=mapEasingToNativeEasing(cs);return Array.isArray(fs)&&(ps.easing=fs),as.animate(ps,{delay:ss,duration:os,easing:Array.isArray(fs)?"linear":fs,fill:"both",iterations:ls+1,direction:us==="reverse"?"alternate":"normal"})}const featureTests={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},results={},supports={};for(const as in featureTests)supports[as]=()=>(results[as]===void 0&&(results[as]=featureTests[as]()),results[as]);function getFinalKeyframe(as,{repeat:rs,repeatType:ns="loop"}){const ss=rs&&ns!=="loop"&&rs%2===1?0:as.length-1;return as[ss]}const calcBezier=(as,rs,ns)=>(((1-3*ns+3*rs)*as+(3*ns-6*rs))*as+3*rs)*as,subdivisionPrecision=1e-7,subdivisionMaxIterations=12;function binarySubdivide(as,rs,ns,ss,os){let ls,us,cs=0;do us=rs+(ns-rs)/2,ls=calcBezier(us,ss,os)-as,ls>0?ns=us:rs=us;while(Math.abs(ls)>subdivisionPrecision&&++csbinarySubdivide(ls,0,1,as,ns);return ls=>ls===0||ls===1?ls:calcBezier(os(ls),rs,ss)}const easeIn=cubicBezier(.42,0,1,1),easeOut=cubicBezier(0,0,.58,1),easeInOut=cubicBezier(.42,0,.58,1),isColorString=(as,rs)=>ns=>!!(isString$1(ns)&&singleColorRegex.test(ns)&&ns.startsWith(as)||rs&&Object.prototype.hasOwnProperty.call(ns,rs)),splitColor=(as,rs,ns)=>ss=>{if(!isString$1(ss))return ss;const[os,ls,us,cs]=ss.match(floatRegex);return{[as]:parseFloat(os),[rs]:parseFloat(ls),[ns]:parseFloat(us),alpha:cs!==void 0?parseFloat(cs):1}},clampRgbUnit=as=>clamp$1(0,255,as),rgbUnit={...number,transform:as=>Math.round(clampRgbUnit(as))},rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:as,green:rs,blue:ns,alpha:ss=1})=>"rgba("+rgbUnit.transform(as)+", "+rgbUnit.transform(rs)+", "+rgbUnit.transform(ns)+", "+sanitize(alpha.transform(ss))+")"};function parseHex(as){let rs="",ns="",ss="",os="";return as.length>5?(rs=as.substring(1,3),ns=as.substring(3,5),ss=as.substring(5,7),os=as.substring(7,9)):(rs=as.substring(1,2),ns=as.substring(2,3),ss=as.substring(3,4),os=as.substring(4,5),rs+=rs,ns+=ns,ss+=ss,os+=os),{red:parseInt(rs,16),green:parseInt(ns,16),blue:parseInt(ss,16),alpha:os?parseInt(os,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex,transform:rgba.transform},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:as,saturation:rs,lightness:ns,alpha:ss=1})=>"hsla("+Math.round(as)+", "+percent.transform(sanitize(rs))+", "+percent.transform(sanitize(ns))+", "+sanitize(alpha.transform(ss))+")"},color={test:as=>rgba.test(as)||hex.test(as)||hsla.test(as),parse:as=>rgba.test(as)?rgba.parse(as):hsla.test(as)?hsla.parse(as):hex.parse(as),transform:as=>isString$1(as)?as:as.hasOwnProperty("red")?rgba.transform(as):hsla.transform(as)},mix=(as,rs,ns)=>-ns*as+ns*rs+as;function hueToRgb(as,rs,ns){return ns<0&&(ns+=1),ns>1&&(ns-=1),ns<1/6?as+(rs-as)*6*ns:ns<1/2?rs:ns<2/3?as+(rs-as)*(2/3-ns)*6:as}function hslaToRgba({hue:as,saturation:rs,lightness:ns,alpha:ss}){as/=360,rs/=100,ns/=100;let os=0,ls=0,us=0;if(!rs)os=ls=us=ns;else{const cs=ns<.5?ns*(1+rs):ns+rs-ns*rs,ds=2*ns-cs;os=hueToRgb(ds,cs,as+1/3),ls=hueToRgb(ds,cs,as),us=hueToRgb(ds,cs,as-1/3)}return{red:Math.round(os*255),green:Math.round(ls*255),blue:Math.round(us*255),alpha:ss}}const mixLinearColor=(as,rs,ns)=>{const ss=as*as;return Math.sqrt(Math.max(0,ns*(rs*rs-ss)+ss))},colorTypes=[hex,rgba,hsla],getColorType=as=>colorTypes.find(rs=>rs.test(as));function asRGBA(as){const rs=getColorType(as);let ns=rs.parse(as);return rs===hsla&&(ns=hslaToRgba(ns)),ns}const mixColor=(as,rs)=>{const ns=asRGBA(as),ss=asRGBA(rs),os={...ns};return ls=>(os.red=mixLinearColor(ns.red,ss.red,ls),os.green=mixLinearColor(ns.green,ss.green,ls),os.blue=mixLinearColor(ns.blue,ss.blue,ls),os.alpha=mix(ns.alpha,ss.alpha,ls),rgba.transform(os))},colorToken="${c}",numberToken="${n}";function test(as){var rs,ns;return isNaN(as)&&isString$1(as)&&(((rs=as.match(floatRegex))===null||rs===void 0?void 0:rs.length)||0)+(((ns=as.match(colorRegex))===null||ns===void 0?void 0:ns.length)||0)>0}function analyseComplexValue(as){typeof as=="number"&&(as=`${as}`);const rs=[];let ns=0,ss=0;const os=as.match(colorRegex);os&&(ns=os.length,as=as.replace(colorRegex,colorToken),rs.push(...os.map(color.parse)));const ls=as.match(floatRegex);return ls&&(ss=ls.length,as=as.replace(floatRegex,numberToken),rs.push(...ls.map(number.parse))),{values:rs,numColors:ns,numNumbers:ss,tokenised:as}}function parse$1(as){return analyseComplexValue(as).values}function createTransformer(as){const{values:rs,numColors:ns,tokenised:ss}=analyseComplexValue(as),os=rs.length;return ls=>{let us=ss;for(let cs=0;cstypeof as=="number"?0:as;function getAnimatableNone$1(as){const rs=parse$1(as);return createTransformer(as)(rs.map(convertNumbersToZero))}const complex={test,parse:parse$1,createTransformer,getAnimatableNone:getAnimatableNone$1};function getMixer(as,rs){return typeof as=="number"?ns=>mix(as,rs,ns):color.test(as)?mixColor(as,rs):mixComplex(as,rs)}const mixArray=(as,rs)=>{const ns=[...as],ss=ns.length,os=as.map((ls,us)=>getMixer(ls,rs[us]));return ls=>{for(let us=0;us{const ns={...as,...rs},ss={};for(const os in ns)as[os]!==void 0&&rs[os]!==void 0&&(ss[os]=getMixer(as[os],rs[os]));return os=>{for(const ls in ss)ns[ls]=ss[ls](os);return ns}},mixComplex=(as,rs)=>{const ns=complex.createTransformer(rs),ss=analyseComplexValue(as),os=analyseComplexValue(rs);return ss.numColors===os.numColors&&ss.numNumbers>=os.numNumbers?pipe(mixArray(ss.values,os.values),ns):us=>`${us>0?rs:as}`},progress=(as,rs,ns)=>{const ss=rs-as;return ss===0?1:(ns-as)/ss},mixNumber=(as,rs)=>ns=>mix(as,rs,ns);function detectMixerFactory(as){return typeof as=="number"?mixNumber:typeof as=="string"?color.test(as)?mixColor:mixComplex:Array.isArray(as)?mixArray:typeof as=="object"?mixObject:mixNumber}function createMixers(as,rs,ns){const ss=[],os=ns||detectMixerFactory(as[0]),ls=as.length-1;for(let us=0;usrs[0];as[0]>as[ls-1]&&(as=[...as].reverse(),rs=[...rs].reverse());const us=createMixers(rs,ss,os),cs=us.length,ds=ps=>{let fs=0;if(cs>1)for(;fsds(clamp$1(as[0],as[ls-1],ps)):ds}function fillOffset(as,rs){const ns=as[as.length-1];for(let ss=1;ss<=rs;ss++){const os=progress(0,rs,ss);as.push(mix(ns,1,os))}}function defaultOffset(as){const rs=[0];return fillOffset(rs,as.length-1),rs}function convertOffsetToTimes(as,rs){return as.map(ns=>ns*rs)}const mirrorEasing=as=>rs=>rs<=.5?as(2*rs)/2:(2-as(2*(1-rs)))/2,reverseEasing=as=>rs=>1-as(1-rs),circIn=as=>1-Math.sin(Math.acos(as)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circOut),backOut=cubicBezier(.33,1.53,.69,.99),backIn=reverseEasing(backOut),backInOut=mirrorEasing(backIn),anticipate=as=>(as*=2)<1?.5*backIn(as):.5*(2-Math.pow(2,-10*(as-1))),easingLookup={linear:noop$1,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate},easingDefinitionToFunction=as=>{if(Array.isArray(as)){invariant(as.length===4);const[rs,ns,ss,os]=as;return cubicBezier(rs,ns,ss,os)}else if(typeof as=="string")return easingLookup[as];return as},isEasingArray=as=>Array.isArray(as)&&typeof as[0]!="number";function defaultEasing(as,rs){return as.map(()=>rs||easeInOut).splice(0,as.length-1)}function keyframes({duration:as=300,keyframes:rs,times:ns,ease:ss="easeInOut"}){const os=isEasingArray(ss)?ss.map(easingDefinitionToFunction):easingDefinitionToFunction(ss),ls={done:!1,value:rs[0]},us=convertOffsetToTimes(ns&&ns.length===rs.length?ns:defaultOffset(rs),as),cs=interpolate(us,rs,{ease:Array.isArray(os)?os:defaultEasing(rs,os)});return{calculatedDuration:as,next:ds=>(ls.value=cs(ds),ls.done=ds>=as,ls)}}function velocityPerSecond(as,rs){return rs?as*(1e3/rs):0}const velocitySampleDuration=5;function calcGeneratorVelocity(as,rs,ns){const ss=Math.max(rs-velocitySampleDuration,0);return velocityPerSecond(ns-as(ss),rs-ss)}const safeMin=.001,minDuration=.01,maxDuration$2=10,minDamping=.05,maxDamping=1;function findSpring({duration:as=800,bounce:rs=.25,velocity:ns=0,mass:ss=1}){let os,ls;warning(as<=secondsToMilliseconds(maxDuration$2));let us=1-rs;us=clamp$1(minDamping,maxDamping,us),as=clamp$1(minDuration,maxDuration$2,millisecondsToSeconds(as)),us<1?(os=ps=>{const fs=ps*us,hs=fs*as,gs=fs-ns,ys=calcAngularFreq(ps,us),bs=Math.exp(-hs);return safeMin-gs/ys*bs},ls=ps=>{const hs=ps*us*as,gs=hs*ns+ns,ys=Math.pow(us,2)*Math.pow(ps,2)*as,bs=Math.exp(-hs),vs=calcAngularFreq(Math.pow(ps,2),us);return(-os(ps)+safeMin>0?-1:1)*((gs-ys)*bs)/vs}):(os=ps=>{const fs=Math.exp(-ps*as),hs=(ps-ns)*as+1;return-safeMin+fs*hs},ls=ps=>{const fs=Math.exp(-ps*as),hs=(ns-ps)*(as*as);return fs*hs});const cs=5/as,ds=approximateRoot(os,ls,cs);if(as=secondsToMilliseconds(as),isNaN(ds))return{stiffness:100,damping:10,duration:as};{const ps=Math.pow(ds,2)*ss;return{stiffness:ps,damping:us*2*Math.sqrt(ss*ps),duration:as}}}const rootIterations=12;function approximateRoot(as,rs,ns){let ss=ns;for(let os=1;osas[ns]!==void 0)}function getSpringOptions(as){let rs={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...as};if(!isSpringType(as,physicsKeys)&&isSpringType(as,durationKeys)){const ns=findSpring(as);rs={...rs,...ns,velocity:0,mass:1},rs.isResolvedFromDuration=!0}return rs}function spring({keyframes:as,restDelta:rs,restSpeed:ns,...ss}){const os=as[0],ls=as[as.length-1],us={done:!1,value:os},{stiffness:cs,damping:ds,mass:ps,velocity:fs,duration:hs,isResolvedFromDuration:gs}=getSpringOptions(ss),ys=fs?-millisecondsToSeconds(fs):0,bs=ds/(2*Math.sqrt(cs*ps)),vs=ls-os,xs=millisecondsToSeconds(Math.sqrt(cs/ps)),Cs=Math.abs(vs)<5;ns||(ns=Cs?.01:2),rs||(rs=Cs?.005:.5);let Ts;if(bs<1){const Ss=calcAngularFreq(xs,bs);Ts=Ns=>{const As=Math.exp(-bs*xs*Ns);return ls-As*((ys+bs*xs*vs)/Ss*Math.sin(Ss*Ns)+vs*Math.cos(Ss*Ns))}}else if(bs===1)Ts=Ss=>ls-Math.exp(-xs*Ss)*(vs+(ys+xs*vs)*Ss);else{const Ss=xs*Math.sqrt(bs*bs-1);Ts=Ns=>{const As=Math.exp(-bs*xs*Ns),ws=Math.min(Ss*Ns,300);return ls-As*((ys+bs*xs*vs)*Math.sinh(ws)+Ss*vs*Math.cosh(ws))/Ss}}return{calculatedDuration:gs&&hs||null,next:Ss=>{const Ns=Ts(Ss);if(gs)us.done=Ss>=hs;else{let As=ys;Ss!==0&&(bs<1?As=calcGeneratorVelocity(Ts,Ss,Ns):As=0);const ws=Math.abs(As)<=ns,Es=Math.abs(ls-Ns)<=rs;us.done=ws&&Es}return us.value=us.done?ls:Ns,us}}}function inertia({keyframes:as,velocity:rs=0,power:ns=.8,timeConstant:ss=325,bounceDamping:os=10,bounceStiffness:ls=500,modifyTarget:us,min:cs,max:ds,restDelta:ps=.5,restSpeed:fs}){const hs=as[0],gs={done:!1,value:hs},ys=_s=>cs!==void 0&&_sds,bs=_s=>cs===void 0?ds:ds===void 0||Math.abs(cs-_s)-vs*Math.exp(-_s/ss),Ss=_s=>Cs+Ts(_s),Ns=_s=>{const $s=Ts(_s),Rs=Ss(_s);gs.done=Math.abs($s)<=ps,gs.value=gs.done?Cs:Rs};let As,ws;const Es=_s=>{ys(gs.value)&&(As=_s,ws=spring({keyframes:[gs.value,bs(gs.value)],velocity:calcGeneratorVelocity(Ss,_s,gs.value),damping:os,stiffness:ls,restDelta:ps,restSpeed:fs}))};return Es(0),{calculatedDuration:null,next:_s=>{let $s=!1;return!ws&&As===void 0&&($s=!0,Ns(_s),Es(_s)),As!==void 0&&_s>As?ws.next(_s-As):(!$s&&Ns(_s),gs)}}}const frameloopDriver=as=>{const rs=({timestamp:ns})=>as(ns);return{start:()=>sync.update(rs,!0),stop:()=>cancelSync.update(rs),now:()=>frameData.isProcessing?frameData.timestamp:performance.now()}},types={decay:inertia,inertia,tween:keyframes,keyframes,spring},maxDuration$1=2e4;function calculateDuration(as){let rs=0;const ns=50;let ss=as.next(rs);for(;!ss.done&&rs{vs&&vs(),xs=new Promise(js=>{vs=js})};Cs();let Ts;const Ss=types[os]||keyframes;let Ns;Ss!==keyframes&&typeof ss[0]!="number"&&(Ns=interpolate([0,100],ss,{clamp:!1}),ss=[0,100]);const As=Ss({...gs,keyframes:ss});let ws;cs==="mirror"&&(ws=Ss({...gs,keyframes:[...ss].reverse(),velocity:-(gs.velocity||0)}));let Es="idle",_s=null,$s=null,Rs=null;As.calculatedDuration===null&&ls&&(As.calculatedDuration=calculateDuration(As));const{calculatedDuration:Ds}=As;let Os=1/0,Is=1/0;Ds!==null&&(Os=Ds+us,Is=Os*(ls+1)-us);let Vs=0;const ks=js=>{if($s===null)return;_s!==null?Vs=_s:Vs=(js-$s)*ys,Vs=Math.max(Vs-rs,0),Es==="finished"&&_s===null&&(Vs=Is);let Ls=Vs,Gs=As;if(ls){const Nl=Vs/Os;let yl=Math.floor(Nl),Dl=Nl%1;!Dl&&Nl>=1&&(Dl=1),Dl===1&&yl--,yl=Math.min(yl,ls+1);const Rl=!!(yl%2);Rl&&(cs==="reverse"?(Dl=1-Dl,us&&(Dl-=us/Os)):cs==="mirror"&&(Gs=ws));let Ml=clamp$1(0,1,Dl);Vs>Is&&(Ml=cs==="reverse"&&Rl?1:0),Ls=Ml*Os}const Hs=Gs.next(Ls);Ns&&(Hs.value=Ns(Hs.value));let{done:Ys}=Hs;Ds!==null&&(Ys=Vs>=Is);const Zs=_s===null&&(Es==="finished"||Es==="running"&&Ys||ys<0&&Vs<=0);return hs&&hs(Hs.value),Zs&&Ms(),Hs},Ps=()=>{Ts&&Ts.stop(),Ts=void 0},Bs=()=>{Es="idle",Ps(),Cs(),$s=Rs=null},Ms=()=>{Es="finished",fs&&fs(),Ps(),Cs()},Ws=()=>{if(bs)return;Ts||(Ts=ns(ks));const js=Ts.now();ds&&ds(),Es="running",_s!==null?$s=js-_s:$s||($s=js),Rs=$s,_s=null,Ts.start()};as&&Ws();const Us={then(js,Ls){return xs.then(js,Ls)},get time(){return millisecondsToSeconds(Vs)},set time(js){js=secondsToMilliseconds(js),Vs=js,_s!==null||!Ts||ys===0?_s=js:$s=Ts.now()-js/ys},get speed(){return ys},set speed(js){js===ys||!Ts||(ys=js,Us.time=millisecondsToSeconds(Vs))},get state(){return Es},play:Ws,pause:()=>{Es="paused",_s=Vs},stop:()=>{bs=!0,Es!=="idle"&&(Es="idle",ps&&ps(),Bs())},cancel:()=>{Rs!==null&&ks(Rs),Bs()},complete:()=>{Es="finished"},sample:js=>($s=0,ks(js))};return Us}const acceleratedValues=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),sampleDelta=10,maxDuration=2e4,requiresPregeneratedKeyframes=(as,rs)=>rs.type==="spring"||as==="backgroundColor"||!isWaapiSupportedEasing(rs.ease);function createAcceleratedAnimation(as,rs,{onUpdate:ns,onComplete:ss,...os}){if(!(supports.waapi()&&acceleratedValues.has(rs)&&!os.repeatDelay&&os.repeatType!=="mirror"&&os.damping!==0&&os.type!=="inertia"))return!1;let us=!1,cs,ds;const ps=()=>{ds=new Promise(vs=>{cs=vs})};ps();let{keyframes:fs,duration:hs=300,ease:gs}=os;if(requiresPregeneratedKeyframes(rs,os)){const vs=animateValue({...os,repeat:0,delay:0});let xs={done:!1,value:fs[0]};const Cs=[];let Ts=0;for(;!xs.done&&Ts{sync.update(()=>ys.cancel()),cs(),ps()};return ys.onfinish=()=>{as.set(getFinalKeyframe(fs,os)),ss&&ss(),bs()},{then(vs,xs){return ds.then(vs,xs)},get time(){return millisecondsToSeconds(ys.currentTime||0)},set time(vs){ys.currentTime=secondsToMilliseconds(vs)},get speed(){return ys.playbackRate},set speed(vs){ys.playbackRate=vs},play:()=>{us||ys.play()},pause:()=>ys.pause(),stop:()=>{if(us=!0,ys.playState==="idle")return;const{currentTime:vs}=ys;if(vs){const xs=animateValue({...os,autoplay:!1});as.setWithVelocity(xs.sample(vs-sampleDelta).value,xs.sample(vs).value,sampleDelta)}bs()},complete:()=>ys.finish(),cancel:bs}}function createInstantAnimation({keyframes:as,delay:rs,onUpdate:ns,onComplete:ss}){const os=()=>(ns&&ns(as[as.length-1]),ss&&ss(),{time:0,speed:1,play:noop$1,pause:noop$1,stop:noop$1,then:ls=>(ls(),Promise.resolve()),cancel:noop$1,complete:noop$1});return rs?animateValue({keyframes:[0,1],duration:rs,onComplete:os}):os()}const underDampedSpring={type:"spring",stiffness:500,damping:25,restSpeed:10},criticallyDampedSpring=as=>({type:"spring",stiffness:550,damping:as===0?2*Math.sqrt(550):30,restSpeed:10}),keyframesTransition={type:"keyframes",duration:.8},ease={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},getDefaultTransition=(as,{keyframes:rs})=>rs.length>2?keyframesTransition:transformProps.has(as)?as.startsWith("scale")?criticallyDampedSpring(rs[1]):underDampedSpring:ease,isAnimatable=(as,rs)=>as==="zIndex"?!1:!!(typeof rs=="number"||Array.isArray(rs)||typeof rs=="string"&&complex.test(rs)&&!rs.startsWith("url(")),maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(as){const[rs,ns]=as.slice(0,-1).split("(");if(rs==="drop-shadow")return as;const[ss]=ns.match(floatRegex)||[];if(!ss)return as;const os=ns.replace(ss,"");let ls=maxDefaults.has(rs)?1:0;return ss!==ns&&(ls*=100),rs+"("+ls+os+")"}const functionRegex=/([a-z-]*)\(.*?\)/g,filter$1={...complex,getAnimatableNone:as=>{const rs=as.match(functionRegex);return rs?rs.map(applyDefaultFilter).join(" "):as}},defaultValueTypes={...numberValueTypes,color,backgroundColor:color,outlineColor:color,fill:color,stroke:color,borderColor:color,borderTopColor:color,borderRightColor:color,borderBottomColor:color,borderLeftColor:color,filter:filter$1,WebkitFilter:filter$1},getDefaultValueType=as=>defaultValueTypes[as];function getAnimatableNone(as,rs){let ns=getDefaultValueType(as);return ns!==filter$1&&(ns=complex),ns.getAnimatableNone?ns.getAnimatableNone(rs):void 0}function isTransitionDefined({when:as,delay:rs,delayChildren:ns,staggerChildren:ss,staggerDirection:os,repeat:ls,repeatType:us,repeatDelay:cs,from:ds,elapsed:ps,...fs}){return!!Object.keys(fs).length}function isZero(as){return as===0||typeof as=="string"&&parseFloat(as)===0&&as.indexOf(" ")===-1}function getZeroUnit(as){return typeof as=="number"?0:getAnimatableNone("",as)}function getValueTransition(as,rs){return as[rs]||as.default||as}function getKeyframes(as,rs,ns,ss){const os=isAnimatable(rs,ns);let ls=ss.from!==void 0?ss.from:as.get();return ls==="none"&&os&&typeof ns=="string"?ls=getAnimatableNone(rs,ns):isZero(ls)&&typeof ns=="string"?ls=getZeroUnit(ns):!Array.isArray(ns)&&isZero(ns)&&typeof ls=="string"&&(ns=getZeroUnit(ls)),Array.isArray(ns)?(ns[0]===null&&(ns[0]=ls),ns):[ls,ns]}const animateMotionValue=(as,rs,ns,ss={})=>os=>{const ls=getValueTransition(ss,as)||{},us=ls.delay||ss.delay||0;let{elapsed:cs=0}=ss;cs=cs-secondsToMilliseconds(us);const ds=getKeyframes(rs,as,ns,ls),ps=ds[0],fs=ds[ds.length-1],hs=isAnimatable(as,ps),gs=isAnimatable(as,fs);let ys={keyframes:ds,velocity:rs.getVelocity(),ease:"easeOut",...ls,delay:-cs,onUpdate:bs=>{rs.set(bs),ls.onUpdate&&ls.onUpdate(bs)},onComplete:()=>{os(),ls.onComplete&&ls.onComplete()}};if(!hs||!gs||instantAnimationState.current||ls.type===!1)return createInstantAnimation(ys);if(isTransitionDefined(ls)||(ys={...ys,...getDefaultTransition(as,ys)}),ys.duration&&(ys.duration=secondsToMilliseconds(ys.duration)),ys.repeatDelay&&(ys.repeatDelay=secondsToMilliseconds(ys.repeatDelay)),rs.owner&&rs.owner.current instanceof HTMLElement&&!rs.owner.getProps().onUpdate){const bs=createAcceleratedAnimation(rs,as,ys);if(bs)return bs}return animateValue(ys)};function isWillChangeMotionValue(as){return!!(isMotionValue(as)&&as.add)}const isNumericalString=as=>/^\-?\d*\.?\d+$/.test(as),isZeroValueString=as=>/^0[^.\s]+$/.test(as);function addUniqueItem(as,rs){as.indexOf(rs)===-1&&as.push(rs)}function removeItem(as,rs){const ns=as.indexOf(rs);ns>-1&&as.splice(ns,1)}class SubscriptionManager{constructor(){this.subscriptions=[]}add(rs){return addUniqueItem(this.subscriptions,rs),()=>removeItem(this.subscriptions,rs)}notify(rs,ns,ss){const os=this.subscriptions.length;if(os)if(os===1)this.subscriptions[0](rs,ns,ss);else for(let ls=0;ls!isNaN(parseFloat(as));class MotionValue{constructor(rs,ns={}){this.version="10.8.5",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(ss,os=!0)=>{this.prev=this.current,this.current=ss;const{delta:ls,timestamp:us}=frameData;this.lastUpdated!==us&&(this.timeDelta=ls,this.lastUpdated=us,sync.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),os&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>sync.postRender(this.velocityCheck),this.velocityCheck=({timestamp:ss})=>{ss!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=rs,this.canTrackVelocity=isFloat(this.current),this.owner=ns.owner}onChange(rs){return this.on("change",rs)}on(rs,ns){this.events[rs]||(this.events[rs]=new SubscriptionManager);const ss=this.events[rs].add(ns);return rs==="change"?()=>{ss(),sync.read(()=>{this.events.change.getSize()||this.stop()})}:ss}clearListeners(){for(const rs in this.events)this.events[rs].clear()}attach(rs,ns){this.passiveEffect=rs,this.stopPassiveEffect=ns}set(rs,ns=!0){!ns||!this.passiveEffect?this.updateAndNotify(rs,ns):this.passiveEffect(rs,this.updateAndNotify)}setWithVelocity(rs,ns,ss){this.set(ns),this.prev=rs,this.timeDelta=ss}jump(rs){this.updateAndNotify(rs),this.prev=rs,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?velocityPerSecond(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(rs){return this.stop(),new Promise(ns=>{this.hasAnimated=!0,this.animation=rs(ns),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function motionValue(as,rs){return new MotionValue(as,rs)}const testValueType=as=>rs=>rs.test(as),auto$1={test:as=>as==="auto",parse:as=>as},dimensionValueTypes=[number,px$1,percent,degrees,vw,vh,auto$1],findDimensionValueType=as=>dimensionValueTypes.find(testValueType(as)),valueTypes=[...dimensionValueTypes,color,complex],findValueType=as=>valueTypes.find(testValueType(as));function setMotionValue(as,rs,ns){as.hasValue(rs)?as.getValue(rs).set(ns):as.addValue(rs,motionValue(ns))}function setTarget(as,rs){const ns=resolveVariant(as,rs);let{transitionEnd:ss={},transition:os={},...ls}=ns?as.makeTargetAnimatable(ns,!1):{};ls={...ls,...ss};for(const us in ls){const cs=resolveFinalValueInKeyframes(ls[us]);setMotionValue(as,us,cs)}}function checkTargetForNewValues(as,rs,ns){var ss,os;const ls=Object.keys(rs).filter(cs=>!as.hasValue(cs)),us=ls.length;if(us)for(let cs=0;csds.remove(hs))),ps.push(vs)}return us&&Promise.all(ps).then(()=>{us&&setTarget(as,us)}),ps}function animateVariant(as,rs,ns={}){const ss=resolveVariant(as,rs,ns.custom);let{transition:os=as.getDefaultTransition()||{}}=ss||{};ns.transitionOverride&&(os=ns.transitionOverride);const ls=ss?()=>Promise.all(animateTarget(as,ss,ns)):()=>Promise.resolve(),us=as.variantChildren&&as.variantChildren.size?(ds=0)=>{const{delayChildren:ps=0,staggerChildren:fs,staggerDirection:hs}=os;return animateChildren(as,rs,ps+ds,fs,hs,ns)}:()=>Promise.resolve(),{when:cs}=os;if(cs){const[ds,ps]=cs==="beforeChildren"?[ls,us]:[us,ls];return ds().then(()=>ps())}else return Promise.all([ls(),us(ns.delay)])}function animateChildren(as,rs,ns=0,ss=0,os=1,ls){const us=[],cs=(as.variantChildren.size-1)*ss,ds=os===1?(ps=0)=>ps*ss:(ps=0)=>cs-ps*ss;return Array.from(as.variantChildren).sort(sortByTreeOrder).forEach((ps,fs)=>{ps.notify("AnimationStart",rs),us.push(animateVariant(ps,rs,{...ls,delay:ns+ds(fs)}).then(()=>ps.notify("AnimationComplete",rs)))}),Promise.all(us)}function sortByTreeOrder(as,rs){return as.sortNodePosition(rs)}function animateVisualElement(as,rs,ns={}){as.notify("AnimationStart",rs);let ss;if(Array.isArray(rs)){const os=rs.map(ls=>animateVariant(as,ls,ns));ss=Promise.all(os)}else if(typeof rs=="string")ss=animateVariant(as,rs,ns);else{const os=typeof rs=="function"?resolveVariant(as,rs,ns.custom):rs;ss=Promise.all(animateTarget(as,os,ns))}return ss.then(()=>as.notify("AnimationComplete",rs))}const reversePriorityOrder=[...variantPriorityOrder].reverse(),numAnimationTypes=variantPriorityOrder.length;function animateList(as){return rs=>Promise.all(rs.map(({animation:ns,options:ss})=>animateVisualElement(as,ns,ss)))}function createAnimationState(as){let rs=animateList(as);const ns=createState();let ss=!0;const os=(ds,ps)=>{const fs=resolveVariant(as,ps);if(fs){const{transition:hs,transitionEnd:gs,...ys}=fs;ds={...ds,...ys,...gs}}return ds};function ls(ds){rs=ds(as)}function us(ds,ps){const fs=as.getProps(),hs=as.getVariantContext(!0)||{},gs=[],ys=new Set;let bs={},vs=1/0;for(let Cs=0;Csvs&&As;const Rs=Array.isArray(Ns)?Ns:[Ns];let Ds=Rs.reduce(os,{});ws===!1&&(Ds={});const{prevResolvedValues:Os={}}=Ss,Is={...Os,...Ds},Vs=ks=>{$s=!0,ys.delete(ks),Ss.needsAnimating[ks]=!0};for(const ks in Is){const Ps=Ds[ks],Bs=Os[ks];bs.hasOwnProperty(ks)||(Ps!==Bs?isKeyframesTarget(Ps)&&isKeyframesTarget(Bs)?!shallowCompare(Ps,Bs)||_s?Vs(ks):Ss.protectedKeys[ks]=!0:Ps!==void 0?Vs(ks):ys.add(ks):Ps!==void 0&&ys.has(ks)?Vs(ks):Ss.protectedKeys[ks]=!0)}Ss.prevProp=Ns,Ss.prevResolvedValues=Ds,Ss.isActive&&(bs={...bs,...Ds}),ss&&as.blockInitialAnimation&&($s=!1),$s&&!Es&&gs.push(...Rs.map(ks=>({animation:ks,options:{type:Ts,...ds}})))}if(ys.size){const Cs={};ys.forEach(Ts=>{const Ss=as.getBaseTarget(Ts);Ss!==void 0&&(Cs[Ts]=Ss)}),gs.push({animation:Cs})}let xs=!!gs.length;return ss&&fs.initial===!1&&!as.manuallyAnimateOnMount&&(xs=!1),ss=!1,xs?rs(gs):Promise.resolve()}function cs(ds,ps,fs){var hs;if(ns[ds].isActive===ps)return Promise.resolve();(hs=as.variantChildren)===null||hs===void 0||hs.forEach(ys=>{var bs;return(bs=ys.animationState)===null||bs===void 0?void 0:bs.setActive(ds,ps)}),ns[ds].isActive=ps;const gs=us(fs,ds);for(const ys in ns)ns[ys].protectedKeys={};return gs}return{animateChanges:us,setActive:cs,setAnimateFunction:ls,getState:()=>ns}}function checkVariantsDidChange(as,rs){return typeof rs=="string"?rs!==as:Array.isArray(rs)?!shallowCompare(rs,as):!1}function createTypeState(as=!1){return{isActive:as,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function createState(){return{animate:createTypeState(!0),whileInView:createTypeState(),whileHover:createTypeState(),whileTap:createTypeState(),whileDrag:createTypeState(),whileFocus:createTypeState(),exit:createTypeState()}}class AnimationFeature extends Feature{constructor(rs){super(rs),rs.animationState||(rs.animationState=createAnimationState(rs))}updateAnimationControlsSubscription(){const{animate:rs}=this.node.getProps();this.unmount(),isAnimationControls(rs)&&(this.unmount=rs.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:rs}=this.node.getProps(),{animate:ns}=this.node.prevProps||{};rs!==ns&&this.updateAnimationControlsSubscription()}unmount(){}}let id$2=0;class ExitAnimationFeature extends Feature{constructor(){super(...arguments),this.id=id$2++}update(){if(!this.node.presenceContext)return;const{isPresent:rs,onExitComplete:ns,custom:ss}=this.node.presenceContext,{isPresent:os}=this.node.prevPresenceContext||{};if(!this.node.animationState||rs===os)return;const ls=this.node.animationState.setActive("exit",!rs,{custom:ss??this.node.getProps().custom});ns&&!rs&&ls.then(()=>ns(this.id))}mount(){const{register:rs}=this.node.presenceContext||{};rs&&(this.unmount=rs(this.id))}unmount(){}}const animations={animation:{Feature:AnimationFeature},exit:{Feature:ExitAnimationFeature}},distance=(as,rs)=>Math.abs(as-rs);function distance2D(as,rs){const ns=distance(as.x,rs.x),ss=distance(as.y,rs.y);return Math.sqrt(ns**2+ss**2)}class PanSession{constructor(rs,ns,{transformPagePoint:ss}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const ps=getPanInfo(this.lastMoveEventInfo,this.history),fs=this.startEvent!==null,hs=distance2D(ps.offset,{x:0,y:0})>=3;if(!fs&&!hs)return;const{point:gs}=ps,{timestamp:ys}=frameData;this.history.push({...gs,timestamp:ys});const{onStart:bs,onMove:vs}=this.handlers;fs||(bs&&bs(this.lastMoveEvent,ps),this.startEvent=this.lastMoveEvent),vs&&vs(this.lastMoveEvent,ps)},this.handlePointerMove=(ps,fs)=>{this.lastMoveEvent=ps,this.lastMoveEventInfo=transformPoint(fs,this.transformPagePoint),sync.update(this.updatePoint,!0)},this.handlePointerUp=(ps,fs)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:hs,onSessionEnd:gs}=this.handlers,ys=getPanInfo(ps.type==="pointercancel"?this.lastMoveEventInfo:transformPoint(fs,this.transformPagePoint),this.history);this.startEvent&&hs&&hs(ps,ys),gs&&gs(ps,ys)},!isPrimaryPointer(rs))return;this.handlers=ns,this.transformPagePoint=ss;const os=extractEventInfo(rs),ls=transformPoint(os,this.transformPagePoint),{point:us}=ls,{timestamp:cs}=frameData;this.history=[{...us,timestamp:cs}];const{onSessionStart:ds}=ns;ds&&ds(rs,getPanInfo(ls,this.history)),this.removeListeners=pipe(addPointerEvent(window,"pointermove",this.handlePointerMove),addPointerEvent(window,"pointerup",this.handlePointerUp),addPointerEvent(window,"pointercancel",this.handlePointerUp))}updateHandlers(rs){this.handlers=rs}end(){this.removeListeners&&this.removeListeners(),cancelSync.update(this.updatePoint)}}function transformPoint(as,rs){return rs?{point:rs(as.point)}:as}function subtractPoint(as,rs){return{x:as.x-rs.x,y:as.y-rs.y}}function getPanInfo({point:as},rs){return{point:as,delta:subtractPoint(as,lastDevicePoint(rs)),offset:subtractPoint(as,startDevicePoint(rs)),velocity:getVelocity(rs,.1)}}function startDevicePoint(as){return as[0]}function lastDevicePoint(as){return as[as.length-1]}function getVelocity(as,rs){if(as.length<2)return{x:0,y:0};let ns=as.length-1,ss=null;const os=lastDevicePoint(as);for(;ns>=0&&(ss=as[ns],!(os.timestamp-ss.timestamp>secondsToMilliseconds(rs)));)ns--;if(!ss)return{x:0,y:0};const ls=millisecondsToSeconds(os.timestamp-ss.timestamp);if(ls===0)return{x:0,y:0};const us={x:(os.x-ss.x)/ls,y:(os.y-ss.y)/ls};return us.x===1/0&&(us.x=0),us.y===1/0&&(us.y=0),us}function calcLength(as){return as.max-as.min}function isNear(as,rs=0,ns=.01){return Math.abs(as-rs)<=ns}function calcAxisDelta(as,rs,ns,ss=.5){as.origin=ss,as.originPoint=mix(rs.min,rs.max,as.origin),as.scale=calcLength(ns)/calcLength(rs),(isNear(as.scale,1,1e-4)||isNaN(as.scale))&&(as.scale=1),as.translate=mix(ns.min,ns.max,as.origin)-as.originPoint,(isNear(as.translate)||isNaN(as.translate))&&(as.translate=0)}function calcBoxDelta(as,rs,ns,ss){calcAxisDelta(as.x,rs.x,ns.x,ss?ss.originX:void 0),calcAxisDelta(as.y,rs.y,ns.y,ss?ss.originY:void 0)}function calcRelativeAxis(as,rs,ns){as.min=ns.min+rs.min,as.max=as.min+calcLength(rs)}function calcRelativeBox(as,rs,ns){calcRelativeAxis(as.x,rs.x,ns.x),calcRelativeAxis(as.y,rs.y,ns.y)}function calcRelativeAxisPosition(as,rs,ns){as.min=rs.min-ns.min,as.max=as.min+calcLength(rs)}function calcRelativePosition(as,rs,ns){calcRelativeAxisPosition(as.x,rs.x,ns.x),calcRelativeAxisPosition(as.y,rs.y,ns.y)}function applyConstraints(as,{min:rs,max:ns},ss){return rs!==void 0&&asns&&(as=ss?mix(ns,as,ss.max):Math.min(as,ns)),as}function calcRelativeAxisConstraints(as,rs,ns){return{min:rs!==void 0?as.min+rs:void 0,max:ns!==void 0?as.max+ns-(as.max-as.min):void 0}}function calcRelativeConstraints(as,{top:rs,left:ns,bottom:ss,right:os}){return{x:calcRelativeAxisConstraints(as.x,ns,os),y:calcRelativeAxisConstraints(as.y,rs,ss)}}function calcViewportAxisConstraints(as,rs){let ns=rs.min-as.min,ss=rs.max-as.max;return rs.max-rs.minss?ns=progress(rs.min,rs.max-ss,as.min):ss>os&&(ns=progress(as.min,as.max-os,rs.min)),clamp$1(0,1,ns)}function rebaseAxisConstraints(as,rs){const ns={};return rs.min!==void 0&&(ns.min=rs.min-as.min),rs.max!==void 0&&(ns.max=rs.max-as.min),ns}const defaultElastic=.35;function resolveDragElastic(as=defaultElastic){return as===!1?as=0:as===!0&&(as=defaultElastic),{x:resolveAxisElastic(as,"left","right"),y:resolveAxisElastic(as,"top","bottom")}}function resolveAxisElastic(as,rs,ns){return{min:resolvePointElastic(as,rs),max:resolvePointElastic(as,ns)}}function resolvePointElastic(as,rs){return typeof as=="number"?as:as[rs]||0}const createAxisDelta=()=>({translate:0,scale:1,origin:0,originPoint:0}),createDelta=()=>({x:createAxisDelta(),y:createAxisDelta()}),createAxis=()=>({min:0,max:0}),createBox=()=>({x:createAxis(),y:createAxis()});function eachAxis(as){return[as("x"),as("y")]}function convertBoundingBoxToBox({top:as,left:rs,right:ns,bottom:ss}){return{x:{min:rs,max:ns},y:{min:as,max:ss}}}function convertBoxToBoundingBox({x:as,y:rs}){return{top:rs.min,right:as.max,bottom:rs.max,left:as.min}}function transformBoxPoints(as,rs){if(!rs)return as;const ns=rs({x:as.left,y:as.top}),ss=rs({x:as.right,y:as.bottom});return{top:ns.y,left:ns.x,bottom:ss.y,right:ss.x}}function isIdentityScale(as){return as===void 0||as===1}function hasScale({scale:as,scaleX:rs,scaleY:ns}){return!isIdentityScale(as)||!isIdentityScale(rs)||!isIdentityScale(ns)}function hasTransform(as){return hasScale(as)||has2DTranslate(as)||as.z||as.rotate||as.rotateX||as.rotateY}function has2DTranslate(as){return is2DTranslate(as.x)||is2DTranslate(as.y)}function is2DTranslate(as){return as&&as!=="0%"}function scalePoint(as,rs,ns){const ss=as-ns,os=rs*ss;return ns+os}function applyPointDelta(as,rs,ns,ss,os){return os!==void 0&&(as=scalePoint(as,os,ss)),scalePoint(as,ns,ss)+rs}function applyAxisDelta(as,rs=0,ns=1,ss,os){as.min=applyPointDelta(as.min,rs,ns,ss,os),as.max=applyPointDelta(as.max,rs,ns,ss,os)}function applyBoxDelta(as,{x:rs,y:ns}){applyAxisDelta(as.x,rs.translate,rs.scale,rs.originPoint),applyAxisDelta(as.y,ns.translate,ns.scale,ns.originPoint)}function applyTreeDeltas(as,rs,ns,ss=!1){const os=ns.length;if(!os)return;rs.x=rs.y=1;let ls,us;for(let cs=0;cs1.0000000000001||as<.999999999999?as:1}function translateAxis(as,rs){as.min=as.min+rs,as.max=as.max+rs}function transformAxis(as,rs,[ns,ss,os]){const ls=rs[os]!==void 0?rs[os]:.5,us=mix(as.min,as.max,ls);applyAxisDelta(as,rs[ns],rs[ss],us,rs.scale)}const xKeys$1=["x","scaleX","originX"],yKeys$1=["y","scaleY","originY"];function transformBox(as,rs){transformAxis(as.x,rs,xKeys$1),transformAxis(as.y,rs,yKeys$1)}function measureViewportBox(as,rs){return convertBoundingBoxToBox(transformBoxPoints(as.getBoundingClientRect(),rs))}function measurePageBox(as,rs,ns){const ss=measureViewportBox(as,ns),{scroll:os}=rs;return os&&(translateAxis(ss.x,os.offset.x),translateAxis(ss.y,os.offset.y)),ss}const elementDragControls=new WeakMap;class VisualElementDragControls{constructor(rs){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=createBox(),this.visualElement=rs}start(rs,{snapToCursor:ns=!1}={}){const{presenceContext:ss}=this.visualElement;if(ss&&ss.isPresent===!1)return;const os=ds=>{this.stopAnimation(),ns&&this.snapToCursor(extractEventInfo(ds,"page").point)},ls=(ds,ps)=>{const{drag:fs,dragPropagation:hs,onDragStart:gs}=this.getProps();if(fs&&!hs&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=getGlobalLock(fs),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),eachAxis(bs=>{let vs=this.getAxisMotionValue(bs).get()||0;if(percent.test(vs)){const{projection:xs}=this.visualElement;if(xs&&xs.layout){const Cs=xs.layout.layoutBox[bs];Cs&&(vs=calcLength(Cs)*(parseFloat(vs)/100))}}this.originPoint[bs]=vs}),gs&&sync.update(()=>gs(ds,ps));const{animationState:ys}=this.visualElement;ys&&ys.setActive("whileDrag",!0)},us=(ds,ps)=>{const{dragPropagation:fs,dragDirectionLock:hs,onDirectionLock:gs,onDrag:ys}=this.getProps();if(!fs&&!this.openGlobalLock)return;const{offset:bs}=ps;if(hs&&this.currentDirection===null){this.currentDirection=getCurrentDirection(bs),this.currentDirection!==null&&gs&&gs(this.currentDirection);return}this.updateAxis("x",ps.point,bs),this.updateAxis("y",ps.point,bs),this.visualElement.render(),ys&&ys(ds,ps)},cs=(ds,ps)=>this.stop(ds,ps);this.panSession=new PanSession(rs,{onSessionStart:os,onStart:ls,onMove:us,onSessionEnd:cs},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(rs,ns){const ss=this.isDragging;if(this.cancel(),!ss)return;const{velocity:os}=ns;this.startAnimation(os);const{onDragEnd:ls}=this.getProps();ls&&sync.update(()=>ls(rs,ns))}cancel(){this.isDragging=!1;const{projection:rs,animationState:ns}=this.visualElement;rs&&(rs.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:ss}=this.getProps();!ss&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),ns&&ns.setActive("whileDrag",!1)}updateAxis(rs,ns,ss){const{drag:os}=this.getProps();if(!ss||!shouldDrag(rs,os,this.currentDirection))return;const ls=this.getAxisMotionValue(rs);let us=this.originPoint[rs]+ss[rs];this.constraints&&this.constraints[rs]&&(us=applyConstraints(us,this.constraints[rs],this.elastic[rs])),ls.set(us)}resolveConstraints(){const{dragConstraints:rs,dragElastic:ns}=this.getProps(),{layout:ss}=this.visualElement.projection||{},os=this.constraints;rs&&isRefObject(rs)?this.constraints||(this.constraints=this.resolveRefConstraints()):rs&&ss?this.constraints=calcRelativeConstraints(ss.layoutBox,rs):this.constraints=!1,this.elastic=resolveDragElastic(ns),os!==this.constraints&&ss&&this.constraints&&!this.hasMutatedConstraints&&eachAxis(ls=>{this.getAxisMotionValue(ls)&&(this.constraints[ls]=rebaseAxisConstraints(ss.layoutBox[ls],this.constraints[ls]))})}resolveRefConstraints(){const{dragConstraints:rs,onMeasureDragConstraints:ns}=this.getProps();if(!rs||!isRefObject(rs))return!1;const ss=rs.current,{projection:os}=this.visualElement;if(!os||!os.layout)return!1;const ls=measurePageBox(ss,os.root,this.visualElement.getTransformPagePoint());let us=calcViewportConstraints(os.layout.layoutBox,ls);if(ns){const cs=ns(convertBoxToBoundingBox(us));this.hasMutatedConstraints=!!cs,cs&&(us=convertBoundingBoxToBox(cs))}return us}startAnimation(rs){const{drag:ns,dragMomentum:ss,dragElastic:os,dragTransition:ls,dragSnapToOrigin:us,onDragTransitionEnd:cs}=this.getProps(),ds=this.constraints||{},ps=eachAxis(fs=>{if(!shouldDrag(fs,ns,this.currentDirection))return;let hs=ds&&ds[fs]||{};us&&(hs={min:0,max:0});const gs=os?200:1e6,ys=os?40:1e7,bs={type:"inertia",velocity:ss?rs[fs]:0,bounceStiffness:gs,bounceDamping:ys,timeConstant:750,restDelta:1,restSpeed:10,...ls,...hs};return this.startAxisValueAnimation(fs,bs)});return Promise.all(ps).then(cs)}startAxisValueAnimation(rs,ns){const ss=this.getAxisMotionValue(rs);return ss.start(animateMotionValue(rs,ss,0,ns))}stopAnimation(){eachAxis(rs=>this.getAxisMotionValue(rs).stop())}getAxisMotionValue(rs){const ns="_drag"+rs.toUpperCase(),ss=this.visualElement.getProps(),os=ss[ns];return os||this.visualElement.getValue(rs,(ss.initial?ss.initial[rs]:void 0)||0)}snapToCursor(rs){eachAxis(ns=>{const{drag:ss}=this.getProps();if(!shouldDrag(ns,ss,this.currentDirection))return;const{projection:os}=this.visualElement,ls=this.getAxisMotionValue(ns);if(os&&os.layout){const{min:us,max:cs}=os.layout.layoutBox[ns];ls.set(rs[ns]-mix(us,cs,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:rs,dragConstraints:ns}=this.getProps(),{projection:ss}=this.visualElement;if(!isRefObject(ns)||!ss||!this.constraints)return;this.stopAnimation();const os={x:0,y:0};eachAxis(us=>{const cs=this.getAxisMotionValue(us);if(cs){const ds=cs.get();os[us]=calcOrigin({min:ds,max:ds},this.constraints[us])}});const{transformTemplate:ls}=this.visualElement.getProps();this.visualElement.current.style.transform=ls?ls({},""):"none",ss.root&&ss.root.updateScroll(),ss.updateLayout(),this.resolveConstraints(),eachAxis(us=>{if(!shouldDrag(us,rs,null))return;const cs=this.getAxisMotionValue(us),{min:ds,max:ps}=this.constraints[us];cs.set(mix(ds,ps,os[us]))})}addListeners(){if(!this.visualElement.current)return;elementDragControls.set(this.visualElement,this);const rs=this.visualElement.current,ns=addPointerEvent(rs,"pointerdown",ds=>{const{drag:ps,dragListener:fs=!0}=this.getProps();ps&&fs&&this.start(ds)}),ss=()=>{const{dragConstraints:ds}=this.getProps();isRefObject(ds)&&(this.constraints=this.resolveRefConstraints())},{projection:os}=this.visualElement,ls=os.addEventListener("measure",ss);os&&!os.layout&&(os.root&&os.root.updateScroll(),os.updateLayout()),ss();const us=addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints()),cs=os.addEventListener("didUpdate",({delta:ds,hasLayoutChanged:ps})=>{this.isDragging&&ps&&(eachAxis(fs=>{const hs=this.getAxisMotionValue(fs);hs&&(this.originPoint[fs]+=ds[fs].translate,hs.set(hs.get()+ds[fs].translate))}),this.visualElement.render())});return()=>{us(),ns(),ls(),cs&&cs()}}getProps(){const rs=this.visualElement.getProps(),{drag:ns=!1,dragDirectionLock:ss=!1,dragPropagation:os=!1,dragConstraints:ls=!1,dragElastic:us=defaultElastic,dragMomentum:cs=!0}=rs;return{...rs,drag:ns,dragDirectionLock:ss,dragPropagation:os,dragConstraints:ls,dragElastic:us,dragMomentum:cs}}}function shouldDrag(as,rs,ns){return(rs===!0||rs===as)&&(ns===null||ns===as)}function getCurrentDirection(as,rs=10){let ns=null;return Math.abs(as.y)>rs?ns="y":Math.abs(as.x)>rs&&(ns="x"),ns}class DragGesture extends Feature{constructor(rs){super(rs),this.removeGroupControls=noop$1,this.removeListeners=noop$1,this.controls=new VisualElementDragControls(rs)}mount(){const{dragControls:rs}=this.node.getProps();rs&&(this.removeGroupControls=rs.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||noop$1}unmount(){this.removeGroupControls(),this.removeListeners()}}const asyncHandler=as=>(rs,ns)=>{as&&sync.update(()=>as(rs,ns))};class PanGesture extends Feature{constructor(){super(...arguments),this.removePointerDownListener=noop$1}onPointerDown(rs){this.session=new PanSession(rs,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:rs,onPanStart:ns,onPan:ss,onPanEnd:os}=this.node.getProps();return{onSessionStart:asyncHandler(rs),onStart:asyncHandler(ns),onMove:ss,onEnd:(ls,us)=>{delete this.session,os&&sync.update(()=>os(ls,us))}}}mount(){this.removePointerDownListener=addPointerEvent(this.node.current,"pointerdown",rs=>this.onPointerDown(rs))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function usePresence(){const as=reactExports.useContext(PresenceContext);if(as===null)return[!0,null];const{isPresent:rs,onExitComplete:ns,register:ss}=as,os=reactExports.useId();return reactExports.useEffect(()=>ss(os),[]),!rs&&ns?[!1,()=>ns&&ns(os)]:[!0]}function useIsPresent(){return isPresent(reactExports.useContext(PresenceContext))}function isPresent(as){return as===null?!0:as.isPresent}function pixelsToPercent(as,rs){return rs.max===rs.min?0:as/(rs.max-rs.min)*100}const correctBorderRadius={correct:(as,rs)=>{if(!rs.target)return as;if(typeof as=="string")if(px$1.test(as))as=parseFloat(as);else return as;const ns=pixelsToPercent(as,rs.target.x),ss=pixelsToPercent(as,rs.target.y);return`${ns}% ${ss}%`}},cssVariableRegex=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function parseCSSVariable(as){const rs=cssVariableRegex.exec(as);if(!rs)return[,];const[,ns,ss]=rs;return[ns,ss]}function getVariableValue(as,rs,ns=1){const[ss,os]=parseCSSVariable(as);if(!ss)return;const ls=window.getComputedStyle(rs).getPropertyValue(ss);return ls?ls.trim():isCSSVariableToken(os)?getVariableValue(os,rs,ns+1):os}function resolveCSSVariables(as,{...rs},ns){const ss=as.current;if(!(ss instanceof Element))return{target:rs,transitionEnd:ns};ns&&(ns={...ns}),as.values.forEach(os=>{const ls=os.get();if(!isCSSVariableToken(ls))return;const us=getVariableValue(ls,ss);us&&os.set(us)});for(const os in rs){const ls=rs[os];if(!isCSSVariableToken(ls))continue;const us=getVariableValue(ls,ss);us&&(rs[os]=us,ns||(ns={}),ns[os]===void 0&&(ns[os]=ls))}return{target:rs,transitionEnd:ns}}const varToken="_$css",correctBoxShadow={correct:(as,{treeScale:rs,projectionDelta:ns})=>{const ss=as,os=as.includes("var("),ls=[];os&&(as=as.replace(cssVariableRegex,ys=>(ls.push(ys),varToken)));const us=complex.parse(as);if(us.length>5)return ss;const cs=complex.createTransformer(as),ds=typeof us[0]!="number"?1:0,ps=ns.x.scale*rs.x,fs=ns.y.scale*rs.y;us[0+ds]/=ps,us[1+ds]/=fs;const hs=mix(ps,fs,.5);typeof us[2+ds]=="number"&&(us[2+ds]/=hs),typeof us[3+ds]=="number"&&(us[3+ds]/=hs);let gs=cs(us);if(os){let ys=0;gs=gs.replace(varToken,()=>{const bs=ls[ys];return ys++,bs})}return gs}};class MeasureLayoutWithContext extends React.Component{componentDidMount(){const{visualElement:rs,layoutGroup:ns,switchLayoutGroup:ss,layoutId:os}=this.props,{projection:ls}=rs;addScaleCorrector(defaultScaleCorrectors),ls&&(ns.group&&ns.group.add(ls),ss&&ss.register&&os&&ss.register(ls),ls.root.didUpdate(),ls.addEventListener("animationComplete",()=>{this.safeToRemove()}),ls.setOptions({...ls.options,onExitComplete:()=>this.safeToRemove()})),globalProjectionState.hasEverUpdated=!0}getSnapshotBeforeUpdate(rs){const{layoutDependency:ns,visualElement:ss,drag:os,isPresent:ls}=this.props,us=ss.projection;return us&&(us.isPresent=ls,os||rs.layoutDependency!==ns||ns===void 0?us.willUpdate():this.safeToRemove(),rs.isPresent!==ls&&(ls?us.promote():us.relegate()||sync.postRender(()=>{const cs=us.getStack();(!cs||!cs.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:rs}=this.props.visualElement;rs&&(rs.root.didUpdate(),!rs.currentAnimation&&rs.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:rs,layoutGroup:ns,switchLayoutGroup:ss}=this.props,{projection:os}=rs;os&&(os.scheduleCheckAfterUnmount(),ns&&ns.group&&ns.group.remove(os),ss&&ss.deregister&&ss.deregister(os))}safeToRemove(){const{safeToRemove:rs}=this.props;rs&&rs()}render(){return null}}function MeasureLayout(as){const[rs,ns]=usePresence(),ss=reactExports.useContext(LayoutGroupContext);return React.createElement(MeasureLayoutWithContext,{...as,layoutGroup:ss,switchLayoutGroup:reactExports.useContext(SwitchLayoutGroupContext),isPresent:rs,safeToRemove:ns})}const defaultScaleCorrectors={borderRadius:{...correctBorderRadius,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=as=>typeof as=="string"?parseFloat(as):as,isPx=as=>typeof as=="number"||px$1.test(as);function mixValues(as,rs,ns,ss,os,ls){os?(as.opacity=mix(0,ns.opacity!==void 0?ns.opacity:1,easeCrossfadeIn(ss)),as.opacityExit=mix(rs.opacity!==void 0?rs.opacity:1,0,easeCrossfadeOut(ss))):ls&&(as.opacity=mix(rs.opacity!==void 0?rs.opacity:1,ns.opacity!==void 0?ns.opacity:1,ss));for(let us=0;usssrs?1:ns(progress(as,rs,ss))}function copyAxisInto(as,rs){as.min=rs.min,as.max=rs.max}function copyBoxInto(as,rs){copyAxisInto(as.x,rs.x),copyAxisInto(as.y,rs.y)}function removePointDelta(as,rs,ns,ss,os){return as-=rs,as=scalePoint(as,1/ns,ss),os!==void 0&&(as=scalePoint(as,1/os,ss)),as}function removeAxisDelta(as,rs=0,ns=1,ss=.5,os,ls=as,us=as){if(percent.test(rs)&&(rs=parseFloat(rs),rs=mix(us.min,us.max,rs/100)-us.min),typeof rs!="number")return;let cs=mix(ls.min,ls.max,ss);as===ls&&(cs-=rs),as.min=removePointDelta(as.min,rs,ns,cs,os),as.max=removePointDelta(as.max,rs,ns,cs,os)}function removeAxisTransforms(as,rs,[ns,ss,os],ls,us){removeAxisDelta(as,rs[ns],rs[ss],rs[os],rs.scale,ls,us)}const xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(as,rs,ns,ss){removeAxisTransforms(as.x,rs,xKeys,ns?ns.x:void 0,ss?ss.x:void 0),removeAxisTransforms(as.y,rs,yKeys,ns?ns.y:void 0,ss?ss.y:void 0)}function isAxisDeltaZero(as){return as.translate===0&&as.scale===1}function isDeltaZero(as){return isAxisDeltaZero(as.x)&&isAxisDeltaZero(as.y)}function boxEquals(as,rs){return as.x.min===rs.x.min&&as.x.max===rs.x.max&&as.y.min===rs.y.min&&as.y.max===rs.y.max}function aspectRatio(as){return calcLength(as.x)/calcLength(as.y)}class NodeStack{constructor(){this.members=[]}add(rs){addUniqueItem(this.members,rs),rs.scheduleRender()}remove(rs){if(removeItem(this.members,rs),rs===this.prevLead&&(this.prevLead=void 0),rs===this.lead){const ns=this.members[this.members.length-1];ns&&this.promote(ns)}}relegate(rs){const ns=this.members.findIndex(os=>rs===os);if(ns===0)return!1;let ss;for(let os=ns;os>=0;os--){const ls=this.members[os];if(ls.isPresent!==!1){ss=ls;break}}return ss?(this.promote(ss),!0):!1}promote(rs,ns){const ss=this.lead;if(rs!==ss&&(this.prevLead=ss,this.lead=rs,rs.show(),ss)){ss.instance&&ss.scheduleRender(),rs.scheduleRender(),rs.resumeFrom=ss,ns&&(rs.resumeFrom.preserveOpacity=!0),ss.snapshot&&(rs.snapshot=ss.snapshot,rs.snapshot.latestValues=ss.animationValues||ss.latestValues),rs.root&&rs.root.isUpdating&&(rs.isLayoutDirty=!0);const{crossfade:os}=rs.options;os===!1&&ss.hide()}}exitAnimationComplete(){this.members.forEach(rs=>{const{options:ns,resumingFrom:ss}=rs;ns.onExitComplete&&ns.onExitComplete(),ss&&ss.options.onExitComplete&&ss.options.onExitComplete()})}scheduleRender(){this.members.forEach(rs=>{rs.instance&&rs.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function buildProjectionTransform(as,rs,ns){let ss="";const os=as.x.translate/rs.x,ls=as.y.translate/rs.y;if((os||ls)&&(ss=`translate3d(${os}px, ${ls}px, 0) `),(rs.x!==1||rs.y!==1)&&(ss+=`scale(${1/rs.x}, ${1/rs.y}) `),ns){const{rotate:ds,rotateX:ps,rotateY:fs}=ns;ds&&(ss+=`rotate(${ds}deg) `),ps&&(ss+=`rotateX(${ps}deg) `),fs&&(ss+=`rotateY(${fs}deg) `)}const us=as.x.scale*rs.x,cs=as.y.scale*rs.y;return(us!==1||cs!==1)&&(ss+=`scale(${us}, ${cs})`),ss||"none"}const compareByDepth=(as,rs)=>as.depth-rs.depth;class FlatTree{constructor(){this.children=[],this.isDirty=!1}add(rs){addUniqueItem(this.children,rs),this.isDirty=!0}remove(rs){removeItem(this.children,rs),this.isDirty=!0}forEach(rs){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(rs)}}function delay(as,rs){const ns=performance.now(),ss=({timestamp:os})=>{const ls=os-ns;ls>=rs&&(cancelSync.read(ss),as(ls-rs))};return sync.read(ss,!0),()=>cancelSync.read(ss)}function record(as){window.MotionDebug&&window.MotionDebug.record(as)}function isSVGElement(as){return as instanceof SVGElement&&as.tagName!=="svg"}function animateSingleValue(as,rs,ns){const ss=isMotionValue(as)?as:motionValue(as);return ss.start(animateMotionValue("",ss,rs,ns)),ss.animation}const transformAxes=["","X","Y","Z"],animationTarget=1e3;let id$1=0;const projectionFrameData={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function createProjectionNode({attachResizeListener:as,defaultParent:rs,measureScroll:ns,checkIsScrollRoot:ss,resetTransform:os}){return class{constructor(us,cs={},ds=rs==null?void 0:rs()){this.id=id$1++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{projectionFrameData.totalNodes=projectionFrameData.resolvedTargetDeltas=projectionFrameData.recalculatedProjection=0,this.nodes.forEach(propagateDirtyNodes),this.nodes.forEach(resolveTargetDelta),this.nodes.forEach(calcProjection),this.nodes.forEach(cleanDirtyNodes),record(projectionFrameData)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=us,this.latestValues=cs,this.root=ds?ds.root||ds:this,this.path=ds?[...ds.path,ds]:[],this.parent=ds,this.depth=ds?ds.depth+1:0,us&&this.root.registerPotentialNode(us,this);for(let ps=0;psthis.root.updateBlockedByResize=!1;as(us,()=>{this.root.updateBlockedByResize=!0,hs&&hs(),hs=delay(gs,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,this.nodes.forEach(finishAnimation))})}ds&&this.root.registerSharedNode(ds,this),this.options.animate!==!1&&fs&&(ds||ps)&&this.addEventListener("didUpdate",({delta:hs,hasLayoutChanged:gs,hasRelativeTargetChanged:ys,layout:bs})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const vs=this.options.transition||fs.getDefaultTransition()||defaultLayoutTransition,{onLayoutAnimationStart:xs,onLayoutAnimationComplete:Cs}=fs.getProps(),Ts=!this.targetLayout||!boxEquals(this.targetLayout,bs)||ys,Ss=!gs&&ys;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||Ss||gs&&(Ts||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(hs,Ss);const Ns={...getValueTransition(vs,"layout"),onPlay:xs,onComplete:Cs};(fs.shouldReduceMotion||this.options.layoutRoot)&&(Ns.delay=0,Ns.type=!1),this.startAnimation(Ns)}else!gs&&this.animationProgress===0&&finishAnimation(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=bs})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const us=this.getStack();us&&us.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cancelSync.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(resetRotation),this.animationId++)}getTransformTemplate(){const{visualElement:us}=this.options;return us&&us.getProps().transformTemplate}willUpdate(us=!0){if(this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let fs=0;fs{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let ds=0;ds{const As=Ns/1e3;mixAxisDelta(hs.x,us.x,As),mixAxisDelta(hs.y,us.y,As),this.setTargetDelta(hs),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(calcRelativePosition(gs,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mixBox(this.relativeTarget,this.relativeTargetOrigin,gs,As),Ss&&boxEquals(this.relativeTarget,Ss)&&(this.isProjectionDirty=!1),Ss||(Ss=createBox()),copyBoxInto(Ss,this.relativeTarget)),vs&&(this.animationValues=fs,mixValues(fs,ps,this.latestValues,As,Ts,Cs)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=As},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(us){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cancelSync.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=sync.update(()=>{globalProjectionState.hasAnimatedSinceResize=!0,this.currentAnimation=animateSingleValue(0,animationTarget,{...us,onUpdate:cs=>{this.mixTargetDelta(cs),us.onUpdate&&us.onUpdate(cs)},onComplete:()=>{us.onComplete&&us.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const us=this.getStack();us&&us.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(animationTarget),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const us=this.getLead();let{targetWithTransforms:cs,target:ds,layout:ps,latestValues:fs}=us;if(!(!cs||!ds||!ps)){if(this!==us&&this.layout&&ps&&shouldAnimatePositionOnly(this.options.animationType,this.layout.layoutBox,ps.layoutBox)){ds=this.target||createBox();const hs=calcLength(this.layout.layoutBox.x);ds.x.min=us.target.x.min,ds.x.max=ds.x.min+hs;const gs=calcLength(this.layout.layoutBox.y);ds.y.min=us.target.y.min,ds.y.max=ds.y.min+gs}copyBoxInto(cs,ds),transformBox(cs,fs),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,cs,fs)}}registerSharedNode(us,cs){this.sharedNodes.has(us)||this.sharedNodes.set(us,new NodeStack),this.sharedNodes.get(us).add(cs);const ps=cs.options.initialPromotionConfig;cs.promote({transition:ps?ps.transition:void 0,preserveFollowOpacity:ps&&ps.shouldPreserveFollowOpacity?ps.shouldPreserveFollowOpacity(cs):void 0})}isLead(){const us=this.getStack();return us?us.lead===this:!0}getLead(){var us;const{layoutId:cs}=this.options;return cs?((us=this.getStack())===null||us===void 0?void 0:us.lead)||this:this}getPrevLead(){var us;const{layoutId:cs}=this.options;return cs?(us=this.getStack())===null||us===void 0?void 0:us.prevLead:void 0}getStack(){const{layoutId:us}=this.options;if(us)return this.root.sharedNodes.get(us)}promote({needsReset:us,transition:cs,preserveFollowOpacity:ds}={}){const ps=this.getStack();ps&&ps.promote(this,ds),us&&(this.projectionDelta=void 0,this.needsReset=!0),cs&&this.setOptions({transition:cs})}relegate(){const us=this.getStack();return us?us.relegate(this):!1}resetRotation(){const{visualElement:us}=this.options;if(!us)return;let cs=!1;const{latestValues:ds}=us;if((ds.rotate||ds.rotateX||ds.rotateY||ds.rotateZ)&&(cs=!0),!cs)return;const ps={};for(let fs=0;fs{var cs;return(cs=us.currentAnimation)===null||cs===void 0?void 0:cs.stop()}),this.root.nodes.forEach(clearMeasurements),this.root.sharedNodes.clear()}}}function updateLayout(as){as.updateLayout()}function notifyLayoutUpdate(as){var rs;const ns=((rs=as.resumeFrom)===null||rs===void 0?void 0:rs.snapshot)||as.snapshot;if(as.isLead()&&as.layout&&ns&&as.hasListeners("didUpdate")){const{layoutBox:ss,measuredBox:os}=as.layout,{animationType:ls}=as.options,us=ns.source!==as.layout.source;ls==="size"?eachAxis(hs=>{const gs=us?ns.measuredBox[hs]:ns.layoutBox[hs],ys=calcLength(gs);gs.min=ss[hs].min,gs.max=gs.min+ys}):shouldAnimatePositionOnly(ls,ns.layoutBox,ss)&&eachAxis(hs=>{const gs=us?ns.measuredBox[hs]:ns.layoutBox[hs],ys=calcLength(ss[hs]);gs.max=gs.min+ys});const cs=createDelta();calcBoxDelta(cs,ss,ns.layoutBox);const ds=createDelta();us?calcBoxDelta(ds,as.applyTransform(os,!0),ns.measuredBox):calcBoxDelta(ds,ss,ns.layoutBox);const ps=!isDeltaZero(cs);let fs=!1;if(!as.resumeFrom){const hs=as.getClosestProjectingParent();if(hs&&!hs.resumeFrom){const{snapshot:gs,layout:ys}=hs;if(gs&&ys){const bs=createBox();calcRelativePosition(bs,ns.layoutBox,gs.layoutBox);const vs=createBox();calcRelativePosition(vs,ss,ys.layoutBox),boxEquals(bs,vs)||(fs=!0),hs.options.layoutRoot&&(as.relativeTarget=vs,as.relativeTargetOrigin=bs,as.relativeParent=hs)}}}as.notifyListeners("didUpdate",{layout:ss,snapshot:ns,delta:ds,layoutDelta:cs,hasLayoutChanged:ps,hasRelativeTargetChanged:fs})}else if(as.isLead()){const{onExitComplete:ss}=as.options;ss&&ss()}as.options.transition=void 0}function propagateDirtyNodes(as){projectionFrameData.totalNodes++,as.parent&&(as.isProjecting()||(as.isProjectionDirty=as.parent.isProjectionDirty),as.isSharedProjectionDirty||(as.isSharedProjectionDirty=!!(as.isProjectionDirty||as.parent.isProjectionDirty||as.parent.isSharedProjectionDirty)),as.isTransformDirty||(as.isTransformDirty=as.parent.isTransformDirty))}function cleanDirtyNodes(as){as.isProjectionDirty=as.isSharedProjectionDirty=as.isTransformDirty=!1}function clearSnapshot(as){as.clearSnapshot()}function clearMeasurements(as){as.clearMeasurements()}function resetTransformStyle(as){const{visualElement:rs}=as.options;rs&&rs.getProps().onBeforeLayoutMeasure&&rs.notify("BeforeLayoutMeasure"),as.resetTransform()}function finishAnimation(as){as.finishAnimation(),as.targetDelta=as.relativeTarget=as.target=void 0}function resolveTargetDelta(as){as.resolveTargetDelta()}function calcProjection(as){as.calcProjection()}function resetRotation(as){as.resetRotation()}function removeLeadSnapshots(as){as.removeLeadSnapshot()}function mixAxisDelta(as,rs,ns){as.translate=mix(rs.translate,0,ns),as.scale=mix(rs.scale,1,ns),as.origin=rs.origin,as.originPoint=rs.originPoint}function mixAxis(as,rs,ns,ss){as.min=mix(rs.min,ns.min,ss),as.max=mix(rs.max,ns.max,ss)}function mixBox(as,rs,ns,ss){mixAxis(as.x,rs.x,ns.x,ss),mixAxis(as.y,rs.y,ns.y,ss)}function hasOpacityCrossfade(as){return as.animationValues&&as.animationValues.opacityExit!==void 0}const defaultLayoutTransition={duration:.45,ease:[.4,0,.1,1]};function mountNodeEarly(as,rs){let ns=as.root;for(let ls=as.path.length-1;ls>=0;ls--)if(as.path[ls].instance){ns=as.path[ls];break}const os=(ns&&ns!==as.root?ns.instance:document).querySelector(`[data-projection-id="${rs}"]`);os&&as.mount(os,!0)}function roundAxis(as){as.min=Math.round(as.min),as.max=Math.round(as.max)}function roundBox(as){roundAxis(as.x),roundAxis(as.y)}function shouldAnimatePositionOnly(as,rs,ns){return as==="position"||as==="preserve-aspect"&&!isNear(aspectRatio(rs),aspectRatio(ns),.2)}const DocumentProjectionNode=createProjectionNode({attachResizeListener:(as,rs)=>addDomEvent(as,"resize",rs),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode({measureScroll:as=>({x:as.scrollLeft,y:as.scrollTop}),defaultParent:()=>{if(!rootProjectionNode.current){const as=new DocumentProjectionNode(0,{});as.mount(window),as.setOptions({layoutScroll:!0}),rootProjectionNode.current=as}return rootProjectionNode.current},resetTransform:(as,rs)=>{as.style.transform=rs!==void 0?rs:"none"},checkIsScrollRoot:as=>window.getComputedStyle(as).position==="fixed"}),drag={pan:{Feature:PanGesture},drag:{Feature:DragGesture,ProjectionNode:HTMLProjectionNode,MeasureLayout}},positionalKeys=new Set(["width","height","top","left","right","bottom","x","y"]),isPositionalKey=as=>positionalKeys.has(as),hasPositionalKey=as=>Object.keys(as).some(isPositionalKey),isNumOrPxType=as=>as===number||as===px$1,getPosFromMatrix=(as,rs)=>parseFloat(as.split(", ")[rs]),getTranslateFromMatrix=(as,rs)=>(ns,{transform:ss})=>{if(ss==="none"||!ss)return 0;const os=ss.match(/^matrix3d\((.+)\)$/);if(os)return getPosFromMatrix(os[1],rs);{const ls=ss.match(/^matrix\((.+)\)$/);return ls?getPosFromMatrix(ls[1],as):0}},transformKeys=new Set(["x","y","z"]),nonTranslationalTransformKeys=transformPropOrder.filter(as=>!transformKeys.has(as));function removeNonTranslationalTransform(as){const rs=[];return nonTranslationalTransformKeys.forEach(ns=>{const ss=as.getValue(ns);ss!==void 0&&(rs.push([ns,ss.get()]),ss.set(ns.startsWith("scale")?1:0))}),rs.length&&as.render(),rs}const positionalValues={width:({x:as},{paddingLeft:rs="0",paddingRight:ns="0"})=>as.max-as.min-parseFloat(rs)-parseFloat(ns),height:({y:as},{paddingTop:rs="0",paddingBottom:ns="0"})=>as.max-as.min-parseFloat(rs)-parseFloat(ns),top:(as,{top:rs})=>parseFloat(rs),left:(as,{left:rs})=>parseFloat(rs),bottom:({y:as},{top:rs})=>parseFloat(rs)+(as.max-as.min),right:({x:as},{left:rs})=>parseFloat(rs)+(as.max-as.min),x:getTranslateFromMatrix(4,13),y:getTranslateFromMatrix(5,14)},convertChangedValueTypes=(as,rs,ns)=>{const ss=rs.measureViewportBox(),os=rs.current,ls=getComputedStyle(os),{display:us}=ls,cs={};us==="none"&&rs.setStaticValue("display",as.display||"block"),ns.forEach(ps=>{cs[ps]=positionalValues[ps](ss,ls)}),rs.render();const ds=rs.measureViewportBox();return ns.forEach(ps=>{const fs=rs.getValue(ps);fs&&fs.jump(cs[ps]),as[ps]=positionalValues[ps](ds,ls)}),as},checkAndConvertChangedValueTypes=(as,rs,ns={},ss={})=>{rs={...rs},ss={...ss};const os=Object.keys(rs).filter(isPositionalKey);let ls=[],us=!1;const cs=[];if(os.forEach(ds=>{const ps=as.getValue(ds);if(!as.hasValue(ds))return;let fs=ns[ds],hs=findDimensionValueType(fs);const gs=rs[ds];let ys;if(isKeyframesTarget(gs)){const bs=gs.length,vs=gs[0]===null?1:0;fs=gs[vs],hs=findDimensionValueType(fs);for(let xs=vs;xs=0?window.pageYOffset:null,ps=convertChangedValueTypes(rs,as,cs);return ls.length&&ls.forEach(([fs,hs])=>{as.getValue(fs).set(hs)}),as.render(),isBrowser&&ds!==null&&window.scrollTo({top:ds}),{target:ps,transitionEnd:ss}}else return{target:rs,transitionEnd:ss}};function unitConversion(as,rs,ns,ss){return hasPositionalKey(rs)?checkAndConvertChangedValueTypes(as,rs,ns,ss):{target:rs,transitionEnd:ss}}const parseDomVariant=(as,rs,ns,ss)=>{const os=resolveCSSVariables(as,rs,ss);return rs=os.target,ss=os.transitionEnd,unitConversion(as,rs,ns,ss)},prefersReducedMotion={current:null},hasReducedMotionListener={current:!1};function initPrefersReducedMotion(){if(hasReducedMotionListener.current=!0,!!isBrowser)if(window.matchMedia){const as=window.matchMedia("(prefers-reduced-motion)"),rs=()=>prefersReducedMotion.current=as.matches;as.addListener(rs),rs()}else prefersReducedMotion.current=!1}function updateMotionValuesFromProps(as,rs,ns){const{willChange:ss}=rs;for(const os in rs){const ls=rs[os],us=ns[os];if(isMotionValue(ls))as.addValue(os,ls),isWillChangeMotionValue(ss)&&ss.add(os);else if(isMotionValue(us))as.addValue(os,motionValue(ls,{owner:as})),isWillChangeMotionValue(ss)&&ss.remove(os);else if(us!==ls)if(as.hasValue(os)){const cs=as.getValue(os);!cs.hasAnimated&&cs.set(ls)}else{const cs=as.getStaticValue(os);as.addValue(os,motionValue(cs!==void 0?cs:ls,{owner:as}))}}for(const os in ns)rs[os]===void 0&&as.removeValue(os);return rs}const visualElementStore=new WeakMap,featureNames=Object.keys(featureDefinitions),numFeatures=featureNames.length,propEventHandlers=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],numVariantProps=variantProps.length;class VisualElement{constructor({parent:rs,props:ns,presenceContext:ss,reducedMotionConfig:os,visualState:ls},us={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>sync.render(this.render,!1,!0);const{latestValues:cs,renderState:ds}=ls;this.latestValues=cs,this.baseTarget={...cs},this.initialValues=ns.initial?{...cs}:{},this.renderState=ds,this.parent=rs,this.props=ns,this.presenceContext=ss,this.depth=rs?rs.depth+1:0,this.reducedMotionConfig=os,this.options=us,this.isControllingVariants=isControllingVariants(ns),this.isVariantNode=isVariantNode(ns),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(rs&&rs.current);const{willChange:ps,...fs}=this.scrapeMotionValuesFromProps(ns,{});for(const hs in fs){const gs=fs[hs];cs[hs]!==void 0&&isMotionValue(gs)&&(gs.set(cs[hs],!1),isWillChangeMotionValue(ps)&&ps.add(hs))}}scrapeMotionValuesFromProps(rs,ns){return{}}mount(rs){this.current=rs,visualElementStore.set(rs,this),this.projection&&this.projection.mount(rs),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((ns,ss)=>this.bindToMotionValue(ss,ns)),hasReducedMotionListener.current||initPrefersReducedMotion(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:prefersReducedMotion.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){visualElementStore.delete(this.current),this.projection&&this.projection.unmount(),cancelSync.update(this.notifyUpdate),cancelSync.render(this.render),this.valueSubscriptions.forEach(rs=>rs()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const rs in this.events)this.events[rs].clear();for(const rs in this.features)this.features[rs].unmount();this.current=null}bindToMotionValue(rs,ns){const ss=transformProps.has(rs),os=ns.on("change",us=>{this.latestValues[rs]=us,this.props.onUpdate&&sync.update(this.notifyUpdate,!1,!0),ss&&this.projection&&(this.projection.isTransformDirty=!0)}),ls=ns.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(rs,()=>{os(),ls()})}sortNodePosition(rs){return!this.current||!this.sortInstanceNodePosition||this.type!==rs.type?0:this.sortInstanceNodePosition(this.current,rs.current)}loadFeatures({children:rs,...ns},ss,os,ls,us){let cs,ds;for(let ps=0;psthis.scheduleRender(),animationType:typeof fs=="string"?fs:"both",initialPromotionConfig:us,layoutScroll:ys,layoutRoot:bs})}return ds}updateFeatures(){for(const rs in this.features){const ns=this.features[rs];ns.isMounted?ns.update(this.props,this.prevProps):(ns.mount(),ns.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):createBox()}getStaticValue(rs){return this.latestValues[rs]}setStaticValue(rs,ns){this.latestValues[rs]=ns}makeTargetAnimatable(rs,ns=!0){return this.makeTargetAnimatableFromInstance(rs,this.props,ns)}update(rs,ns){(rs.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=rs,this.prevPresenceContext=this.presenceContext,this.presenceContext=ns;for(let ss=0;ssns.variantChildren.delete(rs)}addValue(rs,ns){ns!==this.values.get(rs)&&(this.removeValue(rs),this.bindToMotionValue(rs,ns)),this.values.set(rs,ns),this.latestValues[rs]=ns.get()}removeValue(rs){this.values.delete(rs);const ns=this.valueSubscriptions.get(rs);ns&&(ns(),this.valueSubscriptions.delete(rs)),delete this.latestValues[rs],this.removeValueFromRenderState(rs,this.renderState)}hasValue(rs){return this.values.has(rs)}getValue(rs,ns){if(this.props.values&&this.props.values[rs])return this.props.values[rs];let ss=this.values.get(rs);return ss===void 0&&ns!==void 0&&(ss=motionValue(ns,{owner:this}),this.addValue(rs,ss)),ss}readValue(rs){return this.latestValues[rs]!==void 0||!this.current?this.latestValues[rs]:this.readValueFromInstance(this.current,rs,this.options)}setBaseTarget(rs,ns){this.baseTarget[rs]=ns}getBaseTarget(rs){var ns;const{initial:ss}=this.props,os=typeof ss=="string"||typeof ss=="object"?(ns=resolveVariantFromProps(this.props,ss))===null||ns===void 0?void 0:ns[rs]:void 0;if(ss&&os!==void 0)return os;const ls=this.getBaseTargetFromProps(this.props,rs);return ls!==void 0&&!isMotionValue(ls)?ls:this.initialValues[rs]!==void 0&&os===void 0?void 0:this.baseTarget[rs]}on(rs,ns){return this.events[rs]||(this.events[rs]=new SubscriptionManager),this.events[rs].add(ns)}notify(rs,...ns){this.events[rs]&&this.events[rs].notify(...ns)}}class DOMVisualElement extends VisualElement{sortInstanceNodePosition(rs,ns){return rs.compareDocumentPosition(ns)&2?1:-1}getBaseTargetFromProps(rs,ns){return rs.style?rs.style[ns]:void 0}removeValueFromRenderState(rs,{vars:ns,style:ss}){delete ns[rs],delete ss[rs]}makeTargetAnimatableFromInstance({transition:rs,transitionEnd:ns,...ss},{transformValues:os},ls){let us=getOrigin(ss,rs||{},this);if(os&&(ns&&(ns=os(ns)),ss&&(ss=os(ss)),us&&(us=os(us))),ls){checkTargetForNewValues(this,ss,us);const cs=parseDomVariant(this,ss,us,ns);ns=cs.transitionEnd,ss=cs.target}return{transition:rs,transitionEnd:ns,...ss}}}function getComputedStyle$3(as){return window.getComputedStyle(as)}class HTMLVisualElement extends DOMVisualElement{readValueFromInstance(rs,ns){if(transformProps.has(ns)){const ss=getDefaultValueType(ns);return ss&&ss.default||0}else{const ss=getComputedStyle$3(rs),os=(isCSSVariableName(ns)?ss.getPropertyValue(ns):ss[ns])||0;return typeof os=="string"?os.trim():os}}measureInstanceViewportBox(rs,{transformPagePoint:ns}){return measureViewportBox(rs,ns)}build(rs,ns,ss,os){buildHTMLStyles(rs,ns,ss,os.transformTemplate)}scrapeMotionValuesFromProps(rs,ns){return scrapeMotionValuesFromProps$1(rs,ns)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:rs}=this.props;isMotionValue(rs)&&(this.childSubscription=rs.on("change",ns=>{this.current&&(this.current.textContent=`${ns}`)}))}renderInstance(rs,ns,ss,os){renderHTML(rs,ns,ss,os)}}class SVGVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(rs,ns){return rs[ns]}readValueFromInstance(rs,ns){if(transformProps.has(ns)){const ss=getDefaultValueType(ns);return ss&&ss.default||0}return ns=camelCaseAttributes.has(ns)?ns:camelToDash(ns),rs.getAttribute(ns)}measureInstanceViewportBox(){return createBox()}scrapeMotionValuesFromProps(rs,ns){return scrapeMotionValuesFromProps(rs,ns)}build(rs,ns,ss,os){buildSVGAttrs(rs,ns,ss,this.isSVGTag,os.transformTemplate)}renderInstance(rs,ns,ss,os){renderSVG(rs,ns,ss,os)}mount(rs){this.isSVGTag=isSVGTag(rs.tagName),super.mount(rs)}}const createDomVisualElement=(as,rs)=>isSVGComponent(as)?new SVGVisualElement(rs,{enableHardwareAcceleration:!1}):new HTMLVisualElement(rs,{enableHardwareAcceleration:!0}),layout={layout:{ProjectionNode:HTMLProjectionNode,MeasureLayout}},preloadedFeatures={...animations,...gestureAnimations,...drag,...layout},motion=createMotionProxy((as,rs)=>createDomMotionConfig(as,rs,preloadedFeatures,createDomVisualElement));function useIsMounted(){const as=reactExports.useRef(!1);return useIsomorphicLayoutEffect$1(()=>(as.current=!0,()=>{as.current=!1}),[]),as}function useForceUpdate(){const as=useIsMounted(),[rs,ns]=reactExports.useState(0),ss=reactExports.useCallback(()=>{as.current&&ns(rs+1)},[rs]);return[reactExports.useCallback(()=>sync.postRender(ss),[ss]),rs]}class PopChildMeasure extends reactExports.Component{getSnapshotBeforeUpdate(rs){const ns=this.props.childRef.current;if(ns&&rs.isPresent&&!this.props.isPresent){const ss=this.props.sizeRef.current;ss.height=ns.offsetHeight||0,ss.width=ns.offsetWidth||0,ss.top=ns.offsetTop,ss.left=ns.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function PopChild({children:as,isPresent:rs}){const ns=reactExports.useId(),ss=reactExports.useRef(null),os=reactExports.useRef({width:0,height:0,top:0,left:0});return reactExports.useInsertionEffect(()=>{const{width:ls,height:us,top:cs,left:ds}=os.current;if(rs||!ss.current||!ls||!us)return;ss.current.dataset.motionPopId=ns;const ps=document.createElement("style");return document.head.appendChild(ps),ps.sheet&&ps.sheet.insertRule(` [data-motion-pop-id="${ns}"] { position: absolute !important; width: ${ls}px !important; @@ -1878,7 +1887,7 @@ let ns=poly_div(as,[rs]),ss=0,os=ns[0].length;for(var ls=0;ls{document.head.removeChild(ps)}},[rs]),reactExports.createElement(PopChildMeasure,{isPresent:rs,childRef:ss,sizeRef:os},reactExports.cloneElement(as,{ref:ss}))}const PresenceChild=({children:as,initial:rs,isPresent:ns,onExitComplete:ss,custom:os,presenceAffectsLayout:ls,mode:us})=>{const cs=useConstant(newChildrenMap),ds=reactExports.useId(),ps=reactExports.useMemo(()=>({id:ds,initial:rs,isPresent:ns,custom:os,onExitComplete:fs=>{cs.set(fs,!0);for(const hs of cs.values())if(!hs)return;ss&&ss()},register:fs=>(cs.set(fs,!1),()=>cs.delete(fs))}),ls?void 0:[ns]);return reactExports.useMemo(()=>{cs.forEach((fs,hs)=>cs.set(hs,!1))},[ns]),reactExports.useEffect(()=>{!ns&&!cs.size&&ss&&ss()},[ns]),us==="popLayout"&&(as=reactExports.createElement(PopChild,{isPresent:ns},as)),reactExports.createElement(PresenceContext.Provider,{value:ps},as)};function newChildrenMap(){return new Map}function useUnmountEffect$1(as){return reactExports.useEffect(()=>()=>as(),[])}const getChildKey=as=>as.key||"";function updateChildLookup(as,rs){as.forEach(ns=>{const ss=getChildKey(ns);rs.set(ss,ns)})}function onlyElements(as){const rs=[];return reactExports.Children.forEach(as,ns=>{reactExports.isValidElement(ns)&&rs.push(ns)}),rs}const AnimatePresence=({children:as,custom:rs,initial:ns=!0,onExitComplete:ss,exitBeforeEnter:os,presenceAffectsLayout:ls=!0,mode:us="sync"})=>{let[cs]=useForceUpdate();const ds=reactExports.useContext(LayoutGroupContext).forceRender;ds&&(cs=ds);const ps=useIsMounted(),fs=onlyElements(as);let hs=fs;const gs=new Set,ys=reactExports.useRef(hs),bs=reactExports.useRef(new Map).current,vs=reactExports.useRef(!0);if(useIsomorphicLayoutEffect$1(()=>{vs.current=!1,updateChildLookup(fs,bs),ys.current=hs}),useUnmountEffect$1(()=>{vs.current=!0,bs.clear(),gs.clear()}),vs.current)return reactExports.createElement(reactExports.Fragment,null,hs.map(Ss=>reactExports.createElement(PresenceChild,{key:getChildKey(Ss),isPresent:!0,initial:ns?void 0:!1,presenceAffectsLayout:ls,mode:us},Ss)));hs=[...hs];const xs=ys.current.map(getChildKey),Cs=fs.map(getChildKey),Ts=xs.length;for(let Ss=0;Ss{if(Cs.indexOf(Ss)!==-1)return;const Ns=bs.get(Ss);if(!Ns)return;const As=xs.indexOf(Ss),ws=()=>{bs.delete(Ss),gs.delete(Ss);const Es=ys.current.findIndex(_s=>_s.key===Ss);if(ys.current.splice(Es,1),!gs.size){if(ys.current=fs,ps.current===!1)return;cs(),ss&&ss()}};hs.splice(As,0,reactExports.createElement(PresenceChild,{key:getChildKey(Ns),isPresent:!1,onExitComplete:ws,custom:rs,presenceAffectsLayout:ls,mode:us},Ns))}),hs=hs.map(Ss=>{const Ns=Ss.key;return gs.has(Ns)?Ss:reactExports.createElement(PresenceChild,{key:getChildKey(Ss),isPresent:!0,presenceAffectsLayout:ls,mode:us},Ss)}),reactExports.createElement(reactExports.Fragment,null,gs.size?hs:hs.map(Ss=>reactExports.cloneElement(Ss)))};var toastMotionVariants={initial:as=>{const{position:rs}=as,ns=["top","bottom"].includes(rs)?"y":"x";let ss=["top-right","bottom-right"].includes(rs)?1:-1;return rs==="bottom"&&(ss=1),{opacity:0,[ns]:ss*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},ToastComponent=reactExports.memo(as=>{const{id:rs,message:ns,onCloseComplete:ss,onRequestRemove:os,requestClose:ls=!1,position:us="bottom",duration:cs=5e3,containerStyle:ds,motionVariants:ps=toastMotionVariants,toastSpacing:fs="0.5rem"}=as,[hs,gs]=reactExports.useState(cs),ys=useIsPresent();useUpdateEffect(()=>{ys||ss==null||ss()},[ys]),useUpdateEffect(()=>{gs(cs)},[cs]);const bs=()=>gs(null),vs=()=>gs(cs),xs=()=>{ys&&os()};reactExports.useEffect(()=>{ys&&ls&&os()},[ys,ls,os]),useTimeout(xs,hs);const Cs=reactExports.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:fs,...ds}),[ds,fs]),Ts=reactExports.useMemo(()=>getToastStyle(us),[us]);return jsx$1(motion.li,{layout:!0,className:"chakra-toast",variants:ps,initial:"initial",animate:"animate",exit:"exit",onHoverStart:bs,onHoverEnd:vs,custom:{position:us},style:Ts,children:jsx$1(chakra.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:Cs,children:runIfFn$2(ns,{id:rs,onClose:xs})})})});ToastComponent.displayName="ToastComponent";var fallbackIcon={path:jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[jsx$1("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),jsx$1("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),jsx$1("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Icon=forwardRef((as,rs)=>{const{as:ns,viewBox:ss,color:os="currentColor",focusable:ls=!1,children:us,className:cs,__css:ds,...ps}=as,fs=cx("chakra-icon",cs),hs=useStyleConfig("Icon",as),gs={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:os,...ds,...hs},ys={ref:rs,focusable:ls,className:fs,__css:gs},bs=ss??fallbackIcon.viewBox;if(ns&&typeof ns!="string")return jsx$1(chakra.svg,{as:ns,...ys,...ps});const vs=us??fallbackIcon.path;return jsx$1(chakra.svg,{verticalAlign:"middle",viewBox:bs,...ys,...ps,children:vs})});Icon.displayName="Icon";function CheckIcon$1(as){return jsx$1(Icon,{viewBox:"0 0 24 24",...as,children:jsx$1("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function InfoIcon(as){return jsx$1(Icon,{viewBox:"0 0 24 24",...as,children:jsx$1("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function WarningIcon(as){return jsx$1(Icon,{viewBox:"0 0 24 24",...as,children:jsx$1("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var spin=keyframes$1({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),Spinner=forwardRef((as,rs)=>{const ns=useStyleConfig("Spinner",as),{label:ss="Loading...",thickness:os="2px",speed:ls="0.45s",emptyColor:us="transparent",className:cs,...ds}=omitThemingProps(as),ps=cx("chakra-spinner",cs),fs={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:os,borderBottomColor:us,borderLeftColor:us,animation:`${spin} ${ls} linear infinite`,...ns};return jsx$1(chakra.div,{ref:rs,__css:fs,className:ps,...ds,children:ss&&jsx$1(chakra.span,{srOnly:!0,children:ss})})});Spinner.displayName="Spinner";var[AlertProvider,useAlertContext]=createContext$1({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[AlertStylesProvider,useAlertStyles]=createContext$1({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),STATUSES={info:{icon:InfoIcon,colorScheme:"blue"},warning:{icon:WarningIcon,colorScheme:"orange"},success:{icon:CheckIcon$1,colorScheme:"green"},error:{icon:WarningIcon,colorScheme:"red"},loading:{icon:Spinner,colorScheme:"blue"}};function getStatusColorScheme(as){return STATUSES[as].colorScheme}function getStatusIcon(as){return STATUSES[as].icon}var AlertDescription=forwardRef(function as(rs,ns){const os={display:"inline",...useAlertStyles().description};return jsx$1(chakra.div,{ref:ns,...rs,className:cx("chakra-alert__desc",rs.className),__css:os})});AlertDescription.displayName="AlertDescription";function AlertIcon(as){const{status:rs}=useAlertContext(),ns=getStatusIcon(rs),ss=useAlertStyles(),os=rs==="loading"?ss.spinner:ss.icon;return jsx$1(chakra.span,{display:"inherit",...as,className:cx("chakra-alert__icon",as.className),__css:os,children:as.children||jsx$1(ns,{h:"100%",w:"100%"})})}AlertIcon.displayName="AlertIcon";var AlertTitle=forwardRef(function as(rs,ns){const ss=useAlertStyles();return jsx$1(chakra.div,{ref:ns,...rs,className:cx("chakra-alert__title",rs.className),__css:ss.title})});AlertTitle.displayName="AlertTitle";var Alert$1=forwardRef(function as(rs,ns){var ss;const{status:os="info",addRole:ls=!0,...us}=omitThemingProps(rs),cs=(ss=rs.colorScheme)!=null?ss:getStatusColorScheme(os),ds=useMultiStyleConfig("Alert",{...rs,colorScheme:cs}),ps={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...ds.container};return jsx$1(AlertProvider,{value:{status:os},children:jsx$1(AlertStylesProvider,{value:ds,children:jsx$1(chakra.div,{role:ls?"alert":void 0,ref:ns,...us,className:cx("chakra-alert",rs.className),__css:ps})})})});Alert$1.displayName="Alert";function CloseIcon(as){return jsx$1(Icon,{focusable:"false","aria-hidden":!0,...as,children:jsx$1("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var CloseButton=forwardRef(function as(rs,ns){const ss=useStyleConfig("CloseButton",rs),{children:os,isDisabled:ls,__css:us,...cs}=omitThemingProps(rs),ds={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return jsx$1(chakra.button,{type:"button","aria-label":"Close",ref:ns,disabled:ls,__css:{...ds,...ss,...us},...cs,children:os||jsx$1(CloseIcon,{width:"1em",height:"1em"})})});CloseButton.displayName="CloseButton";var initialState$1={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},toastStore=createStore$1(initialState$1);function createStore$1(as){let rs=as;const ns=new Set,ss=os=>{rs=os(rs),ns.forEach(ls=>ls())};return{getState:()=>rs,subscribe:os=>(ns.add(os),()=>{ss(()=>as),ns.delete(os)}),removeToast:(os,ls)=>{ss(us=>({...us,[ls]:us[ls].filter(cs=>cs.id!=os)}))},notify:(os,ls)=>{const us=createToast(os,ls),{position:cs,id:ds}=us;return ss(ps=>{var fs,hs;const ys=cs.includes("top")?[us,...(fs=ps[cs])!=null?fs:[]]:[...(hs=ps[cs])!=null?hs:[],us];return{...ps,[cs]:ys}}),ds},update:(os,ls)=>{os&&ss(us=>{const cs={...us},{position:ds,index:ps}=findToast(cs,os);return ds&&ps!==-1&&(cs[ds][ps]={...cs[ds][ps],...ls,message:createRenderToast(ls)}),cs})},closeAll:({positions:os}={})=>{ss(ls=>(os??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((ds,ps)=>(ds[ps]=ls[ps].map(fs=>({...fs,requestClose:!0})),ds),{...ls}))},close:os=>{ss(ls=>{const us=getToastPosition(ls,os);return us?{...ls,[us]:ls[us].map(cs=>cs.id==os?{...cs,requestClose:!0}:cs)}:ls})},isActive:os=>!!findToast(toastStore.getState(),os).position}}var counter=0;function createToast(as,rs={}){var ns,ss;counter+=1;const os=(ns=rs.id)!=null?ns:counter,ls=(ss=rs.position)!=null?ss:"bottom";return{id:os,message:as,position:ls,duration:rs.duration,onCloseComplete:rs.onCloseComplete,onRequestRemove:()=>toastStore.removeToast(String(os),ls),status:rs.status,requestClose:!1,containerStyle:rs.containerStyle}}var Toast=as=>{const{status:rs,variant:ns="solid",id:ss,title:os,isClosable:ls,onClose:us,description:cs,icon:ds}=as,ps=ss?{root:`toast-${ss}`,title:`toast-${ss}-title`,description:`toast-${ss}-description`}:void 0;return jsxs(Alert$1,{addRole:!1,status:rs,variant:ns,id:ps==null?void 0:ps.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",children:[jsx$1(AlertIcon,{children:ds}),jsxs(chakra.div,{flex:"1",maxWidth:"100%",children:[os&&jsx$1(AlertTitle,{id:ps==null?void 0:ps.title,children:os}),cs&&jsx$1(AlertDescription,{id:ps==null?void 0:ps.description,display:"block",children:cs})]}),ls&&jsx$1(CloseButton,{size:"sm",onClick:us,position:"absolute",insetEnd:1,top:1})]})};function createRenderToast(as={}){const{render:rs,toastComponent:ns=Toast}=as;return os=>typeof rs=="function"?rs({...os,...as}):jsx$1(ns,{...os,...as})}var[ToastOptionProvider,useToastOptionContext]=createContext$1({name:"ToastOptionsContext",strict:!1}),ToastProvider=as=>{const rs=reactExports.useSyncExternalStore(toastStore.subscribe,toastStore.getState,toastStore.getState),{motionVariants:ns,component:ss=ToastComponent,portalProps:os}=as,us=Object.keys(rs).map(cs=>{const ds=rs[cs];return jsx$1("ul",{role:"region","aria-live":"polite",id:`chakra-toast-manager-${cs}`,style:getToastListStyle(cs),children:jsx$1(AnimatePresence,{initial:!1,children:ds.map(ps=>jsx$1(ss,{motionVariants:ns,...ps},ps.id))})},cs)});return jsx$1(Portal,{...os,children:us})},createChakraProvider=as=>function({children:ns,theme:ss=as,toastOptions:os,...ls}){return jsxs(ChakraProvider$1,{theme:ss,...ls,children:[jsx$1(ToastOptionProvider,{value:os==null?void 0:os.defaultOptions,children:ns}),jsx$1(ToastProvider,{...os})]})},ChakraProvider=createChakraProvider(theme$1),__defProp=Object.defineProperty,__defNormalProp=(as,rs,ns)=>rs in as?__defProp(as,rs,{enumerable:!0,configurable:!0,writable:!0,value:ns}):as[rs]=ns,__publicField=(as,rs,ns)=>(__defNormalProp(as,typeof rs!="symbol"?rs+"":rs,ns),ns);function sortNodes(as){return as.sort((rs,ns)=>{const ss=rs.compareDocumentPosition(ns);if(ss&Node.DOCUMENT_POSITION_FOLLOWING||ss&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(ss&Node.DOCUMENT_POSITION_PRECEDING||ss&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(ss&Node.DOCUMENT_POSITION_DISCONNECTED||ss&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var isElement$3=as=>typeof as=="object"&&"nodeType"in as&&as.nodeType===Node.ELEMENT_NODE;function getNextIndex(as,rs,ns){let ss=as+1;return ns&&ss>=rs&&(ss=0),ss}function getPrevIndex(as,rs,ns){let ss=as-1;return ns&&ss<0&&(ss=rs),ss}var useSafeLayoutEffect=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,cast=as=>as,DescendantsManager=class{constructor(){__publicField(this,"descendants",new Map),__publicField(this,"register",as=>{if(as!=null)return isElement$3(as)?this.registerNode(as):rs=>{this.registerNode(rs,as)}}),__publicField(this,"unregister",as=>{this.descendants.delete(as);const rs=sortNodes(Array.from(this.descendants.keys()));this.assignIndex(rs)}),__publicField(this,"destroy",()=>{this.descendants.clear()}),__publicField(this,"assignIndex",as=>{this.descendants.forEach(rs=>{const ns=as.indexOf(rs.node);rs.index=ns,rs.node.dataset.index=rs.index.toString()})}),__publicField(this,"count",()=>this.descendants.size),__publicField(this,"enabledCount",()=>this.enabledValues().length),__publicField(this,"values",()=>Array.from(this.descendants.values()).sort((rs,ns)=>rs.index-ns.index)),__publicField(this,"enabledValues",()=>this.values().filter(as=>!as.disabled)),__publicField(this,"item",as=>{if(this.count()!==0)return this.values()[as]}),__publicField(this,"enabledItem",as=>{if(this.enabledCount()!==0)return this.enabledValues()[as]}),__publicField(this,"first",()=>this.item(0)),__publicField(this,"firstEnabled",()=>this.enabledItem(0)),__publicField(this,"last",()=>this.item(this.descendants.size-1)),__publicField(this,"lastEnabled",()=>{const as=this.enabledValues().length-1;return this.enabledItem(as)}),__publicField(this,"indexOf",as=>{var rs,ns;return as&&(ns=(rs=this.descendants.get(as))==null?void 0:rs.index)!=null?ns:-1}),__publicField(this,"enabledIndexOf",as=>as==null?-1:this.enabledValues().findIndex(rs=>rs.node.isSameNode(as))),__publicField(this,"next",(as,rs=!0)=>{const ns=getNextIndex(as,this.count(),rs);return this.item(ns)}),__publicField(this,"nextEnabled",(as,rs=!0)=>{const ns=this.item(as);if(!ns)return;const ss=this.enabledIndexOf(ns.node),os=getNextIndex(ss,this.enabledCount(),rs);return this.enabledItem(os)}),__publicField(this,"prev",(as,rs=!0)=>{const ns=getPrevIndex(as,this.count()-1,rs);return this.item(ns)}),__publicField(this,"prevEnabled",(as,rs=!0)=>{const ns=this.item(as);if(!ns)return;const ss=this.enabledIndexOf(ns.node),os=getPrevIndex(ss,this.enabledCount()-1,rs);return this.enabledItem(os)}),__publicField(this,"registerNode",(as,rs)=>{if(!as||this.descendants.has(as))return;const ns=Array.from(this.descendants.keys()).concat(as),ss=sortNodes(ns);rs!=null&&rs.disabled&&(rs.disabled=!!rs.disabled);const os={node:as,index:-1,...rs};this.descendants.set(as,os),this.assignIndex(ss)})}};function assignRef(as,rs){if(as!=null){if(typeof as=="function"){as(rs);return}try{as.current=rs}catch{throw new Error(`Cannot assign value '${rs}' to ref '${as}'`)}}}function mergeRefs(...as){return rs=>{as.forEach(ns=>{assignRef(ns,rs)})}}function useMergeRefs(...as){return reactExports.useMemo(()=>mergeRefs(...as),as)}function useDescendants(){const as=reactExports.useRef(new DescendantsManager);return useSafeLayoutEffect(()=>()=>as.current.destroy()),as.current}var[DescendantsContextProvider,useDescendantsContext]=createContext$1({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function useDescendant(as){const rs=useDescendantsContext(),[ns,ss]=reactExports.useState(-1),os=reactExports.useRef(null);useSafeLayoutEffect(()=>()=>{os.current&&rs.unregister(os.current)},[]),useSafeLayoutEffect(()=>{if(!os.current)return;const us=Number(os.current.dataset.index);ns!=us&&!Number.isNaN(us)&&ss(us)});const ls=cast(as?rs.register(as):rs.register);return{descendants:rs,index:ns,enabledIndex:rs.enabledIndexOf(os.current),register:mergeRefs(ls,os)}}function createDescendantContext(){return[cast(DescendantsContextProvider),()=>cast(useDescendantsContext()),()=>useDescendants(),os=>useDescendant(os)]}function useControllableState(as){const{value:rs,defaultValue:ns,onChange:ss,shouldUpdate:os=(gs,ys)=>gs!==ys}=as,ls=useCallbackRef(ss),us=useCallbackRef(os),[cs,ds]=reactExports.useState(ns),ps=rs!==void 0,fs=ps?rs:cs,hs=useCallbackRef(gs=>{const bs=typeof gs=="function"?gs(fs):gs;us(fs,bs)&&(ps||ds(bs),ls(bs))},[ps,ls,fs,us]);return[fs,hs]}var[AvatarStylesProvider,useAvatarStyles]=createContext$1({name:"AvatarStylesContext",hookName:"useAvatarStyles",providerName:""});function initials(as){const[rs,ns]=as.split(" ");return rs&&ns?`${rs.charAt(0)}${ns.charAt(0)}`:rs.charAt(0)}function AvatarName(as){const{name:rs,getInitials:ns,...ss}=as,os=useAvatarStyles();return jsx$1(chakra.div,{role:"img","aria-label":rs,...ss,__css:os.label,children:rs?ns==null?void 0:ns(rs):null})}AvatarName.displayName="AvatarName";var GenericAvatarIcon=as=>jsxs(chakra.svg,{viewBox:"0 0 128 128",color:"#fff",width:"100%",height:"100%",className:"chakra-avatar__svg",...as,children:[jsx$1("path",{fill:"currentColor",d:"M103,102.1388 C93.094,111.92 79.3504,118 64.1638,118 C48.8056,118 34.9294,111.768 25,101.7892 L25,95.2 C25,86.8096 31.981,80 40.6,80 L87.4,80 C96.019,80 103,86.8096 103,95.2 L103,102.1388 Z"}),jsx$1("path",{fill:"currentColor",d:"M63.9961647,24 C51.2938136,24 41,34.2938136 41,46.9961647 C41,59.7061864 51.2938136,70 63.9961647,70 C76.6985159,70 87,59.7061864 87,46.9961647 C87,34.2938136 76.6985159,24 63.9961647,24"})]}),NativeImage=forwardRef(function as(rs,ns){const{htmlWidth:ss,htmlHeight:os,alt:ls,...us}=rs;return jsx$1("img",{width:ss,height:os,ref:ns,alt:ls,...us})});NativeImage.displayName="NativeImage";function useImage(as){const{loading:rs,src:ns,srcSet:ss,onLoad:os,onError:ls,crossOrigin:us,sizes:cs,ignoreFallback:ds}=as,[ps,fs]=reactExports.useState("pending");reactExports.useEffect(()=>{fs(ns?"loading":"pending")},[ns]);const hs=reactExports.useRef(),gs=reactExports.useCallback(()=>{if(!ns)return;ys();const bs=new Image;bs.src=ns,us&&(bs.crossOrigin=us),ss&&(bs.srcset=ss),cs&&(bs.sizes=cs),rs&&(bs.loading=rs),bs.onload=vs=>{ys(),fs("loaded"),os==null||os(vs)},bs.onerror=vs=>{ys(),fs("failed"),ls==null||ls(vs)},hs.current=bs},[ns,us,ss,cs,os,ls,rs]),ys=()=>{hs.current&&(hs.current.onload=null,hs.current.onerror=null,hs.current=null)};return useSafeLayoutEffect$1(()=>{if(!ds)return ps==="loading"&&gs(),()=>{ys()}},[ps,gs,ds]),ds?"loaded":ps}var shouldShowFallbackImage=(as,rs)=>as!=="loaded"&&rs==="beforeLoadOrError"||as==="failed"&&rs==="onError";function omit$2(as,rs=[]){const ns=Object.assign({},as);for(const ss of rs)ss in ns&&delete ns[ss];return ns}var Image$2=forwardRef(function as(rs,ns){const{fallbackSrc:ss,fallback:os,src:ls,srcSet:us,align:cs,fit:ds,loading:ps,ignoreFallback:fs,crossOrigin:hs,fallbackStrategy:gs="beforeLoadOrError",referrerPolicy:ys,...bs}=rs,vs=ss!==void 0||os!==void 0,xs=ps!=null||fs||!vs,Cs=useImage({...rs,ignoreFallback:xs}),Ts=shouldShowFallbackImage(Cs,gs),Ss={ref:ns,objectFit:ds,objectPosition:cs,...xs?bs:omit$2(bs,["onError","onLoad"])};return Ts?os||jsx$1(chakra.img,{as:NativeImage,className:"chakra-image__placeholder",src:ss,...Ss}):jsx$1(chakra.img,{as:NativeImage,src:ls,srcSet:us,crossOrigin:hs,loading:ps,referrerPolicy:ys,className:"chakra-image",...Ss})});Image$2.displayName="Image";function AvatarImage(as){const{src:rs,srcSet:ns,onError:ss,onLoad:os,getInitials:ls,name:us,borderRadius:cs,loading:ds,iconLabel:ps,icon:fs=jsx$1(GenericAvatarIcon,{}),ignoreFallback:hs,referrerPolicy:gs,crossOrigin:ys}=as,vs=useImage({src:rs,onError:ss,ignoreFallback:hs})==="loaded";return!rs||!vs?us?jsx$1(AvatarName,{className:"chakra-avatar__initials",getInitials:ls,name:us}):reactExports.cloneElement(fs,{role:"img","aria-label":ps}):jsx$1(chakra.img,{src:rs,srcSet:ns,alt:us,onLoad:os,referrerPolicy:gs,crossOrigin:ys??void 0,className:"chakra-avatar__img",loading:ds,__css:{width:"100%",height:"100%",objectFit:"cover",borderRadius:cs}})}AvatarImage.displayName="AvatarImage";var baseStyle={display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center",textTransform:"uppercase",fontWeight:"medium",position:"relative",flexShrink:0},Avatar=forwardRef((as,rs)=>{const ns=useMultiStyleConfig("Avatar",as),[ss,os]=reactExports.useState(!1),{src:ls,srcSet:us,name:cs,showBorder:ds,borderRadius:ps="full",onError:fs,onLoad:hs,getInitials:gs=initials,icon:ys=jsx$1(GenericAvatarIcon,{}),iconLabel:bs=" avatar",loading:vs,children:xs,borderColor:Cs,ignoreFallback:Ts,crossOrigin:Ss,...Ns}=omitThemingProps(as),As={borderRadius:ps,borderWidth:ds?"2px":void 0,...baseStyle,...ns.container};return Cs&&(As.borderColor=Cs),jsx$1(chakra.span,{ref:rs,...Ns,className:cx("chakra-avatar",as.className),"data-loaded":dataAttr(ss),__css:As,children:jsxs(AvatarStylesProvider,{value:ns,children:[jsx$1(AvatarImage,{src:ls,srcSet:us,loading:vs,onLoad:callAllHandlers(hs,()=>{os(!0)}),onError:fs,getInitials:gs,name:cs,borderRadius:ps,icon:ys,iconLabel:bs,ignoreFallback:Ts,crossOrigin:Ss}),xs]})})});Avatar.displayName="Avatar";function getValidChildren(as){return reactExports.Children.toArray(as).filter(rs=>reactExports.isValidElement(rs))}var[ButtonGroupProvider,useButtonGroup]=createContext$1({strict:!1,name:"ButtonGroupContext"});function useButtonType(as){const[rs,ns]=reactExports.useState(!as);return{ref:reactExports.useCallback(ls=>{ls&&ns(ls.tagName==="BUTTON")},[]),type:rs?"button":void 0}}function ButtonIcon(as){const{children:rs,className:ns,...ss}=as,os=reactExports.isValidElement(rs)?reactExports.cloneElement(rs,{"aria-hidden":!0,focusable:!1}):rs,ls=cx("chakra-button__icon",ns);return jsx$1(chakra.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...ss,className:ls,children:os})}ButtonIcon.displayName="ButtonIcon";function ButtonSpinner(as){const{label:rs,placement:ns,spacing:ss="0.5rem",children:os=jsx$1(Spinner,{color:"currentColor",width:"1em",height:"1em"}),className:ls,__css:us,...cs}=as,ds=cx("chakra-button__spinner",ls),ps=ns==="start"?"marginEnd":"marginStart",fs=reactExports.useMemo(()=>({display:"flex",alignItems:"center",position:rs?"relative":"absolute",[ps]:rs?ss:0,fontSize:"1em",lineHeight:"normal",...us}),[us,rs,ps,ss]);return jsx$1(chakra.div,{className:ds,...cs,__css:fs,children:os})}ButtonSpinner.displayName="ButtonSpinner";var Button=forwardRef((as,rs)=>{const ns=useButtonGroup(),ss=useStyleConfig("Button",{...ns,...as}),{isDisabled:os=ns==null?void 0:ns.isDisabled,isLoading:ls,isActive:us,children:cs,leftIcon:ds,rightIcon:ps,loadingText:fs,iconSpacing:hs="0.5rem",type:gs,spinner:ys,spinnerPlacement:bs="start",className:vs,as:xs,...Cs}=omitThemingProps(as),Ts=reactExports.useMemo(()=>{const ws={...ss==null?void 0:ss._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...ss,...!!ns&&{_focus:ws}}},[ss,ns]),{ref:Ss,type:Ns}=useButtonType(xs),As={rightIcon:ps,leftIcon:ds,iconSpacing:hs,children:cs};return jsxs(chakra.button,{ref:useMergeRefs(rs,Ss),as:xs,type:gs??Ns,"data-active":dataAttr(us),"data-loading":dataAttr(ls),__css:Ts,className:cx("chakra-button",vs),...Cs,disabled:os||ls,children:[ls&&bs==="start"&&jsx$1(ButtonSpinner,{className:"chakra-button__spinner--start",label:fs,placement:"start",spacing:hs,children:ys}),ls?fs||jsx$1(chakra.span,{opacity:0,children:jsx$1(ButtonContent,{...As})}):jsx$1(ButtonContent,{...As}),ls&&bs==="end"&&jsx$1(ButtonSpinner,{className:"chakra-button__spinner--end",label:fs,placement:"end",spacing:hs,children:ys})]})});Button.displayName="Button";function ButtonContent(as){const{leftIcon:rs,rightIcon:ns,children:ss,iconSpacing:os}=as;return jsxs(Fragment,{children:[rs&&jsx$1(ButtonIcon,{marginEnd:os,children:rs}),ss,ns&&jsx$1(ButtonIcon,{marginStart:os,children:ns})]})}var IconButton=forwardRef((as,rs)=>{const{icon:ns,children:ss,isRound:os,"aria-label":ls,...us}=as,cs=ns||ss,ds=reactExports.isValidElement(cs)?reactExports.cloneElement(cs,{"aria-hidden":!0,focusable:!1}):null;return jsx$1(Button,{padding:"0",borderRadius:os?"full":void 0,ref:rs,"aria-label":ls,...us,children:ds})});IconButton.displayName="IconButton";var[CheckboxGroupProvider,useCheckboxGroupContext]=createContext$1({name:"CheckboxGroupContext",strict:!1});function CheckIcon(as){return jsx$1(chakra.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...as,children:jsx$1("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function IndeterminateIcon(as){return jsx$1(chakra.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...as,children:jsx$1("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function CheckboxIcon(as){const{isIndeterminate:rs,isChecked:ns,...ss}=as,os=rs?IndeterminateIcon:CheckIcon;return ns||rs?jsx$1(chakra.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:jsx$1(os,{...ss})}):null}var[FormControlStylesProvider,useFormControlStyles]=createContext$1({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[FormControlProvider,useFormControlContext]=createContext$1({strict:!1,name:"FormControlContext"});function useFormControlProvider(as){const{id:rs,isRequired:ns,isInvalid:ss,isDisabled:os,isReadOnly:ls,...us}=as,cs=reactExports.useId(),ds=rs||`field-${cs}`,ps=`${ds}-label`,fs=`${ds}-feedback`,hs=`${ds}-helptext`,[gs,ys]=reactExports.useState(!1),[bs,vs]=reactExports.useState(!1),[xs,Cs]=reactExports.useState(!1),Ts=reactExports.useCallback((Es={},_s=null)=>({id:hs,...Es,ref:mergeRefs(_s,$s=>{$s&&vs(!0)})}),[hs]),Ss=reactExports.useCallback((Es={},_s=null)=>({...Es,ref:_s,"data-focus":dataAttr(xs),"data-disabled":dataAttr(os),"data-invalid":dataAttr(ss),"data-readonly":dataAttr(ls),id:Es.id!==void 0?Es.id:ps,htmlFor:Es.htmlFor!==void 0?Es.htmlFor:ds}),[ds,os,xs,ss,ls,ps]),Ns=reactExports.useCallback((Es={},_s=null)=>({id:fs,...Es,ref:mergeRefs(_s,$s=>{$s&&ys(!0)}),"aria-live":"polite"}),[fs]),As=reactExports.useCallback((Es={},_s=null)=>({...Es,...us,ref:_s,role:"group"}),[us]),ws=reactExports.useCallback((Es={},_s=null)=>({...Es,ref:_s,role:"presentation","aria-hidden":!0,children:Es.children||"*"}),[]);return{isRequired:!!ns,isInvalid:!!ss,isReadOnly:!!ls,isDisabled:!!os,isFocused:!!xs,onFocus:()=>Cs(!0),onBlur:()=>Cs(!1),hasFeedbackText:gs,setHasFeedbackText:ys,hasHelpText:bs,setHasHelpText:vs,id:ds,labelId:ps,feedbackId:fs,helpTextId:hs,htmlProps:us,getHelpTextProps:Ts,getErrorMessageProps:Ns,getRootProps:As,getLabelProps:Ss,getRequiredIndicatorProps:ws}}var FormControl=forwardRef(function as(rs,ns){const ss=useMultiStyleConfig("Form",rs),os=omitThemingProps(rs),{getRootProps:ls,htmlProps:us,...cs}=useFormControlProvider(os),ds=cx("chakra-form-control",rs.className);return jsx$1(FormControlProvider,{value:cs,children:jsx$1(FormControlStylesProvider,{value:ss,children:jsx$1(chakra.div,{...ls({},ns),className:ds,__css:ss.container})})})});FormControl.displayName="FormControl";var FormHelperText=forwardRef(function as(rs,ns){const ss=useFormControlContext(),os=useFormControlStyles(),ls=cx("chakra-form__helper-text",rs.className);return jsx$1(chakra.div,{...ss==null?void 0:ss.getHelpTextProps(rs,ns),__css:os.helperText,className:ls})});FormHelperText.displayName="FormHelperText";function useFormControl(as){const{isDisabled:rs,isInvalid:ns,isReadOnly:ss,isRequired:os,...ls}=useFormControlProps(as);return{...ls,disabled:rs,readOnly:ss,required:os,"aria-invalid":ariaAttr(ns),"aria-required":ariaAttr(os),"aria-readonly":ariaAttr(ss)}}function useFormControlProps(as){var rs,ns,ss;const os=useFormControlContext(),{id:ls,disabled:us,readOnly:cs,required:ds,isRequired:ps,isInvalid:fs,isReadOnly:hs,isDisabled:gs,onFocus:ys,onBlur:bs,...vs}=as,xs=as["aria-describedby"]?[as["aria-describedby"]]:[];return os!=null&&os.hasFeedbackText&&(os!=null&&os.isInvalid)&&xs.push(os.feedbackId),os!=null&&os.hasHelpText&&xs.push(os.helpTextId),{...vs,"aria-describedby":xs.join(" ")||void 0,id:ls??(os==null?void 0:os.id),isDisabled:(rs=us??gs)!=null?rs:os==null?void 0:os.isDisabled,isReadOnly:(ns=cs??hs)!=null?ns:os==null?void 0:os.isReadOnly,isRequired:(ss=ds??ps)!=null?ss:os==null?void 0:os.isRequired,isInvalid:fs??(os==null?void 0:os.isInvalid),onFocus:callAllHandlers(os==null?void 0:os.onFocus,ys),onBlur:callAllHandlers(os==null?void 0:os.onBlur,bs)}}var visuallyHiddenStyle={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},hasSetup=!1,modality=null,hasEventBeforeFocus=!1,hasBlurredWindowRecently=!1,handlers=new Set;function trigger(as,rs){handlers.forEach(ns=>ns(as,rs))}var isMac=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function isValidKey(as){return!(as.metaKey||!isMac&&as.altKey||as.ctrlKey||as.key==="Control"||as.key==="Shift"||as.key==="Meta")}function onKeyboardEvent(as){hasEventBeforeFocus=!0,isValidKey(as)&&(modality="keyboard",trigger("keyboard",as))}function onPointerEvent(as){if(modality="pointer",as.type==="mousedown"||as.type==="pointerdown"){hasEventBeforeFocus=!0;const rs=as.composedPath?as.composedPath()[0]:as.target;let ns=!1;try{ns=rs.matches(":focus-visible")}catch{}if(ns)return;trigger("pointer",as)}}function isVirtualClick(as){return as.mozInputSource===0&&as.isTrusted?!0:as.detail===0&&!as.pointerType}function onClickEvent(as){isVirtualClick(as)&&(hasEventBeforeFocus=!0,modality="virtual")}function onWindowFocus(as){as.target===window||as.target===document||(!hasEventBeforeFocus&&!hasBlurredWindowRecently&&(modality="virtual",trigger("virtual",as)),hasEventBeforeFocus=!1,hasBlurredWindowRecently=!1)}function onWindowBlur(){hasEventBeforeFocus=!1,hasBlurredWindowRecently=!0}function isFocusVisible(){return modality!=="pointer"}function setupGlobalFocusEvents(){if(typeof window>"u"||hasSetup)return;const{focus:as}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...ns){hasEventBeforeFocus=!0,as.apply(this,ns)},document.addEventListener("keydown",onKeyboardEvent,!0),document.addEventListener("keyup",onKeyboardEvent,!0),document.addEventListener("click",onClickEvent,!0),window.addEventListener("focus",onWindowFocus,!0),window.addEventListener("blur",onWindowBlur,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",onPointerEvent,!0),document.addEventListener("pointermove",onPointerEvent,!0),document.addEventListener("pointerup",onPointerEvent,!0)):(document.addEventListener("mousedown",onPointerEvent,!0),document.addEventListener("mousemove",onPointerEvent,!0),document.addEventListener("mouseup",onPointerEvent,!0)),hasSetup=!0}function trackFocusVisible(as){setupGlobalFocusEvents(),as(isFocusVisible());const rs=()=>as(isFocusVisible());return handlers.add(rs),()=>{handlers.delete(rs)}}function omit$1(as,rs=[]){const ns=Object.assign({},as);for(const ss of rs)ss in ns&&delete ns[ss];return ns}function useCheckbox(as={}){const rs=useFormControlProps(as),{isDisabled:ns,isReadOnly:ss,isRequired:os,isInvalid:ls,id:us,onBlur:cs,onFocus:ds,"aria-describedby":ps}=rs,{defaultChecked:fs,isChecked:hs,isFocusable:gs,onChange:ys,isIndeterminate:bs,name:vs,value:xs,tabIndex:Cs=void 0,"aria-label":Ts,"aria-labelledby":Ss,"aria-invalid":Ns,...As}=as,ws=omit$1(As,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),Es=useCallbackRef(ys),_s=useCallbackRef(cs),$s=useCallbackRef(ds),[Rs,Ds]=reactExports.useState(!1),[Os,Is]=reactExports.useState(!1),[Vs,ks]=reactExports.useState(!1),[Ps,Bs]=reactExports.useState(!1);reactExports.useEffect(()=>trackFocusVisible(Ds),[]);const Ms=reactExports.useRef(null),[Ws,Us]=reactExports.useState(!0),[js,Ls]=reactExports.useState(!!fs),Gs=hs!==void 0,Hs=Gs?hs:js,Ys=reactExports.useCallback(Qs=>{if(ss||ns){Qs.preventDefault();return}Gs||Ls(Hs?Qs.target.checked:bs?!0:Qs.target.checked),Es==null||Es(Qs)},[ss,ns,Hs,Gs,bs,Es]);useSafeLayoutEffect$1(()=>{Ms.current&&(Ms.current.indeterminate=!!bs)},[bs]),useUpdateEffect(()=>{ns&&Is(!1)},[ns,Is]),useSafeLayoutEffect$1(()=>{const Qs=Ms.current;Qs!=null&&Qs.form&&(Qs.form.onreset=()=>{Ls(!!fs)})},[]);const Zs=ns&&!gs,Nl=reactExports.useCallback(Qs=>{Qs.key===" "&&Bs(!0)},[Bs]),yl=reactExports.useCallback(Qs=>{Qs.key===" "&&Bs(!1)},[Bs]);useSafeLayoutEffect$1(()=>{if(!Ms.current)return;Ms.current.checked!==Hs&&Ls(Ms.current.checked)},[Ms.current]);const Dl=reactExports.useCallback((Qs={},Js=null)=>{const El=_l=>{Os&&_l.preventDefault(),Bs(!0)};return{...Qs,ref:Js,"data-active":dataAttr(Ps),"data-hover":dataAttr(Vs),"data-checked":dataAttr(Hs),"data-focus":dataAttr(Os),"data-focus-visible":dataAttr(Os&&Rs),"data-indeterminate":dataAttr(bs),"data-disabled":dataAttr(ns),"data-invalid":dataAttr(ls),"data-readonly":dataAttr(ss),"aria-hidden":!0,onMouseDown:callAllHandlers(Qs.onMouseDown,El),onMouseUp:callAllHandlers(Qs.onMouseUp,()=>Bs(!1)),onMouseEnter:callAllHandlers(Qs.onMouseEnter,()=>ks(!0)),onMouseLeave:callAllHandlers(Qs.onMouseLeave,()=>ks(!1))}},[Ps,Hs,ns,Os,Rs,Vs,bs,ls,ss]),Rl=reactExports.useCallback((Qs={},Js=null)=>({...ws,...Qs,ref:mergeRefs(Js,El=>{El&&Us(El.tagName==="LABEL")}),onClick:callAllHandlers(Qs.onClick,()=>{var El;Ws||((El=Ms.current)==null||El.click(),requestAnimationFrame(()=>{var _l;(_l=Ms.current)==null||_l.focus()}))}),"data-disabled":dataAttr(ns),"data-checked":dataAttr(Hs),"data-invalid":dataAttr(ls)}),[ws,ns,Hs,ls,Ws]),Ml=reactExports.useCallback((Qs={},Js=null)=>({...Qs,ref:mergeRefs(Ms,Js),type:"checkbox",name:vs,value:xs,id:us,tabIndex:Cs,onChange:callAllHandlers(Qs.onChange,Ys),onBlur:callAllHandlers(Qs.onBlur,_s,()=>Is(!1)),onFocus:callAllHandlers(Qs.onFocus,$s,()=>Is(!0)),onKeyDown:callAllHandlers(Qs.onKeyDown,Nl),onKeyUp:callAllHandlers(Qs.onKeyUp,yl),required:os,checked:Hs,disabled:Zs,readOnly:ss,"aria-label":Ts,"aria-labelledby":Ss,"aria-invalid":Ns?!!Ns:ls,"aria-describedby":ps,"aria-disabled":ns,style:visuallyHiddenStyle}),[vs,xs,us,Ys,_s,$s,Nl,yl,os,Hs,Zs,ss,Ts,Ss,Ns,ls,ps,ns,Cs]),Ks=reactExports.useCallback((Qs={},Js=null)=>({...Qs,ref:Js,onMouseDown:callAllHandlers(Qs.onMouseDown,stopEvent),onTouchStart:callAllHandlers(Qs.onTouchStart,stopEvent),"data-disabled":dataAttr(ns),"data-checked":dataAttr(Hs),"data-invalid":dataAttr(ls)}),[Hs,ns,ls]);return{state:{isInvalid:ls,isFocused:Os,isChecked:Hs,isActive:Ps,isHovered:Vs,isIndeterminate:bs,isDisabled:ns,isReadOnly:ss,isRequired:os},getRootProps:Rl,getCheckboxProps:Dl,getInputProps:Ml,getLabelProps:Ks,htmlProps:ws}}function stopEvent(as){as.preventDefault(),as.stopPropagation()}var controlStyles={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},rootStyles={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},checkAnim=keyframes$1({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),indeterminateOpacityAnim=keyframes$1({from:{opacity:0},to:{opacity:1}}),indeterminateScaleAnim=keyframes$1({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Checkbox=forwardRef(function as(rs,ns){const ss=useCheckboxGroupContext(),os={...ss,...rs},ls=useMultiStyleConfig("Checkbox",os),us=omitThemingProps(rs),{spacing:cs="0.5rem",className:ds,children:ps,iconColor:fs,iconSize:hs,icon:gs=jsx$1(CheckboxIcon,{}),isChecked:ys,isDisabled:bs=ss==null?void 0:ss.isDisabled,onChange:vs,inputProps:xs,...Cs}=us;let Ts=ys;ss!=null&&ss.value&&us.value&&(Ts=ss.value.includes(us.value));let Ss=vs;ss!=null&&ss.onChange&&us.value&&(Ss=callAll(ss.onChange,vs));const{state:Ns,getInputProps:As,getCheckboxProps:ws,getLabelProps:Es,getRootProps:_s}=useCheckbox({...Cs,isDisabled:bs,isChecked:Ts,onChange:Ss}),$s=reactExports.useMemo(()=>({animation:Ns.isIndeterminate?`${indeterminateOpacityAnim} 20ms linear, ${indeterminateScaleAnim} 200ms linear`:`${checkAnim} 200ms linear`,fontSize:hs,color:fs,...ls.icon}),[fs,hs,Ns.isIndeterminate,ls.icon]),Rs=reactExports.cloneElement(gs,{__css:$s,isIndeterminate:Ns.isIndeterminate,isChecked:Ns.isChecked});return jsxs(chakra.label,{__css:{...rootStyles,...ls.container},className:cx("chakra-checkbox",ds),..._s(),children:[jsx$1("input",{className:"chakra-checkbox__input",...As(xs,ns)}),jsx$1(chakra.span,{__css:{...controlStyles,...ls.control},className:"chakra-checkbox__control",...ws(),children:Rs}),ps&&jsx$1(chakra.span,{className:"chakra-checkbox__label",...Es(),__css:{marginStart:cs,...ls.label},children:ps})]})});Checkbox.displayName="Checkbox";function useEventListener(as,rs,ns,ss){const os=useCallbackRef(ns);return reactExports.useEffect(()=>{const ls=typeof as=="function"?as():as??document;if(!(!ns||!ls))return ls.addEventListener(rs,os,ss),()=>{ls.removeEventListener(rs,os,ss)}},[rs,as,ss,os,ns]),()=>{const ls=typeof as=="function"?as():as??document;ls==null||ls.removeEventListener(rs,os,ss)}}function __awaiter(as,rs,ns,ss){function os(ls){return ls instanceof ns?ls:new ns(function(us){us(ls)})}return new(ns||(ns=Promise))(function(ls,us){function cs(fs){try{ps(ss.next(fs))}catch(hs){us(hs)}}function ds(fs){try{ps(ss.throw(fs))}catch(hs){us(hs)}}function ps(fs){fs.done?ls(fs.value):os(fs.value).then(cs,ds)}ps((ss=ss.apply(as,rs||[])).next())})}function __generator(as,rs){var ns={label:0,sent:function(){if(ls[0]&1)throw ls[1];return ls[1]},trys:[],ops:[]},ss,os,ls,us;return us={next:cs(0),throw:cs(1),return:cs(2)},typeof Symbol=="function"&&(us[Symbol.iterator]=function(){return this}),us;function cs(ps){return function(fs){return ds([ps,fs])}}function ds(ps){if(ss)throw new TypeError("Generator is already executing.");for(;ns;)try{if(ss=1,os&&(ls=ps[0]&2?os.return:ps[0]?os.throw||((ls=os.return)&&ls.call(os),0):os.next)&&!(ls=ls.call(os,ps[1])).done)return ls;switch(os=0,ls&&(ps=[ps[0]&2,ls.value]),ps[0]){case 0:case 1:ls=ps;break;case 4:return ns.label++,{value:ps[1],done:!1};case 5:ns.label++,os=ps[1],ps=[0];continue;case 7:ps=ns.ops.pop(),ns.trys.pop();continue;default:if(ls=ns.trys,!(ls=ls.length>0&&ls[ls.length-1])&&(ps[0]===6||ps[0]===2)){ns=0;continue}if(ps[0]===3&&(!ls||ps[1]>ls[0]&&ps[1]0)&&!(os=ss.next()).done;)ls.push(os.value)}catch(cs){us={error:cs}}finally{try{os&&!os.done&&(ns=ss.return)&&ns.call(ss)}finally{if(us)throw us.error}}return ls}function __spread(){for(var as=[],rs=0;rsas.hasAttribute("tabindex"),hasNegativeTabIndex=as=>hasTabIndex(as)&&as.tabIndex===-1;function isDisabled(as){return!!as.getAttribute("disabled")||!!as.getAttribute("aria-disabled")}function isHidden(as){return as.parentElement&&isHidden(as.parentElement)?!0:as.hidden}function isContentEditable(as){const rs=as.getAttribute("contenteditable");return rs!=="false"&&rs!=null}function isFocusable(as){if(!isHTMLElement$2(as)||isHidden(as)||isDisabled(as))return!1;const{localName:rs}=as;if(["input","select","textarea","button"].indexOf(rs)>=0)return!0;const ss={a:()=>as.hasAttribute("href"),audio:()=>as.hasAttribute("controls"),video:()=>as.hasAttribute("controls")};return rs in ss?ss[rs]():isContentEditable(as)?!0:hasTabIndex(as)}function isTabbable(as){return as?isHTMLElement$2(as)&&isFocusable(as)&&!hasNegativeTabIndex(as):!1}var[InputGroupStylesProvider,useInputGroupStyles]=createContext$1({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),InputGroup=forwardRef(function as(rs,ns){const ss=useMultiStyleConfig("Input",rs),{children:os,className:ls,...us}=omitThemingProps(rs),cs=cx("chakra-input__group",ls),ds={},ps=getValidChildren(os),fs=ss.field;ps.forEach(gs=>{var ys,bs;ss&&(fs&&gs.type.id==="InputLeftElement"&&(ds.paddingStart=(ys=fs.height)!=null?ys:fs.h),fs&&gs.type.id==="InputRightElement"&&(ds.paddingEnd=(bs=fs.height)!=null?bs:fs.h),gs.type.id==="InputRightAddon"&&(ds.borderEndRadius=0),gs.type.id==="InputLeftAddon"&&(ds.borderStartRadius=0))});const hs=ps.map(gs=>{var ys,bs;const vs=compact$1({size:((ys=gs.props)==null?void 0:ys.size)||rs.size,variant:((bs=gs.props)==null?void 0:bs.variant)||rs.variant});return gs.type.id!=="Input"?reactExports.cloneElement(gs,vs):reactExports.cloneElement(gs,Object.assign(vs,ds,gs.props))});return jsx$1(chakra.div,{className:cs,ref:ns,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate"},"data-group":!0,...us,children:jsx$1(InputGroupStylesProvider,{value:ss,children:hs})})});InputGroup.displayName="InputGroup";var placements$1={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},StyledAddon=chakra("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),InputAddon=forwardRef(function as(rs,ns){var ss;const{placement:os="left",...ls}=rs,us=(ss=placements$1[os])!=null?ss:{},cs=useInputGroupStyles();return jsx$1(StyledAddon,{ref:ns,...ls,__css:{...cs.addon,...us}})});InputAddon.displayName="InputAddon";var InputLeftAddon=forwardRef(function as(rs,ns){return jsx$1(InputAddon,{ref:ns,placement:"left",...rs,className:cx("chakra-input__left-addon",rs.className)})});InputLeftAddon.displayName="InputLeftAddon";InputLeftAddon.id="InputLeftAddon";var InputRightAddon=forwardRef(function as(rs,ns){return jsx$1(InputAddon,{ref:ns,placement:"right",...rs,className:cx("chakra-input__right-addon",rs.className)})});InputRightAddon.displayName="InputRightAddon";InputRightAddon.id="InputRightAddon";var StyledInputElement=chakra("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),InputElement=forwardRef(function as(rs,ns){var ss,os;const{placement:ls="left",...us}=rs,cs=useInputGroupStyles(),ds=cs.field,fs={[ls==="left"?"insetStart":"insetEnd"]:"0",width:(ss=ds==null?void 0:ds.height)!=null?ss:ds==null?void 0:ds.h,height:(os=ds==null?void 0:ds.height)!=null?os:ds==null?void 0:ds.h,fontSize:ds==null?void 0:ds.fontSize,...cs.element};return jsx$1(StyledInputElement,{ref:ns,__css:fs,...us})});InputElement.id="InputElement";InputElement.displayName="InputElement";var InputLeftElement=forwardRef(function as(rs,ns){const{className:ss,...os}=rs,ls=cx("chakra-input__left-element",ss);return jsx$1(InputElement,{ref:ns,placement:"left",className:ls,...os})});InputLeftElement.id="InputLeftElement";InputLeftElement.displayName="InputLeftElement";var InputRightElement=forwardRef(function as(rs,ns){const{className:ss,...os}=rs,ls=cx("chakra-input__right-element",ss);return jsx$1(InputElement,{ref:ns,placement:"right",className:ls,...os})});InputRightElement.id="InputRightElement";InputRightElement.displayName="InputRightElement";var Input$1=forwardRef(function as(rs,ns){const{htmlSize:ss,...os}=rs,ls=useMultiStyleConfig("Input",os),us=omitThemingProps(os),cs=useFormControl(us),ds=cx("chakra-input",rs.className);return jsx$1(chakra.input,{size:ss,...cs,__css:ls.field,ref:ns,className:ds})});Input$1.displayName="Input";Input$1.id="Input";function mapResponsive(as,rs){return Array.isArray(as)?as.map(ns=>ns===null?null:rs(ns)):isObject$6(as)?Object.keys(as).reduce((ns,ss)=>(ns[ss]=rs(as[ss]),ns),{}):as!=null?rs(as):null}var Text$1=forwardRef(function as(rs,ns){const ss=useStyleConfig("Text",rs),{className:os,align:ls,decoration:us,casing:cs,...ds}=omitThemingProps(rs),ps=compact$1({textAlign:rs.align,textDecoration:rs.decoration,textTransform:rs.casing});return jsx$1(chakra.p,{ref:ns,className:cx("chakra-text",rs.className),...ps,...ds,__css:ss})});Text$1.displayName="Text";function px(as){return typeof as=="number"?`${as}px`:as}var Wrap=forwardRef(function as(rs,ns){const{spacing:ss="0.5rem",spacingX:os,spacingY:ls,children:us,justify:cs,direction:ds,align:ps,className:fs,shouldWrapChildren:hs,...gs}=rs,ys=reactExports.useMemo(()=>{const{spacingX:vs=ss,spacingY:xs=ss}={spacingX:os,spacingY:ls};return{"--chakra-wrap-x-spacing":Cs=>mapResponsive(vs,Ts=>px(tokenToCSSVar("space",Ts)(Cs))),"--chakra-wrap-y-spacing":Cs=>mapResponsive(xs,Ts=>px(tokenToCSSVar("space",Ts)(Cs))),"--wrap-x-spacing":"calc(var(--chakra-wrap-x-spacing) / 2)","--wrap-y-spacing":"calc(var(--chakra-wrap-y-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:cs,alignItems:ps,flexDirection:ds,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-y-spacing) * -1) calc(var(--wrap-x-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-y-spacing) var(--wrap-x-spacing)"}}},[ss,os,ls,cs,ps,ds]),bs=reactExports.useMemo(()=>hs?reactExports.Children.map(us,(vs,xs)=>jsx$1(WrapItem,{children:vs},xs)):us,[us,hs]);return jsx$1(chakra.div,{ref:ns,className:cx("chakra-wrap",fs),overflow:"hidden",...gs,children:jsx$1(chakra.ul,{className:"chakra-wrap__list",__css:ys,children:bs})})});Wrap.displayName="Wrap";var WrapItem=forwardRef(function as(rs,ns){const{className:ss,...os}=rs;return jsx$1(chakra.li,{ref:ns,__css:{display:"flex",alignItems:"flex-start"},className:cx("chakra-wrap__listitem",ss),...os})});WrapItem.displayName="WrapItem";var Box=chakra("div");Box.displayName="Box";var Square=forwardRef(function as(rs,ns){const{size:ss,centerContent:os=!0,...ls}=rs;return jsx$1(Box,{ref:ns,boxSize:ss,__css:{...os?{display:"flex",alignItems:"center",justifyContent:"center"}:{},flexShrink:0,flexGrow:0},...ls})});Square.displayName="Square";var Circle$1=forwardRef(function as(rs,ns){const{size:ss,...os}=rs;return jsx$1(Square,{size:ss,ref:ns,borderRadius:"9999px",...os})});Circle$1.displayName="Circle";var Link=forwardRef(function as(rs,ns){const ss=useStyleConfig("Link",rs),{className:os,isExternal:ls,...us}=omitThemingProps(rs);return jsx$1(chakra.a,{target:ls?"_blank":void 0,rel:ls?"noopener":void 0,ref:ns,className:cx("chakra-link",os),...us,__css:ss})});Link.displayName="Link";var Badge=forwardRef(function as(rs,ns){const ss=useStyleConfig("Badge",rs),{className:os,...ls}=omitThemingProps(rs);return jsx$1(chakra.span,{ref:ns,className:cx("chakra-badge",rs.className),...ls,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...ss}})});Badge.displayName="Badge";var Center=chakra("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});Center.displayName="Center";var centerStyles={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};forwardRef(function as(rs,ns){const{axis:ss="both",...os}=rs;return jsx$1(chakra.div,{ref:ns,__css:centerStyles[ss],...os,position:"absolute"})});var Flex=forwardRef(function as(rs,ns){const{direction:ss,align:os,justify:ls,wrap:us,basis:cs,grow:ds,shrink:ps,...fs}=rs,hs={display:"flex",flexDirection:ss,alignItems:os,justifyContent:ls,flexWrap:us,flexBasis:cs,flexGrow:ds,flexShrink:ps};return jsx$1(chakra.div,{ref:ns,__css:hs,...fs})});Flex.displayName="Flex";function isPrintableCharacter(as){const{key:rs}=as;return rs.length===1||rs.length>1&&/[^a-zA-Z0-9]/.test(rs)}function useShortcut(as={}){const{timeout:rs=300,preventDefault:ns=()=>!0}=as,[ss,os]=reactExports.useState([]),ls=reactExports.useRef(),us=()=>{ls.current&&(clearTimeout(ls.current),ls.current=null)},cs=()=>{us(),ls.current=setTimeout(()=>{os([]),ls.current=null},rs)};reactExports.useEffect(()=>us,[]);function ds(ps){return fs=>{if(fs.key==="Backspace"){const hs=[...ss];hs.pop(),os(hs);return}if(isPrintableCharacter(fs)){const hs=ss.concat(fs.key);ns(fs)&&(fs.preventDefault(),fs.stopPropagation()),os(hs),ps(hs.join("")),cs()}}}return ds}function getNextItemFromSearch(as,rs,ns,ss){if(rs==null)return ss;if(!ss)return as.find(us=>ns(us).toLowerCase().startsWith(rs.toLowerCase()));const os=as.filter(ls=>ns(ls).toLowerCase().startsWith(rs.toLowerCase()));if(os.length>0){let ls;return os.includes(ss)?(ls=os.indexOf(ss)+1,ls===os.length&&(ls=0),os[ls]):(ls=as.indexOf(os[0]),as[ls])}return ss}function useEventListeners(){const as=reactExports.useRef(new Map),rs=as.current,ns=reactExports.useCallback((os,ls,us,cs)=>{as.current.set(us,{type:ls,el:os,options:cs}),os.addEventListener(ls,us,cs)},[]),ss=reactExports.useCallback((os,ls,us,cs)=>{os.removeEventListener(ls,us,cs),as.current.delete(us)},[]);return reactExports.useEffect(()=>()=>{rs.forEach((os,ls)=>{ss(os.el,os.type,ls,os.options)})},[ss,rs]),{add:ns,remove:ss}}function isValidElement(as){const rs=as.target,{tagName:ns,isContentEditable:ss}=rs;return ns!=="INPUT"&&ns!=="TEXTAREA"&&ss!==!0}function useClickable(as={}){const{ref:rs,isDisabled:ns,isFocusable:ss,clickOnEnter:os=!0,clickOnSpace:ls=!0,onMouseDown:us,onMouseUp:cs,onClick:ds,onKeyDown:ps,onKeyUp:fs,tabIndex:hs,onMouseOver:gs,onMouseLeave:ys,...bs}=as,[vs,xs]=reactExports.useState(!0),[Cs,Ts]=reactExports.useState(!1),Ss=useEventListeners(),Ns=Bs=>{Bs&&Bs.tagName!=="BUTTON"&&xs(!1)},As=vs?hs:hs||0,ws=ns&&!ss,Es=reactExports.useCallback(Bs=>{if(ns){Bs.stopPropagation(),Bs.preventDefault();return}Bs.currentTarget.focus(),ds==null||ds(Bs)},[ns,ds]),_s=reactExports.useCallback(Bs=>{Cs&&isValidElement(Bs)&&(Bs.preventDefault(),Bs.stopPropagation(),Ts(!1),Ss.remove(document,"keyup",_s,!1))},[Cs,Ss]),$s=reactExports.useCallback(Bs=>{if(ps==null||ps(Bs),ns||Bs.defaultPrevented||Bs.metaKey||!isValidElement(Bs.nativeEvent)||vs)return;const Ms=os&&Bs.key==="Enter";ls&&Bs.key===" "&&(Bs.preventDefault(),Ts(!0)),Ms&&(Bs.preventDefault(),Bs.currentTarget.click()),Ss.add(document,"keyup",_s,!1)},[ns,vs,ps,os,ls,Ss,_s]),Rs=reactExports.useCallback(Bs=>{if(fs==null||fs(Bs),ns||Bs.defaultPrevented||Bs.metaKey||!isValidElement(Bs.nativeEvent)||vs)return;ls&&Bs.key===" "&&(Bs.preventDefault(),Ts(!1),Bs.currentTarget.click())},[ls,vs,ns,fs]),Ds=reactExports.useCallback(Bs=>{Bs.button===0&&(Ts(!1),Ss.remove(document,"mouseup",Ds,!1))},[Ss]),Os=reactExports.useCallback(Bs=>{if(Bs.button!==0)return;if(ns){Bs.stopPropagation(),Bs.preventDefault();return}vs||Ts(!0),Bs.currentTarget.focus({preventScroll:!0}),Ss.add(document,"mouseup",Ds,!1),us==null||us(Bs)},[ns,vs,us,Ss,Ds]),Is=reactExports.useCallback(Bs=>{Bs.button===0&&(vs||Ts(!1),cs==null||cs(Bs))},[cs,vs]),Vs=reactExports.useCallback(Bs=>{if(ns){Bs.preventDefault();return}gs==null||gs(Bs)},[ns,gs]),ks=reactExports.useCallback(Bs=>{Cs&&(Bs.preventDefault(),Ts(!1)),ys==null||ys(Bs)},[Cs,ys]),Ps=mergeRefs(rs,Ns);return vs?{...bs,ref:Ps,type:"button","aria-disabled":ws?void 0:ns,disabled:ws,onClick:Es,onMouseDown:us,onMouseUp:cs,onKeyUp:fs,onKeyDown:ps,onMouseOver:gs,onMouseLeave:ys}:{...bs,ref:Ps,role:"button","data-active":dataAttr(Cs),"aria-disabled":ns?"true":void 0,tabIndex:ws?void 0:As,onClick:Es,onMouseDown:Os,onMouseUp:Is,onKeyUp:Rs,onKeyDown:$s,onMouseOver:Vs,onMouseLeave:ks}}function preventReturnFocus(as){const rs=as.current;if(!rs)return!1;const ns=getActiveElement(rs);return!ns||rs.contains(ns)?!1:!!isTabbable(ns)}function useFocusOnHide(as,rs){const{shouldFocus:ns,visible:ss,focusRef:os}=rs,ls=ns&&!ss;useUpdateEffect(()=>{if(!ls||preventReturnFocus(as))return;const us=(os==null?void 0:os.current)||as.current;us&&requestAnimationFrame(()=>{us.focus()})},[ls,as,os])}var toVar=(as,rs)=>({var:as,varRef:rs?`var(${as}, ${rs})`:`var(${as})`}),cssVars={arrowShadowColor:toVar("--popper-arrow-shadow-color"),arrowSize:toVar("--popper-arrow-size","8px"),arrowSizeHalf:toVar("--popper-arrow-size-half"),arrowBg:toVar("--popper-arrow-bg"),transformOrigin:toVar("--popper-transform-origin"),arrowOffset:toVar("--popper-arrow-offset")};function getBoxShadow(as){if(as.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(as.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(as.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(as.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var transforms={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},toTransformOrigin=as=>transforms[as],defaultEventListeners={scroll:!0,resize:!0};function getEventListenerOptions(as){let rs;return typeof as=="object"?rs={enabled:!0,options:{...defaultEventListeners,...as}}:rs={enabled:as,options:defaultEventListeners},rs}var matchWidth={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:as})=>{as.styles.popper.width=`${as.rects.reference.width}px`},effect:({state:as})=>()=>{const rs=as.elements.reference;as.elements.popper.style.width=`${rs.offsetWidth}px`}},transformOrigin={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:as})=>{setTransformOrigin(as)},effect:({state:as})=>()=>{setTransformOrigin(as)}},setTransformOrigin=as=>{as.elements.popper.style.setProperty(cssVars.transformOrigin.var,toTransformOrigin(as.placement))},positionArrow={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:as})=>{setArrowStyles(as)}},setArrowStyles=as=>{var rs;if(!as.placement)return;const ns=getArrowStyle$1(as.placement);if((rs=as.elements)!=null&&rs.arrow&&ns){Object.assign(as.elements.arrow.style,{[ns.property]:ns.value,width:cssVars.arrowSize.varRef,height:cssVars.arrowSize.varRef,zIndex:-1});const ss={[cssVars.arrowSizeHalf.var]:`calc(${cssVars.arrowSize.varRef} / 2)`,[cssVars.arrowOffset.var]:`calc(${cssVars.arrowSizeHalf.varRef} * -1)`};for(const os in ss)as.elements.arrow.style.setProperty(os,ss[os])}},getArrowStyle$1=as=>{if(as.startsWith("top"))return{property:"bottom",value:cssVars.arrowOffset.varRef};if(as.startsWith("bottom"))return{property:"top",value:cssVars.arrowOffset.varRef};if(as.startsWith("left"))return{property:"right",value:cssVars.arrowOffset.varRef};if(as.startsWith("right"))return{property:"left",value:cssVars.arrowOffset.varRef}},innerArrow={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:as})=>{setInnerArrowStyles(as)},effect:({state:as})=>()=>{setInnerArrowStyles(as)}},setInnerArrowStyles=as=>{if(!as.elements.arrow)return;const rs=as.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!rs)return;const ns=getBoxShadow(as.placement);ns&&rs.style.setProperty("--popper-arrow-default-shadow",ns),Object.assign(rs.style,{transform:"rotate(45deg)",background:cssVars.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},logicals={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},opposites={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function getPopperPlacement(as,rs="ltr"){var ns,ss;const os=((ns=logicals[as])==null?void 0:ns[rs])||as;return rs==="ltr"?os:(ss=opposites[as])!=null?ss:os}var top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(as,rs){return as.concat([rs+"-"+start,rs+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(as,rs){return as.concat([rs,rs+"-"+start,rs+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(as){return as?(as.nodeName||"").toLowerCase():null}function getWindow$1(as){if(as==null)return window;if(as.toString()!=="[object Window]"){var rs=as.ownerDocument;return rs&&rs.defaultView||window}return as}function isElement$1(as){var rs=getWindow$1(as).Element;return as instanceof rs||as instanceof Element}function isHTMLElement$1(as){var rs=getWindow$1(as).HTMLElement;return as instanceof rs||as instanceof HTMLElement}function isShadowRoot(as){if(typeof ShadowRoot>"u")return!1;var rs=getWindow$1(as).ShadowRoot;return as instanceof rs||as instanceof ShadowRoot}function applyStyles(as){var rs=as.state;Object.keys(rs.elements).forEach(function(ns){var ss=rs.styles[ns]||{},os=rs.attributes[ns]||{},ls=rs.elements[ns];!isHTMLElement$1(ls)||!getNodeName(ls)||(Object.assign(ls.style,ss),Object.keys(os).forEach(function(us){var cs=os[us];cs===!1?ls.removeAttribute(us):ls.setAttribute(us,cs===!0?"":cs)}))})}function effect$2(as){var rs=as.state,ns={popper:{position:rs.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(rs.elements.popper.style,ns.popper),rs.styles=ns,rs.elements.arrow&&Object.assign(rs.elements.arrow.style,ns.arrow),function(){Object.keys(rs.elements).forEach(function(ss){var os=rs.elements[ss],ls=rs.attributes[ss]||{},us=Object.keys(rs.styles.hasOwnProperty(ss)?rs.styles[ss]:ns[ss]),cs=us.reduce(function(ds,ps){return ds[ps]="",ds},{});!isHTMLElement$1(os)||!getNodeName(os)||(Object.assign(os.style,cs),Object.keys(ls).forEach(function(ds){os.removeAttribute(ds)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(as){return as.split("-")[0]}var max=Math.max,min=Math.min,round=Math.round;function getUAString(){var as=navigator.userAgentData;return as!=null&&as.brands?as.brands.map(function(rs){return rs.brand+"/"+rs.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(as,rs,ns){rs===void 0&&(rs=!1),ns===void 0&&(ns=!1);var ss=as.getBoundingClientRect(),os=1,ls=1;rs&&isHTMLElement$1(as)&&(os=as.offsetWidth>0&&round(ss.width)/as.offsetWidth||1,ls=as.offsetHeight>0&&round(ss.height)/as.offsetHeight||1);var us=isElement$1(as)?getWindow$1(as):window,cs=us.visualViewport,ds=!isLayoutViewport()&&ns,ps=(ss.left+(ds&&cs?cs.offsetLeft:0))/os,fs=(ss.top+(ds&&cs?cs.offsetTop:0))/ls,hs=ss.width/os,gs=ss.height/ls;return{width:hs,height:gs,top:fs,right:ps+hs,bottom:fs+gs,left:ps,x:ps,y:fs}}function getLayoutRect(as){var rs=getBoundingClientRect(as),ns=as.offsetWidth,ss=as.offsetHeight;return Math.abs(rs.width-ns)<=1&&(ns=rs.width),Math.abs(rs.height-ss)<=1&&(ss=rs.height),{x:as.offsetLeft,y:as.offsetTop,width:ns,height:ss}}function contains$1(as,rs){var ns=rs.getRootNode&&rs.getRootNode();if(as.contains(rs))return!0;if(ns&&isShadowRoot(ns)){var ss=rs;do{if(ss&&as.isSameNode(ss))return!0;ss=ss.parentNode||ss.host}while(ss)}return!1}function getComputedStyle$2(as){return getWindow$1(as).getComputedStyle(as)}function isTableElement(as){return["table","td","th"].indexOf(getNodeName(as))>=0}function getDocumentElement(as){return((isElement$1(as)?as.ownerDocument:as.document)||window.document).documentElement}function getParentNode(as){return getNodeName(as)==="html"?as:as.assignedSlot||as.parentNode||(isShadowRoot(as)?as.host:null)||getDocumentElement(as)}function getTrueOffsetParent(as){return!isHTMLElement$1(as)||getComputedStyle$2(as).position==="fixed"?null:as.offsetParent}function getContainingBlock(as){var rs=/firefox/i.test(getUAString()),ns=/Trident/i.test(getUAString());if(ns&&isHTMLElement$1(as)){var ss=getComputedStyle$2(as);if(ss.position==="fixed")return null}var os=getParentNode(as);for(isShadowRoot(os)&&(os=os.host);isHTMLElement$1(os)&&["html","body"].indexOf(getNodeName(os))<0;){var ls=getComputedStyle$2(os);if(ls.transform!=="none"||ls.perspective!=="none"||ls.contain==="paint"||["transform","perspective"].indexOf(ls.willChange)!==-1||rs&&ls.willChange==="filter"||rs&&ls.filter&&ls.filter!=="none")return os;os=os.parentNode}return null}function getOffsetParent(as){for(var rs=getWindow$1(as),ns=getTrueOffsetParent(as);ns&&isTableElement(ns)&&getComputedStyle$2(ns).position==="static";)ns=getTrueOffsetParent(ns);return ns&&(getNodeName(ns)==="html"||getNodeName(ns)==="body"&&getComputedStyle$2(ns).position==="static")?rs:ns||getContainingBlock(as)||rs}function getMainAxisFromPlacement(as){return["top","bottom"].indexOf(as)>=0?"x":"y"}function within(as,rs,ns){return max(as,min(rs,ns))}function withinMaxClamp(as,rs,ns){var ss=within(as,rs,ns);return ss>ns?ns:ss}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(as){return Object.assign({},getFreshSideObject(),as)}function expandToHashMap(as,rs){return rs.reduce(function(ns,ss){return ns[ss]=as,ns},{})}var toPaddingObject=function as(rs,ns){return rs=typeof rs=="function"?rs(Object.assign({},ns.rects,{placement:ns.placement})):rs,mergePaddingObject(typeof rs!="number"?rs:expandToHashMap(rs,basePlacements))};function arrow(as){var rs,ns=as.state,ss=as.name,os=as.options,ls=ns.elements.arrow,us=ns.modifiersData.popperOffsets,cs=getBasePlacement(ns.placement),ds=getMainAxisFromPlacement(cs),ps=[left,right].indexOf(cs)>=0,fs=ps?"height":"width";if(!(!ls||!us)){var hs=toPaddingObject(os.padding,ns),gs=getLayoutRect(ls),ys=ds==="y"?top:left,bs=ds==="y"?bottom:right,vs=ns.rects.reference[fs]+ns.rects.reference[ds]-us[ds]-ns.rects.popper[fs],xs=us[ds]-ns.rects.reference[ds],Cs=getOffsetParent(ls),Ts=Cs?ds==="y"?Cs.clientHeight||0:Cs.clientWidth||0:0,Ss=vs/2-xs/2,Ns=hs[ys],As=Ts-gs[fs]-hs[bs],ws=Ts/2-gs[fs]/2+Ss,Es=within(Ns,ws,As),_s=ds;ns.modifiersData[ss]=(rs={},rs[_s]=Es,rs.centerOffset=Es-ws,rs)}}function effect$1(as){var rs=as.state,ns=as.options,ss=ns.element,os=ss===void 0?"[data-popper-arrow]":ss;os!=null&&(typeof os=="string"&&(os=rs.elements.popper.querySelector(os),!os)||contains$1(rs.elements.popper,os)&&(rs.elements.arrow=os))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(as){return as.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(as){var rs=as.x,ns=as.y,ss=window,os=ss.devicePixelRatio||1;return{x:round(rs*os)/os||0,y:round(ns*os)/os||0}}function mapToStyles(as){var rs,ns=as.popper,ss=as.popperRect,os=as.placement,ls=as.variation,us=as.offsets,cs=as.position,ds=as.gpuAcceleration,ps=as.adaptive,fs=as.roundOffsets,hs=as.isFixed,gs=us.x,ys=gs===void 0?0:gs,bs=us.y,vs=bs===void 0?0:bs,xs=typeof fs=="function"?fs({x:ys,y:vs}):{x:ys,y:vs};ys=xs.x,vs=xs.y;var Cs=us.hasOwnProperty("x"),Ts=us.hasOwnProperty("y"),Ss=left,Ns=top,As=window;if(ps){var ws=getOffsetParent(ns),Es="clientHeight",_s="clientWidth";if(ws===getWindow$1(ns)&&(ws=getDocumentElement(ns),getComputedStyle$2(ws).position!=="static"&&cs==="absolute"&&(Es="scrollHeight",_s="scrollWidth")),ws=ws,os===top||(os===left||os===right)&&ls===end){Ns=bottom;var $s=hs&&ws===As&&As.visualViewport?As.visualViewport.height:ws[Es];vs-=$s-ss.height,vs*=ds?1:-1}if(os===left||(os===top||os===bottom)&&ls===end){Ss=right;var Rs=hs&&ws===As&&As.visualViewport?As.visualViewport.width:ws[_s];ys-=Rs-ss.width,ys*=ds?1:-1}}var Ds=Object.assign({position:cs},ps&&unsetSides),Os=fs===!0?roundOffsetsByDPR({x:ys,y:vs}):{x:ys,y:vs};if(ys=Os.x,vs=Os.y,ds){var Is;return Object.assign({},Ds,(Is={},Is[Ns]=Ts?"0":"",Is[Ss]=Cs?"0":"",Is.transform=(As.devicePixelRatio||1)<=1?"translate("+ys+"px, "+vs+"px)":"translate3d("+ys+"px, "+vs+"px, 0)",Is))}return Object.assign({},Ds,(rs={},rs[Ns]=Ts?vs+"px":"",rs[Ss]=Cs?ys+"px":"",rs.transform="",rs))}function computeStyles(as){var rs=as.state,ns=as.options,ss=ns.gpuAcceleration,os=ss===void 0?!0:ss,ls=ns.adaptive,us=ls===void 0?!0:ls,cs=ns.roundOffsets,ds=cs===void 0?!0:cs,ps={placement:getBasePlacement(rs.placement),variation:getVariation(rs.placement),popper:rs.elements.popper,popperRect:rs.rects.popper,gpuAcceleration:os,isFixed:rs.options.strategy==="fixed"};rs.modifiersData.popperOffsets!=null&&(rs.styles.popper=Object.assign({},rs.styles.popper,mapToStyles(Object.assign({},ps,{offsets:rs.modifiersData.popperOffsets,position:rs.options.strategy,adaptive:us,roundOffsets:ds})))),rs.modifiersData.arrow!=null&&(rs.styles.arrow=Object.assign({},rs.styles.arrow,mapToStyles(Object.assign({},ps,{offsets:rs.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:ds})))),rs.attributes.popper=Object.assign({},rs.attributes.popper,{"data-popper-placement":rs.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(as){var rs=as.state,ns=as.instance,ss=as.options,os=ss.scroll,ls=os===void 0?!0:os,us=ss.resize,cs=us===void 0?!0:us,ds=getWindow$1(rs.elements.popper),ps=[].concat(rs.scrollParents.reference,rs.scrollParents.popper);return ls&&ps.forEach(function(fs){fs.addEventListener("scroll",ns.update,passive)}),cs&&ds.addEventListener("resize",ns.update,passive),function(){ls&&ps.forEach(function(fs){fs.removeEventListener("scroll",ns.update,passive)}),cs&&ds.removeEventListener("resize",ns.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function as(){},effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(as){return as.replace(/left|right|bottom|top/g,function(rs){return hash$1[rs]})}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(as){return as.replace(/start|end/g,function(rs){return hash[rs]})}function getWindowScroll(as){var rs=getWindow$1(as),ns=rs.pageXOffset,ss=rs.pageYOffset;return{scrollLeft:ns,scrollTop:ss}}function getWindowScrollBarX(as){return getBoundingClientRect(getDocumentElement(as)).left+getWindowScroll(as).scrollLeft}function getViewportRect(as,rs){var ns=getWindow$1(as),ss=getDocumentElement(as),os=ns.visualViewport,ls=ss.clientWidth,us=ss.clientHeight,cs=0,ds=0;if(os){ls=os.width,us=os.height;var ps=isLayoutViewport();(ps||!ps&&rs==="fixed")&&(cs=os.offsetLeft,ds=os.offsetTop)}return{width:ls,height:us,x:cs+getWindowScrollBarX(as),y:ds}}function getDocumentRect(as){var rs,ns=getDocumentElement(as),ss=getWindowScroll(as),os=(rs=as.ownerDocument)==null?void 0:rs.body,ls=max(ns.scrollWidth,ns.clientWidth,os?os.scrollWidth:0,os?os.clientWidth:0),us=max(ns.scrollHeight,ns.clientHeight,os?os.scrollHeight:0,os?os.clientHeight:0),cs=-ss.scrollLeft+getWindowScrollBarX(as),ds=-ss.scrollTop;return getComputedStyle$2(os||ns).direction==="rtl"&&(cs+=max(ns.clientWidth,os?os.clientWidth:0)-ls),{width:ls,height:us,x:cs,y:ds}}function isScrollParent(as){var rs=getComputedStyle$2(as),ns=rs.overflow,ss=rs.overflowX,os=rs.overflowY;return/auto|scroll|overlay|hidden/.test(ns+os+ss)}function getScrollParent(as){return["html","body","#document"].indexOf(getNodeName(as))>=0?as.ownerDocument.body:isHTMLElement$1(as)&&isScrollParent(as)?as:getScrollParent(getParentNode(as))}function listScrollParents(as,rs){var ns;rs===void 0&&(rs=[]);var ss=getScrollParent(as),os=ss===((ns=as.ownerDocument)==null?void 0:ns.body),ls=getWindow$1(ss),us=os?[ls].concat(ls.visualViewport||[],isScrollParent(ss)?ss:[]):ss,cs=rs.concat(us);return os?cs:cs.concat(listScrollParents(getParentNode(us)))}function rectToClientRect(as){return Object.assign({},as,{left:as.x,top:as.y,right:as.x+as.width,bottom:as.y+as.height})}function getInnerBoundingClientRect(as,rs){var ns=getBoundingClientRect(as,!1,rs==="fixed");return ns.top=ns.top+as.clientTop,ns.left=ns.left+as.clientLeft,ns.bottom=ns.top+as.clientHeight,ns.right=ns.left+as.clientWidth,ns.width=as.clientWidth,ns.height=as.clientHeight,ns.x=ns.left,ns.y=ns.top,ns}function getClientRectFromMixedType(as,rs,ns){return rs===viewport?rectToClientRect(getViewportRect(as,ns)):isElement$1(rs)?getInnerBoundingClientRect(rs,ns):rectToClientRect(getDocumentRect(getDocumentElement(as)))}function getClippingParents(as){var rs=listScrollParents(getParentNode(as)),ns=["absolute","fixed"].indexOf(getComputedStyle$2(as).position)>=0,ss=ns&&isHTMLElement$1(as)?getOffsetParent(as):as;return isElement$1(ss)?rs.filter(function(os){return isElement$1(os)&&contains$1(os,ss)&&getNodeName(os)!=="body"}):[]}function getClippingRect(as,rs,ns,ss){var os=rs==="clippingParents"?getClippingParents(as):[].concat(rs),ls=[].concat(os,[ns]),us=ls[0],cs=ls.reduce(function(ds,ps){var fs=getClientRectFromMixedType(as,ps,ss);return ds.top=max(fs.top,ds.top),ds.right=min(fs.right,ds.right),ds.bottom=min(fs.bottom,ds.bottom),ds.left=max(fs.left,ds.left),ds},getClientRectFromMixedType(as,us,ss));return cs.width=cs.right-cs.left,cs.height=cs.bottom-cs.top,cs.x=cs.left,cs.y=cs.top,cs}function computeOffsets(as){var rs=as.reference,ns=as.element,ss=as.placement,os=ss?getBasePlacement(ss):null,ls=ss?getVariation(ss):null,us=rs.x+rs.width/2-ns.width/2,cs=rs.y+rs.height/2-ns.height/2,ds;switch(os){case top:ds={x:us,y:rs.y-ns.height};break;case bottom:ds={x:us,y:rs.y+rs.height};break;case right:ds={x:rs.x+rs.width,y:cs};break;case left:ds={x:rs.x-ns.width,y:cs};break;default:ds={x:rs.x,y:rs.y}}var ps=os?getMainAxisFromPlacement(os):null;if(ps!=null){var fs=ps==="y"?"height":"width";switch(ls){case start:ds[ps]=ds[ps]-(rs[fs]/2-ns[fs]/2);break;case end:ds[ps]=ds[ps]+(rs[fs]/2-ns[fs]/2);break}}return ds}function detectOverflow(as,rs){rs===void 0&&(rs={});var ns=rs,ss=ns.placement,os=ss===void 0?as.placement:ss,ls=ns.strategy,us=ls===void 0?as.strategy:ls,cs=ns.boundary,ds=cs===void 0?clippingParents:cs,ps=ns.rootBoundary,fs=ps===void 0?viewport:ps,hs=ns.elementContext,gs=hs===void 0?popper:hs,ys=ns.altBoundary,bs=ys===void 0?!1:ys,vs=ns.padding,xs=vs===void 0?0:vs,Cs=mergePaddingObject(typeof xs!="number"?xs:expandToHashMap(xs,basePlacements)),Ts=gs===popper?reference:popper,Ss=as.rects.popper,Ns=as.elements[bs?Ts:gs],As=getClippingRect(isElement$1(Ns)?Ns:Ns.contextElement||getDocumentElement(as.elements.popper),ds,fs,us),ws=getBoundingClientRect(as.elements.reference),Es=computeOffsets({reference:ws,element:Ss,strategy:"absolute",placement:os}),_s=rectToClientRect(Object.assign({},Ss,Es)),$s=gs===popper?_s:ws,Rs={top:As.top-$s.top+Cs.top,bottom:$s.bottom-As.bottom+Cs.bottom,left:As.left-$s.left+Cs.left,right:$s.right-As.right+Cs.right},Ds=as.modifiersData.offset;if(gs===popper&&Ds){var Os=Ds[os];Object.keys(Rs).forEach(function(Is){var Vs=[right,bottom].indexOf(Is)>=0?1:-1,ks=[top,bottom].indexOf(Is)>=0?"y":"x";Rs[Is]+=Os[ks]*Vs})}return Rs}function computeAutoPlacement(as,rs){rs===void 0&&(rs={});var ns=rs,ss=ns.placement,os=ns.boundary,ls=ns.rootBoundary,us=ns.padding,cs=ns.flipVariations,ds=ns.allowedAutoPlacements,ps=ds===void 0?placements:ds,fs=getVariation(ss),hs=fs?cs?variationPlacements:variationPlacements.filter(function(bs){return getVariation(bs)===fs}):basePlacements,gs=hs.filter(function(bs){return ps.indexOf(bs)>=0});gs.length===0&&(gs=hs);var ys=gs.reduce(function(bs,vs){return bs[vs]=detectOverflow(as,{placement:vs,boundary:os,rootBoundary:ls,padding:us})[getBasePlacement(vs)],bs},{});return Object.keys(ys).sort(function(bs,vs){return ys[bs]-ys[vs]})}function getExpandedFallbackPlacements(as){if(getBasePlacement(as)===auto)return[];var rs=getOppositePlacement(as);return[getOppositeVariationPlacement(as),rs,getOppositeVariationPlacement(rs)]}function flip(as){var rs=as.state,ns=as.options,ss=as.name;if(!rs.modifiersData[ss]._skip){for(var os=ns.mainAxis,ls=os===void 0?!0:os,us=ns.altAxis,cs=us===void 0?!0:us,ds=ns.fallbackPlacements,ps=ns.padding,fs=ns.boundary,hs=ns.rootBoundary,gs=ns.altBoundary,ys=ns.flipVariations,bs=ys===void 0?!0:ys,vs=ns.allowedAutoPlacements,xs=rs.options.placement,Cs=getBasePlacement(xs),Ts=Cs===xs,Ss=ds||(Ts||!bs?[getOppositePlacement(xs)]:getExpandedFallbackPlacements(xs)),Ns=[xs].concat(Ss).reduce(function(Hs,Ys){return Hs.concat(getBasePlacement(Ys)===auto?computeAutoPlacement(rs,{placement:Ys,boundary:fs,rootBoundary:hs,padding:ps,flipVariations:bs,allowedAutoPlacements:vs}):Ys)},[]),As=rs.rects.reference,ws=rs.rects.popper,Es=new Map,_s=!0,$s=Ns[0],Rs=0;Rs=0,ks=Vs?"width":"height",Ps=detectOverflow(rs,{placement:Ds,boundary:fs,rootBoundary:hs,altBoundary:gs,padding:ps}),Bs=Vs?Is?right:left:Is?bottom:top;As[ks]>ws[ks]&&(Bs=getOppositePlacement(Bs));var Ms=getOppositePlacement(Bs),Ws=[];if(ls&&Ws.push(Ps[Os]<=0),cs&&Ws.push(Ps[Bs]<=0,Ps[Ms]<=0),Ws.every(function(Hs){return Hs})){$s=Ds,_s=!1;break}Es.set(Ds,Ws)}if(_s)for(var Us=bs?3:1,js=function(Ys){var Zs=Ns.find(function(Nl){var yl=Es.get(Nl);if(yl)return yl.slice(0,Ys).every(function(Dl){return Dl})});if(Zs)return $s=Zs,"break"},Ls=Us;Ls>0;Ls--){var Gs=js(Ls);if(Gs==="break")break}rs.placement!==$s&&(rs.modifiersData[ss]._skip=!0,rs.placement=$s,rs.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(as,rs,ns){return ns===void 0&&(ns={x:0,y:0}),{top:as.top-rs.height-ns.y,right:as.right-rs.width+ns.x,bottom:as.bottom-rs.height+ns.y,left:as.left-rs.width-ns.x}}function isAnySideFullyClipped(as){return[top,right,bottom,left].some(function(rs){return as[rs]>=0})}function hide(as){var rs=as.state,ns=as.name,ss=rs.rects.reference,os=rs.rects.popper,ls=rs.modifiersData.preventOverflow,us=detectOverflow(rs,{elementContext:"reference"}),cs=detectOverflow(rs,{altBoundary:!0}),ds=getSideOffsets(us,ss),ps=getSideOffsets(cs,os,ls),fs=isAnySideFullyClipped(ds),hs=isAnySideFullyClipped(ps);rs.modifiersData[ns]={referenceClippingOffsets:ds,popperEscapeOffsets:ps,isReferenceHidden:fs,hasPopperEscaped:hs},rs.attributes.popper=Object.assign({},rs.attributes.popper,{"data-popper-reference-hidden":fs,"data-popper-escaped":hs})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(as,rs,ns){var ss=getBasePlacement(as),os=[left,top].indexOf(ss)>=0?-1:1,ls=typeof ns=="function"?ns(Object.assign({},rs,{placement:as})):ns,us=ls[0],cs=ls[1];return us=us||0,cs=(cs||0)*os,[left,right].indexOf(ss)>=0?{x:cs,y:us}:{x:us,y:cs}}function offset(as){var rs=as.state,ns=as.options,ss=as.name,os=ns.offset,ls=os===void 0?[0,0]:os,us=placements.reduce(function(fs,hs){return fs[hs]=distanceAndSkiddingToXY(hs,rs.rects,ls),fs},{}),cs=us[rs.placement],ds=cs.x,ps=cs.y;rs.modifiersData.popperOffsets!=null&&(rs.modifiersData.popperOffsets.x+=ds,rs.modifiersData.popperOffsets.y+=ps),rs.modifiersData[ss]=us}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(as){var rs=as.state,ns=as.name;rs.modifiersData[ns]=computeOffsets({reference:rs.rects.reference,element:rs.rects.popper,strategy:"absolute",placement:rs.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(as){return as==="x"?"y":"x"}function preventOverflow(as){var rs=as.state,ns=as.options,ss=as.name,os=ns.mainAxis,ls=os===void 0?!0:os,us=ns.altAxis,cs=us===void 0?!1:us,ds=ns.boundary,ps=ns.rootBoundary,fs=ns.altBoundary,hs=ns.padding,gs=ns.tether,ys=gs===void 0?!0:gs,bs=ns.tetherOffset,vs=bs===void 0?0:bs,xs=detectOverflow(rs,{boundary:ds,rootBoundary:ps,padding:hs,altBoundary:fs}),Cs=getBasePlacement(rs.placement),Ts=getVariation(rs.placement),Ss=!Ts,Ns=getMainAxisFromPlacement(Cs),As=getAltAxis(Ns),ws=rs.modifiersData.popperOffsets,Es=rs.rects.reference,_s=rs.rects.popper,$s=typeof vs=="function"?vs(Object.assign({},rs.rects,{placement:rs.placement})):vs,Rs=typeof $s=="number"?{mainAxis:$s,altAxis:$s}:Object.assign({mainAxis:0,altAxis:0},$s),Ds=rs.modifiersData.offset?rs.modifiersData.offset[rs.placement]:null,Os={x:0,y:0};if(ws){if(ls){var Is,Vs=Ns==="y"?top:left,ks=Ns==="y"?bottom:right,Ps=Ns==="y"?"height":"width",Bs=ws[Ns],Ms=Bs+xs[Vs],Ws=Bs-xs[ks],Us=ys?-_s[Ps]/2:0,js=Ts===start?Es[Ps]:_s[Ps],Ls=Ts===start?-_s[Ps]:-Es[Ps],Gs=rs.elements.arrow,Hs=ys&&Gs?getLayoutRect(Gs):{width:0,height:0},Ys=rs.modifiersData["arrow#persistent"]?rs.modifiersData["arrow#persistent"].padding:getFreshSideObject(),Zs=Ys[Vs],Nl=Ys[ks],yl=within(0,Es[Ps],Hs[Ps]),Dl=Ss?Es[Ps]/2-Us-yl-Zs-Rs.mainAxis:js-yl-Zs-Rs.mainAxis,Rl=Ss?-Es[Ps]/2+Us+yl+Nl+Rs.mainAxis:Ls+yl+Nl+Rs.mainAxis,Ml=rs.elements.arrow&&getOffsetParent(rs.elements.arrow),Ks=Ml?Ns==="y"?Ml.clientTop||0:Ml.clientLeft||0:0,qs=(Is=Ds==null?void 0:Ds[Ns])!=null?Is:0,Qs=Bs+Dl-qs-Ks,Js=Bs+Rl-qs,El=within(ys?min(Ms,Qs):Ms,Bs,ys?max(Ws,Js):Ws);ws[Ns]=El,Os[Ns]=El-Bs}if(cs){var _l,Xs=Ns==="x"?top:left,xl=Ns==="x"?bottom:right,Al=ws[As],Sl=As==="y"?"height":"width",Vl=Al+xs[Xs],Fs=Al-xs[xl],Cl=[top,left].indexOf(Cs)!==-1,Tl=(_l=Ds==null?void 0:Ds[As])!=null?_l:0,zl=Cl?Vl:Al-Es[Sl]-_s[Sl]-Tl+Rs.altAxis,Xl=Cl?Al+Es[Sl]+_s[Sl]-Tl-Rs.altAxis:Fs,Pl=ys&&Cl?withinMaxClamp(zl,Al,Xl):within(ys?zl:Vl,Al,ys?Xl:Fs);ws[As]=Pl,Os[As]=Pl-Al}rs.modifiersData[ss]=Os}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(as){return{scrollLeft:as.scrollLeft,scrollTop:as.scrollTop}}function getNodeScroll(as){return as===getWindow$1(as)||!isHTMLElement$1(as)?getWindowScroll(as):getHTMLElementScroll(as)}function isElementScaled(as){var rs=as.getBoundingClientRect(),ns=round(rs.width)/as.offsetWidth||1,ss=round(rs.height)/as.offsetHeight||1;return ns!==1||ss!==1}function getCompositeRect(as,rs,ns){ns===void 0&&(ns=!1);var ss=isHTMLElement$1(rs),os=isHTMLElement$1(rs)&&isElementScaled(rs),ls=getDocumentElement(rs),us=getBoundingClientRect(as,os,ns),cs={scrollLeft:0,scrollTop:0},ds={x:0,y:0};return(ss||!ss&&!ns)&&((getNodeName(rs)!=="body"||isScrollParent(ls))&&(cs=getNodeScroll(rs)),isHTMLElement$1(rs)?(ds=getBoundingClientRect(rs,!0),ds.x+=rs.clientLeft,ds.y+=rs.clientTop):ls&&(ds.x=getWindowScrollBarX(ls))),{x:us.left+cs.scrollLeft-ds.x,y:us.top+cs.scrollTop-ds.y,width:us.width,height:us.height}}function order(as){var rs=new Map,ns=new Set,ss=[];as.forEach(function(ls){rs.set(ls.name,ls)});function os(ls){ns.add(ls.name);var us=[].concat(ls.requires||[],ls.requiresIfExists||[]);us.forEach(function(cs){if(!ns.has(cs)){var ds=rs.get(cs);ds&&os(ds)}}),ss.push(ls)}return as.forEach(function(ls){ns.has(ls.name)||os(ls)}),ss}function orderModifiers(as){var rs=order(as);return modifierPhases.reduce(function(ns,ss){return ns.concat(rs.filter(function(os){return os.phase===ss}))},[])}function debounce(as){var rs;return function(){return rs||(rs=new Promise(function(ns){Promise.resolve().then(function(){rs=void 0,ns(as())})})),rs}}function mergeByName(as){var rs=as.reduce(function(ns,ss){var os=ns[ss.name];return ns[ss.name]=os?Object.assign({},os,ss,{options:Object.assign({},os.options,ss.options),data:Object.assign({},os.data,ss.data)}):ss,ns},{});return Object.keys(rs).map(function(ns){return rs[ns]})}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var as=arguments.length,rs=new Array(as),ns=0;ns{}),Ss=reactExports.useCallback(()=>{var Rs;!rs||!bs.current||!vs.current||((Rs=Ts.current)==null||Rs.call(Ts),xs.current=createPopper(bs.current,vs.current,{placement:Cs,modifiers:[innerArrow,positionArrow,transformOrigin,{...matchWidth,enabled:!!gs},{name:"eventListeners",...getEventListenerOptions(us)},{name:"arrow",options:{padding:ls}},{name:"offset",options:{offset:cs??[0,ds]}},{name:"flip",enabled:!!ps,options:{padding:8}},{name:"preventOverflow",enabled:!!hs,options:{boundary:fs}},...ns??[]],strategy:os}),xs.current.forceUpdate(),Ts.current=xs.current.destroy)},[Cs,rs,ns,gs,us,ls,cs,ds,ps,hs,fs,os]);reactExports.useEffect(()=>()=>{var Rs;!bs.current&&!vs.current&&((Rs=xs.current)==null||Rs.destroy(),xs.current=null)},[]);const Ns=reactExports.useCallback(Rs=>{bs.current=Rs,Ss()},[Ss]),As=reactExports.useCallback((Rs={},Ds=null)=>({...Rs,ref:mergeRefs(Ns,Ds)}),[Ns]),ws=reactExports.useCallback(Rs=>{vs.current=Rs,Ss()},[Ss]),Es=reactExports.useCallback((Rs={},Ds=null)=>({...Rs,ref:mergeRefs(ws,Ds),style:{...Rs.style,position:os,minWidth:gs?void 0:"max-content",inset:"0 auto auto 0"}}),[os,ws,gs]),_s=reactExports.useCallback((Rs={},Ds=null)=>{const{size:Os,shadowColor:Is,bg:Vs,style:ks,...Ps}=Rs;return{...Ps,ref:Ds,"data-popper-arrow":"",style:getArrowStyle(Rs)}},[]),$s=reactExports.useCallback((Rs={},Ds=null)=>({...Rs,ref:Ds,"data-popper-arrow-inner":""}),[]);return{update(){var Rs;(Rs=xs.current)==null||Rs.update()},forceUpdate(){var Rs;(Rs=xs.current)==null||Rs.forceUpdate()},transformOrigin:cssVars.transformOrigin.varRef,referenceRef:Ns,popperRef:ws,getPopperProps:Es,getArrowProps:_s,getArrowInnerProps:$s,getReferenceProps:As}}function getArrowStyle(as){const{size:rs,shadowColor:ns,bg:ss,style:os}=as,ls={...os,position:"absolute"};return rs&&(ls["--popper-arrow-size"]=rs),ns&&(ls["--popper-arrow-shadow-color"]=ns),ss&&(ls["--popper-arrow-bg"]=ss),ls}function useDisclosure(as={}){const{onClose:rs,onOpen:ns,isOpen:ss,id:os}=as,ls=useCallbackRef(ns),us=useCallbackRef(rs),[cs,ds]=reactExports.useState(as.defaultIsOpen||!1),ps=ss!==void 0?ss:cs,fs=ss!==void 0,hs=reactExports.useId(),gs=os??`disclosure-${hs}`,ys=reactExports.useCallback(()=>{fs||ds(!1),us==null||us()},[fs,us]),bs=reactExports.useCallback(()=>{fs||ds(!0),ls==null||ls()},[fs,ls]),vs=reactExports.useCallback(()=>{ps?ys():bs()},[ps,bs,ys]);function xs(Ts={}){return{...Ts,"aria-expanded":ps,"aria-controls":gs,onClick(Ss){var Ns;(Ns=Ts.onClick)==null||Ns.call(Ts,Ss),vs()}}}function Cs(Ts={}){return{...Ts,hidden:!ps,id:gs}}return{isOpen:ps,onOpen:bs,onClose:ys,onToggle:vs,isControlled:fs,getButtonProps:xs,getDisclosureProps:Cs}}function useOutsideClick(as){const{ref:rs,handler:ns,enabled:ss=!0}=as,os=useCallbackRef(ns),us=reactExports.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;reactExports.useEffect(()=>{if(!ss)return;const cs=hs=>{isValidEvent(hs,rs)&&(us.isPointerDown=!0)},ds=hs=>{if(us.ignoreEmulatedMouseEvents){us.ignoreEmulatedMouseEvents=!1;return}us.isPointerDown&&ns&&isValidEvent(hs,rs)&&(us.isPointerDown=!1,os(hs))},ps=hs=>{us.ignoreEmulatedMouseEvents=!0,ns&&us.isPointerDown&&isValidEvent(hs,rs)&&(us.isPointerDown=!1,os(hs))},fs=getOwnerDocument$1(rs.current);return fs.addEventListener("mousedown",cs,!0),fs.addEventListener("mouseup",ds,!0),fs.addEventListener("touchstart",cs,!0),fs.addEventListener("touchend",ps,!0),()=>{fs.removeEventListener("mousedown",cs,!0),fs.removeEventListener("mouseup",ds,!0),fs.removeEventListener("touchstart",cs,!0),fs.removeEventListener("touchend",ps,!0)}},[ns,rs,os,us,ss])}function isValidEvent(as,rs){var ns;const ss=as.target;return as.button>0||ss&&!getOwnerDocument$1(ss).contains(ss)?!1:!((ns=rs.current)!=null&&ns.contains(ss))}function getOwnerDocument$1(as){var rs;return(rs=as==null?void 0:as.ownerDocument)!=null?rs:document}function useAnimationState(as){const{isOpen:rs,ref:ns}=as,[ss,os]=reactExports.useState(rs),[ls,us]=reactExports.useState(!1);return reactExports.useEffect(()=>{ls||(os(rs),us(!0))},[rs,ls,ss]),useEventListener(()=>ns.current,"animationend",()=>{os(rs)}),{present:!(rs?!1:!ss),onComplete(){var ds;const ps=getOwnerWindow(ns.current),fs=new ps.CustomEvent("animationend",{bubbles:!0});(ds=ns.current)==null||ds.dispatchEvent(fs)}}}function lazyDisclosure(as){const{wasSelected:rs,enabled:ns,isSelected:ss,mode:os="unmount"}=as;return!!(!ns||ss||os==="keepMounted"&&rs)}var[MenuDescendantsProvider,useMenuDescendantsContext,useMenuDescendants,useMenuDescendant]=createDescendantContext(),[MenuProvider,useMenuContext]=createContext$1({strict:!1,name:"MenuContext"});function useIds(as,...rs){const ns=reactExports.useId(),ss=as||ns;return reactExports.useMemo(()=>rs.map(os=>`${os}-${ss}`),[ss,rs])}function getOwnerDocument(as){var rs;return(rs=as==null?void 0:as.ownerDocument)!=null?rs:document}function isActiveElement(as){return getOwnerDocument(as).activeElement===as}function useMenu(as={}){const{id:rs,closeOnSelect:ns=!0,closeOnBlur:ss=!0,initialFocusRef:os,autoSelect:ls=!0,isLazy:us,isOpen:cs,defaultIsOpen:ds,onClose:ps,onOpen:fs,placement:hs="bottom-start",lazyBehavior:gs="unmount",direction:ys,computePositionOnMount:bs=!1,...vs}=as,xs=reactExports.useRef(null),Cs=reactExports.useRef(null),Ts=useMenuDescendants(),Ss=reactExports.useCallback(()=>{requestAnimationFrame(()=>{var Gs;(Gs=xs.current)==null||Gs.focus({preventScroll:!1})})},[]),Ns=reactExports.useCallback(()=>{const Gs=setTimeout(()=>{var Hs;if(os)(Hs=os.current)==null||Hs.focus();else{const Ys=Ts.firstEnabled();Ys&&Is(Ys.index)}});Ms.current.add(Gs)},[Ts,os]),As=reactExports.useCallback(()=>{const Gs=setTimeout(()=>{const Hs=Ts.lastEnabled();Hs&&Is(Hs.index)});Ms.current.add(Gs)},[Ts]),ws=reactExports.useCallback(()=>{fs==null||fs(),ls?Ns():Ss()},[ls,Ns,Ss,fs]),{isOpen:Es,onOpen:_s,onClose:$s,onToggle:Rs}=useDisclosure({isOpen:cs,defaultIsOpen:ds,onClose:ps,onOpen:ws});useOutsideClick({enabled:Es&&ss,ref:xs,handler:Gs=>{var Hs;(Hs=Cs.current)!=null&&Hs.contains(Gs.target)||$s()}});const Ds=usePopper({...vs,enabled:Es||bs,placement:hs,direction:ys}),[Os,Is]=reactExports.useState(-1);useUpdateEffect(()=>{Es||Is(-1)},[Es]),useFocusOnHide(xs,{focusRef:Cs,visible:Es,shouldFocus:!0});const Vs=useAnimationState({isOpen:Es,ref:xs}),[ks,Ps]=useIds(rs,"menu-button","menu-list"),Bs=reactExports.useCallback(()=>{_s(),Ss()},[_s,Ss]),Ms=reactExports.useRef(new Set([]));useUnmountEffect(()=>{Ms.current.forEach(Gs=>clearTimeout(Gs)),Ms.current.clear()});const Ws=reactExports.useCallback(()=>{_s(),Ns()},[Ns,_s]),Us=reactExports.useCallback(()=>{_s(),As()},[_s,As]),js=reactExports.useCallback(()=>{var Gs,Hs;const Ys=getOwnerDocument(xs.current),Zs=(Gs=xs.current)==null?void 0:Gs.contains(Ys.activeElement);if(!(Es&&!Zs))return;const yl=(Hs=Ts.item(Os))==null?void 0:Hs.node;yl==null||yl.focus()},[Es,Os,Ts]),Ls=reactExports.useRef(null);return{openAndFocusMenu:Bs,openAndFocusFirstItem:Ws,openAndFocusLastItem:Us,onTransitionEnd:js,unstable__animationState:Vs,descendants:Ts,popper:Ds,buttonId:ks,menuId:Ps,forceUpdate:Ds.forceUpdate,orientation:"vertical",isOpen:Es,onToggle:Rs,onOpen:_s,onClose:$s,menuRef:xs,buttonRef:Cs,focusedIndex:Os,closeOnSelect:ns,closeOnBlur:ss,autoSelect:ls,setFocusedIndex:Is,isLazy:us,lazyBehavior:gs,initialFocusRef:os,rafId:Ls}}function useMenuButton(as={},rs=null){const ns=useMenuContext(),{onToggle:ss,popper:os,openAndFocusFirstItem:ls,openAndFocusLastItem:us}=ns,cs=reactExports.useCallback(ds=>{const ps=ds.key,hs={Enter:ls,ArrowDown:ls,ArrowUp:us}[ps];hs&&(ds.preventDefault(),ds.stopPropagation(),hs(ds))},[ls,us]);return{...as,ref:mergeRefs(ns.buttonRef,rs,os.referenceRef),id:ns.buttonId,"data-active":dataAttr(ns.isOpen),"aria-expanded":ns.isOpen,"aria-haspopup":"menu","aria-controls":ns.menuId,onClick:callAllHandlers(as.onClick,ss),onKeyDown:callAllHandlers(as.onKeyDown,cs)}}function isTargetMenuItem(as){var rs;return isHTMLElement(as)&&!!((rs=as==null?void 0:as.getAttribute("role"))!=null&&rs.startsWith("menuitem"))}function useMenuList(as={},rs=null){const ns=useMenuContext();if(!ns)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within ");const{focusedIndex:ss,setFocusedIndex:os,menuRef:ls,isOpen:us,onClose:cs,menuId:ds,isLazy:ps,lazyBehavior:fs,unstable__animationState:hs}=ns,gs=useMenuDescendantsContext(),ys=useShortcut({preventDefault:Cs=>Cs.key!==" "&&isTargetMenuItem(Cs.target)}),bs=reactExports.useCallback(Cs=>{const Ts=Cs.key,Ns={Tab:ws=>ws.preventDefault(),Escape:cs,ArrowDown:()=>{const ws=gs.nextEnabled(ss);ws&&os(ws.index)},ArrowUp:()=>{const ws=gs.prevEnabled(ss);ws&&os(ws.index)}}[Ts];if(Ns){Cs.preventDefault(),Ns(Cs);return}const As=ys(ws=>{const Es=getNextItemFromSearch(gs.values(),ws,_s=>{var $s,Rs;return(Rs=($s=_s==null?void 0:_s.node)==null?void 0:$s.textContent)!=null?Rs:""},gs.item(ss));if(Es){const _s=gs.indexOf(Es.node);os(_s)}});isTargetMenuItem(Cs.target)&&As(Cs)},[gs,ss,ys,cs,os]),vs=reactExports.useRef(!1);us&&(vs.current=!0);const xs=lazyDisclosure({wasSelected:vs.current,enabled:ps,mode:fs,isSelected:hs.present});return{...as,ref:mergeRefs(ls,rs),children:xs?as.children:null,tabIndex:-1,role:"menu",id:ds,style:{...as.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:callAllHandlers(as.onKeyDown,bs)}}function useMenuPositioner(as={}){const{popper:rs,isOpen:ns}=useMenuContext();return rs.getPopperProps({...as,style:{visibility:ns?"visible":"hidden",...as.style}})}function useMenuItem(as={},rs=null){const{onMouseEnter:ns,onMouseMove:ss,onMouseLeave:os,onClick:ls,onFocus:us,isDisabled:cs,isFocusable:ds,closeOnSelect:ps,type:fs,...hs}=as,gs=useMenuContext(),{setFocusedIndex:ys,focusedIndex:bs,closeOnSelect:vs,onClose:xs,menuRef:Cs,isOpen:Ts,menuId:Ss,rafId:Ns}=gs,As=reactExports.useRef(null),ws=`${Ss}-menuitem-${reactExports.useId()}`,{index:Es,register:_s}=useMenuDescendant({disabled:cs&&!ds}),$s=reactExports.useCallback(Bs=>{ns==null||ns(Bs),!cs&&ys(Es)},[ys,Es,cs,ns]),Rs=reactExports.useCallback(Bs=>{ss==null||ss(Bs),As.current&&!isActiveElement(As.current)&&$s(Bs)},[$s,ss]),Ds=reactExports.useCallback(Bs=>{os==null||os(Bs),!cs&&ys(-1)},[ys,cs,os]),Os=reactExports.useCallback(Bs=>{ls==null||ls(Bs),isTargetMenuItem(Bs.currentTarget)&&(ps??vs)&&xs()},[xs,ls,vs,ps]),Is=reactExports.useCallback(Bs=>{us==null||us(Bs),ys(Es)},[ys,us,Es]),Vs=Es===bs,ks=cs&&!ds;useUpdateEffect(()=>{Ts&&(Vs&&!ks&&As.current?(Ns.current&&cancelAnimationFrame(Ns.current),Ns.current=requestAnimationFrame(()=>{var Bs;(Bs=As.current)==null||Bs.focus(),Ns.current=null})):Cs.current&&!isActiveElement(Cs.current)&&Cs.current.focus())},[Vs,ks,Cs,Ts]);const Ps=useClickable({onClick:Os,onFocus:Is,onMouseEnter:$s,onMouseMove:Rs,onMouseLeave:Ds,ref:mergeRefs(_s,As,rs),isDisabled:cs,isFocusable:ds});return{...hs,...Ps,type:fs??Ps.type,id:ws,role:"menuitem",tabIndex:Vs?0:-1}}function isHTMLElement(as){var rs;if(!isElement(as))return!1;const ns=(rs=as.ownerDocument.defaultView)!=null?rs:window;return as instanceof ns.HTMLElement}function isElement(as){return as!=null&&typeof as=="object"&&"nodeType"in as&&as.nodeType===Node.ELEMENT_NODE}function useUnmountEffect(as,rs=[]){return reactExports.useEffect(()=>()=>as(),rs)}var[MenuStylesProvider,useMenuStyles]=createContext$1({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Menu=as=>{const{children:rs}=as,ns=useMultiStyleConfig("Menu",as),ss=omitThemingProps(as),{direction:os}=useTheme(),{descendants:ls,...us}=useMenu({...ss,direction:os}),cs=reactExports.useMemo(()=>us,[us]),{isOpen:ds,onClose:ps,forceUpdate:fs}=cs;return jsx$1(MenuDescendantsProvider,{value:ls,children:jsx$1(MenuProvider,{value:cs,children:jsx$1(MenuStylesProvider,{value:ns,children:runIfFn$2(rs,{isOpen:ds,onClose:ps,forceUpdate:fs})})})})};Menu.displayName="Menu";var MenuCommand=forwardRef((as,rs)=>{const ns=useMenuStyles();return jsx$1(chakra.span,{ref:rs,...as,__css:ns.command,className:"chakra-menu__command"})});MenuCommand.displayName="MenuCommand";var StyledMenuItem$1=forwardRef((as,rs)=>{const{type:ns,...ss}=as,os=useMenuStyles(),ls=ss.as||ns?ns??void 0:"button",us=reactExports.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...os.item}),[os.item]);return jsx$1(chakra.button,{ref:rs,type:ls,...ss,__css:us})}),MenuIcon=as=>{const{className:rs,children:ns,...ss}=as,os=reactExports.Children.only(ns),ls=reactExports.isValidElement(os)?reactExports.cloneElement(os,{focusable:"false","aria-hidden":!0,className:cx("chakra-menu__icon",os.props.className)}):null,us=cx("chakra-menu__icon-wrapper",rs);return jsx$1(chakra.span,{className:us,...ss,__css:{flexShrink:0},children:ls})};MenuIcon.displayName="MenuIcon";var MenuItem$1=forwardRef((as,rs)=>{const{icon:ns,iconSpacing:ss="0.75rem",command:os,commandSpacing:ls="0.75rem",children:us,...cs}=as,ds=useMenuItem(cs,rs),fs=ns||os?jsx$1("span",{style:{pointerEvents:"none",flex:1},children:us}):us;return jsxs(StyledMenuItem$1,{...ds,className:cx("chakra-menu__menuitem",ds.className),children:[ns&&jsx$1(MenuIcon,{fontSize:"0.8em",marginEnd:ss,children:ns}),fs,os&&jsx$1(MenuCommand,{marginStart:ls,children:os})]})});MenuItem$1.displayName="MenuItem";var motionVariants={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},MenuTransition=chakra(motion.div),MenuList=forwardRef(function as(rs,ns){var ss,os;const{rootProps:ls,motionProps:us,...cs}=rs,{isOpen:ds,onTransitionEnd:ps,unstable__animationState:fs}=useMenuContext(),hs=useMenuList(cs,ns),gs=useMenuPositioner(ls),ys=useMenuStyles();return jsx$1(chakra.div,{...gs,__css:{zIndex:(os=rs.zIndex)!=null?os:(ss=ys.list)==null?void 0:ss.zIndex},children:jsx$1(MenuTransition,{variants:motionVariants,initial:!1,animate:ds?"enter":"exit",__css:{outline:0,...ys.list},...us,className:cx("chakra-menu__menu-list",hs.className),...hs,onUpdate:ps,onAnimationComplete:callAll(fs.onComplete,hs.onAnimationComplete)})})});MenuList.displayName="MenuList";var StyledMenuButton=forwardRef((as,rs)=>{const ns=useMenuStyles();return jsx$1(chakra.button,{ref:rs,...as,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...ns.button}})}),MenuButton=forwardRef((as,rs)=>{const{children:ns,as:ss,...os}=as,ls=useMenuButton(os,rs);return jsx$1(ss||StyledMenuButton,{...ls,className:cx("chakra-menu__menu-button",as.className),children:jsx$1(chakra.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:as.children})})});MenuButton.displayName="MenuButton";var[TabsDescendantsProvider,useTabsDescendantsContext,useTabsDescendants,useTabsDescendant]=createDescendantContext();function useTabs(as){var rs;const{defaultIndex:ns,onChange:ss,index:os,isManual:ls,isLazy:us,lazyBehavior:cs="unmount",orientation:ds="horizontal",direction:ps="ltr",...fs}=as,[hs,gs]=reactExports.useState(ns??0),[ys,bs]=useControllableState({defaultValue:ns??0,value:os,onChange:ss});reactExports.useEffect(()=>{os!=null&&gs(os)},[os]);const vs=useTabsDescendants(),xs=reactExports.useId();return{id:`tabs-${(rs=as.id)!=null?rs:xs}`,selectedIndex:ys,focusedIndex:hs,setSelectedIndex:bs,setFocusedIndex:gs,isManual:ls,isLazy:us,lazyBehavior:cs,orientation:ds,descendants:vs,direction:ps,htmlProps:fs}}var[TabsProvider,useTabsContext]=createContext$1({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function useTabList(as){const{focusedIndex:rs,orientation:ns,direction:ss}=useTabsContext(),os=useTabsDescendantsContext(),ls=reactExports.useCallback(us=>{const cs=()=>{var Ts;const Ss=os.nextEnabled(rs);Ss&&((Ts=Ss.node)==null||Ts.focus())},ds=()=>{var Ts;const Ss=os.prevEnabled(rs);Ss&&((Ts=Ss.node)==null||Ts.focus())},ps=()=>{var Ts;const Ss=os.firstEnabled();Ss&&((Ts=Ss.node)==null||Ts.focus())},fs=()=>{var Ts;const Ss=os.lastEnabled();Ss&&((Ts=Ss.node)==null||Ts.focus())},hs=ns==="horizontal",gs=ns==="vertical",ys=us.key,bs=ss==="ltr"?"ArrowLeft":"ArrowRight",vs=ss==="ltr"?"ArrowRight":"ArrowLeft",Cs={[bs]:()=>hs&&ds(),[vs]:()=>hs&&cs(),ArrowDown:()=>gs&&cs(),ArrowUp:()=>gs&&ds(),Home:ps,End:fs}[ys];Cs&&(us.preventDefault(),Cs(us))},[os,rs,ns,ss]);return{...as,role:"tablist","aria-orientation":ns,onKeyDown:callAllHandlers(as.onKeyDown,ls)}}function useTab(as){const{isDisabled:rs,isFocusable:ns,...ss}=as,{setSelectedIndex:os,isManual:ls,id:us,setFocusedIndex:cs,selectedIndex:ds}=useTabsContext(),{index:ps,register:fs}=useTabsDescendant({disabled:rs&&!ns}),hs=ps===ds,gs=()=>{os(ps)},ys=()=>{cs(ps),!ls&&!(rs&&ns)&&os(ps)},bs=useClickable({...ss,ref:mergeRefs(fs,as.ref),isDisabled:rs,isFocusable:ns,onClick:callAllHandlers(as.onClick,gs)}),vs="button";return{...bs,id:makeTabId(us,ps),role:"tab",tabIndex:hs?0:-1,type:vs,"aria-selected":hs,"aria-controls":makeTabPanelId(us,ps),onFocus:rs?void 0:callAllHandlers(as.onFocus,ys)}}var[TabPanelProvider,useTabPanelContext]=createContext$1({});function useTabPanels(as){const rs=useTabsContext(),{id:ns,selectedIndex:ss}=rs,ls=getValidChildren(as.children).map((us,cs)=>reactExports.createElement(TabPanelProvider,{key:cs,value:{isSelected:cs===ss,id:makeTabPanelId(ns,cs),tabId:makeTabId(ns,cs),selectedIndex:ss}},us));return{...as,children:ls}}function useTabPanel(as){const{children:rs,...ns}=as,{isLazy:ss,lazyBehavior:os}=useTabsContext(),{isSelected:ls,id:us,tabId:cs}=useTabPanelContext(),ds=reactExports.useRef(!1);ls&&(ds.current=!0);const ps=lazyDisclosure({wasSelected:ds.current,isSelected:ls,enabled:ss,mode:os});return{tabIndex:0,...ns,children:ps?rs:null,role:"tabpanel","aria-labelledby":cs,hidden:!ls,id:us}}function makeTabId(as,rs){return`${as}--tab-${rs}`}function makeTabPanelId(as,rs){return`${as}--tabpanel-${rs}`}var[TabsStylesProvider,useTabsStyles]=createContext$1({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Tabs=forwardRef(function as(rs,ns){const ss=useMultiStyleConfig("Tabs",rs),{children:os,className:ls,...us}=omitThemingProps(rs),{htmlProps:cs,descendants:ds,...ps}=useTabs(us),fs=reactExports.useMemo(()=>ps,[ps]),{isFitted:hs,...gs}=cs;return jsx$1(TabsDescendantsProvider,{value:ds,children:jsx$1(TabsProvider,{value:fs,children:jsx$1(TabsStylesProvider,{value:ss,children:jsx$1(chakra.div,{className:cx("chakra-tabs",ls),ref:ns,...gs,__css:ss.root,children:os})})})})});Tabs.displayName="Tabs";var TabList=forwardRef(function as(rs,ns){const ss=useTabList({...rs,ref:ns}),ls={display:"flex",...useTabsStyles().tablist};return jsx$1(chakra.div,{...ss,className:cx("chakra-tabs__tablist",rs.className),__css:ls})});TabList.displayName="TabList";var TabPanel=forwardRef(function as(rs,ns){const ss=useTabPanel({...rs,ref:ns}),os=useTabsStyles();return jsx$1(chakra.div,{outline:"0",...ss,className:cx("chakra-tabs__tab-panel",rs.className),__css:os.tabpanel})});TabPanel.displayName="TabPanel";var TabPanels=forwardRef(function as(rs,ns){const ss=useTabPanels(rs),os=useTabsStyles();return jsx$1(chakra.div,{...ss,width:"100%",ref:ns,className:cx("chakra-tabs__tab-panels",rs.className),__css:os.tabpanels})});TabPanels.displayName="TabPanels";var Tab=forwardRef(function as(rs,ns){const ss=useTabsStyles(),os=useTab({...rs,ref:ns}),ls={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...ss.tab};return jsx$1(chakra.button,{...os,className:cx("chakra-tabs__tab",rs.className),__css:ls})});Tab.displayName="Tab";var scale={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},getDoc=as=>{var rs;return((rs=as.current)==null?void 0:rs.ownerDocument)||document},getWin=as=>{var rs,ns;return((ns=(rs=as.current)==null?void 0:rs.ownerDocument)==null?void 0:ns.defaultView)||window};function useTooltip(as={}){const{openDelay:rs=0,closeDelay:ns=0,closeOnClick:ss=!0,closeOnMouseDown:os,closeOnScroll:ls,closeOnPointerDown:us=os,closeOnEsc:cs=!0,onOpen:ds,onClose:ps,placement:fs,id:hs,isOpen:gs,defaultIsOpen:ys,arrowSize:bs=10,arrowShadowColor:vs,arrowPadding:xs,modifiers:Cs,isDisabled:Ts,gutter:Ss,offset:Ns,direction:As,...ws}=as,{isOpen:Es,onOpen:_s,onClose:$s}=useDisclosure({isOpen:gs,defaultIsOpen:ys,onOpen:ds,onClose:ps}),{referenceRef:Rs,getPopperProps:Ds,getArrowInnerProps:Os,getArrowProps:Is}=usePopper({enabled:Es,placement:fs,arrowPadding:xs,modifiers:Cs,gutter:Ss,offset:Ns,direction:As}),Vs=reactExports.useId(),Ps=`tooltip-${hs??Vs}`,Bs=reactExports.useRef(null),Ms=reactExports.useRef(),Ws=reactExports.useCallback(()=>{Ms.current&&(clearTimeout(Ms.current),Ms.current=void 0)},[]),Us=reactExports.useRef(),js=reactExports.useCallback(()=>{Us.current&&(clearTimeout(Us.current),Us.current=void 0)},[]),Ls=reactExports.useCallback(()=>{js(),$s()},[$s,js]),Gs=useCloseEvent(Bs,Ls),Hs=reactExports.useCallback(()=>{if(!Ts&&!Ms.current){Gs();const Ks=getWin(Bs);Ms.current=Ks.setTimeout(_s,rs)}},[Gs,Ts,_s,rs]),Ys=reactExports.useCallback(()=>{Ws();const Ks=getWin(Bs);Us.current=Ks.setTimeout(Ls,ns)},[ns,Ls,Ws]),Zs=reactExports.useCallback(()=>{Es&&ss&&Ys()},[ss,Ys,Es]),Nl=reactExports.useCallback(()=>{Es&&us&&Ys()},[us,Ys,Es]),yl=reactExports.useCallback(Ks=>{Es&&Ks.key==="Escape"&&Ys()},[Es,Ys]);useEventListener(()=>getDoc(Bs),"keydown",cs?yl:void 0),useEventListener(()=>getDoc(Bs),"scroll",()=>{Es&&ls&&Ls()}),reactExports.useEffect(()=>{Ts&&(Ws(),Es&&$s())},[Ts,Es,$s,Ws]),reactExports.useEffect(()=>()=>{Ws(),js()},[Ws,js]),useEventListener(()=>Bs.current,"pointerleave",Ys);const Dl=reactExports.useCallback((Ks={},qs=null)=>({...Ks,ref:mergeRefs(Bs,qs,Rs),onPointerEnter:callAllHandlers(Ks.onPointerEnter,Js=>{Js.pointerType!=="touch"&&Hs()}),onClick:callAllHandlers(Ks.onClick,Zs),onPointerDown:callAllHandlers(Ks.onPointerDown,Nl),onFocus:callAllHandlers(Ks.onFocus,Hs),onBlur:callAllHandlers(Ks.onBlur,Ys),"aria-describedby":Es?Ps:void 0}),[Hs,Ys,Nl,Es,Ps,Zs,Rs]),Rl=reactExports.useCallback((Ks={},qs=null)=>Ds({...Ks,style:{...Ks.style,[cssVars.arrowSize.var]:bs?`${bs}px`:void 0,[cssVars.arrowShadowColor.var]:vs}},qs),[Ds,bs,vs]),Ml=reactExports.useCallback((Ks={},qs=null)=>{const Qs={...Ks.style,position:"relative",transformOrigin:cssVars.transformOrigin.varRef};return{ref:qs,...ws,...Ks,id:Ps,role:"tooltip",style:Qs}},[ws,Ps]);return{isOpen:Es,show:Hs,hide:Ys,getTriggerProps:Dl,getTooltipProps:Ml,getTooltipPositionerProps:Rl,getArrowProps:Is,getArrowInnerProps:Os}}var closeEventName="chakra-ui:close-tooltip";function useCloseEvent(as,rs){return reactExports.useEffect(()=>{const ns=getDoc(as);return ns.addEventListener(closeEventName,rs),()=>ns.removeEventListener(closeEventName,rs)},[rs,as]),()=>{const ns=getDoc(as),ss=getWin(as);ns.dispatchEvent(new ss.CustomEvent(closeEventName))}}function omit(as,rs=[]){const ns=Object.assign({},as);for(const ss of rs)ss in ns&&delete ns[ss];return ns}function pick$1(as,rs){const ns={};for(const ss of rs)ss in as&&(ns[ss]=as[ss]);return ns}var MotionDiv=chakra(motion.div),Tooltip=forwardRef((as,rs)=>{var ns,ss;const os=useStyleConfig("Tooltip",as),ls=omitThemingProps(as),us=useTheme(),{children:cs,label:ds,shouldWrapChildren:ps,"aria-label":fs,hasArrow:hs,bg:gs,portalProps:ys,background:bs,backgroundColor:vs,bgColor:xs,motionProps:Cs,...Ts}=ls,Ss=(ss=(ns=bs??vs)!=null?ns:gs)!=null?ss:xs;if(Ss){os.bg=Ss;const Ds=getCSSVar(us,"colors",Ss);os[cssVars.arrowBg.var]=Ds}const Ns=useTooltip({...Ts,direction:us.direction}),As=typeof cs=="string"||ps;let ws;if(As)ws=jsx$1(chakra.span,{display:"inline-block",tabIndex:0,...Ns.getTriggerProps(),children:cs});else{const Ds=reactExports.Children.only(cs);ws=reactExports.cloneElement(Ds,Ns.getTriggerProps(Ds.props,Ds.ref))}const Es=!!fs,_s=Ns.getTooltipProps({},rs),$s=Es?omit(_s,["role","id"]):_s,Rs=pick$1(_s,["role","id"]);return ds?jsxs(Fragment,{children:[ws,jsx$1(AnimatePresence,{children:Ns.isOpen&&jsx$1(Portal,{...ys,children:jsx$1(chakra.div,{...Ns.getTooltipPositionerProps(),__css:{zIndex:os.zIndex,pointerEvents:"none"},children:jsxs(MotionDiv,{variants:scale,initial:"exit",animate:"enter",exit:"exit",...Cs,...$s,__css:os,children:[ds,Es&&jsx$1(chakra.span,{srOnly:!0,...Rs,children:fs}),hs&&jsx$1(chakra.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:jsx$1(chakra.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:os.bg}})})]})})})})]}):jsx$1(Fragment,{children:cs})});Tooltip.displayName="Tooltip";function isObject$5(as){return as!==null&&typeof as=="object"&&"constructor"in as&&as.constructor===Object}function extend$2(as={},rs={}){Object.keys(rs).forEach(ns=>{typeof as[ns]>"u"?as[ns]=rs[ns]:isObject$5(rs[ns])&&isObject$5(as[ns])&&Object.keys(rs[ns]).length>0&&extend$2(as[ns],rs[ns])})}const ssrDocument={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function getDocument(){const as=typeof document<"u"?document:{};return extend$2(as,ssrDocument),as}const ssrWindow={document:ssrDocument,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function as(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(as){return typeof setTimeout>"u"?(as(),null):setTimeout(as,0)},cancelAnimationFrame(as){typeof setTimeout>"u"||clearTimeout(as)}};function getWindow(){const as=typeof window<"u"?window:{};return extend$2(as,ssrWindow),as}function deleteProps(as){const rs=as;Object.keys(rs).forEach(ns=>{try{rs[ns]=null}catch{}try{delete rs[ns]}catch{}})}function nextTick(as,rs=0){return setTimeout(as,rs)}function now(){return Date.now()}function getComputedStyle$1(as){const rs=getWindow();let ns;return rs.getComputedStyle&&(ns=rs.getComputedStyle(as,null)),!ns&&as.currentStyle&&(ns=as.currentStyle),ns||(ns=as.style),ns}function getTranslate(as,rs="x"){const ns=getWindow();let ss,os,ls;const us=getComputedStyle$1(as);return ns.WebKitCSSMatrix?(os=us.transform||us.webkitTransform,os.split(",").length>6&&(os=os.split(", ").map(cs=>cs.replace(",",".")).join(", ")),ls=new ns.WebKitCSSMatrix(os==="none"?"":os)):(ls=us.MozTransform||us.OTransform||us.MsTransform||us.msTransform||us.transform||us.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),ss=ls.toString().split(",")),rs==="x"&&(ns.WebKitCSSMatrix?os=ls.m41:ss.length===16?os=parseFloat(ss[12]):os=parseFloat(ss[4])),rs==="y"&&(ns.WebKitCSSMatrix?os=ls.m42:ss.length===16?os=parseFloat(ss[13]):os=parseFloat(ss[5])),os||0}function isObject$4(as){return typeof as=="object"&&as!==null&&as.constructor&&Object.prototype.toString.call(as).slice(8,-1)==="Object"}function isNode$1(as){return typeof window<"u"&&typeof window.HTMLElement<"u"?as instanceof HTMLElement:as&&(as.nodeType===1||as.nodeType===11)}function extend$1(...as){const rs=Object(as[0]),ns=["__proto__","constructor","prototype"];for(let ss=1;ssns.indexOf(us)<0);for(let us=0,cs=ls.length;usos?"next":"prev",ps=(hs,gs)=>ds==="next"&&hs>=gs||ds==="prev"&&hs<=gs,fs=()=>{us=new Date().getTime(),ls===null&&(ls=us);const hs=Math.max(Math.min((us-ls)/cs,1),0),gs=.5-Math.cos(hs*Math.PI)/2;let ys=os+gs*(rs-os);if(ps(ys,rs)&&(ys=rs),as.wrapperEl.scrollTo({[ns]:ys}),ps(ys,rs)){as.wrapperEl.style.overflow="hidden",as.wrapperEl.style.scrollSnapType="",setTimeout(()=>{as.wrapperEl.style.overflow="",as.wrapperEl.scrollTo({[ns]:ys})}),ss.cancelAnimationFrame(as.cssModeFrameID);return}as.cssModeFrameID=ss.requestAnimationFrame(fs)};fs()}function elementChildren(as,rs=""){return[...as.children].filter(ns=>ns.matches(rs))}function createElement(as,rs=[]){const ns=document.createElement(as);return ns.classList.add(...Array.isArray(rs)?rs:[rs]),ns}function elementOffset(as){const rs=getWindow(),ns=getDocument(),ss=as.getBoundingClientRect(),os=ns.body,ls=as.clientTop||os.clientTop||0,us=as.clientLeft||os.clientLeft||0,cs=as===rs?rs.scrollY:as.scrollTop,ds=as===rs?rs.scrollX:as.scrollLeft;return{top:ss.top+cs-ls,left:ss.left+ds-us}}function elementPrevAll(as,rs){const ns=[];for(;as.previousElementSibling;){const ss=as.previousElementSibling;rs?ss.matches(rs)&&ns.push(ss):ns.push(ss),as=ss}return ns}function elementNextAll(as,rs){const ns=[];for(;as.nextElementSibling;){const ss=as.nextElementSibling;rs?ss.matches(rs)&&ns.push(ss):ns.push(ss),as=ss}return ns}function elementStyle(as,rs){return getWindow().getComputedStyle(as,null).getPropertyValue(rs)}function elementIndex(as){let rs=as,ns;if(rs){for(ns=0;(rs=rs.previousSibling)!==null;)rs.nodeType===1&&(ns+=1);return ns}}function elementParents(as,rs){const ns=[];let ss=as.parentElement;for(;ss;)rs?ss.matches(rs)&&ns.push(ss):ns.push(ss),ss=ss.parentElement;return ns}function elementOuterSize(as,rs,ns){const ss=getWindow();return ns?as[rs==="width"?"offsetWidth":"offsetHeight"]+parseFloat(ss.getComputedStyle(as,null).getPropertyValue(rs==="width"?"margin-right":"margin-top"))+parseFloat(ss.getComputedStyle(as,null).getPropertyValue(rs==="width"?"margin-left":"margin-bottom")):as.offsetWidth}let support;function calcSupport(){const as=getWindow(),rs=getDocument();return{smoothScroll:rs.documentElement&&"scrollBehavior"in rs.documentElement.style,touch:!!("ontouchstart"in as||as.DocumentTouch&&rs instanceof as.DocumentTouch)}}function getSupport(){return support||(support=calcSupport()),support}let deviceCached;function calcDevice({userAgent:as}={}){const rs=getSupport(),ns=getWindow(),ss=ns.navigator.platform,os=as||ns.navigator.userAgent,ls={ios:!1,android:!1},us=ns.screen.width,cs=ns.screen.height,ds=os.match(/(Android);?[\s\/]+([\d.]+)?/);let ps=os.match(/(iPad).*OS\s([\d_]+)/);const fs=os.match(/(iPod)(.*OS\s([\d_]+))?/),hs=!ps&&os.match(/(iPhone\sOS|iOS)\s([\d_]+)/),gs=ss==="Win32";let ys=ss==="MacIntel";const bs=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!ps&&ys&&rs.touch&&bs.indexOf(`${us}x${cs}`)>=0&&(ps=os.match(/(Version)\/([\d.]+)/),ps||(ps=[0,1,"13_0_0"]),ys=!1),ds&&!gs&&(ls.os="android",ls.android=!0),(ps||hs||fs)&&(ls.os="ios",ls.ios=!0),ls}function getDevice(as={}){return deviceCached||(deviceCached=calcDevice(as)),deviceCached}let browser;function calcBrowser(){const as=getWindow();let rs=!1;function ns(){const ss=as.navigator.userAgent.toLowerCase();return ss.indexOf("safari")>=0&&ss.indexOf("chrome")<0&&ss.indexOf("android")<0}if(ns()){const ss=String(as.navigator.userAgent);if(ss.includes("Version/")){const[os,ls]=ss.split("Version/")[1].split(" ")[0].split(".").map(us=>Number(us));rs=os<16||os===16&&ls<2}}return{isSafari:rs||ns(),needPerspectiveFix:rs,isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(as.navigator.userAgent)}}function getBrowser(){return browser||(browser=calcBrowser()),browser}function Resize({swiper:as,on:rs,emit:ns}){const ss=getWindow();let os=null,ls=null;const us=()=>{!as||as.destroyed||!as.initialized||(ns("beforeResize"),ns("resize"))},cs=()=>{!as||as.destroyed||!as.initialized||(os=new ResizeObserver(fs=>{ls=ss.requestAnimationFrame(()=>{const{width:hs,height:gs}=as;let ys=hs,bs=gs;fs.forEach(({contentBoxSize:vs,contentRect:xs,target:Cs})=>{Cs&&Cs!==as.el||(ys=xs?xs.width:(vs[0]||vs).inlineSize,bs=xs?xs.height:(vs[0]||vs).blockSize)}),(ys!==hs||bs!==gs)&&us()})}),os.observe(as.el))},ds=()=>{ls&&ss.cancelAnimationFrame(ls),os&&os.unobserve&&as.el&&(os.unobserve(as.el),os=null)},ps=()=>{!as||as.destroyed||!as.initialized||ns("orientationchange")};rs("init",()=>{if(as.params.resizeObserver&&typeof ss.ResizeObserver<"u"){cs();return}ss.addEventListener("resize",us),ss.addEventListener("orientationchange",ps)}),rs("destroy",()=>{ds(),ss.removeEventListener("resize",us),ss.removeEventListener("orientationchange",ps)})}function Observer({swiper:as,extendParams:rs,on:ns,emit:ss}){const os=[],ls=getWindow(),us=(ps,fs={})=>{const hs=ls.MutationObserver||ls.WebkitMutationObserver,gs=new hs(ys=>{if(ys.length===1){ss("observerUpdate",ys[0]);return}const bs=function(){ss("observerUpdate",ys[0])};ls.requestAnimationFrame?ls.requestAnimationFrame(bs):ls.setTimeout(bs,0)});gs.observe(ps,{attributes:typeof fs.attributes>"u"?!0:fs.attributes,childList:typeof fs.childList>"u"?!0:fs.childList,characterData:typeof fs.characterData>"u"?!0:fs.characterData}),os.push(gs)},cs=()=>{if(as.params.observer){if(as.params.observeParents){const ps=elementParents(as.el);for(let fs=0;fs{os.forEach(ps=>{ps.disconnect()}),os.splice(0,os.length)};rs({observer:!1,observeParents:!1,observeSlideChildren:!1}),ns("init",cs),ns("destroy",ds)}const eventsEmitter={on(as,rs,ns){const ss=this;if(!ss.eventsListeners||ss.destroyed||typeof rs!="function")return ss;const os=ns?"unshift":"push";return as.split(" ").forEach(ls=>{ss.eventsListeners[ls]||(ss.eventsListeners[ls]=[]),ss.eventsListeners[ls][os](rs)}),ss},once(as,rs,ns){const ss=this;if(!ss.eventsListeners||ss.destroyed||typeof rs!="function")return ss;function os(...ls){ss.off(as,os),os.__emitterProxy&&delete os.__emitterProxy,rs.apply(ss,ls)}return os.__emitterProxy=rs,ss.on(as,os,ns)},onAny(as,rs){const ns=this;if(!ns.eventsListeners||ns.destroyed||typeof as!="function")return ns;const ss=rs?"unshift":"push";return ns.eventsAnyListeners.indexOf(as)<0&&ns.eventsAnyListeners[ss](as),ns},offAny(as){const rs=this;if(!rs.eventsListeners||rs.destroyed||!rs.eventsAnyListeners)return rs;const ns=rs.eventsAnyListeners.indexOf(as);return ns>=0&&rs.eventsAnyListeners.splice(ns,1),rs},off(as,rs){const ns=this;return!ns.eventsListeners||ns.destroyed||!ns.eventsListeners||as.split(" ").forEach(ss=>{typeof rs>"u"?ns.eventsListeners[ss]=[]:ns.eventsListeners[ss]&&ns.eventsListeners[ss].forEach((os,ls)=>{(os===rs||os.__emitterProxy&&os.__emitterProxy===rs)&&ns.eventsListeners[ss].splice(ls,1)})}),ns},emit(...as){const rs=this;if(!rs.eventsListeners||rs.destroyed||!rs.eventsListeners)return rs;let ns,ss,os;return typeof as[0]=="string"||Array.isArray(as[0])?(ns=as[0],ss=as.slice(1,as.length),os=rs):(ns=as[0].events,ss=as[0].data,os=as[0].context||rs),ss.unshift(os),(Array.isArray(ns)?ns:ns.split(" ")).forEach(us=>{rs.eventsAnyListeners&&rs.eventsAnyListeners.length&&rs.eventsAnyListeners.forEach(cs=>{cs.apply(os,[us,...ss])}),rs.eventsListeners&&rs.eventsListeners[us]&&rs.eventsListeners[us].forEach(cs=>{cs.apply(os,ss)})}),rs}};function updateSize(){const as=this;let rs,ns;const ss=as.el;typeof as.params.width<"u"&&as.params.width!==null?rs=as.params.width:rs=ss.clientWidth,typeof as.params.height<"u"&&as.params.height!==null?ns=as.params.height:ns=ss.clientHeight,!(rs===0&&as.isHorizontal()||ns===0&&as.isVertical())&&(rs=rs-parseInt(elementStyle(ss,"padding-left")||0,10)-parseInt(elementStyle(ss,"padding-right")||0,10),ns=ns-parseInt(elementStyle(ss,"padding-top")||0,10)-parseInt(elementStyle(ss,"padding-bottom")||0,10),Number.isNaN(rs)&&(rs=0),Number.isNaN(ns)&&(ns=0),Object.assign(as,{width:rs,height:ns,size:as.isHorizontal()?rs:ns}))}function updateSlides(){const as=this;function rs(Ds){return as.isHorizontal()?Ds:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[Ds]}function ns(Ds,Os){return parseFloat(Ds.getPropertyValue(rs(Os))||0)}const ss=as.params,{wrapperEl:os,slidesEl:ls,size:us,rtlTranslate:cs,wrongRTL:ds}=as,ps=as.virtual&&ss.virtual.enabled,fs=ps?as.virtual.slides.length:as.slides.length,hs=elementChildren(ls,`.${as.params.slideClass}, swiper-slide`),gs=ps?as.virtual.slides.length:hs.length;let ys=[];const bs=[],vs=[];let xs=ss.slidesOffsetBefore;typeof xs=="function"&&(xs=ss.slidesOffsetBefore.call(as));let Cs=ss.slidesOffsetAfter;typeof Cs=="function"&&(Cs=ss.slidesOffsetAfter.call(as));const Ts=as.snapGrid.length,Ss=as.slidesGrid.length;let Ns=ss.spaceBetween,As=-xs,ws=0,Es=0;if(typeof us>"u")return;typeof Ns=="string"&&Ns.indexOf("%")>=0&&(Ns=parseFloat(Ns.replace("%",""))/100*us),as.virtualSize=-Ns,hs.forEach(Ds=>{cs?Ds.style.marginLeft="":Ds.style.marginRight="",Ds.style.marginBottom="",Ds.style.marginTop=""}),ss.centeredSlides&&ss.cssMode&&(setCSSProperty(os,"--swiper-centered-offset-before",""),setCSSProperty(os,"--swiper-centered-offset-after",""));const _s=ss.grid&&ss.grid.rows>1&&as.grid;_s&&as.grid.initSlides(gs);let $s;const Rs=ss.slidesPerView==="auto"&&ss.breakpoints&&Object.keys(ss.breakpoints).filter(Ds=>typeof ss.breakpoints[Ds].slidesPerView<"u").length>0;for(let Ds=0;Ds1&&ys.push(as.virtualSize-us)}if(ps&&ss.loop){const Ds=vs[0]+Ns;if(ss.slidesPerGroup>1){const Os=Math.ceil((as.virtual.slidesBefore+as.virtual.slidesAfter)/ss.slidesPerGroup),Is=Ds*ss.slidesPerGroup;for(let Vs=0;Vs!ss.cssMode||ss.loop?!0:Is!==hs.length-1).forEach(Os=>{Os.style[Ds]=`${Ns}px`})}if(ss.centeredSlides&&ss.centeredSlidesBounds){let Ds=0;vs.forEach(Is=>{Ds+=Is+(ss.spaceBetween?ss.spaceBetween:0)}),Ds-=ss.spaceBetween;const Os=Ds-us;ys=ys.map(Is=>Is<0?-xs:Is>Os?Os+Cs:Is)}if(ss.centerInsufficientSlides){let Ds=0;if(vs.forEach(Os=>{Ds+=Os+(ss.spaceBetween?ss.spaceBetween:0)}),Ds-=ss.spaceBetween,Ds{ys[Vs]=Is-Os}),bs.forEach((Is,Vs)=>{bs[Vs]=Is+Os})}}if(Object.assign(as,{slides:hs,snapGrid:ys,slidesGrid:bs,slidesSizesGrid:vs}),ss.centeredSlides&&ss.cssMode&&!ss.centeredSlidesBounds){setCSSProperty(os,"--swiper-centered-offset-before",`${-ys[0]}px`),setCSSProperty(os,"--swiper-centered-offset-after",`${as.size/2-vs[vs.length-1]/2}px`);const Ds=-as.snapGrid[0],Os=-as.slidesGrid[0];as.snapGrid=as.snapGrid.map(Is=>Is+Ds),as.slidesGrid=as.slidesGrid.map(Is=>Is+Os)}if(gs!==fs&&as.emit("slidesLengthChange"),ys.length!==Ts&&(as.params.watchOverflow&&as.checkOverflow(),as.emit("snapGridLengthChange")),bs.length!==Ss&&as.emit("slidesGridLengthChange"),ss.watchSlidesProgress&&as.updateSlidesOffset(),!ps&&!ss.cssMode&&(ss.effect==="slide"||ss.effect==="fade")){const Ds=`${ss.containerModifierClass}backface-hidden`,Os=as.el.classList.contains(Ds);gs<=ss.maxBackfaceHiddenSlides?Os||as.el.classList.add(Ds):Os&&as.el.classList.remove(Ds)}}function updateAutoHeight(as){const rs=this,ns=[],ss=rs.virtual&&rs.params.virtual.enabled;let os=0,ls;typeof as=="number"?rs.setTransition(as):as===!0&&rs.setTransition(rs.params.speed);const us=cs=>ss?rs.slides.filter(ds=>parseInt(ds.getAttribute("data-swiper-slide-index"),10)===cs)[0]:rs.slides[cs];if(rs.params.slidesPerView!=="auto"&&rs.params.slidesPerView>1)if(rs.params.centeredSlides)(rs.visibleSlides||[]).forEach(cs=>{ns.push(cs)});else for(ls=0;lsrs.slides.length&&!ss)break;ns.push(us(cs))}else ns.push(us(rs.activeIndex));for(ls=0;lsos?cs:os}(os||os===0)&&(rs.wrapperEl.style.height=`${os}px`)}function updateSlidesOffset(){const as=this,rs=as.slides,ns=as.isElement?as.isHorizontal()?as.wrapperEl.offsetLeft:as.wrapperEl.offsetTop:0;for(let ss=0;ss"u"&&rs.updateSlidesOffset();let us=-as;os&&(us=as),ss.forEach(cs=>{cs.classList.remove(ns.slideVisibleClass)}),rs.visibleSlidesIndexes=[],rs.visibleSlides=[];for(let cs=0;cs=0&&gs1&&ys<=rs.size||gs<=0&&ys>=rs.size)&&(rs.visibleSlides.push(ds),rs.visibleSlidesIndexes.push(cs),ss[cs].classList.add(ns.slideVisibleClass)),ds.progress=os?-fs:fs,ds.originalProgress=os?-hs:hs}}function updateProgress(as){const rs=this;if(typeof as>"u"){const fs=rs.rtlTranslate?-1:1;as=rs&&rs.translate&&rs.translate*fs||0}const ns=rs.params,ss=rs.maxTranslate()-rs.minTranslate();let{progress:os,isBeginning:ls,isEnd:us,progressLoop:cs}=rs;const ds=ls,ps=us;if(ss===0)os=0,ls=!0,us=!0;else{os=(as-rs.minTranslate())/ss;const fs=Math.abs(as-rs.minTranslate())<1,hs=Math.abs(as-rs.maxTranslate())<1;ls=fs||os<=0,us=hs||os>=1,fs&&(os=0),hs&&(os=1)}if(ns.loop){const fs=elementIndex(rs.slides.filter(xs=>xs.getAttribute("data-swiper-slide-index")==="0")[0]),hs=elementIndex(rs.slides.filter(xs=>xs.getAttribute("data-swiper-slide-index")*1===rs.slides.length-1)[0]),gs=rs.slidesGrid[fs],ys=rs.slidesGrid[hs],bs=rs.slidesGrid[rs.slidesGrid.length-1],vs=Math.abs(as);vs>=gs?cs=(vs-gs)/bs:cs=(vs+bs-ys)/bs,cs>1&&(cs-=1)}Object.assign(rs,{progress:os,progressLoop:cs,isBeginning:ls,isEnd:us}),(ns.watchSlidesProgress||ns.centeredSlides&&ns.autoHeight)&&rs.updateSlidesProgress(as),ls&&!ds&&rs.emit("reachBeginning toEdge"),us&&!ps&&rs.emit("reachEnd toEdge"),(ds&&!ls||ps&&!us)&&rs.emit("fromEdge"),rs.emit("progress",os)}function updateSlidesClasses(){const as=this,{slides:rs,params:ns,slidesEl:ss,activeIndex:os}=as,ls=as.virtual&&ns.virtual.enabled,us=ds=>elementChildren(ss,`.${ns.slideClass}${ds}, swiper-slide${ds}`)[0];rs.forEach(ds=>{ds.classList.remove(ns.slideActiveClass,ns.slideNextClass,ns.slidePrevClass)});let cs;if(ls)if(ns.loop){let ds=os-as.virtual.slidesBefore;ds<0&&(ds=as.virtual.slides.length+ds),ds>=as.virtual.slides.length&&(ds-=as.virtual.slides.length),cs=us(`[data-swiper-slide-index="${ds}"]`)}else cs=us(`[data-swiper-slide-index="${os}"]`);else cs=rs[os];if(cs){cs.classList.add(ns.slideActiveClass);let ds=elementNextAll(cs,`.${ns.slideClass}, swiper-slide`)[0];ns.loop&&!ds&&(ds=rs[0]),ds&&ds.classList.add(ns.slideNextClass);let ps=elementPrevAll(cs,`.${ns.slideClass}, swiper-slide`)[0];ns.loop&&!ps===0&&(ps=rs[rs.length-1]),ps&&ps.classList.add(ns.slidePrevClass)}as.emitSlidesClasses()}function getActiveIndexByTranslate(as){const{slidesGrid:rs,params:ns}=as,ss=as.rtlTranslate?as.translate:-as.translate;let os;for(let ls=0;ls=rs[ls]&&ss=rs[ls]&&ss=rs[ls]&&(os=ls);return ns.normalizeSlideIndex&&(os<0||typeof os>"u")&&(os=0),os}function updateActiveIndex(as){const rs=this,ns=rs.rtlTranslate?rs.translate:-rs.translate,{snapGrid:ss,params:os,activeIndex:ls,realIndex:us,snapIndex:cs}=rs;let ds=as,ps;const fs=gs=>{let ys=gs-rs.virtual.slidesBefore;return ys<0&&(ys=rs.virtual.slides.length+ys),ys>=rs.virtual.slides.length&&(ys-=rs.virtual.slides.length),ys};if(typeof ds>"u"&&(ds=getActiveIndexByTranslate(rs)),ss.indexOf(ns)>=0)ps=ss.indexOf(ns);else{const gs=Math.min(os.slidesPerGroupSkip,ds);ps=gs+Math.floor((ds-gs)/os.slidesPerGroup)}if(ps>=ss.length&&(ps=ss.length-1),ds===ls){ps!==cs&&(rs.snapIndex=ps,rs.emit("snapIndexChange")),rs.params.loop&&rs.virtual&&rs.params.virtual.enabled&&(rs.realIndex=fs(ds));return}let hs;rs.virtual&&os.virtual.enabled&&os.loop?hs=fs(ds):rs.slides[ds]?hs=parseInt(rs.slides[ds].getAttribute("data-swiper-slide-index")||ds,10):hs=ds,Object.assign(rs,{snapIndex:ps,realIndex:hs,previousIndex:ls,activeIndex:ds}),rs.emit("activeIndexChange"),rs.emit("snapIndexChange"),us!==hs&&rs.emit("realIndexChange"),(rs.initialized||rs.params.runCallbacksOnInit)&&rs.emit("slideChange")}function updateClickedSlide(as){const rs=this,ns=rs.params,ss=as.closest(`.${ns.slideClass}, swiper-slide`);let os=!1,ls;if(ss){for(let us=0;usds?fs=ds:ss&&asls?us="next":os=ds.length&&(xs=ds.length-1);const Cs=-ds[xs];if(cs.normalizeSlideIndex)for(let Ss=0;Ss=As&&Ns=As&&Ns=As&&(us=Ss)}if(ls.initialized&&us!==hs&&(!ls.allowSlideNext&&Csls.translate&&Cs>ls.maxTranslate()&&(hs||0)!==us))return!1;us!==(fs||0)&&ns&&ls.emit("beforeSlideChangeStart"),ls.updateProgress(Cs);let Ts;if(us>hs?Ts="next":us0?(ls._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{ys[Ss?"scrollLeft":"scrollTop"]=Ns})):ys[Ss?"scrollLeft":"scrollTop"]=Ns,As&&requestAnimationFrame(()=>{ls.wrapperEl.style.scrollSnapType="",ls._immediateVirtual=!1})}else{if(!ls.support.smoothScroll)return animateCSSModeScroll({swiper:ls,targetPosition:Ns,side:Ss?"left":"top"}),!0;ys.scrollTo({[Ss?"left":"top"]:Ns,behavior:"smooth"})}return!0}return ls.setTransition(rs),ls.setTranslate(Cs),ls.updateActiveIndex(us),ls.updateSlidesClasses(),ls.emit("beforeTransitionStart",rs,ss),ls.transitionStart(ns,Ts),rs===0?ls.transitionEnd(ns,Ts):ls.animating||(ls.animating=!0,ls.onSlideToWrapperTransitionEnd||(ls.onSlideToWrapperTransitionEnd=function(Ns){!ls||ls.destroyed||Ns.target===this&&(ls.wrapperEl.removeEventListener("transitionend",ls.onSlideToWrapperTransitionEnd),ls.onSlideToWrapperTransitionEnd=null,delete ls.onSlideToWrapperTransitionEnd,ls.transitionEnd(ns,Ts))}),ls.wrapperEl.addEventListener("transitionend",ls.onSlideToWrapperTransitionEnd)),!0}function slideToLoop(as=0,rs=this.params.speed,ns=!0,ss){typeof as=="string"&&(as=parseInt(as,10));const os=this;let ls=as;return os.params.loop&&(os.virtual&&os.params.virtual.enabled?ls=ls+os.virtual.slidesBefore:ls=elementIndex(os.slides.filter(us=>us.getAttribute("data-swiper-slide-index")*1===ls)[0])),os.slideTo(ls,rs,ns,ss)}function slideNext(as=this.params.speed,rs=!0,ns){const ss=this,{enabled:os,params:ls,animating:us}=ss;if(!os)return ss;let cs=ls.slidesPerGroup;ls.slidesPerView==="auto"&&ls.slidesPerGroup===1&&ls.slidesPerGroupAuto&&(cs=Math.max(ss.slidesPerViewDynamic("current",!0),1));const ds=ss.activeIndexgs(Cs));let vs=ls[bs.indexOf(ys)-1];if(typeof vs>"u"&&os.cssMode){let Cs;ls.forEach((Ts,Ss)=>{ys>=Ts&&(Cs=Ss)}),typeof Cs<"u"&&(vs=ls[Cs>0?Cs-1:Cs])}let xs=0;if(typeof vs<"u"&&(xs=us.indexOf(vs),xs<0&&(xs=ss.activeIndex-1),os.slidesPerView==="auto"&&os.slidesPerGroup===1&&os.slidesPerGroupAuto&&(xs=xs-ss.slidesPerViewDynamic("previous",!0)+1,xs=Math.max(xs,0))),os.rewind&&ss.isBeginning){const Cs=ss.params.virtual&&ss.params.virtual.enabled&&ss.virtual?ss.virtual.slides.length-1:ss.slides.length-1;return ss.slideTo(Cs,as,rs,ns)}return ss.slideTo(xs,as,rs,ns)}function slideReset(as=this.params.speed,rs=!0,ns){const ss=this;return ss.slideTo(ss.activeIndex,as,rs,ns)}function slideToClosest(as=this.params.speed,rs=!0,ns,ss=.5){const os=this;let ls=os.activeIndex;const us=Math.min(os.params.slidesPerGroupSkip,ls),cs=us+Math.floor((ls-us)/os.params.slidesPerGroup),ds=os.rtlTranslate?os.translate:-os.translate;if(ds>=os.snapGrid[cs]){const ps=os.snapGrid[cs],fs=os.snapGrid[cs+1];ds-ps>(fs-ps)*ss&&(ls+=os.params.slidesPerGroup)}else{const ps=os.snapGrid[cs-1],fs=os.snapGrid[cs];ds-ps<=(fs-ps)*ss&&(ls-=os.params.slidesPerGroup)}return ls=Math.max(ls,0),ls=Math.min(ls,os.slidesGrid.length-1),os.slideTo(ls,as,rs,ns)}function slideToClickedSlide(){const as=this,{params:rs,slidesEl:ns}=as,ss=rs.slidesPerView==="auto"?as.slidesPerViewDynamic():rs.slidesPerView;let os=as.clickedIndex,ls;const us=as.isElement?"swiper-slide":`.${rs.slideClass}`;if(rs.loop){if(as.animating)return;ls=parseInt(as.clickedSlide.getAttribute("data-swiper-slide-index"),10),rs.centeredSlides?osas.slides.length-as.loopedSlides+ss/2?(as.loopFix(),os=elementIndex(elementChildren(ns,`${us}[data-swiper-slide-index="${ls}"]`)[0]),nextTick(()=>{as.slideTo(os)})):as.slideTo(os):os>as.slides.length-ss?(as.loopFix(),os=elementIndex(elementChildren(ns,`${us}[data-swiper-slide-index="${ls}"]`)[0]),nextTick(()=>{as.slideTo(os)})):as.slideTo(os)}else as.slideTo(os)}const slide={slideTo,slideToLoop,slideNext,slidePrev,slideReset,slideToClosest,slideToClickedSlide};function loopCreate(as){const rs=this,{params:ns,slidesEl:ss}=rs;if(!ns.loop||rs.virtual&&rs.params.virtual.enabled)return;elementChildren(ss,`.${ns.slideClass}, swiper-slide`).forEach((ls,us)=>{ls.setAttribute("data-swiper-slide-index",us)}),rs.loopFix({slideRealIndex:as,direction:ns.centeredSlides?void 0:"next"})}function loopFix({slideRealIndex:as,slideTo:rs=!0,direction:ns,setTranslate:ss,activeSlideIndex:os,byController:ls,byMousewheel:us}={}){const cs=this;if(!cs.params.loop)return;cs.emit("beforeLoopFix");const{slides:ds,allowSlidePrev:ps,allowSlideNext:fs,slidesEl:hs,params:gs}=cs;if(cs.allowSlidePrev=!0,cs.allowSlideNext=!0,cs.virtual&&gs.virtual.enabled){rs&&(!gs.centeredSlides&&cs.snapIndex===0?cs.slideTo(cs.virtual.slides.length,0,!1,!0):gs.centeredSlides&&cs.snapIndex"u"?os=elementIndex(cs.slides.filter(ws=>ws.classList.contains("swiper-slide-active"))[0]):Cs=os;const Ts=ns==="next"||!ns,Ss=ns==="prev"||!ns;let Ns=0,As=0;if(oscs.slides.length-bs*2){As=os-(cs.slides.length-bs*2);for(let ws=0;ws{hs.prepend(cs.slides[ws])}),Ts&&xs.forEach(ws=>{hs.append(cs.slides[ws])}),cs.recalcSlides(),gs.watchSlidesProgress&&cs.updateSlidesOffset(),rs){if(vs.length>0&&Ss)if(typeof as>"u"){const ws=cs.slidesGrid[Cs],_s=cs.slidesGrid[Cs+Ns]-ws;us?cs.setTranslate(cs.translate-_s):(cs.slideTo(Cs+Ns,0,!1,!0),ss&&(cs.touches[cs.isHorizontal()?"startX":"startY"]+=_s))}else ss&&cs.slideToLoop(as,0,!1,!0);else if(xs.length>0&&Ts)if(typeof as>"u"){const ws=cs.slidesGrid[Cs],_s=cs.slidesGrid[Cs-As]-ws;us?cs.setTranslate(cs.translate-_s):(cs.slideTo(Cs-As,0,!1,!0),ss&&(cs.touches[cs.isHorizontal()?"startX":"startY"]+=_s))}else cs.slideToLoop(as,0,!1,!0)}if(cs.allowSlidePrev=ps,cs.allowSlideNext=fs,cs.controller&&cs.controller.control&&!ls){const ws={slideRealIndex:as,slideTo:!1,direction:ns,setTranslate:ss,activeSlideIndex:os,byController:!0};Array.isArray(cs.controller.control)?cs.controller.control.forEach(Es=>{Es.params.loop&&Es.loopFix(ws)}):cs.controller.control instanceof cs.constructor&&cs.controller.control.params.loop&&cs.controller.control.loopFix(ws)}cs.emit("loopFix")}function loopDestroy(){const as=this,{slides:rs,params:ns,slidesEl:ss}=as;if(!ns.loop||as.virtual&&as.params.virtual.enabled)return;as.recalcSlides();const os=[];rs.forEach(ls=>{const us=typeof ls.swiperSlideIndex>"u"?ls.getAttribute("data-swiper-slide-index")*1:ls.swiperSlideIndex;os[us]=ls}),rs.forEach(ls=>{ls.removeAttribute("data-swiper-slide-index")}),os.forEach(ls=>{ss.append(ls)}),as.recalcSlides(),as.slideTo(as.realIndex,0)}const loop={loopCreate,loopFix,loopDestroy};function setGrabCursor(as){const rs=this;if(!rs.params.simulateTouch||rs.params.watchOverflow&&rs.isLocked||rs.params.cssMode)return;const ns=rs.params.touchEventsTarget==="container"?rs.el:rs.wrapperEl;ns.style.cursor="move",ns.style.cursor=as?"grabbing":"grab"}function unsetGrabCursor(){const as=this;as.params.watchOverflow&&as.isLocked||as.params.cssMode||(as[as.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="")}const grabCursor={setGrabCursor,unsetGrabCursor};function closestElement(as,rs=this){function ns(ss){if(!ss||ss===getDocument()||ss===getWindow())return null;ss.assignedSlot&&(ss=ss.assignedSlot);const os=ss.closest(as);return!os&&!ss.getRootNode?null:os||ns(ss.getRootNode().host)}return ns(rs)}function onTouchStart(as){const rs=this,ns=getDocument(),ss=getWindow(),os=rs.touchEventsData;os.evCache.push(as);const{params:ls,touches:us,enabled:cs}=rs;if(!cs||!ls.simulateTouch&&as.pointerType==="mouse"||rs.animating&&ls.preventInteractionOnTransition)return;!rs.animating&&ls.cssMode&&ls.loop&&rs.loopFix();let ds=as;ds.originalEvent&&(ds=ds.originalEvent);let ps=ds.target;if(ls.touchEventsTarget==="wrapper"&&!rs.wrapperEl.contains(ps)||"which"in ds&&ds.which===3||"button"in ds&&ds.button>0||os.isTouched&&os.isMoved)return;const fs=!!ls.noSwipingClass&&ls.noSwipingClass!=="",hs=as.composedPath?as.composedPath():as.path;fs&&ds.target&&ds.target.shadowRoot&&hs&&(ps=hs[0]);const gs=ls.noSwipingSelector?ls.noSwipingSelector:`.${ls.noSwipingClass}`,ys=!!(ds.target&&ds.target.shadowRoot);if(ls.noSwiping&&(ys?closestElement(gs,ps):ps.closest(gs))){rs.allowClick=!0;return}if(ls.swipeHandler&&!ps.closest(ls.swipeHandler))return;us.currentX=ds.pageX,us.currentY=ds.pageY;const bs=us.currentX,vs=us.currentY,xs=ls.edgeSwipeDetection||ls.iOSEdgeSwipeDetection,Cs=ls.edgeSwipeThreshold||ls.iOSEdgeSwipeThreshold;if(xs&&(bs<=Cs||bs>=ss.innerWidth-Cs))if(xs==="prevent")as.preventDefault();else return;Object.assign(os,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),us.startX=bs,us.startY=vs,os.touchStartTime=now(),rs.allowClick=!0,rs.updateSize(),rs.swipeDirection=void 0,ls.threshold>0&&(os.allowThresholdMove=!1);let Ts=!0;ps.matches(os.focusableElements)&&(Ts=!1,ps.nodeName==="SELECT"&&(os.isTouched=!1)),ns.activeElement&&ns.activeElement.matches(os.focusableElements)&&ns.activeElement!==ps&&ns.activeElement.blur();const Ss=Ts&&rs.allowTouchMove&&ls.touchStartPreventDefault;(ls.touchStartForcePreventDefault||Ss)&&!ps.isContentEditable&&ds.preventDefault(),rs.params.freeMode&&rs.params.freeMode.enabled&&rs.freeMode&&rs.animating&&!ls.cssMode&&rs.freeMode.onTouchStart(),rs.emit("touchStart",ds)}function onTouchMove(as){const rs=getDocument(),ns=this,ss=ns.touchEventsData,{params:os,touches:ls,rtlTranslate:us,enabled:cs}=ns;if(!cs||!os.simulateTouch&&as.pointerType==="mouse")return;let ds=as;if(ds.originalEvent&&(ds=ds.originalEvent),!ss.isTouched){ss.startMoving&&ss.isScrolling&&ns.emit("touchMoveOpposite",ds);return}const ps=ss.evCache.findIndex(ws=>ws.pointerId===ds.pointerId);ps>=0&&(ss.evCache[ps]=ds);const fs=ss.evCache.length>1?ss.evCache[0]:ds,hs=fs.pageX,gs=fs.pageY;if(ds.preventedByNestedSwiper){ls.startX=hs,ls.startY=gs;return}if(!ns.allowTouchMove){ds.target.matches(ss.focusableElements)||(ns.allowClick=!1),ss.isTouched&&(Object.assign(ls,{startX:hs,startY:gs,prevX:ns.touches.currentX,prevY:ns.touches.currentY,currentX:hs,currentY:gs}),ss.touchStartTime=now());return}if(os.touchReleaseOnEdges&&!os.loop){if(ns.isVertical()){if(gsls.startY&&ns.translate>=ns.minTranslate()){ss.isTouched=!1,ss.isMoved=!1;return}}else if(hsls.startX&&ns.translate>=ns.minTranslate())return}if(rs.activeElement&&ds.target===rs.activeElement&&ds.target.matches(ss.focusableElements)){ss.isMoved=!0,ns.allowClick=!1;return}if(ss.allowTouchCallbacks&&ns.emit("touchMove",ds),ds.targetTouches&&ds.targetTouches.length>1)return;ls.currentX=hs,ls.currentY=gs;const ys=ls.currentX-ls.startX,bs=ls.currentY-ls.startY;if(ns.params.threshold&&Math.sqrt(ys**2+bs**2)"u"){let ws;ns.isHorizontal()&&ls.currentY===ls.startY||ns.isVertical()&&ls.currentX===ls.startX?ss.isScrolling=!1:ys*ys+bs*bs>=25&&(ws=Math.atan2(Math.abs(bs),Math.abs(ys))*180/Math.PI,ss.isScrolling=ns.isHorizontal()?ws>os.touchAngle:90-ws>os.touchAngle)}if(ss.isScrolling&&ns.emit("touchMoveOpposite",ds),typeof ss.startMoving>"u"&&(ls.currentX!==ls.startX||ls.currentY!==ls.startY)&&(ss.startMoving=!0),ss.isScrolling||ns.zoom&&ns.params.zoom&&ns.params.zoom.enabled&&ss.evCache.length>1){ss.isTouched=!1;return}if(!ss.startMoving)return;ns.allowClick=!1,!os.cssMode&&ds.cancelable&&ds.preventDefault(),os.touchMoveStopPropagation&&!os.nested&&ds.stopPropagation();let vs=ns.isHorizontal()?ys:bs,xs=ns.isHorizontal()?ls.currentX-ls.previousX:ls.currentY-ls.previousY;os.oneWayMovement&&(vs=Math.abs(vs)*(us?1:-1),xs=Math.abs(xs)*(us?1:-1)),ls.diff=vs,vs*=os.touchRatio,us&&(vs=-vs,xs=-xs);const Cs=ns.touchesDirection;ns.swipeDirection=vs>0?"prev":"next",ns.touchesDirection=xs>0?"prev":"next";const Ts=ns.params.loop&&!os.cssMode;if(!ss.isMoved){if(Ts&&ns.loopFix({direction:ns.swipeDirection}),ss.startTranslate=ns.getTranslate(),ns.setTransition(0),ns.animating){const ws=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});ns.wrapperEl.dispatchEvent(ws)}ss.allowMomentumBounce=!1,os.grabCursor&&(ns.allowSlideNext===!0||ns.allowSlidePrev===!0)&&ns.setGrabCursor(!0),ns.emit("sliderFirstMove",ds)}let Ss;ss.isMoved&&Cs!==ns.touchesDirection&&Ts&&Math.abs(vs)>=1&&(ns.loopFix({direction:ns.swipeDirection,setTranslate:!0}),Ss=!0),ns.emit("sliderMove",ds),ss.isMoved=!0,ss.currentTranslate=vs+ss.startTranslate;let Ns=!0,As=os.resistanceRatio;if(os.touchReleaseOnEdges&&(As=0),vs>0?(Ts&&!Ss&&ss.currentTranslate>(os.centeredSlides?ns.minTranslate()-ns.size/2:ns.minTranslate())&&ns.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),ss.currentTranslate>ns.minTranslate()&&(Ns=!1,os.resistance&&(ss.currentTranslate=ns.minTranslate()-1+(-ns.minTranslate()+ss.startTranslate+vs)**As))):vs<0&&(Ts&&!Ss&&ss.currentTranslate<(os.centeredSlides?ns.maxTranslate()+ns.size/2:ns.maxTranslate())&&ns.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:ns.slides.length-(os.slidesPerView==="auto"?ns.slidesPerViewDynamic():Math.ceil(parseFloat(os.slidesPerView,10)))}),ss.currentTranslatess.startTranslate&&(ss.currentTranslate=ss.startTranslate),!ns.allowSlidePrev&&!ns.allowSlideNext&&(ss.currentTranslate=ss.startTranslate),os.threshold>0)if(Math.abs(vs)>os.threshold||ss.allowThresholdMove){if(!ss.allowThresholdMove){ss.allowThresholdMove=!0,ls.startX=ls.currentX,ls.startY=ls.currentY,ss.currentTranslate=ss.startTranslate,ls.diff=ns.isHorizontal()?ls.currentX-ls.startX:ls.currentY-ls.startY;return}}else{ss.currentTranslate=ss.startTranslate;return}!os.followFinger||os.cssMode||((os.freeMode&&os.freeMode.enabled&&ns.freeMode||os.watchSlidesProgress)&&(ns.updateActiveIndex(),ns.updateSlidesClasses()),ns.params.freeMode&&os.freeMode.enabled&&ns.freeMode&&ns.freeMode.onTouchMove(),ns.updateProgress(ss.currentTranslate),ns.setTranslate(ss.currentTranslate))}function onTouchEnd(as){const rs=this,ns=rs.touchEventsData,ss=ns.evCache.findIndex(Ss=>Ss.pointerId===as.pointerId);if(ss>=0&&ns.evCache.splice(ss,1),["pointercancel","pointerout","pointerleave"].includes(as.type))return;const{params:os,touches:ls,rtlTranslate:us,slidesGrid:cs,enabled:ds}=rs;if(!ds||!os.simulateTouch&&as.pointerType==="mouse")return;let ps=as;if(ps.originalEvent&&(ps=ps.originalEvent),ns.allowTouchCallbacks&&rs.emit("touchEnd",ps),ns.allowTouchCallbacks=!1,!ns.isTouched){ns.isMoved&&os.grabCursor&&rs.setGrabCursor(!1),ns.isMoved=!1,ns.startMoving=!1;return}os.grabCursor&&ns.isMoved&&ns.isTouched&&(rs.allowSlideNext===!0||rs.allowSlidePrev===!0)&&rs.setGrabCursor(!1);const fs=now(),hs=fs-ns.touchStartTime;if(rs.allowClick){const Ss=ps.path||ps.composedPath&&ps.composedPath();rs.updateClickedSlide(Ss&&Ss[0]||ps.target),rs.emit("tap click",ps),hs<300&&fs-ns.lastClickTime<300&&rs.emit("doubleTap doubleClick",ps)}if(ns.lastClickTime=now(),nextTick(()=>{rs.destroyed||(rs.allowClick=!0)}),!ns.isTouched||!ns.isMoved||!rs.swipeDirection||ls.diff===0||ns.currentTranslate===ns.startTranslate){ns.isTouched=!1,ns.isMoved=!1,ns.startMoving=!1;return}ns.isTouched=!1,ns.isMoved=!1,ns.startMoving=!1;let gs;if(os.followFinger?gs=us?rs.translate:-rs.translate:gs=-ns.currentTranslate,os.cssMode)return;if(rs.params.freeMode&&os.freeMode.enabled){rs.freeMode.onTouchEnd({currentPos:gs});return}let ys=0,bs=rs.slidesSizesGrid[0];for(let Ss=0;Ss=cs[Ss]&&gs=cs[Ss]&&(ys=Ss,bs=cs[cs.length-1]-cs[cs.length-2])}let vs=null,xs=null;os.rewind&&(rs.isBeginning?xs=rs.params.virtual&&rs.params.virtual.enabled&&rs.virtual?rs.virtual.slides.length-1:rs.slides.length-1:rs.isEnd&&(vs=0));const Cs=(gs-cs[ys])/bs,Ts=ysos.longSwipesMs){if(!os.longSwipes){rs.slideTo(rs.activeIndex);return}rs.swipeDirection==="next"&&(Cs>=os.longSwipesRatio?rs.slideTo(os.rewind&&rs.isEnd?vs:ys+Ts):rs.slideTo(ys)),rs.swipeDirection==="prev"&&(Cs>1-os.longSwipesRatio?rs.slideTo(ys+Ts):xs!==null&&Cs<0&&Math.abs(Cs)>os.longSwipesRatio?rs.slideTo(xs):rs.slideTo(ys))}else{if(!os.shortSwipes){rs.slideTo(rs.activeIndex);return}rs.navigation&&(ps.target===rs.navigation.nextEl||ps.target===rs.navigation.prevEl)?ps.target===rs.navigation.nextEl?rs.slideTo(ys+Ts):rs.slideTo(ys):(rs.swipeDirection==="next"&&rs.slideTo(vs!==null?vs:ys+Ts),rs.swipeDirection==="prev"&&rs.slideTo(xs!==null?xs:ys))}}let timeout;function onResize(){const as=this,{params:rs,el:ns}=as;if(ns&&ns.offsetWidth===0)return;rs.breakpoints&&as.setBreakpoint();const{allowSlideNext:ss,allowSlidePrev:os,snapGrid:ls}=as,us=as.virtual&&as.params.virtual.enabled;as.allowSlideNext=!0,as.allowSlidePrev=!0,as.updateSize(),as.updateSlides(),as.updateSlidesClasses();const cs=us&&rs.loop;(rs.slidesPerView==="auto"||rs.slidesPerView>1)&&as.isEnd&&!as.isBeginning&&!as.params.centeredSlides&&!cs?as.slideTo(as.slides.length-1,0,!1,!0):as.params.loop&&!us?as.slideToLoop(as.realIndex,0,!1,!0):as.slideTo(as.activeIndex,0,!1,!0),as.autoplay&&as.autoplay.running&&as.autoplay.paused&&(clearTimeout(timeout),timeout=setTimeout(()=>{as.autoplay.resume()},500)),as.allowSlidePrev=os,as.allowSlideNext=ss,as.params.watchOverflow&&ls!==as.snapGrid&&as.checkOverflow()}function onClick(as){const rs=this;rs.enabled&&(rs.allowClick||(rs.params.preventClicks&&as.preventDefault(),rs.params.preventClicksPropagation&&rs.animating&&(as.stopPropagation(),as.stopImmediatePropagation())))}function onScroll(){const as=this,{wrapperEl:rs,rtlTranslate:ns,enabled:ss}=as;if(!ss)return;as.previousTranslate=as.translate,as.isHorizontal()?as.translate=-rs.scrollLeft:as.translate=-rs.scrollTop,as.translate===0&&(as.translate=0),as.updateActiveIndex(),as.updateSlidesClasses();let os;const ls=as.maxTranslate()-as.minTranslate();ls===0?os=0:os=(as.translate-as.minTranslate())/ls,os!==as.progress&&as.updateProgress(ns?-as.translate:as.translate),as.emit("setTranslate",as.translate,!1)}const processLazyPreloader=(as,rs)=>{if(!as||as.destroyed||!as.params)return;const ns=()=>as.isElement?"swiper-slide":`.${as.params.slideClass}`,ss=rs.closest(ns());if(ss){const os=ss.querySelector(`.${as.params.lazyPreloaderClass}`);os&&os.remove()}};function onLoad(as){const rs=this;processLazyPreloader(rs,as.target),rs.update()}let dummyEventAttached=!1;function dummyEventListener(){}const events=(as,rs)=>{const ns=getDocument(),{params:ss,el:os,wrapperEl:ls,device:us}=as,cs=!!ss.nested,ds=rs==="on"?"addEventListener":"removeEventListener",ps=rs;os[ds]("pointerdown",as.onTouchStart,{passive:!1}),ns[ds]("pointermove",as.onTouchMove,{passive:!1,capture:cs}),ns[ds]("pointerup",as.onTouchEnd,{passive:!0}),ns[ds]("pointercancel",as.onTouchEnd,{passive:!0}),ns[ds]("pointerout",as.onTouchEnd,{passive:!0}),ns[ds]("pointerleave",as.onTouchEnd,{passive:!0}),(ss.preventClicks||ss.preventClicksPropagation)&&os[ds]("click",as.onClick,!0),ss.cssMode&&ls[ds]("scroll",as.onScroll),ss.updateOnWindowResize?as[ps](us.ios||us.android?"resize orientationchange observerUpdate":"resize observerUpdate",onResize,!0):as[ps]("observerUpdate",onResize,!0),os[ds]("load",as.onLoad,{capture:!0})};function attachEvents(){const as=this,rs=getDocument(),{params:ns}=as;as.onTouchStart=onTouchStart.bind(as),as.onTouchMove=onTouchMove.bind(as),as.onTouchEnd=onTouchEnd.bind(as),ns.cssMode&&(as.onScroll=onScroll.bind(as)),as.onClick=onClick.bind(as),as.onLoad=onLoad.bind(as),dummyEventAttached||(rs.addEventListener("touchstart",dummyEventListener),dummyEventAttached=!0),events(as,"on")}function detachEvents(){events(this,"off")}const events$1={attachEvents,detachEvents},isGridEnabled=(as,rs)=>as.grid&&rs.grid&&rs.grid.rows>1;function setBreakpoint(){const as=this,{realIndex:rs,initialized:ns,params:ss,el:os}=as,ls=ss.breakpoints;if(!ls||ls&&Object.keys(ls).length===0)return;const us=as.getBreakpoint(ls,as.params.breakpointsBase,as.el);if(!us||as.currentBreakpoint===us)return;const ds=(us in ls?ls[us]:void 0)||as.originalParams,ps=isGridEnabled(as,ss),fs=isGridEnabled(as,ds),hs=ss.enabled;ps&&!fs?(os.classList.remove(`${ss.containerModifierClass}grid`,`${ss.containerModifierClass}grid-column`),as.emitContainerClasses()):!ps&&fs&&(os.classList.add(`${ss.containerModifierClass}grid`),(ds.grid.fill&&ds.grid.fill==="column"||!ds.grid.fill&&ss.grid.fill==="column")&&os.classList.add(`${ss.containerModifierClass}grid-column`),as.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach(vs=>{const xs=ss[vs]&&ss[vs].enabled,Cs=ds[vs]&&ds[vs].enabled;xs&&!Cs&&as[vs].disable(),!xs&&Cs&&as[vs].enable()});const gs=ds.direction&&ds.direction!==ss.direction,ys=ss.loop&&(ds.slidesPerView!==ss.slidesPerView||gs);gs&&ns&&as.changeDirection(),extend$1(as.params,ds);const bs=as.params.enabled;Object.assign(as,{allowTouchMove:as.params.allowTouchMove,allowSlideNext:as.params.allowSlideNext,allowSlidePrev:as.params.allowSlidePrev}),hs&&!bs?as.disable():!hs&&bs&&as.enable(),as.currentBreakpoint=us,as.emit("_beforeBreakpoint",ds),ys&&ns&&(as.loopDestroy(),as.loopCreate(rs),as.updateSlides()),as.emit("breakpoint",ds)}function getBreakpoint(as,rs="window",ns){if(!as||rs==="container"&&!ns)return;let ss=!1;const os=getWindow(),ls=rs==="window"?os.innerHeight:ns.clientHeight,us=Object.keys(as).map(cs=>{if(typeof cs=="string"&&cs.indexOf("@")===0){const ds=parseFloat(cs.substr(1));return{value:ls*ds,point:cs}}return{value:cs,point:cs}});us.sort((cs,ds)=>parseInt(cs.value,10)-parseInt(ds.value,10));for(let cs=0;cs{typeof ss=="object"?Object.keys(ss).forEach(os=>{ss[os]&&ns.push(rs+os)}):typeof ss=="string"&&ns.push(rs+ss)}),ns}function addClasses(){const as=this,{classNames:rs,params:ns,rtl:ss,el:os,device:ls}=as,us=prepareClasses(["initialized",ns.direction,{"free-mode":as.params.freeMode&&ns.freeMode.enabled},{autoheight:ns.autoHeight},{rtl:ss},{grid:ns.grid&&ns.grid.rows>1},{"grid-column":ns.grid&&ns.grid.rows>1&&ns.grid.fill==="column"},{android:ls.android},{ios:ls.ios},{"css-mode":ns.cssMode},{centered:ns.cssMode&&ns.centeredSlides},{"watch-progress":ns.watchSlidesProgress}],ns.containerModifierClass);rs.push(...us),os.classList.add(...rs),as.emitContainerClasses()}function removeClasses(){const as=this,{el:rs,classNames:ns}=as;rs.classList.remove(...ns),as.emitContainerClasses()}const classes={addClasses,removeClasses};function checkOverflow(){const as=this,{isLocked:rs,params:ns}=as,{slidesOffsetBefore:ss}=ns;if(ss){const os=as.slides.length-1,ls=as.slidesGrid[os]+as.slidesSizesGrid[os]+ss*2;as.isLocked=as.size>ls}else as.isLocked=as.snapGrid.length===1;ns.allowSlideNext===!0&&(as.allowSlideNext=!as.isLocked),ns.allowSlidePrev===!0&&(as.allowSlidePrev=!as.isLocked),rs&&rs!==as.isLocked&&(as.isEnd=!1),rs!==as.isLocked&&as.emit(as.isLocked?"lock":"unlock")}const checkOverflow$1={checkOverflow},defaults$2={init:!0,direction:"horizontal",oneWayMovement:!1,touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopedSlides:null,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",runCallbacksOnInit:!0,_emitClasses:!1};function moduleExtendParams(as,rs){return function(ss={}){const os=Object.keys(ss)[0],ls=ss[os];if(typeof ls!="object"||ls===null){extend$1(rs,ss);return}if(["navigation","pagination","scrollbar"].indexOf(os)>=0&&as[os]===!0&&(as[os]={auto:!0}),!(os in as&&"enabled"in ls)){extend$1(rs,ss);return}as[os]===!0&&(as[os]={enabled:!0}),typeof as[os]=="object"&&!("enabled"in as[os])&&(as[os].enabled=!0),as[os]||(as[os]={enabled:!1}),extend$1(rs,ss)}}const prototypes={eventsEmitter,update,translate,transition,slide,loop,grabCursor,events:events$1,breakpoints,checkOverflow:checkOverflow$1,classes},extendedDefaults={};let Swiper$1=class Ou{constructor(...rs){let ns,ss;rs.length===1&&rs[0].constructor&&Object.prototype.toString.call(rs[0]).slice(8,-1)==="Object"?ss=rs[0]:[ns,ss]=rs,ss||(ss={}),ss=extend$1({},ss),ns&&!ss.el&&(ss.el=ns);const os=getDocument();if(ss.el&&typeof ss.el=="string"&&os.querySelectorAll(ss.el).length>1){const ds=[];return os.querySelectorAll(ss.el).forEach(ps=>{const fs=extend$1({},ss,{el:ps});ds.push(new Ou(fs))}),ds}const ls=this;ls.__swiper__=!0,ls.support=getSupport(),ls.device=getDevice({userAgent:ss.userAgent}),ls.browser=getBrowser(),ls.eventsListeners={},ls.eventsAnyListeners=[],ls.modules=[...ls.__modules__],ss.modules&&Array.isArray(ss.modules)&&ls.modules.push(...ss.modules);const us={};ls.modules.forEach(ds=>{ds({params:ss,swiper:ls,extendParams:moduleExtendParams(ss,us),on:ls.on.bind(ls),once:ls.once.bind(ls),off:ls.off.bind(ls),emit:ls.emit.bind(ls)})});const cs=extend$1({},defaults$2,us);return ls.params=extend$1({},cs,extendedDefaults,ss),ls.originalParams=extend$1({},ls.params),ls.passedParams=extend$1({},ss),ls.params&&ls.params.on&&Object.keys(ls.params.on).forEach(ds=>{ls.on(ds,ls.params.on[ds])}),ls.params&&ls.params.onAny&&ls.onAny(ls.params.onAny),Object.assign(ls,{enabled:ls.params.enabled,el:ns,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return ls.params.direction==="horizontal"},isVertical(){return ls.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,allowSlideNext:ls.params.allowSlideNext,allowSlidePrev:ls.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:ls.params.focusableElements,lastClickTime:now(),clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,evCache:[]},allowClick:!0,allowTouchMove:ls.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),ls.emit("_swiper"),ls.params.init&&ls.init(),ls}recalcSlides(){const rs=this,{slidesEl:ns,params:ss}=rs;rs.slides=elementChildren(ns,`.${ss.slideClass}, swiper-slide`)}enable(){const rs=this;rs.enabled||(rs.enabled=!0,rs.params.grabCursor&&rs.setGrabCursor(),rs.emit("enable"))}disable(){const rs=this;rs.enabled&&(rs.enabled=!1,rs.params.grabCursor&&rs.unsetGrabCursor(),rs.emit("disable"))}setProgress(rs,ns){const ss=this;rs=Math.min(Math.max(rs,0),1);const os=ss.minTranslate(),us=(ss.maxTranslate()-os)*rs+os;ss.translateTo(us,typeof ns>"u"?0:ns),ss.updateActiveIndex(),ss.updateSlidesClasses()}emitContainerClasses(){const rs=this;if(!rs.params._emitClasses||!rs.el)return;const ns=rs.el.className.split(" ").filter(ss=>ss.indexOf("swiper")===0||ss.indexOf(rs.params.containerModifierClass)===0);rs.emit("_containerClasses",ns.join(" "))}getSlideClasses(rs){const ns=this;return ns.destroyed?"":rs.className.split(" ").filter(ss=>ss.indexOf("swiper-slide")===0||ss.indexOf(ns.params.slideClass)===0).join(" ")}emitSlidesClasses(){const rs=this;if(!rs.params._emitClasses||!rs.el)return;const ns=[];rs.slides.forEach(ss=>{const os=rs.getSlideClasses(ss);ns.push({slideEl:ss,classNames:os}),rs.emit("_slideClass",ss,os)}),rs.emit("_slideClasses",ns)}slidesPerViewDynamic(rs="current",ns=!1){const ss=this,{params:os,slides:ls,slidesGrid:us,slidesSizesGrid:cs,size:ds,activeIndex:ps}=ss;let fs=1;if(os.centeredSlides){let hs=ls[ps].swiperSlideSize,gs;for(let ys=ps+1;ysds&&(gs=!0));for(let ys=ps-1;ys>=0;ys-=1)ls[ys]&&!gs&&(hs+=ls[ys].swiperSlideSize,fs+=1,hs>ds&&(gs=!0))}else if(rs==="current")for(let hs=ps+1;hs=0;hs-=1)us[ps]-us[hs]{us.complete&&processLazyPreloader(rs,us)}),rs.updateSize(),rs.updateSlides(),rs.updateProgress(),rs.updateSlidesClasses();function os(){const us=rs.rtlTranslate?rs.translate*-1:rs.translate,cs=Math.min(Math.max(us,rs.maxTranslate()),rs.minTranslate());rs.setTranslate(cs),rs.updateActiveIndex(),rs.updateSlidesClasses()}let ls;rs.params.freeMode&&rs.params.freeMode.enabled?(os(),rs.params.autoHeight&&rs.updateAutoHeight()):((rs.params.slidesPerView==="auto"||rs.params.slidesPerView>1)&&rs.isEnd&&!rs.params.centeredSlides?ls=rs.slideTo(rs.slides.length-1,0,!1,!0):ls=rs.slideTo(rs.activeIndex,0,!1,!0),ls||os()),ss.watchOverflow&&ns!==rs.snapGrid&&rs.checkOverflow(),rs.emit("update")}changeDirection(rs,ns=!0){const ss=this,os=ss.params.direction;return rs||(rs=os==="horizontal"?"vertical":"horizontal"),rs===os||rs!=="horizontal"&&rs!=="vertical"||(ss.el.classList.remove(`${ss.params.containerModifierClass}${os}`),ss.el.classList.add(`${ss.params.containerModifierClass}${rs}`),ss.emitContainerClasses(),ss.params.direction=rs,ss.slides.forEach(ls=>{rs==="vertical"?ls.style.width="":ls.style.height=""}),ss.emit("changeDirection"),ns&&ss.update()),ss}changeLanguageDirection(rs){const ns=this;ns.rtl&&rs==="rtl"||!ns.rtl&&rs==="ltr"||(ns.rtl=rs==="rtl",ns.rtlTranslate=ns.params.direction==="horizontal"&&ns.rtl,ns.rtl?(ns.el.classList.add(`${ns.params.containerModifierClass}rtl`),ns.el.dir="rtl"):(ns.el.classList.remove(`${ns.params.containerModifierClass}rtl`),ns.el.dir="ltr"),ns.update())}mount(rs){const ns=this;if(ns.mounted)return!0;let ss=rs||ns.params.el;if(typeof ss=="string"&&(ss=document.querySelector(ss)),!ss)return!1;ss.swiper=ns,ss.shadowEl&&(ns.isElement=!0);const os=()=>`.${(ns.params.wrapperClass||"").trim().split(" ").join(".")}`;let us=(()=>ss&&ss.shadowRoot&&ss.shadowRoot.querySelector?ss.shadowRoot.querySelector(os()):elementChildren(ss,os())[0])();return!us&&ns.params.createElements&&(us=createElement("div",ns.params.wrapperClass),ss.append(us),elementChildren(ss,`.${ns.params.slideClass}`).forEach(cs=>{us.append(cs)})),Object.assign(ns,{el:ss,wrapperEl:us,slidesEl:ns.isElement?ss:us,mounted:!0,rtl:ss.dir.toLowerCase()==="rtl"||elementStyle(ss,"direction")==="rtl",rtlTranslate:ns.params.direction==="horizontal"&&(ss.dir.toLowerCase()==="rtl"||elementStyle(ss,"direction")==="rtl"),wrongRTL:elementStyle(us,"display")==="-webkit-box"}),!0}init(rs){const ns=this;return ns.initialized||ns.mount(rs)===!1||(ns.emit("beforeInit"),ns.params.breakpoints&&ns.setBreakpoint(),ns.addClasses(),ns.updateSize(),ns.updateSlides(),ns.params.watchOverflow&&ns.checkOverflow(),ns.params.grabCursor&&ns.enabled&&ns.setGrabCursor(),ns.params.loop&&ns.virtual&&ns.params.virtual.enabled?ns.slideTo(ns.params.initialSlide+ns.virtual.slidesBefore,0,ns.params.runCallbacksOnInit,!1,!0):ns.slideTo(ns.params.initialSlide,0,ns.params.runCallbacksOnInit,!1,!0),ns.params.loop&&ns.loopCreate(),ns.attachEvents(),[...ns.el.querySelectorAll('[loading="lazy"]')].forEach(os=>{os.complete?processLazyPreloader(ns,os):os.addEventListener("load",ls=>{processLazyPreloader(ns,ls.target)})}),ns.initialized=!0,ns.emit("init"),ns.emit("afterInit")),ns}destroy(rs=!0,ns=!0){const ss=this,{params:os,el:ls,wrapperEl:us,slides:cs}=ss;return typeof ss.params>"u"||ss.destroyed||(ss.emit("beforeDestroy"),ss.initialized=!1,ss.detachEvents(),os.loop&&ss.loopDestroy(),ns&&(ss.removeClasses(),ls.removeAttribute("style"),us.removeAttribute("style"),cs&&cs.length&&cs.forEach(ds=>{ds.classList.remove(os.slideVisibleClass,os.slideActiveClass,os.slideNextClass,os.slidePrevClass),ds.removeAttribute("style"),ds.removeAttribute("data-swiper-slide-index")})),ss.emit("destroy"),Object.keys(ss.eventsListeners).forEach(ds=>{ss.off(ds)}),rs!==!1&&(ss.el.swiper=null,deleteProps(ss)),ss.destroyed=!0),null}static extendDefaults(rs){extend$1(extendedDefaults,rs)}static get extendedDefaults(){return extendedDefaults}static get defaults(){return defaults$2}static installModule(rs){Ou.prototype.__modules__||(Ou.prototype.__modules__=[]);const ns=Ou.prototype.__modules__;typeof rs=="function"&&ns.indexOf(rs)<0&&ns.push(rs)}static use(rs){return Array.isArray(rs)?(rs.forEach(ns=>Ou.installModule(ns)),Ou):(Ou.installModule(rs),Ou)}};Object.keys(prototypes).forEach(as=>{Object.keys(prototypes[as]).forEach(rs=>{Swiper$1.prototype[rs]=prototypes[as][rs]})});Swiper$1.use([Resize,Observer]);function Keyboard({swiper:as,extendParams:rs,on:ns,emit:ss}){const os=getDocument(),ls=getWindow();as.keyboard={enabled:!1},rs({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0}});function us(ps){if(!as.enabled)return;const{rtlTranslate:fs}=as;let hs=ps;hs.originalEvent&&(hs=hs.originalEvent);const gs=hs.keyCode||hs.charCode,ys=as.params.keyboard.pageUpDown,bs=ys&&gs===33,vs=ys&&gs===34,xs=gs===37,Cs=gs===39,Ts=gs===38,Ss=gs===40;if(!as.allowSlideNext&&(as.isHorizontal()&&Cs||as.isVertical()&&Ss||vs)||!as.allowSlidePrev&&(as.isHorizontal()&&xs||as.isVertical()&&Ts||bs))return!1;if(!(hs.shiftKey||hs.altKey||hs.ctrlKey||hs.metaKey)&&!(os.activeElement&&os.activeElement.nodeName&&(os.activeElement.nodeName.toLowerCase()==="input"||os.activeElement.nodeName.toLowerCase()==="textarea"))){if(as.params.keyboard.onlyInViewport&&(bs||vs||xs||Cs||Ts||Ss)){let Ns=!1;if(elementParents(as.el,`.${as.params.slideClass}, swiper-slide`).length>0&&elementParents(as.el,`.${as.params.slideActiveClass}`).length===0)return;const As=as.el,ws=As.clientWidth,Es=As.clientHeight,_s=ls.innerWidth,$s=ls.innerHeight,Rs=elementOffset(As);fs&&(Rs.left-=As.scrollLeft);const Ds=[[Rs.left,Rs.top],[Rs.left+ws,Rs.top],[Rs.left,Rs.top+Es],[Rs.left+ws,Rs.top+Es]];for(let Os=0;Os=0&&Is[0]<=_s&&Is[1]>=0&&Is[1]<=$s){if(Is[0]===0&&Is[1]===0)continue;Ns=!0}}if(!Ns)return}as.isHorizontal()?((bs||vs||xs||Cs)&&(hs.preventDefault?hs.preventDefault():hs.returnValue=!1),((vs||Cs)&&!fs||(bs||xs)&&fs)&&as.slideNext(),((bs||xs)&&!fs||(vs||Cs)&&fs)&&as.slidePrev()):((bs||vs||Ts||Ss)&&(hs.preventDefault?hs.preventDefault():hs.returnValue=!1),(vs||Ss)&&as.slideNext(),(bs||Ts)&&as.slidePrev()),ss("keyPress",gs)}}function cs(){as.keyboard.enabled||(os.addEventListener("keydown",us),as.keyboard.enabled=!0)}function ds(){as.keyboard.enabled&&(os.removeEventListener("keydown",us),as.keyboard.enabled=!1)}ns("init",()=>{as.params.keyboard.enabled&&cs()}),ns("destroy",()=>{as.keyboard.enabled&&ds()}),Object.assign(as.keyboard,{enable:cs,disable:ds})}function Mousewheel({swiper:as,extendParams:rs,on:ns,emit:ss}){const os=getWindow();rs({mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarget:"container",thresholdDelta:null,thresholdTime:null}}),as.mousewheel={enabled:!1};let ls,us=now(),cs;const ds=[];function ps(Ts){let ws=0,Es=0,_s=0,$s=0;return"detail"in Ts&&(Es=Ts.detail),"wheelDelta"in Ts&&(Es=-Ts.wheelDelta/120),"wheelDeltaY"in Ts&&(Es=-Ts.wheelDeltaY/120),"wheelDeltaX"in Ts&&(ws=-Ts.wheelDeltaX/120),"axis"in Ts&&Ts.axis===Ts.HORIZONTAL_AXIS&&(ws=Es,Es=0),_s=ws*10,$s=Es*10,"deltaY"in Ts&&($s=Ts.deltaY),"deltaX"in Ts&&(_s=Ts.deltaX),Ts.shiftKey&&!_s&&(_s=$s,$s=0),(_s||$s)&&Ts.deltaMode&&(Ts.deltaMode===1?(_s*=40,$s*=40):(_s*=800,$s*=800)),_s&&!ws&&(ws=_s<1?-1:1),$s&&!Es&&(Es=$s<1?-1:1),{spinX:ws,spinY:Es,pixelX:_s,pixelY:$s}}function fs(){as.enabled&&(as.mouseEntered=!0)}function hs(){as.enabled&&(as.mouseEntered=!1)}function gs(Ts){return as.params.mousewheel.thresholdDelta&&Ts.delta=6&&now()-us<60?!0:(Ts.direction<0?(!as.isEnd||as.params.loop)&&!as.animating&&(as.slideNext(),ss("scroll",Ts.raw)):(!as.isBeginning||as.params.loop)&&!as.animating&&(as.slidePrev(),ss("scroll",Ts.raw)),us=new os.Date().getTime(),!1)}function ys(Ts){const Ss=as.params.mousewheel;if(Ts.direction<0){if(as.isEnd&&!as.params.loop&&Ss.releaseOnEdges)return!0}else if(as.isBeginning&&!as.params.loop&&Ss.releaseOnEdges)return!0;return!1}function bs(Ts){let Ss=Ts,Ns=!0;if(!as.enabled)return;const As=as.params.mousewheel;as.params.cssMode&&Ss.preventDefault();let ws=as.el;as.params.mousewheel.eventsTarget!=="container"&&(ws=document.querySelector(as.params.mousewheel.eventsTarget));const Es=ws&&ws.contains(Ss.target);if(!as.mouseEntered&&!Es&&!As.releaseOnEdges)return!0;Ss.originalEvent&&(Ss=Ss.originalEvent);let _s=0;const $s=as.rtlTranslate?-1:1,Rs=ps(Ss);if(As.forceToAxis)if(as.isHorizontal())if(Math.abs(Rs.pixelX)>Math.abs(Rs.pixelY))_s=-Rs.pixelX*$s;else return!0;else if(Math.abs(Rs.pixelY)>Math.abs(Rs.pixelX))_s=-Rs.pixelY;else return!0;else _s=Math.abs(Rs.pixelX)>Math.abs(Rs.pixelY)?-Rs.pixelX*$s:-Rs.pixelY;if(_s===0)return!0;As.invert&&(_s=-_s);let Ds=as.getTranslate()+_s*As.sensitivity;if(Ds>=as.minTranslate()&&(Ds=as.minTranslate()),Ds<=as.maxTranslate()&&(Ds=as.maxTranslate()),Ns=as.params.loop?!0:!(Ds===as.minTranslate()||Ds===as.maxTranslate()),Ns&&as.params.nested&&Ss.stopPropagation(),!as.params.freeMode||!as.params.freeMode.enabled){const Os={time:now(),delta:Math.abs(_s),direction:Math.sign(_s),raw:Ts};ds.length>=2&&ds.shift();const Is=ds.length?ds[ds.length-1]:void 0;if(ds.push(Os),Is?(Os.direction!==Is.direction||Os.delta>Is.delta||Os.time>Is.time+150)&&gs(Os):gs(Os),ys(Os))return!0}else{const Os={time:now(),delta:Math.abs(_s),direction:Math.sign(_s)},Is=cs&&Os.time=as.minTranslate()&&(Vs=as.minTranslate()),Vs<=as.maxTranslate()&&(Vs=as.maxTranslate()),as.setTransition(0),as.setTranslate(Vs),as.updateProgress(),as.updateActiveIndex(),as.updateSlidesClasses(),(!ks&&as.isBeginning||!Ps&&as.isEnd)&&as.updateSlidesClasses(),as.params.loop&&as.loopFix({direction:Os.direction<0?"next":"prev",byMousewheel:!0}),as.params.freeMode.sticky){clearTimeout(ls),ls=void 0,ds.length>=15&&ds.shift();const Bs=ds.length?ds[ds.length-1]:void 0,Ms=ds[0];if(ds.push(Os),Bs&&(Os.delta>Bs.delta||Os.direction!==Bs.direction))ds.splice(0);else if(ds.length>=15&&Os.time-Ms.time<500&&Ms.delta-Os.delta>=1&&Os.delta<=6){const Ws=_s>0?.8:.2;cs=Os,ds.splice(0),ls=nextTick(()=>{as.slideToClosest(as.params.speed,!0,void 0,Ws)},0)}ls||(ls=nextTick(()=>{cs=Os,ds.splice(0),as.slideToClosest(as.params.speed,!0,void 0,.5)},500))}if(Is||ss("scroll",Ss),as.params.autoplay&&as.params.autoplayDisableOnInteraction&&as.autoplay.stop(),Vs===as.minTranslate()||Vs===as.maxTranslate())return!0}}return Ss.preventDefault?Ss.preventDefault():Ss.returnValue=!1,!1}function vs(Ts){let Ss=as.el;as.params.mousewheel.eventsTarget!=="container"&&(Ss=document.querySelector(as.params.mousewheel.eventsTarget)),Ss[Ts]("mouseenter",fs),Ss[Ts]("mouseleave",hs),Ss[Ts]("wheel",bs)}function xs(){return as.params.cssMode?(as.wrapperEl.removeEventListener("wheel",bs),!0):as.mousewheel.enabled?!1:(vs("addEventListener"),as.mousewheel.enabled=!0,!0)}function Cs(){return as.params.cssMode?(as.wrapperEl.addEventListener(event,bs),!0):as.mousewheel.enabled?(vs("removeEventListener"),as.mousewheel.enabled=!1,!0):!1}ns("init",()=>{!as.params.mousewheel.enabled&&as.params.cssMode&&Cs(),as.params.mousewheel.enabled&&xs()}),ns("destroy",()=>{as.params.cssMode&&xs(),as.mousewheel.enabled&&Cs()}),Object.assign(as.mousewheel,{enable:xs,disable:Cs})}function createElementIfNotDefined(as,rs,ns,ss){return as.params.createElements&&Object.keys(ss).forEach(os=>{if(!ns[os]&&ns.auto===!0){let ls=elementChildren(as.el,`.${ss[os]}`)[0];ls||(ls=createElement("div",ss[os]),ls.className=ss[os],as.el.append(ls)),ns[os]=ls,rs[os]=ls}}),ns}function classesToSelector(as=""){return`.${as.trim().replace(/([\.:!\/])/g,"\\$1").replace(/ /g,".")}`}function Pagination({swiper:as,extendParams:rs,on:ns,emit:ss}){const os="swiper-pagination";rs({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:Cs=>Cs,formatFractionTotal:Cs=>Cs,bulletClass:`${os}-bullet`,bulletActiveClass:`${os}-bullet-active`,modifierClass:`${os}-`,currentClass:`${os}-current`,totalClass:`${os}-total`,hiddenClass:`${os}-hidden`,progressbarFillClass:`${os}-progressbar-fill`,progressbarOppositeClass:`${os}-progressbar-opposite`,clickableClass:`${os}-clickable`,lockClass:`${os}-lock`,horizontalClass:`${os}-horizontal`,verticalClass:`${os}-vertical`,paginationDisabledClass:`${os}-disabled`}}),as.pagination={el:null,bullets:[]};let ls,us=0;const cs=Cs=>(Array.isArray(Cs)||(Cs=[Cs].filter(Ts=>!!Ts)),Cs);function ds(){return!as.params.pagination.el||!as.pagination.el||Array.isArray(as.pagination.el)&&as.pagination.el.length===0}function ps(Cs,Ts){const{bulletActiveClass:Ss}=as.params.pagination;Cs&&(Cs=Cs[`${Ts==="prev"?"previous":"next"}ElementSibling`],Cs&&(Cs.classList.add(`${Ss}-${Ts}`),Cs=Cs[`${Ts==="prev"?"previous":"next"}ElementSibling`],Cs&&Cs.classList.add(`${Ss}-${Ts}-${Ts}`)))}function fs(Cs){const Ts=Cs.target.closest(classesToSelector(as.params.pagination.bulletClass));if(!Ts)return;Cs.preventDefault();const Ss=elementIndex(Ts)*as.params.slidesPerGroup;as.params.loop?as.slideToLoop(Ss):as.slideTo(Ss)}function hs(){const Cs=as.rtl,Ts=as.params.pagination;if(ds())return;let Ss=as.pagination.el;Ss=cs(Ss);let Ns;const As=as.virtual&&as.params.virtual.enabled?as.virtual.slides.length:as.slides.length,ws=as.params.loop?Math.ceil(As/as.params.slidesPerGroup):as.snapGrid.length;if(as.params.loop?Ns=as.params.slidesPerGroup>1?Math.floor(as.realIndex/as.params.slidesPerGroup):as.realIndex:typeof as.snapIndex<"u"?Ns=as.snapIndex:Ns=as.activeIndex||0,Ts.type==="bullets"&&as.pagination.bullets&&as.pagination.bullets.length>0){const Es=as.pagination.bullets;let _s,$s,Rs;if(Ts.dynamicBullets&&(ls=elementOuterSize(Es[0],as.isHorizontal()?"width":"height",!0),Ss.forEach(Ds=>{Ds.style[as.isHorizontal()?"width":"height"]=`${ls*(Ts.dynamicMainBullets+4)}px`}),Ts.dynamicMainBullets>1&&as.previousIndex!==void 0&&(us+=Ns-(as.previousIndex||0),us>Ts.dynamicMainBullets-1?us=Ts.dynamicMainBullets-1:us<0&&(us=0)),_s=Math.max(Ns-us,0),$s=_s+(Math.min(Es.length,Ts.dynamicMainBullets)-1),Rs=($s+_s)/2),Es.forEach(Ds=>{Ds.classList.remove(...["","-next","-next-next","-prev","-prev-prev","-main"].map(Os=>`${Ts.bulletActiveClass}${Os}`))}),Ss.length>1)Es.forEach(Ds=>{const Os=elementIndex(Ds);Os===Ns&&Ds.classList.add(Ts.bulletActiveClass),Ts.dynamicBullets&&(Os>=_s&&Os<=$s&&Ds.classList.add(`${Ts.bulletActiveClass}-main`),Os===_s&&ps(Ds,"prev"),Os===$s&&ps(Ds,"next"))});else{const Ds=Es[Ns];if(Ds&&Ds.classList.add(Ts.bulletActiveClass),Ts.dynamicBullets){const Os=Es[_s],Is=Es[$s];for(let Vs=_s;Vs<=$s;Vs+=1)Es[Vs].classList.add(`${Ts.bulletActiveClass}-main`);ps(Os,"prev"),ps(Is,"next")}}if(Ts.dynamicBullets){const Ds=Math.min(Es.length,Ts.dynamicMainBullets+4),Os=(ls*Ds-ls)/2-Rs*ls,Is=Cs?"right":"left";Es.forEach(Vs=>{Vs.style[as.isHorizontal()?Is:"top"]=`${Os}px`})}}Ss.forEach((Es,_s)=>{if(Ts.type==="fraction"&&(Es.querySelectorAll(classesToSelector(Ts.currentClass)).forEach($s=>{$s.textContent=Ts.formatFractionCurrent(Ns+1)}),Es.querySelectorAll(classesToSelector(Ts.totalClass)).forEach($s=>{$s.textContent=Ts.formatFractionTotal(ws)})),Ts.type==="progressbar"){let $s;Ts.progressbarOpposite?$s=as.isHorizontal()?"vertical":"horizontal":$s=as.isHorizontal()?"horizontal":"vertical";const Rs=(Ns+1)/ws;let Ds=1,Os=1;$s==="horizontal"?Ds=Rs:Os=Rs,Es.querySelectorAll(classesToSelector(Ts.progressbarFillClass)).forEach(Is=>{Is.style.transform=`translate3d(0,0,0) scaleX(${Ds}) scaleY(${Os})`,Is.style.transitionDuration=`${as.params.speed}ms`})}Ts.type==="custom"&&Ts.renderCustom?(Es.innerHTML=Ts.renderCustom(as,Ns+1,ws),_s===0&&ss("paginationRender",Es)):(_s===0&&ss("paginationRender",Es),ss("paginationUpdate",Es)),as.params.watchOverflow&&as.enabled&&Es.classList[as.isLocked?"add":"remove"](Ts.lockClass)})}function gs(){const Cs=as.params.pagination;if(ds())return;const Ts=as.virtual&&as.params.virtual.enabled?as.virtual.slides.length:as.slides.length;let Ss=as.pagination.el;Ss=cs(Ss);let Ns="";if(Cs.type==="bullets"){let As=as.params.loop?Math.ceil(Ts/as.params.slidesPerGroup):as.snapGrid.length;as.params.freeMode&&as.params.freeMode.enabled&&As>Ts&&(As=Ts);for(let ws=0;ws`}Cs.type==="fraction"&&(Cs.renderFraction?Ns=Cs.renderFraction.call(as,Cs.currentClass,Cs.totalClass):Ns=` / `),Cs.type==="progressbar"&&(Cs.renderProgressbar?Ns=Cs.renderProgressbar.call(as,Cs.progressbarFillClass):Ns=``),Ss.forEach(As=>{Cs.type!=="custom"&&(As.innerHTML=Ns||""),Cs.type==="bullets"&&(as.pagination.bullets=[...As.querySelectorAll(classesToSelector(Cs.bulletClass))])}),Cs.type!=="custom"&&ss("paginationRender",Ss[0])}function ys(){as.params.pagination=createElementIfNotDefined(as,as.originalParams.pagination,as.params.pagination,{el:"swiper-pagination"});const Cs=as.params.pagination;if(!Cs.el)return;let Ts;typeof Cs.el=="string"&&as.isElement&&(Ts=as.el.shadowRoot.querySelector(Cs.el)),!Ts&&typeof Cs.el=="string"&&(Ts=[...document.querySelectorAll(Cs.el)]),Ts||(Ts=Cs.el),!(!Ts||Ts.length===0)&&(as.params.uniqueNavElements&&typeof Cs.el=="string"&&Array.isArray(Ts)&&Ts.length>1&&(Ts=[...as.el.querySelectorAll(Cs.el)],Ts.length>1&&(Ts=Ts.filter(Ss=>elementParents(Ss,".swiper")[0]===as.el)[0])),Array.isArray(Ts)&&Ts.length===1&&(Ts=Ts[0]),Object.assign(as.pagination,{el:Ts}),Ts=cs(Ts),Ts.forEach(Ss=>{Cs.type==="bullets"&&Cs.clickable&&Ss.classList.add(Cs.clickableClass),Ss.classList.add(Cs.modifierClass+Cs.type),Ss.classList.add(as.isHorizontal()?Cs.horizontalClass:Cs.verticalClass),Cs.type==="bullets"&&Cs.dynamicBullets&&(Ss.classList.add(`${Cs.modifierClass}${Cs.type}-dynamic`),us=0,Cs.dynamicMainBullets<1&&(Cs.dynamicMainBullets=1)),Cs.type==="progressbar"&&Cs.progressbarOpposite&&Ss.classList.add(Cs.progressbarOppositeClass),Cs.clickable&&Ss.addEventListener("click",fs),as.enabled||Ss.classList.add(Cs.lockClass)}))}function bs(){const Cs=as.params.pagination;if(ds())return;let Ts=as.pagination.el;Ts&&(Ts=cs(Ts),Ts.forEach(Ss=>{Ss.classList.remove(Cs.hiddenClass),Ss.classList.remove(Cs.modifierClass+Cs.type),Ss.classList.remove(as.isHorizontal()?Cs.horizontalClass:Cs.verticalClass),Cs.clickable&&Ss.removeEventListener("click",fs)})),as.pagination.bullets&&as.pagination.bullets.forEach(Ss=>Ss.classList.remove(Cs.bulletActiveClass))}ns("init",()=>{as.params.pagination.enabled===!1?xs():(ys(),gs(),hs())}),ns("activeIndexChange",()=>{typeof as.snapIndex>"u"&&hs()}),ns("snapIndexChange",()=>{hs()}),ns("snapGridLengthChange",()=>{gs(),hs()}),ns("destroy",()=>{bs()}),ns("enable disable",()=>{let{el:Cs}=as.pagination;Cs&&(Cs=cs(Cs),Cs.forEach(Ts=>Ts.classList[as.enabled?"remove":"add"](as.params.pagination.lockClass)))}),ns("lock unlock",()=>{hs()}),ns("click",(Cs,Ts)=>{const Ss=Ts.target;let{el:Ns}=as.pagination;if(Array.isArray(Ns)||(Ns=[Ns].filter(As=>!!As)),as.params.pagination.el&&as.params.pagination.hideOnClick&&Ns&&Ns.length>0&&!Ss.classList.contains(as.params.pagination.bulletClass)){if(as.navigation&&(as.navigation.nextEl&&Ss===as.navigation.nextEl||as.navigation.prevEl&&Ss===as.navigation.prevEl))return;const As=Ns[0].classList.contains(as.params.pagination.hiddenClass);ss(As===!0?"paginationShow":"paginationHide"),Ns.forEach(ws=>ws.classList.toggle(as.params.pagination.hiddenClass))}});const vs=()=>{as.el.classList.remove(as.params.pagination.paginationDisabledClass);let{el:Cs}=as.pagination;Cs&&(Cs=cs(Cs),Cs.forEach(Ts=>Ts.classList.remove(as.params.pagination.paginationDisabledClass))),ys(),gs(),hs()},xs=()=>{as.el.classList.add(as.params.pagination.paginationDisabledClass);let{el:Cs}=as.pagination;Cs&&(Cs=cs(Cs),Cs.forEach(Ts=>Ts.classList.add(as.params.pagination.paginationDisabledClass))),bs()};Object.assign(as.pagination,{enable:vs,disable:xs,render:gs,update:hs,init:ys,destroy:bs})}function A11y({swiper:as,extendParams:rs,on:ns}){rs({a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",slideLabelMessage:"{{index}} / {{slidesLength}}",containerMessage:null,containerRoleDescriptionMessage:null,itemRoleDescriptionMessage:null,slideRole:"group",id:null}}),as.a11y={clicked:!1};let ss=null;function os(Is){const Vs=ss;Vs.length!==0&&(Vs.innerHTML="",Vs.innerHTML=Is)}const ls=Is=>(Array.isArray(Is)||(Is=[Is].filter(Vs=>!!Vs)),Is);function us(Is=16){const Vs=()=>Math.round(16*Math.random()).toString(16);return"x".repeat(Is).replace(/x/g,Vs)}function cs(Is){Is=ls(Is),Is.forEach(Vs=>{Vs.setAttribute("tabIndex","0")})}function ds(Is){Is=ls(Is),Is.forEach(Vs=>{Vs.setAttribute("tabIndex","-1")})}function ps(Is,Vs){Is=ls(Is),Is.forEach(ks=>{ks.setAttribute("role",Vs)})}function fs(Is,Vs){Is=ls(Is),Is.forEach(ks=>{ks.setAttribute("aria-roledescription",Vs)})}function hs(Is,Vs){Is=ls(Is),Is.forEach(ks=>{ks.setAttribute("aria-controls",Vs)})}function gs(Is,Vs){Is=ls(Is),Is.forEach(ks=>{ks.setAttribute("aria-label",Vs)})}function ys(Is,Vs){Is=ls(Is),Is.forEach(ks=>{ks.setAttribute("id",Vs)})}function bs(Is,Vs){Is=ls(Is),Is.forEach(ks=>{ks.setAttribute("aria-live",Vs)})}function vs(Is){Is=ls(Is),Is.forEach(Vs=>{Vs.setAttribute("aria-disabled",!0)})}function xs(Is){Is=ls(Is),Is.forEach(Vs=>{Vs.setAttribute("aria-disabled",!1)})}function Cs(Is){if(Is.keyCode!==13&&Is.keyCode!==32)return;const Vs=as.params.a11y,ks=Is.target;as.pagination&&as.pagination.el&&(ks===as.pagination.el||as.pagination.el.contains(Is.target))&&!Is.target.matches(classesToSelector(as.params.pagination.bulletClass))||(as.navigation&&as.navigation.nextEl&&ks===as.navigation.nextEl&&(as.isEnd&&!as.params.loop||as.slideNext(),as.isEnd?os(Vs.lastSlideMessage):os(Vs.nextSlideMessage)),as.navigation&&as.navigation.prevEl&&ks===as.navigation.prevEl&&(as.isBeginning&&!as.params.loop||as.slidePrev(),as.isBeginning?os(Vs.firstSlideMessage):os(Vs.prevSlideMessage)),as.pagination&&ks.matches(classesToSelector(as.params.pagination.bulletClass))&&ks.click())}function Ts(){if(as.params.loop||as.params.rewind||!as.navigation)return;const{nextEl:Is,prevEl:Vs}=as.navigation;Vs&&(as.isBeginning?(vs(Vs),ds(Vs)):(xs(Vs),cs(Vs))),Is&&(as.isEnd?(vs(Is),ds(Is)):(xs(Is),cs(Is)))}function Ss(){return as.pagination&&as.pagination.bullets&&as.pagination.bullets.length}function Ns(){return Ss()&&as.params.pagination.clickable}function As(){const Is=as.params.a11y;Ss()&&as.pagination.bullets.forEach(Vs=>{as.params.pagination.clickable&&(cs(Vs),as.params.pagination.renderBullet||(ps(Vs,"button"),gs(Vs,Is.paginationBulletMessage.replace(/\{\{index\}\}/,elementIndex(Vs)+1)))),Vs.matches(`.${as.params.pagination.bulletActiveClass}`)?Vs.setAttribute("aria-current","true"):Vs.removeAttribute("aria-current")})}const ws=(Is,Vs,ks)=>{cs(Is),Is.tagName!=="BUTTON"&&(ps(Is,"button"),Is.addEventListener("keydown",Cs)),gs(Is,ks),hs(Is,Vs)},Es=()=>{as.a11y.clicked=!0},_s=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{as.destroyed||(as.a11y.clicked=!1)})})},$s=Is=>{if(as.a11y.clicked)return;const Vs=Is.target.closest(`.${as.params.slideClass}, swiper-slide`);if(!Vs||!as.slides.includes(Vs))return;const ks=as.slides.indexOf(Vs)===as.activeIndex,Ps=as.params.watchSlidesProgress&&as.visibleSlides&&as.visibleSlides.includes(Vs);ks||Ps||Is.sourceCapabilities&&Is.sourceCapabilities.firesTouchEvents||(as.isHorizontal()?as.el.scrollLeft=0:as.el.scrollTop=0,as.slideTo(as.slides.indexOf(Vs),0))},Rs=()=>{const Is=as.params.a11y;Is.itemRoleDescriptionMessage&&fs(as.slides,Is.itemRoleDescriptionMessage),Is.slideRole&&ps(as.slides,Is.slideRole);const Vs=as.slides.length;Is.slideLabelMessage&&as.slides.forEach((ks,Ps)=>{const Bs=as.params.loop?parseInt(ks.getAttribute("data-swiper-slide-index"),10):Ps,Ms=Is.slideLabelMessage.replace(/\{\{index\}\}/,Bs+1).replace(/\{\{slidesLength\}\}/,Vs);gs(ks,Ms)})},Ds=()=>{const Is=as.params.a11y;as.el.append(ss);const Vs=as.el;Is.containerRoleDescriptionMessage&&fs(Vs,Is.containerRoleDescriptionMessage),Is.containerMessage&&gs(Vs,Is.containerMessage);const ks=as.wrapperEl,Ps=Is.id||ks.getAttribute("id")||`swiper-wrapper-${us(16)}`,Bs=as.params.autoplay&&as.params.autoplay.enabled?"off":"polite";ys(ks,Ps),bs(ks,Bs),Rs();let{nextEl:Ms,prevEl:Ws}=as.navigation?as.navigation:{};Ms=ls(Ms),Ws=ls(Ws),Ms&&Ms.forEach(Us=>ws(Us,Ps,Is.nextSlideMessage)),Ws&&Ws.forEach(Us=>ws(Us,Ps,Is.prevSlideMessage)),Ns()&&(Array.isArray(as.pagination.el)?as.pagination.el:[as.pagination.el]).forEach(js=>{js.addEventListener("keydown",Cs)}),as.el.addEventListener("focus",$s,!0),as.el.addEventListener("pointerdown",Es,!0),as.el.addEventListener("pointerup",_s,!0)};function Os(){ss&&ss.length>0&&ss.remove();let{nextEl:Is,prevEl:Vs}=as.navigation?as.navigation:{};Is=ls(Is),Vs=ls(Vs),Is&&Is.forEach(ks=>ks.removeEventListener("keydown",Cs)),Vs&&Vs.forEach(ks=>ks.removeEventListener("keydown",Cs)),Ns()&&(Array.isArray(as.pagination.el)?as.pagination.el:[as.pagination.el]).forEach(Ps=>{Ps.removeEventListener("keydown",Cs)}),as.el.removeEventListener("focus",$s,!0),as.el.removeEventListener("pointerdown",Es,!0),as.el.removeEventListener("pointerup",_s,!0)}ns("beforeInit",()=>{ss=createElement("span",as.params.a11y.notificationClass),ss.setAttribute("aria-live","assertive"),ss.setAttribute("aria-atomic","true"),as.isElement&&ss.setAttribute("slot","container-end")}),ns("afterInit",()=>{as.params.a11y.enabled&&Ds()}),ns("slidesLengthChange snapGridLengthChange slidesGridLengthChange",()=>{as.params.a11y.enabled&&Rs()}),ns("fromEdge toEdge afterInit lock unlock",()=>{as.params.a11y.enabled&&Ts()}),ns("paginationUpdate",()=>{as.params.a11y.enabled&&As()}),ns("destroy",()=>{as.params.a11y.enabled&&Os()})}function isObject$3(as){return typeof as=="object"&&as!==null&&as.constructor&&Object.prototype.toString.call(as).slice(8,-1)==="Object"}function extend(as,rs){const ns=["__proto__","constructor","prototype"];Object.keys(rs).filter(ss=>ns.indexOf(ss)<0).forEach(ss=>{typeof as[ss]>"u"?as[ss]=rs[ss]:isObject$3(rs[ss])&&isObject$3(as[ss])&&Object.keys(rs[ss]).length>0?rs[ss].__swiper__?as[ss]=rs[ss]:extend(as[ss],rs[ss]):as[ss]=rs[ss]})}function needsNavigation(as={}){return as.navigation&&typeof as.navigation.nextEl>"u"&&typeof as.navigation.prevEl>"u"}function needsPagination(as={}){return as.pagination&&typeof as.pagination.el>"u"}function needsScrollbar(as={}){return as.scrollbar&&typeof as.scrollbar.el>"u"}function uniqueClasses(as=""){const rs=as.split(" ").map(ss=>ss.trim()).filter(ss=>!!ss),ns=[];return rs.forEach(ss=>{ns.indexOf(ss)<0&&ns.push(ss)}),ns.join(" ")}function wrapperClass(as=""){return as?as.includes("swiper-wrapper")?as:`swiper-wrapper ${as}`:"swiper-wrapper"}const paramsList=["modules","init","_direction","oneWayMovement","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopedSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideNextClass","slidePrevClass","wrapperClass","lazyPreloaderClass","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control","injectStyles","injectStylesUrls"];function getParams(as={},rs=!0){const ns={on:{}},ss={},os={};extend(ns,Swiper$1.defaults),extend(ns,Swiper$1.extendedDefaults),ns._emitClasses=!0,ns.init=!1;const ls={},us=paramsList.map(ds=>ds.replace(/_/,"")),cs=Object.assign({},as);return Object.keys(cs).forEach(ds=>{typeof as[ds]>"u"||(us.indexOf(ds)>=0?isObject$3(as[ds])?(ns[ds]={},os[ds]={},extend(ns[ds],as[ds]),extend(os[ds],as[ds])):(ns[ds]=as[ds],os[ds]=as[ds]):ds.search(/on[A-Z]/)===0&&typeof as[ds]=="function"?rs?ss[`${ds[2].toLowerCase()}${ds.substr(3)}`]=as[ds]:ns.on[`${ds[2].toLowerCase()}${ds.substr(3)}`]=as[ds]:ls[ds]=as[ds])}),["navigation","pagination","scrollbar"].forEach(ds=>{ns[ds]===!0&&(ns[ds]={}),ns[ds]===!1&&delete ns[ds]}),{params:ns,passedParams:os,rest:ls,events:ss}}function mountSwiper({el:as,nextEl:rs,prevEl:ns,paginationEl:ss,scrollbarEl:os,swiper:ls},us){needsNavigation(us)&&rs&&ns&&(ls.params.navigation.nextEl=rs,ls.originalParams.navigation.nextEl=rs,ls.params.navigation.prevEl=ns,ls.originalParams.navigation.prevEl=ns),needsPagination(us)&&ss&&(ls.params.pagination.el=ss,ls.originalParams.pagination.el=ss),needsScrollbar(us)&&os&&(ls.params.scrollbar.el=os,ls.originalParams.scrollbar.el=os),ls.init(as)}function getChangedParams(as,rs,ns,ss,os){const ls=[];if(!rs)return ls;const us=ds=>{ls.indexOf(ds)<0&&ls.push(ds)};if(ns&&ss){const ds=ss.map(os),ps=ns.map(os);ds.join("")!==ps.join("")&&us("children"),ss.length!==ns.length&&us("children")}return paramsList.filter(ds=>ds[0]==="_").map(ds=>ds.replace(/_/,"")).forEach(ds=>{if(ds in as&&ds in rs)if(isObject$3(as[ds])&&isObject$3(rs[ds])){const ps=Object.keys(as[ds]),fs=Object.keys(rs[ds]);ps.length!==fs.length?us(ds):(ps.forEach(hs=>{as[ds][hs]!==rs[ds][hs]&&us(ds)}),fs.forEach(hs=>{as[ds][hs]!==rs[ds][hs]&&us(ds)}))}else as[ds]!==rs[ds]&&us(ds)}),ls}function isChildSwiperSlide(as){return as.type&&as.type.displayName&&as.type.displayName.includes("SwiperSlide")}function processChildren(as){const rs=[];return React.Children.toArray(as).forEach(ns=>{isChildSwiperSlide(ns)?rs.push(ns):ns.props&&ns.props.children&&processChildren(ns.props.children).forEach(ss=>rs.push(ss))}),rs}function getChildren$1(as){const rs=[],ns={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return React.Children.toArray(as).forEach(ss=>{if(isChildSwiperSlide(ss))rs.push(ss);else if(ss.props&&ss.props.slot&&ns[ss.props.slot])ns[ss.props.slot].push(ss);else if(ss.props&&ss.props.children){const os=processChildren(ss.props.children);os.length>0?os.forEach(ls=>rs.push(ls)):ns["container-end"].push(ss)}else ns["container-end"].push(ss)}),{slides:rs,slots:ns}}function updateSwiper({swiper:as,slides:rs,passedParams:ns,changedParams:ss,nextEl:os,prevEl:ls,scrollbarEl:us,paginationEl:cs}){const ds=ss.filter(_s=>_s!=="children"&&_s!=="direction"&&_s!=="wrapperClass"),{params:ps,pagination:fs,navigation:hs,scrollbar:gs,virtual:ys,thumbs:bs}=as;let vs,xs,Cs,Ts,Ss,Ns,As,ws;ss.includes("thumbs")&&ns.thumbs&&ns.thumbs.swiper&&ps.thumbs&&!ps.thumbs.swiper&&(vs=!0),ss.includes("controller")&&ns.controller&&ns.controller.control&&ps.controller&&!ps.controller.control&&(xs=!0),ss.includes("pagination")&&ns.pagination&&(ns.pagination.el||cs)&&(ps.pagination||ps.pagination===!1)&&fs&&!fs.el&&(Cs=!0),ss.includes("scrollbar")&&ns.scrollbar&&(ns.scrollbar.el||us)&&(ps.scrollbar||ps.scrollbar===!1)&&gs&&!gs.el&&(Ts=!0),ss.includes("navigation")&&ns.navigation&&(ns.navigation.prevEl||ls)&&(ns.navigation.nextEl||os)&&(ps.navigation||ps.navigation===!1)&&hs&&!hs.prevEl&&!hs.nextEl&&(Ss=!0);const Es=_s=>{as[_s]&&(as[_s].destroy(),_s==="navigation"?(as.isElement&&(as[_s].prevEl.remove(),as[_s].nextEl.remove()),ps[_s].prevEl=void 0,ps[_s].nextEl=void 0,as[_s].prevEl=void 0,as[_s].nextEl=void 0):(as.isElement&&as[_s].el.remove(),ps[_s].el=void 0,as[_s].el=void 0))};ss.includes("loop")&&as.isElement&&(ps.loop&&!ns.loop?Ns=!0:!ps.loop&&ns.loop?As=!0:ws=!0),ds.forEach(_s=>{if(isObject$3(ps[_s])&&isObject$3(ns[_s]))extend(ps[_s],ns[_s]);else{const $s=ns[_s];($s===!0||$s===!1)&&(_s==="navigation"||_s==="pagination"||_s==="scrollbar")?$s===!1&&Es(_s):ps[_s]=ns[_s]}}),ds.includes("controller")&&!xs&&as.controller&&as.controller.control&&ps.controller&&ps.controller.control&&(as.controller.control=ps.controller.control),ss.includes("children")&&rs&&ys&&ps.virtual.enabled&&(ys.slides=rs,ys.update(!0)),ss.includes("children")&&rs&&ps.loop&&(ws=!0),vs&&bs.init()&&bs.update(!0),xs&&(as.controller.control=ps.controller.control),Cs&&(as.isElement&&(!cs||typeof cs=="string")&&(cs=document.createElement("div"),cs.classList.add("swiper-pagination"),as.el.shadowEl.appendChild(cs)),cs&&(ps.pagination.el=cs),fs.init(),fs.render(),fs.update()),Ts&&(as.isElement&&(!us||typeof us=="string")&&(us=document.createElement("div"),us.classList.add("swiper-scrollbar"),as.el.shadowEl.appendChild(us)),us&&(ps.scrollbar.el=us),gs.init(),gs.updateSize(),gs.setTranslate()),Ss&&(as.isElement&&((!os||typeof os=="string")&&(os=document.createElement("div"),os.classList.add("swiper-button-next"),as.el.shadowEl.appendChild(os)),(!ls||typeof ls=="string")&&(ls=document.createElement("div"),ls.classList.add("swiper-button-prev"),as.el.shadowEl.appendChild(ls))),os&&(ps.navigation.nextEl=os),ls&&(ps.navigation.prevEl=ls),hs.init(),hs.update()),ss.includes("allowSlideNext")&&(as.allowSlideNext=ns.allowSlideNext),ss.includes("allowSlidePrev")&&(as.allowSlidePrev=ns.allowSlidePrev),ss.includes("direction")&&as.changeDirection(ns.direction,!1),(Ns||ws)&&as.loopDestroy(),(As||ws)&&as.loopCreate(),as.update()}function renderVirtual(as,rs,ns){if(!ns)return null;const ss=fs=>{let hs=fs;return fs<0?hs=rs.length+fs:hs>=rs.length&&(hs=hs-rs.length),hs},os=as.isHorizontal()?{[as.rtlTranslate?"right":"left"]:`${ns.offset}px`}:{top:`${ns.offset}px`},{from:ls,to:us}=ns,cs=as.params.loop?-rs.length:0,ds=as.params.loop?rs.length*2:rs.length,ps=[];for(let fs=cs;fs=ls&&fs<=us&&ps.push(rs[ss(fs)]);return ps.map(fs=>React.cloneElement(fs,{swiper:as,style:os}))}const updateOnVirtualData=as=>{!as||as.destroyed||!as.params.virtual||as.params.virtual&&!as.params.virtual.enabled||(as.updateSlides(),as.updateProgress(),as.updateSlidesClasses(),as.parallax&&as.params.parallax&&as.params.parallax.enabled&&as.parallax.setTranslate())};function useIsomorphicLayoutEffect(as,rs){return typeof window>"u"?reactExports.useEffect(as,rs):reactExports.useLayoutEffect(as,rs)}const SwiperSlideContext=reactExports.createContext(null),SwiperContext=reactExports.createContext(null);function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(as){for(var rs=1;rs{bs(!ys)};Object.assign(_s.on,{_containerClasses(Ws,Us){fs(Us)}});const ks=()=>{Object.assign(_s.on,Ds),ds=!0;const Ws={..._s};if(delete Ws.wrapperClass,Cs.current=new Swiper$1(Ws),Cs.current.virtual&&Cs.current.params.virtual.enabled){Cs.current.virtual.slides=Os;const Us={cache:!1,slides:Os,renderExternal:gs,renderExternalUpdate:!1};extend(Cs.current.params.virtual,Us),extend(Cs.current.originalParams.virtual,Us)}};xs.current||ks(),Cs.current&&Cs.current.on("_beforeBreakpoint",Vs);const Ps=()=>{ds||!Ds||!Cs.current||Object.keys(Ds).forEach(Ws=>{Cs.current.on(Ws,Ds[Ws])})},Bs=()=>{!Ds||!Cs.current||Object.keys(Ds).forEach(Ws=>{Cs.current.off(Ws,Ds[Ws])})};reactExports.useEffect(()=>()=>{Cs.current&&Cs.current.off("_beforeBreakpoint",Vs)}),reactExports.useEffect(()=>{!vs.current&&Cs.current&&(Cs.current.emitSlidesClasses(),vs.current=!0)}),useIsomorphicLayoutEffect(()=>{if(rs&&(rs.current=xs.current),!!xs.current)return Cs.current.destroyed&&ks(),mountSwiper({el:xs.current,nextEl:Ns.current,prevEl:As.current,paginationEl:ws.current,scrollbarEl:Es.current,swiper:Cs.current},_s),us&&us(Cs.current),()=>{Cs.current&&!Cs.current.destroyed&&Cs.current.destroy(!0,!1)}},[]),useIsomorphicLayoutEffect(()=>{Ps();const Ws=getChangedParams($s,Ts.current,Os,Ss.current,Us=>Us.key);return Ts.current=$s,Ss.current=Os,Ws.length&&Cs.current&&!Cs.current.destroyed&&updateSwiper({swiper:Cs.current,slides:Os,passedParams:$s,changedParams:Ws,nextEl:Ns.current,prevEl:As.current,scrollbarEl:Es.current,paginationEl:ws.current}),()=>{Bs()}}),useIsomorphicLayoutEffect(()=>{updateOnVirtualData(Cs.current)},[hs]);function Ms(){return _s.virtual?renderVirtual(Cs.current,Os,hs):Os.map((Ws,Us)=>React.cloneElement(Ws,{swiper:Cs.current,swiperSlideIndex:Us}))}return React.createElement(ss,_extends$1({ref:xs,className:uniqueClasses(`${ps}${ns?` ${ns}`:""}`)},Rs),React.createElement(SwiperContext.Provider,{value:Cs.current},Is["container-start"],React.createElement(os,{className:wrapperClass(_s.wrapperClass)},Is["wrapper-start"],Ms(),Is["wrapper-end"]),needsNavigation(_s)&&React.createElement(React.Fragment,null,React.createElement("div",{ref:As,className:"swiper-button-prev"}),React.createElement("div",{ref:Ns,className:"swiper-button-next"})),needsScrollbar(_s)&&React.createElement("div",{ref:Es,className:"swiper-scrollbar"}),needsPagination(_s)&&React.createElement("div",{ref:ws,className:"swiper-pagination"}),Is["container-end"]))});Swiper.displayName="Swiper";function _extends(){return _extends=Object.assign?Object.assign.bind():function(as){for(var rs=1;rs{if(typeof ps<"u"&&(hs.current.swiperSlideIndex=ps),rs&&(rs.current=hs.current),!(!hs.current||!ls)){if(ls.destroyed){gs!=="swiper-slide"&&ys("swiper-slide");return}return ls.on("_slideClass",xs),()=>{ls&&ls.off("_slideClass",xs)}}}),useIsomorphicLayoutEffect(()=>{ls&&hs.current&&!ls.destroyed&&ys(ls.getSlideClasses(hs.current))},[ls]);const Cs={isActive:gs.indexOf("swiper-slide-active")>=0,isVisible:gs.indexOf("swiper-slide-visible")>=0,isPrev:gs.indexOf("swiper-slide-prev")>=0,isNext:gs.indexOf("swiper-slide-next")>=0},Ts=()=>typeof ss=="function"?ss(Cs):ss,Ss=()=>{vs(!0)};return React.createElement(ns,_extends({ref:hs,className:uniqueClasses(`${gs}${os?` ${os}`:""}`),"data-swiper-slide-index":ds,onLoad:Ss},fs),us&&React.createElement(SwiperSlideContext.Provider,{value:Cs},React.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof us=="number"?us:void 0},Ts(),cs&&!bs&&React.createElement("div",{className:"swiper-lazy-preloader"}))),!us&&React.createElement(SwiperSlideContext.Provider,{value:Cs},Ts(),cs&&!bs&&React.createElement("div",{className:"swiper-lazy-preloader"})))});SwiperSlide.displayName="SwiperSlide";const swiper_min="",pagination_min="",keyboard_min="",Carousel$1="";Swiper$1.use([Keyboard,Mousewheel]);function Card$2({activityLink:as,doenetId:rs,imagePath:ns,label:ss,fullName:os}){return jsxs(Box,{display:"flex",flexDirection:"column",height:"180px",width:"180px",background:"black",overflow:"hidden",margin:"10px",border:"2px solid #949494",borderRadius:"6px",children:[jsx$1(Box,{height:"130px",children:jsx$1(Link$1,{to:as,children:jsx$1(Image$2,{width:"100%",height:"100%",objectFit:"contain",src:ns,alt:"Activity Card"})})}),jsxs(Box,{height:"50px",display:"flex",justifyContent:"flex-start",padding:"2px",color:"black",background:"white",children:[jsxs(Box,{width:"40px",display:"flex",alignContent:"center",justifyContent:"center",alignItems:"center",position:"relative",children:[jsx$1(Avatar,{size:"sm",name:os}),jsx$1(Box,{position:"absolute",width:"100px",left:"8px",bottom:"0px",children:jsx$1(Text$1,{fontSize:"10px",children:os})})]}),jsx$1(Box,{children:jsx$1(Text$1,{fontSize:"sm",lineHeight:"1",noOfLines:2,children:ss})})]})]})}const LeftChevron=styled$1(FontAwesomeIcon)` + `),()=>{document.head.removeChild(ps)}},[rs]),reactExports.createElement(PopChildMeasure,{isPresent:rs,childRef:ss,sizeRef:os},reactExports.cloneElement(as,{ref:ss}))}const PresenceChild=({children:as,initial:rs,isPresent:ns,onExitComplete:ss,custom:os,presenceAffectsLayout:ls,mode:us})=>{const cs=useConstant(newChildrenMap),ds=reactExports.useId(),ps=reactExports.useMemo(()=>({id:ds,initial:rs,isPresent:ns,custom:os,onExitComplete:fs=>{cs.set(fs,!0);for(const hs of cs.values())if(!hs)return;ss&&ss()},register:fs=>(cs.set(fs,!1),()=>cs.delete(fs))}),ls?void 0:[ns]);return reactExports.useMemo(()=>{cs.forEach((fs,hs)=>cs.set(hs,!1))},[ns]),reactExports.useEffect(()=>{!ns&&!cs.size&&ss&&ss()},[ns]),us==="popLayout"&&(as=reactExports.createElement(PopChild,{isPresent:ns},as)),reactExports.createElement(PresenceContext.Provider,{value:ps},as)};function newChildrenMap(){return new Map}function useUnmountEffect$1(as){return reactExports.useEffect(()=>()=>as(),[])}const getChildKey=as=>as.key||"";function updateChildLookup(as,rs){as.forEach(ns=>{const ss=getChildKey(ns);rs.set(ss,ns)})}function onlyElements(as){const rs=[];return reactExports.Children.forEach(as,ns=>{reactExports.isValidElement(ns)&&rs.push(ns)}),rs}const AnimatePresence=({children:as,custom:rs,initial:ns=!0,onExitComplete:ss,exitBeforeEnter:os,presenceAffectsLayout:ls=!0,mode:us="sync"})=>{let[cs]=useForceUpdate();const ds=reactExports.useContext(LayoutGroupContext).forceRender;ds&&(cs=ds);const ps=useIsMounted(),fs=onlyElements(as);let hs=fs;const gs=new Set,ys=reactExports.useRef(hs),bs=reactExports.useRef(new Map).current,vs=reactExports.useRef(!0);if(useIsomorphicLayoutEffect$1(()=>{vs.current=!1,updateChildLookup(fs,bs),ys.current=hs}),useUnmountEffect$1(()=>{vs.current=!0,bs.clear(),gs.clear()}),vs.current)return reactExports.createElement(reactExports.Fragment,null,hs.map(Ss=>reactExports.createElement(PresenceChild,{key:getChildKey(Ss),isPresent:!0,initial:ns?void 0:!1,presenceAffectsLayout:ls,mode:us},Ss)));hs=[...hs];const xs=ys.current.map(getChildKey),Cs=fs.map(getChildKey),Ts=xs.length;for(let Ss=0;Ss{if(Cs.indexOf(Ss)!==-1)return;const Ns=bs.get(Ss);if(!Ns)return;const As=xs.indexOf(Ss),ws=()=>{bs.delete(Ss),gs.delete(Ss);const Es=ys.current.findIndex(_s=>_s.key===Ss);if(ys.current.splice(Es,1),!gs.size){if(ys.current=fs,ps.current===!1)return;cs(),ss&&ss()}};hs.splice(As,0,reactExports.createElement(PresenceChild,{key:getChildKey(Ns),isPresent:!1,onExitComplete:ws,custom:rs,presenceAffectsLayout:ls,mode:us},Ns))}),hs=hs.map(Ss=>{const Ns=Ss.key;return gs.has(Ns)?Ss:reactExports.createElement(PresenceChild,{key:getChildKey(Ss),isPresent:!0,presenceAffectsLayout:ls,mode:us},Ss)}),reactExports.createElement(reactExports.Fragment,null,gs.size?hs:hs.map(Ss=>reactExports.cloneElement(Ss)))};var toastMotionVariants={initial:as=>{const{position:rs}=as,ns=["top","bottom"].includes(rs)?"y":"x";let ss=["top-right","bottom-right"].includes(rs)?1:-1;return rs==="bottom"&&(ss=1),{opacity:0,[ns]:ss*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},ToastComponent=reactExports.memo(as=>{const{id:rs,message:ns,onCloseComplete:ss,onRequestRemove:os,requestClose:ls=!1,position:us="bottom",duration:cs=5e3,containerStyle:ds,motionVariants:ps=toastMotionVariants,toastSpacing:fs="0.5rem"}=as,[hs,gs]=reactExports.useState(cs),ys=useIsPresent();useUpdateEffect(()=>{ys||ss==null||ss()},[ys]),useUpdateEffect(()=>{gs(cs)},[cs]);const bs=()=>gs(null),vs=()=>gs(cs),xs=()=>{ys&&os()};reactExports.useEffect(()=>{ys&&ls&&os()},[ys,ls,os]),useTimeout(xs,hs);const Cs=reactExports.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:fs,...ds}),[ds,fs]),Ts=reactExports.useMemo(()=>getToastStyle(us),[us]);return jsx$1(motion.li,{layout:!0,className:"chakra-toast",variants:ps,initial:"initial",animate:"animate",exit:"exit",onHoverStart:bs,onHoverEnd:vs,custom:{position:us},style:Ts,children:jsx$1(chakra.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:Cs,children:runIfFn$2(ns,{id:rs,onClose:xs})})})});ToastComponent.displayName="ToastComponent";var fallbackIcon={path:jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[jsx$1("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),jsx$1("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),jsx$1("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},Icon=forwardRef((as,rs)=>{const{as:ns,viewBox:ss,color:os="currentColor",focusable:ls=!1,children:us,className:cs,__css:ds,...ps}=as,fs=cx("chakra-icon",cs),hs=useStyleConfig("Icon",as),gs={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:os,...ds,...hs},ys={ref:rs,focusable:ls,className:fs,__css:gs},bs=ss??fallbackIcon.viewBox;if(ns&&typeof ns!="string")return jsx$1(chakra.svg,{as:ns,...ys,...ps});const vs=us??fallbackIcon.path;return jsx$1(chakra.svg,{verticalAlign:"middle",viewBox:bs,...ys,...ps,children:vs})});Icon.displayName="Icon";function CheckIcon$1(as){return jsx$1(Icon,{viewBox:"0 0 24 24",...as,children:jsx$1("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function InfoIcon(as){return jsx$1(Icon,{viewBox:"0 0 24 24",...as,children:jsx$1("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function WarningIcon(as){return jsx$1(Icon,{viewBox:"0 0 24 24",...as,children:jsx$1("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var spin=keyframes$1({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),Spinner=forwardRef((as,rs)=>{const ns=useStyleConfig("Spinner",as),{label:ss="Loading...",thickness:os="2px",speed:ls="0.45s",emptyColor:us="transparent",className:cs,...ds}=omitThemingProps(as),ps=cx("chakra-spinner",cs),fs={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:os,borderBottomColor:us,borderLeftColor:us,animation:`${spin} ${ls} linear infinite`,...ns};return jsx$1(chakra.div,{ref:rs,__css:fs,className:ps,...ds,children:ss&&jsx$1(chakra.span,{srOnly:!0,children:ss})})});Spinner.displayName="Spinner";var[AlertProvider,useAlertContext]=createContext$1({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[AlertStylesProvider,useAlertStyles]=createContext$1({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),STATUSES={info:{icon:InfoIcon,colorScheme:"blue"},warning:{icon:WarningIcon,colorScheme:"orange"},success:{icon:CheckIcon$1,colorScheme:"green"},error:{icon:WarningIcon,colorScheme:"red"},loading:{icon:Spinner,colorScheme:"blue"}};function getStatusColorScheme(as){return STATUSES[as].colorScheme}function getStatusIcon(as){return STATUSES[as].icon}var AlertDescription=forwardRef(function as(rs,ns){const os={display:"inline",...useAlertStyles().description};return jsx$1(chakra.div,{ref:ns,...rs,className:cx("chakra-alert__desc",rs.className),__css:os})});AlertDescription.displayName="AlertDescription";function AlertIcon(as){const{status:rs}=useAlertContext(),ns=getStatusIcon(rs),ss=useAlertStyles(),os=rs==="loading"?ss.spinner:ss.icon;return jsx$1(chakra.span,{display:"inherit",...as,className:cx("chakra-alert__icon",as.className),__css:os,children:as.children||jsx$1(ns,{h:"100%",w:"100%"})})}AlertIcon.displayName="AlertIcon";var AlertTitle=forwardRef(function as(rs,ns){const ss=useAlertStyles();return jsx$1(chakra.div,{ref:ns,...rs,className:cx("chakra-alert__title",rs.className),__css:ss.title})});AlertTitle.displayName="AlertTitle";var Alert$1=forwardRef(function as(rs,ns){var ss;const{status:os="info",addRole:ls=!0,...us}=omitThemingProps(rs),cs=(ss=rs.colorScheme)!=null?ss:getStatusColorScheme(os),ds=useMultiStyleConfig("Alert",{...rs,colorScheme:cs}),ps={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...ds.container};return jsx$1(AlertProvider,{value:{status:os},children:jsx$1(AlertStylesProvider,{value:ds,children:jsx$1(chakra.div,{role:ls?"alert":void 0,ref:ns,...us,className:cx("chakra-alert",rs.className),__css:ps})})})});Alert$1.displayName="Alert";function CloseIcon(as){return jsx$1(Icon,{focusable:"false","aria-hidden":!0,...as,children:jsx$1("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var CloseButton=forwardRef(function as(rs,ns){const ss=useStyleConfig("CloseButton",rs),{children:os,isDisabled:ls,__css:us,...cs}=omitThemingProps(rs),ds={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return jsx$1(chakra.button,{type:"button","aria-label":"Close",ref:ns,disabled:ls,__css:{...ds,...ss,...us},...cs,children:os||jsx$1(CloseIcon,{width:"1em",height:"1em"})})});CloseButton.displayName="CloseButton";var initialState$1={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},toastStore=createStore(initialState$1);function createStore(as){let rs=as;const ns=new Set,ss=os=>{rs=os(rs),ns.forEach(ls=>ls())};return{getState:()=>rs,subscribe:os=>(ns.add(os),()=>{ss(()=>as),ns.delete(os)}),removeToast:(os,ls)=>{ss(us=>({...us,[ls]:us[ls].filter(cs=>cs.id!=os)}))},notify:(os,ls)=>{const us=createToast(os,ls),{position:cs,id:ds}=us;return ss(ps=>{var fs,hs;const ys=cs.includes("top")?[us,...(fs=ps[cs])!=null?fs:[]]:[...(hs=ps[cs])!=null?hs:[],us];return{...ps,[cs]:ys}}),ds},update:(os,ls)=>{os&&ss(us=>{const cs={...us},{position:ds,index:ps}=findToast(cs,os);return ds&&ps!==-1&&(cs[ds][ps]={...cs[ds][ps],...ls,message:createRenderToast(ls)}),cs})},closeAll:({positions:os}={})=>{ss(ls=>(os??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((ds,ps)=>(ds[ps]=ls[ps].map(fs=>({...fs,requestClose:!0})),ds),{...ls}))},close:os=>{ss(ls=>{const us=getToastPosition(ls,os);return us?{...ls,[us]:ls[us].map(cs=>cs.id==os?{...cs,requestClose:!0}:cs)}:ls})},isActive:os=>!!findToast(toastStore.getState(),os).position}}var counter=0;function createToast(as,rs={}){var ns,ss;counter+=1;const os=(ns=rs.id)!=null?ns:counter,ls=(ss=rs.position)!=null?ss:"bottom";return{id:os,message:as,position:ls,duration:rs.duration,onCloseComplete:rs.onCloseComplete,onRequestRemove:()=>toastStore.removeToast(String(os),ls),status:rs.status,requestClose:!1,containerStyle:rs.containerStyle}}var Toast=as=>{const{status:rs,variant:ns="solid",id:ss,title:os,isClosable:ls,onClose:us,description:cs,icon:ds}=as,ps=ss?{root:`toast-${ss}`,title:`toast-${ss}-title`,description:`toast-${ss}-description`}:void 0;return jsxs(Alert$1,{addRole:!1,status:rs,variant:ns,id:ps==null?void 0:ps.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",children:[jsx$1(AlertIcon,{children:ds}),jsxs(chakra.div,{flex:"1",maxWidth:"100%",children:[os&&jsx$1(AlertTitle,{id:ps==null?void 0:ps.title,children:os}),cs&&jsx$1(AlertDescription,{id:ps==null?void 0:ps.description,display:"block",children:cs})]}),ls&&jsx$1(CloseButton,{size:"sm",onClick:us,position:"absolute",insetEnd:1,top:1})]})};function createRenderToast(as={}){const{render:rs,toastComponent:ns=Toast}=as;return os=>typeof rs=="function"?rs({...os,...as}):jsx$1(ns,{...os,...as})}var[ToastOptionProvider,useToastOptionContext]=createContext$1({name:"ToastOptionsContext",strict:!1}),ToastProvider=as=>{const rs=reactExports.useSyncExternalStore(toastStore.subscribe,toastStore.getState,toastStore.getState),{motionVariants:ns,component:ss=ToastComponent,portalProps:os}=as,us=Object.keys(rs).map(cs=>{const ds=rs[cs];return jsx$1("ul",{role:"region","aria-live":"polite",id:`chakra-toast-manager-${cs}`,style:getToastListStyle(cs),children:jsx$1(AnimatePresence,{initial:!1,children:ds.map(ps=>jsx$1(ss,{motionVariants:ns,...ps},ps.id))})},cs)});return jsx$1(Portal,{...os,children:us})},createChakraProvider=as=>function({children:ns,theme:ss=as,toastOptions:os,...ls}){return jsxs(ChakraProvider$1,{theme:ss,...ls,children:[jsx$1(ToastOptionProvider,{value:os==null?void 0:os.defaultOptions,children:ns}),jsx$1(ToastProvider,{...os})]})},ChakraProvider=createChakraProvider(theme$1),__defProp=Object.defineProperty,__defNormalProp=(as,rs,ns)=>rs in as?__defProp(as,rs,{enumerable:!0,configurable:!0,writable:!0,value:ns}):as[rs]=ns,__publicField=(as,rs,ns)=>(__defNormalProp(as,typeof rs!="symbol"?rs+"":rs,ns),ns);function sortNodes(as){return as.sort((rs,ns)=>{const ss=rs.compareDocumentPosition(ns);if(ss&Node.DOCUMENT_POSITION_FOLLOWING||ss&Node.DOCUMENT_POSITION_CONTAINED_BY)return-1;if(ss&Node.DOCUMENT_POSITION_PRECEDING||ss&Node.DOCUMENT_POSITION_CONTAINS)return 1;if(ss&Node.DOCUMENT_POSITION_DISCONNECTED||ss&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC)throw Error("Cannot sort the given nodes.");return 0})}var isElement$3=as=>typeof as=="object"&&"nodeType"in as&&as.nodeType===Node.ELEMENT_NODE;function getNextIndex(as,rs,ns){let ss=as+1;return ns&&ss>=rs&&(ss=0),ss}function getPrevIndex(as,rs,ns){let ss=as-1;return ns&&ss<0&&(ss=rs),ss}var useSafeLayoutEffect=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,cast=as=>as,DescendantsManager=class{constructor(){__publicField(this,"descendants",new Map),__publicField(this,"register",as=>{if(as!=null)return isElement$3(as)?this.registerNode(as):rs=>{this.registerNode(rs,as)}}),__publicField(this,"unregister",as=>{this.descendants.delete(as);const rs=sortNodes(Array.from(this.descendants.keys()));this.assignIndex(rs)}),__publicField(this,"destroy",()=>{this.descendants.clear()}),__publicField(this,"assignIndex",as=>{this.descendants.forEach(rs=>{const ns=as.indexOf(rs.node);rs.index=ns,rs.node.dataset.index=rs.index.toString()})}),__publicField(this,"count",()=>this.descendants.size),__publicField(this,"enabledCount",()=>this.enabledValues().length),__publicField(this,"values",()=>Array.from(this.descendants.values()).sort((rs,ns)=>rs.index-ns.index)),__publicField(this,"enabledValues",()=>this.values().filter(as=>!as.disabled)),__publicField(this,"item",as=>{if(this.count()!==0)return this.values()[as]}),__publicField(this,"enabledItem",as=>{if(this.enabledCount()!==0)return this.enabledValues()[as]}),__publicField(this,"first",()=>this.item(0)),__publicField(this,"firstEnabled",()=>this.enabledItem(0)),__publicField(this,"last",()=>this.item(this.descendants.size-1)),__publicField(this,"lastEnabled",()=>{const as=this.enabledValues().length-1;return this.enabledItem(as)}),__publicField(this,"indexOf",as=>{var rs,ns;return as&&(ns=(rs=this.descendants.get(as))==null?void 0:rs.index)!=null?ns:-1}),__publicField(this,"enabledIndexOf",as=>as==null?-1:this.enabledValues().findIndex(rs=>rs.node.isSameNode(as))),__publicField(this,"next",(as,rs=!0)=>{const ns=getNextIndex(as,this.count(),rs);return this.item(ns)}),__publicField(this,"nextEnabled",(as,rs=!0)=>{const ns=this.item(as);if(!ns)return;const ss=this.enabledIndexOf(ns.node),os=getNextIndex(ss,this.enabledCount(),rs);return this.enabledItem(os)}),__publicField(this,"prev",(as,rs=!0)=>{const ns=getPrevIndex(as,this.count()-1,rs);return this.item(ns)}),__publicField(this,"prevEnabled",(as,rs=!0)=>{const ns=this.item(as);if(!ns)return;const ss=this.enabledIndexOf(ns.node),os=getPrevIndex(ss,this.enabledCount()-1,rs);return this.enabledItem(os)}),__publicField(this,"registerNode",(as,rs)=>{if(!as||this.descendants.has(as))return;const ns=Array.from(this.descendants.keys()).concat(as),ss=sortNodes(ns);rs!=null&&rs.disabled&&(rs.disabled=!!rs.disabled);const os={node:as,index:-1,...rs};this.descendants.set(as,os),this.assignIndex(ss)})}};function assignRef(as,rs){if(as!=null){if(typeof as=="function"){as(rs);return}try{as.current=rs}catch{throw new Error(`Cannot assign value '${rs}' to ref '${as}'`)}}}function mergeRefs(...as){return rs=>{as.forEach(ns=>{assignRef(ns,rs)})}}function useMergeRefs(...as){return reactExports.useMemo(()=>mergeRefs(...as),as)}function useDescendants(){const as=reactExports.useRef(new DescendantsManager);return useSafeLayoutEffect(()=>()=>as.current.destroy()),as.current}var[DescendantsContextProvider,useDescendantsContext]=createContext$1({name:"DescendantsProvider",errorMessage:"useDescendantsContext must be used within DescendantsProvider"});function useDescendant(as){const rs=useDescendantsContext(),[ns,ss]=reactExports.useState(-1),os=reactExports.useRef(null);useSafeLayoutEffect(()=>()=>{os.current&&rs.unregister(os.current)},[]),useSafeLayoutEffect(()=>{if(!os.current)return;const us=Number(os.current.dataset.index);ns!=us&&!Number.isNaN(us)&&ss(us)});const ls=cast(as?rs.register(as):rs.register);return{descendants:rs,index:ns,enabledIndex:rs.enabledIndexOf(os.current),register:mergeRefs(ls,os)}}function createDescendantContext(){return[cast(DescendantsContextProvider),()=>cast(useDescendantsContext()),()=>useDescendants(),os=>useDescendant(os)]}function useControllableState(as){const{value:rs,defaultValue:ns,onChange:ss,shouldUpdate:os=(gs,ys)=>gs!==ys}=as,ls=useCallbackRef(ss),us=useCallbackRef(os),[cs,ds]=reactExports.useState(ns),ps=rs!==void 0,fs=ps?rs:cs,hs=useCallbackRef(gs=>{const bs=typeof gs=="function"?gs(fs):gs;us(fs,bs)&&(ps||ds(bs),ls(bs))},[ps,ls,fs,us]);return[fs,hs]}var[AvatarStylesProvider,useAvatarStyles]=createContext$1({name:"AvatarStylesContext",hookName:"useAvatarStyles",providerName:""});function initials(as){const[rs,ns]=as.split(" ");return rs&&ns?`${rs.charAt(0)}${ns.charAt(0)}`:rs.charAt(0)}function AvatarName(as){const{name:rs,getInitials:ns,...ss}=as,os=useAvatarStyles();return jsx$1(chakra.div,{role:"img","aria-label":rs,...ss,__css:os.label,children:rs?ns==null?void 0:ns(rs):null})}AvatarName.displayName="AvatarName";var GenericAvatarIcon=as=>jsxs(chakra.svg,{viewBox:"0 0 128 128",color:"#fff",width:"100%",height:"100%",className:"chakra-avatar__svg",...as,children:[jsx$1("path",{fill:"currentColor",d:"M103,102.1388 C93.094,111.92 79.3504,118 64.1638,118 C48.8056,118 34.9294,111.768 25,101.7892 L25,95.2 C25,86.8096 31.981,80 40.6,80 L87.4,80 C96.019,80 103,86.8096 103,95.2 L103,102.1388 Z"}),jsx$1("path",{fill:"currentColor",d:"M63.9961647,24 C51.2938136,24 41,34.2938136 41,46.9961647 C41,59.7061864 51.2938136,70 63.9961647,70 C76.6985159,70 87,59.7061864 87,46.9961647 C87,34.2938136 76.6985159,24 63.9961647,24"})]}),NativeImage=forwardRef(function as(rs,ns){const{htmlWidth:ss,htmlHeight:os,alt:ls,...us}=rs;return jsx$1("img",{width:ss,height:os,ref:ns,alt:ls,...us})});NativeImage.displayName="NativeImage";function useImage(as){const{loading:rs,src:ns,srcSet:ss,onLoad:os,onError:ls,crossOrigin:us,sizes:cs,ignoreFallback:ds}=as,[ps,fs]=reactExports.useState("pending");reactExports.useEffect(()=>{fs(ns?"loading":"pending")},[ns]);const hs=reactExports.useRef(),gs=reactExports.useCallback(()=>{if(!ns)return;ys();const bs=new Image;bs.src=ns,us&&(bs.crossOrigin=us),ss&&(bs.srcset=ss),cs&&(bs.sizes=cs),rs&&(bs.loading=rs),bs.onload=vs=>{ys(),fs("loaded"),os==null||os(vs)},bs.onerror=vs=>{ys(),fs("failed"),ls==null||ls(vs)},hs.current=bs},[ns,us,ss,cs,os,ls,rs]),ys=()=>{hs.current&&(hs.current.onload=null,hs.current.onerror=null,hs.current=null)};return useSafeLayoutEffect$1(()=>{if(!ds)return ps==="loading"&&gs(),()=>{ys()}},[ps,gs,ds]),ds?"loaded":ps}var shouldShowFallbackImage=(as,rs)=>as!=="loaded"&&rs==="beforeLoadOrError"||as==="failed"&&rs==="onError";function omit$2(as,rs=[]){const ns=Object.assign({},as);for(const ss of rs)ss in ns&&delete ns[ss];return ns}var Image$2=forwardRef(function as(rs,ns){const{fallbackSrc:ss,fallback:os,src:ls,srcSet:us,align:cs,fit:ds,loading:ps,ignoreFallback:fs,crossOrigin:hs,fallbackStrategy:gs="beforeLoadOrError",referrerPolicy:ys,...bs}=rs,vs=ss!==void 0||os!==void 0,xs=ps!=null||fs||!vs,Cs=useImage({...rs,ignoreFallback:xs}),Ts=shouldShowFallbackImage(Cs,gs),Ss={ref:ns,objectFit:ds,objectPosition:cs,...xs?bs:omit$2(bs,["onError","onLoad"])};return Ts?os||jsx$1(chakra.img,{as:NativeImage,className:"chakra-image__placeholder",src:ss,...Ss}):jsx$1(chakra.img,{as:NativeImage,src:ls,srcSet:us,crossOrigin:hs,loading:ps,referrerPolicy:ys,className:"chakra-image",...Ss})});Image$2.displayName="Image";function AvatarImage(as){const{src:rs,srcSet:ns,onError:ss,onLoad:os,getInitials:ls,name:us,borderRadius:cs,loading:ds,iconLabel:ps,icon:fs=jsx$1(GenericAvatarIcon,{}),ignoreFallback:hs,referrerPolicy:gs,crossOrigin:ys}=as,vs=useImage({src:rs,onError:ss,ignoreFallback:hs})==="loaded";return!rs||!vs?us?jsx$1(AvatarName,{className:"chakra-avatar__initials",getInitials:ls,name:us}):reactExports.cloneElement(fs,{role:"img","aria-label":ps}):jsx$1(chakra.img,{src:rs,srcSet:ns,alt:us,onLoad:os,referrerPolicy:gs,crossOrigin:ys??void 0,className:"chakra-avatar__img",loading:ds,__css:{width:"100%",height:"100%",objectFit:"cover",borderRadius:cs}})}AvatarImage.displayName="AvatarImage";var baseStyle={display:"inline-flex",alignItems:"center",justifyContent:"center",textAlign:"center",textTransform:"uppercase",fontWeight:"medium",position:"relative",flexShrink:0},Avatar=forwardRef((as,rs)=>{const ns=useMultiStyleConfig("Avatar",as),[ss,os]=reactExports.useState(!1),{src:ls,srcSet:us,name:cs,showBorder:ds,borderRadius:ps="full",onError:fs,onLoad:hs,getInitials:gs=initials,icon:ys=jsx$1(GenericAvatarIcon,{}),iconLabel:bs=" avatar",loading:vs,children:xs,borderColor:Cs,ignoreFallback:Ts,crossOrigin:Ss,...Ns}=omitThemingProps(as),As={borderRadius:ps,borderWidth:ds?"2px":void 0,...baseStyle,...ns.container};return Cs&&(As.borderColor=Cs),jsx$1(chakra.span,{ref:rs,...Ns,className:cx("chakra-avatar",as.className),"data-loaded":dataAttr(ss),__css:As,children:jsxs(AvatarStylesProvider,{value:ns,children:[jsx$1(AvatarImage,{src:ls,srcSet:us,loading:vs,onLoad:callAllHandlers(hs,()=>{os(!0)}),onError:fs,getInitials:gs,name:cs,borderRadius:ps,icon:ys,iconLabel:bs,ignoreFallback:Ts,crossOrigin:Ss}),xs]})})});Avatar.displayName="Avatar";function getValidChildren(as){return reactExports.Children.toArray(as).filter(rs=>reactExports.isValidElement(rs))}var[ButtonGroupProvider,useButtonGroup]=createContext$1({strict:!1,name:"ButtonGroupContext"});function useButtonType(as){const[rs,ns]=reactExports.useState(!as);return{ref:reactExports.useCallback(ls=>{ls&&ns(ls.tagName==="BUTTON")},[]),type:rs?"button":void 0}}function ButtonIcon(as){const{children:rs,className:ns,...ss}=as,os=reactExports.isValidElement(rs)?reactExports.cloneElement(rs,{"aria-hidden":!0,focusable:!1}):rs,ls=cx("chakra-button__icon",ns);return jsx$1(chakra.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...ss,className:ls,children:os})}ButtonIcon.displayName="ButtonIcon";function ButtonSpinner(as){const{label:rs,placement:ns,spacing:ss="0.5rem",children:os=jsx$1(Spinner,{color:"currentColor",width:"1em",height:"1em"}),className:ls,__css:us,...cs}=as,ds=cx("chakra-button__spinner",ls),ps=ns==="start"?"marginEnd":"marginStart",fs=reactExports.useMemo(()=>({display:"flex",alignItems:"center",position:rs?"relative":"absolute",[ps]:rs?ss:0,fontSize:"1em",lineHeight:"normal",...us}),[us,rs,ps,ss]);return jsx$1(chakra.div,{className:ds,...cs,__css:fs,children:os})}ButtonSpinner.displayName="ButtonSpinner";var Button=forwardRef((as,rs)=>{const ns=useButtonGroup(),ss=useStyleConfig("Button",{...ns,...as}),{isDisabled:os=ns==null?void 0:ns.isDisabled,isLoading:ls,isActive:us,children:cs,leftIcon:ds,rightIcon:ps,loadingText:fs,iconSpacing:hs="0.5rem",type:gs,spinner:ys,spinnerPlacement:bs="start",className:vs,as:xs,...Cs}=omitThemingProps(as),Ts=reactExports.useMemo(()=>{const ws={...ss==null?void 0:ss._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...ss,...!!ns&&{_focus:ws}}},[ss,ns]),{ref:Ss,type:Ns}=useButtonType(xs),As={rightIcon:ps,leftIcon:ds,iconSpacing:hs,children:cs};return jsxs(chakra.button,{ref:useMergeRefs(rs,Ss),as:xs,type:gs??Ns,"data-active":dataAttr(us),"data-loading":dataAttr(ls),__css:Ts,className:cx("chakra-button",vs),...Cs,disabled:os||ls,children:[ls&&bs==="start"&&jsx$1(ButtonSpinner,{className:"chakra-button__spinner--start",label:fs,placement:"start",spacing:hs,children:ys}),ls?fs||jsx$1(chakra.span,{opacity:0,children:jsx$1(ButtonContent,{...As})}):jsx$1(ButtonContent,{...As}),ls&&bs==="end"&&jsx$1(ButtonSpinner,{className:"chakra-button__spinner--end",label:fs,placement:"end",spacing:hs,children:ys})]})});Button.displayName="Button";function ButtonContent(as){const{leftIcon:rs,rightIcon:ns,children:ss,iconSpacing:os}=as;return jsxs(Fragment,{children:[rs&&jsx$1(ButtonIcon,{marginEnd:os,children:rs}),ss,ns&&jsx$1(ButtonIcon,{marginStart:os,children:ns})]})}var IconButton=forwardRef((as,rs)=>{const{icon:ns,children:ss,isRound:os,"aria-label":ls,...us}=as,cs=ns||ss,ds=reactExports.isValidElement(cs)?reactExports.cloneElement(cs,{"aria-hidden":!0,focusable:!1}):null;return jsx$1(Button,{padding:"0",borderRadius:os?"full":void 0,ref:rs,"aria-label":ls,...us,children:ds})});IconButton.displayName="IconButton";var[CheckboxGroupProvider,useCheckboxGroupContext]=createContext$1({name:"CheckboxGroupContext",strict:!1});function CheckIcon(as){return jsx$1(chakra.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...as,children:jsx$1("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function IndeterminateIcon(as){return jsx$1(chakra.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...as,children:jsx$1("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function CheckboxIcon(as){const{isIndeterminate:rs,isChecked:ns,...ss}=as,os=rs?IndeterminateIcon:CheckIcon;return ns||rs?jsx$1(chakra.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:jsx$1(os,{...ss})}):null}var[FormControlStylesProvider,useFormControlStyles]=createContext$1({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[FormControlProvider,useFormControlContext]=createContext$1({strict:!1,name:"FormControlContext"});function useFormControlProvider(as){const{id:rs,isRequired:ns,isInvalid:ss,isDisabled:os,isReadOnly:ls,...us}=as,cs=reactExports.useId(),ds=rs||`field-${cs}`,ps=`${ds}-label`,fs=`${ds}-feedback`,hs=`${ds}-helptext`,[gs,ys]=reactExports.useState(!1),[bs,vs]=reactExports.useState(!1),[xs,Cs]=reactExports.useState(!1),Ts=reactExports.useCallback((Es={},_s=null)=>({id:hs,...Es,ref:mergeRefs(_s,$s=>{$s&&vs(!0)})}),[hs]),Ss=reactExports.useCallback((Es={},_s=null)=>({...Es,ref:_s,"data-focus":dataAttr(xs),"data-disabled":dataAttr(os),"data-invalid":dataAttr(ss),"data-readonly":dataAttr(ls),id:Es.id!==void 0?Es.id:ps,htmlFor:Es.htmlFor!==void 0?Es.htmlFor:ds}),[ds,os,xs,ss,ls,ps]),Ns=reactExports.useCallback((Es={},_s=null)=>({id:fs,...Es,ref:mergeRefs(_s,$s=>{$s&&ys(!0)}),"aria-live":"polite"}),[fs]),As=reactExports.useCallback((Es={},_s=null)=>({...Es,...us,ref:_s,role:"group"}),[us]),ws=reactExports.useCallback((Es={},_s=null)=>({...Es,ref:_s,role:"presentation","aria-hidden":!0,children:Es.children||"*"}),[]);return{isRequired:!!ns,isInvalid:!!ss,isReadOnly:!!ls,isDisabled:!!os,isFocused:!!xs,onFocus:()=>Cs(!0),onBlur:()=>Cs(!1),hasFeedbackText:gs,setHasFeedbackText:ys,hasHelpText:bs,setHasHelpText:vs,id:ds,labelId:ps,feedbackId:fs,helpTextId:hs,htmlProps:us,getHelpTextProps:Ts,getErrorMessageProps:Ns,getRootProps:As,getLabelProps:Ss,getRequiredIndicatorProps:ws}}var FormControl=forwardRef(function as(rs,ns){const ss=useMultiStyleConfig("Form",rs),os=omitThemingProps(rs),{getRootProps:ls,htmlProps:us,...cs}=useFormControlProvider(os),ds=cx("chakra-form-control",rs.className);return jsx$1(FormControlProvider,{value:cs,children:jsx$1(FormControlStylesProvider,{value:ss,children:jsx$1(chakra.div,{...ls({},ns),className:ds,__css:ss.container})})})});FormControl.displayName="FormControl";var FormHelperText=forwardRef(function as(rs,ns){const ss=useFormControlContext(),os=useFormControlStyles(),ls=cx("chakra-form__helper-text",rs.className);return jsx$1(chakra.div,{...ss==null?void 0:ss.getHelpTextProps(rs,ns),__css:os.helperText,className:ls})});FormHelperText.displayName="FormHelperText";function useFormControl(as){const{isDisabled:rs,isInvalid:ns,isReadOnly:ss,isRequired:os,...ls}=useFormControlProps(as);return{...ls,disabled:rs,readOnly:ss,required:os,"aria-invalid":ariaAttr(ns),"aria-required":ariaAttr(os),"aria-readonly":ariaAttr(ss)}}function useFormControlProps(as){var rs,ns,ss;const os=useFormControlContext(),{id:ls,disabled:us,readOnly:cs,required:ds,isRequired:ps,isInvalid:fs,isReadOnly:hs,isDisabled:gs,onFocus:ys,onBlur:bs,...vs}=as,xs=as["aria-describedby"]?[as["aria-describedby"]]:[];return os!=null&&os.hasFeedbackText&&(os!=null&&os.isInvalid)&&xs.push(os.feedbackId),os!=null&&os.hasHelpText&&xs.push(os.helpTextId),{...vs,"aria-describedby":xs.join(" ")||void 0,id:ls??(os==null?void 0:os.id),isDisabled:(rs=us??gs)!=null?rs:os==null?void 0:os.isDisabled,isReadOnly:(ns=cs??hs)!=null?ns:os==null?void 0:os.isReadOnly,isRequired:(ss=ds??ps)!=null?ss:os==null?void 0:os.isRequired,isInvalid:fs??(os==null?void 0:os.isInvalid),onFocus:callAllHandlers(os==null?void 0:os.onFocus,ys),onBlur:callAllHandlers(os==null?void 0:os.onBlur,bs)}}var visuallyHiddenStyle={border:"0",clip:"rect(0, 0, 0, 0)",height:"1px",width:"1px",margin:"-1px",padding:"0",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},hasSetup=!1,modality=null,hasEventBeforeFocus=!1,hasBlurredWindowRecently=!1,handlers=new Set;function trigger(as,rs){handlers.forEach(ns=>ns(as,rs))}var isMac=typeof window<"u"&&window.navigator!=null?/^Mac/.test(window.navigator.platform):!1;function isValidKey(as){return!(as.metaKey||!isMac&&as.altKey||as.ctrlKey||as.key==="Control"||as.key==="Shift"||as.key==="Meta")}function onKeyboardEvent(as){hasEventBeforeFocus=!0,isValidKey(as)&&(modality="keyboard",trigger("keyboard",as))}function onPointerEvent(as){if(modality="pointer",as.type==="mousedown"||as.type==="pointerdown"){hasEventBeforeFocus=!0;const rs=as.composedPath?as.composedPath()[0]:as.target;let ns=!1;try{ns=rs.matches(":focus-visible")}catch{}if(ns)return;trigger("pointer",as)}}function isVirtualClick(as){return as.mozInputSource===0&&as.isTrusted?!0:as.detail===0&&!as.pointerType}function onClickEvent(as){isVirtualClick(as)&&(hasEventBeforeFocus=!0,modality="virtual")}function onWindowFocus(as){as.target===window||as.target===document||(!hasEventBeforeFocus&&!hasBlurredWindowRecently&&(modality="virtual",trigger("virtual",as)),hasEventBeforeFocus=!1,hasBlurredWindowRecently=!1)}function onWindowBlur(){hasEventBeforeFocus=!1,hasBlurredWindowRecently=!0}function isFocusVisible(){return modality!=="pointer"}function setupGlobalFocusEvents(){if(typeof window>"u"||hasSetup)return;const{focus:as}=HTMLElement.prototype;HTMLElement.prototype.focus=function(...ns){hasEventBeforeFocus=!0,as.apply(this,ns)},document.addEventListener("keydown",onKeyboardEvent,!0),document.addEventListener("keyup",onKeyboardEvent,!0),document.addEventListener("click",onClickEvent,!0),window.addEventListener("focus",onWindowFocus,!0),window.addEventListener("blur",onWindowBlur,!1),typeof PointerEvent<"u"?(document.addEventListener("pointerdown",onPointerEvent,!0),document.addEventListener("pointermove",onPointerEvent,!0),document.addEventListener("pointerup",onPointerEvent,!0)):(document.addEventListener("mousedown",onPointerEvent,!0),document.addEventListener("mousemove",onPointerEvent,!0),document.addEventListener("mouseup",onPointerEvent,!0)),hasSetup=!0}function trackFocusVisible(as){setupGlobalFocusEvents(),as(isFocusVisible());const rs=()=>as(isFocusVisible());return handlers.add(rs),()=>{handlers.delete(rs)}}function omit$1(as,rs=[]){const ns=Object.assign({},as);for(const ss of rs)ss in ns&&delete ns[ss];return ns}function useCheckbox(as={}){const rs=useFormControlProps(as),{isDisabled:ns,isReadOnly:ss,isRequired:os,isInvalid:ls,id:us,onBlur:cs,onFocus:ds,"aria-describedby":ps}=rs,{defaultChecked:fs,isChecked:hs,isFocusable:gs,onChange:ys,isIndeterminate:bs,name:vs,value:xs,tabIndex:Cs=void 0,"aria-label":Ts,"aria-labelledby":Ss,"aria-invalid":Ns,...As}=as,ws=omit$1(As,["isDisabled","isReadOnly","isRequired","isInvalid","id","onBlur","onFocus","aria-describedby"]),Es=useCallbackRef(ys),_s=useCallbackRef(cs),$s=useCallbackRef(ds),[Rs,Ds]=reactExports.useState(!1),[Os,Is]=reactExports.useState(!1),[Vs,ks]=reactExports.useState(!1),[Ps,Bs]=reactExports.useState(!1);reactExports.useEffect(()=>trackFocusVisible(Ds),[]);const Ms=reactExports.useRef(null),[Ws,Us]=reactExports.useState(!0),[js,Ls]=reactExports.useState(!!fs),Gs=hs!==void 0,Hs=Gs?hs:js,Ys=reactExports.useCallback(Qs=>{if(ss||ns){Qs.preventDefault();return}Gs||Ls(Hs?Qs.target.checked:bs?!0:Qs.target.checked),Es==null||Es(Qs)},[ss,ns,Hs,Gs,bs,Es]);useSafeLayoutEffect$1(()=>{Ms.current&&(Ms.current.indeterminate=!!bs)},[bs]),useUpdateEffect(()=>{ns&&Is(!1)},[ns,Is]),useSafeLayoutEffect$1(()=>{const Qs=Ms.current;Qs!=null&&Qs.form&&(Qs.form.onreset=()=>{Ls(!!fs)})},[]);const Zs=ns&&!gs,Nl=reactExports.useCallback(Qs=>{Qs.key===" "&&Bs(!0)},[Bs]),yl=reactExports.useCallback(Qs=>{Qs.key===" "&&Bs(!1)},[Bs]);useSafeLayoutEffect$1(()=>{if(!Ms.current)return;Ms.current.checked!==Hs&&Ls(Ms.current.checked)},[Ms.current]);const Dl=reactExports.useCallback((Qs={},Js=null)=>{const El=_l=>{Os&&_l.preventDefault(),Bs(!0)};return{...Qs,ref:Js,"data-active":dataAttr(Ps),"data-hover":dataAttr(Vs),"data-checked":dataAttr(Hs),"data-focus":dataAttr(Os),"data-focus-visible":dataAttr(Os&&Rs),"data-indeterminate":dataAttr(bs),"data-disabled":dataAttr(ns),"data-invalid":dataAttr(ls),"data-readonly":dataAttr(ss),"aria-hidden":!0,onMouseDown:callAllHandlers(Qs.onMouseDown,El),onMouseUp:callAllHandlers(Qs.onMouseUp,()=>Bs(!1)),onMouseEnter:callAllHandlers(Qs.onMouseEnter,()=>ks(!0)),onMouseLeave:callAllHandlers(Qs.onMouseLeave,()=>ks(!1))}},[Ps,Hs,ns,Os,Rs,Vs,bs,ls,ss]),Rl=reactExports.useCallback((Qs={},Js=null)=>({...ws,...Qs,ref:mergeRefs(Js,El=>{El&&Us(El.tagName==="LABEL")}),onClick:callAllHandlers(Qs.onClick,()=>{var El;Ws||((El=Ms.current)==null||El.click(),requestAnimationFrame(()=>{var _l;(_l=Ms.current)==null||_l.focus()}))}),"data-disabled":dataAttr(ns),"data-checked":dataAttr(Hs),"data-invalid":dataAttr(ls)}),[ws,ns,Hs,ls,Ws]),Ml=reactExports.useCallback((Qs={},Js=null)=>({...Qs,ref:mergeRefs(Ms,Js),type:"checkbox",name:vs,value:xs,id:us,tabIndex:Cs,onChange:callAllHandlers(Qs.onChange,Ys),onBlur:callAllHandlers(Qs.onBlur,_s,()=>Is(!1)),onFocus:callAllHandlers(Qs.onFocus,$s,()=>Is(!0)),onKeyDown:callAllHandlers(Qs.onKeyDown,Nl),onKeyUp:callAllHandlers(Qs.onKeyUp,yl),required:os,checked:Hs,disabled:Zs,readOnly:ss,"aria-label":Ts,"aria-labelledby":Ss,"aria-invalid":Ns?!!Ns:ls,"aria-describedby":ps,"aria-disabled":ns,style:visuallyHiddenStyle}),[vs,xs,us,Ys,_s,$s,Nl,yl,os,Hs,Zs,ss,Ts,Ss,Ns,ls,ps,ns,Cs]),Ks=reactExports.useCallback((Qs={},Js=null)=>({...Qs,ref:Js,onMouseDown:callAllHandlers(Qs.onMouseDown,stopEvent),onTouchStart:callAllHandlers(Qs.onTouchStart,stopEvent),"data-disabled":dataAttr(ns),"data-checked":dataAttr(Hs),"data-invalid":dataAttr(ls)}),[Hs,ns,ls]);return{state:{isInvalid:ls,isFocused:Os,isChecked:Hs,isActive:Ps,isHovered:Vs,isIndeterminate:bs,isDisabled:ns,isReadOnly:ss,isRequired:os},getRootProps:Rl,getCheckboxProps:Dl,getInputProps:Ml,getLabelProps:Ks,htmlProps:ws}}function stopEvent(as){as.preventDefault(),as.stopPropagation()}var controlStyles={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},rootStyles={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},checkAnim=keyframes$1({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),indeterminateOpacityAnim=keyframes$1({from:{opacity:0},to:{opacity:1}}),indeterminateScaleAnim=keyframes$1({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),Checkbox=forwardRef(function as(rs,ns){const ss=useCheckboxGroupContext(),os={...ss,...rs},ls=useMultiStyleConfig("Checkbox",os),us=omitThemingProps(rs),{spacing:cs="0.5rem",className:ds,children:ps,iconColor:fs,iconSize:hs,icon:gs=jsx$1(CheckboxIcon,{}),isChecked:ys,isDisabled:bs=ss==null?void 0:ss.isDisabled,onChange:vs,inputProps:xs,...Cs}=us;let Ts=ys;ss!=null&&ss.value&&us.value&&(Ts=ss.value.includes(us.value));let Ss=vs;ss!=null&&ss.onChange&&us.value&&(Ss=callAll(ss.onChange,vs));const{state:Ns,getInputProps:As,getCheckboxProps:ws,getLabelProps:Es,getRootProps:_s}=useCheckbox({...Cs,isDisabled:bs,isChecked:Ts,onChange:Ss}),$s=reactExports.useMemo(()=>({animation:Ns.isIndeterminate?`${indeterminateOpacityAnim} 20ms linear, ${indeterminateScaleAnim} 200ms linear`:`${checkAnim} 200ms linear`,fontSize:hs,color:fs,...ls.icon}),[fs,hs,Ns.isIndeterminate,ls.icon]),Rs=reactExports.cloneElement(gs,{__css:$s,isIndeterminate:Ns.isIndeterminate,isChecked:Ns.isChecked});return jsxs(chakra.label,{__css:{...rootStyles,...ls.container},className:cx("chakra-checkbox",ds),..._s(),children:[jsx$1("input",{className:"chakra-checkbox__input",...As(xs,ns)}),jsx$1(chakra.span,{__css:{...controlStyles,...ls.control},className:"chakra-checkbox__control",...ws(),children:Rs}),ps&&jsx$1(chakra.span,{className:"chakra-checkbox__label",...Es(),__css:{marginStart:cs,...ls.label},children:ps})]})});Checkbox.displayName="Checkbox";function useEventListener(as,rs,ns,ss){const os=useCallbackRef(ns);return reactExports.useEffect(()=>{const ls=typeof as=="function"?as():as??document;if(!(!ns||!ls))return ls.addEventListener(rs,os,ss),()=>{ls.removeEventListener(rs,os,ss)}},[rs,as,ss,os,ns]),()=>{const ls=typeof as=="function"?as():as??document;ls==null||ls.removeEventListener(rs,os,ss)}}function __awaiter(as,rs,ns,ss){function os(ls){return ls instanceof ns?ls:new ns(function(us){us(ls)})}return new(ns||(ns=Promise))(function(ls,us){function cs(fs){try{ps(ss.next(fs))}catch(hs){us(hs)}}function ds(fs){try{ps(ss.throw(fs))}catch(hs){us(hs)}}function ps(fs){fs.done?ls(fs.value):os(fs.value).then(cs,ds)}ps((ss=ss.apply(as,rs||[])).next())})}function __generator(as,rs){var ns={label:0,sent:function(){if(ls[0]&1)throw ls[1];return ls[1]},trys:[],ops:[]},ss,os,ls,us;return us={next:cs(0),throw:cs(1),return:cs(2)},typeof Symbol=="function"&&(us[Symbol.iterator]=function(){return this}),us;function cs(ps){return function(fs){return ds([ps,fs])}}function ds(ps){if(ss)throw new TypeError("Generator is already executing.");for(;ns;)try{if(ss=1,os&&(ls=ps[0]&2?os.return:ps[0]?os.throw||((ls=os.return)&&ls.call(os),0):os.next)&&!(ls=ls.call(os,ps[1])).done)return ls;switch(os=0,ls&&(ps=[ps[0]&2,ls.value]),ps[0]){case 0:case 1:ls=ps;break;case 4:return ns.label++,{value:ps[1],done:!1};case 5:ns.label++,os=ps[1],ps=[0];continue;case 7:ps=ns.ops.pop(),ns.trys.pop();continue;default:if(ls=ns.trys,!(ls=ls.length>0&&ls[ls.length-1])&&(ps[0]===6||ps[0]===2)){ns=0;continue}if(ps[0]===3&&(!ls||ps[1]>ls[0]&&ps[1]0)&&!(os=ss.next()).done;)ls.push(os.value)}catch(cs){us={error:cs}}finally{try{os&&!os.done&&(ns=ss.return)&&ns.call(ss)}finally{if(us)throw us.error}}return ls}function __spread(){for(var as=[],rs=0;rsas.hasAttribute("tabindex"),hasNegativeTabIndex=as=>hasTabIndex(as)&&as.tabIndex===-1;function isDisabled(as){return!!as.getAttribute("disabled")||!!as.getAttribute("aria-disabled")}function isHidden(as){return as.parentElement&&isHidden(as.parentElement)?!0:as.hidden}function isContentEditable(as){const rs=as.getAttribute("contenteditable");return rs!=="false"&&rs!=null}function isFocusable(as){if(!isHTMLElement$2(as)||isHidden(as)||isDisabled(as))return!1;const{localName:rs}=as;if(["input","select","textarea","button"].indexOf(rs)>=0)return!0;const ss={a:()=>as.hasAttribute("href"),audio:()=>as.hasAttribute("controls"),video:()=>as.hasAttribute("controls")};return rs in ss?ss[rs]():isContentEditable(as)?!0:hasTabIndex(as)}function isTabbable(as){return as?isHTMLElement$2(as)&&isFocusable(as)&&!hasNegativeTabIndex(as):!1}var[InputGroupStylesProvider,useInputGroupStyles]=createContext$1({name:"InputGroupStylesContext",errorMessage:`useInputGroupStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),InputGroup=forwardRef(function as(rs,ns){const ss=useMultiStyleConfig("Input",rs),{children:os,className:ls,...us}=omitThemingProps(rs),cs=cx("chakra-input__group",ls),ds={},ps=getValidChildren(os),fs=ss.field;ps.forEach(gs=>{var ys,bs;ss&&(fs&&gs.type.id==="InputLeftElement"&&(ds.paddingStart=(ys=fs.height)!=null?ys:fs.h),fs&&gs.type.id==="InputRightElement"&&(ds.paddingEnd=(bs=fs.height)!=null?bs:fs.h),gs.type.id==="InputRightAddon"&&(ds.borderEndRadius=0),gs.type.id==="InputLeftAddon"&&(ds.borderStartRadius=0))});const hs=ps.map(gs=>{var ys,bs;const vs=compact$1({size:((ys=gs.props)==null?void 0:ys.size)||rs.size,variant:((bs=gs.props)==null?void 0:bs.variant)||rs.variant});return gs.type.id!=="Input"?reactExports.cloneElement(gs,vs):reactExports.cloneElement(gs,Object.assign(vs,ds,gs.props))});return jsx$1(chakra.div,{className:cs,ref:ns,__css:{width:"100%",display:"flex",position:"relative",isolation:"isolate"},"data-group":!0,...us,children:jsx$1(InputGroupStylesProvider,{value:ss,children:hs})})});InputGroup.displayName="InputGroup";var placements$1={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},StyledAddon=chakra("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),InputAddon=forwardRef(function as(rs,ns){var ss;const{placement:os="left",...ls}=rs,us=(ss=placements$1[os])!=null?ss:{},cs=useInputGroupStyles();return jsx$1(StyledAddon,{ref:ns,...ls,__css:{...cs.addon,...us}})});InputAddon.displayName="InputAddon";var InputLeftAddon=forwardRef(function as(rs,ns){return jsx$1(InputAddon,{ref:ns,placement:"left",...rs,className:cx("chakra-input__left-addon",rs.className)})});InputLeftAddon.displayName="InputLeftAddon";InputLeftAddon.id="InputLeftAddon";var InputRightAddon=forwardRef(function as(rs,ns){return jsx$1(InputAddon,{ref:ns,placement:"right",...rs,className:cx("chakra-input__right-addon",rs.className)})});InputRightAddon.displayName="InputRightAddon";InputRightAddon.id="InputRightAddon";var StyledInputElement=chakra("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:"0",zIndex:2}}),InputElement=forwardRef(function as(rs,ns){var ss,os;const{placement:ls="left",...us}=rs,cs=useInputGroupStyles(),ds=cs.field,fs={[ls==="left"?"insetStart":"insetEnd"]:"0",width:(ss=ds==null?void 0:ds.height)!=null?ss:ds==null?void 0:ds.h,height:(os=ds==null?void 0:ds.height)!=null?os:ds==null?void 0:ds.h,fontSize:ds==null?void 0:ds.fontSize,...cs.element};return jsx$1(StyledInputElement,{ref:ns,__css:fs,...us})});InputElement.id="InputElement";InputElement.displayName="InputElement";var InputLeftElement=forwardRef(function as(rs,ns){const{className:ss,...os}=rs,ls=cx("chakra-input__left-element",ss);return jsx$1(InputElement,{ref:ns,placement:"left",className:ls,...os})});InputLeftElement.id="InputLeftElement";InputLeftElement.displayName="InputLeftElement";var InputRightElement=forwardRef(function as(rs,ns){const{className:ss,...os}=rs,ls=cx("chakra-input__right-element",ss);return jsx$1(InputElement,{ref:ns,placement:"right",className:ls,...os})});InputRightElement.id="InputRightElement";InputRightElement.displayName="InputRightElement";var Input$1=forwardRef(function as(rs,ns){const{htmlSize:ss,...os}=rs,ls=useMultiStyleConfig("Input",os),us=omitThemingProps(os),cs=useFormControl(us),ds=cx("chakra-input",rs.className);return jsx$1(chakra.input,{size:ss,...cs,__css:ls.field,ref:ns,className:ds})});Input$1.displayName="Input";Input$1.id="Input";function mapResponsive(as,rs){return Array.isArray(as)?as.map(ns=>ns===null?null:rs(ns)):isObject$6(as)?Object.keys(as).reduce((ns,ss)=>(ns[ss]=rs(as[ss]),ns),{}):as!=null?rs(as):null}var Text$1=forwardRef(function as(rs,ns){const ss=useStyleConfig("Text",rs),{className:os,align:ls,decoration:us,casing:cs,...ds}=omitThemingProps(rs),ps=compact$1({textAlign:rs.align,textDecoration:rs.decoration,textTransform:rs.casing});return jsx$1(chakra.p,{ref:ns,className:cx("chakra-text",rs.className),...ps,...ds,__css:ss})});Text$1.displayName="Text";function px(as){return typeof as=="number"?`${as}px`:as}var Wrap=forwardRef(function as(rs,ns){const{spacing:ss="0.5rem",spacingX:os,spacingY:ls,children:us,justify:cs,direction:ds,align:ps,className:fs,shouldWrapChildren:hs,...gs}=rs,ys=reactExports.useMemo(()=>{const{spacingX:vs=ss,spacingY:xs=ss}={spacingX:os,spacingY:ls};return{"--chakra-wrap-x-spacing":Cs=>mapResponsive(vs,Ts=>px(tokenToCSSVar("space",Ts)(Cs))),"--chakra-wrap-y-spacing":Cs=>mapResponsive(xs,Ts=>px(tokenToCSSVar("space",Ts)(Cs))),"--wrap-x-spacing":"calc(var(--chakra-wrap-x-spacing) / 2)","--wrap-y-spacing":"calc(var(--chakra-wrap-y-spacing) / 2)",display:"flex",flexWrap:"wrap",justifyContent:cs,alignItems:ps,flexDirection:ds,listStyleType:"none",padding:"0",margin:"calc(var(--wrap-y-spacing) * -1) calc(var(--wrap-x-spacing) * -1)","& > *:not(style)":{margin:"var(--wrap-y-spacing) var(--wrap-x-spacing)"}}},[ss,os,ls,cs,ps,ds]),bs=reactExports.useMemo(()=>hs?reactExports.Children.map(us,(vs,xs)=>jsx$1(WrapItem,{children:vs},xs)):us,[us,hs]);return jsx$1(chakra.div,{ref:ns,className:cx("chakra-wrap",fs),overflow:"hidden",...gs,children:jsx$1(chakra.ul,{className:"chakra-wrap__list",__css:ys,children:bs})})});Wrap.displayName="Wrap";var WrapItem=forwardRef(function as(rs,ns){const{className:ss,...os}=rs;return jsx$1(chakra.li,{ref:ns,__css:{display:"flex",alignItems:"flex-start"},className:cx("chakra-wrap__listitem",ss),...os})});WrapItem.displayName="WrapItem";var Box=chakra("div");Box.displayName="Box";var Square=forwardRef(function as(rs,ns){const{size:ss,centerContent:os=!0,...ls}=rs;return jsx$1(Box,{ref:ns,boxSize:ss,__css:{...os?{display:"flex",alignItems:"center",justifyContent:"center"}:{},flexShrink:0,flexGrow:0},...ls})});Square.displayName="Square";var Circle$1=forwardRef(function as(rs,ns){const{size:ss,...os}=rs;return jsx$1(Square,{size:ss,ref:ns,borderRadius:"9999px",...os})});Circle$1.displayName="Circle";var Link=forwardRef(function as(rs,ns){const ss=useStyleConfig("Link",rs),{className:os,isExternal:ls,...us}=omitThemingProps(rs);return jsx$1(chakra.a,{target:ls?"_blank":void 0,rel:ls?"noopener":void 0,ref:ns,className:cx("chakra-link",os),...us,__css:ss})});Link.displayName="Link";var Badge=forwardRef(function as(rs,ns){const ss=useStyleConfig("Badge",rs),{className:os,...ls}=omitThemingProps(rs);return jsx$1(chakra.span,{ref:ns,className:cx("chakra-badge",rs.className),...ls,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...ss}})});Badge.displayName="Badge";var Center=chakra("div",{baseStyle:{display:"flex",alignItems:"center",justifyContent:"center"}});Center.displayName="Center";var centerStyles={horizontal:{insetStart:"50%",transform:"translateX(-50%)"},vertical:{top:"50%",transform:"translateY(-50%)"},both:{insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)"}};forwardRef(function as(rs,ns){const{axis:ss="both",...os}=rs;return jsx$1(chakra.div,{ref:ns,__css:centerStyles[ss],...os,position:"absolute"})});var Flex=forwardRef(function as(rs,ns){const{direction:ss,align:os,justify:ls,wrap:us,basis:cs,grow:ds,shrink:ps,...fs}=rs,hs={display:"flex",flexDirection:ss,alignItems:os,justifyContent:ls,flexWrap:us,flexBasis:cs,flexGrow:ds,flexShrink:ps};return jsx$1(chakra.div,{ref:ns,__css:hs,...fs})});Flex.displayName="Flex";function isPrintableCharacter(as){const{key:rs}=as;return rs.length===1||rs.length>1&&/[^a-zA-Z0-9]/.test(rs)}function useShortcut(as={}){const{timeout:rs=300,preventDefault:ns=()=>!0}=as,[ss,os]=reactExports.useState([]),ls=reactExports.useRef(),us=()=>{ls.current&&(clearTimeout(ls.current),ls.current=null)},cs=()=>{us(),ls.current=setTimeout(()=>{os([]),ls.current=null},rs)};reactExports.useEffect(()=>us,[]);function ds(ps){return fs=>{if(fs.key==="Backspace"){const hs=[...ss];hs.pop(),os(hs);return}if(isPrintableCharacter(fs)){const hs=ss.concat(fs.key);ns(fs)&&(fs.preventDefault(),fs.stopPropagation()),os(hs),ps(hs.join("")),cs()}}}return ds}function getNextItemFromSearch(as,rs,ns,ss){if(rs==null)return ss;if(!ss)return as.find(us=>ns(us).toLowerCase().startsWith(rs.toLowerCase()));const os=as.filter(ls=>ns(ls).toLowerCase().startsWith(rs.toLowerCase()));if(os.length>0){let ls;return os.includes(ss)?(ls=os.indexOf(ss)+1,ls===os.length&&(ls=0),os[ls]):(ls=as.indexOf(os[0]),as[ls])}return ss}function useEventListeners(){const as=reactExports.useRef(new Map),rs=as.current,ns=reactExports.useCallback((os,ls,us,cs)=>{as.current.set(us,{type:ls,el:os,options:cs}),os.addEventListener(ls,us,cs)},[]),ss=reactExports.useCallback((os,ls,us,cs)=>{os.removeEventListener(ls,us,cs),as.current.delete(us)},[]);return reactExports.useEffect(()=>()=>{rs.forEach((os,ls)=>{ss(os.el,os.type,ls,os.options)})},[ss,rs]),{add:ns,remove:ss}}function isValidElement(as){const rs=as.target,{tagName:ns,isContentEditable:ss}=rs;return ns!=="INPUT"&&ns!=="TEXTAREA"&&ss!==!0}function useClickable(as={}){const{ref:rs,isDisabled:ns,isFocusable:ss,clickOnEnter:os=!0,clickOnSpace:ls=!0,onMouseDown:us,onMouseUp:cs,onClick:ds,onKeyDown:ps,onKeyUp:fs,tabIndex:hs,onMouseOver:gs,onMouseLeave:ys,...bs}=as,[vs,xs]=reactExports.useState(!0),[Cs,Ts]=reactExports.useState(!1),Ss=useEventListeners(),Ns=Bs=>{Bs&&Bs.tagName!=="BUTTON"&&xs(!1)},As=vs?hs:hs||0,ws=ns&&!ss,Es=reactExports.useCallback(Bs=>{if(ns){Bs.stopPropagation(),Bs.preventDefault();return}Bs.currentTarget.focus(),ds==null||ds(Bs)},[ns,ds]),_s=reactExports.useCallback(Bs=>{Cs&&isValidElement(Bs)&&(Bs.preventDefault(),Bs.stopPropagation(),Ts(!1),Ss.remove(document,"keyup",_s,!1))},[Cs,Ss]),$s=reactExports.useCallback(Bs=>{if(ps==null||ps(Bs),ns||Bs.defaultPrevented||Bs.metaKey||!isValidElement(Bs.nativeEvent)||vs)return;const Ms=os&&Bs.key==="Enter";ls&&Bs.key===" "&&(Bs.preventDefault(),Ts(!0)),Ms&&(Bs.preventDefault(),Bs.currentTarget.click()),Ss.add(document,"keyup",_s,!1)},[ns,vs,ps,os,ls,Ss,_s]),Rs=reactExports.useCallback(Bs=>{if(fs==null||fs(Bs),ns||Bs.defaultPrevented||Bs.metaKey||!isValidElement(Bs.nativeEvent)||vs)return;ls&&Bs.key===" "&&(Bs.preventDefault(),Ts(!1),Bs.currentTarget.click())},[ls,vs,ns,fs]),Ds=reactExports.useCallback(Bs=>{Bs.button===0&&(Ts(!1),Ss.remove(document,"mouseup",Ds,!1))},[Ss]),Os=reactExports.useCallback(Bs=>{if(Bs.button!==0)return;if(ns){Bs.stopPropagation(),Bs.preventDefault();return}vs||Ts(!0),Bs.currentTarget.focus({preventScroll:!0}),Ss.add(document,"mouseup",Ds,!1),us==null||us(Bs)},[ns,vs,us,Ss,Ds]),Is=reactExports.useCallback(Bs=>{Bs.button===0&&(vs||Ts(!1),cs==null||cs(Bs))},[cs,vs]),Vs=reactExports.useCallback(Bs=>{if(ns){Bs.preventDefault();return}gs==null||gs(Bs)},[ns,gs]),ks=reactExports.useCallback(Bs=>{Cs&&(Bs.preventDefault(),Ts(!1)),ys==null||ys(Bs)},[Cs,ys]),Ps=mergeRefs(rs,Ns);return vs?{...bs,ref:Ps,type:"button","aria-disabled":ws?void 0:ns,disabled:ws,onClick:Es,onMouseDown:us,onMouseUp:cs,onKeyUp:fs,onKeyDown:ps,onMouseOver:gs,onMouseLeave:ys}:{...bs,ref:Ps,role:"button","data-active":dataAttr(Cs),"aria-disabled":ns?"true":void 0,tabIndex:ws?void 0:As,onClick:Es,onMouseDown:Os,onMouseUp:Is,onKeyUp:Rs,onKeyDown:$s,onMouseOver:Vs,onMouseLeave:ks}}function preventReturnFocus(as){const rs=as.current;if(!rs)return!1;const ns=getActiveElement(rs);return!ns||rs.contains(ns)?!1:!!isTabbable(ns)}function useFocusOnHide(as,rs){const{shouldFocus:ns,visible:ss,focusRef:os}=rs,ls=ns&&!ss;useUpdateEffect(()=>{if(!ls||preventReturnFocus(as))return;const us=(os==null?void 0:os.current)||as.current;us&&requestAnimationFrame(()=>{us.focus()})},[ls,as,os])}var toVar=(as,rs)=>({var:as,varRef:rs?`var(${as}, ${rs})`:`var(${as})`}),cssVars={arrowShadowColor:toVar("--popper-arrow-shadow-color"),arrowSize:toVar("--popper-arrow-size","8px"),arrowSizeHalf:toVar("--popper-arrow-size-half"),arrowBg:toVar("--popper-arrow-bg"),transformOrigin:toVar("--popper-transform-origin"),arrowOffset:toVar("--popper-arrow-offset")};function getBoxShadow(as){if(as.includes("top"))return"1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(as.includes("bottom"))return"-1px -1px 1px 0 var(--popper-arrow-shadow-color)";if(as.includes("right"))return"-1px 1px 1px 0 var(--popper-arrow-shadow-color)";if(as.includes("left"))return"1px -1px 1px 0 var(--popper-arrow-shadow-color)"}var transforms={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},toTransformOrigin=as=>transforms[as],defaultEventListeners={scroll:!0,resize:!0};function getEventListenerOptions(as){let rs;return typeof as=="object"?rs={enabled:!0,options:{...defaultEventListeners,...as}}:rs={enabled:as,options:defaultEventListeners},rs}var matchWidth={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:as})=>{as.styles.popper.width=`${as.rects.reference.width}px`},effect:({state:as})=>()=>{const rs=as.elements.reference;as.elements.popper.style.width=`${rs.offsetWidth}px`}},transformOrigin={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:as})=>{setTransformOrigin(as)},effect:({state:as})=>()=>{setTransformOrigin(as)}},setTransformOrigin=as=>{as.elements.popper.style.setProperty(cssVars.transformOrigin.var,toTransformOrigin(as.placement))},positionArrow={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:as})=>{setArrowStyles(as)}},setArrowStyles=as=>{var rs;if(!as.placement)return;const ns=getArrowStyle$1(as.placement);if((rs=as.elements)!=null&&rs.arrow&&ns){Object.assign(as.elements.arrow.style,{[ns.property]:ns.value,width:cssVars.arrowSize.varRef,height:cssVars.arrowSize.varRef,zIndex:-1});const ss={[cssVars.arrowSizeHalf.var]:`calc(${cssVars.arrowSize.varRef} / 2)`,[cssVars.arrowOffset.var]:`calc(${cssVars.arrowSizeHalf.varRef} * -1)`};for(const os in ss)as.elements.arrow.style.setProperty(os,ss[os])}},getArrowStyle$1=as=>{if(as.startsWith("top"))return{property:"bottom",value:cssVars.arrowOffset.varRef};if(as.startsWith("bottom"))return{property:"top",value:cssVars.arrowOffset.varRef};if(as.startsWith("left"))return{property:"right",value:cssVars.arrowOffset.varRef};if(as.startsWith("right"))return{property:"left",value:cssVars.arrowOffset.varRef}},innerArrow={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:as})=>{setInnerArrowStyles(as)},effect:({state:as})=>()=>{setInnerArrowStyles(as)}},setInnerArrowStyles=as=>{if(!as.elements.arrow)return;const rs=as.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!rs)return;const ns=getBoxShadow(as.placement);ns&&rs.style.setProperty("--popper-arrow-default-shadow",ns),Object.assign(rs.style,{transform:"rotate(45deg)",background:cssVars.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},logicals={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},opposites={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function getPopperPlacement(as,rs="ltr"){var ns,ss;const os=((ns=logicals[as])==null?void 0:ns[rs])||as;return rs==="ltr"?os:(ss=opposites[as])!=null?ss:os}var top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(as,rs){return as.concat([rs+"-"+start,rs+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(as,rs){return as.concat([rs,rs+"-"+start,rs+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(as){return as?(as.nodeName||"").toLowerCase():null}function getWindow$1(as){if(as==null)return window;if(as.toString()!=="[object Window]"){var rs=as.ownerDocument;return rs&&rs.defaultView||window}return as}function isElement$1(as){var rs=getWindow$1(as).Element;return as instanceof rs||as instanceof Element}function isHTMLElement$1(as){var rs=getWindow$1(as).HTMLElement;return as instanceof rs||as instanceof HTMLElement}function isShadowRoot(as){if(typeof ShadowRoot>"u")return!1;var rs=getWindow$1(as).ShadowRoot;return as instanceof rs||as instanceof ShadowRoot}function applyStyles(as){var rs=as.state;Object.keys(rs.elements).forEach(function(ns){var ss=rs.styles[ns]||{},os=rs.attributes[ns]||{},ls=rs.elements[ns];!isHTMLElement$1(ls)||!getNodeName(ls)||(Object.assign(ls.style,ss),Object.keys(os).forEach(function(us){var cs=os[us];cs===!1?ls.removeAttribute(us):ls.setAttribute(us,cs===!0?"":cs)}))})}function effect$2(as){var rs=as.state,ns={popper:{position:rs.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(rs.elements.popper.style,ns.popper),rs.styles=ns,rs.elements.arrow&&Object.assign(rs.elements.arrow.style,ns.arrow),function(){Object.keys(rs.elements).forEach(function(ss){var os=rs.elements[ss],ls=rs.attributes[ss]||{},us=Object.keys(rs.styles.hasOwnProperty(ss)?rs.styles[ss]:ns[ss]),cs=us.reduce(function(ds,ps){return ds[ps]="",ds},{});!isHTMLElement$1(os)||!getNodeName(os)||(Object.assign(os.style,cs),Object.keys(ls).forEach(function(ds){os.removeAttribute(ds)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(as){return as.split("-")[0]}var max=Math.max,min=Math.min,round=Math.round;function getUAString(){var as=navigator.userAgentData;return as!=null&&as.brands?as.brands.map(function(rs){return rs.brand+"/"+rs.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(as,rs,ns){rs===void 0&&(rs=!1),ns===void 0&&(ns=!1);var ss=as.getBoundingClientRect(),os=1,ls=1;rs&&isHTMLElement$1(as)&&(os=as.offsetWidth>0&&round(ss.width)/as.offsetWidth||1,ls=as.offsetHeight>0&&round(ss.height)/as.offsetHeight||1);var us=isElement$1(as)?getWindow$1(as):window,cs=us.visualViewport,ds=!isLayoutViewport()&&ns,ps=(ss.left+(ds&&cs?cs.offsetLeft:0))/os,fs=(ss.top+(ds&&cs?cs.offsetTop:0))/ls,hs=ss.width/os,gs=ss.height/ls;return{width:hs,height:gs,top:fs,right:ps+hs,bottom:fs+gs,left:ps,x:ps,y:fs}}function getLayoutRect(as){var rs=getBoundingClientRect(as),ns=as.offsetWidth,ss=as.offsetHeight;return Math.abs(rs.width-ns)<=1&&(ns=rs.width),Math.abs(rs.height-ss)<=1&&(ss=rs.height),{x:as.offsetLeft,y:as.offsetTop,width:ns,height:ss}}function contains$1(as,rs){var ns=rs.getRootNode&&rs.getRootNode();if(as.contains(rs))return!0;if(ns&&isShadowRoot(ns)){var ss=rs;do{if(ss&&as.isSameNode(ss))return!0;ss=ss.parentNode||ss.host}while(ss)}return!1}function getComputedStyle$2(as){return getWindow$1(as).getComputedStyle(as)}function isTableElement(as){return["table","td","th"].indexOf(getNodeName(as))>=0}function getDocumentElement(as){return((isElement$1(as)?as.ownerDocument:as.document)||window.document).documentElement}function getParentNode(as){return getNodeName(as)==="html"?as:as.assignedSlot||as.parentNode||(isShadowRoot(as)?as.host:null)||getDocumentElement(as)}function getTrueOffsetParent(as){return!isHTMLElement$1(as)||getComputedStyle$2(as).position==="fixed"?null:as.offsetParent}function getContainingBlock(as){var rs=/firefox/i.test(getUAString()),ns=/Trident/i.test(getUAString());if(ns&&isHTMLElement$1(as)){var ss=getComputedStyle$2(as);if(ss.position==="fixed")return null}var os=getParentNode(as);for(isShadowRoot(os)&&(os=os.host);isHTMLElement$1(os)&&["html","body"].indexOf(getNodeName(os))<0;){var ls=getComputedStyle$2(os);if(ls.transform!=="none"||ls.perspective!=="none"||ls.contain==="paint"||["transform","perspective"].indexOf(ls.willChange)!==-1||rs&&ls.willChange==="filter"||rs&&ls.filter&&ls.filter!=="none")return os;os=os.parentNode}return null}function getOffsetParent(as){for(var rs=getWindow$1(as),ns=getTrueOffsetParent(as);ns&&isTableElement(ns)&&getComputedStyle$2(ns).position==="static";)ns=getTrueOffsetParent(ns);return ns&&(getNodeName(ns)==="html"||getNodeName(ns)==="body"&&getComputedStyle$2(ns).position==="static")?rs:ns||getContainingBlock(as)||rs}function getMainAxisFromPlacement(as){return["top","bottom"].indexOf(as)>=0?"x":"y"}function within(as,rs,ns){return max(as,min(rs,ns))}function withinMaxClamp(as,rs,ns){var ss=within(as,rs,ns);return ss>ns?ns:ss}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(as){return Object.assign({},getFreshSideObject(),as)}function expandToHashMap(as,rs){return rs.reduce(function(ns,ss){return ns[ss]=as,ns},{})}var toPaddingObject=function as(rs,ns){return rs=typeof rs=="function"?rs(Object.assign({},ns.rects,{placement:ns.placement})):rs,mergePaddingObject(typeof rs!="number"?rs:expandToHashMap(rs,basePlacements))};function arrow(as){var rs,ns=as.state,ss=as.name,os=as.options,ls=ns.elements.arrow,us=ns.modifiersData.popperOffsets,cs=getBasePlacement(ns.placement),ds=getMainAxisFromPlacement(cs),ps=[left,right].indexOf(cs)>=0,fs=ps?"height":"width";if(!(!ls||!us)){var hs=toPaddingObject(os.padding,ns),gs=getLayoutRect(ls),ys=ds==="y"?top:left,bs=ds==="y"?bottom:right,vs=ns.rects.reference[fs]+ns.rects.reference[ds]-us[ds]-ns.rects.popper[fs],xs=us[ds]-ns.rects.reference[ds],Cs=getOffsetParent(ls),Ts=Cs?ds==="y"?Cs.clientHeight||0:Cs.clientWidth||0:0,Ss=vs/2-xs/2,Ns=hs[ys],As=Ts-gs[fs]-hs[bs],ws=Ts/2-gs[fs]/2+Ss,Es=within(Ns,ws,As),_s=ds;ns.modifiersData[ss]=(rs={},rs[_s]=Es,rs.centerOffset=Es-ws,rs)}}function effect$1(as){var rs=as.state,ns=as.options,ss=ns.element,os=ss===void 0?"[data-popper-arrow]":ss;os!=null&&(typeof os=="string"&&(os=rs.elements.popper.querySelector(os),!os)||contains$1(rs.elements.popper,os)&&(rs.elements.arrow=os))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(as){return as.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(as){var rs=as.x,ns=as.y,ss=window,os=ss.devicePixelRatio||1;return{x:round(rs*os)/os||0,y:round(ns*os)/os||0}}function mapToStyles(as){var rs,ns=as.popper,ss=as.popperRect,os=as.placement,ls=as.variation,us=as.offsets,cs=as.position,ds=as.gpuAcceleration,ps=as.adaptive,fs=as.roundOffsets,hs=as.isFixed,gs=us.x,ys=gs===void 0?0:gs,bs=us.y,vs=bs===void 0?0:bs,xs=typeof fs=="function"?fs({x:ys,y:vs}):{x:ys,y:vs};ys=xs.x,vs=xs.y;var Cs=us.hasOwnProperty("x"),Ts=us.hasOwnProperty("y"),Ss=left,Ns=top,As=window;if(ps){var ws=getOffsetParent(ns),Es="clientHeight",_s="clientWidth";if(ws===getWindow$1(ns)&&(ws=getDocumentElement(ns),getComputedStyle$2(ws).position!=="static"&&cs==="absolute"&&(Es="scrollHeight",_s="scrollWidth")),ws=ws,os===top||(os===left||os===right)&&ls===end){Ns=bottom;var $s=hs&&ws===As&&As.visualViewport?As.visualViewport.height:ws[Es];vs-=$s-ss.height,vs*=ds?1:-1}if(os===left||(os===top||os===bottom)&&ls===end){Ss=right;var Rs=hs&&ws===As&&As.visualViewport?As.visualViewport.width:ws[_s];ys-=Rs-ss.width,ys*=ds?1:-1}}var Ds=Object.assign({position:cs},ps&&unsetSides),Os=fs===!0?roundOffsetsByDPR({x:ys,y:vs}):{x:ys,y:vs};if(ys=Os.x,vs=Os.y,ds){var Is;return Object.assign({},Ds,(Is={},Is[Ns]=Ts?"0":"",Is[Ss]=Cs?"0":"",Is.transform=(As.devicePixelRatio||1)<=1?"translate("+ys+"px, "+vs+"px)":"translate3d("+ys+"px, "+vs+"px, 0)",Is))}return Object.assign({},Ds,(rs={},rs[Ns]=Ts?vs+"px":"",rs[Ss]=Cs?ys+"px":"",rs.transform="",rs))}function computeStyles(as){var rs=as.state,ns=as.options,ss=ns.gpuAcceleration,os=ss===void 0?!0:ss,ls=ns.adaptive,us=ls===void 0?!0:ls,cs=ns.roundOffsets,ds=cs===void 0?!0:cs,ps={placement:getBasePlacement(rs.placement),variation:getVariation(rs.placement),popper:rs.elements.popper,popperRect:rs.rects.popper,gpuAcceleration:os,isFixed:rs.options.strategy==="fixed"};rs.modifiersData.popperOffsets!=null&&(rs.styles.popper=Object.assign({},rs.styles.popper,mapToStyles(Object.assign({},ps,{offsets:rs.modifiersData.popperOffsets,position:rs.options.strategy,adaptive:us,roundOffsets:ds})))),rs.modifiersData.arrow!=null&&(rs.styles.arrow=Object.assign({},rs.styles.arrow,mapToStyles(Object.assign({},ps,{offsets:rs.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:ds})))),rs.attributes.popper=Object.assign({},rs.attributes.popper,{"data-popper-placement":rs.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(as){var rs=as.state,ns=as.instance,ss=as.options,os=ss.scroll,ls=os===void 0?!0:os,us=ss.resize,cs=us===void 0?!0:us,ds=getWindow$1(rs.elements.popper),ps=[].concat(rs.scrollParents.reference,rs.scrollParents.popper);return ls&&ps.forEach(function(fs){fs.addEventListener("scroll",ns.update,passive)}),cs&&ds.addEventListener("resize",ns.update,passive),function(){ls&&ps.forEach(function(fs){fs.removeEventListener("scroll",ns.update,passive)}),cs&&ds.removeEventListener("resize",ns.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function as(){},effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(as){return as.replace(/left|right|bottom|top/g,function(rs){return hash$1[rs]})}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(as){return as.replace(/start|end/g,function(rs){return hash[rs]})}function getWindowScroll(as){var rs=getWindow$1(as),ns=rs.pageXOffset,ss=rs.pageYOffset;return{scrollLeft:ns,scrollTop:ss}}function getWindowScrollBarX(as){return getBoundingClientRect(getDocumentElement(as)).left+getWindowScroll(as).scrollLeft}function getViewportRect(as,rs){var ns=getWindow$1(as),ss=getDocumentElement(as),os=ns.visualViewport,ls=ss.clientWidth,us=ss.clientHeight,cs=0,ds=0;if(os){ls=os.width,us=os.height;var ps=isLayoutViewport();(ps||!ps&&rs==="fixed")&&(cs=os.offsetLeft,ds=os.offsetTop)}return{width:ls,height:us,x:cs+getWindowScrollBarX(as),y:ds}}function getDocumentRect(as){var rs,ns=getDocumentElement(as),ss=getWindowScroll(as),os=(rs=as.ownerDocument)==null?void 0:rs.body,ls=max(ns.scrollWidth,ns.clientWidth,os?os.scrollWidth:0,os?os.clientWidth:0),us=max(ns.scrollHeight,ns.clientHeight,os?os.scrollHeight:0,os?os.clientHeight:0),cs=-ss.scrollLeft+getWindowScrollBarX(as),ds=-ss.scrollTop;return getComputedStyle$2(os||ns).direction==="rtl"&&(cs+=max(ns.clientWidth,os?os.clientWidth:0)-ls),{width:ls,height:us,x:cs,y:ds}}function isScrollParent(as){var rs=getComputedStyle$2(as),ns=rs.overflow,ss=rs.overflowX,os=rs.overflowY;return/auto|scroll|overlay|hidden/.test(ns+os+ss)}function getScrollParent(as){return["html","body","#document"].indexOf(getNodeName(as))>=0?as.ownerDocument.body:isHTMLElement$1(as)&&isScrollParent(as)?as:getScrollParent(getParentNode(as))}function listScrollParents(as,rs){var ns;rs===void 0&&(rs=[]);var ss=getScrollParent(as),os=ss===((ns=as.ownerDocument)==null?void 0:ns.body),ls=getWindow$1(ss),us=os?[ls].concat(ls.visualViewport||[],isScrollParent(ss)?ss:[]):ss,cs=rs.concat(us);return os?cs:cs.concat(listScrollParents(getParentNode(us)))}function rectToClientRect(as){return Object.assign({},as,{left:as.x,top:as.y,right:as.x+as.width,bottom:as.y+as.height})}function getInnerBoundingClientRect(as,rs){var ns=getBoundingClientRect(as,!1,rs==="fixed");return ns.top=ns.top+as.clientTop,ns.left=ns.left+as.clientLeft,ns.bottom=ns.top+as.clientHeight,ns.right=ns.left+as.clientWidth,ns.width=as.clientWidth,ns.height=as.clientHeight,ns.x=ns.left,ns.y=ns.top,ns}function getClientRectFromMixedType(as,rs,ns){return rs===viewport?rectToClientRect(getViewportRect(as,ns)):isElement$1(rs)?getInnerBoundingClientRect(rs,ns):rectToClientRect(getDocumentRect(getDocumentElement(as)))}function getClippingParents(as){var rs=listScrollParents(getParentNode(as)),ns=["absolute","fixed"].indexOf(getComputedStyle$2(as).position)>=0,ss=ns&&isHTMLElement$1(as)?getOffsetParent(as):as;return isElement$1(ss)?rs.filter(function(os){return isElement$1(os)&&contains$1(os,ss)&&getNodeName(os)!=="body"}):[]}function getClippingRect(as,rs,ns,ss){var os=rs==="clippingParents"?getClippingParents(as):[].concat(rs),ls=[].concat(os,[ns]),us=ls[0],cs=ls.reduce(function(ds,ps){var fs=getClientRectFromMixedType(as,ps,ss);return ds.top=max(fs.top,ds.top),ds.right=min(fs.right,ds.right),ds.bottom=min(fs.bottom,ds.bottom),ds.left=max(fs.left,ds.left),ds},getClientRectFromMixedType(as,us,ss));return cs.width=cs.right-cs.left,cs.height=cs.bottom-cs.top,cs.x=cs.left,cs.y=cs.top,cs}function computeOffsets(as){var rs=as.reference,ns=as.element,ss=as.placement,os=ss?getBasePlacement(ss):null,ls=ss?getVariation(ss):null,us=rs.x+rs.width/2-ns.width/2,cs=rs.y+rs.height/2-ns.height/2,ds;switch(os){case top:ds={x:us,y:rs.y-ns.height};break;case bottom:ds={x:us,y:rs.y+rs.height};break;case right:ds={x:rs.x+rs.width,y:cs};break;case left:ds={x:rs.x-ns.width,y:cs};break;default:ds={x:rs.x,y:rs.y}}var ps=os?getMainAxisFromPlacement(os):null;if(ps!=null){var fs=ps==="y"?"height":"width";switch(ls){case start:ds[ps]=ds[ps]-(rs[fs]/2-ns[fs]/2);break;case end:ds[ps]=ds[ps]+(rs[fs]/2-ns[fs]/2);break}}return ds}function detectOverflow(as,rs){rs===void 0&&(rs={});var ns=rs,ss=ns.placement,os=ss===void 0?as.placement:ss,ls=ns.strategy,us=ls===void 0?as.strategy:ls,cs=ns.boundary,ds=cs===void 0?clippingParents:cs,ps=ns.rootBoundary,fs=ps===void 0?viewport:ps,hs=ns.elementContext,gs=hs===void 0?popper:hs,ys=ns.altBoundary,bs=ys===void 0?!1:ys,vs=ns.padding,xs=vs===void 0?0:vs,Cs=mergePaddingObject(typeof xs!="number"?xs:expandToHashMap(xs,basePlacements)),Ts=gs===popper?reference:popper,Ss=as.rects.popper,Ns=as.elements[bs?Ts:gs],As=getClippingRect(isElement$1(Ns)?Ns:Ns.contextElement||getDocumentElement(as.elements.popper),ds,fs,us),ws=getBoundingClientRect(as.elements.reference),Es=computeOffsets({reference:ws,element:Ss,strategy:"absolute",placement:os}),_s=rectToClientRect(Object.assign({},Ss,Es)),$s=gs===popper?_s:ws,Rs={top:As.top-$s.top+Cs.top,bottom:$s.bottom-As.bottom+Cs.bottom,left:As.left-$s.left+Cs.left,right:$s.right-As.right+Cs.right},Ds=as.modifiersData.offset;if(gs===popper&&Ds){var Os=Ds[os];Object.keys(Rs).forEach(function(Is){var Vs=[right,bottom].indexOf(Is)>=0?1:-1,ks=[top,bottom].indexOf(Is)>=0?"y":"x";Rs[Is]+=Os[ks]*Vs})}return Rs}function computeAutoPlacement(as,rs){rs===void 0&&(rs={});var ns=rs,ss=ns.placement,os=ns.boundary,ls=ns.rootBoundary,us=ns.padding,cs=ns.flipVariations,ds=ns.allowedAutoPlacements,ps=ds===void 0?placements:ds,fs=getVariation(ss),hs=fs?cs?variationPlacements:variationPlacements.filter(function(bs){return getVariation(bs)===fs}):basePlacements,gs=hs.filter(function(bs){return ps.indexOf(bs)>=0});gs.length===0&&(gs=hs);var ys=gs.reduce(function(bs,vs){return bs[vs]=detectOverflow(as,{placement:vs,boundary:os,rootBoundary:ls,padding:us})[getBasePlacement(vs)],bs},{});return Object.keys(ys).sort(function(bs,vs){return ys[bs]-ys[vs]})}function getExpandedFallbackPlacements(as){if(getBasePlacement(as)===auto)return[];var rs=getOppositePlacement(as);return[getOppositeVariationPlacement(as),rs,getOppositeVariationPlacement(rs)]}function flip(as){var rs=as.state,ns=as.options,ss=as.name;if(!rs.modifiersData[ss]._skip){for(var os=ns.mainAxis,ls=os===void 0?!0:os,us=ns.altAxis,cs=us===void 0?!0:us,ds=ns.fallbackPlacements,ps=ns.padding,fs=ns.boundary,hs=ns.rootBoundary,gs=ns.altBoundary,ys=ns.flipVariations,bs=ys===void 0?!0:ys,vs=ns.allowedAutoPlacements,xs=rs.options.placement,Cs=getBasePlacement(xs),Ts=Cs===xs,Ss=ds||(Ts||!bs?[getOppositePlacement(xs)]:getExpandedFallbackPlacements(xs)),Ns=[xs].concat(Ss).reduce(function(Hs,Ys){return Hs.concat(getBasePlacement(Ys)===auto?computeAutoPlacement(rs,{placement:Ys,boundary:fs,rootBoundary:hs,padding:ps,flipVariations:bs,allowedAutoPlacements:vs}):Ys)},[]),As=rs.rects.reference,ws=rs.rects.popper,Es=new Map,_s=!0,$s=Ns[0],Rs=0;Rs=0,ks=Vs?"width":"height",Ps=detectOverflow(rs,{placement:Ds,boundary:fs,rootBoundary:hs,altBoundary:gs,padding:ps}),Bs=Vs?Is?right:left:Is?bottom:top;As[ks]>ws[ks]&&(Bs=getOppositePlacement(Bs));var Ms=getOppositePlacement(Bs),Ws=[];if(ls&&Ws.push(Ps[Os]<=0),cs&&Ws.push(Ps[Bs]<=0,Ps[Ms]<=0),Ws.every(function(Hs){return Hs})){$s=Ds,_s=!1;break}Es.set(Ds,Ws)}if(_s)for(var Us=bs?3:1,js=function(Ys){var Zs=Ns.find(function(Nl){var yl=Es.get(Nl);if(yl)return yl.slice(0,Ys).every(function(Dl){return Dl})});if(Zs)return $s=Zs,"break"},Ls=Us;Ls>0;Ls--){var Gs=js(Ls);if(Gs==="break")break}rs.placement!==$s&&(rs.modifiersData[ss]._skip=!0,rs.placement=$s,rs.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(as,rs,ns){return ns===void 0&&(ns={x:0,y:0}),{top:as.top-rs.height-ns.y,right:as.right-rs.width+ns.x,bottom:as.bottom-rs.height+ns.y,left:as.left-rs.width-ns.x}}function isAnySideFullyClipped(as){return[top,right,bottom,left].some(function(rs){return as[rs]>=0})}function hide(as){var rs=as.state,ns=as.name,ss=rs.rects.reference,os=rs.rects.popper,ls=rs.modifiersData.preventOverflow,us=detectOverflow(rs,{elementContext:"reference"}),cs=detectOverflow(rs,{altBoundary:!0}),ds=getSideOffsets(us,ss),ps=getSideOffsets(cs,os,ls),fs=isAnySideFullyClipped(ds),hs=isAnySideFullyClipped(ps);rs.modifiersData[ns]={referenceClippingOffsets:ds,popperEscapeOffsets:ps,isReferenceHidden:fs,hasPopperEscaped:hs},rs.attributes.popper=Object.assign({},rs.attributes.popper,{"data-popper-reference-hidden":fs,"data-popper-escaped":hs})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(as,rs,ns){var ss=getBasePlacement(as),os=[left,top].indexOf(ss)>=0?-1:1,ls=typeof ns=="function"?ns(Object.assign({},rs,{placement:as})):ns,us=ls[0],cs=ls[1];return us=us||0,cs=(cs||0)*os,[left,right].indexOf(ss)>=0?{x:cs,y:us}:{x:us,y:cs}}function offset(as){var rs=as.state,ns=as.options,ss=as.name,os=ns.offset,ls=os===void 0?[0,0]:os,us=placements.reduce(function(fs,hs){return fs[hs]=distanceAndSkiddingToXY(hs,rs.rects,ls),fs},{}),cs=us[rs.placement],ds=cs.x,ps=cs.y;rs.modifiersData.popperOffsets!=null&&(rs.modifiersData.popperOffsets.x+=ds,rs.modifiersData.popperOffsets.y+=ps),rs.modifiersData[ss]=us}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(as){var rs=as.state,ns=as.name;rs.modifiersData[ns]=computeOffsets({reference:rs.rects.reference,element:rs.rects.popper,strategy:"absolute",placement:rs.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(as){return as==="x"?"y":"x"}function preventOverflow(as){var rs=as.state,ns=as.options,ss=as.name,os=ns.mainAxis,ls=os===void 0?!0:os,us=ns.altAxis,cs=us===void 0?!1:us,ds=ns.boundary,ps=ns.rootBoundary,fs=ns.altBoundary,hs=ns.padding,gs=ns.tether,ys=gs===void 0?!0:gs,bs=ns.tetherOffset,vs=bs===void 0?0:bs,xs=detectOverflow(rs,{boundary:ds,rootBoundary:ps,padding:hs,altBoundary:fs}),Cs=getBasePlacement(rs.placement),Ts=getVariation(rs.placement),Ss=!Ts,Ns=getMainAxisFromPlacement(Cs),As=getAltAxis(Ns),ws=rs.modifiersData.popperOffsets,Es=rs.rects.reference,_s=rs.rects.popper,$s=typeof vs=="function"?vs(Object.assign({},rs.rects,{placement:rs.placement})):vs,Rs=typeof $s=="number"?{mainAxis:$s,altAxis:$s}:Object.assign({mainAxis:0,altAxis:0},$s),Ds=rs.modifiersData.offset?rs.modifiersData.offset[rs.placement]:null,Os={x:0,y:0};if(ws){if(ls){var Is,Vs=Ns==="y"?top:left,ks=Ns==="y"?bottom:right,Ps=Ns==="y"?"height":"width",Bs=ws[Ns],Ms=Bs+xs[Vs],Ws=Bs-xs[ks],Us=ys?-_s[Ps]/2:0,js=Ts===start?Es[Ps]:_s[Ps],Ls=Ts===start?-_s[Ps]:-Es[Ps],Gs=rs.elements.arrow,Hs=ys&&Gs?getLayoutRect(Gs):{width:0,height:0},Ys=rs.modifiersData["arrow#persistent"]?rs.modifiersData["arrow#persistent"].padding:getFreshSideObject(),Zs=Ys[Vs],Nl=Ys[ks],yl=within(0,Es[Ps],Hs[Ps]),Dl=Ss?Es[Ps]/2-Us-yl-Zs-Rs.mainAxis:js-yl-Zs-Rs.mainAxis,Rl=Ss?-Es[Ps]/2+Us+yl+Nl+Rs.mainAxis:Ls+yl+Nl+Rs.mainAxis,Ml=rs.elements.arrow&&getOffsetParent(rs.elements.arrow),Ks=Ml?Ns==="y"?Ml.clientTop||0:Ml.clientLeft||0:0,qs=(Is=Ds==null?void 0:Ds[Ns])!=null?Is:0,Qs=Bs+Dl-qs-Ks,Js=Bs+Rl-qs,El=within(ys?min(Ms,Qs):Ms,Bs,ys?max(Ws,Js):Ws);ws[Ns]=El,Os[Ns]=El-Bs}if(cs){var _l,Xs=Ns==="x"?top:left,xl=Ns==="x"?bottom:right,Al=ws[As],Sl=As==="y"?"height":"width",Vl=Al+xs[Xs],Fs=Al-xs[xl],Cl=[top,left].indexOf(Cs)!==-1,Tl=(_l=Ds==null?void 0:Ds[As])!=null?_l:0,zl=Cl?Vl:Al-Es[Sl]-_s[Sl]-Tl+Rs.altAxis,Xl=Cl?Al+Es[Sl]+_s[Sl]-Tl-Rs.altAxis:Fs,Pl=ys&&Cl?withinMaxClamp(zl,Al,Xl):within(ys?zl:Vl,Al,ys?Xl:Fs);ws[As]=Pl,Os[As]=Pl-Al}rs.modifiersData[ss]=Os}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(as){return{scrollLeft:as.scrollLeft,scrollTop:as.scrollTop}}function getNodeScroll(as){return as===getWindow$1(as)||!isHTMLElement$1(as)?getWindowScroll(as):getHTMLElementScroll(as)}function isElementScaled(as){var rs=as.getBoundingClientRect(),ns=round(rs.width)/as.offsetWidth||1,ss=round(rs.height)/as.offsetHeight||1;return ns!==1||ss!==1}function getCompositeRect(as,rs,ns){ns===void 0&&(ns=!1);var ss=isHTMLElement$1(rs),os=isHTMLElement$1(rs)&&isElementScaled(rs),ls=getDocumentElement(rs),us=getBoundingClientRect(as,os,ns),cs={scrollLeft:0,scrollTop:0},ds={x:0,y:0};return(ss||!ss&&!ns)&&((getNodeName(rs)!=="body"||isScrollParent(ls))&&(cs=getNodeScroll(rs)),isHTMLElement$1(rs)?(ds=getBoundingClientRect(rs,!0),ds.x+=rs.clientLeft,ds.y+=rs.clientTop):ls&&(ds.x=getWindowScrollBarX(ls))),{x:us.left+cs.scrollLeft-ds.x,y:us.top+cs.scrollTop-ds.y,width:us.width,height:us.height}}function order(as){var rs=new Map,ns=new Set,ss=[];as.forEach(function(ls){rs.set(ls.name,ls)});function os(ls){ns.add(ls.name);var us=[].concat(ls.requires||[],ls.requiresIfExists||[]);us.forEach(function(cs){if(!ns.has(cs)){var ds=rs.get(cs);ds&&os(ds)}}),ss.push(ls)}return as.forEach(function(ls){ns.has(ls.name)||os(ls)}),ss}function orderModifiers(as){var rs=order(as);return modifierPhases.reduce(function(ns,ss){return ns.concat(rs.filter(function(os){return os.phase===ss}))},[])}function debounce(as){var rs;return function(){return rs||(rs=new Promise(function(ns){Promise.resolve().then(function(){rs=void 0,ns(as())})})),rs}}function mergeByName(as){var rs=as.reduce(function(ns,ss){var os=ns[ss.name];return ns[ss.name]=os?Object.assign({},os,ss,{options:Object.assign({},os.options,ss.options),data:Object.assign({},os.data,ss.data)}):ss,ns},{});return Object.keys(rs).map(function(ns){return rs[ns]})}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var as=arguments.length,rs=new Array(as),ns=0;ns{}),Ss=reactExports.useCallback(()=>{var Rs;!rs||!bs.current||!vs.current||((Rs=Ts.current)==null||Rs.call(Ts),xs.current=createPopper(bs.current,vs.current,{placement:Cs,modifiers:[innerArrow,positionArrow,transformOrigin,{...matchWidth,enabled:!!gs},{name:"eventListeners",...getEventListenerOptions(us)},{name:"arrow",options:{padding:ls}},{name:"offset",options:{offset:cs??[0,ds]}},{name:"flip",enabled:!!ps,options:{padding:8}},{name:"preventOverflow",enabled:!!hs,options:{boundary:fs}},...ns??[]],strategy:os}),xs.current.forceUpdate(),Ts.current=xs.current.destroy)},[Cs,rs,ns,gs,us,ls,cs,ds,ps,hs,fs,os]);reactExports.useEffect(()=>()=>{var Rs;!bs.current&&!vs.current&&((Rs=xs.current)==null||Rs.destroy(),xs.current=null)},[]);const Ns=reactExports.useCallback(Rs=>{bs.current=Rs,Ss()},[Ss]),As=reactExports.useCallback((Rs={},Ds=null)=>({...Rs,ref:mergeRefs(Ns,Ds)}),[Ns]),ws=reactExports.useCallback(Rs=>{vs.current=Rs,Ss()},[Ss]),Es=reactExports.useCallback((Rs={},Ds=null)=>({...Rs,ref:mergeRefs(ws,Ds),style:{...Rs.style,position:os,minWidth:gs?void 0:"max-content",inset:"0 auto auto 0"}}),[os,ws,gs]),_s=reactExports.useCallback((Rs={},Ds=null)=>{const{size:Os,shadowColor:Is,bg:Vs,style:ks,...Ps}=Rs;return{...Ps,ref:Ds,"data-popper-arrow":"",style:getArrowStyle(Rs)}},[]),$s=reactExports.useCallback((Rs={},Ds=null)=>({...Rs,ref:Ds,"data-popper-arrow-inner":""}),[]);return{update(){var Rs;(Rs=xs.current)==null||Rs.update()},forceUpdate(){var Rs;(Rs=xs.current)==null||Rs.forceUpdate()},transformOrigin:cssVars.transformOrigin.varRef,referenceRef:Ns,popperRef:ws,getPopperProps:Es,getArrowProps:_s,getArrowInnerProps:$s,getReferenceProps:As}}function getArrowStyle(as){const{size:rs,shadowColor:ns,bg:ss,style:os}=as,ls={...os,position:"absolute"};return rs&&(ls["--popper-arrow-size"]=rs),ns&&(ls["--popper-arrow-shadow-color"]=ns),ss&&(ls["--popper-arrow-bg"]=ss),ls}function useDisclosure(as={}){const{onClose:rs,onOpen:ns,isOpen:ss,id:os}=as,ls=useCallbackRef(ns),us=useCallbackRef(rs),[cs,ds]=reactExports.useState(as.defaultIsOpen||!1),ps=ss!==void 0?ss:cs,fs=ss!==void 0,hs=reactExports.useId(),gs=os??`disclosure-${hs}`,ys=reactExports.useCallback(()=>{fs||ds(!1),us==null||us()},[fs,us]),bs=reactExports.useCallback(()=>{fs||ds(!0),ls==null||ls()},[fs,ls]),vs=reactExports.useCallback(()=>{ps?ys():bs()},[ps,bs,ys]);function xs(Ts={}){return{...Ts,"aria-expanded":ps,"aria-controls":gs,onClick(Ss){var Ns;(Ns=Ts.onClick)==null||Ns.call(Ts,Ss),vs()}}}function Cs(Ts={}){return{...Ts,hidden:!ps,id:gs}}return{isOpen:ps,onOpen:bs,onClose:ys,onToggle:vs,isControlled:fs,getButtonProps:xs,getDisclosureProps:Cs}}function useOutsideClick(as){const{ref:rs,handler:ns,enabled:ss=!0}=as,os=useCallbackRef(ns),us=reactExports.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}).current;reactExports.useEffect(()=>{if(!ss)return;const cs=hs=>{isValidEvent(hs,rs)&&(us.isPointerDown=!0)},ds=hs=>{if(us.ignoreEmulatedMouseEvents){us.ignoreEmulatedMouseEvents=!1;return}us.isPointerDown&&ns&&isValidEvent(hs,rs)&&(us.isPointerDown=!1,os(hs))},ps=hs=>{us.ignoreEmulatedMouseEvents=!0,ns&&us.isPointerDown&&isValidEvent(hs,rs)&&(us.isPointerDown=!1,os(hs))},fs=getOwnerDocument$1(rs.current);return fs.addEventListener("mousedown",cs,!0),fs.addEventListener("mouseup",ds,!0),fs.addEventListener("touchstart",cs,!0),fs.addEventListener("touchend",ps,!0),()=>{fs.removeEventListener("mousedown",cs,!0),fs.removeEventListener("mouseup",ds,!0),fs.removeEventListener("touchstart",cs,!0),fs.removeEventListener("touchend",ps,!0)}},[ns,rs,os,us,ss])}function isValidEvent(as,rs){var ns;const ss=as.target;return as.button>0||ss&&!getOwnerDocument$1(ss).contains(ss)?!1:!((ns=rs.current)!=null&&ns.contains(ss))}function getOwnerDocument$1(as){var rs;return(rs=as==null?void 0:as.ownerDocument)!=null?rs:document}function useAnimationState(as){const{isOpen:rs,ref:ns}=as,[ss,os]=reactExports.useState(rs),[ls,us]=reactExports.useState(!1);return reactExports.useEffect(()=>{ls||(os(rs),us(!0))},[rs,ls,ss]),useEventListener(()=>ns.current,"animationend",()=>{os(rs)}),{present:!(rs?!1:!ss),onComplete(){var ds;const ps=getOwnerWindow(ns.current),fs=new ps.CustomEvent("animationend",{bubbles:!0});(ds=ns.current)==null||ds.dispatchEvent(fs)}}}function lazyDisclosure(as){const{wasSelected:rs,enabled:ns,isSelected:ss,mode:os="unmount"}=as;return!!(!ns||ss||os==="keepMounted"&&rs)}var[MenuDescendantsProvider,useMenuDescendantsContext,useMenuDescendants,useMenuDescendant]=createDescendantContext(),[MenuProvider,useMenuContext]=createContext$1({strict:!1,name:"MenuContext"});function useIds(as,...rs){const ns=reactExports.useId(),ss=as||ns;return reactExports.useMemo(()=>rs.map(os=>`${os}-${ss}`),[ss,rs])}function getOwnerDocument(as){var rs;return(rs=as==null?void 0:as.ownerDocument)!=null?rs:document}function isActiveElement(as){return getOwnerDocument(as).activeElement===as}function useMenu(as={}){const{id:rs,closeOnSelect:ns=!0,closeOnBlur:ss=!0,initialFocusRef:os,autoSelect:ls=!0,isLazy:us,isOpen:cs,defaultIsOpen:ds,onClose:ps,onOpen:fs,placement:hs="bottom-start",lazyBehavior:gs="unmount",direction:ys,computePositionOnMount:bs=!1,...vs}=as,xs=reactExports.useRef(null),Cs=reactExports.useRef(null),Ts=useMenuDescendants(),Ss=reactExports.useCallback(()=>{requestAnimationFrame(()=>{var Gs;(Gs=xs.current)==null||Gs.focus({preventScroll:!1})})},[]),Ns=reactExports.useCallback(()=>{const Gs=setTimeout(()=>{var Hs;if(os)(Hs=os.current)==null||Hs.focus();else{const Ys=Ts.firstEnabled();Ys&&Is(Ys.index)}});Ms.current.add(Gs)},[Ts,os]),As=reactExports.useCallback(()=>{const Gs=setTimeout(()=>{const Hs=Ts.lastEnabled();Hs&&Is(Hs.index)});Ms.current.add(Gs)},[Ts]),ws=reactExports.useCallback(()=>{fs==null||fs(),ls?Ns():Ss()},[ls,Ns,Ss,fs]),{isOpen:Es,onOpen:_s,onClose:$s,onToggle:Rs}=useDisclosure({isOpen:cs,defaultIsOpen:ds,onClose:ps,onOpen:ws});useOutsideClick({enabled:Es&&ss,ref:xs,handler:Gs=>{var Hs;(Hs=Cs.current)!=null&&Hs.contains(Gs.target)||$s()}});const Ds=usePopper({...vs,enabled:Es||bs,placement:hs,direction:ys}),[Os,Is]=reactExports.useState(-1);useUpdateEffect(()=>{Es||Is(-1)},[Es]),useFocusOnHide(xs,{focusRef:Cs,visible:Es,shouldFocus:!0});const Vs=useAnimationState({isOpen:Es,ref:xs}),[ks,Ps]=useIds(rs,"menu-button","menu-list"),Bs=reactExports.useCallback(()=>{_s(),Ss()},[_s,Ss]),Ms=reactExports.useRef(new Set([]));useUnmountEffect(()=>{Ms.current.forEach(Gs=>clearTimeout(Gs)),Ms.current.clear()});const Ws=reactExports.useCallback(()=>{_s(),Ns()},[Ns,_s]),Us=reactExports.useCallback(()=>{_s(),As()},[_s,As]),js=reactExports.useCallback(()=>{var Gs,Hs;const Ys=getOwnerDocument(xs.current),Zs=(Gs=xs.current)==null?void 0:Gs.contains(Ys.activeElement);if(!(Es&&!Zs))return;const yl=(Hs=Ts.item(Os))==null?void 0:Hs.node;yl==null||yl.focus()},[Es,Os,Ts]),Ls=reactExports.useRef(null);return{openAndFocusMenu:Bs,openAndFocusFirstItem:Ws,openAndFocusLastItem:Us,onTransitionEnd:js,unstable__animationState:Vs,descendants:Ts,popper:Ds,buttonId:ks,menuId:Ps,forceUpdate:Ds.forceUpdate,orientation:"vertical",isOpen:Es,onToggle:Rs,onOpen:_s,onClose:$s,menuRef:xs,buttonRef:Cs,focusedIndex:Os,closeOnSelect:ns,closeOnBlur:ss,autoSelect:ls,setFocusedIndex:Is,isLazy:us,lazyBehavior:gs,initialFocusRef:os,rafId:Ls}}function useMenuButton(as={},rs=null){const ns=useMenuContext(),{onToggle:ss,popper:os,openAndFocusFirstItem:ls,openAndFocusLastItem:us}=ns,cs=reactExports.useCallback(ds=>{const ps=ds.key,hs={Enter:ls,ArrowDown:ls,ArrowUp:us}[ps];hs&&(ds.preventDefault(),ds.stopPropagation(),hs(ds))},[ls,us]);return{...as,ref:mergeRefs(ns.buttonRef,rs,os.referenceRef),id:ns.buttonId,"data-active":dataAttr(ns.isOpen),"aria-expanded":ns.isOpen,"aria-haspopup":"menu","aria-controls":ns.menuId,onClick:callAllHandlers(as.onClick,ss),onKeyDown:callAllHandlers(as.onKeyDown,cs)}}function isTargetMenuItem(as){var rs;return isHTMLElement(as)&&!!((rs=as==null?void 0:as.getAttribute("role"))!=null&&rs.startsWith("menuitem"))}function useMenuList(as={},rs=null){const ns=useMenuContext();if(!ns)throw new Error("useMenuContext: context is undefined. Seems you forgot to wrap component within ");const{focusedIndex:ss,setFocusedIndex:os,menuRef:ls,isOpen:us,onClose:cs,menuId:ds,isLazy:ps,lazyBehavior:fs,unstable__animationState:hs}=ns,gs=useMenuDescendantsContext(),ys=useShortcut({preventDefault:Cs=>Cs.key!==" "&&isTargetMenuItem(Cs.target)}),bs=reactExports.useCallback(Cs=>{const Ts=Cs.key,Ns={Tab:ws=>ws.preventDefault(),Escape:cs,ArrowDown:()=>{const ws=gs.nextEnabled(ss);ws&&os(ws.index)},ArrowUp:()=>{const ws=gs.prevEnabled(ss);ws&&os(ws.index)}}[Ts];if(Ns){Cs.preventDefault(),Ns(Cs);return}const As=ys(ws=>{const Es=getNextItemFromSearch(gs.values(),ws,_s=>{var $s,Rs;return(Rs=($s=_s==null?void 0:_s.node)==null?void 0:$s.textContent)!=null?Rs:""},gs.item(ss));if(Es){const _s=gs.indexOf(Es.node);os(_s)}});isTargetMenuItem(Cs.target)&&As(Cs)},[gs,ss,ys,cs,os]),vs=reactExports.useRef(!1);us&&(vs.current=!0);const xs=lazyDisclosure({wasSelected:vs.current,enabled:ps,mode:fs,isSelected:hs.present});return{...as,ref:mergeRefs(ls,rs),children:xs?as.children:null,tabIndex:-1,role:"menu",id:ds,style:{...as.style,transformOrigin:"var(--popper-transform-origin)"},"aria-orientation":"vertical",onKeyDown:callAllHandlers(as.onKeyDown,bs)}}function useMenuPositioner(as={}){const{popper:rs,isOpen:ns}=useMenuContext();return rs.getPopperProps({...as,style:{visibility:ns?"visible":"hidden",...as.style}})}function useMenuItem(as={},rs=null){const{onMouseEnter:ns,onMouseMove:ss,onMouseLeave:os,onClick:ls,onFocus:us,isDisabled:cs,isFocusable:ds,closeOnSelect:ps,type:fs,...hs}=as,gs=useMenuContext(),{setFocusedIndex:ys,focusedIndex:bs,closeOnSelect:vs,onClose:xs,menuRef:Cs,isOpen:Ts,menuId:Ss,rafId:Ns}=gs,As=reactExports.useRef(null),ws=`${Ss}-menuitem-${reactExports.useId()}`,{index:Es,register:_s}=useMenuDescendant({disabled:cs&&!ds}),$s=reactExports.useCallback(Bs=>{ns==null||ns(Bs),!cs&&ys(Es)},[ys,Es,cs,ns]),Rs=reactExports.useCallback(Bs=>{ss==null||ss(Bs),As.current&&!isActiveElement(As.current)&&$s(Bs)},[$s,ss]),Ds=reactExports.useCallback(Bs=>{os==null||os(Bs),!cs&&ys(-1)},[ys,cs,os]),Os=reactExports.useCallback(Bs=>{ls==null||ls(Bs),isTargetMenuItem(Bs.currentTarget)&&(ps??vs)&&xs()},[xs,ls,vs,ps]),Is=reactExports.useCallback(Bs=>{us==null||us(Bs),ys(Es)},[ys,us,Es]),Vs=Es===bs,ks=cs&&!ds;useUpdateEffect(()=>{Ts&&(Vs&&!ks&&As.current?(Ns.current&&cancelAnimationFrame(Ns.current),Ns.current=requestAnimationFrame(()=>{var Bs;(Bs=As.current)==null||Bs.focus(),Ns.current=null})):Cs.current&&!isActiveElement(Cs.current)&&Cs.current.focus())},[Vs,ks,Cs,Ts]);const Ps=useClickable({onClick:Os,onFocus:Is,onMouseEnter:$s,onMouseMove:Rs,onMouseLeave:Ds,ref:mergeRefs(_s,As,rs),isDisabled:cs,isFocusable:ds});return{...hs,...Ps,type:fs??Ps.type,id:ws,role:"menuitem",tabIndex:Vs?0:-1}}function isHTMLElement(as){var rs;if(!isElement(as))return!1;const ns=(rs=as.ownerDocument.defaultView)!=null?rs:window;return as instanceof ns.HTMLElement}function isElement(as){return as!=null&&typeof as=="object"&&"nodeType"in as&&as.nodeType===Node.ELEMENT_NODE}function useUnmountEffect(as,rs=[]){return reactExports.useEffect(()=>()=>as(),rs)}var[MenuStylesProvider,useMenuStyles]=createContext$1({name:"MenuStylesContext",errorMessage:`useMenuStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Menu=as=>{const{children:rs}=as,ns=useMultiStyleConfig("Menu",as),ss=omitThemingProps(as),{direction:os}=useTheme(),{descendants:ls,...us}=useMenu({...ss,direction:os}),cs=reactExports.useMemo(()=>us,[us]),{isOpen:ds,onClose:ps,forceUpdate:fs}=cs;return jsx$1(MenuDescendantsProvider,{value:ls,children:jsx$1(MenuProvider,{value:cs,children:jsx$1(MenuStylesProvider,{value:ns,children:runIfFn$2(rs,{isOpen:ds,onClose:ps,forceUpdate:fs})})})})};Menu.displayName="Menu";var MenuCommand=forwardRef((as,rs)=>{const ns=useMenuStyles();return jsx$1(chakra.span,{ref:rs,...as,__css:ns.command,className:"chakra-menu__command"})});MenuCommand.displayName="MenuCommand";var StyledMenuItem$1=forwardRef((as,rs)=>{const{type:ns,...ss}=as,os=useMenuStyles(),ls=ss.as||ns?ns??void 0:"button",us=reactExports.useMemo(()=>({textDecoration:"none",color:"inherit",userSelect:"none",display:"flex",width:"100%",alignItems:"center",textAlign:"start",flex:"0 0 auto",outline:0,...os.item}),[os.item]);return jsx$1(chakra.button,{ref:rs,type:ls,...ss,__css:us})}),MenuIcon=as=>{const{className:rs,children:ns,...ss}=as,os=reactExports.Children.only(ns),ls=reactExports.isValidElement(os)?reactExports.cloneElement(os,{focusable:"false","aria-hidden":!0,className:cx("chakra-menu__icon",os.props.className)}):null,us=cx("chakra-menu__icon-wrapper",rs);return jsx$1(chakra.span,{className:us,...ss,__css:{flexShrink:0},children:ls})};MenuIcon.displayName="MenuIcon";var MenuItem$1=forwardRef((as,rs)=>{const{icon:ns,iconSpacing:ss="0.75rem",command:os,commandSpacing:ls="0.75rem",children:us,...cs}=as,ds=useMenuItem(cs,rs),fs=ns||os?jsx$1("span",{style:{pointerEvents:"none",flex:1},children:us}):us;return jsxs(StyledMenuItem$1,{...ds,className:cx("chakra-menu__menuitem",ds.className),children:[ns&&jsx$1(MenuIcon,{fontSize:"0.8em",marginEnd:ss,children:ns}),fs,os&&jsx$1(MenuCommand,{marginStart:ls,children:os})]})});MenuItem$1.displayName="MenuItem";var motionVariants={enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.2,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.1,easings:"easeOut"}}},MenuTransition=chakra(motion.div),MenuList=forwardRef(function as(rs,ns){var ss,os;const{rootProps:ls,motionProps:us,...cs}=rs,{isOpen:ds,onTransitionEnd:ps,unstable__animationState:fs}=useMenuContext(),hs=useMenuList(cs,ns),gs=useMenuPositioner(ls),ys=useMenuStyles();return jsx$1(chakra.div,{...gs,__css:{zIndex:(os=rs.zIndex)!=null?os:(ss=ys.list)==null?void 0:ss.zIndex},children:jsx$1(MenuTransition,{variants:motionVariants,initial:!1,animate:ds?"enter":"exit",__css:{outline:0,...ys.list},...us,className:cx("chakra-menu__menu-list",hs.className),...hs,onUpdate:ps,onAnimationComplete:callAll(fs.onComplete,hs.onAnimationComplete)})})});MenuList.displayName="MenuList";var StyledMenuButton=forwardRef((as,rs)=>{const ns=useMenuStyles();return jsx$1(chakra.button,{ref:rs,...as,__css:{display:"inline-flex",appearance:"none",alignItems:"center",outline:0,...ns.button}})}),MenuButton=forwardRef((as,rs)=>{const{children:ns,as:ss,...os}=as,ls=useMenuButton(os,rs);return jsx$1(ss||StyledMenuButton,{...ls,className:cx("chakra-menu__menu-button",as.className),children:jsx$1(chakra.span,{__css:{pointerEvents:"none",flex:"1 1 auto",minW:0},children:as.children})})});MenuButton.displayName="MenuButton";var[TabsDescendantsProvider,useTabsDescendantsContext,useTabsDescendants,useTabsDescendant]=createDescendantContext();function useTabs(as){var rs;const{defaultIndex:ns,onChange:ss,index:os,isManual:ls,isLazy:us,lazyBehavior:cs="unmount",orientation:ds="horizontal",direction:ps="ltr",...fs}=as,[hs,gs]=reactExports.useState(ns??0),[ys,bs]=useControllableState({defaultValue:ns??0,value:os,onChange:ss});reactExports.useEffect(()=>{os!=null&&gs(os)},[os]);const vs=useTabsDescendants(),xs=reactExports.useId();return{id:`tabs-${(rs=as.id)!=null?rs:xs}`,selectedIndex:ys,focusedIndex:hs,setSelectedIndex:bs,setFocusedIndex:gs,isManual:ls,isLazy:us,lazyBehavior:cs,orientation:ds,descendants:vs,direction:ps,htmlProps:fs}}var[TabsProvider,useTabsContext]=createContext$1({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "});function useTabList(as){const{focusedIndex:rs,orientation:ns,direction:ss}=useTabsContext(),os=useTabsDescendantsContext(),ls=reactExports.useCallback(us=>{const cs=()=>{var Ts;const Ss=os.nextEnabled(rs);Ss&&((Ts=Ss.node)==null||Ts.focus())},ds=()=>{var Ts;const Ss=os.prevEnabled(rs);Ss&&((Ts=Ss.node)==null||Ts.focus())},ps=()=>{var Ts;const Ss=os.firstEnabled();Ss&&((Ts=Ss.node)==null||Ts.focus())},fs=()=>{var Ts;const Ss=os.lastEnabled();Ss&&((Ts=Ss.node)==null||Ts.focus())},hs=ns==="horizontal",gs=ns==="vertical",ys=us.key,bs=ss==="ltr"?"ArrowLeft":"ArrowRight",vs=ss==="ltr"?"ArrowRight":"ArrowLeft",Cs={[bs]:()=>hs&&ds(),[vs]:()=>hs&&cs(),ArrowDown:()=>gs&&cs(),ArrowUp:()=>gs&&ds(),Home:ps,End:fs}[ys];Cs&&(us.preventDefault(),Cs(us))},[os,rs,ns,ss]);return{...as,role:"tablist","aria-orientation":ns,onKeyDown:callAllHandlers(as.onKeyDown,ls)}}function useTab(as){const{isDisabled:rs,isFocusable:ns,...ss}=as,{setSelectedIndex:os,isManual:ls,id:us,setFocusedIndex:cs,selectedIndex:ds}=useTabsContext(),{index:ps,register:fs}=useTabsDescendant({disabled:rs&&!ns}),hs=ps===ds,gs=()=>{os(ps)},ys=()=>{cs(ps),!ls&&!(rs&&ns)&&os(ps)},bs=useClickable({...ss,ref:mergeRefs(fs,as.ref),isDisabled:rs,isFocusable:ns,onClick:callAllHandlers(as.onClick,gs)}),vs="button";return{...bs,id:makeTabId(us,ps),role:"tab",tabIndex:hs?0:-1,type:vs,"aria-selected":hs,"aria-controls":makeTabPanelId(us,ps),onFocus:rs?void 0:callAllHandlers(as.onFocus,ys)}}var[TabPanelProvider,useTabPanelContext]=createContext$1({});function useTabPanels(as){const rs=useTabsContext(),{id:ns,selectedIndex:ss}=rs,ls=getValidChildren(as.children).map((us,cs)=>reactExports.createElement(TabPanelProvider,{key:cs,value:{isSelected:cs===ss,id:makeTabPanelId(ns,cs),tabId:makeTabId(ns,cs),selectedIndex:ss}},us));return{...as,children:ls}}function useTabPanel(as){const{children:rs,...ns}=as,{isLazy:ss,lazyBehavior:os}=useTabsContext(),{isSelected:ls,id:us,tabId:cs}=useTabPanelContext(),ds=reactExports.useRef(!1);ls&&(ds.current=!0);const ps=lazyDisclosure({wasSelected:ds.current,isSelected:ls,enabled:ss,mode:os});return{tabIndex:0,...ns,children:ps?rs:null,role:"tabpanel","aria-labelledby":cs,hidden:!ls,id:us}}function makeTabId(as,rs){return`${as}--tab-${rs}`}function makeTabPanelId(as,rs){return`${as}--tabpanel-${rs}`}var[TabsStylesProvider,useTabsStyles]=createContext$1({name:"TabsStylesContext",errorMessage:`useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Tabs=forwardRef(function as(rs,ns){const ss=useMultiStyleConfig("Tabs",rs),{children:os,className:ls,...us}=omitThemingProps(rs),{htmlProps:cs,descendants:ds,...ps}=useTabs(us),fs=reactExports.useMemo(()=>ps,[ps]),{isFitted:hs,...gs}=cs;return jsx$1(TabsDescendantsProvider,{value:ds,children:jsx$1(TabsProvider,{value:fs,children:jsx$1(TabsStylesProvider,{value:ss,children:jsx$1(chakra.div,{className:cx("chakra-tabs",ls),ref:ns,...gs,__css:ss.root,children:os})})})})});Tabs.displayName="Tabs";var TabList=forwardRef(function as(rs,ns){const ss=useTabList({...rs,ref:ns}),ls={display:"flex",...useTabsStyles().tablist};return jsx$1(chakra.div,{...ss,className:cx("chakra-tabs__tablist",rs.className),__css:ls})});TabList.displayName="TabList";var TabPanel=forwardRef(function as(rs,ns){const ss=useTabPanel({...rs,ref:ns}),os=useTabsStyles();return jsx$1(chakra.div,{outline:"0",...ss,className:cx("chakra-tabs__tab-panel",rs.className),__css:os.tabpanel})});TabPanel.displayName="TabPanel";var TabPanels=forwardRef(function as(rs,ns){const ss=useTabPanels(rs),os=useTabsStyles();return jsx$1(chakra.div,{...ss,width:"100%",ref:ns,className:cx("chakra-tabs__tab-panels",rs.className),__css:os.tabpanels})});TabPanels.displayName="TabPanels";var Tab=forwardRef(function as(rs,ns){const ss=useTabsStyles(),os=useTab({...rs,ref:ns}),ls={outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...ss.tab};return jsx$1(chakra.button,{...os,className:cx("chakra-tabs__tab",rs.className),__css:ls})});Tab.displayName="Tab";var scale={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},getDoc=as=>{var rs;return((rs=as.current)==null?void 0:rs.ownerDocument)||document},getWin=as=>{var rs,ns;return((ns=(rs=as.current)==null?void 0:rs.ownerDocument)==null?void 0:ns.defaultView)||window};function useTooltip(as={}){const{openDelay:rs=0,closeDelay:ns=0,closeOnClick:ss=!0,closeOnMouseDown:os,closeOnScroll:ls,closeOnPointerDown:us=os,closeOnEsc:cs=!0,onOpen:ds,onClose:ps,placement:fs,id:hs,isOpen:gs,defaultIsOpen:ys,arrowSize:bs=10,arrowShadowColor:vs,arrowPadding:xs,modifiers:Cs,isDisabled:Ts,gutter:Ss,offset:Ns,direction:As,...ws}=as,{isOpen:Es,onOpen:_s,onClose:$s}=useDisclosure({isOpen:gs,defaultIsOpen:ys,onOpen:ds,onClose:ps}),{referenceRef:Rs,getPopperProps:Ds,getArrowInnerProps:Os,getArrowProps:Is}=usePopper({enabled:Es,placement:fs,arrowPadding:xs,modifiers:Cs,gutter:Ss,offset:Ns,direction:As}),Vs=reactExports.useId(),Ps=`tooltip-${hs??Vs}`,Bs=reactExports.useRef(null),Ms=reactExports.useRef(),Ws=reactExports.useCallback(()=>{Ms.current&&(clearTimeout(Ms.current),Ms.current=void 0)},[]),Us=reactExports.useRef(),js=reactExports.useCallback(()=>{Us.current&&(clearTimeout(Us.current),Us.current=void 0)},[]),Ls=reactExports.useCallback(()=>{js(),$s()},[$s,js]),Gs=useCloseEvent(Bs,Ls),Hs=reactExports.useCallback(()=>{if(!Ts&&!Ms.current){Gs();const Ks=getWin(Bs);Ms.current=Ks.setTimeout(_s,rs)}},[Gs,Ts,_s,rs]),Ys=reactExports.useCallback(()=>{Ws();const Ks=getWin(Bs);Us.current=Ks.setTimeout(Ls,ns)},[ns,Ls,Ws]),Zs=reactExports.useCallback(()=>{Es&&ss&&Ys()},[ss,Ys,Es]),Nl=reactExports.useCallback(()=>{Es&&us&&Ys()},[us,Ys,Es]),yl=reactExports.useCallback(Ks=>{Es&&Ks.key==="Escape"&&Ys()},[Es,Ys]);useEventListener(()=>getDoc(Bs),"keydown",cs?yl:void 0),useEventListener(()=>getDoc(Bs),"scroll",()=>{Es&&ls&&Ls()}),reactExports.useEffect(()=>{Ts&&(Ws(),Es&&$s())},[Ts,Es,$s,Ws]),reactExports.useEffect(()=>()=>{Ws(),js()},[Ws,js]),useEventListener(()=>Bs.current,"pointerleave",Ys);const Dl=reactExports.useCallback((Ks={},qs=null)=>({...Ks,ref:mergeRefs(Bs,qs,Rs),onPointerEnter:callAllHandlers(Ks.onPointerEnter,Js=>{Js.pointerType!=="touch"&&Hs()}),onClick:callAllHandlers(Ks.onClick,Zs),onPointerDown:callAllHandlers(Ks.onPointerDown,Nl),onFocus:callAllHandlers(Ks.onFocus,Hs),onBlur:callAllHandlers(Ks.onBlur,Ys),"aria-describedby":Es?Ps:void 0}),[Hs,Ys,Nl,Es,Ps,Zs,Rs]),Rl=reactExports.useCallback((Ks={},qs=null)=>Ds({...Ks,style:{...Ks.style,[cssVars.arrowSize.var]:bs?`${bs}px`:void 0,[cssVars.arrowShadowColor.var]:vs}},qs),[Ds,bs,vs]),Ml=reactExports.useCallback((Ks={},qs=null)=>{const Qs={...Ks.style,position:"relative",transformOrigin:cssVars.transformOrigin.varRef};return{ref:qs,...ws,...Ks,id:Ps,role:"tooltip",style:Qs}},[ws,Ps]);return{isOpen:Es,show:Hs,hide:Ys,getTriggerProps:Dl,getTooltipProps:Ml,getTooltipPositionerProps:Rl,getArrowProps:Is,getArrowInnerProps:Os}}var closeEventName="chakra-ui:close-tooltip";function useCloseEvent(as,rs){return reactExports.useEffect(()=>{const ns=getDoc(as);return ns.addEventListener(closeEventName,rs),()=>ns.removeEventListener(closeEventName,rs)},[rs,as]),()=>{const ns=getDoc(as),ss=getWin(as);ns.dispatchEvent(new ss.CustomEvent(closeEventName))}}function omit(as,rs=[]){const ns=Object.assign({},as);for(const ss of rs)ss in ns&&delete ns[ss];return ns}function pick$1(as,rs){const ns={};for(const ss of rs)ss in as&&(ns[ss]=as[ss]);return ns}var MotionDiv=chakra(motion.div),Tooltip=forwardRef((as,rs)=>{var ns,ss;const os=useStyleConfig("Tooltip",as),ls=omitThemingProps(as),us=useTheme(),{children:cs,label:ds,shouldWrapChildren:ps,"aria-label":fs,hasArrow:hs,bg:gs,portalProps:ys,background:bs,backgroundColor:vs,bgColor:xs,motionProps:Cs,...Ts}=ls,Ss=(ss=(ns=bs??vs)!=null?ns:gs)!=null?ss:xs;if(Ss){os.bg=Ss;const Ds=getCSSVar(us,"colors",Ss);os[cssVars.arrowBg.var]=Ds}const Ns=useTooltip({...Ts,direction:us.direction}),As=typeof cs=="string"||ps;let ws;if(As)ws=jsx$1(chakra.span,{display:"inline-block",tabIndex:0,...Ns.getTriggerProps(),children:cs});else{const Ds=reactExports.Children.only(cs);ws=reactExports.cloneElement(Ds,Ns.getTriggerProps(Ds.props,Ds.ref))}const Es=!!fs,_s=Ns.getTooltipProps({},rs),$s=Es?omit(_s,["role","id"]):_s,Rs=pick$1(_s,["role","id"]);return ds?jsxs(Fragment,{children:[ws,jsx$1(AnimatePresence,{children:Ns.isOpen&&jsx$1(Portal,{...ys,children:jsx$1(chakra.div,{...Ns.getTooltipPositionerProps(),__css:{zIndex:os.zIndex,pointerEvents:"none"},children:jsxs(MotionDiv,{variants:scale,initial:"exit",animate:"enter",exit:"exit",...Cs,...$s,__css:os,children:[ds,Es&&jsx$1(chakra.span,{srOnly:!0,...Rs,children:fs}),hs&&jsx$1(chakra.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:jsx$1(chakra.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:os.bg}})})]})})})})]}):jsx$1(Fragment,{children:cs})});Tooltip.displayName="Tooltip";function isObject$5(as){return as!==null&&typeof as=="object"&&"constructor"in as&&as.constructor===Object}function extend$2(as={},rs={}){Object.keys(rs).forEach(ns=>{typeof as[ns]>"u"?as[ns]=rs[ns]:isObject$5(rs[ns])&&isObject$5(as[ns])&&Object.keys(rs[ns]).length>0&&extend$2(as[ns],rs[ns])})}const ssrDocument={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function getDocument(){const as=typeof document<"u"?document:{};return extend$2(as,ssrDocument),as}const ssrWindow={document:ssrDocument,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function as(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(as){return typeof setTimeout>"u"?(as(),null):setTimeout(as,0)},cancelAnimationFrame(as){typeof setTimeout>"u"||clearTimeout(as)}};function getWindow(){const as=typeof window<"u"?window:{};return extend$2(as,ssrWindow),as}function deleteProps(as){const rs=as;Object.keys(rs).forEach(ns=>{try{rs[ns]=null}catch{}try{delete rs[ns]}catch{}})}function nextTick(as,rs=0){return setTimeout(as,rs)}function now(){return Date.now()}function getComputedStyle$1(as){const rs=getWindow();let ns;return rs.getComputedStyle&&(ns=rs.getComputedStyle(as,null)),!ns&&as.currentStyle&&(ns=as.currentStyle),ns||(ns=as.style),ns}function getTranslate(as,rs="x"){const ns=getWindow();let ss,os,ls;const us=getComputedStyle$1(as);return ns.WebKitCSSMatrix?(os=us.transform||us.webkitTransform,os.split(",").length>6&&(os=os.split(", ").map(cs=>cs.replace(",",".")).join(", ")),ls=new ns.WebKitCSSMatrix(os==="none"?"":os)):(ls=us.MozTransform||us.OTransform||us.MsTransform||us.msTransform||us.transform||us.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),ss=ls.toString().split(",")),rs==="x"&&(ns.WebKitCSSMatrix?os=ls.m41:ss.length===16?os=parseFloat(ss[12]):os=parseFloat(ss[4])),rs==="y"&&(ns.WebKitCSSMatrix?os=ls.m42:ss.length===16?os=parseFloat(ss[13]):os=parseFloat(ss[5])),os||0}function isObject$4(as){return typeof as=="object"&&as!==null&&as.constructor&&Object.prototype.toString.call(as).slice(8,-1)==="Object"}function isNode$1(as){return typeof window<"u"&&typeof window.HTMLElement<"u"?as instanceof HTMLElement:as&&(as.nodeType===1||as.nodeType===11)}function extend$1(...as){const rs=Object(as[0]),ns=["__proto__","constructor","prototype"];for(let ss=1;ssns.indexOf(us)<0);for(let us=0,cs=ls.length;usos?"next":"prev",ps=(hs,gs)=>ds==="next"&&hs>=gs||ds==="prev"&&hs<=gs,fs=()=>{us=new Date().getTime(),ls===null&&(ls=us);const hs=Math.max(Math.min((us-ls)/cs,1),0),gs=.5-Math.cos(hs*Math.PI)/2;let ys=os+gs*(rs-os);if(ps(ys,rs)&&(ys=rs),as.wrapperEl.scrollTo({[ns]:ys}),ps(ys,rs)){as.wrapperEl.style.overflow="hidden",as.wrapperEl.style.scrollSnapType="",setTimeout(()=>{as.wrapperEl.style.overflow="",as.wrapperEl.scrollTo({[ns]:ys})}),ss.cancelAnimationFrame(as.cssModeFrameID);return}as.cssModeFrameID=ss.requestAnimationFrame(fs)};fs()}function elementChildren(as,rs=""){return[...as.children].filter(ns=>ns.matches(rs))}function createElement(as,rs=[]){const ns=document.createElement(as);return ns.classList.add(...Array.isArray(rs)?rs:[rs]),ns}function elementOffset(as){const rs=getWindow(),ns=getDocument(),ss=as.getBoundingClientRect(),os=ns.body,ls=as.clientTop||os.clientTop||0,us=as.clientLeft||os.clientLeft||0,cs=as===rs?rs.scrollY:as.scrollTop,ds=as===rs?rs.scrollX:as.scrollLeft;return{top:ss.top+cs-ls,left:ss.left+ds-us}}function elementPrevAll(as,rs){const ns=[];for(;as.previousElementSibling;){const ss=as.previousElementSibling;rs?ss.matches(rs)&&ns.push(ss):ns.push(ss),as=ss}return ns}function elementNextAll(as,rs){const ns=[];for(;as.nextElementSibling;){const ss=as.nextElementSibling;rs?ss.matches(rs)&&ns.push(ss):ns.push(ss),as=ss}return ns}function elementStyle(as,rs){return getWindow().getComputedStyle(as,null).getPropertyValue(rs)}function elementIndex(as){let rs=as,ns;if(rs){for(ns=0;(rs=rs.previousSibling)!==null;)rs.nodeType===1&&(ns+=1);return ns}}function elementParents(as,rs){const ns=[];let ss=as.parentElement;for(;ss;)rs?ss.matches(rs)&&ns.push(ss):ns.push(ss),ss=ss.parentElement;return ns}function elementOuterSize(as,rs,ns){const ss=getWindow();return ns?as[rs==="width"?"offsetWidth":"offsetHeight"]+parseFloat(ss.getComputedStyle(as,null).getPropertyValue(rs==="width"?"margin-right":"margin-top"))+parseFloat(ss.getComputedStyle(as,null).getPropertyValue(rs==="width"?"margin-left":"margin-bottom")):as.offsetWidth}let support;function calcSupport(){const as=getWindow(),rs=getDocument();return{smoothScroll:rs.documentElement&&"scrollBehavior"in rs.documentElement.style,touch:!!("ontouchstart"in as||as.DocumentTouch&&rs instanceof as.DocumentTouch)}}function getSupport(){return support||(support=calcSupport()),support}let deviceCached;function calcDevice({userAgent:as}={}){const rs=getSupport(),ns=getWindow(),ss=ns.navigator.platform,os=as||ns.navigator.userAgent,ls={ios:!1,android:!1},us=ns.screen.width,cs=ns.screen.height,ds=os.match(/(Android);?[\s\/]+([\d.]+)?/);let ps=os.match(/(iPad).*OS\s([\d_]+)/);const fs=os.match(/(iPod)(.*OS\s([\d_]+))?/),hs=!ps&&os.match(/(iPhone\sOS|iOS)\s([\d_]+)/),gs=ss==="Win32";let ys=ss==="MacIntel";const bs=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!ps&&ys&&rs.touch&&bs.indexOf(`${us}x${cs}`)>=0&&(ps=os.match(/(Version)\/([\d.]+)/),ps||(ps=[0,1,"13_0_0"]),ys=!1),ds&&!gs&&(ls.os="android",ls.android=!0),(ps||hs||fs)&&(ls.os="ios",ls.ios=!0),ls}function getDevice(as={}){return deviceCached||(deviceCached=calcDevice(as)),deviceCached}let browser;function calcBrowser(){const as=getWindow();let rs=!1;function ns(){const ss=as.navigator.userAgent.toLowerCase();return ss.indexOf("safari")>=0&&ss.indexOf("chrome")<0&&ss.indexOf("android")<0}if(ns()){const ss=String(as.navigator.userAgent);if(ss.includes("Version/")){const[os,ls]=ss.split("Version/")[1].split(" ")[0].split(".").map(us=>Number(us));rs=os<16||os===16&&ls<2}}return{isSafari:rs||ns(),needPerspectiveFix:rs,isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(as.navigator.userAgent)}}function getBrowser(){return browser||(browser=calcBrowser()),browser}function Resize({swiper:as,on:rs,emit:ns}){const ss=getWindow();let os=null,ls=null;const us=()=>{!as||as.destroyed||!as.initialized||(ns("beforeResize"),ns("resize"))},cs=()=>{!as||as.destroyed||!as.initialized||(os=new ResizeObserver(fs=>{ls=ss.requestAnimationFrame(()=>{const{width:hs,height:gs}=as;let ys=hs,bs=gs;fs.forEach(({contentBoxSize:vs,contentRect:xs,target:Cs})=>{Cs&&Cs!==as.el||(ys=xs?xs.width:(vs[0]||vs).inlineSize,bs=xs?xs.height:(vs[0]||vs).blockSize)}),(ys!==hs||bs!==gs)&&us()})}),os.observe(as.el))},ds=()=>{ls&&ss.cancelAnimationFrame(ls),os&&os.unobserve&&as.el&&(os.unobserve(as.el),os=null)},ps=()=>{!as||as.destroyed||!as.initialized||ns("orientationchange")};rs("init",()=>{if(as.params.resizeObserver&&typeof ss.ResizeObserver<"u"){cs();return}ss.addEventListener("resize",us),ss.addEventListener("orientationchange",ps)}),rs("destroy",()=>{ds(),ss.removeEventListener("resize",us),ss.removeEventListener("orientationchange",ps)})}function Observer({swiper:as,extendParams:rs,on:ns,emit:ss}){const os=[],ls=getWindow(),us=(ps,fs={})=>{const hs=ls.MutationObserver||ls.WebkitMutationObserver,gs=new hs(ys=>{if(ys.length===1){ss("observerUpdate",ys[0]);return}const bs=function(){ss("observerUpdate",ys[0])};ls.requestAnimationFrame?ls.requestAnimationFrame(bs):ls.setTimeout(bs,0)});gs.observe(ps,{attributes:typeof fs.attributes>"u"?!0:fs.attributes,childList:typeof fs.childList>"u"?!0:fs.childList,characterData:typeof fs.characterData>"u"?!0:fs.characterData}),os.push(gs)},cs=()=>{if(as.params.observer){if(as.params.observeParents){const ps=elementParents(as.el);for(let fs=0;fs{os.forEach(ps=>{ps.disconnect()}),os.splice(0,os.length)};rs({observer:!1,observeParents:!1,observeSlideChildren:!1}),ns("init",cs),ns("destroy",ds)}const eventsEmitter={on(as,rs,ns){const ss=this;if(!ss.eventsListeners||ss.destroyed||typeof rs!="function")return ss;const os=ns?"unshift":"push";return as.split(" ").forEach(ls=>{ss.eventsListeners[ls]||(ss.eventsListeners[ls]=[]),ss.eventsListeners[ls][os](rs)}),ss},once(as,rs,ns){const ss=this;if(!ss.eventsListeners||ss.destroyed||typeof rs!="function")return ss;function os(...ls){ss.off(as,os),os.__emitterProxy&&delete os.__emitterProxy,rs.apply(ss,ls)}return os.__emitterProxy=rs,ss.on(as,os,ns)},onAny(as,rs){const ns=this;if(!ns.eventsListeners||ns.destroyed||typeof as!="function")return ns;const ss=rs?"unshift":"push";return ns.eventsAnyListeners.indexOf(as)<0&&ns.eventsAnyListeners[ss](as),ns},offAny(as){const rs=this;if(!rs.eventsListeners||rs.destroyed||!rs.eventsAnyListeners)return rs;const ns=rs.eventsAnyListeners.indexOf(as);return ns>=0&&rs.eventsAnyListeners.splice(ns,1),rs},off(as,rs){const ns=this;return!ns.eventsListeners||ns.destroyed||!ns.eventsListeners||as.split(" ").forEach(ss=>{typeof rs>"u"?ns.eventsListeners[ss]=[]:ns.eventsListeners[ss]&&ns.eventsListeners[ss].forEach((os,ls)=>{(os===rs||os.__emitterProxy&&os.__emitterProxy===rs)&&ns.eventsListeners[ss].splice(ls,1)})}),ns},emit(...as){const rs=this;if(!rs.eventsListeners||rs.destroyed||!rs.eventsListeners)return rs;let ns,ss,os;return typeof as[0]=="string"||Array.isArray(as[0])?(ns=as[0],ss=as.slice(1,as.length),os=rs):(ns=as[0].events,ss=as[0].data,os=as[0].context||rs),ss.unshift(os),(Array.isArray(ns)?ns:ns.split(" ")).forEach(us=>{rs.eventsAnyListeners&&rs.eventsAnyListeners.length&&rs.eventsAnyListeners.forEach(cs=>{cs.apply(os,[us,...ss])}),rs.eventsListeners&&rs.eventsListeners[us]&&rs.eventsListeners[us].forEach(cs=>{cs.apply(os,ss)})}),rs}};function updateSize(){const as=this;let rs,ns;const ss=as.el;typeof as.params.width<"u"&&as.params.width!==null?rs=as.params.width:rs=ss.clientWidth,typeof as.params.height<"u"&&as.params.height!==null?ns=as.params.height:ns=ss.clientHeight,!(rs===0&&as.isHorizontal()||ns===0&&as.isVertical())&&(rs=rs-parseInt(elementStyle(ss,"padding-left")||0,10)-parseInt(elementStyle(ss,"padding-right")||0,10),ns=ns-parseInt(elementStyle(ss,"padding-top")||0,10)-parseInt(elementStyle(ss,"padding-bottom")||0,10),Number.isNaN(rs)&&(rs=0),Number.isNaN(ns)&&(ns=0),Object.assign(as,{width:rs,height:ns,size:as.isHorizontal()?rs:ns}))}function updateSlides(){const as=this;function rs(Ds){return as.isHorizontal()?Ds:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[Ds]}function ns(Ds,Os){return parseFloat(Ds.getPropertyValue(rs(Os))||0)}const ss=as.params,{wrapperEl:os,slidesEl:ls,size:us,rtlTranslate:cs,wrongRTL:ds}=as,ps=as.virtual&&ss.virtual.enabled,fs=ps?as.virtual.slides.length:as.slides.length,hs=elementChildren(ls,`.${as.params.slideClass}, swiper-slide`),gs=ps?as.virtual.slides.length:hs.length;let ys=[];const bs=[],vs=[];let xs=ss.slidesOffsetBefore;typeof xs=="function"&&(xs=ss.slidesOffsetBefore.call(as));let Cs=ss.slidesOffsetAfter;typeof Cs=="function"&&(Cs=ss.slidesOffsetAfter.call(as));const Ts=as.snapGrid.length,Ss=as.slidesGrid.length;let Ns=ss.spaceBetween,As=-xs,ws=0,Es=0;if(typeof us>"u")return;typeof Ns=="string"&&Ns.indexOf("%")>=0&&(Ns=parseFloat(Ns.replace("%",""))/100*us),as.virtualSize=-Ns,hs.forEach(Ds=>{cs?Ds.style.marginLeft="":Ds.style.marginRight="",Ds.style.marginBottom="",Ds.style.marginTop=""}),ss.centeredSlides&&ss.cssMode&&(setCSSProperty(os,"--swiper-centered-offset-before",""),setCSSProperty(os,"--swiper-centered-offset-after",""));const _s=ss.grid&&ss.grid.rows>1&&as.grid;_s&&as.grid.initSlides(gs);let $s;const Rs=ss.slidesPerView==="auto"&&ss.breakpoints&&Object.keys(ss.breakpoints).filter(Ds=>typeof ss.breakpoints[Ds].slidesPerView<"u").length>0;for(let Ds=0;Ds1&&ys.push(as.virtualSize-us)}if(ps&&ss.loop){const Ds=vs[0]+Ns;if(ss.slidesPerGroup>1){const Os=Math.ceil((as.virtual.slidesBefore+as.virtual.slidesAfter)/ss.slidesPerGroup),Is=Ds*ss.slidesPerGroup;for(let Vs=0;Vs!ss.cssMode||ss.loop?!0:Is!==hs.length-1).forEach(Os=>{Os.style[Ds]=`${Ns}px`})}if(ss.centeredSlides&&ss.centeredSlidesBounds){let Ds=0;vs.forEach(Is=>{Ds+=Is+(ss.spaceBetween?ss.spaceBetween:0)}),Ds-=ss.spaceBetween;const Os=Ds-us;ys=ys.map(Is=>Is<0?-xs:Is>Os?Os+Cs:Is)}if(ss.centerInsufficientSlides){let Ds=0;if(vs.forEach(Os=>{Ds+=Os+(ss.spaceBetween?ss.spaceBetween:0)}),Ds-=ss.spaceBetween,Ds{ys[Vs]=Is-Os}),bs.forEach((Is,Vs)=>{bs[Vs]=Is+Os})}}if(Object.assign(as,{slides:hs,snapGrid:ys,slidesGrid:bs,slidesSizesGrid:vs}),ss.centeredSlides&&ss.cssMode&&!ss.centeredSlidesBounds){setCSSProperty(os,"--swiper-centered-offset-before",`${-ys[0]}px`),setCSSProperty(os,"--swiper-centered-offset-after",`${as.size/2-vs[vs.length-1]/2}px`);const Ds=-as.snapGrid[0],Os=-as.slidesGrid[0];as.snapGrid=as.snapGrid.map(Is=>Is+Ds),as.slidesGrid=as.slidesGrid.map(Is=>Is+Os)}if(gs!==fs&&as.emit("slidesLengthChange"),ys.length!==Ts&&(as.params.watchOverflow&&as.checkOverflow(),as.emit("snapGridLengthChange")),bs.length!==Ss&&as.emit("slidesGridLengthChange"),ss.watchSlidesProgress&&as.updateSlidesOffset(),!ps&&!ss.cssMode&&(ss.effect==="slide"||ss.effect==="fade")){const Ds=`${ss.containerModifierClass}backface-hidden`,Os=as.el.classList.contains(Ds);gs<=ss.maxBackfaceHiddenSlides?Os||as.el.classList.add(Ds):Os&&as.el.classList.remove(Ds)}}function updateAutoHeight(as){const rs=this,ns=[],ss=rs.virtual&&rs.params.virtual.enabled;let os=0,ls;typeof as=="number"?rs.setTransition(as):as===!0&&rs.setTransition(rs.params.speed);const us=cs=>ss?rs.slides.filter(ds=>parseInt(ds.getAttribute("data-swiper-slide-index"),10)===cs)[0]:rs.slides[cs];if(rs.params.slidesPerView!=="auto"&&rs.params.slidesPerView>1)if(rs.params.centeredSlides)(rs.visibleSlides||[]).forEach(cs=>{ns.push(cs)});else for(ls=0;lsrs.slides.length&&!ss)break;ns.push(us(cs))}else ns.push(us(rs.activeIndex));for(ls=0;lsos?cs:os}(os||os===0)&&(rs.wrapperEl.style.height=`${os}px`)}function updateSlidesOffset(){const as=this,rs=as.slides,ns=as.isElement?as.isHorizontal()?as.wrapperEl.offsetLeft:as.wrapperEl.offsetTop:0;for(let ss=0;ss"u"&&rs.updateSlidesOffset();let us=-as;os&&(us=as),ss.forEach(cs=>{cs.classList.remove(ns.slideVisibleClass)}),rs.visibleSlidesIndexes=[],rs.visibleSlides=[];for(let cs=0;cs=0&&gs1&&ys<=rs.size||gs<=0&&ys>=rs.size)&&(rs.visibleSlides.push(ds),rs.visibleSlidesIndexes.push(cs),ss[cs].classList.add(ns.slideVisibleClass)),ds.progress=os?-fs:fs,ds.originalProgress=os?-hs:hs}}function updateProgress(as){const rs=this;if(typeof as>"u"){const fs=rs.rtlTranslate?-1:1;as=rs&&rs.translate&&rs.translate*fs||0}const ns=rs.params,ss=rs.maxTranslate()-rs.minTranslate();let{progress:os,isBeginning:ls,isEnd:us,progressLoop:cs}=rs;const ds=ls,ps=us;if(ss===0)os=0,ls=!0,us=!0;else{os=(as-rs.minTranslate())/ss;const fs=Math.abs(as-rs.minTranslate())<1,hs=Math.abs(as-rs.maxTranslate())<1;ls=fs||os<=0,us=hs||os>=1,fs&&(os=0),hs&&(os=1)}if(ns.loop){const fs=elementIndex(rs.slides.filter(xs=>xs.getAttribute("data-swiper-slide-index")==="0")[0]),hs=elementIndex(rs.slides.filter(xs=>xs.getAttribute("data-swiper-slide-index")*1===rs.slides.length-1)[0]),gs=rs.slidesGrid[fs],ys=rs.slidesGrid[hs],bs=rs.slidesGrid[rs.slidesGrid.length-1],vs=Math.abs(as);vs>=gs?cs=(vs-gs)/bs:cs=(vs+bs-ys)/bs,cs>1&&(cs-=1)}Object.assign(rs,{progress:os,progressLoop:cs,isBeginning:ls,isEnd:us}),(ns.watchSlidesProgress||ns.centeredSlides&&ns.autoHeight)&&rs.updateSlidesProgress(as),ls&&!ds&&rs.emit("reachBeginning toEdge"),us&&!ps&&rs.emit("reachEnd toEdge"),(ds&&!ls||ps&&!us)&&rs.emit("fromEdge"),rs.emit("progress",os)}function updateSlidesClasses(){const as=this,{slides:rs,params:ns,slidesEl:ss,activeIndex:os}=as,ls=as.virtual&&ns.virtual.enabled,us=ds=>elementChildren(ss,`.${ns.slideClass}${ds}, swiper-slide${ds}`)[0];rs.forEach(ds=>{ds.classList.remove(ns.slideActiveClass,ns.slideNextClass,ns.slidePrevClass)});let cs;if(ls)if(ns.loop){let ds=os-as.virtual.slidesBefore;ds<0&&(ds=as.virtual.slides.length+ds),ds>=as.virtual.slides.length&&(ds-=as.virtual.slides.length),cs=us(`[data-swiper-slide-index="${ds}"]`)}else cs=us(`[data-swiper-slide-index="${os}"]`);else cs=rs[os];if(cs){cs.classList.add(ns.slideActiveClass);let ds=elementNextAll(cs,`.${ns.slideClass}, swiper-slide`)[0];ns.loop&&!ds&&(ds=rs[0]),ds&&ds.classList.add(ns.slideNextClass);let ps=elementPrevAll(cs,`.${ns.slideClass}, swiper-slide`)[0];ns.loop&&!ps===0&&(ps=rs[rs.length-1]),ps&&ps.classList.add(ns.slidePrevClass)}as.emitSlidesClasses()}function getActiveIndexByTranslate(as){const{slidesGrid:rs,params:ns}=as,ss=as.rtlTranslate?as.translate:-as.translate;let os;for(let ls=0;ls=rs[ls]&&ss=rs[ls]&&ss=rs[ls]&&(os=ls);return ns.normalizeSlideIndex&&(os<0||typeof os>"u")&&(os=0),os}function updateActiveIndex(as){const rs=this,ns=rs.rtlTranslate?rs.translate:-rs.translate,{snapGrid:ss,params:os,activeIndex:ls,realIndex:us,snapIndex:cs}=rs;let ds=as,ps;const fs=gs=>{let ys=gs-rs.virtual.slidesBefore;return ys<0&&(ys=rs.virtual.slides.length+ys),ys>=rs.virtual.slides.length&&(ys-=rs.virtual.slides.length),ys};if(typeof ds>"u"&&(ds=getActiveIndexByTranslate(rs)),ss.indexOf(ns)>=0)ps=ss.indexOf(ns);else{const gs=Math.min(os.slidesPerGroupSkip,ds);ps=gs+Math.floor((ds-gs)/os.slidesPerGroup)}if(ps>=ss.length&&(ps=ss.length-1),ds===ls){ps!==cs&&(rs.snapIndex=ps,rs.emit("snapIndexChange")),rs.params.loop&&rs.virtual&&rs.params.virtual.enabled&&(rs.realIndex=fs(ds));return}let hs;rs.virtual&&os.virtual.enabled&&os.loop?hs=fs(ds):rs.slides[ds]?hs=parseInt(rs.slides[ds].getAttribute("data-swiper-slide-index")||ds,10):hs=ds,Object.assign(rs,{snapIndex:ps,realIndex:hs,previousIndex:ls,activeIndex:ds}),rs.emit("activeIndexChange"),rs.emit("snapIndexChange"),us!==hs&&rs.emit("realIndexChange"),(rs.initialized||rs.params.runCallbacksOnInit)&&rs.emit("slideChange")}function updateClickedSlide(as){const rs=this,ns=rs.params,ss=as.closest(`.${ns.slideClass}, swiper-slide`);let os=!1,ls;if(ss){for(let us=0;usds?fs=ds:ss&&asls?us="next":os=ds.length&&(xs=ds.length-1);const Cs=-ds[xs];if(cs.normalizeSlideIndex)for(let Ss=0;Ss=As&&Ns=As&&Ns=As&&(us=Ss)}if(ls.initialized&&us!==hs&&(!ls.allowSlideNext&&Csls.translate&&Cs>ls.maxTranslate()&&(hs||0)!==us))return!1;us!==(fs||0)&&ns&&ls.emit("beforeSlideChangeStart"),ls.updateProgress(Cs);let Ts;if(us>hs?Ts="next":us0?(ls._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{ys[Ss?"scrollLeft":"scrollTop"]=Ns})):ys[Ss?"scrollLeft":"scrollTop"]=Ns,As&&requestAnimationFrame(()=>{ls.wrapperEl.style.scrollSnapType="",ls._immediateVirtual=!1})}else{if(!ls.support.smoothScroll)return animateCSSModeScroll({swiper:ls,targetPosition:Ns,side:Ss?"left":"top"}),!0;ys.scrollTo({[Ss?"left":"top"]:Ns,behavior:"smooth"})}return!0}return ls.setTransition(rs),ls.setTranslate(Cs),ls.updateActiveIndex(us),ls.updateSlidesClasses(),ls.emit("beforeTransitionStart",rs,ss),ls.transitionStart(ns,Ts),rs===0?ls.transitionEnd(ns,Ts):ls.animating||(ls.animating=!0,ls.onSlideToWrapperTransitionEnd||(ls.onSlideToWrapperTransitionEnd=function(Ns){!ls||ls.destroyed||Ns.target===this&&(ls.wrapperEl.removeEventListener("transitionend",ls.onSlideToWrapperTransitionEnd),ls.onSlideToWrapperTransitionEnd=null,delete ls.onSlideToWrapperTransitionEnd,ls.transitionEnd(ns,Ts))}),ls.wrapperEl.addEventListener("transitionend",ls.onSlideToWrapperTransitionEnd)),!0}function slideToLoop(as=0,rs=this.params.speed,ns=!0,ss){typeof as=="string"&&(as=parseInt(as,10));const os=this;let ls=as;return os.params.loop&&(os.virtual&&os.params.virtual.enabled?ls=ls+os.virtual.slidesBefore:ls=elementIndex(os.slides.filter(us=>us.getAttribute("data-swiper-slide-index")*1===ls)[0])),os.slideTo(ls,rs,ns,ss)}function slideNext(as=this.params.speed,rs=!0,ns){const ss=this,{enabled:os,params:ls,animating:us}=ss;if(!os)return ss;let cs=ls.slidesPerGroup;ls.slidesPerView==="auto"&&ls.slidesPerGroup===1&&ls.slidesPerGroupAuto&&(cs=Math.max(ss.slidesPerViewDynamic("current",!0),1));const ds=ss.activeIndexgs(Cs));let vs=ls[bs.indexOf(ys)-1];if(typeof vs>"u"&&os.cssMode){let Cs;ls.forEach((Ts,Ss)=>{ys>=Ts&&(Cs=Ss)}),typeof Cs<"u"&&(vs=ls[Cs>0?Cs-1:Cs])}let xs=0;if(typeof vs<"u"&&(xs=us.indexOf(vs),xs<0&&(xs=ss.activeIndex-1),os.slidesPerView==="auto"&&os.slidesPerGroup===1&&os.slidesPerGroupAuto&&(xs=xs-ss.slidesPerViewDynamic("previous",!0)+1,xs=Math.max(xs,0))),os.rewind&&ss.isBeginning){const Cs=ss.params.virtual&&ss.params.virtual.enabled&&ss.virtual?ss.virtual.slides.length-1:ss.slides.length-1;return ss.slideTo(Cs,as,rs,ns)}return ss.slideTo(xs,as,rs,ns)}function slideReset(as=this.params.speed,rs=!0,ns){const ss=this;return ss.slideTo(ss.activeIndex,as,rs,ns)}function slideToClosest(as=this.params.speed,rs=!0,ns,ss=.5){const os=this;let ls=os.activeIndex;const us=Math.min(os.params.slidesPerGroupSkip,ls),cs=us+Math.floor((ls-us)/os.params.slidesPerGroup),ds=os.rtlTranslate?os.translate:-os.translate;if(ds>=os.snapGrid[cs]){const ps=os.snapGrid[cs],fs=os.snapGrid[cs+1];ds-ps>(fs-ps)*ss&&(ls+=os.params.slidesPerGroup)}else{const ps=os.snapGrid[cs-1],fs=os.snapGrid[cs];ds-ps<=(fs-ps)*ss&&(ls-=os.params.slidesPerGroup)}return ls=Math.max(ls,0),ls=Math.min(ls,os.slidesGrid.length-1),os.slideTo(ls,as,rs,ns)}function slideToClickedSlide(){const as=this,{params:rs,slidesEl:ns}=as,ss=rs.slidesPerView==="auto"?as.slidesPerViewDynamic():rs.slidesPerView;let os=as.clickedIndex,ls;const us=as.isElement?"swiper-slide":`.${rs.slideClass}`;if(rs.loop){if(as.animating)return;ls=parseInt(as.clickedSlide.getAttribute("data-swiper-slide-index"),10),rs.centeredSlides?osas.slides.length-as.loopedSlides+ss/2?(as.loopFix(),os=elementIndex(elementChildren(ns,`${us}[data-swiper-slide-index="${ls}"]`)[0]),nextTick(()=>{as.slideTo(os)})):as.slideTo(os):os>as.slides.length-ss?(as.loopFix(),os=elementIndex(elementChildren(ns,`${us}[data-swiper-slide-index="${ls}"]`)[0]),nextTick(()=>{as.slideTo(os)})):as.slideTo(os)}else as.slideTo(os)}const slide={slideTo,slideToLoop,slideNext,slidePrev,slideReset,slideToClosest,slideToClickedSlide};function loopCreate(as){const rs=this,{params:ns,slidesEl:ss}=rs;if(!ns.loop||rs.virtual&&rs.params.virtual.enabled)return;elementChildren(ss,`.${ns.slideClass}, swiper-slide`).forEach((ls,us)=>{ls.setAttribute("data-swiper-slide-index",us)}),rs.loopFix({slideRealIndex:as,direction:ns.centeredSlides?void 0:"next"})}function loopFix({slideRealIndex:as,slideTo:rs=!0,direction:ns,setTranslate:ss,activeSlideIndex:os,byController:ls,byMousewheel:us}={}){const cs=this;if(!cs.params.loop)return;cs.emit("beforeLoopFix");const{slides:ds,allowSlidePrev:ps,allowSlideNext:fs,slidesEl:hs,params:gs}=cs;if(cs.allowSlidePrev=!0,cs.allowSlideNext=!0,cs.virtual&&gs.virtual.enabled){rs&&(!gs.centeredSlides&&cs.snapIndex===0?cs.slideTo(cs.virtual.slides.length,0,!1,!0):gs.centeredSlides&&cs.snapIndex"u"?os=elementIndex(cs.slides.filter(ws=>ws.classList.contains("swiper-slide-active"))[0]):Cs=os;const Ts=ns==="next"||!ns,Ss=ns==="prev"||!ns;let Ns=0,As=0;if(oscs.slides.length-bs*2){As=os-(cs.slides.length-bs*2);for(let ws=0;ws{hs.prepend(cs.slides[ws])}),Ts&&xs.forEach(ws=>{hs.append(cs.slides[ws])}),cs.recalcSlides(),gs.watchSlidesProgress&&cs.updateSlidesOffset(),rs){if(vs.length>0&&Ss)if(typeof as>"u"){const ws=cs.slidesGrid[Cs],_s=cs.slidesGrid[Cs+Ns]-ws;us?cs.setTranslate(cs.translate-_s):(cs.slideTo(Cs+Ns,0,!1,!0),ss&&(cs.touches[cs.isHorizontal()?"startX":"startY"]+=_s))}else ss&&cs.slideToLoop(as,0,!1,!0);else if(xs.length>0&&Ts)if(typeof as>"u"){const ws=cs.slidesGrid[Cs],_s=cs.slidesGrid[Cs-As]-ws;us?cs.setTranslate(cs.translate-_s):(cs.slideTo(Cs-As,0,!1,!0),ss&&(cs.touches[cs.isHorizontal()?"startX":"startY"]+=_s))}else cs.slideToLoop(as,0,!1,!0)}if(cs.allowSlidePrev=ps,cs.allowSlideNext=fs,cs.controller&&cs.controller.control&&!ls){const ws={slideRealIndex:as,slideTo:!1,direction:ns,setTranslate:ss,activeSlideIndex:os,byController:!0};Array.isArray(cs.controller.control)?cs.controller.control.forEach(Es=>{Es.params.loop&&Es.loopFix(ws)}):cs.controller.control instanceof cs.constructor&&cs.controller.control.params.loop&&cs.controller.control.loopFix(ws)}cs.emit("loopFix")}function loopDestroy(){const as=this,{slides:rs,params:ns,slidesEl:ss}=as;if(!ns.loop||as.virtual&&as.params.virtual.enabled)return;as.recalcSlides();const os=[];rs.forEach(ls=>{const us=typeof ls.swiperSlideIndex>"u"?ls.getAttribute("data-swiper-slide-index")*1:ls.swiperSlideIndex;os[us]=ls}),rs.forEach(ls=>{ls.removeAttribute("data-swiper-slide-index")}),os.forEach(ls=>{ss.append(ls)}),as.recalcSlides(),as.slideTo(as.realIndex,0)}const loop={loopCreate,loopFix,loopDestroy};function setGrabCursor(as){const rs=this;if(!rs.params.simulateTouch||rs.params.watchOverflow&&rs.isLocked||rs.params.cssMode)return;const ns=rs.params.touchEventsTarget==="container"?rs.el:rs.wrapperEl;ns.style.cursor="move",ns.style.cursor=as?"grabbing":"grab"}function unsetGrabCursor(){const as=this;as.params.watchOverflow&&as.isLocked||as.params.cssMode||(as[as.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="")}const grabCursor={setGrabCursor,unsetGrabCursor};function closestElement(as,rs=this){function ns(ss){if(!ss||ss===getDocument()||ss===getWindow())return null;ss.assignedSlot&&(ss=ss.assignedSlot);const os=ss.closest(as);return!os&&!ss.getRootNode?null:os||ns(ss.getRootNode().host)}return ns(rs)}function onTouchStart(as){const rs=this,ns=getDocument(),ss=getWindow(),os=rs.touchEventsData;os.evCache.push(as);const{params:ls,touches:us,enabled:cs}=rs;if(!cs||!ls.simulateTouch&&as.pointerType==="mouse"||rs.animating&&ls.preventInteractionOnTransition)return;!rs.animating&&ls.cssMode&&ls.loop&&rs.loopFix();let ds=as;ds.originalEvent&&(ds=ds.originalEvent);let ps=ds.target;if(ls.touchEventsTarget==="wrapper"&&!rs.wrapperEl.contains(ps)||"which"in ds&&ds.which===3||"button"in ds&&ds.button>0||os.isTouched&&os.isMoved)return;const fs=!!ls.noSwipingClass&&ls.noSwipingClass!=="",hs=as.composedPath?as.composedPath():as.path;fs&&ds.target&&ds.target.shadowRoot&&hs&&(ps=hs[0]);const gs=ls.noSwipingSelector?ls.noSwipingSelector:`.${ls.noSwipingClass}`,ys=!!(ds.target&&ds.target.shadowRoot);if(ls.noSwiping&&(ys?closestElement(gs,ps):ps.closest(gs))){rs.allowClick=!0;return}if(ls.swipeHandler&&!ps.closest(ls.swipeHandler))return;us.currentX=ds.pageX,us.currentY=ds.pageY;const bs=us.currentX,vs=us.currentY,xs=ls.edgeSwipeDetection||ls.iOSEdgeSwipeDetection,Cs=ls.edgeSwipeThreshold||ls.iOSEdgeSwipeThreshold;if(xs&&(bs<=Cs||bs>=ss.innerWidth-Cs))if(xs==="prevent")as.preventDefault();else return;Object.assign(os,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),us.startX=bs,us.startY=vs,os.touchStartTime=now(),rs.allowClick=!0,rs.updateSize(),rs.swipeDirection=void 0,ls.threshold>0&&(os.allowThresholdMove=!1);let Ts=!0;ps.matches(os.focusableElements)&&(Ts=!1,ps.nodeName==="SELECT"&&(os.isTouched=!1)),ns.activeElement&&ns.activeElement.matches(os.focusableElements)&&ns.activeElement!==ps&&ns.activeElement.blur();const Ss=Ts&&rs.allowTouchMove&&ls.touchStartPreventDefault;(ls.touchStartForcePreventDefault||Ss)&&!ps.isContentEditable&&ds.preventDefault(),rs.params.freeMode&&rs.params.freeMode.enabled&&rs.freeMode&&rs.animating&&!ls.cssMode&&rs.freeMode.onTouchStart(),rs.emit("touchStart",ds)}function onTouchMove(as){const rs=getDocument(),ns=this,ss=ns.touchEventsData,{params:os,touches:ls,rtlTranslate:us,enabled:cs}=ns;if(!cs||!os.simulateTouch&&as.pointerType==="mouse")return;let ds=as;if(ds.originalEvent&&(ds=ds.originalEvent),!ss.isTouched){ss.startMoving&&ss.isScrolling&&ns.emit("touchMoveOpposite",ds);return}const ps=ss.evCache.findIndex(ws=>ws.pointerId===ds.pointerId);ps>=0&&(ss.evCache[ps]=ds);const fs=ss.evCache.length>1?ss.evCache[0]:ds,hs=fs.pageX,gs=fs.pageY;if(ds.preventedByNestedSwiper){ls.startX=hs,ls.startY=gs;return}if(!ns.allowTouchMove){ds.target.matches(ss.focusableElements)||(ns.allowClick=!1),ss.isTouched&&(Object.assign(ls,{startX:hs,startY:gs,prevX:ns.touches.currentX,prevY:ns.touches.currentY,currentX:hs,currentY:gs}),ss.touchStartTime=now());return}if(os.touchReleaseOnEdges&&!os.loop){if(ns.isVertical()){if(gsls.startY&&ns.translate>=ns.minTranslate()){ss.isTouched=!1,ss.isMoved=!1;return}}else if(hsls.startX&&ns.translate>=ns.minTranslate())return}if(rs.activeElement&&ds.target===rs.activeElement&&ds.target.matches(ss.focusableElements)){ss.isMoved=!0,ns.allowClick=!1;return}if(ss.allowTouchCallbacks&&ns.emit("touchMove",ds),ds.targetTouches&&ds.targetTouches.length>1)return;ls.currentX=hs,ls.currentY=gs;const ys=ls.currentX-ls.startX,bs=ls.currentY-ls.startY;if(ns.params.threshold&&Math.sqrt(ys**2+bs**2)"u"){let ws;ns.isHorizontal()&&ls.currentY===ls.startY||ns.isVertical()&&ls.currentX===ls.startX?ss.isScrolling=!1:ys*ys+bs*bs>=25&&(ws=Math.atan2(Math.abs(bs),Math.abs(ys))*180/Math.PI,ss.isScrolling=ns.isHorizontal()?ws>os.touchAngle:90-ws>os.touchAngle)}if(ss.isScrolling&&ns.emit("touchMoveOpposite",ds),typeof ss.startMoving>"u"&&(ls.currentX!==ls.startX||ls.currentY!==ls.startY)&&(ss.startMoving=!0),ss.isScrolling||ns.zoom&&ns.params.zoom&&ns.params.zoom.enabled&&ss.evCache.length>1){ss.isTouched=!1;return}if(!ss.startMoving)return;ns.allowClick=!1,!os.cssMode&&ds.cancelable&&ds.preventDefault(),os.touchMoveStopPropagation&&!os.nested&&ds.stopPropagation();let vs=ns.isHorizontal()?ys:bs,xs=ns.isHorizontal()?ls.currentX-ls.previousX:ls.currentY-ls.previousY;os.oneWayMovement&&(vs=Math.abs(vs)*(us?1:-1),xs=Math.abs(xs)*(us?1:-1)),ls.diff=vs,vs*=os.touchRatio,us&&(vs=-vs,xs=-xs);const Cs=ns.touchesDirection;ns.swipeDirection=vs>0?"prev":"next",ns.touchesDirection=xs>0?"prev":"next";const Ts=ns.params.loop&&!os.cssMode;if(!ss.isMoved){if(Ts&&ns.loopFix({direction:ns.swipeDirection}),ss.startTranslate=ns.getTranslate(),ns.setTransition(0),ns.animating){const ws=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});ns.wrapperEl.dispatchEvent(ws)}ss.allowMomentumBounce=!1,os.grabCursor&&(ns.allowSlideNext===!0||ns.allowSlidePrev===!0)&&ns.setGrabCursor(!0),ns.emit("sliderFirstMove",ds)}let Ss;ss.isMoved&&Cs!==ns.touchesDirection&&Ts&&Math.abs(vs)>=1&&(ns.loopFix({direction:ns.swipeDirection,setTranslate:!0}),Ss=!0),ns.emit("sliderMove",ds),ss.isMoved=!0,ss.currentTranslate=vs+ss.startTranslate;let Ns=!0,As=os.resistanceRatio;if(os.touchReleaseOnEdges&&(As=0),vs>0?(Ts&&!Ss&&ss.currentTranslate>(os.centeredSlides?ns.minTranslate()-ns.size/2:ns.minTranslate())&&ns.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),ss.currentTranslate>ns.minTranslate()&&(Ns=!1,os.resistance&&(ss.currentTranslate=ns.minTranslate()-1+(-ns.minTranslate()+ss.startTranslate+vs)**As))):vs<0&&(Ts&&!Ss&&ss.currentTranslate<(os.centeredSlides?ns.maxTranslate()+ns.size/2:ns.maxTranslate())&&ns.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:ns.slides.length-(os.slidesPerView==="auto"?ns.slidesPerViewDynamic():Math.ceil(parseFloat(os.slidesPerView,10)))}),ss.currentTranslatess.startTranslate&&(ss.currentTranslate=ss.startTranslate),!ns.allowSlidePrev&&!ns.allowSlideNext&&(ss.currentTranslate=ss.startTranslate),os.threshold>0)if(Math.abs(vs)>os.threshold||ss.allowThresholdMove){if(!ss.allowThresholdMove){ss.allowThresholdMove=!0,ls.startX=ls.currentX,ls.startY=ls.currentY,ss.currentTranslate=ss.startTranslate,ls.diff=ns.isHorizontal()?ls.currentX-ls.startX:ls.currentY-ls.startY;return}}else{ss.currentTranslate=ss.startTranslate;return}!os.followFinger||os.cssMode||((os.freeMode&&os.freeMode.enabled&&ns.freeMode||os.watchSlidesProgress)&&(ns.updateActiveIndex(),ns.updateSlidesClasses()),ns.params.freeMode&&os.freeMode.enabled&&ns.freeMode&&ns.freeMode.onTouchMove(),ns.updateProgress(ss.currentTranslate),ns.setTranslate(ss.currentTranslate))}function onTouchEnd(as){const rs=this,ns=rs.touchEventsData,ss=ns.evCache.findIndex(Ss=>Ss.pointerId===as.pointerId);if(ss>=0&&ns.evCache.splice(ss,1),["pointercancel","pointerout","pointerleave"].includes(as.type))return;const{params:os,touches:ls,rtlTranslate:us,slidesGrid:cs,enabled:ds}=rs;if(!ds||!os.simulateTouch&&as.pointerType==="mouse")return;let ps=as;if(ps.originalEvent&&(ps=ps.originalEvent),ns.allowTouchCallbacks&&rs.emit("touchEnd",ps),ns.allowTouchCallbacks=!1,!ns.isTouched){ns.isMoved&&os.grabCursor&&rs.setGrabCursor(!1),ns.isMoved=!1,ns.startMoving=!1;return}os.grabCursor&&ns.isMoved&&ns.isTouched&&(rs.allowSlideNext===!0||rs.allowSlidePrev===!0)&&rs.setGrabCursor(!1);const fs=now(),hs=fs-ns.touchStartTime;if(rs.allowClick){const Ss=ps.path||ps.composedPath&&ps.composedPath();rs.updateClickedSlide(Ss&&Ss[0]||ps.target),rs.emit("tap click",ps),hs<300&&fs-ns.lastClickTime<300&&rs.emit("doubleTap doubleClick",ps)}if(ns.lastClickTime=now(),nextTick(()=>{rs.destroyed||(rs.allowClick=!0)}),!ns.isTouched||!ns.isMoved||!rs.swipeDirection||ls.diff===0||ns.currentTranslate===ns.startTranslate){ns.isTouched=!1,ns.isMoved=!1,ns.startMoving=!1;return}ns.isTouched=!1,ns.isMoved=!1,ns.startMoving=!1;let gs;if(os.followFinger?gs=us?rs.translate:-rs.translate:gs=-ns.currentTranslate,os.cssMode)return;if(rs.params.freeMode&&os.freeMode.enabled){rs.freeMode.onTouchEnd({currentPos:gs});return}let ys=0,bs=rs.slidesSizesGrid[0];for(let Ss=0;Ss=cs[Ss]&&gs=cs[Ss]&&(ys=Ss,bs=cs[cs.length-1]-cs[cs.length-2])}let vs=null,xs=null;os.rewind&&(rs.isBeginning?xs=rs.params.virtual&&rs.params.virtual.enabled&&rs.virtual?rs.virtual.slides.length-1:rs.slides.length-1:rs.isEnd&&(vs=0));const Cs=(gs-cs[ys])/bs,Ts=ysos.longSwipesMs){if(!os.longSwipes){rs.slideTo(rs.activeIndex);return}rs.swipeDirection==="next"&&(Cs>=os.longSwipesRatio?rs.slideTo(os.rewind&&rs.isEnd?vs:ys+Ts):rs.slideTo(ys)),rs.swipeDirection==="prev"&&(Cs>1-os.longSwipesRatio?rs.slideTo(ys+Ts):xs!==null&&Cs<0&&Math.abs(Cs)>os.longSwipesRatio?rs.slideTo(xs):rs.slideTo(ys))}else{if(!os.shortSwipes){rs.slideTo(rs.activeIndex);return}rs.navigation&&(ps.target===rs.navigation.nextEl||ps.target===rs.navigation.prevEl)?ps.target===rs.navigation.nextEl?rs.slideTo(ys+Ts):rs.slideTo(ys):(rs.swipeDirection==="next"&&rs.slideTo(vs!==null?vs:ys+Ts),rs.swipeDirection==="prev"&&rs.slideTo(xs!==null?xs:ys))}}let timeout;function onResize(){const as=this,{params:rs,el:ns}=as;if(ns&&ns.offsetWidth===0)return;rs.breakpoints&&as.setBreakpoint();const{allowSlideNext:ss,allowSlidePrev:os,snapGrid:ls}=as,us=as.virtual&&as.params.virtual.enabled;as.allowSlideNext=!0,as.allowSlidePrev=!0,as.updateSize(),as.updateSlides(),as.updateSlidesClasses();const cs=us&&rs.loop;(rs.slidesPerView==="auto"||rs.slidesPerView>1)&&as.isEnd&&!as.isBeginning&&!as.params.centeredSlides&&!cs?as.slideTo(as.slides.length-1,0,!1,!0):as.params.loop&&!us?as.slideToLoop(as.realIndex,0,!1,!0):as.slideTo(as.activeIndex,0,!1,!0),as.autoplay&&as.autoplay.running&&as.autoplay.paused&&(clearTimeout(timeout),timeout=setTimeout(()=>{as.autoplay.resume()},500)),as.allowSlidePrev=os,as.allowSlideNext=ss,as.params.watchOverflow&&ls!==as.snapGrid&&as.checkOverflow()}function onClick(as){const rs=this;rs.enabled&&(rs.allowClick||(rs.params.preventClicks&&as.preventDefault(),rs.params.preventClicksPropagation&&rs.animating&&(as.stopPropagation(),as.stopImmediatePropagation())))}function onScroll(){const as=this,{wrapperEl:rs,rtlTranslate:ns,enabled:ss}=as;if(!ss)return;as.previousTranslate=as.translate,as.isHorizontal()?as.translate=-rs.scrollLeft:as.translate=-rs.scrollTop,as.translate===0&&(as.translate=0),as.updateActiveIndex(),as.updateSlidesClasses();let os;const ls=as.maxTranslate()-as.minTranslate();ls===0?os=0:os=(as.translate-as.minTranslate())/ls,os!==as.progress&&as.updateProgress(ns?-as.translate:as.translate),as.emit("setTranslate",as.translate,!1)}const processLazyPreloader=(as,rs)=>{if(!as||as.destroyed||!as.params)return;const ns=()=>as.isElement?"swiper-slide":`.${as.params.slideClass}`,ss=rs.closest(ns());if(ss){const os=ss.querySelector(`.${as.params.lazyPreloaderClass}`);os&&os.remove()}};function onLoad(as){const rs=this;processLazyPreloader(rs,as.target),rs.update()}let dummyEventAttached=!1;function dummyEventListener(){}const events=(as,rs)=>{const ns=getDocument(),{params:ss,el:os,wrapperEl:ls,device:us}=as,cs=!!ss.nested,ds=rs==="on"?"addEventListener":"removeEventListener",ps=rs;os[ds]("pointerdown",as.onTouchStart,{passive:!1}),ns[ds]("pointermove",as.onTouchMove,{passive:!1,capture:cs}),ns[ds]("pointerup",as.onTouchEnd,{passive:!0}),ns[ds]("pointercancel",as.onTouchEnd,{passive:!0}),ns[ds]("pointerout",as.onTouchEnd,{passive:!0}),ns[ds]("pointerleave",as.onTouchEnd,{passive:!0}),(ss.preventClicks||ss.preventClicksPropagation)&&os[ds]("click",as.onClick,!0),ss.cssMode&&ls[ds]("scroll",as.onScroll),ss.updateOnWindowResize?as[ps](us.ios||us.android?"resize orientationchange observerUpdate":"resize observerUpdate",onResize,!0):as[ps]("observerUpdate",onResize,!0),os[ds]("load",as.onLoad,{capture:!0})};function attachEvents(){const as=this,rs=getDocument(),{params:ns}=as;as.onTouchStart=onTouchStart.bind(as),as.onTouchMove=onTouchMove.bind(as),as.onTouchEnd=onTouchEnd.bind(as),ns.cssMode&&(as.onScroll=onScroll.bind(as)),as.onClick=onClick.bind(as),as.onLoad=onLoad.bind(as),dummyEventAttached||(rs.addEventListener("touchstart",dummyEventListener),dummyEventAttached=!0),events(as,"on")}function detachEvents(){events(this,"off")}const events$1={attachEvents,detachEvents},isGridEnabled=(as,rs)=>as.grid&&rs.grid&&rs.grid.rows>1;function setBreakpoint(){const as=this,{realIndex:rs,initialized:ns,params:ss,el:os}=as,ls=ss.breakpoints;if(!ls||ls&&Object.keys(ls).length===0)return;const us=as.getBreakpoint(ls,as.params.breakpointsBase,as.el);if(!us||as.currentBreakpoint===us)return;const ds=(us in ls?ls[us]:void 0)||as.originalParams,ps=isGridEnabled(as,ss),fs=isGridEnabled(as,ds),hs=ss.enabled;ps&&!fs?(os.classList.remove(`${ss.containerModifierClass}grid`,`${ss.containerModifierClass}grid-column`),as.emitContainerClasses()):!ps&&fs&&(os.classList.add(`${ss.containerModifierClass}grid`),(ds.grid.fill&&ds.grid.fill==="column"||!ds.grid.fill&&ss.grid.fill==="column")&&os.classList.add(`${ss.containerModifierClass}grid-column`),as.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach(vs=>{const xs=ss[vs]&&ss[vs].enabled,Cs=ds[vs]&&ds[vs].enabled;xs&&!Cs&&as[vs].disable(),!xs&&Cs&&as[vs].enable()});const gs=ds.direction&&ds.direction!==ss.direction,ys=ss.loop&&(ds.slidesPerView!==ss.slidesPerView||gs);gs&&ns&&as.changeDirection(),extend$1(as.params,ds);const bs=as.params.enabled;Object.assign(as,{allowTouchMove:as.params.allowTouchMove,allowSlideNext:as.params.allowSlideNext,allowSlidePrev:as.params.allowSlidePrev}),hs&&!bs?as.disable():!hs&&bs&&as.enable(),as.currentBreakpoint=us,as.emit("_beforeBreakpoint",ds),ys&&ns&&(as.loopDestroy(),as.loopCreate(rs),as.updateSlides()),as.emit("breakpoint",ds)}function getBreakpoint(as,rs="window",ns){if(!as||rs==="container"&&!ns)return;let ss=!1;const os=getWindow(),ls=rs==="window"?os.innerHeight:ns.clientHeight,us=Object.keys(as).map(cs=>{if(typeof cs=="string"&&cs.indexOf("@")===0){const ds=parseFloat(cs.substr(1));return{value:ls*ds,point:cs}}return{value:cs,point:cs}});us.sort((cs,ds)=>parseInt(cs.value,10)-parseInt(ds.value,10));for(let cs=0;cs{typeof ss=="object"?Object.keys(ss).forEach(os=>{ss[os]&&ns.push(rs+os)}):typeof ss=="string"&&ns.push(rs+ss)}),ns}function addClasses(){const as=this,{classNames:rs,params:ns,rtl:ss,el:os,device:ls}=as,us=prepareClasses(["initialized",ns.direction,{"free-mode":as.params.freeMode&&ns.freeMode.enabled},{autoheight:ns.autoHeight},{rtl:ss},{grid:ns.grid&&ns.grid.rows>1},{"grid-column":ns.grid&&ns.grid.rows>1&&ns.grid.fill==="column"},{android:ls.android},{ios:ls.ios},{"css-mode":ns.cssMode},{centered:ns.cssMode&&ns.centeredSlides},{"watch-progress":ns.watchSlidesProgress}],ns.containerModifierClass);rs.push(...us),os.classList.add(...rs),as.emitContainerClasses()}function removeClasses(){const as=this,{el:rs,classNames:ns}=as;rs.classList.remove(...ns),as.emitContainerClasses()}const classes={addClasses,removeClasses};function checkOverflow(){const as=this,{isLocked:rs,params:ns}=as,{slidesOffsetBefore:ss}=ns;if(ss){const os=as.slides.length-1,ls=as.slidesGrid[os]+as.slidesSizesGrid[os]+ss*2;as.isLocked=as.size>ls}else as.isLocked=as.snapGrid.length===1;ns.allowSlideNext===!0&&(as.allowSlideNext=!as.isLocked),ns.allowSlidePrev===!0&&(as.allowSlidePrev=!as.isLocked),rs&&rs!==as.isLocked&&(as.isEnd=!1),rs!==as.isLocked&&as.emit(as.isLocked?"lock":"unlock")}const checkOverflow$1={checkOverflow},defaults$2={init:!0,direction:"horizontal",oneWayMovement:!1,touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopedSlides:null,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",runCallbacksOnInit:!0,_emitClasses:!1};function moduleExtendParams(as,rs){return function(ss={}){const os=Object.keys(ss)[0],ls=ss[os];if(typeof ls!="object"||ls===null){extend$1(rs,ss);return}if(["navigation","pagination","scrollbar"].indexOf(os)>=0&&as[os]===!0&&(as[os]={auto:!0}),!(os in as&&"enabled"in ls)){extend$1(rs,ss);return}as[os]===!0&&(as[os]={enabled:!0}),typeof as[os]=="object"&&!("enabled"in as[os])&&(as[os].enabled=!0),as[os]||(as[os]={enabled:!1}),extend$1(rs,ss)}}const prototypes={eventsEmitter,update,translate,transition,slide,loop,grabCursor,events:events$1,breakpoints,checkOverflow:checkOverflow$1,classes},extendedDefaults={};let Swiper$1=class Ou{constructor(...rs){let ns,ss;rs.length===1&&rs[0].constructor&&Object.prototype.toString.call(rs[0]).slice(8,-1)==="Object"?ss=rs[0]:[ns,ss]=rs,ss||(ss={}),ss=extend$1({},ss),ns&&!ss.el&&(ss.el=ns);const os=getDocument();if(ss.el&&typeof ss.el=="string"&&os.querySelectorAll(ss.el).length>1){const ds=[];return os.querySelectorAll(ss.el).forEach(ps=>{const fs=extend$1({},ss,{el:ps});ds.push(new Ou(fs))}),ds}const ls=this;ls.__swiper__=!0,ls.support=getSupport(),ls.device=getDevice({userAgent:ss.userAgent}),ls.browser=getBrowser(),ls.eventsListeners={},ls.eventsAnyListeners=[],ls.modules=[...ls.__modules__],ss.modules&&Array.isArray(ss.modules)&&ls.modules.push(...ss.modules);const us={};ls.modules.forEach(ds=>{ds({params:ss,swiper:ls,extendParams:moduleExtendParams(ss,us),on:ls.on.bind(ls),once:ls.once.bind(ls),off:ls.off.bind(ls),emit:ls.emit.bind(ls)})});const cs=extend$1({},defaults$2,us);return ls.params=extend$1({},cs,extendedDefaults,ss),ls.originalParams=extend$1({},ls.params),ls.passedParams=extend$1({},ss),ls.params&&ls.params.on&&Object.keys(ls.params.on).forEach(ds=>{ls.on(ds,ls.params.on[ds])}),ls.params&&ls.params.onAny&&ls.onAny(ls.params.onAny),Object.assign(ls,{enabled:ls.params.enabled,el:ns,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return ls.params.direction==="horizontal"},isVertical(){return ls.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,allowSlideNext:ls.params.allowSlideNext,allowSlidePrev:ls.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:ls.params.focusableElements,lastClickTime:now(),clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,evCache:[]},allowClick:!0,allowTouchMove:ls.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),ls.emit("_swiper"),ls.params.init&&ls.init(),ls}recalcSlides(){const rs=this,{slidesEl:ns,params:ss}=rs;rs.slides=elementChildren(ns,`.${ss.slideClass}, swiper-slide`)}enable(){const rs=this;rs.enabled||(rs.enabled=!0,rs.params.grabCursor&&rs.setGrabCursor(),rs.emit("enable"))}disable(){const rs=this;rs.enabled&&(rs.enabled=!1,rs.params.grabCursor&&rs.unsetGrabCursor(),rs.emit("disable"))}setProgress(rs,ns){const ss=this;rs=Math.min(Math.max(rs,0),1);const os=ss.minTranslate(),us=(ss.maxTranslate()-os)*rs+os;ss.translateTo(us,typeof ns>"u"?0:ns),ss.updateActiveIndex(),ss.updateSlidesClasses()}emitContainerClasses(){const rs=this;if(!rs.params._emitClasses||!rs.el)return;const ns=rs.el.className.split(" ").filter(ss=>ss.indexOf("swiper")===0||ss.indexOf(rs.params.containerModifierClass)===0);rs.emit("_containerClasses",ns.join(" "))}getSlideClasses(rs){const ns=this;return ns.destroyed?"":rs.className.split(" ").filter(ss=>ss.indexOf("swiper-slide")===0||ss.indexOf(ns.params.slideClass)===0).join(" ")}emitSlidesClasses(){const rs=this;if(!rs.params._emitClasses||!rs.el)return;const ns=[];rs.slides.forEach(ss=>{const os=rs.getSlideClasses(ss);ns.push({slideEl:ss,classNames:os}),rs.emit("_slideClass",ss,os)}),rs.emit("_slideClasses",ns)}slidesPerViewDynamic(rs="current",ns=!1){const ss=this,{params:os,slides:ls,slidesGrid:us,slidesSizesGrid:cs,size:ds,activeIndex:ps}=ss;let fs=1;if(os.centeredSlides){let hs=ls[ps].swiperSlideSize,gs;for(let ys=ps+1;ysds&&(gs=!0));for(let ys=ps-1;ys>=0;ys-=1)ls[ys]&&!gs&&(hs+=ls[ys].swiperSlideSize,fs+=1,hs>ds&&(gs=!0))}else if(rs==="current")for(let hs=ps+1;hs=0;hs-=1)us[ps]-us[hs]{us.complete&&processLazyPreloader(rs,us)}),rs.updateSize(),rs.updateSlides(),rs.updateProgress(),rs.updateSlidesClasses();function os(){const us=rs.rtlTranslate?rs.translate*-1:rs.translate,cs=Math.min(Math.max(us,rs.maxTranslate()),rs.minTranslate());rs.setTranslate(cs),rs.updateActiveIndex(),rs.updateSlidesClasses()}let ls;rs.params.freeMode&&rs.params.freeMode.enabled?(os(),rs.params.autoHeight&&rs.updateAutoHeight()):((rs.params.slidesPerView==="auto"||rs.params.slidesPerView>1)&&rs.isEnd&&!rs.params.centeredSlides?ls=rs.slideTo(rs.slides.length-1,0,!1,!0):ls=rs.slideTo(rs.activeIndex,0,!1,!0),ls||os()),ss.watchOverflow&&ns!==rs.snapGrid&&rs.checkOverflow(),rs.emit("update")}changeDirection(rs,ns=!0){const ss=this,os=ss.params.direction;return rs||(rs=os==="horizontal"?"vertical":"horizontal"),rs===os||rs!=="horizontal"&&rs!=="vertical"||(ss.el.classList.remove(`${ss.params.containerModifierClass}${os}`),ss.el.classList.add(`${ss.params.containerModifierClass}${rs}`),ss.emitContainerClasses(),ss.params.direction=rs,ss.slides.forEach(ls=>{rs==="vertical"?ls.style.width="":ls.style.height=""}),ss.emit("changeDirection"),ns&&ss.update()),ss}changeLanguageDirection(rs){const ns=this;ns.rtl&&rs==="rtl"||!ns.rtl&&rs==="ltr"||(ns.rtl=rs==="rtl",ns.rtlTranslate=ns.params.direction==="horizontal"&&ns.rtl,ns.rtl?(ns.el.classList.add(`${ns.params.containerModifierClass}rtl`),ns.el.dir="rtl"):(ns.el.classList.remove(`${ns.params.containerModifierClass}rtl`),ns.el.dir="ltr"),ns.update())}mount(rs){const ns=this;if(ns.mounted)return!0;let ss=rs||ns.params.el;if(typeof ss=="string"&&(ss=document.querySelector(ss)),!ss)return!1;ss.swiper=ns,ss.shadowEl&&(ns.isElement=!0);const os=()=>`.${(ns.params.wrapperClass||"").trim().split(" ").join(".")}`;let us=(()=>ss&&ss.shadowRoot&&ss.shadowRoot.querySelector?ss.shadowRoot.querySelector(os()):elementChildren(ss,os())[0])();return!us&&ns.params.createElements&&(us=createElement("div",ns.params.wrapperClass),ss.append(us),elementChildren(ss,`.${ns.params.slideClass}`).forEach(cs=>{us.append(cs)})),Object.assign(ns,{el:ss,wrapperEl:us,slidesEl:ns.isElement?ss:us,mounted:!0,rtl:ss.dir.toLowerCase()==="rtl"||elementStyle(ss,"direction")==="rtl",rtlTranslate:ns.params.direction==="horizontal"&&(ss.dir.toLowerCase()==="rtl"||elementStyle(ss,"direction")==="rtl"),wrongRTL:elementStyle(us,"display")==="-webkit-box"}),!0}init(rs){const ns=this;return ns.initialized||ns.mount(rs)===!1||(ns.emit("beforeInit"),ns.params.breakpoints&&ns.setBreakpoint(),ns.addClasses(),ns.updateSize(),ns.updateSlides(),ns.params.watchOverflow&&ns.checkOverflow(),ns.params.grabCursor&&ns.enabled&&ns.setGrabCursor(),ns.params.loop&&ns.virtual&&ns.params.virtual.enabled?ns.slideTo(ns.params.initialSlide+ns.virtual.slidesBefore,0,ns.params.runCallbacksOnInit,!1,!0):ns.slideTo(ns.params.initialSlide,0,ns.params.runCallbacksOnInit,!1,!0),ns.params.loop&&ns.loopCreate(),ns.attachEvents(),[...ns.el.querySelectorAll('[loading="lazy"]')].forEach(os=>{os.complete?processLazyPreloader(ns,os):os.addEventListener("load",ls=>{processLazyPreloader(ns,ls.target)})}),ns.initialized=!0,ns.emit("init"),ns.emit("afterInit")),ns}destroy(rs=!0,ns=!0){const ss=this,{params:os,el:ls,wrapperEl:us,slides:cs}=ss;return typeof ss.params>"u"||ss.destroyed||(ss.emit("beforeDestroy"),ss.initialized=!1,ss.detachEvents(),os.loop&&ss.loopDestroy(),ns&&(ss.removeClasses(),ls.removeAttribute("style"),us.removeAttribute("style"),cs&&cs.length&&cs.forEach(ds=>{ds.classList.remove(os.slideVisibleClass,os.slideActiveClass,os.slideNextClass,os.slidePrevClass),ds.removeAttribute("style"),ds.removeAttribute("data-swiper-slide-index")})),ss.emit("destroy"),Object.keys(ss.eventsListeners).forEach(ds=>{ss.off(ds)}),rs!==!1&&(ss.el.swiper=null,deleteProps(ss)),ss.destroyed=!0),null}static extendDefaults(rs){extend$1(extendedDefaults,rs)}static get extendedDefaults(){return extendedDefaults}static get defaults(){return defaults$2}static installModule(rs){Ou.prototype.__modules__||(Ou.prototype.__modules__=[]);const ns=Ou.prototype.__modules__;typeof rs=="function"&&ns.indexOf(rs)<0&&ns.push(rs)}static use(rs){return Array.isArray(rs)?(rs.forEach(ns=>Ou.installModule(ns)),Ou):(Ou.installModule(rs),Ou)}};Object.keys(prototypes).forEach(as=>{Object.keys(prototypes[as]).forEach(rs=>{Swiper$1.prototype[rs]=prototypes[as][rs]})});Swiper$1.use([Resize,Observer]);function Keyboard({swiper:as,extendParams:rs,on:ns,emit:ss}){const os=getDocument(),ls=getWindow();as.keyboard={enabled:!1},rs({keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0}});function us(ps){if(!as.enabled)return;const{rtlTranslate:fs}=as;let hs=ps;hs.originalEvent&&(hs=hs.originalEvent);const gs=hs.keyCode||hs.charCode,ys=as.params.keyboard.pageUpDown,bs=ys&&gs===33,vs=ys&&gs===34,xs=gs===37,Cs=gs===39,Ts=gs===38,Ss=gs===40;if(!as.allowSlideNext&&(as.isHorizontal()&&Cs||as.isVertical()&&Ss||vs)||!as.allowSlidePrev&&(as.isHorizontal()&&xs||as.isVertical()&&Ts||bs))return!1;if(!(hs.shiftKey||hs.altKey||hs.ctrlKey||hs.metaKey)&&!(os.activeElement&&os.activeElement.nodeName&&(os.activeElement.nodeName.toLowerCase()==="input"||os.activeElement.nodeName.toLowerCase()==="textarea"))){if(as.params.keyboard.onlyInViewport&&(bs||vs||xs||Cs||Ts||Ss)){let Ns=!1;if(elementParents(as.el,`.${as.params.slideClass}, swiper-slide`).length>0&&elementParents(as.el,`.${as.params.slideActiveClass}`).length===0)return;const As=as.el,ws=As.clientWidth,Es=As.clientHeight,_s=ls.innerWidth,$s=ls.innerHeight,Rs=elementOffset(As);fs&&(Rs.left-=As.scrollLeft);const Ds=[[Rs.left,Rs.top],[Rs.left+ws,Rs.top],[Rs.left,Rs.top+Es],[Rs.left+ws,Rs.top+Es]];for(let Os=0;Os=0&&Is[0]<=_s&&Is[1]>=0&&Is[1]<=$s){if(Is[0]===0&&Is[1]===0)continue;Ns=!0}}if(!Ns)return}as.isHorizontal()?((bs||vs||xs||Cs)&&(hs.preventDefault?hs.preventDefault():hs.returnValue=!1),((vs||Cs)&&!fs||(bs||xs)&&fs)&&as.slideNext(),((bs||xs)&&!fs||(vs||Cs)&&fs)&&as.slidePrev()):((bs||vs||Ts||Ss)&&(hs.preventDefault?hs.preventDefault():hs.returnValue=!1),(vs||Ss)&&as.slideNext(),(bs||Ts)&&as.slidePrev()),ss("keyPress",gs)}}function cs(){as.keyboard.enabled||(os.addEventListener("keydown",us),as.keyboard.enabled=!0)}function ds(){as.keyboard.enabled&&(os.removeEventListener("keydown",us),as.keyboard.enabled=!1)}ns("init",()=>{as.params.keyboard.enabled&&cs()}),ns("destroy",()=>{as.keyboard.enabled&&ds()}),Object.assign(as.keyboard,{enable:cs,disable:ds})}function Mousewheel({swiper:as,extendParams:rs,on:ns,emit:ss}){const os=getWindow();rs({mousewheel:{enabled:!1,releaseOnEdges:!1,invert:!1,forceToAxis:!1,sensitivity:1,eventsTarget:"container",thresholdDelta:null,thresholdTime:null}}),as.mousewheel={enabled:!1};let ls,us=now(),cs;const ds=[];function ps(Ts){let ws=0,Es=0,_s=0,$s=0;return"detail"in Ts&&(Es=Ts.detail),"wheelDelta"in Ts&&(Es=-Ts.wheelDelta/120),"wheelDeltaY"in Ts&&(Es=-Ts.wheelDeltaY/120),"wheelDeltaX"in Ts&&(ws=-Ts.wheelDeltaX/120),"axis"in Ts&&Ts.axis===Ts.HORIZONTAL_AXIS&&(ws=Es,Es=0),_s=ws*10,$s=Es*10,"deltaY"in Ts&&($s=Ts.deltaY),"deltaX"in Ts&&(_s=Ts.deltaX),Ts.shiftKey&&!_s&&(_s=$s,$s=0),(_s||$s)&&Ts.deltaMode&&(Ts.deltaMode===1?(_s*=40,$s*=40):(_s*=800,$s*=800)),_s&&!ws&&(ws=_s<1?-1:1),$s&&!Es&&(Es=$s<1?-1:1),{spinX:ws,spinY:Es,pixelX:_s,pixelY:$s}}function fs(){as.enabled&&(as.mouseEntered=!0)}function hs(){as.enabled&&(as.mouseEntered=!1)}function gs(Ts){return as.params.mousewheel.thresholdDelta&&Ts.delta=6&&now()-us<60?!0:(Ts.direction<0?(!as.isEnd||as.params.loop)&&!as.animating&&(as.slideNext(),ss("scroll",Ts.raw)):(!as.isBeginning||as.params.loop)&&!as.animating&&(as.slidePrev(),ss("scroll",Ts.raw)),us=new os.Date().getTime(),!1)}function ys(Ts){const Ss=as.params.mousewheel;if(Ts.direction<0){if(as.isEnd&&!as.params.loop&&Ss.releaseOnEdges)return!0}else if(as.isBeginning&&!as.params.loop&&Ss.releaseOnEdges)return!0;return!1}function bs(Ts){let Ss=Ts,Ns=!0;if(!as.enabled)return;const As=as.params.mousewheel;as.params.cssMode&&Ss.preventDefault();let ws=as.el;as.params.mousewheel.eventsTarget!=="container"&&(ws=document.querySelector(as.params.mousewheel.eventsTarget));const Es=ws&&ws.contains(Ss.target);if(!as.mouseEntered&&!Es&&!As.releaseOnEdges)return!0;Ss.originalEvent&&(Ss=Ss.originalEvent);let _s=0;const $s=as.rtlTranslate?-1:1,Rs=ps(Ss);if(As.forceToAxis)if(as.isHorizontal())if(Math.abs(Rs.pixelX)>Math.abs(Rs.pixelY))_s=-Rs.pixelX*$s;else return!0;else if(Math.abs(Rs.pixelY)>Math.abs(Rs.pixelX))_s=-Rs.pixelY;else return!0;else _s=Math.abs(Rs.pixelX)>Math.abs(Rs.pixelY)?-Rs.pixelX*$s:-Rs.pixelY;if(_s===0)return!0;As.invert&&(_s=-_s);let Ds=as.getTranslate()+_s*As.sensitivity;if(Ds>=as.minTranslate()&&(Ds=as.minTranslate()),Ds<=as.maxTranslate()&&(Ds=as.maxTranslate()),Ns=as.params.loop?!0:!(Ds===as.minTranslate()||Ds===as.maxTranslate()),Ns&&as.params.nested&&Ss.stopPropagation(),!as.params.freeMode||!as.params.freeMode.enabled){const Os={time:now(),delta:Math.abs(_s),direction:Math.sign(_s),raw:Ts};ds.length>=2&&ds.shift();const Is=ds.length?ds[ds.length-1]:void 0;if(ds.push(Os),Is?(Os.direction!==Is.direction||Os.delta>Is.delta||Os.time>Is.time+150)&&gs(Os):gs(Os),ys(Os))return!0}else{const Os={time:now(),delta:Math.abs(_s),direction:Math.sign(_s)},Is=cs&&Os.time=as.minTranslate()&&(Vs=as.minTranslate()),Vs<=as.maxTranslate()&&(Vs=as.maxTranslate()),as.setTransition(0),as.setTranslate(Vs),as.updateProgress(),as.updateActiveIndex(),as.updateSlidesClasses(),(!ks&&as.isBeginning||!Ps&&as.isEnd)&&as.updateSlidesClasses(),as.params.loop&&as.loopFix({direction:Os.direction<0?"next":"prev",byMousewheel:!0}),as.params.freeMode.sticky){clearTimeout(ls),ls=void 0,ds.length>=15&&ds.shift();const Bs=ds.length?ds[ds.length-1]:void 0,Ms=ds[0];if(ds.push(Os),Bs&&(Os.delta>Bs.delta||Os.direction!==Bs.direction))ds.splice(0);else if(ds.length>=15&&Os.time-Ms.time<500&&Ms.delta-Os.delta>=1&&Os.delta<=6){const Ws=_s>0?.8:.2;cs=Os,ds.splice(0),ls=nextTick(()=>{as.slideToClosest(as.params.speed,!0,void 0,Ws)},0)}ls||(ls=nextTick(()=>{cs=Os,ds.splice(0),as.slideToClosest(as.params.speed,!0,void 0,.5)},500))}if(Is||ss("scroll",Ss),as.params.autoplay&&as.params.autoplayDisableOnInteraction&&as.autoplay.stop(),Vs===as.minTranslate()||Vs===as.maxTranslate())return!0}}return Ss.preventDefault?Ss.preventDefault():Ss.returnValue=!1,!1}function vs(Ts){let Ss=as.el;as.params.mousewheel.eventsTarget!=="container"&&(Ss=document.querySelector(as.params.mousewheel.eventsTarget)),Ss[Ts]("mouseenter",fs),Ss[Ts]("mouseleave",hs),Ss[Ts]("wheel",bs)}function xs(){return as.params.cssMode?(as.wrapperEl.removeEventListener("wheel",bs),!0):as.mousewheel.enabled?!1:(vs("addEventListener"),as.mousewheel.enabled=!0,!0)}function Cs(){return as.params.cssMode?(as.wrapperEl.addEventListener(event,bs),!0):as.mousewheel.enabled?(vs("removeEventListener"),as.mousewheel.enabled=!1,!0):!1}ns("init",()=>{!as.params.mousewheel.enabled&&as.params.cssMode&&Cs(),as.params.mousewheel.enabled&&xs()}),ns("destroy",()=>{as.params.cssMode&&xs(),as.mousewheel.enabled&&Cs()}),Object.assign(as.mousewheel,{enable:xs,disable:Cs})}function createElementIfNotDefined(as,rs,ns,ss){return as.params.createElements&&Object.keys(ss).forEach(os=>{if(!ns[os]&&ns.auto===!0){let ls=elementChildren(as.el,`.${ss[os]}`)[0];ls||(ls=createElement("div",ss[os]),ls.className=ss[os],as.el.append(ls)),ns[os]=ls,rs[os]=ls}}),ns}function classesToSelector(as=""){return`.${as.trim().replace(/([\.:!\/])/g,"\\$1").replace(/ /g,".")}`}function Pagination({swiper:as,extendParams:rs,on:ns,emit:ss}){const os="swiper-pagination";rs({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:Cs=>Cs,formatFractionTotal:Cs=>Cs,bulletClass:`${os}-bullet`,bulletActiveClass:`${os}-bullet-active`,modifierClass:`${os}-`,currentClass:`${os}-current`,totalClass:`${os}-total`,hiddenClass:`${os}-hidden`,progressbarFillClass:`${os}-progressbar-fill`,progressbarOppositeClass:`${os}-progressbar-opposite`,clickableClass:`${os}-clickable`,lockClass:`${os}-lock`,horizontalClass:`${os}-horizontal`,verticalClass:`${os}-vertical`,paginationDisabledClass:`${os}-disabled`}}),as.pagination={el:null,bullets:[]};let ls,us=0;const cs=Cs=>(Array.isArray(Cs)||(Cs=[Cs].filter(Ts=>!!Ts)),Cs);function ds(){return!as.params.pagination.el||!as.pagination.el||Array.isArray(as.pagination.el)&&as.pagination.el.length===0}function ps(Cs,Ts){const{bulletActiveClass:Ss}=as.params.pagination;Cs&&(Cs=Cs[`${Ts==="prev"?"previous":"next"}ElementSibling`],Cs&&(Cs.classList.add(`${Ss}-${Ts}`),Cs=Cs[`${Ts==="prev"?"previous":"next"}ElementSibling`],Cs&&Cs.classList.add(`${Ss}-${Ts}-${Ts}`)))}function fs(Cs){const Ts=Cs.target.closest(classesToSelector(as.params.pagination.bulletClass));if(!Ts)return;Cs.preventDefault();const Ss=elementIndex(Ts)*as.params.slidesPerGroup;as.params.loop?as.slideToLoop(Ss):as.slideTo(Ss)}function hs(){const Cs=as.rtl,Ts=as.params.pagination;if(ds())return;let Ss=as.pagination.el;Ss=cs(Ss);let Ns;const As=as.virtual&&as.params.virtual.enabled?as.virtual.slides.length:as.slides.length,ws=as.params.loop?Math.ceil(As/as.params.slidesPerGroup):as.snapGrid.length;if(as.params.loop?Ns=as.params.slidesPerGroup>1?Math.floor(as.realIndex/as.params.slidesPerGroup):as.realIndex:typeof as.snapIndex<"u"?Ns=as.snapIndex:Ns=as.activeIndex||0,Ts.type==="bullets"&&as.pagination.bullets&&as.pagination.bullets.length>0){const Es=as.pagination.bullets;let _s,$s,Rs;if(Ts.dynamicBullets&&(ls=elementOuterSize(Es[0],as.isHorizontal()?"width":"height",!0),Ss.forEach(Ds=>{Ds.style[as.isHorizontal()?"width":"height"]=`${ls*(Ts.dynamicMainBullets+4)}px`}),Ts.dynamicMainBullets>1&&as.previousIndex!==void 0&&(us+=Ns-(as.previousIndex||0),us>Ts.dynamicMainBullets-1?us=Ts.dynamicMainBullets-1:us<0&&(us=0)),_s=Math.max(Ns-us,0),$s=_s+(Math.min(Es.length,Ts.dynamicMainBullets)-1),Rs=($s+_s)/2),Es.forEach(Ds=>{Ds.classList.remove(...["","-next","-next-next","-prev","-prev-prev","-main"].map(Os=>`${Ts.bulletActiveClass}${Os}`))}),Ss.length>1)Es.forEach(Ds=>{const Os=elementIndex(Ds);Os===Ns&&Ds.classList.add(Ts.bulletActiveClass),Ts.dynamicBullets&&(Os>=_s&&Os<=$s&&Ds.classList.add(`${Ts.bulletActiveClass}-main`),Os===_s&&ps(Ds,"prev"),Os===$s&&ps(Ds,"next"))});else{const Ds=Es[Ns];if(Ds&&Ds.classList.add(Ts.bulletActiveClass),Ts.dynamicBullets){const Os=Es[_s],Is=Es[$s];for(let Vs=_s;Vs<=$s;Vs+=1)Es[Vs].classList.add(`${Ts.bulletActiveClass}-main`);ps(Os,"prev"),ps(Is,"next")}}if(Ts.dynamicBullets){const Ds=Math.min(Es.length,Ts.dynamicMainBullets+4),Os=(ls*Ds-ls)/2-Rs*ls,Is=Cs?"right":"left";Es.forEach(Vs=>{Vs.style[as.isHorizontal()?Is:"top"]=`${Os}px`})}}Ss.forEach((Es,_s)=>{if(Ts.type==="fraction"&&(Es.querySelectorAll(classesToSelector(Ts.currentClass)).forEach($s=>{$s.textContent=Ts.formatFractionCurrent(Ns+1)}),Es.querySelectorAll(classesToSelector(Ts.totalClass)).forEach($s=>{$s.textContent=Ts.formatFractionTotal(ws)})),Ts.type==="progressbar"){let $s;Ts.progressbarOpposite?$s=as.isHorizontal()?"vertical":"horizontal":$s=as.isHorizontal()?"horizontal":"vertical";const Rs=(Ns+1)/ws;let Ds=1,Os=1;$s==="horizontal"?Ds=Rs:Os=Rs,Es.querySelectorAll(classesToSelector(Ts.progressbarFillClass)).forEach(Is=>{Is.style.transform=`translate3d(0,0,0) scaleX(${Ds}) scaleY(${Os})`,Is.style.transitionDuration=`${as.params.speed}ms`})}Ts.type==="custom"&&Ts.renderCustom?(Es.innerHTML=Ts.renderCustom(as,Ns+1,ws),_s===0&&ss("paginationRender",Es)):(_s===0&&ss("paginationRender",Es),ss("paginationUpdate",Es)),as.params.watchOverflow&&as.enabled&&Es.classList[as.isLocked?"add":"remove"](Ts.lockClass)})}function gs(){const Cs=as.params.pagination;if(ds())return;const Ts=as.virtual&&as.params.virtual.enabled?as.virtual.slides.length:as.slides.length;let Ss=as.pagination.el;Ss=cs(Ss);let Ns="";if(Cs.type==="bullets"){let As=as.params.loop?Math.ceil(Ts/as.params.slidesPerGroup):as.snapGrid.length;as.params.freeMode&&as.params.freeMode.enabled&&As>Ts&&(As=Ts);for(let ws=0;ws`}Cs.type==="fraction"&&(Cs.renderFraction?Ns=Cs.renderFraction.call(as,Cs.currentClass,Cs.totalClass):Ns=` / `),Cs.type==="progressbar"&&(Cs.renderProgressbar?Ns=Cs.renderProgressbar.call(as,Cs.progressbarFillClass):Ns=``),Ss.forEach(As=>{Cs.type!=="custom"&&(As.innerHTML=Ns||""),Cs.type==="bullets"&&(as.pagination.bullets=[...As.querySelectorAll(classesToSelector(Cs.bulletClass))])}),Cs.type!=="custom"&&ss("paginationRender",Ss[0])}function ys(){as.params.pagination=createElementIfNotDefined(as,as.originalParams.pagination,as.params.pagination,{el:"swiper-pagination"});const Cs=as.params.pagination;if(!Cs.el)return;let Ts;typeof Cs.el=="string"&&as.isElement&&(Ts=as.el.shadowRoot.querySelector(Cs.el)),!Ts&&typeof Cs.el=="string"&&(Ts=[...document.querySelectorAll(Cs.el)]),Ts||(Ts=Cs.el),!(!Ts||Ts.length===0)&&(as.params.uniqueNavElements&&typeof Cs.el=="string"&&Array.isArray(Ts)&&Ts.length>1&&(Ts=[...as.el.querySelectorAll(Cs.el)],Ts.length>1&&(Ts=Ts.filter(Ss=>elementParents(Ss,".swiper")[0]===as.el)[0])),Array.isArray(Ts)&&Ts.length===1&&(Ts=Ts[0]),Object.assign(as.pagination,{el:Ts}),Ts=cs(Ts),Ts.forEach(Ss=>{Cs.type==="bullets"&&Cs.clickable&&Ss.classList.add(Cs.clickableClass),Ss.classList.add(Cs.modifierClass+Cs.type),Ss.classList.add(as.isHorizontal()?Cs.horizontalClass:Cs.verticalClass),Cs.type==="bullets"&&Cs.dynamicBullets&&(Ss.classList.add(`${Cs.modifierClass}${Cs.type}-dynamic`),us=0,Cs.dynamicMainBullets<1&&(Cs.dynamicMainBullets=1)),Cs.type==="progressbar"&&Cs.progressbarOpposite&&Ss.classList.add(Cs.progressbarOppositeClass),Cs.clickable&&Ss.addEventListener("click",fs),as.enabled||Ss.classList.add(Cs.lockClass)}))}function bs(){const Cs=as.params.pagination;if(ds())return;let Ts=as.pagination.el;Ts&&(Ts=cs(Ts),Ts.forEach(Ss=>{Ss.classList.remove(Cs.hiddenClass),Ss.classList.remove(Cs.modifierClass+Cs.type),Ss.classList.remove(as.isHorizontal()?Cs.horizontalClass:Cs.verticalClass),Cs.clickable&&Ss.removeEventListener("click",fs)})),as.pagination.bullets&&as.pagination.bullets.forEach(Ss=>Ss.classList.remove(Cs.bulletActiveClass))}ns("init",()=>{as.params.pagination.enabled===!1?xs():(ys(),gs(),hs())}),ns("activeIndexChange",()=>{typeof as.snapIndex>"u"&&hs()}),ns("snapIndexChange",()=>{hs()}),ns("snapGridLengthChange",()=>{gs(),hs()}),ns("destroy",()=>{bs()}),ns("enable disable",()=>{let{el:Cs}=as.pagination;Cs&&(Cs=cs(Cs),Cs.forEach(Ts=>Ts.classList[as.enabled?"remove":"add"](as.params.pagination.lockClass)))}),ns("lock unlock",()=>{hs()}),ns("click",(Cs,Ts)=>{const Ss=Ts.target;let{el:Ns}=as.pagination;if(Array.isArray(Ns)||(Ns=[Ns].filter(As=>!!As)),as.params.pagination.el&&as.params.pagination.hideOnClick&&Ns&&Ns.length>0&&!Ss.classList.contains(as.params.pagination.bulletClass)){if(as.navigation&&(as.navigation.nextEl&&Ss===as.navigation.nextEl||as.navigation.prevEl&&Ss===as.navigation.prevEl))return;const As=Ns[0].classList.contains(as.params.pagination.hiddenClass);ss(As===!0?"paginationShow":"paginationHide"),Ns.forEach(ws=>ws.classList.toggle(as.params.pagination.hiddenClass))}});const vs=()=>{as.el.classList.remove(as.params.pagination.paginationDisabledClass);let{el:Cs}=as.pagination;Cs&&(Cs=cs(Cs),Cs.forEach(Ts=>Ts.classList.remove(as.params.pagination.paginationDisabledClass))),ys(),gs(),hs()},xs=()=>{as.el.classList.add(as.params.pagination.paginationDisabledClass);let{el:Cs}=as.pagination;Cs&&(Cs=cs(Cs),Cs.forEach(Ts=>Ts.classList.add(as.params.pagination.paginationDisabledClass))),bs()};Object.assign(as.pagination,{enable:vs,disable:xs,render:gs,update:hs,init:ys,destroy:bs})}function A11y({swiper:as,extendParams:rs,on:ns}){rs({a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",slideLabelMessage:"{{index}} / {{slidesLength}}",containerMessage:null,containerRoleDescriptionMessage:null,itemRoleDescriptionMessage:null,slideRole:"group",id:null}}),as.a11y={clicked:!1};let ss=null;function os(Is){const Vs=ss;Vs.length!==0&&(Vs.innerHTML="",Vs.innerHTML=Is)}const ls=Is=>(Array.isArray(Is)||(Is=[Is].filter(Vs=>!!Vs)),Is);function us(Is=16){const Vs=()=>Math.round(16*Math.random()).toString(16);return"x".repeat(Is).replace(/x/g,Vs)}function cs(Is){Is=ls(Is),Is.forEach(Vs=>{Vs.setAttribute("tabIndex","0")})}function ds(Is){Is=ls(Is),Is.forEach(Vs=>{Vs.setAttribute("tabIndex","-1")})}function ps(Is,Vs){Is=ls(Is),Is.forEach(ks=>{ks.setAttribute("role",Vs)})}function fs(Is,Vs){Is=ls(Is),Is.forEach(ks=>{ks.setAttribute("aria-roledescription",Vs)})}function hs(Is,Vs){Is=ls(Is),Is.forEach(ks=>{ks.setAttribute("aria-controls",Vs)})}function gs(Is,Vs){Is=ls(Is),Is.forEach(ks=>{ks.setAttribute("aria-label",Vs)})}function ys(Is,Vs){Is=ls(Is),Is.forEach(ks=>{ks.setAttribute("id",Vs)})}function bs(Is,Vs){Is=ls(Is),Is.forEach(ks=>{ks.setAttribute("aria-live",Vs)})}function vs(Is){Is=ls(Is),Is.forEach(Vs=>{Vs.setAttribute("aria-disabled",!0)})}function xs(Is){Is=ls(Is),Is.forEach(Vs=>{Vs.setAttribute("aria-disabled",!1)})}function Cs(Is){if(Is.keyCode!==13&&Is.keyCode!==32)return;const Vs=as.params.a11y,ks=Is.target;as.pagination&&as.pagination.el&&(ks===as.pagination.el||as.pagination.el.contains(Is.target))&&!Is.target.matches(classesToSelector(as.params.pagination.bulletClass))||(as.navigation&&as.navigation.nextEl&&ks===as.navigation.nextEl&&(as.isEnd&&!as.params.loop||as.slideNext(),as.isEnd?os(Vs.lastSlideMessage):os(Vs.nextSlideMessage)),as.navigation&&as.navigation.prevEl&&ks===as.navigation.prevEl&&(as.isBeginning&&!as.params.loop||as.slidePrev(),as.isBeginning?os(Vs.firstSlideMessage):os(Vs.prevSlideMessage)),as.pagination&&ks.matches(classesToSelector(as.params.pagination.bulletClass))&&ks.click())}function Ts(){if(as.params.loop||as.params.rewind||!as.navigation)return;const{nextEl:Is,prevEl:Vs}=as.navigation;Vs&&(as.isBeginning?(vs(Vs),ds(Vs)):(xs(Vs),cs(Vs))),Is&&(as.isEnd?(vs(Is),ds(Is)):(xs(Is),cs(Is)))}function Ss(){return as.pagination&&as.pagination.bullets&&as.pagination.bullets.length}function Ns(){return Ss()&&as.params.pagination.clickable}function As(){const Is=as.params.a11y;Ss()&&as.pagination.bullets.forEach(Vs=>{as.params.pagination.clickable&&(cs(Vs),as.params.pagination.renderBullet||(ps(Vs,"button"),gs(Vs,Is.paginationBulletMessage.replace(/\{\{index\}\}/,elementIndex(Vs)+1)))),Vs.matches(`.${as.params.pagination.bulletActiveClass}`)?Vs.setAttribute("aria-current","true"):Vs.removeAttribute("aria-current")})}const ws=(Is,Vs,ks)=>{cs(Is),Is.tagName!=="BUTTON"&&(ps(Is,"button"),Is.addEventListener("keydown",Cs)),gs(Is,ks),hs(Is,Vs)},Es=()=>{as.a11y.clicked=!0},_s=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{as.destroyed||(as.a11y.clicked=!1)})})},$s=Is=>{if(as.a11y.clicked)return;const Vs=Is.target.closest(`.${as.params.slideClass}, swiper-slide`);if(!Vs||!as.slides.includes(Vs))return;const ks=as.slides.indexOf(Vs)===as.activeIndex,Ps=as.params.watchSlidesProgress&&as.visibleSlides&&as.visibleSlides.includes(Vs);ks||Ps||Is.sourceCapabilities&&Is.sourceCapabilities.firesTouchEvents||(as.isHorizontal()?as.el.scrollLeft=0:as.el.scrollTop=0,as.slideTo(as.slides.indexOf(Vs),0))},Rs=()=>{const Is=as.params.a11y;Is.itemRoleDescriptionMessage&&fs(as.slides,Is.itemRoleDescriptionMessage),Is.slideRole&&ps(as.slides,Is.slideRole);const Vs=as.slides.length;Is.slideLabelMessage&&as.slides.forEach((ks,Ps)=>{const Bs=as.params.loop?parseInt(ks.getAttribute("data-swiper-slide-index"),10):Ps,Ms=Is.slideLabelMessage.replace(/\{\{index\}\}/,Bs+1).replace(/\{\{slidesLength\}\}/,Vs);gs(ks,Ms)})},Ds=()=>{const Is=as.params.a11y;as.el.append(ss);const Vs=as.el;Is.containerRoleDescriptionMessage&&fs(Vs,Is.containerRoleDescriptionMessage),Is.containerMessage&&gs(Vs,Is.containerMessage);const ks=as.wrapperEl,Ps=Is.id||ks.getAttribute("id")||`swiper-wrapper-${us(16)}`,Bs=as.params.autoplay&&as.params.autoplay.enabled?"off":"polite";ys(ks,Ps),bs(ks,Bs),Rs();let{nextEl:Ms,prevEl:Ws}=as.navigation?as.navigation:{};Ms=ls(Ms),Ws=ls(Ws),Ms&&Ms.forEach(Us=>ws(Us,Ps,Is.nextSlideMessage)),Ws&&Ws.forEach(Us=>ws(Us,Ps,Is.prevSlideMessage)),Ns()&&(Array.isArray(as.pagination.el)?as.pagination.el:[as.pagination.el]).forEach(js=>{js.addEventListener("keydown",Cs)}),as.el.addEventListener("focus",$s,!0),as.el.addEventListener("pointerdown",Es,!0),as.el.addEventListener("pointerup",_s,!0)};function Os(){ss&&ss.length>0&&ss.remove();let{nextEl:Is,prevEl:Vs}=as.navigation?as.navigation:{};Is=ls(Is),Vs=ls(Vs),Is&&Is.forEach(ks=>ks.removeEventListener("keydown",Cs)),Vs&&Vs.forEach(ks=>ks.removeEventListener("keydown",Cs)),Ns()&&(Array.isArray(as.pagination.el)?as.pagination.el:[as.pagination.el]).forEach(Ps=>{Ps.removeEventListener("keydown",Cs)}),as.el.removeEventListener("focus",$s,!0),as.el.removeEventListener("pointerdown",Es,!0),as.el.removeEventListener("pointerup",_s,!0)}ns("beforeInit",()=>{ss=createElement("span",as.params.a11y.notificationClass),ss.setAttribute("aria-live","assertive"),ss.setAttribute("aria-atomic","true"),as.isElement&&ss.setAttribute("slot","container-end")}),ns("afterInit",()=>{as.params.a11y.enabled&&Ds()}),ns("slidesLengthChange snapGridLengthChange slidesGridLengthChange",()=>{as.params.a11y.enabled&&Rs()}),ns("fromEdge toEdge afterInit lock unlock",()=>{as.params.a11y.enabled&&Ts()}),ns("paginationUpdate",()=>{as.params.a11y.enabled&&As()}),ns("destroy",()=>{as.params.a11y.enabled&&Os()})}function isObject$3(as){return typeof as=="object"&&as!==null&&as.constructor&&Object.prototype.toString.call(as).slice(8,-1)==="Object"}function extend(as,rs){const ns=["__proto__","constructor","prototype"];Object.keys(rs).filter(ss=>ns.indexOf(ss)<0).forEach(ss=>{typeof as[ss]>"u"?as[ss]=rs[ss]:isObject$3(rs[ss])&&isObject$3(as[ss])&&Object.keys(rs[ss]).length>0?rs[ss].__swiper__?as[ss]=rs[ss]:extend(as[ss],rs[ss]):as[ss]=rs[ss]})}function needsNavigation(as={}){return as.navigation&&typeof as.navigation.nextEl>"u"&&typeof as.navigation.prevEl>"u"}function needsPagination(as={}){return as.pagination&&typeof as.pagination.el>"u"}function needsScrollbar(as={}){return as.scrollbar&&typeof as.scrollbar.el>"u"}function uniqueClasses(as=""){const rs=as.split(" ").map(ss=>ss.trim()).filter(ss=>!!ss),ns=[];return rs.forEach(ss=>{ns.indexOf(ss)<0&&ns.push(ss)}),ns.join(" ")}function wrapperClass(as=""){return as?as.includes("swiper-wrapper")?as:`swiper-wrapper ${as}`:"swiper-wrapper"}const paramsList=["modules","init","_direction","oneWayMovement","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopedSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideNextClass","slidePrevClass","wrapperClass","lazyPreloaderClass","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control","injectStyles","injectStylesUrls"];function getParams(as={},rs=!0){const ns={on:{}},ss={},os={};extend(ns,Swiper$1.defaults),extend(ns,Swiper$1.extendedDefaults),ns._emitClasses=!0,ns.init=!1;const ls={},us=paramsList.map(ds=>ds.replace(/_/,"")),cs=Object.assign({},as);return Object.keys(cs).forEach(ds=>{typeof as[ds]>"u"||(us.indexOf(ds)>=0?isObject$3(as[ds])?(ns[ds]={},os[ds]={},extend(ns[ds],as[ds]),extend(os[ds],as[ds])):(ns[ds]=as[ds],os[ds]=as[ds]):ds.search(/on[A-Z]/)===0&&typeof as[ds]=="function"?rs?ss[`${ds[2].toLowerCase()}${ds.substr(3)}`]=as[ds]:ns.on[`${ds[2].toLowerCase()}${ds.substr(3)}`]=as[ds]:ls[ds]=as[ds])}),["navigation","pagination","scrollbar"].forEach(ds=>{ns[ds]===!0&&(ns[ds]={}),ns[ds]===!1&&delete ns[ds]}),{params:ns,passedParams:os,rest:ls,events:ss}}function mountSwiper({el:as,nextEl:rs,prevEl:ns,paginationEl:ss,scrollbarEl:os,swiper:ls},us){needsNavigation(us)&&rs&&ns&&(ls.params.navigation.nextEl=rs,ls.originalParams.navigation.nextEl=rs,ls.params.navigation.prevEl=ns,ls.originalParams.navigation.prevEl=ns),needsPagination(us)&&ss&&(ls.params.pagination.el=ss,ls.originalParams.pagination.el=ss),needsScrollbar(us)&&os&&(ls.params.scrollbar.el=os,ls.originalParams.scrollbar.el=os),ls.init(as)}function getChangedParams(as,rs,ns,ss,os){const ls=[];if(!rs)return ls;const us=ds=>{ls.indexOf(ds)<0&&ls.push(ds)};if(ns&&ss){const ds=ss.map(os),ps=ns.map(os);ds.join("")!==ps.join("")&&us("children"),ss.length!==ns.length&&us("children")}return paramsList.filter(ds=>ds[0]==="_").map(ds=>ds.replace(/_/,"")).forEach(ds=>{if(ds in as&&ds in rs)if(isObject$3(as[ds])&&isObject$3(rs[ds])){const ps=Object.keys(as[ds]),fs=Object.keys(rs[ds]);ps.length!==fs.length?us(ds):(ps.forEach(hs=>{as[ds][hs]!==rs[ds][hs]&&us(ds)}),fs.forEach(hs=>{as[ds][hs]!==rs[ds][hs]&&us(ds)}))}else as[ds]!==rs[ds]&&us(ds)}),ls}function isChildSwiperSlide(as){return as.type&&as.type.displayName&&as.type.displayName.includes("SwiperSlide")}function processChildren(as){const rs=[];return React.Children.toArray(as).forEach(ns=>{isChildSwiperSlide(ns)?rs.push(ns):ns.props&&ns.props.children&&processChildren(ns.props.children).forEach(ss=>rs.push(ss))}),rs}function getChildren$1(as){const rs=[],ns={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return React.Children.toArray(as).forEach(ss=>{if(isChildSwiperSlide(ss))rs.push(ss);else if(ss.props&&ss.props.slot&&ns[ss.props.slot])ns[ss.props.slot].push(ss);else if(ss.props&&ss.props.children){const os=processChildren(ss.props.children);os.length>0?os.forEach(ls=>rs.push(ls)):ns["container-end"].push(ss)}else ns["container-end"].push(ss)}),{slides:rs,slots:ns}}function updateSwiper({swiper:as,slides:rs,passedParams:ns,changedParams:ss,nextEl:os,prevEl:ls,scrollbarEl:us,paginationEl:cs}){const ds=ss.filter(_s=>_s!=="children"&&_s!=="direction"&&_s!=="wrapperClass"),{params:ps,pagination:fs,navigation:hs,scrollbar:gs,virtual:ys,thumbs:bs}=as;let vs,xs,Cs,Ts,Ss,Ns,As,ws;ss.includes("thumbs")&&ns.thumbs&&ns.thumbs.swiper&&ps.thumbs&&!ps.thumbs.swiper&&(vs=!0),ss.includes("controller")&&ns.controller&&ns.controller.control&&ps.controller&&!ps.controller.control&&(xs=!0),ss.includes("pagination")&&ns.pagination&&(ns.pagination.el||cs)&&(ps.pagination||ps.pagination===!1)&&fs&&!fs.el&&(Cs=!0),ss.includes("scrollbar")&&ns.scrollbar&&(ns.scrollbar.el||us)&&(ps.scrollbar||ps.scrollbar===!1)&&gs&&!gs.el&&(Ts=!0),ss.includes("navigation")&&ns.navigation&&(ns.navigation.prevEl||ls)&&(ns.navigation.nextEl||os)&&(ps.navigation||ps.navigation===!1)&&hs&&!hs.prevEl&&!hs.nextEl&&(Ss=!0);const Es=_s=>{as[_s]&&(as[_s].destroy(),_s==="navigation"?(as.isElement&&(as[_s].prevEl.remove(),as[_s].nextEl.remove()),ps[_s].prevEl=void 0,ps[_s].nextEl=void 0,as[_s].prevEl=void 0,as[_s].nextEl=void 0):(as.isElement&&as[_s].el.remove(),ps[_s].el=void 0,as[_s].el=void 0))};ss.includes("loop")&&as.isElement&&(ps.loop&&!ns.loop?Ns=!0:!ps.loop&&ns.loop?As=!0:ws=!0),ds.forEach(_s=>{if(isObject$3(ps[_s])&&isObject$3(ns[_s]))extend(ps[_s],ns[_s]);else{const $s=ns[_s];($s===!0||$s===!1)&&(_s==="navigation"||_s==="pagination"||_s==="scrollbar")?$s===!1&&Es(_s):ps[_s]=ns[_s]}}),ds.includes("controller")&&!xs&&as.controller&&as.controller.control&&ps.controller&&ps.controller.control&&(as.controller.control=ps.controller.control),ss.includes("children")&&rs&&ys&&ps.virtual.enabled&&(ys.slides=rs,ys.update(!0)),ss.includes("children")&&rs&&ps.loop&&(ws=!0),vs&&bs.init()&&bs.update(!0),xs&&(as.controller.control=ps.controller.control),Cs&&(as.isElement&&(!cs||typeof cs=="string")&&(cs=document.createElement("div"),cs.classList.add("swiper-pagination"),as.el.shadowEl.appendChild(cs)),cs&&(ps.pagination.el=cs),fs.init(),fs.render(),fs.update()),Ts&&(as.isElement&&(!us||typeof us=="string")&&(us=document.createElement("div"),us.classList.add("swiper-scrollbar"),as.el.shadowEl.appendChild(us)),us&&(ps.scrollbar.el=us),gs.init(),gs.updateSize(),gs.setTranslate()),Ss&&(as.isElement&&((!os||typeof os=="string")&&(os=document.createElement("div"),os.classList.add("swiper-button-next"),as.el.shadowEl.appendChild(os)),(!ls||typeof ls=="string")&&(ls=document.createElement("div"),ls.classList.add("swiper-button-prev"),as.el.shadowEl.appendChild(ls))),os&&(ps.navigation.nextEl=os),ls&&(ps.navigation.prevEl=ls),hs.init(),hs.update()),ss.includes("allowSlideNext")&&(as.allowSlideNext=ns.allowSlideNext),ss.includes("allowSlidePrev")&&(as.allowSlidePrev=ns.allowSlidePrev),ss.includes("direction")&&as.changeDirection(ns.direction,!1),(Ns||ws)&&as.loopDestroy(),(As||ws)&&as.loopCreate(),as.update()}function renderVirtual(as,rs,ns){if(!ns)return null;const ss=fs=>{let hs=fs;return fs<0?hs=rs.length+fs:hs>=rs.length&&(hs=hs-rs.length),hs},os=as.isHorizontal()?{[as.rtlTranslate?"right":"left"]:`${ns.offset}px`}:{top:`${ns.offset}px`},{from:ls,to:us}=ns,cs=as.params.loop?-rs.length:0,ds=as.params.loop?rs.length*2:rs.length,ps=[];for(let fs=cs;fs=ls&&fs<=us&&ps.push(rs[ss(fs)]);return ps.map(fs=>React.cloneElement(fs,{swiper:as,style:os}))}const updateOnVirtualData=as=>{!as||as.destroyed||!as.params.virtual||as.params.virtual&&!as.params.virtual.enabled||(as.updateSlides(),as.updateProgress(),as.updateSlidesClasses(),as.parallax&&as.params.parallax&&as.params.parallax.enabled&&as.parallax.setTranslate())};function useIsomorphicLayoutEffect(as,rs){return typeof window>"u"?reactExports.useEffect(as,rs):reactExports.useLayoutEffect(as,rs)}const SwiperSlideContext=reactExports.createContext(null),SwiperContext=reactExports.createContext(null);function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(as){for(var rs=1;rs{bs(!ys)};Object.assign(_s.on,{_containerClasses(Ws,Us){fs(Us)}});const ks=()=>{Object.assign(_s.on,Ds),ds=!0;const Ws={..._s};if(delete Ws.wrapperClass,Cs.current=new Swiper$1(Ws),Cs.current.virtual&&Cs.current.params.virtual.enabled){Cs.current.virtual.slides=Os;const Us={cache:!1,slides:Os,renderExternal:gs,renderExternalUpdate:!1};extend(Cs.current.params.virtual,Us),extend(Cs.current.originalParams.virtual,Us)}};xs.current||ks(),Cs.current&&Cs.current.on("_beforeBreakpoint",Vs);const Ps=()=>{ds||!Ds||!Cs.current||Object.keys(Ds).forEach(Ws=>{Cs.current.on(Ws,Ds[Ws])})},Bs=()=>{!Ds||!Cs.current||Object.keys(Ds).forEach(Ws=>{Cs.current.off(Ws,Ds[Ws])})};reactExports.useEffect(()=>()=>{Cs.current&&Cs.current.off("_beforeBreakpoint",Vs)}),reactExports.useEffect(()=>{!vs.current&&Cs.current&&(Cs.current.emitSlidesClasses(),vs.current=!0)}),useIsomorphicLayoutEffect(()=>{if(rs&&(rs.current=xs.current),!!xs.current)return Cs.current.destroyed&&ks(),mountSwiper({el:xs.current,nextEl:Ns.current,prevEl:As.current,paginationEl:ws.current,scrollbarEl:Es.current,swiper:Cs.current},_s),us&&us(Cs.current),()=>{Cs.current&&!Cs.current.destroyed&&Cs.current.destroy(!0,!1)}},[]),useIsomorphicLayoutEffect(()=>{Ps();const Ws=getChangedParams($s,Ts.current,Os,Ss.current,Us=>Us.key);return Ts.current=$s,Ss.current=Os,Ws.length&&Cs.current&&!Cs.current.destroyed&&updateSwiper({swiper:Cs.current,slides:Os,passedParams:$s,changedParams:Ws,nextEl:Ns.current,prevEl:As.current,scrollbarEl:Es.current,paginationEl:ws.current}),()=>{Bs()}}),useIsomorphicLayoutEffect(()=>{updateOnVirtualData(Cs.current)},[hs]);function Ms(){return _s.virtual?renderVirtual(Cs.current,Os,hs):Os.map((Ws,Us)=>React.cloneElement(Ws,{swiper:Cs.current,swiperSlideIndex:Us}))}return React.createElement(ss,_extends$1({ref:xs,className:uniqueClasses(`${ps}${ns?` ${ns}`:""}`)},Rs),React.createElement(SwiperContext.Provider,{value:Cs.current},Is["container-start"],React.createElement(os,{className:wrapperClass(_s.wrapperClass)},Is["wrapper-start"],Ms(),Is["wrapper-end"]),needsNavigation(_s)&&React.createElement(React.Fragment,null,React.createElement("div",{ref:As,className:"swiper-button-prev"}),React.createElement("div",{ref:Ns,className:"swiper-button-next"})),needsScrollbar(_s)&&React.createElement("div",{ref:Es,className:"swiper-scrollbar"}),needsPagination(_s)&&React.createElement("div",{ref:ws,className:"swiper-pagination"}),Is["container-end"]))});Swiper.displayName="Swiper";function _extends(){return _extends=Object.assign?Object.assign.bind():function(as){for(var rs=1;rs{if(typeof ps<"u"&&(hs.current.swiperSlideIndex=ps),rs&&(rs.current=hs.current),!(!hs.current||!ls)){if(ls.destroyed){gs!=="swiper-slide"&&ys("swiper-slide");return}return ls.on("_slideClass",xs),()=>{ls&&ls.off("_slideClass",xs)}}}),useIsomorphicLayoutEffect(()=>{ls&&hs.current&&!ls.destroyed&&ys(ls.getSlideClasses(hs.current))},[ls]);const Cs={isActive:gs.indexOf("swiper-slide-active")>=0,isVisible:gs.indexOf("swiper-slide-visible")>=0,isPrev:gs.indexOf("swiper-slide-prev")>=0,isNext:gs.indexOf("swiper-slide-next")>=0},Ts=()=>typeof ss=="function"?ss(Cs):ss,Ss=()=>{vs(!0)};return React.createElement(ns,_extends({ref:hs,className:uniqueClasses(`${gs}${os?` ${os}`:""}`),"data-swiper-slide-index":ds,onLoad:Ss},fs),us&&React.createElement(SwiperSlideContext.Provider,{value:Cs},React.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof us=="number"?us:void 0},Ts(),cs&&!bs&&React.createElement("div",{className:"swiper-lazy-preloader"}))),!us&&React.createElement(SwiperSlideContext.Provider,{value:Cs},Ts(),cs&&!bs&&React.createElement("div",{className:"swiper-lazy-preloader"})))});SwiperSlide.displayName="SwiperSlide";const swiper_min="",pagination_min="",keyboard_min="",Carousel$1="";Swiper$1.use([Keyboard,Mousewheel]);function Card$2({activityLink:as,doenetId:rs,imagePath:ns,label:ss,fullName:os}){return jsxs(Box,{display:"flex",flexDirection:"column",height:"180px",width:"180px",background:"black",overflow:"hidden",margin:"10px",border:"2px solid #949494",borderRadius:"6px",children:[jsx$1(Box,{height:"130px",children:jsx$1(Link$1,{to:as,children:jsx$1(Image$2,{width:"100%",height:"100%",objectFit:"contain",src:ns,alt:"Activity Card"})})}),jsxs(Box,{height:"50px",display:"flex",justifyContent:"flex-start",padding:"2px",color:"black",background:"white",children:[jsxs(Box,{width:"40px",display:"flex",alignContent:"center",justifyContent:"center",alignItems:"center",position:"relative",children:[jsx$1(Avatar,{size:"sm",name:os}),jsx$1(Box,{position:"absolute",width:"100px",left:"8px",bottom:"0px",children:jsx$1(Text$1,{fontSize:"10px",children:os})})]}),jsx$1(Box,{children:jsx$1(Text$1,{fontSize:"sm",lineHeight:"1",noOfLines:2,children:ss})})]})]})}const LeftChevron=styled$1(FontAwesomeIcon)` color: #949494; font-size: 50px; margin-top: 65px; @@ -1903,7 +1912,7 @@ let ns=poly_div(as,[rs]),ss=0,os=ns[0].length;for(var ls=0;lsjsxs(Flex,{w:"100%",position:"relative",children:[jsx$1(Tab,{background:"doenet.canvas",fontWeight:"700",borderLeft:"none",px:3,w:"100%",onClick:()=>os(gs),children:jsxs(Flex,{w:"100%",alignItems:"center",justifyContent:"right",children:[hs.label,jsx$1(Badge,{ml:2,w:5,h:5,fontSize:"0.8em",background:"doenet.lightBlue",borderRadius:"full",children:hs.count})]})},`tab-${gs}`),jsx$1(Box,{display:ss!==gs&&"none",position:"absolute",right:0,top:0,bottom:0,w:1,borderRadius:5,bg:"doenet.mainBlue"})]},`tab-${gs}`))}),jsxs(TabPanels,{background:"doenet.mainGray",children:[jsx$1(TabPanel,{children:jsxs(Wrap,{p:10,m:0,display:"flex",justifyContent:"center",alignItems:"center",children:[ps.map(hs=>{if((hs==null?void 0:hs.type)=="activity"){const{doenetId:gs,imagePath:ys,label:bs,fullName:vs}=hs;return jsx$1(ActivityCard,{doenetId:gs,imagePath:ys,label:bs,fullName:vs},gs)}else if((hs==null?void 0:hs.type)=="author"){const{courseId:gs,firstName:ys,lastName:bs}=hs;return jsx$1(AuthorCard,{fullName:`${ys} ${bs}`,portfolioCourseId:gs},gs)}}),ps.length==0?jsxs(Flex,{flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minHeight:200,background:"doenet.canvas",padding:20,children:[jsx$1(Icon,{fontSize:"48pt",as:RiEmotionSadLine}),jsx$1(Text$1,{fontSize:"36pt",children:"No Matches Found!"})]}):null]})}),jsx$1(TabPanel,{children:jsxs(Wrap,{p:10,m:0,display:"flex",justifyContent:"center",alignItems:"center",children:[ns==null?void 0:ns.activities.map(hs=>{const{doenetId:gs,imagePath:ys,label:bs,fullName:vs}=hs;return jsx$1(ActivityCard,{doenetId:gs,imagePath:ys,label:bs,fullName:vs},gs)}),((cs=ns==null?void 0:ns.activities)==null?void 0:cs.length)==0?jsxs(Flex,{flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minHeight:200,background:"doenet.canvas",padding:20,children:[jsx$1(Icon,{fontSize:"48pt",as:RiEmotionSadLine}),jsx$1(Text$1,{fontSize:"36pt",children:"No Matching Activities Found!"})]}):null]})}),jsx$1(TabPanel,{children:jsxs(Flex,{p:10,m:0,display:"flex",justifyContent:"center",alignItems:"center",children:[ns==null?void 0:ns.users.map(hs=>{const{courseId:gs,firstName:ys,lastName:bs}=hs;return jsx$1(AuthorCard,{fullName:`${ys} ${bs}`,portfolioCourseId:gs},gs)}),((ds=ns==null?void 0:ns.users)==null?void 0:ds.length)==0?jsxs(Flex,{flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minHeight:200,background:"doenet.canvas",padding:20,children:[jsx$1(Icon,{fontSize:"48pt",as:RiEmotionSadLine}),jsx$1(Text$1,{fontSize:"36pt",children:"No Matching Authors Found!"})]}):null]})})]})]})]})}return jsxs(Fragment,{children:[jsx$1(Flex,{flexDirection:"column",p:4,mt:"1rem",justifyContent:"center",alignItems:"center",textAlign:"center",height:"20px",children:jsx$1(Box,{maxW:400,minW:200,children:jsx$1(Box,{width:"400px",children:jsx$1(Form,{children:jsx$1(Searchbar,{defaultValue:rs})})})})}),jsx$1(Heading$1,{heading:"Community Public Content"}),jsxs(CarouselSection$1,{children:[jsx$1(Carousel,{title:"College Math",data:as[0]}),jsx$1(Carousel,{title:"Science & Engineering",data:as[1]}),jsx$1(Carousel,{title:"K-12 Math",data:as[2]})]})]})}function promisifyRequest(as){return new Promise((rs,ns)=>{as.oncomplete=as.onsuccess=()=>rs(as.result),as.onabort=as.onerror=()=>ns(as.error)})}function createStore(as,rs){const ns=indexedDB.open(as);ns.onupgradeneeded=()=>ns.result.createObjectStore(rs);const ss=promisifyRequest(ns);return(os,ls)=>ss.then(us=>ls(us.transaction(rs,os).objectStore(rs)))}let defaultGetStoreFunc;function defaultGetStore(){return defaultGetStoreFunc||(defaultGetStoreFunc=createStore("keyval-store","keyval")),defaultGetStoreFunc}function get(as,rs=defaultGetStore()){return rs("readonly",ns=>promisifyRequest(ns.get(as)))}function set(as,rs,ns=defaultGetStore()){return ns("readwrite",ss=>(ss.put(rs,as),promisifyRequest(ss.transaction)))}function clear(as=defaultGetStore()){return as("readwrite",rs=>(rs.clear(),promisifyRequest(rs.transaction)))}function eachCursor(as,rs){return as.openCursor().onsuccess=function(){this.result&&(rs(this.result),this.result.continue())},promisifyRequest(as.transaction)}function keys$2(as=defaultGetStore()){return as("readonly",rs=>{if(rs.getAllKeys)return promisifyRequest(rs.getAllKeys());const ns=[];return eachCursor(rs,ss=>ns.push(ss.key)).then(()=>ns)})}async function clearUsersInformationFromTheBrowser(){return localStorage.clear(),await axios.get("/api/signOut.php"),await clear(),!0}async function checkIfUserClearedOut(){let as=[],ns=(await keys$2()).length==0;ns||as.push("IndexedDB not removed");let ss=localStorage.length==0;ss||as.push("local storage not removed");const{data:os}=await axios.get("/api/getQuickCheckSignedIn.php"),ls=!(os!=null&&os.signedIn),us=document.cookie.split(";"),cs=us.length===1&&us[0]==="";let ds=cs&&ls;cs||as.push("cookie not removed"),ls||as.push("secure cookie not removed");let ps=!1;return ns&&ss&&ds&&(ps=!0),{userInformationIsCompletelyRemoved:ps,messageArray:as,cookieRemoved:ds}}const LogoButton=styled$1.button` +`;function Community(){var ls,us,cs,ds;const{carouselData:as,q:rs,searchResults:ns}=useLoaderData(),[ss,os]=reactExports.useState(0);if(rs){let ps=[...ns==null?void 0:ns.activities,...ns==null?void 0:ns.users];const fs=[{label:"All Matches",count:ps.length},{label:"Activities",count:(ls=ns==null?void 0:ns.activities)==null?void 0:ls.length},{label:"Authors",count:(us=ns==null?void 0:ns.users)==null?void 0:us.length}];return jsxs(Fragment,{children:[jsx$1(Flex,{flexDirection:"column",p:4,mt:"1rem",justifyContent:"center",alignItems:"center",textAlign:"center",height:"20px",children:jsx$1(Box,{maxW:400,minW:200,children:jsx$1(Box,{w:"400px",children:jsx$1(Form,{children:jsx$1(Searchbar,{defaultValue:rs})})})})}),jsx$1(Box,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100px",background:"doenet.canvas",children:jsxs(Text$1,{fontSize:"24px",children:["Results for",jsxs(Text$1,{as:"span",fontSize:"24px",fontWeight:"700",children:[" ",rs]})]})}),jsxs(Tabs,{orientation:"vertical",minHeight:"calc(100vh - 150px)",variant:"line",children:[jsx$1(TabList,{background:"doenet.canvas",w:240,children:fs.map((hs,gs)=>jsxs(Flex,{w:"100%",position:"relative",children:[jsx$1(Tab,{background:"doenet.canvas",fontWeight:"700",borderLeft:"none",px:3,w:"100%",onClick:()=>os(gs),children:jsxs(Flex,{w:"100%",alignItems:"center",justifyContent:"right",children:[hs.label,jsx$1(Badge,{ml:2,w:5,h:5,fontSize:"0.8em",background:"doenet.lightBlue",borderRadius:"full",children:hs.count})]})},`tab-${gs}`),jsx$1(Box,{display:ss!==gs&&"none",position:"absolute",right:0,top:0,bottom:0,w:1,borderRadius:5,bg:"doenet.mainBlue"})]},`tab-${gs}`))}),jsxs(TabPanels,{background:"doenet.mainGray",children:[jsx$1(TabPanel,{children:jsxs(Wrap,{p:10,m:0,display:"flex",justifyContent:"center",alignItems:"center",children:[ps.map(hs=>{if((hs==null?void 0:hs.type)=="activity"){const{doenetId:gs,imagePath:ys,label:bs,fullName:vs}=hs;return jsx$1(ActivityCard,{doenetId:gs,imagePath:ys,label:bs,fullName:vs},gs)}else if((hs==null?void 0:hs.type)=="author"){const{courseId:gs,firstName:ys,lastName:bs}=hs;return jsx$1(AuthorCard,{fullName:`${ys} ${bs}`,portfolioCourseId:gs},gs)}}),ps.length==0?jsxs(Flex,{flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minHeight:200,background:"doenet.canvas",padding:20,children:[jsx$1(Icon,{fontSize:"48pt",as:RiEmotionSadLine}),jsx$1(Text$1,{fontSize:"36pt",children:"No Matches Found!"})]}):null]})}),jsx$1(TabPanel,{children:jsxs(Wrap,{p:10,m:0,display:"flex",justifyContent:"center",alignItems:"center",children:[ns==null?void 0:ns.activities.map(hs=>{const{doenetId:gs,imagePath:ys,label:bs,fullName:vs}=hs;return jsx$1(ActivityCard,{doenetId:gs,imagePath:ys,label:bs,fullName:vs},gs)}),((cs=ns==null?void 0:ns.activities)==null?void 0:cs.length)==0?jsxs(Flex,{flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minHeight:200,background:"doenet.canvas",padding:20,children:[jsx$1(Icon,{fontSize:"48pt",as:RiEmotionSadLine}),jsx$1(Text$1,{fontSize:"36pt",children:"No Matching Activities Found!"})]}):null]})}),jsx$1(TabPanel,{children:jsxs(Flex,{p:10,m:0,display:"flex",justifyContent:"center",alignItems:"center",children:[ns==null?void 0:ns.users.map(hs=>{const{courseId:gs,firstName:ys,lastName:bs}=hs;return jsx$1(AuthorCard,{fullName:`${ys} ${bs}`,portfolioCourseId:gs},gs)}),((ds=ns==null?void 0:ns.users)==null?void 0:ds.length)==0?jsxs(Flex,{flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minHeight:200,background:"doenet.canvas",padding:20,children:[jsx$1(Icon,{fontSize:"48pt",as:RiEmotionSadLine}),jsx$1(Text$1,{fontSize:"36pt",children:"No Matching Authors Found!"})]}):null]})})]})]})]})}return jsxs(Fragment,{children:[jsx$1(Flex,{flexDirection:"column",p:4,mt:"1rem",justifyContent:"center",alignItems:"center",textAlign:"center",height:"20px",children:jsx$1(Box,{maxW:400,minW:200,children:jsx$1(Box,{width:"400px",children:jsx$1(Form,{children:jsx$1(Searchbar,{defaultValue:rs})})})})}),jsx$1(Heading$1,{heading:"Community Public Content"}),jsxs(CarouselSection$1,{children:[jsx$1(Carousel,{title:"College Math",data:as[0]}),jsx$1(Carousel,{title:"Science & Engineering",data:as[1]}),jsx$1(Carousel,{title:"K-12 Math",data:as[2]})]})]})}const LogoButton=styled$1.button` background-image: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)), url('/Doenet_Logo_cloud_only.png'); background-position: center; @@ -1971,7 +1980,7 @@ let ns=poly_div(as,[rs]),ss=0,os=ns[0].length;for(var ls=0;lslocation.pathname==="/"||ns?"active":ss?"pending":"",children:rs})}function SiteHeader(as){let rs=useNavigate(),ns=useLoaderData();const ss=Recoil_index_24(pageToolViewAtom);let os=jsx$1(Button$2,{dataTest:"Nav to course",size:"medium",onClick:()=>{ss({page:"course",tool:"",view:"",params:{}}),rs("/course")},value:"Go to Course"});return ns.signedIn||(os=jsx$1(Button$2,{dataTest:"Nav to signin",onClick:()=>rs("/SignIn"),size:"medium",value:"Sign In"})),jsx$1(Fragment,{children:jsxs(TopContainer,{children:[jsxs(Box,{as:"header",gridRow:"1 / 2",backgroundColor:"#fff",color:"#000",height:"40px",position:"fixed",top:"0",width:"100%",margin:"0",display:"flex",justifyContent:"space-between",borderBottom:"1px solid var(--mainGray)",zIndex:"1200",children:[jsxs(Branding,{children:[jsx$1(RouterLogo,{}),jsx$1("p",{children:"Doenet"})]}),jsxs(BarMenu,{children:[jsx$1(MenuItem,{to:"/",children:"Home"}),jsx$1(MenuItem,{to:"community",children:"Community"}),ns.signedIn?jsx$1(MenuItem,{to:`portfolio/${ns.portfolioCourseId}`,children:"Portfolio"}):null]}),jsx$1(SignInButtonContainer,{children:os})]}),jsx$1(ContentContainer,{children:jsx$1(Outlet,{context:{signedIn:ns.signedIn}})})]})})}const __variableDynamicImportRuntimeHelper=(as,rs)=>{const ns=as[rs];return ns?typeof ns=="function"?ns():Promise.resolve(ns):new Promise((ss,os)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(os.bind(null,new Error("Unknown variable dynamic import: "+rs)))})};let nanoid=(as=21)=>crypto.getRandomValues(new Uint8Array(as)).reduce((rs,ns)=>(ns&=63,ns<36?rs+=ns.toString(36):ns<62?rs+=(ns-26).toString(36).toUpperCase():ns>62?rs+="-":rs+="_",rs),"");var sha1Exports={},sha1={get exports(){return sha1Exports},set exports(as){sha1Exports=as}},coreExports={},core={get exports(){return coreExports},set exports(as){coreExports=as}},hasRequiredCore;function requireCore(){return hasRequiredCore||(hasRequiredCore=1,function(as,rs){(function(ns,ss){as.exports=ss()})(commonjsGlobal$1,function(){var ns=ns||function(ss,os){var ls=Object.create||function(){function xs(){}return function(Cs){var Ts;return xs.prototype=Cs,Ts=new xs,xs.prototype=null,Ts}}(),us={},cs=us.lib={},ds=cs.Base=function(){return{extend:function(xs){var Cs=ls(this);return xs&&Cs.mixIn(xs),(!Cs.hasOwnProperty("init")||this.init===Cs.init)&&(Cs.init=function(){Cs.$super.init.apply(this,arguments)}),Cs.init.prototype=Cs,Cs.$super=this,Cs},create:function(){var xs=this.extend();return xs.init.apply(xs,arguments),xs},init:function(){},mixIn:function(xs){for(var Cs in xs)xs.hasOwnProperty(Cs)&&(this[Cs]=xs[Cs]);xs.hasOwnProperty("toString")&&(this.toString=xs.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),ps=cs.WordArray=ds.extend({init:function(xs,Cs){xs=this.words=xs||[],Cs!=os?this.sigBytes=Cs:this.sigBytes=xs.length*4},toString:function(xs){return(xs||hs).stringify(this)},concat:function(xs){var Cs=this.words,Ts=xs.words,Ss=this.sigBytes,Ns=xs.sigBytes;if(this.clamp(),Ss%4)for(var As=0;As>>2]>>>24-As%4*8&255;Cs[Ss+As>>>2]|=ws<<24-(Ss+As)%4*8}else for(var As=0;As>>2]=Ts[As>>>2];return this.sigBytes+=Ns,this},clamp:function(){var xs=this.words,Cs=this.sigBytes;xs[Cs>>>2]&=4294967295<<32-Cs%4*8,xs.length=ss.ceil(Cs/4)},clone:function(){var xs=ds.clone.call(this);return xs.words=this.words.slice(0),xs},random:function(xs){for(var Cs=[],Ts=function(Es){var Es=Es,_s=987654321,$s=4294967295;return function(){_s=36969*(_s&65535)+(_s>>16)&$s,Es=18e3*(Es&65535)+(Es>>16)&$s;var Rs=(_s<<16)+Es&$s;return Rs/=4294967296,Rs+=.5,Rs*(ss.random()>.5?1:-1)}},Ss=0,Ns;Ss>>2]>>>24-Ns%4*8&255;Ss.push((As>>>4).toString(16)),Ss.push((As&15).toString(16))}return Ss.join("")},parse:function(xs){for(var Cs=xs.length,Ts=[],Ss=0;Ss>>3]|=parseInt(xs.substr(Ss,2),16)<<24-Ss%8*4;return new ps.init(Ts,Cs/2)}},gs=fs.Latin1={stringify:function(xs){for(var Cs=xs.words,Ts=xs.sigBytes,Ss=[],Ns=0;Ns>>2]>>>24-Ns%4*8&255;Ss.push(String.fromCharCode(As))}return Ss.join("")},parse:function(xs){for(var Cs=xs.length,Ts=[],Ss=0;Ss>>2]|=(xs.charCodeAt(Ss)&255)<<24-Ss%4*8;return new ps.init(Ts,Cs)}},ys=fs.Utf8={stringify:function(xs){try{return decodeURIComponent(escape(gs.stringify(xs)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(xs){return gs.parse(unescape(encodeURIComponent(xs)))}},bs=cs.BufferedBlockAlgorithm=ds.extend({reset:function(){this._data=new ps.init,this._nDataBytes=0},_append:function(xs){typeof xs=="string"&&(xs=ys.parse(xs)),this._data.concat(xs),this._nDataBytes+=xs.sigBytes},_process:function(xs){var Cs=this._data,Ts=Cs.words,Ss=Cs.sigBytes,Ns=this.blockSize,As=Ns*4,ws=Ss/As;xs?ws=ss.ceil(ws):ws=ss.max((ws|0)-this._minBufferSize,0);var Es=ws*Ns,_s=ss.min(Es*4,Ss);if(Es){for(var $s=0;$s>>31}var Ns=(ys<<5|ys>>>27)+Cs+ds[Ts];Ts<20?Ns+=(bs&vs|~bs&xs)+1518500249:Ts<40?Ns+=(bs^vs^xs)+1859775393:Ts<60?Ns+=(bs&vs|bs&xs|vs&xs)-1894007588:Ns+=(bs^vs^xs)-899497514,Cs=xs,xs=vs,vs=bs<<30|bs>>>2,bs=ys,ys=Ns}gs[0]=gs[0]+ys|0,gs[1]=gs[1]+bs|0,gs[2]=gs[2]+vs|0,gs[3]=gs[3]+xs|0,gs[4]=gs[4]+Cs|0},_doFinalize:function(){var fs=this._data,hs=fs.words,gs=this._nDataBytes*8,ys=fs.sigBytes*8;return hs[ys>>>5]|=128<<24-ys%32,hs[(ys+64>>>9<<4)+14]=Math.floor(gs/4294967296),hs[(ys+64>>>9<<4)+15]=gs,fs.sigBytes=hs.length*4,this._process(),this._hash},clone:function(){var fs=us.clone.call(this);return fs._hash=this._hash.clone(),fs}});ss.SHA1=us._createHelper(ps),ss.HmacSHA1=us._createHmacHelper(ps)}(),ns.SHA1})})(sha1);var encBase64Exports={},encBase64={get exports(){return encBase64Exports},set exports(as){encBase64Exports=as}};(function(as,rs){(function(ns,ss){as.exports=ss(requireCore())})(commonjsGlobal$1,function(ns){return function(){var ss=ns,os=ss.lib,ls=os.WordArray,us=ss.enc;us.Base64={stringify:function(ds){var ps=ds.words,fs=ds.sigBytes,hs=this._map;ds.clamp();for(var gs=[],ys=0;ys>>2]>>>24-ys%4*8&255,vs=ps[ys+1>>>2]>>>24-(ys+1)%4*8&255,xs=ps[ys+2>>>2]>>>24-(ys+2)%4*8&255,Cs=bs<<16|vs<<8|xs,Ts=0;Ts<4&&ys+Ts*.75>>6*(3-Ts)&63));var Ss=hs.charAt(64);if(Ss)for(;gs.length%4;)gs.push(Ss);return gs.join("")},parse:function(ds){var ps=ds.length,fs=this._map,hs=this._reverseMap;if(!hs){hs=this._reverseMap=[];for(var gs=0;gs>>6-ys%4*2;hs[gs>>>2]|=(bs|vs)<<24-gs%4*8,gs++}return ls.create(hs,gs)}}(),ns.enc.Base64})})(encBase64);let rePlus=/\+/g,reSlash=/\//g;function createUniqueName(as,rs){let ns=encBase64Exports.stringify(sha1Exports(rs)).slice(0,10).replace(rePlus,"_").replace(reSlash,"-");return"__"+as+"_"+ns}function getUniqueIdentifierFromBase(as,rs){let ns=1,ss=as+ns;for(;rs.includes(ss);)ns+=1,ss=as+ns;return rs.push(ss),ss}function getNamespaceFromName(as){let rs=as.lastIndexOf("/");if(rs===-1)throw Error(`Encountered name ${as} that doesn't include a slash`);return as.slice(0,rs+1)}function flattenDeep(as){return as.reduce((rs,ns)=>Array.isArray(ns)?rs.concat(flattenDeep(ns)):rs.concat(ns),[])}function flattenLevels(as,rs){return console.log(`levels: ${rs}`),as.reduce((ns,ss)=>Array.isArray(ss)&&rs>1?ns.concat(flattenLevels(ss,rs-1)):ns.concat(ss),[])}class Subset{union(rs){return this.complement().intersect(rs.complement()).complement()}intersectWithOpenInterval(rs){return this.intersect(rs)}setMinus(rs){return this.intersect(rs.complement())}symmetricDifference(rs){return this.setMinus(rs).union(rs.setMinus(this))}equals(rs){return this.symmetricDifference(rs).isEmpty()}toJSON(){return{objectType:"subset",data:Object.assign({},this),subsetType:this.constructor.subsetType}}static reviver(rs,ns){if(ns&&ns.objectType==="subset"&&ns.subsetType!==void 0){if(ns.subsetType==="emptySet")return new EmptySet;if(ns.subsetType==="realLine")return new RealLine;if(ns.subsetType==="singleton")return new Singleton(ns.data.element);if(ns.subsetType==="union")return new Union(ns.data.subsets);if(ns.subsetType==="openInterval")return new OpenInterval(ns.data.left,ns.data.right)}return ns}copy(){return this.constructor.reviver(null,this.toJSON())}}const hp=class extends Subset{union(rs){return rs}intersect(){return new hp}contains(){return!1}isEmpty(){return!0}complement(){return new RealLine}toString(){return"∅"}toMathExpression(){return Context.fromAst("∅")}};let EmptySet=hp;zs(EmptySet,"subsetType","emptySet");const gp=class extends Subset{union(){return new gp}intersect(rs){return rs}contains(){return!0}complement(){return new EmptySet}isEmpty(){return!1}toString(){return"ℝ"}toMathExpression(){return Context.fromAst("R")}};let RealLine=gp;zs(RealLine,"subsetType","realLine");const yp=class extends Subset{constructor(rs){if(super(),!Number.isFinite(rs))return new EmptySet;this.element=rs}union(rs){return rs.contains(this.element)?rs:new Union([rs,this])}intersect(rs){return rs.contains(this.element)?new yp(this.element):new EmptySet}isEmpty(){return!1}contains(rs){return rs===this.element}complement(){return new Union([new OpenInterval(-1/0,this.element),new OpenInterval(this.element,1/0)])}toString(){return`{${this.element}}`}toMathExpression(){return Context.fromAst(["set",this.element])}};let Singleton=yp;zs(Singleton,"subsetType","singleton");const Ju=class extends Subset{intersect(rs){return new Ju(this.subsets.map(ns=>rs.intersect(ns)))}toString(){return this.subsets.map(rs=>rs.toString()).join(" U ")}toMathExpression(){return Context.fromAst(["union",...this.subsets.map(rs=>rs.toMathExpression().tree)])}constructor(rs){super();let ns=rs.filter(ss=>!ss.isEmpty());if(ns.length===0)return new EmptySet;ns=ns.reduce((ss,os)=>os instanceof Ju?ss.concat(os.subsets):ss.concat(os),[]),this.subsets=[];for(let ss=0;ssus&&ps.elementds.left&&usns.contains(rs))}isEmpty(){return this.subsets.every(rs=>rs.isEmpty())}complement(){return this.subsets.map(rs=>rs.complement()).reduce((rs,ns)=>rs.intersect(ns))}};let Union=Ju;zs(Union,"subsetType","union");let Interval$1=class extends Subset{constructor(rs,ns){return super(),this.left=rs,this.right=ns,this.left<=this.right?this.left===-1/0&&this.right===1/0?new RealLine:this:new EmptySet}};const bp=class extends Interval$1{constructor(rs,ns){return super(rs,ns),rs===ns?new EmptySet:this}intersect(rs){return rs.intersectWithOpenInterval(this)}intersectWithOpenInterval(rs){return new bp(Math.max(this.left,rs.left),Math.min(this.right,rs.right))}complement(){return new Union([new OpenClosedInterval(-1/0,this.left),new ClosedOpenInterval(this.right,1/0)])}isEmpty(){return this.left>=this.right}contains(rs){return rs>this.left&&rsbuildSubsetFromIntervals(os,rs)).filter(os=>os);return ss.length===0?new EmptySet:ss.length===1?ss[0]:new Union(ss)}else if(ns==="intersect"||ns==="and"){let ss=as.slice(1).map(os=>buildSubsetFromIntervals(os,rs)).filter(os=>os);return ss.length===0?new RealLine:ss.reduce((os,ls)=>os.intersect(ls))}else if(ns==="set"){let ss=as.slice(1).map(os=>buildSubsetFromIntervals(os,rs)).filter(os=>os);return ss.length===0?new EmptySet:ss.length===1?ss[0]:new Union(ss)}else if(["<","le",">","ge","=","ne"].includes(ns)){let ss=as[1],os=!1;if(!Number.isFinite(ss)){if(deepCompare(ss,rs))os=!0;else if(ss=Context.fromAst(ss).evaluate_to_constant(),!(Number.isFinite(ss)||ss===1/0||ss===-1/0))return new EmptySet}let ls=as[2],us=!1;if(!Number.isFinite(ls)){if(deepCompare(ls,rs))us=!0;else if(ls=Context.fromAst(ls).evaluate_to_constant(),!(Number.isFinite(ls)||ls===1/0||ls===-1/0))return new EmptySet}return os?us?new EmptySet:ns==="<"?new OpenInterval(-1/0,ls):ns==="le"?new OpenClosedInterval(-1/0,ls):ns===">"?new OpenInterval(ls,1/0):ns==="ge"?new ClosedOpenInterval(ls,1/0):ns==="="?Number.isFinite(ls)?new Singleton(ls):new EmptySet:Number.isFinite(ls)?new Union([new OpenInterval(-1/0,ls),new OpenInterval(ls,1/0)]):new RealLine:us?ns==="<"?new OpenInterval(ss,1/0):ns==="le"?new ClosedOpenInterval(ss,1/0):ns===">"?new OpenInterval(-1/0,ss):ns==="ge"?new OpenClosedInterval(-1/0,ss):ns==="="?Number.isFinite(ss)?new Singleton(ss):new EmptySet:Number.isFinite(ss)?new Union([new OpenInterval(-1/0,ss),new OpenInterval(ss,1/0)]):new RealLine:new EmptySet}else if(["lts","gts"].includes(ns)){let ss=as[1].slice(1),os=as[2].slice(1);if(ss.length!==3||!deepCompare(ss[1],rs))return new EmptySet;ns==="gts"&&(ss.reverse(),os.reverse());let ls=ss[0];if(!Number.isFinite(ls)&&(ls=Context.fromAst(ls).evaluate_to_constant(),!(Number.isFinite(ls)||ls===1/0||ls===-1/0)))return new EmptySet;let us=ss[2];return!Number.isFinite(us)&&(us=Context.fromAst(us).evaluate_to_constant(),!(Number.isFinite(us)||us===1/0||us===-1/0))?new EmptySet:os[0]?os[1]?new OpenInterval(ls,us):new OpenClosedInterval(ls,us):os[1]?new ClosedOpenInterval(ls,us):new ClosedInterval(ls,us)}else if(ns==="|"){let ss=as[1];return buildSubsetFromIntervals(as[2],ss)}else if(ns==="^"&&(as[2]==="C"||as[2]==="c")){let ss=buildSubsetFromIntervals(as[1],rs);return ss?ss.complement():new EmptySet}else{if(ns==="in")return deepCompare(as[1],rs)?buildSubsetFromIntervals(as[2],rs):new EmptySet;if(ns==="ni")return deepCompare(as[2],rs)?buildSubsetFromIntervals(as[1],rs):new EmptySet;if(ns==="notin"){if(deepCompare(as[1],rs)){let ss=buildSubsetFromIntervals(as[2],rs);if(ss)return ss.complement()}return new EmptySet}else if(ns==="notni"){if(deepCompare(as[2],rs)){let ss=buildSubsetFromIntervals(as[1],rs);if(ss)return ss.complement()}return new EmptySet}else{let ss=Context.fromAst(as).evaluate_to_constant();return Number.isFinite(ss)?new Singleton(ss):new EmptySet}}}function buildSubsetFromMathExpression(as,rs){return buildSubsetFromIntervals(as.to_intervals().tree,rs.tree)}function deepClone(as,rs,ns){if(Object(as)!==as||as instanceof Function||rs!==void 0&&as instanceof rs)return as;if(as instanceof Context.class||as instanceof theModule.Subset)return as.copy();if(ns===void 0&&(ns=new WeakMap),Array.isArray(as))return[...as.map(os=>deepClone(os,rs,ns))];if(as.constructor===Object&&Object.entries(as).length===0)return{};if(ns.has(as))return ns.get(as);try{var ss=new as.constructor}catch{ss=Object.create(Object.getPrototypeOf(as))}return as instanceof Map?Array.from(as,([os,ls])=>ss.set(deepClone(os,rs,ns),deepClone(ls,rs,ns))):as instanceof Set&&Array.from(as,os=>ss.add(deepClone(os,rs,ns))),ns.set(as,ss),Object.assign(ss,...Object.keys(as).map(os=>({[os]:deepClone(as[os],rs,ns)})))}function deepCompare(as,rs,ns){var ss,os;function ls(us,cs){var ds;if(Number.isNaN(us)&&Number.isNaN(cs)||us===cs)return!0;if(ns!==void 0&&us instanceof ns&&cs instanceof ns)return us.componentName===cs.componentName;if(us instanceof Context.class&&cs instanceof Context.class)return ls(us.tree,cs.tree);if(typeof us=="function"&&typeof cs=="function"||us instanceof Date&&cs instanceof Date||us instanceof RegExp&&cs instanceof RegExp||us instanceof String&&cs instanceof String||us instanceof Number&&cs instanceof Number)return us.toString()===cs.toString();if(!(us instanceof Object&&cs instanceof Object)||us.isPrototypeOf(cs)||cs.isPrototypeOf(us)||us.constructor!==cs.constructor||us.prototype!==cs.prototype||ss.indexOf(us)>-1||os.indexOf(cs)>-1)return!1;for(ds in cs){if(cs.hasOwnProperty(ds)!==us.hasOwnProperty(ds))return!1;if(typeof cs[ds]!=typeof us[ds])return!1}for(ds in us){if(cs.hasOwnProperty(ds)!==us.hasOwnProperty(ds))return!1;if(typeof cs[ds]!=typeof us[ds])return!1;switch(typeof us[ds]){case"object":case"function":if(ss.push(us),os.push(cs),!ls(us[ds],cs[ds]))return!1;ss.pop(),os.pop();break;default:if(us[ds]!==cs[ds]&&!(Number.isNaN(us[ds])&&Number.isNaN(cs[ds])))return!1;break}}return!0}return ss=[],os=[],ls(as,rs)}function breakStringsAndOthersIntoComponentsByStringCommas(as){return null}function returnBreakStringsSugarFunction({childrenToComponentFunction:as,mustStripOffOuterParentheses:rs=!1}){return function({matchedChildren:ns}){let ss=0,os=[],ls=[],us=!1,cs=ns.length;if(rs){let ps=ns[0];if(typeof ps!="string"||ps.trimLeft()[0]!=="(")return{success:!1}}for(let[ps,fs]of ns.entries()){if(typeof fs!="string"){ls.push(fs);continue}let hs=fs.trim();if(ps===0&&rs&&hs[0]==="("){let ys=ns[cs-1];if(typeof ys=="string"){let bs=ys.trimRight();bs[bs.length-1]===")"&&(us=!0,hs=hs.substring(1))}}let gs=0;for(let ys=0;ysgs&&ls.push(hs.substring(gs,ys)),os.push(ls),ls=[],gs=ys+1)}hs.length>gs&&ls.push(hs.substring(gs,hs.length))}return ss!==0?{success:!1}:(os.push(ls),{success:!0,newChildren:os.map(as)})}}function breakEmbeddedStringByCommas({childrenList:as}){let rs=0,ns=[],ss=[];for(let os of as){if(typeof os!="string"){ss.push(os);continue}let ls=os.trim(),us=0;for(let cs=0;csus){let ps=ls.substring(us,cs).trim();ss.push(ps)}ns.push(ss),ss=[],us=cs+1}}if(ls.length>us){let cs=ls.substring(us,ls.length).trim();ss.push(cs)}}return rs!==0?{success:!1}:(ns.push(ss),{success:!0,pieces:ns})}function breakEmbeddedStringsIntoParensPieces({componentList:as,removeParens:rs=!1}){let ns=0,ss=[],os=[];for(let ls of as){if(typeof ls!="string"){ns===0?ss.push([ls]):os.push(ls);continue}let us=ls.trim(),cs=0;for(let ds=0;dscs){let fs=rs?ds:ds+1,hs=us.substring(cs,fs).trim();hs.length>0&&os.push(hs)}ss.push(os),os=[],cs=ds+1}ns--}else if(ns===0&&!ps.match(/\s/))return{success:!1}}if(us.length>cs){let ds=us.substring(cs,us.length).trim();os.push(ds)}}return ns!==0?{success:!1}:(os.length>0&&ss.push(os),{success:!0,pieces:ss})}const DefaultBufferLength=1024;let nextPropID=0;class Range{constructor(rs,ns){this.from=rs,this.to=ns}}class NodeProp{constructor(rs={}){this.id=nextPropID++,this.perNode=!!rs.perNode,this.deserialize=rs.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(rs){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof rs!="function"&&(rs=NodeType.match(rs)),ns=>{let ss=rs(ns);return ss===void 0?null:[this,ss]}}}NodeProp.closedBy=new NodeProp({deserialize:as=>as.split(" ")});NodeProp.openedBy=new NodeProp({deserialize:as=>as.split(" ")});NodeProp.group=new NodeProp({deserialize:as=>as.split(" ")});NodeProp.contextHash=new NodeProp({perNode:!0});NodeProp.lookAhead=new NodeProp({perNode:!0});NodeProp.mounted=new NodeProp({perNode:!0});const noProps=Object.create(null);class NodeType{constructor(rs,ns,ss,os=0){this.name=rs,this.props=ns,this.id=ss,this.flags=os}static define(rs){let ns=rs.props&&rs.props.length?Object.create(null):noProps,ss=(rs.top?1:0)|(rs.skipped?2:0)|(rs.error?4:0)|(rs.name==null?8:0),os=new NodeType(rs.name||"",ns,rs.id,ss);if(rs.props){for(let ls of rs.props)if(Array.isArray(ls)||(ls=ls(os)),ls){if(ls[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");ns[ls[0].id]=ls[1]}}return os}prop(rs){return this.props[rs.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(rs){if(typeof rs=="string"){if(this.name==rs)return!0;let ns=this.prop(NodeProp.group);return ns?ns.indexOf(rs)>-1:!1}return this.id==rs}static match(rs){let ns=Object.create(null);for(let ss in rs)for(let os of ss.split(" "))ns[os]=rs[ss];return ss=>{for(let os=ss.prop(NodeProp.group),ls=-1;ls<(os?os.length:0);ls++){let us=ns[ls<0?ss.name:os[ls]];if(us)return us}}}}NodeType.none=new NodeType("",Object.create(null),0,8);class NodeSet{constructor(rs){this.types=rs;for(let ns=0;nsus.node;;){let ds=!1;if(us.from<=ls&&us.to>=os&&(us.type.isAnonymous||ns(us.type,us.from,us.to,cs)!==!1)){if(us.firstChild())continue;us.type.isAnonymous||(ds=!0)}for(;ds&&ss&&ss(us.type,us.from,us.to,cs),ds=us.type.isAnonymous,!us.nextSibling();){if(!us.parent())return;ds=!0}}}prop(rs){return rs.perNode?this.props?this.props[rs.id]:void 0:this.type.prop(rs)}get propValues(){let rs=[];if(this.props)for(let ns in this.props)rs.push([+ns,this.props[ns]]);return rs}balance(rs={}){return this.children.length<=8?this:balanceRange(NodeType.none,this.children,this.positions,0,this.children.length,0,this.length,(ns,ss,os)=>new Tree(this.type,ns,ss,os,this.propValues),rs.makeTree||((ns,ss,os)=>new Tree(NodeType.none,ns,ss,os)))}static build(rs){return buildTree(rs)}}Tree.empty=new Tree(NodeType.none,[],[],0);class FlatBufferCursor{constructor(rs,ns){this.buffer=rs,this.index=ns}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new FlatBufferCursor(this.buffer,this.index)}}class TreeBuffer{constructor(rs,ns,ss){this.buffer=rs,this.length=ns,this.set=ss}get type(){return NodeType.none}toString(){let rs=[];for(let ns=0;ns0));ds=us[ds+3]);return cs}slice(rs,ns,ss,os){let ls=this.buffer,us=new Uint16Array(ns-rs);for(let cs=rs,ds=0;cs=rs&&nsrs;case 1:return ns<=rs&&ss>rs;case 2:return ss>rs;case 4:return!0}}function enterUnfinishedNodesBefore(as,rs){let ns=as.childBefore(rs);for(;ns;){let ss=ns.lastChild;if(!ss||ss.to!=ns.to)break;ss.type.isError&&ss.from==ss.to?(as=ns,ns=ss.prevSibling):ns=ss}return as}function resolveNode(as,rs,ns,ss){for(var os;as.from==as.to||(ns<1?as.from>=rs:as.from>rs)||(ns>-1?as.to<=rs:as.to0?cs.length:-1;rs!=ps;rs+=ns){let fs=cs[rs],hs=ds[rs]+us._from;if(checkSide(os,ss,hs,hs+fs.length)){if(fs instanceof TreeBuffer){if(ls&2)continue;let gs=fs.findChild(0,fs.buffer.length,ns,ss-hs,os);if(gs>-1)return new BufferNode(new BufferContext(us,fs,rs,hs),null,gs)}else if(ls&1||!fs.type.isAnonymous||hasChild(fs)){let gs;if(!(ls&1)&&fs.props&&(gs=fs.prop(NodeProp.mounted))&&!gs.overlay)return new TreeNode(gs.tree,hs,rs,us);let ys=new TreeNode(fs,hs,rs,us);return ls&1||!ys.type.isAnonymous?ys:ys.nextChild(ns<0?fs.children.length-1:0,ns,ss,os)}}}if(ls&1||!us.type.isAnonymous||(us.index>=0?rs=us.index+ns:rs=ns<0?-1:us._parent.node.children.length,us=us._parent,!us))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this.node.children.length-1,-1,0,4)}childAfter(rs){return this.nextChild(0,1,rs,2)}childBefore(rs){return this.nextChild(this.node.children.length-1,-1,rs,-2)}enter(rs,ns,ss=!0,os=!0){let ls;if(ss&&(ls=this.node.prop(NodeProp.mounted))&&ls.overlay){let us=rs-this.from;for(let{from:cs,to:ds}of ls.overlay)if((ns>0?cs<=us:cs=us:ds>us))return new TreeNode(ls.tree,ls.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,rs,ns,os?0:2)}nextSignificantParent(){let rs=this;for(;rs.type.isAnonymous&&rs._parent;)rs=rs._parent;return rs}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get cursor(){return new TreeCursor(this)}get tree(){return this.node}toTree(){return this.node}resolve(rs,ns=0){return resolveNode(this,rs,ns,!1)}resolveInner(rs,ns=0){return resolveNode(this,rs,ns,!0)}enterUnfinishedNodesBefore(rs){return enterUnfinishedNodesBefore(this,rs)}getChild(rs,ns=null,ss=null){let os=getChildren(this,rs,ns,ss);return os.length?os[0]:null}getChildren(rs,ns=null,ss=null){return getChildren(this,rs,ns,ss)}toString(){return this.node.toString()}}function getChildren(as,rs,ns,ss){let os=as.cursor,ls=[];if(!os.firstChild())return ls;if(ns!=null){for(;!os.type.is(ns);)if(!os.nextSibling())return ls}for(;;){if(ss!=null&&os.type.is(ss))return ls;if(os.type.is(rs)&&ls.push(os.node),!os.nextSibling())return ss==null?ls:[]}}class BufferContext{constructor(rs,ns,ss,os){this.parent=rs,this.buffer=ns,this.index=ss,this.start=os}}class BufferNode{constructor(rs,ns,ss){this.context=rs,this._parent=ns,this.index=ss,this.type=rs.buffer.set.types[rs.buffer.buffer[ss]]}get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}child(rs,ns,ss){let{buffer:os}=this.context,ls=os.findChild(this.index+4,os.buffer[this.index+3],rs,ns-this.context.start,ss);return ls<0?null:new BufferNode(this.context,this,ls)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(rs){return this.child(1,rs,2)}childBefore(rs){return this.child(-1,rs,-2)}enter(rs,ns,ss,os=!0){if(!os)return null;let{buffer:ls}=this.context,us=ls.findChild(this.index+4,ls.buffer[this.index+3],ns>0?1:-1,rs-this.context.start,ns);return us<0?null:new BufferNode(this.context,this,us)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(rs){return this._parent?null:this.context.parent.nextChild(this.context.index+rs,rs,0,4)}get nextSibling(){let{buffer:rs}=this.context,ns=rs.buffer[this.index+3];return ns<(this._parent?rs.buffer[this._parent.index+3]:rs.buffer.length)?new BufferNode(this.context,this._parent,ns):this.externalSibling(1)}get prevSibling(){let{buffer:rs}=this.context,ns=this._parent?this._parent.index+4:0;return this.index==ns?this.externalSibling(-1):new BufferNode(this.context,this._parent,rs.findChild(ns,this.index,-1,0,4))}get cursor(){return new TreeCursor(this)}get tree(){return null}toTree(){let rs=[],ns=[],{buffer:ss}=this.context,os=this.index+4,ls=ss.buffer[this.index+3];if(ls>os){let us=ss.buffer[this.index+1],cs=ss.buffer[this.index+2];rs.push(ss.slice(os,ls,us,cs)),ns.push(0)}return new Tree(this.type,rs,ns,this.to-this.from)}resolve(rs,ns=0){return resolveNode(this,rs,ns,!1)}resolveInner(rs,ns=0){return resolveNode(this,rs,ns,!0)}enterUnfinishedNodesBefore(rs){return enterUnfinishedNodesBefore(this,rs)}toString(){return this.context.buffer.childString(this.index)}getChild(rs,ns=null,ss=null){let os=getChildren(this,rs,ns,ss);return os.length?os[0]:null}getChildren(rs,ns=null,ss=null){return getChildren(this,rs,ns,ss)}}class TreeCursor{constructor(rs,ns=0){if(this.mode=ns,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,rs instanceof TreeNode)this.yieldNode(rs);else{this._tree=rs.context.parent,this.buffer=rs.context;for(let ss=rs._parent;ss;ss=ss._parent)this.stack.unshift(ss.index);this.bufferNode=rs,this.yieldBuf(rs.index)}}get name(){return this.type.name}yieldNode(rs){return rs?(this._tree=rs,this.type=rs.type,this.from=rs.from,this.to=rs.to,!0):!1}yieldBuf(rs,ns){this.index=rs;let{start:ss,buffer:os}=this.buffer;return this.type=ns||os.set.types[os.buffer[rs]],this.from=ss+os.buffer[rs+1],this.to=ss+os.buffer[rs+2],!0}yield(rs){return rs?rs instanceof TreeNode?(this.buffer=null,this.yieldNode(rs)):(this.buffer=rs.context,this.yieldBuf(rs.index,rs.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(rs,ns,ss){if(!this.buffer)return this.yield(this._tree.nextChild(rs<0?this._tree.node.children.length-1:0,rs,ns,ss,this.mode));let{buffer:os}=this.buffer,ls=os.findChild(this.index+4,os.buffer[this.index+3],rs,ns-this.buffer.start,ss);return ls<0?!1:(this.stack.push(this.index),this.yieldBuf(ls))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(rs){return this.enterChild(1,rs,2)}childBefore(rs){return this.enterChild(-1,rs,-2)}enter(rs,ns,ss=!0,os=!0){return this.buffer?os?this.enterChild(1,rs,ns):!1:this.yield(this._tree.enter(rs,ns,ss&&!(this.mode&1),os))}parent(){if(!this.buffer)return this.yieldNode(this.mode&1?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let rs=this.mode&1?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(rs)}sibling(rs){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+rs,rs,0,4,this.mode)):!1;let{buffer:ns}=this.buffer,ss=this.stack.length-1;if(rs<0){let os=ss<0?0:this.stack[ss]+4;if(this.index!=os)return this.yieldBuf(ns.findChild(os,this.index,-1,0,4))}else{let os=ns.buffer[this.index+3];if(os<(ss<0?ns.buffer.length:ns.buffer[this.stack[ss]+3]))return this.yieldBuf(os)}return ss<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+rs,rs,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(rs){let ns,ss,{buffer:os}=this;if(os){if(rs>0){if(this.index-1)for(let ls=ns+rs,us=rs<0?-1:ss.node.children.length;ls!=us;ls+=rs){let cs=ss.node.children[ls];if(this.mode&1||cs instanceof TreeBuffer||!cs.type.isAnonymous||hasChild(cs))return!1}return!0}move(rs,ns){if(ns&&this.enterChild(rs,0,4))return!0;for(;;){if(this.sibling(rs))return!0;if(this.atLastNode(rs)||!this.parent())return!1}}next(rs=!0){return this.move(1,rs)}prev(rs=!0){return this.move(-1,rs)}moveTo(rs,ns=0){for(;(this.from==this.to||(ns<1?this.from>=rs:this.from>rs)||(ns>-1?this.to<=rs:this.to=0;){for(let us=rs;us;us=us._parent)if(us.index==os){if(os==this.index)return us;ns=us,ss=ls+1;break e}os=this.stack[--ls]}for(let os=ss;osrs instanceof TreeBuffer||!rs.type.isAnonymous||hasChild(rs))}function buildTree(as){var rs;let{buffer:ns,nodeSet:ss,maxBufferLength:os=DefaultBufferLength,reused:ls=[],minRepeatType:us=ss.types.length}=as,cs=Array.isArray(ns)?new FlatBufferCursor(ns,ns.length):ns,ds=ss.types,ps=0,fs=0;function hs(Ns,As,ws,Es,_s){let{id:$s,start:Rs,end:Ds,size:Os}=cs,Is=fs;for(;Os<0;)if(cs.next(),Os==-1){let Ms=ls[$s];ws.push(Ms),Es.push(Rs-Ns);return}else if(Os==-3){ps=$s;return}else if(Os==-4){fs=$s;return}else throw new RangeError(`Unrecognized record size: ${Os}`);let Vs=ds[$s],ks,Ps,Bs=Rs-Ns;if(Ds-Rs<=os&&(Ps=vs(cs.pos-As,_s))){let Ms=new Uint16Array(Ps.size-Ps.skip),Ws=cs.pos-Ps.size,Us=Ms.length;for(;cs.pos>Ws;)Us=xs(Ps.start,Ms,Us);ks=new TreeBuffer(Ms,Ds-Ps.start,ss),Bs=Ps.start-Ns}else{let Ms=cs.pos-Os;cs.next();let Ws=[],Us=[],js=$s>=us?$s:-1,Ls=0,Gs=Ds;for(;cs.pos>Ms;)js>=0&&cs.id==js&&cs.size>=0?(cs.end<=Gs-os&&(ys(Ws,Us,Rs,Ls,cs.end,Gs,js,Is),Ls=Ws.length,Gs=cs.end),cs.next()):hs(Rs,Ms,Ws,Us,js);if(js>=0&&Ls>0&&Ls-1&&Ls>0){let Hs=gs(Vs);ks=balanceRange(Vs,Ws,Us,0,Ws.length,0,Ds-Rs,Hs,Hs)}else ks=bs(Vs,Ws,Us,Ds-Rs,Is-Ds)}ws.push(ks),Es.push(Bs)}function gs(Ns){return(As,ws,Es)=>{let _s=0,$s=As.length-1,Rs,Ds;if($s>=0&&(Rs=As[$s])instanceof Tree){if(!$s&&Rs.type==Ns&&Rs.length==Es)return Rs;(Ds=Rs.prop(NodeProp.lookAhead))&&(_s=ws[$s]+Rs.length+Ds)}return bs(Ns,As,ws,Es,_s)}}function ys(Ns,As,ws,Es,_s,$s,Rs,Ds){let Os=[],Is=[];for(;Ns.length>Es;)Os.push(Ns.pop()),Is.push(As.pop()+ws-_s);Ns.push(bs(ss.types[Rs],Os,Is,$s-_s,Ds-$s)),As.push(_s-ws)}function bs(Ns,As,ws,Es,_s=0,$s){if(ps){let Rs=[NodeProp.contextHash,ps];$s=$s?[Rs].concat($s):[Rs]}if(_s>25){let Rs=[NodeProp.lookAhead,_s];$s=$s?[Rs].concat($s):[Rs]}return new Tree(Ns,As,ws,Es,$s)}function vs(Ns,As){let ws=cs.fork(),Es=0,_s=0,$s=0,Rs=ws.end-os,Ds={size:0,start:0,skip:0};e:for(let Os=ws.pos-Ns;ws.pos>Os;){let Is=ws.size;if(ws.id==As&&Is>=0){Ds.size=Es,Ds.start=_s,Ds.skip=$s,$s+=4,Es+=4,ws.next();continue}let Vs=ws.pos-Is;if(Is<0||Vs=us?4:0,Ps=ws.start;for(ws.next();ws.pos>Vs;){if(ws.size<0)if(ws.size==-3)ks+=4;else break e;else ws.id>=us&&(ks+=4);ws.next()}_s=Ps,Es+=Is,$s+=ks}return(As<0||Es==Ns)&&(Ds.size=Es,Ds.start=_s,Ds.skip=$s),Ds.size>4?Ds:void 0}function xs(Ns,As,ws){let{id:Es,start:_s,end:$s,size:Rs}=cs;if(cs.next(),Rs>=0&&Es4){let Os=cs.pos-(Rs-4);for(;cs.pos>Os;)ws=xs(Ns,As,ws)}As[--ws]=Ds,As[--ws]=$s-Ns,As[--ws]=_s-Ns,As[--ws]=Es}else Rs==-3?ps=Es:Rs==-4&&(fs=Es);return ws}let Cs=[],Ts=[];for(;cs.pos>0;)hs(as.start||0,as.bufferStart||0,Cs,Ts,-1);let Ss=(rs=as.length)!==null&&rs!==void 0?rs:Cs.length?Ts[0]+Cs[0].length:0;return new Tree(ds[as.topID],Cs.reverse(),Ts.reverse(),Ss)}const nodeSizeCache=new WeakMap;function nodeSize(as,rs){if(!as.isAnonymous||rs instanceof TreeBuffer||rs.type!=as)return 1;let ns=nodeSizeCache.get(rs);if(ns==null){ns=1;for(let ss of rs.children){if(ss.type!=as||!(ss instanceof Tree)){ns=1;break}ns+=nodeSize(as,ss)}nodeSizeCache.set(rs,ns)}return ns}function balanceRange(as,rs,ns,ss,os,ls,us,cs,ds){let ps=0;for(let bs=ss;bs=fs)break;ws+=Es}if(Ss==Ns+1){if(ws>fs){let Es=bs[Ns];ys(Es.children,Es.positions,0,Es.children.length,vs[Ns]+Ts);continue}hs.push(bs[Ns])}else{let Es=vs[Ss-1]+bs[Ss-1].length-As;hs.push(balanceRange(as,bs,vs,Ns,Ss,As,Es,null,ds))}gs.push(As+Ts-ls)}}return ys(rs,ns,ss,os,0),(cs||ds)(hs,gs,us)}class TreeFragment{constructor(rs,ns,ss,os,ls=!1,us=!1){this.from=rs,this.to=ns,this.tree=ss,this.offset=os,this.open=(ls?1:0)|(us?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(rs,ns=[],ss=!1){let os=[new TreeFragment(0,rs.length,rs,0,!1,ss)];for(let ls of ns)ls.to>rs.length&&os.push(ls);return os}static applyChanges(rs,ns,ss=128){if(!ns.length)return rs;let os=[],ls=1,us=rs.length?rs[0]:null;for(let cs=0,ds=0,ps=0;;cs++){let fs=cs=ss)for(;us&&us.from=gs.from||hs<=gs.to||ps){let ys=Math.max(gs.from,ds)-ps,bs=Math.min(gs.to,hs)-ps;gs=ys>=bs?null:new TreeFragment(ys,bs,gs.tree,gs.offset+ps,cs>0,!!fs)}if(gs&&os.push(gs),us.to>hs)break;us=lsnew Range(os.from,os.to)):[new Range(0,0)]:[new Range(0,rs.length)],this.createParse(rs,ns||[],ss)}parse(rs,ns,ss){let os=this.startParse(rs,ns,ss);for(;;){let ls=os.advance();if(ls)return ls}}};class StringInput{constructor(rs){this.string=rs}get length(){return this.string.length}chunk(rs){return this.string.slice(rs)}get lineChunks(){return!1}read(rs,ns){return this.string.slice(rs,ns)}}new NodeProp({perNode:!0});let Stack$1=class mp{constructor(rs,ns,ss,os,ls,us,cs,ds,ps,fs=0,hs){this.p=rs,this.stack=ns,this.state=ss,this.reducePos=os,this.pos=ls,this.score=us,this.buffer=cs,this.bufferBase=ds,this.curContext=ps,this.lookAhead=fs,this.parent=hs}toString(){return`[${this.stack.filter((rs,ns)=>ns%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(rs,ns,ss=0){let os=rs.parser.context;return new mp(rs,[],ns,ss,ss,0,[],0,os?new StackContext(os,os.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(rs,ns){this.stack.push(this.state,ns,this.bufferBase+this.buffer.length),this.state=rs}reduce(rs){let ns=rs>>19,ss=rs&65535,{parser:os}=this.p,ls=os.dynamicPrecedence(ss);if(ls&&(this.score+=ls),ns==0){this.pushState(os.getGoto(this.state,ss,!0),this.reducePos),ssus;)this.stack.pop();this.reduceContext(ss,cs)}storeNode(rs,ns,ss,os=4,ls=!1){if(rs==0){let us=this,cs=this.buffer.length;if(cs==0&&us.parent&&(cs=us.bufferBase-us.parent.bufferBase,us=us.parent),cs>0&&us.buffer[cs-4]==0&&us.buffer[cs-1]>-1){if(ns==ss)return;if(us.buffer[cs-2]>=ns){us.buffer[cs-2]=ss;return}}}if(!ls||this.pos==ss)this.buffer.push(rs,ns,ss,os);else{let us=this.buffer.length;if(us>0&&this.buffer[us-4]!=0)for(;us>0&&this.buffer[us-2]>ss;)this.buffer[us]=this.buffer[us-4],this.buffer[us+1]=this.buffer[us-3],this.buffer[us+2]=this.buffer[us-2],this.buffer[us+3]=this.buffer[us-1],us-=4,os>4&&(os-=4);this.buffer[us]=rs,this.buffer[us+1]=ns,this.buffer[us+2]=ss,this.buffer[us+3]=os}}shift(rs,ns,ss){let os=this.pos;if(rs&131072)this.pushState(rs&65535,this.pos);else if(rs&262144)this.pos=ss,this.shiftContext(ns,os),ns<=this.p.parser.maxNode&&this.buffer.push(ns,os,ss,4);else{let ls=rs,{parser:us}=this.p;(ss>this.pos||ns<=us.maxNode)&&(this.pos=ss,us.stateFlag(ls,1)||(this.reducePos=ss)),this.pushState(ls,os),this.shiftContext(ns,os),ns<=us.maxNode&&this.buffer.push(ns,os,ss,4)}}apply(rs,ns,ss){rs&65536?this.reduce(rs):this.shift(rs,ns,ss)}useNode(rs,ns){let ss=this.p.reused.length-1;(ss<0||this.p.reused[ss]!=rs)&&(this.p.reused.push(rs),ss++);let os=this.pos;this.reducePos=this.pos=os+rs.length,this.pushState(ns,os),this.buffer.push(ss,os,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,rs,this,this.p.stream.reset(this.pos-rs.length)))}split(){let rs=this,ns=rs.buffer.length;for(;ns>0&&rs.buffer[ns-2]>rs.reducePos;)ns-=4;let ss=rs.buffer.slice(ns),os=rs.bufferBase+ns;for(;rs&&os==rs.bufferBase;)rs=rs.parent;return new mp(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,ss,os,this.curContext,this.lookAhead,rs)}recoverByDelete(rs,ns){let ss=rs<=this.p.parser.maxNode;ss&&this.storeNode(rs,this.pos,ns,4),this.storeNode(0,this.pos,ns,ss?8:4),this.pos=this.reducePos=ns,this.score-=190}canShift(rs){for(let ns=new SimulatedStack(this);;){let ss=this.p.parser.stateSlot(ns.state,4)||this.p.parser.hasAction(ns.state,rs);if(!(ss&65536))return!0;if(ss==0)return!1;ns.reduce(ss)}}recoverByInsert(rs){if(this.stack.length>=300)return[];let ns=this.p.parser.nextStates(this.state);if(ns.length>4<<1||this.stack.length>=120){let os=[];for(let ls=0,us;lsds&1&&cs==us)||os.push(ns[ls],us)}ns=os}let ss=[];for(let os=0;os>19,os=rs&65535,ls=this.stack.length-ss*3;if(ls<0||ns.getGoto(this.stack[ls],os,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reduce(rs),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:rs}=this.p;return rs.data[rs.stateSlot(this.state,1)]==65535&&!rs.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(rs){if(this.state!=rs.state||this.stack.length!=rs.stack.length)return!1;for(let ns=0;nsthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=rs)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};class StackContext{constructor(rs,ns){this.tracker=rs,this.context=ns,this.hash=rs.strict?rs.hash(ns):0}}var Recover;(function(as){as[as.Insert=200]="Insert",as[as.Delete=190]="Delete",as[as.Reduce=100]="Reduce",as[as.MaxNext=4]="MaxNext",as[as.MaxInsertStackDepth=300]="MaxInsertStackDepth",as[as.DampenInsertStackDepth=120]="DampenInsertStackDepth"})(Recover||(Recover={}));class SimulatedStack{constructor(rs){this.start=rs,this.state=rs.state,this.stack=rs.stack,this.base=this.stack.length}reduce(rs){let ns=rs&65535,ss=rs>>19;ss==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(ss-1)*3;let os=this.start.p.parser.getGoto(this.stack[this.base-3],ns,!0);this.state=os}}class StackBufferCursor{constructor(rs,ns,ss){this.stack=rs,this.pos=ns,this.index=ss,this.buffer=rs.buffer,this.index==0&&this.maybeNext()}static create(rs,ns=rs.bufferBase+rs.buffer.length){return new StackBufferCursor(rs,ns,ns-rs.bufferBase)}maybeNext(){let rs=this.stack.parent;rs!=null&&(this.index=this.stack.bufferBase-rs.bufferBase,this.stack=rs,this.buffer=rs.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new StackBufferCursor(this.stack,this.pos,this.index)}}class CachedToken{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const nullToken=new CachedToken;class InputStream{constructor(rs,ns){this.input=rs,this.ranges=ns,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=nullToken,this.rangeIndex=0,this.pos=this.chunkPos=ns[0].from,this.range=ns[0],this.end=ns[ns.length-1].to,this.readNext()}resolveOffset(rs,ns){let ss=this.range,os=this.rangeIndex,ls=this.pos+rs;for(;lsss.to:ls>=ss.to;){if(os==this.ranges.length-1)return null;let us=this.ranges[++os];ls+=us.from-ss.to,ss=us}return ls}peek(rs){let ns=this.chunkOff+rs,ss,os;if(ns>=0&&ns=this.chunk2Pos&&sscs.to&&(this.chunk2=this.chunk2.slice(0,cs.to-ss)),os=this.chunk2.charCodeAt(0)}}return ss>=this.token.lookAhead&&(this.token.lookAhead=ss+1),os}acceptToken(rs,ns=0){let ss=ns?this.resolveOffset(ns,-1):this.pos;if(ss==null||ss=this.chunk2Pos&&this.posthis.range.to?rs.slice(0,this.range.to-this.pos):rs,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(rs=1){for(this.chunkOff+=rs;this.pos+rs>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();rs-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=rs,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(rs,ns){if(ns?(this.token=ns,ns.start=rs,ns.lookAhead=rs+1,ns.value=ns.extended=-1):this.token=nullToken,this.pos!=rs){if(this.pos=rs,rs==this.end)return this.setDone(),this;for(;rs=this.range.to;)this.range=this.ranges[++this.rangeIndex];rs>=this.chunkPos&&rs=this.chunkPos&&ns<=this.chunkPos+this.chunk.length)return this.chunk.slice(rs-this.chunkPos,ns-this.chunkPos);if(rs>=this.chunk2Pos&&ns<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(rs-this.chunk2Pos,ns-this.chunk2Pos);if(rs>=this.range.from&&ns<=this.range.to)return this.input.read(rs,ns);let ss="";for(let os of this.ranges){if(os.from>=ns)break;os.to>rs&&(ss+=this.input.read(Math.max(os.from,rs),Math.min(os.to,ns)))}return ss}}class TokenGroup{constructor(rs,ns){this.data=rs,this.id=ns}token(rs,ns){readToken(this.data,rs,ns,this.id)}}TokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;class ExternalTokenizer{constructor(rs,ns={}){this.token=rs,this.contextual=!!ns.contextual,this.fallback=!!ns.fallback,this.extend=!!ns.extend}}function readToken(as,rs,ns,ss){let os=0,ls=1<0){let fs=as[ps];if(cs.allows(fs)&&(rs.token.value==-1||rs.token.value==fs||us.overrides(fs,rs.token.value))){rs.acceptToken(fs);break}}for(let ps=rs.next,fs=0,hs=as[os+2];fs>1,ys=ds+gs+(gs<<1),bs=as[ys],vs=as[ys+1];if(ps=vs)fs=gs+1;else{os=as[ys+2],rs.advance();continue e}}break}}function decodeArray(as,rs=Uint16Array){if(typeof as!="string")return as;let ns=null;for(let ss=0,os=0;ss=92&&us--,us>=34&&us--;let ds=us-32;if(ds>=46&&(ds-=46,cs=!0),ls+=ds,cs)break;ls*=46}ns?ns[os++]=ls:ns=new rs(ls)}return ns}const verbose=typeof browser$1$2<"u"&&/\bparse\b/.test({}.LOG);let stackIDs=null;var Safety;(function(as){as[as.Margin=25]="Margin"})(Safety||(Safety={}));function cutAt(as,rs,ns){let ss=as.fullCursor();for(ss.moveTo(rs);;)if(!(ns<0?ss.childBefore(rs):ss.childAfter(rs)))for(;;){if((ns<0?ss.tors)&&!ss.type.isError)return ns<0?Math.max(0,Math.min(ss.to-1,rs-25)):Math.min(as.length,Math.max(ss.from+1,rs+25));if(ns<0?ss.prevSibling():ss.nextSibling())break;if(!ss.parent())return ns<0?0:as.length}}class FragmentCursor{constructor(rs,ns){this.fragments=rs,this.nodeSet=ns,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let rs=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(rs){for(this.safeFrom=rs.openStart?cutAt(rs.tree,rs.from+rs.offset,1)-rs.offset:rs.from,this.safeTo=rs.openEnd?cutAt(rs.tree,rs.to+rs.offset,-1)-rs.offset:rs.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(rs.tree),this.start.push(-rs.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(rs){if(rsrs)return this.nextStart=us,null;if(ls instanceof Tree){if(us==rs){if(us=Math.max(this.safeFrom,rs)&&(this.trees.push(ls),this.start.push(us),this.index.push(0))}else this.index[ns]++,this.nextStart=us+ls.length}}}class TokenCache{constructor(rs,ns){this.stream=ns,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=rs.tokenizers.map(ss=>new CachedToken)}getActions(rs){let ns=0,ss=null,{parser:os}=rs.p,{tokenizers:ls}=os,us=os.stateSlot(rs.state,3),cs=rs.curContext?rs.curContext.hash:0,ds=0;for(let ps=0;pshs.end+25&&(ds=Math.max(hs.lookAhead,ds)),hs.value!=0)){let gs=ns;if(hs.extended>-1&&(ns=this.addActions(rs,hs.extended,hs.end,ns)),ns=this.addActions(rs,hs.value,hs.end,ns),!fs.extend&&(ss=hs,ns>gs))break}}for(;this.actions.length>ns;)this.actions.pop();return ds&&rs.setLookAhead(ds),!ss&&rs.pos==this.stream.end&&(ss=new CachedToken,ss.value=rs.p.parser.eofTerm,ss.start=ss.end=rs.pos,ns=this.addActions(rs,ss.value,ss.end,ns)),this.mainToken=ss,this.actions}getMainToken(rs){if(this.mainToken)return this.mainToken;let ns=new CachedToken,{pos:ss,p:os}=rs;return ns.start=ss,ns.end=Math.min(ss+1,os.stream.end),ns.value=ss==os.stream.end?os.parser.eofTerm:0,ns}updateCachedToken(rs,ns,ss){if(ns.token(this.stream.reset(ss.pos,rs),ss),rs.value>-1){let{parser:os}=ss.p;for(let ls=0;ls=0&&ss.p.parser.dialect.allows(us>>1)){us&1?rs.extended=us>>1:rs.value=us>>1;break}}}else rs.value=0,rs.end=Math.min(ss.p.stream.end,ss.pos+1)}putAction(rs,ns,ss,os){for(let ls=0;lsrs.bufferLength*4?new FragmentCursor(ss,rs.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let rs=this.stacks,ns=this.minStackPos,ss=this.stacks=[],os,ls;for(let us=0;usns)ss.push(cs);else{if(this.advanceStack(cs,ss,rs))continue;{os||(os=[],ls=[]),os.push(cs);let ds=this.tokens.getMainToken(cs);ls.push(ds.value,ds.end)}}break}}if(!ss.length){let us=os&&findFinished(os);if(us)return this.stackToTree(us);if(this.parser.strict)throw verbose&&os&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+ns);this.recovering||(this.recovering=5)}if(this.recovering&&os){let us=this.stoppedAt!=null&&os[0].pos>this.stoppedAt?os[0]:this.runRecovery(os,ls,ss);if(us)return this.stackToTree(us.forceAll())}if(this.recovering){let us=this.recovering==1?1:this.recovering*3;if(ss.length>us)for(ss.sort((cs,ds)=>ds.score-cs.score);ss.length>us;)ss.pop();ss.some(cs=>cs.reducePos>ns)&&this.recovering--}else if(ss.length>1)e:for(let us=0;us500&&ps.buffer.length>500)if((cs.score-ps.score||cs.buffer.length-ps.buffer.length)>0)ss.splice(ds--,1);else{ss.splice(us--,1);continue e}}}this.minStackPos=ss[0].pos;for(let us=1;us ":"";if(this.stoppedAt!=null&&os>this.stoppedAt)return rs.forceReduce()?rs:null;if(this.fragments){let ps=rs.curContext&&rs.curContext.tracker.strict,fs=ps?rs.curContext.hash:0;for(let hs=this.fragments.nodeAt(os);hs;){let gs=this.parser.nodeSet.types[hs.type.id]==hs.type?ls.getGoto(rs.state,hs.type.id):-1;if(gs>-1&&hs.length&&(!ps||(hs.prop(NodeProp.contextHash)||0)==fs))return rs.useNode(hs,gs),verbose&&console.log(us+this.stackID(rs)+` (via reuse of ${ls.getName(hs.type.id)})`),!0;if(!(hs instanceof Tree)||hs.children.length==0||hs.positions[0]>0)break;let ys=hs.children[0];if(ys instanceof Tree&&hs.positions[0]==0)hs=ys;else break}}let cs=ls.stateSlot(rs.state,4);if(cs>0)return rs.reduce(cs),verbose&&console.log(us+this.stackID(rs)+` (via always-reduce ${ls.getName(cs&65535)})`),!0;if(rs.stack.length>=15e3)for(;rs.stack.length>9e3&&rs.forceReduce(););let ds=this.tokens.getActions(rs);for(let ps=0;psos?ns.push(bs):ss.push(bs)}return!1}advanceFully(rs,ns){let ss=rs.pos;for(;;){if(!this.advanceStack(rs,null,null))return!1;if(rs.pos>ss)return pushStackDedup(rs,ns),!0}}runRecovery(rs,ns,ss){let os=null,ls=!1;for(let us=0;us ":"";if(cs.deadEnd&&(ls||(ls=!0,cs.restart(),verbose&&console.log(fs+this.stackID(cs)+" (restarted)"),this.advanceFully(cs,ss))))continue;let hs=cs.split(),gs=fs;for(let ys=0;hs.forceReduce()&&ys<10&&(verbose&&console.log(gs+this.stackID(hs)+" (via force-reduce)"),!this.advanceFully(hs,ss));ys++)verbose&&(gs=this.stackID(hs)+" -> ");for(let ys of cs.recoverByInsert(ds))verbose&&console.log(fs+this.stackID(ys)+" (via recover-insert)"),this.advanceFully(ys,ss);this.stream.end>cs.pos?(ps==cs.pos&&(ps++,ds=0),cs.recoverByDelete(ds,ps),verbose&&console.log(fs+this.stackID(cs)+` (via recover-delete ${this.parser.getName(ds)})`),pushStackDedup(cs,ss)):(!os||os.scoreas;class ContextTracker{constructor(rs){this.start=rs.start,this.shift=rs.shift||id,this.reduce=rs.reduce||id,this.reuse=rs.reuse||id,this.hash=rs.hash||(()=>0),this.strict=rs.strict!==!1}}class LRParser extends Parser$1{constructor(rs){if(super(),this.wrappers=[],rs.version!=13)throw new RangeError(`Parser version (${rs.version}) doesn't match runtime version (13)`);let ns=rs.nodeNames.split(" ");this.minRepeatTerm=ns.length;for(let cs=0;csrs.topRules[cs][1]),os=[];for(let cs=0;cs=0)ls(fs,ds,cs[ps++]);else{let hs=cs[ps+-fs];for(let gs=-fs;gs>0;gs--)ls(cs[ps++],ds,hs);ps++}}}this.nodeSet=new NodeSet(ns.map((cs,ds)=>NodeType.define({name:ds>=this.minRepeatTerm?void 0:cs,id:ds,props:os[ds],top:ss.indexOf(ds)>-1,error:ds==0,skipped:rs.skippedNodes&&rs.skippedNodes.indexOf(ds)>-1}))),this.strict=!1,this.bufferLength=DefaultBufferLength;let us=decodeArray(rs.tokenData);if(this.context=rs.context,this.specialized=new Uint16Array(rs.specialized?rs.specialized.length:0),this.specializers=[],rs.specialized)for(let cs=0;cstypeof cs=="number"?new TokenGroup(us,cs):cs),this.topRules=rs.topRules,this.dialects=rs.dialects||{},this.dynamicPrecedences=rs.dynamicPrecedences||null,this.tokenPrecTable=rs.tokenPrec,this.termNames=rs.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(rs,ns,ss){let os=new Parse(this,rs,ns,ss);for(let ls of this.wrappers)os=ls(os,rs,ns,ss);return os}getGoto(rs,ns,ss=!1){let os=this.goto;if(ns>=os[0])return-1;for(let ls=os[ns+1];;){let us=os[ls++],cs=us&1,ds=os[ls++];if(cs&&ss)return ds;for(let ps=ls+(us>>1);ls0}validAction(rs,ns){if(ns==this.stateSlot(rs,4))return!0;for(let ss=this.stateSlot(rs,1);;ss+=3){if(this.data[ss]==65535)if(this.data[ss+1]==1)ss=pair(this.data,ss+2);else return!1;if(ns==pair(this.data,ss+1))return!0}}nextStates(rs){let ns=[];for(let ss=this.stateSlot(rs,1);;ss+=3){if(this.data[ss]==65535)if(this.data[ss+1]==1)ss=pair(this.data,ss+2);else break;if(!(this.data[ss+2]&1)){let os=this.data[ss+1];ns.some((ls,us)=>us&1&&ls==os)||ns.push(this.data[ss],os)}}return ns}overrides(rs,ns){let ss=findOffset(this.data,this.tokenPrecTable,ns);return ss<0||findOffset(this.data,this.tokenPrecTable,rs){let os=rs.tokenizers.find(ls=>ls.from==ss);return os?os.to:ss})),rs.contextTracker&&(ns.context=rs.contextTracker),rs.dialect&&(ns.dialect=this.parseDialect(rs.dialect)),rs.strict!=null&&(ns.strict=rs.strict),rs.wrap&&(ns.wrappers=ns.wrappers.concat(rs.wrap)),rs.bufferLength!=null&&(ns.bufferLength=rs.bufferLength),ns}getName(rs){return this.termNames?this.termNames[rs]:String(rs<=this.maxNode&&this.nodeSet.types[rs].name||rs)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(rs){let ns=this.dynamicPrecedences;return ns==null?0:ns[rs]||0}parseDialect(rs){let ns=Object.keys(this.dialects),ss=ns.map(()=>!1);if(rs)for(let ls of rs.split(" ")){let us=ns.indexOf(ls);us>=0&&(ss[us]=!0)}let os=null;for(let ls=0;lsss)&&ns.p.parser.stateFlag(ns.state,2)&&(!rs||rs.score=65&&as<=90||as==95||as>=97&&as<=122||as>=161}function isSpace(as){return as==9||as==10||as==13||as==32}let cachedName=null,cachedInput=null,cachedPos=0;function tagNameAfter(as,rs){let ns=as.pos+rs;if(cachedInput==as&&cachedPos==ns)return cachedName;for(;isSpace(as.peek(rs));)rs++;let ss="";for(;;){let os=as.peek(rs);if(!nameChar(os))break;ss+=String.fromCharCode(os),rs++}return cachedInput=as,cachedPos=ns,cachedName=ss||null}function ElementContext(as,rs){this.name=as,this.parent=rs,this.hash=rs?rs.hash:0;for(let ns=0;ns{if(as.next==60){if(as.advance(),as.next==47){as.advance();let ns=tagNameAfter(as,0);if(!ns)return as.acceptToken(incompleteStartCloseTag);if(rs.context&&ns.toLowerCase()==rs.context.name.toLowerCase())return as.acceptToken(StartCloseTag);for(let ss=rs.context;ss;ss=ss.parent)if(ss.name==ns)return as.acceptToken(MissingCloseTag,-2);as.acceptToken(mismatchedStartCloseTag)}else if(as.next!=33&&as.next!=63&&!isSpace(as.next))return as.acceptToken(StartTag)}},{contextual:!0});function scanTo(as,rs){return new ExternalTokenizer(ns=>{for(let ss=0,os=0;;os++){if(ns.next<0){os&&ns.acceptToken(as);break}if(ns.next==rs.charCodeAt(ss)){if(ss++,ss==rs.length){os>rs.length&&ns.acceptToken(as,1-rs.length);break}}else ss=0;ns.advance()}})}const commentContent=scanTo(commentContent$1,"-->"),parser=LRParser.deserialize({version:13,states:"*[OQOTOOO]OYO'#CdOeO`O'#CfO!OOTO'#CeOOOP'#Ce'#CeOOOP'#Cx'#CxOOOP'#Co'#CoQQOTOOOOOQ'#Cp'#CpO!VOYO,59OOOOP,59O,59OO!_OpO,59QO!mO`O'#ClOOOP'#DT'#DTOOOP'#Cu'#CuO!rOTO,59PO!yO`O'#CmOOOP,59P,59POOOP-E6m-E6mOOOQ-E6n-E6nOOOP1G.j1G.jOOOO'#Cq'#CqO#ROpO1G.lO#aOpO'#ChOOOO'#Cr'#CrO#rOpO1G.lOOOP1G.l1G.lOOOP1G.t1G.tO#}OWO,59WOOOP-E6s-E6sOOOP1G.k1G.kO$SO`O,59XO$[OWO,59XOOOO-E6o-E6oO$dOpO7+$WOOOP7+$W7+$WOOOP7+$`7+$`O$oOpO,59SO%QOWO,59SOOOO-E6p-E6pOOOP1G.r1G.rO%]OWO1G.sO%]OWO1G.sOOOP1G.s1G.sOOOP< tag. Found ${as.slice(ds-1,bs)}`)}us.firstChild();let gs=as.substring(us.from,us.to);if(us.nextSibling()===!1){if(gs in ps)throw Error(`Duplicate attribute ${gs}. Found in component of type ${cs} at indices ${us.from}-${us.to}`);ps[gs]=!0}else{us.nextSibling();let ys=as.substring(us.from+1,us.to-1);if(gs in ps)throw Error(`Duplicate attribute ${gs}. Found in component of type ${cs} at indices ${us.from}-${us.to}`);ps[gs]=ys}us.parent()}us.parent();let fs=us.to,hs={componentType:cs,props:{...ps},children:[]};for(;us.nextSibling();)if(us.name==="Text"){let gs=as.substring(us.from,us.to);gs!==""&&hs.children.push(gs)}else if(us.name==="Element")hs.children.push(rs(us.node.cursor));else{if(us.name==="CloseTag")break;if(us.name==="Comment")continue;throw us.name==="MismatchedCloseTag"?Error(`Invalid DoenetML at position ${us.from}. Mismatched closing tag. Expected . Found ${as.slice(us.from,us.to)}.`):Error(`Invalid DoenetML at position ${us.from}. Expected a closing tag. Instead found ${as.slice(us.from,us.to)}.`)}return hs.range={openBegin:ds,openEnd:fs,closeBegin:us.from,closeEnd:us.to},hs}else if(us.name==="SelfClosingTag"){us.firstChild(),us.nextSibling();let cs=as.substring(us.from,us.to),ds=us.from,ps={};for(;us.nextSibling();){if(us.name!=="Attribute")throw Error(`Invalid DoenetML at positions ${us.from} to ${us.to}. Error in self-closing <${cs}/> tag.`);us.firstChild();let hs=as.substring(us.from,us.to);if(us.nextSibling()===!1){if(hs in ps)throw Error(`Duplicate attribute ${hs}. Found in component of type ${cs} at indices ${us.from}-${us.to}`);ps[hs]=!0}else{if(us.nextSibling(),hs in ps)throw Error(`Duplicate attribute ${hs}. Found in component of type ${cs} at indices ${us.from}-${us.to}`);let gs=as.substring(us.from+1,us.to-1);ps[hs]=gs}us.parent()}let fs={selfCloseBegin:ds,selfCloseEnd:us.to+3};return{componentType:cs,props:{...ps},children:[],range:fs}}else throw Error("Non SelfClosingTag/OpenTag in Element. How did you do that?")}function ns(us){if(us.node.name==="Element")return rs(us.node.cursor);if(us.node.name==="Comment")return null;if(us.node.name==="Text"){let cs=as.substring(us.node.from,us.node.to);if(cs!=="")return cs}else throw Error(`Invalid DoenetML at positions ${us.node.from} to ${us.node.to}. Found ${as.substring(us.node.from,us.node.to)}`)}if(!as)return[];let ss=parse(as),os=[];if(!ss.firstChild())return os;let ls=ns(ss);for(ls!=null&&os.push(ls);ss.nextSibling();){let us=ns(ss);us!=null&&os.push(us)}return os}var base32Exports={},base32$1={get exports(){return base32Exports},set exports(as){base32Exports=as}};(function(as){(function(){var rs=typeof window=="object"?window:{},ns=!rs.HI_BASE32_NO_NODE_JS&&typeof browser$1$2=="object"&&browser$1$2.versions&&browser$1$2.versions.node;ns&&(rs=commonjsGlobal$1);var ss=!rs.HI_BASE32_NO_COMMON_JS&&!0&&as.exports,os="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),ls={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},us=[0,0,0,0,0,0,0,0],cs=function(xs,Cs){Cs.length>10&&(Cs="..."+Cs.substr(-10));var Ts=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+xs+" bytes: "+Cs+" <-");throw Ts.position=xs,Ts},ds=function(xs){for(var Cs="",Ts=xs.length,Ss=0,Ns=0,As,ws;Ss191&&As<=223?(ws=As&31,Ns=1):As<=239?(ws=As&15,Ns=2):As<=247?(ws=As&7,Ns=3):cs(Ss,Cs);for(var Es=0;Es191)&&cs(Ss,Cs),ws<<=6,ws+=As&63;ws>=55296&&ws<=57343&&cs(Ss,Cs),ws>1114111&&cs(Ss,Cs),ws<=65535?Cs+=String.fromCharCode(ws):(ws-=65536,Cs+=String.fromCharCode((ws>>10)+55296),Cs+=String.fromCharCode((ws&1023)+56320))}return Cs},ps=function(xs){if(xs==="")return[];if(!/^[A-Z2-7=]+$/.test(xs))throw new Error("Invalid base32 characters");xs=xs.replace(/=/g,"");for(var Cs,Ts,Ss,Ns,As,ws,Es,_s,$s=[],Rs=0,Ds=xs.length,Os=0,Is=Ds>>3<<3;Os>>2)&255,$s[Rs++]=(Ts<<6|Ss<<1|Ns>>>4)&255,$s[Rs++]=(Ns<<4|As>>>1)&255,$s[Rs++]=(As<<7|ws<<2|Es>>>3)&255,$s[Rs++]=(Es<<5|_s)&255;var Vs=Ds-Is;return Vs===2?(Cs=ls[xs.charAt(Os++)],Ts=ls[xs.charAt(Os++)],$s[Rs++]=(Cs<<3|Ts>>>2)&255):Vs===4?(Cs=ls[xs.charAt(Os++)],Ts=ls[xs.charAt(Os++)],Ss=ls[xs.charAt(Os++)],Ns=ls[xs.charAt(Os++)],$s[Rs++]=(Cs<<3|Ts>>>2)&255,$s[Rs++]=(Ts<<6|Ss<<1|Ns>>>4)&255):Vs===5?(Cs=ls[xs.charAt(Os++)],Ts=ls[xs.charAt(Os++)],Ss=ls[xs.charAt(Os++)],Ns=ls[xs.charAt(Os++)],As=ls[xs.charAt(Os++)],$s[Rs++]=(Cs<<3|Ts>>>2)&255,$s[Rs++]=(Ts<<6|Ss<<1|Ns>>>4)&255,$s[Rs++]=(Ns<<4|As>>>1)&255):Vs===7&&(Cs=ls[xs.charAt(Os++)],Ts=ls[xs.charAt(Os++)],Ss=ls[xs.charAt(Os++)],Ns=ls[xs.charAt(Os++)],As=ls[xs.charAt(Os++)],ws=ls[xs.charAt(Os++)],Es=ls[xs.charAt(Os++)],$s[Rs++]=(Cs<<3|Ts>>>2)&255,$s[Rs++]=(Ts<<6|Ss<<1|Ns>>>4)&255,$s[Rs++]=(Ns<<4|As>>>1)&255,$s[Rs++]=(As<<7|ws<<2|Es>>>3)&255),$s},fs=function(xs){for(var Cs,Ts,Ss,Ns,As,ws="",Es=xs.length,_s=0,$s=parseInt(Es/5)*5;_s<$s;)Cs=xs.charCodeAt(_s++),Ts=xs.charCodeAt(_s++),Ss=xs.charCodeAt(_s++),Ns=xs.charCodeAt(_s++),As=xs.charCodeAt(_s++),ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[(Ss<<1|Ns>>>7)&31]+os[Ns>>>2&31]+os[(Ns<<3|As>>>5)&31]+os[As&31];var Rs=Es-$s;return Rs===1?(Cs=xs.charCodeAt(_s),ws+=os[Cs>>>3]+os[Cs<<2&31]+"======"):Rs===2?(Cs=xs.charCodeAt(_s++),Ts=xs.charCodeAt(_s),ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[Ts<<4&31]+"===="):Rs===3?(Cs=xs.charCodeAt(_s++),Ts=xs.charCodeAt(_s++),Ss=xs.charCodeAt(_s),ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[Ss<<1&31]+"==="):Rs===4&&(Cs=xs.charCodeAt(_s++),Ts=xs.charCodeAt(_s++),Ss=xs.charCodeAt(_s++),Ns=xs.charCodeAt(_s),ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[(Ss<<1|Ns>>>7)&31]+os[Ns>>>2&31]+os[Ns<<3&31]+"="),ws},hs=function(xs){var Cs,Ts,Ss,Ns,As,ws,Es=!1,_s="",$s=0,Rs,Ds=0,Os=xs.length;if(xs==="")return _s;do{for(us[0]=us[5],us[1]=us[6],us[2]=us[7],Rs=Ds;$s>6,us[Rs++]=128|ws&63):ws<55296||ws>=57344?(us[Rs++]=224|ws>>12,us[Rs++]=128|ws>>6&63,us[Rs++]=128|ws&63):(ws=65536+((ws&1023)<<10|xs.charCodeAt(++$s)&1023),us[Rs++]=240|ws>>18,us[Rs++]=128|ws>>12&63,us[Rs++]=128|ws>>6&63,us[Rs++]=128|ws&63);Ds=Rs-5,$s===Os&&++$s,$s>Os&&Rs<6&&(Es=!0),Cs=us[0],Rs>4?(Ts=us[1],Ss=us[2],Ns=us[3],As=us[4],_s+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[(Ss<<1|Ns>>>7)&31]+os[Ns>>>2&31]+os[(Ns<<3|As>>>5)&31]+os[As&31]):Rs===1?_s+=os[Cs>>>3]+os[Cs<<2&31]+"======":Rs===2?(Ts=us[1],_s+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[Ts<<4&31]+"===="):Rs===3?(Ts=us[1],Ss=us[2],_s+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[Ss<<1&31]+"==="):(Ts=us[1],Ss=us[2],Ns=us[3],_s+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[(Ss<<1|Ns>>>7)&31]+os[Ns>>>2&31]+os[Ns<<3&31]+"=")}while(!Es);return _s},gs=function(xs){for(var Cs,Ts,Ss,Ns,As,ws="",Es=xs.length,_s=0,$s=parseInt(Es/5)*5;_s<$s;)Cs=xs[_s++],Ts=xs[_s++],Ss=xs[_s++],Ns=xs[_s++],As=xs[_s++],ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[(Ss<<1|Ns>>>7)&31]+os[Ns>>>2&31]+os[(Ns<<3|As>>>5)&31]+os[As&31];var Rs=Es-$s;return Rs===1?(Cs=xs[_s],ws+=os[Cs>>>3]+os[Cs<<2&31]+"======"):Rs===2?(Cs=xs[_s++],Ts=xs[_s],ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[Ts<<4&31]+"===="):Rs===3?(Cs=xs[_s++],Ts=xs[_s++],Ss=xs[_s],ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[Ss<<1&31]+"==="):Rs===4&&(Cs=xs[_s++],Ts=xs[_s++],Ss=xs[_s++],Ns=xs[_s],ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[(Ss<<1|Ns>>>7)&31]+os[Ns>>>2&31]+os[Ns<<3&31]+"="),ws},ys=function(xs,Cs){var Ts=typeof xs!="string";return Ts&&xs.constructor===ArrayBuffer&&(xs=new Uint8Array(xs)),Ts?gs(xs):Cs?fs(xs):hs(xs)},bs=function(xs,Cs){if(!Cs)return ds(ps(xs));if(xs==="")return"";if(!/^[A-Z2-7=]+$/.test(xs))throw new Error("Invalid base32 characters");var Ts,Ss,Ns,As,ws,Es,_s,$s,Rs="",Ds=xs.indexOf("=");Ds===-1&&(Ds=xs.length);for(var Os=0,Is=Ds>>3<<3;Os>>2)&255)+String.fromCharCode((Ss<<6|Ns<<1|As>>>4)&255)+String.fromCharCode((As<<4|ws>>>1)&255)+String.fromCharCode((ws<<7|Es<<2|_s>>>3)&255)+String.fromCharCode((_s<<5|$s)&255);var Vs=Ds-Is;return Vs===2?(Ts=ls[xs.charAt(Os++)],Ss=ls[xs.charAt(Os++)],Rs+=String.fromCharCode((Ts<<3|Ss>>>2)&255)):Vs===4?(Ts=ls[xs.charAt(Os++)],Ss=ls[xs.charAt(Os++)],Ns=ls[xs.charAt(Os++)],As=ls[xs.charAt(Os++)],Rs+=String.fromCharCode((Ts<<3|Ss>>>2)&255)+String.fromCharCode((Ss<<6|Ns<<1|As>>>4)&255)):Vs===5?(Ts=ls[xs.charAt(Os++)],Ss=ls[xs.charAt(Os++)],Ns=ls[xs.charAt(Os++)],As=ls[xs.charAt(Os++)],ws=ls[xs.charAt(Os++)],Rs+=String.fromCharCode((Ts<<3|Ss>>>2)&255)+String.fromCharCode((Ss<<6|Ns<<1|As>>>4)&255)+String.fromCharCode((As<<4|ws>>>1)&255)):Vs===7&&(Ts=ls[xs.charAt(Os++)],Ss=ls[xs.charAt(Os++)],Ns=ls[xs.charAt(Os++)],As=ls[xs.charAt(Os++)],ws=ls[xs.charAt(Os++)],Es=ls[xs.charAt(Os++)],_s=ls[xs.charAt(Os++)],Rs+=String.fromCharCode((Ts<<3|Ss>>>2)&255)+String.fromCharCode((Ss<<6|Ns<<1|As>>>4)&255)+String.fromCharCode((As<<4|ws>>>1)&255)+String.fromCharCode((ws<<7|Es<<2|_s>>>3)&255)),Rs},vs={encode:ys,decode:bs};bs.asBytes=ps,ss?as.exports=vs:rs.base32=vs})()})(base32$1);const base32=base32Exports;async function cidFromText(as){let ns=new TextEncoder().encode(as);return await cidFromArrayBuffer(ns)}async function cidFromArrayBuffer(as){let rs=await crypto.subtle.digest("SHA-256",as),ns=new Uint8Array(36);return ns.set([1,85,18,32]),ns.set(new Uint8Array(rs),4),"b"+base32.encode(ns).toLowerCase().replace(/=+/,"")}const textByCid={};function retrieveTextFileForCid(as,rs="doenet"){return textByCid[as]!==void 0?Promise.resolve(textByCid[as]):new Promise((ns,ss)=>{let os=retrieveTextFileFromIPFS(as),ls=os.promise,us=os.controller,cs,ds=!1,ps=!1,fs;ls.then(hs=>{clearTimeout(fs),cs&&!ps&&cs.abort(),textByCid[as]=hs,ns(hs)}).catch(hs=>{ds=!0,ps&&(clearTimeout(fs),ss(hs))}),fs=setTimeout(()=>{let hs=retrieveTextFileFromServer(as,rs),gs=hs.promise;cs=hs.controller,gs.then(ys=>{ds||us.abort(),textByCid[as]=ys,ns(ys)}).catch(ys=>{ps=!0,ds?ss(ys):fs=setTimeout(()=>{us.abort(),ss(ys)},5e3)})},100)})}function retrieveTextFileFromIPFS(as){let rs=new AbortController,ns=rs.signal;return{promise:async function(){try{let ls=await fetch(`https://${as}.ipfs.dweb.link/`,{signal:ns});if(ls.ok){let us=await ls.text();return await cidFromText(us)===as?us:Promise.reject(new Error("cid mismatch"))}else return Promise.reject(new Error(`cid not found: ${as}`))}catch{return Promise.reject(new Error(`cid not found: ${as}`))}}(),controller:rs}}function retrieveTextFileFromServer(as,rs){let ns=new AbortController,ss=ns.signal;return{promise:async function(){try{let us=await fetch(`/media/${as}.${rs}`,{signal:ss});if(us.ok){let cs=await us.text(),ds=await cidFromText(cs);return ds===as?cs:(console.warn(`cid mismatch, ${as}, ${ds}`),Promise.reject(new Error("cid mismatch")))}else return Promise.reject(new Error(`cid not found: ${as}`))}catch{return Promise.reject(new Error(`cid not found: ${as}`))}}(),controller:ns}}async function expandDoenetMLsToFullSerializedComponents({cids:as,doenetMLs:rs,componentInfoObjects:ns}){var us,cs;let ss=[],os={};for(let ds of rs){let ps=parseAndCompile(ds);ps=cleanIfHaveJustDocument(ps),substituteDeprecations(ps),temporarilyRenameSourceBackToTarget(ps),correctComponentTypeCapitalization(ps,ns.componentTypeLowerCaseMapping),copyTargetOrFromURIAttributeCreatesCopyComponent(ps,ns.isCompositeComponent),createAttributesFromProps(ps,ns),breakUpTargetIntoPropsAndIndices(ps,ns),applyMacros(ps,ns),removeBlankStringChildren(ps,ns),decodeXMLEntities(ps),applySugar({serializedComponents:ps,componentInfoObjects:ns}),ss.push(ps);let fs=findContentCopies({serializedComponents:ps});for(let hs in fs.cidComponents)os[hs]===void 0&&(os[hs]=[]),os[hs].push(...fs.cidComponents[hs])}let ls=Object.keys(os);if(ls.length>0){let{newDoenetMLs:ds,newCids:ps}=await cidsToDoenetMLs(ls);for(let[gs,ys]of ls.entries())if(ps[gs]&&ps[gs].substring(0,ys.length)!==ys)return Promise.reject(new Error(`Requested cid ${ys} but got back ${ps[gs]}!`));let fs=ls.length;for(let gs=0;gstypeof Ns!="string"||Ns.trim()),Ts=Cs.length===1&&typeof Cs[0]=="object",Ss=(us=vs.doenetAttributes)==null?void 0:us.fromCopyFromURI;if(Ss||Ts)if(Ss&&!Ts)console.warn("ignoring copyFromURI as it was not a single component");else{let Ns=Cs[0];Ns.attributes||(Ns.attributes={}),vs.doenetAttributes||(vs.doenetAttributes={}),vs.doenetAttributes.keptNewNamespaceOfLastChild=!!((cs=Ns.attributes.newNamespace)!=null&&cs.primitive),Ns.attributes.newNamespace={primitive:!0},vs.children=[Ns,...vs.children],vs.doenetAttributes.nameFirstChildIndependently=!0}else{let Ns={componentType:"externalContent",children:JSON.parse(JSON.stringify(bs)),attributes:{newNamespace:{primitive:!0}},doenetAttributes:{createUniqueName:!0}};vs.children=[Ns,...vs.children]}}}}return{cids:as,fullSerializedComponents:ss}}function cidsToDoenetMLs(as){let rs=[],ns=as;for(let ss of as)rs.push(retrieveTextFileForCid(ss,"doenet"));return Promise.all(rs).then(ss=>Promise.resolve({newDoenetMLs:ss,newCids:ns})).catch(ss=>{let os;return ns.length===1?os=`Could not retrieve cid ${ns[0]}`:os=`Could not retrieve cids ${ns.join(",")}`,os+=": "+ss.message,console.error(os),Promise.reject(new Error(os))})}function removeBlankStringChildren(as,rs){for(let ns of as){if(ns.children){let ss=rs.allComponentClasses[ns.componentType];ss&&!ss.includeBlankStringChildren&&(ns.children=ns.children.filter(os=>typeof os!="string"||os.trim()!=="")),removeBlankStringChildren(ns.children,rs)}for(let ss in ns.attributes){let os=ns.attributes[ss].component;os&&os.children&&removeBlankStringChildren([os],rs)}}}function findContentCopies({serializedComponents:as}){let rs={};for(let ns of as)if(ns.componentType==="copy"){if(ns.attributes&&ns.attributes.uri){let ss=ns.attributes.uri.primitive;if(ss&&ss.substring(0,7).toLowerCase()==="doenet:"){let os=ss.match(/[:&]cid=([^&]+)/i);if(os){let ls=os[1];rs[ls]===void 0&&(rs[ls]=[]),rs[ls].push(ns)}}}}else if(ns.children!==void 0){let ss=findContentCopies({serializedComponents:ns.children});for(let os in ss.cidComponents)rs[os]===void 0&&(rs[os]=[]),rs[os].push(...ss.cidComponents[os])}return{cidComponents:rs}}function addDocumentIfItsMissing(as){if(as.length!==1||as[0].componentType!=="document"){let rs=as.splice(0);as.push({componentType:"document",children:rs})}}function substituteDeprecations(as){let rs={tname:"target",triggerwithtnames:"triggerWith",updatewithtname:"updateWith",paginatortname:"paginator",randomizeorder:"shuffleOrder",copytarget:"copySource",triggerwithtargets:"triggerWith",triggerwhentargetsclicked:"triggerWhenObjectsClicked",fortarget:"forObject",targetattributestoignore:"sourceAttributesToIgnore",targetattributestoignorerecursively:"sourceAttributesToIgnoreRecursively",targetsareresponses:"sourcesAreResponses",updatewithtarget:"updateWith",targetsarefunctionsymbols:"sourcesAreFunctionSymbols",selectforvariantnames:"selectForVariants"},ns={copy:{target:"source",tname:"source"},collect:{target:"source",tname:"source"},summarystatistics:{target:"source"}};for(let ss of as)if(typeof ss=="object"){if(ss.props){let os=ss.componentType,ls=ns[os.toLowerCase()];ls||(ls={});let us=!0;for(;us;){us=!1;for(let cs in ss.props){let ds=cs.toLowerCase();if(ds in ls){let ps=ls[ds];console.warn(`Attribute ${cs} of component type ${os} is deprecated. Use ${ps} instead.`),ss.props[ps]=ss.props[cs],delete ss.props[cs],us=!0;break}else if(ds in rs){let ps=rs[ds];console.warn(`Attribute ${cs} is deprecated. Use ${ps} instead.`),ss.props[ps]=ss.props[cs],delete ss.props[cs],us=!0;break}}}}ss.children&&substituteDeprecations(ss.children)}}function temporarilyRenameSourceBackToTarget(as){let rs={copysource:"copyTarget"},ns={copy:{source:"target"},collect:{source:"target"}};for(let ss of as)if(typeof ss=="object"){if(ss.props){let os=ss.componentType,ls=ns[os.toLowerCase()];ls||(ls={});let us=!0;for(;us;){us=!1;for(let cs in ss.props){let ds=cs.toLowerCase();if(ds in ls){let ps=ls[ds];ss.props[ps]=ss.props[cs],delete ss.props[cs],us=!0;break}else if(ds in rs){let ps=rs[ds];ss.props[ps]=ss.props[cs],delete ss.props[cs],us=!0;break}}}}ss.children&&temporarilyRenameSourceBackToTarget(ss.children)}}function cleanIfHaveJustDocument(as){let rs=as.filter(ns=>typeof ns!="string"||ns.trim()!=="");return rs.length===1&&rs[0].componentType==="document"?rs:as}function correctComponentTypeCapitalization(as,rs){for(let ns of as){if(typeof ns!="object")continue;let ss=rs[ns.componentType.toLowerCase()];if(ss)ns.componentType=ss;else throw Error(`Invalid component type${indexRangeString(ns)}: ${ns.componentType}`);ns.children&&correctComponentTypeCapitalization(ns.children,rs)}}function copyTargetOrFromURIAttributeCreatesCopyComponent(as,rs){for(let ns of as){if(ns.props){let ss=!1,os=!1,ls=!1,us=ns.componentType,cs=rs({componentType:us,includeNonStandard:!1}),ds=rs({componentType:us,includeNonStandard:!0});for(let ps of Object.keys(ns.props)){let fs=ps.toLowerCase();if(fs==="copytarget"){if(ss)throw Error(`Cannot repeat attribute ${ps}. Found in component type ${us}${indexRangeString(ns)}`);if(os)throw Error(`Cannot combine copyTarget and copyFromURI attribiutes. For in component of type ${us}${indexRangeString(ns)}`);if(ls)throw Error(ds?`A component of type ${us} cannot have both assignNames and copyTarget. Found${indexRangeString(ns)}.`:`Invalid attribute assignNames for component of type ${us}${indexRangeString(ns)}`);if(ss=!0,ns.doenetAttributes||(ns.doenetAttributes={}),cs||(ns.props.createComponentOfType=us,ns.doenetAttributes.nameBecomesAssignNames=!0),ns.componentType="copy",ns.props.target=ns.props[ps],typeof ns.props.target!="string")throw Error(`Must specify value for copyTarget. Found in component of type ${us}${indexRangeString(ns)}`);delete ns.props[ps],ns.doenetAttributes.fromCopyTarget=!0,ns.doenetAttributes.createNameFromComponentType=us,ns.props.assignNamesSkip="1"}else if(fs==="copyfromuri"){if(os)throw Error(`Cannot repeat attribute ${ps}. Found in component type ${us}${indexRangeString(ns)}`);if(ss)throw Error(`Cannot combine copyTarget and copyFromURI attribiutes. For in component of type ${us}${indexRangeString(ns)}`);if(ls)throw Error(ds?`A component of type ${us} cannot have both assignNames and copyFromURI. Found${indexRangeString(ns)}.`:`Invalid attribute assignNames for component of type ${us}${indexRangeString(ns)}`);if(os=!0,ns.doenetAttributes||(ns.doenetAttributes={}),cs||(ns.props.createComponentOfType=us,ns.doenetAttributes.nameBecomesAssignNames=!0),ns.componentType="copy",ns.props.uri=ns.props[ps],typeof ns.props.uri!="string")throw Error(`Must specify value for copyFromURI. Found in component of type ${us}${indexRangeString(ns)}`);delete ns.props[ps],ns.doenetAttributes.fromCopyFromURI=!0,ns.doenetAttributes.createNameFromComponentType=us,ns.props.assignNamesSkip="1"}else if(fs==="assignnames"&&!cs){if(ss||os)throw Error(ds?`A component of type ${us} cannot have both assignNames and copyTarget. Found${indexRangeString(ns)}.`:`Invalid attribute assignNames for component of type ${us}${indexRangeString(ns)}`);ls=!0}}if(ss){for(let fs of Object.keys(ns.props))if(fs.toLowerCase()==="prop")throw Error(`Invalid attribute prop for component of type ${us}${indexRangeString(ns)}`);let ps=!1;for(let fs of Object.keys(ns.props))if(fs.toLowerCase()==="copyprop"){if(ps)throw Error(`Cannot repeat attribute ${fs}. Found in component type ${us}${indexRangeString(ns)}`);ns.props.prop=ns.props[fs],delete ns.props[fs],ps=!0}}}ns.children&©TargetOrFromURIAttributeCreatesCopyComponent(ns.children,rs)}}function breakUpTargetIntoPropsAndIndices(as,rs,ns=""){for(let[ss,os]of as.entries()){if(os.props&&["copy","updateValue","animateFromSequence"].includes(os.componentType)){let ls,us,cs,ds,ps,fs,hs;for(let gs of Object.keys(os.props))if(gs.toLowerCase()==="target"){if(ls)throw Error(`Cannot repeat attribute ${gs}. Found in component type ${os.componentType}${indexRangeString(os)}`);ls=gs,hs=os.props[gs];let bs=buildSourcePieces(hs,!0);bs.success&&bs.matchLength===hs.length&&(us=bs.sourceName,cs=bs.componentIndex,ds=bs.componentAttributes,ps=bs.propArray,fs=bs.subNames)}if(ls&&us)if(cs||ds||ps.length>0){if(os.attributes.prop)throw Error(`Cannot combine the prop attribute with an extended source attribute. Found in component type ${os.componentType}${indexRangeString(os)}`);if(os.attributes.propIndex)throw Error(`Cannot combine the propIndex attribute with an extended source attribute. Found in component type ${os.componentType}${indexRangeString(os)}`);if(os.attributes.componentIndex)throw Error(`Cannot combine the componentIndex attribute with an extended source attribute. Found in component type ${os.componentType}${indexRangeString(os)}`);let gs=createComponentFromExtendedSource({sourceName:us,componentIndex:cs,subNames:fs,componentAttributes:ds,propArray:ps,componentInfoObjects:rs});if(gs.success){let ys=gs.newComponent;if(os.componentType==="copy")delete os.props[ls],Object.assign(os.attributes,ys.attributes),os.doenetAttributes||(os.doenetAttributes={}),Object.assign(os.doenetAttributes,ys.doenetAttributes),os.doenetAttributes.createNameFromComponentType||(os.doenetAttributes.createNameFromComponentType=os.componentType),os.componentType=ys.componentType,ps.length===0&&!(os.attributes.prop||os.attributes.propIndex)&&(os.doenetAttributes.isPlainCopy=!0),ys.children&&(os.children=ys.children);else if(ys.componentType==="copy")delete os.props[ls],Object.assign(os.attributes,ys.attributes),os.doenetAttributes||(os.doenetAttributes={}),Object.assign(os.doenetAttributes,ys.doenetAttributes);else{let bs="fromExtendedSource"+ns+"|"+ss,vs=createUniqueName("extract",bs);ys.doenetAttributes.prescribedName=vs,ys.doenetAttributes.createdFromMacro=!0;let xs={componentType:"setup",children:[ys],doenetAttributes:{createdFromMacro:!0}};as.push(xs),delete os.props[ls],os.doenetAttributes||(os.doenetAttributes={}),os.doenetAttributes.target=vs,os.doenetAttributes.allowDoubleUnderscoreTarget=!0}}else os.componentType==="copy"?console.warn(`invalid copy source: ${hs}`):console.warn(`invalid target: ${hs}`)}else os.componentType==="copy"&&!(os.attributes.prop||os.attributes.propIndex)&&(os.doenetAttributes||(os.doenetAttributes={}),os.doenetAttributes.isPlainCopy=!0)}os.children&&breakUpTargetIntoPropsAndIndices(os.children,rs,ns+"|"+ss)}}function createAttributesFromProps(as,rs){for(let ns of as){if(typeof ns!="object")continue;let ss=rs.allComponentClasses[ns.componentType],os=ss.createAttributesObject(),ls={};for(let ds in os)ls[ds.toLowerCase()]=ds;let us={},cs=Object.assign({},ns.props);if(ns.props)for(let ds in ns.props){let ps=ls[ds.toLowerCase()],fs=os[ps];if(fs){if(ps in us)throw Error(`Cannot repeat attribute ${ps}. Found in component type ${ns.componentType}${indexRangeString(ns)}`);us[ps]=componentFromAttribute({attrObj:fs,value:ns.props[ds],originalComponentProps:cs,componentInfoObjects:rs}),delete ns.props[ds]}else if(!["name","assignnames","target"].includes(ds.toLowerCase()))if(ss.acceptAnyAttribute)us[ds]=componentFromAttribute({value:ns.props[ds],originalComponentProps:cs,componentInfoObjects:rs}),delete ns.props[ds];else throw Error(`Invalid attribute ${ds} for component of type ${ns.componentType}${indexRangeString(ns)}`)}for(let ds in os){let ps=os[ds];ps.createPrimitiveOfType&&"defaultPrimitiveValue"in ps&&!(ds in us)&&(us[ds]=componentFromAttribute({attrObj:ps,originalComponentProps:cs,value:ps.defaultPrimitiveValue.toString(),componentInfoObjects:rs}))}ns.attributes=us,ns.children!==void 0&&createAttributesFromProps(ns.children,rs)}}function componentFromAttribute({attrObj:as,value:rs,originalComponentProps:ns,componentInfoObjects:ss}){if(typeof rs!="object"?rs={rawString:rs.toString()}:rs===null&&(rs={rawString:""}),as&&as.createComponentOfType){let os,ls=rs.rawString.trim().toLowerCase();if(ls==="true"&&as.valueForTrue!==void 0)os={componentType:as.createComponentOfType,state:{value:as.valueForTrue}};else if(ls==="false"&&as.valueForFalse!==void 0)os={componentType:as.createComponentOfType,state:{value:as.valueForFalse}};else if(ss.isInheritedComponentType({inheritedComponentType:as.createComponentOfType,baseComponentType:"boolean"})&&["true","false"].includes(ls))os={componentType:as.createComponentOfType,state:{value:ls==="true"}};else{let cs=rs.childrenForComponent;cs?cs=JSON.parse(JSON.stringify(cs)):cs=[rs.rawString],os={componentType:as.createComponentOfType,children:cs},removeBlankStringChildren([os],ss)}if(as.attributesForCreatedComponent||as.copyComponentAttributesForCreatedComponent){if(as.attributesForCreatedComponent?os.props=as.attributesForCreatedComponent:os.props={},as.copyComponentAttributesForCreatedComponent)for(let cs of as.copyComponentAttributesForCreatedComponent)ns[cs]&&(os.props[cs]=JSON.parse(JSON.stringify(ns[cs])));createAttributesFromProps([os],ss)}let us={component:os};return as.ignoreFixed&&(us.ignoreFixed=!0),us}else if(as&&as.createPrimitiveOfType){let os;return as.createPrimitiveOfType==="boolean"?os=rs.rawString.trim().toLowerCase()==="true":as.createPrimitiveOfType==="number"?os=Number(rs.rawString):as.createPrimitiveOfType==="integer"?os=Math.round(Number(rs.rawString)):as.createPrimitiveOfType==="stringArray"?os=rs.rawString.trim().split(/\s+/):as.createPrimitiveOfType==="numberArray"?os=rs.rawString.trim().split(/\s+/).map(Number):os=rs.rawString,as.validationFunction&&(os=as.validationFunction(os)),{primitive:os}}else return as&&as.createTargetComponentNames?{targetComponentNames:rs.rawString.trim().split(/\s+/).map(ls=>(ls[0]==="$"&&ls[1]!=="$"&&(ls=ls.slice(1),ls[0]==="("&&ls[ls.length-1]===")"&&(ls=ls.slice(1,ls.length-1))),{relativeName:ls}))}:(rs.childrenForComponent||(rs.childrenForComponent=[rs.rawString]),rs)}function findPreSugarIndsAndMarkFromSugar(as){let rs=[];for(let ns of as)if(typeof ns=="object"){if(ns.preSugarInd!==void 0)rs.push(ns.preSugarInd);else if(ns.doenetAttributes||(ns.doenetAttributes={}),ns.doenetAttributes.createdFromSugar=!0,ns.children){let ss=findPreSugarIndsAndMarkFromSugar(ns.children);rs.push(...ss)}}return rs}function applyMacros(as,rs){for(let ns of as)if(ns.children&&applyMacros(ns.children,rs),ns.attributes)for(let ss in ns.attributes){let os=ns.attributes[ss];os.component?applyMacros([os.component],rs):os.childrenForComponent&&applyMacros(os.childrenForComponent,rs)}substituteMacros(as,rs)}function substituteMacros(as,rs){for(let ns=0;ns0&&as[ns-1].range){let Ts=as[ns-1].range;Ts.closeEnd?Cs+=Ts.closeEnd:Ts.selfCloseEnd&&(Cs+=Ts.selfCloseBegin)}throw Error(`${hs.message}. At indices ${Cs}-${Cs+ds}. Found: ${xs}`)}markCreatedFromMacro([gs]),us.propArray.length===0&&(gs.doenetAttributes.isPlainMacro=!0),fs=[gs];let ys=1,bs=ls.substring(cs+ds);if(ps===2){let xs=ls.slice(cs+ds).match(/^\s*\(/);if(!xs){os=cs+2;continue}let Cs=ds+xs[0].length,Ts=[],Ss=!1;ls.length>cs+Cs&&(Ss=!0,Ts.push(ls.substring(cs+Cs))),Ts.push(...as.slice(ns+1));let Ns=createEvaluateIfFindMatchedClosingParens({componentsFromMacro:fs,remainingComponents:Ts,includeFirstInRemaining:Ss,componentInfoObjects:rs});if(!Ns.success){os=cs+2;continue}fs=Ns.componentsFromMacro,ys=Ns.lastComponentIndMatched+1,Ss||ys++,bs=""}let vs=[];cs>0&&vs.push(ls.substring(0,cs)),vs.push(...fs),bs.length>0&&vs.push(bs),as.splice(ns,ys,...vs),cs>0&&ns++;break}}}}function createComponentFromExtendedSource({sourceName:as,componentIndex:rs,componentAttributes:ns,propArray:ss,subNames:os,componentInfoObjects:ls}){let us={componentType:"copy",doenetAttributes:{target:as},attributes:{}};if(rs){let ds=[rs];applyMacros(ds,ls),us.attributes.componentIndex={component:{componentType:"integer",children:ds}}}if((os==null?void 0:os.length)>0){let ds=[],ps=[];for(let fs of os)ds.push(fs.subName),fs.subNameComponentIndex!==void 0&&(ps.length0){let fs=[ps.join(" ")];applyMacros(fs,ls),us.attributes.sourceSubnamesComponentIndex={component:{componentType:"numberList",children:fs}}}}let cs=!1;if(ns){cs=!0;let ds=createAttributesFromString(ns,ls);if(!ds.success)return ds;Object.assign(us.attributes,ds.newAttributes),ds.assignNames&&(us.props={assignNames:ds.assignNames})}for(let ds of ss){if(cs&&(us.doenetAttributes.createdFromMacro=!0,us={componentType:"extract",attributes:{},doenetAttributes:{},children:[us]}),us.attributes.prop={primitive:ds.prop},ds.propIndex){let ps=[ds.propIndex.join(" ")];applyMacros(ps,ls),us.attributes.propIndex={component:{componentType:"numberList",children:ps}}}if(ds.attributes){let ps=createAttributesFromString(ds.attributes,ls);if(!ps.success)return ps;Object.assign(us.attributes,ps.newAttributes),ps.assignNames&&(us.props={assignNames:ps.assignNames})}cs=!0}return{success:!0,newComponent:us}}function createAttributesFromString(as,rs){let ns=``,ss;try{ss=parseAndCompile(ns)}catch{return{success:!1,message:"Error in macro"}}createAttributesFromProps(ss,rs),markCreatedFromMacro(ss),applyMacros(ss,rs);let os=ss[0].attributes;if(os.prop||os.propIndex||os.componentIndex)return{success:!1,message:"Error in macro: macro cannot directly add attributes prop, propIndex, or componentIndex"};let ls;if(ss[0].props){for(let us in ss[0].props)if(us.toLowerCase()==="assignnames"){if(ls)return{success:!1,message:"Error in macro: cannot repeat assignNames"};ls=ss[0].props[us]}}return{success:!0,newAttributes:os,assignNames:ls}}function findFirstFullMacroInString(as){let rs=0,ns;for(;;){let ss=as.substring(rs).match(/(\$+)(.?)/);if(!ss)return{success:!1};if(ns=ss[1].length,rs+=ss.index+ns,ns<=2){let os=!1,ls=as.substring(rs),us=0,cs=findWordOrDelimitedGroup(ls,os);cs.startDelim==="("&&(os=!0,ls=cs.group,us=cs.group.length);let ds=buildSourcePieces(ls,os);if(ds.success){if(os){if(ds.matchLength!==us)return{success:!1};ds.matchLength+=2}return ds.nDollarSigns=ns,ds.firstIndMatched=rs-ns,ds.matchLength+=ns,ds}}}}function buildSourcePieces(as,rs){let ns=findWordOrDelimitedGroup(as,rs),ss=0;if(ns.withPeriod||!ns.word)return{success:!1};let os={sourceName:(ns.withSlash?"/":"")+ns.word};ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs),ns.startDelim==="["&&(os.componentIndex=ns.group,ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs));let ls=[];for(;ns.withSlash;){let cs={subName:ns.word};ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs),ns.startDelim==="["&&(cs.subNameComponentIndex=ns.group,ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs)),ls.push(cs)}os.subNames=ls,ns.startDelim==="{"&&(os.componentAttributes=ns.group,ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs));let us=[];for(;ns.withPeriod;){let cs={prop:ns.word};ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs);let ds=[];for(;ns.startDelim==="[";)ds.push(ns.group),ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs);ds.length>0&&(cs.propIndex=ds),ns.startDelim==="{"&&(cs.attributes=ns.group,ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs)),us.push(cs)}return os.propArray=us,os.matchLength=ss,os.success=!0,os}function findWordOrDelimitedGroup(as,rs=!1){let ns=!1,ss=!1;as[0]==="."&&as[1]!=="."&&(ns=!0,as=as.substring(1));let os;rs?ns?os=/^[\w-]+/:(as[0]==="/"&&as[1].match(/\w/)&&(ss=!0,as=as.substring(1)),os=/^([\w\/-]|\.\.\/)+/):os=/^[a-zA-Z_]\w*/;let ls=as.match(os);if(ls)return{success:!0,withPeriod:ns,withSlash:ss,word:ls[0],matchLength:ls[0].length+(ns?1:0)+(ss?1:0)};if(ns||ss)return{success:!1};let us=[],cs={"(":")","{":"}","[":"]"},ds=Object.values(cs),ps=as[0],fs=cs[ps];if(!fs)return{success:!1};us.push(fs);for(let hs=1;hs0?rs[ls]=us.substring(0,os.charInd):rs=rs.slice(0,ls);let ds=breakEmbeddedStringByCommas({childrenList:rs});ds.pieces.forEach(gs=>applyMacros(gs,ss));let ps=ds.pieces.map(gs=>gs.length===1&&typeof gs[0]!="string"?gs[0]:{componentType:"math",doenetAttributes:{createdFromMacro:!0},children:gs}),hs=[{componentType:"evaluate",doenetAttributes:{createdFromMacro:!0},attributes:{function:{component:{componentType:"function",doenetAttributes:{createdFromMacro:!0},children:as}},input:{component:{componentType:"mathList",doenetAttributes:{createdFromMacro:!0},children:ps}}}}];return cs.length>0&&hs.push(cs),{success:!0,componentsFromMacro:hs,lastComponentIndMatched:ls}}function findFirstUnmatchedClosingParens(as){let rs=0;for(let[ns,ss]of as.entries())if(typeof ss=="string"){let os=ss;for(let ls=0;ls").replace(/</g,"<").replace(/$/g,"$").replace(/&/g,"&")}for(let[ns,ss]of as.entries())if(typeof ss=="string")as[ns]=rs(ss);else if(ss.children&&decodeXMLEntities(ss.children),ss.attributes)for(let os in ss.attributes){let ls=ss.attributes[os];ls.component?decodeXMLEntities([ls.component]):ls.primitive?typeof ls.primitive=="string"&&(ls.primitive=rs(ls.primitive)):(ls.childrenForComponent&&decodeXMLEntities(ls.childrenForComponent),ls.rawString&&(ls.rawString=rs(ls.rawString)))}}function applySugar({serializedComponents:as,parentParametersFromSugar:rs={},parentAttributes:ns={},componentInfoObjects:ss,parentUniqueId:os="",isAttributeComponent:ls=!1}){for(let[us,cs]of as.entries()){if(typeof cs!="object")continue;let ds=cs.componentType,ps=ss.allComponentClasses[ds];if(!ps)throw Error(`Unrecognized component type ${ds}`);let fs=os+"|"+ds+us,hs={};for(let gs in cs.attributes){let ys=cs.attributes[gs];ys.primitive!==void 0&&(hs[gs]=ys.primitive)}if(cs.children){let gs={};if(!cs.skipSugar)for(let[ys,bs]of ps.returnSugarInstructions().entries()){let vs=cs.children.map(Ns=>typeof Ns=="string"?"s":"n").join("");if(bs.childrenRegex){let Ns=vs.match(bs.childrenRegex);if(!Ns||Ns[0].length!==cs.children.length)continue}let xs=deepClone(cs.children),Cs=0;for(let Ns of xs)typeof Ns!="string"&&(Ns.preSugarInd=Cs,Cs++);let Ts=!1;cs.doenetAttributes&&cs.doenetAttributes.createdFromMacro&&(Ts=!0);let Ss=bs.replacementFunction({matchedChildren:xs,parentParametersFromSugar:rs,parentAttributes:ns,componentAttributes:hs,uniqueId:fs+"|sugar"+ys,componentInfoObjects:ss,isAttributeComponent:ls,createdFromMacro:Ts});if(Ss.success){let Ns=Ss.newChildren,As=Ss.newAttributes,ws=[],Es=[];if(Ns&&(ws=findPreSugarIndsAndMarkFromSugar(Ns)),As)for(let $s in As){let Rs=As[$s].component;Rs&&Es.push(...findPreSugarIndsAndMarkFromSugar(Rs.children))}let _s=[...ws,...Es];if(_s.length!==Cs||!_s.sort(($s,Rs)=>$s-Rs).every(($s,Rs)=>$s===Rs))throw Error(`Invalid sugar for ${ds} as didn't return set of original components`);if(ws.length>0&&![...ws].sort((Rs,Ds)=>Rs-Ds).every((Rs,Ds)=>Rs===ws[Ds]))throw Error(`Invalid sugar for ${ds} as didn't return original components in order`);Ss.parametersForChildrenSugar&&Object.assign(gs,Ss.parametersForChildrenSugar),Ns?cs.children=Ns:cs.children=[],As&&(cs.attributes||(cs.attributes={}),Object.assign(cs.attributes,As))}}ps.removeBlankStringChildrenPostSugar&&(cs.children=cs.children.filter(ys=>typeof ys!="string"||/\S/.test(ys))),applySugar({serializedComponents:cs.children,parentParametersFromSugar:gs,parentAttributes:hs,componentInfoObjects:ss,parentUniqueId:fs})}if(cs.attributes)for(let gs in cs.attributes){let ys=cs.attributes[gs];ys.component&&applySugar({serializedComponents:[ys.component],parentAttributes:hs,componentInfoObjects:ss,parentUniqueId:fs,isAttributeComponent:!0})}}}function breakStringInPiecesBySpacesOrParens(as){if(typeof as!="string")return{success:!1};let rs=0,ns=[];as=as.trim();let ss=0;for(let ls=0;ls0&&ns.push(cs),ss=ls}rs++}else if(us===")"){if(rs===0)return{success:!1};if(rs===1){let cs=as.substring(ss+1,ls).trim();if(cs.length>0){let ds=breakStringInPiecesBySpacesOrParens(cs);ds.success===!0?ns.push(ds.pieces):ns.push(cs)}ss=ls+1}rs--}else if(rs===0&&us.match(/\s/)){let cs=as.substring(ss,ls).trim();cs.length>0&&ns.push(cs),ss=ls}}if(rs!==0)return{success:!1};let os=as.substring(ss,as.length).trim();return os.length>0&&ns.push(os),{success:!0,pieces:ns}}function countRegularComponentTypesInNamespace(as,rs={}){var ns,ss;for(let os of as)if(typeof os=="object"){let ls=os.componentType,us=rs[ls];us===void 0&&(us=0);let cs=os.doenetAttributes;cs!=null&&cs.isAttributeChild||cs!=null&&cs.createdFromSugar||cs!=null&&cs.createdFromMacro||(rs[ls]=++us),os.children&&!((ss=(ns=os.attributes)==null?void 0:ns.newNamespace)!=null&&ss.primitive)&&(rs=countRegularComponentTypesInNamespace(os.children,rs))}return rs}function renameAutonameBasedOnNewCounts(as,rs={}){var ss,os;let ns={...rs};for(let ls of as)if(typeof ls=="object"){let us=ls.componentType,cs=ns[us];cs===void 0&&(cs=0);let ds=ls.doenetAttributes;if(!(ds!=null&&ds.isAttributeChild||ds!=null&&ds.createdFromSugar||ds!=null&&ds.createdFromMacro)&&(ns[us]=++cs,ls.componentName)){let ps=ls.componentName.lastIndexOf("/"),fs=ls.componentName.substring(ps+1),hs="_"+us.toLowerCase();fs.substring(0,hs.length)===hs&&(ls.componentName=ls.componentName.substring(0,ps+1)+hs+cs)}ls.children&&!((os=(ss=ls.attributes)==null?void 0:ss.newNamespace)!=null&&os.primitive)&&(ns=renameAutonameBasedOnNewCounts(ls.children,ns))}return ns}function createComponentNames({serializedComponents:as,namespaceStack:rs=[],componentInfoObjects:ns,parentDoenetAttributes:ss={},parentName:os,useOriginalNames:ls=!1,attributesByTargetComponentName:us,indOffset:cs=0,createNameContext:ds="",initWithoutShadowingComposite:ps=!1}){var gs,ys,bs;rs.length===0&&rs.push({namespace:"",componentCounts:{},namesUsed:{}});let fs=rs.length-1,hs=rs[fs];for(let[vs,xs]of as.entries()){if(typeof xs!="object")continue;let Cs=xs.componentType,Ts=ns.allComponentClasses[Cs],Ss=xs.doenetAttributes;Ss===void 0&&(Ss=xs.doenetAttributes={});let Ns=xs.attributes;Ns||(Ns=xs.attributes={}),Ss.createNameFromComponentType&&(Cs=Ss.createNameFromComponentType);let As=Ss.prescribedName,ws=Ss.assignNames,Es=Ss.target,_s=Ss.isAttributeChild||Ss.createdFromSugar||Ss.createdFromMacro||Ss.createUniqueName,$s;((gs=Ns.newNamespace)!=null&&gs.primitive||ls&&xs.originalAttributes&&xs.originalAttributes.newNamespace)&&($s=!0);let Rs=As!==void 0,Ds=xs.props;if(Ds===void 0)Ds=xs.props={};else for(let Vs in Ds){let ks=Vs.toLowerCase();if(ks==="name")if(As===void 0)As=Ds[Vs],delete Ds[Vs];else throw Error(`Cannot define name twice. Found in component of type ${Cs}${indexRangeString(xs)}`);else if(ks==="assignnames")if(ws===void 0){let Ps=breakStringInPiecesBySpacesOrParens(Ds[Vs]);if(Ps.success)ws=Ps.pieces;else throw Error(`Invalid format for assignnames. Found in component of type ${Cs}${indexRangeString(xs)}`);delete Ds[Vs]}else throw Error(`Cannot define assignNames twice for a component. Found in component of type ${Cs}${indexRangeString(xs)}`);else if(ks==="target")if(Es===void 0){if(typeof Ds[Vs]!="string")throw Error(`Must specify value for target. Found in component of type ${Cs}${indexRangeString(xs)}`);Es=Ds[Vs].trim(),delete Ds[Vs]}else throw Error(`Cannot define target twice for a component. Found in component of type ${Cs}${indexRangeString(xs)}`)}if(As){if(!Rs&&!Ss.createdFromSugar){if(!/[a-zA-Z]/.test(As.substring(0,1)))throw Error(`Invalid component name: ${As}. Component name must begin with a letter. Found in component of type ${Cs}${indexRangeString(xs)}`);if(!/^[a-zA-Z0-9_\-]+$/.test(As))throw Error(`Invalid component name: ${As}. Component name can contain only letters, numbers, hyphens, and underscores. Found in component of type ${Cs}${indexRangeString(xs)}`)}Ss.prescribedName=As}else if(_s){let Vs=os+"|createUniqueName|";xs.downstreamDependencies?Vs+=JSON.stringify(xs.downstreamDependencies):Vs+=vs+"|"+cs+"|"+ds,As=createUniqueName(Cs.toLowerCase(),Vs)}if(!ws&&ls&&xs.originalDoenetAttributes&&xs.originalDoenetAttributes.assignNames&&(ws=xs.originalDoenetAttributes.assignNames),ws){if(!Ts.assignNamesToReplacements)throw Error(`Cannot assign names for component type ${Cs}${indexRangeString(xs)}`);if(Ss.assignNames=ws,!Ss.createUniqueAssignNames){let ks=flattenDeep(ws);if(!Ss.fromCopyTarget&&!Ss.fromCopyFromURI)for(let Ps of ks){if(!/[a-zA-Z]/.test(Ps.substring(0,1)))throw Error(`All assigned names must begin with a letter. Found in component of type ${Cs}${indexRangeString(xs)}`);if(!/^[a-zA-Z0-9_\-]+$/.test(Ps))throw Error(`Assigned names can contain only letters, numbers, hyphens, and underscores. Found in component of type ${Cs}${indexRangeString(xs)}`)}if(ks.length!==new Set(ks).size)throw Error(`Duplicate assigned names. Found in component of type ${Cs}${indexRangeString(xs)}`)}}$s&&(Ns.newNamespace={primitive:$s});let Os=hs.componentCounts[Cs];Os===void 0&&(Os=0),Ss.isAttributeChild||Ss.createdFromSugar||Ss.createdFromMacro||(hs.componentCounts[Cs]=++Os);let Is="";for(let Vs=0;Vs<=fs;Vs++)Is+=rs[Vs].namespace+"/";if(!As){if(ls&&xs.originalName){let Vs=xs.originalName.lastIndexOf("/");As=xs.originalName.substring(Vs+1)}As||(As="_"+Cs.toLowerCase()+Os)}if(Ss.nameBecomesAssignNames){$s&&(Ns.assignNewNamespaces={primitive:!0},delete Ns.newNamespace,$s=!1),ws=Ss.assignNames=[As],delete Ss.nameBecomesAssignNames;let Vs=os+"|createUniqueName|";Ss.createUniqueName=!0,delete Ss.prescribedName,xs.downstreamDependencies?Vs+=JSON.stringify(xs.downstreamDependencies):Vs+=vs+"|"+cs+"|"+ds,As=createUniqueName("copy",Vs)}if(Is+=As,xs.componentName=Is,As){if(As in hs.namesUsed)throw Error(`Duplicate component name ${Is}. Found in component of type ${Cs}${indexRangeString(xs)}`);hs.namesUsed[As]=!0}if(!$s&&ws)for(let Vs of flattenDeep(ws)){if(Vs in hs.namesUsed)throw Error(`Duplicate component name ${Vs} (from assignNames of ${Is}). Found in component of type ${Cs}${indexRangeString(xs)}`);hs.namesUsed[Vs]=!0}if(xs.doenetAttributes.createUniqueAssignNames&&xs.originalName){let Vs=xs.doenetAttributes.assignNames;Vs||(Vs=xs.doenetAttributes.originalAssignNames);let ks=Is+"|createUniqueName|assignNames|",Ps="",Bs;if($s)Ps=Is+"/",Bs=xs.originalName+"/";else{for(let Us=0;Us<=fs;Us++)Ps+=rs[Us].namespace+"/";let Ws=xs.originalName.lastIndexOf("/");Bs=xs.originalName.slice(0,Ws+1)}let Ms=createNewAssignNamesAndrenameMatchingTargetNames({originalAssignNames:Vs,longNameIdBase:ks,namespace:Ps,oldNamespace:Bs,attributesByTargetComponentName:us});ws=xs.doenetAttributes.assignNames=Ms}if(renameMatchingTargetNames(xs,us),Es){if(!Ts.acceptTarget)throw Error(`Component type ${Cs} does not accept a target attribute. Found in component ${Is}${indexRangeString(xs)}`);if(Es.includes("|"))throw Error(`target cannot include |. Found in component of type ${Cs}${indexRangeString(xs)}`);Ss.target=Es,Ss.targetComponentName=convertComponentTarget({relativeName:Es,oldAbsoluteName:Ss.targetComponentName,namespaceStack:rs,acceptDoubleUnderscore:Ss.createdFromSugar||Ss.allowDoubleUnderscoreTarget})}for(let Vs in Ns){let ks=Ns[Vs];if(ks.targetComponentNames)for(let Ps of ks.targetComponentNames)Ps.absoluteName=convertComponentTarget({relativeName:Ps.relativeName,oldAbsoluteName:Ps.absoluteName,namespaceStack:rs,acceptDoubleUnderscore:Ss.createdFromSugar||Ss.allowDoubleUnderscoreTarget})}if(xs.children)if($s||(ys=Ns.assignNewNamespaces)!=null&&ys.primitive){let Vs={};ws&&flattenDeep(ws).forEach(Bs=>Vs[Bs]=!0);let ks=xs.children;if(Ss.nameFirstChildIndependently&&xs.children.length>0){ks=ks.slice(1);let Bs={namespace:As,componentCounts:{},namesUsed:{}};rs.push(Bs),createComponentNames({serializedComponents:[xs.children[0]],namespaceStack:rs,componentInfoObjects:ns,parentDoenetAttributes:Ss,parentName:Is,useOriginalNames:ls,attributesByTargetComponentName:us}),rs.pop()}let Ps={namespace:As,componentCounts:{},namesUsed:Vs};if(Ss.haveNewNamespaceOnlyFromShadow){let Bs=!0,Ms=[...ks];for(;Ms.length>0;){let Ws=[];for(let Us of Ms){if(!!((bs=Us.doenetAttributes)!=null&&bs.ignoreParentNewNamespace)===Bs)break;Ws.push(Us)}Ms.splice(0,Ws.length),Bs?rs.push(Ps):ps&&Ws.forEach(Us=>Us.doenetAttributes.createUniqueName=!0),createComponentNames({serializedComponents:Ws,namespaceStack:rs,componentInfoObjects:ns,parentDoenetAttributes:Ss,parentName:Is,useOriginalNames:ls,attributesByTargetComponentName:us}),Bs&&rs.pop(),Bs=!Bs}}else rs.push(Ps),createComponentNames({serializedComponents:ks,namespaceStack:rs,componentInfoObjects:ns,parentDoenetAttributes:Ss,parentName:Is,useOriginalNames:ls,attributesByTargetComponentName:us}),rs.pop()}else{let Vs=xs.children;if(Ss.nameFirstChildIndependently&&Vs.length>0){Vs=Vs.slice(1);let ks=hs.namesUsed,Ps=hs.componentCounts;hs.namesUsed={},hs.componentCounts={},createComponentNames({serializedComponents:[xs.children[0]],namespaceStack:rs,componentInfoObjects:ns,parentDoenetAttributes:Ss,parentName:Is,useOriginalNames:ls,attributesByTargetComponentName:us}),hs.namesUsed=ks,hs.componentCounts=Ps}createComponentNames({serializedComponents:Vs,namespaceStack:rs,componentInfoObjects:ns,parentDoenetAttributes:Ss,parentName:Is,useOriginalNames:ls,attributesByTargetComponentName:us})}if(xs.attributes)for(let Vs in xs.attributes){let ks=xs.attributes[Vs];if(ks.component){let Ps=ks.component;Ps.doenetAttributes||(Ps.doenetAttributes={}),Ps.doenetAttributes.isAttributeChild=!0,ks.ignoreFixed&&(Ps.doenetAttributes.ignoreParentFixed=!0),createComponentNames({serializedComponents:[Ps],namespaceStack:rs,componentInfoObjects:ns,parentDoenetAttributes:Ss,parentName:Is,useOriginalNames:ls,attributesByTargetComponentName:us,createNameContext:Vs})}else ks.childrenForComponent&&createComponentNames({serializedComponents:ks.childrenForComponent,namespaceStack:rs,componentInfoObjects:ns,parentDoenetAttributes:Ss,parentName:Is,useOriginalNames:ls,attributesByTargetComponentName:us,createNameContext:Vs})}}return as}function createNewAssignNamesAndrenameMatchingTargetNames({originalAssignNames:as,longNameIdBase:rs,namespace:ns,oldNamespace:ss,attributesByTargetComponentName:os}){let ls=[];for(let[us,cs]of as.entries())if(Array.isArray(cs)){let ds=createNewAssignNamesAndrenameMatchingTargetNames({originalAssignNames:cs,longNameIdBase:rs+us+"_",namespace:ns,oldNamespace:ss,attributesByTargetComponentName:os});ls.push(ds)}else{let ds=rs+us,ps=createUniqueName("fromAssignNames",ds);ls.push(ps);let fs={componentName:ns+ps,originalName:ss+cs};renameMatchingTargetNames(fs,os,!0)}return ls}function convertComponentTarget({relativeName:as,oldAbsoluteName:rs,namespaceStack:ns,acceptDoubleUnderscore:ss}){if(!rs&&/__/.test(as)&&!ss)throw Error("Invalid reference target: "+as);let os;if(as.substring(0,1)==="/")os=as;else{let ls=ns.length-1;for(;as.substring(0,3)==="../";)as=as.substring(3),ls--;ls<0&&(ls=0),os="";for(let us=0;us<=ls;us++)os+=ns[us].namespace+"/";os+=as}return os}function serializedComponentsReplacer(as,rs){return rs!==rs?{objectType:"special-numeric",stringValue:"NaN"}:rs===1/0?{objectType:"special-numeric",stringValue:"Infinity"}:rs===-1/0?{objectType:"special-numeric",stringValue:"-Infinity"}:rs}let nanInfinityReviver=function(as,rs){if(rs&&rs.objectType==="special-numeric"){if(rs.stringValue==="NaN")return NaN;if(rs.stringValue==="Infinity")return 1/0;if(rs.stringValue==="-Infinity")return-1/0}return rs};function serializedComponentsReviver(as,rs){return Context.reviver(as,theModule.Subset.reviver(as,nanInfinityReviver(as,rs)))}function processAssignNames({assignNames:as=[],assignNewNamespaces:rs=!1,serializedComponents:ns,parentName:ss,parentCreatesNewNamespace:os,componentInfoObjects:ls,indOffset:us=0,originalNamesAreConsistent:cs=!1,shadowingComposite:ds=!1}){var bs,vs;let ps=ns.length;moveComponentNamesToOriginalNames(ns);let fs={},hs=null;if(cs){if(ps>0){let xs=ns.filter(Cs=>typeof Cs=="object")[0];if(xs&&xs.originalName){let Cs=xs.originalName.lastIndexOf("/");hs=xs.originalName.substring(0,Cs)}}if(hs!==null)for(let xs of ns)setTargetsOutsideNamespaceToAbsoluteAndRecordAllTargetComponentNames({namespace:hs,components:[xs],attributesByTargetComponentName:fs})}else for(let xs=0;xs0&&Cs.originalName){let Ts=Cs.originalName.lastIndexOf("/");hs=Cs.originalName.substring(0,Ts)}hs!==null&&setTargetsOutsideNamespaceToAbsoluteAndRecordAllTargetComponentNames({namespace:hs,components:[Cs],attributesByTargetComponentName:fs})}}let gs=[],ys=0;for(let xs=0;xs0&&Ts.originalName)){let Ns=Ts.originalName.lastIndexOf("/");hs=Ts.originalName.substring(0,Ns)}if(Ss){if(ls.allComponentClasses[Ts.componentType].assignNamesSkipOver)Ss=[Ss];else if((bs=Ts.attributes)!=null&&bs.assignNamesSkip){let Ns=Ts.attributes.assignNamesSkip.primitive;if(Ns>0)for(let As=0;As({namespace:gs,componentCounts:{},namesUsed:{}}));as[0]!=="/"&&ps.splice(0,0,{componentCounts:{},namesUsed:{},namespace:""}),rs.doenetAttributes||(rs.doenetAttributes={}),rs.attributes||(rs.attributes={});let fs;(hs=rs.attributes.newNamespace)!=null&&hs.primitive||us?fs=!0:(fs=!1,rs.children&&markToCreateAllUniqueNames(rs.children));for(let gs in rs.attributes){let ys=rs.attributes[gs];ys.component?markToCreateAllUniqueNames([ys.component]):ys.childrenForComponent&&markToCreateAllUniqueNames(ys.childrenForComponent)}createComponentNames({serializedComponents:[rs],namespaceStack:ps,componentInfoObjects:os,parentName:as,useOriginalNames:fs,attributesByTargetComponentName:ls,indOffset:ns,initWithoutShadowingComposite:!cs})}function setTargetsOutsideNamespaceToAbsoluteAndRecordAllTargetComponentNames({namespace:as,components:rs,attributesByTargetComponentName:ns}){let ss=as.length;for(let os of rs)if(typeof os=="object"){if(os.doenetAttributes&&os.doenetAttributes.target){let ls=os.doenetAttributes.targetComponentName;ls!==void 0&&(ls.substring(0,ss)!==as&&(os.doenetAttributes.target=ls),ns[ls]||(ns[ls]=[]),ns[ls].push(os.doenetAttributes))}for(let ls in os.attributes){let us=os.attributes[ls];if(us.targetComponentNames)for(let cs of us.targetComponentNames){let ds=cs.absoluteName;ds!==void 0&&(ds.substring(0,ss)!==as&&(cs.relativeName=ds),ns[ds]||(ns[ds]=[]),ns[ds].push(cs))}}if(os.children&&setTargetsOutsideNamespaceToAbsoluteAndRecordAllTargetComponentNames({namespace:as,components:os.children,attributesByTargetComponentName:ns}),os.attributes)for(let ls in os.attributes){let us=os.attributes[ls];us.component?setTargetsOutsideNamespaceToAbsoluteAndRecordAllTargetComponentNames({namespace:as,components:[us.component],attributesByTargetComponentName:ns}):us.childrenForComponent&&setTargetsOutsideNamespaceToAbsoluteAndRecordAllTargetComponentNames({namespace:as,components:us.childrenForComponent,attributesByTargetComponentName:ns})}}}function renameMatchingTargetNames(as,rs,ns=!1){if(as.originalName&&rs&&as.componentName!==as.originalName){if(rs[as.originalName])for(let ss of rs[as.originalName])ss.relativeName?(ss.relativeName=as.componentName,ss.absoluteName=as.componentName):(ss.target=as.componentName,ss.targetComponentName=as.componentName);if(ns){let ss=as.originalName+"/",os=ss.length;for(let ls in rs)if(ls.substring(0,os)===ss){let us=ls.substring(os);for(let cs of rs[ls])cs.relativeName?(cs.relativeName=as.componentName+"/"+us,cs.absoluteName=as.componentName+"/"+us):(cs.target=as.componentName+"/"+us,cs.targetComponentName=as.componentName+"/"+us)}}}}function moveComponentNamesToOriginalNames(as){for(let rs of as)if(rs.componentName&&(rs.originalName=rs.componentName,delete rs.componentName),rs.children&&moveComponentNamesToOriginalNames(rs.children),rs.attributes)for(let ns in rs.attributes){let ss=rs.attributes[ns];ss.component?moveComponentNamesToOriginalNames([ss.component]):ss.childrenForComponent&&moveComponentNamesToOriginalNames(ss.childrenForComponent)}}function markToCreateAllUniqueNames(as){var rs,ns;for(let ss of as)if(typeof ss=="object"&&(ss.doenetAttributes||(ss.doenetAttributes={}),ss.doenetAttributes.createUniqueName=!0,delete ss.doenetAttributes.prescribedName,(ns=(rs=ss.attributes)==null?void 0:rs.newNamespace)!=null&&ns.primitive||(ss.doenetAttributes.assignNames?(ss.doenetAttributes.createUniqueAssignNames=!0,ss.doenetAttributes.originalAssignNames=ss.doenetAttributes.assignNames,delete ss.doenetAttributes.assignNames):ss.originalDoenetAttributes&&ss.originalDoenetAttributes.assignNames&&(ss.doenetAttributes.createUniqueAssignNames=!0,ss.doenetAttributes.originalAssignNames=ss.originalDoenetAttributes.assignNames),ss.children&&markToCreateAllUniqueNames(ss.children)),ss.attributes))for(let os in ss.attributes){let ls=ss.attributes[os];ls.component?markToCreateAllUniqueNames([ls.component]):ls.childrenForComponent&&markToCreateAllUniqueNames(ls.childrenForComponent)}}function setTNamesToAbsolute(as){for(let rs of as){if(rs.doenetAttributes&&rs.doenetAttributes.target){let ns=rs.doenetAttributes.targetComponentName;ns!==void 0&&(rs.doenetAttributes.target=ns)}if(rs.children&&setTNamesToAbsolute(rs.children),rs.attributes)for(let ns in rs.attributes){let ss=rs.attributes[ns];ss.component?setTNamesToAbsolute([ss.component]):ss.childrenForComponent&&setTNamesToAbsolute(ss.childrenForComponent)}}}function restrictTNamesToNamespace({components:as,namespace:rs,parentNamespace:ns,parentIsCopy:ss=!1,invalidateReferencesToBaseNamespace:os=!1}){var us;ns===void 0&&(ns=rs);let ls=rs.length;for(let cs of as){if(cs.doenetAttributes&&cs.doenetAttributes.target){let ds=cs.doenetAttributes.target;if(ds[0]==="/"){if(ds.substring(0,ls)!==rs){let ps=rs.split("/").slice(1),fs=ds.split("/").slice(1),hs=!1,gs=rs+ds.slice(1);for(;ps.length>0&&ps[0]===fs[0];)ps=ps.slice(1),fs=fs.slice(1),hs=!0;if(hs)gs=rs+fs.join("/");else{let ys=rs.split("/").slice(1);for(let bs=1;bs0||(cs=1)),us in rs?rs[us]+=cs:rs[us]=cs}return rs}const rendererState=Recoil_index_10({key:"rendererState",default:{stateValues:{},sourceOfUpdate:{},ignoreUpdate:!1,childrenInstructions:[],prefixForIds:""}});function useDoenetRenderer(as,rs=!0){let ns=as.componentInstructions.actions,ss=as.componentInstructions.componentName,os=as.componentInstructions.effectiveName,ls=as.coreId+ss,[us,cs]=reactExports.useState({}),{stateValues:ds,sourceOfUpdate:ps={},ignoreUpdate:fs,childrenInstructions:hs,prefixForIds:gs}=Recoil_index_20(rendererState(ls)),ys=[];const bs=Object.keys(us).length===0;for(let Ts of hs){let Ss=vs(Ts,bs);ys.push(Ss)}reactExports.useEffect(()=>{Object.keys(us).length>0&&renderersloadComponent(Object.values(us),Object.keys(us)).then(Ts=>{Object.assign(as.rendererClasses,Ts),cs({})})},[us,as.rendererClasses]);function vs(Ts,Ss){if(typeof Ts=="string")return Ts;let Ns={key:as.coreId+Ts.componentName,componentInstructions:Ts,rendererClasses:as.rendererClasses,flags:as.flags,coreId:as.coreId,callAction:as.callAction},As=as.rendererClasses[Ts.rendererType];return As?React.createElement(As,Ns):(Ss&&cs(Es=>{let _s={...Es};return Ts.rendererType in _s||(_s[Ts.rendererType]=__variableDynamicImportRuntimeHelper(Object.assign({"./renderers/alert.jsx":()=>__vitePreload(()=>import("./alert-c90a8781.js"),[]),"./renderers/angle.jsx":()=>__vitePreload(()=>import("./angle-30091d5d.js"),["assets/angle-30091d5d.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/answer.jsx":()=>__vitePreload(()=>import("./answer-5798aa41.js"),[]),"./renderers/asList.jsx":()=>__vitePreload(()=>import("./asList-c29bc521.js"),[]),"./renderers/boolean.jsx":()=>__vitePreload(()=>import("./boolean-437e292f.js"),[]),"./renderers/booleanInput.jsx":()=>__vitePreload(()=>import("./booleanInput-5b19956a.js"),["assets/booleanInput-5b19956a.js","assets/ToggleButton-57def544.js","assets/booleanInput-01650bf1.css"]),"./renderers/c.jsx":()=>__vitePreload(()=>import("./c-328881f4.js"),[]),"./renderers/callAction.jsx":()=>__vitePreload(()=>import("./callAction-4954fd7b.js"),[]),"./renderers/cell.jsx":()=>__vitePreload(()=>import("./cell-ec2c6a75.js"),[]),"./renderers/chart.jsx":()=>__vitePreload(()=>import("./chart-7ea2262d.js"),["assets/chart-7ea2262d.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/choiceInput.jsx":()=>__vitePreload(()=>import("./choiceInput-9c4307b4.js"),["assets/choiceInput-9c4307b4.js","assets/choiceInput-92287600.css"]),"./renderers/circle.jsx":()=>__vitePreload(()=>import("./circle-e7253084.js"),["assets/circle-e7253084.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/cobwebPolyline.jsx":()=>__vitePreload(()=>import("./cobwebPolyline-97c56c48.js"),["assets/cobwebPolyline-97c56c48.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/codeEditor.jsx":()=>__vitePreload(()=>import("./codeEditor-9456a083.js"),["assets/codeEditor-9456a083.js","assets/css-14ccef8c.js","assets/CodeMirror-35f8e4ac.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/codeViewer.jsx":()=>__vitePreload(()=>import("./codeViewer-b9183700.js"),["assets/codeViewer-b9183700.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/containerBlock.jsx":()=>__vitePreload(()=>import("./containerBlock-f5e1b6af.js"),["assets/containerBlock-f5e1b6af.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/containerInline.jsx":()=>__vitePreload(()=>import("./containerInline-c98df7cf.js"),[]),"./renderers/curve.jsx":()=>__vitePreload(()=>import("./curve-c366682a.js"),["assets/curve-c366682a.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/ellipsis.jsx":()=>__vitePreload(()=>import("./ellipsis-195ae941.js"),[]),"./renderers/em.jsx":()=>__vitePreload(()=>import("./em-6796dd6a.js"),[]),"./renderers/embed.jsx":()=>__vitePreload(()=>import("./embed-c6a7dbcf.js"),["assets/embed-c6a7dbcf.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/feedback.jsx":()=>__vitePreload(()=>import("./feedback-0d6d8ff8.js"),["assets/feedback-0d6d8ff8.js","assets/index-47ca4f11.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/figure.jsx":()=>__vitePreload(()=>import("./figure-ef236daa.js"),["assets/figure-ef236daa.js","assets/visibility-sensor-55e75ed1.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js"]),"./renderers/footnote.jsx":()=>__vitePreload(()=>import("./footnote-093a9cc2.js"),[]),"./renderers/graph.jsx":()=>__vitePreload(()=>import("./graph-57e1e537.js"),["assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/hint.jsx":()=>__vitePreload(()=>import("./hint-e6c88621.js"),["assets/hint-e6c88621.js","assets/index-47ca4f11.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/image.jsx":()=>__vitePreload(()=>import("./image-da34720e.js"),["assets/image-da34720e.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/label.jsx":()=>__vitePreload(()=>import("./label-1c306ce3.js"),["assets/label-1c306ce3.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/legend.jsx":()=>__vitePreload(()=>import("./legend-78658a1d.js"),["assets/legend-78658a1d.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/line.jsx":()=>__vitePreload(()=>import("./line-43a0ad82.js"),["assets/line-43a0ad82.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/lineSegment.jsx":()=>__vitePreload(()=>import("./lineSegment-97164a85.js"),["assets/lineSegment-97164a85.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/list.jsx":()=>__vitePreload(()=>import("./list-6cb6dea9.js"),["assets/list-6cb6dea9.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/math.jsx":()=>__vitePreload(()=>import("./math-7187d78d.js"),["assets/math-7187d78d.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/mathInput.jsx":()=>__vitePreload(()=>import("./mathInput-ff25072a.js"),["assets/mathInput-ff25072a.js","assets/MathInputSelector-58bfc077.js","assets/mathInput-cbd86307.css"]),"./renderers/mathList.jsx":()=>__vitePreload(()=>import("./mathList-4fb8f8ad.js"),[]),"./renderers/matrixInput.jsx":()=>__vitePreload(()=>import("./matrixInput-baa0ea60.js"),["assets/matrixInput-baa0ea60.js","assets/ActionButton-f612d279.js","assets/ActionButtonGroup-a395ceaf.js","assets/mathInput-cbd86307.css"]),"./renderers/mdash.jsx":()=>__vitePreload(()=>import("./mdash-fe43836d.js"),[]),"./renderers/nbsp.jsx":()=>__vitePreload(()=>import("./nbsp-39cd594f.js"),[]),"./renderers/ndash.jsx":()=>__vitePreload(()=>import("./ndash-6390eb8f.js"),[]),"./renderers/number.jsx":()=>__vitePreload(()=>import("./number-9609086c.js"),[]),"./renderers/numberList.jsx":()=>__vitePreload(()=>import("./numberList-0a281efa.js"),[]),"./renderers/orbitalDiagram.jsx":()=>__vitePreload(()=>import("./orbitalDiagram-f11dd287.js"),["assets/orbitalDiagram-f11dd287.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/orbitalDiagramInput.jsx":()=>__vitePreload(()=>import("./orbitalDiagramInput-7f035ba9.js"),["assets/orbitalDiagramInput-7f035ba9.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/p.jsx":()=>__vitePreload(()=>import("./p-518868cc.js"),["assets/p-518868cc.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/paginatorControls.jsx":()=>__vitePreload(()=>import("./paginatorControls-99bfd825.js"),[]),"./renderers/pegboard.jsx":()=>__vitePreload(()=>import("./pegboard-c9abe2cd.js"),["assets/pegboard-c9abe2cd.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/point.jsx":()=>__vitePreload(()=>import("./point-b3a7f195.js"),["assets/point-b3a7f195.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/polygon.jsx":()=>__vitePreload(()=>import("./polygon-07cd896e.js"),["assets/polygon-07cd896e.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/polyline.jsx":()=>__vitePreload(()=>import("./polyline-a05315bf.js"),["assets/polyline-a05315bf.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/pre.jsx":()=>__vitePreload(()=>import("./pre-c97cad3a.js"),["assets/pre-c97cad3a.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/q.jsx":()=>__vitePreload(()=>import("./q-6e12a53c.js"),[]),"./renderers/ray.jsx":()=>__vitePreload(()=>import("./ray-c17c1d64.js"),["assets/ray-c17c1d64.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/ref.jsx":()=>__vitePreload(()=>import("./ref-b907f9de.js"),[]),"./renderers/regionBetweenCurveXAxis.jsx":()=>__vitePreload(()=>import("./regionBetweenCurveXAxis-a859244d.js"),["assets/regionBetweenCurveXAxis-a859244d.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/row.jsx":()=>__vitePreload(()=>import("./row-53a40069.js"),[]),"./renderers/section.jsx":()=>__vitePreload(()=>import("./section-b73f2819.js"),["assets/section-b73f2819.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/sideBySide.jsx":()=>__vitePreload(()=>import("./sideBySide-5d149b57.js"),["assets/sideBySide-5d149b57.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/slider.jsx":()=>__vitePreload(()=>import("./slider-4de8a392.js"),["assets/slider-4de8a392.js","assets/ActionButton-f612d279.js","assets/ActionButtonGroup-a395ceaf.js"]),"./renderers/solution.jsx":()=>__vitePreload(()=>import("./solution-3639bb17.js"),["assets/solution-3639bb17.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/spreadsheet.jsx":()=>__vitePreload(()=>import("./spreadsheet-ec3406bb.js"),["assets/spreadsheet-ec3406bb.js","assets/moment-f5bb98f1.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js","assets/spreadsheet-f0a2a11b.css"]),"./renderers/sq.jsx":()=>__vitePreload(()=>import("./sq-c120de61.js"),[]),"./renderers/subsetOfRealsInput.jsx":()=>__vitePreload(()=>import("./subsetOfRealsInput-552c7467.js"),["assets/subsetOfRealsInput-552c7467.js","assets/ActionButton-f612d279.js","assets/ActionButtonGroup-a395ceaf.js","assets/ToggleButton-57def544.js","assets/ToggleButtonGroup-c2629620.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/summaryStatistics.jsx":()=>__vitePreload(()=>import("./summaryStatistics-32543040.js"),["assets/summaryStatistics-32543040.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/table.jsx":()=>__vitePreload(()=>import("./table-5d256c10.js"),["assets/table-5d256c10.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/tabular.jsx":()=>__vitePreload(()=>import("./tabular-c4050873.js"),["assets/tabular-c4050873.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/tag.jsx":()=>__vitePreload(()=>import("./tag-ff0e0cde.js"),[]),"./renderers/text.jsx":()=>__vitePreload(()=>import("./text-74742579.js"),["assets/text-74742579.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/textInput.jsx":()=>__vitePreload(()=>import("./textInput-1f45908d.js"),["assets/textInput-1f45908d.js","assets/css-14ccef8c.js"]),"./renderers/textList.jsx":()=>__vitePreload(()=>import("./textList-4e0545b9.js"),[]),"./renderers/triggerSet.jsx":()=>__vitePreload(()=>import("./triggerSet-5e33735f.js"),[]),"./renderers/updateValue.jsx":()=>__vitePreload(()=>import("./updateValue-488877e4.js"),[]),"./renderers/vector.jsx":()=>__vitePreload(()=>import("./vector-a4f5b9ff.js"),["assets/vector-a4f5b9ff.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/video.jsx":()=>__vitePreload(()=>import("./video-88119a6d.js"),["assets/video-88119a6d.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"])}),`./renderers/${Ts.rendererType}.jsx`)),_s}),null)}let xs=as.componentInstructions.rendererType;const Cs=Ts=>(Ts.componentName||(Ts={...Ts},Ts.componentName=ss),Ts.rendererType||(Ts={...Ts},Ts.rendererType=xs),as.callAction(Ts));return{name:os,id:gs+os,SVs:ds,actions:ns,children:ys,sourceOfUpdate:ps,ignoreUpdate:fs,rendererName:ls,initializeChildren:()=>{},callAction:Cs}}function returnStandardSequenceAttributes(){return{type:{createPrimitiveOfType:"string",createStateVariable:"type",defaultPrimitiveValue:"number",toLowerCase:!0,validValues:["number","math","letters"]},from:{createComponentOfType:"_componentWithSelectableType"},to:{createComponentOfType:"_componentWithSelectableType"},step:{createComponentOfType:"math"},length:{createComponentOfType:"number"},exclude:{createComponentOfType:"_componentListWithSelectableType"}}}function returnStandardSequenceStateVariableDefinitions(){let as={};return as.specifiedFrom={returnDependencies:()=>({fromAttr:{dependencyType:"attributeComponent",attributeName:"from",variableNames:["value"]}}),defaultValue:null,hasEssential:!0,essentialVarName:"from",definition:function({dependencyValues:rs}){return rs.fromAttr===null?{useEssentialOrDefaultValue:{specifiedFrom:!0}}:rs.fromAttr.stateValues.value===null?{setValue:{specifiedFrom:NaN}}:{setValue:{specifiedFrom:rs.fromAttr.stateValues.value}}}},as.specifiedTo={returnDependencies:()=>({toAttr:{dependencyType:"attributeComponent",attributeName:"to",variableNames:["value"]}}),defaultValue:null,hasEssential:!0,essentialVarName:"to",definition:function({dependencyValues:rs}){return rs.toAttr===null?{useEssentialOrDefaultValue:{specifiedTo:!0}}:rs.toAttr.stateValues.value===null?{setValue:{specifiedTo:NaN}}:{setValue:{specifiedTo:rs.toAttr.stateValues.value}}}},as.specifiedLength={returnDependencies:()=>({lengthAttr:{dependencyType:"attributeComponent",attributeName:"length",variableNames:["value"]}}),defaultValue:null,hasEssential:!0,essentialVarName:"length",definition:function({dependencyValues:rs}){return rs.lengthAttr===null?{useEssentialOrDefaultValue:{specifiedLength:!0}}:rs.lengthAttr.stateValues.value===null?{setValue:{specifiedLength:NaN}}:{setValue:{specifiedLength:rs.lengthAttr.stateValues.value}}}},as.specifiedStep={returnDependencies:()=>({stepAttr:{dependencyType:"attributeComponent",attributeName:"step",variableNames:["value"]},type:{dependencyType:"stateVariable",variableName:"type"}}),defaultValue:null,hasEssential:!0,essentialVarName:"step",definition:function({dependencyValues:rs}){if(rs.stepAttr===null)return{useEssentialOrDefaultValue:{specifiedStep:!0}};let ns=rs.stepAttr.stateValues.value;return ns===null?{setValue:{specifiedStep:NaN}}:{setValue:{specifiedStep:ns}}}},as.specifiedExclude={returnDependencies:()=>({excludeAttr:{dependencyType:"attributeComponent",attributeName:"exclude",variableNames:["values"]}}),defaultValue:[],hasEssential:!0,essentialVarName:"exclude",definition:function({dependencyValues:rs}){return rs.excludeAttr===null?{useEssentialOrDefaultValue:{specifiedExclude:!0}}:{setValue:{specifiedExclude:rs.excludeAttr.stateValues.values}}}},as.lowercase={returnDependencies:()=>({specifiedTo:{dependencyType:"stateVariable",variableName:"specifiedTo"},specifiedFrom:{dependencyType:"stateVariable",variableName:"specifiedFrom"}}),definition:function({dependencyValues:rs}){let ns=/^[A-Z]*$/,ss=!0;return rs.specifiedFrom!==null?ns.test(rs.specifiedFrom)&&(ss=!1):rs.specifiedTo!==null&&ns.test(rs.specifiedTo)&&(ss=!1),{setValue:{lowercase:ss}}}},as.validSequence={returnDependencies:()=>({specifiedLength:{dependencyType:"stateVariable",variableName:"specifiedLength"},specifiedStep:{dependencyType:"stateVariable",variableName:"specifiedStep"},specifiedFrom:{dependencyType:"stateVariable",variableName:"specifiedFrom"},specifiedTo:{dependencyType:"stateVariable",variableName:"specifiedTo"},type:{dependencyType:"stateVariable",variableName:"type"},lowercase:{dependencyType:"stateVariable",variableName:"lowercase"}}),definition:function({dependencyValues:rs}){let ns=!0;if(rs.specifiedLength!==null&&(!Number.isInteger(rs.specifiedLength)||rs.specifiedLength<0)&&(console.warn("Invalid length of sequence. Must be a non-negative integer."),ns=!1),rs.specifiedStep!==null&&rs.type!=="math"){let ss=findFiniteNumericalValue(rs.specifiedStep);Number.isFinite(ss)||(console.warn("Invalid step of sequence. Must be a number for sequence of type "+rs.type+"."),ns=!1)}if(rs.specifiedFrom!==null)if(rs.type==="number"){let ss=findFiniteNumericalValue(rs.specifiedFrom);Number.isFinite(ss)||(console.warn("Invalid from of number sequence. Must be a number"),ns=!1)}else Number.isNaN(rs.specifiedFrom)&&(console.warn("Invalid from of sequence"),ns=!1);if(rs.specifiedTo!==null)if(rs.type==="number"){let ss=findFiniteNumericalValue(rs.specifiedTo);Number.isFinite(ss)||(console.warn("Invalid to of number sequence. Must be a number"),ns=!1)}else Number.isNaN(rs.specifiedTo)&&(console.warn("Invalid to of sequence"),ns=!1);return{setValue:{validSequence:ns}}}},as.from={additionalStateVariablesDefined:["step","length","exclude"],returnDependencies:()=>({specifiedFrom:{dependencyType:"stateVariable",variableName:"specifiedFrom"},specifiedTo:{dependencyType:"stateVariable",variableName:"specifiedTo"},specifiedLength:{dependencyType:"stateVariable",variableName:"specifiedLength"},specifiedStep:{dependencyType:"stateVariable",variableName:"specifiedStep"},type:{dependencyType:"stateVariable",variableName:"type"},specifiedExclude:{dependencyType:"stateVariable",variableName:"specifiedExclude"},validSequence:{dependencyType:"stateVariable",variableName:"validSequence"}}),definition:function({dependencyValues:rs}){let ns=rs.specifiedFrom,ss=rs.specifiedTo,os=rs.specifiedStep,ls=rs.specifiedLength,us=[...rs.specifiedExclude],cs=rs.type;if(rs.type==="math")ss!==null&&(ss instanceof Context.class||(ss=Context.fromAst(ss))),ns!==null&&(ns instanceof Context.class||(ns=Context.fromAst(ns))),os!==null&&(os instanceof Context.class||(os=Context.fromAst(os)));else if(os!==null&&os instanceof Context.class&&(os=os.evaluate_to_constant()),rs.type==="letters")ns!==null&&(ns=lettersToNumber$1(ns)),ss!==null&&(ss=lettersToNumber$1(ss)),us=us.map(lettersToNumber$1);else if(rs.type==="number"){ss!==null&&(ss instanceof Context.class?ss=ss.evaluate_to_constant():ss=Number(ss)),ns!==null&&(ns instanceof Context.class?ns=ns.evaluate_to_constant():ns=Number(ns));for(let[ds,ps]of us.entries())ps instanceof Context.class?us[ds]=ps.evaluate_to_constant():us[ds]=Number(ps)}if(rs.validSequence){let ds=calculateSequenceParameters({from:ns,to:ss,step:os,length:ls,type:cs});return ds.exclude=us,{setValue:ds}}return(!Number.isInteger(ls)||ls<0)&&(ls=0),{setValue:{from:ns,step:os,length:ls,exclude:us}}}},as}function calculateSequenceParameters({from:as,to:rs,step:ns,length:ss,type:os}){if(as===null)rs===null?(os==="math"?as=Context.fromAst(1):as=1,ns===null&&(os==="math"?ns=Context.fromAst(1):ns=1),ss===null&&(ss=10)):(ns===null&&(os==="math"?ns=Context.fromAst(1):ns=1),ss===null&&(os==="math"?ss=Math.floor((rs.subtract(1).divide(ns).evaluate_to_constant()+1)*(1+1e-14)):ss=Math.floor(((rs-1)/ns+1)*(1+1e-14))),os==="math"?as=rs.subtract(ns.multiply(ss-1)).simplify():(as=rs-ns*(ss-1),os==="letters"&&as<1&&(ss=Math.floor(((rs-1)/ns+1)*(1+1e-14)),as=rs-ns*(ss-1))));else if(rs===null)ns===null&&(os==="math"?ns=Context.fromAst(1):ns=1),ss===null&&(ss=10);else if(ns===null)ss===null?os==="math"?(ns=Context.fromAst(1),ss=Math.floor(rs.subtract(as).add(1).evaluate_to_constant()*(1+1e-14))):(ns=1,ss=Math.floor((rs-as+1)*(1+1e-14))):os==="math"?ns=rs.subtract(as).divide(ss-1):(ns=(rs-as)/(ss-1),os==="letters"&&(ns=Math.floor(ns)));else if(ss===null)os==="math"?ss=Math.floor(rs.subtract(as).divide(ns).add(1).evaluate_to_constant()*(1+1e-14)):ss=Math.floor(((rs-as)/ns+1)*(1+1e-14));else throw Error("Can't define from, to, step, and length for sequence");return(!Number.isInteger(ss)||ss<0)&&(console.warn("Invalid length of sequence. Must be a non-negative integer."),ss=0),{from:as,step:ns,length:ss}}function returnSequenceValues({from:as,step:rs,length:ns,exclude:ss,type:os,lowercase:ls,maxNum:us},cs=!1){let ds=[],ps=0;for(let fs=0;fs0&&(os==="math"?hs=hs.add(rs.multiply(Context.fromAst(fs))).expand().simplify():hs+=rs*fs),os==="math"){if(ss.some(gs=>gs&&gs.equals(hs)))continue}else if(os==="number"){if(ss.some(gs=>Math.abs(gs-hs)<=1e-14*Math.max(Math.abs(gs),Math.abs(hs))))continue}else if(ss.includes(hs))continue;if(os==="letters"&&(hs=numberToLetters(hs,ls)),cs?ds.push({value:hs,originalIndex:fs}):ds.push(hs),ps++,ps===us)break}return ds}function returnSequenceValueForIndex({index:as,from:rs,step:ns,length:ss,exclude:os,type:ls,lowercase:us}){if(!(as>=0&&(ss===void 0||as0&&(ls==="math"?cs=cs.add(ns.multiply(Context.fromAst(as))).expand().simplify():cs+=ns*as),ls==="math"){if(os.some(ds=>ds&&ds.equals(cs)))return null}else if(ls==="number"){if(os.some(ds=>Math.abs(ds-cs)<=1e-14*Math.max(Math.abs(ds),Math.abs(cs))))return null}else if(os.includes(cs))return null;return ls==="letters"&&(cs=numberToLetters(cs,us)),cs}function lettersToNumber$1(as){try{as=as.toUpperCase()}catch{console.warn("Cannot convert "+as+" to a number");return}let rs=0,ns=as.length,ss=ns;for(;(ss-=1)>-1;){let os=as.charCodeAt(ss)-64;if(os<1||os>26){console.warn("Cannot convert "+as+" to a number");return}rs+=os*Math.pow(26,ns-1-ss)}return rs}function numberToLetters(as,rs){as--;let ns=65;rs&&(ns=97);let ss="";for(;;){let os=as%26;if(ss=String.fromCharCode(ns+os)+ss,as<26)break;as=Math.floor(as/26)-1}return ss}let styleAttributes={lineColor:{componentType:"text"},lineColorWord:{componentType:"text"},lineColorDarkMode:{componentType:"text"},lineColorWordDarkMode:{componentType:"text"},lineOpacity:{componentType:"number"},lineWidth:{componentType:"number"},lineWidthWord:{componentType:"text"},lineStyle:{componentType:"text"},lineStyleWord:{componentType:"text"},markerColor:{componentType:"text"},markerColorWord:{componentType:"text"},markerColorDarkMode:{componentType:"text"},markerColorWordDarkMode:{componentType:"text"},markerStyle:{componentType:"text"},markerStyleWord:{componentType:"text"},markerSize:{componentType:"number"},fillColor:{componentType:"text"},fillColorWord:{componentType:"text"},fillColorDarkMode:{componentType:"text"},fillColorWordDarkMode:{componentType:"text"},fillOpacity:{componentType:"number"}},defaultStyle={lineColor:"#648FFF",lineColorWord:"blue",lineColorDarkMode:"#648FFF",lineColorWordDarkMode:"blue",lineOpacity:.7,lineWidth:4,lineWidthWord:"thick",lineStyle:"solid",lineStyleWord:"",markerColor:"#648FFF",markerColorWord:"blue",markerColorDarkMode:"#648FFF",markerColorWordDarkMode:"blue",markerStyle:"circle",markerStyleWord:"point",markerSize:5,fillColor:"#648FFF",fillColorWord:"blue",fillColorDarkMode:"#648FFF",fillColorWordDarkMode:"blue",fillOpacity:.3};function returnDefaultStyleDefinitions(){return{1:{lineColor:"#648FFF",lineColorWord:"blue",lineColorDarkMode:"#648FFF",lineColorWordDarkMode:"blue",lineOpacity:.7,lineWidth:4,lineWidthWord:"thick",lineStyle:"solid",lineStyleWord:"",markerColor:"#648FFF",markerColorWord:"blue",markerColorDarkMode:"#648FFF",markerColorWordDarkMode:"blue",markerStyle:"circle",markerStyleWord:"point",markerSize:5,fillColor:"#648FFF",fillColorWord:"blue",fillColorDarkMode:"#648FFF",fillColorWordDarkMode:"blue",fillOpacity:.3},2:{lineColor:"#D4042D",lineColorWord:"red",lineColorDarkMode:"#D4042D",lineColorWordDarkMode:"red",lineOpacity:.7,lineWidth:2,lineWidthWord:"",lineStyle:"solid",lineStyleWord:"",markerColor:"#D4042D",markerColorWord:"red",markerColorDarkMode:"#D4042D",markerColorWordDarkMode:"red",markerStyle:"square",markerStyleWord:"square",markerSize:5,fillColor:"#D4042D",fillColorWord:"red",fillColorDarkMode:"#D4042D",fillColorWordDarkMode:"red",fillOpacity:.3},3:{lineColor:"#F19143",lineColorWord:"orange",lineColorDarkMode:"#F19143",lineColorWordDarkMode:"orange",lineOpacity:.7,lineWidth:3,lineWidthWord:"",lineStyle:"solid",lineStyleWord:"",markerColor:"#F19143",markerColorWord:"orange",markerColorDarkMode:"#F19143",markerColorWordDarkMode:"orange",markerStyle:"triangle",markerStyleWord:"triangle",markerSize:5,fillColor:"#F19143",fillColorWord:"orange",fillColorDarkMode:"#F19143",fillColorWordDarkMode:"orange",fillOpacity:.3},4:{lineColor:"#644CD6",lineColorWord:"purple",lineColorDarkMode:"#644CD6",lineColorWordDarkMode:"purple",lineOpacity:.7,lineWidth:2,lineWidthWord:"",lineStyle:"solid",lineStyleWord:"",markerColor:"#644CD6",markerColorWord:"purple",markerColorDarkMode:"#644CD6",markerColorWordDarkMode:"purple",markerStyle:"diamond",markerStyleWord:"diamond",markerSize:5,fillColor:"#644CD6",fillColorWord:"purple",fillColorDarkMode:"#644CD6",fillColorWordDarkMode:"purple",fillOpacity:.3},5:{lineColor:"black",lineColorWord:"black",lineColorDarkMode:"white",lineColorWordDarkMode:"white",lineOpacity:.7,lineWidth:1,lineWidthWord:"thin",lineStyle:"solid",lineStyleWord:"",markerColor:"black",markerColorWord:"black",markerColorDarkMode:"white",markerColorWordDarkMode:"white",markerStyle:"circle",markerStyleWord:"point",markerSize:5,fillColor:"black",fillColorWord:"black",fillColorDarkMode:"white",fillColorWordDarkMode:"white",fillOpacity:.3},6:{lineColor:"gray",lineColorWord:"gray",lineColorDarkMode:"gray",lineColorWordDarkMode:"gray",lineOpacity:.7,lineWidth:1,lineWidthWord:"thin",lineStyle:"dotted",lineStyleWord:"dotted",markerColor:"gray",markerColorWord:"gray",markerColorDarkMode:"gray",markerColorWordDarkMode:"gray",markerStyle:"circle",markerStyleWord:"point",markerSize:5,fillColor:"gray",fillColorWord:"gray",fillColorDarkMode:"gray",fillColorWordDarkMode:"gray",fillOpacity:.3}}}function returnStyleDefinitionStateVariables(){let as={};return as.setupChildren={returnDependencies:()=>({setupChildren:{dependencyType:"child",childGroups:["setups"],proceedIfAllChildrenNotMatched:!0}}),definition({dependencyValues:rs}){return{setValue:{setupChildren:rs.setupChildren}}}},as.styleDefinitions={stateVariablesDeterminingDependencies:["setupChildren"],returnDependencies({stateValues:rs}){let ns={ancestorWithStyle:{dependencyType:"ancestor",variableNames:["styleDefinitions"]},setupChildren:{dependencyType:"child",childGroups:["setups"],proceedIfAllChildrenNotMatched:!0}};for(let ss of rs.setupChildren)ns[`styleDefinitionsOf${ss.componentName}`]={dependencyType:"child",parentName:ss.componentName,childGroups:["styleDefinitions"],variableNames:["value"]};return ns},definition({dependencyValues:rs}){let ns={},ss;rs.ancestorWithStyle&&(ss=rs.ancestorWithStyle.stateValues.styleDefinitions),ss||(ss=returnDefaultStyleDefinitions());for(let ls in ss)ns[ls]=Object.assign({},ss[ls]);let os=[];for(let ls of rs.setupChildren)os.push(...rs[`styleDefinitionsOf${ls.componentName}`]);for(let ls of os){let us=ls.stateValues.value;for(let cs in us){let ds=ns[cs];ds||(ds=ns[cs]=Object.assign({},defaultStyle));let ps=Object.assign({},us[cs]);"markerColor"in ps&&!("markerColorWord"in ps)&&(ps.markerColorWord=ps.markerColor),"markerColorDarkMode"in ps&&!("markerColorWordDarkMode"in ps)&&(ps.markerColorWordDarkMode=ps.markerColorDarkMode),"markerColor"in ps&&!("markerColorDarkMode"in ps)&&(ps.markerColorDarkMode=ps.markerColor,ps.markerColorWordDarkMode=ps.markerWordColor),"markerStyle"in ps&&!("markerStyleWord"in ps)&&(ps.markerStyleWord=ps.markerStyle,ps.markerStyleWord==="circle"?ps.markerStyleWord="point":ps.markerStyleWord.slice(0,8)==="triangle"&&(ps.markerStyleWord="triangle")),"lineColor"in ps&&!("lineColorWord"in ps)&&(ps.lineColorWord=ps.lineColor),"lineColorDarkMode"in ps&&!("lineColorWordDarkMode"in ps)&&(ps.lineColorWordDarkMode=ps.lineColorDarkMode),"lineColor"in ps&&!("lineColorDarkMode"in ps)&&(ps.lineColorDarkMode=ps.lineColor,ps.lineColorWordDarkMode=ps.lineWordColor),"fillColor"in ps&&!("fillColorWord"in ps)&&(ps.fillColorWord=ps.fillColor),"fillColorDarkMode"in ps&&!("fillColorWordDarkMode"in ps)&&(ps.fillColorWordDarkMode=ps.fillColorDarkMode),"fillColor"in ps&&!("fillColorDarkMode"in ps)&&(ps.fillColorDarkMode=ps.fillColor,ps.fillColorWordDarkMode=ps.fillWordColor),"lineWidth"in ps&&!("lineWidthWord"in ps)&&(ps.lineWidth>=4?ps.lineWidthWord="thick":ps.lineWidth<=1?ps.lineWidthWord="thin":ps.lineWidthWord=""),"lineStyle"in ps&&!("lineStyleWord"in ps)&&(ps.lineStyle==="dashed"?ps.lineStyleWord="dashed":ps.lineStyle==="dotted"?ps.lineStyleWord="dotted":ps.lineStyleWord=""),Object.assign(ds,ps)}}return{setValue:{styleDefinitions:ns}}}},as}function returnSelectedStyleStateVariableDefinition(){return{selectedStyle:{forRenderer:!0,willNeverBeEssential:!0,returnDependencies:()=>({styleNumber:{dependencyType:"stateVariable",variableName:"styleNumber"},ancestorWithStyle:{dependencyType:"ancestor",variableNames:["styleDefinitions"]}}),definition:function({dependencyValues:as}){let rs=as.ancestorWithStyle.stateValues.styleDefinitions;rs||(rs=returnDefaultStyleDefinitions());let ns=rs[as.styleNumber];return ns===void 0&&(ns=defaultStyle),{setValue:{selectedStyle:ns}}}}}}function createStateProxyHandler(){return{get:function(as,rs){let ns=as[rs];return ns!==void 0&&(ns.isArray&&(ns.public||ns.trackChanges)?ns=new Proxy(ns.value,createArrayProxyHandler({variable:rs,nDimensions:ns.nDimensions})):ns=ns.value),ns},set:function(as,rs,ns){throw Error("Property "+rs+" is read-only")},deleteProperty:function(as,rs){throw Error("Property "+rs+" is read-only")}}}function createArrayProxyHandler({variable:as,nDimensions:rs,indicesSoFar:ns=[]}){return{variable:as,nDimensions:rs,indicesSoFar:ns,get:function(ss,os){if(os==="then"&&ss instanceof Promise)return us=>ss.then.bind(ss)(cs=>us(cs!==null&&typeof cs=="object"?new Proxy(cs,createArrayProxyHandler({variable:this.variable,nDimensions:this.nDimensions,indicesSoFar:this.indicesSoFar})):cs));let ls=ss[os];return ls!==null&&typeof ls=="object"&&rs>1&&(ls=new Proxy(ls,createArrayProxyHandler({variable:this.variable,nDimensions:this.nDimensions-1,indicesSoFar:[...this.indicesSoFar,os]}))),ls},set:function(ss,os,ls){throw Error("Property "+os+" is read-only")},deleteProperty:function(ss,os){throw Error("Property "+os+" is read-only")}}}function enumerateSelectionCombinations({numberOfIndices:as,numberOfOptions:rs,maxNumber:ns=1/0,withReplacement:ss=!1,skipZero:os=!1}){if(as===1){let ds=[...Array(rs).keys()];return ds=ds.slice(1),os||(ds=[...ds,0]),ds=ds.slice(0,ns),ds=ds.map(ps=>[ps]),ds}let ls=enumerateSelectionCombinations({numberOfIndices:as-1,numberOfOptions:rs,maxNumber:ns,withReplacement:ss,skipZero:!ss}),us=[],cs=0;for(let ds of ls)for(let ps=1;ps<=rs;ps++){let fs=[ps%rs,...ds.map(hs=>(ps+hs)%rs)];if(!(os&&fs.includes(0))&&(us.push(fs),cs++,cs>=ns))return us}return us}function enumerateCombinations({numberOfOptionsByIndex:as,maxNumber:rs=1/0}){let ns=as.length;if(ns===0)return[];let ss=[];for(let bs=0;bs[...vs,...bs],[]).reduce((bs,vs)=>Math.max(bs,vs),1);if(os===1){let bs=as.reduce((xs,Cs)=>xs*Cs);bs=Math.min(bs,rs);let vs=[];for(let xs=0;xsxs%Ts);vs.push(Cs)}return vs}if(ns===2){let bs=os,vs=Context.math.lcm(...as),xs=[],Cs=0;for(let Ts=0;Ts=rs)return xs}return xs}let ls=[];for(let bs=0;bs1?vs.push(Context.math.lcm(as[bs],as[xs])):vs.push(null);ls.push(vs)}let us=ls.reduce((bs,vs)=>[...vs,...bs],[]).filter(bs=>bs!==null).reduce((bs,vs)=>Math.min(bs,vs),1/0),cs;for(let bs=0;bs{if(os.length===0)ns.push(ls);else for(let us=0;us=rs)return}};return ss(as),ns}function getVariantsForDescendantsForUniqueVariants({variantIndex:as,serializedComponent:rs,componentInfoObjects:ns}){var cs;let ss=(cs=rs.variants)==null?void 0:cs.descendantVariantComponents;if(ss===void 0)return{success:!1};let os=ss.map(ds=>ds.variants.numberOfVariants),ls=enumerateCombinations({numberOfOptionsByIndex:os,maxNumber:as})[as-1],us=[];for(let[ds,ps]of ss.entries()){let hs=ns.allComponentClasses[ps.componentType].getUniqueVariant({serializedComponent:ps,variantIndex:ls[ds]+1,componentInfoObjects:ns});if(hs.success)us.push(hs.desiredVariant);else return{succss:!1}}return{success:!0,desiredVariants:us}}function setUpVariantSeedAndRng({serializedComponent:as,sharedParameters:rs,descendantVariantComponents:ns,useSubpartVariantRng:ss=!1}){let os,ls;if(as.variants&&(ls=as.variants.desiredVariant),(ls==null?void 0:ls.seed)!==void 0?os=ls.seed.toString():ss?os=rs.subpartVariantRng().toString().slice(2):os=rs.variantRng().toString().slice(2),rs.variantSeed=os,rs.variantRng=new rs.rngClass(rs.variantSeed),rs.subpartVariantRng=new rs.rngClass(rs.variantSeed+"s"),ls!=null&&ls.subvariants&&ns)for(let us in ls.subvariants){let cs=ls.subvariants[us],ds=ns[us];if(ds===void 0)break;ds.variants.desiredVariant=cs}}function gatherVariantComponents({serializedComponents:as,componentInfoObjects:rs}){let ns=[];for(let ss of as){if(typeof ss!="object")continue;if(ss.variants||(ss.variants={}),ss.variants.isVariantComponent){ns.push(ss);continue}if(ss.componentType in rs.componentTypesCreatingVariants){ss.variants.isVariantComponent=!0,ns.push(ss);continue}if(!ss.children)continue;if(ss.children.some(us=>us.componentType==="variantControl")){ss.variants.isVariantComponent=!0,ns.push(ss);continue}let ls=gatherVariantComponents({serializedComponents:ss.children,componentInfoObjects:rs});ls.length>0&&(ss.variants.descendantVariantComponents=ls,ns.push(...ls))}return ns}function getNumberOfVariants({serializedComponent:as,componentInfoObjects:rs}){as.variants||(as.variants={});let ns;for(let os of as.children)if(os.componentType==="variantControl"){ns=os;break}let ss=as.componentType==="document";if(!ns){if(!ss)return{success:!1};let os=as.children.filter(ls=>ls.componentType||ls.trim()!=="");if(os.length===1&&rs.isInheritedComponentType({inheritedComponentType:os[0].componentType,baseComponentType:"_sectioningComponent"})){let ls=os[0],us=getNumberOfVariants({serializedComponent:ls,componentInfoObjects:rs});if(us.success)return as.variants.descendantVariantComponents=gatherVariantComponents({serializedComponents:as.children,componentInfoObjects:rs}),as.variants.uniqueVariants=!0,as.variants.numberOfVariants=ls.variants.numberOfVariants,as.variants.allPossibleVariants=ls.variants.allPossibleVariants,as.variants.allVariantNames=ls.variants.allVariantNames,as.variants.allPossibleVariantUniqueIndices=[...ls.variants.allPossibleVariants.keys()].map(cs=>cs+1),as.variants.allPossibleVariantSeeds=[...ls.variants.allPossibleVariants.keys()].map(cs=>(cs+1).toString()),us}}return determineVariantsForSection({serializedComponent:as,componentInfoObjects:rs,isDocument:ss})}function determineVariantsForSection({serializedComponent:as,componentInfoObjects:rs,isDocument:ns=!1}){var Ns,As,ws,Es;as.variants===void 0&&(as.variants={});let ss;for(let _s of as.children)if(_s.componentType==="variantControl"){ss=_s;break}if(!ss&&!ns)return rs.allComponentClasses._base.determineNumberOfUniqueVariants({serializedComponent:as,componentInfoObjects:rs});let os=[];if(ss!=null&&ss.attributes.variantNames&&(os=ss.attributes.variantNames.component.children.map(_s=>_s.toLowerCase())),os.length!==[...new Set(os)].length)throw Error("Duplicate variant names specified");let ls=(Ns=ss==null?void 0:ss.attributes.nVariants)==null?void 0:Ns.primitive;Number.isFinite(ls)||(ls=100),ls=Math.min(Math.max(ls,1),1e3);let us=[...os];if(us.length_s.toLowerCase()),cs=[...new Set(cs)];for(let _s of cs)if(!us.includes(_s))throw Error(`Cannot include variant ${_s} as ${_s} is a not variant name`)}let ds=(ws=ss==null?void 0:ss.attributes.variantsToExclude)==null?void 0:ws.component.children;if(ds){ds=ds.map(_s=>_s.toLowerCase());for(let _s of ds)if(!us.includes(_s))throw Error(`Cannot exclude variant ${_s} as ${_s} is not a variant name`)}else ds=[];cs?cs=cs.filter(_s=>!ds.includes(_s)):cs=[...us].filter(_s=>!ds.includes(_s));let ps=cs.map(_s=>us.indexOf(_s)+1),fs=[];ss!=null&&ss.attributes.seeds&&(fs=ss.attributes.seeds.component.children);let hs=[...fs];if(hs.lengthhs[_s-1]),ys=(ss==null?void 0:ss.attributes.uniqueVariants)!==void 0,bs=(Es=ss==null?void 0:ss.attributes.uniqueVariants)==null?void 0:Es.primitive,vs;(bs||!ys)&&(vs=rs.allComponentClasses._base.determineNumberOfUniqueVariants({serializedComponent:as,componentInfoObjects:rs}),vs.success?bs=bs||vs.numberOfVariants<=ls:bs=!1);let xs=[],Cs=[],Ts=[];if(bs)for(let[_s,$s]of ps.entries())$s<=vs.numberOfVariants&&(Cs.push($s),xs.push(cs[_s]),Ts.push(gs[_s]));else xs=cs,Cs=ps,Ts=gs;let Ss=xs.length;if(Ss===0)throw Error("No variants selected based on variantsToInclude, variantsToExclude, and the number of variants available");return as.variants.uniqueVariants=bs,as.variants.numberOfVariants=Ss,as.variants.allPossibleVariants=xs,as.variants.allVariantNames=us,as.variants.allPossibleVariantUniqueIndices=Cs,as.variants.allPossibleVariantSeeds=Ts,{success:!0,numberOfVariants:Ss}}function indexToLowercaseLetters(as){return numberToLetters(as,!0)}function renameStateVariable({stateVariableDefinitions:as,oldName:rs,newName:ns}){let ss=as[ns]=as[rs];if(delete as[rs],ss.additionalStateVariablesDefined){let ds=ss.additionalStateVariablesDefined.indexOf(rs);ds!==-1&&(ss.additionalStateVariablesDefined[ds]=ns)}let os=ss.definition,ls=["setValue","useEssentialOrDefaultValue","setEssentialValue"],us=["noChanges"];ss.definition=function(ds){let ps=os(ds);for(let fs of ls)ps[fs]&&rs in ps[fs]&&(ps[fs][ns]=ps[fs][rs],delete ps[fs][rs]);for(let fs of us)if(ps[fs]){let hs=ps[fs].indexOf(rs);hs!==-1&&(ps[fs][hs]=ns)}return ps};let cs=ss.inverseDefinition;cs&&(ss.inverseDefinition=async function(ds){let ps=ds.desiredStateVariableValues;ps[rs]=ps[ns],delete ps[ns];let fs=await cs(ds);if(fs.success)for(let hs of fs.instructions)hs.setEssentialValue===rs&&(hs.setEssentialValue=ns);return fs})}function returnDefaultGetArrayKeysFromVarName(as){return as>1?function({arrayEntryPrefix:rs,varEnding:ns,arraySize:ss,nDimensions:os}){let ls=ns.split("_").map(us=>Number(us)-1);return ls.length===os&&ls.every((us,cs)=>Number.isInteger(us)&&us>=0)?ss?ls.every((us,cs)=>us=0?ss?ostypeof ls=="object"?ls.componentType:ls));for(let ls of os){let us=this.componentInfoObjects.allComponentClasses[ls];if(us){let cs=us.rendererType;cs&&!rs.includes(cs)&&rs.push(cs)}}}}if(this.constructor.adapters)for(let ns of this.constructor.adapters){let ss;typeof ns=="string"?ss=ns:ss=ns.componentType;let os=this.componentInfoObjects.allComponentClasses[ss];if(os){let ls=os.rendererType;ls&&!rs.includes(ls)&&rs.push(ls)}}if(!this.rendererType)return rs;for(let ns in this.allChildren){let ss=this.allChildren[ns].component;if(typeof ss=="object")for(let os of ss.allPotentialRendererTypes)rs.includes(os)||rs.push(os)}return rs}potentialRendererTypesFromSerializedComponents(rs){var ss;let ns=[];for(let os of rs){let ls=this.componentInfoObjects.allComponentClasses[os.componentType];if(ls){let us=ls.rendererType;us&&!ns.includes(us)&&ns.push(us);let cs=ls.returnStateVariableInfo({onlyPublic:!0}).stateVariableDescriptions;for(let ds in cs){let ps=cs[ds],fs=(ss=ps.shadowingInstructions)==null?void 0:ss.createComponentOfType;Array.isArray(fs)||(fs=[fs]),ps.wrappingComponents&&fs.push(...flattenDeep(ps.wrappingComponents).map(hs=>typeof hs=="object"?hs.componentType:hs));for(let hs of fs){let gs=this.componentInfoObjects.allComponentClasses[hs];if(gs){let ys=gs.rendererType;ys&&!ns.includes(ys)&&ns.push(ys)}}}if(ls.adapters)for(let ds of ls.adapters){let ps;typeof ds=="string"?ps=ds:ps=ds.componentType;let fs=this.componentInfoObjects.allComponentClasses[ps];if(fs){let hs=fs.rendererType;hs&&!ns.includes(hs)&&ns.push(hs)}}}if(os.children){let us=this.potentialRendererTypesFromSerializedComponents(os.children);for(let cs of us)ns.includes(cs)||ns.push(cs)}}return ns}get childrenMatched(){return this.childrenMatchedWithPlaceholders&&!this.placeholderActiveChildrenIndices}static createAttributesObject(){return{hide:{createComponentOfType:"boolean",createStateVariable:"hide",defaultValue:!1,public:!0},disabled:{createComponentOfType:"boolean"},fixed:{createComponentOfType:"boolean",ignoreFixed:!0},modifyIndirectly:{createComponentOfType:"boolean",createStateVariable:"modifyIndirectly",defaultValue:!0,public:!0,propagateToProps:!0},styleNumber:{createComponentOfType:"number",createStateVariable:"styleNumber",defaultValue:1,public:!0,fallBackToParentStateVariable:"styleNumber"},isResponse:{createPrimitiveOfType:"boolean",createStateVariable:"isResponse",defaultValue:!1,public:!0},newNamespace:{createPrimitiveOfType:"boolean",createStateVariable:"newNamespace",defaultValue:!1,public:!0}}}static returnSugarInstructions(){return[]}static returnChildGroups(){return[]}static get childGroups(){return this.hasOwnProperty("childGroupsData")?this.childGroupsData:(this.childGroupsData=this.returnChildGroups(),this.childGroupsData)}static get childGroupOfComponentType(){return this.hasOwnProperty("childGroupOfComponentTypeData")?this.childGroupOfComponentTypeData:(this.childGroupOfComponentTypeData={},this.childGroupOfComponentTypeData)}static get childGroupIndsByName(){if(this.hasOwnProperty("childGroupIndsByNameData"))return Object.assign({},this.childGroupIndsByNameData);this.childGroupIndsByNameData={};for(let[rs,ns]of this.childGroups.entries()){if(ns.group in this.childGroupIndsByNameData)throw Error(`Invalid childGroups for componentClass ${this.componentType}: ${ns} is repeated`);this.childGroupIndsByNameData[ns.group]=rs}return Object.assign({},this.childGroupIndsByNameData)}returnMatchedChildIndices(rs){let ns=[];for(let ss of rs){let os=this.childMatchesByGroup[ss];if(!os)return;ns.push(...os)}return ns.sort((ss,os)=>ss-os)}static returnStateVariableDefinitions(){let rs={};return rs.hidden={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},forRenderer:!0,returnDependencies:()=>({hide:{dependencyType:"stateVariable",variableName:"hide",variablesOptional:!0},parentHidden:{dependencyType:"parentStateVariable",variableName:"hidden"},sourceCompositeHidden:{dependencyType:"sourceCompositeStateVariable",variableName:"hidden"},adapterSourceHidden:{dependencyType:"adapterSourceStateVariable",variableName:"hidden"}}),definition:({dependencyValues:ns})=>({setValue:{hidden:!!(ns.parentHidden||ns.sourceCompositeHidden||ns.adapterSourceHidden||ns.hide)}}),markStale:()=>({updateParentRenderedChildren:!0}),inverseDefinition({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setDependency:"hide",desiredValue:ns.hidden}]}}},rs.disabled={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},forRenderer:!0,hasEssential:!0,doNotShadowEssential:!0,defaultValue:!1,provideEssentialValuesInDefinition:!0,returnDependencies:()=>({disabledAttr:{dependencyType:"attributeComponent",attributeName:"disabled",variableNames:["value"]},readOnly:{dependencyType:"flag",flagName:"readOnly"},parentDisabled:{dependencyType:"parentStateVariable",variableName:"disabled"},sourceCompositeDisabled:{dependencyType:"sourceCompositeStateVariable",variableName:"disabled"},adapterSourceDisabled:{dependencyType:"adapterSourceStateVariable",variableName:"disabled"}}),definition({dependencyValues:ns,usedDefault:ss,essentialValues:os}){if(ns.readOnly)return{setValue:{disabled:!0}};if(ns.disabledAttr!==null)return{setValue:{disabled:ns.disabledAttr.stateValues.value}};if(os.disabled!==void 0)return{useEssentialOrDefaultValue:{disabled:!0}};let ls=!1,us=!0;return ns.parentDisabled!==null&&!ss.parentDisabled&&(ls=ls||ns.parentDisabled,us=!1),ns.sourceCompositeDisabled!==null&&!ss.sourceCompositeDisabled&&(ls=ls||ns.sourceCompositeDisabled,us=!1),ns.adapterSourceDisabled!==null&&!ss.adapterSourceDisabled&&(ls=ls||ns.adapterSourceDisabled,us=!1),us?{useEssentialOrDefaultValue:{disabled:!0}}:{setValue:{disabled:ls}}},inverseDefinition({dependencyValues:ns,desiredStateVariableValues:ss}){return ns.disabledAttr!==null?{success:!0,instructions:[{setDependency:"disabledAttr",desiredValue:ss.disabled,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"disabled",value:ss.disabled}]}}},rs.fixed={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},forRenderer:!0,defaultValue:!1,hasEssential:!0,doNotShadowEssential:!0,ignoreFixed:!0,provideEssentialValuesInDefinition:!0,returnDependencies:()=>({fixedAttr:{dependencyType:"attributeComponent",attributeName:"fixed",variableNames:["value"]},parentFixed:{dependencyType:"parentStateVariable",variableName:"fixed"},sourceCompositeFixed:{dependencyType:"sourceCompositeStateVariable",variableName:"fixed"},adapterSourceFixed:{dependencyType:"adapterSourceStateVariable",variableName:"fixed"},ignoreParentFixed:{dependencyType:"doenetAttribute",attributeName:"ignoreParentFixed"}}),definition({dependencyValues:ns,usedDefault:ss,essentialValues:os}){if(ns.fixedAttr!==null)return{setValue:{fixed:ns.fixedAttr.stateValues.value}};if(os.fixed!==void 0)return{useEssentialOrDefaultValue:{fixed:!0}};let ls=!1,us=!0;return ns.parentFixed!==null&&!ss.parentFixed&&!ns.ignoreParentFixed&&(ls=ls||ns.parentFixed,us=!1),ns.sourceCompositeFixed!==null&&!ss.sourceCompositeFixed&&(ls=ls||ns.sourceCompositeFixed,us=!1),ns.adapterSourceFixed!==null&&!ss.adapterSourceFixed&&(ls=ls||ns.adapterSourceFixed,us=!1),us?{useEssentialOrDefaultValue:{fixed:!0}}:{setValue:{fixed:ls}}},inverseDefinition({dependencyValues:ns,desiredStateVariableValues:ss}){return ns.fixedAttr!==null?{success:!0,instructions:[{setDependency:"fixedAttr",desiredValue:ss.fixed,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"fixed",value:ss.fixed}]}}},rs.isInactiveCompositeReplacement={defaultValue:!1,hasEssential:!0,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{isInactiveCompositeReplacement:!0}}),inverseDefinition({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setEssentialValue:{variableName:"isInactiveCompositeReplacement",value:ns.isInactiveCompositeReplacement}}]}}},rs.doenetML={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({doenetML:{dependencyType:"doenetML"}}),definition({dependencyValues:ns}){let ss=ns.doenetML;return ss||(ss=""),{setValue:{doenetML:ss}}}},rs}static returnNormalizedStateVariableDefinitions({attributeNames:rs,numerics:ns}){let ss=this.returnStateVariableDefinitions({attributeNames:rs,numerics:ns});if(!ss)throw Error(`Error in state variable definitions of ${this.componentType}: returnStateVariableDefinitions did not return anything`);let os=function(cs){for(let[ds,ps]of cs.entries())typeof ps=="object"&&(cs[ds]=ps.variableName)},ls=["returnDependencies","definition","inverseDefinition","stateVariablesDeterminingDependencies","stateVariablesDeterminingArraySizeDependencies","isArray","nDimensions","returnArraySizeDependencies","returnArraySize","returnArrayDependenciesByKey","arrayDefinitionByKey","inverseArrayDefinitionByKey","basedOnArrayKeyStateVariables","markStale","getPreviousDependencyValuesForMarkStale","determineDependenciesImmediately","createWorkspace","workspace","provideEssentialValuesInDefinition","providePreviousValuesInDefinition"],us={};for(let cs in ss){let ds=ss[cs];if(us[cs]=ds,ds.createWorkspace&&(ds.workspace={}),ds.additionalStateVariablesDefined){for(let[ps,fs]of ds.additionalStateVariablesDefined.entries()){let hs={};for(let ys of ls)ys in ds&&(hs[ys]=ds[ys]);hs.additionalStateVariablesDefined=[...ds.additionalStateVariablesDefined],hs.additionalStateVariablesDefined[ps]=cs,os(hs.additionalStateVariablesDefined);let gs=fs;typeof fs=="object"&&(gs=fs.variableName,fs=Object.assign({},fs),delete fs.variableName,Object.assign(hs,fs)),us[gs]=hs}os(ds.additionalStateVariablesDefined)}}return us}static returnStateVariableInfo({onlyPublic:rs=!1,onlyForRenderer:ns=!1}={}){var ds,ps;let ss=this.createAttributesObject(),os={},ls={},us={};for(let fs in ss){let hs=ss[fs],gs=hs.createStateVariable;if(gs&&(!rs||hs.public)&&(!ns||hs.forRenderer))if(hs.public){let ys=!hs.createComponentOfType,bs;ys?(bs=hs.createPrimitiveOfType,bs==="string"&&(bs="text")):bs=hs.createComponentOfType,os[gs]={createComponentOfType:bs,public:!0}}else os[gs]={}}let cs=this.returnNormalizedStateVariableDefinitions({attributeNames:Object.keys(os)});for(let fs in cs){let hs=cs[fs];if(hs.isAlias){us[fs]=hs.targetVariableName;continue}if((!rs||hs.public)&&(!ns||hs.forRenderer)&&(hs.public?os[fs]={createComponentOfType:hs.shadowingInstructions.createComponentOfType,public:!0}:os[fs]={},hs.isArray)){os[fs].isArray=!0,os[fs].nDimensions=hs.nDimensions===void 0?1:hs.nDimensions,os[fs].wrappingComponents=(ds=hs.shadowingInstructions)!=null&&ds.returnWrappingComponents?hs.shadowingInstructions.returnWrappingComponents():[];let gs;hs.entryPrefixes?gs=hs.entryPrefixes:gs=[fs];for(let ys of gs)ls[ys]={arrayVariableName:fs,nDimensions:hs.returnEntryDimensions?hs.returnEntryDimensions(ys):1,wrappingComponents:(ps=hs.shadowingInstructions)!=null&&ps.returnWrappingComponents?hs.shadowingInstructions.returnWrappingComponents(ys):[]};hs.getArrayKeysFromVarName?os[fs].getArrayKeysFromVarName=hs.getArrayKeysFromVarName:os[fs].getArrayKeysFromVarName=returnDefaultGetArrayKeysFromVarName(os[fs].nDimensions)}}return{stateVariableDescriptions:os,arrayEntryPrefixes:ls,aliases:us}}get parentName(){if(!(this.ancestors===void 0||this.ancestors.length===0))return this.ancestors[0].componentName}getAllChildrenDownstreamComponentNames(rs=!1){const ns=Object.keys(this.allChildren);let ss=Object.keys(this.downstreamDependencies);return rs!==!0&&(ss=ss.filter(os=>this.downstreamDependencies[os].inactive!==!0)),[...ns,...ss]}get allDescendants(){let rs=[];for(let ns in this.allChildren){let ss=this.allChildren[ns].component;rs=[...rs,ns,...ss.allDescendants]}return rs}async serialize(rs={}){let ns={componentType:this.componentType},ss=[],os={...rs},ls;rs.sourceAttributesToIgnoreRecursively?ls=[...rs.sourceAttributesToIgnoreRecursively]:ls=[],rs.sourceAttributesToIgnore&&(ls.push(...rs.sourceAttributesToIgnore),delete os.sourceAttributesToIgnore);{for(let us of this.definingChildren)typeof us!="object"?ss.push(us):ss.push(await us.serialize(os));if(this.serializedChildren!==void 0)for(let us of this.serializedChildren)ss.push(this.copySerializedComponent(us));ss.length>0&&(ns.children=ss)}ns.attributes={};for(let us in this.attributes){let cs=this.attributes[us];cs.component?rs.copyAll&&(ns.attributes[us]={component:await cs.component.serialize(os)}):(!ls.includes(us)||rs.copyAll)&&(ns.attributes[us]=JSON.parse(JSON.stringify(cs)))}return this.essentialState&&Object.keys(this.essentialState).length>0&&(ns.state=deepClone(this.essentialState)),rs.copyVariants&&this.state.generatedVariantInfo&&(ns.variants={desiredVariant:await this.stateValues.generatedVariantInfo}),ns.originalName=this.componentName,ns.originalDoenetAttributes=deepClone(this.doenetAttributes),ns.doenetAttributes=deepClone(this.doenetAttributes),ns.originalAttributes=deepClone(ns.attributes),delete ns.doenetAttributes.prescribedName,delete ns.doenetAttributes.assignNames,ns}copySerializedComponent(rs){if(typeof rs!="object")return rs;let ns=[];if(rs.children!==void 0)for(let os of rs.children)ns.push(this.copySerializedComponent(os));let ss={componentType:rs.componentType,originalName:rs.componentName,originalNameFromSerializedComponent:!0,children:ns,state:{},doenetAttributes:{}};return rs.doenetAttributes!==void 0&&(ss.originalDoenetAttributes=deepClone(rs.doenetAttributes),ss.doenetAttributes=deepClone(rs.doenetAttributes),ss.originalAttributes=deepClone(rs.attributes),ss.attributes=deepClone(rs.attributes),delete ss.doenetAttributes.prescribedName,delete ss.doenetAttributes.assignNames),rs.state!==void 0&&Object.assign(ss.state,rs.state),ss}static get nAdapters(){return this.adapters.length}getAdapter(rs){if(rs>=this.constructor.adapters.length)return;let ns=this.constructor.adapters[rs],ss,os,ls,us;typeof ns=="string"?ss=ns:(ss=ns.stateVariable,os=ns.componentType,ls=ns.substituteForPrimaryStateVariable,us=ns.stateVariablesToShadow);let cs=this.state[ss];if(cs===void 0||!cs.public&&!os)throw Error("Invalid adapter "+ss+" in "+this.componentType);return os===void 0&&(os=cs.shadowingInstructions.createComponentOfType),{componentType:os,downstreamDependencies:{[this.componentName]:[{dependencyType:"adapter",adapterVariable:ss,adapterTargetIdentity:{componentName:this.componentName,componentType:this.componentType},substituteForPrimaryStateVariable:ls,stateVariablesToShadow:us}]}}}static getAdapterComponentType(rs,ns){if(rs>=this.adapters.length)return;let ss=this.adapters[rs],os,ls;if(typeof ss=="string"?os=ss:(os=ss.stateVariable,ls=ss.componentType),ls===void 0){let cs=ns[this.componentType].stateVariableDescriptions[os];if(!cs)throw Error("Invalid adapter "+os+" in "+this.componentType);if(ls=cs.createComponentOfType,!ls)throw Error(`Couldn't get adapter component type for ${os} of componentType ${this.componentType}`)}return ls}static determineNumberOfUniqueVariants({serializedComponent:rs,componentInfoObjects:ns}){var us;let ss=(us=rs.variants)==null?void 0:us.numberOfVariants;if(ss!==void 0)return{success:!0,numberOfVariants:ss};let os=[];rs.children&&(os=gatherVariantComponents({serializedComponents:rs.children,componentInfoObjects:ns})),rs.variants===void 0&&(rs.variants={}),rs.variants.descendantVariantComponents=os,ss=1;let ls=[];for(let cs of os){let ps=ns.allComponentClasses[cs.componentType].determineNumberOfUniqueVariants({serializedComponent:cs,componentInfoObjects:ns});if(!ps.success)return{success:!1};ls.push(ps.numberOfVariants),ss*=ps.numberOfVariants}return rs.variants.numberOfVariants=ss,rs.variants.uniqueVariantData={numberOfVariantsByDescendant:ls},{success:!0,numberOfVariants:ss}}static getUniqueVariant({serializedComponent:rs,variantIndex:ns,componentInfoObjects:ss}){var fs;let os=(fs=rs.variants)==null?void 0:fs.numberOfVariants;if(os===void 0)return{success:!1};if(!Number.isInteger(ns)||ns<1||ns>os)return{success:!1};let ls=!1,us=rs.variants.uniqueVariantData.numberOfVariantsByDescendant,cs=rs.variants.descendantVariantComponents,ds=[];if(cs.length>0){let hs=enumerateCombinations({numberOfOptionsByIndex:us,maxNumber:ns})[ns-1].map(gs=>gs+1);for(let gs=0;gs1){let ys=cs[gs],vs=ss.allComponentClasses[ys.componentType].getUniqueVariant({serializedComponent:ys,variantIndex:hs[gs],componentInfoObjects:ss});if(!vs.success)return{success:!1};ds.push(vs.desiredVariant),ls=!0}else ds.push({})}let ps={index:ns};return ls&&(ps.subvariants=ds),{success:!0,desiredVariant:ps}}async copyDoenetMLToClipboard({actionId:rs}){let ns=await this.stateValues.doenetML;ns?this.coreFunctions.copyToClipboard(ns,rs):this.coreFunctions.resolveAction({actionId:rs})}}zs(BaseComponent,"componentType","_base"),zs(BaseComponent,"childGroupOfComponentTypeData"),zs(BaseComponent,"childGroupIndsByNameData"),zs(BaseComponent,"adapters",[]);class InlineComponent extends BaseComponent{}zs(InlineComponent,"componentType","_inline");class Text extends InlineComponent{constructor(rs){super(rs),Object.assign(this.actions,{moveText:this.moveText.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.layer={createComponentOfType:"number",createStateVariable:"layer",defaultValue:0,public:!0,forRenderer:!0},rs.anchor={createComponentOfType:"point"},rs.positionFromAnchor={createComponentOfType:"text",createStateVariable:"positionFromAnchor",defaultValue:"center",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft","top","bottom","left","right","center"]},rs.styleNumber.defaultValue=0,rs}static returnChildGroups(){return[{group:"textLike",componentTypes:["string","text","_singleCharacterInline","_inlineRenderInlineChildren"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=returnSelectedStyleStateVariableDefinition();return Object.assign(rs,ns),rs.value={public:!0,shadowingInstructions:{createComponentOfType:this.componentType,addAttributeComponentsShadowingStateVariables:{fixed:{stateVariableToShadow:"fixed"}}},hasEssential:!0,returnDependencies:()=>({textLikeChildren:{dependencyType:"child",childGroups:["textLike"],variableNames:["text"]}}),defaultValue:"",set:ss=>ss===null?"":String(ss),definition:function({dependencyValues:ss}){if(ss.textLikeChildren.length===0)return{useEssentialOrDefaultValue:{value:!0}};let os="";for(let ls of ss.textLikeChildren)typeof ls=="string"?os+=ls:os+=ls.stateValues.text;return{setValue:{value:os}}},inverseDefinition:function({desiredStateVariableValues:ss,dependencyValues:os}){let ls=os.textLikeChildren.length;return ls>1?{success:!1}:ls===1?{success:!0,instructions:[{setDependency:"textLikeChildren",desiredValue:ss.value,childIndex:0,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"value",value:ss.value===null?"":String(ss.value)}]}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition:({dependencyValues:ss})=>({setValue:{text:ss.value}}),inverseDefinition:({desiredStateVariableValues:ss})=>({success:!0,instructions:[{setDependency:"value",desiredValue:ss.text}]})},rs.anchor={defaultValue:Context.fromText("(0,0)"),public:!0,forRenderer:!0,hasEssential:!0,shadowingInstructions:{createComponentOfType:"point"},returnDependencies:()=>({anchorAttr:{dependencyType:"attributeComponent",attributeName:"anchor",variableNames:["coords"]}}),definition({dependencyValues:ss}){return ss.anchorAttr?{setValue:{anchor:ss.anchorAttr.stateValues.coords}}:{useEssentialOrDefaultValue:{anchor:!0}}},async inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os,stateValues:ls,initialChange:us}){return us&&!await ls.draggable?{success:!1}:os.anchorAttr?{success:!0,instructions:[{setDependency:"anchorAttr",desiredValue:ss.anchor,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"anchor",value:ss.anchor}]}}},rs}async moveText({x:rs,y:ns,z:ss,transient:os,actionId:ls,sourceInformation:us={},skipRendererUpdate:cs=!1}){let ds=["vector"];return rs!==void 0&&(ds[1]=rs),ns!==void 0&&(ds[2]=ns),ss!==void 0&&(ds[3]=ss),os?await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],transient:os,actionId:ls,sourceInformation:us,skipRendererUpdate:cs}):await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],actionId:ls,sourceInformation:us,skipRendererUpdate:cs,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{x:rs,y:ns,z:ss}}})}}zs(Text,"componentType","text"),zs(Text,"includeBlankStringChildren",!0),zs(Text,"variableForPlainMacro","value"),zs(Text,"descendantCompositesMustHaveAReplacement",!1);class TextOrInline extends InlineComponent{static returnChildGroups(){return[{group:"inlines",componentTypes:["_inline"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.value={public:!0,shadowingInstructions:{createComponentOfType:this.componentType},returnDependencies:()=>({inlineChildren:{dependencyType:"child",childGroups:["inlines"],variableNames:["text"],variablesOptional:!0}}),definition:function({dependencyValues:ns}){let ss="";for(let os of ns.inlineChildren)typeof os!="object"?ss+=os.toString():typeof os.stateValues.text=="string"&&(ss+=os.stateValues.text);return{setValue:{value:ss}}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition:({dependencyValues:ns})=>({setValue:{text:ns.value}})},rs}}zs(TextOrInline,"componentType","_textOrInline"),zs(TextOrInline,"renderChildren",!0),zs(TextOrInline,"rendererType","containerInline"),zs(TextOrInline,"includeBlankStringChildren",!0);class CompositeComponent extends BaseComponent{constructor(ns){super(ns);zs(this,"replacements",[]);zs(this,"replacementsToWithhold",0);this.replacementsWorkspace={}}static returnStateVariableDefinitions(){let ns=super.returnStateVariableDefinitions();return ns.replacements={returnDependencies:()=>({replacements:{dependencyType:"replacement"}}),definition:({dependencyValues:ss})=>({setValue:{replacements:ss.replacements}})},ns.recursiveReplacements={returnDependencies:()=>({recursiveReplacements:{dependencyType:"replacement",recursive:!0}}),definition:({dependencyValues:ss})=>({setValue:{recursiveReplacements:ss.recursiveReplacements}})},ns.fullRecursiveReplacements={returnDependencies:()=>({recursiveReplacements:{dependencyType:"replacement",recursive:!0,recurseNonStandardComposites:!0}}),definition:({dependencyValues:ss})=>({setValue:{fullRecursiveReplacements:ss.recursiveReplacements}})},ns}static createSerializedReplacements(){return{replacements:[]}}static calculateReplacementChanges(){return[]}get allPotentialRendererTypes(){let ns=super.allPotentialRendererTypes;for(let ss in this.allChildren){let os=this.allChildren[ss].component;for(let ls of os.allPotentialRendererTypes)ns.includes(ls)||ns.push(ls)}if(this.replacements){for(let ss of this.replacements)if(typeof ss=="object")for(let os of ss.allPotentialRendererTypes)ns.includes(os)||ns.push(os)}return ns}}zs(CompositeComponent,"componentType","_composite"),zs(CompositeComponent,"rendererType");function postProcessCopy({serializedComponents:as,componentName:rs,addShadowDependencies:ns=!0,markAsPrimaryShadow:ss=!1,uniqueIdentifiersUsed:os=[],identifierPrefix:ls="",unlinkExternalCopies:us=!1,copiesByTargetComponentName:cs={},componentNamesFound:ds=[],assignNamesFound:ps=[],activeAliases:fs=[],init:hs=!0}){var gs;for(let ys in as){let bs=as[ys];if(typeof bs!="object")continue;let vs;if(bs.originalName){if(us){if(ds.push(bs.originalName),bs.originalDoenetAttributes&&bs.originalDoenetAttributes.assignNames){let xs;if((gs=bs.attributes.newNamespace)!=null&&gs.primitive)xs=bs.originalName;else{let Cs=bs.originalName.lastIndexOf("/");xs=bs.originalName.substring(0,Cs)}for(let Cs of bs.originalDoenetAttributes.assignNames)ds.push(xs+"/"+Cs),ps.push(xs+"/"+Cs)}bs.attributes&&(bs.attributes.alias&&fs.push(bs.attributes.alias.primitive),bs.attributes.indexAlias&&fs.push(bs.attributes.indexAlias.primitive))}if(vs=ls+bs.originalName+"|shadow",!bs.originalNameFromSerializedComponent)if(ns){let xs={[bs.originalName]:[{dependencyType:"referenceShadow",compositeName:rs}]};if(hs&&(xs[bs.originalName][0].firstLevelReplacement=!0),ss&&(xs[bs.originalName][0].isPrimaryShadow=!0),bs.state){let Cs=Object.keys(bs.state);xs[bs.originalName].downstreamStateVariables=Cs,xs[bs.originalName].upstreamStateVariables=Cs}bs.downstreamDependencies=xs}else bs.unlinkedCopySource=bs.originalName}else vs=ls+bs.componentType+"|shadowUnnamed";if(bs.componentType==="copy"&&us){let xs=bs.doenetAttributes.targetComponentName;if(xs)fs.includes(bs.doenetAttributes.target)?bs.doenetAttributes.targetComponentName=bs.doenetAttributes.target:(cs[xs]===void 0&&(cs[xs]=[]),cs[xs].push(bs));else if(!bs.attributes.uri)throw Error("we need to create a targetComponentName here, then.")}bs.uniqueIdentifier=getUniqueIdentifierFromBase(vs,os)}for(let ys in as){let bs=as[ys];if(typeof bs=="object"){postProcessCopy({serializedComponents:bs.children,componentName:rs,addShadowDependencies:ns,markAsPrimaryShadow:ss,uniqueIdentifiersUsed:os,identifierPrefix:ls,unlinkExternalCopies:us,copiesByTargetComponentName:cs,componentNamesFound:ds,assignNamesFound:ps,activeAliases:[...fs],init:!1});for(let vs in bs.attributes){let xs=bs.attributes[vs];xs.component&&(xs.component=postProcessCopy({serializedComponents:[xs.component],componentName:rs,addShadowDependencies:ns,markAsPrimaryShadow:ss,uniqueIdentifiersUsed:os,identifierPrefix:ls,unlinkExternalCopies:us,copiesByTargetComponentName:cs,componentNamesFound:ds,assignNamesFound:ps,activeAliases:[...fs],init:!1})[0])}bs.replacements&&postProcessCopy({serializedComponents:bs.replacements,componentName:rs,addShadowDependencies:ns,markAsPrimaryShadow:ss,uniqueIdentifiersUsed:os,identifierPrefix:ls,unlinkExternalCopies:us,copiesByTargetComponentName:cs,componentNamesFound:ds,assignNamesFound:ps,activeAliases:[...fs],init:!1})}}if(hs&&us){for(let ys in cs)if(!ds.includes(ys)){let bs=!1;for(let vs of ps){let xs=vs+"/",Cs=xs.length;if(ys.substring(0,Cs)===xs){bs=!0;break}}if(!bs)for(let vs of cs[ys])vs.attributes||(vs.attributes={}),vs.attributes.link={primitive:!1},vs.doenetAttributes.target=vs.doenetAttributes.targetComponentName}}return as}function convertAttributesForComponentType({attributes:as,componentType:rs,componentInfoObjects:ns,compositeAttributesObj:ss={},compositeCreatesNewNamespace:os,flags:ls}){var fs;let us=ns.allComponentClasses[rs],cs=us.createAttributesObject(),ds={};for(let hs in cs)ds[hs.toLowerCase()]=hs;let ps={};for(let hs in as){if(hs in ss&&!ss[hs].leaveRaw)continue;let gs=ds[hs.toLowerCase()],ys=cs[gs];if(ys){if(gs in ps)throw Error(`Cannot repeat prop ${gs}`);if(ps[gs]=componentFromAttribute({attrObj:ys,value:JSON.parse(JSON.stringify(as[hs])),componentInfoObjects:ns}),(fs=ps[gs].component)!=null&&fs.children){let bs=[ps[gs].component];if(applyMacros(bs,ns),removeBlankStringChildren(bs,ns),applySugar({serializedComponents:bs,componentInfoObjects:ns,isAttributeComponent:!0}),os){for(let vs of ps[gs].component.children)if(vs.componentType==="copy"){let xs=vs.doenetAttributes.target;/[a-zA-Z_]/.test(xs[0])&&(vs.doenetAttributes.target="../"+xs)}}}}else us.acceptAnyAttribute&&(ps[hs]=JSON.parse(JSON.stringify(as[hs])))}return ps}async function verifyReplacementsMatchSpecifiedType({component:as,replacements:rs,replacementChanges:ns,assignNames:ss,workspace:os={},componentInfoObjects:ls,compositeAttributesObj:us,flags:cs}){var gs,ys,bs,vs,xs;if(!((gs=as.attributes.createComponentOfType)!=null&&gs.primitive)&&!as.sharedParameters.compositesMustHaveAReplacement)return{replacements:rs,replacementChanges:ns};let ds=as.replacementsToWithhold,ps;if(!ns)ls.isInheritedComponentType({inheritedComponentType:as.componentType,baseComponentType:"template"})&&(rs=rs.filter(Cs=>Cs.componentType||Cs.trim().length>0)),ps=rs.map(Cs=>Cs.componentType),ps.length===1&&ps[0]==="externalContent"&&(ps=rs[0].children.filter(Cs=>Cs.componentType||Cs.trim().length>0).map(Cs=>Cs.componentType));else{ps=as.replacements.map(Cs=>Cs.componentType);for(let Cs of ns)if(Cs.changeType==="add"){if(Cs.replacementsToWithhold!==void 0&&(ds=Cs.replacementsToWithhold),!Cs.changeTopLevelReplacements)continue;if(Cs.serializedReplacements){let Ts=Cs.numberReplacementsToReplace;Ts>0||(Ts=0);let Ss=Cs.firstReplacementInd,Ns=Cs.serializedReplacements.map(As=>As.componentType);ps.splice(Ss,Ts,...Ns)}}else if(Cs.changeType==="delete"){if(Cs.replacementsToWithhold!==void 0&&(ds=Cs.replacementsToWithhold),Cs.changeTopLevelReplacements){let Ts=Cs.firstReplacementInd,Ss=Cs.numberReplacementsToDelete;ps.splice(Ts,Ss)}}else Cs.changeType==="changeReplacementsToWithhold"&&Cs.replacementsToWithhold!==void 0&&(ds=Cs.replacementsToWithhold)}if(ds>0&&(ps=ps.slice(0,ps.length-ds)),!((ys=as.attributes.createComponentOfType)!=null&&ys.primitive)&&as.sharedParameters.compositesMustHaveAReplacement&&ps.length>0)return{replacements:rs,replacementChanges:ns};let fs=(bs=as.attributes.createComponentOfType)==null?void 0:bs.primitive,hs=await as.stateValues.nComponentsSpecified;if(!fs){if(fs=as.sharedParameters.compositesDefaultReplacementType,!fs)throw Error("A component class specified descendantCompositesMustHaveAReplacement but didn't specify descendantCompositesDefaultReplacementType");hs=1}if(fs=ls.componentTypeLowerCaseMapping[fs.toLowerCase()],ps.length!==hs||!ps.every(Cs=>Cs===fs)){if((rs==null?void 0:rs.length)===1&&ls.isInheritedComponentType({inheritedComponentType:rs[0].componentType,baseComponentType:"template"}))return rs[0].attributes||(rs[0].attributes={}),rs[0].attributes.createComponentOfType={primitive:fs},rs[0].attributes.nComponents={primitive:hs},{replacements:rs,replacementChanges:ns};let Cs=ps.length===hs&&!(ds>0)&&((vs=os.sourceNames)==null?void 0:vs.length)===hs,Ts;Cs&&ns&&(ns.length===1&&ns[0].numberReplacementsToReplace===hs?Ts=ns[0].serializedReplacements:Cs=!1),Cs?Ts||(Ts=rs):(os.numReplacementsBySource=[],os.numNonStringReplacementsBySource=[],os.propVariablesCopiedBySource=[],os.sourceNames=[],os.uniqueIdentifiersUsedBySource={},os.uniqueIdentifiersUsedBySource[0]=[]);let Ss=(xs=as.attributes.newNamespace)==null?void 0:xs.primitive;rs=[];for(let As=0;Astypeof As!="string").length),ns){ns=[],as.replacementsToWithhold>0&&ns.push({changeType:"changeReplacementsToWithhold",replacementsToWithhold:0});let As=0;as.replacements&&(As=as.replacements.length),ns.push({changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:0,numberReplacementsToReplace:As,serializedReplacements:rs})}}return{replacements:rs,replacementChanges:ns}}class Template extends CompositeComponent{static keepChildrenSerialized({serializedComponent:rs}){return rs.children===void 0?[]:Object.keys(rs.children)}static createAttributesObject(){let rs=super.createAttributesObject();return rs.rendered={createComponentOfType:"boolean",createStateVariable:"rendered",defaultValue:this.renderedDefault,public:!0},rs.isResponse={leaveRaw:!0},rs.createComponentOfType={createPrimitiveOfType:"string"},rs.nComponents={createPrimitiveOfType:"number"},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=this;return rs.serializedChildren={returnDependencies:()=>({serializedChildren:{dependencyType:"serializedChildren",doNotProxy:!0}}),definition:function({dependencyValues:ss}){return{setValue:{serializedChildren:ss.serializedChildren}}}},rs.newNamespace={returnDependencies:()=>({newNamespace:{dependencyType:"attributePrimitive",attributeName:"newNamespace"}}),definition({dependencyValues:ss}){return{setValue:{newNamespace:ss.newNamespace}}}},rs.readyToExpandWhenResolved={returnDependencies:()=>({}),definition:function(){return{setValue:{readyToExpandWhenResolved:!0}}}},rs.isVariantComponent={returnDependencies:()=>({}),definition:()=>({setValue:{isVariantComponent:!0}})},rs.generatedVariantInfo={returnDependencies:({sharedParameters:ss,componentInfoObjects:os})=>({variantSeed:{dependencyType:"value",value:ss.variantSeed},variantDescendants:{dependencyType:"descendant",componentTypes:Object.keys(os.componentTypesCreatingVariants),variableNames:["isVariantComponent","generatedVariantInfo"],useReplacementsForComposites:!0,recurseToMatchedChildren:!1,variablesOptional:!0,includeNonActiveChildren:!0,ignoreReplacementsOfEncounteredComposites:!0}}),definition({dependencyValues:ss,componentName:os}){let ls={seed:ss.variantSeed,meta:{createdBy:os}},us=ls.subvariants=[];for(let cs of ss.variantDescendants)cs.stateValues.isVariantComponent?us.push(cs.stateValues.generatedVariantInfo):cs.stateValues.generatedVariantInfo&&us.push(...cs.stateValues.generatedVariantInfo.subvariants);return{setValue:{generatedVariantInfo:ls}}}},rs.nComponentsSpecified={returnDependencies:()=>({nComponentsAttr:{dependencyType:"attributePrimitive",attributeName:"nComponents"},typeAttr:{dependencyType:"attributePrimitive",attributeName:"createComponentOfType"}}),definition({dependencyValues:ss,componentInfoObjects:os}){let ls;if(ss.typeAttr){if(!(os.componentTypeLowerCaseMapping[ss.typeAttr.toLowerCase()]in os.allComponentClasses))throw Error(`Invalid componentType ${ss.typeAttr} of copy.`);ss.nComponentsAttr!==null?ls=ss.nComponentsAttr:ls=1}else{if(ss.nComponentsAttr!==null)throw Error(`You must specify createComponentOfType when specifying nComponents for a ${ns.componentType}.`);ls=null}return{setValue:{nComponentsSpecified:ls}}}},rs}static async createSerializedReplacements({component:rs,componentInfoObjects:ns,alwaysCreateReplacements:ss,flags:os}){var ls;if(await rs.stateValues.nComponentsSpecified,await rs.stateValues.rendered||ss){let us=deepClone(await rs.state.serializedChildren.value),cs=(ls=rs.attributes.newNamespace)==null?void 0:ls.primitive;if("isResponse"in rs.attributes)for(let fs of us){if(typeof fs!="object")continue;let hs=convertAttributesForComponentType({attributes:{isResponse:rs.attributes.isResponse},componentType:fs.componentType,componentInfoObjects:ns,compositeCreatesNewNamespace:cs,flags:os});fs.attributes||(fs.attributes={}),Object.assign(fs.attributes,hs)}let ds=processAssignNames({assignNames:rs.doenetAttributes.assignNames,serializedComponents:us,parentName:rs.componentName,parentCreatesNewNamespace:cs,componentInfoObjects:ns,originalNamesAreConsistent:!0});return{replacements:(await verifyReplacementsMatchSpecifiedType({component:rs,replacements:ds.serializedComponents,assignNames:rs.doenetAttributes.assignNames,componentInfoObjects:ns,compositeAttributesObj:this.createAttributesObject(),flags:os})).replacements}}else return{replacements:[]}}static setUpVariant({serializedComponent:rs,sharedParameters:ns,descendantVariantComponents:ss}){setUpVariantSeedAndRng({serializedComponent:rs,sharedParameters:ns,descendantVariantComponents:ss,useSubpartVariantRng:!0})}get allPotentialRendererTypes(){let rs=super.allPotentialRendererTypes,ns=this.potentialRendererTypesFromSerializedComponents(this.serializedChildren);for(let ss of ns)rs.includes(ss)||rs.push(ss);return rs}}zs(Template,"componentType","template"),zs(Template,"treatAsComponentForRecursiveReplacements",!0),zs(Template,"includeBlankStringChildren",!0),zs(Template,"renderedDefault",!1),zs(Template,"assignNamesToReplacements",!0),zs(Template,"createsVariants",!0);const vectorAndListOperators=["list",...vectorOperators];class MathComponent extends InlineComponent{constructor(rs){super(rs),Object.assign(this.actions,{moveMath:this.moveMath.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.format={createComponentOfType:"text",createStateVariable:"format",defaultValue:"text",public:!0,toLowerCase:!0,validValues:["text","latex"]},rs.simplify={createComponentOfType:"text",createStateVariable:"simplify",defaultValue:"none",public:!0,toLowerCase:!0,valueTransformations:{"":"full",true:"full",false:"none"},validValues:["none","full","numbers","numberspreserveorder"]},rs.expand={createComponentOfType:"boolean",createStateVariable:"expand",defaultValue:!1,public:!0},rs.displayDigits={createComponentOfType:"integer"},rs.displayDecimals={createComponentOfType:"integer"},rs.displaySmallAsZero={createComponentOfType:"number",valueForTrue:1e-14,valueForFalse:0},rs.padZeros={createComponentOfType:"boolean"},rs.renderMode={createComponentOfType:"text",createStateVariable:"renderMode",defaultValue:"inline",public:!0,forRenderer:!0},rs.unordered={createComponentOfType:"boolean"},rs.createVectors={createComponentOfType:"boolean",createStateVariable:"createVectors",defaultValue:!1,public:!0},rs.createIntervals={createComponentOfType:"boolean",createStateVariable:"createIntervals",defaultValue:!1,public:!0},rs.functionSymbols={createComponentOfType:"textList",createStateVariable:"functionSymbols",defaultValue:["f","g"],public:!0},rs.sourcesAreFunctionSymbols={createComponentOfType:"textList",createStateVariable:"sourcesAreFunctionSymbols",defaultValue:[]},rs.splitSymbols={createComponentOfType:"boolean",createStateVariable:"splitSymbols",defaultValue:!0,public:!0,fallBackToParentStateVariable:"splitSymbols"},rs.parseScientificNotation={createComponentOfType:"boolean",createStateVariable:"parseScientificNotation",defaultValue:!1,public:!0,fallBackToParentStateVariable:"parseScientificNotation"},rs.groupCompositeReplacements={createPrimitiveOfType:"boolean",createStateVariable:"groupCompositeReplacements",defaultValue:!0},rs.displayBlanks={createComponentOfType:"boolean",createStateVariable:"displayBlanks",defaultValue:!0,public:!0},rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.layer={createComponentOfType:"number",createStateVariable:"layer",defaultValue:0,public:!0,forRenderer:!0},rs.anchor={createComponentOfType:"point"},rs.positionFromAnchor={createComponentOfType:"text",createStateVariable:"positionFromAnchor",defaultValue:"center",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft","top","bottom","left","right","center"]},rs.styleNumber.defaultValue=0,rs}static returnChildGroups(){return[{group:"maths",componentTypes:["math"]},{group:"strings",componentTypes:["string"]},{group:"displayedMaths",componentTypes:["m","me","men"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=returnSelectedStyleStateVariableDefinition();return Object.assign(rs,ns),rs.displayDigits={public:!0,shadowingInstructions:{createComponentOfType:"integer"},hasEssential:!0,defaultValue:10,returnDependencies:()=>({mathListParentDisplayDigits:{dependencyType:"parentStateVariable",parentComponentType:"mathList",variableName:"displayDigits"},numberListParentDisplayDigits:{dependencyType:"parentStateVariable",parentComponentType:"numberList",variableName:"displayDigits"},mathListParentDisplayDecimals:{dependencyType:"parentStateVariable",parentComponentType:"mathList",variableName:"displayDecimals"},numberListParentDisplayDecimals:{dependencyType:"parentStateVariable",parentComponentType:"numberList",variableName:"displayDecimals"},displayDigitsAttr:{dependencyType:"attributeComponent",attributeName:"displayDigits",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]},mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["displayDigits"]},stringChildren:{dependencyType:"child",childGroups:["strings"]}}),definition({dependencyValues:ss,usedDefault:os}){let ls=!1,us;if(ss.mathListParentDisplayDigits!==null)if(os.mathListParentDisplayDigits)ls=!0,us=ss.mathListParentDisplayDigits;else return{setValue:{displayDigits:ss.mathListParentDisplayDigits}};if(ss.numberListParentDisplayDigits!==null)if(os.numberListParentDisplayDigits)ls=!0,us=ss.numberListParentDisplayDigits;else return{setValue:{displayDigits:ss.numberListParentDisplayDigits}};let cs=ss.numberListParentDisplayDecimals!==null&&!os.numberListParentDisplayDecimals||ss.mathListParentDisplayDecimals!==null&&!os.mathListParentDisplayDecimals,ds=ss.displayDigitsAttr===null||os.displayDigitsAttr,ps=ss.displayDecimalsAttr===null||os.displayDecimalsAttr;if(!(ds||ps)){let fs=ss.displayDigitsAttr.shadowDepth;ss.displayDecimalsAttr.shadowDepth({mathListParentDisplayDecimals:{dependencyType:"parentStateVariable",parentComponentType:"mathList",variableName:"displayDecimals"},numberListParentDisplayDecimals:{dependencyType:"parentStateVariable",parentComponentType:"numberList",variableName:"displayDecimals"},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]},mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["displayDecimals"]},stringChildren:{dependencyType:"child",childGroups:["strings"]}}),definition({dependencyValues:ss,usedDefault:os}){let ls=!1,us;if(ss.mathListParentDisplayDecimals!==null)if(os.mathListParentDisplayDecimals)ls=!0,us=ss.mathListParentDisplayDecimals;else return{setValue:{displayDecimals:ss.mathListParentDisplayDecimals}};if(ss.numberListParentDisplayDecimals!==null)if(os.numberListParentDisplayDecimals)ls=!0,us=ss.numberListParentDisplayDecimals;else return{setValue:{displayDecimals:ss.numberListParentDisplayDecimals}};if(ss.displayDecimalsAttr!==null)if(os.displayDecimalsAttr)ls=!0,us=ss.displayDecimalsAttr.stateValues.value;else return{setValue:{displayDecimals:ss.displayDecimalsAttr.stateValues.value}};if(ss.mathChildren.length===1&&ss.stringChildren.length===0)if(os.mathChildren[0]&&os.mathChildren[0].displayDecimals)ls=!0,us=ss.mathChildren[0].stateValues.displayDecimals;else return{setValue:{displayDecimals:ss.mathChildren[0].stateValues.displayDecimals}};return ls?{useEssentialOrDefaultValue:{displayDecimals:{defaultValue:us}}}:{useEssentialOrDefaultValue:{displayDecimals:!0}}}},rs.displaySmallAsZero={public:!0,shadowingInstructions:{createComponentOfType:"number"},hasEssential:!0,defaultValue:0,returnDependencies:()=>({mathListParentDisplaySmallAsZero:{dependencyType:"parentStateVariable",parentComponentType:"mathList",variableName:"displaySmallAsZero"},numberListParentDisplaySmallAsZero:{dependencyType:"parentStateVariable",parentComponentType:"numberList",variableName:"displaySmallAsZero"},displaySmallAsZeroAttr:{dependencyType:"attributeComponent",attributeName:"displaySmallAsZero",variableNames:["value"]},mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["displaySmallAsZero"]},stringChildren:{dependencyType:"child",childGroups:["strings"]}}),definition({dependencyValues:ss,usedDefault:os}){let ls=!1,us;if(ss.mathListParentDisplaySmallAsZero!==null)if(os.mathListParentDisplaySmallAsZero)ls=!0,us=ss.mathListParentDisplaySmallAsZero;else return{setValue:{displaySmallAsZero:ss.mathListParentDisplaySmallAsZero}};if(ss.numberListParentDisplaySmallAsZero!==null)if(os.numberListParentDisplaySmallAsZero)ls=!0,us=ss.numberListParentDisplaySmallAsZero;else return{setValue:{displaySmallAsZero:ss.numberListParentDisplaySmallAsZero}};if(ss.displaySmallAsZeroAttr!==null)if(os.displaySmallAsZeroAttr)ls=!0,us=ss.displaySmallAsZeroAttr.stateValues.value;else return{setValue:{displaySmallAsZero:ss.displaySmallAsZeroAttr.stateValues.value}};if(ss.mathChildren.length===1&&ss.stringChildren.length===0)if(os.mathChildren[0]&&os.mathChildren[0].displaySmallAsZero)ls=!0,us=ss.mathChildren[0].stateValues.displaySmallAsZero;else return{setValue:{displaySmallAsZero:ss.mathChildren[0].stateValues.displaySmallAsZero}};return ls?{useEssentialOrDefaultValue:{displaySmallAsZero:{defaultValue:us}}}:{useEssentialOrDefaultValue:{displaySmallAsZero:!0}}}},rs.padZeros={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},hasEssential:!0,defaultValue:!1,returnDependencies:()=>({mathListParentPadZeros:{dependencyType:"parentStateVariable",parentComponentType:"mathList",variableName:"padZeros"},numberListParentPadZeros:{dependencyType:"parentStateVariable",parentComponentType:"numberList",variableName:"padZeros"},padZerosAttr:{dependencyType:"attributeComponent",attributeName:"padZeros",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]},mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["padZeros"]},stringChildren:{dependencyType:"child",childGroups:["strings"]}}),definition({dependencyValues:ss,usedDefault:os}){let ls=!1,us;if(ss.mathListParentPadZeros!==null)if(os.mathListParentPadZeros)ls=!0,us=ss.mathListParentPadZeros;else return{setValue:{padZeros:ss.mathListParentPadZeros}};if(ss.numberListParentPadZeros!==null)if(os.numberListParentPadZeros)ls=!0,us=ss.numberListParentPadZeros;else return{setValue:{padZeros:ss.numberListParentPadZeros}};if(ss.padZerosAttr!==null)if(os.padZerosAttr)ls=!0,us=ss.padZerosAttr.stateValues.value;else return{setValue:{padZeros:ss.padZerosAttr.stateValues.value}};if(ss.mathChildren.length===1&&ss.stringChildren.length==0)if(os.mathChildren[0]&&os.mathChildren[0].padZeros)ls=!0,us=ss.mathChildren[0].stateValues.padZeros;else return{setValue:{padZeros:ss.mathChildren[0].stateValues.padZeros}};return ls?{useEssentialOrDefaultValue:{padZeros:{defaultValue:us}}}:{useEssentialOrDefaultValue:{padZeros:!0}}}},rs.valueShadow={defaultValue:Context.fromAst("_"),hasEssential:!0,essentialVarName:"value",returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{valueShadow:!0}}),inverseDefinition:function({desiredStateVariableValues:ss}){return{success:!0,instructions:[{setEssentialValue:"valueShadow",value:ss.valueShadow}]}}},rs.unordered={defaultValue:!1,public:!0,shadowingInstructions:{createComponentOfType:"boolean"},hasEssential:!0,returnDependencies:()=>({unorderedAttr:{dependencyType:"attributeComponent",attributeName:"unordered",variableNames:["value"]},mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["unordered"]}}),definition({dependencyValues:ss}){return ss.unorderedAttr===null?ss.mathChildren.length>0?{setValue:{unordered:ss.mathChildren.every(ls=>ls.stateValues.unordered)}}:{useEssentialOrDefaultValue:{unordered:!0}}:{setValue:{unordered:ss.unorderedAttr.stateValues.value}}}},rs.codePre={returnDependencies:()=>({stringChildren:{dependencyType:"child",childGroups:["strings"]}}),definition({dependencyValues:ss}){let os="math",ls=!1;do{ls=!1;for(let us of ss.stringChildren)if(us.includes(os)===!0){ls=!0,os+="m";break}}while(ls);return{setValue:{codePre:os}}}},rs.mathChildrenFunctionSymbols={returnDependencies:()=>({sourcesAreFunctionSymbols:{dependencyType:"stateVariable",variableName:"sourcesAreFunctionSymbols"},mathChildren:{dependencyType:"child",childGroups:["maths"]}}),definition({dependencyValues:ss}){let os=[];if(ss.mathChildren.compositeReplacementRange){for(let ls of ss.mathChildren.compositeReplacementRange)if(ss.sourcesAreFunctionSymbols.includes(ls.target))for(let us=ls.firstInd;us<=ls.lastInd;us++)os.push(us)}return{setValue:{mathChildrenFunctionSymbols:os}}}},rs.expressionWithCodes={hasEssential:!0,doNotShadowEssential:!0,returnDependencies:()=>({stringMathChildren:{dependencyType:"child",childGroups:["strings","maths"]},stringChildren:{dependencyType:"child",childGroups:["strings"]},mathChildren:{dependencyType:"child",childGroups:["maths"]},displayedMathChildren:{dependencyType:"child",childGroups:["displayedMaths"],variableNames:["latex"]},format:{dependencyType:"stateVariable",variableName:"format"},codePre:{dependencyType:"stateVariable",variableName:"codePre"},functionSymbols:{dependencyType:"stateVariable",variableName:"functionSymbols"},mathChildrenFunctionSymbols:{dependencyType:"stateVariable",variableName:"mathChildrenFunctionSymbols"},splitSymbols:{dependencyType:"stateVariable",variableName:"splitSymbols"},parseScientificNotation:{dependencyType:"stateVariable",variableName:"parseScientificNotation"},groupCompositeReplacements:{dependencyType:"stateVariable",variableName:"groupCompositeReplacements"}}),set:ss=>ss===null?null:convertValueToMathExpression(ss),definition:calculateExpressionWithCodes,async inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os,stateValues:ls}){let us=ss.expressionWithCodes,cs=[{setEssentialValue:"expressionWithCodes",value:us}],ds=os.stringChildren.length;if(ds===0)return{success:!1};if(os.mathChildren.length===0){let ps;await ls.format==="latex"?ps=us.toLatex():ps=us.toString(),cs.push({setDependency:"stringChildren",desiredValue:ps,childIndex:0,variableIndex:0,ignoreChildChangeForComponent:!0});for(let fs=1;fs({mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["value","canBeModified"]}}),definition:({dependencyValues:ss})=>({setValue:{mathChildrenWithCanBeModified:ss.mathChildren}})},rs.unnormalizedValue={returnDependencies:()=>({mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["value"]},stringChildren:{dependencyType:"child",childGroups:["strings"],variableNames:["value"]},expressionWithCodes:{dependencyType:"stateVariable",variableName:"expressionWithCodes"},codePre:{dependencyType:"stateVariable",variableName:"codePre"},valueShadow:{dependencyType:"stateVariable",variableName:"valueShadow"}}),set:convertValueToMathExpression,defaultValue:Context.fromAst("_"),definition:calculateMathValue,inverseDefinition:invertMath},rs.value={public:!0,shadowingInstructions:{createComponentOfType:this.componentType,attributesToShadow:["unordered","displayDigits","displayDecimals","displaySmallAsZero","padZeros","simplify","expand"],addAttributeComponentsShadowingStateVariables:{fixed:{stateVariableToShadow:"fixed"}}},returnDependencies:()=>({unnormalizedValue:{dependencyType:"stateVariable",variableName:"unnormalizedValue"},simplify:{dependencyType:"stateVariable",variableName:"simplify"},expand:{dependencyType:"stateVariable",variableName:"expand"},createVectors:{dependencyType:"stateVariable",variableName:"createVectors"},createIntervals:{dependencyType:"stateVariable",variableName:"createIntervals"}}),definition:function({dependencyValues:ss}){let os=ss.unnormalizedValue,{simplify:ls,expand:us,createVectors:cs,createIntervals:ds}=ss;return os=normalizeMathExpression({value:os,simplify:ls,expand:us,createVectors:cs,createIntervals:ds}),{setValue:{value:os}}},inverseDefinition:function({desiredStateVariableValues:ss}){return{success:!0,instructions:[{setDependency:"unnormalizedValue",desiredValue:ss.value}]}}},rs.number={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition:function({dependencyValues:ss}){return{setValue:{number:ss.value.evaluate_to_constant()}}},inverseDefinition:function({desiredStateVariableValues:ss}){return{success:!0,instructions:[{setDependency:"value",desiredValue:Context.fromAst(ss.number)}]}}},rs.isNumber={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition:function({dependencyValues:ss}){return{setValue:{isNumber:Number.isFinite(ss.value.tree)}}}},rs.isNumeric={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},returnDependencies:()=>({number:{dependencyType:"stateVariable",variableName:"number"}}),definition:function({dependencyValues:ss}){return{setValue:{isNumeric:Number.isFinite(ss.number)}}}},rs.valueForDisplay={returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"},simplify:{dependencyType:"stateVariable",variableName:"simplify"},expand:{dependencyType:"stateVariable",variableName:"expand"}}),definition:function({dependencyValues:ss,usedDefault:os}){let ls=roundForDisplay({value:ss.value,dependencyValues:ss,usedDefault:os});return{setValue:{valueForDisplay:normalizeMathExpression({value:ls,simplify:ss.simplify,expand:ss.expand})}}},inverseDefinition({desiredStateVariableValues:ss}){return{success:!0,instructions:[{setDependency:"value",desiredValue:ss.valueForDisplay}]}}},rs.latex={public:!0,forRenderer:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({valueForDisplay:{dependencyType:"stateVariable",variableName:"valueForDisplay"},padZeros:{dependencyType:"stateVariable",variableName:"padZeros"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displayBlanks:{dependencyType:"stateVariable",variableName:"displayBlanks"}}),definition:function({dependencyValues:ss,usedDefault:os}){let ls,us={};ss.padZeros&&(os.displayDigits&&!os.displayDecimals?Number.isFinite(ss.displayDecimals)&&(us.padToDecimals=ss.displayDecimals):ss.displayDigits>=1&&(us.padToDigits=ss.displayDigits)),ss.displayBlanks||(us.showBlanks=!1);try{ls=ss.valueForDisplay.toLatex(us)}catch{ss.displayBlanks?ls="_":ls=""}return{setValue:{latex:ls}}},inverseDefinition({desiredStateVariableValues:ss}){let os;try{os=Context.fromLatex(ss.latex)}catch{return{success:!1}}return{success:!0,instructions:[{setDependency:"valueForDisplay",desiredValue:os}]}}},rs.latexWithInputChildren={forRenderer:!0,returnDependencies:()=>({latex:{dependencyType:"stateVariable",variableName:"latex"}}),definition:function({dependencyValues:ss}){return{setValue:{latexWithInputChildren:[ss.latex]}}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({valueForDisplay:{dependencyType:"stateVariable",variableName:"valueForDisplay"},padZeros:{dependencyType:"stateVariable",variableName:"padZeros"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},value:{dependencyType:"stateVariable",variableName:"value"},displayBlanks:{dependencyType:"stateVariable",variableName:"displayBlanks"}}),definition:function({dependencyValues:ss,usedDefault:os}){let ls,us={};ss.padZeros&&(os.displayDigits&&!os.displayDecimals?Number.isFinite(ss.displayDecimals)&&(us.padToDecimals=ss.displayDecimals):ss.displayDigits>=1&&(us.padToDigits=ss.displayDigits)),ss.displayBlanks||(us.showBlanks=!1);try{ls=ss.valueForDisplay.toString(us)}catch{ss.displayBlanks?ls="_":ls=""}return{setValue:{text:superSubscriptsToUnicode(ls.toString())}}},async inverseDefinition({desiredStateVariableValues:ss,stateValues:os}){let ls=getFromText({functionSymbols:await os.functionSymbols,splitSymbols:await os.splitSymbols,parseScientificNotation:await os.parseScientificNotation}),us;try{us=ls(unicodeToSuperSubscripts(ss.text))}catch{return{success:!1}}return{success:!0,instructions:[{setDependency:"value",desiredValue:us}]}}},rs.codesAdjacentToStrings={returnDependencies:()=>({stringMathChildren:{dependencyType:"child",childGroups:["strings","maths"]},codePre:{dependencyType:"stateVariable",variableName:"codePre"},format:{dependencyType:"stateVariable",variableName:"format"}}),definition:calculateCodesAdjacentToStrings},rs.canBeModified={additionalStateVariablesDefined:["constantChildIndices","codeForExpression","inverseMaps","template","mathChildrenMapped"],returnDependencies:()=>({mathChildrenModifiable:{dependencyType:"child",childGroups:["maths"],variableNames:["canBeModified"]},displayedMathChildren:{dependencyType:"child",childGroups:["displayedMaths"]},expressionWithCodes:{dependencyType:"stateVariable",variableName:"expressionWithCodes"},modifyIndirectly:{dependencyType:"stateVariable",variableName:"modifyIndirectly"},fixed:{dependencyType:"stateVariable",variableName:"fixed"},codePre:{dependencyType:"stateVariable",variableName:"codePre"}}),definition:determineCanBeModified},rs.mathChildrenByVectorComponent={returnDependencies:()=>({codePre:{dependencyType:"stateVariable",variableName:"codePre"},mathChildren:{dependencyType:"child",childGroups:["maths"]},expressionWithCodes:{dependencyType:"stateVariable",variableName:"expressionWithCodes"}}),definition:function({dependencyValues:ss}){if(ss.expressionWithCodes===null)return{setValue:{mathChildrenByVectorComponent:null}};let os=ss.expressionWithCodes.tree,ls=ss.mathChildren.length;if(ls===0||!Array.isArray(os)||!vectorOperators.includes(os[0]))return{setValue:{mathChildrenByVectorComponent:null}};let us={},cs=0,ds=ss.codePre+cs;for(let ps=1;ps=ls)break}return{setValue:{mathChildrenByVectorComponent:us}}}},rs.nDimensions={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition({dependencyValues:ss}){let os=1,ls=ss.value.tree;if(Array.isArray(ls))if(vectorAndListOperators.includes(ls[0]))os=ls.length-1;else if(ls[0]==="matrix"){let us=ls[1].slice(1);us[0]===1?os=us[1]:us[1]===1&&(os=us[0])}else vectorOperators.includes(ls[1][0])&&(ls[0]==="^"&&ls[2]==="T"||ls[0]==="prime")&&(os=ls[1].length-1);return{setValue:{nDimensions:os}}}},rs.vector={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"],returnWrappingComponents(ss){return ss==="x"?[]:[["vector",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,entryPrefixes:["x"],returnArraySizeDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ss}){return[ss.nDimensions]},returnArrayDependenciesByKey(){return{globalDependencies:{value:{dependencyType:"stateVariable",variableName:"value"}}}},arrayDefinitionByKey({globalDependencyValues:ss,arraySize:os}){let ls=ss.value.tree,us=!1,cs={};if(Array.isArray(ls)){if(vectorAndListOperators.includes(ls[0])){for(let ds=0;dshs.tree)]);else if(ps[0]==="matrix"){let hs=ps[1].slice(1);if(hs[0]===1){let gs=["tuple"];for(let ys=0;yshs.tree)]],ps[2]&&ds.push(ps[2]),ds=Context.fromAst(ds));return ds||(ds=us.desiredVector[0]),{success:!0,instructions:[{setDependency:"value",desiredValue:ds}]}}},rs.x={isAlias:!0,targetVariableName:"x1"},rs.y={isAlias:!0,targetVariableName:"x2"},rs.z={isAlias:!0,targetVariableName:"x3"},rs.matrixSize={public:!0,shadowingInstructions:{createComponentOfType:"numberList"},returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition({dependencyValues:ss}){let os=[1,1],ls=ss.value.tree;return Array.isArray(ls)&&(vectorAndListOperators.includes(ls[0])?os=[ls.length-1,1]:ls[0]==="matrix"?os=ls[1].slice(1):vectorOperators.includes(ls[1][0])&&(ls[0]==="^"&&ls[2]==="T"||ls[0]==="prime")&&(os=[1,ls[1].length-1])),{setValue:{matrixSize:os}}}},rs.nRows={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({matrixSize:{dependencyType:"stateVariable",variableName:"matrixSize"}}),definition({dependencyValues:ss}){return{setValue:{nRows:ss.matrixSize[0]}}}},rs.nColumns={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({matrixSize:{dependencyType:"stateVariable",variableName:"matrixSize"}}),definition({dependencyValues:ss}){return{setValue:{nColumns:ss.matrixSize[1]}}}},rs.matrix={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"],returnWrappingComponents(ss){return ss==="matrixEntry"?[]:ss==="row"?[["matrix","matrixRow"]]:ss==="column"?[["matrix","matrixColumn"]]:[["matrixRow"],["matrix"]]}},isArray:!0,nDimensions:2,entryPrefixes:["matrixEntry","row","column","rows","columns"],getArrayKeysFromVarName({arrayEntryPrefix:ss,varEnding:os,arraySize:ls}){if(ss==="matrixEntry"){let us=os.split("_").map(cs=>Number(cs)-1);return us.length===2&&us.every(cs=>Number.isInteger(cs)&&cs>=0)?ls?us.every((cs,ds)=>cs=0?ls?usus+","+ds):[]:[us+",0"]:[]}else if(ss==="column"){let us=Number(os)-1;return Number.isInteger(us)&&us>=0?ls?usds+","+us):[]:["0,"+us]:[]}else if(ss==="rows"||ss==="columns"){if(!ls)return["0,0"];let us=[];for(let cs=0;cscs+","+ps));return us}},arrayVarNameFromPropIndex(ss,os){if(os==="matrix"||os==="rows")return ss.length===1?"row"+ss[0]:`matrixEntry${ss[0]}_${ss[1]}`;if(os==="columns")return ss.length===1?"column"+ss[0]:`matrixEntry${ss[1]}_${ss[0]}`;if(os.slice(0,3)==="row"){let ls=Number(os.slice(3));if(Number.isInteger(ls)&&ls>0)return`matrixEntry${ls}_${ss[0]}`}if(os.slice(0,6)==="column"){let ls=Number(os.slice(6));if(Number.isInteger(ls)&&ls>0)return`matrixEntry${ss[0]}_${ls}`}return null},returnArraySizeDependencies:()=>({matrixSize:{dependencyType:"stateVariable",variableName:"matrixSize"}}),returnArraySize({dependencyValues:ss}){return ss.matrixSize},returnArrayDependenciesByKey(){return{globalDependencies:{value:{dependencyType:"stateVariable",variableName:"value"}}}},arrayDefinitionByKey({globalDependencyValues:ss,arraySize:os}){let ls=ss.value.tree,us=!1,cs={};if(Array.isArray(ls)){if(vectorAndListOperators.includes(ls[0])){for(let ds=0;ds({anchorAttr:{dependencyType:"attributeComponent",attributeName:"anchor",variableNames:["coords"]}}),definition({dependencyValues:ss}){return ss.anchorAttr?{setValue:{anchor:ss.anchorAttr.stateValues.coords}}:{useEssentialOrDefaultValue:{anchor:!0}}},async inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os,stateValues:ls,initialChange:us}){return us&&!await ls.draggable?{success:!1}:os.anchorAttr?{success:!0,instructions:[{setDependency:"anchorAttr",desiredValue:ss.anchor,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"anchor",value:ss.anchor}]}}},rs}async moveMath({x:rs,y:ns,z:ss,transient:os,actionId:ls,sourceInformation:us={},skipRendererUpdate:cs=!1}){let ds=["vector"];return rs!==void 0&&(ds[1]=rs),ns!==void 0&&(ds[2]=ns),ss!==void 0&&(ds[3]=ss),os?await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],transient:os,actionId:ls,sourceInformation:us,skipRendererUpdate:cs}):await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],actionId:ls,sourceInformation:us,skipRendererUpdate:cs,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{x:rs,y:ns,z:ss}}})}}zs(MathComponent,"componentType","math"),zs(MathComponent,"primaryStateVariableForDefinition","unnormalizedValue"),zs(MathComponent,"primaryEssentialStateVariable","value"),zs(MathComponent,"variableForPlainMacro","value"),zs(MathComponent,"descendantCompositesMustHaveAReplacement",!0),zs(MathComponent,"descendantCompositesDefaultReplacementType","math"),zs(MathComponent,"adapters",[{stateVariable:"number",stateVariablesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},"text",{componentType:"subsetOfReals",stateVariable:"value",substituteForPrimaryStateVariable:"subsetValue"}]);function calculateExpressionWithCodes({dependencyValues:as,changes:rs}){if(!("stringMathChildren"in rs&&rs.stringMathChildren.componentIdentitiesChanged||"displayedMathChildren"in rs||"format"in rs||"splitSymbols"in rs||"parseScientificNotation"in rs||"functionSymbols"in rs||"mathChildrenFunctionSymbols"in rs))return{useEssentialOrDefaultValue:{expressionWithCodes:!0}};if(as.stringMathChildren.length===0)if(as.displayedMathChildren.length>0){let gs;try{gs=Context.fromLatex(as.displayedMathChildren[0].stateValues.latex)}catch{gs=Context.fromAst("_")}return{setValue:{expressionWithCodes:gs},setEssentialValue:{expressionWithCodes:gs}}}else return{setValue:{expressionWithCodes:null},setEssentialValue:{expressionWithCodes:null}};let ns="",ss=0,os="",ls=as.stringMathChildren.compositeReplacementRange,us,cs,ds,ps;as.groupCompositeReplacements&&ls.length>0&&(ds=0,ps=ls[ds].firstInd);for(let[gs,ys]of as.stringMathChildren.entries()){if(us===void 0&&gs===ps){us=ds,cs=ls[ds].lastInd,os="";let bs=cs===gs;if(!bs){for(let vs=gs;vs<=cs;vs++)if(typeof as.stringMathChildren[vs]=="string"){bs=!0;break}}bs&&(ls.length>us+1?(ds=us+1,ps=ls[ds].firstInd):(ds=void 0,ps=void 0),us=void 0,cs=void 0)}if(typeof ys=="string")ns+=" "+ys+" ";else{let bs=as.codePre+ss;ss++;let vs;as.format==="latex"?vs="\\operatorname{"+bs+"}":vs=" "+bs+" ",us!==void 0?(os&&(os+=","),os+=vs):ns+=vs}if(gs===cs){let bs=ns.trimEnd(),vs=!1;if(bs.length===0)vs=!0;else{let xs=bs[bs.length-1];if(!["{","[","(","|",","].includes(xs))vs=!0;else{let Cs=as.stringMathChildren[gs+1];if(typeof Cs!="string")vs=!0;else{let Ts=Cs.trimStart();if(Ts.length===0)vs=!0;else{let Ss=Ts[0];as.format==="latex"&&Ss==="\\"&&Ts.length>1&&(Ss=Ts[1]),["}","]",")","|",","].includes(Ss)||(vs=!0)}}}}vs&&(os="("+os+")"),ns+=os,os="",ls.length>us+1?(ds=us+1,ps=ls[ds].firstInd):(ds=void 0,ps=void 0),us=void 0,cs=void 0}}let fs=null,hs=[...as.functionSymbols];if(hs.push(...as.mathChildrenFunctionSymbols.map(gs=>as.codePre+gs)),ns==="")fs=Context.fromAst("_");else if(as.format==="text"){let gs=getFromText({functionSymbols:hs,splitSymbols:as.splitSymbols,parseScientificNotation:as.parseScientificNotation});try{fs=gs(ns)}catch{fs=Context.fromAst("_"),console.log("Invalid value for a math of text format: "+ns)}}else if(as.format==="latex"){let gs=getFromLatex({functionSymbols:hs,splitSymbols:as.splitSymbols,parseScientificNotation:as.parseScientificNotation});try{fs=gs(ns)}catch{fs=Context.fromAst("_"),console.log("Invalid value for a math of latex format: "+ns)}}return{setValue:{expressionWithCodes:fs},setEssentialValue:{expressionWithCodes:fs}}}function calculateMathValue({dependencyValues:as}={}){if(as.expressionWithCodes===null)return{setValue:{unnormalizedValue:as.valueShadow}};let rs={};for(let[ss,os]of as.mathChildren.entries())rs[as.codePre+ss]=os.stateValues.value;let ns=as.expressionWithCodes;return as.mathChildren.length>0&&(ns=ns.substitute(rs)),ns=Context.fromAst(mergeListsWithOtherContainers(ns.tree)),{setValue:{unnormalizedValue:ns}}}function calculateCodesAdjacentToStrings({dependencyValues:as}){let rs=[],ns;for(let[ss,os]of as.stringMathChildren.entries())if(typeof os=="string"){let ls=as.stringMathChildren[ss+1];if(ls!==void 0&&typeof ls=="string")continue;let us={};if(ns!==void 0&&(as.format==="latex"?us.prevCode="\\operatorname{"+as.codePre+ns+"}":us.prevCode=as.codePre+ns),ls!==void 0){let cs=0;ns!==void 0&&(cs=ns+1),as.format==="latex"?us.nextCode="\\operatorname{"+as.codePre+cs+"}":us.nextCode=as.codePre+cs}rs.push(us)}else ns===void 0?ns=0:ns++;return{setValue:{codesAdjacentToStrings:rs}}}function determineCanBeModified({dependencyValues:as}){if(!as.modifyIndirectly||as.fixed)return{setValue:{canBeModified:!1,constantChildIndices:null,codeForExpression:null,inverseMaps:null,template:null,mathChildrenMapped:null}};if(as.mathChildrenModifiable.length===0)return as.displayedMathChildren.length>0?{setValue:{canBeModified:!1,constantChildIndices:null,codeForExpression:null,inverseMaps:null,template:null,mathChildrenMapped:null}}:{setValue:{canBeModified:!0,constantChildIndices:null,codeForExpression:null,inverseMaps:null,template:null,mathChildrenMapped:null}};let rs=[],ns=[],ss=[],os={};for(let[ds,ps]of as.mathChildrenModifiable.entries()){let fs=as.codePre+ds;ps.stateValues.canBeModified===!0?(rs.push(ds),ns.push(fs)):(ss.push(fs),os[fs]=ds)}let ls=as.codePre+"expr",us=Context.utils.unflattenLeft(as.expressionWithCodes.tree),cs=checkForLinearExpression(us,ns,ls,ss);if(cs.foundLinear){let ds={},ps=cs.template,fs=new Set;for(let hs in cs.mappings){ds[hs]=cs.mappings[hs];let gs=ds[hs].mathChildSub;if(gs){let ys=rs[ns.indexOf(gs)];ds[hs].mathChildInd=ys,fs.add(Number(ys))}}return fs.has=fs.has.bind(fs),{setValue:{canBeModified:!0,constantChildIndices:os,codeForExpression:ls,inverseMaps:ds,template:ps,mathChildrenMapped:fs}}}return{setValue:{canBeModified:!1,constantChildIndices:null,codeForExpression:null,inverseMaps:null,template:null,mathChildrenMapped:null}}}function checkForLinearExpression(as,rs,ns,ss=[],os=[]){let ls=Context.variables(as);if(ls.every(ds=>!rs.includes(ds))&&ls.every(ds=>!ss.includes(ds))){let ds={},ps="x"+os.join("_");return ds[ps]={result:Context.fromAst(ns).simplify(),components:os},{foundLinear:!0,mappings:ds,template:ps}}if(!Array.isArray(as))return checkForScalarLinearExpression(as,rs,ns,os);let us=as[0],cs=as.slice(1);if(vectorAndListOperators.includes(us)){let ds={mappings:{},template:[us]},ps=0;for(let fs=0;fs!rs.includes(us))?(ns=["+",ns,["-",ls[0]]],checkForScalarLinearExpression(ls[1],rs,ns,ss)):Context.variables(ls[1]).every(us=>!rs.includes(us))?(ns=["+",ns,["-",ls[1]]],checkForScalarLinearExpression(ls[0],rs,ns,ss)):{foundLinear:!1}:os==="*"?Context.variables(ls[0]).every(us=>!rs.includes(us))?(ns=["/",ns,ls[0]],checkForScalarLinearExpression(ls[1],rs,ns,ss)):Context.variables(ls[1]).every(us=>!rs.includes(us))?(ns=["/",ns,ls[1]],checkForScalarLinearExpression(ls[0],rs,ns,ss)):{foundLinear:!1}:os==="/"?Context.variables(ls[1]).every(us=>!rs.includes(us))?(ns=["*",ns,ls[1]],checkForScalarLinearExpression(ls[0],rs,ns,ss)):{foundLinear:!1}:{foundLinear:!1}}async function invertMath({desiredStateVariableValues:as,dependencyValues:rs,stateValues:ns,workspace:ss,overrideFixed:os}){if(!await ns.canBeModified&&!os)return{success:!1};let ls=rs.mathChildren,us=rs.stringChildren.length;if(ls.length===1&&us===0)return{success:!0,instructions:[{setDependency:"mathChildren",desiredValue:as.unnormalizedValue,childIndex:0,variableIndex:0}]};let cs=convertValueToMathExpression(as.unnormalizedValue),ds=await preprocessMathInverseDefinition({desiredValue:cs,stateValues:ns,variableName:"value",workspace:ss}),ps=ds.vectorComponentsNotAffected;if(cs=ds.desiredValue,ls.length===0){let bs=[];return us>0?bs.push({setDependency:"expressionWithCodes",desiredValue:cs}):bs.push({setDependency:"valueShadow",desiredValue:cs}),{success:!0,instructions:bs}}let fs=await getExpressionPieces({expression:cs,stateValues:ns});if(!fs)return{success:!1};let hs=[],gs=[];if(ps&&await ns.mathChildrenByVectorComponent){let bs=await ns.mathChildrenByVectorComponent;for(let vs of ps)bs[vs]&&gs.push(...bs[vs])}let ys=await ns.mathChildrenWithCanBeModified;for(let[bs,vs]of ls.entries())if(ns.mathChildrenMapped.has(bs)&&ys[bs].stateValues.canBeModified){if(!gs.includes(bs)){let xs=fs[bs],Cs={},Ts=!1,Ss=await ns.constantChildIndices;for(let Ns in Ss){let As=Ss[Ns];Cs[Ns]=ls[As].stateValues.value,Ts=!0}Ts&&(xs=xs.substitute(Cs)),xs=xs.simplify(),hs.push({setDependency:"mathChildren",desiredValue:xs,childIndex:bs,variableIndex:0})}delete fs[bs]}if(us>0){let Cs=function(Ss){return typeof Ss=="string"&&Ss.substring(0,xs)===vs},Ts=function(Ss){return Array.isArray(Ss)?flattenDeep(Ss.slice(1)).some(Cs):Cs(Ss)},bs=rs.expressionWithCodes,vs=rs.codePre,xs=vs.length;if(vectorAndListOperators.includes(bs.tree[0])&&!bs.tree.slice(1).every(Ts)){let Ss=await ns.inverseMaps;for(let Ns in fs){let As=Ss[Ns];if(As.mathChildInd!==void 0)continue;let ws=As.components;bs=bs.substitute_component(ws,fs[Ns])}hs.push({setDependency:"expressionWithCodes",desiredValue:bs})}}return{success:!0,instructions:hs}}async function getExpressionPieces({expression:as,stateValues:rs}){let ns=await rs.template,ss=Context.utils.match(as.tree,ns);if(!ss&&(ss=Context.utils.match(as.tuples_to_vectors().tree,Context.fromAst(ns).tuples_to_vectors().tree),!ss&&(ss=Context.utils.match(as.to_intervals().tree,Context.fromAst(ns).to_intervals().tree),!ss&&(ss=Context.utils.match(as.tuples_to_vectors().to_intervals().tree,Context.fromAst(ns).tuples_to_vectors().to_intervals().tree),!ss))))return!1;let os={};for(let ls in ss){let us={};us[await rs.codeForExpression]=ss[ls];let cs=(await rs.inverseMaps)[ls];if(cs!==void 0){let ds=ls;cs.mathChildInd!==void 0&&(ds=cs.mathChildInd),os[ds]=cs.result.substitute(us),os[ds]=normalizeMathExpression({value:os[ds],simplify:await rs.simplify,expand:await rs.expand,createVectors:await rs.createVectors,createIntervals:await rs.createIntervals})}}return os}var Vu;let Label$1=(Vu=class extends InlineComponent{constructor(rs){super(rs),Object.assign(this.actions,{moveLabel:this.moveLabel.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.forObject={createTargetComponentNames:!0},rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.layer={createComponentOfType:"number",createStateVariable:"layer",defaultValue:0,public:!0,forRenderer:!0},rs.anchor={createComponentOfType:"point"},rs.positionFromAnchor={createComponentOfType:"text",createStateVariable:"positionFromAnchor",defaultValue:"center",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft","top","bottom","left","right","center"]},rs.styleNumber.defaultValue=0,rs}static returnChildGroups(){return[{group:"inlines",componentTypes:["_inline"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=returnSelectedStyleStateVariableDefinition();return Object.assign(rs,ns),rs.valueShadow={hasEssential:!0,defaultValue:null,returnDependencies:()=>({}),definition(){return{useEssentialOrDefaultValue:{valueShadow:!0}}},inverseDefinition({desiredStateVariableValues:ss}){return{success:!0,instructions:[{setEssentialValue:"valueShadow",value:ss.valueShadow}]}}},rs.hasLatex={public:!0,forRenderer:!0,shadowingInstructions:{createComponentOfType:"boolean"},returnDependencies:()=>({inlineChildren:{dependencyType:"child",childGroups:["inlines"],variableNames:["text","latex","value","hasLatex","renderAsMath"],variablesOptional:!0},valueShadow:{dependencyType:"stateVariable",variableName:"valueShadow"}}),definition:function({dependencyValues:ss}){if(ss.inlineChildren.length===0&&ss.valueShadow!==null){let ls=ss.valueShadow;return{setValue:{hasLatex:!!/\\\(.*\\\)/.exec(ls)}}}let os=!1;for(let ls of ss.inlineChildren)if(typeof ls=="object"){if(typeof ls.stateValues.hasLatex=="boolean"&&typeof ls.stateValues.value=="string"&&typeof ls.stateValues.text=="string"){if(ls.stateValues.hasLatex)return{setValue:{hasLatex:!0}}}else if(typeof ls.stateValues.renderAsMath=="boolean"&&typeof ls.stateValues.latex=="string"&&typeof ls.stateValues.text=="string"){if(ls.stateValues.renderAsMath)return{setValue:{hasLatex:!0}}}else if(typeof ls.stateValues.latex=="string")return{setValue:{hasLatex:!0}}}return{setValue:{hasLatex:os}}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},additionalStateVariablesDefined:[{variableName:"latex",public:!0,shadowingInstructions:{createComponentOfType:"text"}},{variableName:"value",public:!0,forRenderer:!0,shadowingInstructions:{createComponentOfType:"label",addStateVariablesShadowingStateVariables:{hasLatex:{stateVariableToShadow:"hasLatex"}}}}],returnDependencies:()=>({inlineChildren:{dependencyType:"child",childGroups:["inlines"],variableNames:["text","latex","value","hasLatex","renderAsMath"],variablesOptional:!0},valueShadow:{dependencyType:"stateVariable",variableName:"valueShadow"},hasLatex:{dependencyType:"stateVariable",variableName:"hasLatex"}}),definition:function({dependencyValues:ss}){if(ss.inlineChildren.length===0&&ss.valueShadow!==null){let us=ss.valueShadow,cs=us;return ss.hasLatex&&(cs=cs.replace(/\\\(/g,""),cs=cs.replace(/\\\)/g,"")),{setValue:{text:cs,latex:cs,value:us}}}let os="",ls="";for(let us of ss.inlineChildren)if(typeof us!="object"){let cs=us.toString();os+=cs,ls+=cs}else typeof us.stateValues.hasLatex=="boolean"&&typeof us.stateValues.value=="string"&&typeof us.stateValues.text=="string"?(os+=us.stateValues.text,ls+=us.stateValues.value):typeof us.stateValues.renderAsMath=="boolean"&&typeof us.stateValues.latex=="string"&&typeof us.stateValues.text=="string"?us.stateValues.renderAsMath?(os+=us.stateValues.latex,ls+="\\("+us.stateValues.latex+"\\)"):(os+=us.stateValues.text,ls+=us.stateValues.text):typeof us.stateValues.latex=="string"?(os+=us.stateValues.latex,ls+="\\("+us.stateValues.latex+"\\)"):typeof us.stateValues.text=="string"&&(os+=us.stateValues.text,ls+=us.stateValues.text);return{setValue:{text:os,latex:os,value:ls}}},inverseDefinition:function({desiredStateVariableValues:ss,dependencyValues:os}){let ls;if(typeof ss.value=="string")ls=ss.value;else if(typeof ss.text=="string")ls=ss.text;else if(typeof ss.latex=="string")ls=ss.latex;else return{success:!1};if(os.inlineChildren.length===0&&os.valueShadow!==null)return{success:!0,instructions:[{setDependency:"valueShadow",desiredValue:ls}]};if(os.inlineChildren.length===1){let us=os.inlineChildren[0],cs=ss.value;if(typeof us!="object")return{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:cs,childIndex:0}]};if(typeof us.stateValues.hasLatex=="boolean"&&typeof us.stateValues.value=="string"&&typeof us.stateValues.text=="string")return{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:cs,childIndex:0,variableIndex:2}]};if(typeof us.stateValues.renderAsMath=="boolean"&&typeof us.stateValues.latex=="string"&&typeof us.stateValues.text=="string")if(us.stateValues.renderAsMath){let ds=cs.match(/^\\\((.*)\\\)/);return ds&&(cs=ds[1]),{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:cs,childIndex:0,variableIndex:1}]}}else return{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:cs,childIndex:0,variableIndex:0}]};else if(typeof us.stateValues.latex=="string"){let ds=cs.match(/^\\\((.*)\\\)/);return ds&&(cs=ds[1]),{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:cs,childIndex:0,variableIndex:1}]}}else return typeof us.stateValues.text=="string"?{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:cs,childIndex:0,variableIndex:0}]}:{success:!1}}else return{success:!1}}},rs.forObjectComponentName={returnDependencies:()=>({forObject:{dependencyType:"attributeTargetComponentNames",attributeName:"forObject"}}),definition({dependencyValues:ss}){var ls;let os;return((ls=ss.forObject)==null?void 0:ls.length)===1?os=ss.forObject[0].absoluteName:os=null,{setValue:{forObjectComponentName:os}}}},rs.anchor={defaultValue:Context.fromText("(0,0)"),public:!0,forRenderer:!0,hasEssential:!0,shadowingInstructions:{createComponentOfType:"point"},returnDependencies:()=>({anchorAttr:{dependencyType:"attributeComponent",attributeName:"anchor",variableNames:["coords"]}}),definition({dependencyValues:ss}){return ss.anchorAttr?{setValue:{anchor:ss.anchorAttr.stateValues.coords}}:{useEssentialOrDefaultValue:{anchor:!0}}},async inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os,stateValues:ls,initialChange:us}){return us&&!await ls.draggable?{success:!1}:os.anchorAttr?{success:!0,instructions:[{setDependency:"anchorAttr",desiredValue:ss.anchor,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"anchor",value:ss.anchor}]}}},rs}async moveLabel({x:rs,y:ns,z:ss,transient:os,actionId:ls,sourceInformation:us={},skipRendererUpdate:cs=!1}){let ds=["vector"];return rs!==void 0&&(ds[1]=rs),ns!==void 0&&(ds[2]=ns),ss!==void 0&&(ds[3]=ss),os?await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],transient:os,actionId:ls,sourceInformation:us,skipRendererUpdate:cs}):await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],actionId:ls,sourceInformation:us,skipRendererUpdate:cs,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{x:rs,y:ns,z:ss}}})}},zs(Vu,"componentType","label"),zs(Vu,"renderChildren",!0),zs(Vu,"rendererType","label"),zs(Vu,"includeBlankStringChildren",!0),zs(Vu,"primaryStateVariableForDefinition","valueShadow"),zs(Vu,"adapters",["text"]),Vu);function returnGroupIntoComponentTypeSeparatedBySpaces({componentType:as,forceComponentType:rs=!1}){return function({matchedChildren:ns,componentInfoObjects:ss}){let os=[],ls=[];function us(){var ds;let cs=!1;if(rs){if(ls.length===1){let ps=ls[0],fs=ps.componentType;fs==="copy"&&((ds=ps.attributes)!=null&&ds.createComponentOfType)&&(!ps.attributes.nComponents||ps.attributes.nComponents.primitive===1)&&(fs=ps.attributes.createComponentOfType.primitive),ss.isInheritedComponentType({inheritedComponentType:fs,baseComponentType:as})&&(os.push(ps),cs=!0)}}else ls.length===1&&typeof ls[0]!="string"&&(os.push(ls[0]),cs=!0);!cs&&ls.length>0&&os.push({componentType:as,children:ls}),ls=[]}for(let cs of ns)if(typeof cs!="string")ls.push(cs);else{let ds=cs.split(/\s+/),ps=ds[0];ps===""?us():ls.push(ps);for(let fs of ds.slice(1))us(),fs!==""&&ls.push(fs)}return us(),{success:!0,newChildren:os}}}function returnBreakStringsIntoComponentTypeBySpaces({componentType:as}){return function({matchedChildren:rs}){return{success:!0,newChildren:rs.reduce(function(ss,os){return typeof os=="string"?[...ss,...os.split(/\s+/).filter(ls=>ls).map(ls=>({componentType:as,children:[ls]}))]:[...ss,os]},[])}}}class MathList extends InlineComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.unordered={createComponentOfType:"boolean",createStateVariable:"unordered",defaultValue:!1,public:!0},rs.maximumNumber={createComponentOfType:"number",createStateVariable:"maximumNumber",defaultValue:null,public:!0},rs.mergeMathLists={createComponentOfType:"boolean"},rs.displayDigits={createComponentOfType:"integer"},rs.displayDecimals={createComponentOfType:"integer",createStateVariable:"displayDecimals",defaultValue:null,public:!0},rs.displaySmallAsZero={createComponentOfType:"number",createStateVariable:"displaySmallAsZero",valueForTrue:1e-14,valueForFalse:0,defaultValue:0,public:!0},rs.padZeros={createComponentOfType:"boolean",createStateVariable:"padZeros",defaultValue:!1,public:!0},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=returnGroupIntoComponentTypeSeparatedBySpaces({componentType:"math"}),ss=returnBreakStringsIntoComponentTypeBySpaces({componentType:"math"});return rs.push({replacementFunction:function({matchedChildren:os,isAttributeComponent:ls=!1,createdFromMacro:us=!1}){return ls&&!us?ns({matchedChildren:os}):ss({matchedChildren:os})}}),rs}static returnChildGroups(){return[{group:"maths",componentTypes:["math"]},{group:"mathLists",componentTypes:["mathList"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.overrideChildHide={returnDependencies:()=>({}),definition:()=>({setValue:{overrideChildHide:!0}})},rs.displayDigits={public:!0,shadowingInstructions:{createComponentOfType:"integer"},hasEssential:!0,defaultValue:10,returnDependencies:()=>({displayDigitsAttr:{dependencyType:"attributeComponent",attributeName:"displayDigits",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]}}),definition({dependencyValues:ns,usedDefault:ss}){if(ns.displayDigitsAttr!==null){let os=ss.displayDigitsAttr,ls=ns.displayDecimalsAttr===null||ss.displayDecimalsAttr;if(!(os||ls)){let us=ns.displayDigitsAttr.shadowDepth;ns.displayDecimalsAttr.shadowDepth({}),definition:()=>({useEssentialOrDefaultValue:{mathsShadow:!0}})},rs.mergeMathLists={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},returnDependencies:()=>({mergeMathListsAttr:{dependencyType:"attributeComponent",attributeName:"mergeMathLists",variableNames:["value"]},mathListChildren:{dependencyType:"child",childGroups:["mathLists"],skipComponentNames:!0},mathChildren:{dependencyType:"child",childGroups:["maths"],skipComponentNames:!0}}),definition({dependencyValues:ns}){var os;return{setValue:{mergeMathLists:((os=ns.mergeMathListsAttr)==null?void 0:os.stateValues.value)||ns.mathListChildren.length===0&&ns.mathChildren.length===1}}}},rs.nComponents={public:!0,shadowingInstructions:{createComponentOfType:"number"},stateVariablesDeterminingDependencies:["mergeMathLists"],additionalStateVariablesDefined:["childIndexByArrayKey"],returnDependencies({stateValues:ns}){let ss={maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"},mergeMathLists:{dependencyType:"stateVariable",variableName:"mergeMathLists"},mathsShadow:{dependencyType:"stateVariable",variableName:"mathsShadow"}};return ns.mergeMathLists?ss.mathAndMathListChildren={dependencyType:"child",childGroups:["maths","mathLists"],variableNames:["value","nComponents"],variablesOptional:!0}:(ss.mathListChildren={dependencyType:"child",childGroups:["mathLists"],variableNames:["nComponents"]},ss.mathAndMathListChildren={dependencyType:"child",childGroups:["maths","mathLists"],skipComponentNames:!0}),ss},definition:function({dependencyValues:ns,componentInfoObjects:ss}){let os=0,ls=[];if(ns.mathAndMathListChildren.length>0)if(ns.mergeMathLists)for(let[cs,ds]of ns.mathAndMathListChildren.entries())if(ss.isInheritedComponentType({inheritedComponentType:ds.componentType,baseComponentType:"mathList"})){for(let ps=0;psus&&(os=us,ls=ls.slice(0,us)),{setValue:{nComponents:os,childIndexByArrayKey:ls},checkForActualChange:{nComponents:!0}}}},rs.maths={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},isArray:!0,entryPrefixes:["math"],stateVariablesDeterminingDependencies:["mergeMathLists","childIndexByArrayKey"],returnArraySizeDependencies:()=>({nComponents:{dependencyType:"stateVariable",variableName:"nComponents"}}),returnArraySize({dependencyValues:ns}){return[ns.nComponents]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={},ls={mergeMathLists:{dependencyType:"stateVariable",variableName:"mergeMathLists"},childIndexByArrayKey:{dependencyType:"stateVariable",variableName:"childIndexByArrayKey"},mathsShadow:{dependencyType:"stateVariable",variableName:"mathsShadow"}};for(let us of ns){let cs=[],ds="1";ss.childIndexByArrayKey[us]&&(cs=[ss.childIndexByArrayKey[us][0]],ds=ss.childIndexByArrayKey[us][1]+1),os[us]={mathAndMathListChildren:{dependencyType:"child",childGroups:["maths","mathLists"],variableNames:["value","math"+ds],variablesOptional:!0,childIndices:cs}}}return{globalDependencies:ls,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=ss[us].mathAndMathListChildren[0];if(cs)if(cs.stateValues.value!==void 0){let ds=cs.stateValues.value;if(ns.mergeMathLists&&Array.isArray(ds.tree)&&ds.tree[0]==="list"){let ps=ns.childIndexByArrayKey[us][1];ls[us]=ds.get_component(ps)}else ls[us]=ds}else{let ds=ns.childIndexByArrayKey[us][1]+1;ls[us]=cs.stateValues["math"+ds]}else ns.mathsShadow!==null&&(ls[us]=ns.mathsShadow[us])}return{setValue:{maths:ls}}},async inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,stateValues:us,workspace:cs}){if(ss.mergeMathLists){let ps=[],fs=await us.childIndexByArrayKey,hs=[];for(let gs in ns.maths){if(!os[gs]||hs.includes(gs))continue;let ys;if(fs[gs][2]!==void 0){let vs=Number(gs)-fs[gs][1],xs=vs+fs[gs][2]-1;cs.desiredMaths||(cs.desiredMaths=[]);let Cs=["list"];for(let Ts=vs;Ts<=xs;Ts++)ns.maths[Ts]!==void 0?cs.desiredMaths[Ts]=convertValueToMathExpression(ns.maths[Ts]):cs.desiredMaths[Ts]===void 0&&(cs.desiredMaths[Ts]=(await us.maths)[Ts]),Cs.push(cs.desiredMaths[Ts].tree),hs.push(Ts.toString());ys=Context.fromAst(Cs)}else ys=ns.maths[gs];let bs=os[gs].mathAndMathListChildren[0];bs&&(bs.stateValues.value!==void 0?ps.push({setDependency:ls[gs].mathAndMathListChildren,desiredValue:ys,childIndex:0,variableIndex:0}):ps.push({setDependency:ls[gs].mathAndMathListChildren,desiredValue:ys,childIndex:0,variableIndex:1}))}return{success:!0,instructions:ps}}let ds=[];for(let ps in ns.maths){if(!os[ps])continue;let fs=os[ps].mathAndMathListChildren[0];fs&&(fs.stateValues.value!==void 0?ds.push({setDependency:ls[ps].mathAndMathListChildren,desiredValue:ns.maths[ps],childIndex:0,variableIndex:0}):ds.push({setDependency:ls[ps].mathAndMathListChildren,desiredValue:ns.maths[ps],childIndex:0,variableIndex:1}))}return{success:!0,instructions:ds}}},rs.math={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},returnDependencies:()=>({maths:{dependencyType:"stateVariable",variableName:"maths"}}),definition({dependencyValues:ns}){let ss;return ns.maths.length===0?ss=Context.fromAst("_"):ns.maths.length===1?ss=ns.maths[0]:ss=Context.fromAst(["list",...ns.maths.map(os=>os.tree)]),{setValue:{math:ss}}}},rs.nValues={isAlias:!0,targetVariableName:"nComponents"},rs.values={isAlias:!0,targetVariableName:"maths"},rs.latex={additionalStateVariablesDefined:["latexs"],public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies:()=>({mathAndMathListChildren:{dependencyType:"child",childGroups:["maths","mathLists"],variableNames:["valueForDisplay","latex","latexs"],variablesOptional:!0},maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"},mergeMathLists:{dependencyType:"stateVariable",variableName:"mergeMathLists"},mathsShadow:{dependencyType:"stateVariable",variableName:"mathsShadow"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"},padZeros:{dependencyType:"stateVariable",variableName:"padZeros"}}),definition:function({dependencyValues:ns,usedDefault:ss}){let os=[],ls={};if(ns.padZeros&&(ss.displayDigits&&!ss.displayDecimals?Number.isFinite(ns.displayDecimals)&&(ls.padToDecimals=ns.displayDecimals):ns.displayDigits>=1&&(ls.padToDigits=ns.displayDigits)),ns.mathAndMathListChildren.length>0)for(let ds of ns.mathAndMathListChildren)if(ds.stateValues.valueForDisplay){let ps=ds.stateValues.valueForDisplay;if(ns.mergeMathLists&&Array.isArray(ps.tree)&&ps.tree[0]==="list")for(let fs=0;fsroundForDisplay({value:ds,dependencyValues:ns,usedDefault:ss}).toLatex(ls)));let us=ns.maximumNumber;return us!==null&&os.length>us&&(us=Math.max(0,Math.floor(us)),os=os.slice(0,us)),{setValue:{latex:os.join(", "),latexs:os}}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},additionalStateVariablesDefined:["texts"],returnDependencies:()=>({mathAndMathListChildren:{dependencyType:"child",childGroups:["maths","mathLists"],variableNames:["valueForDisplay","text","texts"],variablesOptional:!0},maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"},mergeMathLists:{dependencyType:"stateVariable",variableName:"mergeMathLists"},mathsShadow:{dependencyType:"stateVariable",variableName:"mathsShadow"}}),definition:function({dependencyValues:ns}){let ss=[];if(ns.mathAndMathListChildren.length>0)for(let us of ns.mathAndMathListChildren)if(us.stateValues.valueForDisplay){let cs=us.stateValues.valueForDisplay;if(ns.mergeMathLists&&Array.isArray(cs.tree)&&cs.tree[0]==="list")for(let ds=0;dsus.toString()));let os=ns.maximumNumber;return os!==null&&ss.length>os&&(os=Math.max(0,Math.floor(os)),ss=ss.slice(0,os)),{setValue:{text:ss.join(", "),texts:ss}}}},rs.componentNamesInList={returnDependencies:()=>({mathAndMathListChildren:{dependencyType:"child",childGroups:["maths","mathLists"],variableNames:["componentNamesInList"],variablesOptional:!0},maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"}}),definition:function({dependencyValues:ns,componentInfoObjects:ss}){let os=[];for(let us of ns.mathAndMathListChildren)ss.isInheritedComponentType({inheritedComponentType:us.componentType,baseComponentType:"mathList"})?os.push(...us.stateValues.componentNamesInList):os.push(us.componentName);let ls=ns.maximumNumber;return ls!==null&&os.length>ls&&(ls=Math.max(0,Math.floor(ls)),os=os.slice(0,ls)),{setValue:{componentNamesInList:os}}}},rs.nComponentsToDisplayByChild={additionalStateVariablesDefined:["nChildrenToRender"],returnDependencies:()=>({nComponents:{dependencyType:"stateVariable",variableName:"nComponents"},mathListChildren:{dependencyType:"child",childGroups:["mathLists"],variableNames:["nComponents"]},mathAndMathListChildren:{dependencyType:"child",childGroups:["maths","mathLists"],skipComponentNames:!0},parentNComponentsToDisplayByChild:{dependencyType:"parentStateVariable",parentComponentType:"mathList",variableName:"nComponentsToDisplayByChild"}}),definition:function({dependencyValues:ns,componentInfoObjects:ss,componentName:os}){let ls=ns.nComponents;ns.parentNComponentsToDisplayByChild!==null&&(ls=ns.parentNComponentsToDisplayByChild[os]);let us={},cs=0,ds=0,ps=0;for(let fs of ns.mathAndMathListChildren){let hs=Math.max(0,ls-cs);if(hs>0&&ds++,ss.isInheritedComponentType({inheritedComponentType:fs.componentType,baseComponentType:"mathList"})){let gs=ns.mathListChildren[ps];ps++;let ys=Math.min(hs,gs.stateValues.nComponents);us[gs.componentName]=ys,cs+=ys}else cs+=1}return{setValue:{nComponentsToDisplayByChild:us,nChildrenToRender:ds}}},markStale:()=>({updateRenderedChildren:!0})},rs}}zs(MathList,"componentType","mathList"),zs(MathList,"renderChildren",!0),zs(MathList,"includeBlankStringChildren",!0),zs(MathList,"removeBlankStringChildrenPostSugar",!0),zs(MathList,"stateVariableForAttributeValue","maths"),zs(MathList,"primaryStateVariableForDefinition","mathsShadow"),zs(MathList,"descendantCompositesMustHaveAReplacement",!1),zs(MathList,"adapters",[{stateVariable:"math",stateVariablesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},"text"]);class Columns extends Text{}zs(Columns,"componentType","columns"),zs(Columns,"rendererType","text");class Title extends TextOrInline{}zs(Title,"componentType","title");class RightHandSide extends MathComponent{}zs(RightHandSide,"componentType","rightHandSide"),zs(RightHandSide,"rendererType","math");class Description extends TextOrInline{}zs(Description,"componentType","description"),zs(Description,"rendererType");class Else extends Template{}zs(Else,"componentType","else");class Xlabel extends Label$1{}zs(Xlabel,"componentType","xlabel"),zs(Xlabel,"rendererType","label");class Ylabel extends Label$1{}zs(Ylabel,"componentType","ylabel"),zs(Ylabel,"rendererType","label");class MatrixRow extends MathList{}zs(MatrixRow,"componentType","matrixRow"),zs(MatrixRow,"rendererType","mathList");class MatrixColumn extends MathList{}zs(MatrixColumn,"componentType","matrixColumn"),zs(MatrixColumn,"rendererType","mathList");const Aliases=Object.freeze(Object.defineProperty({__proto__:null,Columns,Description,Else,MatrixColumn,MatrixRow,RightHandSide,Title,Xlabel,Ylabel},Symbol.toStringTag,{value:"Module"}));var Mu;let M$3=(Mu=class extends InlineComponent{constructor(rs){super(rs),Object.assign(this.actions,{moveMath:this.moveMath.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.layer={createComponentOfType:"number",createStateVariable:"layer",defaultValue:0,public:!0,forRenderer:!0},rs.anchor={createComponentOfType:"point"},rs.positionFromAnchor={createComponentOfType:"text",createStateVariable:"positionFromAnchor",defaultValue:"center",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft","top","bottom","left","right","center"]},rs.styleNumber.defaultValue=0,rs}static returnChildGroups(){return[{group:"inline",componentTypes:["_inline"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=returnSelectedStyleStateVariableDefinition();return Object.assign(rs,ns),rs.latex={public:!0,shadowingInstructions:{createComponentOfType:"text"},defaultValue:"",hasEssential:!0,forRenderer:!0,returnDependencies:()=>({inlineChildren:{dependencyType:"child",childGroups:["inline"],variableNames:["latex","text"],variablesOptional:!0}}),definition:function({dependencyValues:ss}){if(ss.inlineChildren.length===0)return{useEssentialOrDefaultValue:{latex:!0}};let os="";for(let ls of ss.inlineChildren)typeof ls!="object"?os+=ls:typeof ls.stateValues.latex=="string"?os+=ls.stateValues.latex:typeof ls.stateValues.text=="string"&&(os+=ls.stateValues.text);return{setValue:{latex:os}}},inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os}){if(typeof ss.latex!="string")return{success:!1};if(os.inlineChildren.length===0)return{success:!0,instructions:[{setEssentialValue:"latex",value:ss.latex}]};if(os.inlineChildren.length===1){let ls=os.inlineChildren[0];return typeof ls!="object"?{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:ss.latex,childIndex:0}]}:typeof ls.stateValues.latex=="string"?{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:ss.latex,childIndex:0,variableIndex:0}]}:typeof ls.stateValues.text=="string"?{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:ss.latex,childIndex:0,variableIndex:1}]}:{success:!1}}else return{success:!1}}},rs.latexWithInputChildren={forRenderer:!0,returnDependencies:()=>({inlineChildren:{dependencyType:"child",childGroups:["inline"],variableNames:["latex","text"],variablesOptional:!0},latex:{dependencyType:"stateVariable",variableName:"latex"}}),definition:function({dependencyValues:ss,componentInfoObjects:os}){if(ss.inlineChildren.length===0)return{setValue:{latexWithInputChildren:[ss.latex]}};let ls=[],us="",cs=0;for(let ds of ss.inlineChildren)typeof ds!="object"?us+=ds:os.isInheritedComponentType({inheritedComponentType:ds.componentType,baseComponentType:"input"})?(us.length>0&&(ls.push(us),us=""),ls.push(cs),cs++):typeof ds.stateValues.latex=="string"?us+=ds.stateValues.latex:typeof ds.stateValues.text=="string"&&(us+=ds.stateValues.text);return us.length>0&&ls.push(us),{setValue:{latexWithInputChildren:ls}}}},rs.renderMode={forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{renderMode:"inline"}})},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({latex:{dependencyType:"stateVariable",variableName:"latex"}}),definition:function({dependencyValues:ss}){let os;try{os=Context.fromAst(latexToAst.convert(ss.latex))}catch{return{setValue:{text:ss.latex}}}return{setValue:{text:superSubscriptsToUnicode(os.toString())}}}},rs.anchor={defaultValue:Context.fromText("(0,0)"),public:!0,forRenderer:!0,hasEssential:!0,shadowingInstructions:{createComponentOfType:"point"},returnDependencies:()=>({anchorAttr:{dependencyType:"attributeComponent",attributeName:"anchor",variableNames:["coords"]}}),definition({dependencyValues:ss}){return ss.anchorAttr?{setValue:{anchor:ss.anchorAttr.stateValues.coords}}:{useEssentialOrDefaultValue:{anchor:!0}}},async inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os,stateValues:ls,initialChange:us}){return us&&!await ls.draggable?{success:!1}:os.anchorAttr?{success:!0,instructions:[{setDependency:"anchorAttr",desiredValue:ss.anchor,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"anchor",value:ss.anchor}]}}},rs}async moveMath({x:rs,y:ns,z:ss,transient:os,actionId:ls,sourceInformation:us={},skipRendererUpdate:cs=!1}){let ds=["vector"];return rs!==void 0&&(ds[1]=rs),ns!==void 0&&(ds[2]=ns),ss!==void 0&&(ds[3]=ss),os?await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],transient:os,actionId:ls,sourceInformation:us,skipRendererUpdate:cs}):await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],actionId:ls,sourceInformation:us,skipRendererUpdate:cs,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{x:rs,y:ns,z:ss}}})}},zs(Mu,"componentType","m"),zs(Mu,"rendererType","math"),zs(Mu,"includeBlankStringChildren",!0),zs(Mu,"primaryStateVariableForDefinition","latex"),Mu);var cp;let Me$2=(cp=class extends M$3{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.renderMode.definition=()=>({setValue:{renderMode:"display"}}),rs}},zs(cp,"componentType","me"),cp);class Men extends M$3{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.renderMode.definition=()=>({setValue:{renderMode:"numbered"}}),rs.equationTag={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies:()=>({equationCounter:{dependencyType:"counter",counterName:"equation"}}),definition({dependencyValues:ns}){return{setValue:{equationTag:String(ns.equationCounter)}}}},rs}}zs(Men,"componentType","men");const MMeMen=Object.freeze(Object.defineProperty({__proto__:null,M:M$3,Me:Me$2,Men},Symbol.toStringTag,{value:"Module"}));class Md extends InlineComponent{constructor(rs){super(rs),Object.assign(this.actions,{moveMath:this.moveMath.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.layer={createComponentOfType:"number",createStateVariable:"layer",defaultValue:0,public:!0,forRenderer:!0},rs.anchor={createComponentOfType:"point"},rs.positionFromAnchor={createComponentOfType:"text",createStateVariable:"positionFromAnchor",defaultValue:"center",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft","top","bottom","left","right","center"]},rs.styleNumber.defaultValue=0,rs}static returnChildGroups(){return[{group:"mrows",componentTypes:["mrow"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=returnSelectedStyleStateVariableDefinition();return Object.assign(rs,ns),rs.mrowChildNames={forRenderer:!0,returnDependencies:()=>({mrowChildren:{dependencyType:"child",childGroups:["mrows"]}}),definition:({dependencyValues:ss})=>({setValue:{mrowChildNames:ss.mrowChildren.map(os=>os.componentName)}})},rs.latex={public:!0,shadowingInstructions:{createComponentOfType:"text"},defaultValue:"",hasEssential:!0,shadowVariable:!0,forRenderer:!0,returnDependencies:()=>({mrowChildren:{dependencyType:"child",childGroups:["mrows"],variableNames:["latex","hide","equationTag","numbered"]}}),definition:function({dependencyValues:ss}){if(ss.mrowChildren.length>0){let os="";for(let ls of ss.mrowChildren)ls.stateValues.hide||(os.length>0&&(os+="\\\\"),ls.stateValues.numbered?os+=`\\tag{${ls.stateValues.equationTag}}`:os+="\\notag ",os+=ls.stateValues.latex);return{setValue:{latex:os}}}else return{useEssentialOrDefaultValue:{latex:!0}}}},rs.latexWithInputChildren={forRenderer:!0,returnDependencies:()=>({mrowChildren:{dependencyType:"child",childGroups:["mrows"],variableNames:["latexWithInputChildren","hide","equationTag","numbered"]},latex:{dependencyType:"stateVariable",variableName:"latex"}}),definition:function({dependencyValues:ss}){if(ss.mrowChildren.length>0){let os=[],ls=0,us="";for(let cs of ss.mrowChildren)if(!cs.stateValues.hide){us.length>0&&(us+="\\\\"),cs.stateValues.numbered?us+=`\\tag{${cs.stateValues.equationTag}}`:us+="\\notag ";for(let ds of cs.stateValues.latexWithInputChildren)typeof ds=="number"?(us.length>0&&(os.push(us),us=""),os.push(ls),ls++):us+=ds}return us.length>0&&os.push(us),{setValue:{latexWithInputChildren:os}}}else return{setValue:{latexWithInputChildren:[ss.latex]}}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({latex:{dependencyType:"stateVariable",variableName:"latex"}}),definition:function({dependencyValues:ss}){let os;try{os=ss.latex.replaceAll("\\notag","").replaceAll("\\amp","").split("\\\\").map(ls=>Context.fromAst(latexToAst.convert(ls)).toString()).join(`\\\\ +`;function MenuItem({to:as,children:rs}){return jsx$1(StyledMenuItem,{to:as,className:({isActive:ns,isPending:ss})=>location.pathname==="/"||ns?"active":ss?"pending":"",children:rs})}function SiteHeader(as){let rs=useNavigate(),ns=useLoaderData();const ss=Recoil_index_24(pageToolViewAtom);let os=jsx$1(Button$2,{dataTest:"Nav to course",size:"medium",onClick:()=>{ss({page:"course",tool:"",view:"",params:{}}),rs("/course")},value:"Go to Course"});return ns.signedIn||(os=jsx$1(Button$2,{dataTest:"Nav to signin",onClick:()=>rs("/SignIn"),size:"medium",value:"Sign In"})),jsx$1(Fragment,{children:jsxs(TopContainer,{children:[jsxs(Box,{as:"header",gridRow:"1 / 2",backgroundColor:"#fff",color:"#000",height:"40px",position:"fixed",top:"0",width:"100%",margin:"0",display:"flex",justifyContent:"space-between",borderBottom:"1px solid var(--mainGray)",zIndex:"1200",children:[jsxs(Branding,{children:[jsx$1(RouterLogo,{}),jsx$1("p",{children:"Doenet"})]}),jsxs(BarMenu,{children:[jsx$1(MenuItem,{to:"/",children:"Home"}),jsx$1(MenuItem,{to:"community",children:"Community"}),ns.signedIn?jsx$1(MenuItem,{to:`portfolio/${ns.portfolioCourseId}`,children:"Portfolio"}):null]}),jsx$1(SignInButtonContainer,{children:os})]}),jsx$1(ContentContainer,{children:jsx$1(Outlet,{context:{signedIn:ns.signedIn}})})]})})}const __variableDynamicImportRuntimeHelper=(as,rs)=>{const ns=as[rs];return ns?typeof ns=="function"?ns():Promise.resolve(ns):new Promise((ss,os)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(os.bind(null,new Error("Unknown variable dynamic import: "+rs)))})};let nanoid=(as=21)=>crypto.getRandomValues(new Uint8Array(as)).reduce((rs,ns)=>(ns&=63,ns<36?rs+=ns.toString(36):ns<62?rs+=(ns-26).toString(36).toUpperCase():ns>62?rs+="-":rs+="_",rs),"");var sha1Exports={},sha1={get exports(){return sha1Exports},set exports(as){sha1Exports=as}},coreExports={},core={get exports(){return coreExports},set exports(as){coreExports=as}},hasRequiredCore;function requireCore(){return hasRequiredCore||(hasRequiredCore=1,function(as,rs){(function(ns,ss){as.exports=ss()})(commonjsGlobal$1,function(){var ns=ns||function(ss,os){var ls=Object.create||function(){function xs(){}return function(Cs){var Ts;return xs.prototype=Cs,Ts=new xs,xs.prototype=null,Ts}}(),us={},cs=us.lib={},ds=cs.Base=function(){return{extend:function(xs){var Cs=ls(this);return xs&&Cs.mixIn(xs),(!Cs.hasOwnProperty("init")||this.init===Cs.init)&&(Cs.init=function(){Cs.$super.init.apply(this,arguments)}),Cs.init.prototype=Cs,Cs.$super=this,Cs},create:function(){var xs=this.extend();return xs.init.apply(xs,arguments),xs},init:function(){},mixIn:function(xs){for(var Cs in xs)xs.hasOwnProperty(Cs)&&(this[Cs]=xs[Cs]);xs.hasOwnProperty("toString")&&(this.toString=xs.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),ps=cs.WordArray=ds.extend({init:function(xs,Cs){xs=this.words=xs||[],Cs!=os?this.sigBytes=Cs:this.sigBytes=xs.length*4},toString:function(xs){return(xs||hs).stringify(this)},concat:function(xs){var Cs=this.words,Ts=xs.words,Ss=this.sigBytes,Ns=xs.sigBytes;if(this.clamp(),Ss%4)for(var As=0;As>>2]>>>24-As%4*8&255;Cs[Ss+As>>>2]|=ws<<24-(Ss+As)%4*8}else for(var As=0;As>>2]=Ts[As>>>2];return this.sigBytes+=Ns,this},clamp:function(){var xs=this.words,Cs=this.sigBytes;xs[Cs>>>2]&=4294967295<<32-Cs%4*8,xs.length=ss.ceil(Cs/4)},clone:function(){var xs=ds.clone.call(this);return xs.words=this.words.slice(0),xs},random:function(xs){for(var Cs=[],Ts=function(Es){var Es=Es,_s=987654321,$s=4294967295;return function(){_s=36969*(_s&65535)+(_s>>16)&$s,Es=18e3*(Es&65535)+(Es>>16)&$s;var Rs=(_s<<16)+Es&$s;return Rs/=4294967296,Rs+=.5,Rs*(ss.random()>.5?1:-1)}},Ss=0,Ns;Ss>>2]>>>24-Ns%4*8&255;Ss.push((As>>>4).toString(16)),Ss.push((As&15).toString(16))}return Ss.join("")},parse:function(xs){for(var Cs=xs.length,Ts=[],Ss=0;Ss>>3]|=parseInt(xs.substr(Ss,2),16)<<24-Ss%8*4;return new ps.init(Ts,Cs/2)}},gs=fs.Latin1={stringify:function(xs){for(var Cs=xs.words,Ts=xs.sigBytes,Ss=[],Ns=0;Ns>>2]>>>24-Ns%4*8&255;Ss.push(String.fromCharCode(As))}return Ss.join("")},parse:function(xs){for(var Cs=xs.length,Ts=[],Ss=0;Ss>>2]|=(xs.charCodeAt(Ss)&255)<<24-Ss%4*8;return new ps.init(Ts,Cs)}},ys=fs.Utf8={stringify:function(xs){try{return decodeURIComponent(escape(gs.stringify(xs)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(xs){return gs.parse(unescape(encodeURIComponent(xs)))}},bs=cs.BufferedBlockAlgorithm=ds.extend({reset:function(){this._data=new ps.init,this._nDataBytes=0},_append:function(xs){typeof xs=="string"&&(xs=ys.parse(xs)),this._data.concat(xs),this._nDataBytes+=xs.sigBytes},_process:function(xs){var Cs=this._data,Ts=Cs.words,Ss=Cs.sigBytes,Ns=this.blockSize,As=Ns*4,ws=Ss/As;xs?ws=ss.ceil(ws):ws=ss.max((ws|0)-this._minBufferSize,0);var Es=ws*Ns,_s=ss.min(Es*4,Ss);if(Es){for(var $s=0;$s>>31}var Ns=(ys<<5|ys>>>27)+Cs+ds[Ts];Ts<20?Ns+=(bs&vs|~bs&xs)+1518500249:Ts<40?Ns+=(bs^vs^xs)+1859775393:Ts<60?Ns+=(bs&vs|bs&xs|vs&xs)-1894007588:Ns+=(bs^vs^xs)-899497514,Cs=xs,xs=vs,vs=bs<<30|bs>>>2,bs=ys,ys=Ns}gs[0]=gs[0]+ys|0,gs[1]=gs[1]+bs|0,gs[2]=gs[2]+vs|0,gs[3]=gs[3]+xs|0,gs[4]=gs[4]+Cs|0},_doFinalize:function(){var fs=this._data,hs=fs.words,gs=this._nDataBytes*8,ys=fs.sigBytes*8;return hs[ys>>>5]|=128<<24-ys%32,hs[(ys+64>>>9<<4)+14]=Math.floor(gs/4294967296),hs[(ys+64>>>9<<4)+15]=gs,fs.sigBytes=hs.length*4,this._process(),this._hash},clone:function(){var fs=us.clone.call(this);return fs._hash=this._hash.clone(),fs}});ss.SHA1=us._createHelper(ps),ss.HmacSHA1=us._createHmacHelper(ps)}(),ns.SHA1})})(sha1);var encBase64Exports={},encBase64={get exports(){return encBase64Exports},set exports(as){encBase64Exports=as}};(function(as,rs){(function(ns,ss){as.exports=ss(requireCore())})(commonjsGlobal$1,function(ns){return function(){var ss=ns,os=ss.lib,ls=os.WordArray,us=ss.enc;us.Base64={stringify:function(ds){var ps=ds.words,fs=ds.sigBytes,hs=this._map;ds.clamp();for(var gs=[],ys=0;ys>>2]>>>24-ys%4*8&255,vs=ps[ys+1>>>2]>>>24-(ys+1)%4*8&255,xs=ps[ys+2>>>2]>>>24-(ys+2)%4*8&255,Cs=bs<<16|vs<<8|xs,Ts=0;Ts<4&&ys+Ts*.75>>6*(3-Ts)&63));var Ss=hs.charAt(64);if(Ss)for(;gs.length%4;)gs.push(Ss);return gs.join("")},parse:function(ds){var ps=ds.length,fs=this._map,hs=this._reverseMap;if(!hs){hs=this._reverseMap=[];for(var gs=0;gs>>6-ys%4*2;hs[gs>>>2]|=(bs|vs)<<24-gs%4*8,gs++}return ls.create(hs,gs)}}(),ns.enc.Base64})})(encBase64);let rePlus=/\+/g,reSlash=/\//g;function createUniqueName(as,rs){let ns=encBase64Exports.stringify(sha1Exports(rs)).slice(0,10).replace(rePlus,"_").replace(reSlash,"-");return"__"+as+"_"+ns}function getUniqueIdentifierFromBase(as,rs){let ns=1,ss=as+ns;for(;rs.includes(ss);)ns+=1,ss=as+ns;return rs.push(ss),ss}function getNamespaceFromName(as){let rs=as.lastIndexOf("/");if(rs===-1)throw Error(`Encountered name ${as} that doesn't include a slash`);return as.slice(0,rs+1)}function flattenDeep(as){return as.reduce((rs,ns)=>Array.isArray(ns)?rs.concat(flattenDeep(ns)):rs.concat(ns),[])}function flattenLevels(as,rs){return console.log(`levels: ${rs}`),as.reduce((ns,ss)=>Array.isArray(ss)&&rs>1?ns.concat(flattenLevels(ss,rs-1)):ns.concat(ss),[])}class Subset{union(rs){return this.complement().intersect(rs.complement()).complement()}intersectWithOpenInterval(rs){return this.intersect(rs)}setMinus(rs){return this.intersect(rs.complement())}symmetricDifference(rs){return this.setMinus(rs).union(rs.setMinus(this))}equals(rs){return this.symmetricDifference(rs).isEmpty()}toJSON(){return{objectType:"subset",data:Object.assign({},this),subsetType:this.constructor.subsetType}}static reviver(rs,ns){if(ns&&ns.objectType==="subset"&&ns.subsetType!==void 0){if(ns.subsetType==="emptySet")return new EmptySet;if(ns.subsetType==="realLine")return new RealLine;if(ns.subsetType==="singleton")return new Singleton(ns.data.element);if(ns.subsetType==="union")return new Union(ns.data.subsets);if(ns.subsetType==="openInterval")return new OpenInterval(ns.data.left,ns.data.right)}return ns}copy(){return this.constructor.reviver(null,this.toJSON())}}const hp=class extends Subset{union(rs){return rs}intersect(){return new hp}contains(){return!1}isEmpty(){return!0}complement(){return new RealLine}toString(){return"∅"}toMathExpression(){return Context.fromAst("∅")}};let EmptySet=hp;zs(EmptySet,"subsetType","emptySet");const gp=class extends Subset{union(){return new gp}intersect(rs){return rs}contains(){return!0}complement(){return new EmptySet}isEmpty(){return!1}toString(){return"ℝ"}toMathExpression(){return Context.fromAst("R")}};let RealLine=gp;zs(RealLine,"subsetType","realLine");const yp=class extends Subset{constructor(rs){if(super(),!Number.isFinite(rs))return new EmptySet;this.element=rs}union(rs){return rs.contains(this.element)?rs:new Union([rs,this])}intersect(rs){return rs.contains(this.element)?new yp(this.element):new EmptySet}isEmpty(){return!1}contains(rs){return rs===this.element}complement(){return new Union([new OpenInterval(-1/0,this.element),new OpenInterval(this.element,1/0)])}toString(){return`{${this.element}}`}toMathExpression(){return Context.fromAst(["set",this.element])}};let Singleton=yp;zs(Singleton,"subsetType","singleton");const Ju=class extends Subset{intersect(rs){return new Ju(this.subsets.map(ns=>rs.intersect(ns)))}toString(){return this.subsets.map(rs=>rs.toString()).join(" U ")}toMathExpression(){return Context.fromAst(["union",...this.subsets.map(rs=>rs.toMathExpression().tree)])}constructor(rs){super();let ns=rs.filter(ss=>!ss.isEmpty());if(ns.length===0)return new EmptySet;ns=ns.reduce((ss,os)=>os instanceof Ju?ss.concat(os.subsets):ss.concat(os),[]),this.subsets=[];for(let ss=0;ssus&&ps.elementds.left&&usns.contains(rs))}isEmpty(){return this.subsets.every(rs=>rs.isEmpty())}complement(){return this.subsets.map(rs=>rs.complement()).reduce((rs,ns)=>rs.intersect(ns))}};let Union=Ju;zs(Union,"subsetType","union");let Interval$1=class extends Subset{constructor(rs,ns){return super(),this.left=rs,this.right=ns,this.left<=this.right?this.left===-1/0&&this.right===1/0?new RealLine:this:new EmptySet}};const bp=class extends Interval$1{constructor(rs,ns){return super(rs,ns),rs===ns?new EmptySet:this}intersect(rs){return rs.intersectWithOpenInterval(this)}intersectWithOpenInterval(rs){return new bp(Math.max(this.left,rs.left),Math.min(this.right,rs.right))}complement(){return new Union([new OpenClosedInterval(-1/0,this.left),new ClosedOpenInterval(this.right,1/0)])}isEmpty(){return this.left>=this.right}contains(rs){return rs>this.left&&rsbuildSubsetFromIntervals(os,rs)).filter(os=>os);return ss.length===0?new EmptySet:ss.length===1?ss[0]:new Union(ss)}else if(ns==="intersect"||ns==="and"){let ss=as.slice(1).map(os=>buildSubsetFromIntervals(os,rs)).filter(os=>os);return ss.length===0?new RealLine:ss.reduce((os,ls)=>os.intersect(ls))}else if(ns==="set"){let ss=as.slice(1).map(os=>buildSubsetFromIntervals(os,rs)).filter(os=>os);return ss.length===0?new EmptySet:ss.length===1?ss[0]:new Union(ss)}else if(["<","le",">","ge","=","ne"].includes(ns)){let ss=as[1],os=!1;if(!Number.isFinite(ss)){if(deepCompare(ss,rs))os=!0;else if(ss=Context.fromAst(ss).evaluate_to_constant(),!(Number.isFinite(ss)||ss===1/0||ss===-1/0))return new EmptySet}let ls=as[2],us=!1;if(!Number.isFinite(ls)){if(deepCompare(ls,rs))us=!0;else if(ls=Context.fromAst(ls).evaluate_to_constant(),!(Number.isFinite(ls)||ls===1/0||ls===-1/0))return new EmptySet}return os?us?new EmptySet:ns==="<"?new OpenInterval(-1/0,ls):ns==="le"?new OpenClosedInterval(-1/0,ls):ns===">"?new OpenInterval(ls,1/0):ns==="ge"?new ClosedOpenInterval(ls,1/0):ns==="="?Number.isFinite(ls)?new Singleton(ls):new EmptySet:Number.isFinite(ls)?new Union([new OpenInterval(-1/0,ls),new OpenInterval(ls,1/0)]):new RealLine:us?ns==="<"?new OpenInterval(ss,1/0):ns==="le"?new ClosedOpenInterval(ss,1/0):ns===">"?new OpenInterval(-1/0,ss):ns==="ge"?new OpenClosedInterval(-1/0,ss):ns==="="?Number.isFinite(ss)?new Singleton(ss):new EmptySet:Number.isFinite(ss)?new Union([new OpenInterval(-1/0,ss),new OpenInterval(ss,1/0)]):new RealLine:new EmptySet}else if(["lts","gts"].includes(ns)){let ss=as[1].slice(1),os=as[2].slice(1);if(ss.length!==3||!deepCompare(ss[1],rs))return new EmptySet;ns==="gts"&&(ss.reverse(),os.reverse());let ls=ss[0];if(!Number.isFinite(ls)&&(ls=Context.fromAst(ls).evaluate_to_constant(),!(Number.isFinite(ls)||ls===1/0||ls===-1/0)))return new EmptySet;let us=ss[2];return!Number.isFinite(us)&&(us=Context.fromAst(us).evaluate_to_constant(),!(Number.isFinite(us)||us===1/0||us===-1/0))?new EmptySet:os[0]?os[1]?new OpenInterval(ls,us):new OpenClosedInterval(ls,us):os[1]?new ClosedOpenInterval(ls,us):new ClosedInterval(ls,us)}else if(ns==="|"){let ss=as[1];return buildSubsetFromIntervals(as[2],ss)}else if(ns==="^"&&(as[2]==="C"||as[2]==="c")){let ss=buildSubsetFromIntervals(as[1],rs);return ss?ss.complement():new EmptySet}else{if(ns==="in")return deepCompare(as[1],rs)?buildSubsetFromIntervals(as[2],rs):new EmptySet;if(ns==="ni")return deepCompare(as[2],rs)?buildSubsetFromIntervals(as[1],rs):new EmptySet;if(ns==="notin"){if(deepCompare(as[1],rs)){let ss=buildSubsetFromIntervals(as[2],rs);if(ss)return ss.complement()}return new EmptySet}else if(ns==="notni"){if(deepCompare(as[2],rs)){let ss=buildSubsetFromIntervals(as[1],rs);if(ss)return ss.complement()}return new EmptySet}else{let ss=Context.fromAst(as).evaluate_to_constant();return Number.isFinite(ss)?new Singleton(ss):new EmptySet}}}function buildSubsetFromMathExpression(as,rs){return buildSubsetFromIntervals(as.to_intervals().tree,rs.tree)}function deepClone(as,rs,ns){if(Object(as)!==as||as instanceof Function||rs!==void 0&&as instanceof rs)return as;if(as instanceof Context.class||as instanceof theModule.Subset)return as.copy();if(ns===void 0&&(ns=new WeakMap),Array.isArray(as))return[...as.map(os=>deepClone(os,rs,ns))];if(as.constructor===Object&&Object.entries(as).length===0)return{};if(ns.has(as))return ns.get(as);try{var ss=new as.constructor}catch{ss=Object.create(Object.getPrototypeOf(as))}return as instanceof Map?Array.from(as,([os,ls])=>ss.set(deepClone(os,rs,ns),deepClone(ls,rs,ns))):as instanceof Set&&Array.from(as,os=>ss.add(deepClone(os,rs,ns))),ns.set(as,ss),Object.assign(ss,...Object.keys(as).map(os=>({[os]:deepClone(as[os],rs,ns)})))}function deepCompare(as,rs,ns){var ss,os;function ls(us,cs){var ds;if(Number.isNaN(us)&&Number.isNaN(cs)||us===cs)return!0;if(ns!==void 0&&us instanceof ns&&cs instanceof ns)return us.componentName===cs.componentName;if(us instanceof Context.class&&cs instanceof Context.class)return ls(us.tree,cs.tree);if(typeof us=="function"&&typeof cs=="function"||us instanceof Date&&cs instanceof Date||us instanceof RegExp&&cs instanceof RegExp||us instanceof String&&cs instanceof String||us instanceof Number&&cs instanceof Number)return us.toString()===cs.toString();if(!(us instanceof Object&&cs instanceof Object)||us.isPrototypeOf(cs)||cs.isPrototypeOf(us)||us.constructor!==cs.constructor||us.prototype!==cs.prototype||ss.indexOf(us)>-1||os.indexOf(cs)>-1)return!1;for(ds in cs){if(cs.hasOwnProperty(ds)!==us.hasOwnProperty(ds))return!1;if(typeof cs[ds]!=typeof us[ds])return!1}for(ds in us){if(cs.hasOwnProperty(ds)!==us.hasOwnProperty(ds))return!1;if(typeof cs[ds]!=typeof us[ds])return!1;switch(typeof us[ds]){case"object":case"function":if(ss.push(us),os.push(cs),!ls(us[ds],cs[ds]))return!1;ss.pop(),os.pop();break;default:if(us[ds]!==cs[ds]&&!(Number.isNaN(us[ds])&&Number.isNaN(cs[ds])))return!1;break}}return!0}return ss=[],os=[],ls(as,rs)}function breakStringsAndOthersIntoComponentsByStringCommas(as){return null}function returnBreakStringsSugarFunction({childrenToComponentFunction:as,mustStripOffOuterParentheses:rs=!1}){return function({matchedChildren:ns}){let ss=0,os=[],ls=[],us=!1,cs=ns.length;if(rs){let ps=ns[0];if(typeof ps!="string"||ps.trimLeft()[0]!=="(")return{success:!1}}for(let[ps,fs]of ns.entries()){if(typeof fs!="string"){ls.push(fs);continue}let hs=fs.trim();if(ps===0&&rs&&hs[0]==="("){let ys=ns[cs-1];if(typeof ys=="string"){let bs=ys.trimRight();bs[bs.length-1]===")"&&(us=!0,hs=hs.substring(1))}}let gs=0;for(let ys=0;ysgs&&ls.push(hs.substring(gs,ys)),os.push(ls),ls=[],gs=ys+1)}hs.length>gs&&ls.push(hs.substring(gs,hs.length))}return ss!==0?{success:!1}:(os.push(ls),{success:!0,newChildren:os.map(as)})}}function breakEmbeddedStringByCommas({childrenList:as}){let rs=0,ns=[],ss=[];for(let os of as){if(typeof os!="string"){ss.push(os);continue}let ls=os.trim(),us=0;for(let cs=0;csus){let ps=ls.substring(us,cs).trim();ss.push(ps)}ns.push(ss),ss=[],us=cs+1}}if(ls.length>us){let cs=ls.substring(us,ls.length).trim();ss.push(cs)}}return rs!==0?{success:!1}:(ns.push(ss),{success:!0,pieces:ns})}function breakEmbeddedStringsIntoParensPieces({componentList:as,removeParens:rs=!1}){let ns=0,ss=[],os=[];for(let ls of as){if(typeof ls!="string"){ns===0?ss.push([ls]):os.push(ls);continue}let us=ls.trim(),cs=0;for(let ds=0;dscs){let fs=rs?ds:ds+1,hs=us.substring(cs,fs).trim();hs.length>0&&os.push(hs)}ss.push(os),os=[],cs=ds+1}ns--}else if(ns===0&&!ps.match(/\s/))return{success:!1}}if(us.length>cs){let ds=us.substring(cs,us.length).trim();os.push(ds)}}return ns!==0?{success:!1}:(os.length>0&&ss.push(os),{success:!0,pieces:ss})}const DefaultBufferLength=1024;let nextPropID=0;class Range{constructor(rs,ns){this.from=rs,this.to=ns}}class NodeProp{constructor(rs={}){this.id=nextPropID++,this.perNode=!!rs.perNode,this.deserialize=rs.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(rs){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof rs!="function"&&(rs=NodeType.match(rs)),ns=>{let ss=rs(ns);return ss===void 0?null:[this,ss]}}}NodeProp.closedBy=new NodeProp({deserialize:as=>as.split(" ")});NodeProp.openedBy=new NodeProp({deserialize:as=>as.split(" ")});NodeProp.group=new NodeProp({deserialize:as=>as.split(" ")});NodeProp.contextHash=new NodeProp({perNode:!0});NodeProp.lookAhead=new NodeProp({perNode:!0});NodeProp.mounted=new NodeProp({perNode:!0});const noProps=Object.create(null);class NodeType{constructor(rs,ns,ss,os=0){this.name=rs,this.props=ns,this.id=ss,this.flags=os}static define(rs){let ns=rs.props&&rs.props.length?Object.create(null):noProps,ss=(rs.top?1:0)|(rs.skipped?2:0)|(rs.error?4:0)|(rs.name==null?8:0),os=new NodeType(rs.name||"",ns,rs.id,ss);if(rs.props){for(let ls of rs.props)if(Array.isArray(ls)||(ls=ls(os)),ls){if(ls[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");ns[ls[0].id]=ls[1]}}return os}prop(rs){return this.props[rs.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(rs){if(typeof rs=="string"){if(this.name==rs)return!0;let ns=this.prop(NodeProp.group);return ns?ns.indexOf(rs)>-1:!1}return this.id==rs}static match(rs){let ns=Object.create(null);for(let ss in rs)for(let os of ss.split(" "))ns[os]=rs[ss];return ss=>{for(let os=ss.prop(NodeProp.group),ls=-1;ls<(os?os.length:0);ls++){let us=ns[ls<0?ss.name:os[ls]];if(us)return us}}}}NodeType.none=new NodeType("",Object.create(null),0,8);class NodeSet{constructor(rs){this.types=rs;for(let ns=0;nsus.node;;){let ds=!1;if(us.from<=ls&&us.to>=os&&(us.type.isAnonymous||ns(us.type,us.from,us.to,cs)!==!1)){if(us.firstChild())continue;us.type.isAnonymous||(ds=!0)}for(;ds&&ss&&ss(us.type,us.from,us.to,cs),ds=us.type.isAnonymous,!us.nextSibling();){if(!us.parent())return;ds=!0}}}prop(rs){return rs.perNode?this.props?this.props[rs.id]:void 0:this.type.prop(rs)}get propValues(){let rs=[];if(this.props)for(let ns in this.props)rs.push([+ns,this.props[ns]]);return rs}balance(rs={}){return this.children.length<=8?this:balanceRange(NodeType.none,this.children,this.positions,0,this.children.length,0,this.length,(ns,ss,os)=>new Tree(this.type,ns,ss,os,this.propValues),rs.makeTree||((ns,ss,os)=>new Tree(NodeType.none,ns,ss,os)))}static build(rs){return buildTree(rs)}}Tree.empty=new Tree(NodeType.none,[],[],0);class FlatBufferCursor{constructor(rs,ns){this.buffer=rs,this.index=ns}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new FlatBufferCursor(this.buffer,this.index)}}class TreeBuffer{constructor(rs,ns,ss){this.buffer=rs,this.length=ns,this.set=ss}get type(){return NodeType.none}toString(){let rs=[];for(let ns=0;ns0));ds=us[ds+3]);return cs}slice(rs,ns,ss,os){let ls=this.buffer,us=new Uint16Array(ns-rs);for(let cs=rs,ds=0;cs=rs&&nsrs;case 1:return ns<=rs&&ss>rs;case 2:return ss>rs;case 4:return!0}}function enterUnfinishedNodesBefore(as,rs){let ns=as.childBefore(rs);for(;ns;){let ss=ns.lastChild;if(!ss||ss.to!=ns.to)break;ss.type.isError&&ss.from==ss.to?(as=ns,ns=ss.prevSibling):ns=ss}return as}function resolveNode(as,rs,ns,ss){for(var os;as.from==as.to||(ns<1?as.from>=rs:as.from>rs)||(ns>-1?as.to<=rs:as.to0?cs.length:-1;rs!=ps;rs+=ns){let fs=cs[rs],hs=ds[rs]+us._from;if(checkSide(os,ss,hs,hs+fs.length)){if(fs instanceof TreeBuffer){if(ls&2)continue;let gs=fs.findChild(0,fs.buffer.length,ns,ss-hs,os);if(gs>-1)return new BufferNode(new BufferContext(us,fs,rs,hs),null,gs)}else if(ls&1||!fs.type.isAnonymous||hasChild(fs)){let gs;if(!(ls&1)&&fs.props&&(gs=fs.prop(NodeProp.mounted))&&!gs.overlay)return new TreeNode(gs.tree,hs,rs,us);let ys=new TreeNode(fs,hs,rs,us);return ls&1||!ys.type.isAnonymous?ys:ys.nextChild(ns<0?fs.children.length-1:0,ns,ss,os)}}}if(ls&1||!us.type.isAnonymous||(us.index>=0?rs=us.index+ns:rs=ns<0?-1:us._parent.node.children.length,us=us._parent,!us))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this.node.children.length-1,-1,0,4)}childAfter(rs){return this.nextChild(0,1,rs,2)}childBefore(rs){return this.nextChild(this.node.children.length-1,-1,rs,-2)}enter(rs,ns,ss=!0,os=!0){let ls;if(ss&&(ls=this.node.prop(NodeProp.mounted))&&ls.overlay){let us=rs-this.from;for(let{from:cs,to:ds}of ls.overlay)if((ns>0?cs<=us:cs=us:ds>us))return new TreeNode(ls.tree,ls.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,rs,ns,os?0:2)}nextSignificantParent(){let rs=this;for(;rs.type.isAnonymous&&rs._parent;)rs=rs._parent;return rs}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get cursor(){return new TreeCursor(this)}get tree(){return this.node}toTree(){return this.node}resolve(rs,ns=0){return resolveNode(this,rs,ns,!1)}resolveInner(rs,ns=0){return resolveNode(this,rs,ns,!0)}enterUnfinishedNodesBefore(rs){return enterUnfinishedNodesBefore(this,rs)}getChild(rs,ns=null,ss=null){let os=getChildren(this,rs,ns,ss);return os.length?os[0]:null}getChildren(rs,ns=null,ss=null){return getChildren(this,rs,ns,ss)}toString(){return this.node.toString()}}function getChildren(as,rs,ns,ss){let os=as.cursor,ls=[];if(!os.firstChild())return ls;if(ns!=null){for(;!os.type.is(ns);)if(!os.nextSibling())return ls}for(;;){if(ss!=null&&os.type.is(ss))return ls;if(os.type.is(rs)&&ls.push(os.node),!os.nextSibling())return ss==null?ls:[]}}class BufferContext{constructor(rs,ns,ss,os){this.parent=rs,this.buffer=ns,this.index=ss,this.start=os}}class BufferNode{constructor(rs,ns,ss){this.context=rs,this._parent=ns,this.index=ss,this.type=rs.buffer.set.types[rs.buffer.buffer[ss]]}get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}child(rs,ns,ss){let{buffer:os}=this.context,ls=os.findChild(this.index+4,os.buffer[this.index+3],rs,ns-this.context.start,ss);return ls<0?null:new BufferNode(this.context,this,ls)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(rs){return this.child(1,rs,2)}childBefore(rs){return this.child(-1,rs,-2)}enter(rs,ns,ss,os=!0){if(!os)return null;let{buffer:ls}=this.context,us=ls.findChild(this.index+4,ls.buffer[this.index+3],ns>0?1:-1,rs-this.context.start,ns);return us<0?null:new BufferNode(this.context,this,us)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(rs){return this._parent?null:this.context.parent.nextChild(this.context.index+rs,rs,0,4)}get nextSibling(){let{buffer:rs}=this.context,ns=rs.buffer[this.index+3];return ns<(this._parent?rs.buffer[this._parent.index+3]:rs.buffer.length)?new BufferNode(this.context,this._parent,ns):this.externalSibling(1)}get prevSibling(){let{buffer:rs}=this.context,ns=this._parent?this._parent.index+4:0;return this.index==ns?this.externalSibling(-1):new BufferNode(this.context,this._parent,rs.findChild(ns,this.index,-1,0,4))}get cursor(){return new TreeCursor(this)}get tree(){return null}toTree(){let rs=[],ns=[],{buffer:ss}=this.context,os=this.index+4,ls=ss.buffer[this.index+3];if(ls>os){let us=ss.buffer[this.index+1],cs=ss.buffer[this.index+2];rs.push(ss.slice(os,ls,us,cs)),ns.push(0)}return new Tree(this.type,rs,ns,this.to-this.from)}resolve(rs,ns=0){return resolveNode(this,rs,ns,!1)}resolveInner(rs,ns=0){return resolveNode(this,rs,ns,!0)}enterUnfinishedNodesBefore(rs){return enterUnfinishedNodesBefore(this,rs)}toString(){return this.context.buffer.childString(this.index)}getChild(rs,ns=null,ss=null){let os=getChildren(this,rs,ns,ss);return os.length?os[0]:null}getChildren(rs,ns=null,ss=null){return getChildren(this,rs,ns,ss)}}class TreeCursor{constructor(rs,ns=0){if(this.mode=ns,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,rs instanceof TreeNode)this.yieldNode(rs);else{this._tree=rs.context.parent,this.buffer=rs.context;for(let ss=rs._parent;ss;ss=ss._parent)this.stack.unshift(ss.index);this.bufferNode=rs,this.yieldBuf(rs.index)}}get name(){return this.type.name}yieldNode(rs){return rs?(this._tree=rs,this.type=rs.type,this.from=rs.from,this.to=rs.to,!0):!1}yieldBuf(rs,ns){this.index=rs;let{start:ss,buffer:os}=this.buffer;return this.type=ns||os.set.types[os.buffer[rs]],this.from=ss+os.buffer[rs+1],this.to=ss+os.buffer[rs+2],!0}yield(rs){return rs?rs instanceof TreeNode?(this.buffer=null,this.yieldNode(rs)):(this.buffer=rs.context,this.yieldBuf(rs.index,rs.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(rs,ns,ss){if(!this.buffer)return this.yield(this._tree.nextChild(rs<0?this._tree.node.children.length-1:0,rs,ns,ss,this.mode));let{buffer:os}=this.buffer,ls=os.findChild(this.index+4,os.buffer[this.index+3],rs,ns-this.buffer.start,ss);return ls<0?!1:(this.stack.push(this.index),this.yieldBuf(ls))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(rs){return this.enterChild(1,rs,2)}childBefore(rs){return this.enterChild(-1,rs,-2)}enter(rs,ns,ss=!0,os=!0){return this.buffer?os?this.enterChild(1,rs,ns):!1:this.yield(this._tree.enter(rs,ns,ss&&!(this.mode&1),os))}parent(){if(!this.buffer)return this.yieldNode(this.mode&1?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let rs=this.mode&1?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(rs)}sibling(rs){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+rs,rs,0,4,this.mode)):!1;let{buffer:ns}=this.buffer,ss=this.stack.length-1;if(rs<0){let os=ss<0?0:this.stack[ss]+4;if(this.index!=os)return this.yieldBuf(ns.findChild(os,this.index,-1,0,4))}else{let os=ns.buffer[this.index+3];if(os<(ss<0?ns.buffer.length:ns.buffer[this.stack[ss]+3]))return this.yieldBuf(os)}return ss<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+rs,rs,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(rs){let ns,ss,{buffer:os}=this;if(os){if(rs>0){if(this.index-1)for(let ls=ns+rs,us=rs<0?-1:ss.node.children.length;ls!=us;ls+=rs){let cs=ss.node.children[ls];if(this.mode&1||cs instanceof TreeBuffer||!cs.type.isAnonymous||hasChild(cs))return!1}return!0}move(rs,ns){if(ns&&this.enterChild(rs,0,4))return!0;for(;;){if(this.sibling(rs))return!0;if(this.atLastNode(rs)||!this.parent())return!1}}next(rs=!0){return this.move(1,rs)}prev(rs=!0){return this.move(-1,rs)}moveTo(rs,ns=0){for(;(this.from==this.to||(ns<1?this.from>=rs:this.from>rs)||(ns>-1?this.to<=rs:this.to=0;){for(let us=rs;us;us=us._parent)if(us.index==os){if(os==this.index)return us;ns=us,ss=ls+1;break e}os=this.stack[--ls]}for(let os=ss;osrs instanceof TreeBuffer||!rs.type.isAnonymous||hasChild(rs))}function buildTree(as){var rs;let{buffer:ns,nodeSet:ss,maxBufferLength:os=DefaultBufferLength,reused:ls=[],minRepeatType:us=ss.types.length}=as,cs=Array.isArray(ns)?new FlatBufferCursor(ns,ns.length):ns,ds=ss.types,ps=0,fs=0;function hs(Ns,As,ws,Es,_s){let{id:$s,start:Rs,end:Ds,size:Os}=cs,Is=fs;for(;Os<0;)if(cs.next(),Os==-1){let Ms=ls[$s];ws.push(Ms),Es.push(Rs-Ns);return}else if(Os==-3){ps=$s;return}else if(Os==-4){fs=$s;return}else throw new RangeError(`Unrecognized record size: ${Os}`);let Vs=ds[$s],ks,Ps,Bs=Rs-Ns;if(Ds-Rs<=os&&(Ps=vs(cs.pos-As,_s))){let Ms=new Uint16Array(Ps.size-Ps.skip),Ws=cs.pos-Ps.size,Us=Ms.length;for(;cs.pos>Ws;)Us=xs(Ps.start,Ms,Us);ks=new TreeBuffer(Ms,Ds-Ps.start,ss),Bs=Ps.start-Ns}else{let Ms=cs.pos-Os;cs.next();let Ws=[],Us=[],js=$s>=us?$s:-1,Ls=0,Gs=Ds;for(;cs.pos>Ms;)js>=0&&cs.id==js&&cs.size>=0?(cs.end<=Gs-os&&(ys(Ws,Us,Rs,Ls,cs.end,Gs,js,Is),Ls=Ws.length,Gs=cs.end),cs.next()):hs(Rs,Ms,Ws,Us,js);if(js>=0&&Ls>0&&Ls-1&&Ls>0){let Hs=gs(Vs);ks=balanceRange(Vs,Ws,Us,0,Ws.length,0,Ds-Rs,Hs,Hs)}else ks=bs(Vs,Ws,Us,Ds-Rs,Is-Ds)}ws.push(ks),Es.push(Bs)}function gs(Ns){return(As,ws,Es)=>{let _s=0,$s=As.length-1,Rs,Ds;if($s>=0&&(Rs=As[$s])instanceof Tree){if(!$s&&Rs.type==Ns&&Rs.length==Es)return Rs;(Ds=Rs.prop(NodeProp.lookAhead))&&(_s=ws[$s]+Rs.length+Ds)}return bs(Ns,As,ws,Es,_s)}}function ys(Ns,As,ws,Es,_s,$s,Rs,Ds){let Os=[],Is=[];for(;Ns.length>Es;)Os.push(Ns.pop()),Is.push(As.pop()+ws-_s);Ns.push(bs(ss.types[Rs],Os,Is,$s-_s,Ds-$s)),As.push(_s-ws)}function bs(Ns,As,ws,Es,_s=0,$s){if(ps){let Rs=[NodeProp.contextHash,ps];$s=$s?[Rs].concat($s):[Rs]}if(_s>25){let Rs=[NodeProp.lookAhead,_s];$s=$s?[Rs].concat($s):[Rs]}return new Tree(Ns,As,ws,Es,$s)}function vs(Ns,As){let ws=cs.fork(),Es=0,_s=0,$s=0,Rs=ws.end-os,Ds={size:0,start:0,skip:0};e:for(let Os=ws.pos-Ns;ws.pos>Os;){let Is=ws.size;if(ws.id==As&&Is>=0){Ds.size=Es,Ds.start=_s,Ds.skip=$s,$s+=4,Es+=4,ws.next();continue}let Vs=ws.pos-Is;if(Is<0||Vs=us?4:0,Ps=ws.start;for(ws.next();ws.pos>Vs;){if(ws.size<0)if(ws.size==-3)ks+=4;else break e;else ws.id>=us&&(ks+=4);ws.next()}_s=Ps,Es+=Is,$s+=ks}return(As<0||Es==Ns)&&(Ds.size=Es,Ds.start=_s,Ds.skip=$s),Ds.size>4?Ds:void 0}function xs(Ns,As,ws){let{id:Es,start:_s,end:$s,size:Rs}=cs;if(cs.next(),Rs>=0&&Es4){let Os=cs.pos-(Rs-4);for(;cs.pos>Os;)ws=xs(Ns,As,ws)}As[--ws]=Ds,As[--ws]=$s-Ns,As[--ws]=_s-Ns,As[--ws]=Es}else Rs==-3?ps=Es:Rs==-4&&(fs=Es);return ws}let Cs=[],Ts=[];for(;cs.pos>0;)hs(as.start||0,as.bufferStart||0,Cs,Ts,-1);let Ss=(rs=as.length)!==null&&rs!==void 0?rs:Cs.length?Ts[0]+Cs[0].length:0;return new Tree(ds[as.topID],Cs.reverse(),Ts.reverse(),Ss)}const nodeSizeCache=new WeakMap;function nodeSize(as,rs){if(!as.isAnonymous||rs instanceof TreeBuffer||rs.type!=as)return 1;let ns=nodeSizeCache.get(rs);if(ns==null){ns=1;for(let ss of rs.children){if(ss.type!=as||!(ss instanceof Tree)){ns=1;break}ns+=nodeSize(as,ss)}nodeSizeCache.set(rs,ns)}return ns}function balanceRange(as,rs,ns,ss,os,ls,us,cs,ds){let ps=0;for(let bs=ss;bs=fs)break;ws+=Es}if(Ss==Ns+1){if(ws>fs){let Es=bs[Ns];ys(Es.children,Es.positions,0,Es.children.length,vs[Ns]+Ts);continue}hs.push(bs[Ns])}else{let Es=vs[Ss-1]+bs[Ss-1].length-As;hs.push(balanceRange(as,bs,vs,Ns,Ss,As,Es,null,ds))}gs.push(As+Ts-ls)}}return ys(rs,ns,ss,os,0),(cs||ds)(hs,gs,us)}class TreeFragment{constructor(rs,ns,ss,os,ls=!1,us=!1){this.from=rs,this.to=ns,this.tree=ss,this.offset=os,this.open=(ls?1:0)|(us?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(rs,ns=[],ss=!1){let os=[new TreeFragment(0,rs.length,rs,0,!1,ss)];for(let ls of ns)ls.to>rs.length&&os.push(ls);return os}static applyChanges(rs,ns,ss=128){if(!ns.length)return rs;let os=[],ls=1,us=rs.length?rs[0]:null;for(let cs=0,ds=0,ps=0;;cs++){let fs=cs=ss)for(;us&&us.from=gs.from||hs<=gs.to||ps){let ys=Math.max(gs.from,ds)-ps,bs=Math.min(gs.to,hs)-ps;gs=ys>=bs?null:new TreeFragment(ys,bs,gs.tree,gs.offset+ps,cs>0,!!fs)}if(gs&&os.push(gs),us.to>hs)break;us=lsnew Range(os.from,os.to)):[new Range(0,0)]:[new Range(0,rs.length)],this.createParse(rs,ns||[],ss)}parse(rs,ns,ss){let os=this.startParse(rs,ns,ss);for(;;){let ls=os.advance();if(ls)return ls}}};class StringInput{constructor(rs){this.string=rs}get length(){return this.string.length}chunk(rs){return this.string.slice(rs)}get lineChunks(){return!1}read(rs,ns){return this.string.slice(rs,ns)}}new NodeProp({perNode:!0});let Stack$1=class mp{constructor(rs,ns,ss,os,ls,us,cs,ds,ps,fs=0,hs){this.p=rs,this.stack=ns,this.state=ss,this.reducePos=os,this.pos=ls,this.score=us,this.buffer=cs,this.bufferBase=ds,this.curContext=ps,this.lookAhead=fs,this.parent=hs}toString(){return`[${this.stack.filter((rs,ns)=>ns%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(rs,ns,ss=0){let os=rs.parser.context;return new mp(rs,[],ns,ss,ss,0,[],0,os?new StackContext(os,os.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(rs,ns){this.stack.push(this.state,ns,this.bufferBase+this.buffer.length),this.state=rs}reduce(rs){let ns=rs>>19,ss=rs&65535,{parser:os}=this.p,ls=os.dynamicPrecedence(ss);if(ls&&(this.score+=ls),ns==0){this.pushState(os.getGoto(this.state,ss,!0),this.reducePos),ssus;)this.stack.pop();this.reduceContext(ss,cs)}storeNode(rs,ns,ss,os=4,ls=!1){if(rs==0){let us=this,cs=this.buffer.length;if(cs==0&&us.parent&&(cs=us.bufferBase-us.parent.bufferBase,us=us.parent),cs>0&&us.buffer[cs-4]==0&&us.buffer[cs-1]>-1){if(ns==ss)return;if(us.buffer[cs-2]>=ns){us.buffer[cs-2]=ss;return}}}if(!ls||this.pos==ss)this.buffer.push(rs,ns,ss,os);else{let us=this.buffer.length;if(us>0&&this.buffer[us-4]!=0)for(;us>0&&this.buffer[us-2]>ss;)this.buffer[us]=this.buffer[us-4],this.buffer[us+1]=this.buffer[us-3],this.buffer[us+2]=this.buffer[us-2],this.buffer[us+3]=this.buffer[us-1],us-=4,os>4&&(os-=4);this.buffer[us]=rs,this.buffer[us+1]=ns,this.buffer[us+2]=ss,this.buffer[us+3]=os}}shift(rs,ns,ss){let os=this.pos;if(rs&131072)this.pushState(rs&65535,this.pos);else if(rs&262144)this.pos=ss,this.shiftContext(ns,os),ns<=this.p.parser.maxNode&&this.buffer.push(ns,os,ss,4);else{let ls=rs,{parser:us}=this.p;(ss>this.pos||ns<=us.maxNode)&&(this.pos=ss,us.stateFlag(ls,1)||(this.reducePos=ss)),this.pushState(ls,os),this.shiftContext(ns,os),ns<=us.maxNode&&this.buffer.push(ns,os,ss,4)}}apply(rs,ns,ss){rs&65536?this.reduce(rs):this.shift(rs,ns,ss)}useNode(rs,ns){let ss=this.p.reused.length-1;(ss<0||this.p.reused[ss]!=rs)&&(this.p.reused.push(rs),ss++);let os=this.pos;this.reducePos=this.pos=os+rs.length,this.pushState(ns,os),this.buffer.push(ss,os,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,rs,this,this.p.stream.reset(this.pos-rs.length)))}split(){let rs=this,ns=rs.buffer.length;for(;ns>0&&rs.buffer[ns-2]>rs.reducePos;)ns-=4;let ss=rs.buffer.slice(ns),os=rs.bufferBase+ns;for(;rs&&os==rs.bufferBase;)rs=rs.parent;return new mp(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,ss,os,this.curContext,this.lookAhead,rs)}recoverByDelete(rs,ns){let ss=rs<=this.p.parser.maxNode;ss&&this.storeNode(rs,this.pos,ns,4),this.storeNode(0,this.pos,ns,ss?8:4),this.pos=this.reducePos=ns,this.score-=190}canShift(rs){for(let ns=new SimulatedStack(this);;){let ss=this.p.parser.stateSlot(ns.state,4)||this.p.parser.hasAction(ns.state,rs);if(!(ss&65536))return!0;if(ss==0)return!1;ns.reduce(ss)}}recoverByInsert(rs){if(this.stack.length>=300)return[];let ns=this.p.parser.nextStates(this.state);if(ns.length>4<<1||this.stack.length>=120){let os=[];for(let ls=0,us;lsds&1&&cs==us)||os.push(ns[ls],us)}ns=os}let ss=[];for(let os=0;os>19,os=rs&65535,ls=this.stack.length-ss*3;if(ls<0||ns.getGoto(this.stack[ls],os,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reduce(rs),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:rs}=this.p;return rs.data[rs.stateSlot(this.state,1)]==65535&&!rs.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(rs){if(this.state!=rs.state||this.stack.length!=rs.stack.length)return!1;for(let ns=0;nsthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=rs)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};class StackContext{constructor(rs,ns){this.tracker=rs,this.context=ns,this.hash=rs.strict?rs.hash(ns):0}}var Recover;(function(as){as[as.Insert=200]="Insert",as[as.Delete=190]="Delete",as[as.Reduce=100]="Reduce",as[as.MaxNext=4]="MaxNext",as[as.MaxInsertStackDepth=300]="MaxInsertStackDepth",as[as.DampenInsertStackDepth=120]="DampenInsertStackDepth"})(Recover||(Recover={}));class SimulatedStack{constructor(rs){this.start=rs,this.state=rs.state,this.stack=rs.stack,this.base=this.stack.length}reduce(rs){let ns=rs&65535,ss=rs>>19;ss==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(ss-1)*3;let os=this.start.p.parser.getGoto(this.stack[this.base-3],ns,!0);this.state=os}}class StackBufferCursor{constructor(rs,ns,ss){this.stack=rs,this.pos=ns,this.index=ss,this.buffer=rs.buffer,this.index==0&&this.maybeNext()}static create(rs,ns=rs.bufferBase+rs.buffer.length){return new StackBufferCursor(rs,ns,ns-rs.bufferBase)}maybeNext(){let rs=this.stack.parent;rs!=null&&(this.index=this.stack.bufferBase-rs.bufferBase,this.stack=rs,this.buffer=rs.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new StackBufferCursor(this.stack,this.pos,this.index)}}class CachedToken{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const nullToken=new CachedToken;class InputStream{constructor(rs,ns){this.input=rs,this.ranges=ns,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=nullToken,this.rangeIndex=0,this.pos=this.chunkPos=ns[0].from,this.range=ns[0],this.end=ns[ns.length-1].to,this.readNext()}resolveOffset(rs,ns){let ss=this.range,os=this.rangeIndex,ls=this.pos+rs;for(;lsss.to:ls>=ss.to;){if(os==this.ranges.length-1)return null;let us=this.ranges[++os];ls+=us.from-ss.to,ss=us}return ls}peek(rs){let ns=this.chunkOff+rs,ss,os;if(ns>=0&&ns=this.chunk2Pos&&sscs.to&&(this.chunk2=this.chunk2.slice(0,cs.to-ss)),os=this.chunk2.charCodeAt(0)}}return ss>=this.token.lookAhead&&(this.token.lookAhead=ss+1),os}acceptToken(rs,ns=0){let ss=ns?this.resolveOffset(ns,-1):this.pos;if(ss==null||ss=this.chunk2Pos&&this.posthis.range.to?rs.slice(0,this.range.to-this.pos):rs,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(rs=1){for(this.chunkOff+=rs;this.pos+rs>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();rs-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=rs,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(rs,ns){if(ns?(this.token=ns,ns.start=rs,ns.lookAhead=rs+1,ns.value=ns.extended=-1):this.token=nullToken,this.pos!=rs){if(this.pos=rs,rs==this.end)return this.setDone(),this;for(;rs=this.range.to;)this.range=this.ranges[++this.rangeIndex];rs>=this.chunkPos&&rs=this.chunkPos&&ns<=this.chunkPos+this.chunk.length)return this.chunk.slice(rs-this.chunkPos,ns-this.chunkPos);if(rs>=this.chunk2Pos&&ns<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(rs-this.chunk2Pos,ns-this.chunk2Pos);if(rs>=this.range.from&&ns<=this.range.to)return this.input.read(rs,ns);let ss="";for(let os of this.ranges){if(os.from>=ns)break;os.to>rs&&(ss+=this.input.read(Math.max(os.from,rs),Math.min(os.to,ns)))}return ss}}class TokenGroup{constructor(rs,ns){this.data=rs,this.id=ns}token(rs,ns){readToken(this.data,rs,ns,this.id)}}TokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;class ExternalTokenizer{constructor(rs,ns={}){this.token=rs,this.contextual=!!ns.contextual,this.fallback=!!ns.fallback,this.extend=!!ns.extend}}function readToken(as,rs,ns,ss){let os=0,ls=1<0){let fs=as[ps];if(cs.allows(fs)&&(rs.token.value==-1||rs.token.value==fs||us.overrides(fs,rs.token.value))){rs.acceptToken(fs);break}}for(let ps=rs.next,fs=0,hs=as[os+2];fs>1,ys=ds+gs+(gs<<1),bs=as[ys],vs=as[ys+1];if(ps=vs)fs=gs+1;else{os=as[ys+2],rs.advance();continue e}}break}}function decodeArray(as,rs=Uint16Array){if(typeof as!="string")return as;let ns=null;for(let ss=0,os=0;ss=92&&us--,us>=34&&us--;let ds=us-32;if(ds>=46&&(ds-=46,cs=!0),ls+=ds,cs)break;ls*=46}ns?ns[os++]=ls:ns=new rs(ls)}return ns}const verbose=typeof browser$1$2<"u"&&/\bparse\b/.test({}.LOG);let stackIDs=null;var Safety;(function(as){as[as.Margin=25]="Margin"})(Safety||(Safety={}));function cutAt(as,rs,ns){let ss=as.fullCursor();for(ss.moveTo(rs);;)if(!(ns<0?ss.childBefore(rs):ss.childAfter(rs)))for(;;){if((ns<0?ss.tors)&&!ss.type.isError)return ns<0?Math.max(0,Math.min(ss.to-1,rs-25)):Math.min(as.length,Math.max(ss.from+1,rs+25));if(ns<0?ss.prevSibling():ss.nextSibling())break;if(!ss.parent())return ns<0?0:as.length}}class FragmentCursor{constructor(rs,ns){this.fragments=rs,this.nodeSet=ns,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let rs=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(rs){for(this.safeFrom=rs.openStart?cutAt(rs.tree,rs.from+rs.offset,1)-rs.offset:rs.from,this.safeTo=rs.openEnd?cutAt(rs.tree,rs.to+rs.offset,-1)-rs.offset:rs.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(rs.tree),this.start.push(-rs.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(rs){if(rsrs)return this.nextStart=us,null;if(ls instanceof Tree){if(us==rs){if(us=Math.max(this.safeFrom,rs)&&(this.trees.push(ls),this.start.push(us),this.index.push(0))}else this.index[ns]++,this.nextStart=us+ls.length}}}class TokenCache{constructor(rs,ns){this.stream=ns,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=rs.tokenizers.map(ss=>new CachedToken)}getActions(rs){let ns=0,ss=null,{parser:os}=rs.p,{tokenizers:ls}=os,us=os.stateSlot(rs.state,3),cs=rs.curContext?rs.curContext.hash:0,ds=0;for(let ps=0;pshs.end+25&&(ds=Math.max(hs.lookAhead,ds)),hs.value!=0)){let gs=ns;if(hs.extended>-1&&(ns=this.addActions(rs,hs.extended,hs.end,ns)),ns=this.addActions(rs,hs.value,hs.end,ns),!fs.extend&&(ss=hs,ns>gs))break}}for(;this.actions.length>ns;)this.actions.pop();return ds&&rs.setLookAhead(ds),!ss&&rs.pos==this.stream.end&&(ss=new CachedToken,ss.value=rs.p.parser.eofTerm,ss.start=ss.end=rs.pos,ns=this.addActions(rs,ss.value,ss.end,ns)),this.mainToken=ss,this.actions}getMainToken(rs){if(this.mainToken)return this.mainToken;let ns=new CachedToken,{pos:ss,p:os}=rs;return ns.start=ss,ns.end=Math.min(ss+1,os.stream.end),ns.value=ss==os.stream.end?os.parser.eofTerm:0,ns}updateCachedToken(rs,ns,ss){if(ns.token(this.stream.reset(ss.pos,rs),ss),rs.value>-1){let{parser:os}=ss.p;for(let ls=0;ls=0&&ss.p.parser.dialect.allows(us>>1)){us&1?rs.extended=us>>1:rs.value=us>>1;break}}}else rs.value=0,rs.end=Math.min(ss.p.stream.end,ss.pos+1)}putAction(rs,ns,ss,os){for(let ls=0;lsrs.bufferLength*4?new FragmentCursor(ss,rs.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let rs=this.stacks,ns=this.minStackPos,ss=this.stacks=[],os,ls;for(let us=0;usns)ss.push(cs);else{if(this.advanceStack(cs,ss,rs))continue;{os||(os=[],ls=[]),os.push(cs);let ds=this.tokens.getMainToken(cs);ls.push(ds.value,ds.end)}}break}}if(!ss.length){let us=os&&findFinished(os);if(us)return this.stackToTree(us);if(this.parser.strict)throw verbose&&os&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+ns);this.recovering||(this.recovering=5)}if(this.recovering&&os){let us=this.stoppedAt!=null&&os[0].pos>this.stoppedAt?os[0]:this.runRecovery(os,ls,ss);if(us)return this.stackToTree(us.forceAll())}if(this.recovering){let us=this.recovering==1?1:this.recovering*3;if(ss.length>us)for(ss.sort((cs,ds)=>ds.score-cs.score);ss.length>us;)ss.pop();ss.some(cs=>cs.reducePos>ns)&&this.recovering--}else if(ss.length>1)e:for(let us=0;us500&&ps.buffer.length>500)if((cs.score-ps.score||cs.buffer.length-ps.buffer.length)>0)ss.splice(ds--,1);else{ss.splice(us--,1);continue e}}}this.minStackPos=ss[0].pos;for(let us=1;us ":"";if(this.stoppedAt!=null&&os>this.stoppedAt)return rs.forceReduce()?rs:null;if(this.fragments){let ps=rs.curContext&&rs.curContext.tracker.strict,fs=ps?rs.curContext.hash:0;for(let hs=this.fragments.nodeAt(os);hs;){let gs=this.parser.nodeSet.types[hs.type.id]==hs.type?ls.getGoto(rs.state,hs.type.id):-1;if(gs>-1&&hs.length&&(!ps||(hs.prop(NodeProp.contextHash)||0)==fs))return rs.useNode(hs,gs),verbose&&console.log(us+this.stackID(rs)+` (via reuse of ${ls.getName(hs.type.id)})`),!0;if(!(hs instanceof Tree)||hs.children.length==0||hs.positions[0]>0)break;let ys=hs.children[0];if(ys instanceof Tree&&hs.positions[0]==0)hs=ys;else break}}let cs=ls.stateSlot(rs.state,4);if(cs>0)return rs.reduce(cs),verbose&&console.log(us+this.stackID(rs)+` (via always-reduce ${ls.getName(cs&65535)})`),!0;if(rs.stack.length>=15e3)for(;rs.stack.length>9e3&&rs.forceReduce(););let ds=this.tokens.getActions(rs);for(let ps=0;psos?ns.push(bs):ss.push(bs)}return!1}advanceFully(rs,ns){let ss=rs.pos;for(;;){if(!this.advanceStack(rs,null,null))return!1;if(rs.pos>ss)return pushStackDedup(rs,ns),!0}}runRecovery(rs,ns,ss){let os=null,ls=!1;for(let us=0;us ":"";if(cs.deadEnd&&(ls||(ls=!0,cs.restart(),verbose&&console.log(fs+this.stackID(cs)+" (restarted)"),this.advanceFully(cs,ss))))continue;let hs=cs.split(),gs=fs;for(let ys=0;hs.forceReduce()&&ys<10&&(verbose&&console.log(gs+this.stackID(hs)+" (via force-reduce)"),!this.advanceFully(hs,ss));ys++)verbose&&(gs=this.stackID(hs)+" -> ");for(let ys of cs.recoverByInsert(ds))verbose&&console.log(fs+this.stackID(ys)+" (via recover-insert)"),this.advanceFully(ys,ss);this.stream.end>cs.pos?(ps==cs.pos&&(ps++,ds=0),cs.recoverByDelete(ds,ps),verbose&&console.log(fs+this.stackID(cs)+` (via recover-delete ${this.parser.getName(ds)})`),pushStackDedup(cs,ss)):(!os||os.scoreas;class ContextTracker{constructor(rs){this.start=rs.start,this.shift=rs.shift||id,this.reduce=rs.reduce||id,this.reuse=rs.reuse||id,this.hash=rs.hash||(()=>0),this.strict=rs.strict!==!1}}class LRParser extends Parser$1{constructor(rs){if(super(),this.wrappers=[],rs.version!=13)throw new RangeError(`Parser version (${rs.version}) doesn't match runtime version (13)`);let ns=rs.nodeNames.split(" ");this.minRepeatTerm=ns.length;for(let cs=0;csrs.topRules[cs][1]),os=[];for(let cs=0;cs=0)ls(fs,ds,cs[ps++]);else{let hs=cs[ps+-fs];for(let gs=-fs;gs>0;gs--)ls(cs[ps++],ds,hs);ps++}}}this.nodeSet=new NodeSet(ns.map((cs,ds)=>NodeType.define({name:ds>=this.minRepeatTerm?void 0:cs,id:ds,props:os[ds],top:ss.indexOf(ds)>-1,error:ds==0,skipped:rs.skippedNodes&&rs.skippedNodes.indexOf(ds)>-1}))),this.strict=!1,this.bufferLength=DefaultBufferLength;let us=decodeArray(rs.tokenData);if(this.context=rs.context,this.specialized=new Uint16Array(rs.specialized?rs.specialized.length:0),this.specializers=[],rs.specialized)for(let cs=0;cstypeof cs=="number"?new TokenGroup(us,cs):cs),this.topRules=rs.topRules,this.dialects=rs.dialects||{},this.dynamicPrecedences=rs.dynamicPrecedences||null,this.tokenPrecTable=rs.tokenPrec,this.termNames=rs.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(rs,ns,ss){let os=new Parse(this,rs,ns,ss);for(let ls of this.wrappers)os=ls(os,rs,ns,ss);return os}getGoto(rs,ns,ss=!1){let os=this.goto;if(ns>=os[0])return-1;for(let ls=os[ns+1];;){let us=os[ls++],cs=us&1,ds=os[ls++];if(cs&&ss)return ds;for(let ps=ls+(us>>1);ls0}validAction(rs,ns){if(ns==this.stateSlot(rs,4))return!0;for(let ss=this.stateSlot(rs,1);;ss+=3){if(this.data[ss]==65535)if(this.data[ss+1]==1)ss=pair(this.data,ss+2);else return!1;if(ns==pair(this.data,ss+1))return!0}}nextStates(rs){let ns=[];for(let ss=this.stateSlot(rs,1);;ss+=3){if(this.data[ss]==65535)if(this.data[ss+1]==1)ss=pair(this.data,ss+2);else break;if(!(this.data[ss+2]&1)){let os=this.data[ss+1];ns.some((ls,us)=>us&1&&ls==os)||ns.push(this.data[ss],os)}}return ns}overrides(rs,ns){let ss=findOffset(this.data,this.tokenPrecTable,ns);return ss<0||findOffset(this.data,this.tokenPrecTable,rs){let os=rs.tokenizers.find(ls=>ls.from==ss);return os?os.to:ss})),rs.contextTracker&&(ns.context=rs.contextTracker),rs.dialect&&(ns.dialect=this.parseDialect(rs.dialect)),rs.strict!=null&&(ns.strict=rs.strict),rs.wrap&&(ns.wrappers=ns.wrappers.concat(rs.wrap)),rs.bufferLength!=null&&(ns.bufferLength=rs.bufferLength),ns}getName(rs){return this.termNames?this.termNames[rs]:String(rs<=this.maxNode&&this.nodeSet.types[rs].name||rs)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(rs){let ns=this.dynamicPrecedences;return ns==null?0:ns[rs]||0}parseDialect(rs){let ns=Object.keys(this.dialects),ss=ns.map(()=>!1);if(rs)for(let ls of rs.split(" ")){let us=ns.indexOf(ls);us>=0&&(ss[us]=!0)}let os=null;for(let ls=0;lsss)&&ns.p.parser.stateFlag(ns.state,2)&&(!rs||rs.score=65&&as<=90||as==95||as>=97&&as<=122||as>=161}function isSpace(as){return as==9||as==10||as==13||as==32}let cachedName=null,cachedInput=null,cachedPos=0;function tagNameAfter(as,rs){let ns=as.pos+rs;if(cachedInput==as&&cachedPos==ns)return cachedName;for(;isSpace(as.peek(rs));)rs++;let ss="";for(;;){let os=as.peek(rs);if(!nameChar(os))break;ss+=String.fromCharCode(os),rs++}return cachedInput=as,cachedPos=ns,cachedName=ss||null}function ElementContext(as,rs){this.name=as,this.parent=rs,this.hash=rs?rs.hash:0;for(let ns=0;ns{if(as.next==60){if(as.advance(),as.next==47){as.advance();let ns=tagNameAfter(as,0);if(!ns)return as.acceptToken(incompleteStartCloseTag);if(rs.context&&ns.toLowerCase()==rs.context.name.toLowerCase())return as.acceptToken(StartCloseTag);for(let ss=rs.context;ss;ss=ss.parent)if(ss.name==ns)return as.acceptToken(MissingCloseTag,-2);as.acceptToken(mismatchedStartCloseTag)}else if(as.next!=33&&as.next!=63&&!isSpace(as.next))return as.acceptToken(StartTag)}},{contextual:!0});function scanTo(as,rs){return new ExternalTokenizer(ns=>{for(let ss=0,os=0;;os++){if(ns.next<0){os&&ns.acceptToken(as);break}if(ns.next==rs.charCodeAt(ss)){if(ss++,ss==rs.length){os>rs.length&&ns.acceptToken(as,1-rs.length);break}}else ss=0;ns.advance()}})}const commentContent=scanTo(commentContent$1,"-->"),parser=LRParser.deserialize({version:13,states:"*[OQOTOOO]OYO'#CdOeO`O'#CfO!OOTO'#CeOOOP'#Ce'#CeOOOP'#Cx'#CxOOOP'#Co'#CoQQOTOOOOOQ'#Cp'#CpO!VOYO,59OOOOP,59O,59OO!_OpO,59QO!mO`O'#ClOOOP'#DT'#DTOOOP'#Cu'#CuO!rOTO,59PO!yO`O'#CmOOOP,59P,59POOOP-E6m-E6mOOOQ-E6n-E6nOOOP1G.j1G.jOOOO'#Cq'#CqO#ROpO1G.lO#aOpO'#ChOOOO'#Cr'#CrO#rOpO1G.lOOOP1G.l1G.lOOOP1G.t1G.tO#}OWO,59WOOOP-E6s-E6sOOOP1G.k1G.kO$SO`O,59XO$[OWO,59XOOOO-E6o-E6oO$dOpO7+$WOOOP7+$W7+$WOOOP7+$`7+$`O$oOpO,59SO%QOWO,59SOOOO-E6p-E6pOOOP1G.r1G.rO%]OWO1G.sO%]OWO1G.sOOOP1G.s1G.sOOOP< tag. Found ${as.slice(ds-1,bs)}`)}us.firstChild();let gs=as.substring(us.from,us.to);if(us.nextSibling()===!1){if(gs in ps)throw Error(`Duplicate attribute ${gs}. Found in component of type ${cs} at indices ${us.from}-${us.to}`);ps[gs]=!0}else{us.nextSibling();let ys=as.substring(us.from+1,us.to-1);if(gs in ps)throw Error(`Duplicate attribute ${gs}. Found in component of type ${cs} at indices ${us.from}-${us.to}`);ps[gs]=ys}us.parent()}us.parent();let fs=us.to,hs={componentType:cs,props:{...ps},children:[]};for(;us.nextSibling();)if(us.name==="Text"){let gs=as.substring(us.from,us.to);gs!==""&&hs.children.push(gs)}else if(us.name==="Element")hs.children.push(rs(us.node.cursor));else{if(us.name==="CloseTag")break;if(us.name==="Comment")continue;throw us.name==="MismatchedCloseTag"?Error(`Invalid DoenetML at position ${us.from}. Mismatched closing tag. Expected . Found ${as.slice(us.from,us.to)}.`):Error(`Invalid DoenetML at position ${us.from}. Expected a closing tag. Instead found ${as.slice(us.from,us.to)}.`)}return hs.range={openBegin:ds,openEnd:fs,closeBegin:us.from,closeEnd:us.to},hs}else if(us.name==="SelfClosingTag"){us.firstChild(),us.nextSibling();let cs=as.substring(us.from,us.to),ds=us.from,ps={};for(;us.nextSibling();){if(us.name!=="Attribute")throw Error(`Invalid DoenetML at positions ${us.from} to ${us.to}. Error in self-closing <${cs}/> tag.`);us.firstChild();let hs=as.substring(us.from,us.to);if(us.nextSibling()===!1){if(hs in ps)throw Error(`Duplicate attribute ${hs}. Found in component of type ${cs} at indices ${us.from}-${us.to}`);ps[hs]=!0}else{if(us.nextSibling(),hs in ps)throw Error(`Duplicate attribute ${hs}. Found in component of type ${cs} at indices ${us.from}-${us.to}`);let gs=as.substring(us.from+1,us.to-1);ps[hs]=gs}us.parent()}let fs={selfCloseBegin:ds,selfCloseEnd:us.to+3};return{componentType:cs,props:{...ps},children:[],range:fs}}else throw Error("Non SelfClosingTag/OpenTag in Element. How did you do that?")}function ns(us){if(us.node.name==="Element")return rs(us.node.cursor);if(us.node.name==="Comment")return null;if(us.node.name==="Text"){let cs=as.substring(us.node.from,us.node.to);if(cs!=="")return cs}else throw Error(`Invalid DoenetML at positions ${us.node.from} to ${us.node.to}. Found ${as.substring(us.node.from,us.node.to)}`)}if(!as)return[];let ss=parse(as),os=[];if(!ss.firstChild())return os;let ls=ns(ss);for(ls!=null&&os.push(ls);ss.nextSibling();){let us=ns(ss);us!=null&&os.push(us)}return os}var base32Exports={},base32$1={get exports(){return base32Exports},set exports(as){base32Exports=as}};(function(as){(function(){var rs=typeof window=="object"?window:{},ns=!rs.HI_BASE32_NO_NODE_JS&&typeof browser$1$2=="object"&&browser$1$2.versions&&browser$1$2.versions.node;ns&&(rs=commonjsGlobal$1);var ss=!rs.HI_BASE32_NO_COMMON_JS&&!0&&as.exports,os="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),ls={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},us=[0,0,0,0,0,0,0,0],cs=function(xs,Cs){Cs.length>10&&(Cs="..."+Cs.substr(-10));var Ts=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+xs+" bytes: "+Cs+" <-");throw Ts.position=xs,Ts},ds=function(xs){for(var Cs="",Ts=xs.length,Ss=0,Ns=0,As,ws;Ss191&&As<=223?(ws=As&31,Ns=1):As<=239?(ws=As&15,Ns=2):As<=247?(ws=As&7,Ns=3):cs(Ss,Cs);for(var Es=0;Es191)&&cs(Ss,Cs),ws<<=6,ws+=As&63;ws>=55296&&ws<=57343&&cs(Ss,Cs),ws>1114111&&cs(Ss,Cs),ws<=65535?Cs+=String.fromCharCode(ws):(ws-=65536,Cs+=String.fromCharCode((ws>>10)+55296),Cs+=String.fromCharCode((ws&1023)+56320))}return Cs},ps=function(xs){if(xs==="")return[];if(!/^[A-Z2-7=]+$/.test(xs))throw new Error("Invalid base32 characters");xs=xs.replace(/=/g,"");for(var Cs,Ts,Ss,Ns,As,ws,Es,_s,$s=[],Rs=0,Ds=xs.length,Os=0,Is=Ds>>3<<3;Os>>2)&255,$s[Rs++]=(Ts<<6|Ss<<1|Ns>>>4)&255,$s[Rs++]=(Ns<<4|As>>>1)&255,$s[Rs++]=(As<<7|ws<<2|Es>>>3)&255,$s[Rs++]=(Es<<5|_s)&255;var Vs=Ds-Is;return Vs===2?(Cs=ls[xs.charAt(Os++)],Ts=ls[xs.charAt(Os++)],$s[Rs++]=(Cs<<3|Ts>>>2)&255):Vs===4?(Cs=ls[xs.charAt(Os++)],Ts=ls[xs.charAt(Os++)],Ss=ls[xs.charAt(Os++)],Ns=ls[xs.charAt(Os++)],$s[Rs++]=(Cs<<3|Ts>>>2)&255,$s[Rs++]=(Ts<<6|Ss<<1|Ns>>>4)&255):Vs===5?(Cs=ls[xs.charAt(Os++)],Ts=ls[xs.charAt(Os++)],Ss=ls[xs.charAt(Os++)],Ns=ls[xs.charAt(Os++)],As=ls[xs.charAt(Os++)],$s[Rs++]=(Cs<<3|Ts>>>2)&255,$s[Rs++]=(Ts<<6|Ss<<1|Ns>>>4)&255,$s[Rs++]=(Ns<<4|As>>>1)&255):Vs===7&&(Cs=ls[xs.charAt(Os++)],Ts=ls[xs.charAt(Os++)],Ss=ls[xs.charAt(Os++)],Ns=ls[xs.charAt(Os++)],As=ls[xs.charAt(Os++)],ws=ls[xs.charAt(Os++)],Es=ls[xs.charAt(Os++)],$s[Rs++]=(Cs<<3|Ts>>>2)&255,$s[Rs++]=(Ts<<6|Ss<<1|Ns>>>4)&255,$s[Rs++]=(Ns<<4|As>>>1)&255,$s[Rs++]=(As<<7|ws<<2|Es>>>3)&255),$s},fs=function(xs){for(var Cs,Ts,Ss,Ns,As,ws="",Es=xs.length,_s=0,$s=parseInt(Es/5)*5;_s<$s;)Cs=xs.charCodeAt(_s++),Ts=xs.charCodeAt(_s++),Ss=xs.charCodeAt(_s++),Ns=xs.charCodeAt(_s++),As=xs.charCodeAt(_s++),ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[(Ss<<1|Ns>>>7)&31]+os[Ns>>>2&31]+os[(Ns<<3|As>>>5)&31]+os[As&31];var Rs=Es-$s;return Rs===1?(Cs=xs.charCodeAt(_s),ws+=os[Cs>>>3]+os[Cs<<2&31]+"======"):Rs===2?(Cs=xs.charCodeAt(_s++),Ts=xs.charCodeAt(_s),ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[Ts<<4&31]+"===="):Rs===3?(Cs=xs.charCodeAt(_s++),Ts=xs.charCodeAt(_s++),Ss=xs.charCodeAt(_s),ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[Ss<<1&31]+"==="):Rs===4&&(Cs=xs.charCodeAt(_s++),Ts=xs.charCodeAt(_s++),Ss=xs.charCodeAt(_s++),Ns=xs.charCodeAt(_s),ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[(Ss<<1|Ns>>>7)&31]+os[Ns>>>2&31]+os[Ns<<3&31]+"="),ws},hs=function(xs){var Cs,Ts,Ss,Ns,As,ws,Es=!1,_s="",$s=0,Rs,Ds=0,Os=xs.length;if(xs==="")return _s;do{for(us[0]=us[5],us[1]=us[6],us[2]=us[7],Rs=Ds;$s>6,us[Rs++]=128|ws&63):ws<55296||ws>=57344?(us[Rs++]=224|ws>>12,us[Rs++]=128|ws>>6&63,us[Rs++]=128|ws&63):(ws=65536+((ws&1023)<<10|xs.charCodeAt(++$s)&1023),us[Rs++]=240|ws>>18,us[Rs++]=128|ws>>12&63,us[Rs++]=128|ws>>6&63,us[Rs++]=128|ws&63);Ds=Rs-5,$s===Os&&++$s,$s>Os&&Rs<6&&(Es=!0),Cs=us[0],Rs>4?(Ts=us[1],Ss=us[2],Ns=us[3],As=us[4],_s+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[(Ss<<1|Ns>>>7)&31]+os[Ns>>>2&31]+os[(Ns<<3|As>>>5)&31]+os[As&31]):Rs===1?_s+=os[Cs>>>3]+os[Cs<<2&31]+"======":Rs===2?(Ts=us[1],_s+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[Ts<<4&31]+"===="):Rs===3?(Ts=us[1],Ss=us[2],_s+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[Ss<<1&31]+"==="):(Ts=us[1],Ss=us[2],Ns=us[3],_s+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[(Ss<<1|Ns>>>7)&31]+os[Ns>>>2&31]+os[Ns<<3&31]+"=")}while(!Es);return _s},gs=function(xs){for(var Cs,Ts,Ss,Ns,As,ws="",Es=xs.length,_s=0,$s=parseInt(Es/5)*5;_s<$s;)Cs=xs[_s++],Ts=xs[_s++],Ss=xs[_s++],Ns=xs[_s++],As=xs[_s++],ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[(Ss<<1|Ns>>>7)&31]+os[Ns>>>2&31]+os[(Ns<<3|As>>>5)&31]+os[As&31];var Rs=Es-$s;return Rs===1?(Cs=xs[_s],ws+=os[Cs>>>3]+os[Cs<<2&31]+"======"):Rs===2?(Cs=xs[_s++],Ts=xs[_s],ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[Ts<<4&31]+"===="):Rs===3?(Cs=xs[_s++],Ts=xs[_s++],Ss=xs[_s],ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[Ss<<1&31]+"==="):Rs===4&&(Cs=xs[_s++],Ts=xs[_s++],Ss=xs[_s++],Ns=xs[_s],ws+=os[Cs>>>3]+os[(Cs<<2|Ts>>>6)&31]+os[Ts>>>1&31]+os[(Ts<<4|Ss>>>4)&31]+os[(Ss<<1|Ns>>>7)&31]+os[Ns>>>2&31]+os[Ns<<3&31]+"="),ws},ys=function(xs,Cs){var Ts=typeof xs!="string";return Ts&&xs.constructor===ArrayBuffer&&(xs=new Uint8Array(xs)),Ts?gs(xs):Cs?fs(xs):hs(xs)},bs=function(xs,Cs){if(!Cs)return ds(ps(xs));if(xs==="")return"";if(!/^[A-Z2-7=]+$/.test(xs))throw new Error("Invalid base32 characters");var Ts,Ss,Ns,As,ws,Es,_s,$s,Rs="",Ds=xs.indexOf("=");Ds===-1&&(Ds=xs.length);for(var Os=0,Is=Ds>>3<<3;Os>>2)&255)+String.fromCharCode((Ss<<6|Ns<<1|As>>>4)&255)+String.fromCharCode((As<<4|ws>>>1)&255)+String.fromCharCode((ws<<7|Es<<2|_s>>>3)&255)+String.fromCharCode((_s<<5|$s)&255);var Vs=Ds-Is;return Vs===2?(Ts=ls[xs.charAt(Os++)],Ss=ls[xs.charAt(Os++)],Rs+=String.fromCharCode((Ts<<3|Ss>>>2)&255)):Vs===4?(Ts=ls[xs.charAt(Os++)],Ss=ls[xs.charAt(Os++)],Ns=ls[xs.charAt(Os++)],As=ls[xs.charAt(Os++)],Rs+=String.fromCharCode((Ts<<3|Ss>>>2)&255)+String.fromCharCode((Ss<<6|Ns<<1|As>>>4)&255)):Vs===5?(Ts=ls[xs.charAt(Os++)],Ss=ls[xs.charAt(Os++)],Ns=ls[xs.charAt(Os++)],As=ls[xs.charAt(Os++)],ws=ls[xs.charAt(Os++)],Rs+=String.fromCharCode((Ts<<3|Ss>>>2)&255)+String.fromCharCode((Ss<<6|Ns<<1|As>>>4)&255)+String.fromCharCode((As<<4|ws>>>1)&255)):Vs===7&&(Ts=ls[xs.charAt(Os++)],Ss=ls[xs.charAt(Os++)],Ns=ls[xs.charAt(Os++)],As=ls[xs.charAt(Os++)],ws=ls[xs.charAt(Os++)],Es=ls[xs.charAt(Os++)],_s=ls[xs.charAt(Os++)],Rs+=String.fromCharCode((Ts<<3|Ss>>>2)&255)+String.fromCharCode((Ss<<6|Ns<<1|As>>>4)&255)+String.fromCharCode((As<<4|ws>>>1)&255)+String.fromCharCode((ws<<7|Es<<2|_s>>>3)&255)),Rs},vs={encode:ys,decode:bs};bs.asBytes=ps,ss?as.exports=vs:rs.base32=vs})()})(base32$1);const base32=base32Exports;async function cidFromText(as){let ns=new TextEncoder().encode(as);return await cidFromArrayBuffer(ns)}async function cidFromArrayBuffer(as){let rs=await crypto.subtle.digest("SHA-256",as),ns=new Uint8Array(36);return ns.set([1,85,18,32]),ns.set(new Uint8Array(rs),4),"b"+base32.encode(ns).toLowerCase().replace(/=+/,"")}const textByCid={};function retrieveTextFileForCid(as,rs="doenet"){return textByCid[as]!==void 0?Promise.resolve(textByCid[as]):new Promise((ns,ss)=>{let os=retrieveTextFileFromIPFS(as),ls=os.promise,us=os.controller,cs,ds=!1,ps=!1,fs;ls.then(hs=>{clearTimeout(fs),cs&&!ps&&cs.abort(),textByCid[as]=hs,ns(hs)}).catch(hs=>{ds=!0,ps&&(clearTimeout(fs),ss(hs))}),fs=setTimeout(()=>{let hs=retrieveTextFileFromServer(as,rs),gs=hs.promise;cs=hs.controller,gs.then(ys=>{ds||us.abort(),textByCid[as]=ys,ns(ys)}).catch(ys=>{ps=!0,ds?ss(ys):fs=setTimeout(()=>{us.abort(),ss(ys)},5e3)})},100)})}function retrieveTextFileFromIPFS(as){let rs=new AbortController,ns=rs.signal;return{promise:async function(){try{let ls=await fetch(`https://${as}.ipfs.dweb.link/`,{signal:ns});if(ls.ok){let us=await ls.text();return await cidFromText(us)===as?us:Promise.reject(new Error("cid mismatch"))}else return Promise.reject(new Error(`cid not found: ${as}`))}catch{return Promise.reject(new Error(`cid not found: ${as}`))}}(),controller:rs}}function retrieveTextFileFromServer(as,rs){let ns=new AbortController,ss=ns.signal;return{promise:async function(){try{let us=await fetch(`/media/${as}.${rs}`,{signal:ss});if(us.ok){let cs=await us.text(),ds=await cidFromText(cs);return ds===as?cs:(console.warn(`cid mismatch, ${as}, ${ds}`),Promise.reject(new Error("cid mismatch")))}else return Promise.reject(new Error(`cid not found: ${as}`))}catch{return Promise.reject(new Error(`cid not found: ${as}`))}}(),controller:ns}}async function expandDoenetMLsToFullSerializedComponents({cids:as,doenetMLs:rs,componentInfoObjects:ns}){var us,cs;let ss=[],os={};for(let ds of rs){let ps=parseAndCompile(ds);ps=cleanIfHaveJustDocument(ps),substituteDeprecations(ps),temporarilyRenameSourceBackToTarget(ps),correctComponentTypeCapitalization(ps,ns.componentTypeLowerCaseMapping),copyTargetOrFromURIAttributeCreatesCopyComponent(ps,ns.isCompositeComponent),createAttributesFromProps(ps,ns),breakUpTargetIntoPropsAndIndices(ps,ns),applyMacros(ps,ns),removeBlankStringChildren(ps,ns),decodeXMLEntities(ps),applySugar({serializedComponents:ps,componentInfoObjects:ns}),ss.push(ps);let fs=findContentCopies({serializedComponents:ps});for(let hs in fs.cidComponents)os[hs]===void 0&&(os[hs]=[]),os[hs].push(...fs.cidComponents[hs])}let ls=Object.keys(os);if(ls.length>0){let{newDoenetMLs:ds,newCids:ps}=await cidsToDoenetMLs(ls);for(let[gs,ys]of ls.entries())if(ps[gs]&&ps[gs].substring(0,ys.length)!==ys)return Promise.reject(new Error(`Requested cid ${ys} but got back ${ps[gs]}!`));let fs=ls.length;for(let gs=0;gstypeof Ns!="string"||Ns.trim()),Ts=Cs.length===1&&typeof Cs[0]=="object",Ss=(us=vs.doenetAttributes)==null?void 0:us.fromCopyFromURI;if(Ss||Ts)if(Ss&&!Ts)console.warn("ignoring copyFromURI as it was not a single component");else{let Ns=Cs[0];Ns.attributes||(Ns.attributes={}),vs.doenetAttributes||(vs.doenetAttributes={}),vs.doenetAttributes.keptNewNamespaceOfLastChild=!!((cs=Ns.attributes.newNamespace)!=null&&cs.primitive),Ns.attributes.newNamespace={primitive:!0},vs.children=[Ns,...vs.children],vs.doenetAttributes.nameFirstChildIndependently=!0}else{let Ns={componentType:"externalContent",children:JSON.parse(JSON.stringify(bs)),attributes:{newNamespace:{primitive:!0}},doenetAttributes:{createUniqueName:!0}};vs.children=[Ns,...vs.children]}}}}return{cids:as,fullSerializedComponents:ss}}function cidsToDoenetMLs(as){let rs=[],ns=as;for(let ss of as)rs.push(retrieveTextFileForCid(ss,"doenet"));return Promise.all(rs).then(ss=>Promise.resolve({newDoenetMLs:ss,newCids:ns})).catch(ss=>{let os;return ns.length===1?os=`Could not retrieve cid ${ns[0]}`:os=`Could not retrieve cids ${ns.join(",")}`,os+=": "+ss.message,console.error(os),Promise.reject(new Error(os))})}function removeBlankStringChildren(as,rs){for(let ns of as){if(ns.children){let ss=rs.allComponentClasses[ns.componentType];ss&&!ss.includeBlankStringChildren&&(ns.children=ns.children.filter(os=>typeof os!="string"||os.trim()!=="")),removeBlankStringChildren(ns.children,rs)}for(let ss in ns.attributes){let os=ns.attributes[ss].component;os&&os.children&&removeBlankStringChildren([os],rs)}}}function findContentCopies({serializedComponents:as}){let rs={};for(let ns of as)if(ns.componentType==="copy"){if(ns.attributes&&ns.attributes.uri){let ss=ns.attributes.uri.primitive;if(ss&&ss.substring(0,7).toLowerCase()==="doenet:"){let os=ss.match(/[:&]cid=([^&]+)/i);if(os){let ls=os[1];rs[ls]===void 0&&(rs[ls]=[]),rs[ls].push(ns)}}}}else if(ns.children!==void 0){let ss=findContentCopies({serializedComponents:ns.children});for(let os in ss.cidComponents)rs[os]===void 0&&(rs[os]=[]),rs[os].push(...ss.cidComponents[os])}return{cidComponents:rs}}function addDocumentIfItsMissing(as){if(as.length!==1||as[0].componentType!=="document"){let rs=as.splice(0);as.push({componentType:"document",children:rs})}}function substituteDeprecations(as){let rs={tname:"target",triggerwithtnames:"triggerWith",updatewithtname:"updateWith",paginatortname:"paginator",randomizeorder:"shuffleOrder",copytarget:"copySource",triggerwithtargets:"triggerWith",triggerwhentargetsclicked:"triggerWhenObjectsClicked",fortarget:"forObject",targetattributestoignore:"sourceAttributesToIgnore",targetattributestoignorerecursively:"sourceAttributesToIgnoreRecursively",targetsareresponses:"sourcesAreResponses",updatewithtarget:"updateWith",targetsarefunctionsymbols:"sourcesAreFunctionSymbols",selectforvariantnames:"selectForVariants"},ns={copy:{target:"source",tname:"source"},collect:{target:"source",tname:"source"},summarystatistics:{target:"source"}};for(let ss of as)if(typeof ss=="object"){if(ss.props){let os=ss.componentType,ls=ns[os.toLowerCase()];ls||(ls={});let us=!0;for(;us;){us=!1;for(let cs in ss.props){let ds=cs.toLowerCase();if(ds in ls){let ps=ls[ds];console.warn(`Attribute ${cs} of component type ${os} is deprecated. Use ${ps} instead.`),ss.props[ps]=ss.props[cs],delete ss.props[cs],us=!0;break}else if(ds in rs){let ps=rs[ds];console.warn(`Attribute ${cs} is deprecated. Use ${ps} instead.`),ss.props[ps]=ss.props[cs],delete ss.props[cs],us=!0;break}}}}ss.children&&substituteDeprecations(ss.children)}}function temporarilyRenameSourceBackToTarget(as){let rs={copysource:"copyTarget"},ns={copy:{source:"target"},collect:{source:"target"}};for(let ss of as)if(typeof ss=="object"){if(ss.props){let os=ss.componentType,ls=ns[os.toLowerCase()];ls||(ls={});let us=!0;for(;us;){us=!1;for(let cs in ss.props){let ds=cs.toLowerCase();if(ds in ls){let ps=ls[ds];ss.props[ps]=ss.props[cs],delete ss.props[cs],us=!0;break}else if(ds in rs){let ps=rs[ds];ss.props[ps]=ss.props[cs],delete ss.props[cs],us=!0;break}}}}ss.children&&temporarilyRenameSourceBackToTarget(ss.children)}}function cleanIfHaveJustDocument(as){let rs=as.filter(ns=>typeof ns!="string"||ns.trim()!=="");return rs.length===1&&rs[0].componentType==="document"?rs:as}function correctComponentTypeCapitalization(as,rs){for(let ns of as){if(typeof ns!="object")continue;let ss=rs[ns.componentType.toLowerCase()];if(ss)ns.componentType=ss;else throw Error(`Invalid component type${indexRangeString(ns)}: ${ns.componentType}`);ns.children&&correctComponentTypeCapitalization(ns.children,rs)}}function copyTargetOrFromURIAttributeCreatesCopyComponent(as,rs){for(let ns of as){if(ns.props){let ss=!1,os=!1,ls=!1,us=ns.componentType,cs=rs({componentType:us,includeNonStandard:!1}),ds=rs({componentType:us,includeNonStandard:!0});for(let ps of Object.keys(ns.props)){let fs=ps.toLowerCase();if(fs==="copytarget"){if(ss)throw Error(`Cannot repeat attribute ${ps}. Found in component type ${us}${indexRangeString(ns)}`);if(os)throw Error(`Cannot combine copyTarget and copyFromURI attribiutes. For in component of type ${us}${indexRangeString(ns)}`);if(ls)throw Error(ds?`A component of type ${us} cannot have both assignNames and copyTarget. Found${indexRangeString(ns)}.`:`Invalid attribute assignNames for component of type ${us}${indexRangeString(ns)}`);if(ss=!0,ns.doenetAttributes||(ns.doenetAttributes={}),cs||(ns.props.createComponentOfType=us,ns.doenetAttributes.nameBecomesAssignNames=!0),ns.componentType="copy",ns.props.target=ns.props[ps],typeof ns.props.target!="string")throw Error(`Must specify value for copyTarget. Found in component of type ${us}${indexRangeString(ns)}`);delete ns.props[ps],ns.doenetAttributes.fromCopyTarget=!0,ns.doenetAttributes.createNameFromComponentType=us,ns.props.assignNamesSkip="1"}else if(fs==="copyfromuri"){if(os)throw Error(`Cannot repeat attribute ${ps}. Found in component type ${us}${indexRangeString(ns)}`);if(ss)throw Error(`Cannot combine copyTarget and copyFromURI attribiutes. For in component of type ${us}${indexRangeString(ns)}`);if(ls)throw Error(ds?`A component of type ${us} cannot have both assignNames and copyFromURI. Found${indexRangeString(ns)}.`:`Invalid attribute assignNames for component of type ${us}${indexRangeString(ns)}`);if(os=!0,ns.doenetAttributes||(ns.doenetAttributes={}),cs||(ns.props.createComponentOfType=us,ns.doenetAttributes.nameBecomesAssignNames=!0),ns.componentType="copy",ns.props.uri=ns.props[ps],typeof ns.props.uri!="string")throw Error(`Must specify value for copyFromURI. Found in component of type ${us}${indexRangeString(ns)}`);delete ns.props[ps],ns.doenetAttributes.fromCopyFromURI=!0,ns.doenetAttributes.createNameFromComponentType=us,ns.props.assignNamesSkip="1"}else if(fs==="assignnames"&&!cs){if(ss||os)throw Error(ds?`A component of type ${us} cannot have both assignNames and copyTarget. Found${indexRangeString(ns)}.`:`Invalid attribute assignNames for component of type ${us}${indexRangeString(ns)}`);ls=!0}}if(ss){for(let fs of Object.keys(ns.props))if(fs.toLowerCase()==="prop")throw Error(`Invalid attribute prop for component of type ${us}${indexRangeString(ns)}`);let ps=!1;for(let fs of Object.keys(ns.props))if(fs.toLowerCase()==="copyprop"){if(ps)throw Error(`Cannot repeat attribute ${fs}. Found in component type ${us}${indexRangeString(ns)}`);ns.props.prop=ns.props[fs],delete ns.props[fs],ps=!0}}}ns.children&©TargetOrFromURIAttributeCreatesCopyComponent(ns.children,rs)}}function breakUpTargetIntoPropsAndIndices(as,rs,ns=""){for(let[ss,os]of as.entries()){if(os.props&&["copy","updateValue","animateFromSequence"].includes(os.componentType)){let ls,us,cs,ds,ps,fs,hs;for(let gs of Object.keys(os.props))if(gs.toLowerCase()==="target"){if(ls)throw Error(`Cannot repeat attribute ${gs}. Found in component type ${os.componentType}${indexRangeString(os)}`);ls=gs,hs=os.props[gs];let bs=buildSourcePieces(hs,!0);bs.success&&bs.matchLength===hs.length&&(us=bs.sourceName,cs=bs.componentIndex,ds=bs.componentAttributes,ps=bs.propArray,fs=bs.subNames)}if(ls&&us)if(cs||ds||ps.length>0){if(os.attributes.prop)throw Error(`Cannot combine the prop attribute with an extended source attribute. Found in component type ${os.componentType}${indexRangeString(os)}`);if(os.attributes.propIndex)throw Error(`Cannot combine the propIndex attribute with an extended source attribute. Found in component type ${os.componentType}${indexRangeString(os)}`);if(os.attributes.componentIndex)throw Error(`Cannot combine the componentIndex attribute with an extended source attribute. Found in component type ${os.componentType}${indexRangeString(os)}`);let gs=createComponentFromExtendedSource({sourceName:us,componentIndex:cs,subNames:fs,componentAttributes:ds,propArray:ps,componentInfoObjects:rs});if(gs.success){let ys=gs.newComponent;if(os.componentType==="copy")delete os.props[ls],Object.assign(os.attributes,ys.attributes),os.doenetAttributes||(os.doenetAttributes={}),Object.assign(os.doenetAttributes,ys.doenetAttributes),os.doenetAttributes.createNameFromComponentType||(os.doenetAttributes.createNameFromComponentType=os.componentType),os.componentType=ys.componentType,ps.length===0&&!(os.attributes.prop||os.attributes.propIndex)&&(os.doenetAttributes.isPlainCopy=!0),ys.children&&(os.children=ys.children);else if(ys.componentType==="copy")delete os.props[ls],Object.assign(os.attributes,ys.attributes),os.doenetAttributes||(os.doenetAttributes={}),Object.assign(os.doenetAttributes,ys.doenetAttributes);else{let bs="fromExtendedSource"+ns+"|"+ss,vs=createUniqueName("extract",bs);ys.doenetAttributes.prescribedName=vs,ys.doenetAttributes.createdFromMacro=!0;let xs={componentType:"setup",children:[ys],doenetAttributes:{createdFromMacro:!0}};as.push(xs),delete os.props[ls],os.doenetAttributes||(os.doenetAttributes={}),os.doenetAttributes.target=vs,os.doenetAttributes.allowDoubleUnderscoreTarget=!0}}else os.componentType==="copy"?console.warn(`invalid copy source: ${hs}`):console.warn(`invalid target: ${hs}`)}else os.componentType==="copy"&&!(os.attributes.prop||os.attributes.propIndex)&&(os.doenetAttributes||(os.doenetAttributes={}),os.doenetAttributes.isPlainCopy=!0)}os.children&&breakUpTargetIntoPropsAndIndices(os.children,rs,ns+"|"+ss)}}function createAttributesFromProps(as,rs){for(let ns of as){if(typeof ns!="object")continue;let ss=rs.allComponentClasses[ns.componentType],os=ss.createAttributesObject(),ls={};for(let ds in os)ls[ds.toLowerCase()]=ds;let us={},cs=Object.assign({},ns.props);if(ns.props)for(let ds in ns.props){let ps=ls[ds.toLowerCase()],fs=os[ps];if(fs){if(ps in us)throw Error(`Cannot repeat attribute ${ps}. Found in component type ${ns.componentType}${indexRangeString(ns)}`);us[ps]=componentFromAttribute({attrObj:fs,value:ns.props[ds],originalComponentProps:cs,componentInfoObjects:rs}),delete ns.props[ds]}else if(!["name","assignnames","target"].includes(ds.toLowerCase()))if(ss.acceptAnyAttribute)us[ds]=componentFromAttribute({value:ns.props[ds],originalComponentProps:cs,componentInfoObjects:rs}),delete ns.props[ds];else throw Error(`Invalid attribute ${ds} for component of type ${ns.componentType}${indexRangeString(ns)}`)}for(let ds in os){let ps=os[ds];ps.createPrimitiveOfType&&"defaultPrimitiveValue"in ps&&!(ds in us)&&(us[ds]=componentFromAttribute({attrObj:ps,originalComponentProps:cs,value:ps.defaultPrimitiveValue.toString(),componentInfoObjects:rs}))}ns.attributes=us,ns.children!==void 0&&createAttributesFromProps(ns.children,rs)}}function componentFromAttribute({attrObj:as,value:rs,originalComponentProps:ns,componentInfoObjects:ss}){if(typeof rs!="object"?rs={rawString:rs.toString()}:rs===null&&(rs={rawString:""}),as&&as.createComponentOfType){let os,ls=rs.rawString.trim().toLowerCase();if(ls==="true"&&as.valueForTrue!==void 0)os={componentType:as.createComponentOfType,state:{value:as.valueForTrue}};else if(ls==="false"&&as.valueForFalse!==void 0)os={componentType:as.createComponentOfType,state:{value:as.valueForFalse}};else if(ss.isInheritedComponentType({inheritedComponentType:as.createComponentOfType,baseComponentType:"boolean"})&&["true","false"].includes(ls))os={componentType:as.createComponentOfType,state:{value:ls==="true"}};else{let cs=rs.childrenForComponent;cs?cs=JSON.parse(JSON.stringify(cs)):cs=[rs.rawString],os={componentType:as.createComponentOfType,children:cs},removeBlankStringChildren([os],ss)}if(as.attributesForCreatedComponent||as.copyComponentAttributesForCreatedComponent){if(as.attributesForCreatedComponent?os.props=as.attributesForCreatedComponent:os.props={},as.copyComponentAttributesForCreatedComponent)for(let cs of as.copyComponentAttributesForCreatedComponent)ns[cs]&&(os.props[cs]=JSON.parse(JSON.stringify(ns[cs])));createAttributesFromProps([os],ss)}let us={component:os};return as.ignoreFixed&&(us.ignoreFixed=!0),us}else if(as&&as.createPrimitiveOfType){let os;return as.createPrimitiveOfType==="boolean"?os=rs.rawString.trim().toLowerCase()==="true":as.createPrimitiveOfType==="number"?os=Number(rs.rawString):as.createPrimitiveOfType==="integer"?os=Math.round(Number(rs.rawString)):as.createPrimitiveOfType==="stringArray"?os=rs.rawString.trim().split(/\s+/):as.createPrimitiveOfType==="numberArray"?os=rs.rawString.trim().split(/\s+/).map(Number):os=rs.rawString,as.validationFunction&&(os=as.validationFunction(os)),{primitive:os}}else return as&&as.createTargetComponentNames?{targetComponentNames:rs.rawString.trim().split(/\s+/).map(ls=>(ls[0]==="$"&&ls[1]!=="$"&&(ls=ls.slice(1),ls[0]==="("&&ls[ls.length-1]===")"&&(ls=ls.slice(1,ls.length-1))),{relativeName:ls}))}:(rs.childrenForComponent||(rs.childrenForComponent=[rs.rawString]),rs)}function findPreSugarIndsAndMarkFromSugar(as){let rs=[];for(let ns of as)if(typeof ns=="object"){if(ns.preSugarInd!==void 0)rs.push(ns.preSugarInd);else if(ns.doenetAttributes||(ns.doenetAttributes={}),ns.doenetAttributes.createdFromSugar=!0,ns.children){let ss=findPreSugarIndsAndMarkFromSugar(ns.children);rs.push(...ss)}}return rs}function applyMacros(as,rs){for(let ns of as)if(ns.children&&applyMacros(ns.children,rs),ns.attributes)for(let ss in ns.attributes){let os=ns.attributes[ss];os.component?applyMacros([os.component],rs):os.childrenForComponent&&applyMacros(os.childrenForComponent,rs)}substituteMacros(as,rs)}function substituteMacros(as,rs){for(let ns=0;ns0&&as[ns-1].range){let Ts=as[ns-1].range;Ts.closeEnd?Cs+=Ts.closeEnd:Ts.selfCloseEnd&&(Cs+=Ts.selfCloseBegin)}throw Error(`${hs.message}. At indices ${Cs}-${Cs+ds}. Found: ${xs}`)}markCreatedFromMacro([gs]),us.propArray.length===0&&(gs.doenetAttributes.isPlainMacro=!0),fs=[gs];let ys=1,bs=ls.substring(cs+ds);if(ps===2){let xs=ls.slice(cs+ds).match(/^\s*\(/);if(!xs){os=cs+2;continue}let Cs=ds+xs[0].length,Ts=[],Ss=!1;ls.length>cs+Cs&&(Ss=!0,Ts.push(ls.substring(cs+Cs))),Ts.push(...as.slice(ns+1));let Ns=createEvaluateIfFindMatchedClosingParens({componentsFromMacro:fs,remainingComponents:Ts,includeFirstInRemaining:Ss,componentInfoObjects:rs});if(!Ns.success){os=cs+2;continue}fs=Ns.componentsFromMacro,ys=Ns.lastComponentIndMatched+1,Ss||ys++,bs=""}let vs=[];cs>0&&vs.push(ls.substring(0,cs)),vs.push(...fs),bs.length>0&&vs.push(bs),as.splice(ns,ys,...vs),cs>0&&ns++;break}}}}function createComponentFromExtendedSource({sourceName:as,componentIndex:rs,componentAttributes:ns,propArray:ss,subNames:os,componentInfoObjects:ls}){let us={componentType:"copy",doenetAttributes:{target:as},attributes:{}};if(rs){let ds=[rs];applyMacros(ds,ls),us.attributes.componentIndex={component:{componentType:"integer",children:ds}}}if((os==null?void 0:os.length)>0){let ds=[],ps=[];for(let fs of os)ds.push(fs.subName),fs.subNameComponentIndex!==void 0&&(ps.length0){let fs=[ps.join(" ")];applyMacros(fs,ls),us.attributes.sourceSubnamesComponentIndex={component:{componentType:"numberList",children:fs}}}}let cs=!1;if(ns){cs=!0;let ds=createAttributesFromString(ns,ls);if(!ds.success)return ds;Object.assign(us.attributes,ds.newAttributes),ds.assignNames&&(us.props={assignNames:ds.assignNames})}for(let ds of ss){if(cs&&(us.doenetAttributes.createdFromMacro=!0,us={componentType:"extract",attributes:{},doenetAttributes:{},children:[us]}),us.attributes.prop={primitive:ds.prop},ds.propIndex){let ps=[ds.propIndex.join(" ")];applyMacros(ps,ls),us.attributes.propIndex={component:{componentType:"numberList",children:ps}}}if(ds.attributes){let ps=createAttributesFromString(ds.attributes,ls);if(!ps.success)return ps;Object.assign(us.attributes,ps.newAttributes),ps.assignNames&&(us.props={assignNames:ps.assignNames})}cs=!0}return{success:!0,newComponent:us}}function createAttributesFromString(as,rs){let ns=``,ss;try{ss=parseAndCompile(ns)}catch{return{success:!1,message:"Error in macro"}}createAttributesFromProps(ss,rs),markCreatedFromMacro(ss),applyMacros(ss,rs);let os=ss[0].attributes;if(os.prop||os.propIndex||os.componentIndex)return{success:!1,message:"Error in macro: macro cannot directly add attributes prop, propIndex, or componentIndex"};let ls;if(ss[0].props){for(let us in ss[0].props)if(us.toLowerCase()==="assignnames"){if(ls)return{success:!1,message:"Error in macro: cannot repeat assignNames"};ls=ss[0].props[us]}}return{success:!0,newAttributes:os,assignNames:ls}}function findFirstFullMacroInString(as){let rs=0,ns;for(;;){let ss=as.substring(rs).match(/(\$+)(.?)/);if(!ss)return{success:!1};if(ns=ss[1].length,rs+=ss.index+ns,ns<=2){let os=!1,ls=as.substring(rs),us=0,cs=findWordOrDelimitedGroup(ls,os);cs.startDelim==="("&&(os=!0,ls=cs.group,us=cs.group.length);let ds=buildSourcePieces(ls,os);if(ds.success){if(os){if(ds.matchLength!==us)return{success:!1};ds.matchLength+=2}return ds.nDollarSigns=ns,ds.firstIndMatched=rs-ns,ds.matchLength+=ns,ds}}}}function buildSourcePieces(as,rs){let ns=findWordOrDelimitedGroup(as,rs),ss=0;if(ns.withPeriod||!ns.word)return{success:!1};let os={sourceName:(ns.withSlash?"/":"")+ns.word};ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs),ns.startDelim==="["&&(os.componentIndex=ns.group,ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs));let ls=[];for(;ns.withSlash;){let cs={subName:ns.word};ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs),ns.startDelim==="["&&(cs.subNameComponentIndex=ns.group,ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs)),ls.push(cs)}os.subNames=ls,ns.startDelim==="{"&&(os.componentAttributes=ns.group,ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs));let us=[];for(;ns.withPeriod;){let cs={prop:ns.word};ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs);let ds=[];for(;ns.startDelim==="[";)ds.push(ns.group),ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs);ds.length>0&&(cs.propIndex=ds),ns.startDelim==="{"&&(cs.attributes=ns.group,ss+=ns.matchLength,as=as.substring(ns.matchLength),ns=findWordOrDelimitedGroup(as,rs)),us.push(cs)}return os.propArray=us,os.matchLength=ss,os.success=!0,os}function findWordOrDelimitedGroup(as,rs=!1){let ns=!1,ss=!1;as[0]==="."&&as[1]!=="."&&(ns=!0,as=as.substring(1));let os;rs?ns?os=/^[\w-]+/:(as[0]==="/"&&as[1].match(/\w/)&&(ss=!0,as=as.substring(1)),os=/^([\w\/-]|\.\.\/)+/):os=/^[a-zA-Z_]\w*/;let ls=as.match(os);if(ls)return{success:!0,withPeriod:ns,withSlash:ss,word:ls[0],matchLength:ls[0].length+(ns?1:0)+(ss?1:0)};if(ns||ss)return{success:!1};let us=[],cs={"(":")","{":"}","[":"]"},ds=Object.values(cs),ps=as[0],fs=cs[ps];if(!fs)return{success:!1};us.push(fs);for(let hs=1;hs0?rs[ls]=us.substring(0,os.charInd):rs=rs.slice(0,ls);let ds=breakEmbeddedStringByCommas({childrenList:rs});ds.pieces.forEach(gs=>applyMacros(gs,ss));let ps=ds.pieces.map(gs=>gs.length===1&&typeof gs[0]!="string"?gs[0]:{componentType:"math",doenetAttributes:{createdFromMacro:!0},children:gs}),hs=[{componentType:"evaluate",doenetAttributes:{createdFromMacro:!0},attributes:{function:{component:{componentType:"function",doenetAttributes:{createdFromMacro:!0},children:as}},input:{component:{componentType:"mathList",doenetAttributes:{createdFromMacro:!0},children:ps}}}}];return cs.length>0&&hs.push(cs),{success:!0,componentsFromMacro:hs,lastComponentIndMatched:ls}}function findFirstUnmatchedClosingParens(as){let rs=0;for(let[ns,ss]of as.entries())if(typeof ss=="string"){let os=ss;for(let ls=0;ls").replace(/</g,"<").replace(/$/g,"$").replace(/&/g,"&")}for(let[ns,ss]of as.entries())if(typeof ss=="string")as[ns]=rs(ss);else if(ss.children&&decodeXMLEntities(ss.children),ss.attributes)for(let os in ss.attributes){let ls=ss.attributes[os];ls.component?decodeXMLEntities([ls.component]):ls.primitive?typeof ls.primitive=="string"&&(ls.primitive=rs(ls.primitive)):(ls.childrenForComponent&&decodeXMLEntities(ls.childrenForComponent),ls.rawString&&(ls.rawString=rs(ls.rawString)))}}function applySugar({serializedComponents:as,parentParametersFromSugar:rs={},parentAttributes:ns={},componentInfoObjects:ss,parentUniqueId:os="",isAttributeComponent:ls=!1}){for(let[us,cs]of as.entries()){if(typeof cs!="object")continue;let ds=cs.componentType,ps=ss.allComponentClasses[ds];if(!ps)throw Error(`Unrecognized component type ${ds}`);let fs=os+"|"+ds+us,hs={};for(let gs in cs.attributes){let ys=cs.attributes[gs];ys.primitive!==void 0&&(hs[gs]=ys.primitive)}if(cs.children){let gs={};if(!cs.skipSugar)for(let[ys,bs]of ps.returnSugarInstructions().entries()){let vs=cs.children.map(Ns=>typeof Ns=="string"?"s":"n").join("");if(bs.childrenRegex){let Ns=vs.match(bs.childrenRegex);if(!Ns||Ns[0].length!==cs.children.length)continue}let xs=deepClone(cs.children),Cs=0;for(let Ns of xs)typeof Ns!="string"&&(Ns.preSugarInd=Cs,Cs++);let Ts=!1;cs.doenetAttributes&&cs.doenetAttributes.createdFromMacro&&(Ts=!0);let Ss=bs.replacementFunction({matchedChildren:xs,parentParametersFromSugar:rs,parentAttributes:ns,componentAttributes:hs,uniqueId:fs+"|sugar"+ys,componentInfoObjects:ss,isAttributeComponent:ls,createdFromMacro:Ts});if(Ss.success){let Ns=Ss.newChildren,As=Ss.newAttributes,ws=[],Es=[];if(Ns&&(ws=findPreSugarIndsAndMarkFromSugar(Ns)),As)for(let $s in As){let Rs=As[$s].component;Rs&&Es.push(...findPreSugarIndsAndMarkFromSugar(Rs.children))}let _s=[...ws,...Es];if(_s.length!==Cs||!_s.sort(($s,Rs)=>$s-Rs).every(($s,Rs)=>$s===Rs))throw Error(`Invalid sugar for ${ds} as didn't return set of original components`);if(ws.length>0&&![...ws].sort((Rs,Ds)=>Rs-Ds).every((Rs,Ds)=>Rs===ws[Ds]))throw Error(`Invalid sugar for ${ds} as didn't return original components in order`);Ss.parametersForChildrenSugar&&Object.assign(gs,Ss.parametersForChildrenSugar),Ns?cs.children=Ns:cs.children=[],As&&(cs.attributes||(cs.attributes={}),Object.assign(cs.attributes,As))}}ps.removeBlankStringChildrenPostSugar&&(cs.children=cs.children.filter(ys=>typeof ys!="string"||/\S/.test(ys))),applySugar({serializedComponents:cs.children,parentParametersFromSugar:gs,parentAttributes:hs,componentInfoObjects:ss,parentUniqueId:fs})}if(cs.attributes)for(let gs in cs.attributes){let ys=cs.attributes[gs];ys.component&&applySugar({serializedComponents:[ys.component],parentAttributes:hs,componentInfoObjects:ss,parentUniqueId:fs,isAttributeComponent:!0})}}}function breakStringInPiecesBySpacesOrParens(as){if(typeof as!="string")return{success:!1};let rs=0,ns=[];as=as.trim();let ss=0;for(let ls=0;ls0&&ns.push(cs),ss=ls}rs++}else if(us===")"){if(rs===0)return{success:!1};if(rs===1){let cs=as.substring(ss+1,ls).trim();if(cs.length>0){let ds=breakStringInPiecesBySpacesOrParens(cs);ds.success===!0?ns.push(ds.pieces):ns.push(cs)}ss=ls+1}rs--}else if(rs===0&&us.match(/\s/)){let cs=as.substring(ss,ls).trim();cs.length>0&&ns.push(cs),ss=ls}}if(rs!==0)return{success:!1};let os=as.substring(ss,as.length).trim();return os.length>0&&ns.push(os),{success:!0,pieces:ns}}function countRegularComponentTypesInNamespace(as,rs={}){var ns,ss;for(let os of as)if(typeof os=="object"){let ls=os.componentType,us=rs[ls];us===void 0&&(us=0);let cs=os.doenetAttributes;cs!=null&&cs.isAttributeChild||cs!=null&&cs.createdFromSugar||cs!=null&&cs.createdFromMacro||(rs[ls]=++us),os.children&&!((ss=(ns=os.attributes)==null?void 0:ns.newNamespace)!=null&&ss.primitive)&&(rs=countRegularComponentTypesInNamespace(os.children,rs))}return rs}function renameAutonameBasedOnNewCounts(as,rs={}){var ss,os;let ns={...rs};for(let ls of as)if(typeof ls=="object"){let us=ls.componentType,cs=ns[us];cs===void 0&&(cs=0);let ds=ls.doenetAttributes;if(!(ds!=null&&ds.isAttributeChild||ds!=null&&ds.createdFromSugar||ds!=null&&ds.createdFromMacro)&&(ns[us]=++cs,ls.componentName)){let ps=ls.componentName.lastIndexOf("/"),fs=ls.componentName.substring(ps+1),hs="_"+us.toLowerCase();fs.substring(0,hs.length)===hs&&(ls.componentName=ls.componentName.substring(0,ps+1)+hs+cs)}ls.children&&!((os=(ss=ls.attributes)==null?void 0:ss.newNamespace)!=null&&os.primitive)&&(ns=renameAutonameBasedOnNewCounts(ls.children,ns))}return ns}function createComponentNames({serializedComponents:as,namespaceStack:rs=[],componentInfoObjects:ns,parentDoenetAttributes:ss={},parentName:os,useOriginalNames:ls=!1,attributesByTargetComponentName:us,indOffset:cs=0,createNameContext:ds="",initWithoutShadowingComposite:ps=!1}){var gs,ys,bs;rs.length===0&&rs.push({namespace:"",componentCounts:{},namesUsed:{}});let fs=rs.length-1,hs=rs[fs];for(let[vs,xs]of as.entries()){if(typeof xs!="object")continue;let Cs=xs.componentType,Ts=ns.allComponentClasses[Cs],Ss=xs.doenetAttributes;Ss===void 0&&(Ss=xs.doenetAttributes={});let Ns=xs.attributes;Ns||(Ns=xs.attributes={}),Ss.createNameFromComponentType&&(Cs=Ss.createNameFromComponentType);let As=Ss.prescribedName,ws=Ss.assignNames,Es=Ss.target,_s=Ss.isAttributeChild||Ss.createdFromSugar||Ss.createdFromMacro||Ss.createUniqueName,$s;((gs=Ns.newNamespace)!=null&&gs.primitive||ls&&xs.originalAttributes&&xs.originalAttributes.newNamespace)&&($s=!0);let Rs=As!==void 0,Ds=xs.props;if(Ds===void 0)Ds=xs.props={};else for(let Vs in Ds){let ks=Vs.toLowerCase();if(ks==="name")if(As===void 0)As=Ds[Vs],delete Ds[Vs];else throw Error(`Cannot define name twice. Found in component of type ${Cs}${indexRangeString(xs)}`);else if(ks==="assignnames")if(ws===void 0){let Ps=breakStringInPiecesBySpacesOrParens(Ds[Vs]);if(Ps.success)ws=Ps.pieces;else throw Error(`Invalid format for assignnames. Found in component of type ${Cs}${indexRangeString(xs)}`);delete Ds[Vs]}else throw Error(`Cannot define assignNames twice for a component. Found in component of type ${Cs}${indexRangeString(xs)}`);else if(ks==="target")if(Es===void 0){if(typeof Ds[Vs]!="string")throw Error(`Must specify value for target. Found in component of type ${Cs}${indexRangeString(xs)}`);Es=Ds[Vs].trim(),delete Ds[Vs]}else throw Error(`Cannot define target twice for a component. Found in component of type ${Cs}${indexRangeString(xs)}`)}if(As){if(!Rs&&!Ss.createdFromSugar){if(!/[a-zA-Z]/.test(As.substring(0,1)))throw Error(`Invalid component name: ${As}. Component name must begin with a letter. Found in component of type ${Cs}${indexRangeString(xs)}`);if(!/^[a-zA-Z0-9_\-]+$/.test(As))throw Error(`Invalid component name: ${As}. Component name can contain only letters, numbers, hyphens, and underscores. Found in component of type ${Cs}${indexRangeString(xs)}`)}Ss.prescribedName=As}else if(_s){let Vs=os+"|createUniqueName|";xs.downstreamDependencies?Vs+=JSON.stringify(xs.downstreamDependencies):Vs+=vs+"|"+cs+"|"+ds,As=createUniqueName(Cs.toLowerCase(),Vs)}if(!ws&&ls&&xs.originalDoenetAttributes&&xs.originalDoenetAttributes.assignNames&&(ws=xs.originalDoenetAttributes.assignNames),ws){if(!Ts.assignNamesToReplacements)throw Error(`Cannot assign names for component type ${Cs}${indexRangeString(xs)}`);if(Ss.assignNames=ws,!Ss.createUniqueAssignNames){let ks=flattenDeep(ws);if(!Ss.fromCopyTarget&&!Ss.fromCopyFromURI)for(let Ps of ks){if(!/[a-zA-Z]/.test(Ps.substring(0,1)))throw Error(`All assigned names must begin with a letter. Found in component of type ${Cs}${indexRangeString(xs)}`);if(!/^[a-zA-Z0-9_\-]+$/.test(Ps))throw Error(`Assigned names can contain only letters, numbers, hyphens, and underscores. Found in component of type ${Cs}${indexRangeString(xs)}`)}if(ks.length!==new Set(ks).size)throw Error(`Duplicate assigned names. Found in component of type ${Cs}${indexRangeString(xs)}`)}}$s&&(Ns.newNamespace={primitive:$s});let Os=hs.componentCounts[Cs];Os===void 0&&(Os=0),Ss.isAttributeChild||Ss.createdFromSugar||Ss.createdFromMacro||(hs.componentCounts[Cs]=++Os);let Is="";for(let Vs=0;Vs<=fs;Vs++)Is+=rs[Vs].namespace+"/";if(!As){if(ls&&xs.originalName){let Vs=xs.originalName.lastIndexOf("/");As=xs.originalName.substring(Vs+1)}As||(As="_"+Cs.toLowerCase()+Os)}if(Ss.nameBecomesAssignNames){$s&&(Ns.assignNewNamespaces={primitive:!0},delete Ns.newNamespace,$s=!1),ws=Ss.assignNames=[As],delete Ss.nameBecomesAssignNames;let Vs=os+"|createUniqueName|";Ss.createUniqueName=!0,delete Ss.prescribedName,xs.downstreamDependencies?Vs+=JSON.stringify(xs.downstreamDependencies):Vs+=vs+"|"+cs+"|"+ds,As=createUniqueName("copy",Vs)}if(Is+=As,xs.componentName=Is,As){if(As in hs.namesUsed)throw Error(`Duplicate component name ${Is}. Found in component of type ${Cs}${indexRangeString(xs)}`);hs.namesUsed[As]=!0}if(!$s&&ws)for(let Vs of flattenDeep(ws)){if(Vs in hs.namesUsed)throw Error(`Duplicate component name ${Vs} (from assignNames of ${Is}). Found in component of type ${Cs}${indexRangeString(xs)}`);hs.namesUsed[Vs]=!0}if(xs.doenetAttributes.createUniqueAssignNames&&xs.originalName){let Vs=xs.doenetAttributes.assignNames;Vs||(Vs=xs.doenetAttributes.originalAssignNames);let ks=Is+"|createUniqueName|assignNames|",Ps="",Bs;if($s)Ps=Is+"/",Bs=xs.originalName+"/";else{for(let Us=0;Us<=fs;Us++)Ps+=rs[Us].namespace+"/";let Ws=xs.originalName.lastIndexOf("/");Bs=xs.originalName.slice(0,Ws+1)}let Ms=createNewAssignNamesAndrenameMatchingTargetNames({originalAssignNames:Vs,longNameIdBase:ks,namespace:Ps,oldNamespace:Bs,attributesByTargetComponentName:us});ws=xs.doenetAttributes.assignNames=Ms}if(renameMatchingTargetNames(xs,us),Es){if(!Ts.acceptTarget)throw Error(`Component type ${Cs} does not accept a target attribute. Found in component ${Is}${indexRangeString(xs)}`);if(Es.includes("|"))throw Error(`target cannot include |. Found in component of type ${Cs}${indexRangeString(xs)}`);Ss.target=Es,Ss.targetComponentName=convertComponentTarget({relativeName:Es,oldAbsoluteName:Ss.targetComponentName,namespaceStack:rs,acceptDoubleUnderscore:Ss.createdFromSugar||Ss.allowDoubleUnderscoreTarget})}for(let Vs in Ns){let ks=Ns[Vs];if(ks.targetComponentNames)for(let Ps of ks.targetComponentNames)Ps.absoluteName=convertComponentTarget({relativeName:Ps.relativeName,oldAbsoluteName:Ps.absoluteName,namespaceStack:rs,acceptDoubleUnderscore:Ss.createdFromSugar||Ss.allowDoubleUnderscoreTarget})}if(xs.children)if($s||(ys=Ns.assignNewNamespaces)!=null&&ys.primitive){let Vs={};ws&&flattenDeep(ws).forEach(Bs=>Vs[Bs]=!0);let ks=xs.children;if(Ss.nameFirstChildIndependently&&xs.children.length>0){ks=ks.slice(1);let Bs={namespace:As,componentCounts:{},namesUsed:{}};rs.push(Bs),createComponentNames({serializedComponents:[xs.children[0]],namespaceStack:rs,componentInfoObjects:ns,parentDoenetAttributes:Ss,parentName:Is,useOriginalNames:ls,attributesByTargetComponentName:us}),rs.pop()}let Ps={namespace:As,componentCounts:{},namesUsed:Vs};if(Ss.haveNewNamespaceOnlyFromShadow){let Bs=!0,Ms=[...ks];for(;Ms.length>0;){let Ws=[];for(let Us of Ms){if(!!((bs=Us.doenetAttributes)!=null&&bs.ignoreParentNewNamespace)===Bs)break;Ws.push(Us)}Ms.splice(0,Ws.length),Bs?rs.push(Ps):ps&&Ws.forEach(Us=>Us.doenetAttributes.createUniqueName=!0),createComponentNames({serializedComponents:Ws,namespaceStack:rs,componentInfoObjects:ns,parentDoenetAttributes:Ss,parentName:Is,useOriginalNames:ls,attributesByTargetComponentName:us}),Bs&&rs.pop(),Bs=!Bs}}else rs.push(Ps),createComponentNames({serializedComponents:ks,namespaceStack:rs,componentInfoObjects:ns,parentDoenetAttributes:Ss,parentName:Is,useOriginalNames:ls,attributesByTargetComponentName:us}),rs.pop()}else{let Vs=xs.children;if(Ss.nameFirstChildIndependently&&Vs.length>0){Vs=Vs.slice(1);let ks=hs.namesUsed,Ps=hs.componentCounts;hs.namesUsed={},hs.componentCounts={},createComponentNames({serializedComponents:[xs.children[0]],namespaceStack:rs,componentInfoObjects:ns,parentDoenetAttributes:Ss,parentName:Is,useOriginalNames:ls,attributesByTargetComponentName:us}),hs.namesUsed=ks,hs.componentCounts=Ps}createComponentNames({serializedComponents:Vs,namespaceStack:rs,componentInfoObjects:ns,parentDoenetAttributes:Ss,parentName:Is,useOriginalNames:ls,attributesByTargetComponentName:us})}if(xs.attributes)for(let Vs in xs.attributes){let ks=xs.attributes[Vs];if(ks.component){let Ps=ks.component;Ps.doenetAttributes||(Ps.doenetAttributes={}),Ps.doenetAttributes.isAttributeChild=!0,ks.ignoreFixed&&(Ps.doenetAttributes.ignoreParentFixed=!0),createComponentNames({serializedComponents:[Ps],namespaceStack:rs,componentInfoObjects:ns,parentDoenetAttributes:Ss,parentName:Is,useOriginalNames:ls,attributesByTargetComponentName:us,createNameContext:Vs})}else ks.childrenForComponent&&createComponentNames({serializedComponents:ks.childrenForComponent,namespaceStack:rs,componentInfoObjects:ns,parentDoenetAttributes:Ss,parentName:Is,useOriginalNames:ls,attributesByTargetComponentName:us,createNameContext:Vs})}}return as}function createNewAssignNamesAndrenameMatchingTargetNames({originalAssignNames:as,longNameIdBase:rs,namespace:ns,oldNamespace:ss,attributesByTargetComponentName:os}){let ls=[];for(let[us,cs]of as.entries())if(Array.isArray(cs)){let ds=createNewAssignNamesAndrenameMatchingTargetNames({originalAssignNames:cs,longNameIdBase:rs+us+"_",namespace:ns,oldNamespace:ss,attributesByTargetComponentName:os});ls.push(ds)}else{let ds=rs+us,ps=createUniqueName("fromAssignNames",ds);ls.push(ps);let fs={componentName:ns+ps,originalName:ss+cs};renameMatchingTargetNames(fs,os,!0)}return ls}function convertComponentTarget({relativeName:as,oldAbsoluteName:rs,namespaceStack:ns,acceptDoubleUnderscore:ss}){if(!rs&&/__/.test(as)&&!ss)throw Error("Invalid reference target: "+as);let os;if(as.substring(0,1)==="/")os=as;else{let ls=ns.length-1;for(;as.substring(0,3)==="../";)as=as.substring(3),ls--;ls<0&&(ls=0),os="";for(let us=0;us<=ls;us++)os+=ns[us].namespace+"/";os+=as}return os}function serializedComponentsReplacer(as,rs){return rs!==rs?{objectType:"special-numeric",stringValue:"NaN"}:rs===1/0?{objectType:"special-numeric",stringValue:"Infinity"}:rs===-1/0?{objectType:"special-numeric",stringValue:"-Infinity"}:rs}let nanInfinityReviver=function(as,rs){if(rs&&rs.objectType==="special-numeric"){if(rs.stringValue==="NaN")return NaN;if(rs.stringValue==="Infinity")return 1/0;if(rs.stringValue==="-Infinity")return-1/0}return rs};function serializedComponentsReviver(as,rs){return Context.reviver(as,theModule.Subset.reviver(as,nanInfinityReviver(as,rs)))}function processAssignNames({assignNames:as=[],assignNewNamespaces:rs=!1,serializedComponents:ns,parentName:ss,parentCreatesNewNamespace:os,componentInfoObjects:ls,indOffset:us=0,originalNamesAreConsistent:cs=!1,shadowingComposite:ds=!1}){var bs,vs;let ps=ns.length;moveComponentNamesToOriginalNames(ns);let fs={},hs=null;if(cs){if(ps>0){let xs=ns.filter(Cs=>typeof Cs=="object")[0];if(xs&&xs.originalName){let Cs=xs.originalName.lastIndexOf("/");hs=xs.originalName.substring(0,Cs)}}if(hs!==null)for(let xs of ns)setTargetsOutsideNamespaceToAbsoluteAndRecordAllTargetComponentNames({namespace:hs,components:[xs],attributesByTargetComponentName:fs})}else for(let xs=0;xs0&&Cs.originalName){let Ts=Cs.originalName.lastIndexOf("/");hs=Cs.originalName.substring(0,Ts)}hs!==null&&setTargetsOutsideNamespaceToAbsoluteAndRecordAllTargetComponentNames({namespace:hs,components:[Cs],attributesByTargetComponentName:fs})}}let gs=[],ys=0;for(let xs=0;xs0&&Ts.originalName)){let Ns=Ts.originalName.lastIndexOf("/");hs=Ts.originalName.substring(0,Ns)}if(Ss){if(ls.allComponentClasses[Ts.componentType].assignNamesSkipOver)Ss=[Ss];else if((bs=Ts.attributes)!=null&&bs.assignNamesSkip){let Ns=Ts.attributes.assignNamesSkip.primitive;if(Ns>0)for(let As=0;As({namespace:gs,componentCounts:{},namesUsed:{}}));as[0]!=="/"&&ps.splice(0,0,{componentCounts:{},namesUsed:{},namespace:""}),rs.doenetAttributes||(rs.doenetAttributes={}),rs.attributes||(rs.attributes={});let fs;(hs=rs.attributes.newNamespace)!=null&&hs.primitive||us?fs=!0:(fs=!1,rs.children&&markToCreateAllUniqueNames(rs.children));for(let gs in rs.attributes){let ys=rs.attributes[gs];ys.component?markToCreateAllUniqueNames([ys.component]):ys.childrenForComponent&&markToCreateAllUniqueNames(ys.childrenForComponent)}createComponentNames({serializedComponents:[rs],namespaceStack:ps,componentInfoObjects:os,parentName:as,useOriginalNames:fs,attributesByTargetComponentName:ls,indOffset:ns,initWithoutShadowingComposite:!cs})}function setTargetsOutsideNamespaceToAbsoluteAndRecordAllTargetComponentNames({namespace:as,components:rs,attributesByTargetComponentName:ns}){let ss=as.length;for(let os of rs)if(typeof os=="object"){if(os.doenetAttributes&&os.doenetAttributes.target){let ls=os.doenetAttributes.targetComponentName;ls!==void 0&&(ls.substring(0,ss)!==as&&(os.doenetAttributes.target=ls),ns[ls]||(ns[ls]=[]),ns[ls].push(os.doenetAttributes))}for(let ls in os.attributes){let us=os.attributes[ls];if(us.targetComponentNames)for(let cs of us.targetComponentNames){let ds=cs.absoluteName;ds!==void 0&&(ds.substring(0,ss)!==as&&(cs.relativeName=ds),ns[ds]||(ns[ds]=[]),ns[ds].push(cs))}}if(os.children&&setTargetsOutsideNamespaceToAbsoluteAndRecordAllTargetComponentNames({namespace:as,components:os.children,attributesByTargetComponentName:ns}),os.attributes)for(let ls in os.attributes){let us=os.attributes[ls];us.component?setTargetsOutsideNamespaceToAbsoluteAndRecordAllTargetComponentNames({namespace:as,components:[us.component],attributesByTargetComponentName:ns}):us.childrenForComponent&&setTargetsOutsideNamespaceToAbsoluteAndRecordAllTargetComponentNames({namespace:as,components:us.childrenForComponent,attributesByTargetComponentName:ns})}}}function renameMatchingTargetNames(as,rs,ns=!1){if(as.originalName&&rs&&as.componentName!==as.originalName){if(rs[as.originalName])for(let ss of rs[as.originalName])ss.relativeName?(ss.relativeName=as.componentName,ss.absoluteName=as.componentName):(ss.target=as.componentName,ss.targetComponentName=as.componentName);if(ns){let ss=as.originalName+"/",os=ss.length;for(let ls in rs)if(ls.substring(0,os)===ss){let us=ls.substring(os);for(let cs of rs[ls])cs.relativeName?(cs.relativeName=as.componentName+"/"+us,cs.absoluteName=as.componentName+"/"+us):(cs.target=as.componentName+"/"+us,cs.targetComponentName=as.componentName+"/"+us)}}}}function moveComponentNamesToOriginalNames(as){for(let rs of as)if(rs.componentName&&(rs.originalName=rs.componentName,delete rs.componentName),rs.children&&moveComponentNamesToOriginalNames(rs.children),rs.attributes)for(let ns in rs.attributes){let ss=rs.attributes[ns];ss.component?moveComponentNamesToOriginalNames([ss.component]):ss.childrenForComponent&&moveComponentNamesToOriginalNames(ss.childrenForComponent)}}function markToCreateAllUniqueNames(as){var rs,ns;for(let ss of as)if(typeof ss=="object"&&(ss.doenetAttributes||(ss.doenetAttributes={}),ss.doenetAttributes.createUniqueName=!0,delete ss.doenetAttributes.prescribedName,(ns=(rs=ss.attributes)==null?void 0:rs.newNamespace)!=null&&ns.primitive||(ss.doenetAttributes.assignNames?(ss.doenetAttributes.createUniqueAssignNames=!0,ss.doenetAttributes.originalAssignNames=ss.doenetAttributes.assignNames,delete ss.doenetAttributes.assignNames):ss.originalDoenetAttributes&&ss.originalDoenetAttributes.assignNames&&(ss.doenetAttributes.createUniqueAssignNames=!0,ss.doenetAttributes.originalAssignNames=ss.originalDoenetAttributes.assignNames),ss.children&&markToCreateAllUniqueNames(ss.children)),ss.attributes))for(let os in ss.attributes){let ls=ss.attributes[os];ls.component?markToCreateAllUniqueNames([ls.component]):ls.childrenForComponent&&markToCreateAllUniqueNames(ls.childrenForComponent)}}function setTNamesToAbsolute(as){for(let rs of as){if(rs.doenetAttributes&&rs.doenetAttributes.target){let ns=rs.doenetAttributes.targetComponentName;ns!==void 0&&(rs.doenetAttributes.target=ns)}if(rs.children&&setTNamesToAbsolute(rs.children),rs.attributes)for(let ns in rs.attributes){let ss=rs.attributes[ns];ss.component?setTNamesToAbsolute([ss.component]):ss.childrenForComponent&&setTNamesToAbsolute(ss.childrenForComponent)}}}function restrictTNamesToNamespace({components:as,namespace:rs,parentNamespace:ns,parentIsCopy:ss=!1,invalidateReferencesToBaseNamespace:os=!1}){var us;ns===void 0&&(ns=rs);let ls=rs.length;for(let cs of as){if(cs.doenetAttributes&&cs.doenetAttributes.target){let ds=cs.doenetAttributes.target;if(ds[0]==="/"){if(ds.substring(0,ls)!==rs){let ps=rs.split("/").slice(1),fs=ds.split("/").slice(1),hs=!1,gs=rs+ds.slice(1);for(;ps.length>0&&ps[0]===fs[0];)ps=ps.slice(1),fs=fs.slice(1),hs=!0;if(hs)gs=rs+fs.join("/");else{let ys=rs.split("/").slice(1);for(let bs=1;bs0||(cs=1)),us in rs?rs[us]+=cs:rs[us]=cs}return rs}const rendererState=Recoil_index_10({key:"rendererState",default:{stateValues:{},sourceOfUpdate:{},ignoreUpdate:!1,childrenInstructions:[],prefixForIds:""}});function useDoenetRenderer(as,rs=!0){let ns=as.componentInstructions.actions,ss=as.componentInstructions.componentName,os=as.componentInstructions.effectiveName,ls=as.coreId+ss,[us,cs]=reactExports.useState({}),{stateValues:ds,sourceOfUpdate:ps={},ignoreUpdate:fs,childrenInstructions:hs,prefixForIds:gs}=Recoil_index_20(rendererState(ls)),ys=[];const bs=Object.keys(us).length===0;for(let Ts of hs){let Ss=vs(Ts,bs);ys.push(Ss)}reactExports.useEffect(()=>{Object.keys(us).length>0&&renderersloadComponent(Object.values(us),Object.keys(us)).then(Ts=>{Object.assign(as.rendererClasses,Ts),cs({})})},[us,as.rendererClasses]);function vs(Ts,Ss){if(typeof Ts=="string")return Ts;let Ns={key:as.coreId+Ts.componentName,componentInstructions:Ts,rendererClasses:as.rendererClasses,flags:as.flags,coreId:as.coreId,callAction:as.callAction},As=as.rendererClasses[Ts.rendererType];return As?React.createElement(As,Ns):(Ss&&cs(Es=>{let _s={...Es};return Ts.rendererType in _s||(_s[Ts.rendererType]=__variableDynamicImportRuntimeHelper(Object.assign({"./renderers/alert.jsx":()=>__vitePreload(()=>import("./alert-7670faad.js"),[]),"./renderers/angle.jsx":()=>__vitePreload(()=>import("./angle-a79a8ada.js"),["assets/angle-a79a8ada.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/answer.jsx":()=>__vitePreload(()=>import("./answer-ec00b2c9.js"),[]),"./renderers/asList.jsx":()=>__vitePreload(()=>import("./asList-3a660e37.js"),[]),"./renderers/boolean.jsx":()=>__vitePreload(()=>import("./boolean-75566a42.js"),[]),"./renderers/booleanInput.jsx":()=>__vitePreload(()=>import("./booleanInput-b5eb97fc.js"),["assets/booleanInput-b5eb97fc.js","assets/ToggleButton-faf565eb.js","assets/booleanInput-01650bf1.css"]),"./renderers/c.jsx":()=>__vitePreload(()=>import("./c-c3cef1f1.js"),[]),"./renderers/callAction.jsx":()=>__vitePreload(()=>import("./callAction-0d868376.js"),[]),"./renderers/cell.jsx":()=>__vitePreload(()=>import("./cell-0157179d.js"),[]),"./renderers/chart.jsx":()=>__vitePreload(()=>import("./chart-815ca470.js"),["assets/chart-815ca470.js","assets/visibility-sensor-7d414852.js"]),"./renderers/choiceInput.jsx":()=>__vitePreload(()=>import("./choiceInput-5177cadb.js"),["assets/choiceInput-5177cadb.js","assets/choiceInput-92287600.css"]),"./renderers/circle.jsx":()=>__vitePreload(()=>import("./circle-83bf1e74.js"),["assets/circle-83bf1e74.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/cobwebPolyline.jsx":()=>__vitePreload(()=>import("./cobwebPolyline-32ff0a06.js"),["assets/cobwebPolyline-32ff0a06.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/codeEditor.jsx":()=>__vitePreload(()=>import("./codeEditor-3b7bb2dd.js"),["assets/codeEditor-3b7bb2dd.js","assets/css-14ccef8c.js","assets/CodeMirror-87ecbb8f.js","assets/visibility-sensor-7d414852.js"]),"./renderers/codeViewer.jsx":()=>__vitePreload(()=>import("./codeViewer-74dc4db9.js"),["assets/codeViewer-74dc4db9.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/containerBlock.jsx":()=>__vitePreload(()=>import("./containerBlock-cf29dd99.js"),["assets/containerBlock-cf29dd99.js","assets/visibility-sensor-7d414852.js"]),"./renderers/containerInline.jsx":()=>__vitePreload(()=>import("./containerInline-df5cd01f.js"),[]),"./renderers/curve.jsx":()=>__vitePreload(()=>import("./curve-a288db30.js"),["assets/curve-a288db30.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/ellipsis.jsx":()=>__vitePreload(()=>import("./ellipsis-23f4589c.js"),[]),"./renderers/em.jsx":()=>__vitePreload(()=>import("./em-c600ba78.js"),[]),"./renderers/embed.jsx":()=>__vitePreload(()=>import("./embed-e7f1d893.js"),["assets/embed-e7f1d893.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/feedback.jsx":()=>__vitePreload(()=>import("./feedback-2ba4856e.js"),["assets/feedback-2ba4856e.js","assets/index-47ca4f11.js","assets/visibility-sensor-7d414852.js"]),"./renderers/figure.jsx":()=>__vitePreload(()=>import("./figure-c70e4517.js"),["assets/figure-c70e4517.js","assets/visibility-sensor-7d414852.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js"]),"./renderers/footnote.jsx":()=>__vitePreload(()=>import("./footnote-31adff59.js"),[]),"./renderers/graph.jsx":()=>__vitePreload(()=>import("./graph-71cec529.js"),["assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/hint.jsx":()=>__vitePreload(()=>import("./hint-06657f21.js"),["assets/hint-06657f21.js","assets/index-47ca4f11.js","assets/visibility-sensor-7d414852.js"]),"./renderers/image.jsx":()=>__vitePreload(()=>import("./image-c0f70d24.js"),["assets/image-c0f70d24.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/label.jsx":()=>__vitePreload(()=>import("./label-95b19c73.js"),["assets/label-95b19c73.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/legend.jsx":()=>__vitePreload(()=>import("./legend-4044edd9.js"),["assets/legend-4044edd9.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/line.jsx":()=>__vitePreload(()=>import("./line-c1a7164a.js"),["assets/line-c1a7164a.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/lineSegment.jsx":()=>__vitePreload(()=>import("./lineSegment-3e0035f9.js"),["assets/lineSegment-3e0035f9.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/list.jsx":()=>__vitePreload(()=>import("./list-6bbf4bcf.js"),["assets/list-6bbf4bcf.js","assets/visibility-sensor-7d414852.js"]),"./renderers/math.jsx":()=>__vitePreload(()=>import("./math-52fe5cc4.js"),["assets/math-52fe5cc4.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/mathInput.jsx":()=>__vitePreload(()=>import("./mathInput-4f892c75.js"),["assets/mathInput-4f892c75.js","assets/MathInputSelector-50cc4d06.js","assets/mathInput-cbd86307.css"]),"./renderers/mathList.jsx":()=>__vitePreload(()=>import("./mathList-e4fc0d9b.js"),[]),"./renderers/matrixInput.jsx":()=>__vitePreload(()=>import("./matrixInput-900c080a.js"),["assets/matrixInput-900c080a.js","assets/ActionButton-e5ea2a2f.js","assets/ActionButtonGroup-f4ce05e4.js","assets/mathInput-cbd86307.css"]),"./renderers/mdash.jsx":()=>__vitePreload(()=>import("./mdash-33408b70.js"),[]),"./renderers/nbsp.jsx":()=>__vitePreload(()=>import("./nbsp-f0190b99.js"),[]),"./renderers/ndash.jsx":()=>__vitePreload(()=>import("./ndash-5b905601.js"),[]),"./renderers/number.jsx":()=>__vitePreload(()=>import("./number-56f4821a.js"),[]),"./renderers/numberList.jsx":()=>__vitePreload(()=>import("./numberList-7136c931.js"),[]),"./renderers/orbitalDiagram.jsx":()=>__vitePreload(()=>import("./orbitalDiagram-01886706.js"),["assets/orbitalDiagram-01886706.js","assets/visibility-sensor-7d414852.js"]),"./renderers/orbitalDiagramInput.jsx":()=>__vitePreload(()=>import("./orbitalDiagramInput-3cb02455.js"),["assets/orbitalDiagramInput-3cb02455.js","assets/visibility-sensor-7d414852.js"]),"./renderers/p.jsx":()=>__vitePreload(()=>import("./p-b709c326.js"),["assets/p-b709c326.js","assets/visibility-sensor-7d414852.js"]),"./renderers/paginatorControls.jsx":()=>__vitePreload(()=>import("./paginatorControls-9cf5c4a4.js"),[]),"./renderers/pegboard.jsx":()=>__vitePreload(()=>import("./pegboard-30708879.js"),["assets/pegboard-30708879.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/point.jsx":()=>__vitePreload(()=>import("./point-922dded5.js"),["assets/point-922dded5.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/polygon.jsx":()=>__vitePreload(()=>import("./polygon-8f87d0c3.js"),["assets/polygon-8f87d0c3.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/polyline.jsx":()=>__vitePreload(()=>import("./polyline-bd178059.js"),["assets/polyline-bd178059.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/pre.jsx":()=>__vitePreload(()=>import("./pre-f575ed61.js"),["assets/pre-f575ed61.js","assets/visibility-sensor-7d414852.js"]),"./renderers/q.jsx":()=>__vitePreload(()=>import("./q-2ee17014.js"),[]),"./renderers/ray.jsx":()=>__vitePreload(()=>import("./ray-8d758dd7.js"),["assets/ray-8d758dd7.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/ref.jsx":()=>__vitePreload(()=>import("./ref-9e5f0fce.js"),[]),"./renderers/regionBetweenCurveXAxis.jsx":()=>__vitePreload(()=>import("./regionBetweenCurveXAxis-eaed737c.js"),["assets/regionBetweenCurveXAxis-eaed737c.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/row.jsx":()=>__vitePreload(()=>import("./row-83da3eab.js"),[]),"./renderers/section.jsx":()=>__vitePreload(()=>import("./section-ed8954fc.js"),["assets/section-ed8954fc.js","assets/visibility-sensor-7d414852.js"]),"./renderers/sideBySide.jsx":()=>__vitePreload(()=>import("./sideBySide-29763439.js"),["assets/sideBySide-29763439.js","assets/visibility-sensor-7d414852.js"]),"./renderers/slider.jsx":()=>__vitePreload(()=>import("./slider-3c30e9ab.js"),["assets/slider-3c30e9ab.js","assets/ActionButton-e5ea2a2f.js","assets/ActionButtonGroup-f4ce05e4.js"]),"./renderers/solution.jsx":()=>__vitePreload(()=>import("./solution-1f60217a.js"),["assets/solution-1f60217a.js","assets/visibility-sensor-7d414852.js"]),"./renderers/spreadsheet.jsx":()=>__vitePreload(()=>import("./spreadsheet-2720b9d5.js"),["assets/spreadsheet-2720b9d5.js","assets/moment-3cda1086.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js","assets/spreadsheet-f0a2a11b.css"]),"./renderers/sq.jsx":()=>__vitePreload(()=>import("./sq-02280959.js"),[]),"./renderers/subsetOfRealsInput.jsx":()=>__vitePreload(()=>import("./subsetOfRealsInput-5a92c517.js"),["assets/subsetOfRealsInput-5a92c517.js","assets/ActionButton-e5ea2a2f.js","assets/ActionButtonGroup-f4ce05e4.js","assets/ToggleButton-faf565eb.js","assets/ToggleButtonGroup-6decfcc6.js","assets/visibility-sensor-7d414852.js"]),"./renderers/summaryStatistics.jsx":()=>__vitePreload(()=>import("./summaryStatistics-0ee64249.js"),["assets/summaryStatistics-0ee64249.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/table.jsx":()=>__vitePreload(()=>import("./table-64ddd443.js"),["assets/table-64ddd443.js","assets/visibility-sensor-7d414852.js"]),"./renderers/tabular.jsx":()=>__vitePreload(()=>import("./tabular-c18e7770.js"),["assets/tabular-c18e7770.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/tag.jsx":()=>__vitePreload(()=>import("./tag-36b858d8.js"),[]),"./renderers/text.jsx":()=>__vitePreload(()=>import("./text-a4ea3b78.js"),["assets/text-a4ea3b78.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/textInput.jsx":()=>__vitePreload(()=>import("./textInput-ac28802f.js"),["assets/textInput-ac28802f.js","assets/css-14ccef8c.js"]),"./renderers/textList.jsx":()=>__vitePreload(()=>import("./textList-6cb5330d.js"),[]),"./renderers/triggerSet.jsx":()=>__vitePreload(()=>import("./triggerSet-ef3bd2fe.js"),[]),"./renderers/updateValue.jsx":()=>__vitePreload(()=>import("./updateValue-83b7ae1f.js"),[]),"./renderers/vector.jsx":()=>__vitePreload(()=>import("./vector-52de4831.js"),["assets/vector-52de4831.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/video.jsx":()=>__vitePreload(()=>import("./video-964a54d0.js"),["assets/video-964a54d0.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"])}),`./renderers/${Ts.rendererType}.jsx`)),_s}),null)}let xs=as.componentInstructions.rendererType;const Cs=Ts=>(Ts.componentName||(Ts={...Ts},Ts.componentName=ss),Ts.rendererType||(Ts={...Ts},Ts.rendererType=xs),as.callAction(Ts));return{name:os,id:gs+os,SVs:ds,actions:ns,children:ys,sourceOfUpdate:ps,ignoreUpdate:fs,rendererName:ls,initializeChildren:()=>{},callAction:Cs}}function returnStandardSequenceAttributes(){return{type:{createPrimitiveOfType:"string",createStateVariable:"type",defaultPrimitiveValue:"number",toLowerCase:!0,validValues:["number","math","letters"]},from:{createComponentOfType:"_componentWithSelectableType"},to:{createComponentOfType:"_componentWithSelectableType"},step:{createComponentOfType:"math"},length:{createComponentOfType:"number"},exclude:{createComponentOfType:"_componentListWithSelectableType"}}}function returnStandardSequenceStateVariableDefinitions(){let as={};return as.specifiedFrom={returnDependencies:()=>({fromAttr:{dependencyType:"attributeComponent",attributeName:"from",variableNames:["value"]}}),defaultValue:null,hasEssential:!0,essentialVarName:"from",definition:function({dependencyValues:rs}){return rs.fromAttr===null?{useEssentialOrDefaultValue:{specifiedFrom:!0}}:rs.fromAttr.stateValues.value===null?{setValue:{specifiedFrom:NaN}}:{setValue:{specifiedFrom:rs.fromAttr.stateValues.value}}}},as.specifiedTo={returnDependencies:()=>({toAttr:{dependencyType:"attributeComponent",attributeName:"to",variableNames:["value"]}}),defaultValue:null,hasEssential:!0,essentialVarName:"to",definition:function({dependencyValues:rs}){return rs.toAttr===null?{useEssentialOrDefaultValue:{specifiedTo:!0}}:rs.toAttr.stateValues.value===null?{setValue:{specifiedTo:NaN}}:{setValue:{specifiedTo:rs.toAttr.stateValues.value}}}},as.specifiedLength={returnDependencies:()=>({lengthAttr:{dependencyType:"attributeComponent",attributeName:"length",variableNames:["value"]}}),defaultValue:null,hasEssential:!0,essentialVarName:"length",definition:function({dependencyValues:rs}){return rs.lengthAttr===null?{useEssentialOrDefaultValue:{specifiedLength:!0}}:rs.lengthAttr.stateValues.value===null?{setValue:{specifiedLength:NaN}}:{setValue:{specifiedLength:rs.lengthAttr.stateValues.value}}}},as.specifiedStep={returnDependencies:()=>({stepAttr:{dependencyType:"attributeComponent",attributeName:"step",variableNames:["value"]},type:{dependencyType:"stateVariable",variableName:"type"}}),defaultValue:null,hasEssential:!0,essentialVarName:"step",definition:function({dependencyValues:rs}){if(rs.stepAttr===null)return{useEssentialOrDefaultValue:{specifiedStep:!0}};let ns=rs.stepAttr.stateValues.value;return ns===null?{setValue:{specifiedStep:NaN}}:{setValue:{specifiedStep:ns}}}},as.specifiedExclude={returnDependencies:()=>({excludeAttr:{dependencyType:"attributeComponent",attributeName:"exclude",variableNames:["values"]}}),defaultValue:[],hasEssential:!0,essentialVarName:"exclude",definition:function({dependencyValues:rs}){return rs.excludeAttr===null?{useEssentialOrDefaultValue:{specifiedExclude:!0}}:{setValue:{specifiedExclude:rs.excludeAttr.stateValues.values}}}},as.lowercase={returnDependencies:()=>({specifiedTo:{dependencyType:"stateVariable",variableName:"specifiedTo"},specifiedFrom:{dependencyType:"stateVariable",variableName:"specifiedFrom"}}),definition:function({dependencyValues:rs}){let ns=/^[A-Z]*$/,ss=!0;return rs.specifiedFrom!==null?ns.test(rs.specifiedFrom)&&(ss=!1):rs.specifiedTo!==null&&ns.test(rs.specifiedTo)&&(ss=!1),{setValue:{lowercase:ss}}}},as.validSequence={returnDependencies:()=>({specifiedLength:{dependencyType:"stateVariable",variableName:"specifiedLength"},specifiedStep:{dependencyType:"stateVariable",variableName:"specifiedStep"},specifiedFrom:{dependencyType:"stateVariable",variableName:"specifiedFrom"},specifiedTo:{dependencyType:"stateVariable",variableName:"specifiedTo"},type:{dependencyType:"stateVariable",variableName:"type"},lowercase:{dependencyType:"stateVariable",variableName:"lowercase"}}),definition:function({dependencyValues:rs}){let ns=!0;if(rs.specifiedLength!==null&&(!Number.isInteger(rs.specifiedLength)||rs.specifiedLength<0)&&(console.warn("Invalid length of sequence. Must be a non-negative integer."),ns=!1),rs.specifiedStep!==null&&rs.type!=="math"){let ss=findFiniteNumericalValue(rs.specifiedStep);Number.isFinite(ss)||(console.warn("Invalid step of sequence. Must be a number for sequence of type "+rs.type+"."),ns=!1)}if(rs.specifiedFrom!==null)if(rs.type==="number"){let ss=findFiniteNumericalValue(rs.specifiedFrom);Number.isFinite(ss)||(console.warn("Invalid from of number sequence. Must be a number"),ns=!1)}else Number.isNaN(rs.specifiedFrom)&&(console.warn("Invalid from of sequence"),ns=!1);if(rs.specifiedTo!==null)if(rs.type==="number"){let ss=findFiniteNumericalValue(rs.specifiedTo);Number.isFinite(ss)||(console.warn("Invalid to of number sequence. Must be a number"),ns=!1)}else Number.isNaN(rs.specifiedTo)&&(console.warn("Invalid to of sequence"),ns=!1);return{setValue:{validSequence:ns}}}},as.from={additionalStateVariablesDefined:["step","length","exclude"],returnDependencies:()=>({specifiedFrom:{dependencyType:"stateVariable",variableName:"specifiedFrom"},specifiedTo:{dependencyType:"stateVariable",variableName:"specifiedTo"},specifiedLength:{dependencyType:"stateVariable",variableName:"specifiedLength"},specifiedStep:{dependencyType:"stateVariable",variableName:"specifiedStep"},type:{dependencyType:"stateVariable",variableName:"type"},specifiedExclude:{dependencyType:"stateVariable",variableName:"specifiedExclude"},validSequence:{dependencyType:"stateVariable",variableName:"validSequence"}}),definition:function({dependencyValues:rs}){let ns=rs.specifiedFrom,ss=rs.specifiedTo,os=rs.specifiedStep,ls=rs.specifiedLength,us=[...rs.specifiedExclude],cs=rs.type;if(rs.type==="math")ss!==null&&(ss instanceof Context.class||(ss=Context.fromAst(ss))),ns!==null&&(ns instanceof Context.class||(ns=Context.fromAst(ns))),os!==null&&(os instanceof Context.class||(os=Context.fromAst(os)));else if(os!==null&&os instanceof Context.class&&(os=os.evaluate_to_constant()),rs.type==="letters")ns!==null&&(ns=lettersToNumber$1(ns)),ss!==null&&(ss=lettersToNumber$1(ss)),us=us.map(lettersToNumber$1);else if(rs.type==="number"){ss!==null&&(ss instanceof Context.class?ss=ss.evaluate_to_constant():ss=Number(ss)),ns!==null&&(ns instanceof Context.class?ns=ns.evaluate_to_constant():ns=Number(ns));for(let[ds,ps]of us.entries())ps instanceof Context.class?us[ds]=ps.evaluate_to_constant():us[ds]=Number(ps)}if(rs.validSequence){let ds=calculateSequenceParameters({from:ns,to:ss,step:os,length:ls,type:cs});return ds.exclude=us,{setValue:ds}}return(!Number.isInteger(ls)||ls<0)&&(ls=0),{setValue:{from:ns,step:os,length:ls,exclude:us}}}},as}function calculateSequenceParameters({from:as,to:rs,step:ns,length:ss,type:os}){if(as===null)rs===null?(os==="math"?as=Context.fromAst(1):as=1,ns===null&&(os==="math"?ns=Context.fromAst(1):ns=1),ss===null&&(ss=10)):(ns===null&&(os==="math"?ns=Context.fromAst(1):ns=1),ss===null&&(os==="math"?ss=Math.floor((rs.subtract(1).divide(ns).evaluate_to_constant()+1)*(1+1e-14)):ss=Math.floor(((rs-1)/ns+1)*(1+1e-14))),os==="math"?as=rs.subtract(ns.multiply(ss-1)).simplify():(as=rs-ns*(ss-1),os==="letters"&&as<1&&(ss=Math.floor(((rs-1)/ns+1)*(1+1e-14)),as=rs-ns*(ss-1))));else if(rs===null)ns===null&&(os==="math"?ns=Context.fromAst(1):ns=1),ss===null&&(ss=10);else if(ns===null)ss===null?os==="math"?(ns=Context.fromAst(1),ss=Math.floor(rs.subtract(as).add(1).evaluate_to_constant()*(1+1e-14))):(ns=1,ss=Math.floor((rs-as+1)*(1+1e-14))):os==="math"?ns=rs.subtract(as).divide(ss-1):(ns=(rs-as)/(ss-1),os==="letters"&&(ns=Math.floor(ns)));else if(ss===null)os==="math"?ss=Math.floor(rs.subtract(as).divide(ns).add(1).evaluate_to_constant()*(1+1e-14)):ss=Math.floor(((rs-as)/ns+1)*(1+1e-14));else throw Error("Can't define from, to, step, and length for sequence");return(!Number.isInteger(ss)||ss<0)&&(console.warn("Invalid length of sequence. Must be a non-negative integer."),ss=0),{from:as,step:ns,length:ss}}function returnSequenceValues({from:as,step:rs,length:ns,exclude:ss,type:os,lowercase:ls,maxNum:us},cs=!1){let ds=[],ps=0;for(let fs=0;fs0&&(os==="math"?hs=hs.add(rs.multiply(Context.fromAst(fs))).expand().simplify():hs+=rs*fs),os==="math"){if(ss.some(gs=>gs&&gs.equals(hs)))continue}else if(os==="number"){if(ss.some(gs=>Math.abs(gs-hs)<=1e-14*Math.max(Math.abs(gs),Math.abs(hs))))continue}else if(ss.includes(hs))continue;if(os==="letters"&&(hs=numberToLetters(hs,ls)),cs?ds.push({value:hs,originalIndex:fs}):ds.push(hs),ps++,ps===us)break}return ds}function returnSequenceValueForIndex({index:as,from:rs,step:ns,length:ss,exclude:os,type:ls,lowercase:us}){if(!(as>=0&&(ss===void 0||as0&&(ls==="math"?cs=cs.add(ns.multiply(Context.fromAst(as))).expand().simplify():cs+=ns*as),ls==="math"){if(os.some(ds=>ds&&ds.equals(cs)))return null}else if(ls==="number"){if(os.some(ds=>Math.abs(ds-cs)<=1e-14*Math.max(Math.abs(ds),Math.abs(cs))))return null}else if(os.includes(cs))return null;return ls==="letters"&&(cs=numberToLetters(cs,us)),cs}function lettersToNumber$1(as){try{as=as.toUpperCase()}catch{console.warn("Cannot convert "+as+" to a number");return}let rs=0,ns=as.length,ss=ns;for(;(ss-=1)>-1;){let os=as.charCodeAt(ss)-64;if(os<1||os>26){console.warn("Cannot convert "+as+" to a number");return}rs+=os*Math.pow(26,ns-1-ss)}return rs}function numberToLetters(as,rs){as--;let ns=65;rs&&(ns=97);let ss="";for(;;){let os=as%26;if(ss=String.fromCharCode(ns+os)+ss,as<26)break;as=Math.floor(as/26)-1}return ss}let styleAttributes={lineColor:{componentType:"text"},lineColorWord:{componentType:"text"},lineColorDarkMode:{componentType:"text"},lineColorWordDarkMode:{componentType:"text"},lineOpacity:{componentType:"number"},lineWidth:{componentType:"number"},lineWidthWord:{componentType:"text"},lineStyle:{componentType:"text"},lineStyleWord:{componentType:"text"},markerColor:{componentType:"text"},markerColorWord:{componentType:"text"},markerColorDarkMode:{componentType:"text"},markerColorWordDarkMode:{componentType:"text"},markerStyle:{componentType:"text"},markerStyleWord:{componentType:"text"},markerSize:{componentType:"number"},fillColor:{componentType:"text"},fillColorWord:{componentType:"text"},fillColorDarkMode:{componentType:"text"},fillColorWordDarkMode:{componentType:"text"},fillOpacity:{componentType:"number"}},defaultStyle={lineColor:"#648FFF",lineColorWord:"blue",lineColorDarkMode:"#648FFF",lineColorWordDarkMode:"blue",lineOpacity:.7,lineWidth:4,lineWidthWord:"thick",lineStyle:"solid",lineStyleWord:"",markerColor:"#648FFF",markerColorWord:"blue",markerColorDarkMode:"#648FFF",markerColorWordDarkMode:"blue",markerStyle:"circle",markerStyleWord:"point",markerSize:5,fillColor:"#648FFF",fillColorWord:"blue",fillColorDarkMode:"#648FFF",fillColorWordDarkMode:"blue",fillOpacity:.3};function returnDefaultStyleDefinitions(){return{1:{lineColor:"#648FFF",lineColorWord:"blue",lineColorDarkMode:"#648FFF",lineColorWordDarkMode:"blue",lineOpacity:.7,lineWidth:4,lineWidthWord:"thick",lineStyle:"solid",lineStyleWord:"",markerColor:"#648FFF",markerColorWord:"blue",markerColorDarkMode:"#648FFF",markerColorWordDarkMode:"blue",markerStyle:"circle",markerStyleWord:"point",markerSize:5,fillColor:"#648FFF",fillColorWord:"blue",fillColorDarkMode:"#648FFF",fillColorWordDarkMode:"blue",fillOpacity:.3},2:{lineColor:"#D4042D",lineColorWord:"red",lineColorDarkMode:"#D4042D",lineColorWordDarkMode:"red",lineOpacity:.7,lineWidth:2,lineWidthWord:"",lineStyle:"solid",lineStyleWord:"",markerColor:"#D4042D",markerColorWord:"red",markerColorDarkMode:"#D4042D",markerColorWordDarkMode:"red",markerStyle:"square",markerStyleWord:"square",markerSize:5,fillColor:"#D4042D",fillColorWord:"red",fillColorDarkMode:"#D4042D",fillColorWordDarkMode:"red",fillOpacity:.3},3:{lineColor:"#F19143",lineColorWord:"orange",lineColorDarkMode:"#F19143",lineColorWordDarkMode:"orange",lineOpacity:.7,lineWidth:3,lineWidthWord:"",lineStyle:"solid",lineStyleWord:"",markerColor:"#F19143",markerColorWord:"orange",markerColorDarkMode:"#F19143",markerColorWordDarkMode:"orange",markerStyle:"triangle",markerStyleWord:"triangle",markerSize:5,fillColor:"#F19143",fillColorWord:"orange",fillColorDarkMode:"#F19143",fillColorWordDarkMode:"orange",fillOpacity:.3},4:{lineColor:"#644CD6",lineColorWord:"purple",lineColorDarkMode:"#644CD6",lineColorWordDarkMode:"purple",lineOpacity:.7,lineWidth:2,lineWidthWord:"",lineStyle:"solid",lineStyleWord:"",markerColor:"#644CD6",markerColorWord:"purple",markerColorDarkMode:"#644CD6",markerColorWordDarkMode:"purple",markerStyle:"diamond",markerStyleWord:"diamond",markerSize:5,fillColor:"#644CD6",fillColorWord:"purple",fillColorDarkMode:"#644CD6",fillColorWordDarkMode:"purple",fillOpacity:.3},5:{lineColor:"black",lineColorWord:"black",lineColorDarkMode:"white",lineColorWordDarkMode:"white",lineOpacity:.7,lineWidth:1,lineWidthWord:"thin",lineStyle:"solid",lineStyleWord:"",markerColor:"black",markerColorWord:"black",markerColorDarkMode:"white",markerColorWordDarkMode:"white",markerStyle:"circle",markerStyleWord:"point",markerSize:5,fillColor:"black",fillColorWord:"black",fillColorDarkMode:"white",fillColorWordDarkMode:"white",fillOpacity:.3},6:{lineColor:"gray",lineColorWord:"gray",lineColorDarkMode:"gray",lineColorWordDarkMode:"gray",lineOpacity:.7,lineWidth:1,lineWidthWord:"thin",lineStyle:"dotted",lineStyleWord:"dotted",markerColor:"gray",markerColorWord:"gray",markerColorDarkMode:"gray",markerColorWordDarkMode:"gray",markerStyle:"circle",markerStyleWord:"point",markerSize:5,fillColor:"gray",fillColorWord:"gray",fillColorDarkMode:"gray",fillColorWordDarkMode:"gray",fillOpacity:.3}}}function returnStyleDefinitionStateVariables(){let as={};return as.setupChildren={returnDependencies:()=>({setupChildren:{dependencyType:"child",childGroups:["setups"],proceedIfAllChildrenNotMatched:!0}}),definition({dependencyValues:rs}){return{setValue:{setupChildren:rs.setupChildren}}}},as.styleDefinitions={stateVariablesDeterminingDependencies:["setupChildren"],returnDependencies({stateValues:rs}){let ns={ancestorWithStyle:{dependencyType:"ancestor",variableNames:["styleDefinitions"]},setupChildren:{dependencyType:"child",childGroups:["setups"],proceedIfAllChildrenNotMatched:!0}};for(let ss of rs.setupChildren)ns[`styleDefinitionsOf${ss.componentName}`]={dependencyType:"child",parentName:ss.componentName,childGroups:["styleDefinitions"],variableNames:["value"]};return ns},definition({dependencyValues:rs}){let ns={},ss;rs.ancestorWithStyle&&(ss=rs.ancestorWithStyle.stateValues.styleDefinitions),ss||(ss=returnDefaultStyleDefinitions());for(let ls in ss)ns[ls]=Object.assign({},ss[ls]);let os=[];for(let ls of rs.setupChildren)os.push(...rs[`styleDefinitionsOf${ls.componentName}`]);for(let ls of os){let us=ls.stateValues.value;for(let cs in us){let ds=ns[cs];ds||(ds=ns[cs]=Object.assign({},defaultStyle));let ps=Object.assign({},us[cs]);"markerColor"in ps&&!("markerColorWord"in ps)&&(ps.markerColorWord=ps.markerColor),"markerColorDarkMode"in ps&&!("markerColorWordDarkMode"in ps)&&(ps.markerColorWordDarkMode=ps.markerColorDarkMode),"markerColor"in ps&&!("markerColorDarkMode"in ps)&&(ps.markerColorDarkMode=ps.markerColor,ps.markerColorWordDarkMode=ps.markerWordColor),"markerStyle"in ps&&!("markerStyleWord"in ps)&&(ps.markerStyleWord=ps.markerStyle,ps.markerStyleWord==="circle"?ps.markerStyleWord="point":ps.markerStyleWord.slice(0,8)==="triangle"&&(ps.markerStyleWord="triangle")),"lineColor"in ps&&!("lineColorWord"in ps)&&(ps.lineColorWord=ps.lineColor),"lineColorDarkMode"in ps&&!("lineColorWordDarkMode"in ps)&&(ps.lineColorWordDarkMode=ps.lineColorDarkMode),"lineColor"in ps&&!("lineColorDarkMode"in ps)&&(ps.lineColorDarkMode=ps.lineColor,ps.lineColorWordDarkMode=ps.lineWordColor),"fillColor"in ps&&!("fillColorWord"in ps)&&(ps.fillColorWord=ps.fillColor),"fillColorDarkMode"in ps&&!("fillColorWordDarkMode"in ps)&&(ps.fillColorWordDarkMode=ps.fillColorDarkMode),"fillColor"in ps&&!("fillColorDarkMode"in ps)&&(ps.fillColorDarkMode=ps.fillColor,ps.fillColorWordDarkMode=ps.fillWordColor),"lineWidth"in ps&&!("lineWidthWord"in ps)&&(ps.lineWidth>=4?ps.lineWidthWord="thick":ps.lineWidth<=1?ps.lineWidthWord="thin":ps.lineWidthWord=""),"lineStyle"in ps&&!("lineStyleWord"in ps)&&(ps.lineStyle==="dashed"?ps.lineStyleWord="dashed":ps.lineStyle==="dotted"?ps.lineStyleWord="dotted":ps.lineStyleWord=""),Object.assign(ds,ps)}}return{setValue:{styleDefinitions:ns}}}},as}function returnSelectedStyleStateVariableDefinition(){return{selectedStyle:{forRenderer:!0,willNeverBeEssential:!0,returnDependencies:()=>({styleNumber:{dependencyType:"stateVariable",variableName:"styleNumber"},ancestorWithStyle:{dependencyType:"ancestor",variableNames:["styleDefinitions"]}}),definition:function({dependencyValues:as}){let rs=as.ancestorWithStyle.stateValues.styleDefinitions;rs||(rs=returnDefaultStyleDefinitions());let ns=rs[as.styleNumber];return ns===void 0&&(ns=defaultStyle),{setValue:{selectedStyle:ns}}}}}}function createStateProxyHandler(){return{get:function(as,rs){let ns=as[rs];return ns!==void 0&&(ns.isArray&&(ns.public||ns.trackChanges)?ns=new Proxy(ns.value,createArrayProxyHandler({variable:rs,nDimensions:ns.nDimensions})):ns=ns.value),ns},set:function(as,rs,ns){throw Error("Property "+rs+" is read-only")},deleteProperty:function(as,rs){throw Error("Property "+rs+" is read-only")}}}function createArrayProxyHandler({variable:as,nDimensions:rs,indicesSoFar:ns=[]}){return{variable:as,nDimensions:rs,indicesSoFar:ns,get:function(ss,os){if(os==="then"&&ss instanceof Promise)return us=>ss.then.bind(ss)(cs=>us(cs!==null&&typeof cs=="object"?new Proxy(cs,createArrayProxyHandler({variable:this.variable,nDimensions:this.nDimensions,indicesSoFar:this.indicesSoFar})):cs));let ls=ss[os];return ls!==null&&typeof ls=="object"&&rs>1&&(ls=new Proxy(ls,createArrayProxyHandler({variable:this.variable,nDimensions:this.nDimensions-1,indicesSoFar:[...this.indicesSoFar,os]}))),ls},set:function(ss,os,ls){throw Error("Property "+os+" is read-only")},deleteProperty:function(ss,os){throw Error("Property "+os+" is read-only")}}}function enumerateSelectionCombinations({numberOfIndices:as,numberOfOptions:rs,maxNumber:ns=1/0,withReplacement:ss=!1,skipZero:os=!1}){if(as===1){let ds=[...Array(rs).keys()];return ds=ds.slice(1),os||(ds=[...ds,0]),ds=ds.slice(0,ns),ds=ds.map(ps=>[ps]),ds}let ls=enumerateSelectionCombinations({numberOfIndices:as-1,numberOfOptions:rs,maxNumber:ns,withReplacement:ss,skipZero:!ss}),us=[],cs=0;for(let ds of ls)for(let ps=1;ps<=rs;ps++){let fs=[ps%rs,...ds.map(hs=>(ps+hs)%rs)];if(!(os&&fs.includes(0))&&(us.push(fs),cs++,cs>=ns))return us}return us}function enumerateCombinations({numberOfOptionsByIndex:as,maxNumber:rs=1/0}){let ns=as.length;if(ns===0)return[];let ss=[];for(let bs=0;bs[...vs,...bs],[]).reduce((bs,vs)=>Math.max(bs,vs),1);if(os===1){let bs=as.reduce((xs,Cs)=>xs*Cs);bs=Math.min(bs,rs);let vs=[];for(let xs=0;xsxs%Ts);vs.push(Cs)}return vs}if(ns===2){let bs=os,vs=Context.math.lcm(...as),xs=[],Cs=0;for(let Ts=0;Ts=rs)return xs}return xs}let ls=[];for(let bs=0;bs1?vs.push(Context.math.lcm(as[bs],as[xs])):vs.push(null);ls.push(vs)}let us=ls.reduce((bs,vs)=>[...vs,...bs],[]).filter(bs=>bs!==null).reduce((bs,vs)=>Math.min(bs,vs),1/0),cs;for(let bs=0;bs{if(os.length===0)ns.push(ls);else for(let us=0;us=rs)return}};return ss(as),ns}function getVariantsForDescendantsForUniqueVariants({variantIndex:as,serializedComponent:rs,componentInfoObjects:ns}){var cs;let ss=(cs=rs.variants)==null?void 0:cs.descendantVariantComponents;if(ss===void 0)return{success:!1};let os=ss.map(ds=>ds.variants.numberOfVariants),ls=enumerateCombinations({numberOfOptionsByIndex:os,maxNumber:as})[as-1],us=[];for(let[ds,ps]of ss.entries()){let hs=ns.allComponentClasses[ps.componentType].getUniqueVariant({serializedComponent:ps,variantIndex:ls[ds]+1,componentInfoObjects:ns});if(hs.success)us.push(hs.desiredVariant);else return{succss:!1}}return{success:!0,desiredVariants:us}}function setUpVariantSeedAndRng({serializedComponent:as,sharedParameters:rs,descendantVariantComponents:ns,useSubpartVariantRng:ss=!1}){let os,ls;if(as.variants&&(ls=as.variants.desiredVariant),(ls==null?void 0:ls.seed)!==void 0?os=ls.seed.toString():ss?os=rs.subpartVariantRng().toString().slice(2):os=rs.variantRng().toString().slice(2),rs.variantSeed=os,rs.variantRng=new rs.rngClass(rs.variantSeed),rs.subpartVariantRng=new rs.rngClass(rs.variantSeed+"s"),ls!=null&&ls.subvariants&&ns)for(let us in ls.subvariants){let cs=ls.subvariants[us],ds=ns[us];if(ds===void 0)break;ds.variants.desiredVariant=cs}}function gatherVariantComponents({serializedComponents:as,componentInfoObjects:rs}){let ns=[];for(let ss of as){if(typeof ss!="object")continue;if(ss.variants||(ss.variants={}),ss.variants.isVariantComponent){ns.push(ss);continue}if(ss.componentType in rs.componentTypesCreatingVariants){ss.variants.isVariantComponent=!0,ns.push(ss);continue}if(!ss.children)continue;if(ss.children.some(us=>us.componentType==="variantControl")){ss.variants.isVariantComponent=!0,ns.push(ss);continue}let ls=gatherVariantComponents({serializedComponents:ss.children,componentInfoObjects:rs});ls.length>0&&(ss.variants.descendantVariantComponents=ls,ns.push(...ls))}return ns}function getNumberOfVariants({serializedComponent:as,componentInfoObjects:rs}){as.variants||(as.variants={});let ns;for(let os of as.children)if(os.componentType==="variantControl"){ns=os;break}let ss=as.componentType==="document";if(!ns){if(!ss)return{success:!1};let os=as.children.filter(ls=>ls.componentType||ls.trim()!=="");if(os.length===1&&rs.isInheritedComponentType({inheritedComponentType:os[0].componentType,baseComponentType:"_sectioningComponent"})){let ls=os[0],us=getNumberOfVariants({serializedComponent:ls,componentInfoObjects:rs});if(us.success)return as.variants.descendantVariantComponents=gatherVariantComponents({serializedComponents:as.children,componentInfoObjects:rs}),as.variants.uniqueVariants=!0,as.variants.numberOfVariants=ls.variants.numberOfVariants,as.variants.allPossibleVariants=ls.variants.allPossibleVariants,as.variants.allVariantNames=ls.variants.allVariantNames,as.variants.allPossibleVariantUniqueIndices=[...ls.variants.allPossibleVariants.keys()].map(cs=>cs+1),as.variants.allPossibleVariantSeeds=[...ls.variants.allPossibleVariants.keys()].map(cs=>(cs+1).toString()),us}}return determineVariantsForSection({serializedComponent:as,componentInfoObjects:rs,isDocument:ss})}function determineVariantsForSection({serializedComponent:as,componentInfoObjects:rs,isDocument:ns=!1}){var Ns,As,ws,Es;as.variants===void 0&&(as.variants={});let ss;for(let _s of as.children)if(_s.componentType==="variantControl"){ss=_s;break}if(!ss&&!ns)return rs.allComponentClasses._base.determineNumberOfUniqueVariants({serializedComponent:as,componentInfoObjects:rs});let os=[];if(ss!=null&&ss.attributes.variantNames&&(os=ss.attributes.variantNames.component.children.map(_s=>_s.toLowerCase())),os.length!==[...new Set(os)].length)throw Error("Duplicate variant names specified");let ls=(Ns=ss==null?void 0:ss.attributes.nVariants)==null?void 0:Ns.primitive;Number.isFinite(ls)||(ls=100),ls=Math.min(Math.max(ls,1),1e3);let us=[...os];if(us.length_s.toLowerCase()),cs=[...new Set(cs)];for(let _s of cs)if(!us.includes(_s))throw Error(`Cannot include variant ${_s} as ${_s} is a not variant name`)}let ds=(ws=ss==null?void 0:ss.attributes.variantsToExclude)==null?void 0:ws.component.children;if(ds){ds=ds.map(_s=>_s.toLowerCase());for(let _s of ds)if(!us.includes(_s))throw Error(`Cannot exclude variant ${_s} as ${_s} is not a variant name`)}else ds=[];cs?cs=cs.filter(_s=>!ds.includes(_s)):cs=[...us].filter(_s=>!ds.includes(_s));let ps=cs.map(_s=>us.indexOf(_s)+1),fs=[];ss!=null&&ss.attributes.seeds&&(fs=ss.attributes.seeds.component.children);let hs=[...fs];if(hs.lengthhs[_s-1]),ys=(ss==null?void 0:ss.attributes.uniqueVariants)!==void 0,bs=(Es=ss==null?void 0:ss.attributes.uniqueVariants)==null?void 0:Es.primitive,vs;(bs||!ys)&&(vs=rs.allComponentClasses._base.determineNumberOfUniqueVariants({serializedComponent:as,componentInfoObjects:rs}),vs.success?bs=bs||vs.numberOfVariants<=ls:bs=!1);let xs=[],Cs=[],Ts=[];if(bs)for(let[_s,$s]of ps.entries())$s<=vs.numberOfVariants&&(Cs.push($s),xs.push(cs[_s]),Ts.push(gs[_s]));else xs=cs,Cs=ps,Ts=gs;let Ss=xs.length;if(Ss===0)throw Error("No variants selected based on variantsToInclude, variantsToExclude, and the number of variants available");return as.variants.uniqueVariants=bs,as.variants.numberOfVariants=Ss,as.variants.allPossibleVariants=xs,as.variants.allVariantNames=us,as.variants.allPossibleVariantUniqueIndices=Cs,as.variants.allPossibleVariantSeeds=Ts,{success:!0,numberOfVariants:Ss}}function indexToLowercaseLetters(as){return numberToLetters(as,!0)}function renameStateVariable({stateVariableDefinitions:as,oldName:rs,newName:ns}){let ss=as[ns]=as[rs];if(delete as[rs],ss.additionalStateVariablesDefined){let ds=ss.additionalStateVariablesDefined.indexOf(rs);ds!==-1&&(ss.additionalStateVariablesDefined[ds]=ns)}let os=ss.definition,ls=["setValue","useEssentialOrDefaultValue","setEssentialValue"],us=["noChanges"];ss.definition=function(ds){let ps=os(ds);for(let fs of ls)ps[fs]&&rs in ps[fs]&&(ps[fs][ns]=ps[fs][rs],delete ps[fs][rs]);for(let fs of us)if(ps[fs]){let hs=ps[fs].indexOf(rs);hs!==-1&&(ps[fs][hs]=ns)}return ps};let cs=ss.inverseDefinition;cs&&(ss.inverseDefinition=async function(ds){let ps=ds.desiredStateVariableValues;ps[rs]=ps[ns],delete ps[ns];let fs=await cs(ds);if(fs.success)for(let hs of fs.instructions)hs.setEssentialValue===rs&&(hs.setEssentialValue=ns);return fs})}function returnDefaultGetArrayKeysFromVarName(as){return as>1?function({arrayEntryPrefix:rs,varEnding:ns,arraySize:ss,nDimensions:os}){let ls=ns.split("_").map(us=>Number(us)-1);return ls.length===os&&ls.every((us,cs)=>Number.isInteger(us)&&us>=0)?ss?ls.every((us,cs)=>us=0?ss?ostypeof ls=="object"?ls.componentType:ls));for(let ls of os){let us=this.componentInfoObjects.allComponentClasses[ls];if(us){let cs=us.rendererType;cs&&!rs.includes(cs)&&rs.push(cs)}}}}if(this.constructor.adapters)for(let ns of this.constructor.adapters){let ss;typeof ns=="string"?ss=ns:ss=ns.componentType;let os=this.componentInfoObjects.allComponentClasses[ss];if(os){let ls=os.rendererType;ls&&!rs.includes(ls)&&rs.push(ls)}}if(!this.rendererType)return rs;for(let ns in this.allChildren){let ss=this.allChildren[ns].component;if(typeof ss=="object")for(let os of ss.allPotentialRendererTypes)rs.includes(os)||rs.push(os)}return rs}potentialRendererTypesFromSerializedComponents(rs){var ss;let ns=[];for(let os of rs){let ls=this.componentInfoObjects.allComponentClasses[os.componentType];if(ls){let us=ls.rendererType;us&&!ns.includes(us)&&ns.push(us);let cs=ls.returnStateVariableInfo({onlyPublic:!0}).stateVariableDescriptions;for(let ds in cs){let ps=cs[ds],fs=(ss=ps.shadowingInstructions)==null?void 0:ss.createComponentOfType;Array.isArray(fs)||(fs=[fs]),ps.wrappingComponents&&fs.push(...flattenDeep(ps.wrappingComponents).map(hs=>typeof hs=="object"?hs.componentType:hs));for(let hs of fs){let gs=this.componentInfoObjects.allComponentClasses[hs];if(gs){let ys=gs.rendererType;ys&&!ns.includes(ys)&&ns.push(ys)}}}if(ls.adapters)for(let ds of ls.adapters){let ps;typeof ds=="string"?ps=ds:ps=ds.componentType;let fs=this.componentInfoObjects.allComponentClasses[ps];if(fs){let hs=fs.rendererType;hs&&!ns.includes(hs)&&ns.push(hs)}}}if(os.children){let us=this.potentialRendererTypesFromSerializedComponents(os.children);for(let cs of us)ns.includes(cs)||ns.push(cs)}}return ns}get childrenMatched(){return this.childrenMatchedWithPlaceholders&&!this.placeholderActiveChildrenIndices}static createAttributesObject(){return{hide:{createComponentOfType:"boolean",createStateVariable:"hide",defaultValue:!1,public:!0},disabled:{createComponentOfType:"boolean"},fixed:{createComponentOfType:"boolean",ignoreFixed:!0},modifyIndirectly:{createComponentOfType:"boolean",createStateVariable:"modifyIndirectly",defaultValue:!0,public:!0,propagateToProps:!0},styleNumber:{createComponentOfType:"number",createStateVariable:"styleNumber",defaultValue:1,public:!0,fallBackToParentStateVariable:"styleNumber"},isResponse:{createPrimitiveOfType:"boolean",createStateVariable:"isResponse",defaultValue:!1,public:!0},newNamespace:{createPrimitiveOfType:"boolean",createStateVariable:"newNamespace",defaultValue:!1,public:!0}}}static returnSugarInstructions(){return[]}static returnChildGroups(){return[]}static get childGroups(){return this.hasOwnProperty("childGroupsData")?this.childGroupsData:(this.childGroupsData=this.returnChildGroups(),this.childGroupsData)}static get childGroupOfComponentType(){return this.hasOwnProperty("childGroupOfComponentTypeData")?this.childGroupOfComponentTypeData:(this.childGroupOfComponentTypeData={},this.childGroupOfComponentTypeData)}static get childGroupIndsByName(){if(this.hasOwnProperty("childGroupIndsByNameData"))return Object.assign({},this.childGroupIndsByNameData);this.childGroupIndsByNameData={};for(let[rs,ns]of this.childGroups.entries()){if(ns.group in this.childGroupIndsByNameData)throw Error(`Invalid childGroups for componentClass ${this.componentType}: ${ns} is repeated`);this.childGroupIndsByNameData[ns.group]=rs}return Object.assign({},this.childGroupIndsByNameData)}returnMatchedChildIndices(rs){let ns=[];for(let ss of rs){let os=this.childMatchesByGroup[ss];if(!os)return;ns.push(...os)}return ns.sort((ss,os)=>ss-os)}static returnStateVariableDefinitions(){let rs={};return rs.hidden={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},forRenderer:!0,returnDependencies:()=>({hide:{dependencyType:"stateVariable",variableName:"hide",variablesOptional:!0},parentHidden:{dependencyType:"parentStateVariable",variableName:"hidden"},sourceCompositeHidden:{dependencyType:"sourceCompositeStateVariable",variableName:"hidden"},adapterSourceHidden:{dependencyType:"adapterSourceStateVariable",variableName:"hidden"}}),definition:({dependencyValues:ns})=>({setValue:{hidden:!!(ns.parentHidden||ns.sourceCompositeHidden||ns.adapterSourceHidden||ns.hide)}}),markStale:()=>({updateParentRenderedChildren:!0}),inverseDefinition({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setDependency:"hide",desiredValue:ns.hidden}]}}},rs.disabled={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},forRenderer:!0,hasEssential:!0,doNotShadowEssential:!0,defaultValue:!1,provideEssentialValuesInDefinition:!0,returnDependencies:()=>({disabledAttr:{dependencyType:"attributeComponent",attributeName:"disabled",variableNames:["value"]},readOnly:{dependencyType:"flag",flagName:"readOnly"},parentDisabled:{dependencyType:"parentStateVariable",variableName:"disabled"},sourceCompositeDisabled:{dependencyType:"sourceCompositeStateVariable",variableName:"disabled"},adapterSourceDisabled:{dependencyType:"adapterSourceStateVariable",variableName:"disabled"}}),definition({dependencyValues:ns,usedDefault:ss,essentialValues:os}){if(ns.readOnly)return{setValue:{disabled:!0}};if(ns.disabledAttr!==null)return{setValue:{disabled:ns.disabledAttr.stateValues.value}};if(os.disabled!==void 0)return{useEssentialOrDefaultValue:{disabled:!0}};let ls=!1,us=!0;return ns.parentDisabled!==null&&!ss.parentDisabled&&(ls=ls||ns.parentDisabled,us=!1),ns.sourceCompositeDisabled!==null&&!ss.sourceCompositeDisabled&&(ls=ls||ns.sourceCompositeDisabled,us=!1),ns.adapterSourceDisabled!==null&&!ss.adapterSourceDisabled&&(ls=ls||ns.adapterSourceDisabled,us=!1),us?{useEssentialOrDefaultValue:{disabled:!0}}:{setValue:{disabled:ls}}},inverseDefinition({dependencyValues:ns,desiredStateVariableValues:ss}){return ns.disabledAttr!==null?{success:!0,instructions:[{setDependency:"disabledAttr",desiredValue:ss.disabled,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"disabled",value:ss.disabled}]}}},rs.fixed={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},forRenderer:!0,defaultValue:!1,hasEssential:!0,doNotShadowEssential:!0,ignoreFixed:!0,provideEssentialValuesInDefinition:!0,returnDependencies:()=>({fixedAttr:{dependencyType:"attributeComponent",attributeName:"fixed",variableNames:["value"]},parentFixed:{dependencyType:"parentStateVariable",variableName:"fixed"},sourceCompositeFixed:{dependencyType:"sourceCompositeStateVariable",variableName:"fixed"},adapterSourceFixed:{dependencyType:"adapterSourceStateVariable",variableName:"fixed"},ignoreParentFixed:{dependencyType:"doenetAttribute",attributeName:"ignoreParentFixed"}}),definition({dependencyValues:ns,usedDefault:ss,essentialValues:os}){if(ns.fixedAttr!==null)return{setValue:{fixed:ns.fixedAttr.stateValues.value}};if(os.fixed!==void 0)return{useEssentialOrDefaultValue:{fixed:!0}};let ls=!1,us=!0;return ns.parentFixed!==null&&!ss.parentFixed&&!ns.ignoreParentFixed&&(ls=ls||ns.parentFixed,us=!1),ns.sourceCompositeFixed!==null&&!ss.sourceCompositeFixed&&(ls=ls||ns.sourceCompositeFixed,us=!1),ns.adapterSourceFixed!==null&&!ss.adapterSourceFixed&&(ls=ls||ns.adapterSourceFixed,us=!1),us?{useEssentialOrDefaultValue:{fixed:!0}}:{setValue:{fixed:ls}}},inverseDefinition({dependencyValues:ns,desiredStateVariableValues:ss}){return ns.fixedAttr!==null?{success:!0,instructions:[{setDependency:"fixedAttr",desiredValue:ss.fixed,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"fixed",value:ss.fixed}]}}},rs.isInactiveCompositeReplacement={defaultValue:!1,hasEssential:!0,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{isInactiveCompositeReplacement:!0}}),inverseDefinition({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setEssentialValue:{variableName:"isInactiveCompositeReplacement",value:ns.isInactiveCompositeReplacement}}]}}},rs.doenetML={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({doenetML:{dependencyType:"doenetML"}}),definition({dependencyValues:ns}){let ss=ns.doenetML;return ss||(ss=""),{setValue:{doenetML:ss}}}},rs}static returnNormalizedStateVariableDefinitions({attributeNames:rs,numerics:ns}){let ss=this.returnStateVariableDefinitions({attributeNames:rs,numerics:ns});if(!ss)throw Error(`Error in state variable definitions of ${this.componentType}: returnStateVariableDefinitions did not return anything`);let os=function(cs){for(let[ds,ps]of cs.entries())typeof ps=="object"&&(cs[ds]=ps.variableName)},ls=["returnDependencies","definition","inverseDefinition","stateVariablesDeterminingDependencies","stateVariablesDeterminingArraySizeDependencies","isArray","nDimensions","returnArraySizeDependencies","returnArraySize","returnArrayDependenciesByKey","arrayDefinitionByKey","inverseArrayDefinitionByKey","basedOnArrayKeyStateVariables","markStale","getPreviousDependencyValuesForMarkStale","determineDependenciesImmediately","createWorkspace","workspace","provideEssentialValuesInDefinition","providePreviousValuesInDefinition"],us={};for(let cs in ss){let ds=ss[cs];if(us[cs]=ds,ds.createWorkspace&&(ds.workspace={}),ds.additionalStateVariablesDefined){for(let[ps,fs]of ds.additionalStateVariablesDefined.entries()){let hs={};for(let ys of ls)ys in ds&&(hs[ys]=ds[ys]);hs.additionalStateVariablesDefined=[...ds.additionalStateVariablesDefined],hs.additionalStateVariablesDefined[ps]=cs,os(hs.additionalStateVariablesDefined);let gs=fs;typeof fs=="object"&&(gs=fs.variableName,fs=Object.assign({},fs),delete fs.variableName,Object.assign(hs,fs)),us[gs]=hs}os(ds.additionalStateVariablesDefined)}}return us}static returnStateVariableInfo({onlyPublic:rs=!1,onlyForRenderer:ns=!1}={}){var ds,ps;let ss=this.createAttributesObject(),os={},ls={},us={};for(let fs in ss){let hs=ss[fs],gs=hs.createStateVariable;if(gs&&(!rs||hs.public)&&(!ns||hs.forRenderer))if(hs.public){let ys=!hs.createComponentOfType,bs;ys?(bs=hs.createPrimitiveOfType,bs==="string"&&(bs="text")):bs=hs.createComponentOfType,os[gs]={createComponentOfType:bs,public:!0}}else os[gs]={}}let cs=this.returnNormalizedStateVariableDefinitions({attributeNames:Object.keys(os)});for(let fs in cs){let hs=cs[fs];if(hs.isAlias){us[fs]=hs.targetVariableName;continue}if((!rs||hs.public)&&(!ns||hs.forRenderer)&&(hs.public?os[fs]={createComponentOfType:hs.shadowingInstructions.createComponentOfType,public:!0}:os[fs]={},hs.isArray)){os[fs].isArray=!0,os[fs].nDimensions=hs.nDimensions===void 0?1:hs.nDimensions,os[fs].wrappingComponents=(ds=hs.shadowingInstructions)!=null&&ds.returnWrappingComponents?hs.shadowingInstructions.returnWrappingComponents():[];let gs;hs.entryPrefixes?gs=hs.entryPrefixes:gs=[fs];for(let ys of gs)ls[ys]={arrayVariableName:fs,nDimensions:hs.returnEntryDimensions?hs.returnEntryDimensions(ys):1,wrappingComponents:(ps=hs.shadowingInstructions)!=null&&ps.returnWrappingComponents?hs.shadowingInstructions.returnWrappingComponents(ys):[]};hs.getArrayKeysFromVarName?os[fs].getArrayKeysFromVarName=hs.getArrayKeysFromVarName:os[fs].getArrayKeysFromVarName=returnDefaultGetArrayKeysFromVarName(os[fs].nDimensions)}}return{stateVariableDescriptions:os,arrayEntryPrefixes:ls,aliases:us}}get parentName(){if(!(this.ancestors===void 0||this.ancestors.length===0))return this.ancestors[0].componentName}getAllChildrenDownstreamComponentNames(rs=!1){const ns=Object.keys(this.allChildren);let ss=Object.keys(this.downstreamDependencies);return rs!==!0&&(ss=ss.filter(os=>this.downstreamDependencies[os].inactive!==!0)),[...ns,...ss]}get allDescendants(){let rs=[];for(let ns in this.allChildren){let ss=this.allChildren[ns].component;rs=[...rs,ns,...ss.allDescendants]}return rs}async serialize(rs={}){let ns={componentType:this.componentType},ss=[],os={...rs},ls;rs.sourceAttributesToIgnoreRecursively?ls=[...rs.sourceAttributesToIgnoreRecursively]:ls=[],rs.sourceAttributesToIgnore&&(ls.push(...rs.sourceAttributesToIgnore),delete os.sourceAttributesToIgnore);{for(let us of this.definingChildren)typeof us!="object"?ss.push(us):ss.push(await us.serialize(os));if(this.serializedChildren!==void 0)for(let us of this.serializedChildren)ss.push(this.copySerializedComponent(us));ss.length>0&&(ns.children=ss)}ns.attributes={};for(let us in this.attributes){let cs=this.attributes[us];cs.component?rs.copyAll&&(ns.attributes[us]={component:await cs.component.serialize(os)}):(!ls.includes(us)||rs.copyAll)&&(ns.attributes[us]=JSON.parse(JSON.stringify(cs)))}return this.essentialState&&Object.keys(this.essentialState).length>0&&(ns.state=deepClone(this.essentialState)),rs.copyVariants&&this.state.generatedVariantInfo&&(ns.variants={desiredVariant:await this.stateValues.generatedVariantInfo}),ns.originalName=this.componentName,ns.originalDoenetAttributes=deepClone(this.doenetAttributes),ns.doenetAttributes=deepClone(this.doenetAttributes),ns.originalAttributes=deepClone(ns.attributes),delete ns.doenetAttributes.prescribedName,delete ns.doenetAttributes.assignNames,ns}copySerializedComponent(rs){if(typeof rs!="object")return rs;let ns=[];if(rs.children!==void 0)for(let os of rs.children)ns.push(this.copySerializedComponent(os));let ss={componentType:rs.componentType,originalName:rs.componentName,originalNameFromSerializedComponent:!0,children:ns,state:{},doenetAttributes:{}};return rs.doenetAttributes!==void 0&&(ss.originalDoenetAttributes=deepClone(rs.doenetAttributes),ss.doenetAttributes=deepClone(rs.doenetAttributes),ss.originalAttributes=deepClone(rs.attributes),ss.attributes=deepClone(rs.attributes),delete ss.doenetAttributes.prescribedName,delete ss.doenetAttributes.assignNames),rs.state!==void 0&&Object.assign(ss.state,rs.state),ss}static get nAdapters(){return this.adapters.length}getAdapter(rs){if(rs>=this.constructor.adapters.length)return;let ns=this.constructor.adapters[rs],ss,os,ls,us;typeof ns=="string"?ss=ns:(ss=ns.stateVariable,os=ns.componentType,ls=ns.substituteForPrimaryStateVariable,us=ns.stateVariablesToShadow);let cs=this.state[ss];if(cs===void 0||!cs.public&&!os)throw Error("Invalid adapter "+ss+" in "+this.componentType);return os===void 0&&(os=cs.shadowingInstructions.createComponentOfType),{componentType:os,downstreamDependencies:{[this.componentName]:[{dependencyType:"adapter",adapterVariable:ss,adapterTargetIdentity:{componentName:this.componentName,componentType:this.componentType},substituteForPrimaryStateVariable:ls,stateVariablesToShadow:us}]}}}static getAdapterComponentType(rs,ns){if(rs>=this.adapters.length)return;let ss=this.adapters[rs],os,ls;if(typeof ss=="string"?os=ss:(os=ss.stateVariable,ls=ss.componentType),ls===void 0){let cs=ns[this.componentType].stateVariableDescriptions[os];if(!cs)throw Error("Invalid adapter "+os+" in "+this.componentType);if(ls=cs.createComponentOfType,!ls)throw Error(`Couldn't get adapter component type for ${os} of componentType ${this.componentType}`)}return ls}static determineNumberOfUniqueVariants({serializedComponent:rs,componentInfoObjects:ns}){var us;let ss=(us=rs.variants)==null?void 0:us.numberOfVariants;if(ss!==void 0)return{success:!0,numberOfVariants:ss};let os=[];rs.children&&(os=gatherVariantComponents({serializedComponents:rs.children,componentInfoObjects:ns})),rs.variants===void 0&&(rs.variants={}),rs.variants.descendantVariantComponents=os,ss=1;let ls=[];for(let cs of os){let ps=ns.allComponentClasses[cs.componentType].determineNumberOfUniqueVariants({serializedComponent:cs,componentInfoObjects:ns});if(!ps.success)return{success:!1};ls.push(ps.numberOfVariants),ss*=ps.numberOfVariants}return rs.variants.numberOfVariants=ss,rs.variants.uniqueVariantData={numberOfVariantsByDescendant:ls},{success:!0,numberOfVariants:ss}}static getUniqueVariant({serializedComponent:rs,variantIndex:ns,componentInfoObjects:ss}){var fs;let os=(fs=rs.variants)==null?void 0:fs.numberOfVariants;if(os===void 0)return{success:!1};if(!Number.isInteger(ns)||ns<1||ns>os)return{success:!1};let ls=!1,us=rs.variants.uniqueVariantData.numberOfVariantsByDescendant,cs=rs.variants.descendantVariantComponents,ds=[];if(cs.length>0){let hs=enumerateCombinations({numberOfOptionsByIndex:us,maxNumber:ns})[ns-1].map(gs=>gs+1);for(let gs=0;gs1){let ys=cs[gs],vs=ss.allComponentClasses[ys.componentType].getUniqueVariant({serializedComponent:ys,variantIndex:hs[gs],componentInfoObjects:ss});if(!vs.success)return{success:!1};ds.push(vs.desiredVariant),ls=!0}else ds.push({})}let ps={index:ns};return ls&&(ps.subvariants=ds),{success:!0,desiredVariant:ps}}async copyDoenetMLToClipboard({actionId:rs}){let ns=await this.stateValues.doenetML;ns?this.coreFunctions.copyToClipboard(ns,rs):this.coreFunctions.resolveAction({actionId:rs})}}zs(BaseComponent,"componentType","_base"),zs(BaseComponent,"childGroupOfComponentTypeData"),zs(BaseComponent,"childGroupIndsByNameData"),zs(BaseComponent,"adapters",[]);class InlineComponent extends BaseComponent{}zs(InlineComponent,"componentType","_inline");class Text extends InlineComponent{constructor(rs){super(rs),Object.assign(this.actions,{moveText:this.moveText.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.layer={createComponentOfType:"number",createStateVariable:"layer",defaultValue:0,public:!0,forRenderer:!0},rs.anchor={createComponentOfType:"point"},rs.positionFromAnchor={createComponentOfType:"text",createStateVariable:"positionFromAnchor",defaultValue:"center",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft","top","bottom","left","right","center"]},rs.styleNumber.defaultValue=0,rs}static returnChildGroups(){return[{group:"textLike",componentTypes:["string","text","_singleCharacterInline","_inlineRenderInlineChildren"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=returnSelectedStyleStateVariableDefinition();return Object.assign(rs,ns),rs.value={public:!0,shadowingInstructions:{createComponentOfType:this.componentType,addAttributeComponentsShadowingStateVariables:{fixed:{stateVariableToShadow:"fixed"}}},hasEssential:!0,returnDependencies:()=>({textLikeChildren:{dependencyType:"child",childGroups:["textLike"],variableNames:["text"]}}),defaultValue:"",set:ss=>ss===null?"":String(ss),definition:function({dependencyValues:ss}){if(ss.textLikeChildren.length===0)return{useEssentialOrDefaultValue:{value:!0}};let os="";for(let ls of ss.textLikeChildren)typeof ls=="string"?os+=ls:os+=ls.stateValues.text;return{setValue:{value:os}}},inverseDefinition:function({desiredStateVariableValues:ss,dependencyValues:os}){let ls=os.textLikeChildren.length;return ls>1?{success:!1}:ls===1?{success:!0,instructions:[{setDependency:"textLikeChildren",desiredValue:ss.value,childIndex:0,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"value",value:ss.value===null?"":String(ss.value)}]}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition:({dependencyValues:ss})=>({setValue:{text:ss.value}}),inverseDefinition:({desiredStateVariableValues:ss})=>({success:!0,instructions:[{setDependency:"value",desiredValue:ss.text}]})},rs.anchor={defaultValue:Context.fromText("(0,0)"),public:!0,forRenderer:!0,hasEssential:!0,shadowingInstructions:{createComponentOfType:"point"},returnDependencies:()=>({anchorAttr:{dependencyType:"attributeComponent",attributeName:"anchor",variableNames:["coords"]}}),definition({dependencyValues:ss}){return ss.anchorAttr?{setValue:{anchor:ss.anchorAttr.stateValues.coords}}:{useEssentialOrDefaultValue:{anchor:!0}}},async inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os,stateValues:ls,initialChange:us}){return us&&!await ls.draggable?{success:!1}:os.anchorAttr?{success:!0,instructions:[{setDependency:"anchorAttr",desiredValue:ss.anchor,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"anchor",value:ss.anchor}]}}},rs}async moveText({x:rs,y:ns,z:ss,transient:os,actionId:ls,sourceInformation:us={},skipRendererUpdate:cs=!1}){let ds=["vector"];return rs!==void 0&&(ds[1]=rs),ns!==void 0&&(ds[2]=ns),ss!==void 0&&(ds[3]=ss),os?await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],transient:os,actionId:ls,sourceInformation:us,skipRendererUpdate:cs}):await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],actionId:ls,sourceInformation:us,skipRendererUpdate:cs,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{x:rs,y:ns,z:ss}}})}}zs(Text,"componentType","text"),zs(Text,"includeBlankStringChildren",!0),zs(Text,"variableForPlainMacro","value"),zs(Text,"descendantCompositesMustHaveAReplacement",!1);class TextOrInline extends InlineComponent{static returnChildGroups(){return[{group:"inlines",componentTypes:["_inline"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.value={public:!0,shadowingInstructions:{createComponentOfType:this.componentType},returnDependencies:()=>({inlineChildren:{dependencyType:"child",childGroups:["inlines"],variableNames:["text"],variablesOptional:!0}}),definition:function({dependencyValues:ns}){let ss="";for(let os of ns.inlineChildren)typeof os!="object"?ss+=os.toString():typeof os.stateValues.text=="string"&&(ss+=os.stateValues.text);return{setValue:{value:ss}}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition:({dependencyValues:ns})=>({setValue:{text:ns.value}})},rs}}zs(TextOrInline,"componentType","_textOrInline"),zs(TextOrInline,"renderChildren",!0),zs(TextOrInline,"rendererType","containerInline"),zs(TextOrInline,"includeBlankStringChildren",!0);class CompositeComponent extends BaseComponent{constructor(ns){super(ns);zs(this,"replacements",[]);zs(this,"replacementsToWithhold",0);this.replacementsWorkspace={}}static returnStateVariableDefinitions(){let ns=super.returnStateVariableDefinitions();return ns.replacements={returnDependencies:()=>({replacements:{dependencyType:"replacement"}}),definition:({dependencyValues:ss})=>({setValue:{replacements:ss.replacements}})},ns.recursiveReplacements={returnDependencies:()=>({recursiveReplacements:{dependencyType:"replacement",recursive:!0}}),definition:({dependencyValues:ss})=>({setValue:{recursiveReplacements:ss.recursiveReplacements}})},ns.fullRecursiveReplacements={returnDependencies:()=>({recursiveReplacements:{dependencyType:"replacement",recursive:!0,recurseNonStandardComposites:!0}}),definition:({dependencyValues:ss})=>({setValue:{fullRecursiveReplacements:ss.recursiveReplacements}})},ns}static createSerializedReplacements(){return{replacements:[]}}static calculateReplacementChanges(){return[]}get allPotentialRendererTypes(){let ns=super.allPotentialRendererTypes;for(let ss in this.allChildren){let os=this.allChildren[ss].component;for(let ls of os.allPotentialRendererTypes)ns.includes(ls)||ns.push(ls)}if(this.replacements){for(let ss of this.replacements)if(typeof ss=="object")for(let os of ss.allPotentialRendererTypes)ns.includes(os)||ns.push(os)}return ns}}zs(CompositeComponent,"componentType","_composite"),zs(CompositeComponent,"rendererType");function postProcessCopy({serializedComponents:as,componentName:rs,addShadowDependencies:ns=!0,markAsPrimaryShadow:ss=!1,uniqueIdentifiersUsed:os=[],identifierPrefix:ls="",unlinkExternalCopies:us=!1,copiesByTargetComponentName:cs={},componentNamesFound:ds=[],assignNamesFound:ps=[],activeAliases:fs=[],init:hs=!0}){var gs;for(let ys in as){let bs=as[ys];if(typeof bs!="object")continue;let vs;if(bs.originalName){if(us){if(ds.push(bs.originalName),bs.originalDoenetAttributes&&bs.originalDoenetAttributes.assignNames){let xs;if((gs=bs.attributes.newNamespace)!=null&&gs.primitive)xs=bs.originalName;else{let Cs=bs.originalName.lastIndexOf("/");xs=bs.originalName.substring(0,Cs)}for(let Cs of bs.originalDoenetAttributes.assignNames)ds.push(xs+"/"+Cs),ps.push(xs+"/"+Cs)}bs.attributes&&(bs.attributes.alias&&fs.push(bs.attributes.alias.primitive),bs.attributes.indexAlias&&fs.push(bs.attributes.indexAlias.primitive))}if(vs=ls+bs.originalName+"|shadow",!bs.originalNameFromSerializedComponent)if(ns){let xs={[bs.originalName]:[{dependencyType:"referenceShadow",compositeName:rs}]};if(hs&&(xs[bs.originalName][0].firstLevelReplacement=!0),ss&&(xs[bs.originalName][0].isPrimaryShadow=!0),bs.state){let Cs=Object.keys(bs.state);xs[bs.originalName].downstreamStateVariables=Cs,xs[bs.originalName].upstreamStateVariables=Cs}bs.downstreamDependencies=xs}else bs.unlinkedCopySource=bs.originalName}else vs=ls+bs.componentType+"|shadowUnnamed";if(bs.componentType==="copy"&&us){let xs=bs.doenetAttributes.targetComponentName;if(xs)fs.includes(bs.doenetAttributes.target)?bs.doenetAttributes.targetComponentName=bs.doenetAttributes.target:(cs[xs]===void 0&&(cs[xs]=[]),cs[xs].push(bs));else if(!bs.attributes.uri)throw Error("we need to create a targetComponentName here, then.")}bs.uniqueIdentifier=getUniqueIdentifierFromBase(vs,os)}for(let ys in as){let bs=as[ys];if(typeof bs=="object"){postProcessCopy({serializedComponents:bs.children,componentName:rs,addShadowDependencies:ns,markAsPrimaryShadow:ss,uniqueIdentifiersUsed:os,identifierPrefix:ls,unlinkExternalCopies:us,copiesByTargetComponentName:cs,componentNamesFound:ds,assignNamesFound:ps,activeAliases:[...fs],init:!1});for(let vs in bs.attributes){let xs=bs.attributes[vs];xs.component&&(xs.component=postProcessCopy({serializedComponents:[xs.component],componentName:rs,addShadowDependencies:ns,markAsPrimaryShadow:ss,uniqueIdentifiersUsed:os,identifierPrefix:ls,unlinkExternalCopies:us,copiesByTargetComponentName:cs,componentNamesFound:ds,assignNamesFound:ps,activeAliases:[...fs],init:!1})[0])}bs.replacements&&postProcessCopy({serializedComponents:bs.replacements,componentName:rs,addShadowDependencies:ns,markAsPrimaryShadow:ss,uniqueIdentifiersUsed:os,identifierPrefix:ls,unlinkExternalCopies:us,copiesByTargetComponentName:cs,componentNamesFound:ds,assignNamesFound:ps,activeAliases:[...fs],init:!1})}}if(hs&&us){for(let ys in cs)if(!ds.includes(ys)){let bs=!1;for(let vs of ps){let xs=vs+"/",Cs=xs.length;if(ys.substring(0,Cs)===xs){bs=!0;break}}if(!bs)for(let vs of cs[ys])vs.attributes||(vs.attributes={}),vs.attributes.link={primitive:!1},vs.doenetAttributes.target=vs.doenetAttributes.targetComponentName}}return as}function convertAttributesForComponentType({attributes:as,componentType:rs,componentInfoObjects:ns,compositeAttributesObj:ss={},compositeCreatesNewNamespace:os,flags:ls}){var fs;let us=ns.allComponentClasses[rs],cs=us.createAttributesObject(),ds={};for(let hs in cs)ds[hs.toLowerCase()]=hs;let ps={};for(let hs in as){if(hs in ss&&!ss[hs].leaveRaw)continue;let gs=ds[hs.toLowerCase()],ys=cs[gs];if(ys){if(gs in ps)throw Error(`Cannot repeat prop ${gs}`);if(ps[gs]=componentFromAttribute({attrObj:ys,value:JSON.parse(JSON.stringify(as[hs])),componentInfoObjects:ns}),(fs=ps[gs].component)!=null&&fs.children){let bs=[ps[gs].component];if(applyMacros(bs,ns),removeBlankStringChildren(bs,ns),applySugar({serializedComponents:bs,componentInfoObjects:ns,isAttributeComponent:!0}),os){for(let vs of ps[gs].component.children)if(vs.componentType==="copy"){let xs=vs.doenetAttributes.target;/[a-zA-Z_]/.test(xs[0])&&(vs.doenetAttributes.target="../"+xs)}}}}else us.acceptAnyAttribute&&(ps[hs]=JSON.parse(JSON.stringify(as[hs])))}return ps}async function verifyReplacementsMatchSpecifiedType({component:as,replacements:rs,replacementChanges:ns,assignNames:ss,workspace:os={},componentInfoObjects:ls,compositeAttributesObj:us,flags:cs}){var gs,ys,bs,vs,xs;if(!((gs=as.attributes.createComponentOfType)!=null&&gs.primitive)&&!as.sharedParameters.compositesMustHaveAReplacement)return{replacements:rs,replacementChanges:ns};let ds=as.replacementsToWithhold,ps;if(!ns)ls.isInheritedComponentType({inheritedComponentType:as.componentType,baseComponentType:"template"})&&(rs=rs.filter(Cs=>Cs.componentType||Cs.trim().length>0)),ps=rs.map(Cs=>Cs.componentType),ps.length===1&&ps[0]==="externalContent"&&(ps=rs[0].children.filter(Cs=>Cs.componentType||Cs.trim().length>0).map(Cs=>Cs.componentType));else{ps=as.replacements.map(Cs=>Cs.componentType);for(let Cs of ns)if(Cs.changeType==="add"){if(Cs.replacementsToWithhold!==void 0&&(ds=Cs.replacementsToWithhold),!Cs.changeTopLevelReplacements)continue;if(Cs.serializedReplacements){let Ts=Cs.numberReplacementsToReplace;Ts>0||(Ts=0);let Ss=Cs.firstReplacementInd,Ns=Cs.serializedReplacements.map(As=>As.componentType);ps.splice(Ss,Ts,...Ns)}}else if(Cs.changeType==="delete"){if(Cs.replacementsToWithhold!==void 0&&(ds=Cs.replacementsToWithhold),Cs.changeTopLevelReplacements){let Ts=Cs.firstReplacementInd,Ss=Cs.numberReplacementsToDelete;ps.splice(Ts,Ss)}}else Cs.changeType==="changeReplacementsToWithhold"&&Cs.replacementsToWithhold!==void 0&&(ds=Cs.replacementsToWithhold)}if(ds>0&&(ps=ps.slice(0,ps.length-ds)),!((ys=as.attributes.createComponentOfType)!=null&&ys.primitive)&&as.sharedParameters.compositesMustHaveAReplacement&&ps.length>0)return{replacements:rs,replacementChanges:ns};let fs=(bs=as.attributes.createComponentOfType)==null?void 0:bs.primitive,hs=await as.stateValues.nComponentsSpecified;if(!fs){if(fs=as.sharedParameters.compositesDefaultReplacementType,!fs)throw Error("A component class specified descendantCompositesMustHaveAReplacement but didn't specify descendantCompositesDefaultReplacementType");hs=1}if(fs=ls.componentTypeLowerCaseMapping[fs.toLowerCase()],ps.length!==hs||!ps.every(Cs=>Cs===fs)){if((rs==null?void 0:rs.length)===1&&ls.isInheritedComponentType({inheritedComponentType:rs[0].componentType,baseComponentType:"template"}))return rs[0].attributes||(rs[0].attributes={}),rs[0].attributes.createComponentOfType={primitive:fs},rs[0].attributes.nComponents={primitive:hs},{replacements:rs,replacementChanges:ns};let Cs=ps.length===hs&&!(ds>0)&&((vs=os.sourceNames)==null?void 0:vs.length)===hs,Ts;Cs&&ns&&(ns.length===1&&ns[0].numberReplacementsToReplace===hs?Ts=ns[0].serializedReplacements:Cs=!1),Cs?Ts||(Ts=rs):(os.numReplacementsBySource=[],os.numNonStringReplacementsBySource=[],os.propVariablesCopiedBySource=[],os.sourceNames=[],os.uniqueIdentifiersUsedBySource={},os.uniqueIdentifiersUsedBySource[0]=[]);let Ss=(xs=as.attributes.newNamespace)==null?void 0:xs.primitive;rs=[];for(let As=0;Astypeof As!="string").length),ns){ns=[],as.replacementsToWithhold>0&&ns.push({changeType:"changeReplacementsToWithhold",replacementsToWithhold:0});let As=0;as.replacements&&(As=as.replacements.length),ns.push({changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:0,numberReplacementsToReplace:As,serializedReplacements:rs})}}return{replacements:rs,replacementChanges:ns}}class Template extends CompositeComponent{static keepChildrenSerialized({serializedComponent:rs}){return rs.children===void 0?[]:Object.keys(rs.children)}static createAttributesObject(){let rs=super.createAttributesObject();return rs.rendered={createComponentOfType:"boolean",createStateVariable:"rendered",defaultValue:this.renderedDefault,public:!0},rs.isResponse={leaveRaw:!0},rs.createComponentOfType={createPrimitiveOfType:"string"},rs.nComponents={createPrimitiveOfType:"number"},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=this;return rs.serializedChildren={returnDependencies:()=>({serializedChildren:{dependencyType:"serializedChildren",doNotProxy:!0}}),definition:function({dependencyValues:ss}){return{setValue:{serializedChildren:ss.serializedChildren}}}},rs.newNamespace={returnDependencies:()=>({newNamespace:{dependencyType:"attributePrimitive",attributeName:"newNamespace"}}),definition({dependencyValues:ss}){return{setValue:{newNamespace:ss.newNamespace}}}},rs.readyToExpandWhenResolved={returnDependencies:()=>({}),definition:function(){return{setValue:{readyToExpandWhenResolved:!0}}}},rs.isVariantComponent={returnDependencies:()=>({}),definition:()=>({setValue:{isVariantComponent:!0}})},rs.generatedVariantInfo={returnDependencies:({sharedParameters:ss,componentInfoObjects:os})=>({variantSeed:{dependencyType:"value",value:ss.variantSeed},variantDescendants:{dependencyType:"descendant",componentTypes:Object.keys(os.componentTypesCreatingVariants),variableNames:["isVariantComponent","generatedVariantInfo"],useReplacementsForComposites:!0,recurseToMatchedChildren:!1,variablesOptional:!0,includeNonActiveChildren:!0,ignoreReplacementsOfEncounteredComposites:!0}}),definition({dependencyValues:ss,componentName:os}){let ls={seed:ss.variantSeed,meta:{createdBy:os}},us=ls.subvariants=[];for(let cs of ss.variantDescendants)cs.stateValues.isVariantComponent?us.push(cs.stateValues.generatedVariantInfo):cs.stateValues.generatedVariantInfo&&us.push(...cs.stateValues.generatedVariantInfo.subvariants);return{setValue:{generatedVariantInfo:ls}}}},rs.nComponentsSpecified={returnDependencies:()=>({nComponentsAttr:{dependencyType:"attributePrimitive",attributeName:"nComponents"},typeAttr:{dependencyType:"attributePrimitive",attributeName:"createComponentOfType"}}),definition({dependencyValues:ss,componentInfoObjects:os}){let ls;if(ss.typeAttr){if(!(os.componentTypeLowerCaseMapping[ss.typeAttr.toLowerCase()]in os.allComponentClasses))throw Error(`Invalid componentType ${ss.typeAttr} of copy.`);ss.nComponentsAttr!==null?ls=ss.nComponentsAttr:ls=1}else{if(ss.nComponentsAttr!==null)throw Error(`You must specify createComponentOfType when specifying nComponents for a ${ns.componentType}.`);ls=null}return{setValue:{nComponentsSpecified:ls}}}},rs}static async createSerializedReplacements({component:rs,componentInfoObjects:ns,alwaysCreateReplacements:ss,flags:os}){var ls;if(await rs.stateValues.nComponentsSpecified,await rs.stateValues.rendered||ss){let us=deepClone(await rs.state.serializedChildren.value),cs=(ls=rs.attributes.newNamespace)==null?void 0:ls.primitive;if("isResponse"in rs.attributes)for(let fs of us){if(typeof fs!="object")continue;let hs=convertAttributesForComponentType({attributes:{isResponse:rs.attributes.isResponse},componentType:fs.componentType,componentInfoObjects:ns,compositeCreatesNewNamespace:cs,flags:os});fs.attributes||(fs.attributes={}),Object.assign(fs.attributes,hs)}let ds=processAssignNames({assignNames:rs.doenetAttributes.assignNames,serializedComponents:us,parentName:rs.componentName,parentCreatesNewNamespace:cs,componentInfoObjects:ns,originalNamesAreConsistent:!0});return{replacements:(await verifyReplacementsMatchSpecifiedType({component:rs,replacements:ds.serializedComponents,assignNames:rs.doenetAttributes.assignNames,componentInfoObjects:ns,compositeAttributesObj:this.createAttributesObject(),flags:os})).replacements}}else return{replacements:[]}}static setUpVariant({serializedComponent:rs,sharedParameters:ns,descendantVariantComponents:ss}){setUpVariantSeedAndRng({serializedComponent:rs,sharedParameters:ns,descendantVariantComponents:ss,useSubpartVariantRng:!0})}get allPotentialRendererTypes(){let rs=super.allPotentialRendererTypes,ns=this.potentialRendererTypesFromSerializedComponents(this.serializedChildren);for(let ss of ns)rs.includes(ss)||rs.push(ss);return rs}}zs(Template,"componentType","template"),zs(Template,"treatAsComponentForRecursiveReplacements",!0),zs(Template,"includeBlankStringChildren",!0),zs(Template,"renderedDefault",!1),zs(Template,"assignNamesToReplacements",!0),zs(Template,"createsVariants",!0);const vectorAndListOperators=["list",...vectorOperators];class MathComponent extends InlineComponent{constructor(rs){super(rs),Object.assign(this.actions,{moveMath:this.moveMath.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.format={createComponentOfType:"text",createStateVariable:"format",defaultValue:"text",public:!0,toLowerCase:!0,validValues:["text","latex"]},rs.simplify={createComponentOfType:"text",createStateVariable:"simplify",defaultValue:"none",public:!0,toLowerCase:!0,valueTransformations:{"":"full",true:"full",false:"none"},validValues:["none","full","numbers","numberspreserveorder"]},rs.expand={createComponentOfType:"boolean",createStateVariable:"expand",defaultValue:!1,public:!0},rs.displayDigits={createComponentOfType:"integer"},rs.displayDecimals={createComponentOfType:"integer"},rs.displaySmallAsZero={createComponentOfType:"number",valueForTrue:1e-14,valueForFalse:0},rs.padZeros={createComponentOfType:"boolean"},rs.renderMode={createComponentOfType:"text",createStateVariable:"renderMode",defaultValue:"inline",public:!0,forRenderer:!0},rs.unordered={createComponentOfType:"boolean"},rs.createVectors={createComponentOfType:"boolean",createStateVariable:"createVectors",defaultValue:!1,public:!0},rs.createIntervals={createComponentOfType:"boolean",createStateVariable:"createIntervals",defaultValue:!1,public:!0},rs.functionSymbols={createComponentOfType:"textList",createStateVariable:"functionSymbols",defaultValue:["f","g"],public:!0},rs.sourcesAreFunctionSymbols={createComponentOfType:"textList",createStateVariable:"sourcesAreFunctionSymbols",defaultValue:[]},rs.splitSymbols={createComponentOfType:"boolean",createStateVariable:"splitSymbols",defaultValue:!0,public:!0,fallBackToParentStateVariable:"splitSymbols"},rs.parseScientificNotation={createComponentOfType:"boolean",createStateVariable:"parseScientificNotation",defaultValue:!1,public:!0,fallBackToParentStateVariable:"parseScientificNotation"},rs.groupCompositeReplacements={createPrimitiveOfType:"boolean",createStateVariable:"groupCompositeReplacements",defaultValue:!0},rs.displayBlanks={createComponentOfType:"boolean",createStateVariable:"displayBlanks",defaultValue:!0,public:!0},rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.layer={createComponentOfType:"number",createStateVariable:"layer",defaultValue:0,public:!0,forRenderer:!0},rs.anchor={createComponentOfType:"point"},rs.positionFromAnchor={createComponentOfType:"text",createStateVariable:"positionFromAnchor",defaultValue:"center",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft","top","bottom","left","right","center"]},rs.styleNumber.defaultValue=0,rs}static returnChildGroups(){return[{group:"maths",componentTypes:["math"]},{group:"strings",componentTypes:["string"]},{group:"displayedMaths",componentTypes:["m","me","men"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=returnSelectedStyleStateVariableDefinition();return Object.assign(rs,ns),rs.displayDigits={public:!0,shadowingInstructions:{createComponentOfType:"integer"},hasEssential:!0,defaultValue:10,returnDependencies:()=>({mathListParentDisplayDigits:{dependencyType:"parentStateVariable",parentComponentType:"mathList",variableName:"displayDigits"},numberListParentDisplayDigits:{dependencyType:"parentStateVariable",parentComponentType:"numberList",variableName:"displayDigits"},mathListParentDisplayDecimals:{dependencyType:"parentStateVariable",parentComponentType:"mathList",variableName:"displayDecimals"},numberListParentDisplayDecimals:{dependencyType:"parentStateVariable",parentComponentType:"numberList",variableName:"displayDecimals"},displayDigitsAttr:{dependencyType:"attributeComponent",attributeName:"displayDigits",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]},mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["displayDigits"]},stringChildren:{dependencyType:"child",childGroups:["strings"]}}),definition({dependencyValues:ss,usedDefault:os}){let ls=!1,us;if(ss.mathListParentDisplayDigits!==null)if(os.mathListParentDisplayDigits)ls=!0,us=ss.mathListParentDisplayDigits;else return{setValue:{displayDigits:ss.mathListParentDisplayDigits}};if(ss.numberListParentDisplayDigits!==null)if(os.numberListParentDisplayDigits)ls=!0,us=ss.numberListParentDisplayDigits;else return{setValue:{displayDigits:ss.numberListParentDisplayDigits}};let cs=ss.numberListParentDisplayDecimals!==null&&!os.numberListParentDisplayDecimals||ss.mathListParentDisplayDecimals!==null&&!os.mathListParentDisplayDecimals,ds=ss.displayDigitsAttr===null||os.displayDigitsAttr,ps=ss.displayDecimalsAttr===null||os.displayDecimalsAttr;if(!(ds||ps)){let fs=ss.displayDigitsAttr.shadowDepth;ss.displayDecimalsAttr.shadowDepth({mathListParentDisplayDecimals:{dependencyType:"parentStateVariable",parentComponentType:"mathList",variableName:"displayDecimals"},numberListParentDisplayDecimals:{dependencyType:"parentStateVariable",parentComponentType:"numberList",variableName:"displayDecimals"},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]},mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["displayDecimals"]},stringChildren:{dependencyType:"child",childGroups:["strings"]}}),definition({dependencyValues:ss,usedDefault:os}){let ls=!1,us;if(ss.mathListParentDisplayDecimals!==null)if(os.mathListParentDisplayDecimals)ls=!0,us=ss.mathListParentDisplayDecimals;else return{setValue:{displayDecimals:ss.mathListParentDisplayDecimals}};if(ss.numberListParentDisplayDecimals!==null)if(os.numberListParentDisplayDecimals)ls=!0,us=ss.numberListParentDisplayDecimals;else return{setValue:{displayDecimals:ss.numberListParentDisplayDecimals}};if(ss.displayDecimalsAttr!==null)if(os.displayDecimalsAttr)ls=!0,us=ss.displayDecimalsAttr.stateValues.value;else return{setValue:{displayDecimals:ss.displayDecimalsAttr.stateValues.value}};if(ss.mathChildren.length===1&&ss.stringChildren.length===0)if(os.mathChildren[0]&&os.mathChildren[0].displayDecimals)ls=!0,us=ss.mathChildren[0].stateValues.displayDecimals;else return{setValue:{displayDecimals:ss.mathChildren[0].stateValues.displayDecimals}};return ls?{useEssentialOrDefaultValue:{displayDecimals:{defaultValue:us}}}:{useEssentialOrDefaultValue:{displayDecimals:!0}}}},rs.displaySmallAsZero={public:!0,shadowingInstructions:{createComponentOfType:"number"},hasEssential:!0,defaultValue:0,returnDependencies:()=>({mathListParentDisplaySmallAsZero:{dependencyType:"parentStateVariable",parentComponentType:"mathList",variableName:"displaySmallAsZero"},numberListParentDisplaySmallAsZero:{dependencyType:"parentStateVariable",parentComponentType:"numberList",variableName:"displaySmallAsZero"},displaySmallAsZeroAttr:{dependencyType:"attributeComponent",attributeName:"displaySmallAsZero",variableNames:["value"]},mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["displaySmallAsZero"]},stringChildren:{dependencyType:"child",childGroups:["strings"]}}),definition({dependencyValues:ss,usedDefault:os}){let ls=!1,us;if(ss.mathListParentDisplaySmallAsZero!==null)if(os.mathListParentDisplaySmallAsZero)ls=!0,us=ss.mathListParentDisplaySmallAsZero;else return{setValue:{displaySmallAsZero:ss.mathListParentDisplaySmallAsZero}};if(ss.numberListParentDisplaySmallAsZero!==null)if(os.numberListParentDisplaySmallAsZero)ls=!0,us=ss.numberListParentDisplaySmallAsZero;else return{setValue:{displaySmallAsZero:ss.numberListParentDisplaySmallAsZero}};if(ss.displaySmallAsZeroAttr!==null)if(os.displaySmallAsZeroAttr)ls=!0,us=ss.displaySmallAsZeroAttr.stateValues.value;else return{setValue:{displaySmallAsZero:ss.displaySmallAsZeroAttr.stateValues.value}};if(ss.mathChildren.length===1&&ss.stringChildren.length===0)if(os.mathChildren[0]&&os.mathChildren[0].displaySmallAsZero)ls=!0,us=ss.mathChildren[0].stateValues.displaySmallAsZero;else return{setValue:{displaySmallAsZero:ss.mathChildren[0].stateValues.displaySmallAsZero}};return ls?{useEssentialOrDefaultValue:{displaySmallAsZero:{defaultValue:us}}}:{useEssentialOrDefaultValue:{displaySmallAsZero:!0}}}},rs.padZeros={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},hasEssential:!0,defaultValue:!1,returnDependencies:()=>({mathListParentPadZeros:{dependencyType:"parentStateVariable",parentComponentType:"mathList",variableName:"padZeros"},numberListParentPadZeros:{dependencyType:"parentStateVariable",parentComponentType:"numberList",variableName:"padZeros"},padZerosAttr:{dependencyType:"attributeComponent",attributeName:"padZeros",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]},mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["padZeros"]},stringChildren:{dependencyType:"child",childGroups:["strings"]}}),definition({dependencyValues:ss,usedDefault:os}){let ls=!1,us;if(ss.mathListParentPadZeros!==null)if(os.mathListParentPadZeros)ls=!0,us=ss.mathListParentPadZeros;else return{setValue:{padZeros:ss.mathListParentPadZeros}};if(ss.numberListParentPadZeros!==null)if(os.numberListParentPadZeros)ls=!0,us=ss.numberListParentPadZeros;else return{setValue:{padZeros:ss.numberListParentPadZeros}};if(ss.padZerosAttr!==null)if(os.padZerosAttr)ls=!0,us=ss.padZerosAttr.stateValues.value;else return{setValue:{padZeros:ss.padZerosAttr.stateValues.value}};if(ss.mathChildren.length===1&&ss.stringChildren.length==0)if(os.mathChildren[0]&&os.mathChildren[0].padZeros)ls=!0,us=ss.mathChildren[0].stateValues.padZeros;else return{setValue:{padZeros:ss.mathChildren[0].stateValues.padZeros}};return ls?{useEssentialOrDefaultValue:{padZeros:{defaultValue:us}}}:{useEssentialOrDefaultValue:{padZeros:!0}}}},rs.valueShadow={defaultValue:Context.fromAst("_"),hasEssential:!0,essentialVarName:"value",returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{valueShadow:!0}}),inverseDefinition:function({desiredStateVariableValues:ss}){return{success:!0,instructions:[{setEssentialValue:"valueShadow",value:ss.valueShadow}]}}},rs.unordered={defaultValue:!1,public:!0,shadowingInstructions:{createComponentOfType:"boolean"},hasEssential:!0,returnDependencies:()=>({unorderedAttr:{dependencyType:"attributeComponent",attributeName:"unordered",variableNames:["value"]},mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["unordered"]}}),definition({dependencyValues:ss}){return ss.unorderedAttr===null?ss.mathChildren.length>0?{setValue:{unordered:ss.mathChildren.every(ls=>ls.stateValues.unordered)}}:{useEssentialOrDefaultValue:{unordered:!0}}:{setValue:{unordered:ss.unorderedAttr.stateValues.value}}}},rs.codePre={returnDependencies:()=>({stringChildren:{dependencyType:"child",childGroups:["strings"]}}),definition({dependencyValues:ss}){let os="math",ls=!1;do{ls=!1;for(let us of ss.stringChildren)if(us.includes(os)===!0){ls=!0,os+="m";break}}while(ls);return{setValue:{codePre:os}}}},rs.mathChildrenFunctionSymbols={returnDependencies:()=>({sourcesAreFunctionSymbols:{dependencyType:"stateVariable",variableName:"sourcesAreFunctionSymbols"},mathChildren:{dependencyType:"child",childGroups:["maths"]}}),definition({dependencyValues:ss}){let os=[];if(ss.mathChildren.compositeReplacementRange){for(let ls of ss.mathChildren.compositeReplacementRange)if(ss.sourcesAreFunctionSymbols.includes(ls.target))for(let us=ls.firstInd;us<=ls.lastInd;us++)os.push(us)}return{setValue:{mathChildrenFunctionSymbols:os}}}},rs.expressionWithCodes={hasEssential:!0,doNotShadowEssential:!0,returnDependencies:()=>({stringMathChildren:{dependencyType:"child",childGroups:["strings","maths"]},stringChildren:{dependencyType:"child",childGroups:["strings"]},mathChildren:{dependencyType:"child",childGroups:["maths"]},displayedMathChildren:{dependencyType:"child",childGroups:["displayedMaths"],variableNames:["latex"]},format:{dependencyType:"stateVariable",variableName:"format"},codePre:{dependencyType:"stateVariable",variableName:"codePre"},functionSymbols:{dependencyType:"stateVariable",variableName:"functionSymbols"},mathChildrenFunctionSymbols:{dependencyType:"stateVariable",variableName:"mathChildrenFunctionSymbols"},splitSymbols:{dependencyType:"stateVariable",variableName:"splitSymbols"},parseScientificNotation:{dependencyType:"stateVariable",variableName:"parseScientificNotation"},groupCompositeReplacements:{dependencyType:"stateVariable",variableName:"groupCompositeReplacements"}}),set:ss=>ss===null?null:convertValueToMathExpression(ss),definition:calculateExpressionWithCodes,async inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os,stateValues:ls}){let us=ss.expressionWithCodes,cs=[{setEssentialValue:"expressionWithCodes",value:us}],ds=os.stringChildren.length;if(ds===0)return{success:!1};if(os.mathChildren.length===0){let ps;await ls.format==="latex"?ps=us.toLatex():ps=us.toString(),cs.push({setDependency:"stringChildren",desiredValue:ps,childIndex:0,variableIndex:0,ignoreChildChangeForComponent:!0});for(let fs=1;fs({mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["value","canBeModified"]}}),definition:({dependencyValues:ss})=>({setValue:{mathChildrenWithCanBeModified:ss.mathChildren}})},rs.unnormalizedValue={returnDependencies:()=>({mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["value"]},stringChildren:{dependencyType:"child",childGroups:["strings"],variableNames:["value"]},expressionWithCodes:{dependencyType:"stateVariable",variableName:"expressionWithCodes"},codePre:{dependencyType:"stateVariable",variableName:"codePre"},valueShadow:{dependencyType:"stateVariable",variableName:"valueShadow"}}),set:convertValueToMathExpression,defaultValue:Context.fromAst("_"),definition:calculateMathValue,inverseDefinition:invertMath},rs.value={public:!0,shadowingInstructions:{createComponentOfType:this.componentType,attributesToShadow:["unordered","displayDigits","displayDecimals","displaySmallAsZero","padZeros","simplify","expand"],addAttributeComponentsShadowingStateVariables:{fixed:{stateVariableToShadow:"fixed"}}},returnDependencies:()=>({unnormalizedValue:{dependencyType:"stateVariable",variableName:"unnormalizedValue"},simplify:{dependencyType:"stateVariable",variableName:"simplify"},expand:{dependencyType:"stateVariable",variableName:"expand"},createVectors:{dependencyType:"stateVariable",variableName:"createVectors"},createIntervals:{dependencyType:"stateVariable",variableName:"createIntervals"}}),definition:function({dependencyValues:ss}){let os=ss.unnormalizedValue,{simplify:ls,expand:us,createVectors:cs,createIntervals:ds}=ss;return os=normalizeMathExpression({value:os,simplify:ls,expand:us,createVectors:cs,createIntervals:ds}),{setValue:{value:os}}},inverseDefinition:function({desiredStateVariableValues:ss}){return{success:!0,instructions:[{setDependency:"unnormalizedValue",desiredValue:ss.value}]}}},rs.number={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition:function({dependencyValues:ss}){return{setValue:{number:ss.value.evaluate_to_constant()}}},inverseDefinition:function({desiredStateVariableValues:ss}){return{success:!0,instructions:[{setDependency:"value",desiredValue:Context.fromAst(ss.number)}]}}},rs.isNumber={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition:function({dependencyValues:ss}){return{setValue:{isNumber:Number.isFinite(ss.value.tree)}}}},rs.isNumeric={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},returnDependencies:()=>({number:{dependencyType:"stateVariable",variableName:"number"}}),definition:function({dependencyValues:ss}){return{setValue:{isNumeric:Number.isFinite(ss.number)}}}},rs.valueForDisplay={returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"},simplify:{dependencyType:"stateVariable",variableName:"simplify"},expand:{dependencyType:"stateVariable",variableName:"expand"}}),definition:function({dependencyValues:ss,usedDefault:os}){let ls=roundForDisplay({value:ss.value,dependencyValues:ss,usedDefault:os});return{setValue:{valueForDisplay:normalizeMathExpression({value:ls,simplify:ss.simplify,expand:ss.expand})}}},inverseDefinition({desiredStateVariableValues:ss}){return{success:!0,instructions:[{setDependency:"value",desiredValue:ss.valueForDisplay}]}}},rs.latex={public:!0,forRenderer:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({valueForDisplay:{dependencyType:"stateVariable",variableName:"valueForDisplay"},padZeros:{dependencyType:"stateVariable",variableName:"padZeros"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displayBlanks:{dependencyType:"stateVariable",variableName:"displayBlanks"}}),definition:function({dependencyValues:ss,usedDefault:os}){let ls,us={};ss.padZeros&&(os.displayDigits&&!os.displayDecimals?Number.isFinite(ss.displayDecimals)&&(us.padToDecimals=ss.displayDecimals):ss.displayDigits>=1&&(us.padToDigits=ss.displayDigits)),ss.displayBlanks||(us.showBlanks=!1);try{ls=ss.valueForDisplay.toLatex(us)}catch{ss.displayBlanks?ls="_":ls=""}return{setValue:{latex:ls}}},inverseDefinition({desiredStateVariableValues:ss}){let os;try{os=Context.fromLatex(ss.latex)}catch{return{success:!1}}return{success:!0,instructions:[{setDependency:"valueForDisplay",desiredValue:os}]}}},rs.latexWithInputChildren={forRenderer:!0,returnDependencies:()=>({latex:{dependencyType:"stateVariable",variableName:"latex"}}),definition:function({dependencyValues:ss}){return{setValue:{latexWithInputChildren:[ss.latex]}}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({valueForDisplay:{dependencyType:"stateVariable",variableName:"valueForDisplay"},padZeros:{dependencyType:"stateVariable",variableName:"padZeros"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},value:{dependencyType:"stateVariable",variableName:"value"},displayBlanks:{dependencyType:"stateVariable",variableName:"displayBlanks"}}),definition:function({dependencyValues:ss,usedDefault:os}){let ls,us={};ss.padZeros&&(os.displayDigits&&!os.displayDecimals?Number.isFinite(ss.displayDecimals)&&(us.padToDecimals=ss.displayDecimals):ss.displayDigits>=1&&(us.padToDigits=ss.displayDigits)),ss.displayBlanks||(us.showBlanks=!1);try{ls=ss.valueForDisplay.toString(us)}catch{ss.displayBlanks?ls="_":ls=""}return{setValue:{text:superSubscriptsToUnicode(ls.toString())}}},async inverseDefinition({desiredStateVariableValues:ss,stateValues:os}){let ls=getFromText({functionSymbols:await os.functionSymbols,splitSymbols:await os.splitSymbols,parseScientificNotation:await os.parseScientificNotation}),us;try{us=ls(unicodeToSuperSubscripts(ss.text))}catch{return{success:!1}}return{success:!0,instructions:[{setDependency:"value",desiredValue:us}]}}},rs.codesAdjacentToStrings={returnDependencies:()=>({stringMathChildren:{dependencyType:"child",childGroups:["strings","maths"]},codePre:{dependencyType:"stateVariable",variableName:"codePre"},format:{dependencyType:"stateVariable",variableName:"format"}}),definition:calculateCodesAdjacentToStrings},rs.canBeModified={additionalStateVariablesDefined:["constantChildIndices","codeForExpression","inverseMaps","template","mathChildrenMapped"],returnDependencies:()=>({mathChildrenModifiable:{dependencyType:"child",childGroups:["maths"],variableNames:["canBeModified"]},displayedMathChildren:{dependencyType:"child",childGroups:["displayedMaths"]},expressionWithCodes:{dependencyType:"stateVariable",variableName:"expressionWithCodes"},modifyIndirectly:{dependencyType:"stateVariable",variableName:"modifyIndirectly"},fixed:{dependencyType:"stateVariable",variableName:"fixed"},codePre:{dependencyType:"stateVariable",variableName:"codePre"}}),definition:determineCanBeModified},rs.mathChildrenByVectorComponent={returnDependencies:()=>({codePre:{dependencyType:"stateVariable",variableName:"codePre"},mathChildren:{dependencyType:"child",childGroups:["maths"]},expressionWithCodes:{dependencyType:"stateVariable",variableName:"expressionWithCodes"}}),definition:function({dependencyValues:ss}){if(ss.expressionWithCodes===null)return{setValue:{mathChildrenByVectorComponent:null}};let os=ss.expressionWithCodes.tree,ls=ss.mathChildren.length;if(ls===0||!Array.isArray(os)||!vectorOperators.includes(os[0]))return{setValue:{mathChildrenByVectorComponent:null}};let us={},cs=0,ds=ss.codePre+cs;for(let ps=1;ps=ls)break}return{setValue:{mathChildrenByVectorComponent:us}}}},rs.nDimensions={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition({dependencyValues:ss}){let os=1,ls=ss.value.tree;if(Array.isArray(ls))if(vectorAndListOperators.includes(ls[0]))os=ls.length-1;else if(ls[0]==="matrix"){let us=ls[1].slice(1);us[0]===1?os=us[1]:us[1]===1&&(os=us[0])}else vectorOperators.includes(ls[1][0])&&(ls[0]==="^"&&ls[2]==="T"||ls[0]==="prime")&&(os=ls[1].length-1);return{setValue:{nDimensions:os}}}},rs.vector={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"],returnWrappingComponents(ss){return ss==="x"?[]:[["vector",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,entryPrefixes:["x"],returnArraySizeDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ss}){return[ss.nDimensions]},returnArrayDependenciesByKey(){return{globalDependencies:{value:{dependencyType:"stateVariable",variableName:"value"}}}},arrayDefinitionByKey({globalDependencyValues:ss,arraySize:os}){let ls=ss.value.tree,us=!1,cs={};if(Array.isArray(ls)){if(vectorAndListOperators.includes(ls[0])){for(let ds=0;dshs.tree)]);else if(ps[0]==="matrix"){let hs=ps[1].slice(1);if(hs[0]===1){let gs=["tuple"];for(let ys=0;yshs.tree)]],ps[2]&&ds.push(ps[2]),ds=Context.fromAst(ds));return ds||(ds=us.desiredVector[0]),{success:!0,instructions:[{setDependency:"value",desiredValue:ds}]}}},rs.x={isAlias:!0,targetVariableName:"x1"},rs.y={isAlias:!0,targetVariableName:"x2"},rs.z={isAlias:!0,targetVariableName:"x3"},rs.matrixSize={public:!0,shadowingInstructions:{createComponentOfType:"numberList"},returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition({dependencyValues:ss}){let os=[1,1],ls=ss.value.tree;return Array.isArray(ls)&&(vectorAndListOperators.includes(ls[0])?os=[ls.length-1,1]:ls[0]==="matrix"?os=ls[1].slice(1):vectorOperators.includes(ls[1][0])&&(ls[0]==="^"&&ls[2]==="T"||ls[0]==="prime")&&(os=[1,ls[1].length-1])),{setValue:{matrixSize:os}}}},rs.nRows={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({matrixSize:{dependencyType:"stateVariable",variableName:"matrixSize"}}),definition({dependencyValues:ss}){return{setValue:{nRows:ss.matrixSize[0]}}}},rs.nColumns={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({matrixSize:{dependencyType:"stateVariable",variableName:"matrixSize"}}),definition({dependencyValues:ss}){return{setValue:{nColumns:ss.matrixSize[1]}}}},rs.matrix={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"],returnWrappingComponents(ss){return ss==="matrixEntry"?[]:ss==="row"?[["matrix","matrixRow"]]:ss==="column"?[["matrix","matrixColumn"]]:[["matrixRow"],["matrix"]]}},isArray:!0,nDimensions:2,entryPrefixes:["matrixEntry","row","column","rows","columns"],getArrayKeysFromVarName({arrayEntryPrefix:ss,varEnding:os,arraySize:ls}){if(ss==="matrixEntry"){let us=os.split("_").map(cs=>Number(cs)-1);return us.length===2&&us.every(cs=>Number.isInteger(cs)&&cs>=0)?ls?us.every((cs,ds)=>cs=0?ls?usus+","+ds):[]:[us+",0"]:[]}else if(ss==="column"){let us=Number(os)-1;return Number.isInteger(us)&&us>=0?ls?usds+","+us):[]:["0,"+us]:[]}else if(ss==="rows"||ss==="columns"){if(!ls)return["0,0"];let us=[];for(let cs=0;cscs+","+ps));return us}},arrayVarNameFromPropIndex(ss,os){if(os==="matrix"||os==="rows")return ss.length===1?"row"+ss[0]:`matrixEntry${ss[0]}_${ss[1]}`;if(os==="columns")return ss.length===1?"column"+ss[0]:`matrixEntry${ss[1]}_${ss[0]}`;if(os.slice(0,3)==="row"){let ls=Number(os.slice(3));if(Number.isInteger(ls)&&ls>0)return`matrixEntry${ls}_${ss[0]}`}if(os.slice(0,6)==="column"){let ls=Number(os.slice(6));if(Number.isInteger(ls)&&ls>0)return`matrixEntry${ss[0]}_${ls}`}return null},returnArraySizeDependencies:()=>({matrixSize:{dependencyType:"stateVariable",variableName:"matrixSize"}}),returnArraySize({dependencyValues:ss}){return ss.matrixSize},returnArrayDependenciesByKey(){return{globalDependencies:{value:{dependencyType:"stateVariable",variableName:"value"}}}},arrayDefinitionByKey({globalDependencyValues:ss,arraySize:os}){let ls=ss.value.tree,us=!1,cs={};if(Array.isArray(ls)){if(vectorAndListOperators.includes(ls[0])){for(let ds=0;ds({anchorAttr:{dependencyType:"attributeComponent",attributeName:"anchor",variableNames:["coords"]}}),definition({dependencyValues:ss}){return ss.anchorAttr?{setValue:{anchor:ss.anchorAttr.stateValues.coords}}:{useEssentialOrDefaultValue:{anchor:!0}}},async inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os,stateValues:ls,initialChange:us}){return us&&!await ls.draggable?{success:!1}:os.anchorAttr?{success:!0,instructions:[{setDependency:"anchorAttr",desiredValue:ss.anchor,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"anchor",value:ss.anchor}]}}},rs}async moveMath({x:rs,y:ns,z:ss,transient:os,actionId:ls,sourceInformation:us={},skipRendererUpdate:cs=!1}){let ds=["vector"];return rs!==void 0&&(ds[1]=rs),ns!==void 0&&(ds[2]=ns),ss!==void 0&&(ds[3]=ss),os?await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],transient:os,actionId:ls,sourceInformation:us,skipRendererUpdate:cs}):await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],actionId:ls,sourceInformation:us,skipRendererUpdate:cs,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{x:rs,y:ns,z:ss}}})}}zs(MathComponent,"componentType","math"),zs(MathComponent,"primaryStateVariableForDefinition","unnormalizedValue"),zs(MathComponent,"primaryEssentialStateVariable","value"),zs(MathComponent,"variableForPlainMacro","value"),zs(MathComponent,"descendantCompositesMustHaveAReplacement",!0),zs(MathComponent,"descendantCompositesDefaultReplacementType","math"),zs(MathComponent,"adapters",[{stateVariable:"number",stateVariablesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},"text",{componentType:"subsetOfReals",stateVariable:"value",substituteForPrimaryStateVariable:"subsetValue"}]);function calculateExpressionWithCodes({dependencyValues:as,changes:rs}){if(!("stringMathChildren"in rs&&rs.stringMathChildren.componentIdentitiesChanged||"displayedMathChildren"in rs||"format"in rs||"splitSymbols"in rs||"parseScientificNotation"in rs||"functionSymbols"in rs||"mathChildrenFunctionSymbols"in rs))return{useEssentialOrDefaultValue:{expressionWithCodes:!0}};if(as.stringMathChildren.length===0)if(as.displayedMathChildren.length>0){let gs;try{gs=Context.fromLatex(as.displayedMathChildren[0].stateValues.latex)}catch{gs=Context.fromAst("_")}return{setValue:{expressionWithCodes:gs},setEssentialValue:{expressionWithCodes:gs}}}else return{setValue:{expressionWithCodes:null},setEssentialValue:{expressionWithCodes:null}};let ns="",ss=0,os="",ls=as.stringMathChildren.compositeReplacementRange,us,cs,ds,ps;as.groupCompositeReplacements&&ls.length>0&&(ds=0,ps=ls[ds].firstInd);for(let[gs,ys]of as.stringMathChildren.entries()){if(us===void 0&&gs===ps){us=ds,cs=ls[ds].lastInd,os="";let bs=cs===gs;if(!bs){for(let vs=gs;vs<=cs;vs++)if(typeof as.stringMathChildren[vs]=="string"){bs=!0;break}}bs&&(ls.length>us+1?(ds=us+1,ps=ls[ds].firstInd):(ds=void 0,ps=void 0),us=void 0,cs=void 0)}if(typeof ys=="string")ns+=" "+ys+" ";else{let bs=as.codePre+ss;ss++;let vs;as.format==="latex"?vs="\\operatorname{"+bs+"}":vs=" "+bs+" ",us!==void 0?(os&&(os+=","),os+=vs):ns+=vs}if(gs===cs){let bs=ns.trimEnd(),vs=!1;if(bs.length===0)vs=!0;else{let xs=bs[bs.length-1];if(!["{","[","(","|",","].includes(xs))vs=!0;else{let Cs=as.stringMathChildren[gs+1];if(typeof Cs!="string")vs=!0;else{let Ts=Cs.trimStart();if(Ts.length===0)vs=!0;else{let Ss=Ts[0];as.format==="latex"&&Ss==="\\"&&Ts.length>1&&(Ss=Ts[1]),["}","]",")","|",","].includes(Ss)||(vs=!0)}}}}vs&&(os="("+os+")"),ns+=os,os="",ls.length>us+1?(ds=us+1,ps=ls[ds].firstInd):(ds=void 0,ps=void 0),us=void 0,cs=void 0}}let fs=null,hs=[...as.functionSymbols];if(hs.push(...as.mathChildrenFunctionSymbols.map(gs=>as.codePre+gs)),ns==="")fs=Context.fromAst("_");else if(as.format==="text"){let gs=getFromText({functionSymbols:hs,splitSymbols:as.splitSymbols,parseScientificNotation:as.parseScientificNotation});try{fs=gs(ns)}catch{fs=Context.fromAst("_"),console.log("Invalid value for a math of text format: "+ns)}}else if(as.format==="latex"){let gs=getFromLatex({functionSymbols:hs,splitSymbols:as.splitSymbols,parseScientificNotation:as.parseScientificNotation});try{fs=gs(ns)}catch{fs=Context.fromAst("_"),console.log("Invalid value for a math of latex format: "+ns)}}return{setValue:{expressionWithCodes:fs},setEssentialValue:{expressionWithCodes:fs}}}function calculateMathValue({dependencyValues:as}={}){if(as.expressionWithCodes===null)return{setValue:{unnormalizedValue:as.valueShadow}};let rs={};for(let[ss,os]of as.mathChildren.entries())rs[as.codePre+ss]=os.stateValues.value;let ns=as.expressionWithCodes;return as.mathChildren.length>0&&(ns=ns.substitute(rs)),ns=Context.fromAst(mergeListsWithOtherContainers(ns.tree)),{setValue:{unnormalizedValue:ns}}}function calculateCodesAdjacentToStrings({dependencyValues:as}){let rs=[],ns;for(let[ss,os]of as.stringMathChildren.entries())if(typeof os=="string"){let ls=as.stringMathChildren[ss+1];if(ls!==void 0&&typeof ls=="string")continue;let us={};if(ns!==void 0&&(as.format==="latex"?us.prevCode="\\operatorname{"+as.codePre+ns+"}":us.prevCode=as.codePre+ns),ls!==void 0){let cs=0;ns!==void 0&&(cs=ns+1),as.format==="latex"?us.nextCode="\\operatorname{"+as.codePre+cs+"}":us.nextCode=as.codePre+cs}rs.push(us)}else ns===void 0?ns=0:ns++;return{setValue:{codesAdjacentToStrings:rs}}}function determineCanBeModified({dependencyValues:as}){if(!as.modifyIndirectly||as.fixed)return{setValue:{canBeModified:!1,constantChildIndices:null,codeForExpression:null,inverseMaps:null,template:null,mathChildrenMapped:null}};if(as.mathChildrenModifiable.length===0)return as.displayedMathChildren.length>0?{setValue:{canBeModified:!1,constantChildIndices:null,codeForExpression:null,inverseMaps:null,template:null,mathChildrenMapped:null}}:{setValue:{canBeModified:!0,constantChildIndices:null,codeForExpression:null,inverseMaps:null,template:null,mathChildrenMapped:null}};let rs=[],ns=[],ss=[],os={};for(let[ds,ps]of as.mathChildrenModifiable.entries()){let fs=as.codePre+ds;ps.stateValues.canBeModified===!0?(rs.push(ds),ns.push(fs)):(ss.push(fs),os[fs]=ds)}let ls=as.codePre+"expr",us=Context.utils.unflattenLeft(as.expressionWithCodes.tree),cs=checkForLinearExpression(us,ns,ls,ss);if(cs.foundLinear){let ds={},ps=cs.template,fs=new Set;for(let hs in cs.mappings){ds[hs]=cs.mappings[hs];let gs=ds[hs].mathChildSub;if(gs){let ys=rs[ns.indexOf(gs)];ds[hs].mathChildInd=ys,fs.add(Number(ys))}}return fs.has=fs.has.bind(fs),{setValue:{canBeModified:!0,constantChildIndices:os,codeForExpression:ls,inverseMaps:ds,template:ps,mathChildrenMapped:fs}}}return{setValue:{canBeModified:!1,constantChildIndices:null,codeForExpression:null,inverseMaps:null,template:null,mathChildrenMapped:null}}}function checkForLinearExpression(as,rs,ns,ss=[],os=[]){let ls=Context.variables(as);if(ls.every(ds=>!rs.includes(ds))&&ls.every(ds=>!ss.includes(ds))){let ds={},ps="x"+os.join("_");return ds[ps]={result:Context.fromAst(ns).simplify(),components:os},{foundLinear:!0,mappings:ds,template:ps}}if(!Array.isArray(as))return checkForScalarLinearExpression(as,rs,ns,os);let us=as[0],cs=as.slice(1);if(vectorAndListOperators.includes(us)){let ds={mappings:{},template:[us]},ps=0;for(let fs=0;fs!rs.includes(us))?(ns=["+",ns,["-",ls[0]]],checkForScalarLinearExpression(ls[1],rs,ns,ss)):Context.variables(ls[1]).every(us=>!rs.includes(us))?(ns=["+",ns,["-",ls[1]]],checkForScalarLinearExpression(ls[0],rs,ns,ss)):{foundLinear:!1}:os==="*"?Context.variables(ls[0]).every(us=>!rs.includes(us))?(ns=["/",ns,ls[0]],checkForScalarLinearExpression(ls[1],rs,ns,ss)):Context.variables(ls[1]).every(us=>!rs.includes(us))?(ns=["/",ns,ls[1]],checkForScalarLinearExpression(ls[0],rs,ns,ss)):{foundLinear:!1}:os==="/"?Context.variables(ls[1]).every(us=>!rs.includes(us))?(ns=["*",ns,ls[1]],checkForScalarLinearExpression(ls[0],rs,ns,ss)):{foundLinear:!1}:{foundLinear:!1}}async function invertMath({desiredStateVariableValues:as,dependencyValues:rs,stateValues:ns,workspace:ss,overrideFixed:os}){if(!await ns.canBeModified&&!os)return{success:!1};let ls=rs.mathChildren,us=rs.stringChildren.length;if(ls.length===1&&us===0)return{success:!0,instructions:[{setDependency:"mathChildren",desiredValue:as.unnormalizedValue,childIndex:0,variableIndex:0}]};let cs=convertValueToMathExpression(as.unnormalizedValue),ds=await preprocessMathInverseDefinition({desiredValue:cs,stateValues:ns,variableName:"value",workspace:ss}),ps=ds.vectorComponentsNotAffected;if(cs=ds.desiredValue,ls.length===0){let bs=[];return us>0?bs.push({setDependency:"expressionWithCodes",desiredValue:cs}):bs.push({setDependency:"valueShadow",desiredValue:cs}),{success:!0,instructions:bs}}let fs=await getExpressionPieces({expression:cs,stateValues:ns});if(!fs)return{success:!1};let hs=[],gs=[];if(ps&&await ns.mathChildrenByVectorComponent){let bs=await ns.mathChildrenByVectorComponent;for(let vs of ps)bs[vs]&&gs.push(...bs[vs])}let ys=await ns.mathChildrenWithCanBeModified;for(let[bs,vs]of ls.entries())if(ns.mathChildrenMapped.has(bs)&&ys[bs].stateValues.canBeModified){if(!gs.includes(bs)){let xs=fs[bs],Cs={},Ts=!1,Ss=await ns.constantChildIndices;for(let Ns in Ss){let As=Ss[Ns];Cs[Ns]=ls[As].stateValues.value,Ts=!0}Ts&&(xs=xs.substitute(Cs)),xs=xs.simplify(),hs.push({setDependency:"mathChildren",desiredValue:xs,childIndex:bs,variableIndex:0})}delete fs[bs]}if(us>0){let Cs=function(Ss){return typeof Ss=="string"&&Ss.substring(0,xs)===vs},Ts=function(Ss){return Array.isArray(Ss)?flattenDeep(Ss.slice(1)).some(Cs):Cs(Ss)},bs=rs.expressionWithCodes,vs=rs.codePre,xs=vs.length;if(vectorAndListOperators.includes(bs.tree[0])&&!bs.tree.slice(1).every(Ts)){let Ss=await ns.inverseMaps;for(let Ns in fs){let As=Ss[Ns];if(As.mathChildInd!==void 0)continue;let ws=As.components;bs=bs.substitute_component(ws,fs[Ns])}hs.push({setDependency:"expressionWithCodes",desiredValue:bs})}}return{success:!0,instructions:hs}}async function getExpressionPieces({expression:as,stateValues:rs}){let ns=await rs.template,ss=Context.utils.match(as.tree,ns);if(!ss&&(ss=Context.utils.match(as.tuples_to_vectors().tree,Context.fromAst(ns).tuples_to_vectors().tree),!ss&&(ss=Context.utils.match(as.to_intervals().tree,Context.fromAst(ns).to_intervals().tree),!ss&&(ss=Context.utils.match(as.tuples_to_vectors().to_intervals().tree,Context.fromAst(ns).tuples_to_vectors().to_intervals().tree),!ss))))return!1;let os={};for(let ls in ss){let us={};us[await rs.codeForExpression]=ss[ls];let cs=(await rs.inverseMaps)[ls];if(cs!==void 0){let ds=ls;cs.mathChildInd!==void 0&&(ds=cs.mathChildInd),os[ds]=cs.result.substitute(us),os[ds]=normalizeMathExpression({value:os[ds],simplify:await rs.simplify,expand:await rs.expand,createVectors:await rs.createVectors,createIntervals:await rs.createIntervals})}}return os}var Vu;let Label$1=(Vu=class extends InlineComponent{constructor(rs){super(rs),Object.assign(this.actions,{moveLabel:this.moveLabel.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.forObject={createTargetComponentNames:!0},rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.layer={createComponentOfType:"number",createStateVariable:"layer",defaultValue:0,public:!0,forRenderer:!0},rs.anchor={createComponentOfType:"point"},rs.positionFromAnchor={createComponentOfType:"text",createStateVariable:"positionFromAnchor",defaultValue:"center",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft","top","bottom","left","right","center"]},rs.styleNumber.defaultValue=0,rs}static returnChildGroups(){return[{group:"inlines",componentTypes:["_inline"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=returnSelectedStyleStateVariableDefinition();return Object.assign(rs,ns),rs.valueShadow={hasEssential:!0,defaultValue:null,returnDependencies:()=>({}),definition(){return{useEssentialOrDefaultValue:{valueShadow:!0}}},inverseDefinition({desiredStateVariableValues:ss}){return{success:!0,instructions:[{setEssentialValue:"valueShadow",value:ss.valueShadow}]}}},rs.hasLatex={public:!0,forRenderer:!0,shadowingInstructions:{createComponentOfType:"boolean"},returnDependencies:()=>({inlineChildren:{dependencyType:"child",childGroups:["inlines"],variableNames:["text","latex","value","hasLatex","renderAsMath"],variablesOptional:!0},valueShadow:{dependencyType:"stateVariable",variableName:"valueShadow"}}),definition:function({dependencyValues:ss}){if(ss.inlineChildren.length===0&&ss.valueShadow!==null){let ls=ss.valueShadow;return{setValue:{hasLatex:!!/\\\(.*\\\)/.exec(ls)}}}let os=!1;for(let ls of ss.inlineChildren)if(typeof ls=="object"){if(typeof ls.stateValues.hasLatex=="boolean"&&typeof ls.stateValues.value=="string"&&typeof ls.stateValues.text=="string"){if(ls.stateValues.hasLatex)return{setValue:{hasLatex:!0}}}else if(typeof ls.stateValues.renderAsMath=="boolean"&&typeof ls.stateValues.latex=="string"&&typeof ls.stateValues.text=="string"){if(ls.stateValues.renderAsMath)return{setValue:{hasLatex:!0}}}else if(typeof ls.stateValues.latex=="string")return{setValue:{hasLatex:!0}}}return{setValue:{hasLatex:os}}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},additionalStateVariablesDefined:[{variableName:"latex",public:!0,shadowingInstructions:{createComponentOfType:"text"}},{variableName:"value",public:!0,forRenderer:!0,shadowingInstructions:{createComponentOfType:"label",addStateVariablesShadowingStateVariables:{hasLatex:{stateVariableToShadow:"hasLatex"}}}}],returnDependencies:()=>({inlineChildren:{dependencyType:"child",childGroups:["inlines"],variableNames:["text","latex","value","hasLatex","renderAsMath"],variablesOptional:!0},valueShadow:{dependencyType:"stateVariable",variableName:"valueShadow"},hasLatex:{dependencyType:"stateVariable",variableName:"hasLatex"}}),definition:function({dependencyValues:ss}){if(ss.inlineChildren.length===0&&ss.valueShadow!==null){let us=ss.valueShadow,cs=us;return ss.hasLatex&&(cs=cs.replace(/\\\(/g,""),cs=cs.replace(/\\\)/g,"")),{setValue:{text:cs,latex:cs,value:us}}}let os="",ls="";for(let us of ss.inlineChildren)if(typeof us!="object"){let cs=us.toString();os+=cs,ls+=cs}else typeof us.stateValues.hasLatex=="boolean"&&typeof us.stateValues.value=="string"&&typeof us.stateValues.text=="string"?(os+=us.stateValues.text,ls+=us.stateValues.value):typeof us.stateValues.renderAsMath=="boolean"&&typeof us.stateValues.latex=="string"&&typeof us.stateValues.text=="string"?us.stateValues.renderAsMath?(os+=us.stateValues.latex,ls+="\\("+us.stateValues.latex+"\\)"):(os+=us.stateValues.text,ls+=us.stateValues.text):typeof us.stateValues.latex=="string"?(os+=us.stateValues.latex,ls+="\\("+us.stateValues.latex+"\\)"):typeof us.stateValues.text=="string"&&(os+=us.stateValues.text,ls+=us.stateValues.text);return{setValue:{text:os,latex:os,value:ls}}},inverseDefinition:function({desiredStateVariableValues:ss,dependencyValues:os}){let ls;if(typeof ss.value=="string")ls=ss.value;else if(typeof ss.text=="string")ls=ss.text;else if(typeof ss.latex=="string")ls=ss.latex;else return{success:!1};if(os.inlineChildren.length===0&&os.valueShadow!==null)return{success:!0,instructions:[{setDependency:"valueShadow",desiredValue:ls}]};if(os.inlineChildren.length===1){let us=os.inlineChildren[0],cs=ss.value;if(typeof us!="object")return{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:cs,childIndex:0}]};if(typeof us.stateValues.hasLatex=="boolean"&&typeof us.stateValues.value=="string"&&typeof us.stateValues.text=="string")return{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:cs,childIndex:0,variableIndex:2}]};if(typeof us.stateValues.renderAsMath=="boolean"&&typeof us.stateValues.latex=="string"&&typeof us.stateValues.text=="string")if(us.stateValues.renderAsMath){let ds=cs.match(/^\\\((.*)\\\)/);return ds&&(cs=ds[1]),{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:cs,childIndex:0,variableIndex:1}]}}else return{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:cs,childIndex:0,variableIndex:0}]};else if(typeof us.stateValues.latex=="string"){let ds=cs.match(/^\\\((.*)\\\)/);return ds&&(cs=ds[1]),{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:cs,childIndex:0,variableIndex:1}]}}else return typeof us.stateValues.text=="string"?{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:cs,childIndex:0,variableIndex:0}]}:{success:!1}}else return{success:!1}}},rs.forObjectComponentName={returnDependencies:()=>({forObject:{dependencyType:"attributeTargetComponentNames",attributeName:"forObject"}}),definition({dependencyValues:ss}){var ls;let os;return((ls=ss.forObject)==null?void 0:ls.length)===1?os=ss.forObject[0].absoluteName:os=null,{setValue:{forObjectComponentName:os}}}},rs.anchor={defaultValue:Context.fromText("(0,0)"),public:!0,forRenderer:!0,hasEssential:!0,shadowingInstructions:{createComponentOfType:"point"},returnDependencies:()=>({anchorAttr:{dependencyType:"attributeComponent",attributeName:"anchor",variableNames:["coords"]}}),definition({dependencyValues:ss}){return ss.anchorAttr?{setValue:{anchor:ss.anchorAttr.stateValues.coords}}:{useEssentialOrDefaultValue:{anchor:!0}}},async inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os,stateValues:ls,initialChange:us}){return us&&!await ls.draggable?{success:!1}:os.anchorAttr?{success:!0,instructions:[{setDependency:"anchorAttr",desiredValue:ss.anchor,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"anchor",value:ss.anchor}]}}},rs}async moveLabel({x:rs,y:ns,z:ss,transient:os,actionId:ls,sourceInformation:us={},skipRendererUpdate:cs=!1}){let ds=["vector"];return rs!==void 0&&(ds[1]=rs),ns!==void 0&&(ds[2]=ns),ss!==void 0&&(ds[3]=ss),os?await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],transient:os,actionId:ls,sourceInformation:us,skipRendererUpdate:cs}):await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],actionId:ls,sourceInformation:us,skipRendererUpdate:cs,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{x:rs,y:ns,z:ss}}})}},zs(Vu,"componentType","label"),zs(Vu,"renderChildren",!0),zs(Vu,"rendererType","label"),zs(Vu,"includeBlankStringChildren",!0),zs(Vu,"primaryStateVariableForDefinition","valueShadow"),zs(Vu,"adapters",["text"]),Vu);function returnGroupIntoComponentTypeSeparatedBySpaces({componentType:as,forceComponentType:rs=!1}){return function({matchedChildren:ns,componentInfoObjects:ss}){let os=[],ls=[];function us(){var ds;let cs=!1;if(rs){if(ls.length===1){let ps=ls[0],fs=ps.componentType;fs==="copy"&&((ds=ps.attributes)!=null&&ds.createComponentOfType)&&(!ps.attributes.nComponents||ps.attributes.nComponents.primitive===1)&&(fs=ps.attributes.createComponentOfType.primitive),ss.isInheritedComponentType({inheritedComponentType:fs,baseComponentType:as})&&(os.push(ps),cs=!0)}}else ls.length===1&&typeof ls[0]!="string"&&(os.push(ls[0]),cs=!0);!cs&&ls.length>0&&os.push({componentType:as,children:ls}),ls=[]}for(let cs of ns)if(typeof cs!="string")ls.push(cs);else{let ds=cs.split(/\s+/),ps=ds[0];ps===""?us():ls.push(ps);for(let fs of ds.slice(1))us(),fs!==""&&ls.push(fs)}return us(),{success:!0,newChildren:os}}}function returnBreakStringsIntoComponentTypeBySpaces({componentType:as}){return function({matchedChildren:rs}){return{success:!0,newChildren:rs.reduce(function(ss,os){return typeof os=="string"?[...ss,...os.split(/\s+/).filter(ls=>ls).map(ls=>({componentType:as,children:[ls]}))]:[...ss,os]},[])}}}class MathList extends InlineComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.unordered={createComponentOfType:"boolean",createStateVariable:"unordered",defaultValue:!1,public:!0},rs.maximumNumber={createComponentOfType:"number",createStateVariable:"maximumNumber",defaultValue:null,public:!0},rs.mergeMathLists={createComponentOfType:"boolean"},rs.displayDigits={createComponentOfType:"integer"},rs.displayDecimals={createComponentOfType:"integer",createStateVariable:"displayDecimals",defaultValue:null,public:!0},rs.displaySmallAsZero={createComponentOfType:"number",createStateVariable:"displaySmallAsZero",valueForTrue:1e-14,valueForFalse:0,defaultValue:0,public:!0},rs.padZeros={createComponentOfType:"boolean",createStateVariable:"padZeros",defaultValue:!1,public:!0},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=returnGroupIntoComponentTypeSeparatedBySpaces({componentType:"math"}),ss=returnBreakStringsIntoComponentTypeBySpaces({componentType:"math"});return rs.push({replacementFunction:function({matchedChildren:os,isAttributeComponent:ls=!1,createdFromMacro:us=!1}){return ls&&!us?ns({matchedChildren:os}):ss({matchedChildren:os})}}),rs}static returnChildGroups(){return[{group:"maths",componentTypes:["math"]},{group:"mathLists",componentTypes:["mathList"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.overrideChildHide={returnDependencies:()=>({}),definition:()=>({setValue:{overrideChildHide:!0}})},rs.displayDigits={public:!0,shadowingInstructions:{createComponentOfType:"integer"},hasEssential:!0,defaultValue:10,returnDependencies:()=>({displayDigitsAttr:{dependencyType:"attributeComponent",attributeName:"displayDigits",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]}}),definition({dependencyValues:ns,usedDefault:ss}){if(ns.displayDigitsAttr!==null){let os=ss.displayDigitsAttr,ls=ns.displayDecimalsAttr===null||ss.displayDecimalsAttr;if(!(os||ls)){let us=ns.displayDigitsAttr.shadowDepth;ns.displayDecimalsAttr.shadowDepth({}),definition:()=>({useEssentialOrDefaultValue:{mathsShadow:!0}})},rs.mergeMathLists={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},returnDependencies:()=>({mergeMathListsAttr:{dependencyType:"attributeComponent",attributeName:"mergeMathLists",variableNames:["value"]},mathListChildren:{dependencyType:"child",childGroups:["mathLists"],skipComponentNames:!0},mathChildren:{dependencyType:"child",childGroups:["maths"],skipComponentNames:!0}}),definition({dependencyValues:ns}){var os;return{setValue:{mergeMathLists:((os=ns.mergeMathListsAttr)==null?void 0:os.stateValues.value)||ns.mathListChildren.length===0&&ns.mathChildren.length===1}}}},rs.nComponents={public:!0,shadowingInstructions:{createComponentOfType:"number"},stateVariablesDeterminingDependencies:["mergeMathLists"],additionalStateVariablesDefined:["childIndexByArrayKey"],returnDependencies({stateValues:ns}){let ss={maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"},mergeMathLists:{dependencyType:"stateVariable",variableName:"mergeMathLists"},mathsShadow:{dependencyType:"stateVariable",variableName:"mathsShadow"}};return ns.mergeMathLists?ss.mathAndMathListChildren={dependencyType:"child",childGroups:["maths","mathLists"],variableNames:["value","nComponents"],variablesOptional:!0}:(ss.mathListChildren={dependencyType:"child",childGroups:["mathLists"],variableNames:["nComponents"]},ss.mathAndMathListChildren={dependencyType:"child",childGroups:["maths","mathLists"],skipComponentNames:!0}),ss},definition:function({dependencyValues:ns,componentInfoObjects:ss}){let os=0,ls=[];if(ns.mathAndMathListChildren.length>0)if(ns.mergeMathLists)for(let[cs,ds]of ns.mathAndMathListChildren.entries())if(ss.isInheritedComponentType({inheritedComponentType:ds.componentType,baseComponentType:"mathList"})){for(let ps=0;psus&&(os=us,ls=ls.slice(0,us)),{setValue:{nComponents:os,childIndexByArrayKey:ls},checkForActualChange:{nComponents:!0}}}},rs.maths={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},isArray:!0,entryPrefixes:["math"],stateVariablesDeterminingDependencies:["mergeMathLists","childIndexByArrayKey"],returnArraySizeDependencies:()=>({nComponents:{dependencyType:"stateVariable",variableName:"nComponents"}}),returnArraySize({dependencyValues:ns}){return[ns.nComponents]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={},ls={mergeMathLists:{dependencyType:"stateVariable",variableName:"mergeMathLists"},childIndexByArrayKey:{dependencyType:"stateVariable",variableName:"childIndexByArrayKey"},mathsShadow:{dependencyType:"stateVariable",variableName:"mathsShadow"}};for(let us of ns){let cs=[],ds="1";ss.childIndexByArrayKey[us]&&(cs=[ss.childIndexByArrayKey[us][0]],ds=ss.childIndexByArrayKey[us][1]+1),os[us]={mathAndMathListChildren:{dependencyType:"child",childGroups:["maths","mathLists"],variableNames:["value","math"+ds],variablesOptional:!0,childIndices:cs}}}return{globalDependencies:ls,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=ss[us].mathAndMathListChildren[0];if(cs)if(cs.stateValues.value!==void 0){let ds=cs.stateValues.value;if(ns.mergeMathLists&&Array.isArray(ds.tree)&&ds.tree[0]==="list"){let ps=ns.childIndexByArrayKey[us][1];ls[us]=ds.get_component(ps)}else ls[us]=ds}else{let ds=ns.childIndexByArrayKey[us][1]+1;ls[us]=cs.stateValues["math"+ds]}else ns.mathsShadow!==null&&(ls[us]=ns.mathsShadow[us])}return{setValue:{maths:ls}}},async inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,stateValues:us,workspace:cs}){if(ss.mergeMathLists){let ps=[],fs=await us.childIndexByArrayKey,hs=[];for(let gs in ns.maths){if(!os[gs]||hs.includes(gs))continue;let ys;if(fs[gs][2]!==void 0){let vs=Number(gs)-fs[gs][1],xs=vs+fs[gs][2]-1;cs.desiredMaths||(cs.desiredMaths=[]);let Cs=["list"];for(let Ts=vs;Ts<=xs;Ts++)ns.maths[Ts]!==void 0?cs.desiredMaths[Ts]=convertValueToMathExpression(ns.maths[Ts]):cs.desiredMaths[Ts]===void 0&&(cs.desiredMaths[Ts]=(await us.maths)[Ts]),Cs.push(cs.desiredMaths[Ts].tree),hs.push(Ts.toString());ys=Context.fromAst(Cs)}else ys=ns.maths[gs];let bs=os[gs].mathAndMathListChildren[0];bs&&(bs.stateValues.value!==void 0?ps.push({setDependency:ls[gs].mathAndMathListChildren,desiredValue:ys,childIndex:0,variableIndex:0}):ps.push({setDependency:ls[gs].mathAndMathListChildren,desiredValue:ys,childIndex:0,variableIndex:1}))}return{success:!0,instructions:ps}}let ds=[];for(let ps in ns.maths){if(!os[ps])continue;let fs=os[ps].mathAndMathListChildren[0];fs&&(fs.stateValues.value!==void 0?ds.push({setDependency:ls[ps].mathAndMathListChildren,desiredValue:ns.maths[ps],childIndex:0,variableIndex:0}):ds.push({setDependency:ls[ps].mathAndMathListChildren,desiredValue:ns.maths[ps],childIndex:0,variableIndex:1}))}return{success:!0,instructions:ds}}},rs.math={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},returnDependencies:()=>({maths:{dependencyType:"stateVariable",variableName:"maths"}}),definition({dependencyValues:ns}){let ss;return ns.maths.length===0?ss=Context.fromAst("_"):ns.maths.length===1?ss=ns.maths[0]:ss=Context.fromAst(["list",...ns.maths.map(os=>os.tree)]),{setValue:{math:ss}}}},rs.nValues={isAlias:!0,targetVariableName:"nComponents"},rs.values={isAlias:!0,targetVariableName:"maths"},rs.latex={additionalStateVariablesDefined:["latexs"],public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies:()=>({mathAndMathListChildren:{dependencyType:"child",childGroups:["maths","mathLists"],variableNames:["valueForDisplay","latex","latexs"],variablesOptional:!0},maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"},mergeMathLists:{dependencyType:"stateVariable",variableName:"mergeMathLists"},mathsShadow:{dependencyType:"stateVariable",variableName:"mathsShadow"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"},padZeros:{dependencyType:"stateVariable",variableName:"padZeros"}}),definition:function({dependencyValues:ns,usedDefault:ss}){let os=[],ls={};if(ns.padZeros&&(ss.displayDigits&&!ss.displayDecimals?Number.isFinite(ns.displayDecimals)&&(ls.padToDecimals=ns.displayDecimals):ns.displayDigits>=1&&(ls.padToDigits=ns.displayDigits)),ns.mathAndMathListChildren.length>0)for(let ds of ns.mathAndMathListChildren)if(ds.stateValues.valueForDisplay){let ps=ds.stateValues.valueForDisplay;if(ns.mergeMathLists&&Array.isArray(ps.tree)&&ps.tree[0]==="list")for(let fs=0;fsroundForDisplay({value:ds,dependencyValues:ns,usedDefault:ss}).toLatex(ls)));let us=ns.maximumNumber;return us!==null&&os.length>us&&(us=Math.max(0,Math.floor(us)),os=os.slice(0,us)),{setValue:{latex:os.join(", "),latexs:os}}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},additionalStateVariablesDefined:["texts"],returnDependencies:()=>({mathAndMathListChildren:{dependencyType:"child",childGroups:["maths","mathLists"],variableNames:["valueForDisplay","text","texts"],variablesOptional:!0},maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"},mergeMathLists:{dependencyType:"stateVariable",variableName:"mergeMathLists"},mathsShadow:{dependencyType:"stateVariable",variableName:"mathsShadow"}}),definition:function({dependencyValues:ns}){let ss=[];if(ns.mathAndMathListChildren.length>0)for(let us of ns.mathAndMathListChildren)if(us.stateValues.valueForDisplay){let cs=us.stateValues.valueForDisplay;if(ns.mergeMathLists&&Array.isArray(cs.tree)&&cs.tree[0]==="list")for(let ds=0;dsus.toString()));let os=ns.maximumNumber;return os!==null&&ss.length>os&&(os=Math.max(0,Math.floor(os)),ss=ss.slice(0,os)),{setValue:{text:ss.join(", "),texts:ss}}}},rs.componentNamesInList={returnDependencies:()=>({mathAndMathListChildren:{dependencyType:"child",childGroups:["maths","mathLists"],variableNames:["componentNamesInList"],variablesOptional:!0},maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"}}),definition:function({dependencyValues:ns,componentInfoObjects:ss}){let os=[];for(let us of ns.mathAndMathListChildren)ss.isInheritedComponentType({inheritedComponentType:us.componentType,baseComponentType:"mathList"})?os.push(...us.stateValues.componentNamesInList):os.push(us.componentName);let ls=ns.maximumNumber;return ls!==null&&os.length>ls&&(ls=Math.max(0,Math.floor(ls)),os=os.slice(0,ls)),{setValue:{componentNamesInList:os}}}},rs.nComponentsToDisplayByChild={additionalStateVariablesDefined:["nChildrenToRender"],returnDependencies:()=>({nComponents:{dependencyType:"stateVariable",variableName:"nComponents"},mathListChildren:{dependencyType:"child",childGroups:["mathLists"],variableNames:["nComponents"]},mathAndMathListChildren:{dependencyType:"child",childGroups:["maths","mathLists"],skipComponentNames:!0},parentNComponentsToDisplayByChild:{dependencyType:"parentStateVariable",parentComponentType:"mathList",variableName:"nComponentsToDisplayByChild"}}),definition:function({dependencyValues:ns,componentInfoObjects:ss,componentName:os}){let ls=ns.nComponents;ns.parentNComponentsToDisplayByChild!==null&&(ls=ns.parentNComponentsToDisplayByChild[os]);let us={},cs=0,ds=0,ps=0;for(let fs of ns.mathAndMathListChildren){let hs=Math.max(0,ls-cs);if(hs>0&&ds++,ss.isInheritedComponentType({inheritedComponentType:fs.componentType,baseComponentType:"mathList"})){let gs=ns.mathListChildren[ps];ps++;let ys=Math.min(hs,gs.stateValues.nComponents);us[gs.componentName]=ys,cs+=ys}else cs+=1}return{setValue:{nComponentsToDisplayByChild:us,nChildrenToRender:ds}}},markStale:()=>({updateRenderedChildren:!0})},rs}}zs(MathList,"componentType","mathList"),zs(MathList,"renderChildren",!0),zs(MathList,"includeBlankStringChildren",!0),zs(MathList,"removeBlankStringChildrenPostSugar",!0),zs(MathList,"stateVariableForAttributeValue","maths"),zs(MathList,"primaryStateVariableForDefinition","mathsShadow"),zs(MathList,"descendantCompositesMustHaveAReplacement",!1),zs(MathList,"adapters",[{stateVariable:"math",stateVariablesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},"text"]);class Columns extends Text{}zs(Columns,"componentType","columns"),zs(Columns,"rendererType","text");class Title extends TextOrInline{}zs(Title,"componentType","title");class RightHandSide extends MathComponent{}zs(RightHandSide,"componentType","rightHandSide"),zs(RightHandSide,"rendererType","math");class Description extends TextOrInline{}zs(Description,"componentType","description"),zs(Description,"rendererType");class Else extends Template{}zs(Else,"componentType","else");class Xlabel extends Label$1{}zs(Xlabel,"componentType","xlabel"),zs(Xlabel,"rendererType","label");class Ylabel extends Label$1{}zs(Ylabel,"componentType","ylabel"),zs(Ylabel,"rendererType","label");class MatrixRow extends MathList{}zs(MatrixRow,"componentType","matrixRow"),zs(MatrixRow,"rendererType","mathList");class MatrixColumn extends MathList{}zs(MatrixColumn,"componentType","matrixColumn"),zs(MatrixColumn,"rendererType","mathList");const Aliases=Object.freeze(Object.defineProperty({__proto__:null,Columns,Description,Else,MatrixColumn,MatrixRow,RightHandSide,Title,Xlabel,Ylabel},Symbol.toStringTag,{value:"Module"}));var Mu;let M$3=(Mu=class extends InlineComponent{constructor(rs){super(rs),Object.assign(this.actions,{moveMath:this.moveMath.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.layer={createComponentOfType:"number",createStateVariable:"layer",defaultValue:0,public:!0,forRenderer:!0},rs.anchor={createComponentOfType:"point"},rs.positionFromAnchor={createComponentOfType:"text",createStateVariable:"positionFromAnchor",defaultValue:"center",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft","top","bottom","left","right","center"]},rs.styleNumber.defaultValue=0,rs}static returnChildGroups(){return[{group:"inline",componentTypes:["_inline"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=returnSelectedStyleStateVariableDefinition();return Object.assign(rs,ns),rs.latex={public:!0,shadowingInstructions:{createComponentOfType:"text"},defaultValue:"",hasEssential:!0,forRenderer:!0,returnDependencies:()=>({inlineChildren:{dependencyType:"child",childGroups:["inline"],variableNames:["latex","text"],variablesOptional:!0}}),definition:function({dependencyValues:ss}){if(ss.inlineChildren.length===0)return{useEssentialOrDefaultValue:{latex:!0}};let os="";for(let ls of ss.inlineChildren)typeof ls!="object"?os+=ls:typeof ls.stateValues.latex=="string"?os+=ls.stateValues.latex:typeof ls.stateValues.text=="string"&&(os+=ls.stateValues.text);return{setValue:{latex:os}}},inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os}){if(typeof ss.latex!="string")return{success:!1};if(os.inlineChildren.length===0)return{success:!0,instructions:[{setEssentialValue:"latex",value:ss.latex}]};if(os.inlineChildren.length===1){let ls=os.inlineChildren[0];return typeof ls!="object"?{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:ss.latex,childIndex:0}]}:typeof ls.stateValues.latex=="string"?{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:ss.latex,childIndex:0,variableIndex:0}]}:typeof ls.stateValues.text=="string"?{success:!0,instructions:[{setDependency:"inlineChildren",desiredValue:ss.latex,childIndex:0,variableIndex:1}]}:{success:!1}}else return{success:!1}}},rs.latexWithInputChildren={forRenderer:!0,returnDependencies:()=>({inlineChildren:{dependencyType:"child",childGroups:["inline"],variableNames:["latex","text"],variablesOptional:!0},latex:{dependencyType:"stateVariable",variableName:"latex"}}),definition:function({dependencyValues:ss,componentInfoObjects:os}){if(ss.inlineChildren.length===0)return{setValue:{latexWithInputChildren:[ss.latex]}};let ls=[],us="",cs=0;for(let ds of ss.inlineChildren)typeof ds!="object"?us+=ds:os.isInheritedComponentType({inheritedComponentType:ds.componentType,baseComponentType:"input"})?(us.length>0&&(ls.push(us),us=""),ls.push(cs),cs++):typeof ds.stateValues.latex=="string"?us+=ds.stateValues.latex:typeof ds.stateValues.text=="string"&&(us+=ds.stateValues.text);return us.length>0&&ls.push(us),{setValue:{latexWithInputChildren:ls}}}},rs.renderMode={forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{renderMode:"inline"}})},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({latex:{dependencyType:"stateVariable",variableName:"latex"}}),definition:function({dependencyValues:ss}){let os;try{os=Context.fromAst(latexToAst.convert(ss.latex))}catch{return{setValue:{text:ss.latex}}}return{setValue:{text:superSubscriptsToUnicode(os.toString())}}}},rs.anchor={defaultValue:Context.fromText("(0,0)"),public:!0,forRenderer:!0,hasEssential:!0,shadowingInstructions:{createComponentOfType:"point"},returnDependencies:()=>({anchorAttr:{dependencyType:"attributeComponent",attributeName:"anchor",variableNames:["coords"]}}),definition({dependencyValues:ss}){return ss.anchorAttr?{setValue:{anchor:ss.anchorAttr.stateValues.coords}}:{useEssentialOrDefaultValue:{anchor:!0}}},async inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os,stateValues:ls,initialChange:us}){return us&&!await ls.draggable?{success:!1}:os.anchorAttr?{success:!0,instructions:[{setDependency:"anchorAttr",desiredValue:ss.anchor,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"anchor",value:ss.anchor}]}}},rs}async moveMath({x:rs,y:ns,z:ss,transient:os,actionId:ls,sourceInformation:us={},skipRendererUpdate:cs=!1}){let ds=["vector"];return rs!==void 0&&(ds[1]=rs),ns!==void 0&&(ds[2]=ns),ss!==void 0&&(ds[3]=ss),os?await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],transient:os,actionId:ls,sourceInformation:us,skipRendererUpdate:cs}):await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],actionId:ls,sourceInformation:us,skipRendererUpdate:cs,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{x:rs,y:ns,z:ss}}})}},zs(Mu,"componentType","m"),zs(Mu,"rendererType","math"),zs(Mu,"includeBlankStringChildren",!0),zs(Mu,"primaryStateVariableForDefinition","latex"),Mu);var cp;let Me$2=(cp=class extends M$3{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.renderMode.definition=()=>({setValue:{renderMode:"display"}}),rs}},zs(cp,"componentType","me"),cp);class Men extends M$3{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.renderMode.definition=()=>({setValue:{renderMode:"numbered"}}),rs.equationTag={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies:()=>({equationCounter:{dependencyType:"counter",counterName:"equation"}}),definition({dependencyValues:ns}){return{setValue:{equationTag:String(ns.equationCounter)}}}},rs}}zs(Men,"componentType","men");const MMeMen=Object.freeze(Object.defineProperty({__proto__:null,M:M$3,Me:Me$2,Men},Symbol.toStringTag,{value:"Module"}));class Md extends InlineComponent{constructor(rs){super(rs),Object.assign(this.actions,{moveMath:this.moveMath.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.layer={createComponentOfType:"number",createStateVariable:"layer",defaultValue:0,public:!0,forRenderer:!0},rs.anchor={createComponentOfType:"point"},rs.positionFromAnchor={createComponentOfType:"text",createStateVariable:"positionFromAnchor",defaultValue:"center",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft","top","bottom","left","right","center"]},rs.styleNumber.defaultValue=0,rs}static returnChildGroups(){return[{group:"mrows",componentTypes:["mrow"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=returnSelectedStyleStateVariableDefinition();return Object.assign(rs,ns),rs.mrowChildNames={forRenderer:!0,returnDependencies:()=>({mrowChildren:{dependencyType:"child",childGroups:["mrows"]}}),definition:({dependencyValues:ss})=>({setValue:{mrowChildNames:ss.mrowChildren.map(os=>os.componentName)}})},rs.latex={public:!0,shadowingInstructions:{createComponentOfType:"text"},defaultValue:"",hasEssential:!0,shadowVariable:!0,forRenderer:!0,returnDependencies:()=>({mrowChildren:{dependencyType:"child",childGroups:["mrows"],variableNames:["latex","hide","equationTag","numbered"]}}),definition:function({dependencyValues:ss}){if(ss.mrowChildren.length>0){let os="";for(let ls of ss.mrowChildren)ls.stateValues.hide||(os.length>0&&(os+="\\\\"),ls.stateValues.numbered?os+=`\\tag{${ls.stateValues.equationTag}}`:os+="\\notag ",os+=ls.stateValues.latex);return{setValue:{latex:os}}}else return{useEssentialOrDefaultValue:{latex:!0}}}},rs.latexWithInputChildren={forRenderer:!0,returnDependencies:()=>({mrowChildren:{dependencyType:"child",childGroups:["mrows"],variableNames:["latexWithInputChildren","hide","equationTag","numbered"]},latex:{dependencyType:"stateVariable",variableName:"latex"}}),definition:function({dependencyValues:ss}){if(ss.mrowChildren.length>0){let os=[],ls=0,us="";for(let cs of ss.mrowChildren)if(!cs.stateValues.hide){us.length>0&&(us+="\\\\"),cs.stateValues.numbered?us+=`\\tag{${cs.stateValues.equationTag}}`:us+="\\notag ";for(let ds of cs.stateValues.latexWithInputChildren)typeof ds=="number"?(us.length>0&&(os.push(us),us=""),os.push(ls),ls++):us+=ds}return us.length>0&&os.push(us),{setValue:{latexWithInputChildren:os}}}else return{setValue:{latexWithInputChildren:[ss.latex]}}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({latex:{dependencyType:"stateVariable",variableName:"latex"}}),definition:function({dependencyValues:ss}){let os;try{os=ss.latex.replaceAll("\\notag","").replaceAll("\\amp","").split("\\\\").map(ls=>Context.fromAst(latexToAst.convert(ls)).toString()).join(`\\\\ `)}catch{return{setValue:{text:ss.latex}}}return{setValue:{text:superSubscriptsToUnicode(os.toString())}}}},rs.renderMode={forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{renderMode:"align"}})},rs.numbered={returnDependencies:()=>({}),definition:()=>({setValue:{numbered:!1}})},rs.anchor={defaultValue:Context.fromText("(0,0)"),public:!0,forRenderer:!0,hasEssential:!0,shadowingInstructions:{createComponentOfType:"point"},returnDependencies:()=>({anchorAttr:{dependencyType:"attributeComponent",attributeName:"anchor",variableNames:["coords"]}}),definition({dependencyValues:ss}){return ss.anchorAttr?{setValue:{anchor:ss.anchorAttr.stateValues.coords}}:{useEssentialOrDefaultValue:{anchor:!0}}},async inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os,stateValues:ls,initialChange:us}){return us&&!await ls.draggable?{success:!1}:os.anchorAttr?{success:!0,instructions:[{setDependency:"anchorAttr",desiredValue:ss.anchor,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"anchor",value:ss.anchor}]}}},rs}async moveMath({x:rs,y:ns,z:ss,transient:os,actionId:ls,sourceInformation:us={},skipRendererUpdate:cs=!1}){let ds=["vector"];return rs!==void 0&&(ds[1]=rs),ns!==void 0&&(ds[2]=ns),ss!==void 0&&(ds[3]=ss),os?await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],transient:os,actionId:ls,sourceInformation:us,skipRendererUpdate:cs}):await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"anchor",value:Context.fromAst(ds)}],actionId:ls,sourceInformation:us,skipRendererUpdate:cs,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{x:rs,y:ns,z:ss}}})}}zs(Md,"componentType","md"),zs(Md,"rendererType","math"),zs(Md,"primaryStateVariableForDefinition","latex");class Mdn extends Md{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.numbered={returnDependencies:()=>({}),definition:()=>({setValue:{numbered:!0}})},rs}}zs(Mdn,"componentType","mdn");class Mrow extends M$3{static createAttributesObject(){let rs=super.createAttributesObject();return rs.number={createComponentOfType:"boolean"},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.renderMode.definition=()=>({setValue:{renderMode:"display"}}),rs.numbered={forRenderer:!0,returnDependencies:()=>({parentNumbered:{dependencyType:"parentStateVariable",variableName:"numbered"},numberAttr:{dependencyType:"attributeComponent",attributeName:"number",variableNames:["value"]}}),definition({dependencyValues:ns}){let ss;return ns.numberAttr!==null?ss=ns.numberAttr.stateValues.value:ss=ns.parentNumbered,{setValue:{numbered:ss}}}},rs.equationTag={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,stateVariablesDeterminingDependencies:["numbered"],returnDependencies({stateValues:ns}){return ns.numbered?{equationCounter:{dependencyType:"counter",counterName:"equation"}}:{}},definition({dependencyValues:ns}){return ns.equationCounter!==void 0?{setValue:{equationTag:String(ns.equationCounter)}}:{setValue:{equationTag:null}}}},rs}}zs(Mrow,"componentType","mrow");const MdMdnMrow=Object.freeze(Object.defineProperty({__proto__:null,Md,Mdn,Mrow},Symbol.toStringTag,{value:"Module"}));function periodicSetEquality(as,rs,{min_elements_match:ns=3,match_partial:ss=!1}={}){if(!is_periodic_set(as))return!1;if(is_periodic_set(rs))if(ss){let os=contained_in(as.tree,rs.tree,ss);if(os===!1)return 0;let ls=contained_in(rs.tree,as.tree,ss);return ls===!1?0:os===!0?ls===!0?1:ls:ls===!0?os:Math.min(os,ls)}else return contained_in(as.tree,rs.tree,ss)&&contained_in(rs.tree,as.tree,ss);else{let os=as.tree.slice(1);if(os.length>1)return!1;let ls=Context.fromAst(os[0][1]).evaluate_to_constant(),us=Context.fromAst(["apply","abs",os[0][2]]).evaluate_to_constant();if(!Number.isFinite(ls)||!Number.isFinite(us))return!1;let cs=os[0][3],ds=os[0][4];if(cs!==-1/0||ds!==1/0||rs.tree[0]!=="list")return!1;let ps=rs.tree.slice(1),fs=0;if(ps[0][0]==="ldots")fs++,ps=ps.slice(1);else if(!ss)return!1;if(ps[ps.length-1][0]==="ldots")fs++,ps=ps.slice(0,ps.length-1);else if(!ss)return!1;let hs=ps.length;if(hs===0||!ss&&hsContext.fromAst(vs).evaluate_to_constant());let gs=Context.math.mod(ps[0]-ls,us);if(!(Context.math.min(gs,us-gs)<1e-10*us))return!1;let ys=1;for(let vs=1;vs=ns)return!0;let bs=ys/Math.max(hs,ns);return bs*=(9+fs/2)/10,bs}}function is_periodic_set(as){var rs=as.tree;if(!Array.isArray(rs)||rs[0]!=="periodic_set")return!1;var ns=rs.slice(1);for(var ss of ns)if(!Array.isArray(ss)||ss[0]!=="tuple"||ss.length!==5)return!1;return!0}function contained_in(as,rs,ns){if(as[0]==="periodic_set")if(ns){let hs=0;for(let ys of as.slice(1)){let bs=contained_in(ys,rs,ns);bs===!0?hs++:bs!==!1&&(hs+=bs)}let gs=as.length-1;return hs===gs?!0:hs===0?!1:hs/gs}else return as.slice(1).every(hs=>contained_in(hs,rs));var ss=as[1],os=as[2],ls=as[3],us=as[4];if(ls!==-1/0||us!==1/0)return!1;ss=Context.fromAst(["/",ss,os]).evaluate_to_constant();var cs=rs.slice(1),ds=[];for(let hs=0;hs1e3)return!1;let Ts=xs.d;ds.push([Cs,Ts,bs,vs])}for(ds.sort();ds[0][0]===1;){let gs=ds[0][2],ys=ds[0][3],bs=Context.fromAst(["+",gs,["-",ss]]).evaluate_to_constant();if(Number.isFinite(bs)&&Number.isFinite(ys)&&(bs=Context.math.mod(bs,ys),Context.math.min(bs,ys-bs)<1e-10*ys))return!0;if(ds.splice(0,1),ds.length===0)return!1}var ps=[...new Set(ds.map(hs=>hs[0]))];let fs=0;for(let hs of ps){let gs=ds.map(function(bs,vs){let xs=hs/bs[0];if(Number.isInteger(xs))return[bs[0],xs,vs]}).filter(bs=>bs),ys=[];for(let bs of gs){let vs=bs[0],xs=bs[1],Cs=bs[2],Ts=ds[Cs][2],Ss=ds[Cs][3];for(let Ns=0;Nsfs&&(fs=bs)}}return ns&&fs>0?fs:!1}const nonTupleVectorOperators=["vector","altvector"];function checkEquality({object1:as,object2:rs,isUnordered:ns=!1,partialMatches:ss=!1,matchByExactPositions:os=!1,symbolicEquality:ls=!1,simplify:us="none",expand:cs=!1,allowedErrorInNumbers:ds=0,includeErrorInNumberExponents:ps=!1,allowedErrorIsAbsolute:fs=!1,nSignErrorsMatched:hs=0,nPeriodicSetMatchesRequired:gs=3,caseInsensitiveMatch:ys=!1,matchBlanks:bs=!1}){let vs=!1;if(as instanceof Context.class){if(vs=!0,!(rs instanceof Context.class))if(typeof rs=="number"||typeof rs=="string")rs=Context.fromAst(rs);else return{fraction_equal:0}}else if(rs instanceof Context.class)if(vs=!0,typeof as=="number"||typeof as=="string")as=Context.fromAst(as);else return{fraction_equal:0};let xs=function($s,Rs=!1){$s instanceof Context.class||($s=Context.fromAst($s)),$s=$s.normalize_function_names().normalize_applied_functions(),ys&&($s=Context.fromAst(setStringsInTreeToLowerCase($s.tree)));let Ds=us,Os=cs;return Rs&&(Ds="full",Os=!0),Ds==="none"?ds>0&&($s=$s.constants_to_floats()):Ds==="numberspreserveorder"?$s=$s.evaluate_numbers({max_digits:1/0,skip_ordering:!0}):Ds==="number"?$s=$s.evaluate_numbers({max_digits:1/0}):$s=$s.evaluate_numbers({max_digits:1/0,evaluate_functions:!0}),normalizeMathExpression({value:$s,simplify:Ds,expand:Os})},Cs;vs?ls?Cs=function($s,Rs){let Ds=$s,Os=Rs;if($s instanceof Context.class||(Ds=Context.fromAst($s)),Rs instanceof Context.class||(Os=Context.fromAst(Rs)),hs>0){Os=JSON.parse(JSON.stringify(Os),Context.reviver);let Is=function(ks,Ps){return ks.variables().includes("_")||Ps.variables().includes("_")?!1:(ks=xs(ks),ks.equalsViaSyntax(Ps,{allowed_error_in_numbers:ds,include_error_in_number_exponents:ps,allowed_error_is_absolute:fs,allow_blanks:bs}))};return Ds.tree.im||Os.tree.im?{fraction_equal:0}:{fraction_equal:Context.equalSpecifiedSignErrors(Os,Ds,{equalityFunction:Is,n_sign_errors:hs})?1:0}}else return Ds.variables().includes("_")||Os.variables().includes("_")?{fraction_equal:0}:Ds.tree.im||Os.tree.im?{fraction_equal:0}:{fraction_equal:Ds.equalsViaSyntax(Os,{allowed_error_in_numbers:ds,include_error_in_number_exponents:ps,allowed_error_is_absolute:fs,allow_blanks:bs})?1:0}}:Cs=function($s,Rs){let Ds=$s,Os=Rs;if($s instanceof Context.class||(Ds=Context.fromAst($s)),Rs instanceof Context.class||(Os=Context.fromAst(Rs)),ys&&(Ds=Context.fromAst(setStringsInTreeToLowerCase(Ds.tree)),Os=Context.fromAst(setStringsInTreeToLowerCase(Os.tree))),hs>0){Os=JSON.parse(JSON.stringify(Os),Context.reviver);let Is=function(ks,Ps){return ks.equals(Ps,{allowed_error_in_numbers:ds,include_error_in_number_exponents:ps,allowed_error_is_absolute:fs,allow_blanks:bs})};return Ds.tree.im||Os.tree.im?{fraction_equal:0}:{fraction_equal:Context.equalSpecifiedSignErrors(Os,Ds,{equalityFunction:Is,n_sign_errors:hs})?1:0}}else return Ds.tree.im||Os.tree.im?{fraction_equal:0}:{fraction_equal:Ds.equals(Os,{allowed_error_in_numbers:ds,include_error_in_number_exponents:ps,allowed_error_is_absolute:fs,allow_blanks:bs})?1:0}}:Cs=($s,Rs)=>(ys&&($s=convertStringsToLowerCase($s),Rs=convertStringsToLowerCase(Rs)),{fraction_equal:deepCompare($s,Rs)?1:0});let Ts=!1,Ss=!1;if(vs){as=xs(as,!ls),rs=xs(rs,!ls);let $s=as.tree[0],Rs=rs.tree[0];if($s==="periodic_set"||Rs==="periodic_set"){let Ds=as,Os=rs;$s!=="periodic_set"&&(Ds=rs,Os=as);let Is=periodicSetEquality(Ds,Os,{match_partial:ss,min_elements_match:gs});return Is===!0?{fraction_equal:1}:Is===!1?{fraction_equal:0}:{fraction_equal:Is}}else if($s==="list")as=as.tree.slice(1),Rs==="list"?rs=rs.tree.slice(1):rs=[rs.tree];else if(Rs==="list")rs=rs.tree.slice(1),as=[as.tree];else if(nonTupleVectorOperators.includes($s)){if(as=as.tree.slice(1),Rs==="interval"||Rs==="matrix"||Rs==="array"||Rs==="set")return{fraction_equal:0};vectorOperators.includes(Rs)?rs=rs.tree.slice(1):rs=[rs.tree]}else if(nonTupleVectorOperators.includes(Rs)){if(rs=rs.tree.slice(1),$s==="interval"||$s==="matrix"||$s==="array"||$s==="set")return{fraction_equal:0};$s==="tuple"?as=as.tree.slice(1):as=[as.tree]}else if($s==="interval"){os=!0;let Ds=as.tree[2],Os=Ds[1],Is=Ds[2];if(as=as.tree[1].slice(1),Rs==="matrix"||Rs==="set")return{fraction_equal:0};if(Rs==="tuple"){let Vs=rs.tree.slice(1);if(Vs.length===2&&Os===!1&&Is===!1)rs=Vs;else return{fraction_equal:0}}else if(Rs==="array"){let Vs=rs.tree.slice(1);if(Vs.length===2&&Os===!0&&Is===!0)rs=Vs;else return{fraction_equal:0}}else if(Rs==="interval"){let Vs=rs.tree[2];if(Vs[1]!==Os||Vs[2]!==Is)return{fraction_equal:0};rs=rs.tree[1].slice(1)}else return{fraction_equal:0}}else if(Rs==="interval"){os=!0;let Ds=rs.tree[2],Os=Ds[1],Is=Ds[2];if(rs=rs.tree[1].slice(1),$s==="matrix"||$s==="set")return{fraction_equal:0};if($s==="tuple"){let Vs=as.tree.slice(1);if(Vs.length===2&&Os===!1&&Is===!1)as=Vs;else return{fraction_equal:0}}else if($s==="array"){let Vs=as.tree.slice(1);if(Vs.length===2&&Os===!0&&Is===!0)as=Vs;else return{fraction_equal:0}}else return{fraction_equal:0}}else if($s==="matrix")if(Rs==="matrix")as=convertMatrixToArrayOfTuples(as.tree.slice(1)),rs=convertMatrixToArrayOfTuples(rs.tree.slice(1)),os=!0,Ss=!0,Ts=!0;else return{fraction_equal:0};else{if(Rs==="matrix")return{fraction_equal:0};if($s==="set"){let Ds=[];for(let Os of as.tree.slice(1))Ds.some(Is=>Cs(Is,Os).fraction_equal===1)||Ds.push(Os);if(as=Ds,ns=!0,Rs==="tuple"||Rs==="array")return{fraction_equal:0};if(Rs==="set"){Ds=[];for(let Os of rs.tree.slice(1))Ds.some(Is=>Cs(Is,Os).fraction_equal===1)||Ds.push(Os);rs=Ds}else rs=[rs.tree]}else if(Rs==="set"){let Ds=[];for(let Os of rs.tree.slice(1))Ds.some(Is=>Cs(Is,Os).fraction_equal===1)||Ds.push(Os);if(rs=Ds,ns=!0,$s==="tuple"||$s==="array")return{fraction_equal:0};as=[as.tree]}else if($s==="tuple"){if(as=as.tree.slice(1),Rs==="array")return{fraction_equal:0};Rs==="tuple"?rs=rs.tree.slice(1):rs=[rs.tree]}else if(Rs==="tuple"){if(rs=rs.tree.slice(1),$s==="array")return{fraction_equal:0};as=[as.tree]}else if($s==="array")as=as.tree.slice(1),Rs==="array"?rs=rs.tree.slice(1):rs=[rs.tree];else if(Rs==="array")rs=rs.tree.slice(1),as=[as.tree];else return Cs(as.tree,rs.tree)}}else if(Array.isArray(as))Array.isArray(rs)||(typeof rs=="string"&&as.every($s=>typeof $s=="string"&&!$s.includes(","))?rs=rs.split(",").map($s=>$s.trim()):rs=[rs]);else if(Array.isArray(rs))typeof as=="string"&&rs.every($s=>typeof $s=="string"&&!$s.includes(","))?as=as.split(",").map($s=>$s.trim()):as=[as];else return Cs(as,rs);let Ns=as.length,As=rs.length,ws={fraction_equal:0};if(os&&(ns=!1),!ns){let $s=0,Rs=Math.min(Ns,As);for(let Is=0;IsArray(As+1).fill(0));for(let Is=0;IsDs&&(Ds=Vs.fraction_equal,Rs=Os)}Rs!==-1&&(_s+=Ds,Es.add(Rs))}return Ns===As&&Ns===_s?(ws.fraction_equal=1,ws):(ss&&(ws.fraction_equal=_s/Math.max(Ns,As)),ws)}function setStringsInTreeToLowerCase(as){return typeof as=="string"?as.toLowerCase():Array.isArray(as)?[as[0],...as.slice(1).map(setStringsInTreeToLowerCase)]:as}function convertStringsToLowerCase(as){return typeof as=="string"?as.toLowerCase():Array.isArray(as)?as.map(convertStringsToLowerCase):as}function convertMatrixToArrayOfTuples(as){let rs=as[0][1],ns=as[0][2];if(!(Number.isInteger(rs)&&Number.isInteger(ns)))return as;let ss=[];for(let os=0;osevaluateLogic({logicTree:Ts,canOverrideUnorderedCompare:rs,dependencyValues:ns,valueOnInvalid:ss});if(!Array.isArray(as)){if(typeof as=="string"){let Ts=ns.booleanChildrenByCode[as];if(Ts)return ns.matchPartial&&Ts.stateValues.fractionSatisfied!==void 0?Ts.stateValues.fractionSatisfied:Ts.stateValues.value?1:0;{let Ss=ns.mathChildrenByCode[as];if(Ss){let Ns=Ss.stateValues.value.simplify().evaluate_to_constant();return Number.isFinite(Ns)&&Ns!==0?1:0}else{let Ns=ns.numberChildrenByCode[as];if(Ns){let As=Ns.stateValues.value;return Number.isFinite(As)&&As!==0?1:0}else{if(as.toLowerCase()==="true")return 1;if(as.toLowerCase()==="false")return 0}}}}else if(typeof as=="number")return as===0?0:1;return console.warn("Invalid format for boolean condition"),ss}let ls=as[0],us=as.slice(1);if(ls==="not")return us.length!==1?(console.warn("Invalid format for boolean condition"),ss):os(us[0])===0?1:0;if(ls==="and")return ns.matchPartial?us.reduce((Ts,Ss)=>Ts+os(Ss),0)/us.length:us.every(Ts=>os(Ts)===1)?1:0;if(ls==="or")return ns.matchPartial?us.reduce((Ts,Ss)=>Math.max(os(Ss),Ts),0):us.some(Ts=>os(Ts)===1)?1:0;let cs=!1,ds=!1,ps=!1,fs=!1;us.forEach(function(Ts){typeof Ts=="string"&&(Ts in ns.mathChildrenByCode||Ts in ns.mathListChildrenByCode||Ts in ns.numberChildrenByCode||Ts in ns.numberListChildrenByCode?cs=!0:Ts in ns.textChildrenByCode||Ts in ns.textListChildrenByCode?ds=!0:Ts in ns.booleanChildrenByCode||Ts in ns.booleanListChildrenByCode?ps=!0:Ts in ns.otherChildrenByCode&&(fs=!0))});let hs=function(Ts){if(typeof Ts=="string"){let Ss=ns.mathChildrenByCode[Ts];return Ss!==void 0?Ss.stateValues.value.tree:(Ss=ns.mathListChildrenByCode[Ts],Ss!==void 0?["list",...Ss.stateValues.maths.map(Ns=>Ns.tree)]:(Ss=ns.numberChildrenByCode[Ts],Ss!==void 0?numberToMathExpression(Ss.stateValues.value).tree:(Ss=ns.numberListChildrenByCode[Ts],Ss!==void 0?["list",...Ss.stateValues.numbers]:Ts)))}return Array.isArray(Ts)?[Ts[0],...Ts.slice(1).map(hs)]:Ts};if(ls==="apply"&&["isnumber","isinteger"].includes(us[0])){if(ds||ps||fs)return 0;let Ss=Context.fromAst(hs(us[1])).simplify().evaluate_to_constant();if(!Number.isFinite(Ss))return 0;if(us[0]==="isnumber")return 1;{let Ns=Math.round(Ss);return Math.abs(Ns-Ss)<=1e-15*Math.abs(Ss)?1:0}}if(!["=","ne","<",">","le","ge","lts","gts","in","notin"].includes(ls)){if(ds||ps||fs)return console.warn("Invalid format for boolean condition"),ss;let Ss=Context.fromAst(hs(as)).simplify().evaluate_to_constant();return Number.isFinite(Ss)&&Ss!==0?1:0}if(ps){if(cs||ds||fs)return console.warn("Invalid format for boolean condition"),ss;let Ts=!1,Ss=!1;if(us=us.map(function(As){if(typeof As=="string"){let ws=ns.booleanChildrenByCode[As];return ws!==void 0?ws.stateValues.value:(ws=ns.booleanListChildrenByCode[As],ws!==void 0?(ws.stateValues.unordered&&(Ss=!0),ws.stateValues.booleans):(As=As.toLowerCase().trim(),As==="true"||As==="t"?!0:As==="false"||As==="f"?!1:(console.warn("Invalid format for boolean condition"),Ts=!0,ss)))}return console.warn("Invalid format for boolean condition"),Ts=!0,ss}),Ts)return ss;let Ns=ns.unorderedCompare;if(rs&&Ss&&(Ns=!0),ls==="="){let As=us[0];if(ns.matchPartial){let ws=us.slice(1).map(_s=>checkEquality({object1:As,object2:_s,isUnordered:Ns,partialMatches:ns.matchPartial,matchByExactPositions:ns.matchByExactPositions}));return ws.reduce((_s,$s)=>_s+$s.fraction_equal,0)/ws.length}else return us.slice(1).every(ws=>checkEquality({object1:As,object2:ws,isUnordered:Ns,partialMatches:ns.matchPartial,matchByExactPositions:ns.matchByExactPositions}).fraction_equal===1)?1:0}else return ls==="ne"?us.length!==2?(console.warn("Invalid format for boolean condition"),ss):checkEquality({object1:us[0],object2:us[1],isUnordered:Ns,partialMatches:ns.matchPartial,matchByExactPositions:ns.matchByExactPositions}).fraction_equal===0?1:0:(console.warn("Invalid format for boolean condition"),ss)}else if(ds){if(cs||fs)return console.warn("Invalid format for boolean condition"),ss;let Ts=!1,Ss=!1,Ns=function(ws,Es=!1){if(typeof ws=="string"){let _s=ns.textChildrenByCode[ws];return _s!==void 0?_s.stateValues.value.trim().replace(/\s+/," "):(_s=ns.textListChildrenByCode[ws],_s!==void 0?(_s.stateValues.unordered&&(Ss=!0),_s.stateValues.texts.map($s=>$s.trim().replace(/\s+/," "))):ws.trim())}return typeof ws=="number"?ws.toString():Es&&Array.isArray(ws)&&ws[0]==="*"?ws.slice(1).map(Ns).join(" "):(console.warn("Invalid format for boolean condition"),Ts=!0,"")};if(us=us.map(ws=>Ns(ws,!0)),Ts)return ss;let As=ns.unorderedCompare;if(rs&&Ss&&(As=!0),ls==="="){let ws=us[0];if(ns.matchPartial){let Es=us.slice(1).map($s=>checkEquality({object1:ws,object2:$s,isUnordered:As,partialMatches:ns.matchPartial,matchByExactPositions:ns.matchByExactPositions,caseInsensitiveMatch:ns.caseInsensitiveMatch}));return Es.reduce(($s,Rs)=>$s+Rs.fraction_equal,0)/Es.length}else return us.slice(1).every(Es=>checkEquality({object1:ws,object2:Es,isUnordered:As,partialMatches:ns.matchPartial,matchByExactPositions:ns.matchByExactPositions,caseInsensitiveMatch:ns.caseInsensitiveMatch}).fraction_equal===1)?1:0}else return ls==="ne"?us.length!==2?(console.warn("Invalid format for boolean condition"),0):checkEquality({object1:us[0],object2:us[1],isUnordered:As,partialMatches:ns.matchPartial,matchByExactPositions:ns.matchByExactPositions,caseInsensitiveMatch:ns.caseInsensitiveMatch}).fraction_equal===0?1:0:(console.warn("Invalid format for boolean condition"),ss)}else if(fs){if(cs)return console.warn("Invalid format for boolean condition"),ss;let Ts=!1;return us=us.map(function(Ss){if(typeof Ss=="string"){let Ns=ns.otherChildrenByCode[Ss];if(Ns!==void 0)return Ns.stateValues.value}return console.warn("Invalid format for boolean condition"),Ts=!0,null}),Ts?ss:ls==="="?us.slice(1).every(Ss=>deepCompare(Ss,us[0]))?1:0:ls==="ne"?us.length!==2?(console.warn("Invalid format for boolean condition"),0):deepCompare(us[0],us[1])?0:1:(console.warn("Invalid format for boolean condition"),0)}let gs;(ls==="lts"||ls==="gts")&&(gs=us[1].slice(1),us=us[0].slice(1));let ys=!1,bs=function(Ts){if(typeof Ts=="string"){let Ss=ns.mathChildrenByCode[Ts];return Ss!==void 0?(Ss.stateValues.unordered&&(ys=!0),Ss.stateValues.value.tree):(Ss=ns.mathListChildrenByCode[Ts],Ss!==void 0?(Ss.stateValues.unordered&&(ys=!0),["list",...Ss.stateValues.maths.map(Ns=>Ns.tree)]):(Ss=ns.numberChildrenByCode[Ts],Ss!==void 0?numberToMathExpression(Ss.stateValues.value).tree:(Ss=ns.numberListChildrenByCode[Ts],Ss!==void 0?(Ss.stateValues.unordered&&(ys=!0),["list",...Ss.stateValues.numbers]):Ts)))}return Array.isArray(Ts)?[Ts[0],...Ts.slice(1).map(bs)]:Ts},vs=us.map(function(Ts){return Context.fromAst(bs(Ts))}),xs=ns.unorderedCompare;if(rs&&ys&&(xs=!0),ls==="="){let Ts=vs[0];if(Number.isNaN(Ts.tree))return vs.slice(1).every(Ss=>Number.isNaN(Ss.tree))?1:0;if(ns.matchPartial){let Ss=vs.slice(1).map(As=>checkEquality({object1:Ts,object2:As,isUnordered:xs,partialMatches:ns.matchPartial,matchByExactPositions:ns.matchByExactPositions,symbolicEquality:ns.symbolicEquality,simplify:ns.simplifyOnCompare,expand:ns.expandOnCompare,allowedErrorInNumbers:ns.allowedErrorInNumbers,includeErrorInNumberExponents:ns.includeErrorInNumberExponents,allowedErrorIsAbsolute:ns.allowedErrorIsAbsolute,nSignErrorsMatched:ns.nSignErrorsMatched,nPeriodicSetMatchesRequired:ns.nPeriodicSetMatchesRequired,caseInsensitiveMatch:ns.caseInsensitiveMatch,matchBlanks:ns.matchBlanks}));return Ss.reduce((As,ws)=>As+ws.fraction_equal,0)/Ss.length}else return vs.slice(1).every(Ss=>checkEquality({object1:Ts,object2:Ss,isUnordered:xs,partialMatches:ns.matchPartial,matchByExactPositions:ns.matchByExactPositions,symbolicEquality:ns.symbolicEquality,simplify:ns.simplifyOnCompare,expand:ns.expandOnCompare,allowedErrorInNumbers:ns.allowedErrorInNumbers,includeErrorInNumberExponents:ns.includeErrorInNumberExponents,allowedErrorIsAbsolute:ns.allowedErrorIsAbsolute,nSignErrorsMatched:ns.nSignErrorsMatched,nPeriodicSetMatchesRequired:ns.nPeriodicSetMatchesRequired,caseInsensitiveMatch:ns.caseInsensitiveMatch,matchBlanks:ns.matchBlanks}).fraction_equal===1)?1:0}if(ls==="ne")return checkEquality({object1:vs[0],object2:vs[1],isUnordered:xs,partialMatches:ns.matchPartial,matchByExactPositions:ns.matchByExactPositions,symbolicEquality:ns.symbolicEquality,simplify:ns.simplifyOnCompare,expand:ns.expandOnCompare,allowedErrorInNumbers:ns.allowedErrorInNumbers,includeErrorInNumberExponents:ns.includeErrorInNumberExponents,allowedErrorIsAbsolute:ns.allowedErrorIsAbsolute,nSignErrorsMatched:ns.nSignErrorsMatched,nPeriodicSetMatchesRequired:ns.nPeriodicSetMatchesRequired,caseInsensitiveMatch:ns.caseInsensitiveMatch,matchBlanks:ns.matchBlanks}).fraction_equal===0?1:0;if(ls==="in"||ls==="notin"){let Ts=vs[0],Ns=vs[1].tree;if(!(Array.isArray(Ns)&&Ns[0]==="set"))return console.warn("Invalid format for boolean condition"),ss;if(ns.matchPartial){let ws=Ns.slice(1).map(Es=>checkEquality({object1:Ts,object2:Context.fromAst(Es),isUnordered:xs,partialMatches:ns.matchPartial,matchByExactPositions:ns.matchByExactPositions,symbolicEquality:ns.symbolicEquality,simplify:ns.simplifyOnCompare,expand:ns.expandOnCompare,allowedErrorInNumbers:ns.allowedErrorInNumbers,includeErrorInNumberExponents:ns.includeErrorInNumberExponents,allowedErrorIsAbsolute:ns.allowedErrorIsAbsolute,nSignErrorsMatched:ns.nSignErrorsMatched,nPeriodicSetMatchesRequired:ns.nPeriodicSetMatchesRequired,caseInsensitiveMatch:ns.caseInsensitiveMatch,matchBlanks:ns.matchBlanks})).reduce((Es,_s)=>Math.max(Es,_s.fraction_equal),0);return ls==="in"?ws:1-ws}else{let As=Ns.slice(1).some(ws=>checkEquality({object1:Ts,object2:Context.fromAst(ws),isUnordered:xs,partialMatches:ns.matchPartial,matchByExactPositions:ns.matchByExactPositions,symbolicEquality:ns.symbolicEquality,simplify:ns.simplifyOnCompare,expand:ns.expandOnCompare,allowedErrorInNumbers:ns.allowedErrorInNumbers,includeErrorInNumberExponents:ns.includeErrorInNumberExponents,allowedErrorIsAbsolute:ns.allowedErrorIsAbsolute,nSignErrorsMatched:ns.nSignErrorsMatched,nPeriodicSetMatchesRequired:ns.nPeriodicSetMatchesRequired,caseInsensitiveMatch:ns.caseInsensitiveMatch,matchBlanks:ns.matchBlanks}).fraction_equal===1);return ls==="in"?As?1:0:As?0:1}}let Cs=vs.map(Ts=>Ts.simplify().evaluate_to_constant());if(Cs.some(Ts=>Number.isNaN(Ts)))return 0;if(ls==="<")return Cs[0]")return Cs[0]>Cs[1]?1:0;if(ls==="le")return Cs[0]<=Cs[1]?1:0;if(ls==="ge")return Cs[0]>=Cs[1]?1:0;for(let Ts=0;TsCs[Ts+1]))return 0}else if(!(Cs[Ts]>=Cs[Ts+1]))return 0;return 1}function splitSymbolsIfMath({logicTree:as,nonMathCodes:rs,foundNonMath:ns=!1,init:ss=!0}){if(!Array.isArray(as))return typeof as=="string"&&!ns&&!ss?fromTextSplit(as).tree:as;let os=as[0],ls=as.slice(1);if(["and","not","or"].includes(os))return[os,...ls.map(us=>splitSymbolsIfMath({logicTree:us,nonMathCodes:rs,foundNonMath:ns,init:ss}))];if(ls.some(us=>rs.includes(us))&&(ns=!0),os==="apply"){ls=[ls[0],...ls.slice(1).map(cs=>splitSymbolsIfMath({logicTree:cs,nonMathCodes:rs,foundNonMath:ns,init:!1}))];let us=!1;if(ls[0]==="int"?us=!0:Array.isArray(ls[0])&&(ls[0][0]==="^"?(ls[0][1]==="int"||Array.isArray(ls[0][1])&&ls[0][1][0]==="_"&&ls[0][1][1]==="int")&&(us=!0):ls[0][0]==="_"&&ls[0][1]==="int"&&(us=!0)),us){ls=Context.fromAst([os,...ls]).tree.slice(1);let cs=ls[1];if(Array.isArray(cs)&&cs[0]==="*"){let ds=[];for(let ps=0;pssplitSymbolsIfMath({logicTree:us,nonMathCodes:rs,foundNonMath:ns,init:!1}))]}class BooleanComponent extends InlineComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.symbolicEquality={createComponentOfType:"boolean",createStateVariable:"symbolicEquality",defaultValue:!1,public:!0},rs.expandOnCompare={createComponentOfType:"boolean",createStateVariable:"expandOnCompare",defaultValue:!1,public:!0},rs.simplifyOnCompare={createComponentOfType:"text",createStateVariable:"simplifyOnCompare",defaultValue:"none",toLowerCase:!0,valueTransformations:{"":"full",true:"full",false:"none"},validValues:["none","full","numbers","numbersepreserveorder"],public:!0},rs.unorderedCompare={createComponentOfType:"boolean",createStateVariable:"unorderedCompare",defaultValue:!1,public:!0},rs.matchByExactPositions={createComponentOfType:"boolean",createStateVariable:"matchByExactPositions",defaultValue:!1,public:!0},rs.allowedErrorInNumbers={createComponentOfType:"number",createStateVariable:"allowedErrorInNumbers",defaultValue:0,public:!0},rs.includeErrorInNumberExponents={createComponentOfType:"boolean",createStateVariable:"includeErrorInNumberExponents",defaultValue:!1,public:!0},rs.allowedErrorIsAbsolute={createComponentOfType:"boolean",createStateVariable:"allowedErrorIsAbsolute",defaultValue:!1,public:!0},rs.nSignErrorsMatched={createComponentOfType:"number",createStateVariable:"nSignErrorsMatched",defaultValue:0,public:!0},rs.nPeriodicSetMatchesRequired={createComponentOfType:"integer",createStateVariable:"nPeriodicSetMatchesRequired",defaultValue:3,public:!0},rs.caseInsensitiveMatch={createComponentOfType:"boolean",createStateVariable:"caseInsensitiveMatch",defaultValue:!1,public:!0},rs.matchBlanks={createComponentOfType:"boolean",createStateVariable:"matchBlanks",defaultValue:!1,public:!0},rs}static returnChildGroups(){return[{group:"strings",componentTypes:["string"]},{group:"comparableTypes",componentTypes:["math","mathList","number","numberList","text","textList","boolean","booleanList","orbitalDiagram"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.parsedExpression={additionalStateVariablesDefined:["codePre"],returnDependencies:()=>({allChildren:{dependencyType:"child",childGroups:["strings","comparableTypes"]},stringChildren:{dependencyType:"child",childGroups:["strings"],variableNames:["value"]}}),definition:buildParsedExpression},rs.mathChildrenByCode={additionalStateVariablesDefined:["mathListChildrenByCode","numberChildrenByCode","numberListChildrenByCode","textChildrenByCode","textListChildrenByCode","booleanChildrenByCode","booleanListChildrenByCode","otherChildrenByCode"],returnDependencies:()=>({allChildren:{dependencyType:"child",childGroups:["strings","comparableTypes"],variableNames:["value","texts","maths","numbers","booleans","fractionSatisfied","unordered"],variablesOptional:!0},codePre:{dependencyType:"stateVariable",variableName:"codePre"}}),definition({dependencyValues:ns,componentInfoObjects:ss}){let os={},ls={},us={},cs={},ds={},ps={},fs={},hs={},gs={},ys=0,bs=ns.codePre;for(let vs of ns.allChildren)if(typeof vs!="string"){let xs=bs+ys;ss.isInheritedComponentType({inheritedComponentType:vs.componentType,baseComponentType:"math"})?os[xs]=vs:ss.isInheritedComponentType({inheritedComponentType:vs.componentType,baseComponentType:"mathList"})?ls[xs]=vs:ss.isInheritedComponentType({inheritedComponentType:vs.componentType,baseComponentType:"number"})?us[xs]=vs:ss.isInheritedComponentType({inheritedComponentType:vs.componentType,baseComponentType:"numberList"})?cs[xs]=vs:ss.isInheritedComponentType({inheritedComponentType:vs.componentType,baseComponentType:"text"})?ds[xs]=vs:ss.isInheritedComponentType({inheritedComponentType:vs.componentType,baseComponentType:"textList"})?ps[xs]=vs:ss.isInheritedComponentType({inheritedComponentType:vs.componentType,baseComponentType:"boolean"})?fs[xs]=vs:ss.isInheritedComponentType({inheritedComponentType:vs.componentType,baseComponentType:"booleanList"})?hs[xs]=vs:gs[xs]=vs,ys+=1}return{setValue:{mathChildrenByCode:os,mathListChildrenByCode:ls,numberChildrenByCode:us,numberListChildrenByCode:cs,textChildrenByCode:ds,textListChildrenByCode:ps,booleanChildrenByCode:fs,booleanListChildrenByCode:hs,otherChildrenByCode:gs}}}},rs.value={public:!0,shadowingInstructions:{createComponentOfType:"boolean",attributesToShadow:["fixed"]},forRenderer:!0,hasEssential:!0,defaultValue:!1,set:Boolean,returnDependencies:()=>({symbolicEquality:{dependencyType:"stateVariable",variableName:"symbolicEquality"},expandOnCompare:{dependencyType:"stateVariable",variableName:"expandOnCompare"},simplifyOnCompare:{dependencyType:"stateVariable",variableName:"simplifyOnCompare"},unorderedCompare:{dependencyType:"stateVariable",variableName:"unorderedCompare"},matchByExactPositions:{dependencyType:"stateVariable",variableName:"matchByExactPositions"},allowedErrorInNumbers:{dependencyType:"stateVariable",variableName:"allowedErrorInNumbers"},includeErrorInNumberExponents:{dependencyType:"stateVariable",variableName:"includeErrorInNumberExponents"},allowedErrorIsAbsolute:{dependencyType:"stateVariable",variableName:"allowedErrorIsAbsolute"},nSignErrorsMatched:{dependencyType:"stateVariable",variableName:"nSignErrorsMatched"},nPeriodicSetMatchesRequired:{dependencyType:"stateVariable",variableName:"nPeriodicSetMatchesRequired"},caseInsensitiveMatch:{dependencyType:"stateVariable",variableName:"caseInsensitiveMatch"},matchBlanks:{dependencyType:"stateVariable",variableName:"matchBlanks"},parsedExpression:{dependencyType:"stateVariable",variableName:"parsedExpression"},allChildren:{dependencyType:"child",childGroups:["strings","comparableTypes"],variableNames:["value"],variablesOptional:!0},booleanChildrenByCode:{dependencyType:"stateVariable",variableName:"booleanChildrenByCode"},booleanListChildrenByCode:{dependencyType:"stateVariable",variableName:"booleanListChildrenByCode"},textChildrenByCode:{dependencyType:"stateVariable",variableName:"textChildrenByCode"},textListChildrenByCode:{dependencyType:"stateVariable",variableName:"textListChildrenByCode"},mathChildrenByCode:{dependencyType:"stateVariable",variableName:"mathChildrenByCode"},mathListChildrenByCode:{dependencyType:"stateVariable",variableName:"mathListChildrenByCode"},numberChildrenByCode:{dependencyType:"stateVariable",variableName:"numberChildrenByCode"},numberListChildrenByCode:{dependencyType:"stateVariable",variableName:"numberListChildrenByCode"},otherChildrenByCode:{dependencyType:"stateVariable",variableName:"otherChildrenByCode"}}),definition({dependencyValues:ns,usedDefault:ss}){if(ns.allChildren.length===0)return{useEssentialOrDefaultValue:{value:!0}};if(ns.parsedExpression===null)return{setValue:{value:!1}};let os=ss.unorderedCompare;return{setValue:{value:evaluateLogic({logicTree:ns.parsedExpression.tree,canOverrideUnorderedCompare:os,dependencyValues:ns})===1}}},inverseDefinition:function({desiredStateVariableValues:ns,dependencyValues:ss,componentInfoObjects:os}){if(ss.allChildren.length===0)return{success:!0,instructions:[{setEssentialValue:"value",value:!!ns.value}]};if(ss.allChildren.length===1){let ls=ss.allChildren[0];if(typeof ls=="string")return{success:!0,instructions:[{setDependency:"allChildren",desiredValue:ns.value.toString(),childIndex:0,variableIndex:0}]};if(os.isInheritedComponentType({inheritedComponentType:ls.componentType,baseComponentType:"boolean"}))return{success:!0,instructions:[{setDependency:"allChildren",desiredValue:ns.value,childIndex:0,variableIndex:0}]}}return{success:!1}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition:function({dependencyValues:ns}){return{setValue:{text:ns.value?"true":"false"}}},inverseDefinition({desiredStateVariableValues:ns}){let ss=String(ns.text).toLowerCase(),os;return ss==="true"?os=!0:ss==="false"&&(os=!1),os!==void 0?{success:!0,instructions:[{setDependency:"value",desiredValue:os}]}:{success:!1}}},rs}}zs(BooleanComponent,"componentType","boolean"),zs(BooleanComponent,"variableForPlainMacro","value"),zs(BooleanComponent,"descendantCompositesMustHaveAReplacement",!0),zs(BooleanComponent,"descendantCompositesDefaultReplacementType","math"),zs(BooleanComponent,"adapters",["text"]);class BooleanOperator extends BooleanComponent{static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss}){return{success:!0,newChildren:ss.reduce(function(ls,us){return typeof us=="string"?[...ls,...us.split(/\s+/).filter(cs=>cs).map(cs=>({componentType:"boolean",children:[cs]}))]:[...ls,us]},[])}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"booleans",componentTypes:["boolean"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();delete rs.parsedExpression,delete rs.mathChildrenByCode;let ns=this;return rs.value={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},forRenderer:!0,returnDependencies:()=>({booleanChildren:{dependencyType:"child",childGroups:["booleans"],variableNames:["value"]}}),definition:function({dependencyValues:ss}){return{setValue:{value:ns.applyBooleanOperator(ss.booleanChildren.map(os=>os.stateValues.value))}}}},rs}}zs(BooleanOperator,"componentType","_booleanOperator"),zs(BooleanOperator,"rendererType","boolean"),zs(BooleanOperator,"descendantCompositesMustHaveAReplacement",!1);class BooleanOperatorOneInput extends BooleanComponent{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=this;return renameStateVariable({stateVariableDefinitions:rs,oldName:"value",newName:"valuePreOperator"}),rs.value={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},forRenderer:!0,returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"valuePreOperator"}}),definition:function({dependencyValues:ss}){return{setValue:{value:ns.applyBooleanOperator(ss.value)}}}},rs}}zs(BooleanOperatorOneInput,"componentType","_booleanOperatorOneInput"),zs(BooleanOperatorOneInput,"rendererType","boolean");class Not extends BooleanOperatorOneInput{static applyBooleanOperator(rs){return!rs}}zs(Not,"componentType","not");class And extends BooleanOperator{static applyBooleanOperator(rs){return rs.every(ns=>ns)}}zs(And,"componentType","and");var dp;let Or$1=(dp=class extends BooleanOperator{static applyBooleanOperator(rs){return rs.some(ns=>ns)}},zs(dp,"componentType","or"),dp);class Xor extends BooleanOperator{static applyBooleanOperator(rs){return rs.reduce((ss,os)=>ss+os,0)===1}}zs(Xor,"componentType","xor");const BooleanOperators=Object.freeze(Object.defineProperty({__proto__:null,And,Not,Or:Or$1,Xor},Symbol.toStringTag,{value:"Module"}));class BooleanBaseOperatorOfMath extends BooleanComponent{static returnSugarInstructions(){let rs=[],ns=function({matchedChildren:ss}){return ss.every(os=>typeof os=="string"||os.doenetAttributes&&os.doenetAttributes.createdFromMacro)?ss.length===1&&typeof ss[0]!="string"?{success:!1}:{success:!0,newChildren:[{componentType:"math",children:ss}]}:{success:!1}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"maths",componentTypes:["math"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return delete rs.parsedExpression,delete rs.mathChildrenByCode,rs.booleanOperator={returnDependencies:()=>({}),definition:()=>({setValue:{booleanOperator:ns=>!1}})},rs.value={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},forRenderer:!0,returnDependencies:()=>({mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["value"]},booleanOperator:{dependencyType:"stateVariable",variableName:"booleanOperator"}}),definition:function({dependencyValues:ns}){return{setValue:{value:ns.booleanOperator(ns.mathChildren.map(ss=>ss.stateValues.value))}}}},rs}}zs(BooleanBaseOperatorOfMath,"componentType","_booleanOperatorOfMath"),zs(BooleanBaseOperatorOfMath,"rendererType","boolean");class IsInteger extends BooleanBaseOperatorOfMath{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.booleanOperator.definition=()=>({setValue:{booleanOperator:function(ns){if(ns.length===0)return!1;if(ns.length!==1)return console.warn("IsInteger requires exactly one math child"),null;let ss=ns[0].evaluate_to_constant();if(!Number.isFinite(ss))return!1;let os=Math.round(ss);return Math.abs(os-ss)<=1e-15*Math.abs(ss)}}}),rs}}zs(IsInteger,"componentType","isInteger");class IsNumber extends BooleanBaseOperatorOfMath{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.booleanOperator.definition=()=>({setValue:{booleanOperator:function(ns){if(ns.length===0)return!1;if(ns.length!==1)return console.warn("IsNumber requires exactly one math child"),null;let ss=ns[0].evaluate_to_constant();return Number.isFinite(ss)}}}),rs}}zs(IsNumber,"componentType","isNumber");class IsBetween extends BooleanBaseOperatorOfMath{static createAttributesObject(){let rs=super.createAttributesObject();return rs.limits={createComponentOfType:"numberList",createStateVariable:"limits",defaultValue:[],public:!0},rs.strict={createComponentOfType:"boolean",createStateVariable:"strict",defaultValue:!1,public:!0},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.booleanOperator={returnDependencies:()=>({limits:{dependencyType:"stateVariable",variableName:"limits"},strict:{dependencyType:"stateVariable",variableName:"strict"}}),definition({dependencyValues:ns}){let ss,os,ls=ns.limits[0],us=ns.limits[1];if(ls!1}};let cs=ns.strict;return{setValue:{booleanOperator:function(ds){if(ds.length===0)return!1;if(ds.length!==1)return console.warn("IsBetween requires exactly one math child"),null;let ps=ds[0].evaluate_to_constant();return cs?ps>os&&ps=os&&ps<=ss}}}}},rs}}zs(IsBetween,"componentType","isBetween");const BooleanOperatorsOfMath=Object.freeze(Object.defineProperty({__proto__:null,IsBetween,IsInteger,IsNumber},Symbol.toStringTag,{value:"Module"}));class MathOperator extends MathComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.forceSymbolic={createComponentOfType:"boolean",createStateVariable:"forceSymbolic",defaultValue:!1,public:!0},rs.forceNumeric={createComponentOfType:"boolean",createStateVariable:"forceNumeric",defaultValue:!1,public:!0},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss}){return{success:!0,newChildren:ss.reduce(function(ls,us){return typeof us=="string"?[...ls,...us.split(/\s+/).filter(cs=>cs).map(cs=>({componentType:Number.isFinite(Number(cs))?"number":"math",children:[cs]}))]:[...ls,us]},[])}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"maths",componentTypes:["math"]},{group:"numbers",componentTypes:["number"]},{group:"mathLists",componentTypes:["mathList"]},{group:"numberLists",componentTypes:["numberList"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.displayDigits={public:!0,shadowingInstructions:{createComponentOfType:"integer"},hasEssential:!0,defaultValue:10,returnDependencies:()=>({displayDigitsAttr:{dependencyType:"attributeComponent",attributeName:"displayDigits",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]},mathLikeChildren:{dependencyType:"child",childGroups:["maths","numbers","mathLists","numberLists"],variableNames:["displayDigits"]}}),definition({dependencyValues:ns,usedDefault:ss}){return ns.displayDigitsAttr!==null?{setValue:{displayDigits:ns.displayDigitsAttr.stateValues.value}}:ns.displayDecimalsAttr===null&&ns.mathLikeChildren.length===1&&!(ss.mathLikeChildren[0]&&ss.mathLikeChildren[0].displayDigits)?{setValue:{displayDigits:ns.mathLikeChildren[0].stateValues.displayDigits}}:{useEssentialOrDefaultValue:{displayDigits:!0}}}},rs.displayDecimals={public:!0,shadowingInstructions:{createComponentOfType:"integer"},hasEssential:!0,defaultValue:null,returnDependencies:()=>({displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]},mathLikeChildren:{dependencyType:"child",childGroups:["maths","numbers","mathLists","numberLists"],variableNames:["displayDecimals"]}}),definition({dependencyValues:ns,usedDefault:ss}){return ns.displayDecimalsAttr!==null?{setValue:{displayDecimals:ns.displayDecimalsAttr.stateValues.value}}:ns.mathLikeChildren.length===1&&!(ss.mathLikeChildren[0]&&ss.mathLikeChildren[0].displayDecimals)?{setValue:{displayDecimals:ns.mathLikeChildren[0].stateValues.displayDecimals}}:{useEssentialOrDefaultValue:{displayDecimals:!0}}}},rs.displaySmallAsZero={public:!0,shadowingInstructions:{createComponentOfType:"number"},hasEssential:!0,defaultValue:0,returnDependencies:()=>({displaySmallAsZeroAttr:{dependencyType:"attributeComponent",attributeName:"displaySmallAsZero",variableNames:["value"]},mathLikeChildren:{dependencyType:"child",childGroups:["maths","numbers","mathLists","numberLists"],variableNames:["displaySmallAsZero"]}}),definition({dependencyValues:ns,usedDefault:ss}){return ns.displaySmallAsZeroAttr!==null?{setValue:{displaySmallAsZero:ns.displaySmallAsZeroAttr.stateValues.value}}:ns.mathLikeChildren.length===1&&!(ss.mathLikeChildren[0]&&ss.mathLikeChildren[0].displaySmallAsZero)?{setValue:{displaySmallAsZero:ns.mathLikeChildren[0].stateValues.displaySmallAsZero}}:{useEssentialOrDefaultValue:{displaySmallAsZero:!0}}}},rs.padZeros={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},hasEssential:!0,defaultValue:!1,returnDependencies:()=>({padZerosAttr:{dependencyType:"attributeComponent",attributeName:"padZeros",variableNames:["value"]},mathLikeChildren:{dependencyType:"child",childGroups:["maths","numbers","mathLists","numberLists"],variableNames:["padZeros"]}}),definition({dependencyValues:ns,usedDefault:ss}){return ns.padZerosAttr!==null?{setValue:{padZeros:ns.padZerosAttr.stateValues.value}}:ns.mathLikeChildren.length===1&&!(ss.mathLikeChildren[0]&&ss.mathLikeChildren[0].padZeros)?{setValue:{padZeros:ns.mathLikeChildren[0].stateValues.padZeros}}:{useEssentialOrDefaultValue:{padZeros:!0}}}},rs.isNumericOperator={returnDependencies:()=>({forceNumeric:{dependencyType:"stateVariable",variableName:"forceNumeric"},forceSymbolic:{dependencyType:"stateVariable",variableName:"forceSymbolic"},mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["isNumber"],variablesOptional:!0},mathListChildren:{dependencyType:"child",childGroups:["mathLists"],variableNames:["maths"]}}),definition({dependencyValues:ns}){let ss;return ns.forceNumeric?ss=!0:ns.forceSymbolic?ss=!1:ns.mathChildren.length===0&&ns.mathListChildren.length===0?ss=!0:ss=ns.mathChildren.every(os=>os.stateValues.isNumber)&&ns.mathListChildren.every(os=>os.stateValues.maths.every(ls=>Number.isFinite(ls.tree))),{setValue:{isNumericOperator:ss}}}},delete rs.codePre,delete rs.expressionWithCodes,delete rs.mathChildrenFunctionSymbols,delete rs.codesAdjacentToStrings,delete rs.mathChildrenByVectorComponent,rs.mathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{mathOperator:ns=>Context.fromAst("_")}})},rs.numericOperator={returnDependencies:()=>({}),definition:()=>({setValue:{numericOperator:ns=>Context.fromAst("_")}})},rs.inverseMathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{inverseMathOperator:null}})},rs.inverseNumericOperator={returnDependencies:()=>({}),definition:()=>({setValue:{inverseNumericOperator:null}})},rs.unnormalizedValue={returnDependencies:()=>({mathNumberChildren:{dependencyType:"child",childGroups:["maths","numbers","mathLists","numberLists"],variableNames:["value","maths","numbers","canBeModified"],variablesOptional:!0},isNumericOperator:{dependencyType:"stateVariable",variableName:"isNumericOperator"},mathOperator:{dependencyType:"stateVariable",variableName:"mathOperator"},numericOperator:{dependencyType:"stateVariable",variableName:"numericOperator"},inverseMathOperator:{dependencyType:"stateVariable",variableName:"inverseMathOperator"},inverseNumericOperator:{dependencyType:"stateVariable",variableName:"inverseNumericOperator"}}),definition:function({dependencyValues:ns,componentInfoObjects:ss}){if(ns.mathNumberChildren.length===0)return{setValue:{unnormalizedValue:Context.fromAst("_")}};if(ns.isNumericOperator){let os=[];for(let ls of ns.mathNumberChildren)if(ss.isInheritedComponentType({inheritedComponentType:ls.componentType,baseComponentType:"number"}))os.push(ls.stateValues.value);else if(ss.isInheritedComponentType({inheritedComponentType:ls.componentType,baseComponentType:"math"})){let us=ls.stateValues.value.evaluate_to_constant();os.push(us)}else if(ss.isInheritedComponentType({inheritedComponentType:ls.componentType,baseComponentType:"numberList"}))os.push(...ls.stateValues.numbers);else{let us=ls.stateValues.maths.map(cs=>{let ds=cs.evaluate_to_constant();return Number.isFinite(ds)||(ds=NaN),ds});os.push(...us)}return{setValue:{unnormalizedValue:Context.fromAst(ns.numericOperator(os))}}}else{let os=[];for(let ls of ns.mathNumberChildren)ss.isInheritedComponentType({inheritedComponentType:ls.componentType,baseComponentType:"number"})?os.push(Context.fromAst(ls.stateValues.value)):ss.isInheritedComponentType({inheritedComponentType:ls.componentType,baseComponentType:"math"})?os.push(ls.stateValues.value):ss.isInheritedComponentType({inheritedComponentType:ls.componentType,baseComponentType:"numberList"})?os.push(...ls.stateValues.numbers.map(us=>Context.fromAst(us))):os.push(...ls.stateValues.maths);return{setValue:{unnormalizedValue:ns.mathOperator(os)}}}},inverseDefinition:function({desiredStateVariableValues:ns,dependencyValues:ss,componentInfoObjects:os}){if(ss.mathNumberChildren.length===0)return{success:!1};if(ss.isNumericOperator)if(ss.inverseNumericOperator){let ls=[],us=[],cs=[];for(let[ps,fs]of ss.mathNumberChildren.entries())if(os.isInheritedComponentType({inheritedComponentType:fs.componentType,baseComponentType:"number"}))ls.push(fs.stateValues.value),us.push(fs.stateValues.canBeModified),cs.push(ps);else if(os.isInheritedComponentType({inheritedComponentType:fs.componentType,baseComponentType:"math"})){let hs=fs.stateValues.value.evaluate_to_constant();ls.push(hs),us.push(fs.stateValues.canBeModified),cs.push(ps)}else if(os.isInheritedComponentType({inheritedComponentType:fs.componentType,baseComponentType:"numberList"}))ls.push(...fs.stateValues.numbers),us.push(...Array(fs.stateValues.numbers.length).fill(fs.stateValues.canBeModified)),fs.stateValues.numbers.length===1?cs.push(ps):cs.push(...Array(fs.stateValues.numbers.length).fill(NaN));else{let hs=fs.stateValues.maths.map(gs=>gs.evaluate_to_constant());ls.push(...hs),us.push(...Array(fs.stateValues.maths.length).fill(fs.stateValues.canBeModified)),fs.stateValues.maths.length===1?cs.push(ps):cs.push(...Array(fs.stateValues.maths.length).fill(NaN))}let ds=ss.inverseNumericOperator({desiredValue:ns.unnormalizedValue.evaluate_to_constant(),inputs:ls,canBeModified:us,desiredMathValue:ns.unnormalizedValue});if(ds.success){let ps=cs[ds.inputNumber];if(Number.isFinite(ps)){let fs=ds.inputValue,hs=0,gs=ss.mathNumberChildren[ps];return os.isInheritedComponentType({inheritedComponentType:gs.componentType,baseComponentType:"numberList"})?(hs=2,fs={0:fs}):os.isInheritedComponentType({inheritedComponentType:gs.componentType,baseComponentType:"mathList"})&&(hs=1,fs={0:fs}),{success:!0,instructions:[{setDependency:"mathNumberChildren",desiredValue:fs,childIndex:ps,variableIndex:hs}]}}else return{success:!1}}else return{success:!1}}else return{success:!1};else if(ss.inverseMathOperator){let ls=[],us=[],cs=[];for(let[ps,fs]of ss.mathNumberChildren.entries())os.isInheritedComponentType({inheritedComponentType:fs.componentType,baseComponentType:"number"})?(ls.push(Context.fromAst(fs.stateValues.value)),us.push(fs.stateValues.canBeModified),cs.push(ps)):os.isInheritedComponentType({inheritedComponentType:fs.componentType,baseComponentType:"math"})?(ls.push(fs.stateValues.value),us.push(fs.stateValues.canBeModified),cs.push(ps)):os.isInheritedComponentType({inheritedComponentType:fs.componentType,baseComponentType:"numberList"})?(ls.push(...fs.stateValues.numbers.map(hs=>Context.fromAst(hs))),us.push(...Array(fs.stateValues.numbers.length).fill(fs.stateValues.canBeModified)),fs.stateValues.numbers.length===1?cs.push(ps):cs.push(...Array(fs.stateValues.numbers.length).fill(NaN))):(ls.push(...fs.stateValues.maths),us.push(...Array(fs.stateValues.maths.length).fill(fs.stateValues.canBeModified)),fs.stateValues.maths.length===1?cs.push(ps):cs.push(...Array(fs.stateValues.maths.length).fill(NaN)));let ds=ss.inverseMathOperator({desiredValue:ns.unnormalizedValue,inputs:ls,canBeModified:us});if(ds.success){let ps=cs[ds.inputNumber];if(Number.isFinite(ps)){let fs=ds.inputValue,hs=0,gs=ss.mathNumberChildren[ps];return os.isInheritedComponentType({inheritedComponentType:gs.componentType,baseComponentType:"numberList"})?(hs=2,fs={0:fs}):os.isInheritedComponentType({inheritedComponentType:gs.componentType,baseComponentType:"mathList"})&&(hs=1,fs={0:fs}),{success:!0,instructions:[{setDependency:"mathNumberChildren",desiredValue:fs,childIndex:ps,variableIndex:hs}]}}else return{success:!1}}else return{success:!1}}else return{success:!1}}},rs.canBeModified={returnDependencies:()=>({modifyIndirectly:{dependencyType:"stateVariable",variableName:"modifyIndirectly"},fixed:{dependencyType:"stateVariable",variableName:"fixed"},mathNumberChildren:{dependencyType:"child",childGroups:["maths","numbers"],variableNames:["canBeModified"]},mathNumberListChildren:{dependencyType:"child",childGroups:["mathLists","numberLists"],variableNames:["nComponents"]},isNumericOperator:{dependencyType:"stateVariable",variableName:"isNumericOperator"},inverseMathOperator:{dependencyType:"stateVariable",variableName:"mathOperator"},inverseNumericOperator:{dependencyType:"stateVariable",variableName:"inverseNumericOperator"}}),definition:function({dependencyValues:ns}){let ss=ns.modifyIndirectly&&!ns.fixed&&!!(ns.isNumericOperator?ns.inverseNumericOperator:ns.inverseMathOperator);return ss&&ns.mathNumberChildren.length+ns.mathNumberListChildren.length>0&&ns.mathNumberChildren.filter(ls=>ls.stateValues.canBeModified).length+ns.mathNumberListChildren.reduce((ls,us)=>ls+us.stateValues.nComponents,0)!==1&&(ss=!1),{setValue:{canBeModified:ss}}}},rs}}zs(MathOperator,"componentType","_mathOperator"),zs(MathOperator,"rendererType","math"),zs(MathOperator,"descendantCompositesMustHaveAReplacement",!1);class MathOperatorOneInput extends MathComponent{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.mathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{mathOperator:ns=>me.fromAst("_")}})},rs.inverseMathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{inverseMathOperator:null}})},renameStateVariable({stateVariableDefinitions:rs,oldName:"unnormalizedValue",newName:"unnormalizedValuePreOperator"}),rs.unnormalizedValue={returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"unnormalizedValuePreOperator"},mathOperator:{dependencyType:"stateVariable",variableName:"mathOperator"},inverseMathOperator:{dependencyType:"stateVariable",variableName:"inverseMathOperator"}}),definition:function({dependencyValues:ns}){return{setValue:{unnormalizedValue:ns.mathOperator(ns.value)}}},inverseDefinition:function({desiredStateVariableValues:ns,dependencyValues:ss,componentName:os}){return ss.inverseMathOperator?{success:!0,instructions:[{setDependency:"value",desiredValue:ss.inverseMathOperator(ns.unnormalizedValue)}]}:{success:!1}}},renameStateVariable({stateVariableDefinitions:rs,oldName:"canBeModified",newName:"canBeModifiedPreOperator"}),rs.canBeModified={returnDependencies:()=>({canBeModifiedPreOperator:{dependencyType:"stateVariable",variableName:"canBeModifiedPreOperator"},inverseMathOperator:{dependencyType:"stateVariable",variableName:"mathOperator"}}),definition:function({dependencyValues:ns}){let ss=ns.canBeModifiedPreOperator;return ns.inverseMathOperator||(ss=!1),{setValue:{canBeModified:ss}}}},rs}}zs(MathOperatorOneInput,"componentType","_mathOperatorOneInput"),zs(MathOperatorOneInput,"rendererType","math");class Sum extends MathOperator{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.numericOperator={returnDependencies:()=>({}),definition:()=>({setValue:{numericOperator:function(ns){return ns.reduce((ss,os)=>ss+os)}}})},rs.mathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{mathOperator:function(ns){return ns.reduce((ss,os)=>ss.add(os))}}})},rs}}zs(Sum,"componentType","sum");class Product extends MathOperator{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.numericOperator={returnDependencies:()=>({}),definition:()=>({setValue:{numericOperator:function(ns){return ns.reduce((ss,os)=>ss*os)}}})},rs.mathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{mathOperator:function(ns){return ns.reduce((ss,os)=>ss.multiply(os))}}})},rs}}zs(Product,"componentType","product");class ClampNumber extends MathOperatorOneInput{static createAttributesObject(){let rs=super.createAttributesObject();return rs.lowerValue={createComponentOfType:"number",createStateVariable:"lowerValue",defaultValue:0,public:!0},rs.upperValue={createComponentOfType:"number",createStateVariable:"upperValue",defaultValue:1,public:!0},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.isNumericOperator={returnDependencies:()=>({}),definition:()=>({setValue:{isNumericOperator:!0}})},rs.mathOperator={returnDependencies:()=>({lowerValue:{dependencyType:"stateVariable",variableName:"lowerValue"},upperValue:{dependencyType:"stateVariable",variableName:"upperValue"}}),definition:({dependencyValues:ns})=>({setValue:{mathOperator:function(ss){return clamp({value:ss,lowerValue:ns.lowerValue,upperValue:ns.upperValue})}}})},rs.inverseMathOperator={returnDependencies:()=>({lowerValue:{dependencyType:"stateVariable",variableName:"lowerValue"},upperValue:{dependencyType:"stateVariable",variableName:"upperValue"}}),definition:({dependencyValues:ns})=>({setValue:{inverseMathOperator:function(ss){return clamp({value:ss,lowerValue:ns.lowerValue,upperValue:ns.upperValue})}}})},rs}}zs(ClampNumber,"componentType","clampNumber");function clamp({value:as,lowerValue:rs,upperValue:ns}){let ss=as;return ss instanceof Context.class&&(ss=ss.evaluate_to_constant()),Context.fromAst(Math.max(rs,Math.min(ns,ss)))}class WrapNumberPeriodic extends MathOperatorOneInput{static createAttributesObject(){let rs=super.createAttributesObject();return rs.lowerValue={createComponentOfType:"number",createStateVariable:"lowerValue",defaultValue:0,public:!0},rs.upperValue={createComponentOfType:"number",createStateVariable:"upperValue",defaultValue:1,public:!0},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.isNumericOperator={returnDependencies:()=>({}),definition:()=>({setValue:{isNumericOperator:!0}})},rs.mathOperator={returnDependencies:()=>({lowerValue:{dependencyType:"stateVariable",variableName:"lowerValue"},upperValue:{dependencyType:"stateVariable",variableName:"upperValue"}}),definition:({dependencyValues:ns})=>({setValue:{mathOperator:function(ss){return makePeriodic({value:ss,lowerValue:ns.lowerValue,upperValue:ns.upperValue})}}})},rs.inverseMathOperator={returnDependencies:()=>({lowerValue:{dependencyType:"stateVariable",variableName:"lowerValue"},upperValue:{dependencyType:"stateVariable",variableName:"upperValue"}}),definition:({dependencyValues:ns})=>({setValue:{inverseMathOperator:function(ss){return makePeriodic({value:ss,lowerValue:ns.lowerValue,upperValue:ns.upperValue})}}})},rs}}zs(WrapNumberPeriodic,"componentType","wrapNumberPeriodic");function makePeriodic({value:as,lowerValue:rs,upperValue:ns}){let ss=as;return ss instanceof Context.class&&(ss=ss.evaluate_to_constant()),Number.isFinite(ss)?rs===ns?Context.fromAst(rs):(rs>ns&&([ns,rs]=[rs,ns]),Context.fromAst(rs+Context.math.mod(ss-rs,ns-rs))):Context.fromAst(NaN)}class Round extends MathOperatorOneInput{static createAttributesObject(){let rs=super.createAttributesObject();return rs.numberDecimals={createComponentOfType:"number",createStateVariable:"numberDecimals",defaultValue:0,public:!0},rs.numberDigits={createComponentOfType:"number",createStateVariable:"numberDigits",defaultValue:null,public:!0},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.mathOperator={returnDependencies:()=>({numberDecimals:{dependencyType:"stateVariable",variableName:"numberDecimals"},numberDigits:{dependencyType:"stateVariable",variableName:"numberDigits"}}),definition:({dependencyValues:ns})=>({setValue:{mathOperator:function(ss){let os=ss.evaluate_numbers({max_digits:1/0,evaluate_functions:!0});return ns.numberDigits!==null?os.round_numbers_to_precision(ns.numberDigits):os.round_numbers_to_decimals(ns.numberDecimals)}}})},rs.inverseMathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{inverseMathOperator:ns=>ns}})},rs}}zs(Round,"componentType","round");class setSmallToZero extends MathOperatorOneInput{static createAttributesObject(){let rs=super.createAttributesObject();return rs.threshold={createComponentOfType:"number",createStateVariable:"threshold",defaultValue:1e-14,public:!0},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.mathOperator={returnDependencies:()=>({threshold:{dependencyType:"stateVariable",variableName:"threshold"}}),definition:({dependencyValues:ns})=>({setValue:{mathOperator:function(ss){return ss.evaluate_numbers({skip_ordering:!0,set_small_zero:ns.threshold})}}})},rs.inverseMathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{inverseMathOperator:ns=>ns}})},rs}}zs(setSmallToZero,"componentType","setSmallToZero");class ConvertSetToList extends MathOperatorOneInput{static createAttributesObject(){let rs=super.createAttributesObject();return delete rs.unordered,rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.unordered={returnDependencies:()=>({}),definition:()=>({setValue:{unordered:!0}})},rs.mathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{mathOperator:function(ns){if(ns!==void 0&&Array.isArray(ns.tree)&&ns.tree[0]==="set"){let ss=[];for(let os of ns.tree.slice(1))ss.some(ls=>ns.context.equalsViaSyntax(ns.context.fromAst(ls),ns.context.fromAst(os)))||ss.push(os);return ns.context.fromAst(["list",...ss])}return ns}}})},rs}}zs(ConvertSetToList,"componentType","convertSetToList");class Ceil extends MathOperatorOneInput{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.mathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{mathOperator:function(ns){let ss=ns.evaluate_to_constant();if(!Number.isFinite(ss))return Context.fromAst(["apply","ceil",ns.tree]);let os=Math.round(ss);return Math.abs((os-ss)/ss)<1e-15?Context.fromAst(os):Context.fromAst(Math.ceil(ss))}}})},rs.inverseMathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{inverseMathOperator:ns=>ns}})},rs}}zs(Ceil,"componentType","ceil");class Floor extends MathOperatorOneInput{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.mathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{mathOperator:function(ns){let ss=ns.evaluate_to_constant();if(!Number.isFinite(ss))return Context.fromAst(["apply","floor",ns.tree]);let os=Math.round(ss);return Math.abs((os-ss)/ss)<1e-15?Context.fromAst(os):Context.fromAst(Math.floor(ss))}}})},rs.inverseMathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{inverseMathOperator:ns=>ns}})},rs}}zs(Floor,"componentType","floor");class Abs extends MathOperatorOneInput{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.mathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{mathOperator:function(ns){let ss=ns.evaluate_to_constant();return Number.isFinite(ss)?Context.fromAst(Math.abs(ss)):Context.fromAst(["apply","abs",ns.tree])}}})},rs.inverseMathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{inverseMathOperator:function(ns){let ss=ns,os=ns.evaluate_to_constant();return Number.isFinite(os)?os<0&&(ss=Context.fromAst(0)):Array.isArray(ns.tree)&&ns.tree[0]==="apply"&&ns.tree[1]==="abs"&&(ss=Context.fromAst(ns.tree[2])),ss}}})},rs}}zs(Abs,"componentType","abs");class Sign extends MathOperatorOneInput{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.mathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{mathOperator:function(ns){let ss=ns.evaluate_to_constant();return Number.isFinite(ss)?Context.fromAst(Math.sign(ss)):Context.fromAst(["apply","sign",ns.tree])}}})},rs}}zs(Sign,"componentType","sign");class Mean extends MathOperator{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.numericOperator={returnDependencies:()=>({}),definition:()=>({setValue:{numericOperator:function(ns){let ss=ns.reduce((os,ls)=>os+ls);return ss/=ns.length,ss}}})},rs.mathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{mathOperator:function(ns){return ns.reduce((ss,os)=>ss.add(os)).divide(ns.length)}}})},rs}}zs(Mean,"componentType","mean");class Variance extends MathOperator{static createAttributesObject(){let rs=super.createAttributesObject();return rs.population={createComponentOfType:"boolean",createStateVariable:"population",defaultValue:!1,public:!0},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.numericOperator={returnDependencies:()=>({population:{dependencyType:"stateVariable",variableName:"population"}}),definition:({dependencyValues:ns})=>({setValue:{numericOperator:function(ss){return calculateNumericVariance(ss,ns.population)}}})},rs.mathOperator={returnDependencies:()=>({population:{dependencyType:"stateVariable",variableName:"population"}}),definition:({dependencyValues:ns})=>({setValue:{mathOperator:function(ss){return calculateSymbolicVariance(ss,ns.population)}}})},rs}}zs(Variance,"componentType","variance");function calculateNumericVariance(as,rs){let ns=0,ss=0;for(let ls of as)ns+=ls,ss+=ls*ls;let os=as.length;return ss-=ns**2/os,rs?ss/=os:ss/=os-1,ss}function calculateSymbolicVariance(as,rs){let ns=as.length,ss=as.reduce((ls,us)=>ls.add(us)),os=as.slice(1).reduce((ls,us)=>ls.add(us.pow(2)),as[0].pow(2)).subtract(ss.pow(2).divide(ns));return rs?os=os.divide(ns):os=os.divide(ns-1),os}class StandardDeviation extends Variance{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.numericOperator.definition=({dependencyValues:ns})=>({setValue:{numericOperator:function(ss){return Math.sqrt(calculateNumericVariance(ss,ns.population))}}}),rs.mathOperator.definition=({dependencyValues:ns})=>({setValue:{mathOperator:function(ss){return Context.fromAst(["apply","sqrt",calculateSymbolicVariance(ss,ns.population).tree])}}}),rs}}zs(StandardDeviation,"componentType","standardDeviation");class Count extends MathOperator{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.isNumericOperator={returnDependencies:()=>({}),definition:()=>({setValue:{isNumericOperator:!0}})},rs.numericOperator={returnDependencies:()=>({}),definition:()=>({setValue:{numericOperator:function(ns){return ns.length}}})},rs}}zs(Count,"componentType","count");class Min extends MathOperator{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.numericOperator={returnDependencies:()=>({}),definition:()=>({setValue:{numericOperator:function(ns){return ns.reduce((ss,os)=>Math.min(ss,os),1/0)}}})},rs.mathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{mathOperator:function(ns){return Context.fromAst(["apply","min",["tuple",...ns.map(ss=>ss.tree)]])}}})},rs.inverseMathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{inverseMathOperator:function({desiredValue:ns,canBeModified:ss}){if(ss.filter(os=>os).length===1){let os=ss.indexOf(!0);if(os>=0)return{success:!0,inputValue:ns,inputNumber:os}}return{success:!1}}}})},rs.inverseNumericOperator={returnDependencies:()=>({}),definition:()=>({setValue:{inverseNumericOperator:function({desiredValue:ns,canBeModified:ss,desiredMathValue:os}){if(ss.filter(ls=>ls).length===1){let ls=ss.indexOf(!0);if(ls>=0)return Number.isFinite(ns)||(ns=os),{success:!0,inputValue:ns,inputNumber:ls}}return{success:!1}}}})},rs}}zs(Min,"componentType","min");class Max extends MathOperator{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.numericOperator={returnDependencies:()=>({}),definition:()=>({setValue:{numericOperator:function(ns){return ns.reduce((ss,os)=>Math.max(ss,os),-1/0)}}})},rs.mathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{mathOperator:function(ns){return Context.fromAst(["apply","max",["tuple",...ns.map(ss=>ss.tree)]])}}})},rs.inverseMathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{inverseMathOperator:function({desiredValue:ns,canBeModified:ss}){if(ss.filter(os=>os).length===1){let os=ss.indexOf(!0);if(os>=0)return{success:!0,inputValue:ns,inputNumber:os}}return{success:!1}}}})},rs.inverseNumericOperator={returnDependencies:()=>({}),definition:()=>({setValue:{inverseNumericOperator:function({desiredValue:ns,canBeModified:ss,desiredMathValue:os}){if(ss.filter(ls=>ls).length===1){let ls=ss.indexOf(!0);if(ls>=0)return Number.isFinite(ns)||(ns=os),{success:!0,inputValue:ns,inputNumber:ls}}return{success:!1}}}})},rs}}zs(Max,"componentType","max");class Mod extends MathOperator{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.numericOperator={returnDependencies:()=>({}),definition:()=>({setValue:{numericOperator:function(ns){return ns.length!==2?NaN:Context.math.mod(ns[0],ns[1])}}})},rs.mathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{mathOperator:function(ns){return ns.length!==2?Context.fromAst("_"):Context.fromAst(["apply","mod",["tuple",...ns.map(ss=>ss.tree)]])}}})},rs}}zs(Mod,"componentType","mod");class Gcd extends MathOperator{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.numericOperator={returnDependencies:()=>({}),definition:()=>({setValue:{numericOperator:function(ns){return ns.every(Number.isInteger)?gcd(...ns):NaN}}})},rs.mathOperator={returnDependencies:()=>({}),definition:()=>({setValue:{mathOperator:function(ns){return Context.fromAst(["apply","gcd",["tuple",...ns.map(ss=>ss.tree)]])}}})},rs}}zs(Gcd,"componentType","gcd");class ExtractMath extends MathOperatorOneInput{static createAttributesObject(){let rs=super.createAttributesObject();return rs.type={createComponentOfType:"text",createStateVariable:"type",defaultValue:null,toLowerCase:!0,validValues:["operand","function","functionargument","numberofoperands"]},rs.operandNumber={createComponentOfType:"number",createStateVariable:"operandNumber",defaultValue:null,public:!0},rs.argumentNumber={createComponentOfType:"number",createStateVariable:"argumentNumber",defaultValue:null,public:!0},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.mathOperator={returnDependencies:()=>({type:{dependencyType:"stateVariable",variableName:"type"},operandNumber:{dependencyType:"stateVariable",variableName:"operandNumber"},argumentNumber:{dependencyType:"stateVariable",variableName:"argumentNumber"}}),definition({dependencyValues:ns}){return ns.type==="operand"?ns.operandNumber===null?(console.warn("Must specify a operandNumber when extracting a math operand"),{setValue:{mathOperator:ss=>Context.fromAst("_")}}):{setValue:{mathOperator:function(ss){let os=ss.tree;if(!Array.isArray(os)||os[0]==="apply")return ns.operandNumber===1?ss:Context.fromAst("_");let us=os[ns.operandNumber];return us===void 0?Context.fromAst("_"):Context.fromAst(us)}}}:ns.type==="function"?{setValue:{mathOperator:function(ss){let os=ss.tree;return!Array.isArray(os)||os[0]!=="apply"?Context.fromAst("_"):Context.fromAst(os[1])}}}:ns.type==="functionargument"?{setValue:{mathOperator:function(ss){let os=ss.tree;if(!Array.isArray(os)||os[0]!=="apply")return Context.fromAst("_");let us=os[2];if(ns.argumentNumber===null)return Context.fromAst(us);if(ns.argumentNumber===1)return Array.isArray(us)&&us[0]==="tuple"?Context.fromAst(us[1]):Context.fromAst(us);if(Array.isArray(us)&&us[0]==="tuple"){let cs=us[ns.argumentNumber];return cs===void 0?Context.fromAst("_"):Context.fromAst(cs)}else return Context.fromAst("_")}}}:ns.type==="numberofoperands"?{setValue:{mathOperator:function(ss){let os=ss.tree;return!Array.isArray(os)||os[0]==="apply"?Context.fromAst(1):Context.fromAst(os.length-1)}}}:{setValue:{mathOperator:ss=>Context.fromAst("_")}}}},rs}}zs(ExtractMath,"componentType","extractMath");function gcd(as,rs,...ns){return!rs&&ns.length>0?gcd(as,...ns):rs?gcd(rs,as%rs,...ns):as}const MathOperators=Object.freeze(Object.defineProperty({__proto__:null,Abs,Ceil,ClampNumber,ConvertSetToList,Count,ExtractMath,Floor,Gcd,Max,Mean,Min,Mod,Product,Round,Sign,StandardDeviation,Sum,Variance,WrapNumberPeriodic,setSmallToZero},Symbol.toStringTag,{value:"Module"}));function returnLabelStateVariableDefinitions(){let as={};return as.componentNameAndShadowSourceNames={returnDependencies:()=>({shadowSource:{dependencyType:"shadowSource",variableNames:["componentNameAndShadowSourceNames"]},unlinkedCopySource:{dependencyType:"unlinkedCopySource",variableNames:["componentNameAndShadowSourceNames"]}}),definition({dependencyValues:rs,componentName:ns}){var os,ls;let ss=[ns];return(os=rs.shadowSource)!=null&&os.stateValues.componentNameAndShadowSourceNames?ss.push(...rs.shadowSource.stateValues.componentNameAndShadowSourceNames):(ls=rs.unlinkedCopySource)!=null&&ls.stateValues.componentNameAndShadowSourceNames&&ss.push(...rs.unlinkedCopySource.stateValues.componentNameAndShadowSourceNames),{setValue:{componentNameAndShadowSourceNames:ss}}}},as.label={forRenderer:!0,public:!0,shadowingInstructions:{createComponentOfType:"label",addStateVariablesShadowingStateVariables:{hasLatex:{stateVariableToShadow:"labelHasLatex"}}},hasEssential:!0,doNotShadowEssential:!0,defaultValue:"",provideEssentialValuesInDefinition:!0,additionalStateVariablesDefined:[{variableName:"labelHasLatex",forRenderer:!0}],returnDependencies:()=>({labelChild:{dependencyType:"child",childGroups:["labels"],variableNames:["value","hasLatex"]},labelIsName:{dependencyType:"stateVariable",variableName:"labelIsName"},labelIsNameAttr:{dependencyType:"attributeComponent",attributeName:"labelIsName"},componentNameAndShadowSourceNames:{dependencyType:"stateVariable",variableName:"componentNameAndShadowSourceNames"},shadowSource:{dependencyType:"shadowSource",variableNames:["label","labelHasLatex"]}}),definition({dependencyValues:rs,essentialValues:ns}){var os;let ss=rs.labelChild[rs.labelChild.length-1];if(ss&&!ss.shadowDepth)return{setValue:{label:ss.stateValues.value,labelHasLatex:ss.stateValues.hasLatex}};if(ns.label!==void 0)return{useEssentialOrDefaultValue:{label:!0},setValue:{labelHasLatex:!1}};if(rs.labelIsName&&!rs.labelIsNameAttr.shadowDepth){let ls="__",us=rs.componentNameAndShadowSourceNames;for(let cs of us){let ds=cs.lastIndexOf("/");if(ls=cs.substring(ds+1),ls.slice(0,2)!=="__")break}return ls.slice(0,2)==="__"?{setValue:{label:"",labelHasLatex:!1}}:(ls[0]!=="_"&&(ls.includes("_")||ls.includes("-")?ls=ls.replace(/[_\-]/g," "):ls.match(/^[a-z]/)?ls.match(/[A-Z]/)&&(ls=ls.replace(/([A-Z])/g," $1").toLowerCase()):ls.match(/^[A-Z]/)&&ls.match(/[a-z]/)&&(ls=ls.replace(/([A-Z])/g," $1"),ls=ls.slice(1))),{setValue:{label:ls,labelHasLatex:!1}})}else return typeof((os=rs.shadowSource)==null?void 0:os.stateValues.label)=="string"?{setValue:{label:rs.shadowSource.stateValues.label,labelHasLatex:!!rs.shadowSource.stateValues.labelHasLatex}}:{useEssentialOrDefaultValue:{label:!0},setValue:{labelHasLatex:!1}}},inverseDefinition({desiredStateVariableValues:rs,dependencyValues:ns}){var ls;if(typeof rs.label!="string")return{success:!1};let ss=ns.labelChild.length-1,os=ns.labelChild[ss];return os&&!os.shadowDepth?{success:!0,instructions:[{setDependency:"labelChild",desiredValue:rs.label,childIndex:ss,variableIndex:0}]}:ns.labelIsName&&!ns.labelIsNameAttr.shadowDepth?{success:!0,instructions:[{setEssentialValue:"label",value:rs.label}]}:typeof((ls=ns.shadowSource)==null?void 0:ls.stateValues.label)=="string"?{success:!0,instructions:[{setDependency:"shadowSource",desiredValue:rs.label,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"label",value:rs.label}]}}},as.labelForGraph={forRenderer:!0,returnDependencies:()=>({label:{dependencyType:"stateVariable",variableName:"label"},labelHasLatex:{dependencyType:"stateVariable",variableName:"labelHasLatex"}}),definition({dependencyValues:rs}){let ns;if(rs.labelHasLatex){let ss=0;ns="";for(let os of rs.label)os==="("?ss++:os===")"?ss--:ss===0&&(os==="_"?os="_":os==="^"&&(os="^")),ns+=os}else ns=rs.label.replaceAll("_","_").replaceAll("^","^");return{setValue:{labelForGraph:ns}}}},as}class GraphicalComponent extends BaseComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.labelIsName={createComponentOfType:"boolean",createStateVariable:"labelIsName",defaultValue:!1,public:!0},rs.showLabel={createComponentOfType:"boolean",createStateVariable:"showLabel",defaultValue:!0,public:!0,forRenderer:!0},rs.applyStyleToLabel={createComponentOfType:"boolean",createStateVariable:"applyStyleToLabel",defaultValue:!1,public:!0,forRenderer:!0},rs.layer={createComponentOfType:"integer",createStateVariable:"layer",defaultValue:0,public:!0,forRenderer:!0,attributesForCreatedComponent:{valueOnNaN:0}},rs}static returnChildGroups(){return[{group:"labels",componentTypes:["label"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=returnSelectedStyleStateVariableDefinition();Object.assign(rs,ns);let ss=returnLabelStateVariableDefinitions();return Object.assign(rs,ss),rs}}zs(GraphicalComponent,"componentType","_graphical");function createFunctionFromDefinition(as){if(as.functionType==="formula")return returnNumericalFunctionFromFormula({formula:Context.fromAst(as.formula),nInputs:as.nInputs,variables:as.variables.map(rs=>Context.fromAst(rs)),domain:as.domain?as.domain.map(rs=>Context.fromAst(rs)):null,component:as.component});if(as.functionType==="reevaluatedFormula"){let rs={};for(let ns in as.evaluateChildrenToReevaluate)rs[ns]={fReevaluate:createFunctionFromDefinition(as.evaluateChildrenToReevaluate[ns].fReevaluateDefinition),inputMathFs:as.evaluateChildrenToReevaluate[ns].inputMaths.map(ss=>Context.fromAst(ss).subscripts_to_strings().f())};return returnNumericalFunctionFromReevaluatedFormula({formulaExpressionWithCodes:Context.fromAst(as.formulaExpressionWithCodes),evaluateChildrenToReevaluate:rs,nInputs:as.nInputs,variables:as.variables.map(ns=>Context.fromAst(ns)),domain:as.domain?as.domain.map(ns=>Context.fromAst(ns)):null,component:as.component})}else return as.functionType==="numericForEvaluate"?returnNumericFunctionForEvaluate({nInputs:as.nInputs,numericalfs:as.fDefinitions.map(rs=>createFunctionFromDefinition(rs))}):as.functionType==="bezier"?returnBezierFunctions({nThroughPoints:as.nThroughPoints,numericalThroughPoints:as.numericalThroughPoints,splineCoeffs:as.splineCoeffs,extrapolateForward:as.extrapolateForward,extrapolateForwardCoeffs:as.extrapolateForwardCoeffs,extrapolateBackward:as.extrapolateBackward,extrapolateBackwardCoeffs:as.extrapolateBackwardCoeffs,component:as.component}):as.functionType==="interpolated"?returnInterpolatedFunction({xs:as.xs,coeffs:as.coeffs,interpolationPoints:as.interpolationPoints,domain:as.domain?as.domain.map(rs=>Context.fromAst(rs)):null}):as.functionType==="functionOperator"?returnFunctionOperatorFunction({componentType:as.componentType,functionOperatorArguments:as.functionOperatorArguments,operatorComposesWithOriginal:as.operatorComposesWithOriginal,originalFDefinition:as.originalFDefinition,nOutputs:as.nOutputs,component:as.component}):as.functionType==="ODESolution"?returnODESolutionFunction({nDimensions:as.nDimensions,t0:as.t0,x0s:as.x0s,chunkSize:as.chunkSize,tolerance:as.tolerance,numericalRHSfDefinitions:as.numericalRHSfDefinitions,maxIterations:as.maxIterations,component:as.component}):as.functionType==="piecewise"?returnPiecewiseNumericalFunctionFromChildren({numericalFsOfChildren:as.fDefinitionsOfChildren.map(rs=>createFunctionFromDefinition(rs)),numericalDomainsOfChildren:as.numericalDomainsOfChildren,domain:as.domain?as.domain.map(rs=>Context.fromAst(rs)):null,component:as.component}):()=>NaN}function returnNumericalFunctionFromFormula({formula:as,nInputs:rs,variables:ns,domain:ss,component:os=0}){if(os=Number(os),Array.isArray(as.tree)&&vectorOperators.includes(as.tree[0]))try{as=as.get_component(os)}catch{return()=>NaN}else if(os!==0)return()=>NaN;let us;try{us=as.subscripts_to_strings().f()}catch{return()=>NaN}if(rs===1){let hs=ns[0].subscripts_to_strings().tree,gs=-1/0,ys=1/0,bs=!1,vs=!1;if(ss!==null){let xs=ss[0];xs!==void 0&&(gs=Context.fromAst(xs.tree[1][1]).evaluate_to_constant(),typeof gs!="number"||Number.isNaN(gs)?gs=-1/0:bs=!xs.tree[2][1],ys=Context.fromAst(xs.tree[1][2]).evaluate_to_constant(),typeof ys!="number"||Number.isNaN(ys)?ys=1/0:vs=!xs.tree[2][2])}return function(xs,Cs=!1){if(Cs){if(isNaN(xs))return NaN}else if(!(xs>=gs)||!(xs<=ys)||bs&&xs===gs||vs&&xs===ys)return NaN;try{return us({[hs]:xs})}catch{return NaN}}}let cs=[];for(let hs=0;hs=vs)||!(bs<=xs)||Cs&&bs===vs||Ts&&bs===xs)return NaN}gs[cs[ys]]=bs}try{return us(gs)}catch{return NaN}}}function returnNumericalFunctionFromReevaluatedFormula({formulaExpressionWithCodes:as,evaluateChildrenToReevaluate:rs,nInputs:ns,variables:ss,domain:os,component:ls=0}){if(ls=Number(ls),Array.isArray(as.tree)&&vectorOperators.includes(as.tree[0]))try{as=as.get_component(Number(ls))}catch{return()=>NaN}else if(ls!==0)return()=>NaN;let cs;try{cs=as.subscripts_to_strings().f()}catch{return()=>NaN}if(ns===1){let gs=ss[0].subscripts_to_strings().tree,ys=-1/0,bs=1/0,vs=!1,xs=!1;if(os!==null){let Cs=os[0];Cs!==void 0&&(ys=Context.fromAst(Cs.tree[1][1]).evaluate_to_constant(),typeof ys!="number"||Number.isNaN(ys)?ys=-1/0:vs=!Cs.tree[2][1],bs=Context.fromAst(Cs.tree[1][2]).evaluate_to_constant(),typeof bs!="number"||Number.isNaN(bs)?bs=1/0:xs=!Cs.tree[2][2])}return function(Cs,Ts=!1){if(Ts){if(isNaN(Cs))return NaN}else if(!(Cs>=ys)||!(Cs<=bs)||vs&&Cs===ys||xs&&Cs===bs)return NaN;let Ss={[gs]:Cs},Ns={[gs]:Cs};for(let As in rs){let ws=rs[As].fReevaluate,Es=rs[As].inputMathFs;try{let _s=Es.map($s=>Context.fromAst($s(Ss)));Ns[As]=ws(_s).evaluate_to_constant()}catch{return NaN}}try{return cs(Ns)}catch{return NaN}}}let ds=[];for(let gs=0;gs=Cs)||!(xs<=Ts)||Ss&&xs===Cs||Ns&&xs===Ts)return NaN}ys[ds[vs]]=xs}let bs={...ys};for(let vs in rs){let xs=rs[vs].fReevaluate,Cs=rs[vs].inputMathFs;try{let Ts=Cs.map(Ss=>Context.fromAst(Ss(bs)));ys[vs]=xs(Ts).evaluate_to_constant()}catch{return NaN}}try{return cs(ys)}catch{return NaN}}}function returnPiecewiseNumericalFunctionFromChildren({numericalFsOfChildren:as,numericalDomainsOfChildren:rs,domain:ns,component:ss=0}){if(ss=Number(ss),ss!==0)return()=>NaN;let os=-1/0,ls=1/0,us=!1,cs=!1;if(ns!==null){let ds=ns[0];ds!==void 0&&(os=Context.fromAst(ds.tree[1][1]).evaluate_to_constant(),typeof os!="number"||Number.isNaN(os)?os=-1/0:us=!ds.tree[2][1],ls=Context.fromAst(ds.tree[1][2]).evaluate_to_constant(),typeof ls!="number"||Number.isNaN(ls)?ls=1/0:cs=!ds.tree[2][2])}return function(ds,ps=!1){if(ps){if(isNaN(ds))return NaN}else if(!(ds>=os)||!(ds<=ls)||us&&ds===os||cs&&ds===ls)return NaN;for(let[fs,hs]of rs.entries()){let gs=hs[0][0],ys=hs[0][1],bs=hs[1][0],vs=hs[1][1];if((ds>gs||bs&&ds===gs)&&(dsContext.fromAst("_")}else if(us!==0)return()=>Context.fromAst("_");let ds=as.subscripts_to_strings();if(os===1){let ys=ls[0].subscripts_to_strings().tree,bs=-1/0,vs=1/0,xs=!1,Cs=!1;if(ss!==null){let Ts=ss[0];Ts!==void 0&&(bs=Context.fromAst(Ts.tree[1][1]).evaluate_to_constant(),typeof bs!="number"||Number.isNaN(bs)?bs=-1/0:xs=!Ts.tree[2][1],vs=Context.fromAst(Ts.tree[1][2]).evaluate_to_constant(),typeof vs!="number"||Number.isNaN(vs)?vs=1/0:Cs=!Ts.tree[2][2])}return function(Ts,Ss=!1){if(!Ss){let Ns=Ts.evaluate_to_constant();if(!Number.isNaN(Ns)&&(!(Ns>=bs)||!(Ns<=vs)||xs&&Ns===bs||Cs&&Ns===vs))return Context.fromAst("_")}return normalizeMathExpression({value:ds.substitute({[ys]:Ts}).strings_to_subscripts(),simplify:rs,expand:ns})}}let ps=[];for(let ys=0;ys=Ns)||!(Ss<=As)||ws&&Ss===Ns||Es&&Ss===As)&&(vs=!0)}}bs[ps[Cs]]=Ts}return xs&&vs?Context.fromAst("_"):normalizeMathExpression({value:ds.substitute(bs).strings_to_subscripts(),simplify:rs,expand:ns})}}function returnSymbolicFunctionFromReevaluatedFormula({formulaExpressionWithCodes:as,evaluateChildrenToReevaluate:rs,simplify:ns,expand:ss,nInputs:os,variables:ls,domain:us,component:cs=0}){if(cs=Number(cs),Array.isArray(as.tree)&&vectorOperators.includes(as.tree[0]))try{as=as.get_component(cs)}catch{return()=>Context.fromAst("_")}else if(cs!==0)return()=>Context.fromAst("_");let ps=as.subscripts_to_strings();if(os===1){let bs=ls[0].subscripts_to_strings().tree,vs=-1/0,xs=1/0,Cs=!1,Ts=!1;if(us!==null){let Ss=us[0];Ss!==void 0&&(vs=Context.fromAst(Ss.tree[1][1]).evaluate_to_constant(),typeof vs!="number"||Number.isNaN(vs)?vs=-1/0:Cs=!Ss.tree[2][1],xs=Context.fromAst(Ss.tree[1][2]).evaluate_to_constant(),typeof xs!="number"||Number.isNaN(xs)?xs=1/0:Ts=!Ss.tree[2][2])}return function(Ss,Ns=!1){if(!Ns){let Es=Ss.evaluate_to_constant();if(!Number.isNaN(Es)&&(!(Es>=vs)||!(Es<=xs)||Cs&&Es===vs||Ts&&Es===xs))return Context.fromAst("_")}let As={[bs]:Ss.tree},ws={[bs]:Ss};for(let Es in rs){let _s=rs[Es].fReevaluate,$s=rs[Es].inputMathFs;try{let Rs=$s.map(Ds=>Context.fromAst(Ds(As)));ws[Es]=_s(Rs)}catch{return NaN}}return normalizeMathExpression({value:ps.substitute(ws).strings_to_subscripts(),simplify:ns,expand:ss})}}let fs=[];for(let bs=0;bs=ws)||!(As<=Es)||_s&&As===ws||$s&&As===Es)&&(Cs=!0)}}vs[fs[Ss]]=Ns,xs[fs[Ss]]=Ns.tree}if(Ts&&Cs)return Context.fromAst("_");for(let Ss in rs){let Ns=rs[Ss].fReevaluate,As=rs[Ss].inputMathFs;try{let ws=As.map(Es=>Context.fromAst(Es(xs)));vs[Ss]=Ns(ws)}catch{return NaN}}return normalizeMathExpression({value:ps.substitute(vs).strings_to_subscripts(),simplify:ns,expand:ss})}}function returnSymbolicFunctionForEvaluate({symbolicfs:as,nInputs:rs}){return function(ns){if(ns.length===1){let ls=ns[0].tree;Array.isArray(ls)&&vectorOperators.includes(ls[0])&&(ns=ls.slice(1).map(us=>Context.fromAst(us)))}if(ns.length!==rs)return Context.fromAst("_");let ss=as.map(ls=>ls(...ns).tree),os;return ss.length===1?os=Context.fromAst(ss[0]):os=Context.fromAst(["vector",...ss]),os}}function returnNumericFunctionForEvaluate({numericalfs:as,nInputs:rs}){return function(ns){if(ns.length===1){let us=ns[0].tree;Array.isArray(us)&&vectorOperators.includes(us[0])&&(ns=us.slice(1).map(cs=>Context.fromAst(cs)))}if(ns.length!==rs)return Context.fromAst("_");let ss=ns.map(us=>us.evaluate_to_constant()),os=as.map(us=>us(...ss)),ls;return os.length===1?ls=Context.fromAst(os[0]):ls=Context.fromAst(["vector",...os]),ls}}function returnBezierFunctions({nThroughPoints:as,numericalThroughPoints:rs,splineCoeffs:ns,extrapolateForward:ss,extrapolateForwardCoeffs:os,extrapolateBackward:ls,extrapolateBackwardCoeffs:us,component:cs}){if(as<1)return()=>NaN;let ds=as-1,ps=rs[ds][cs],fs=ns.map(ys=>ys[cs]),hs;ls&&(hs=us[cs]);let gs;return ss&&(gs=os[cs]),function(ys){if(isNaN(ys))return NaN;if(ys<0)return ls?(hs[2]*ys+hs[1])*ys+hs[0]:NaN;if(ys>=ds)return ss?(ys-=ds,(gs[2]*ys+gs[1])*ys+gs[0]):ys===ds?ps:NaN;let bs=Math.floor(ys);ys-=bs;let vs=fs[bs];return((vs[3]*ys+vs[2])*ys+vs[1])*ys+vs[0]}}function returnInterpolatedFunction({xs:as,coeffs:rs,interpolationPoints:ns,domain:ss}){let os=[];if(ns&&(os=ns.map(hs=>hs.y)),as===null)return()=>NaN;let ls=-1/0,us=1/0,cs=!1,ds=!1;if(ss!==null){let hs=ss[0];hs!==void 0&&(ls=Context.fromAst(hs.tree[1][1]).evaluate_to_constant(),typeof ls!="number"||Number.isNaN(ls)?ls=-1/0:cs=!hs.tree[2][1],us=Context.fromAst(hs.tree[1][2]).evaluate_to_constant(),typeof us!="number"||Number.isNaN(us)?us=1/0:ds=!hs.tree[2][2])}let ps=as[0],fs=as[as.length-1];return function(hs,gs=!1){if(gs){if(isNaN(hs))return NaN}else if(!(hs>=ls)||!(hs<=us)||cs&&hs===ls||ds&&hs===us)return NaN;if(hs<=ps){hs-=ps;let Ts=rs[0];return((Ts[3]*hs+Ts[2])*hs+Ts[1])*hs+Ts[0]}if(hs>=fs){let Ts=as.length-2;hs-=as[Ts];let Ss=rs[Ts];return((Ss[3]*hs+Ss[2])*hs+Ss[1])*hs+Ss[0]}for(var ys=0,bs,vs=as.length-1;ys<=vs;){bs=Math.floor(.5*(ys+vs));let Ts=as[bs];if(Tshs)vs=bs-1;else return os[bs]}let xs=Math.max(0,vs);hs-=as[xs];let Cs=rs[xs];return((Cs[3]*hs+Cs[2])*hs+Cs[1])*hs+Cs[0]}}function returnReturnDerivativesOfInterpolatedFunction({xs:as,coeffs:rs,variables:ns}){if(!as)return()=>NaN;let ss=ns[0].subscripts_to_strings().tree,os=as[0],ls=as[as.length-1];return function(us){let cs=us.map(ps=>ps.subscripts_to_strings().tree),ds=cs.length;return ds>3||!cs.every(ps=>ps===ss)||cs.includes("_")?()=>0:ds===0||as===null?()=>NaN:function(ps){if(isNaN(ps))return NaN;if(ps<=os){ps-=os;let vs=rs[0];return ds===1?(3*vs[3]*ps+2*vs[2])*ps+vs[1]:ds===2?6*vs[3]*ps+2*vs[2]:6*vs[3]}if(ps>=ls){let vs=as.length-2;ps-=as[vs];let xs=rs[vs];return ds===1?(3*xs[3]*ps+2*xs[2])*ps+xs[1]:ds===2?6*xs[3]*ps+2*xs[2]:6*xs[3]}for(var fs=0,hs,gs=as.length-1;fs<=gs;){hs=Math.floor(.5*(fs+gs));let vs=as[hs];if(vsps)gs=hs-1;else return ds===1?rs[hs][1]:ds===2?2*rs[hs][2]:6*rs[hs][3]}let ys=Math.max(0,gs);ps-=as[ys];let bs=rs[ys];return ds===1?(3*bs[3]*ps+2*bs[2])*ps+bs[1]:ds===2?6*bs[3]*ps+2*bs[2]:6*bs[3]}}}function returnFunctionOperatorFunction({componentType:as,functionOperatorArguments:rs,operatorComposesWithOriginal:ns,originalFDefinition:ss,nOutputs:os,component:ls}){if(ns){let us=[];for(let ds=0;dscs(...us.map(ps=>ps(...ds)))}else return functionOperatorDefinitions[as](...rs)}var functionOperatorDefinitions={clampFunction:function(as,rs){return function(ns){return Number.isFinite(ns)?Math.max(as,Math.min(rs,ns)):NaN}},wrapFunctionPeriodic:function(as,rs){return function(ns){if(!Number.isFinite(ns))return NaN;let ss=as,os=rs;return ss===os?ss:(ss>os&&([os,ss]=[ss,os]),ss+Context.math.mod(ns-ss,os-ss))}},derivative:function(as,rs){if(as.derivativeType==="interpolatedFunction"){let ns=returnReturnDerivativesOfInterpolatedFunction({xs:as.xs,coeffs:as.coeffs,variables:as.variables.map(convertValueToMathExpression)}),ss=rs.map(convertValueToMathExpression);if(as.additionalDerivVariables&&(ss=[...as.additionalDerivVariables.map(convertValueToMathExpression),...ss]),as.variableMappings)for(let ls of as.variableMappings){let us=[];for(let cs of ss){let ds=ls[cs.subscripts_to_strings().tree];ds?us.push(convertValueToMathExpression(ds)):us.push(Context.fromAst("_"))}ss=us}return ns(ss)}else return()=>NaN}};function returnODESolutionFunction({nDimensions:as,t0:rs,x0s:ns,chunkSize:ss,tolerance:os,numericalRHSfDefinitions:ls,maxIterations:us,component:cs}){var ds={};ds.calculatedNumericSolutions=[],ds.endingNumericalValues=[],ds.maxPossibleTime=void 0;let ps=ls.map(hs=>createFunctionFromDefinition(hs)),fs=function(hs,gs){let ys=[hs];Array.isArray(gs)?ys.push(...gs):ys.push(gs);try{return ps.map(bs=>bs(...ys))}catch{return NaN}};return function(gs){if(!Number.isFinite(gs))return NaN;if(gs===rs)return ns[cs];let ys=ds.calculatedNumericSolutions.length,bs=Math.ceil((gs-rs)/ss)-1;if(bs<0)return NaN;if(ds.maxPossibleTime===void 0&&bs>=ys)for(let xs=ys;xs<=bs;xs++){let Cs=ds.endingNumericalValues[xs-1];Cs===void 0&&(Cs=ns);let Ts=rs+xs*ss,Ss=Context.math.dopri(Ts,Ts+ss,Cs,fs,os,us);ds.endingNumericalValues.push(Ss.y[Ss.y.length-1]),ds.calculatedNumericSolutions.push(Ss.at.bind(Ss));let Ns=Ss.x[Ss.x.length-1];if(Ns<(Ts+ss)*(1-1e-6)){ds.maxPossibleTime=Ns;break}}return gs>ds.maxPossibleTime?NaN:ds.calculatedNumericSolutions[bs](gs)[cs]}}var ku;let Function$1=(ku=class extends InlineComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.simplify={createComponentOfType:"text",createStateVariable:"simplifySpecified",defaultValue:"full",toLowerCase:!0,valueTransformations:{"":"full",true:"full",false:"none"},validValues:["none","full","numbers","numberspreserveorder"]},rs.expand={createComponentOfType:"boolean",createStateVariable:"expandSpecified",defaultValue:!1,public:!0},rs.xscale={createComponentOfType:"number",createStateVariable:"xscale",defaultValue:1,public:!0},rs.yscale={createComponentOfType:"number",createStateVariable:"yscale",defaultValue:1,public:!0},rs.nInputs={createComponentOfType:"integer"},rs.nOutputs={createComponentOfType:"integer"},rs.domain={createComponentOfType:"_intervalListComponent"},rs.labelIsName={createComponentOfType:"boolean",createStateVariable:"labelIsName",defaultValue:!1,public:!0},rs.showLabel={createComponentOfType:"boolean",createStateVariable:"showLabel",defaultValue:!0,public:!0,forRenderer:!0},rs.applyStyleToLabel={createComponentOfType:"boolean",createStateVariable:"applyStyleToLabel",defaultValue:!1,public:!0,forRenderer:!0},rs.labelPosition={createComponentOfType:"text",createStateVariable:"labelPosition",defaultValue:"upperright",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft","top","bottom","left","right"]},rs.layer={createComponentOfType:"number",createStateVariable:"layer",defaultValue:0,public:!0,forRenderer:!0},rs.minima={createComponentOfType:"extrema"},rs.maxima={createComponentOfType:"extrema"},rs.extrema={createComponentOfType:"extrema"},rs.through={createComponentOfType:"_pointListComponent"},rs.throughSlopes={createComponentOfType:"mathList"},rs.variables={createComponentOfType:"variables"},rs.symbolic={createComponentOfType:"boolean"},rs.displayDigits={createComponentOfType:"integer"},rs.displayDecimals={createComponentOfType:"integer"},rs.displaySmallAsZero={createComponentOfType:"number",valueForTrue:1e-14,valueForFalse:0},rs.padZeros={createComponentOfType:"boolean"},rs.nearestPointAsCurve={createComponentOfType:"boolean",createStateVariable:"nearestPointAsCurve",defaultValue:!1},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss,componentInfoObjects:os}){let ls=fs=>os.componentIsSpecifiedType(fs,"label"),us=ss.map(ls),cs=[],ds=[],ps=[];if(us.filter(fs=>fs).length===0)cs=ss;else{if(us[0]){let hs=us.indexOf(!1);hs!==-1&&(ds=ss.slice(0,hs),ss=ss.slice(hs),us=us.slice(hs))}let fs=us.indexOf(!0);fs===-1?cs=ss:(cs=ss.slice(0,fs),ps=ss.slice(fs))}return cs.length===1&&typeof cs[0]!="string"||cs.length===0?{success:!1}:{success:!0,newChildren:[...ds,{componentType:"math",children:cs},...ps]}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"maths",componentTypes:["math"]},{group:"functions",componentTypes:["function"]},{group:"labels",componentTypes:["label"]}]}static returnStateVariableDefinitions({numerics:rs}){let ns=GraphicalComponent.returnStateVariableDefinitions();return ns.styleDescription={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ss}){var us;let os;((us=ss.document)==null?void 0:us.stateValues.theme)==="dark"?os=ss.selectedStyle.lineColorWordDarkMode:os=ss.selectedStyle.lineColorWord;let ls=ss.selectedStyle.lineWidthWord;return ss.selectedStyle.lineStyleWord&&(ls&&(ls+=" "),ls+=ss.selectedStyle.lineStyleWord),ls&&(ls+=" "),ls+=os,{setValue:{styleDescription:ls}}}},ns.styleDescriptionWithNoun={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({styleDescription:{dependencyType:"stateVariable",variableName:"styleDescription"}}),definition:function({dependencyValues:ss}){return{setValue:{styleDescriptionWithNoun:ss.styleDescription+" function"}}}},ns.displayDigits={public:!0,shadowingInstructions:{createComponentOfType:"integer"},defaultValue:10,hasEssential:!0,returnDependencies:()=>({displayDigitsAttr:{dependencyType:"attributeComponent",attributeName:"displayDigits",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["displayDigits"]}}),definition({dependencyValues:ss,usedDefault:os}){if(ss.displayDigitsAttr!==null){let ls=os.displayDigitsAttr,us=ss.displayDecimalsAttr===null||os.displayDecimalsAttr;if(!(ls||us)){let cs=ss.displayDigitsAttr.shadowDepth;ss.displayDecimalsAttr.shadowDepth0){let ls=os.functionChild[0],us=ss.displayDecimalsAttr===null||os.displayDecimalsAttr;return ls||us||(ls=!0),ls?{useEssentialOrDefaultValue:{displayDigits:{defaultValue:ss.functionChild[0].stateValues.displayDigits}}}:{setValue:{displayDigits:ss.functionChild[0].stateValues.displayDigits}}}else return{useEssentialOrDefaultValue:{displayDigits:!0}}}},ns.displayDecimals={public:!0,shadowingInstructions:{createComponentOfType:"integer"},defaultValue:null,hasEssential:!0,returnDependencies:()=>({displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["displayDecimals"]}}),definition({dependencyValues:ss,usedDefault:os}){return ss.displayDecimalsAttr!==null?{setValue:{displayDecimals:ss.displayDecimalsAttr.stateValues.value}}:ss.functionChild.length>0&&!os.functionChild[0]?{setValue:{displayDecimals:ss.functionChild[0].stateValues.displayDecimals}}:{useEssentialOrDefaultValue:{displayDecimals:!0}}}},ns.displaySmallAsZero={public:!0,shadowingInstructions:{createComponentOfType:"number"},defaultValue:0,hasEssential:!0,returnDependencies:()=>({displaySmallAsZeroAttr:{dependencyType:"attributeComponent",attributeName:"displaySmallAsZero",variableNames:["value"]},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["displaySmallAsZero"]}}),definition({dependencyValues:ss,usedDefault:os}){return ss.displaySmallAsZeroAttr!==null?{setValue:{displaySmallAsZero:ss.displaySmallAsZeroAttr.stateValues.value}}:ss.functionChild.length>0&&!os.functionChild[0]?{setValue:{displaySmallAsZero:ss.functionChild[0].stateValues.displaySmallAsZero}}:{useEssentialOrDefaultValue:{displaySmallAsZero:!0}}}},ns.padZeros={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},defaultValue:!1,hasEssential:!0,returnDependencies:()=>({padZerosAttr:{dependencyType:"attributeComponent",attributeName:"padZeros",variableNames:["value"]},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["padZeros"]}}),definition({dependencyValues:ss,usedDefault:os}){return ss.padZerosAttr!==null?{setValue:{padZeros:ss.padZerosAttr.stateValues.value}}:ss.functionChild.length>0&&!os.functionChild[0]?{setValue:{padZeros:ss.functionChild[0].stateValues.padZeros}}:{useEssentialOrDefaultValue:{padZeros:!0}}}},ns.isInterpolatedFunction={returnDependencies:()=>({through:{dependencyType:"attributeComponent",attributeName:"through"},minima:{dependencyType:"attributeComponent",attributeName:"minima"},maxima:{dependencyType:"attributeComponent",attributeName:"maxima"},extrema:{dependencyType:"attributeComponent",attributeName:"extrema"}}),definition({dependencyValues:ss}){return{setValue:{isInterpolatedFunction:ss.through||ss.minima||ss.maxima||ss.extrema}}}},ns.nInputs={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({nInputsAttr:{dependencyType:"attributeComponent",attributeName:"nInputs",variableNames:["value"]},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["nInputs"]},variablesAttr:{dependencyType:"attributeComponent",attributeName:"variables",variableNames:["nComponents"]},isInterpolatedFunction:{dependencyType:"stateVariable",variableName:"isInterpolatedFunction"}}),definition({dependencyValues:ss}){if(ss.isInterpolatedFunction)return{setValue:{nInputs:1}};if(ss.nInputsAttr!==null){let os=ss.nInputsAttr.stateValues.value;return os>=0||(os=1),{setValue:{nInputs:os}}}else return ss.variablesAttr!==null?{setValue:{nInputs:Math.max(1,ss.variablesAttr.stateValues.nComponents)}}:ss.functionChild.length>0?{setValue:{nInputs:ss.functionChild[0].stateValues.nInputs}}:{setValue:{nInputs:1}}}},ns.nOutputs={defaultValue:1,hasEssential:!0,public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({nOutputsAttr:{dependencyType:"attributeComponent",attributeName:"nOutputs",variableNames:["value"]},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["nOutputs"]},mathChild:{dependencyType:"child",childGroups:["maths"],variableNames:["value"]}}),definition({dependencyValues:ss}){if(ss.functionChild.length>0)return{setValue:{nOutputs:ss.functionChild[0].stateValues.nOutputs}};if(ss.nOutputsAttr!==null){let os=ss.nOutputsAttr.stateValues.value;return os>=0||(os=1),{setValue:{nOutputs:os}}}else if(ss.mathChild.length>0){let os=ss.mathChild[0].stateValues.value,ls=Array.isArray(os.tree)&&vectorOperators.includes(os.tree[0]),us=1;return ls&&(us=os.tree.length-1),{setValue:{nOutputs:us}}}else return{useEssentialOrDefaultValue:{nOutputs:!0}}}},ns.domain={returnDependencies:()=>({domainAttr:{dependencyType:"attributeComponent",attributeName:"domain",variableNames:["intervals"]},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["domain"]},nInputs:{dependencyType:"stateVariable",variableName:"nInputs"}}),definition({dependencyValues:ss}){if(ss.domainAttr!==null){let os=ss.nInputs,ls=ss.domainAttr.stateValues.intervals.slice(0,os);return ls.length!==os?{setValue:{domain:null}}:ls.every(us=>Array.isArray(us.tree)&&us.tree[0]==="interval")?{setValue:{domain:ls}}:{setValue:{domain:null}}}else return ss.functionChild.length>0?{setValue:{domain:ss.functionChild[0].stateValues.domain}}:{setValue:{domain:null}}}},ns.simplify={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({simplifySpecified:{dependencyType:"stateVariable",variableName:"simplifySpecified"},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["simplify"]}}),definition({dependencyValues:ss,usedDefault:os}){return os.simplifySpecified&&ss.functionChild.length>0?{setValue:{simplify:ss.functionChild[0].stateValues.simplify}}:{setValue:{simplify:ss.simplifySpecified}}},inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os,usedDefault:ls}){return ls.simplifySpecified&&os.functionChild.length>0?{success:!0,instructions:[{setDependency:"functionChild",desiredValue:ss.simplify,childIndex:0,variableIndex:0}]}:{success:!0,instructions:[{setDependency:"simplifySpecified",desiredValue:ss.simplify}]}}},ns.expand={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({expandSpecified:{dependencyType:"stateVariable",variableName:"expandSpecified"},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["expand"]}}),definition({dependencyValues:ss,usedDefault:os}){return os.expandSpecified&&ss.functionChild.length>0?{setValue:{expand:ss.functionChild[0].stateValues.expand}}:{setValue:{expand:ss.expandSpecified}}},inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os,usedDefault:ls}){return ls.expandSpecified&&os.functionChild.length>0?{success:!0,instructions:[{setDependency:"functionChild",desiredValue:ss.expand,childIndex:0,variableIndex:0}]}:{success:!0,instructions:[{setDependency:"expandSpecified",desiredValue:ss.expand}]}}},ns.numericalfShadow={defaultValue:null,hasEssential:!0,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{numericalfShadow:!0}})},ns.symbolicfShadow={defaultValue:null,hasEssential:!0,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{symbolicfShadow:!0}})},ns.symbolic={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},defaultValue:!0,hasEssential:!0,returnDependencies:()=>({symbolicAttr:{dependencyType:"attributeComponent",attributeName:"symbolic",variableNames:["value"]},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["symbolic"]},numericalfShadow:{dependencyType:"stateVariable",variableName:"numericalfShadow"},symbolicfShadow:{dependencyType:"stateVariable",variableName:"symbolicfShadow"}}),definition({dependencyValues:ss}){return ss.symbolicAttr!==null?{setValue:{symbolic:ss.symbolicAttr.stateValues.value}}:ss.functionChild.length>0?{setValue:{symbolic:ss.functionChild[0].stateValues.symbolic}}:ss.numericalfShadow?{setValue:{symbolic:!1}}:ss.symbolicfShadow?{setValue:{symbolic:!0}}:{useEssentialOrDefaultValue:{symbolic:!0}}}},ns.variables={isArray:!0,public:!0,shadowingInstructions:{createComponentOfType:"variable"},entryPrefixes:["variable"],returnArraySizeDependencies:()=>({nInputs:{dependencyType:"stateVariable",variableName:"nInputs"}}),returnArraySize({dependencyValues:ss}){return[ss.nInputs]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={variablesAttr:{dependencyType:"attributeComponent",attributeName:"variables",variableNames:["variables"]},parentVariableForChild:{dependencyType:"parentStateVariable",variableName:"variableForChild"},functionChild:{dependencyType:"child",childGroups:["functions"]}},ls={};for(let us of ss)ls[us]={functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["variable"+(Number(us)+1)]}};return{globalDependencies:os,dependenciesByKey:ls}},arrayDefinitionByKey({globalDependencyValues:ss,dependencyValuesByKey:os,arraySize:ls,arrayKeys:us,usedDefault:cs}){if(ss.variablesAttr!==null){let ds=ss.variablesAttr.stateValues.variables;return{setValue:{variables:returnNVariables(ls[0],ds)}}}else if(ss.functionChild.length>0){let ds={};for(let ps of us)ds[ps]=os[ps].functionChild[0].stateValues["variable"+(Number(ps)+1)];return{setValue:{variables:ds}}}else return ss.parentVariableForChild&&!cs.parentVariableForChild?{setValue:{variables:Array(ls[0]).fill(ss.parentVariableForChild)}}:{setValue:{variables:returnNVariables(ls[0],[])}}}},ns.variable={isAlias:!0,targetVariableName:"variable1"},ns.formula={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},defaultValue:Context.fromAst(0),hasEssential:!0,returnDependencies:()=>({mathChild:{dependencyType:"child",childGroups:["maths"],variableNames:["value","formula"],variablesOptional:!0},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["formula"]},isInterpolatedFunction:{dependencyType:"stateVariable",variableName:"isInterpolatedFunction"}}),definition:function({dependencyValues:ss,usedDefault:os}){return ss.isInterpolatedFunction?{setValue:{formula:Context.fromAst("_")}}:ss.mathChild.length>0?{setValue:{formula:ss.mathChild[0].stateValues.value}}:ss.functionChild.length>0&&!os.functionChild[0].formula?{setValue:{formula:ss.functionChild[0].stateValues.formula}}:{useEssentialOrDefaultValue:{formula:!0}}}},ns.nPrescribedPoints={returnDependencies:()=>({through:{dependencyType:"attributeComponent",attributeName:"through",variableNames:["nPoints"]}}),definition({dependencyValues:ss}){let os=0;return ss.through!==null&&(os=ss.through.stateValues.nPoints),{setValue:{nPrescribedPoints:os}}}},ns.prescribedPoints={isArray:!0,entryPrefixes:["prescribedPoint"],returnArraySizeDependencies:()=>({nPrescribedPoints:{dependencyType:"stateVariable",variableName:"nPrescribedPoints"}}),returnArraySize({dependencyValues:ss}){return[ss.nPrescribedPoints]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={};for(let ls of ss){let us=Number(ls)+1;os[ls]={through:{dependencyType:"attributeComponent",attributeName:"through",variableNames:["point"+us]},throughSlopes:{dependencyType:"attributeComponent",attributeName:"throughSlopes",variableNames:["math"+us]}}}return{dependenciesByKey:os}},arrayDefinitionByKey({dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=ss[us].through;if(cs!==null){let ds=Number(us)+1,ps=cs.stateValues["point"+ds],fs=null,hs=ss[us].throughSlopes;hs!==null&&(fs=hs.stateValues["math"+ds],fs===void 0&&(fs=null)),ls[us]={x:ps[0],y:ps[1],slope:fs}}}return{setValue:{prescribedPoints:ls}}}},ns.prescribedMinima={returnDependencies:()=>({minima:{dependencyType:"attributeComponent",attributeName:"minima",variableNames:["extrema"]}}),definition({dependencyValues:ss}){let os=[];return ss.minima!==null&&(os=ss.minima.stateValues.extrema.map(ls=>({x:ls[0],y:ls[1]}))),{setValue:{prescribedMinima:os}}}},ns.prescribedMaxima={returnDependencies:()=>({maxima:{dependencyType:"attributeComponent",attributeName:"maxima",variableNames:["extrema"]}}),definition({dependencyValues:ss}){let os=[];return ss.maxima!==null&&(os=ss.maxima.stateValues.extrema.map(ls=>({x:ls[0],y:ls[1]}))),{setValue:{prescribedMaxima:os}}}},ns.prescribedExtrema={returnDependencies:()=>({extrema:{dependencyType:"attributeComponent",attributeName:"extrema",variableNames:["extrema"]}}),definition({dependencyValues:ss}){let os=[];return ss.extrema!==null&&(os=ss.extrema.stateValues.extrema.map(ls=>({x:ls[0],y:ls[1]}))),{setValue:{prescribedExtrema:os}}}},ns.interpolationPoints={returnDependencies:()=>({xscale:{dependencyType:"stateVariable",variableName:"xscale"},yscale:{dependencyType:"stateVariable",variableName:"yscale"},prescribedPoints:{dependencyType:"stateVariable",variableName:"prescribedPoints"},prescribedMinima:{dependencyType:"stateVariable",variableName:"prescribedMinima"},prescribedMaxima:{dependencyType:"stateVariable",variableName:"prescribedMaxima"},prescribedExtrema:{dependencyType:"stateVariable",variableName:"prescribedExtrema"}}),definition:({dependencyValues:ss})=>calculateInterpolationPoints({dependencyValues:ss,numerics:rs})},ns.xs={additionalStateVariablesDefined:["coeffs"],returnDependencies:()=>({interpolationPoints:{dependencyType:"stateVariable",variableName:"interpolationPoints"}}),definition:computeSplineParamCoeffs},ns.mathChildName={returnDependencies(){return{mathChild:{dependencyType:"child",childGroups:["maths"]}}},definition({dependencyValues:ss}){return ss.mathChild.length>0?{setValue:{mathChildName:ss.mathChild[0].componentName}}:{setValue:{mathChildName:null}}}},ns.mathChildCreatedBySugar={stateVariablesDeterminingDependencies:["mathChildName"],returnDependencies({stateValues:ss}){return ss.mathChildName?{mathChildCreatedBySugar:{dependencyType:"doenetAttribute",componentName:ss.mathChildName,attributeName:"createdFromSugar"}}:{}},definition({dependencyValues:ss}){return{setValue:{mathChildCreatedBySugar:!!ss.mathChildCreatedBySugar}}}},ns.symbolicfs={isArray:!0,entryPrefixes:["symbolicf"],stateVariablesDeterminingDependencies:["isInterpolatedFunction","mathChildName","mathChildCreatedBySugar"],returnArraySizeDependencies:()=>({nOutputs:{dependencyType:"stateVariable",variableName:"nOutputs"}}),returnArraySize({dependencyValues:ss}){return[ss.nOutputs]},returnArrayDependenciesByKey({stateValues:ss}){if(ss.isInterpolatedFunction)return{globalDependencies:{xs:{dependencyType:"stateVariable",variableName:"xs"},coeffs:{dependencyType:"stateVariable",variableName:"coeffs"},interpolationPoints:{dependencyType:"stateVariable",variableName:"interpolationPoints"},isInterpolatedFunction:{dependencyType:"stateVariable",variableName:"isInterpolatedFunction"},domain:{dependencyType:"stateVariable",variableName:"domain"}}};{let os={formula:{dependencyType:"stateVariable",variableName:"formula"},variables:{dependencyType:"stateVariable",variableName:"variables"},nInputs:{dependencyType:"stateVariable",variableName:"nInputs"},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["symbolicfs"]},simplify:{dependencyType:"stateVariable",variableName:"simplify"},expand:{dependencyType:"stateVariable",variableName:"expand"},isInterpolatedFunction:{dependencyType:"stateVariable",variableName:"isInterpolatedFunction"},symbolicfShadow:{dependencyType:"stateVariable",variableName:"symbolicfShadow"},numericalfShadow:{dependencyType:"stateVariable",variableName:"numericalfShadow"},domain:{dependencyType:"stateVariable",variableName:"domain"}};return ss.mathChildName&&(ss.mathChildCreatedBySugar?(os.mathChildExpressionWithCodes={dependencyType:"stateVariable",componentName:ss.mathChildName,variableName:"expressionWithCodes"},os.mathChildMathChildren={dependencyType:"child",parentName:ss.mathChildName,childGroups:["maths"],variableNames:["value","fReevaluate","inputMaths"],variablesOptional:!0},os.mathChildCodePre={dependencyType:"stateVariable",componentName:ss.mathChildName,variableName:"codePre"}):os.mathChild={dependencyType:"child",childGroups:["maths"],variableNames:["value","fReevaluate","inputMaths"],variablesOptional:!0}),{globalDependencies:os}}},arrayDefinitionByKey:function({globalDependencyValues:ss,usedDefault:os,arrayKeys:ls}){var us,cs;if(ss.isInterpolatedFunction){let ds={};for(let ps of ls)if(ps==="0"){let fs=returnInterpolatedFunction({xs:ss.xs,coeffs:ss.coeffs,interpolationPoints:ss.interpolationPoints,domain:ss.domain});ds[ps]=function(hs){let gs=hs.evaluate_to_constant();return Context.fromAst(fs(gs))}}else ds[ps]=fs=>Context.fromAst("_");return{setValue:{symbolicfs:ds}}}else if(ss.functionChild.length>0){let ds={};for(let ps of ls)ds[ps]=ss.functionChild[0].stateValues.symbolicfs[ps];return{setValue:{symbolicfs:ds}}}else if(os.formula)if(ss.symbolicfShadow){let ds={};for(let ps of ls)ps==="0"?ds[ps]=ss.symbolicfShadow:ds[ps]=fs=>Context.fromAst("_");return{setValue:{symbolicfs:ds}}}else if(ss.numericalfShadow){let ds={};for(let ps of ls)ps==="0"?ds[ps]=function(fs){let hs=fs.evaluate_to_constant();return Context.fromAst(ss.numericalfShadow(hs))}:ds[ps]=fs=>Context.fromAst("_");return{setValue:{symbolicfs:ds}}}else{let ds={};for(let ps of ls)ds[ps]=returnSymbolicFunctionFromFormula({formula:ss.formula,simplify:ss.simplify,expand:ss.expand,nInputs:ss.nInputs,variables:ss.variables,domain:ss.domain,component:ps});return{setValue:{symbolicfs:ds}}}else{if(((us=ss.mathChildMathChildren)==null?void 0:us.length)>0){let ps=ss.variables.map(bs=>bs.subscripts_to_strings().tree),fs={},hs=!1,gs=ss.mathChildCodePre,ys={};for(let[bs,vs]of ss.mathChildMathChildren.entries())vs.stateValues.fReevaluate&&vs.stateValues.inputMaths.reduce((Cs,Ts)=>[...Cs,...Ts.subscripts_to_strings().variables()],[]).some(Cs=>ps.includes(Cs))?(fs[gs+bs]={fReevaluate:vs.stateValues.fReevaluate,inputMathFs:vs.stateValues.inputMaths.map(Cs=>Cs.subscripts_to_strings().f())},hs=!0):ys[gs+bs]=vs.stateValues.value;if(hs){let bs=ss.mathChildExpressionWithCodes;Object.keys(ys).length>0&&(bs=bs.substitute(ys)),bs=Context.fromAst(mergeListsWithOtherContainers(bs.tree));let vs={};for(let xs of ls)vs[xs]=returnSymbolicFunctionFromReevaluatedFormula({formulaExpressionWithCodes:bs,evaluateChildrenToReevaluate:fs,simplify:ss.simplify,expand:ss.expand,nInputs:ss.nInputs,variables:ss.variables,domain:ss.domain,component:xs});return{setValue:{symbolicfs:vs}}}}else if((cs=ss.mathChild)!=null&&cs[0].stateValues.fReevaluate){let ps=ss.variables.map(gs=>gs.subscripts_to_strings().tree),fs=ss.mathChild[0];if(fs.stateValues.inputMaths.reduce((gs,ys)=>[...gs,...ys.subscripts_to_strings().variables()],[]).some(gs=>ps.includes(gs))){let gs=Context.fromAst("code"),ys={code:{fReevaluate:fs.stateValues.fReevaluate,inputMathFs:fs.stateValues.inputMaths.map(vs=>vs.subscripts_to_strings().f())}},bs={};for(let vs of ls)bs[vs]=returnSymbolicFunctionFromReevaluatedFormula({formulaExpressionWithCodes:gs,evaluateChildrenToReevaluate:ys,simplify:ss.simplify,expand:ss.expand,nInputs:ss.nInputs,variables:ss.variables,domain:ss.domain,component:vs});return{setValue:{symbolicfs:bs}}}}let ds={};for(let ps of ls)ds[ps]=returnSymbolicFunctionFromFormula({formula:ss.formula,simplify:ss.simplify,expand:ss.expand,nInputs:ss.nInputs,variables:ss.variables,domain:ss.domain,component:ps});return{setValue:{symbolicfs:ds}}}}},ns.symbolicf={isAlias:!0,targetVariableName:"symbolicf1"},ns.numericalfs={isArray:!0,entryPrefixes:["numericalf"],stateVariablesDeterminingDependencies:["isInterpolatedFunction","mathChildName","mathChildCreatedBySugar"],returnArraySizeDependencies:()=>({nOutputs:{dependencyType:"stateVariable",variableName:"nOutputs"}}),returnArraySize({dependencyValues:ss}){return[ss.nOutputs]},returnArrayDependenciesByKey({stateValues:ss}){if(ss.isInterpolatedFunction)return{globalDependencies:{xs:{dependencyType:"stateVariable",variableName:"xs"},coeffs:{dependencyType:"stateVariable",variableName:"coeffs"},interpolationPoints:{dependencyType:"stateVariable",variableName:"interpolationPoints"},isInterpolatedFunction:{dependencyType:"stateVariable",variableName:"isInterpolatedFunction"},domain:{dependencyType:"stateVariable",variableName:"domain"}}};{let os={formula:{dependencyType:"stateVariable",variableName:"formula"},variables:{dependencyType:"stateVariable",variableName:"variables"},nInputs:{dependencyType:"stateVariable",variableName:"nInputs"},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["numericalfs"]},isInterpolatedFunction:{dependencyType:"stateVariable",variableName:"isInterpolatedFunction"},symbolicfShadow:{dependencyType:"stateVariable",variableName:"symbolicfShadow"},numericalfShadow:{dependencyType:"stateVariable",variableName:"numericalfShadow"},domain:{dependencyType:"stateVariable",variableName:"domain"}};return ss.mathChildName&&(ss.mathChildCreatedBySugar?(os.mathChildExpressionWithCodes={dependencyType:"stateVariable",componentName:ss.mathChildName,variableName:"expressionWithCodes"},os.mathChildMathChildren={dependencyType:"child",parentName:ss.mathChildName,childGroups:["maths"],variableNames:["value","fReevaluate","inputMaths"],variablesOptional:!0},os.mathChildCodePre={dependencyType:"stateVariable",componentName:ss.mathChildName,variableName:"codePre"}):os.mathChild={dependencyType:"child",childGroups:["maths"],variableNames:["value","fReevaluate","inputMaths"],variablesOptional:!0}),{globalDependencies:os}}},arrayDefinitionByKey:function({globalDependencyValues:ss,usedDefault:os,arrayKeys:ls}){var us,cs;if(ss.isInterpolatedFunction){let ds={};for(let ps of ls)ps==="0"?ds[ps]=returnInterpolatedFunction({xs:ss.xs,coeffs:ss.coeffs,interpolationPoints:ss.interpolationPoints,domain:ss.domain}):ds[ps]=fs=>Context.fromAst("_");return{setValue:{numericalfs:ds}}}else if(ss.functionChild.length>0){let ds={};for(let ps of ls)ds[ps]=ss.functionChild[0].stateValues.numericalfs[ps];return{setValue:{numericalfs:ds}}}else if(os.formula)if(ss.numericalfShadow){let ds={};for(let ps of ls)ps==="0"?ds[ps]=ss.numericalfShadow:ds[ps]=()=>NaN;return{setValue:{numericalfs:ds}}}else if(ss.symbolicfShadow){let ds={};for(let ps of ls)ps==="0"?ds[ps]=function(fs){return ss.symbolicfShadow(Context.fromAst(fs)).evaluate_to_constant()}:ds[ps]=()=>NaN;return{setValue:{numericalfs:ds}}}else{let ds={};for(let ps of ls)ds[ps]=returnNumericalFunctionFromFormula({formula:ss.formula,nInputs:ss.nInputs,variables:ss.variables,domain:ss.domain,component:ps});return{setValue:{numericalfs:ds}}}else{if(((us=ss.mathChildMathChildren)==null?void 0:us.length)>0){let ps=ss.variables.map(bs=>bs.subscripts_to_strings().tree),fs={},hs=!1,gs=ss.mathChildCodePre,ys={};for(let[bs,vs]of ss.mathChildMathChildren.entries())vs.stateValues.fReevaluate&&vs.stateValues.inputMaths.reduce((Cs,Ts)=>[...Cs,...Ts.subscripts_to_strings().variables()],[]).some(Cs=>ps.includes(Cs))?(fs[gs+bs]={fReevaluate:vs.stateValues.fReevaluate,inputMathFs:vs.stateValues.inputMaths.map(Cs=>Cs.subscripts_to_strings().f())},hs=!0):ys[gs+bs]=vs.stateValues.value;if(hs){let bs=ss.mathChildExpressionWithCodes;Object.keys(ys).length>0&&(bs=bs.substitute(ys)),bs=Context.fromAst(mergeListsWithOtherContainers(bs.tree));let vs={};for(let xs of ls)vs[xs]=returnNumericalFunctionFromReevaluatedFormula({formulaExpressionWithCodes:bs,evaluateChildrenToReevaluate:fs,nInputs:ss.nInputs,variables:ss.variables,domain:ss.domain,component:xs});return{setValue:{numericalfs:vs}}}}else if((cs=ss.mathChild)!=null&&cs[0].stateValues.fReevaluate){let ps=ss.variables.map(gs=>gs.subscripts_to_strings().tree),fs=ss.mathChild[0];if(fs.stateValues.inputMaths.reduce((gs,ys)=>[...gs,...ys.subscripts_to_strings().variables()],[]).some(gs=>ps.includes(gs))){let gs=Context.fromAst("code"),ys={code:{fReevaluate:fs.stateValues.fReevaluate,inputMathFs:fs.stateValues.inputMaths.map(vs=>vs.subscripts_to_strings().f())}},bs={};for(let vs of ls)bs[vs]=returnNumericalFunctionFromReevaluatedFormula({formulaExpressionWithCodes:gs,evaluateChildrenToReevaluate:ys,nInputs:ss.nInputs,variables:ss.variables,domain:ss.domain,component:vs});return{setValue:{numericalfs:bs}}}}let ds={};for(let ps of ls)ds[ps]=returnNumericalFunctionFromFormula({formula:ss.formula,nInputs:ss.nInputs,variables:ss.variables,domain:ss.domain,component:ps});return{setValue:{numericalfs:ds}}}}},ns.numericalf={returnDependencies:()=>({numericalf1:{dependencyType:"stateVariable",variableName:"numericalf1"}}),definition({dependencyValues:ss}){return{setValue:{numericalf:ss.numericalf1}}}},ns.fDefinitions={isArray:!0,entryPrefixes:["fDefinition"],stateVariablesDeterminingDependencies:["isInterpolatedFunction","mathChildName","mathChildCreatedBySugar"],returnArraySizeDependencies:()=>({nOutputs:{dependencyType:"stateVariable",variableName:"nOutputs"}}),returnArraySize({dependencyValues:ss}){return[ss.nOutputs]},returnArrayDependenciesByKey({stateValues:ss}){if(ss.isInterpolatedFunction)return{globalDependencies:{xs:{dependencyType:"stateVariable",variableName:"xs"},coeffs:{dependencyType:"stateVariable",variableName:"coeffs"},interpolationPoints:{dependencyType:"stateVariable",variableName:"interpolationPoints"},isInterpolatedFunction:{dependencyType:"stateVariable",variableName:"isInterpolatedFunction"},domain:{dependencyType:"stateVariable",variableName:"domain"}}};{let os={formula:{dependencyType:"stateVariable",variableName:"formula"},variables:{dependencyType:"stateVariable",variableName:"variables"},nInputs:{dependencyType:"stateVariable",variableName:"nInputs"},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["fDefinitions"]},isInterpolatedFunction:{dependencyType:"stateVariable",variableName:"isInterpolatedFunction"},symbolicfShadow:{dependencyType:"stateVariable",variableName:"symbolicfShadow"},numericalfShadow:{dependencyType:"stateVariable",variableName:"numericalfShadow"},domain:{dependencyType:"stateVariable",variableName:"domain"}};return ss.mathChildName&&(ss.mathChildCreatedBySugar?(os.mathChildExpressionWithCodes={dependencyType:"stateVariable",componentName:ss.mathChildName,variableName:"expressionWithCodes"},os.mathChildMathChildren={dependencyType:"child",parentName:ss.mathChildName,childGroups:["maths"],variableNames:["value","fReevaluateDefinition","inputMaths"],variablesOptional:!0},os.mathChildCodePre={dependencyType:"stateVariable",componentName:ss.mathChildName,variableName:"codePre"}):os.mathChild={dependencyType:"child",childGroups:["maths"],variableNames:["value","fReevaluateDefinition","inputMaths"],variablesOptional:!0}),{globalDependencies:os}}},arrayDefinitionByKey:function({globalDependencyValues:ss,usedDefault:os,arrayKeys:ls}){var us,cs;if(ss.isInterpolatedFunction){let ds={};for(let ps of ls)ps==="0"?ds[ps]={functionType:"interpolated",xs:ss.xs,coeffs:ss.coeffs,interpolationPoints:ss.interpolationPoints,domain:ss.domain?ss.domain.map(fs=>fs.tree):null}:ds[ps]={};return{setValue:{fDefinitions:ds}}}else if(ss.functionChild.length>0){let ds={};for(let ps of ls)ds[ps]=ss.functionChild[0].stateValues.fDefinitions[ps];return{setValue:{fDefinitions:ds}}}else if(os.formula)if(ss.numericalfShadow){let ds={};for(let ps of ls)ds[ps]={};return{setValue:{fDefinitions:ds}}}else if(ss.symbolicfShadow){let ds={};for(let ps of ls)ds[ps]={};return{setValue:{fDefinitions:ds}}}else{let ds={};for(let ps of ls)ds[ps]={functionType:"formula",formula:ss.formula.tree,variables:ss.variables.map(fs=>fs.tree),nInputs:ss.nInputs,nOutputs:ss.nOutputs,domain:ss.domain?ss.domain.map(fs=>fs.tree):null,component:ps};return{setValue:{fDefinitions:ds}}}else{if(((us=ss.mathChildMathChildren)==null?void 0:us.length)>0){let ps=ss.variables.map(bs=>bs.subscripts_to_strings().tree),fs={},hs=!1,gs=ss.mathChildCodePre,ys={};for(let[bs,vs]of ss.mathChildMathChildren.entries())vs.stateValues.fReevaluateDefinition&&vs.stateValues.inputMaths.reduce((Cs,Ts)=>[...Cs,...Ts.subscripts_to_strings().variables()],[]).some(Cs=>ps.includes(Cs))?(fs[gs+bs]={fReevaluateDefinition:vs.stateValues.fReevaluateDefinition,inputMaths:vs.stateValues.inputMaths},hs=!0):ys[gs+bs]=vs.stateValues.value;if(hs){let bs=ss.mathChildExpressionWithCodes;Object.keys(ys).length>0&&(bs=bs.substitute(ys)),bs=Context.fromAst(mergeListsWithOtherContainers(bs.tree));let vs={};for(let xs of ls)vs[xs]={functionType:"reevaluatedFormula",formulaExpressionWithCodes:bs,evaluateChildrenToReevaluate:fs,nInputs:ss.nInputs,variables:ss.variables.map(Cs=>Cs.tree),domain:ss.domain?ss.domain.map(Cs=>Cs.tree):null,component:xs};return{setValue:{fDefinitions:vs}}}}else if((cs=ss.mathChild)!=null&&cs[0].stateValues.fReevaluateDefinition){let ps=ss.variables.map(gs=>gs.subscripts_to_strings().tree),fs=ss.mathChild[0];if(fs.stateValues.inputMaths.reduce((gs,ys)=>[...gs,...ys.subscripts_to_strings().variables()],[]).some(gs=>ps.includes(gs))){let gs=Context.fromAst("code"),ys={code:{fReevaluateDefinition:fs.stateValues.fReevaluateDefinition,inputMaths:fs.stateValues.inputMaths}},bs={};for(let vs of ls)bs[vs]={functionType:"reevaluatedFormula",formulaExpressionWithCodes:gs,evaluateChildrenToReevaluate:ys,nInputs:ss.nInputs,variables:ss.variables.map(xs=>xs.tree),domain:ss.domain?ss.domain.map(xs=>xs.tree):null,component:vs};return{setValue:{fDefinitions:bs}}}}let ds={};for(let ps of ls)ds[ps]={functionType:"formula",formula:ss.formula.tree,variables:ss.variables.map(fs=>fs.tree),nInputs:ss.nInputs,nOutputs:ss.nOutputs,domain:ss.domain?ss.domain.map(fs=>fs.tree):null,component:ps};return{setValue:{fDefinitions:ds}}}}},ns.fDefinition={isAlias:!0,targetVariableName:"fDefinition1"},ns.fs={isArray:!0,entryPrefixes:["f"],returnArraySizeDependencies:()=>({nOutputs:{dependencyType:"stateVariable",variableName:"nOutputs"}}),returnArraySize({dependencyValues:ss}){return[ss.nOutputs]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={symbolic:{dependencyType:"stateVariable",variableName:"symbolic"}},ls={};for(let us of ss){let cs=Number(us)+1;ls[us]={symbolicf:{dependencyType:"stateVariable",variableName:"symbolicf"+cs},numericalf:{dependencyType:"stateVariable",variableName:"numericalf"+cs}}}return{globalDependencies:os,dependenciesByKey:ls}},arrayDefinitionByKey({globalDependencyValues:ss,dependencyValuesByKey:os,arrayKeys:ls}){let us={};if(ss.symbolic)for(let cs of ls)us[cs]=os[cs].symbolicf;else for(let cs of ls)us[cs]=os[cs].numericalf;return{setValue:{fs:us}}}},ns.f={isAlias:!0,targetVariableName:"f1"},ns.latex={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({formula:{dependencyType:"stateVariable",variableName:"formula"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"},padZeros:{dependencyType:"stateVariable",variableName:"padZeros"}}),definition:function({dependencyValues:ss,usedDefault:os}){let ls={};return ss.padZeros&&(os.displayDigits&&!os.displayDecimals?Number.isFinite(ss.displayDecimals)&&(ls.padToDecimals=ss.displayDecimals):ss.displayDigits>=1&&(ls.padToDigits=ss.displayDigits)),{setValue:{latex:roundForDisplay({value:ss.formula,dependencyValues:ss,usedDefault:os}).toLatex(ls)}}}},ns.latexWithInputChildren={forRenderer:!0,returnDependencies:()=>({latex:{dependencyType:"stateVariable",variableName:"latex"}}),definition:function({dependencyValues:ss}){return{setValue:{latexWithInputChildren:[ss.latex]}}}},ns.allMinima={stateVariablesDeterminingDependencies:["isInterpolatedFunction"],returnDependencies({stateValues:ss}){return ss.isInterpolatedFunction?{xs:{dependencyType:"stateVariable",variableName:"xs"},coeffs:{dependencyType:"stateVariable",variableName:"coeffs"},isInterpolatedFunction:{dependencyType:"stateVariable",variableName:"isInterpolatedFunction"},domain:{dependencyType:"stateVariable",variableName:"domain"}}:{numericalf:{dependencyType:"stateVariable",variableName:"numericalf"},formula:{dependencyType:"stateVariable",variableName:"formula"},variables:{dependencyType:"stateVariable",variableName:"variables"},xscale:{dependencyType:"stateVariable",variableName:"xscale"},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["allMinima"]},isInterpolatedFunction:{dependencyType:"stateVariable",variableName:"isInterpolatedFunction"},nInputs:{dependencyType:"stateVariable",variableName:"nInputs"},nOutputs:{dependencyType:"stateVariable",variableName:"nOutputs"},domain:{dependencyType:"stateVariable",variableName:"domain"}}},definition:function({dependencyValues:ss}){if(ss.isInterpolatedFunction){let os=ss.xs,ls=ss.coeffs,us=rs.eps,cs=[];if(os===null)return{setValue:{allMinima:cs}};let ds=!1,ps=-1/0,fs=1/0,hs=!1,gs=!1;if(ss.domain!==null){let xs=ss.domain[0];xs!==void 0&&(ps=Context.fromAst(xs.tree[1][1]).evaluate_to_constant(),Number.isFinite(ps)?hs=!xs.tree[2][1]:ps=-1/0,fs=Context.fromAst(xs.tree[1][2]).evaluate_to_constant(),Number.isFinite(fs)?gs=!xs.tree[2][2]:fs=1/0)}let ys=1e-14*Math.max(Math.abs(ps),Math.abs(fs)),bs=ls[0],vs=os[1]-os[0];if(bs[3]===0){if(bs[2]>0){let xs=-bs[1]/(2*bs[2]);xs+os[0]>=ps-ys&&xs+os[0]<=fs+ys&&(xs<=vs-us?hs&&Math.abs(xs+os[0]-ps)0){let Cs=Math.sqrt(xs),Ts=(-2*bs[2]+Cs)/(6*bs[3]);Ts+os[0]>=ps-ys&&Ts+os[0]<=fs+ys&&(Ts<=vs-us?hs&&Math.abs(Ts+os[0]-ps)0){let Cs=-bs[1]/(2*bs[2]);if(Cs+os[xs]>=ps-ys)if(Cs+os[xs]<=fs+ys)Math.abs(Cs)=us&&Cs<=vs-us&&(hs&&Math.abs(Cs+os[xs]-ps)0){let Ts=Math.sqrt(Cs),Ss=(-2*bs[2]+Ts)/(6*bs[3]);if(Ss+os[xs]>=ps-ys)if(Ss+os[xs]<=fs+ys)Math.abs(Ss)=us&&Ss<=vs-us&&(hs&&Math.abs(Ss+os[xs]-ps)0){let xs=-bs[1]/(2*bs[2]);xs+os[os.length-2]>=ps-ys&&xs+os[os.length-2]<=fs+ys&&(Math.abs(xs)=us&&(hs&&Math.abs(xs+os[os.length-2]-ps)0){let Cs=Math.sqrt(xs),Ts=(-2*bs[2]+Cs)/(6*bs[3]);Ts+os[os.length-2]>=ps-ys&&Ts+os[os.length-2]<=fs+ys&&(Ts>=us?hs&&Math.abs(Ts+os[os.length-2]-ps)0)return{setValue:{allMinima:ss.functionChild[0].stateValues.allMinima}};if(!(ss.nInputs===1&&ss.nOutputs===1))return{setValue:{allMinima:[]}};let os=ss.variables[0].subscripts_to_strings().tree,ls=ss.formula.subscripts_to_strings().derivative(os),us,cs=!0,ds;try{us=ls.subscripts_to_strings().f()}catch{cs=!1,ds=()=>NaN}cs&&(ds=function(ws){try{return us({[os]:ws})}catch{return NaN}});let ps=ws=>ss.numericalf(ws,!0),fs=-100*ss.xscale,hs=100*ss.xscale,gs=!1,ys=!1;if(ss.domain!==null){let ws=ss.domain[0];ws!==void 0&&(fs=Context.fromAst(ws.tree[1][1]).evaluate_to_constant(),Number.isFinite(fs)?gs=!ws.tree[2][1]:fs=-100*ss.xscale,hs=Context.fromAst(ws.tree[1][2]).evaluate_to_constant(),Number.isFinite(hs)?ys=!ws.tree[2][2]:hs=100*ss.xscale)}let bs=1e3,vs=(hs-fs)/bs,xs=1e-10*Math.max(Math.abs(fs),Math.abs(hs)),Cs=[],Ts=!1,Ss=!1,Ns=ps(fs-vs),As=ds(fs-vs);for(let ws=-1;ws0&&(Ds=!0,Ts=!1,Os>=fs-xs&&Os<=hs+xs&&!(gs&&Math.abs(Os-fs)({allMinima:{dependencyType:"stateVariable",variableName:"allMinima"}}),definition({dependencyValues:ss}){return{setValue:{numberMinima:ss.allMinima.length},checkForActualChange:{numberMinima:!0}}}},ns.minima={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"],returnWrappingComponents(ss){return ss==="minimum"||ss===void 0?[["point",{componentType:"mathList",isAttribute:"xs"}]]:[]}},isArray:!0,nDimensions:2,entryPrefixes:["minimum","minimumLocations","minimumLocation","minimumValues","minimumValue"],getArrayKeysFromVarName({arrayEntryPrefix:ss,varEnding:os,arraySize:ls}){if(["minimum","minimumLocation","minimumValue"].includes(ss)){let us=Number(os)-1;return Number.isInteger(us)&&us>=0?!ls||uscs+",0"):["0,0"]:ss==="minimumValues"?os!==""?[]:ls?Array.from(Array(ls[0]),(us,cs)=>cs+",1"):["0,1"]:[]},arrayVarNameFromArrayKey(ss){let[os,ls]=ss.split(",");return ls==="0"?"minimumLocation"+(Number(os)+1):"minimumValue"+(Number(os)+1)},arrayVarNameFromPropIndex(ss,os){if(os==="minima"){if(ss.length===1)return"minimum"+ss[0];{let ls=Number(ss[0]);if(Number.isInteger(ls)&&ls>0){if(ss[1]===1)return"minimumLocation"+ls;if(ss[1]===2)return"minimumValue"+ls}return null}}if(os==="minimumLocations")return"minimumLocation"+ss[0];if(os==="minimumValues")return"minimumValue"+ss[0];if(os.slice(0,7)==="minimum"){let ls=Number(os.slice(7));if(Number.isInteger(ls)&&ls>0){if(ss[0]===1)return"minimumLocation"+ls;if(ss[0]===2)return"minimumValue"+ls}}return null},returnArraySizeDependencies:()=>({numberMinima:{dependencyType:"stateVariable",variableName:"numberMinima"}}),returnArraySize({dependencyValues:ss}){return[ss.numberMinima,2]},returnArrayDependenciesByKey(){return{globalDependencies:{allMinima:{dependencyType:"stateVariable",variableName:"allMinima"}}}},arrayDefinitionByKey({globalDependencyValues:ss}){let os={};for(let ls=0;ls=ps-ys&&xs+os[0]<=fs+ys&&(xs<=vs-us?hs&&Math.abs(xs+os[0]-ps)0){let Cs=Math.sqrt(xs),Ts=(-2*bs[2]-Cs)/(6*bs[3]);Ts+os[0]>=ps-ys&&Ts+os[0]<=fs+ys&&(Ts<=vs-us?hs&&Math.abs(Ts+os[0]-ps)=ps-ys)if(Cs+os[xs]<=fs+ys)Math.abs(Cs)=us&&Cs<=vs-us&&(hs&&Math.abs(Cs+os[xs]-ps)0){let Ts=Math.sqrt(Cs),Ss=(-2*bs[2]-Ts)/(6*bs[3]);if(Ss+os[xs]>=ps-ys)if(Ss+os[xs]<=fs+ys)Math.abs(Ss)=us&&Ss<=vs-us&&(hs&&Math.abs(Ss+os[xs]-ps)=ps-ys&&xs+os[os.length-2]<=fs+ys&&(Math.abs(xs)=us&&(hs&&Math.abs(xs+os[os.length-2]-ps)0){let Cs=Math.sqrt(xs),Ts=(-2*bs[2]-Cs)/(6*bs[3]);Ts+os[os.length-2]>=ps-ys&&Ts+os[os.length-2]<=fs+ys&&(Ts>=us?hs&&Math.abs(Ts+os[os.length-2]-ps)0)return{setValue:{allMaxima:ss.functionChild[0].stateValues.allMaxima}};if(!(ss.nInputs===1&&ss.nOutputs===1))return{setValue:{allMaxima:[]}};let os=ss.variables[0].subscripts_to_strings().tree,ls=ss.formula.subscripts_to_strings().derivative(os),us,cs=!0,ds;try{us=ls.subscripts_to_strings().f()}catch{cs=!1,ds=()=>NaN}cs&&(ds=function(ws){try{return us({[os]:ws})}catch{return NaN}});let ps=ws=>-ss.numericalf(ws,!0),fs=-100*ss.xscale,hs=100*ss.xscale,gs=!1,ys=!1;if(ss.domain!==null){let ws=ss.domain[0];ws!==void 0&&(fs=Context.fromAst(ws.tree[1][1]).evaluate_to_constant(),Number.isFinite(fs)?gs=!ws.tree[2][1]:fs=-100*ss.xscale,hs=Context.fromAst(ws.tree[1][2]).evaluate_to_constant(),Number.isFinite(hs)?ys=!ws.tree[2][2]:hs=100*ss.xscale)}let bs=1e3,vs=(hs-fs)/bs,xs=1e-10*Math.max(Math.abs(fs),Math.abs(hs)),Cs=[],Ts=!1,Ss=!1,Ns=ps(fs-vs),As=ds(fs-vs);for(let ws=-1;ws0&&ds(Os+Vs)<0&&(Ds=!0,Ts=!1,Os>=fs-xs&&Os<=hs+xs&&!(gs&&Math.abs(Os-fs)({allMaxima:{dependencyType:"stateVariable",variableName:"allMaxima"}}),definition({dependencyValues:ss}){return{setValue:{numberMaxima:ss.allMaxima.length},checkForActualChange:{numberMaxima:!0}}}},ns.maxima={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"],returnWrappingComponents(ss){return ss==="maximum"||ss===void 0?[["point",{componentType:"mathList",isAttribute:"xs"}]]:[]}},isArray:!0,nDimensions:2,entryPrefixes:["maximum","maximumLocations","maximumLocation","maximumValues","maximumValue"],getArrayKeysFromVarName({arrayEntryPrefix:ss,varEnding:os,arraySize:ls}){if(["maximum","maximumLocation","maximumValue"].includes(ss)){let us=Number(os)-1;return Number.isInteger(us)&&us>=0?!ls||uscs+",0"):["0,0"]:ss==="maximumValues"?os!==""?[]:ls?Array.from(Array(ls[0]),(us,cs)=>cs+",1"):["0,1"]:[]},arrayVarNameFromArrayKey(ss){let[os,ls]=ss.split(",");return ls==="0"?"maximumLocation"+(Number(os)+1):"maximumValue"+(Number(os)+1)},arrayVarNameFromPropIndex(ss,os){if(os==="maxima"){if(ss.length===1)return"maximum"+ss[0];{let ls=Number(ss[0]);if(Number.isInteger(ls)&&ls>0){if(ss[1]===1)return"maximumLocation"+ls;if(ss[1]===2)return"maximumValue"+ls}return null}}if(os==="maximumLocations")return"maximumLocation"+ss[0];if(os==="maximumValues")return"maximumValue"+ss[0];if(os.slice(0,7)==="maximum"){let ls=Number(os.slice(7));if(Number.isInteger(ls)&&ls>0){if(ss[0]===1)return"maximumLocation"+ls;if(ss[0]===2)return"maximumValue"+ls}}return null},returnArraySizeDependencies:()=>({numberMaxima:{dependencyType:"stateVariable",variableName:"numberMaxima"}}),returnArraySize({dependencyValues:ss}){return[ss.numberMaxima,2]},returnArrayDependenciesByKey(){return{globalDependencies:{allMaxima:{dependencyType:"stateVariable",variableName:"allMaxima"}}}},arrayDefinitionByKey({globalDependencyValues:ss}){let os={};for(let ls=0;ls({numberMinima:{dependencyType:"stateVariable",variableName:"numberMinima"},numberMaxima:{dependencyType:"stateVariable",variableName:"numberMaxima"}}),definition:function({dependencyValues:ss}){return{setValue:{numberExtrema:ss.numberMinima+ss.numberMaxima},checkForActualChange:{numberExtrema:!0}}}},ns.allExtrema={returnDependencies:()=>({allMinima:{dependencyType:"stateVariable",variableName:"allMinima"},allMaxima:{dependencyType:"stateVariable",variableName:"allMaxima"}}),definition({dependencyValues:ss}){return{setValue:{allExtrema:[...ss.allMinima,...ss.allMaxima].sort((ls,us)=>ls[0]-us[0])}}}},ns.extrema={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"],returnWrappingComponents(ss){return ss==="extremum"||ss===void 0?[["point",{componentType:"mathList",isAttribute:"xs"}]]:[]}},isArray:!0,nDimensions:2,entryPrefixes:["extremum","extremumLocations","extremumLocation","extremumValues","extremumValue"],getArrayKeysFromVarName({arrayEntryPrefix:ss,varEnding:os,arraySize:ls}){if(["extremum","extremumLocation","extremumValue"].includes(ss)){let us=Number(os)-1;return Number.isInteger(us)&&us>=0?!ls||uscs+",0"):["0,0"]:ss==="extremumValues"?os!==""?[]:ls?Array.from(Array(ls[0]),(us,cs)=>cs+",1"):["0,1"]:[]},arrayVarNameFromArrayKey(ss){let[os,ls]=ss.split(",");return ls==="0"?"extremumLocation"+(Number(os)+1):"extremumValue"+(Number(os)+1)},arrayVarNameFromPropIndex(ss,os){if(os==="extrema"){if(ss.length===1)return"extremum"+ss[0];{let ls=Number(ss[0]);if(Number.isInteger(ls)&&ls>0){if(ss[1]===1)return"extremumLocation"+ls;if(ss[1]===2)return"extremumValue"+ls}return null}}if(os==="extremumLocations")return"extremumLocation"+ss[0];if(os==="extremumValues")return"extremumValue"+ss[0];if(os.slice(0,8)==="extremum"){let ls=Number(os.slice(8));if(Number.isInteger(ls)&&ls>0){if(ss[0]===1)return"extremumLocation"+ls;if(ss[0]===2)return"extremumValue"+ls}}return null},returnArraySizeDependencies:()=>({numberExtrema:{dependencyType:"stateVariable",variableName:"numberExtrema"}}),returnArraySize({dependencyValues:ss}){return[ss.numberExtrema,2]},returnArrayDependenciesByKey(){return{globalDependencies:{allExtrema:{dependencyType:"stateVariable",variableName:"allExtrema"}}}},arrayDefinitionByKey({globalDependencyValues:ss}){let os={};for(let ls=0;ls0&&ss.functionChild[0].stateValues.returnNumericalDerivatives){let os=ss.variables.map(ds=>ds.subscripts_to_strings().tree),ls=ss.functionChild[0].stateValues.variables,us=ls.map(ds=>ds.subscripts_to_strings().tree),cs={};for(let[ds,ps]of os.entries())us[ds]&&us[ds]!==ps&&(cs[ps]=ls[ds]);return Object.keys(cs).length===0?{setValue:{returnNumericalDerivatives:ss.functionChild[0].stateValues.returnNumericalDerivatives}}:{setValue:{returnNumericalDerivatives:function(ps){let fs=[];for(let hs of ps){let gs=cs[hs.subscripts_to_strings().tree];gs?fs.push(gs):fs.push(Context.fromAst("_"))}return ss.functionChild[0].stateValues.returnNumericalDerivatives(fs)}}}}else return{setValue:{returnNumericalDerivatives:null}}}},ns.numericalDerivativesDefinition={stateVariablesDeterminingDependencies:["isInterpolatedFunction"],returnDependencies({stateValues:ss}){return ss.isInterpolatedFunction?{xs:{dependencyType:"stateVariable",variableName:"xs"},coeffs:{dependencyType:"stateVariable",variableName:"coeffs"},isInterpolatedFunction:{dependencyType:"stateVariable",variableName:"isInterpolatedFunction"},variables:{dependencyType:"stateVariable",variableName:"variables"}}:{functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["numericalDerivativesDefinition","variables"]},isInterpolatedFunction:{dependencyType:"stateVariable",variableName:"isInterpolatedFunction"},variables:{dependencyType:"stateVariable",variableName:"variables"}}},definition:function({dependencyValues:ss}){if(ss.isInterpolatedFunction)return{setValue:{numericalDerivativesDefinition:{derivativeType:"interpolatedFunction",xs:ss.xs,coeffs:ss.coeffs,variables:ss.variables}}};if(ss.functionChild.length>0&&ss.functionChild[0].stateValues.numericalDerivativesDefinition){let os=ss.variables.map(ds=>ds.subscripts_to_strings().tree),ls=ss.functionChild[0].stateValues.variables,us=ls.map(ds=>ds.subscripts_to_strings().tree),cs={};for(let[ds,ps]of os.entries())us[ds]&&us[ds]!==ps&&(cs[ps]=ls[ds]);if(Object.keys(cs).length===0)return{setValue:{numericalDerivativesDefinition:ss.functionChild[0].stateValues.numericalDerivativesDefinition}};{let ds={...ss.functionChild[0].stateValues.numericalDerivativesDefinition};return ds.variableMappings?ds.variableMappings=[cs,...ds.variableMappings]:ds.variableMappings=[cs],{setValue:{numericalDerivativesDefinition:ds}}}}else return{setValue:{numericalDerivativesDefinition:{}}}}},ns}},zs(ku,"componentType","function"),zs(ku,"rendererType","math"),zs(ku,"primaryStateVariableForDefinition","numericalfShadow"),zs(ku,"adapters",[{stateVariable:"numericalf",componentType:"curve",stateVariablesToShadow:["label","labelHasLatex"]},{stateVariable:"formula",componentType:"math",stateVariablesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]}]),ku);function calculateInterpolationPoints({dependencyValues:as,numerics:rs}){let ns=[],ss=[],os={maximum:as.prescribedMaxima,minimum:as.prescribedMinima,extremum:as.prescribedExtrema,point:as.prescribedPoints};for(let As in os)for(let ws of os[As]){let Es=null,_s=null,$s=null;if(ws.x!==null&&(Es=ws.x.evaluate_to_constant(),!Number.isFinite(Es))){console.warn(`Ignoring non-numerical ${As}`);continue}if(ws.y!==null&&(_s=ws.y.evaluate_to_constant(),!Number.isFinite(_s))){console.warn(`Ignoring non-numerical ${As}`);continue}if(ws.slope!==null&&ws.slope!==void 0&&($s=ws.slope.evaluate_to_constant(),Number.isFinite($s)||(console.warn("Ignoring non-numerical slope"),$s=null)),Es===null){if(_s===null){console.warn(`Ignoring empty ${As}`);continue}ss.push({type:As,y:_s,slope:$s})}else ns.push({type:As,x:Es,y:_s,slope:$s})}ns.sort((As,ws)=>As.x-ws.x),ss.sort((As,ws)=>As.y-ws.y);let ls=-1/0,us=rs.eps;for(let As=0;As0;){let As;fs===void 0?As=Ns({allowedTypes:["maximum","minimum","extremum"],comparison:"atLeast",value:-1/0}):fs==="maximum"?As=Ns({allowedTypes:["minimum","extremum"],comparison:"atMost",value:ps-ds}):fs==="minimum"?As=Ns({allowedTypes:["maximum","extremum"],comparison:"atLeast",value:ps+ds}):fs==="point"&&(As=Ns({allowedTypes:["maximum","extremum"],comparison:"atLeast",value:ps+ds}),As.success!==!0&&(As=Ns({allowedTypes:["minimum","extremum"],comparison:"atMost",value:ps-ds})));let ws;As.success===!0?(ws=As.point,ss.splice(As.ind,1),ys?(ws.x=0,ys=!1):ws.x=ls+cs):(ws=ss.pop(),ys?(ws.x=0,ys=!1):ws.x=ls+2*cs);let Es=xs({p:ws,typePrev:fs,xPrev:ls,yPrev:ps});fs=Es.type,ls=Es.x,ps=Es.y}if(hs.length===0&&hs.push({type:"point",x:0,y:0,slope:0}),ys=hs[0],ys.type==="maximum"){let As={type:"point",x:ys.x-cs,y:ys.y-ds,slope:2*ds/cs};hs.splice(0,0,As)}else if(ys.type==="minimum"){let As={type:"point",x:ys.x-cs,y:ys.y+ds,slope:-2*ds/cs};hs.splice(0,0,As)}else if(ys.type==="point")if(hs.length===1)ys.slope===null&&(ys.slope=0);else{let As=hs[1],ws=(As.y-ys.y)/(As.x-ys.x);if(As.type==="maximum"||As.type==="minimum")ys.slope===null&&(ys.slope=2*ws);else{hs.length===2?ys.slope===null&&(ys.slope=ws):(As.slope===null&&(As.slope=vs({point:As,prevPoint:ys,nextPoint:hs[2]})),ys.slope===null&&(ys.slope=2*(ys.y-As.y)/(ys.x-As.x)-As.slope));let Es={x:ys.x-cs,y:ys.y-cs*ys.slope,slope:ys.slope};hs.splice(0,0,Es)}}let bs=hs[hs.length-1];if(bs.type==="maximum"){let As={type:"point",x:bs.x+cs,y:bs.y-ds,slope:-2*ds/cs};hs.push(As)}else if(bs.type==="minimum"){let As={type:"point",x:bs.x+cs,y:bs.y+ds,slope:2*ds/cs};hs.push(As)}else if(bs.type==="point")if(hs.length===1){let As={type:"point",x:bs.x+cs,y:bs.y+ys.slope*cs,slope:ys.slope};hs.push(As)}else{let As=hs[hs.length-2],ws=(As.y-bs.y)/(As.x-bs.x);if(As.type==="maximum"||As.type==="minimum")bs.slope===null&&(bs.slope=2*ws);else{hs.length===2?bs.slope===null&&(bs.slope=ws):(As.slope===null&&(As.slope=vs({point:As,prevPoint:hs[hs.length-3],nextPoint:bs})),bs.slope===null&&(bs.slope=2*(As.y-bs.y)/(As.x-bs.x)-As.slope));let Es={x:bs.x+cs,y:bs.y+cs*bs.slope,slope:bs.slope};hs.push(Es)}}for(let As=1;As$s-ds?Cs({x:As.x,y:As.y,typePrev:Es,xPrev:_s,yPrev:$s,yNext:Rs,pNext:ws}):Ds!==void 0&&As.y!==null&&As.y>ws.y-ds?Cs({x:As.x,y:As.y,typePrev:Es,xPrev:_s,yPrev:$s,yNext:Rs,pNext:ws}):Ts({x:As.x,y:As.y,typePrev:Es,xPrev:_s,yPrev:$s,yNext:Rs,pNext:ws});if(Es==="minimum"||Ds==="minimum")return As.y!==null&&As.y<$s+ds?Ts({x:As.x,y:As.y,typePrev:Es,xPrev:_s,yPrev:$s,yNext:Rs,pNext:ws}):Ds!==void 0&&As.y!==null&&As.y>ws.y+ds?Ts({x:As.x,y:As.y,typePrev:Es,xPrev:_s,yPrev:$s,yNext:Rs,pNext:ws}):Cs({x:As.x,y:As.y,typePrev:Es,xPrev:_s,yPrev:$s,yNext:Rs,pNext:ws});if(Es==="point"||Ds==="point"){let Os="maximum";return(As.y===null&&ws!==void 0&&ws.type===maximum||As.y!==null&&As.y<=$s-ds||Ds!==void 0&&As.y!==null&&As.y>=ws.y-ds)&&(Os="minimum"),Os==="minimum"?Ts({x:As.x,y:As.y,typePrev:Es,xPrev:_s,yPrev:$s,yNext:Rs,pNext:ws}):Cs({x:As.x,y:As.y,typePrev:Es,xPrev:_s,yPrev:$s,yNext:Rs,pNext:ws})}else return As.y!==null&&As.y$s-ds){let Is=[(2*_s+As)/3,(_s+2*As)/3],Vs=[$s-ds,ws+ds],ks=["atMost","atLeast"],Ps=[["minimum","extremum"],["maximum","extremum"]];for(let Bs=0;Bs<2;Bs++){let Ms=Is[Bs],Ws,Us,js=null,Ls=Ns({allowedTypes:Ps[Bs],comparison:ks[Bs],value:Vs[Bs]});Ls.success===!0?(Us=Ps[Bs][0],Ws=Ls.point.y,ss.splice(Ls.ind,1),js=0):(Us="point",Ws=Vs[Bs],js=null),hs.push({type:Us,x:Ms,y:Ws,slope:js})}}}else if(Es==="minimum"){ws===null&&(Rs===void 0?ws=$s:Ds.type==="minimum"?ws=Math.min($s,Rs):ws=Math.min($s,Rs-ds));let Is=Math.max($s,ws)+ds,Vs=(As+_s)/2,ks,Ps,Bs=null,Ms=Ns({allowedTypes:["maximum","extremum"],comparison:"atLeast",value:Is});Ms.success===!0?(Ps="maximum",ks=Ms.point.y,ss.splice(Ms.ind,1),Bs=0):(Ps="point",ks=Is),hs.push({type:Ps,x:Vs,y:ks,slope:Bs})}else if(Es==="point"){if(ws===null)Rs===void 0?ws=$s-ds:Ds.type==="minimum"?ws=Math.min($s-ds,Rs):ws=Math.min($s,Rs)-ds;else if(ws>$s-ds){let Is=(As+_s)/2,Vs,ks,Ps=null,Bs=Ns({allowedTypes:["maximum","extremum"],comparison:"atLeast",value:ws+ds});Bs.success===!0?(ks="maximum",Vs=Bs.point.y,ss.splice(Bs.ind,1),Ps=0):(ks="point",Vs=ws+ds),hs.push({type:ks,x:Is,y:Vs,slope:Ps})}}let Os={type:"minimum",x:As,y:ws,slope:0};return hs.push(Os),Os}function Ss({x:As,y:ws,slope:Es,typePrev:_s,xPrev:$s,yPrev:Rs,yNext:Ds,pNext:Os}){if(_s==="maximum"){if(ws>Rs-ds){let Vs=Math.min(Rs,ws)-ds,ks=(As+$s)/2,Ps,Bs,Ms=null,Ws=Ns({allowedTypes:["minimum","extremum"],comparison:"atMost",value:Vs});Ws.success===!0?(Bs="minimum",Ps=Ws.point.y,ss.splice(Ws.ind,1),Ms=0):(Bs="point",Ps=Rs-ds),hs.push({type:Bs,x:ks,y:Ps,slope:Ms})}}else if(_s==="minimum"&&ws=Es)return{success:!0,ind:Rs,point:Ds}}}return{success:!1}}}function computeSplineParamCoeffs({dependencyValues:as}){let rs=function(cs,ds,ps,fs,hs){return[cs,ps,(-3*cs/hs+3*ds/hs-2*ps-fs)/hs,(2*cs/hs-2*ds/hs+ps+fs)/(hs*hs)]},ns=as.interpolationPoints;if(ns===null)return{setValue:{xs:null,coeffs:null}};let ss=[],os=[],ls,us=ns[0];os.push(us.x);for(let cs=1;csos.componentIsSpecifiedType(fs,"label");if(ss.length===0||!ss.every(fs=>{var hs;return typeof fs=="string"||((hs=fs.doenetAttributes)==null?void 0:hs.createdFromMacro)||ls(fs)}))return{success:!1};let us=ss.map(ls),cs=[],ds=[],ps=[];if(us.filter(fs=>fs).length===0)cs=ss;else{if(us[0]){let hs=us.indexOf(!1);hs!==-1&&(ds=ss.slice(0,hs),ss=ss.slice(hs),us=us.slice(hs))}let fs=us.indexOf(!0);fs===-1?cs=ss:(cs=ss.slice(0,fs),ps=ss.slice(fs))}return cs.length===0?{success:!1}:cs.length===1&&typeof cs[0]!="string"?{success:!1}:{success:!0,newChildren:[...ds,{componentType:"math",children:cs},...ps]}};return rs.push({replacementFunction:ns}),rs}static returnStateVariableDefinitions({numerics:rs}){let ns=super.returnStateVariableDefinitions({numerics:rs}),ss=this.componentType;ns.isInterpolatedFunction={returnDependencies:()=>({}),definition:()=>({setValue:{isInterpolatedFunction:!1}})},delete ns.nPrescribedPoints,delete ns.prescribedPoints,delete ns.prescribedMinima,delete ns.prescribedMaxima,delete ns.prescribedExtrema,delete ns.interpolationPoints,delete ns.xs,ns.operatorBasedOnFormulaIfAvailable={returnDependencies:()=>({}),definition:()=>({setValue:{operatorBasedOnFormulaIfAvailable:!1}})},ns.formula.returnDependencies=()=>({}),ns.formula.definition=()=>({setValue:{formula:Context.fromAst("_")}}),ns.operatorComposesWithOriginal={returnDependencies:()=>({}),definition:()=>({setValue:{operatorComposesWithOriginal:!0}})},ns.symbolicFunctionOperator={returnDependencies:()=>({}),definition:()=>({setValue:{symbolicFunctionOperator:us=>Context.fromAst("_")}})},ns.numericalFunctionOperator={additionalStateVariablesDefined:["numericalFunctionOperatorArguments"],returnDependencies:()=>({}),definition:()=>({setValue:{numericalFunctionOperator:us=>NaN,numericalFunctionOperatorArguments:[]}})},ns.formulaOperator={returnDependencies:()=>({}),definition:()=>({setValue:{formulaOperator:us=>Context.fromAst("_")}})},ns.returnNumericalDerivatives={returnDependencies:()=>({}),definition:()=>({setValue:{returnNumericalDerivatives:null}})},ns.formula={public:!0,shadowingInstructions:{createComponentOfType:"math"},additionalStateVariablesDefined:["operatorBasedOnFormula"],returnDependencies:()=>({operatorBasedOnFormulaIfAvailable:{dependencyType:"stateVariable",variableName:"operatorBasedOnFormulaIfAvailable"},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["formula"]},mathChild:{dependencyType:"child",childGroups:["maths"],variableNames:["value"]},formulaOperator:{dependencyType:"stateVariable",variableName:"formulaOperator"}}),definition:function({dependencyValues:us}){if(!us.operatorBasedOnFormulaIfAvailable||(us.functionChild.length===0||us.functionChild[0].stateValues.formula.tree==="_")&&(us.mathChild.length===0||us.mathChild[0].stateValues.value.tree==="_"))return{setValue:{formula:Context.fromAst("_"),operatorBasedOnFormula:!1}};let cs;return us.functionChild.length===0?cs=us.mathChild[0].stateValues.value:cs=us.functionChild[0].stateValues.formula,{setValue:{formula:us.formulaOperator(cs),operatorBasedOnFormula:!0}}}},ns.symbolicfs={isArray:!0,entryPrefixes:["symbolicf"],returnArraySizeDependencies:()=>({nOutputs:{dependencyType:"stateVariable",variableName:"nOutputs"}}),returnArraySize({dependencyValues:us}){return[us.nOutputs]},returnArrayDependenciesByKey:()=>({globalDependencies:{operatorBasedOnFormula:{dependencyType:"stateVariable",variableName:"operatorBasedOnFormula"},formula:{dependencyType:"stateVariable",variableName:"formula"},variables:{dependencyType:"stateVariable",variableName:"variables"},nInputs:{dependencyType:"stateVariable",variableName:"nInputs"},simplify:{dependencyType:"stateVariable",variableName:"simplify"},expand:{dependencyType:"stateVariable",variableName:"expand"},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["symbolicfs"]},mathChild:{dependencyType:"child",childGroups:["maths"],variableNames:["value"]},symbolicFunctionOperator:{dependencyType:"stateVariable",variableName:"symbolicFunctionOperator"},operatorComposesWithOriginal:{dependencyType:"stateVariable",variableName:"operatorComposesWithOriginal"},domain:{dependencyType:"stateVariable",variableName:"domain"}}}),arrayDefinitionByKey:function({globalDependencyValues:us,usedDefault:cs,arrayKeys:ds,arraySize:ps}){if(us.operatorBasedOnFormula){let fs={};for(let hs of ds)return fs[hs]=returnSymbolicFunctionFromFormula({formula:us.formula,simplify:us.simplify,expand:us.expand,nInputs:us.nInputs,variables:us.variables,domain:us.domain,component:hs}),{setValue:{symbolicfs:fs}}}else if(us.operatorComposesWithOriginal)if(us.functionChild.length===0)if(us.mathChild.length===0){let fs={};for(let hs of ds)fs[hs]=gs=>Context.fromAst("_");return{setValue:{symbolicfs:fs}}}else{let fs=Object.assign({},us);fs.formula=us.mathChild[0].stateValues.value;let hs=[];for(let ys=0;ysus.symbolicFunctionOperator(...hs.map(vs=>vs(...bs)));return{setValue:{symbolicfs:gs}}}else{let fs=[];for(let gs=0;gsus.symbolicFunctionOperator(...fs.map(bs=>bs(...ys)));return{setValue:{symbolicfs:hs}}}else{let fs={};for(let hs of ds)fs[hs]=(...gs)=>us.symbolicFunctionOperator(...gs);return{setValue:{symbolicfs:fs}}}}},ns.numericalfs={isArray:!0,entryPrefixes:["numericalf"],returnArraySizeDependencies:()=>({nOutputs:{dependencyType:"stateVariable",variableName:"nOutputs"}}),returnArraySize({dependencyValues:us}){return[us.nOutputs]},returnArrayDependenciesByKey:()=>({globalDependencies:{operatorBasedOnFormula:{dependencyType:"stateVariable",variableName:"operatorBasedOnFormula"},formula:{dependencyType:"stateVariable",variableName:"formula"},variables:{dependencyType:"stateVariable",variableName:"variables"},nInputs:{dependencyType:"stateVariable",variableName:"nInputs"},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["numericalfs"]},mathChild:{dependencyType:"child",childGroups:["maths"],variableNames:["value"]},numericalFunctionOperator:{dependencyType:"stateVariable",variableName:"numericalFunctionOperator"},operatorComposesWithOriginal:{dependencyType:"stateVariable",variableName:"operatorComposesWithOriginal"},domain:{dependencyType:"stateVariable",variableName:"domain"}}}),arrayDefinitionByKey:function({globalDependencyValues:us,usedDefault:cs,arrayKeys:ds,arraySize:ps}){if(us.operatorBasedOnFormula){let fs={};for(let hs of ds)return fs[hs]=returnNumericalFunctionFromFormula({formula:us.formula,nInputs:us.nInputs,variables:us.variables,domain:us.domain,component:hs}),{setValue:{numericalfs:fs}}}else if(us.operatorComposesWithOriginal)if(us.functionChild.length===0)if(us.mathChild.length===0){let fs={};for(let hs of ds)fs[hs]=gs=>NaN;return{setValue:{numericalfs:fs}}}else{let fs=Object.assign({},us);fs.formula=us.mathChild[0].stateValues.value;let hs=[];for(let ys=0;ysus.numericalFunctionOperator(...hs.map(vs=>vs(...bs)));return{setValue:{numericalfs:gs}}}else{let fs=[];for(let gs=0;gsus.numericalFunctionOperator(...fs.map(bs=>bs(...ys)));return{setValue:{numericalfs:hs}}}else{let fs={};for(let hs of ds)fs[hs]=(...gs)=>us.numericalFunctionOperator(...gs);return{setValue:{numericalfs:fs}}}}},ns.fDefinitions={isArray:!0,entryPrefixes:["fDefinition"],returnArraySizeDependencies:()=>({nOutputs:{dependencyType:"stateVariable",variableName:"nOutputs"}}),returnArraySize({dependencyValues:us}){return[us.nOutputs]},returnArrayDependenciesByKey:()=>({globalDependencies:{operatorBasedOnFormula:{dependencyType:"stateVariable",variableName:"operatorBasedOnFormula"},formula:{dependencyType:"stateVariable",variableName:"formula"},variables:{dependencyType:"stateVariable",variableName:"variables"},nInputs:{dependencyType:"stateVariable",variableName:"nInputs"},nOutputs:{dependencyType:"stateVariable",variableName:"nOutputs"},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["fDefinitions"]},mathChild:{dependencyType:"child",childGroups:["maths"],variableNames:["value"]},numericalFunctionOperator:{dependencyType:"stateVariable",variableName:"numericalFunctionOperator"},numericalFunctionOperatorArguments:{dependencyType:"stateVariable",variableName:"numericalFunctionOperatorArguments"},operatorComposesWithOriginal:{dependencyType:"stateVariable",variableName:"operatorComposesWithOriginal"},domain:{dependencyType:"stateVariable",variableName:"domain"}}}),arrayDefinitionByKey:function({globalDependencyValues:us,usedDefault:cs,arrayKeys:ds,arraySize:ps}){if(us.operatorBasedOnFormula){let fs={};for(let hs of ds)fs[hs]={functionType:"formula",formula:us.formula.tree,variables:us.variables.map(gs=>gs.tree),nInputs:us.nInputs,nOutputs:us.nOutputs,domain:us.domain,component:hs};return{setValue:{fDefinitions:fs}}}else if(us.operatorComposesWithOriginal)if(us.functionChild.length===0)if(us.mathChild.length===0){let fs={};for(let hs of ds)fs[hs]={functionType:"formula",formula:"_",variables:us.variables.map(gs=>gs.tree),nInputs:us.nInputs,nOutputs:us.nOutputs,domain:us.domain};return{setValue:{fDefinitions:fs}}}else throw Error("function operator with math child not implemented yet");else{let fs={};for(let hs of ds)fs[hs]={functionType:"functionOperator",componentType:ss,nOutputs:us.nOutputs,functionOperatorArguments:us.numericalFunctionOperatorArguments,operatorComposesWithOriginal:!0,originalFDefinition:us.functionChild[0].stateValues.fDefinitions[hs]};return{setValue:{fDefinitions:fs}}}else if(us.functionChild.length===0)if(us.mathChild.length===0){let fs={};for(let hs of ds)fs[hs]={functionType:"formula",formula:"_",variables:us.variables.map(gs=>gs.tree),nInputs:us.nInputs,nOutputs:us.nOutputs,domain:us.domain};return{setValue:{fDefinitions:fs}}}else throw Error("function operator with math child not implemented yet");else{let fs={};for(let hs of ds)fs[hs]={functionType:"functionOperator",componentType:ss,nOutputs:us.nOutputs,functionOperatorArguments:us.numericalFunctionOperatorArguments,operatorComposesWithOriginal:!1,originalFDefinition:us.functionChild[0].stateValues.fDefinitions[hs]};return{setValue:{fDefinitions:fs}}}}};let os=ns.allMinima.returnDependencies;ns.allMinima.returnDependencies=function(us){let cs=os(us);return delete cs.functionChild,cs};let ls=ns.allMaxima.returnDependencies;return ns.allMaxima.returnDependencies=function(us){let cs=ls(us);return delete cs.functionChild,cs},ns}}zs(FunctionOperator,"componentType","_functionOperator");class ClampFunction extends FunctionOperator{static createAttributesObject(){let rs=super.createAttributesObject();return rs.lowerValue={createComponentOfType:"number",createStateVariable:"lowerValue",defaultValue:0,public:!0},rs.upperValue={createComponentOfType:"number",createStateVariable:"upperValue",defaultValue:1,public:!0},rs}static returnStateVariableDefinitions({numerics:rs}){let ns=super.returnStateVariableDefinitions({numerics:rs});return ns.numericalFunctionOperator={additionalStateVariablesDefined:["numericalFunctionOperatorArguments"],returnDependencies:()=>({lowerValue:{dependencyType:"stateVariable",variableName:"lowerValue"},upperValue:{dependencyType:"stateVariable",variableName:"upperValue"}}),definition:function({dependencyValues:ss}){return{setValue:{numericalFunctionOperator:functionOperatorDefinitions.clampFunction(ss.lowerValue,ss.upperValue),numericalFunctionOperatorArguments:[ss.lowerValue,ss.upperValue]}}}},ns.symbolicFunctionOperator={returnDependencies:()=>({numericalFunctionOperator:{dependencyType:"stateVariable",variableName:"numericalFunctionOperator"}}),definition({dependencyValues:ss}){return{setValue:{symbolicFunctionOperator:os=>Context.fromAst(ss.numericalFunctionOperator(os.evaluate_to_constant()))}}}},ns}}zs(ClampFunction,"componentType","clampFunction");class WrapFunctionPeriodic extends FunctionOperator{static createAttributesObject(){let rs=super.createAttributesObject();return rs.lowerValue={createComponentOfType:"number",createStateVariable:"lowerValue",defaultValue:0,public:!0},rs.upperValue={createComponentOfType:"number",createStateVariable:"upperValue",defaultValue:1,public:!0},rs}static returnStateVariableDefinitions({numerics:rs}){let ns=super.returnStateVariableDefinitions({numerics:rs});return ns.numericalFunctionOperator={additionalStateVariablesDefined:["numericalFunctionOperatorArguments"],returnDependencies:()=>({lowerValue:{dependencyType:"stateVariable",variableName:"lowerValue"},upperValue:{dependencyType:"stateVariable",variableName:"upperValue"}}),definition:function({dependencyValues:ss}){return{setValue:{numericalFunctionOperator:functionOperatorDefinitions.wrapFunctionPeriodic(ss.lowerValue,ss.upperValue),numericalFunctionOperatorArguments:[ss.lowerValue,ss.upperValue]}}}},ns.symbolicFunctionOperator={returnDependencies:()=>({numericalFunctionOperator:{dependencyType:"stateVariable",variableName:"numericalFunctionOperator"}}),definition({dependencyValues:ss}){return{setValue:{symbolicFunctionOperator:os=>Context.fromAst(ss.numericalFunctionOperator(os.evaluate_to_constant()))}}}},ns}}zs(WrapFunctionPeriodic,"componentType","wrapFunctionPeriodic");class Derivative extends FunctionOperator{static createAttributesObject(){let rs=super.createAttributesObject();return rs.derivVariables={createComponentOfType:"variables"},rs}static returnStateVariableDefinitions({numerics:rs}){let ns=super.returnStateVariableDefinitions({numerics:rs});return ns.operatorBasedOnFormulaIfAvailable={returnDependencies:()=>({}),definition:()=>({setValue:{operatorBasedOnFormulaIfAvailable:!0}})},ns.operatorComposesWithOriginal={returnDependencies:()=>({}),definition:()=>({setValue:{operatorComposesWithOriginal:!1}})},ns.haveFunctionChild={returnDependencies:()=>({functionChild:{dependencyType:"child",childGroups:["functions"]}}),definition({dependencyValues:ss}){return{setValue:{haveFunctionChild:ss.functionChild.length>0}}}},ns.nInputs={defaultValue:1,hasEssential:!0,public:!0,shadowingInstructions:{createComponentOfType:"integer"},stateVariablesDeterminingDependencies:["haveFunctionChild"],returnDependencies({stateValues:ss}){let os={nInputsAttr:{dependencyType:"attributeComponent",attributeName:"nInputs",variableNames:["value"]},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["nInputs"]},variablesAttr:{dependencyType:"attributeComponent",attributeName:"variables",variableNames:["nComponents"]}};return ss.haveFunctionChild||(os.derivVariablesAttr={dependencyType:"attributeComponent",attributeName:"derivVariables",variableNames:["variables"]}),os},definition({dependencyValues:ss}){if(ss.nInputsAttr!==null){let os=ss.nInputsAttr.stateValues.value;return os>=0||(os=1),{setValue:{nInputs:os}}}else return ss.variablesAttr!==null?{setValue:{nInputs:Math.max(1,ss.variablesAttr.stateValues.nComponents)}}:ss.functionChild.length>0?{setValue:{nInputs:ss.functionChild[0].stateValues.nInputs}}:ss.derivVariablesAttr!==null?{setValue:{nInputs:[...new Set(ss.derivVariablesAttr.stateValues.variables.map(ls=>ls.subscripts_to_strings().tree))].length}}:{useEssentialOrDefaultValue:{nInputs:!0}}}},ns.variables={isArray:!0,public:!0,shadowingInstructions:{createComponentOfType:"variable"},entryPrefixes:["variable"],returnArraySizeDependencies:()=>({nInputs:{dependencyType:"stateVariable",variableName:"nInputs"}}),returnArraySize({dependencyValues:ss}){return[ss.nInputs]},stateVariablesDeterminingDependencies:["haveFunctionChild"],returnArrayDependenciesByKey({arrayKeys:ss,stateValues:os}){let ls={variablesAttr:{dependencyType:"attributeComponent",attributeName:"variables",variableNames:["variables"]},parentVariableForChild:{dependencyType:"parentStateVariable",variableName:"variableForChild"},isInterpolatedFunction:{dependencyType:"stateVariable",variableName:"isInterpolatedFunction"},haveFunctionChild:{dependencyType:"stateVariable",variableName:"haveFunctionChild"}},us={};if(os.haveFunctionChild)for(let cs of ss)us[cs]={functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["variable"+(Number(cs)+1)]}};else ls.derivVariablesAttr={dependencyType:"attributeComponent",attributeName:"derivVariables",variableNames:["variables"]};return{globalDependencies:ls,dependenciesByKey:us}},arrayDefinitionByKey({globalDependencyValues:ss,dependencyValuesByKey:os,arraySize:ls,arrayKeys:us,usedDefault:cs}){if(ss.variablesAttr!==null){let ds=ss.variablesAttr.stateValues.variables;return{setValue:{variables:returnNVariables(ls[0],ds)}}}else if(ss.haveFunctionChild){let ds={};for(let ps of us)ds[ps]=os[ps].functionChild[0].stateValues["variable"+(Number(ps)+1)];return{setValue:{variables:ds}}}else if(ss.derivVariablesAttr!==null){let ds=[],ps=[];for(let fs of ss.derivVariablesAttr.stateValues.variables){let hs=fs.subscripts_to_strings().tree;ps.includes(hs)||(ds.push(fs),ps.push(hs))}return{setValue:{variables:returnNVariables(ls[0],ds)}}}else return ss.parentVariableForChild&&!cs.parentVariableForChild?{setValue:{variables:Array(ls[0]).fill(ss.parentVariableForChild)}}:{setValue:{variables:returnNVariables(ls[0],[])}}}},ns.nDerivatives={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies(){return{derivVariablesAttr:{dependencyType:"attributeComponent",attributeName:"derivVariables",variableNames:["nComponents"]}}},definition({dependencyValues:ss}){return ss.derivVariablesAttr!==null?{setValue:{nDerivatives:ss.derivVariablesAttr.stateValues.nComponents}}:{setValue:{nDerivatives:1}}}},ns.derivVariables={isArray:!0,public:!0,shadowingInstructions:{createComponentOfType:"variable"},entryPrefixes:["derivVariable"],returnArraySizeDependencies:()=>({nDerivatives:{dependencyType:"stateVariable",variableName:"nDerivatives"}}),returnArraySize({dependencyValues:ss}){return[ss.nDerivatives]},returnArrayDependenciesByKey(){return{globalDependencies:{derivVariablesAttr:{dependencyType:"attributeComponent",attributeName:"derivVariables",variableNames:["variables"]},variable1:{dependencyType:"stateVariable",variableName:"variable1"}}}},arrayDefinitionByKey({globalDependencyValues:ss}){return ss.derivVariablesAttr!==null?{setValue:{derivVariables:ss.derivVariablesAttr.stateValues.variables}}:{setValue:{derivVariables:{0:ss.variable1}}}}},ns.formulaOperator={returnDependencies:()=>({derivVariables:{dependencyType:"stateVariable",variableName:"derivVariables"}}),definition({dependencyValues:ss}){return{setValue:{formulaOperator:function(os){let ls=os.subscripts_to_strings();for(let us of ss.derivVariables)ls=ls.derivative(us.subscripts_to_strings().tree);return ls.strings_to_subscripts()}}}}},ns.numericalFunctionOperator={returnDependencies:()=>({functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["returnNumericalDerivatives"],variablesOptional:!0},derivVariables:{dependencyType:"stateVariable",variableName:"derivVariables"}}),additionalStateVariablesDefined:["returnNumericalDerivatives"],definition:function({dependencyValues:ss}){return ss.functionChild.length===0||!ss.functionChild[0].stateValues.returnNumericalDerivatives?{setValue:{numericalFunctionOperator:us=>NaN,returnNumericalDerivatives:null}}:{setValue:{numericalFunctionOperator:ss.functionChild[0].stateValues.returnNumericalDerivatives(ss.derivVariables),returnNumericalDerivatives:function(us){let cs=[...ss.derivVariables,...us];return ss.functionChild[0].stateValues.returnNumericalDerivatives(cs)}}}}},ns.numericalFunctionOperatorArguments={returnDependencies:()=>({functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["numericalDerivativesDefinition"],variablesOptional:!0},derivVariables:{dependencyType:"stateVariable",variableName:"derivVariables"}}),additionalStateVariablesDefined:["numericalDerivativesDefinition"],definition:function({dependencyValues:ss}){if(ss.functionChild.length===0||!ss.functionChild[0].stateValues.numericalDerivativesDefinition)return{setValue:{numericalFunctionOperatorArguments:[],numericalDerivativesDefinition:{}}};let os=ss.functionChild[0].stateValues.numericalDerivativesDefinition,ls={...os};return ls.additionalDerivVariables?ls.additionalDerivVariables=[...ss.derivVariables,...ls.additionalDerivVariables]:ls.additionalDerivVariables=[...ss.derivVariables],{setValue:{numericalFunctionOperatorArguments:[os,ss.derivVariables],numericalDerivativesDefinition:ls}}}},ns.symbolicFunctionOperator={returnDependencies:()=>({numericalFunctionOperator:{dependencyType:"stateVariable",variableName:"numericalFunctionOperator"}}),definition({dependencyValues:ss}){return{setValue:{symbolicFunctionOperator:os=>Context.fromAst(ss.numericalFunctionOperator(os.evaluate_to_constant()))}}}},ns}}zs(Derivative,"componentType","derivative");const FunctionOperators=Object.freeze(Object.defineProperty({__proto__:null,ClampFunction,Derivative,WrapFunctionPeriodic},Symbol.toStringTag,{value:"Module"}));class TextBaseOperatorOfMath extends Text{static returnChildGroups(){return[{group:"maths",componentTypes:["math"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=this;return rs.value={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies:()=>({mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["value"]}}),definition:function({dependencyValues:ss}){return{setValue:{value:ns.applyTextOperator(ss.mathChildren.map(os=>os.stateValues.value))}}}},rs}}zs(TextBaseOperatorOfMath,"componentType","_textOperatorOfMath"),zs(TextBaseOperatorOfMath,"rendererType","text");class ExtractMathOperator extends TextBaseOperatorOfMath{static applyTextOperator(rs){return rs.length===0?"":rs.length!==1?(console.warn("MathOperator requires exactly one math child"),""):Array.isArray(rs[0].tree)?rs[0].tree[0]:""}}zs(ExtractMathOperator,"componentType","extractMathOperator");const TextOperatorsOfMath=Object.freeze(Object.defineProperty({__proto__:null,ExtractMathOperator},Symbol.toStringTag,{value:"Module"}));class Extremum extends BaseComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.location={createComponentOfType:"math"},rs.value={createComponentOfType:"math"},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss}){let us=returnBreakStringsSugarFunction({childrenToComponentFunction:cs=>({componentType:"math",children:cs}),mustStripOffOuterParentheses:!0})({matchedChildren:ss});if(!us.success&&ss.length===1)return{success:!0,newAttributes:{value:{component:{componentType:"math",children:ss}}}};if(us.success){if(us.newChildren.length===1)return{success:!0,newAttributes:{value:{component:us.newChildren[0]}}};if(us.newChildren.length===2){let cs=us.newChildren[0],ds=us.newChildren[1],ps={location:{component:cs},value:{component:ds}};return(cs.children.length===0||cs.children.length===1&&typeof cs.children[0]=="string"&&cs.children[0].trim()==="")&&delete ps.location,(ds.children.length===0||ds.children.length===1&&typeof ds.children[0]=="string"&&ds.children[0].trim()==="")&&delete ps.value,{success:!0,newAttributes:ps}}else return{success:!1}}return us};return rs.push({childrenRegex:/s+(.*s)?/,replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"points",componentTypes:["point"]}]}static returnStateVariableDefinitions({numerics:rs}){let ns=super.returnStateVariableDefinitions({numerics:rs}),ss=this;return ns.value={public:!0,shadowingInstructions:{createComponentOfType:"math"},defaultValue:null,hasEssential:!0,additionalStateVariablesDefined:[{variableName:"location",public:!0,shadowingInstructions:{createComponentOfType:"math"},defaultValue:null,hasEssential:!0}],returnDependencies:()=>({extremumChild:{dependencyType:"child",childGroups:["points"],variableNames:["nDimensions","xs"]},location:{dependencyType:"attributeComponent",attributeName:"location",variableNames:["value"]},value:{dependencyType:"attributeComponent",attributeName:"value",variableNames:["value"]}}),definition:function({dependencyValues:os}){let ls,us;if(os.extremumChild.length>0){let gs=os.extremumChild[0];gs.stateValues.nDimensions!==2?(console.log("Cannot determine "+ss.componentType+" from a point that isn't 2D"),ls=null,us=null):(ls=gs.stateValues.xs[0],us=gs.stateValues.xs[1])}else os.location!==null&&(ls=os.location.stateValues.value),os.value!==null&&(us=os.value.stateValues.value);let cs={},ds={},ps=!1,fs=!1;ls===void 0?(ds.location=!0,fs=!0):(cs.location=ls,ps=!0),us===void 0?(ds.value=!0,fs=!0):(cs.value=us,ps=!0);let hs={};return ps&&(hs.setValue=cs),fs&&(hs.useEssentialOrDefaultValue=ds),hs}},ns}}zs(Extremum,"componentType","extremum"),zs(Extremum,"rendererType");class Extrema extends BaseComponent{static get componentTypeCapitalized(){return this.componentType.charAt(0).toUpperCase()+this.componentType.slice(1)}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=this,ss=function({matchedChildren:os}){let ls=breakEmbeddedStringsIntoParensPieces({componentList:os});return ls.success!==!0?{success:!1}:{success:!0,newChildren:ls.pieces.map(function(us){return us.length>1||typeof us[0]=="string"?{componentType:ns.componentTypeSingular,children:us}:us[0]})}};return rs.push({replacementFunction:ss}),rs}static returnChildGroups(){return[{group:"extrema",componentTypes:[this.componentTypeSingular]},{group:"points",componentTypes:["point"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=this;return rs["n"+ns.componentTypeCapitalized]={additionalStateVariablesDefined:["childIdentities"],returnDependencies:()=>({children:{dependencyType:"child",childGroups:["extrema","points"]}}),definition:function({dependencyValues:ss}){return{setValue:{["n"+ns.componentTypeCapitalized]:ss.children.length,childIdentities:ss.children}}}},rs[ns.componentType]={isArray:!0,nDimensions:2,entryPrefixes:[ns.componentTypeSingular,ns.componentTypeSingular+"Locations",ns.componentTypeSingular+"Location",ns.componentTypeSingular+"Values",ns.componentTypeSingular+"Value"],stateVariablesDeterminingDependencies:["childIdentities"],getArrayKeysFromVarName({arrayEntryPrefix:ss,varEnding:os,arraySize:ls}){if([ns.componentTypeSingular,ns.componentTypeSingular+"Location",ns.componentTypeSingular+"Value"].includes(ss)){let us=Number(os)-1;return Number.isInteger(us)&&us>=0?!ls||uscs+",0"):["0,0"]:ss===ns.componentTypeSingular+"Values"?os!==""?[]:ls?Array.from(Array(ls[0]),(us,cs)=>cs+",1"):["0,1"]:[]},arrayVarNameFromArrayKey(ss){let[os,ls]=ss.split(",");return ls==="0"?ns.componentTypeSingular+"Location"+(Number(os)+1):ns.componentTypeSingular+"Value"+(Number(os)+1)},arrayVarNameFromPropIndex(ss,os){if(os===ns.componentType){if(ss.length===1)return ns.componentTypeSingular+ss[0];{let us=Number(ss[0]);if(Number.isInteger(us)&&us>0){if(ss[1]===1)return ns.componentTypeSingular+"Location"+us;if(ss[1]===2)return ns.componentTypeSingular+"Value"+us}return null}}if(os===ns.componentTypeSingular+"Locations")return ns.componentTypeSingular+"Location"+ss[0];if(os===ns.componentTypeSingular+"Values")return ns.componentTypeSingular+"Value"+ss[0];let ls=ns.componentTypeSingular.length;if(os.slice(0,ls)===ns.componentTypeSingular){let us=Number(os.slice(ls));if(Number.isInteger(us)&&us>0){if(ss[0]===1)return ns.componentTypeSingular+"Location"+us;if(ss[0]===2)return ns.componentTypeSingular+"Value"+us}}return null},returnArraySizeDependencies:()=>({nChildren:{dependencyType:"stateVariable",variableName:"n"+ns.componentTypeCapitalized}}),returnArraySize({dependencyValues:ss}){return[ss.nChildren,2]},returnArrayDependenciesByKey({arrayKeys:ss,stateValues:os}){let ls={};for(let us of ss){let[cs,ds]=us.split(","),ps;os.childIdentities[cs].componentType===ns.componentTypeSingular?ps=Number(ds)===0?"location":"value":ps="x"+(Number(ds)+1),ls[us]={child:{dependencyType:"child",childGroups:["extrema","points"],variableNames:[ps],childIndices:[cs]}}}return{dependenciesByKey:ls}},arrayDefinitionByKey({dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=ss[us].child[0];if(cs){let ds=us.split(",")[1],ps=Number(ds)===0?"location":"value";ps in cs.stateValues?ls[us]=cs.stateValues[ps]:ls[us]=cs.stateValues["x"+(Number(ds)+1)]}}return{setValue:{[ns.componentType]:ls}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ss,dependencyNamesByKey:os}){let ls=[];for(let us in ss[ns.componentType])ls.push({setDependency:os[us].extremumChild,desiredValue:ss[ns.componentType][us],childIndex:0,variableIndex:0});return{success:!0,instructions:ls}}},rs}}zs(Extrema,"componentType","extrema"),zs(Extrema,"rendererType"),zs(Extrema,"componentTypeSingular","extremum");const Extrema$1=Object.freeze(Object.defineProperty({__proto__:null,Extrema,Extremum},Symbol.toStringTag,{value:"Module"}));class InlineRenderInlineChildren extends InlineComponent{static returnChildGroups(){return[{group:"inlines",componentTypes:["_inline"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=this;return rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({inlineChildren:{dependencyType:"child",childGroups:["inlines"],variableNames:["text"],variablesOptional:!0}}),definition:function({dependencyValues:ss}){let os="";for(let ls of ss.inlineChildren)typeof ls!="object"?os+=ls.toString():typeof ls.stateValues.text=="string"?os+=ls.stateValues.text:os+=" ";return os=ns.beginTextDelimiter+os+ns.endTextDelimiter,{setValue:{text:os}}}},rs}}zs(InlineRenderInlineChildren,"componentType","_inlineRenderInlineChildren"),zs(InlineRenderInlineChildren,"renderChildren",!0),zs(InlineRenderInlineChildren,"includeBlankStringChildren",!0),zs(InlineRenderInlineChildren,"beginTextDelimiter",""),zs(InlineRenderInlineChildren,"endTextDelimiter","");class Em extends InlineRenderInlineChildren{}zs(Em,"componentType","em");class Alert extends InlineRenderInlineChildren{}zs(Alert,"componentType","alert");var Uu;let Q$2=(Uu=class extends InlineRenderInlineChildren{},zs(Uu,"componentType","q"),zs(Uu,"beginTextDelimiter",'"'),zs(Uu,"endTextDelimiter",'"'),Uu);class SQ extends InlineRenderInlineChildren{}zs(SQ,"componentType","sq"),zs(SQ,"beginTextDelimiter","'"),zs(SQ,"endTextDelimiter","'");class Term extends InlineRenderInlineChildren{}zs(Term,"componentType","term"),zs(Term,"rendererType","alert");var pp;let C$2=(pp=class extends InlineRenderInlineChildren{},zs(pp,"componentType","c"),pp);class Tag extends InlineRenderInlineChildren{}zs(Tag,"componentType","tag"),zs(Tag,"rendererType","tag"),zs(Tag,"beginTextDelimiter","<"),zs(Tag,"endTextDelimiter",">");class Tage extends InlineRenderInlineChildren{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.selfClosed={forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{selfClosed:!0}})},rs}}zs(Tage,"componentType","tage"),zs(Tage,"rendererType","tag"),zs(Tage,"beginTextDelimiter","<"),zs(Tage,"endTextDelimiter","/>");class Attr extends InlineRenderInlineChildren{}zs(Attr,"componentType","attr"),zs(Attr,"rendererType","c");const ParagraphMarkup=Object.freeze(Object.defineProperty({__proto__:null,Alert,Attr,C:C$2,Em,Q:Q$2,SQ,Tag,Tage,Term},Symbol.toStringTag,{value:"Module"}));class SingleCharacter extends InlineComponent{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({}),definition:()=>({setValue:{text:this.unicodeCharacter}})},rs}}zs(SingleCharacter,"componentType","_singleCharacterInline"),zs(SingleCharacter,"unicodeCharacter","");class Ndash extends SingleCharacter{}zs(Ndash,"componentType","ndash"),zs(Ndash,"unicodeCharacter","–");class Mdash extends SingleCharacter{}zs(Mdash,"componentType","mdash"),zs(Mdash,"unicodeCharacter","—");class NBSP extends SingleCharacter{}zs(NBSP,"componentType","nbsp"),zs(NBSP,"unicodeCharacter"," ");class Ellipsis extends SingleCharacter{}zs(Ellipsis,"componentType","ellipsis"),zs(Ellipsis,"unicodeCharacter","…");const SingleCharacterComponents=Object.freeze(Object.defineProperty({__proto__:null,Ellipsis,Mdash,NBSP,Ndash},Symbol.toStringTag,{value:"Module"}));class BlockComponent extends BaseComponent{}zs(BlockComponent,"componentType","_block");function returnDefaultFeedbackDefinitions(){return{numericalerror:"Credit reduced because numbers in your answer weren't quite right. Did you round too much?",goodjob:"Good job!",onesignerror:"Credit reduced because it appears that you made a sign error.",twosignerrors:"Credit reduced because it appears that you made two sign errors."}}function returnFeedbackDefinitionStateVariables(){let as={};return as.setupChildren={returnDependencies:()=>({setupChildren:{dependencyType:"child",childGroups:["setups"],proceedIfAllChildrenNotMatched:!0}}),definition({dependencyValues:rs}){return{setValue:{setupChildren:rs.setupChildren}}}},as.feedbackDefinitions={stateVariablesDeterminingDependencies:["setupChildren"],returnDependencies({stateValues:rs}){let ns={ancestorWithFeedback:{dependencyType:"ancestor",variableNames:["feedbackDefinitions"]},setupChildren:{dependencyType:"child",childGroups:["setups"],proceedIfAllChildrenNotMatched:!0}};for(let ss of rs.setupChildren)ns[`feedbackDefinitionsOf${ss.componentName}`]={dependencyType:"child",parentName:ss.componentName,childGroups:["feedbackDefinitions"],variableNames:["value"]};return ns},definition({dependencyValues:rs}){let ns={},ss;rs.ancestorWithFeedback&&(ss=rs.ancestorWithFeedback.stateValues.feedbackDefinitions),ss||(ss=returnDefaultFeedbackDefinitions()),Object.assign(ns,ss);let os=[];for(let ls of rs.setupChildren)os.push(...rs[`feedbackDefinitionsOf${ls.componentName}`]);for(let ls of os)Object.assign(ns,ls.stateValues.value);return{setValue:{feedbackDefinitions:ns}}}},as}class SectioningComponent extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{submitAllAnswers:this.submitAllAnswers.bind(this),revealSection:this.revealSection.bind(this),closeSection:this.closeSection.bind(this),recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.aggregateScores={createComponentOfType:"boolean",createStateVariable:"aggregateScores",defaultValue:!1,public:!0},rs.weight={createComponentOfType:"number",createStateVariable:"weight",defaultValue:1,public:!0},rs.sectionWideCheckWork={createComponentOfType:"boolean",createStateVariable:"sectionWideCheckWork",defaultValue:!1,public:!0},rs.submitLabel={createComponentOfType:"text",createStateVariable:"submitLabel",defaultValue:"Check Work",public:!0,forRenderer:!0},rs.submitLabelNoCorrectness={createComponentOfType:"text",createStateVariable:"submitLabelNoCorrectness",defaultValue:"Submit Response",public:!0,forRenderer:!0},rs.boxed={createComponentOfType:"boolean",createStateVariable:"boxed",defaultValue:!1,public:!0,forRenderer:!0},rs.suppressAutoName={createComponentOfType:"boolean",createStateVariable:"suppressAutoName",defaultValue:!1,public:!0},rs.suppressAutoNumber={createComponentOfType:"boolean",createStateVariable:"suppressAutoNumber",defaultValue:!1,public:!0},rs.includeAutoName={createComponentOfType:"boolean",createStateVariable:"includeAutoName",defaultValue:!1,public:!0},rs.includeAutoNumber={createComponentOfType:"boolean",createStateVariable:"includeAutoNumber",defaultValue:!1,public:!0},rs.includeAutoNameNumberIfNoTitle={createComponentOfType:"boolean",createStateVariable:"includeAutoNameNumberIfNoTitle",defaultValue:!0,public:!0},rs.includeParentNumber={createComponentOfType:"boolean",createStateVariable:"includeParentNumber",defaultValue:!1,public:!0},rs.level={createComponentOfType:"integer"},rs}static returnChildGroups(){return[{group:"variantControls",componentTypes:["variantControl"]},{group:"titles",componentTypes:["title"]},{group:"setups",componentTypes:["setup"]},{group:"anything",componentTypes:["_base"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=returnStyleDefinitionStateVariables();Object.assign(rs,ns);let ss=returnFeedbackDefinitionStateVariables();return Object.assign(rs,ss),rs.enumeration={additionalStateVariablesDefined:[{variableName:"sectionNumber",public:!0,shadowingInstructions:{createComponentOfType:"text"}}],returnDependencies:()=>({countAmongSiblings:{dependencyType:"countAmongSiblingsOfSameType"},sectionAncestor:{dependencyType:"ancestor",componentType:"_sectioningComponent",variableNames:["enumeration"]},includeParentNumber:{dependencyType:"stateVariable",variableName:"includeParentNumber"}}),definition({dependencyValues:os}){let ls=[];return os.includeParentNumber&&os.sectionAncestor&&ls.push(...os.sectionAncestor.stateValues.enumeration),ls.push(os.countAmongSiblings),{setValue:{enumeration:ls,sectionNumber:ls.join(".")}}}},rs.sectionName={returnDependencies:()=>({}),definition:()=>({setValue:{sectionName:"Section"}})},rs.titleChildName={forRenderer:!0,returnDependencies:()=>({titleChild:{dependencyType:"child",childGroups:["titles"]}}),definition({dependencyValues:os}){let ls=null;return os.titleChild.length>0&&(ls=os.titleChild[os.titleChild.length-1].componentName),{setValue:{titleChildName:ls}}}},rs.childIndicesToRender={returnDependencies:()=>({titleChildren:{dependencyType:"child",childGroups:["titles"]},allChildren:{dependencyType:"child",childGroups:["anything","variantControls","titles","setups"]},titleChildName:{dependencyType:"stateVariable",variableName:"titleChildName"}}),definition({dependencyValues:os}){let ls=[],us=os.titleChildren.map(cs=>cs.componentName);for(let[cs,ds]of os.allChildren.entries())(typeof ds!="object"||!us.includes(ds.componentName)||ds.componentName===os.titleChildName)&&ls.push(cs);return{setValue:{childIndicesToRender:ls}}}},rs.title={additionalStateVariablesDefined:[{variableName:"titlePrefix",forRenderer:!0,alwaysUpdateRenderer:!0}],public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,alwaysUpdateRenderer:!0,returnDependencies:({sharedParameters:os})=>({titleChild:{dependencyType:"child",childGroups:["titles"],variableNames:["text"]},sectionName:{dependencyType:"stateVariable",variableName:"sectionName"},sectionNumber:{dependencyType:"stateVariable",variableName:"sectionNumber"},includeAutoName:{dependencyType:"stateVariable",variableName:"includeAutoName"},includeAutoNumber:{dependencyType:"stateVariable",variableName:"includeAutoNumber"},prerender:{dependencyType:"value",value:os.prerender},includeAutoNameNumberIfNoTitle:{dependencyType:"stateVariable",variableName:"includeAutoNameNumberIfNoTitle"}}),definition({dependencyValues:os}){let ls="",us="";const cs=os.titleChild.length>0;let ds=(os.includeAutoNumber||!cs&&os.includeAutoNameNumberIfNoTitle)&&!os.prerender,ps=os.includeAutoName||!cs&&os.includeAutoNameNumberIfNoTitle;return ds?(ps&&(ls=os.sectionName+" "),ls+=os.sectionNumber):ps&&(ls=os.sectionName),cs?(ls&&(os.includeAutoName?ls+=": ":ls+=". "),us=os.titleChild[os.titleChild.length-1].stateValues.text):us=ls,{setValue:{title:us,titlePrefix:ls}}}},rs.containerTag={forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{containerTag:"section"}})},rs.level={forRenderer:!0,returnDependencies:()=>({ancestorLevel:{dependencyType:"ancestor",componentType:"_sectioningComponent",variableNames:["level"]},levelAttr:{dependencyType:"attributeComponent",attributeName:"level",variableNames:["value"]}}),definition({dependencyValues:os}){var us,cs;let ls=(us=os.levelAttr)==null?void 0:us.stateValues.value;return ls>0||(ls=(((cs=os.ancestorLevel)==null?void 0:cs.stateValues.level)||0)+1),{setValue:{level:ls}}}},rs.viewedSolution={defaultValue:!1,hasEssential:!0,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{viewedSolution:!0}}),inverseDefinition({desiredStateVariableValues:os}){return{success:!0,instructions:[{setEssentialValue:"viewedSolution",value:os.viewedSolution}]}}},rs.scoredDescendants={returnDependencies:()=>({scoredDescendants:{dependencyType:"descendant",componentTypes:["_sectioningComponent","answer","setup"],variableNames:["scoredDescendants","aggregateScores","weight"],recurseToMatchedChildren:!1,variablesOptional:!0}}),definition({dependencyValues:os}){let ls=[];for(let us of os.scoredDescendants)us.componentType!=="setup"&&(us.stateValues.aggregateScores||us.stateValues.scoredDescendants===void 0?ls.push(us):ls.push(...us.stateValues.scoredDescendants));return{setValue:{scoredDescendants:ls}}}},rs.answerDescendants={returnDependencies:()=>({answerDescendants:{dependencyType:"descendant",componentTypes:["answer"],variableNames:["justSubmitted"],recurseToMatchedChildren:!1}}),definition({dependencyValues:os}){return{setValue:{answerDescendants:os.answerDescendants}}}},rs.justSubmitted={forRenderer:!0,returnDependencies:()=>({answerDescendants:{dependencyType:"stateVariable",variableName:"answerDescendants"}}),definition({dependencyValues:os}){return{setValue:{justSubmitted:os.answerDescendants.every(ls=>ls.stateValues.justSubmitted)}}}},rs.showCorrectness={forRenderer:!0,returnDependencies:()=>({showCorrectnessFlag:{dependencyType:"flag",flagName:"showCorrectness"}}),definition({dependencyValues:os}){return{setValue:{showCorrectness:os.showCorrectnessFlag!==!1}}}},rs.displayDigitsForCreditAchieved={returnDependencies:()=>({}),definition:()=>({setValue:{displayDigitsForCreditAchieved:3}})},rs.creditAchieved={public:!0,shadowingInstructions:{createComponentOfType:"number",addAttributeComponentsShadowingStateVariables:{displayDigits:{stateVariableToShadow:"displayDigitsForCreditAchieved"}}},forRenderer:!0,defaultValue:0,hasEssential:!0,additionalStateVariablesDefined:[{variableName:"percentCreditAchieved",public:!0,shadowingInstructions:{createComponentOfType:"number",addAttributeComponentsShadowingStateVariables:{displayDigits:{stateVariableToShadow:"displayDigitsForCreditAchieved"}}},defaultValue:0,hasEssential:!0}],stateVariablesDeterminingDependencies:["aggregateScores","scoredDescendants"],returnDependencies({stateValues:os}){let ls={aggregateScores:{dependencyType:"stateVariable",variableName:"aggregateScores"}};if(os.aggregateScores){ls.scoredDescendants={dependencyType:"stateVariable",variableName:"scoredDescendants"};for(let[us,cs]of os.scoredDescendants.entries())ls["creditAchieved"+us]={dependencyType:"stateVariable",componentName:cs.componentName,variableName:"creditAchieved"}}return ls},definition({dependencyValues:os}){if(!os.aggregateScores)return{setValue:{creditAchieved:0,percentCreditAchieved:0}};let ls=0,us=0;for(let[ps,fs]of os.scoredDescendants.entries()){let hs=fs.stateValues.weight;ls+=os["creditAchieved"+ps]*hs,us+=hs}let cs;us>0?cs=ls/us:cs=1;let ds=cs*100;return{setValue:{creditAchieved:cs,percentCreditAchieved:ds}}}},rs.creditAchievedIfSubmit={defaultValue:0,stateVariablesDeterminingDependencies:["aggregateScores","scoredDescendants"],returnDependencies({stateValues:os}){let ls={aggregateScores:{dependencyType:"stateVariable",variableName:"aggregateScores"}};if(os.aggregateScores){ls.scoredDescendants={dependencyType:"stateVariable",variableName:"scoredDescendants"};for(let[us,cs]of os.scoredDescendants.entries())ls["creditAchievedIfSubmit"+us]={dependencyType:"stateVariable",componentName:cs.componentName,variableName:"creditAchievedIfSubmit"}}return ls},definition({dependencyValues:os}){if(!os.aggregateScores)return{setValue:{creditAchievedIfSubmit:0}};let ls=0,us=0;for(let[ds,ps]of os.scoredDescendants.entries()){let fs=ps.stateValues.weight;ls+=os["creditAchievedIfSubmit"+ds]*fs,us+=fs}return{setValue:{creditAchievedIfSubmit:ls/us}}}},rs.generatedVariantInfo={additionalStateVariablesDefined:["isVariantComponent"],returnDependencies:({sharedParameters:os,componentInfoObjects:ls})=>({variantSeed:{dependencyType:"value",value:os.variantSeed},variantIndex:{dependencyType:"value",value:os.variantIndex},variantName:{dependencyType:"value",value:os.variantName},variantDescendants:{dependencyType:"descendant",componentTypes:Object.keys(ls.componentTypesCreatingVariants),variableNames:["isVariantComponent","generatedVariantInfo"],recurseToMatchedChildren:!1,variablesOptional:!0,includeNonActiveChildren:!0,ignoreReplacementsOfEncounteredComposites:!0}}),definition({dependencyValues:os,componentName:ls}){let us={};os.variantName?(us.index=os.variantIndex,us.name=os.variantName):us.seed=os.variantSeed,us.meta={createdBy:ls};let cs=us.subvariants=[];for(let ds of os.variantDescendants)ds.stateValues.isVariantComponent?cs.push(ds.stateValues.generatedVariantInfo):ds.stateValues.generatedVariantInfo&&cs.push(...ds.stateValues.generatedVariantInfo.subvariants);return{setValue:{generatedVariantInfo:us,isVariantComponent:!0}}}},rs.collapsible={forRenderer:!0,returnDependencies:()=>({}),definition(){return{setValue:{collapsible:!1}}}},rs.open={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},forRenderer:!0,defaultValue:!0,hasEssential:!0,returnDependencies:()=>({}),definition(){return{useEssentialOrDefaultValue:{open:!0}}},inverseDefinition({desiredStateVariableValues:os}){return{success:!0,instructions:[{setEssentialValue:"open",value:os.open}]}}},rs.createSubmitAllButton={forRenderer:!0,additionalStateVariablesDefined:[{variableName:"suppressAnswerSubmitButtons",forRenderer:!0}],returnDependencies:()=>({sectionWideCheckWork:{dependencyType:"stateVariable",variableName:"sectionWideCheckWork"},aggregateScores:{dependencyType:"stateVariable",variableName:"aggregateScores"},sectionAncestor:{dependencyType:"ancestor",componentType:"_sectioningComponent",variableNames:["suppressAnswerSubmitButtons"]},documentAncestor:{dependencyType:"ancestor",componentType:"document",variableNames:["suppressAnswerSubmitButtons"]}}),definition({dependencyValues:os,componentName:ls}){let us=!1,cs=!1;return os.documentAncestor.stateValues.suppressAnswerSubmitButtons||os.sectionAncestor&&os.sectionAncestor.stateValues.suppressAnswerSubmitButtons?cs=!0:os.sectionWideCheckWork&&(os.aggregateScores?(us=!0,cs=!0):console.warn(`Cannot create submit all button for ${ls} because it doesn't aggegrate scores`)),{setValue:{createSubmitAllButton:us,suppressAnswerSubmitButtons:cs}}}},rs.suppressCheckwork={forRenderer:!0,returnDependencies:()=>({autoSubmit:{dependencyType:"flag",flagName:"autoSubmit"}}),definition({dependencyValues:os}){return{setValue:{suppressCheckwork:os.autoSubmit}}}},rs}async submitAllAnswers({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){this.coreFunctions.requestRecordEvent({verb:"submitted",object:{componentName:this.componentName,componentType:this.componentType},result:{creditAchieved:await this.stateValues.creditAchievedIfSubmit}});let os=await this.stateValues.answerDescendants;for(let[ls,us]of await this.stateValues.answerDescendants.entries())await us.stateValues.justSubmitted||await this.coreFunctions.performAction({componentName:us.componentName,actionName:"submitAnswer",args:{actionId:rs,sourceInformation:ns,skipRendererUpdate:ss||ls({setValue:{level:4}}),rs.sectionName.definition=()=>({setValue:{sectionName:"Paragraphs"}}),rs}}zs(Paragraphs,"componentType","paragraphs"),zs(Paragraphs,"rendererType","section");class Aside extends SectioningComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.collapsible={createComponentOfType:"boolean",createStateVariable:"collapsible",defaultValue:!0,public:!0,forRenderer:!0},rs.startOpen={createComponentOfType:"boolean",createStateVariable:"startOpen",defaultValue:!1},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return delete rs.collapsible,rs.open.returnDependencies=()=>({startOpen:{dependencyType:"stateVariable",variableName:"startOpen"}}),rs.open.definition=({dependencyValues:ns})=>({useEssentialOrDefaultValue:{open:{defaultValue:ns.startOpen}}}),rs.level.definition=()=>({setValue:{level:3}}),rs.containerTag.definition=()=>({setValue:{containerTag:"aside"}}),rs.sectionName.definition=()=>({setValue:{sectionName:"Aside"}}),rs}}zs(Aside,"componentType","aside"),zs(Aside,"rendererType","section");class Problem extends SectioningComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.aggregateScores.defaultValue=!0,rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.sectionName.definition=()=>({setValue:{sectionName:"Problem"}}),rs}}zs(Problem,"componentType","problem"),zs(Problem,"rendererType","section");class Exercise extends Problem{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.sectionName.definition=()=>({setValue:{sectionName:"Exercise"}}),rs}}zs(Exercise,"componentType","exercise"),zs(Exercise,"rendererType","section");class Example extends SectioningComponent{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.sectionName.definition=()=>({setValue:{sectionName:"Example"}}),rs}}zs(Example,"componentType","example"),zs(Example,"rendererType","section");class StandinForFutureLayoutTag extends SectioningComponent{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.level.definition=()=>({setValue:{level:3}}),rs.containerTag.definition=()=>({setValue:{containerTag:"aside"}}),rs}}zs(StandinForFutureLayoutTag,"componentType","standinForFutureLayoutTag"),zs(StandinForFutureLayoutTag,"rendererType","section");class externalContent extends SectioningComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.includeAutoNameNumberIfNoTitle.defaultValue=!1,rs}}zs(externalContent,"componentType","externalContent"),zs(externalContent,"rendererType","section");const Sectioning=Object.freeze(Object.defineProperty({__proto__:null,Aside,Example,Exercise,Paragraphs,Problem,Section,StandinForFutureLayoutTag,Subsection,Subsubsection,externalContent},Symbol.toStringTag,{value:"Module"}));class Ol extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.label={createComponentOfType:"text",createStateVariable:"label",defaultValue:null,public:!0,forRenderer:!0},rs.level={createComponentOfType:"integer"},rs}static returnChildGroups(){return[{group:"lis",componentTypes:["li"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.numbered={forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{numbered:!0}})},rs.level={forRenderer:!0,returnDependencies:()=>({ancestorLevel:{dependencyType:"ancestor",componentType:"ol",variableNames:["level"]},levelAttr:{dependencyType:"attributeComponent",attributeName:"level",variableNames:["value"]}}),definition({dependencyValues:ns}){var os,ls;let ss=(os=ns.levelAttr)==null?void 0:os.stateValues.value;return ss>0||(ss=(((ls=ns.ancestorLevel)==null?void 0:ls.stateValues.level)||0)+1),{setValue:{level:ss}}}},rs}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}}zs(Ol,"componentType","ol"),zs(Ol,"rendererType","list"),zs(Ol,"renderChildren",!0);class Ul extends Ol{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.numbered={forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{numbered:!1}})},rs}}zs(Ul,"componentType","ul"),zs(Ul,"rendererType","list");var Fu;let Li$1=(Fu=class extends BaseComponent{constructor(rs){super(rs),Object.assign(this.actions,{recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static returnChildGroups(){return[{group:"anything",componentTypes:["_base"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.item={forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{item:!0}})},rs}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}},zs(Fu,"componentType","li"),zs(Fu,"rendererType","list"),zs(Fu,"renderChildren",!0),zs(Fu,"includeBlankStringChildren",!0),Fu);const Lists=Object.freeze(Object.defineProperty({__proto__:null,Li:Li$1,Ol,Ul},Symbol.toStringTag,{value:"Module"}));class ODESystem extends InlineComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.independentVariable={createComponentOfType:"variable",createStateVariable:"independentVariable",defaultValue:Context.fromAst("t"),public:!0},rs.initialIndependentVariableValue={createComponentOfType:"math",createStateVariable:"initialIndependentVariableValue",defaultValue:Context.fromAst(0),public:!0},rs.displayDigits={createComponentOfType:"integer",createStateVariable:"displayDigits",defaultValue:14,public:!0},rs.displayDecimals={createComponentOfType:"integer",createStateVariable:"displayDecimals",defaultValue:null,public:!0},rs.displaySmallAsZero={createComponentOfType:"number",createStateVariable:"displaySmallAsZero",valueForTrue:1e-14,valueForFalse:0,defaultValue:0,public:!0},rs.padZeros={createComponentOfType:"boolean",createStateVariable:"padZeros",defaultValue:!1,public:!0},rs.renderMode={createComponentOfType:"text",createStateVariable:"renderMode",defaultValue:"align",public:!0,forRenderer:!0},rs.chunkSize={createComponentOfType:"number",createStateVariable:"chunkSize",defaultValue:10,public:!0},rs.tolerance={createComponentOfType:"number",createStateVariable:"tolerance",defaultValue:1e-6,public:!0},rs.maxIterations={createComponentOfType:"number",createStateVariable:"maxIterations",defaultValue:1e3,public:!0},rs.hideInitialCondition={createComponentOfType:"boolean",createStateVariable:"hideInitialCondition",defaultValue:!1,public:!0},rs.initialConditions={createComponentOfType:"mathList"},rs.variables={createComponentOfType:"variables"},rs.number={createComponentOfType:"boolean",createStateVariable:"number",defaultValue:!1,public:!0},rs}static returnChildGroups(){return[{group:"rightHandSides",componentTypes:["rightHandSide"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.validIndependentVariable={returnDependencies:()=>({independentVarAttr:{dependencyType:"attributeComponent",attributeName:"independentVariable",variableNames:["validVariable"]}}),definition({dependencyValues:ns}){let ss=!0;return ns.independentVarAttr&&(ss=ns.independentVarAttr.stateValues.validVariable),{setValue:{validIndependentVariable:ss}}}},rs.nDimensions={returnDependencies:()=>({rhsChildren:{dependencyType:"child",childGroups:["rightHandSides"],skipComponentNames:!0}}),definition:function({dependencyValues:ns}){return{setValue:{nDimensions:ns.rhsChildren.length},checkForActualChange:{nDimensions:!0}}}},rs.variables={additionalStateVariablesDefined:[{variableName:"validVariables",isArray:!0,entryPrefixes:["validVar"]}],isArray:!0,public:!0,shadowingInstructions:{createComponentOfType:"variable"},entryPrefixes:["var"],returnArraySizeDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[ns.nDimensions]},returnArrayDependenciesByKey(){return{globalDependencies:{nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},variables:{dependencyType:"attributeComponent",attributeName:"variables",variableNames:["variables","validVariables"]},independentVariable:{dependencyType:"stateVariable",variableName:"independentVariable"}}}},arrayDefinitionByKey({globalDependencyValues:ns}){let ss=[],os=[],ls=ns.nDimensions;ns.variables!==null&&(ss=ns.variables.stateValues.variables,os=[...ns.variables.stateValues.validVariables].slice(0,ls));let us=returnNVariables(ls,ss);return us.some(cs=>cs.equals(ns.independentVariable))&&console.warn("Variables of odesystem must be different than independent variable."),os.length({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[ns.nDimensions]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={};for(let os of ns)ss[os]={rhsChild:{dependencyType:"child",childGroups:["rightHandSides"],variableNames:["value"],childIndices:[os]}};return{dependenciesByKey:ss}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={};for(let ls of ss)os[ls]=ns[ls].rhsChild[0].stateValues.value;return{setValue:{rhss:os}}}},rs.rhs={isAlias:!0,targetVariableName:"rhs1"},rs.righthandside={isAlias:!0,targetVariableName:"rhs1"},rs.righthandsides={isAlias:!0,targetVariableName:"rhss"},rs.initialConditions={isArray:!0,public:!0,shadowingInstructions:{createComponentOfType:"math"},entryPrefixes:["initialCondition"],defaultValueByArrayKey:()=>Context.fromAst(0),returnArraySizeDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[ns.nDimensions]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={};for(let os of ns)ss[os]={initialConditionAttr:{dependencyType:"attributeComponent",attributeName:"initialConditions",variableNames:[`math${Number(os)+1}`]}};return{dependenciesByKey:ss}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={},ls={};for(let cs of ss){let ds=!1;if(ns[cs].initialConditionAttr){let ps=ns[cs].initialConditionAttr.stateValues[`math${Number(cs)+1}`];ps!==void 0&&(ds=!0,os[cs]=ps)}ds||(ls[cs]=!0)}let us={};return Object.keys(os).length>0&&(us.setValue={initialConditions:os}),Object.keys(ls).length>0&&(us.useEssentialOrDefaultValue={initialConditions:ls}),us}},rs.initialCondition={isAlias:!0,targetVariableName:"initialCondition1"},rs.equationTag={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,stateVariablesDeterminingDependencies:["number"],returnDependencies({stateValues:ns}){return ns.number?{equationCounter:{dependencyType:"counter",counterName:"equation"}}:{}},definition({dependencyValues:ns}){return ns.equationCounter!==void 0?{setValue:{equationTag:String(ns.equationCounter)}}:{setValue:{equationTag:null}}}},rs.latex={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies(){return{nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},variables:{dependencyType:"stateVariable",variableName:"variables"},initialConditions:{dependencyType:"stateVariable",variableName:"initialConditions"},hideInitialCondition:{dependencyType:"stateVariable",variableName:"hideInitialCondition"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"},padZeros:{dependencyType:"stateVariable",variableName:"padZeros"},independentVariable:{dependencyType:"stateVariable",variableName:"independentVariable"},initialIndependentVariableValue:{dependencyType:"stateVariable",variableName:"initialIndependentVariableValue"},rhss:{dependencyType:"stateVariable",variableName:"rhss"},number:{dependencyType:"stateVariable",variableName:"number"},equationTag:{dependencyType:"stateVariable",variableName:"equationTag"}}},definition({dependencyValues:ns,usedDefault:ss}){let os={};ns.padZeros&&(ss.displayDigits&&!ss.displayDecimals?Number.isFinite(ns.displayDecimals)&&(os.padToDecimals=ns.displayDecimals):ns.displayDigits>=1&&(os.padToDigits=ns.displayDigits));let ls=[],us=ns.independentVariable.toLatex();for(let ds=0;ds({latex:{dependencyType:"stateVariable",variableName:"latex"}}),definition:function({dependencyValues:ns}){return{setValue:{latexWithInputChildren:[ns.latex]}}}},rs.numericalRHSf={additionalStateVariablesDefined:["numericalRHSfDefinitions"],returnDependencies:()=>({validIndependentVariable:{dependencyType:"stateVariable",variableName:"validIndependentVariable"},independentVariable:{dependencyType:"stateVariable",variableName:"independentVariable"},validVariables:{dependencyType:"stateVariable",variableName:"validVariables"},variables:{dependencyType:"stateVariable",variableName:"variables"},rhss:{dependencyType:"stateVariable",variableName:"rhss"}}),definition({dependencyValues:ns}){let ss=!0;ns.validIndependentVariable||(console.warn("Can't define ODE RHS functions with invalid independent variable."),ss=!1),ns.validVariables.every(cs=>cs)||(console.warn("Can't define ODE RHS functions with an invalid variable."),ss=!1);let os=ns.independentVariable.subscripts_to_strings().tree,ls=ns.variables.map(cs=>cs.subscripts_to_strings().tree);ls.includes(os)&&(console.warn("Can't define ODE RHS functions when independent variable is a dependent variable"),ss=!1),[...new Set(ls)].length!==ls.length&&(console.warn("Can't define ODE RHS functions with duplicate dependent variable names"),ss=!1);let us;try{us=ns.rhss.map(cs=>cs.subscripts_to_strings().f())}catch{console.warn("Cannot define ODE RHS function. Error creating mathjs function"),ss=!1}if(!ss){let cs=ns.rhss.length;return{setValue:{numericalRHSf:()=>NaN,numericalRHSfDefinitions:Array(cs).fill({})}}}return{setValue:{numericalRHSf:function(cs,ds){let ps={[os]:cs};Array.isArray(ds)?ds.forEach((fs,hs)=>ps[ls[hs]]=fs):ps[ls[0]]=ds;try{return us.map(fs=>fs(ps))}catch{return NaN}},numericalRHSfDefinitions:ns.rhss.map(cs=>({functionType:"formula",formula:cs,nInputs:ls.length+1,variables:[os,...ls]}))}}}},rs.haveNumericalInitialConditions={additionalStateVariablesDefined:["t0","x0s"],returnDependencies:()=>({initialIndependentVariableValue:{dependencyType:"stateVariable",variableName:"initialIndependentVariableValue"},initialConditions:{dependencyType:"stateVariable",variableName:"initialConditions"}}),definition({dependencyValues:ns}){let ss=ns.initialIndependentVariableValue.evaluate_to_constant(),os=ns.initialConditions.map(us=>us.evaluate_to_constant()),ls=Number.isFinite(ss)&&os.every(us=>Number.isFinite(us));return{setValue:{t0:ss,x0s:os,haveNumericalInitialConditions:ls}}}},rs.numericalSolutions={isArray:!0,entryPrefixes:["numericalSolution"],public:!0,shadowingInstructions:{createComponentOfType:"function",addStateVariablesShadowingStateVariables:{fDefinitions:{stateVariableToShadow:"numericalSolutionFDefinitions"}}},createWorkspace:!0,returnArraySizeDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[ns.nDimensions]},returnArrayDependenciesByKey(){return{globalDependencies:{nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},validIndependentVariable:{dependencyType:"stateVariable",variableName:"validIndependentVariable"},independentVariable:{dependencyType:"stateVariable",variableName:"independentVariable"},validVariables:{dependencyType:"stateVariable",variableName:"validVariables"},variables:{dependencyType:"stateVariable",variableName:"variables"},chunkSize:{dependencyType:"stateVariable",variableName:"chunkSize"},tolerance:{dependencyType:"stateVariable",variableName:"tolerance"},maxIterations:{dependencyType:"stateVariable",variableName:"maxIterations"},haveNumericalInitialConditions:{dependencyType:"stateVariable",variableName:"haveNumericalInitialConditions"},t0:{dependencyType:"stateVariable",variableName:"t0"},x0s:{dependencyType:"stateVariable",variableName:"x0s"},numericalRHSf:{dependencyType:"stateVariable",variableName:"numericalRHSf"}}}},arrayDefinitionByKey({globalDependencyValues:ns,workspace:ss,componentName:os}){let ls={};if(ss.calculatedNumericSolutions=[],ss.endingNumericalValues=[],ss.maxPossibleTime=void 0,!ns.haveNumericalInitialConditions){for(let gs=0;gsNaN;return{setValue:{numericalSolutions:ls}}}let us=ns.t0,cs=ns.x0s,ds=ns.chunkSize,ps=ns.tolerance,fs=ns.numericalRHSf,hs=ns.maxIterations;for(let gs=0;gs=vs)for(let Ts=vs;Ts<=xs;Ts++){let Ss=ss.endingNumericalValues[Ts-1];Ss===void 0&&(Ss=cs);let Ns=us+Ts*ds,As=Context.math.dopri(Ns,Ns+ds,Ss,fs,ps,hs);ss.endingNumericalValues.push(As.y[As.y.length-1]),ss.calculatedNumericSolutions.push(As.at.bind(As));let ws=As.x[As.x.length-1];if(ws<(Ns+ds)*(1-1e-6)){ss.maxPossibleTime=ws;let Es="For chunksize "+ds+" and tolerance "+ps+", odesystem";os!==void 0&&(Es+=" ("+os+")"),Es+=" hit maxiterations ("+hs+") at t = "+ss.maxPossibleTime+". Will not calculate solution beyond that time. Decrease chunksize, increase maxiterations, or increase tolerance to calculate further.";break}}return bs>ss.maxPossibleTime?NaN:ss.calculatedNumericSolutions[xs](bs)[gs]};return{setValue:{numericalSolutions:ls}}}},rs.numericalSolution={isAlias:!0,targetVariableName:"numericalSolution1"},rs.numericalSolutionFDefinitions={forRenderer:!0,isArray:!0,entryPrefixes:["numericalSolutionFDefinition"],returnArraySizeDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[ns.nDimensions]},returnArrayDependenciesByKey(){return{globalDependencies:{nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},validIndependentVariable:{dependencyType:"stateVariable",variableName:"validIndependentVariable"},independentVariable:{dependencyType:"stateVariable",variableName:"independentVariable"},validVariables:{dependencyType:"stateVariable",variableName:"validVariables"},variables:{dependencyType:"stateVariable",variableName:"variables"},chunkSize:{dependencyType:"stateVariable",variableName:"chunkSize"},tolerance:{dependencyType:"stateVariable",variableName:"tolerance"},maxIterations:{dependencyType:"stateVariable",variableName:"maxIterations"},haveNumericalInitialConditions:{dependencyType:"stateVariable",variableName:"haveNumericalInitialConditions"},t0:{dependencyType:"stateVariable",variableName:"t0"},x0s:{dependencyType:"stateVariable",variableName:"x0s"},numericalRHSfDefinitions:{dependencyType:"stateVariable",variableName:"numericalRHSfDefinitions"}}}},arrayDefinitionByKey({globalDependencyValues:ns}){return ns.haveNumericalInitialConditions?{setValue:{numericalSolutionFDefinitions:[...Array(ns.nDimensions).keys()].map(ss=>({functionType:"ODESolution",nDimensions:ns.nDimensions,t0:ns.t0,x0s:ns.x0s,chunkSize:ns.chunkSize,tolerance:ns.tolerance,numericalRHSfDefinitions:ns.numericalRHSfDefinitions,maxIterations:ns.maxIterations,component:ss}))}}:{setValue:{numericalSolutionFDefinitions:Array(ns.nDimensions).fill({})}}}},rs}}zs(ODESystem,"componentType","odesystem"),zs(ODESystem,"rendererType","math");class Polyline extends GraphicalComponent{constructor(rs){super(rs),Object.assign(this.actions,{movePolyline:this.movePolyline.bind(this),finalizePolylinePosition:this.finalizePolylinePosition.bind(this),polylineClicked:this.polylineClicked.bind(this),mouseDownOnPolyline:this.mouseDownOnPolyline.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.verticesDraggable={createComponentOfType:"boolean"},rs.vertices={createComponentOfType:"_pointListComponent"},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.styleDescription={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ns}){var ls;let ss;((ls=ns.document)==null?void 0:ls.stateValues.theme)==="dark"?ss=ns.selectedStyle.lineColorWordDarkMode:ss=ns.selectedStyle.lineColorWord;let os=ns.selectedStyle.lineWidthWord;return ns.selectedStyle.lineStyleWord&&(os&&(os+=" "),os+=ns.selectedStyle.lineStyleWord),os&&(os+=" "),os+=ss,{setValue:{styleDescription:os}}}},rs.styleDescriptionWithNoun={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({styleDescription:{dependencyType:"stateVariable",variableName:"styleDescription"}}),definition:function({dependencyValues:ns}){return{setValue:{styleDescriptionWithNoun:ns.styleDescription+" polyline"}}}},rs.verticesDraggable={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},hasEssential:!0,forRenderer:!0,returnDependencies:()=>({verticesDraggableAttr:{dependencyType:"attributeComponent",attributeName:"verticesDraggable",variableNames:["value"]},draggable:{dependencyType:"stateVariable",variableName:"draggable"}}),definition({dependencyValues:ns}){return ns.verticesDraggableAttr?{setValue:{verticesDraggable:ns.verticesDraggableAttr.stateValues.value}}:{useEssentialOrDefaultValue:{verticesDraggable:{defaultValue:ns.draggable}}}}},rs.nVertices={public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies:()=>({vertices:{dependencyType:"attributeComponent",attributeName:"vertices",variableNames:["nPoints"]}}),definition:function({dependencyValues:ns}){return ns.vertices!==null?{setValue:{nVertices:ns.vertices.stateValues.nPoints}}:{setValue:{nVertices:0}}}},rs.nDimensions={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies(){return{vertices:{dependencyType:"attributeComponent",attributeName:"vertices",variableNames:["nDimensions"]}}},definition:function({dependencyValues:ns}){return ns.vertices!==null?{setValue:{nDimensions:ns.vertices.stateValues.nDimensions},checkForActualChange:{nDimensions:!0}}:{setValue:{nDimensions:2}}}},rs.vertices={public:!0,shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(ns){return ns==="vertexX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,nDimensions:2,entryPrefixes:["vertexX","vertex"],getArrayKeysFromVarName({arrayEntryPrefix:ns,varEnding:ss,arraySize:os}){if(ns==="vertexX"){let ls=ss.split("_").map(us=>Number(us)-1);return ls.length===2&&ls.every((us,cs)=>Number.isInteger(us)&&us>=0)?os?ls.every((us,cs)=>us=0?os?lsls+","+cs):[]:[ls+",0"]:[]}},getAllArrayKeys(ns,ss=!0,os){function ls(us){if(us.length===1)return Array.from(Array(us[0]),(cs,ds)=>String(ds));{let cs=us[0],ds=ls(us.slice(1)),ps=[];for(let fs=0;fsfs+","+hs)):ps.push(ds.map(hs=>fs+","+hs));return ps}}if(os){if(os.length===0||!ns)return[];{let us=[...ns];return us[0]=os[0],ls(us)}}else return!ns||ns.length===0?[]:ls(ns)},arrayVarNameFromPropIndex(ns,ss){if(ss==="vertices")return ns.length===1?"vertex"+ns[0]:`vertexX${ns[0]}_${ns[1]}`;if(ss.slice(0,6)==="vertex"){let os=Number(ss.slice(6));if(Number.isInteger(os)&&os>0)return`vertexX${os}_${ns[0]}`}return null},returnArraySizeDependencies:()=>({nVertices:{dependencyType:"stateVariable",variableName:"nVertices"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[ns.nVertices,ns.nDimensions]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={};for(let os of ns){let[ls,us]=os.split(","),cs=Number(ls)+1+"_"+(Number(us)+1);ss[os]={vertices:{dependencyType:"attributeComponent",attributeName:"vertices",variableNames:["pointX"+cs]}}}return{dependenciesByKey:ss}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={};for(let ls of ss){let[us,cs]=ls.split(","),ds=Number(us)+1+"_"+(Number(cs)+1),ps=ns[ls].vertices;ps!==null&&ps.stateValues["pointX"+ds]?os[ls]=ps.stateValues["pointX"+ds]:os[ls]=Context.fromAst("_")}return{setValue:{vertices:os}}},async inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyValuesByKey:ss,dependencyNamesByKey:os,initialChange:ls,stateValues:us}){let cs=[];for(let ds in ns.vertices){let[ps,fs]=ds.split(","),hs=Number(ps)+1+"_"+(Number(fs)+1);if(ss[ds].vertices!==null&&ss[ds].vertices.stateValues["pointX"+hs])cs.push({setDependency:os[ds].vertices,desiredValue:ns.vertices[ds],variableIndex:0});else return{success:!1}}return{success:!0,instructions:cs}}},rs.numericalVertices={isArray:!0,entryPrefixes:["numericalVertex"],forRenderer:!0,returnArraySizeDependencies:()=>({nVertices:{dependencyType:"stateVariable",variableName:"nVertices"}}),returnArraySize({dependencyValues:ns}){return[ns.nVertices]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={};for(let os of ns)ss[os]={vertex:{dependencyType:"stateVariable",variableName:"vertex"+(Number(os)+1)}};return{dependenciesByKey:ss}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={};for(let ls of ss){let us=ns[ls].vertex.map(cs=>cs.evaluate_to_constant());us.every(cs=>Number.isFinite(cs))||(us=Array(us.length).fill(NaN)),os[ls]=us}return{setValue:{numericalVertices:os}}}},rs.nearestPoint={returnDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},numericalVertices:{dependencyType:"stateVariable",variableName:"numericalVertices"},nVertices:{dependencyType:"stateVariable",variableName:"nVertices"}}),definition({dependencyValues:ns}){var hs,gs,ys,bs;let ss=ns.nDimensions,os=ns.nVertices,ls=ns.numericalVertices,us=[],cs,ds,ps=(hs=ls[0])==null?void 0:hs[0],fs=(gs=ls[0])==null?void 0:gs[1];for(let vs=1;vs=1?Ws={x1:$s,x2:Rs}:Ws={x1:Es+Ms*ks*Cs,x2:_s+Ms*Ps*Ts};let Us=Math.pow((As-Ws.x1)/Cs,2)+Math.pow((ws-Ws.x2)/Ts,2);Us0&&(Ns.x3=0),Ns}}}}},rs}async movePolyline({pointCoords:rs,transient:ns,sourceDetails:ss,actionId:os,sourceInformation:ls={},skipRendererUpdate:us=!1}){if(Object.keys(rs).length===1){if(!await this.stateValues.verticesDraggable)return await this.coreFunctions.resolveAction({actionId:os})}else if(!await this.stateValues.draggable)return await this.coreFunctions.resolveAction({actionId:os});let ds={};for(let ps in rs)ds[ps+",0"]=Context.fromAst(rs[ps][0]),ds[ps+",1"]=Context.fromAst(rs[ps][1]);return ns?await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"vertices",value:ds,sourceDetails:ss}],transient:ns,actionId:os,sourceInformation:ls,skipRendererUpdate:us}):await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"vertices",value:ds,sourceDetails:ss}],actionId:os,sourceInformation:ls,skipRendererUpdate:us,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{pointCoordinates:rs}}})}async finalizePolylinePosition({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){return await this.actions.movePolyline({pointCoords:await this.stateValues.numericalVertices,transient:!1,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss})}async polylineClicked({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){await this.coreFunctions.triggerChainedActions({triggeringAction:"click",componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss}),this.coreFunctions.resolveAction({actionId:rs})}async mouseDownOnPolyline({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){await this.coreFunctions.triggerChainedActions({triggeringAction:"down",componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss}),this.coreFunctions.resolveAction({actionId:rs})}}zs(Polyline,"componentType","polyline");class CobwebPolyline extends Polyline{static createAttributesObject(){let rs=super.createAttributesObject();return rs.attractThreshold={createComponentOfType:"number",createStateVariable:"attractThreshold",defaultValue:.5,public:!0},rs.nPoints={createComponentOfType:"number",createStateVariable:"nPoints",defaultValue:1,public:!0,clamp:[0,1/0],forRenderer:!0},rs.variable={createComponentOfType:"variable",createStateVariable:"variable",defaultValue:Context.fromAst("x"),public:!0,forRenderer:!0},rs.nIterationsRequired={createComponentOfType:"number",createStateVariable:"nIterationsRequired",defaultValue:0,public:!0},rs.initialPoint={createComponentOfType:"point"},rs.function={createComponentOfType:"function"},rs.lockToSolution={createComponentOfType:"boolean",createStateVariable:"lockToSolution",defaultValue:!1},rs.defaultPoint={createComponentOfType:"point"},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.nDimensions.returnDependencies=()=>({}),rs.nDimensions.definition=()=>({setValue:{nDimensions:2}}),rs.initialPoint={isArray:!0,public:!0,shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(ns){return ns==="initialPointX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},entryPrefixes:["initialPointX"],defaultValueByArrayKey:()=>Context.fromAst(0),hasEssential:!0,returnArraySizeDependencies:()=>({}),returnArraySize:()=>[2],returnArrayDependenciesByKey({arrayKeys:ns}){let ss={};for(let os of ns){let ls=Number(os)+1;ss[os]={initialPointAttr:{dependencyType:"attributeComponent",attributeName:"initialPoint",variableNames:["x"+ls]}}}return{dependenciesByKey:ss}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={},ls={};for(let cs of ss){let ds=Number(cs)+1;ns[cs].initialPointAttr?os[cs]=ns[cs].initialPointAttr.stateValues["x"+ds]:ls[cs]=!0}let us={};return Object.keys(os).length>0&&(us.setValue={initialPoint:os}),Object.keys(ls).length>0&&(us.useEssentialOrDefaultValue={initialPoint:ls}),us},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyValuesByKey:ss,dependencyNamesByKey:os}){let ls=[];for(let us in ns.initialPoint)ss[us].initialPointAttr&&ss[us].initialPointAttr.stateValues["x"+(Number(us)+1)]?ls.push({setDependency:os[us].initialPointAttr,desiredValue:ns.initialPoint[us],variableIndex:0}):ls.push({setEssentialValue:"initialPoint",value:{[us]:ns.initialPoint[us]}});return{success:!0,instructions:ls}}},rs.f={additionalStateVariablesDefined:[{variableName:"fDefinition",forRenderer:!0}],returnDependencies:()=>({functionAttr:{dependencyType:"attributeComponent",attributeName:"function",variableNames:["numericalf","fDefinition"]}}),definition({dependencyValues:ns}){return ns.functionAttr?{setValue:{f:ns.functionAttr.stateValues.numericalf,fDefinition:ns.functionAttr.stateValues.fDefinition}}:{setValue:{f:null,fDefinition:null}}}},rs.nVertices={isAlias:!0,targetVariableName:"nPoints"},rs.nOriginalVertices={providePreviousValuesInDefinition:!0,returnDependencies:()=>({nVertices:{dependencyType:"stateVariable",variableName:"nVertices"}}),definition({dependencyValues:ns,previousValues:ss}){let os=ns.nVertices;return ss.nOriginalVertices>os&&(os=ss.nOriginalVertices),{setValue:{nOriginalVertices:os}}}},rs.originalVertices={isArray:!0,nDimensions:2,hasEssential:!0,entryPrefixes:["originalVertexX","originalVertex"],getArrayKeysFromVarName({arrayEntryPrefix:ns,varEnding:ss,arraySize:os}){if(ns==="originalVertexX"){let ls=ss.split("_").map(us=>Number(us)-1);return ls.length===2&&ls.every((us,cs)=>Number.isInteger(us)&&us>=0)?os?ls.every((us,cs)=>us=0?os?lsls+","+cs):[]:[ls+",0"]:[]}},arrayVarNameFromPropIndex(ns,ss){if(ss==="originalVertices")return ns.length===1?"originalVertex"+ns[0]:`originalVertexX${ns[0]}_${ns[1]}`;if(ss.slice(0,14)==="originalVertex"){let os=Number(ss.slice(14));if(Number.isInteger(os)&&os>0)return`originalVertexX${os}_${ns[0]}`}return null},returnArraySizeDependencies:()=>({nOriginalVertices:{dependencyType:"stateVariable",variableName:"nOriginalVertices"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[ns.nOriginalVertices-1,ns.nDimensions]},returnArrayDependenciesByKey:()=>({globalDependencies:{graphAncestor:{dependencyType:"ancestor",componentType:"graph",variableNames:["xmin","xmax","ymin","ymax"]},defaultPoint:{dependencyType:"attributeComponent",attributeName:"defaultPoint",variableNames:["xs"]}}}),arrayDefinitionByKey({globalDependencyValues:ns,arrayKeys:ss}){let os={};for(let ls of ss){let us=ls.split(",").map(Number);os[ls]={get defaultValue(){if(ns.defaultPoint){let cs=ns.defaultPoint.stateValues.xs;if(cs.length===2&&us[1]<2)return cs[us[1]]}if(ns.graphAncestor){if(us[1]===0){let cs=ns.graphAncestor.stateValues.xmin,ds=ns.graphAncestor.stateValues.xmax;return Context.fromAst((cs+ds)/2)}else if(us[1]===1){let cs=ns.graphAncestor.stateValues.ymin,ds=ns.graphAncestor.stateValues.ymax;return Context.fromAst((cs+ds)/2)}}return Context.fromAst(0)}}}return{useEssentialOrDefaultValue:{originalVertices:os}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns}){let ss=[];for(let os in ns.originalVertices)ss.push({setEssentialValue:"originalVertices",value:{[os]:ns.originalVertices[os]}});return{success:!0,instructions:ss}}},rs.vertices.additionalStateVariablesDefined=[{variableName:"prelimCorrectVertices",entryPrefixes:["prelimCorrectVertexX","prelimCorrectVertex"],getArrayKeysFromVarName:function({arrayEntryPrefix:ns,varEnding:ss,arraySize:os}){if(ns==="prelimCorrectVertexX"){let ls=ss.split("_").map(us=>Number(us)-1);return ls.length===2&&ls.every((us,cs)=>Number.isInteger(us)&&us>=0)?os?ls.every((us,cs)=>us=0?os?lsls+","+cs):[]:[ls+",0"]:[]}}}],rs.vertices.basedOnArrayKeyStateVariables=!0,rs.vertices.returnArrayDependenciesByKey=function({arrayKeys:ns}){let ss={f:{dependencyType:"stateVariable",variableName:"f"},attractThreshold:{dependencyType:"stateVariable",variableName:"attractThreshold"},lockToSolution:{dependencyType:"stateVariable",variableName:"lockToSolution"}},os={};for(let ls of ns){let[us,cs]=ls.split(",");us==="0"?os[ls]={initialPoint:{dependencyType:"stateVariable",variableName:"initialPointX"+(Number(cs)+1)}}:os[ls]={originalVertexX1:{dependencyType:"stateVariable",variableName:"originalVertexX"+us+"_1"},originalVertexX2:{dependencyType:"stateVariable",variableName:"originalVertexX"+us+"_2"},previousVertexX1:{dependencyType:"stateVariable",variableName:"vertexX"+us+"_1"},previousVertexX2:{dependencyType:"stateVariable",variableName:"vertexX"+us+"_2"}}}return{globalDependencies:ss,dependenciesByKey:os}},rs.vertices.arrayDefinitionByKey=function({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os}){let ls={},us={};for(let cs of os){let[ds,ps]=cs.split(",");if(ds==="0")ls[cs]=ss[cs].initialPoint,us[cs]=null;else{let fs,hs;try{fs=[ss[cs].originalVertexX1.evaluate_to_constant(),ss[cs].originalVertexX2.evaluate_to_constant()],hs=[ss[cs].previousVertexX1.evaluate_to_constant(),ss[cs].previousVertexX2.evaluate_to_constant()]}catch{ls[ds+",0"]=Context.fromAst(0),ls[ds+",1"]=Context.fromAst(0),us[ds+",0"]=!1;continue}let gs;if(Number(ds)%2===1){let bs=ns.f(hs[0]);gs=[hs[0],bs]}else gs=[hs[1],hs[1]];Math.pow(fs[0]-gs[0],2)+Math.pow(fs[1]-gs[1],2)({nVertices:{dependencyType:"stateVariable",variableName:"nVertices"}}),returnArraySize({dependencyValues:ns}){return[ns.nVertices-1]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={};for(let os of ns)ss[os]={prelimCorrectVertex:{dependencyType:"stateVariable",variableName:"prelimCorrectVertexX"+(Number(os)+2)+"_1"}};return{dependenciesByKey:ss}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={};for(let ls of ss)os[ls]=ns[ls].prelimCorrectVertex;return{setValue:{correctVertices:os}}}},rs.fractionCorrectVertices={public:!0,shadowingInstructions:{createComponentOfType:"number"},additionalStateVariablesDefined:[{variableName:"nGradedVertices",public:!0,shadowingInstructions:{createComponentOfType:"number"}},{variableName:"nCorrectVertices",public:!0,shadowingInstructions:{createComponentOfType:"number"}}],returnDependencies:()=>({correctVertices:{dependencyType:"stateVariable",variableName:"correctVertices"}}),definition({dependencyValues:ns}){let ss=ns.correctVertices.length,os,ls;return ss===0?(os=0,ls=0):(ls=ns.correctVertices.reduce((us,cs)=>us+cs,0),os=ls/ss),{setValue:{fractionCorrectVertices:os,nGradedVertices:ss,nCorrectVertices:ls}}}},rs.fractionCorrectVerticesAdjusted={public:!0,shadowingInstructions:{createComponentOfType:"number"},additionalStateVariablesDefined:[{variableName:"nGradedVerticesAdjusted",public:!0,shadowingInstructions:{createComponentOfType:"number"}}],returnDependencies:()=>({nCorrectVertices:{dependencyType:"stateVariable",variableName:"nCorrectVertices"},nGradedVertices:{dependencyType:"stateVariable",variableName:"nGradedVertices"},nIterationsRequired:{dependencyType:"stateVariable",variableName:"nIterationsRequired"}}),definition({dependencyValues:ns}){let ss=0;ns.nIterationsRequired>0&&(ss=2*ns.nIterationsRequired-1);let os=Math.max(ns.nGradedVertices,ss),ls;return os===0?ls=0:ls=ns.nCorrectVertices/os,{setValue:{fractionCorrectVerticesAdjusted:ls,nGradedVerticesAdjusted:os}}}},rs.nIterateValues={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({nVertices:{dependencyType:"stateVariable",variableName:"nVertices"}}),definition:({dependencyValues:ns})=>({setValue:{nIterateValues:Math.ceil((ns.nVertices+1)/2)}})},rs.iterateValues={isArray:!0,public:!0,shadowingInstructions:{createComponentOfType:"math"},entryPrefixes:["iterateValue"],returnArraySizeDependencies:()=>({nIterateValues:{dependencyType:"stateVariable",variableName:"nIterateValues"}}),returnArraySize({dependencyValues:ns}){return[ns.nIterateValues]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={};for(let os of ns)os==="0"?ss[os]={iterateValue:{dependencyType:"stateVariable",variableName:"vertexX1_1"}}:ss[os]={iterateValue:{dependencyType:"stateVariable",variableName:"vertexX"+2*Number(os)+"_2"}};return{dependenciesByKey:ss}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={};for(let ls of ss)os[ls]=ns[ls].iterateValue;return{setValue:{iterateValues:os}}}},rs}}zs(CobwebPolyline,"componentType","cobwebPolyline"),zs(CobwebPolyline,"rendererType","cobwebPolyline");class Point extends GraphicalComponent{constructor(rs){super(rs),Object.assign(this.actions,{movePoint:this.movePoint.bind(this),switchPoint:this.switchPoint.bind(this),pointClicked:this.pointClicked.bind(this),mouseDownOnPoint:this.mouseDownOnPoint.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.x={createComponentOfType:"math"},rs.y={createComponentOfType:"math"},rs.z={createComponentOfType:"math"},rs.xs={createComponentOfType:"mathList"},rs.coords={createComponentOfType:"coords"},rs.displayDigits={createComponentOfType:"integer"},rs.displayDecimals={createComponentOfType:"integer",createStateVariable:"displayDecimals",defaultValue:null,public:!0},rs.displaySmallAsZero={createComponentOfType:"number",createStateVariable:"displaySmallAsZero",valueForTrue:1e-14,valueForFalse:0,defaultValue:0,public:!0},rs.padZeros={createComponentOfType:"boolean",createStateVariable:"padZeros",defaultValue:!1,public:!0},rs.labelPosition={createComponentOfType:"text",createStateVariable:"labelPosition",defaultValue:"upperright",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft","top","bottom","left","right"]},rs.showCoordsWhenDragging={createComponentOfType:"boolean",createStateVariable:"showCoordsWhenDragging",defaultValue:!0,public:!0,forRenderer:!0},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss,componentInfoObjects:os}){let us=returnBreakStringsSugarFunction({childrenToComponentFunction:gs=>({componentType:"math",children:gs}),mustStripOffOuterParentheses:!0}),cs=ss.map(gs=>typeof gs),ds=cs.indexOf("string"),ps=cs.lastIndexOf("string");if(ds===-1){let gs=os.componentIsSpecifiedType,ys=ss.filter(bs=>!(gs(bs,"point")||gs(bs,"vector")||gs(bs,"constraints")||gs(bs,"label")));if(ys.length===1){let bs=ys[0],vs=ss.indexOf(bs),xs=[...ss.slice(0,vs),...ss.slice(vs+1)];return{success:!0,newAttributes:{coords:{component:{componentType:"math",children:ys}}},newChildren:xs}}else return{success:!1}}let fs=[...ss.slice(0,ds),...ss.slice(ps+1)];ss=ss.slice(ds,ps+1);let hs=us({matchedChildren:ss});return!hs.success&&ss.length===1?{success:!0,newAttributes:{xs:{component:{componentType:"mathList",children:[{componentType:"math",children:ss}]}}},newChildren:fs}:hs.success?{success:!0,newAttributes:{xs:{component:{componentType:"mathList",children:hs.newChildren,skipSugar:!0}}},newChildren:fs}:{success:!1}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){let rs=super.returnChildGroups();return rs.push({group:"points",componentTypes:["point"]},{group:"vectors",componentTypes:["vector"]},{group:"constraints",componentTypes:["constraints"]}),rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.styleDescription={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ns}){var os;let ss;return((os=ns.document)==null?void 0:os.stateValues.theme)==="dark"?ss=ns.selectedStyle.markerColorWordDarkMode:ss=ns.selectedStyle.markerColorWord,{setValue:{styleDescription:ss}}}},rs.styleDescriptionWithNoun={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},styleDescription:{dependencyType:"stateVariable",variableName:"styleDescription"}}),definition:function({dependencyValues:ns}){return{setValue:{styleDescriptionWithNoun:ns.styleDescription+" "+ns.selectedStyle.markerStyleWord}}}},rs.displayDigits={public:!0,shadowingInstructions:{createComponentOfType:"integer"},hasEssential:!0,defaultValue:10,returnDependencies:()=>({displayDigitsAttr:{dependencyType:"attributeComponent",attributeName:"displayDigits",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]}}),definition({dependencyValues:ns,usedDefault:ss}){if(ns.displayDigitsAttr!==null){let os=ns.displayDigitsAttr===null||ss.displayDigitsAttr,ls=ns.displayDecimalsAttr===null||ss.displayDecimalsAttr;if(!(os||ls)){let us=ns.displayDigitsAttr.shadowDepth;ns.displayDecimalsAttr.shadowDepth({}),definition:()=>({useEssentialOrDefaultValue:{coordsShadow:!0}}),inverseDefinition:async function({desiredStateVariableValues:ns,stateValues:ss,workspace:os}){return{success:!0,instructions:[{setEssentialValue:"coordsShadow",value:ns.coordsShadow}]}}},rs.nDimensions={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({coordsShadow:{dependencyType:"stateVariable",variableName:"coordsShadow"},coords:{dependencyType:"attributeComponent",attributeName:"coords",variableNames:["value"]},x:{dependencyType:"attributeComponent",attributeName:"x"},y:{dependencyType:"attributeComponent",attributeName:"y"},z:{dependencyType:"attributeComponent",attributeName:"z"},xs:{dependencyType:"attributeComponent",attributeName:"xs",variableNames:["nComponents"]},pointChild:{dependencyType:"child",childGroups:["points"],variableNames:["nDimensions"]},vectorChild:{dependencyType:"child",childGroups:["vectors"],variableNames:["nDimensions"]}}),definition:function({dependencyValues:ns}){let ss=!1,os,ls;if(ns.z!==null?ls=3:ns.y!==null?ls=2:ls=0,ns.coords!==null?(ss=!0,os=ns.coords.stateValues.value):ns.coordsShadow&&(ss=!0,os=ns.coordsShadow),ss){let us=os.tree;return Array.isArray(us)&&vectorOperators.includes(us[0])?ls=Math.max(us.length-1,ls):ls=Math.max(1,ls),{setValue:{nDimensions:ls},checkForActualChange:{nDimensions:!0}}}else return ns.xs!==null?{setValue:{nDimensions:Math.max(ns.xs.stateValues.nComponents,ls)}}:ns.pointChild.length>0?{setValue:{nDimensions:Math.max(ns.pointChild[0].stateValues.nDimensions,ls)}}:ns.vectorChild.length>0?{setValue:{nDimensions:Math.max(ns.vectorChild[0].stateValues.nDimensions,ls)}}:(ls===0&&(ls=2),{setValue:{nDimensions:ls},checkForActualChange:{nDimensions:!0}})}},rs.arrayVariableForConstraints={returnDependencies:()=>({}),definition:()=>({setValue:{arrayVariableForConstraints:"unconstrainedXs"}})},rs.arrayEntryPrefixForConstraints={returnDependencies:()=>({}),definition:()=>({setValue:{arrayEntryPrefixForConstraints:"unconstrainedX"}})},rs.nDimensionsForConstraints={isAlias:!0,targetVariableName:"nDimensions"},rs.unconstrainedXs={isArray:!0,entryPrefixes:["unconstrainedX"],defaultValueByArrayKey:()=>Context.fromAst(0),hasEssential:!0,returnArraySizeDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[ns.nDimensions]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={coordsShadow:{dependencyType:"stateVariable",variableName:"coordsShadow"},coords:{dependencyType:"attributeComponent",attributeName:"coords",variableNames:["value"]}},os={};for(let ls of ns){let us=Number(ls)+1;os[ls]={xs:{dependencyType:"attributeComponent",attributeName:"xs",variableNames:["math"+us]},pointChild:{dependencyType:"child",childGroups:["points"],variableNames:["x"+us]},vectorChild:{dependencyType:"child",childGroups:["vectors"],variableNames:["x"+us]}},ls==="0"?os[ls].component={dependencyType:"attributeComponent",attributeName:"x",variableNames:["value"]}:ls==="1"?os[ls].component={dependencyType:"attributeComponent",attributeName:"y",variableNames:["value"]}:ls==="2"&&(os[ls].component={dependencyType:"attributeComponent",attributeName:"z",variableNames:["value"]})}return{globalDependencies:ss,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os}){let ls={},us={},cs=!1,ds;if(ns.coords!==null?(cs=!0,ds=ns.coords.stateValues.value):ns.coordsShadow&&(cs=!0,ds=ns.coordsShadow),cs){let fs=ds.tree;if(Array.isArray(fs)&&vectorOperators.includes(fs[0]))for(let hs of os){let gs=Number(hs);(gs>=0||gs0)ls[fs]=ys[0].stateValues["x"+hs];else{let bs=ss[fs].vectorChild;bs.length>0&&(ls[fs]=bs[0].stateValues["x"+hs])}}}for(let fs of os){let hs=ss[fs].component;hs?ls[fs]=hs.stateValues.value.simplify():ls[fs]===void 0&&(us[fs]=!0)}let ps={};return Object.keys(ls).length>0&&(ps.setValue={unconstrainedXs:ls}),Object.keys(us).length>0&&(ps.useEssentialOrDefaultValue={unconstrainedXs:us}),ps},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,arraySize:us}){let cs=[],ds=!1,ps,fs,hs=!1;ss.coords!==null?(ds=!0,ps="coords",fs=Array(us[0]+1)):ss.coordsShadow!==null&&(ds=!0,ps="coordsShadow",fs=Array(us[0]+1));for(let gs of Object.keys(ns.unconstrainedXs).reverse()){let ys=convertValueToMathExpression(ns.unconstrainedXs[gs]);os[gs].component!==null?cs.push({setDependency:ls[gs].component,desiredValue:ys,childIndex:0,variableIndex:0}):ds?(fs[Number(gs)+1]=ys.tree,hs=!0):os[gs].xs!==null?cs.push({setDependency:ls[gs].xs,desiredValue:ys,childIndex:0,variableIndex:0}):os[gs].pointChild.length>0?cs.push({setDependency:ls[gs].pointChild,desiredValue:ys,childIndex:0,variableIndex:0}):os[gs].vectorChild.length>0?cs.push({setDependency:ls[gs].vectorChild,desiredValue:ys,childIndex:0,variableIndex:0}):cs.push({setEssentialValue:"unconstrainedXs",value:{[gs]:ys}})}if(hs){let gs;us[0]===1?gs=Context.fromAst(fs[1]):(fs[0]="vector",gs=Context.fromAst(fs));let ys={setDependency:ps,desiredValue:gs};ps==="coords"&&(ys.childIndex=0,ys.variableIndex=0),cs.push(ys)}return{success:!0,instructions:cs}}},rs.xs={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},isArray:!0,entryPrefixes:["x"],returnArraySizeDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[ns.nDimensions]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={};for(let os of ns){let ls=Number(os)+1,us={};us.unconstrainedX={dependencyType:"stateVariable",variableName:`unconstrainedX${ls}`},us.constraintsChild={dependencyType:"child",childGroups:["constraints"],variableNames:[`constraintResult${ls}`]},ss[os]=us}return{dependenciesByKey:ss}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={};for(let ls of ss)if(ns[ls].constraintsChild.length>0){let us=Number(ls)+1;os[ls]=convertValueToMathExpression(ns[ls].constraintsChild[0].stateValues["constraintResult"+us])}else os[ls]=convertValueToMathExpression(ns[ls].unconstrainedX);return ss.length>0?{setValue:{xs:os}}:{}},async inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyValuesByKey:ss,dependencyNamesByKey:os,initialChange:ls,stateValues:us}){if(ls&&!await us.draggable)return{success:!1};let cs=[];for(let ds of Object.keys(ns.xs).reverse())ss[ds]&&(ss[ds].constraintsChild.length>0?cs.push({setDependency:os[ds].constraintsChild,desiredValue:ns.xs[ds],childIndex:0,variableIndex:0}):cs.push({setDependency:os[ds].unconstrainedX,desiredValue:ns.xs[ds]}));return{success:!0,instructions:cs}}},rs.x={isAlias:!0,targetVariableName:"x1"},rs.y={isAlias:!0,targetVariableName:"x2"},rs.z={isAlias:!0,targetVariableName:"x3"},rs.coords={public:!0,shadowingInstructions:{createComponentOfType:"coords",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},returnDependencies:()=>({xs:{dependencyType:"stateVariable",variableName:"xs"}}),definition:function({dependencyValues:ns}){let ss=[];for(let os of ns.xs)os?ss.push(os.tree):ss.push("_");return ss.length>1?ss=["vector",...ss]:ss.length===1?ss=ss[0]:ss="_",{setValue:{coords:Context.fromAst(ss)}}},inverseDefinition:async function({desiredStateVariableValues:ns,stateValues:ss,initialChange:os}){if(os&&!await ss.draggable)return{success:!1};let ls=[],us={},cs=ns.coords.tree;if(!(Array.isArray(cs)&&vectorOperators.includes(cs[0])))us[0]=ns.coords;else for(let ds=0;ds({coords:{dependencyType:"stateVariable",variableName:"coords"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"},padZeros:{dependencyType:"stateVariable",variableName:"padZeros"}}),definition:function({dependencyValues:ns,usedDefault:ss}){let os={};return ns.padZeros&&(ss.displayDigits&&!ss.displayDecimals?Number.isFinite(ns.displayDecimals)&&(os.padToDecimals=ns.displayDecimals):ns.displayDigits>=1&&(os.padToDigits=ns.displayDigits)),{setValue:{latex:roundForDisplay({value:ns.coords,dependencyValues:ns,usedDefault:ss}).toLatex(os)}}}},rs.value={isAlias:!0,targetVariableName:"coords"},rs.constraintUsed={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},returnDependencies:()=>({constraintsChild:{dependencyType:"child",childGroups:["constraints"],variableNames:["constraintUsed"]}}),definition:function({dependencyValues:ns}){return ns.constraintsChild.length===0?{setValue:{constraintUsed:!1}}:{setValue:{constraintUsed:ns.constraintsChild[0].stateValues.constraintUsed}}}},rs.numericalXs={isArray:!0,entryPrefixes:["numericalX"],forRenderer:!0,returnArraySizeDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[ns.nDimensions]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={};for(let os of ns){let ls=Number(os)+1;ss[os]={x:{dependencyType:"stateVariable",variableName:`x${ls}`}}}return{dependenciesByKey:ss}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={};for(let ls of ss){let us=ns[ls].x;us?(us=ns[ls].x.evaluate_to_constant(),os[ls]=us):os[ls]=NaN}return{setValue:{numericalXs:os}}},async inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyNamesByKey:ss,initialChange:os,stateValues:ls}){if(os&&!await ls.draggable)return{success:!1};let us=[];for(let cs in ns.numericalXs)dependencyValuesByKey[cs]&&us.push({setDependency:ss[cs].xs,desiredValue:ns.numericalXs[cs]});return{success:!0,instructions:us}}},rs.nearestPoint={returnDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},numericalXs:{dependencyType:"stateVariable",variableName:"numericalXs"}}),definition:({dependencyValues:ns})=>({setValue:{nearestPoint:function(){let ss={};for(let os=1;os<=ns.nDimensions;os++){let ls=ns.numericalXs[os-1];if(!Number.isFinite(ls))return{};ss["x"+os]=ls}return ss}}})},rs}async movePoint({x:rs,y:ns,z:ss,transient:os,actionId:ls,sourceInformation:us={},skipRendererUpdate:cs=!1}){let ds={};return rs!==void 0&&(ds[0]=Context.fromAst(rs)),ns!==void 0&&(ds[1]=Context.fromAst(ns)),ss!==void 0&&(ds[2]=Context.fromAst(ss)),os?await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"xs",value:ds}],transient:os,actionId:ls,sourceInformation:us,skipRendererUpdate:cs}):await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"xs",value:ds}],actionId:ls,sourceInformation:us,skipRendererUpdate:cs,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{x:rs,y:ns,z:ss}}})}switchPoint(){}async pointClicked({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){await this.coreFunctions.triggerChainedActions({triggeringAction:"click",componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss}),this.coreFunctions.resolveAction({actionId:rs})}async mouseDownOnPoint({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){await this.coreFunctions.triggerChainedActions({triggeringAction:"down",componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss}),this.coreFunctions.resolveAction({actionId:rs})}}zs(Point,"componentType","point"),zs(Point,"primaryStateVariableForDefinition","coordsShadow"),zs(Point,"stateVariableForAttributeValue","coords"),zs(Point,"adapters",[{stateVariable:"coords",stateVariablesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]}]);class EquilibriumPoint extends Point{static createAttributesObject(){let rs=super.createAttributesObject();return rs.stable={createComponentOfType:"boolean",createStateVariable:"stable",defaultValue:!0,public:!0},rs.switchable={createComponentOfType:"boolean",createStateVariable:"switchable",defaultValue:!1,public:!0,forRenderer:!0},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.open={forRenderer:!0,returnDependencies:()=>({stable:{dependencyType:"stateVariable",variableName:"stable"}}),definition({dependencyValues:ns}){return{setValue:{open:!ns.stable}}},inverseDefinition({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setDependency:"stable",desiredValue:!ns.open}]}}},rs}async switchPoint({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){if(await this.stateValues.switchable)return await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"stable",value:!this.stateValues.stable}],actionId:rs,sourceInformation:ns,skipRendererUpdate:ss,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{stable:!this.stateValues.stable}}});this.coreFunctions.resolveAction({actionId:rs})}}zs(EquilibriumPoint,"componentType","equilibriumPoint"),zs(EquilibriumPoint,"rendererType","point");class Line extends GraphicalComponent{constructor(rs){super(rs),Object.assign(this.actions,{moveLine:this.moveLine.bind(this),switchLine:this.switchLine.bind(this),lineClicked:this.lineClicked.bind(this),mouseDownOnLine:this.mouseDownOnLine.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.equation={createComponentOfType:"math"},rs.through={createComponentOfType:"_pointListComponent"},rs.slope={createComponentOfType:"number"},rs.variables={createComponentOfType:"variables"},rs.displayDigits={createComponentOfType:"integer"},rs.displayDecimals={createComponentOfType:"integer",createStateVariable:"displayDecimals",defaultValue:null,public:!0},rs.displaySmallAsZero={createComponentOfType:"number",createStateVariable:"displaySmallAsZero",valueForTrue:1e-14,valueForFalse:0,defaultValue:0,public:!0},rs.padZeros={createComponentOfType:"boolean",createStateVariable:"padZeros",defaultValue:!1,public:!0},rs.labelPosition={createComponentOfType:"text",createStateVariable:"labelPosition",defaultValue:"upperright",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft"]},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss,componentInfoObjects:os}){if(ss.length===0)return{success:!1};let ls=ps=>os.componentIsSpecifiedType(ps,"label"),us=ss.map(ls),cs=[],ds=[];if(us.filter(ps=>ps).length===0)cs=ss;else{if(us[0]){let fs=us.indexOf(!1);fs!==-1&&(ds.push(...ss.slice(0,fs)),ss=ss.slice(fs),us=us.slice(fs))}let ps=us.indexOf(!0);ps===-1?cs=ss:(cs=ss.slice(0,ps),ds.push(...ss.slice(ps)))}return cs.length===0?{success:!1}:{success:!0,newAttributes:{equation:{component:{componentType:"math",children:cs}}},newChildren:ds}};return rs.push({replacementFunction:ns}),rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.styleDescription={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ns}){var ls;let ss;((ls=ns.document)==null?void 0:ls.stateValues.theme)==="dark"?ss=ns.selectedStyle.lineColorWordDarkMode:ss=ns.selectedStyle.lineColorWord;let os=ns.selectedStyle.lineWidthWord;return ns.selectedStyle.lineStyleWord&&(os&&(os+=" "),os+=ns.selectedStyle.lineStyleWord),os&&(os+=" "),os+=ss,{setValue:{styleDescription:os}}}},rs.styleDescriptionWithNoun={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({styleDescription:{dependencyType:"stateVariable",variableName:"styleDescription"}}),definition:function({dependencyValues:ns}){return{setValue:{styleDescriptionWithNoun:ns.styleDescription+" line"}}}},rs.displayDigits={public:!0,shadowingInstructions:{createComponentOfType:"integer"},hasEssential:!0,defaultValue:10,returnDependencies:()=>({displayDigitsAttr:{dependencyType:"attributeComponent",attributeName:"displayDigits",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]}}),definition({dependencyValues:ns,usedDefault:ss}){let os=ns.displayDigitsAttr===null||ss.displayDigitsAttr,ls=ns.displayDecimalsAttr===null||ss.displayDecimalsAttr;if(!(os||ls)){let us=ns.displayDigitsAttr.shadowDepth;ns.displayDecimalsAttr.shadowDepth({throughAttr:{dependencyType:"attributeComponent",attributeName:"through",variableNames:["nPoints"]}}),definition:function({dependencyValues:ns}){return ns.throughAttr===null?{setValue:{nPointsPrescribed:0}}:{setValue:{nPointsPrescribed:ns.throughAttr.stateValues.nPoints}}}},rs.basedOnSlope={returnDependencies:()=>({slopeAttr:{dependencyType:"attributeComponent",attributeName:"slope"},nPointsPrescribed:{dependencyType:"stateVariable",variableName:"nPointsPrescribed"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),definition({dependencyValues:ns}){return{setValue:{basedOnSlope:ns.nPointsPrescribed<2&&ns.slopeAttr!==null&&ns.nDimensions===2}}}},rs.dForSlope={defaultValue:1,hasEssential:!0,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{dForSlope:!0}}),inverseDefinition({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setEssentialValue:"dForSlope",value:ns.dForSlope}]}}},rs.variables={isArray:!0,public:!0,shadowingInstructions:{createComponentOfType:"variable"},entryPrefixes:["var"],returnArraySizeDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[ns.nDimensions]},returnArrayDependenciesByKey(){return{globalDependencies:{variables:{dependencyType:"attributeComponent",attributeName:"variables",variableNames:["variables"]}}}},arrayDefinitionByKey({globalDependencyValues:ns,arraySize:ss}){let os=[];return ns.variables!==null&&(os=ns.variables.stateValues.variables),{setValue:{variables:returnNVariables(ss[0],os)}}}},rs.equationIdentity={returnDependencies:()=>({equation:{dependencyType:"attributeComponent",attributeName:"equation"}}),definition:function({dependencyValues:ns}){return ns.equation!==null?{setValue:{equationIdentity:ns.equation}}:{setValue:{equationIdentity:null}}}},rs.essentialPoints={isArray:!0,nDimensions:"2",hasEssential:!0,entryPrefixes:["essentialPointX","essentialPoint"],set:convertValueToMathExpression,defaultValueByArrayKey:ns=>Context.fromAst(ns==="0,0"?1:0),getArrayKeysFromVarName({arrayEntryPrefix:ns,varEnding:ss,arraySize:os}){if(ns==="essentialPointX"){let ls=ss.split("_").map(us=>Number(us)-1);return ls.length===2&&ls.every((us,cs)=>Number.isInteger(us)&&us>=0)?os?ls.every((us,cs)=>us=0?os?lsls+","+cs):[]:[ls+",0"]:[]}},returnArraySizeDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[2,ns.nDimensions]},returnArrayDependenciesByKey:()=>({}),arrayDefinitionByKey({arrayKeys:ns}){let ss={};for(let os of ns)ss[os]=!0;return{useEssentialOrDefaultValue:{essentialPoints:ss}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns}){let ss=[];for(let os in ns.essentialPoints)ss.push({setEssentialValue:"essentialPoints",value:{[os]:convertValueToMathExpression(ns.essentialPoints[os])}});return{success:!0,instructions:ss}}},rs.points={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"],returnWrappingComponents(ns){return ns==="pointX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,nDimensions:2,entryPrefixes:["pointX","point"],getArrayKeysFromVarName({arrayEntryPrefix:ns,varEnding:ss,arraySize:os}){if(ns==="pointX"){let ls=ss.split("_").map(us=>Number(us)-1);return ls.length===2&&ls.every((us,cs)=>Number.isInteger(us)&&us>=0)?os?ls.every((us,cs)=>us=0?os?lsls+","+cs):[]:[ls+",0"]:[]}},arrayVarNameFromPropIndex(ns,ss){if(ss==="points")return ns.length===1?"point"+ns[0]:`pointX${ns[0]}_${ns[1]}`;if(ss.slice(0,5)==="point"){let os=Number(ss.slice(5));if(Number.isInteger(os)&&os>0)return`pointX${os}_${ns[0]}`}return null},stateVariablesDeterminingDependencies:["equationIdentity","nPointsPrescribed","basedOnSlope"],returnArraySizeDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[2,ns.nDimensions]},returnArrayDependenciesByKey({stateValues:ns,arrayKeys:ss}){if(ns.equationIdentity===null){let os={};for(let us of ss){let[cs,ds]=us.split(","),ps=Number(cs)+1+"_"+(Number(ds)+1);os[us]={through:{dependencyType:"attributeComponent",attributeName:"through",variableNames:["pointX"+ps]}},ns.basedOnSlope?(cs==="1"&&(ns.nPointsPrescribed===1&&os[us].through.variableNames.push("pointX1_"+(Number(ds)+1)),os[us].dForSlope={dependencyType:"stateVariable",variableName:"dForSlope"},os[us].slopeAttr={dependencyType:"attributeComponent",attributeName:"slope",variableNames:["value"]}),ns.nPointsPrescribed===0&&(os[us].essentialPoint={dependencyType:"stateVariable",variableName:"essentialPointX2_"+(Number(ds)+1)})):os[us].essentialPoint={dependencyType:"stateVariable",variableName:"essentialPointX"+ps}}return{dependenciesByKey:os,globalDependencies:{nPointsPrescribed:{dependencyType:"stateVariable",variableName:"nPointsPrescribed"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},basedOnSlope:{dependencyType:"stateVariable",variableName:"basedOnSlope"}}}}else return{globalDependencies:{coeff0:{dependencyType:"stateVariable",variableName:"coeff0"},coeffvar1:{dependencyType:"stateVariable",variableName:"coeffvar1"},coeffvar2:{dependencyType:"stateVariable",variableName:"coeffvar2"},variables:{dependencyType:"stateVariable",variableName:"variables"},lastPointsFromInverting:{dependencyType:"stateVariable",variableName:"lastPointsFromInverting"}}}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os,arraySize:ls,componentName:us}){if("coeff0"in ns){let cs=calculatePointsFromCoeffs(ns);if(cs.success)return{setValue:{points:cs.points}};{let ds={};for(let ps=0;psvs.toString())];for(let vs=0;vs({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return Number.isNaN(ns.nDimensions)?[0]:[2]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}},os={};for(let ls of ns)os[ls]={point:{dependencyType:"stateVariable",variableName:"point"+(Number(ls)+1)}};return{globalDependencies:ss,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os,componentName:ls}){if(Number.isNaN(ns.nDimensions))return{};let us={};for(let cs of os){let ds=ss[cs].point;Array.isArray(ds)||(ds=[ds]);let ps=[];for(let fs=0;fs({coeff0:{dependencyType:"stateVariable",variableName:"coeff0"},coeffvar1:{dependencyType:"stateVariable",variableName:"coeffvar1"},coeffvar2:{dependencyType:"stateVariable",variableName:"coeffvar2"}}),definition:function({dependencyValues:ns}){let ss=ns.coeff0.evaluate_to_constant(),os=ns.coeffvar1.evaluate_to_constant(),ls=ns.coeffvar2.evaluate_to_constant();return{setValue:{numericalCoeff0:ss,numericalCoeffvar1:os,numericalCoeffvar2:ls}}}},rs.slope={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},returnDependencies:()=>({coeffvar1:{dependencyType:"stateVariable",variableName:"coeffvar1"},coeffvar2:{dependencyType:"stateVariable",variableName:"coeffvar2"}}),definition:function({dependencyValues:ns}){return{setValue:{slope:Context.fromAst(["-",["/","a","b"]]).substitute({a:ns.coeffvar1,b:ns.coeffvar2}).simplify()}}}},rs.xintercept={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},returnDependencies:()=>({coeff0:{dependencyType:"stateVariable",variableName:"coeff0"},coeffvar1:{dependencyType:"stateVariable",variableName:"coeffvar1"}}),definition:({dependencyValues:ns})=>({setValue:{xintercept:Context.fromAst(["-",["/","a","b"]]).substitute({a:ns.coeff0,b:ns.coeffvar1}).simplify()}})},rs.yintercept={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},returnDependencies:()=>({coeff0:{dependencyType:"stateVariable",variableName:"coeff0"},coeffvar2:{dependencyType:"stateVariable",variableName:"coeffvar2"}}),definition:({dependencyValues:ns})=>({setValue:{yintercept:Context.fromAst(["-",["/","a","b"]]).substitute({a:ns.coeff0,b:ns.coeffvar2}).simplify()}})},rs.lastPointsFromInverting={defaultValue:null,hasEssential:!0,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{lastPointsFromInverting:!0}}),inverseDefinition:({desiredStateVariableValues:ns})=>({success:!0,instructions:[{setEssentialValue:"lastPointsFromInverting",value:ns.lastPointsFromInverting}]})},rs.latex={forRenderer:!0,public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({equation:{dependencyType:"stateVariable",variableName:"equation"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"},padZeros:{dependencyType:"stateVariable",variableName:"padZeros"}}),definition:function({dependencyValues:ns,usedDefault:ss}){let os={};return ns.padZeros&&(ss.displayDigits&&!ss.displayDecimals?Number.isFinite(ns.displayDecimals)&&(os.padToDecimals=ns.displayDecimals):ns.displayDigits>=1&&(os.padToDigits=ns.displayDigits)),{setValue:{latex:roundForDisplay({value:ns.equation,dependencyValues:ns,usedDefault:ss}).toLatex(os)}}}},rs.nearestPoint={returnDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},numericalCoeff0:{dependencyType:"stateVariable",variableName:"numericalCoeff0"},numericalCoeffvar1:{dependencyType:"stateVariable",variableName:"numericalCoeffvar1"},numericalCoeffvar2:{dependencyType:"stateVariable",variableName:"numericalCoeffvar2"}}),definition({dependencyValues:ns}){let ss=ns.numericalCoeffvar1,os=ns.numericalCoeffvar2,ls=ns.numericalCoeff0,us=Number.isFinite(ss)&&Number.isFinite(os)&&Number.isFinite(ls),cs=ns.nDimensions!==2||!us||ss===0&&os===0;return{setValue:{nearestPoint:function({variables:ds,scales:ps=[1,1]}){var Ns,As;if(cs)return{};let fs=ps[0],hs=ps[1],gs=ss*fs,ys=os*hs,bs=gs*gs+ys*ys,vs=(Ns=ds.x1)==null?void 0:Ns.evaluate_to_constant(),xs=(As=ds.x2)==null?void 0:As.evaluate_to_constant();if(!(Number.isFinite(vs)&&Number.isFinite(xs)))return{};let Cs=vs/fs,Ts=xs/hs,Ss={};return Ss.x1=(ys*(ys*Cs-gs*Ts)-gs*ls)*fs/bs,Ss.x2=(gs*(-ys*Cs+gs*Ts)-ys*ls)*hs/bs,ds.x3!==void 0&&(Ss.x3=0),Ss}}}}},rs}async moveLine({point1coords:rs,point2coords:ns,transient:ss,actionId:os,sourceInformation:ls={},skipRendererUpdate:us=!1}){let cs={"0,0":Context.fromAst(rs[0]),"0,1":Context.fromAst(rs[1])};return await this.stateValues.basedOnSlope||(cs["1,0"]=Context.fromAst(ns[0]),cs["1,1"]=Context.fromAst(ns[1])),ss?await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"points",value:cs}],transient:!0,actionId:os,sourceInformation:ls,skipRendererUpdate:us}):await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"points",value:cs}],actionId:os,sourceInformation:ls,skipRendererUpdate:us,event:{verb:"interacted",object:{componentId:this.componentName},result:{point1:rs,point2:ns}}})}switchLine(){}async lineClicked({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){await this.coreFunctions.triggerChainedActions({triggeringAction:"click",componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss}),this.coreFunctions.resolveAction({actionId:rs})}async mouseDownOnLine({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){await this.coreFunctions.triggerChainedActions({triggeringAction:"down",componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss}),this.coreFunctions.resolveAction({actionId:rs})}}zs(Line,"componentType","line"),zs(Line,"adapters",[{stateVariable:"equation",stateVariablesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]}]);function calculateCoeffsFromEquation({equation:as,variables:rs}){let ns=rs[0],ss=rs[1],os=ns.toString(),ls=ss.toString();if(as=as.expand().simplify(),!(Array.isArray(as.tree)&&as.tree[0]==="="&&as.tree.length===3))return{success:!1};let us=Context.fromAst(["+",as.tree[2],["-",as.tree[1]]]).expand().simplify(),cs=[];Array.isArray(us.tree)&&us.tree[0]==="+"?cs=us.tree.slice(1):cs=[us.tree];let ds=Context.fromAst(0),ps=Context.fromAst(0),fs=Context.fromAst(0);for(let gs of cs){let ys=hs(gs);if(!ys.success)return{success:!1};ds=ds.add(ys.coeffvar1),ps=ps.add(ys.coeffvar2),fs=fs.add(ys.coeff0)}return ds=ds.simplify(),ps=ps.simplify(),fs=fs.simplify(),{success:!0,coeff0:fs,coeffvar1:ds,coeffvar2:ps};function hs(gs){let ys=0,bs=0,vs=0;if(typeof gs=="string")gs===os?ys=1:gs===ls?bs=1:vs=gs;else if(typeof gs=="number")vs=gs;else if(Array.isArray(gs)){let xs=gs[0],Cs=gs.slice(1);if(xs==="-"){let Ts=hs(Cs[0]);if(!Ts.success)return{success:!1};ys=["-",Ts.coeffvar1.tree],bs=["-",Ts.coeffvar2.tree],vs=["-",Ts.coeff0.tree]}else{if(xs==="+")return console.warn("Invalid format for equation of line in variables "+ns+" and "+ss),{success:!1};if(xs==="*"){let Ts=-1,Ss=-1;for(let Ns=0;Ns({stable:{dependencyType:"stateVariable",variableName:"stable"}}),definition({dependencyValues:ns}){return{setValue:{dashed:!ns.stable}}},inverseDefinition({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setDependency:"stable",desiredValue:!ns.dashed}]}}},rs}async switchLine({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){if(await this.stateValues.switchable)return await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"stable",value:!this.stateValues.stable}],actionId:rs,sourceInformation:ns,skipRendererUpdate:ss,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{stable:!this.stateValues.stable}}});this.coreFunctions.resolveAction({actionId:rs})}}zs(EquilibriumLine,"componentType","equilibriumLine"),zs(EquilibriumLine,"rendererType","line");class Curve extends GraphicalComponent{constructor(rs){super(rs),Object.assign(this.actions,{moveControlVector:this.moveControlVector.bind(this),moveThroughPoint:this.moveThroughPoint.bind(this),changeVectorControlDirection:this.changeVectorControlDirection.bind(this),switchCurve:this.switchCurve.bind(this),curveClicked:this.curveClicked.bind(this),mouseDownOnCurve:this.mouseDownOnCurve.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.labelPosition={createComponentOfType:"text",createStateVariable:"labelPosition",defaultValue:"upperright",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft","top","bottom","left","right"]},rs.flipFunction={createComponentOfType:"boolean",createStateVariable:"flipFunction",defaultValue:!1,public:!0,forRenderer:!0},rs.nDiscretizationPoints={createComponentOfType:"number",createStateVariable:"nDiscretizationPoints",defaultValue:1e3,public:!0},rs.periodic={createComponentOfType:"boolean",createStateVariable:"periodic",defaultValue:!1,public:!0},rs.splineTension={createComponentOfType:"number",createStateVariable:"splineTension",defaultValue:.8,clamp:[0,1],public:!0},rs.extrapolateBackward={createComponentOfType:"boolean",createStateVariable:"extrapolateBackward",defaultValue:!1,public:!0,forRenderer:!0},rs.extrapolateForward={createComponentOfType:"boolean",createStateVariable:"extrapolateForward",defaultValue:!1,public:!0,forRenderer:!0},rs.splineForm={createComponentOfType:"text",createStateVariable:"splineForm",defaultValue:"centripetal",public:!0,toLowerCase:!0,validValues:["centripetal","uniform"]},rs.variable={createComponentOfType:"variable",createStateVariable:"variableForChild",defaultValue:Context.fromAst("x")},rs.through={createComponentOfType:"_pointListComponent"},rs.parMin={createComponentOfType:"math"},rs.parMax={createComponentOfType:"math"},rs.nearestPointAsCurve={createComponentOfType:"boolean",createStateVariable:"nearestPointAsCurvePrelim",defaultValue:!1},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss,componentInfoObjects:os}){let ls=bs=>os.componentIsSpecifiedType(bs,"label");if(ss.length===0||!ss.every(bs=>{var vs;return typeof bs=="string"||((vs=bs.doenetAttributes)==null?void 0:vs.createdFromMacro)||ls(bs)}))return{success:!1};let us=ss.map(ls),cs=[],ds=[],ps=[];if(us.filter(bs=>bs).length===0)cs=ss;else{if(us[0]){let vs=us.indexOf(!1);vs!==-1&&(ds=ss.slice(0,vs),ss=ss.slice(vs),us=us.slice(vs))}let bs=us.indexOf(!0);bs===-1?cs=ss:(cs=ss.slice(0,bs),ps=ss.slice(bs))}if(cs.length===0)return{success:!1};let gs=returnBreakStringsSugarFunction({childrenToComponentFunction:bs=>({componentType:"function",children:bs}),mustStripOffOuterParentheses:!0})({matchedChildren:cs}),ys=[];return gs.success?ys=gs.newChildren:ys=[{componentType:"function",children:cs}],{success:!0,newChildren:[...ds,...ys,...ps]}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){let rs=super.returnChildGroups();return rs.push({group:"functions",componentTypes:["function"]},{group:"bezierControls",componentTypes:["bezierControls"]}),rs}static returnStateVariableDefinitions({numerics:rs}){let ns=super.returnStateVariableDefinitions({numerics:rs});return ns.styleDescription={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ss}){var us;let os;((us=ss.document)==null?void 0:us.stateValues.theme)==="dark"?os=ss.selectedStyle.lineColorWordDarkMode:os=ss.selectedStyle.lineColorWord;let ls=ss.selectedStyle.lineWidthWord;return ss.selectedStyle.lineStyleWord&&(ls&&(ls+=" "),ls+=ss.selectedStyle.lineStyleWord),ls&&(ls+=" "),ls+=os,{setValue:{styleDescription:ls}}}},ns.styleDescriptionWithNoun={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({styleDescription:{dependencyType:"stateVariable",variableName:"styleDescription"}}),definition:function({dependencyValues:ss}){return{setValue:{styleDescriptionWithNoun:ss.styleDescription+" curve"}}}},ns.curveType={forRenderer:!0,returnDependencies:()=>({functionChildren:{dependencyType:"child",childGroups:["functions"]},through:{dependencyType:"attributeComponent",attributeName:"through"}}),definition({dependencyValues:ss}){let os="function";return ss.through!==null?os="bezier":ss.functionChildren.length>1&&(os="parameterization"),{setValue:{curveType:os}}}},ns.fShadow={defaultValue:null,hasEssential:!0,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{fShadow:!0}})},ns.graphXmin={forRenderer:!0,additionalStateVariablesDefined:[{variableName:"graphXmax",forRenderer:!0},{variableName:"graphYmin",forRenderer:!0},{variableName:"graphYmax",forRenderer:!0}],returnDependencies:()=>({graphAncestor:{dependencyType:"ancestor",componentType:"graph",variableNames:["xmin","xmax","ymin","ymax"]}}),definition({dependencyValues:ss}){return ss.graphAncestor?{setValue:{graphXmin:ss.graphAncestor.stateValues.xmin,graphXmax:ss.graphAncestor.stateValues.xmax,graphYmin:ss.graphAncestor.stateValues.ymin,graphYmax:ss.graphAncestor.stateValues.ymax}}:{setValue:{graphXmin:null,graphXmax:null,graphYmin:null,graphYmax:null}}}},ns.parMax={public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies:()=>({curveType:{dependencyType:"stateVariable",variableName:"curveType"},parMaxAttr:{dependencyType:"attributeComponent",attributeName:"parMax",variableNames:["value"]},nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"},extrapolateForward:{dependencyType:"stateVariable",variableName:"extrapolateForward"},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["domain"]},adapterSourceDomain:{dependencyType:"adapterSourceStateVariable",variableName:"domain"},graphXmin:{dependencyType:"stateVariable",variableName:"graphXmin"},graphXmax:{dependencyType:"stateVariable",variableName:"graphXmax"},graphYmin:{dependencyType:"stateVariable",variableName:"graphYmin"},graphYmax:{dependencyType:"stateVariable",variableName:"graphYmax"},flipFunction:{dependencyType:"stateVariable",variableName:"flipFunction"}}),definition:function({dependencyValues:ss}){let os;if(ss.curveType==="bezier")os=ss.nThroughPoints-1,ss.extrapolateForward&&(os*=2);else if(ss.parMaxAttr!==null)os=ss.parMaxAttr.stateValues.value.evaluate_to_constant();else if(ss.curveType==="function"){let ls=null;ss.functionChild.length===1?ls=ss.functionChild[0].stateValues.domain:ls=ss.adapterSourceDomain,ls!==null&&(ls=ls[0],os=Context.fromAst(ls.tree[1][2]).evaluate_to_constant());let us,cs;ss.flipFunction?(cs=ss.graphYmax,us=ss.graphYmin):(cs=ss.graphXmax,us=ss.graphXmin),cs!==null&&us!==null&&(os===void 0?os=cs+.1*(cs-us):os=Math.min(os,cs+.1*(cs-us))),os===void 0&&(os=1/0)}else os=10;return{setValue:{parMax:os}}}},ns.parMin={forRenderer:!0,public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({curveType:{dependencyType:"stateVariable",variableName:"curveType"},parMinAttr:{dependencyType:"attributeComponent",attributeName:"parMin",variableNames:["value"]},nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"},extrapolateBackward:{dependencyType:"stateVariable",variableName:"extrapolateBackward"},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["domain"]},adapterSourceDomain:{dependencyType:"adapterSourceStateVariable",variableName:"domain"},graphXmin:{dependencyType:"stateVariable",variableName:"graphXmin"},graphXmax:{dependencyType:"stateVariable",variableName:"graphXmax"},graphYmin:{dependencyType:"stateVariable",variableName:"graphYmin"},graphYmax:{dependencyType:"stateVariable",variableName:"graphYmax"},flipFunction:{dependencyType:"stateVariable",variableName:"flipFunction"}}),definition:function({dependencyValues:ss}){let os;if(ss.curveType==="bezier")os=0,ss.extrapolateBackward&&(os=-(ss.nThroughPoints-1));else if(ss.parMinAttr!==null)os=ss.parMinAttr.stateValues.value.evaluate_to_constant();else if(ss.curveType==="function"){let ls=null;ss.functionChild.length===1?ls=ss.functionChild[0].stateValues.domain:ls=ss.adapterSourceDomain,ls!==null&&(ls=ls[0],os=Context.fromAst(ls.tree[1][1]).evaluate_to_constant());let us,cs;ss.flipFunction?(cs=ss.graphYmax,us=ss.graphYmin):(cs=ss.graphXmax,us=ss.graphXmin),cs!==null&&us!==null&&(os===void 0?os=us+.1*(us-cs):os=Math.max(os,us+.1*(us-cs))),os===void 0&&(os=-1/0)}else os=-10;return{setValue:{parMin:os}}}},ns.domainForFunctions={returnDependencies:()=>({parMin:{dependencyType:"stateVariable",variableName:"parMin"},parMax:{dependencyType:"stateVariable",variableName:"parMax"}}),definition({dependencyValues:ss}){return{setValue:{domainForFunctions:[Context.fromAst(["interval",["tuple",ss.parMin,ss.parMax],["tuple",!0,!0]])]}}}},ns.nThroughPoints={returnDependencies:()=>({through:{dependencyType:"attributeComponent",attributeName:"through",variableNames:["nPoints"]}}),definition({dependencyValues:ss}){let os=0;return ss.through!==null&&(os=ss.through.stateValues.nPoints),{setValue:{nThroughPoints:os}}}},ns.nDimensions={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies(){return{through:{dependencyType:"attributeComponent",attributeName:"through",variableNames:["nDimensions"]}}},definition:function({dependencyValues:ss}){return ss.through!==null?{setValue:{nDimensions:ss.through.stateValues.nDimensions},checkForActualChange:{nDimensions:!0}}:{setValue:{nDimensions:2}}}},ns.throughPoints={public:!0,shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(ss){return ss==="throughPointX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,nDimensions:2,entryPrefixes:["throughPointX","throughPoint"],getArrayKeysFromVarName({arrayEntryPrefix:ss,varEnding:os,arraySize:ls}){if(ss==="throughPointX"){let us=os.split("_").map(cs=>Number(cs)-1);return us.length===2&&us.every((cs,ds)=>Number.isInteger(cs)&&cs>=0)?ls?us.every((cs,ds)=>cs=0?ls?usus+","+ds):[]:[us+",0"]:[]}},arrayVarNameFromPropIndex(ss,os){if(os==="throughPoints")return ss.length===1?"throughPoint"+ss[0]:`throughPointX${ss[0]}_${ss[1]}`;if(os.slice(0,12)==="throughPoint"){let ls=Number(os.slice(12));if(Number.isInteger(ls)&&ls>0)return`throughPointX${ls}_${ss[0]}`}return null},returnArraySizeDependencies:()=>({nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ss}){return[ss.nThroughPoints,ss.nDimensions]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={};for(let ls of ss){let[us,cs]=ls.split(","),ds=Number(us)+1+"_"+(Number(cs)+1);os[ls]={through:{dependencyType:"attributeComponent",attributeName:"through",variableNames:["pointX"+ds]}}}return{dependenciesByKey:os}},arrayDefinitionByKey({dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let[cs,ds]=us.split(","),ps=Number(cs)+1+"_"+(Number(ds)+1),fs=ss[us].through;fs!==null&&fs.stateValues["pointX"+ps]?ls[us]=fs.stateValues["pointX"+ps]:ls[us]=Context.fromAst(0)}return{setValue:{throughPoints:ls}}},async inverseArrayDefinitionByKey({desiredStateVariableValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,initialChange:us,stateValues:cs}){if(us&&!await cs.draggable)return{success:!1};let ds=[];for(let ps in ss.throughPoints){let[fs,hs]=ps.split(","),gs=Number(fs)+1+"_"+(Number(hs)+1);if(os[ps].through!==null&&os[ps].through.stateValues["pointX"+gs])ds.push({setDependency:ls[ps].through,desiredValue:ss.throughPoints[ps],childIndex:0,variableIndex:0});else return{success:!1}}return{success:!0,instructions:ds}}},ns.numericalThroughPoints={isArray:!0,entryPrefixes:["numericalThroughPoint"],forRenderer:!0,returnArraySizeDependencies:()=>({nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"}}),returnArraySize({dependencyValues:ss}){return[ss.nThroughPoints]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={};for(let ls of ss)os[ls]={throughPoint:{dependencyType:"stateVariable",variableName:"throughPoint"+(Number(ls)+1)}};return{dependenciesByKey:os}},arrayDefinitionByKey({dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=ss[us].throughPoint.map(ds=>ds.evaluate_to_constant());cs.every(ds=>Number.isFinite(ds))||(cs=Array(cs.length).fill(NaN)),ls[us]=cs}return{setValue:{numericalThroughPoints:ls}}}},ns.haveBezierControls={forRenderer:!0,returnDependencies:()=>({controlChild:{dependencyType:"child",childGroups:["bezierControls"]}}),definition({dependencyValues:ss}){return{setValue:{haveBezierControls:ss.controlChild.length>0}}}},ns.bezierControlsAlwaysVisible={forRenderer:!0,returnDependencies:()=>({controlChild:{dependencyType:"child",childGroups:["bezierControls"],variableNames:["alwaysVisible"]}}),definition({dependencyValues:ss}){return{setValue:{bezierControlsAlwaysVisible:ss.controlChild.length>0&&ss.controlChild[0].stateValues.alwaysVisible}}}},ns.vectorControlDirections={public:!0,shadowingInstructions:{createComponentOfType:"text"},isArray:!0,entryPrefixes:["vectorControlDirection"],forRenderer:!0,returnArraySizeDependencies:()=>({nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"}}),returnArraySize({dependencyValues:ss}){return[ss.nThroughPoints]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={};for(let us of ss)os[us]={controlChild:{dependencyType:"child",childGroups:["bezierControls"],variableNames:["direction"+(Number(us)+1)]}};return{dependenciesByKey:os,globalDependencies:{haveBezierControls:{dependencyType:"stateVariable",variableName:"haveBezierControls"}}}},arrayDefinitionByKey({dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=ss[us].controlChild;cs&&cs.length>0?ls[us]=cs[0].stateValues["direction"+(Number(us)+1)]:ls[us]="none"}return{setValue:{vectorControlDirections:ls}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ss,dependencyNamesByKey:os,dependencyValuesByKey:ls,globalDependencyValues:us}){if(!us.haveBezierControls)return{success:!1};let cs=[];for(let ds in ss.vectorControlDirections){let ps=ls[ds].controlChild;ps&&ps.length>0&&cs.push({setDependency:os[ds].controlChild,desiredValue:ss.vectorControlDirections[ds],childIndex:0,variableIndex:0})}return{success:!0,instructions:cs}}},ns.hiddenControls={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},isArray:!0,entryPrefixes:["hiddenControl"],forRenderer:!0,returnArraySizeDependencies:()=>({nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"}}),returnArraySize({dependencyValues:ss}){return[ss.nThroughPoints]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={};for(let us of ss)os[us]={controlChild:{dependencyType:"child",childGroups:["bezierControls"],variableNames:["hiddenControl"+(Number(us)+1)]}};return{dependenciesByKey:os,globalDependencies:{haveBezierControls:{dependencyType:"stateVariable",variableName:"haveBezierControls"}}}},arrayDefinitionByKey({dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=ss[us].controlChild;cs&&cs.length>0?ls[us]=cs[0].stateValues["hiddenControl"+(Number(us)+1)]:ls[us]=!1}return{setValue:{hiddenControls:ls}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ss,dependencyNamesByKey:os,dependencyValuesByKey:ls,globalDependencyValues:us}){if(!us.haveBezierControls)return{success:!1};let cs=[];for(let ds in ss.hiddenControls){let ps=ls[ds].controlChild;ps&&ps.length>0&&cs.push({setDependency:os[ds].controlChild,desiredValue:ss.hiddenControls[ds],childIndex:0,variableIndex:0})}return{success:!0,instructions:cs}}},ns.controlVectors={isArray:!0,public:!0,shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(ss){return ss==="controlVectorX"?[]:[["vector",{componentType:"mathList",isAttribute:"xs"}]]}},entryPrefixes:["controlVectorX","controlVector"],nDimensions:3,stateVariablesDeterminingDependencies:["vectorControlDirections","nThroughPoints"],getArrayKeysFromVarName({arrayEntryPrefix:ss,varEnding:os,arraySize:ls}){if(ss==="controlVectorX"){let us=os.split("_").map(cs=>Number(cs)-1);return us.length===3&&us.every((cs,ds)=>Number.isInteger(cs)&&cs>=0)?ls?us.every((cs,ds)=>csNumber(cs)-1);return us.length===2&&us.every(cs=>Number.isInteger(cs)&&cs>=0)?ls?us.every((cs,ds)=>csString(us)+","+ds):[]:[String(us)+",0"]:[]}},returnArraySizeDependencies:()=>({nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ss}){return[ss.nThroughPoints,2,ss.nDimensions]},returnArrayDependenciesByKey({arrayKeys:ss,stateValues:os}){let ls={haveBezierControls:{dependencyType:"stateVariable",variableName:"haveBezierControls"},nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},splineTension:{dependencyType:"stateVariable",variableName:"splineTension"},splineForm:{dependencyType:"stateVariable",variableName:"splineForm"}},us={};for(let cs of ss){let ds=cs.split(",").map(bs=>Number(bs)),ps=ds.map(bs=>bs+1),fs=ps.join("_");us[cs]={direction:{dependencyType:"stateVariable",variableName:"vectorControlDirection"+ps[0]},controlChild:{dependencyType:"child",childGroups:["bezierControls"],variableNames:["control"+fs]}};let hs=ds[0],gs=os.vectorControlDirections[hs],ys=[];gs==="none"?ys=[hs-1,hs,hs+1]:gs==="previous"?ys=[hs,hs+1]:gs==="next"&&(ys=[hs-1,hs]);for(let bs of ys)bs>=0&&bsNumber(bs)),fs=ds.map(bs=>bs+1).join("_"),hs=ds[0],gs=ds[1],ys=os[cs].direction;if(ys==="none"){let bs=os[cs]["throughPoint"+(hs+1)],vs,xs;hs>0&&(vs=os[cs]["throughPoint"+hs]),hsNumber(ys)).map(ys=>ys+1).join("_"),gs=ls[ds].controlChild;gs.length>0&&gs[0].stateValues["control"+hs]&&cs.push({setDependency:os[ds].controlChild,desiredValue:ss.controlVectors[ds],childIndex:0,variableIndex:0})}return{success:!0,instructions:cs}}},ns.numericalControlVectors={isArray:!0,entryPrefixes:["numericalControlVector"],forRenderer:!0,nDimensions:2,returnArraySizeDependencies:()=>({nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"}}),returnArraySize({dependencyValues:ss}){return[ss.nThroughPoints,2]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={};for(let ls of ss){let ds=ls.split(",").map(ps=>Number(ps)).map(ps=>ps+1).join("_");os[ls]={controlVector:{dependencyType:"stateVariable",variableName:"controlVector"+ds}}}return{dependenciesByKey:os}},arrayDefinitionByKey({dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=ss[us].controlVector.map(ds=>ds.tree);ls[us]=cs}return{setValue:{numericalControlVectors:ls}}}},ns.controlPoints={isArray:!0,public:!0,shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(ss){return ss==="controlPointX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},entryPrefixes:["controlPointX","controlPoint"],nDimensions:3,getArrayKeysFromVarName({arrayEntryPrefix:ss,varEnding:os,arraySize:ls}){if(ss==="controlPointX"){let us=os.split("_").map(cs=>Number(cs)-1);return us.length===3&&us.every((cs,ds)=>Number.isInteger(cs)&&cs>=0)?ls?us.every((cs,ds)=>csNumber(cs)-1);return us.length===2&&us.every(cs=>Number.isInteger(cs)&&cs>=0)?ls?us.every((cs,ds)=>csString(us)+","+ds):[]:[String(us)+",0"]:[]}},returnArraySizeDependencies:()=>({nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ss}){return[ss.nThroughPoints,2,ss.nDimensions]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={haveBezierControls:{dependencyType:"stateVariable",variableName:"haveBezierControls"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}},ls={};for(let us of ss){let ds=us.split(",").map(fs=>Number(fs)).map(fs=>fs+1),ps=ds.join("_");ls[us]={throughPointX:{dependencyType:"stateVariable",variableName:"throughPointX"+ds[0]+"_"+ds[2]},controlVectorX:{dependencyType:"stateVariable",variableName:"controlVectorX"+ps}}}return{globalDependencies:os,dependenciesByKey:ls}},arrayDefinitionByKey({globalDependencyValues:ss,dependencyValuesByKey:os,arrayKeys:ls}){let us={};for(let cs of ls)if(ss.nDimensions!==2)us[cs]=Context.fromAst(NaN);else{let ds=os[cs].controlVectorX;if(ds){let ps=os[cs].throughPointX.evaluate_to_constant();us[cs]=Context.fromAst(ps+ds.tree)}else us[cs]=null}return{setValue:{controlPoints:us}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ss,dependencyNamesByKey:os,dependencyValuesByKey:ls,globalDependencyValues:us}){if(!us.haveBezierControls||us.nDimensions!==2)return{success:!1};let cs=[];for(let ds in ss.controlPoints)if(ls[ds].controlVectorX){let fs=ls[ds].throughPointX,hs=ss.controlPoints[ds];hs.tree&&(hs=hs.tree);let gs=Context.fromAst(["+",hs,["-",fs.tree]]);cs.push({setDependency:os[ds].controlVectorX,desiredValue:gs})}return{success:!0,instructions:cs}}},ns.numericalControlPoints={isArray:!0,entryPrefixes:["numericalControlPoint"],forRenderer:!0,nDimensions:2,returnArraySizeDependencies:()=>({nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"}}),returnArraySize({dependencyValues:ss}){return[ss.nThroughPoints,2]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={};for(let ls of ss){let ds=ls.split(",").map(ps=>Number(ps)).map(ps=>ps+1).join("_");os[ls]={controlPoint:{dependencyType:"stateVariable",variableName:"controlPoint"+ds}}}return{dependenciesByKey:os}},arrayDefinitionByKey({dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=ss[us].controlPoint.map(ds=>ds.tree);ls[us]=cs}return{setValue:{numericalControlPoints:ls}}}},ns.splineCoeffs={isArray:!0,returnArraySizeDependencies:()=>({nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"}}),returnArraySize({dependencyValues:ss}){return[ss.nThroughPoints-1]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={};for(let ls of ss){let us=Number(ls)+1,cs=us+1;os[ls]={previousPoint:{dependencyType:"stateVariable",variableName:"numericalThroughPoint"+us},nextPoint:{dependencyType:"stateVariable",variableName:"numericalThroughPoint"+cs},previousVector:{dependencyType:"stateVariable",variableName:"numericalControlVector"+us+"_2"},nextVector:{dependencyType:"stateVariable",variableName:"numericalControlVector"+cs+"_1"}}}return{dependenciesByKey:os}},arrayDefinitionByKey({dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=ss[us].previousPoint,ds=ss[us].nextPoint,ps=ss[us].previousVector,fs=ss[us].nextVector,hs=[];for(let gs=0;gs<2;gs++)hs.push(initCubicPoly(cs[gs],ds[gs],3*ps[gs],-3*fs[gs]));ls[us]=hs}return{setValue:{splineCoeffs:ls}}}},ns.extrapolateBackwardCoeffs={stateVariablesDeterminingDependencies:["extrapolateBackward"],additionalStateVariablesDefined:[{variableName:"extrapolateBackwardMode",public:!0,shadowingInstructions:{createComponentOfType:"text"}}],returnDependencies({stateValues:ss}){let os={extrapolateBackward:{dependencyType:"stateVariable",variableName:"extrapolateBackward"},nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"}};return ss.extrapolateBackward&&(os.firstSplineCoeffs={dependencyType:"stateVariable",variableName:"splineCoeffs1"},os.graphXmin={dependencyType:"stateVariable",variableName:"graphXmin"},os.graphXmax={dependencyType:"stateVariable",variableName:"graphXmax"},os.graphYmin={dependencyType:"stateVariable",variableName:"graphYmin"},os.graphYmax={dependencyType:"stateVariable",variableName:"graphYmax"}),os},definition({dependencyValues:ss}){if(!ss.extrapolateBackward||!ss.firstSplineCoeffs)return{setValue:{extrapolateBackwardCoeffs:null,extrapolateBackwardMode:""}};let os=ss.firstSplineCoeffs[0],ls=ss.firstSplineCoeffs[1],us=os[0],cs=os[1],ds=2*os[2],ps=ls[0],fs=ls[1],hs=2*ls[2],gs=cs*cs+fs*fs,ys=(fs*ds-cs*hs)/(gs*gs);if(Math.abs(ys)<1e-12||Math.abs(cs)<1e-12||Math.abs(fs)<1e-12){let xs=cs,Cs=fs;if(ss.graphXmin!==null&&ss.graphXmax!==null&&ss.graphYmin!==null&&ss.graphYmax!==null){let Ss=ss.graphXmax-ss.graphXmin,Ns=ss.graphYmax-ss.graphYmin,As=ss.nThroughPoints-1,ws=Ss/As/Math.abs(xs),Es=Ns/As/Math.abs(Cs),_s=Math.min(ws,Es);_s>1&&(xs*=_s,Cs*=_s)}return{setValue:{extrapolateBackwardCoeffs:[[us,xs,0],[ps,Cs,0]],extrapolateBackwardMode:"line"}}}let bs=fs*ys,vs=-cs*ys;if(bs*cs>0){let xs=bs/vs,Cs=(1+xs*xs)**2,Ts=cs;if(ss.graphXmin!==null&&ss.graphXmax!==null&&ss.graphYmin!==null&&ss.graphYmax!==null){let ws=ss.graphXmax-ss.graphXmin,Es=ss.graphYmax-ss.graphYmin,_s=ss.nThroughPoints-1,$s=ws/_s,Rs=1/0;if(vs!==0){let Os=vs*Cs/2*_s*_s,Is=-xs*_s,Vs=Math.sqrt(Is*Is+4*Math.abs(Os)*Es);Rs=(Math.abs(Is)+Vs)/(2*Math.abs(Os))}let Ds=Math.min($s,Rs);Ds>Math.abs(Ts)&&(Ts*=Ds/Math.abs(Ts))}let Ss=-Ts*xs,Ns=vs*Ts*Ts*Cs;return{setValue:{extrapolateBackwardCoeffs:[[us,Ts,0],[ps,Ss,Ns/2]],extrapolateBackwardMode:"parabolaVertical"}}}else{let xs=vs/bs,Cs=(1+xs*xs)**2,Ts=fs;if(ss.graphXmin!==null&&ss.graphXmax!==null&&ss.graphYmin!==null&&ss.graphYmax!==null){let ws=ss.graphXmax-ss.graphXmin,Es=ss.graphYmax-ss.graphYmin,_s=ss.nThroughPoints-1,$s=Es/_s,Rs=1/0;if(bs!==0){let Os=bs*Cs/2*_s*_s,Is=-xs*_s,Vs=Math.sqrt(Is*Is+4*Math.abs(Os)*ws);Rs=(Math.abs(Is)+Vs)/(2*Math.abs(Os))}let Ds=Math.min(Rs,$s);Ds>Math.abs(Ts)&&(Ts*=Ds/Math.abs(Ts))}let Ss=-Ts*xs,Ns=bs*Ts*Ts*Cs;return{setValue:{extrapolateBackwardCoeffs:[[us,Ss,Ns/2],[ps,Ts,0]],extrapolateBackwardMode:"parabolaHorizontal"}}}}},ns.extrapolateForwardCoeffs={stateVariablesDeterminingDependencies:["nThroughPoints","extrapolateForward"],additionalStateVariablesDefined:[{variableName:"extrapolateForwardMode",public:!0,shadowingInstructions:{createComponentOfType:"text"}}],returnDependencies({stateValues:ss}){let os={extrapolateForward:{dependencyType:"stateVariable",variableName:"extrapolateForward"},nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"}};return ss.extrapolateForward&&ss.nThroughPoints>=2&&(os.lastSplineCoeffs={dependencyType:"stateVariable",variableName:"splineCoeffs"+(ss.nThroughPoints-1)},os.graphXmin={dependencyType:"stateVariable",variableName:"graphXmin"},os.graphXmax={dependencyType:"stateVariable",variableName:"graphXmax"},os.graphYmin={dependencyType:"stateVariable",variableName:"graphYmin"},os.graphYmax={dependencyType:"stateVariable",variableName:"graphYmax"}),os},definition({dependencyValues:ss}){if(!ss.extrapolateForward||!ss.lastSplineCoeffs)return{setValue:{extrapolateForwardCoeffs:null,extrapolateForwardMode:""}};let os=ss.lastSplineCoeffs[0],ls=ss.lastSplineCoeffs[1],us=os[0]+os[1]+os[2]+os[3],cs=os[1]+2*os[2]+3*os[3],ds=2*os[2]+6*os[3],ps=ls[0]+ls[1]+ls[2]+ls[3],fs=ls[1]+2*ls[2]+3*ls[3],hs=2*ls[2]+6*ls[3],gs=cs*cs+fs*fs,ys=(fs*ds-cs*hs)/(gs*gs);if(Math.abs(ys)<1e-12||Math.abs(cs)<1e-12||Math.abs(fs)<1e-12){let xs=cs,Cs=fs;if(ss.graphXmin!==null&&ss.graphXmax!==null&&ss.graphYmin!==null&&ss.graphYmax!==null){let Ss=ss.graphXmax-ss.graphXmin,Ns=ss.graphYmax-ss.graphYmin,As=ss.nThroughPoints-1,ws=Ss/As/Math.abs(xs),Es=Ns/As/Math.abs(Cs),_s=Math.min(ws,Es);_s>1&&(xs*=_s,Cs*=_s)}return{setValue:{extrapolateForwardCoeffs:[[us,xs,0],[ps,Cs,0]],extrapolateForwardMode:"line"}}}let bs=fs*ys,vs=-cs*ys;if(bs*cs<0){let xs=bs/vs,Cs=(1+xs*xs)**2,Ts=cs;if(ss.graphXmin!==null&&ss.graphXmax!==null&&ss.graphYmin!==null&&ss.graphYmax!==null){let ws=ss.graphXmax-ss.graphXmin,Es=ss.graphYmax-ss.graphYmin,_s=ss.nThroughPoints-1,$s=ws/_s,Rs=1/0;if(vs!==0){let Os=vs*Cs/2*_s*_s,Is=-xs*_s,Vs=Math.sqrt(Is*Is+4*Math.abs(Os)*Es);Rs=(Math.abs(Is)+Vs)/(2*Math.abs(Os))}let Ds=Math.min($s,Rs);Ds>Math.abs(Ts)&&(Ts*=Ds/Math.abs(Ts))}let Ss=-Ts*xs,Ns=vs*Ts*Ts*Cs;return{setValue:{extrapolateForwardCoeffs:[[us,Ts,0],[ps,Ss,Ns/2]],extrapolateForwardMode:"parabolaVertical"}}}else{let xs=vs/bs,Cs=(1+xs*xs)**2,Ts=fs;if(ss.graphXmin!==null&&ss.graphXmax!==null&&ss.graphYmin!==null&&ss.graphYmax!==null){let ws=ss.graphXmax-ss.graphXmin,Es=ss.graphYmax-ss.graphYmin,_s=ss.nThroughPoints-1,$s=Es/_s,Rs=1/0;if(bs!==0){let Os=bs*Cs/2*_s*_s,Is=-xs*_s,Vs=Math.sqrt(Is*Is+4*Math.abs(Os)*ws);Rs=(Math.abs(Is)+Vs)/(2*Math.abs(Os))}let Ds=Math.min(Rs,$s);Ds>Math.abs(Ts)&&(Ts*=Ds/Math.abs(Ts))}let Ss=-Ts*xs,Ns=bs*Ts*Ts*Cs;return{setValue:{extrapolateForwardCoeffs:[[us,Ss,Ns/2],[ps,Ts,0]],extrapolateForwardMode:"parabolaHorizontal"}}}}},ns.fs={isArray:!0,entryPrefixes:["f"],additionalStateVariablesDefined:[{variableName:"fDefinitions",isArray:!0,forRenderer:!0,entryPrefixes:["fDefinition"]}],public:!0,shadowingInstructions:{createComponentOfType:"function",addStateVariablesShadowingStateVariables:{fDefinitions:{stateVariableToShadow:"fDefinitions"},domain:{stateVariableToShadow:"domainForFunctions"}}},returnArraySizeDependencies:()=>({functionChildren:{dependencyType:"child",childGroups:["functions"]},curveType:{dependencyType:"stateVariable",variableName:"curveType"}}),returnArraySize({dependencyValues:ss}){return ss.curveType==="bezier"?[2]:[Math.max(1,ss.functionChildren.length)]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={curveType:{dependencyType:"stateVariable",variableName:"curveType"},numericalThroughPoints:{dependencyType:"stateVariable",variableName:"numericalThroughPoints"},splineCoeffs:{dependencyType:"stateVariable",variableName:"splineCoeffs"},nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"},extrapolateBackward:{dependencyType:"stateVariable",variableName:"extrapolateBackward"},extrapolateBackwardCoeffs:{dependencyType:"stateVariable",variableName:"extrapolateBackwardCoeffs"},extrapolateForward:{dependencyType:"stateVariable",variableName:"extrapolateForward"},extrapolateForwardCoeffs:{dependencyType:"stateVariable",variableName:"extrapolateForwardCoeffs"}},ls={};for(let us of ss)ls[us]={functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["numericalf","fDefinition"],childIndices:[us]}},Number(us)===0&&(ls[us].fShadow={dependencyType:"stateVariable",variableName:"fShadow"},ls[us].fDefinitionAdapted={dependencyType:"adapterSourceStateVariable",variableName:"fDefinition"});return{globalDependencies:os,dependenciesByKey:ls}},arrayDefinitionByKey({globalDependencyValues:ss,dependencyValuesByKey:os,arrayKeys:ls}){if(ss.curveType==="bezier"){let ds={functionType:"bezier",nThroughPoints:ss.nThroughPoints,numericalThroughPoints:ss.numericalThroughPoints,splineCoeffs:ss.splineCoeffs,extrapolateForward:ss.extrapolateForward,extrapolateForwardCoeffs:ss.extrapolateForwardCoeffs,extrapolateBackward:ss.extrapolateBackward,extrapolateBackwardCoeffs:ss.extrapolateBackwardCoeffs},ps={},fs={};return ds.component=0,ps[0]=returnBezierFunctions(ds),fs[0]=ds,ds={...ds},ds.component=1,ps[1]=returnBezierFunctions(ds),fs[1]=ds,{setValue:{fs:ps,fDefinitions:fs}}}let us={},cs={};for(let ds of ls){let ps=os[ds].functionChild;ps.length===1?(us[ds]=ps[0].stateValues.numericalf,cs[ds]=ps[0].stateValues.fDefinition):Number(ds)===0&&os[ds].fShadow?(us[ds]=os[ds].fShadow,cs[ds]=os[ds].fDefinitionAdapted):(us[ds]=()=>0,cs[ds]={functionType:"zero"})}return{setValue:{fs:us,fDefinitions:cs}}}},ns.f={isAlias:!0,targetVariableName:"f1"},ns.allXCriticalPoints={returnDependencies:()=>({splineCoeffs:{dependencyType:"stateVariable",variableName:"splineCoeffs"},fs:{dependencyType:"stateVariable",variableName:"fs"},curveType:{dependencyType:"stateVariable",variableName:"curveType"}}),definition({dependencyValues:ss}){let os=[];if(ss.curveType!=="bezier")return{setValue:{allXCriticalPoints:os}};let ls=ss.fs[0],us=ss.fs[1],cs=[],ds=!1;for(let[ps,fs]of ss.splineCoeffs.entries()){let hs=fs[0],gs=3*hs[3],ys=2*hs[2],bs=hs[1];if(Math.abs(gs)<1e-14){let vs=-bs/ys;ds=addTimePointBezier({t:vs,ind:ps,ts:cs,ignoreLeft:ds})}else{let vs=ys*ys-4*gs*bs;if(vs==0){let xs=-ys/(2*gs);ds=addTimePointBezier({t:xs,ind:ps,ts:cs,ignoreLeft:ds})}else if(vs>0){let xs=Math.sqrt(vs),Cs=[(-ys-xs)/(2*gs),(-ys+xs)/(2*gs)];gs<0&&(Cs=[Cs[1],Cs[0]]);let Ts=!1;for(let Ss of Cs)addTimePointBezier({t:Ss,ind:ps,ts:cs,ignoreLeft:ds})&&(Ts=!0);ds=Ts}else ds=!1}}for(let ps of cs)os.push([ls(ps),us(ps)]);return{setValue:{allXCriticalPoints:os}}}},ns.nXCriticalPoints={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({allXCriticalPoints:{dependencyType:"stateVariable",variableName:"allXCriticalPoints"}}),definition({dependencyValues:ss}){return{setValue:{nXCriticalPoints:ss.allXCriticalPoints.length}}}},ns.xCriticalPoints={public:!0,shadowingInstructions:{createComponentOfType:"number",returnWrappingComponents(ss){return ss==="xCriticalPointX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,nDimensions:2,entryPrefixes:["xCriticalPointX","xCriticalPoint"],getArrayKeysFromVarName({arrayEntryPrefix:ss,varEnding:os,arraySize:ls}){if(ss==="xCriticalPointX"){let us=os.split("_").map(cs=>Number(cs)-1);return us.length===2&&us.every((cs,ds)=>Number.isInteger(cs)&&cs>=0)?ls?us.every((cs,ds)=>cs=0?ls?usus+","+ds):[]:[us+",0"]:[]}},arrayVarNameFromPropIndex(ss,os){if(os==="xCriticalPoints")return ss.length===1?"xCriticalPoint"+ss[0]:`xCriticalPointX${ss[0]}_${ss[1]}`;if(os.slice(0,14)==="xCriticalPoint"){let ls=Number(os.slice(14));if(Number.isInteger(ls)&&ls>0)return`xCriticalPointX${ls}_${ss[0]}`}return null},returnArraySizeDependencies:()=>({nXCriticalPoints:{dependencyType:"stateVariable",variableName:"nXCriticalPoints"}}),returnArraySize({dependencyValues:ss}){return[ss.nXCriticalPoints,2]},returnArrayDependenciesByKey(){return{globalDependencies:{allXCriticalPoints:{dependencyType:"stateVariable",variableName:"allXCriticalPoints"}}}},arrayDefinitionByKey({globalDependencyValues:ss}){let os={};for(let ls=0;ls({splineCoeffs:{dependencyType:"stateVariable",variableName:"splineCoeffs"},fs:{dependencyType:"stateVariable",variableName:"fs"},curveType:{dependencyType:"stateVariable",variableName:"curveType"}}),definition({dependencyValues:ss}){let os=[];if(ss.curveType!=="bezier")return{setValue:{allYCriticalPoints:os}};let ls=ss.fs[0],us=ss.fs[1],cs=[],ds=!1;for(let[ps,fs]of ss.splineCoeffs.entries()){let hs=fs[1],gs=3*hs[3],ys=2*hs[2],bs=hs[1];if(Math.abs(gs)<1e-14){let vs=-bs/ys;ds=addTimePointBezier({t:vs,ind:ps,ts:cs,ignoreLeft:ds})}else{let vs=ys*ys-4*gs*bs;if(vs==0){let xs=-ys/(2*gs);ds=addTimePointBezier({t:xs,ind:ps,ts:cs,ignoreLeft:ds})}else if(vs>0){let xs=Math.sqrt(vs),Cs=[(-ys-xs)/(2*gs),(-ys+xs)/(2*gs)];gs<0&&(Cs=[Cs[1],Cs[0]]);let Ts=!1;for(let Ss of Cs)addTimePointBezier({t:Ss,ind:ps,ts:cs,ignoreLeft:ds})&&(Ts=!0);ds=Ts}else ds=!1}}for(let ps of cs)os.push([ls(ps),us(ps)]);return{setValue:{allYCriticalPoints:os}}}},ns.nYCriticalPoints={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({allYCriticalPoints:{dependencyType:"stateVariable",variableName:"allYCriticalPoints"}}),definition({dependencyValues:ss}){return{setValue:{nYCriticalPoints:ss.allYCriticalPoints.length}}}},ns.yCriticalPoints={public:!0,shadowingInstructions:{createComponentOfType:"number",returnWrappingComponents(ss){return ss==="yCriticalPointX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,nDimensions:2,entryPrefixes:["yCriticalPointX","yCriticalPoint"],getArrayKeysFromVarName({arrayEntryPrefix:ss,varEnding:os,arraySize:ls}){if(ss==="yCriticalPointX"){let us=os.split("_").map(cs=>Number(cs)-1);return us.length===2&&us.every((cs,ds)=>Number.isInteger(cs)&&cs>=0)?ls?us.every((cs,ds)=>cs=0?ls?usus+","+ds):[]:[us+",0"]:[]}},arrayVarNameFromPropIndex(ss,os){if(os==="yCriticalPoints")return ss.length===1?"yCriticalPoint"+ss[0]:`yCriticalPointX${ss[0]}_${ss[1]}`;if(os.slice(0,14)==="yCriticalPoint"){let ls=Number(os.slice(14));if(Number.isInteger(ls)&&ls>0)return`yCriticalPointX${ls}_${ss[0]}`}return null},returnArraySizeDependencies:()=>({nYCriticalPoints:{dependencyType:"stateVariable",variableName:"nYCriticalPoints"}}),returnArraySize({dependencyValues:ss}){return[ss.nYCriticalPoints,2]},returnArrayDependenciesByKey(){return{globalDependencies:{allYCriticalPoints:{dependencyType:"stateVariable",variableName:"allYCriticalPoints"}}}},arrayDefinitionByKey({globalDependencyValues:ss}){let os={};for(let ls=0;ls({splineCoeffs:{dependencyType:"stateVariable",variableName:"splineCoeffs"},fs:{dependencyType:"stateVariable",variableName:"fs"},curveType:{dependencyType:"stateVariable",variableName:"curveType"}}),definition({dependencyValues:ss}){let os=[];if(ss.curveType!=="bezier")return{setValue:{allCurvatureChangePoints:os}};let ls=ss.fs[0],us=ss.fs[1],cs=[],ds=!1;for(let[ps,fs]of ss.splineCoeffs.entries()){let[hs,gs,ys,bs]=fs[0],[vs,xs,Cs,Ts]=fs[1],Ss=3*(ys*Ts-Cs*bs),Ns=3*(gs*Ts-xs*bs),As=gs*Cs-xs*ys;if(Math.abs(Ss)<1e-14){let ws=-As/Ns;ds=addTimePointBezier({t:ws,ind:ps,ts:cs,ignoreLeft:ds})}else{let ws=Ns*Ns-4*Ss*As;if(ws==0){let Es=-Ns/(2*Ss);ds=addTimePointBezier({t:Es,ind:ps,ts:cs,ignoreLeft:ds})}else if(ws>0){let Es=Math.sqrt(ws),_s=[(-Ns-Es)/(2*Ss),(-Ns+Es)/(2*Ss)];Ss<0&&(_s=[_s[1],_s[0]]);let $s=!1;for(let Rs of _s)addTimePointBezier({t:Rs,ind:ps,ts:cs,ignoreLeft:ds})&&($s=!0);ds=$s}else ds=!1}}for(let ps of cs)os.push([ls(ps),us(ps)]);return{setValue:{allCurvatureChangePoints:os}}}},ns.nCurvatureChangePoints={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({allCurvatureChangePoints:{dependencyType:"stateVariable",variableName:"allCurvatureChangePoints"}}),definition({dependencyValues:ss}){return{setValue:{nCurvatureChangePoints:ss.allCurvatureChangePoints.length}}}},ns.curvatureChangePoints={public:!0,shadowingInstructions:{createComponentOfType:"number",returnWrappingComponents(ss){return ss==="curvatureChangePointX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,nDimensions:2,entryPrefixes:["curvatureChangePointX","curvatureChangePoint"],getArrayKeysFromVarName({arrayEntryPrefix:ss,varEnding:os,arraySize:ls}){if(ss==="curvatureChangePointX"){let us=os.split("_").map(cs=>Number(cs)-1);return us.length===2&&us.every((cs,ds)=>Number.isInteger(cs)&&cs>=0)?ls?us.every((cs,ds)=>cs=0?ls?usus+","+ds):[]:[us+",0"]:[]}},arrayVarNameFromPropIndex(ss,os){if(os==="curvatureChangePoints")return ss.length===1?"curvatureChangePoint"+ss[0]:`curvatureChangePointX${ss[0]}_${ss[1]}`;if(os.slice(0,20)==="curvatureChangePoint"){let ls=Number(os.slice(20));if(Number.isInteger(ls)&&ls>0)return`curvatureChangePointX${ls}_${ss[0]}`}return null},returnArraySizeDependencies:()=>({nCurvatureChangePoints:{dependencyType:"stateVariable",variableName:"nCurvatureChangePoints"}}),returnArraySize({dependencyValues:ss}){return[ss.nCurvatureChangePoints,2]},returnArrayDependenciesByKey(){return{globalDependencies:{allCurvatureChangePoints:{dependencyType:"stateVariable",variableName:"allCurvatureChangePoints"}}}},arrayDefinitionByKey({globalDependencyValues:ss}){let os={};for(let ls=0;ls({nearestPointAsCurvePrelim:{dependencyType:"stateVariable",variableName:"nearestPointAsCurvePrelim"},functionChild:{dependencyType:"child",childGroups:["functions"],variableNames:["nearestPointAsCurve"]},adapterSourceValue:{dependencyType:"adapterSourceStateVariable",variableName:"nearestPointAsCurve"}}),definition({dependencyValues:ss,usedDefault:os}){let ls=ss.nearestPointAsCurvePrelim;return os.nearestPointAsCurvePrelim&&(ss.functionChild.length>0?ls=ss.functionChild[0].stateValues.nearestPointAsCurve:ss.adapterSourceValue!==null&&(ls=ss.adapterSourceValue)),{setValue:{nearestPointAsCurve:ls}}}},ns.nearestPoint={returnDependencies:()=>({curveType:{dependencyType:"stateVariable",variableName:"curveType"},fs:{dependencyType:"stateVariable",variableName:"fs"},flipFunction:{dependencyType:"stateVariable",variableName:"flipFunction"},nDiscretizationPoints:{dependencyType:"stateVariable",variableName:"nDiscretizationPoints"},parMin:{dependencyType:"stateVariable",variableName:"parMin"},parMax:{dependencyType:"stateVariable",variableName:"parMax"},periodic:{dependencyType:"stateVariable",variableName:"periodic"},graphXmin:{dependencyType:"stateVariable",variableName:"graphXmin"},graphXmax:{dependencyType:"stateVariable",variableName:"graphXmax"},graphYmin:{dependencyType:"stateVariable",variableName:"graphYmin"},graphYmax:{dependencyType:"stateVariable",variableName:"graphYmax"},nearestPointAsCurve:{dependencyType:"stateVariable",variableName:"nearestPointAsCurve"}}),definition({dependencyValues:ss}){let os=null;return ss.curveType==="function"?os=getNearestPointFunctionCurve({dependencyValues:ss,numerics:rs}):["parameterization","bezier"].includes(ss.curveType)&&(os=getNearestPointParametrizedCurve({dependencyValues:ss,numerics:rs})),{setValue:{nearestPoint:os}}}},ns}async moveControlVector({controlVector:rs,controlVectorInds:ns,transient:ss,actionId:os,sourceInformation:ls={},skipRendererUpdate:us=!1}){let cs={[ns+",0"]:Context.fromAst(rs[0]),[ns+",1"]:Context.fromAst(rs[1])};return ss?await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"controlVectors",value:cs,sourceDetails:{controlVectorMoved:ns}}],transient:ss,actionId:os,sourceInformation:ls,skipRendererUpdate:us}):await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"controlVectors",value:cs,sourceDetails:{controlVectorMoved:ns}}],actionId:os,sourceInformation:ls,skipRendererUpdate:us,event:{verb:"interacted",object:{componentId:this.componentName},result:{["controlVector"+ns.join("_")]:rs}}})}async moveThroughPoint({throughPoint:rs,throughPointInd:ns,transient:ss,actionId:os,sourceInformation:ls={},skipRendererUpdate:us=!1}){let cs={[ns+",0"]:Context.fromAst(rs[0]),[ns+",1"]:Context.fromAst(rs[1])};return ss?await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"throughPoints",value:cs,sourceDetails:{throughPointMoved:ns}}],transient:ss,actionId:os,sourceInformation:ls,skipRendererUpdate:us}):await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"throughPoints",value:cs,sourceDetails:{throughPointMoved:ns}}],actionId:os,sourceInformation:ls,skipRendererUpdate:us,event:{verb:"interacted",object:{componentId:this.componentName},result:{["throughPoint"+ns]:rs}}})}async changeVectorControlDirection({direction:rs,throughPointInd:ns,actionId:ss,sourceInformation:os={},skipRendererUpdate:ls=!1}){return await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"vectorControlDirection",value:{[ns]:rs}}],actionId:ss,sourceInformation:os,skipRendererUpdate:ls})}switchCurve(){}async curveClicked({actionId:rs,name:ns,sourceInformation:ss={},skipRendererUpdate:os=!1}){await this.coreFunctions.triggerChainedActions({triggeringAction:"click",componentName:ns,actionId:rs,sourceInformation:ss,skipRendererUpdate:os}),this.coreFunctions.resolveAction({actionId:rs})}async mouseDownOnCurve({actionId:rs,name:ns,sourceInformation:ss={},skipRendererUpdate:os=!1}){await this.coreFunctions.triggerChainedActions({triggeringAction:"down",componentName:ns,actionId:rs,sourceInformation:ss,skipRendererUpdate:os}),this.coreFunctions.resolveAction({actionId:rs})}}zs(Curve,"componentType","curve"),zs(Curve,"rendererType","curve"),zs(Curve,"primaryStateVariableForDefinition","fShadow");function getNearestPointFunctionCurve({dependencyValues:as,numerics:rs}){let ns=as.flipFunction,ss=as.fs[0],os=as.nDiscretizationPoints,ls=as.parMax,us=as.parMin;return function({variables:cs,scales:ds}){var Bs,Ms;let ps=(Bs=cs.x1)==null?void 0:Bs.evaluate_to_constant(),fs=(Ms=cs.x2)==null?void 0:Ms.evaluate_to_constant(),hs=ds[0],gs=ds[1],ys,bs;if(us!==-1/0){if(ys=us,bs=ss(us),!Number.isFinite(bs)){let Ws=us*.99999+ls*1e-5,Us=ss(Ws);Number.isFinite(Us)&&(ys=Ws,bs=Us)}if(ns){let Ws=ys;ys=bs,bs=Ws}}let vs,xs;if(ls!==1/0){if(vs=ls,xs=ss(ls),!Number.isFinite(xs)){let Ws=us*1e-5+ls*.99999,Us=ss(Ws);Number.isFinite(Us)&&(vs=Ws,xs=Us)}if(ns){let Ws=vs;vs=xs,xs=Ws}}if(!as.nearestPointAsCurve||!(Number.isFinite(ps)&&Number.isFinite(fs))){let Ws,Us;if(ns?(Us=fs,Ws=ss(Us)):(Ws=ps,Us=ss(Ws)),!(Number.isFinite(Ws)&&Number.isFinite(Us))){let js,Ls;ns?(js=Math.abs(us-fs),Ls=Math.abs(ls-fs)):(js=Math.abs(us-ps),Ls=Math.abs(ls-ps)),jsys.evaluate_to_constant());else return{coordsNumeric:[Context.fromAst(NaN),Context.fromAst(NaN)],numericEntries:!1};if(os)ps=os.map(ys=>ys.evaluate_to_constant()),ns?cs=ns.map(ys=>ys.evaluate_to_constant()):cs=[2*ds[0]-ps[0],2*ds[1]-ps[1]];else if(ns)cs=ns.map(ys=>ys.evaluate_to_constant()),ps=[2*ds[0]-cs[0],2*ds[1]-cs[1]];else return{coordsNumeric:[Context.fromAst(NaN),Context.fromAst(NaN)],numericEntries:!1};let fs=[];if(ls==="centripetal"){let ys=us(cs,ds),bs=us(ds,ps);ys=Math.sqrt(ys),bs=Math.sqrt(bs),bsContext.fromAst(ys)),gs=Number.isFinite(fs[0])&&Number.isFinite(fs[1]);return{coordsNumeric:hs,numericEntries:gs}}function initCubicPoly(as,rs,ns,ss){return[as,ns,-3*as+3*rs-2*ns-ss,2*as-2*rs+ns+ss]}function addTimePointBezier({t:as,ind:rs,ts:ns,ignoreLeft:ss=!1}){const ls=1.00000000000001,us=1-1e-14;let cs=!1;return as>=1e-14?as<=us?ns.push(rs+as):as-1e-14&&!ss&&ns.push(rs),cs}class EquilibriumCurve extends Curve{static createAttributesObject(){let rs=super.createAttributesObject();return rs.stable={createComponentOfType:"boolean",createStateVariable:"stable",defaultValue:!0,public:!0},rs.switchable={createComponentOfType:"boolean",createStateVariable:"switchable",defaultValue:!1,public:!0,forRenderer:!0},rs}static returnStateVariableDefinitions({numerics:rs}){let ns=super.returnStateVariableDefinitions({numerics:rs});return ns.dashed={forRenderer:!0,returnDependencies:()=>({stable:{dependencyType:"stateVariable",variableName:"stable"}}),definition({dependencyValues:ss}){return{setValue:{dashed:!ss.stable}}},inverseDefinition({desiredStateVariableValues:ss}){return{success:!0,instructions:[{setDependency:"stable",desiredValue:!ss.dashed}]}}},ns}async switchCurve({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){if(await this.stateValues.switchable)return await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"stable",value:!this.stateValues.stable}],actionId:rs,sourceInformation:ns,skipRendererUpdate:ss,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{stable:!this.stateValues.stable}}});this.coreFunctions.resolveAction({actionId:rs})}}zs(EquilibriumCurve,"componentType","equilibriumCurve"),zs(EquilibriumCurve,"rendererType","curve");const DynamicalSystems=Object.freeze(Object.defineProperty({__proto__:null,CobwebPolyline,EquilibriumCurve,EquilibriumLine,EquilibriumPoint,ODESystem},Symbol.toStringTag,{value:"Module"}));class Atom extends InlineComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.symbol={createComponentOfType:"text"},rs.atomicNumber={createComponentOfType:"integer"},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.atomicNumberShadow={defaultValue:null,hasEssential:!0,essentialVarName:"atomicNumber",returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{atomicNumberShadow:!0}}),inverseDefinition:async function({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setEssentialValue:"atomicNumberShadow",value:ns.atomicNumberShadow}]}}},rs.dataForAtom={returnDependencies:()=>({fileContents:{dependencyType:"file",cid:"bafkreibilal4glrbpo7p7oodtwtnzkfhiylfoqa2td4ij6h6iqva57kzcy",fileType:"csv"},symbolAttr:{dependencyType:"attributeComponent",attributeName:"symbol",variableNames:["value"]},atomicNumberAttr:{dependencyType:"attributeComponent",attributeName:"atomicNumber",variableNames:["value"]},atomicNumberShadow:{dependencyType:"stateVariable",variableName:"atomicNumberShadow"}}),definition:function({dependencyValues:ns}){let ss=null,os=null;if(ns.symbolAttr)ss=ns.symbolAttr.stateValues.value.toLowerCase();else if(ns.atomicNumberAttr)os=ns.atomicNumberAttr.stateValues.value;else if(ns.atomicNumberShadow)os=ns.atomicNumberShadow;else return{setValue:{dataForAtom:null}};let ls=ns.fileContents.trim().split(` `),us;os!==null?us=os-1:us=["h","he","li","be","b","c","n","o","f","ne","na","mg","al","si","p","s","cl","ar","k","ca","sc","ti","v","cr","mn","fe","co","ni","cu","zn","ga","ge","as","se","br","kr","rb","sr","y","zr","nb","mo","tc","ru","rh","pd","ag","cd","in","sn","sb","te","i","xe","cs","ba","la","ce","pr","nd","pm","sm","eu","gd","tb","dy","ho","er","tm","yb","lu","hf","ta","w","re","os","ir","pt","au","hg","tl","pb","bi","po","at","rn","fr","ra","ac","th","pa","u","np","pu","am","cm","bk","cf","es","fm","md","no","lr","rf","db","sg","bh","hs","mt","ds","rg","cn","nh","fl","mc","lv","ts","og"].indexOf(ss==null?void 0:ss.toLowerCase());let cs=ls.slice(1)[us];if(!cs)return{setValue:{dataForAtom:null}};cs=cs.trim().split(",").map(gs=>gs.trim());let ds=ls[0].trim().split(",").map(gs=>gs.trim()).map(gs=>(['"',"'"].includes(gs[0])&&gs[gs.length-1]===gs[0]&&(gs=gs.substring(1,gs.length-1).trim()),gs)),ps=ds.length,fs=["number","string","string","number","number","string","number","string","string","number","number","number","number","number","number","number","string"],hs={};for(let gs=0;gs({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom["Atomic Number"]:ss=null,{setValue:{atomicNumber:ss}}}},rs.symbol={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom.Symbol:ss=null,{setValue:{symbol:ss}}}},rs.name={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom.Name:ss=null,{setValue:{name:ss}}}},rs.group={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom.Group:ss=null,{setValue:{group:ss}}}},rs.atomicMass={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom["Atomic Mass"]:ss=null,{setValue:{atomicMass:ss}}}},rs.phaseAtSTP={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom["Phase at STP"]:ss=null,{setValue:{phaseAtSTP:ss}}}},rs.chargeOfCommonIon={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom["Charge of Common Ion"]:ss=null,{setValue:{chargeOfCommonIon:ss}}}},rs.metalCategory={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom["Metal/Nonmetal/Metalloid"]:ss=null,{setValue:{metalCategory:ss}}}},rs.groupName={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom["Group Name"]:ss=null,{setValue:{groupName:ss}}}},rs.period={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom.Period:ss=null,{setValue:{period:ss}}}},rs.ionizationEnergy={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom["Ionization Energy"]:ss=null,{setValue:{ionizationEnergy:ss}}}},rs.meltingPoint={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom["Melting Point"]:ss=null,{setValue:{meltingPoint:ss}}}},rs.boilingPoint={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom["Boiling Point"]:ss=null,{setValue:{boilingPoint:ss}}}},rs.atomicRadius={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom["Atomic Radius"]:ss=null,{setValue:{atomicRadius:ss}}}},rs.density={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom.Density:ss=null,{setValue:{density:ss}}}},rs.electronegativity={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom.Electronegativity:ss=null,{setValue:{electronegativity:ss}}}},rs.electronConfiguration={public:!0,shadowingInstructions:{createComponentOfType:"electronConfiguration"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom["Electron Configuration"]:ss=null,{setValue:{electronConfiguration:ss}}}},rs.orbitalDiagram={public:!0,shadowingInstructions:{createComponentOfType:"orbitalDiagram"},returnDependencies:()=>({electronConfiguration:{dependencyType:"stateVariable",variableName:"electronConfiguration"}}),definition({dependencyValues:ns}){let ss;return ns.electronConfiguration?ss=electronConfigurationToOrbitalDiagram(ns.electronConfiguration):ss=null,{setValue:{orbitalDiagram:ss}}}},rs.math={public:!0,shadowingInstructions:{createComponentOfType:"math"},returnDependencies:()=>({symbol:{dependencyType:"stateVariable",variableName:"symbol"}}),definition({dependencyValues:ns}){let ss;return ns.symbol?ss=["^",ns.symbol]:ss="_",{setValue:{math:Context.fromAst(ss)}}}},rs.latex={additionalStateVariablesDefined:[{variableName:"latexWithInputChildren",forRenderer:!0}],returnDependencies:()=>({symbol:{dependencyType:"stateVariable",variableName:"symbol"}}),definition({dependencyValues:ns}){let ss;return ns.symbol?ss=`\\text{${ns.symbol}}`:ss="[\\text{Invalid Chemical Symbol}]",{setValue:{latex:ss,latexWithInputChildren:[ss]}}}},rs}}zs(Atom,"componentType","atom"),zs(Atom,"rendererType","math"),zs(Atom,"primaryStateVariableForDefinition","atomicNumberShadow"),zs(Atom,"adapters",["math","name",{stateVariable:"atomicNumber",componentType:"ion"}]);function electronConfigurationToOrbitalDiagram(as){let rs=as.tree;if(!(Array.isArray(rs)&&rs[0]==="*"))return null;rs=rs.slice(1);let ns=rs.length/2;if(!Number.isInteger(ns))return null;let ss=[];for(let os=0;os0))return null;let us=rs[2*os+1];if(!(Array.isArray(us)&&us[0]==="^"))return null;let cs=us[1],ds=us[2];if(!(["s","p","d","f"].includes(cs)&&Number.isInteger(ds)&&ds>0))return null;let ps=`${ls}${cs}`,fs;cs==="s"?fs=1:cs==="p"?fs=3:cs==="d"?fs=5:fs=7;let hs=Array(fs).fill("");for(let gs=0;gs({}),definition:()=>({useEssentialOrDefaultValue:{atomicNumberShadow:!0}}),inverseDefinition:async function({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setEssentialValue:"atomicNumberShadow",value:ns.atomicNumberShadow}]}}},rs.dataForAtom={returnDependencies:()=>({fileContents:{dependencyType:"file",cid:"bafkreibilal4glrbpo7p7oodtwtnzkfhiylfoqa2td4ij6h6iqva57kzcy",fileType:"csv"},symbolAttr:{dependencyType:"attributeComponent",attributeName:"symbol",variableNames:["value"]},atomicNumberAttr:{dependencyType:"attributeComponent",attributeName:"atomicNumber",variableNames:["value"]},atomChild:{dependencyType:"child",childGroups:["atoms"],variableNames:["atomicNumber"]},atomicNumberShadow:{dependencyType:"stateVariable",variableName:"atomicNumberShadow"}}),definition:function({dependencyValues:ns}){let ss=null,os=null;if(ns.atomChild.length>0)os=ns.atomChild[0].stateValues.atomicNumber;else if(ns.symbolAttr)ss=ns.symbolAttr.stateValues.value.toLowerCase();else if(ns.atomicNumberAttr)os=ns.atomicNumberAttr.stateValues.value;else if(ns.atomicNumberShadow)os=ns.atomicNumberShadow;else return{setValue:{dataForAtom:null}};let ls=ns.fileContents.trim().split(` `),us;os!==null?us=os-1:us=["h","he","li","be","b","c","n","o","f","ne","na","mg","al","si","p","s","cl","ar","k","ca","sc","ti","v","cr","mn","fe","co","ni","cu","zn","ga","ge","as","se","br","kr","rb","sr","y","zr","nb","mo","tc","ru","rh","pd","ag","cd","in","sn","sb","te","i","xe","cs","ba","la","ce","pr","nd","pm","sm","eu","gd","tb","dy","ho","er","tm","yb","lu","hf","ta","w","re","os","ir","pt","au","hg","tl","pb","bi","po","at","rn","fr","ra","ac","th","pa","u","np","pu","am","cm","bk","cf","es","fm","md","no","lr","rf","db","sg","bh","hs","mt","ds","rg","cn","nh","fl","mc","lv","ts","og"].indexOf(ss==null?void 0:ss.toLowerCase());let cs=ls.slice(1)[us];if(!cs)return{setValue:{dataForAtom:null}};cs=cs.trim().split(",").map(gs=>gs.trim());let ds=ls[0].trim().split(",").map(gs=>gs.trim()).map(gs=>(['"',"'"].includes(gs[0])&&gs[gs.length-1]===gs[0]&&(gs=gs.substring(1,gs.length-1).trim()),gs)),ps=ds.length,fs=["number","string","string","number","number","string","number","string","string","number","number","number","number","number","number","number","string"],hs={};for(let gs=0;gs({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom["Atomic Number"]:ss=null,{setValue:{atomicNumber:ss}}}},rs.symbol={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom.Symbol:ss=null,{setValue:{symbol:ss}}}},rs.charge={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"},chargeAttr:{dependencyType:"attributeComponent",attributeName:"charge",variableNames:["value"]}}),definition({dependencyValues:ns}){let ss;return ns.chargeAttr?(ss=ns.chargeAttr.stateValues.value,Number.isFinite(ss)||(ss=0)):ns.dataForAtom?ss=ns.dataForAtom["Charge of Common Ion"]||0:ss=0,{setValue:{charge:ss}}}},rs.name={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"},charge:{dependencyType:"stateVariable",variableName:"charge"},group:{dependencyType:"stateVariable",variableName:"group"},atomicNumber:{dependencyType:"stateVariable",variableName:"atomicNumber"}}),definition({dependencyValues:ns}){let ss;if(ns.dataForAtom){if(ss=ns.dataForAtom.Name,ns.charge<0){let os={Hydrogen:"Hydride",Oxygen:"Oxide",Sulfur:"Sulfide",Nitrogen:"Nitride",Phosphorus:"Phosphide",Carbon:"Carbide"},ls=ss.length;ss.substring(ls-3,ls)==="ine"?ss=ss.substring(0,ls-3)+"ide":ss in os&&(ss=os[ss])}else if(ns.charge>0&&(ns.group>=3&&ns.group<=12||ns.group===101||ns.group===102||[13,31,49,50,81,82,83,84].includes(ns.atomicNumber))){let os="";switch(ns.charge){case 1:os=" (I)";break;case 2:os=" (II)";break;case 3:os=" (III)";break;case 4:os=" (IV)";break;case 5:os=" (V)";break;case 6:os=" (VI)";break;case 7:os=" (VII)";break;case 8:os=" (VIII)";break}ss+=os}}else ss=null;return{setValue:{name:ss}}}},rs.group={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom.Group:ss=null,{setValue:{group:ss}}}},rs.metalCategory={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom["Metal/Nonmetal/Metalloid"]:ss=null,{setValue:{metalCategory:ss}}}},rs.groupName={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom["Group Name"]:ss=null,{setValue:{groupName:ss}}}},rs.period={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({dataForAtom:{dependencyType:"stateVariable",variableName:"dataForAtom"}}),definition({dependencyValues:ns}){let ss;return ns.dataForAtom?ss=ns.dataForAtom.Period:ss=null,{setValue:{period:ss}}}},rs.math={public:!0,shadowingInstructions:{createComponentOfType:"math"},returnDependencies:()=>({symbol:{dependencyType:"stateVariable",variableName:"symbol"},charge:{dependencyType:"stateVariable",variableName:"charge"}}),definition({dependencyValues:ns}){let ss;return ns.symbol?(ss=["^",ns.symbol],ns.charge===-1?ss.push("-"):ns.charge===1?ss.push("+"):ns.charge<0?ss.push(Math.abs(ns.charge)+"-"):ns.charge>0&&ss.push(Math.abs(ns.charge)+"+")):ss="_",{setValue:{math:Context.fromAst(ss)}}}},rs.latex={additionalStateVariablesDefined:[{variableName:"latexWithInputChildren",forRenderer:!0}],returnDependencies:()=>({symbol:{dependencyType:"stateVariable",variableName:"symbol"},charge:{dependencyType:"stateVariable",variableName:"charge"}}),definition({dependencyValues:ns}){let ss;return ns.symbol?(ss=`\\text{${ns.symbol}}`,ns.charge===-1?ss=ss+"^-":ns.charge===1?ss=ss+"^+":ns.charge<0?ss=ss+`^{${Math.abs(ns.charge)}-}`:ns.charge>0&&(ss=ss+`^{${Math.abs(ns.charge)}+}`)):ss="[\\text{Invalid Chemical Symbol}]",{setValue:{latex:ss,latexWithInputChildren:[ss]}}}},rs}}zs(Ion,"componentType","ion"),zs(Ion,"rendererType","math"),zs(Ion,"primaryStateVariableForDefinition","atomicNumberShadow"),zs(Ion,"adapters",["math","name"]);class IonicCompound extends InlineComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.symbol={createComponentOfType:"text"},rs.atomicNumber={createComponentOfType:"integer"},rs.charge={createComponentOfType:"integer"},rs}static returnChildGroups(){return[{group:"ions",componentTypes:["ion"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.ionicCompound={returnDependencies:()=>({ionChildren:{dependencyType:"child",childGroups:["ions"],variableNames:["symbol","charge","atomicNumber","name"]}}),definition({dependencyValues:ns}){let ss=ns.ionChildren.map(ds=>ds.stateValues.charge);if(ss.length!==2)return console.warn("have not implemented ionic compound for anything other than two ions"),{setValue:{ionicCompound:null}};if(!(ss[0]*ss[1]<0))return console.warn("ionic compound implemented only for one cation and one anion"),{setValue:{ionicCompound:null}};let os=Math.abs(ss[1]),ls=Math.abs(ss[0]),us=Context.math.gcd(os,ls);return os/=us,ls/=us,{setValue:{ionicCompound:[{symbol:ns.ionChildren[0].stateValues.symbol,atomicNumber:ns.ionChildren[0].stateValues.atomicNumber,name:ns.ionChildren[0].stateValues.name,charge:ss[0],count:os},{symbol:ns.ionChildren[1].stateValues.symbol,atomicNumber:ns.ionChildren[1].stateValues.atomicNumber,name:ns.ionChildren[1].stateValues.name,charge:ss[1],count:ls}]}}}},rs.math={public:!0,shadowingInstructions:{createComponentOfType:"math"},returnDependencies:()=>({ionicCompound:{dependencyType:"stateVariable",variableName:"ionicCompound"}}),definition({dependencyValues:ns}){let ss;if(ns.ionicCompound){ss=[];for(let os of ns.ionicCompound){let ls=os.symbol;os.count>1&&(ls=["_",ls,os.count]),ss.push(ls)}ss.length>1?ss=["*",...ss]:ss.length===1?ss=ss[0]:ss="_"}else ss="_";return{setValue:{math:Context.fromAst(ss)}}}},rs.latex={additionalStateVariablesDefined:[{variableName:"latexWithInputChildren",forRenderer:!0}],returnDependencies:()=>({ionicCompound:{dependencyType:"stateVariable",variableName:"ionicCompound"}}),definition({dependencyValues:ns}){let ss;if(ns.ionicCompound){ss="";for(let os of ns.ionicCompound)ss+=`\\text{${os.symbol}}`,os.count>1&&(ss+=`_{${os.count}}`)}else ss="[\\text{Invalid Ionic Compound}]";return{setValue:{latex:ss,latexWithInputChildren:[ss]}}}},rs}}zs(IonicCompound,"componentType","ionicCompound"),zs(IonicCompound,"rendererType","math"),zs(IonicCompound,"adapters",["math"]);class ElectronConfiguration extends MathComponent{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.latex={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({valueForDisplay:{dependencyType:"stateVariable",variableName:"valueForDisplay"}}),definition:function({dependencyValues:ns,usedDefault:ss}){let os;try{os=ns.valueForDisplay.toLatex()}catch{os="_"}return os=os.replaceAll("\\,",""),os=os.replaceAll("\\cdot","~"),{setValue:{latex:os}}}},rs}}zs(ElectronConfiguration,"componentType","electronConfiguration"),zs(ElectronConfiguration,"rendererType","math");class OrbitalDiagram extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.labels={createComponentOfType:"textList",createStateVariable:"labels",defaultValue:[]},rs}static returnSugarInstructions(){return[{replacementFunction:function({matchedChildren:ns}){return ns.length===1&&typeof ns[0]!="string"?{success:!1}:{success:!0,newChildren:[{componentType:"tupleList",children:ns}]}}}]}static returnChildGroups(){return[{group:"tupleLists",componentTypes:["tupleList"]},{group:"orbitalDiagrams",componentTypes:["orbitalDiagram"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.value={defaultValue:[{orbitalText:"",boxes:[]}],public:!0,shadowingInstructions:{createComponentOfType:"orbitalDiagram"},forRenderer:!0,returnDependencies:()=>({orbitalDiagramChildren:{dependencyType:"child",childGroups:["orbitalDiagrams"],variableNames:["value"]},tupleListChildren:{dependencyType:"child",childGroups:["tupleLists"],variableNames:["maths"]},labels:{dependencyType:"stateVariable",variableName:"labels"}}),definition:function({dependencyValues:ns}){function ss(){var us;function os(cs){if(cs==="u"||cs==="U")return"U";if(cs==="d"||cs==="D")return"D";if(cs==="e"||cs==="E")return"";if(Array.isArray(cs)&&cs[0]==="*"){let ds="";for(let ps of cs.slice(1))if(ps==="u"||ps==="U")ds+="U";else if(ps==="d"||ps==="D")ds+="D";else return"";return ds}else return""}if(ns.orbitalDiagramChildren.length===1)return ns.orbitalDiagramChildren[0].stateValues.value;let ls=[];if(((us=ns.tupleListChildren[0])==null?void 0:us.stateValues.maths.length)>0){let cs=ns.tupleListChildren[0].stateValues.maths;for(let[ds,ps]of cs.entries()){let fs="";ns.labels[ds]&&(fs=ns.labels[ds]);let hs=[];if(Array.isArray(ps.tree)&&ps.tree[0]==="tuple")for(let gs of ps.tree.slice(1))hs.push(os(gs));else hs.push(os(ps.tree));ls.push({orbitalText:fs,boxes:hs})}return ls}else return[{orbitalText:"",boxes:[]}]}return{setValue:{value:ss()}}}},rs}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}}zs(OrbitalDiagram,"componentType","orbitalDiagram"),zs(OrbitalDiagram,"variableForPlainMacro","value");class OrbitalDiagramInput extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{addRow:this.addRow.bind(this),removeRow:this.removeRow.bind(this),addBox:this.addBox.bind(this),removeBox:this.removeBox.bind(this),addUpArrow:this.addUpArrow.bind(this),addDownArrow:this.addDownArrow.bind(this),removeArrow:this.removeArrow.bind(this),updateRowText:this.updateRowText.bind(this),selectRow:this.selectRow.bind(this),selectBox:this.selectBox.bind(this),recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.prefill={createComponentOfType:"orbitalDiagram",createStateVariable:"prefill",defaultValue:[]},rs.prefillLabel={createComponentOfType:"textList",createStateVariable:"prefillLabel",defaultValue:[]},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.value={defaultValue:[{orbitalText:"",boxes:[]}],hasEssential:!0,forRenderer:!0,public:!0,shadowingInstructions:{createComponentOfType:"orbitalDiagram"},returnDependencies:()=>({prefill:{dependencyType:"stateVariable",variableName:"prefill"},prefillLabel:{dependencyType:"stateVariable",variableName:"prefillLabel"}}),definition:function({dependencyValues:ns}){function ss(){var os;if(((os=ns.prefill)==null?void 0:os.length)>0){let ls=JSON.parse(JSON.stringify(ns.prefill));for(let[us,cs]of ls.entries())ns.prefillLabel[us]&&(cs.orbitalText=ns.prefillLabel[us]);return ls}else return[{orbitalText:"",boxes:[]}]}return{useEssentialOrDefaultValue:{value:{get defaultValue(){return ss()}}}}},inverseDefinition({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setEssentialValue:"value",value:ns.value}]}}},rs.rows={public:!0,shadowingInstructions:{createComponentOfType:"orbitalDiagram"},forRenderer:!0,returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition({dependencyValues:ns}){return{setValue:{rows:[...ns.value].reverse()}}},inverseDefinition({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setDependency:"value",desiredValue:[...ns.rows].reverse()}]}}},rs.numRows={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({rows:{dependencyType:"stateVariable",variableName:"rows"}}),definition:function({dependencyValues:ns}){return{setValue:{numRows:ns.rows.length}}}},rs.selectedRowIndex={defaultValue:0,hasEssential:!0,forRenderer:!0,public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({}),definition:function(){return{useEssentialOrDefaultValue:{selectedRowIndex:!0}}},async inverseDefinition({desiredStateVariableValues:ns,stateValues:ss}){let os=await ss.numRows,ls=ns.selectedRowIndex;return Number.isFinite(ls)?ls=Math.min(os,Math.max(0,Math.round(ls))):ls=0,{success:!0,instructions:[{setEssentialValue:"selectedRowIndex",value:ls}]}}},rs.selectedBoxIndex={defaultValue:0,hasEssential:!0,forRenderer:!0,public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({}),definition:function(){return{useEssentialOrDefaultValue:{selectedBoxIndex:!0}}},async inverseDefinition({desiredStateVariableValues:ns}){let ss=ns.selectedBoxIndex;return Number.isFinite(ss)?ss=Math.max(0,Math.round(ss)):ss=0,{success:!0,instructions:[{setEssentialValue:"selectedBoxIndex",value:ss}]}}},rs}async addRow({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){let os=await this.stateValues.rows,ls=JSON.parse(JSON.stringify(os));os.length<20&&(ls=[{orbitalText:"",boxes:[]},...os]);let us=[{updateType:"updateValue",componentName:this.componentName,stateVariable:"rows",value:ls}];return await this.stateValues.selectedRowIndex-1!==-1&&us.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"selectedRowIndex",value:0}),await this.stateValues.selectedBoxIndex-1!==-1&&us.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"selectedBoxIndex",value:0}),await this.coreFunctions.performUpdate({updateInstructions:us,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{rows:ls}}})}async removeRow({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){let os=await this.stateValues.rows,ls=await this.stateValues.selectedRowIndex-1,us=JSON.parse(JSON.stringify(os));if(os.length>1){let cs=os.length-1-ls;ls===-1&&(cs=0),us.splice(cs,1)}return await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"rows",value:us},{updateType:"updateValue",componentName:this.componentName,stateVariable:"selectedRowIndex",value:0},{updateType:"updateValue",componentName:this.componentName,stateVariable:"selectedBoxIndex",value:0}],actionId:rs,sourceInformation:ns,skipRendererUpdate:ss,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{rows:us}}})}async addBox({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){let os=await this.stateValues.rows,ls=JSON.parse(JSON.stringify(os)),us=await this.stateValues.selectedRowIndex-1,cs=os.length-us-1;us===-1&&(cs=0),ls[cs].boxes.length<17&&ls[cs].boxes.push("");let ds=[{updateType:"updateValue",componentName:this.componentName,stateVariable:"rows",value:ls}];if(us!==-1){let ps=0;ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"selectedBoxIndex",value:ps})}return await this.coreFunctions.performUpdate({updateInstructions:ds,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{rows:ls}}})}async removeBox({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){let os=await this.stateValues.rows,ls=JSON.parse(JSON.stringify(os)),us=await this.stateValues.selectedRowIndex-1,cs=os.length-us-1;us===-1&&(cs=0);let ds=await this.stateValues.selectedBoxIndex-1,ps=ds;ds===-1&&(ps=ls[cs].boxes.length-1),ls[cs].boxes.splice(ps,1);let fs=[{updateType:"updateValue",componentName:this.componentName,stateVariable:"rows",value:ls}];return ds!==-1&&fs.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"selectedBoxIndex",value:0}),await this.coreFunctions.performUpdate({updateInstructions:fs,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{rows:ls}}})}async addUpArrow({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){let os=await this.stateValues.rows,ls=JSON.parse(JSON.stringify(os)),us=await this.stateValues.selectedRowIndex-1,cs=os.length-us-1;us===-1&&(cs=0);let ds=await this.stateValues.selectedBoxIndex-1,ps=ds;ds===-1&&(ps=ls[cs].boxes.length-1),ls[cs].boxes.length>0&&ls[cs].boxes[ps].length<3&&(ls[cs].boxes[ps]=ls[cs].boxes[ps]+"U");let fs=[{updateType:"updateValue",componentName:this.componentName,stateVariable:"rows",value:ls}];return await this.coreFunctions.performUpdate({updateInstructions:fs,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{rows:ls}}})}async addDownArrow({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){let os=await this.stateValues.rows,ls=JSON.parse(JSON.stringify(os)),us=await this.stateValues.selectedRowIndex-1,cs=os.length-us-1;us===-1&&(cs=0);let ds=await this.stateValues.selectedBoxIndex-1,ps=ds;ds===-1&&(ps=ls[cs].boxes.length-1),ls[cs].boxes.length>0&&ls[cs].boxes[ps].length<3&&(ls[cs].boxes[ps]=ls[cs].boxes[ps]+"D");let fs=[{updateType:"updateValue",componentName:this.componentName,stateVariable:"rows",value:ls}];return await this.coreFunctions.performUpdate({updateInstructions:fs,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{rows:ls}}})}async removeArrow({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){let os=await this.stateValues.rows,ls=JSON.parse(JSON.stringify(os)),us=await this.stateValues.selectedRowIndex-1,cs=os.length-us-1;us===-1&&(cs=0);let ds=await this.stateValues.selectedBoxIndex-1,ps=ds;ds===-1&&(ps=ls[cs].boxes.length-1),ls[cs].boxes.length>0&&ls[cs].boxes[ps].length>0&&(ls[cs].boxes[ps]=ls[cs].boxes[ps].slice(0,-1));let fs=[{updateType:"updateValue",componentName:this.componentName,stateVariable:"rows",value:ls}];return await this.coreFunctions.performUpdate({updateInstructions:fs,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{rows:ls}}})}async updateRowText({newValue:rs,actionId:ns,sourceInformation:ss={},skipRendererUpdate:os=!1}){let ls=await this.stateValues.rows,us=JSON.parse(JSON.stringify(ls)),cs=await this.stateValues.selectedRowIndex-1,ds=ls.length-cs-1;cs===-1&&(ds=0),us[ds].orbitalText=rs;let ps=[{updateType:"updateValue",componentName:this.componentName,stateVariable:"rows",value:us}];return await this.coreFunctions.performUpdate({updateInstructions:ps,actionId:ns,sourceInformation:ss,skipRendererUpdate:os,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{rows:us}}})}async selectRow({index:rs,actionId:ns,sourceInformation:ss={},skipRendererUpdate:os=!1}){return await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"selectedRowIndex",value:rs}],actionId:ns,sourceInformation:ss,skipRendererUpdate:os,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{selectedRowIndex:rs}}})}async selectBox({index:rs,actionId:ns,sourceInformation:ss={},skipRendererUpdate:os=!1}){return await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"selectedBoxIndex",value:rs}],actionId:ns,sourceInformation:ss,skipRendererUpdate:os,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{selectedBoxIndex:rs}}})}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}}zs(OrbitalDiagramInput,"componentType","orbitalDiagramInput"),zs(OrbitalDiagramInput,"variableForPlainMacro","value"),zs(OrbitalDiagramInput,"variableForPlainCopy","value");const Chemistry=Object.freeze(Object.defineProperty({__proto__:null,Atom,ElectronConfiguration,Ion,IonicCompound,OrbitalDiagram,OrbitalDiagramInput},Symbol.toStringTag,{value:"Module"}));class FeedbackDefinition extends BaseComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.code={createComponentOfType:"text"},rs.text={createComponentOfType:"text"},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.feedbackDefinition={returnDependencies:()=>({codeAttr:{dependencyType:"attributeComponent",attributeName:"code",variableNames:["value"]},textAttr:{dependencyType:"attributeComponent",attributeName:"text",variableNames:["value"]}}),definition({dependencyValues:ns}){return ns.codeAttr!==null&&ns.textAttr!==null?{setValue:{feedbackDefinition:{[ns.codeAttr.stateValues.value.toLowerCase()]:ns.textAttr.stateValues.value}}}:{setValue:{feedbackDefinition:null}}}},rs}}zs(FeedbackDefinition,"componentType","feedbackDefinition");class FeedbackDefinitions extends BaseComponent{static returnChildGroups(){return[{group:"feedbackDefinition",componentTypes:["feedbackDefinition"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.value={returnDependencies:()=>({feedbackDefinitionChildren:{dependencyType:"child",childGroups:["feedbackDefinition"],variableNames:["feedbackDefinition"]}}),definition({dependencyValues:ns}){let ss={};for(let os of ns.feedbackDefinitionChildren)os.stateValues.feedbackDefinition&&Object.assign(ss,os.stateValues.feedbackDefinition);return{setValue:{value:ss}}}},rs}}zs(FeedbackDefinitions,"componentType","feedbackDefinitions"),zs(FeedbackDefinitions,"rendererType");const FeedbackDefinitions$1=Object.freeze(Object.defineProperty({__proto__:null,FeedbackDefinition,FeedbackDefinitions},Symbol.toStringTag,{value:"Module"}));class StyleDefinition extends BaseComponent{static createAttributesObject(){let rs=super.createAttributesObject();rs.styleNumber={createPrimitiveOfType:"number",createStateVariable:"styleNumber",defaultValue:1};for(let ns in styleAttributes)rs[ns]={createComponentOfType:styleAttributes[ns].componentType};return rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.styleDefinition={returnDependencies:function(){let ns={};for(let ss in styleAttributes)ns[ss]={dependencyType:"attributeComponent",attributeName:ss,variableNames:["value"]};return ns},definition:function({dependencyValues:ns}){let ss={};for(let os in styleAttributes)ns[os]!==null&&(ss[os]=ns[os].stateValues.value,typeof ss[os]=="string"&&(ss[os]=ss[os].toLowerCase()));return{setValue:{styleDefinition:ss}}}},rs}}zs(StyleDefinition,"componentType","styleDefinition"),zs(StyleDefinition,"rendererType");class StyleDefinitions extends BaseComponent{static returnChildGroups(){return[{group:"styleDefinition",componentTypes:["styleDefinition"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.value={returnDependencies:()=>({styleDefinitionChildren:{dependencyType:"child",childGroups:["styleDefinition"],variableNames:["styleNumber","styleDefinition"]}}),definition({dependencyValues:ns}){let ss={};for(let os of ns.styleDefinitionChildren){let ls=os.stateValues.styleNumber,us=ss[ls];us||(us=ss[ls]={}),Object.assign(us,os.stateValues.styleDefinition)}return{setValue:{value:ss}}}},rs}}zs(StyleDefinitions,"componentType","styleDefinitions"),zs(StyleDefinitions,"rendererType");const StyleDefinitions$1=Object.freeze(Object.defineProperty({__proto__:null,StyleDefinition,StyleDefinitions},Symbol.toStringTag,{value:"Module"}));class ComponentWithSelectableType extends BaseComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.type={createPrimitiveOfType:"string"},rs}static returnSugarInstructions(){let rs=[];function ns({matchedChildren:ss,componentAttributes:os,parentAttributes:ls}){let us=os.type;us||(us=ls.type),us?["number","letters","math","text","boolean"].includes(us)||(console.warn(`Invalid type ${us}, setting type to number`),us="number"):us="number";let cs=us==="letters"?"text":us;return cs!=="text"&&(ss=ss.filter(ds=>typeof ds!="string"||ds.trim()!=="")),{success:!0,newChildren:[{componentType:cs,children:ss}]}}return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"anything",componentTypes:["_base"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.type={shadowVariable:!0,returnDependencies:()=>({type:{dependencyType:"doenetAttribute",attributeName:"type"},parentType:{dependencyType:"parentStateVariable",variableName:"type"}}),definition:function({dependencyValues:ns,componentName:ss}){let os=ns.type;return os||(os=ns.parentType),os?["number","letters","math","text","boolean"].includes(os)||(console.warn(`Invalid type ${os}, setting type to number`),os="number"):os="number",{setValue:{type:os}}}},rs.value={public:!0,shadowingInstructions:{hasVariableComponentType:!0},shadowVariable:!0,returnDependencies:()=>({type:{dependencyType:"stateVariable",variableName:"type"},atMostOneChild:{dependencyType:"child",childGroups:["anything"],variableNames:["value"]}}),definition({dependencyValues:ns}){let ss;return ns.atMostOneChild.length>0?ss=ns.atMostOneChild[0].stateValues.value:ns.type==="text"||ns.type==="letters"?ss="":ns.type==="boolean"?ss=!1:ns.type==="number"?ss=NaN:ss=Context.fromAst("_"),{setValue:{value:ss},setCreateComponentOfType:{value:ns.type}}},inverseDefinition({desiredStateVariableValues:ns,dependencyValues:ss}){return ss.atMostOneChild.length>0?{success:!0,instructions:[{setDependency:"atMostOneChild",desiredValue:ns.value,childIndex:0,variableIndex:0}]}:{success:!1}}},rs}}zs(ComponentWithSelectableType,"componentType","_componentWithSelectableType"),zs(ComponentWithSelectableType,"rendererType"),zs(ComponentWithSelectableType,"includeBlankStringChildren",!0);class ComponentListWithSelectableType extends ComponentWithSelectableType{static createAttributesObject(){let rs=super.createAttributesObject();return rs.type={createPrimitiveOfType:"string"},rs}static returnSugarInstructions(){let rs=[];return rs.push({replacementFunction:function({matchedChildren:ns,componentAttributes:ss,parentAttributes:os,isAttributeComponent:ls=!1,createdFromMacro:us=!1,componentInfoObjects:cs}){let ds=ss.type;ds||(ds=os.type),ds?["number","letters","math","text","boolean"].includes(ds)||(console.warn(`Invalid type ${ds}, setting type to number`),ds="number"):ds="number";let ps=ds==="letters"?"text":ds;return ls&&!us?returnGroupIntoComponentTypeSeparatedBySpaces({componentType:ps})({matchedChildren:ns}):returnBreakStringsIntoComponentTypeBySpaces({componentType:ps})({matchedChildren:ns})}}),rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return delete rs.value,rs.nValues={additionalStateVariablesDefined:["childForValue"],returnDependencies:()=>({anythingForSelectedType:{dependencyType:"child",childGroups:["anything"],variableNames:["nValues"],variablesOptional:!0}}),definition({dependencyValues:ns}){let ss=0,os=[];for(let[ls,us]of ns.anythingForSelectedType.entries()){let cs=Number.isInteger(us.stateValues.nValues)?us.stateValues.nValues:1;ss+=cs;for(let ds=0;ds({nValues:{dependencyType:"stateVariable",variableName:"nValues"}}),returnArraySize({dependencyValues:ns}){return[ns.nValues]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={type:{dependencyType:"stateVariable",variableName:"type"}},ls={};for(let us of ns){let cs=ss.childForValue[us];ls[us]={anythingForSelectedType:{dependencyType:"child",childGroups:["anything"],variableNames:["value","values"],childIndices:[cs.child],variablesOptional:!0},valueIndex:{dependencyType:"value",value:cs.valueIndex}}}return{globalDependencies:os,dependenciesByKey:ls}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os,componentName:ls}){let us={};for(let cs of os)if(ss[cs].anythingForSelectedType&&ss[cs].anythingForSelectedType.length===1){let ds=ss[cs].anythingForSelectedType[0],ps;ds.stateValues.values?ps=ds.stateValues.values[ss[cs].valueIndex]:ps=ds.stateValues.value,us[cs]=convertValueToType(ps,ns.type)}return{setValue:{values:us},setCreateComponentOfType:{values:ns.type}}}},rs}}zs(ComponentListWithSelectableType,"componentType","_componentListWithSelectableType"),zs(ComponentListWithSelectableType,"includeBlankStringChildren",!0),zs(ComponentListWithSelectableType,"removeBlankStringChildrenPostSugar",!0);class ComponentListOfListsWithSelectableType extends ComponentWithSelectableType{static createAttributesObject(){let rs=super.createAttributesObject();return rs.type={createPrimitiveOfType:"string"},rs}static returnSugarInstructions(){let rs=[],ns=function({matchedChildren:ss,componentAttributes:os,parentAttributes:ls}){let us=breakEmbeddedStringsIntoParensPieces({componentList:ss,removeParens:!0});if(us.success!==!0)return{success:!1};let cs=os.type;return cs||(cs=ls.type),cs?["number","letters","math","text","boolean"].includes(cs)||(console.warn(`Invalid type ${cs}, setting type to number`),cs="number"):cs="number",{success:!0,newChildren:us.pieces.map(ds=>({componentType:"_componentListWithSelectableType",attributes:{type:{primitive:cs}},children:ds}))}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"lists",componentTypes:["_componentListWithSelectableType"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return delete rs.value,rs.nLists={returnDependencies:()=>({listChildren:{dependencyType:"child",childGroups:["lists"]}}),definition({dependencyValues:ns}){return{setValue:{nLists:ns.listChildren.length}}}},rs.lists={isArray:!0,entryPrefixes:["list"],returnArraySizeDependencies:()=>({nLists:{dependencyType:"stateVariable",variableName:"nLists"}}),returnArraySize({dependencyValues:ns}){return[ns.nLists]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={type:{dependencyType:"stateVariable",variableName:"type"}},os={};for(let ls of ns)os[ls]={listChildren:{dependencyType:"child",childGroups:["lists"],variableNames:["values","type"],childIndices:[ls]}};return{globalDependencies:ss,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os)if(ss[us].listChildren&&ss[us].listChildren.length===1){let cs=ss[us].listChildren[0];cs.stateValues.type===ns.type?ls[us]=cs.stateValues.values:ls[us]=cs.stateValues.values.map(ds=>convertValueToType(ds,ns.type))}return{setValue:{lists:ls}}}},rs}}zs(ComponentListOfListsWithSelectableType,"componentType","_componentListOfListsWithSelectableType");function convertValueToType(as,rs){if(Array.isArray(as)&&(as=as[0]),rs==="number")return as instanceof Context.class?as.evaluate_to_constant():Number(as);if(rs==="math"){if(typeof as=="string")try{return Context.fromAst(textToAst.convert(as))}catch{}return convertValueToMathExpression(as)}else return rs==="boolean"?!!as:String(as)}const ComponentWithSelectableType$1=Object.freeze(Object.defineProperty({__proto__:null,ComponentListOfListsWithSelectableType,ComponentListWithSelectableType,ComponentWithSelectableType},Symbol.toStringTag,{value:"Module"}));var Ku;let SideBySide$1=(Ku=class extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.width={createComponentOfType:"_componentSize"},rs.widths={createComponentOfType:"_componentSizeList"},rs.margins={createComponentOfType:"_componentSizeList"},rs.valign={createComponentOfType:"text"},rs.valigns={createComponentOfType:"textList"},rs}static returnChildGroups(){return[{group:"blocks",componentTypes:["_block"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.nPanels={forRenderer:!0,returnDependencies:()=>({blockChildren:{dependencyType:"child",childGroups:["blocks"],skipComponentNames:!0}}),definition({dependencyValues:ns}){return{setValue:{nPanels:ns.blockChildren.length},checkForActualChange:{nPanels:!0}}}},rs.essentialWidths={isArray:!0,entryPrefixes:["essentialWidth"],defaultValueByArrayKey:()=>null,hasEssential:!0,returnArraySizeDependencies:()=>({nPanels:{dependencyType:"stateVariable",variableName:"nPanels"}}),returnArraySize({dependencyValues:ns}){return[ns.nPanels]},returnArrayDependenciesByKey:()=>({}),arrayDefinitionByKey({arrayKeys:ns}){let ss={};for(let os of ns)ss[os]=!0;return{useEssentialOrDefaultValue:{essentialWidths:ss}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns}){let ss={};for(let os in ns.essentialWidths)ss[os]=ns.essentialWidths[os];return{success:!0,instructions:[{setEssentialValue:"essentialWidths",value:ss}]}}},rs.allWidthsSpecified={additionalStateVariablesDefined:["widthsAbsolute"],returnDependencies(){return{nPanels:{dependencyType:"stateVariable",variableName:"nPanels"},widthAttr:{dependencyType:"attributeComponent",attributeName:"width",variableNames:["componentSize"]},widthsAttr:{dependencyType:"attributeComponent",attributeName:"widths",variableNames:["nComponents","componentSizes"]},parentWidths:{dependencyType:"parentStateVariable",parentComponentType:"sbsGroup",variableName:"specifiedWidths"},parentWidthsAbsolute:{dependencyType:"parentStateVariable",parentComponentType:"sbsGroup",variableName:"widthsAbsolute"},essentialWidth:{dependencyType:"stateVariable",variableName:"essentialWidths"}}},definition({dependencyValues:ns}){let ss=[],os=null,ls,us=!1;ns.widthsAttr!==null?ls=ns.widthsAttr.stateValues.nComponents:ns.widthAttr!==null?(ls=ns.nPanels,us=!0):ls=0;for(let cs=0;csNumber.isFinite(cs)?cs:null),{setValue:{allWidthsSpecified:ss,widthsAbsolute:os}}}},rs.essentialMargins={isArray:!0,entryPrefixes:["essentialMargin"],hasEssential:!0,defaultValueByArrayKey:()=>null,returnArraySizeDependencies:()=>({}),returnArraySize(){return[2]},returnArrayDependenciesByKey:()=>({}),arrayDefinitionByKey({arrayKeys:ns}){let ss={};for(let os of ns)ss[os]=!0;return{useEssentialOrDefaultValue:{essentialMargins:ss}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns}){let ss={};for(let os in ns.essentialMargins)ss[os]=ns.essentialMargins[os];return{success:!0,instructions:[{setEssentialValue:"essentialMargins",value:ss}]}}},rs.allMarginsSpecified={additionalStateVariablesDefined:["marginsAbsolute"],returnDependencies(){return{nPanels:{dependencyType:"stateVariable",variableName:"nPanels"},marginsAttr:{dependencyType:"attributeComponent",attributeName:"margins",variableNames:["nComponents","componentSizes"]},parentMargins:{dependencyType:"parentStateVariable",parentComponentType:"sbsGroup",variableName:"specifiedMargins"},parentMarginsAbsolute:{dependencyType:"parentStateVariable",parentComponentType:"sbsGroup",variableName:"marginsAbsolute"},essentialMargins:{dependencyType:"stateVariable",variableName:"essentialMargins"}}},definition({dependencyValues:ns}){let ss=[],os=null;if(ns.marginsAttr===null)if(ns.parentMargins){os=ns.parentMarginsAbsolute;for(let ls=0;ls<2;ls++)ns.essentialMargins[ls]===null?ss[ls]=ns.parentMargins[ls]:ss[ls]=ns.essentialMargins[ls]}else for(let ls=0;ls<2;ls++)ss[ls]=ns.essentialMargins[ls];else if(ns.marginsAttr.stateValues.nComponents===0)for(let ls=0;ls<2;ls++)ss[ls]=ns.essentialMargins[ls];else if(ns.marginsAttr.stateValues.nComponents===1){let ls=null;ns.marginsAttr.stateValues.componentSizes[0]&&(ls=ns.marginsAttr.stateValues.componentSizes[0].size,Number.isFinite(ls)||(ls=null),os=!!ns.marginsAttr.stateValues.componentSizes[0].isAbsolute),ss=[ls,ls]}else{ns.marginsAttr.stateValues.componentSizes[0]?os=!!ns.marginsAttr.stateValues.componentSizes[0].isAbsolute:os=!1;let ls;if(ns.marginsAttr.stateValues.componentSizes[1]?ls=!!ns.marginsAttr.stateValues.componentSizes[1].isAbsolute:ls=!1,ls!==os)throw Error("SideBySide is not implemented for absolute measurements");ss=ns.marginsAttr.stateValues.componentSizes.slice(0,2).map(us=>us&&Number.isFinite(us.size)?us.size:null)}return{setValue:{allMarginsSpecified:ss,marginsAbsolute:os}}}},rs.absoluteMeasurements={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},forRenderer:!0,returnDependencies:()=>({widthsAbsolute:{dependencyType:"stateVariable",variableName:"widthsAbsolute"},marginsAbsolute:{dependencyType:"stateVariable",variableName:"marginsAbsolute"}}),definition({dependencyValues:ns}){let ss;if(ns.widthsAbsolute===null)ns.marginsAbsolute===null?ss=!1:ss=ns.marginsAbsolute;else if(ns.marginsAbsolute===null)ss=ns.widthsAbsolute;else{if(ns.widthsAbsolute!==ns.marginsAbsolute)throw Error("SideBySide is not implemented for absolute measurements");ss=ns.widthsAbsolute}if(ss===!0)throw Error("SideBySide is not implemented for absolute measurements");return{setValue:{absoluteMeasurements:ss}}}},rs.allWidths={additionalStateVariablesDefined:["allMargins",{variableName:"gapWidth",public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0}],returnDependencies:()=>({nPanels:{dependencyType:"stateVariable",variableName:"nPanels"},allWidthsSpecified:{dependencyType:"stateVariable",variableName:"allWidthsSpecified"},allMarginsSpecified:{dependencyType:"stateVariable",variableName:"allMarginsSpecified"},absoluteMeasurements:{dependencyType:"stateVariable",variableName:"absoluteMeasurements"}}),definition({dependencyValues:ns}){let ss=0,os=[...ns.allWidthsSpecified],ls=[...ns.allMarginsSpecified],us=0,cs=0;for(let fs=0;fs=100){let fs=100/(us+ds);for(let hs=0;hs0){let fs=(100-(us+ds))/cs;for(let hs=0;hs0){let fs=(100-(us+ds))/(ps*ns.nPanels);for(let hs=0;hs<2;hs++)ls[hs]===null&&(ls[hs]=fs)}else ns.nPanels>1?ss=(100-(us+ds))/(ns.nPanels-1):ns.nPanels===1?ls[1]=100-(ls[0]+os[0]):console.warn("Invalid sideBySide, as it must have at least one block child");return{setValue:{allWidths:os,allMargins:ls,gapWidth:ss}}}},rs.widths={public:!0,isArray:!0,shadowingInstructions:{createComponentOfType:"number"},entryPrefixes:["width"],forRenderer:!0,returnArraySizeDependencies:()=>({nPanels:{dependencyType:"stateVariable",variableName:"nPanels"}}),returnArraySize({dependencyValues:ns}){return[ns.nPanels]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={allWidths:{dependencyType:"stateVariable",variableName:"allWidths"},widthsAttr:{dependencyType:"attributeComponent",attributeName:"widths",variableNames:["nComponents"]},widthAttr:{dependencyType:"attributeComponent",attributeName:"width",variableNames:["componentSize"]},absoluteMeasurements:{dependencyType:"stateVariable",variableName:"absoluteMeasurements"}},os={};for(let ls of ns){let us=Number(ls)+1;os[ls]={widthsAttr:{dependencyType:"attributeComponent",attributeName:"widths",variableNames:[`componentSize${us}`]},essentialWidth:{dependencyType:"stateVariable",variableName:`essentialWidth${us}`}}}return{globalDependencies:ss,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,arrayKeys:ss}){let os={};for(let ls of ss)os[ls]=ns.allWidths[ls];return{setValue:{widths:os}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyNamesByKey:ss,dependencyValuesByKey:os,globalDependencyValues:ls,arraySize:us}){let cs,ds=!1;ls.widthsAttr!==null?cs=ls.widthsAttr.stateValues.nComponents:ls.widthAttr!==null?(cs=us[0],ds=!0):cs=0;let ps=[];for(let fs in ns.widths)Number(fs)({}),returnArraySize(){return[2]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={allMargins:{dependencyType:"stateVariable",variableName:"allMargins"},marginsAttr:{dependencyType:"attributeComponent",attributeName:"margins",variableNames:["componentSize1","componentSize2","nComponents"]},absoluteMeasurements:{dependencyType:"stateVariable",variableName:"absoluteMeasurements"}},os={};for(let ls of ns){let us=Number(ls)+1;os[ls]={essentialMargin:{dependencyType:"stateVariable",variableName:`essentialMargin${us}`}}}return{globalDependencies:ss,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,arrayKeys:ss}){let os={};for(let ls of ss)os[ls]=ns.allMargins[ls];return{setValue:{margins:os}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyNamesByKey:os}){let ls=[];if(ss.marginsAttr===null)for(let us in ns.margins)ls.push({setDependency:os[us].essentialMargin,desiredValue:ns.margins[us]});else if(!(ss.marginsAttr.stateValues.componentSize1&&Number.isFinite(ss.marginsAttr.stateValues.componentSize1.size)))"0"in ns.margins?ls.push({setDependency:"marginsAttr",desiredValue:{size:ns.margins[0],isAbsolute:ss.absoluteMeasurements},variableIndex:0}):ls.push({setDependency:"marginsAttr",desiredValue:{size:ns.margins[1],isAbsolute:ss.absoluteMeasurements},variableIndex:0}),"1"in ns.margins&&ss.marginsAttr.stateValues.nComponents>1&&ls.push({setDependency:"marginsAttr",desiredValue:{size:ns.margins[1],isAbsolute:ss.absoluteMeasurements},variableIndex:1});else{let us=ss.marginsAttr.stateValues.nComponents===1;for(let cs in ns.margins)us?ls.push({setDependency:"marginsAttr",desiredValue:{size:ns.margins[cs],isAbsolute:ss.absoluteMeasurements},variableIndex:0}):ls.push({setDependency:"marginsAttr",desiredValue:{size:ns.margins[cs],isAbsolute:ss.absoluteMeasurements},variableIndex:cs})}return{success:!0,instructions:ls}}},rs.essentialValigns={isArray:!0,entryPrefixes:["essentialValign"],defaultValueByArrayKey:()=>null,hasEssential:!0,returnArraySizeDependencies:()=>({nPanels:{dependencyType:"stateVariable",variableName:"nPanels"}}),returnArraySize({dependencyValues:ns}){return[ns.nPanels]},returnArrayDependenciesByKey:()=>({}),arrayDefinitionByKey({arrayKeys:ns}){let ss={};for(let os of ns)ss[os]=!0;return{useEssentialOrDefaultValue:{essentialValigns:ss}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns}){let ss={};for(let os in ns.essentialValigns)ss[os]=ns.essentialValigns[os];return{success:!0,instructions:[{setEssentialValue:"essentialValigns",value:ss}]}}},rs.valigns={public:!0,isArray:!0,shadowingInstructions:{createComponentOfType:"text"},entryPrefixes:["valign"],forRenderer:!0,returnArraySizeDependencies:()=>({nPanels:{dependencyType:"stateVariable",variableName:"nPanels"}}),returnArraySize({dependencyValues:ns}){return[ns.nPanels]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={valignAttr:{dependencyType:"attributeComponent",attributeName:"valign",variableNames:["value"]},valignsAttr:{dependencyType:"attributeComponent",attributeName:"valigns",variableNames:["nComponents"]}},os={};for(let ls of ns){let us=Number(ls)+1;os[ls]={valignsAttr:{dependencyType:"attributeComponent",attributeName:"valigns",variableNames:[`text${us}`]},parentValign:{dependencyType:"parentStateVariable",parentComponentType:"sbsGroup",variableName:`valign${us}`},parentValignAbsolute:{dependencyType:"parentStateVariable",parentComponentType:"sbsGroup",variableName:`valignAbsolute${us}`},essentialValign:{dependencyType:"stateVariable",variableName:`essentialValign${us}`}}}return{globalDependencies:ss,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os,arraySize:ls}){let us={},cs,ds=!1;ns.valignsAttr!==null?cs=ns.valignsAttr.stateValues.nComponents:ns.valignAttr!==null?(cs=ls[0],ds=!0):cs=0;for(let ps of os){let fs=Number(ps);if(fs({sideBySideChildren:{dependencyType:"child",childGroups:["sideBySides"],variableNames:["nPanels"]}}),definition({dependencyValues:ns}){return{setValue:{maxNPanelsPerRow:Context.math.max(ns.sideBySideChildren.map(ss=>ss.stateValues.nPanels))},checkForActualChange:{maxNPanelsPerRow:!0}}}},rs.specifiedWidths={additionalStateVariablesDefined:[{variableName:"widthsAbsoluteArray",isArray:!0}],isArray:!0,entryPrefixes:["specifiedWidth"],hasEssential:!0,defaultValueByArrayKey:()=>null,returnArraySizeDependencies:()=>({maxNPanelsPerRow:{dependencyType:"stateVariable",variableName:"maxNPanelsPerRow"}}),returnArraySize({dependencyValues:ns}){return[ns.maxNPanelsPerRow]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={widthAttr:{dependencyType:"attributeComponent",attributeName:"width",variableNames:["componentSize"]},widthsAttr:{dependencyType:"attributeComponent",attributeName:"widths",variableNames:["nComponents"]}},os={};for(let ls of ns){let us=Number(ls)+1;os[ls]={widthsAttr:{dependencyType:"attributeComponent",attributeName:"widths",variableNames:[`componentSize${us}`]}}}return{globalDependencies:ss,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os,arraySize:ls}){let us={},cs={},ds={},ps,fs=!1;ns.widthsAttr!==null?ps=ns.widthsAttr.stateValues.nComponents:ns.widthAttr!==null?(ps=ls[0],fs=!0):ps=0;for(let gs of os){let ys=Number(gs);if(ys0&&(hs.useEssentialOrDefaultValue={specifiedWidths:cs}),hs},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyNamesByKey:ss,globalDependencyValues:os,stateValues:ls,arraySize:us}){let cs,ds=!1;os.widthsAttr!==null?cs=os.widthsAttr.stateValues.nComponents:os.widthAttr!==null?(cs=us[0],ds=!0):cs=0;let ps=[];for(let fs in ns.specifiedWidths)Number(fs)({widthsAbsoluteArray:{dependencyType:"stateVariable",variableName:"widthsAbsoluteArray"}}),definition({dependencyValues:ns}){let ss=null;for(let os in ns.widthsAbsoluteArray){let ls=ns.widthsAbsoluteArray[os];if(ls!==null){if(ls=!!ls,ss===null)ss=ls;else if(ss!==ls)throw Error("SbsGroup is not implemented for absolute measurements")}}return{setValue:{widthsAbsolute:ss}}}},rs.specifiedMargins={additionalStateVariablesDefined:[{variableName:"marginsAbsoluteArray",isArray:!0,entryPrefixes:["marginAbsolute"]}],isArray:!0,entryPrefixes:["specifiedMargin"],hasEssential:!0,defaultValueByArrayKey:()=>null,returnArraySizeDependencies:()=>({}),returnArraySize(){return[2]},returnArrayDependenciesByKey({arrayKeys:ns}){return{globalDependencies:{marginsAttr:{dependencyType:"attributeComponent",attributeName:"margins",variableNames:["componentSize1","componentSize2","nComponents"]}}}},arrayDefinitionByKey({dependencyValuesByKey:ns,globalDependencyValues:ss,arrayKeys:os}){let ls={},us={},cs={};if(ss.marginsAttr===null||ss.marginsAttr.stateValues.nComponents===0)for(let ps of os)us[ps]=!0,cs[ps]=null;else if(ss.marginsAttr.stateValues.nComponents===1){let ps=null,fs=null;ss.marginsAttr.stateValues.componentSize1&&(ps=ss.marginsAttr.stateValues.componentSize1.size,Number.isFinite(ps)||(ps=null),fs=!!ss.marginsAttr.stateValues.componentSize1.isAbsolute);for(let hs of os)ls[hs]=ps,cs[hs]=fs}else for(let ps of os)if(ss.marginsAttr.stateValues[`componentSize${Number(ps)+1}`]){let fs=ss.marginsAttr.stateValues[`componentSize${Number(ps)+1}`].size;Number.isFinite(fs)||(fs=null);let hs=!!ss.marginsAttr.stateValues[`componentSize${Number(ps)+1}`].isAbsolute;ls[ps]=fs,cs[ps]=hs}let ds={setValue:{marginsAbsoluteArray:cs,specifiedMargins:ls}};return Object.keys(us).length>0&&(ds.useEssentialOrDefaultValue={specifiedMargins:us}),ds},async inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyNamesByKey:ss,globalDependencyValues:os,stateValues:ls}){let us=[];if(os.marginsAttr===null)us.push({setEssentialValue:"specifiedMargins",value:ns.specifiedMargins});else if(!(os.marginsAttr.stateValues.componentSize1&&Number.isFinite(os.marginsAttr.stateValues.componentSize1.size)))"0"in ns.specifiedMargins?us.push({setDependency:"marginsAttr",desiredValue:{size:ns.specifiedMargins[0],isAbsolute:await ls.marginsAbsolute},variableIndex:0}):us.push({setDependency:"marginsAttr",desiredValue:{size:ns.specifiedMargins[1],isAbsolute:await ls.marginsAbsolute},variableIndex:0}),"1"in ns.specifiedMargins&&os.marginsAttr.stateValues.nComponents>1&&us.push({setDependency:"marginsAttr",desiredValue:{size:ns.specifiedMargins[1],isAbsolute:await ls.marginsAbsolute},variableIndex:1});else{let cs=os.marginsAttr.stateValues.nComponents===1;for(let ds in ns.specifiedMargins)cs?us.push({setDependency:"marginsAttr",desiredValue:{size:ns.specifiedMargins[ds],isAbsolute:await ls.marginsAbsolute},variableIndex:0}):us.push({setDependency:"marginsAttr",desiredValue:{size:ns.specifiedMargins[ds],isAbsolute:await ls.marginsAbsolute},variableIndex:ds})}return{success:!0,instructions:us}}},rs.marginsAbsolute={returnDependencies:()=>({marginsAbsoluteArray:{dependencyType:"stateVariable",variableName:"marginsAbsoluteArray"}}),definition({dependencyValues:ns}){let ss=null;for(let os in ns.marginsAbsoluteArray){let ls=ns.marginsAbsoluteArray[os];if(ls!==null){if(ls=!!ls,ss===null)ss=ls;else if(ss!==ls)throw Error("SbsGroup is not implemented for absolute measurements")}}return{setValue:{marginsAbsolute:ss}}}},rs.absoluteMeasurements={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},returnDependencies:()=>({widthsAbsolute:{dependencyType:"stateVariable",variableName:"widthsAbsolute"},marginsAbsolute:{dependencyType:"stateVariable",variableName:"marginsAbsolute"}}),definition({dependencyValues:ns}){let ss;if(ns.widthsAbsolute===null)ns.marginsAbsolute===null?ss=!1:ss=ns.marginsAbsolute;else if(ns.marginsAbsolute===null)ss=ns.widthsAbsolute;else{if(ns.widthsAbsolute!==ns.marginsAbsolute)throw Error("SbsGroup is not implemented for absolute measurements");ss=ns.widthsAbsolute}if(ss===!0)throw Error("SbsGroup is not implemented for absolute measurements");return{setValue:{absoluteMeasurements:ss}}}},rs.allWidths={additionalStateVariablesDefined:["allMargins",{variableName:"gapWidth",public:!0,shadowingInstructions:{createComponentOfType:"number"}}],returnDependencies:()=>({maxNPanelsPerRow:{dependencyType:"stateVariable",variableName:"maxNPanelsPerRow"},specifiedWidths:{dependencyType:"stateVariable",variableName:"specifiedWidths"},specifiedMargins:{dependencyType:"stateVariable",variableName:"specifiedMargins"},absoluteMeasurements:{dependencyType:"stateVariable",variableName:"absoluteMeasurements"}}),definition({dependencyValues:ns}){let ss=0,os=[...ns.specifiedWidths],ls=[...ns.specifiedMargins],us=0,cs=0;for(let fs=0;fs=100){let fs=100/(us+ds);for(let hs=0;hs0){let fs=(100-(us+ds))/cs;for(let hs=0;hs0){let fs=(100-(us+ds))/(ps*ns.maxNPanelsPerRow);for(let hs=0;hs<2;hs++)ls[hs]===null&&(ls[hs]=fs)}else ns.maxNPanelsPerRow>1?ss=(100-(us+ds))/(ns.maxNPanelsPerRow-1):ns.maxNPanelsPerRow===1?ls[1]=100-(ls[0]+os[0]):console.warn("Invalid sideBySide, as it must have at least one block child");return{setValue:{allWidths:os,allMargins:ls,gapWidth:ss}}}},rs.widths={public:!0,isArray:!0,shadowingInstructions:{createComponentOfType:"number"},entryPrefixes:["width"],returnArraySizeDependencies:()=>({maxNPanelsPerRow:{dependencyType:"stateVariable",variableName:"maxNPanelsPerRow"}}),returnArraySize({dependencyValues:ns}){return[ns.maxNPanelsPerRow]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={allWidths:{dependencyType:"stateVariable",variableName:"allWidths"}},os={};for(let ls of ns){let us=Number(ls)+1;os[ls]={specifiedWidth:{dependencyType:"stateVariable",variableName:`specifiedWidth${us}`}}}return{globalDependencies:ss,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,arrayKeys:ss}){let os={};for(let ls of ss)os[ls]=ns.allWidths[ls];return{setValue:{widths:os}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyNamesByKey:ss}){let os=[];for(let ls in ns.widths)os.push({setDependency:ss[ls].specifiedWidth,desiredValue:ns.widths[ls],variableIndex:0});return{success:!0,instructions:os}}},rs.margins={public:!0,isArray:!0,shadowingInstructions:{createComponentOfType:"number"},entryPrefixes:["margin"],returnArraySizeDependencies:()=>({}),returnArraySize(){return[2]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={allMargins:{dependencyType:"stateVariable",variableName:"allMargins"}},os={};for(let ls of ns){let us=Number(ls)+1;os[ls]={specifiedMargin:{dependencyType:"stateVariable",variableName:`specifiedMargin${us}`}}}return{globalDependencies:ss,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,arrayKeys:ss}){let os={};for(let ls of ss)os[ls]=ns.allMargins[ls];return{setValue:{margins:os}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyNamesByKey:ss}){let os=[];for(let ls in ns.margins)os.push({setDependency:ss[ls].specifiedMargin,desiredValue:ns.margins[ls],variableIndex:0});return{success:!0,instructions:os}}},rs.valigns={public:!0,isArray:!0,shadowingInstructions:{createComponentOfType:"text"},entryPrefixes:["valign"],hasEssential:!0,defaultValueByArrayKey:()=>"top",returnArraySizeDependencies:()=>({maxNPanelsPerRow:{dependencyType:"stateVariable",variableName:"maxNPanelsPerRow"}}),returnArraySize({dependencyValues:ns}){return[ns.maxNPanelsPerRow]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={valignAttr:{dependencyType:"attributeComponent",attributeName:"valign",variableNames:["value"]},valignsAttr:{dependencyType:"attributeComponent",attributeName:"valigns",variableNames:["nComponents"]}},os={};for(let ls of ns){let us=Number(ls)+1;os[ls]={valignsAttr:{dependencyType:"attributeComponent",attributeName:"valigns",variableNames:[`text${us}`]}}}return{globalDependencies:ss,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os,arraySize:ls}){let us={},cs={},ds,ps=!1;ns.valignsAttr!==null?ds=ns.valignsAttr.stateValues.nComponents:ns.valignAttr!==null?(ds=ls[0],ps=!0):ds=0;for(let hs of os){let gs=Number(hs);if(gs0&&(fs.setValue={valigns:us}),Object.keys(cs).length>0&&(fs.useEssentialOrDefaultValue={valigns:cs}),fs},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyNamesByKey:ss,globalDependencyValues:os,arraySize:ls}){let us,cs=!1;os.valignsAttr!==null?us=os.valignsAttr.stateValues.nComponents:os.valignAttr!==null?(us=ls[0],cs=!0):us=0;let ds=[];for(let ps in ns.valigns){let fs=ns.valigns[ps].toLowerCase();if(!["top","middle","bottom"].includes(fs))continue;Number(ps)({stringTextChildren:{dependencyType:"child",childGroups:["stringsTexts"],variableNames:["value"]},hChildren:{dependencyType:"child",childGroups:["hs"],variableNames:["value"]}}),definition({dependencyValues:ns}){let ss;if(ns.hChildren.length>0)ss=ns.hChildren.map(os=>os.stateValues.value);else{let os="";for(let ls of ns.stringTextChildren)typeof ls=="string"?os+=ls:os+=ls.stateValues.value;ss=[os]}return{setValue:{terms:ss}}}},rs}}zs(Idx,"componentType","idx"),zs(Idx,"rendererType");const Indexing=Object.freeze(Object.defineProperty({__proto__:null,H:H$2,Idx},Symbol.toStringTag,{value:"Module"}));class Div extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static returnChildGroups(){return[{group:"anything",componentTypes:["_base"]}]}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}}zs(Div,"componentType","div"),zs(Div,"rendererType","containerBlock"),zs(Div,"renderChildren",!0);class Span extends InlineComponent{static returnChildGroups(){return[{group:"anything",componentTypes:["_base"]}]}}zs(Span,"componentType","span"),zs(Span,"rendererType","containerInline"),zs(Span,"renderChildren",!0);const Divisions=Object.freeze(Object.defineProperty({__proto__:null,Div,Span},Symbol.toStringTag,{value:"Module"}));class Pre extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static returnChildGroups(){return[{group:"allChildren",componentTypes:["_base"]}]}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}}zs(Pre,"componentType","pre"),zs(Pre,"renderChildren",!0),zs(Pre,"includeBlankStringChildren",!0);class DisplayDoenetML extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static returnChildGroups(){return[{group:"allChildren",componentTypes:["_base"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.value={returnDependencies:()=>({childrenDoenetML:{dependencyType:"doenetML",displayOnlyChildren:!0}}),definition({dependencyValues:ns}){return{setValue:{value:ns.childrenDoenetML}}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition:({dependencyValues:ns})=>({setValue:{text:ns.value}})},rs}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}}zs(DisplayDoenetML,"componentType","displayDoenetML"),zs(DisplayDoenetML,"rendererType","text"),zs(DisplayDoenetML,"includeBlankStringChildren",!0);const Verbatim=Object.freeze(Object.defineProperty({__proto__:null,DisplayDoenetML,Pre},Symbol.toStringTag,{value:"Module"}));class Paginator extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{setPage:this.setPage.bind(this),recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.initialPage={createComponentOfType:"integer",createStateVariable:"initialPage",defaultValue:1},rs}static returnChildGroups(){return[{group:"anything",componentTypes:["_base"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.nPages={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({children:{dependencyType:"child",childGroups:["anything"]}}),definition({dependencyValues:ns}){return{setValue:{nPages:ns.children.length}}}},rs.currentPage={public:!0,shadowingInstructions:{createComponentOfType:"integer"},hasEssential:!0,returnDependencies:()=>({initialPage:{dependencyType:"stateVariable",variableName:"initialPage"},nPages:{dependencyType:"stateVariable",variableName:"nPages"}}),definition({dependencyValues:ns}){return{useEssentialOrDefaultValue:{currentPage:{get defaultValue(){let ss=ns.initialPage;return Number.isInteger(ss)?Math.max(1,Math.min(ns.nPages,ss)):1}}}}},async inverseDefinition({desiredStateVariableValues:ns,stateValues:ss,sourceDetails:os={}}){if(!os.fromSetPage)return{success:!1};let ls=Number(ns.currentPage);return Number.isInteger(ls)?(ls=Math.max(1,Math.min(await ss.nPages,ls)),{success:!0,instructions:[{setEssentialValue:"currentPage",value:ls}]}):{success:!1}}},rs.childIndicesToRender={returnDependencies:()=>({currentPage:{dependencyType:"stateVariable",variableName:"currentPage"}}),definition({dependencyValues:ns}){return{setValue:{childIndicesToRender:[ns.currentPage-1]}}},markStale:()=>({updateRenderedChildren:!0})},rs}async setPage({number:rs,actionId:ns,sourceInformation:ss={},skipRendererUpdate:os=!1}){if(!Number.isInteger(rs)){this.coreFunctions.resolveAction({actionId:ns});return}let ls=Math.max(1,Math.min(await this.stateValues.nPages,rs)),us=[{updateType:"updateValue",componentName:this.componentName,stateVariable:"currentPage",value:ls,sourceDetails:{fromSetPage:!0}}];await this.coreFunctions.performUpdate({updateInstructions:us,actionId:ns,sourceInformation:ss,skipRendererUpdate:os,event:{verb:"selected",object:{componentName:this.componentName,componentType:this.componentType},result:{response:ls,responseText:ls.toString()}}})}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}}zs(Paginator,"componentType","paginator"),zs(Paginator,"rendererType","containerBlock"),zs(Paginator,"renderChildren",!0);class PaginatorControls extends BlockComponent{constructor(rs){super(rs),this.externalActions={},Object.defineProperty(this.externalActions,"setPage",{enumerable:!0,get:async function(){let ns=await this.stateValues.paginatorComponentName;if(ns)return{componentName:ns,actionName:"setPage"}}.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.previousLabel={createComponentOfType:"text",createStateVariable:"previousLabel",defaultValue:"Previous",forRenderer:!0,public:!0},rs.nextLabel={createComponentOfType:"text",createStateVariable:"nextLabel",defaultValue:"Next",forRenderer:!0,public:!0},rs.pageLabel={createComponentOfType:"text",createStateVariable:"pageLabel",defaultValue:"Page",forRenderer:!0,public:!0},rs.paginator={createTargetComponentNames:!0},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.paginatorComponentName={returnDependencies:()=>({paginator:{dependencyType:"attributeTargetComponentNames",attributeName:"paginator"}}),definition({dependencyValues:ns}){var os;let ss;return((os=ns.paginator)==null?void 0:os.length)===1?ss=ns.paginator[0].absoluteName:ss=null,{setValue:{paginatorComponentName:ss}}}},rs.currentPage={forRenderer:!0,stateVariablesDeterminingDependencies:["paginatorComponentName"],returnDependencies({stateValues:ns}){return ns.paginatorComponentName?{paginatorPage:{dependencyType:"stateVariable",componentName:ns.paginatorComponentName,variableName:"currentPage"}}:{}},definition({dependencyValues:ns}){return"paginatorPage"in ns?{setValue:{currentPage:ns.paginatorPage}}:{setValue:{currentPage:1}}}},rs.nPages={forRenderer:!0,stateVariablesDeterminingDependencies:["paginatorComponentName"],returnDependencies({stateValues:ns}){return ns.paginatorComponentName?{paginatorNPages:{dependencyType:"stateVariable",componentName:ns.paginatorComponentName,variableName:"nPages"}}:{}},definition({dependencyValues:ns}){return"paginatorNPages"in ns?{setValue:{nPages:ns.paginatorNPages}}:{setValue:{nPages:1}}}},rs}}zs(PaginatorControls,"componentType","paginatorControls"),zs(PaginatorControls,"renderChildren",!0);const Paginator$1=Object.freeze(Object.defineProperty({__proto__:null,Paginator,PaginatorControls},Symbol.toStringTag,{value:"Module"}));class Input extends InlineComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.collaborateGroups={createComponentOfType:"collaborateGroups",createStateVariable:"collaborateGroups",defaultValue:null,public:!0},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.nValues={returnDependencies:()=>({}),definition:()=>({setValue:{nValues:1}})},rs.answerAncestor={returnDependencies:()=>({answerAncestor:{dependencyType:"ancestor",componentType:"answer",variableNames:["delegateCheckWorkToInput","justSubmitted","creditAchieved","showCorrectness","numberOfAttemptsLeft"]}}),definition:function({dependencyValues:ns}){return{setValue:{answerAncestor:ns.answerAncestor}}}},rs.includeCheckWork={forRenderer:!0,returnDependencies:()=>({answerAncestor:{dependencyType:"stateVariable",variableName:"answerAncestor"}}),definition:function({dependencyValues:ns}){let ss=!1;return ns.answerAncestor&&(ss=ns.answerAncestor.stateValues.delegateCheckWorkToInput),{setValue:{includeCheckWork:ss}}}},rs.suppressCheckwork={forRenderer:!0,returnDependencies:()=>({autoSubmit:{dependencyType:"flag",flagName:"autoSubmit"}}),definition({dependencyValues:ns}){return{setValue:{suppressCheckwork:ns.autoSubmit}}}},rs.creditAchieved={defaultValue:0,public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies:()=>({answerAncestor:{dependencyType:"stateVariable",variableName:"answerAncestor"}}),definition:function({dependencyValues:ns}){let ss=0;return ns.answerAncestor&&(ss=ns.answerAncestor.stateValues.creditAchieved),{setValue:{creditAchieved:ss}}}},rs.valueHasBeenValidated={forRenderer:!0,returnDependencies:()=>({answerAncestor:{dependencyType:"stateVariable",variableName:"answerAncestor"}}),definition:function({dependencyValues:ns}){let ss=!1;return ns.answerAncestor&&ns.answerAncestor.stateValues.justSubmitted&&(ss=!0),{setValue:{valueHasBeenValidated:ss}}}},rs.showCorrectness={forRenderer:!0,returnDependencies:()=>({showCorrectnessFlag:{dependencyType:"flag",flagName:"showCorrectness"},answerAncestor:{dependencyType:"stateVariable",variableName:"answerAncestor"}}),definition({dependencyValues:ns}){let ss;return ns.answerAncestor?ss=ns.answerAncestor.stateValues.showCorrectness:ss=ns.showCorrectnessFlag!==!1,{setValue:{showCorrectness:ss}}}},rs.numberOfAttemptsLeft={forRenderer:!0,returnDependencies:()=>({answerAncestor:{dependencyType:"stateVariable",variableName:"answerAncestor"}}),definition({dependencyValues:ns}){let ss;return ns.answerAncestor?ss=ns.answerAncestor.stateValues.numberOfAttemptsLeft:ss=1/0,{setValue:{numberOfAttemptsLeft:ss}}}},rs}}zs(Input,"componentType","_input");class MatrixInput extends Input{constructor(rs){super(rs),Object.assign(this.actions,{updateNumRows:this.updateNumRows.bind(this),updateNumColumns:this.updateNumColumns.bind(this)}),this.externalActions={},Object.defineProperty(this.externalActions,"submitAnswer",{enumerable:!0,get:async function(){let ns=await this.stateValues.answerAncestor;if(ns!==null)return{componentName:ns.componentName,actionName:"submitAnswer"}}.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.numRows={createComponentOfType:"integer",createStateVariable:"numRowsPreliminary",defaultValue:1,transformNonFiniteTo:0},rs.numColumns={createComponentOfType:"integer",createStateVariable:"numColumnsPreliminary",defaultValue:1,transformNonFiniteTo:0},rs.showSizeControls={createComponentOfType:"boolean",createStateVariable:"showSizeControls",defaultValue:!0,public:!0,forRenderer:!0},rs.defaultEntry={createComponentOfType:"math",createStateVariable:"defaultEntry",defaultValue:Context.fromAst("_")},rs.prefill={createComponentOfType:"math",createStateVariable:"prefill",defaultValue:Context.fromAst("_"),public:!0,copyComponentAttributesForCreatedComponent:["format","functionSymbols","splitSymbols","parseScientificNotation"]},rs.format={createComponentOfType:"text",createStateVariable:"format",defaultValue:"text",public:!0},rs.functionSymbols={createComponentOfType:"textList",createStateVariable:"functionSymbols",defaultValue:["f","g"],public:!0},rs.splitSymbols={createComponentOfType:"boolean",createStateVariable:"splitSymbols",defaultValue:!0,public:!0},rs.parseScientificNotation={createComponentOfType:"boolean",createStateVariable:"parseScientificNotation",defaultValue:!1,public:!0},rs.displayDigits={createComponentOfType:"integer",createStateVariable:"displayDigits",defaultValue:10,public:!0},rs.displayDecimals={createComponentOfType:"integer",createStateVariable:"displayDecimals",defaultValue:null,public:!0},rs.displaySmallAsZero={createComponentOfType:"number",createStateVariable:"displaySmallAsZero",valueForTrue:1e-14,valueForFalse:0,defaultValue:0,public:!0},rs.bindValueTo={createComponentOfType:"math"},rs.unionFromU={createComponentOfType:"boolean",createStateVariable:"unionFromU",defaultValue:!1,public:!0},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss,componentAttributes:os}){return ss.length>0?{success:!1}:{success:!0,newChildren:[{componentType:"matrixInputGrid"}]}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"matrixComponentInputs",componentTypes:["matrixComponentInput"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.valueOriginal={hasEssential:!0,shadowVariable:!0,returnDependencies:()=>({bindValueTo:{dependencyType:"attributeComponent",attributeName:"bindValueTo",variableNames:["value"]},prefill:{dependencyType:"stateVariable",variableName:"prefill"}}),set:convertValueToMathExpression,definition:function({dependencyValues:ns}){return ns.bindValueTo?{setValue:{valueOriginal:ns.bindValueTo.stateValues.value}}:{useEssentialOrDefaultValue:{valueOriginal:{defaultValue:ns.prefill}}}},inverseDefinition:function({desiredStateVariableValues:ns,dependencyValues:ss}){return ss.bindValueTo?{success:!0,instructions:[{setDependency:"bindValueTo",desiredValue:ns.valueOriginal,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"valueOriginal",value:ns.valueOriginal}]}}},rs.immediateValueOriginal={hasEssential:!0,shadowVariable:!0,returnDependencies:()=>({valueOriginal:{dependencyType:"stateVariable",variableName:"valueOriginal"}}),set:convertValueToMathExpression,definition:function({dependencyValues:ns,changes:ss,justUpdatedForNewComponent:os}){return ss.valueOriginal&&!os?{setValue:{immediateValueOriginal:ns.valueOriginal},setEssentialValue:{immediateValueOriginal:ns.valueOriginal}}:{useEssentialOrDefaultValue:{immediateValueOriginal:{defaultValue:ns.valueOriginal}}}},inverseDefinition:function({desiredStateVariableValues:ns,initialChange:ss,shadowedVariable:os}){let ls=[{setEssentialValue:"immediateValueOriginal",value:ns.immediateValueOriginal}];return ss||os||ls.push({setDependency:"valueOriginal",desiredValue:ns.immediateValueOriginal}),{success:!0,instructions:ls}}},rs.haveBoundValue={returnDependencies:()=>({bindValueTo:{dependencyType:"attributeComponent",attributeName:"bindValueTo"}}),definition({dependencyValues:ns}){return{setValue:{haveBoundValue:ns.bindValueTo!==null}}}},rs.numRows={public:!0,shadowingInstructions:{createComponentOfType:"integer"},forRenderer:!0,returnDependencies:()=>({numRowsPreliminary:{dependencyType:"stateVariable",variableName:"numRowsPreliminary"},valueOriginal:{dependencyType:"stateVariable",variableName:"valueOriginal"},haveBoundValue:{dependencyType:"stateVariable",variableName:"haveBoundValue"}}),definition({dependencyValues:ns,usedDefault:ss}){let os=ns.numRowsPreliminary;if(ss.numRowsPreliminary||ns.haveBoundValue){let ls=ns.valueOriginal.tree;if(os=1,Array.isArray(ls)){let us=ls[0];us==="matrix"?os=ls[1][1]:vectorOperators.includes(us)&&(os=ls.length-1)}}return{setValue:{numRows:os}}},async inverseDefinition({desiredStateVariableValues:ns,dependencyValues:ss,stateValues:os}){let ls=ns.numRows;if(!Number.isInteger(ls))return{success:!1};ls=Math.max(0,ls);let us=[{setDependency:"numRowsPreliminary",desiredValue:ls}];if(ss.haveBoundValue){let cs=ss.valueOriginal.tree,ds=(await os.defaultEntry).tree;if(await os.numColumns===1&&Array.isArray(cs)&&vectorOperators.includes(cs[0])){let ps=cs.length-1;if(lsps){let fs=deepClone(cs),hs=await os.accumulatedComponents;for(let gs=ps;gs({numColumnsPreliminary:{dependencyType:"stateVariable",variableName:"numColumnsPreliminary"},valueOriginal:{dependencyType:"stateVariable",variableName:"valueOriginal"},haveBoundValue:{dependencyType:"stateVariable",variableName:"haveBoundValue"}}),definition({dependencyValues:ns,usedDefault:ss}){let os=ns.numColumnsPreliminary;if(ss.numColumnsPreliminary||ns.haveBoundValue){let ls=ns.valueOriginal.tree;if(os=1,Array.isArray(ls)){let us=ls[0];us==="matrix"?os=ls[1][2]:Array.isArray(ls[1])&&vectorOperators.includes(ls[1][0])&&(us==="^"&&ls[2]==="T"||us==="prime")&&(os=ls[1].length-1)}}return{setValue:{numColumns:os}}},async inverseDefinition({desiredStateVariableValues:ns,dependencyValues:ss,stateValues:os}){let ls=ns.numColumns;if(!Number.isInteger(ls))return{success:!1};ls=Math.max(0,ls);let us=[{setDependency:"numColumnsPreliminary",desiredValue:ls}];if(ss.haveBoundValue){let cs=(await os.defaultEntry).tree,ds=ss.valueOriginal.tree,ps=ds[0];if(Array.isArray(ds[1])&&vectorOperators.includes(ds[1][0])&&(ps==="^"&&ds[2]==="T"||ps==="prime")){let fs=ds[1].length-1;if(lsfs){let hs=deepClone(ds),gs=(await os.accumulatedComponents)[0];gs||(gs=[]);for(let ys=fs;ys({valueOriginal:{dependencyType:"stateVariable",variableName:"valueOriginal"}}),definition({dependencyValues:ns,previousValues:ss}){let os=[];ss.accumulatedComponents&&(os=deepClone(ss.accumulatedComponents));let ls=ns.valueOriginal.tree;if(Array.isArray(ls)){let cs=ls[0];if(cs==="matrix"){let ds=ls[2];for(let[ps,fs]of ds.slice(1).entries()){let hs=os[ps];hs||(hs=os[ps]=[]);for(let[gs,ys]of fs.slice(1).entries())hs[gs]=ys}return{setValue:{accumulatedComponents:os}}}else if(vectorOperators.includes(cs)){for(let[ds,ps]of ls.slice(1).entries()){let fs=os[ds];fs||(fs=os[ds]=[]),fs[0]=ps}return{setValue:{accumulatedComponents:os}}}else if(Array.isArray(ls[1])&&vectorOperators.includes(ls[1][0])&&(cs==="^"&&ls[2]==="T"||cs==="prime")){let ds=os[0];ds||(ds=os[0]=[]);for(let[ps,fs]of ls[1].slice(1).entries())ds[ps]=fs;return{setValue:{accumulatedComponents:os}}}}let us=os[0];return us||(us=os[0]=[]),us[0]=ls,{setValue:{accumulatedComponents:os}}}},rs.componentValues={isArray:!0,entryPrefixes:["componentValue"],nDimensions:2,returnArraySizeDependencies:()=>({numRows:{dependencyType:"stateVariable",variableName:"numRows"},numColumns:{dependencyType:"stateVariable",variableName:"numColumns"}}),returnArraySize({dependencyValues:ns}){return[ns.numRows,ns.numColumns]},returnArrayDependenciesByKey(){return{globalDependencies:{valueOriginal:{dependencyType:"stateVariable",variableName:"valueOriginal"},numRows:{dependencyType:"stateVariable",variableName:"numRows"},numColumns:{dependencyType:"stateVariable",variableName:"numColumns"},accumulatedComponents:{dependencyType:"stateVariable",variableName:"accumulatedComponents"},defaultEntry:{dependencyType:"stateVariable",variableName:"defaultEntry"}}}},arrayDefinitionByKey({globalDependencyValues:ns,arrayKeys:ss}){let os=ns.valueOriginal.tree,ls=ns.accumulatedComponents,us=ns.numRows,cs=ns.numColumns;if(Array.isArray(os)){let ps=os[0];if(ps==="matrix"){if(os[1][1]===us&&os[1][2]===cs){let xs={},Cs=os[2];for(let Ts=0;Tshs)for(let xs=0;xsfs)for(let xs=fs;xs[...ys]);else{let ys=ss.valueOriginal.tree;if(ds){if(gs=ys.slice(1,1+us).map(bs=>[bs]),gs.length1)for(let bs=0;bs1)for(let bs=1;bsbs.slice(1,cs+1)),gs[0].length1&&gs[0].push(...Array(cs-1).fill("_")),us>1)for(let bs=1;bsvs[0])]),treatAsInitialChange:os}]}}else if(us===1&&ps){let ys=ss.valueOriginal.tree,bs=ys[0],vs=[ys[1][0],...gs[0]];return bs==="^"?vs=Context.fromAst(["^",vs,"T"]):vs=Context.fromAst(["prime",vs]),{success:!0,instructions:[{setDependency:"valueOriginal",desiredValue:vs,treatAsInitialChange:os}]}}else{let ys=["matrix",["tuple",ss.numRows,ss.numColumns],["tuple",...gs.map(bs=>["tuple",...bs])]];return{success:!0,instructions:[{setDependency:"valueOriginal",desiredValue:Context.fromAst(ys),treatAsInitialChange:os}]}}}},rs.componentImmediateValues={isArray:!0,entryPrefixes:["componentImmediateValue"],nDimensions:2,returnArraySizeDependencies:()=>({numRows:{dependencyType:"stateVariable",variableName:"numRows"},numColumns:{dependencyType:"stateVariable",variableName:"numColumns"}}),returnArraySize({dependencyValues:ns}){return[ns.numRows,ns.numColumns]},returnArrayDependenciesByKey(){return{globalDependencies:{immediateValueOriginal:{dependencyType:"stateVariable",variableName:"immediateValueOriginal"},numRows:{dependencyType:"stateVariable",variableName:"numRows"},numColumns:{dependencyType:"stateVariable",variableName:"numColumns"},accumulatedComponents:{dependencyType:"stateVariable",variableName:"accumulatedComponents"},defaultEntry:{dependencyType:"stateVariable",variableName:"defaultEntry"}}}},arrayDefinitionByKey({globalDependencyValues:ns,arrayKeys:ss}){let os=ns.immediateValueOriginal.tree,ls=ns.accumulatedComponents,us=ns.numRows,cs=ns.numColumns;if(Array.isArray(os)){let ps=os[0];if(ps==="matrix"){if(os[1][1]===us&&os[1][2]===cs){let xs={},Cs=os[2];for(let Ts=0;Tshs)for(let xs=0;xsfs)for(let xs=fs;xs[...ys]);else{let ys=ss.immediateValueOriginal.tree;if(ds){if(gs=ys.slice(1,1+us).map(bs=>[bs]),gs.length1)for(let bs=0;bs1)for(let bs=1;bsbs.slice(1,cs+1)),gs[0].length1&&gs[0].push(...Array(cs-1).fill("_")),us>1)for(let bs=1;bsvs[0])]),treatAsInitialChange:os}]}}else if(us===1&&ps){let ys=ss.immediateValueOriginal.tree,bs=ys[0],vs=[ys[1][0],...gs[0]];return bs==="^"?vs=Context.fromAst(["^",vs,"T"]):vs=Context.fromAst(["prime",vs]),{success:!0,instructions:[{setDependency:"immediateValueOriginal",desiredValue:vs,treatAsInitialChange:os}]}}else{let ys=["matrix",["tuple",ss.numRows,ss.numColumns],["tuple",...gs.map(bs=>["tuple",...bs])]];return{success:!0,instructions:[{setDependency:"immediateValueOriginal",desiredValue:Context.fromAst(ys),treatAsInitialChange:os}]}}}},rs.componentValuesForDisplay={isArray:!0,entryPrefixes:["componentValueForDisplay"],nDimensions:2,forRenderer:!0,returnArraySizeDependencies:()=>({numRows:{dependencyType:"stateVariable",variableName:"numRows"},numColumns:{dependencyType:"stateVariable",variableName:"numColumns"}}),returnArraySize({dependencyValues:ns}){return[ns.numRows,ns.numColumns]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"}},os={};for(let ls of ns){let[us,cs]=ls.split(","),ds=Number(us)+1+"_"+(Number(cs)+1);os[ls]={componentValue:{dependencyType:"stateVariable",variableName:`componentValue${ds}`}}}return{globalDependencies:ss,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os,usedDefault:ls}){let us={};for(let cs of os){let ds=roundForDisplay({value:ss[cs].componentValue,dependencyValues:ns,usedDefault:ls});us[cs]=ds}return{setValue:{componentValuesForDisplay:us}}}},rs.value={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({componentValues:{dependencyType:"stateVariable",variableName:"componentValues"},numRows:{dependencyType:"stateVariable",variableName:"numRows"},numColumns:{dependencyType:"stateVariable",variableName:"numColumns"},valueOriginal:{dependencyType:"stateVariable",variableName:"valueOriginal"}}),definition({dependencyValues:ns}){let ss=ns.numRows,os=ns.numColumns,ls=["matrix",["tuple",ss,os]],us=ls[2]=["tuple"];for(let cs=0;csds[1])])}]}}}else if(ss.numRows===1){let ls=ss.valueOriginal.tree;if(Array.isArray(ls)){let us=ls[0];if(Array.isArray(ls[1])&&vectorOperators.includes(ls[1][0])&&(us==="^"&&ls[2]==="T"||us==="prime")){let cs=[ls[1][0],...os[2][1].slice(1)];return us==="^"?cs=Context.fromAst(["^",cs,"T"]):cs=Context.fromAst(["prime",cs]),{success:!0,instructions:[{setDependency:"valueOriginal",desiredValue:cs}]}}}}return{success:!0,instructions:[{setDependency:"valueOriginal",desiredValue:ns.value}]}}else return{success:!1}}},rs.immediateValue={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({componentImmediateValues:{dependencyType:"stateVariable",variableName:"componentImmediateValues"},numRows:{dependencyType:"stateVariable",variableName:"numRows"},numColumns:{dependencyType:"stateVariable",variableName:"numColumns"},immediateValueOriginal:{dependencyType:"stateVariable",variableName:"immediateValueOriginal"}}),definition({dependencyValues:ns}){let ss=ns.numRows,os=ns.numColumns,ls=["matrix",["tuple",ss,os]],us=ls[2]=["tuple"];for(let cs=0;csds[1])])}]}}}else if(ss.numRows===1){let ls=ss.immediateValueOriginal.tree;if(Array.isArray(ls)){let us=ls[0];if(Array.isArray(ls[1])&&vectorOperators.includes(ls[1][0])&&(us==="^"&&ls[2]==="T"||us==="prime")){let cs=[ls[1][0],...os[2][1].slice(1)];return us==="^"?cs=Context.fromAst(["^",cs,"T"]):cs=Context.fromAst(["prime",cs]),{success:!0,instructions:[{setDependency:"immediateValueOriginal",desiredValue:cs}]}}}}return{success:!0,instructions:[{setDependency:"immediateValueOriginal",desiredValue:ns.immediateValue}]}}else return{success:!1}}},rs.valueForDisplay={forRenderer:!0,returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"}}),definition:function({dependencyValues:ns,usedDefault:ss}){return{setValue:{valueForDisplay:roundForDisplay({value:ns.value,dependencyValues:ns,usedDefault:ss})}}}},rs.componentType={returnDependencies:()=>({}),definition:()=>({setValue:{componentType:"matrix"}})},rs}async updateNumRows({numRows:rs,actionId:ns,sourceInformation:ss={},skipRendererUpdate:os=!1}){if(await this.stateValues.disabled)this.coreFunctions.resolveAction({actionId:ns});else return await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"numRows",value:rs}],actionId:ns,sourceInformation:ss,skipRendererUpdate:os})}async updateNumColumns({numColumns:rs,actionId:ns,sourceInformation:ss={},skipRendererUpdate:os=!1}){if(await this.stateValues.disabled)this.coreFunctions.resolveAction({actionId:ns});else return await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"numColumns",value:rs}],actionId:ns,sourceInformation:ss,skipRendererUpdate:os})}}zs(MatrixInput,"componentType","matrixInput"),zs(MatrixInput,"variableForPlainMacro","value"),zs(MatrixInput,"variableForPlainCopy","value"),zs(MatrixInput,"processWhenJustUpdatedForNewComponent",!0),zs(MatrixInput,"renderChildren",!0),zs(MatrixInput,"adapters",[{stateVariable:"value",stateVariablesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]}]);class MatrixInputGrid extends CompositeComponent{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.numRows={returnDependencies:()=>({parentNumRows:{dependencyType:"parentStateVariable",parentComponentType:"matrixInput",variableName:"numRows"}}),definition({dependencyValues:ns}){return{setValue:{numRows:ns.parentNumRows}}}},rs.numColumns={returnDependencies:()=>({parentNumColumns:{dependencyType:"parentStateVariable",parentComponentType:"matrixInput",variableName:"numColumns"}}),definition({dependencyValues:ns}){return{setValue:{numColumns:ns.parentNumColumns}}}},rs.readyToExpandWhenResolved={returnDependencies:()=>({numRows:{dependencyType:"stateVariable",variableName:"numRows"},numColumns:{dependencyType:"stateVariable",variableName:"numColumns"}}),markStale(){return{updateReplacements:!0}},definition(){return{setValue:{readyToExpandWhenResolved:!0}}}},rs}static async createSerializedReplacements({component:rs,componentInfoObjects:ns,flags:ss,workspace:os}){let ls=[],us=await rs.stateValues.numRows;os.previousNumRows=us;for(let cs=0;cscs&&(fs=ds-cs,rs.replacementsToWithhold>0))if(rs.replacementsToWithhold>=fs){ps=rs.replacementsToWithhold-fs,cs+=fs,fs=0;let hs={changeType:"changeReplacementsToWithhold",replacementsToWithhold:ps};us.push(hs)}else fs-=rs.replacementsToWithhold,cs+=rs.replacementsToWithhold,ps=0;if(fs>0){let hs=[];for(let ys=cs;ys({}),definition:()=>({useEssentialOrDefaultValue:{rowInd:!0}})},rs.numColumns={returnDependencies:()=>({parentNumColumns:{dependencyType:"parentStateVariable",parentComponentType:"matrixInput",variableName:"numColumns"}}),definition({dependencyValues:ns}){return{setValue:{numColumns:ns.parentNumColumns}}}},rs.readyToExpandWhenResolved={returnDependencies:()=>({numColumns:{dependencyType:"stateVariable",variableName:"numColumns"}}),markStale(){return{updateReplacements:!0}},definition(){return{setValue:{readyToExpandWhenResolved:!0}}}},rs}static async createSerializedReplacements({component:rs,componentInfoObjects:ns,flags:ss,workspace:os}){let ls=[],us=await rs.stateValues.numColumns,cs=await rs.stateValues.rowInd;os.previousNumColumns=us;for(let ds=0;dscs&&(hs=ds-cs,rs.replacementsToWithhold>0))if(rs.replacementsToWithhold>=hs){fs=rs.replacementsToWithhold-hs,cs+=hs,hs=0;let gs={changeType:"changeReplacementsToWithhold",replacementsToWithhold:fs};us.push(gs)}else hs-=rs.replacementsToWithhold,cs+=rs.replacementsToWithhold,fs=0;if(hs>0){let gs=[];for(let bs=cs;bs({}),definition:()=>({useEssentialOrDefaultValue:{rowInd:!0}})},rs.colInd={hasEssential:!0,defaultValue:null,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{colInd:!0}})},rs.format={returnDependencies:()=>({parentFormat:{dependencyType:"parentStateVariable",parentComponentType:"matrixInput",variableName:"format"}}),definition({dependencyValues:ns}){return{setValue:{format:ns.parentFormat}}}},rs.functionSymbols={returnDependencies:()=>({parentFunctionSymbols:{dependencyType:"parentStateVariable",parentComponentType:"matrixInput",variableName:"functionSymbols"}}),definition({dependencyValues:ns}){return{setValue:{functionSymbols:ns.parentFunctionSymbols}}}},rs.splitSymbols={returnDependencies:()=>({parentSplitSymbols:{dependencyType:"parentStateVariable",parentComponentType:"matrixInput",variableName:"splitSymbols"}}),definition({dependencyValues:ns}){return{setValue:{splitSymbols:ns.parentSplitSymbols}}}},rs.parseScientificNotation={returnDependencies:()=>({parentParseScientificNotation:{dependencyType:"parentStateVariable",parentComponentType:"matrixInput",variableName:"parseScientificNotation"}}),definition({dependencyValues:ns}){return{setValue:{parseScientificNotation:ns.parentParseScientificNotation}}}},rs.displayDigits={returnDependencies:()=>({parentDisplayDigits:{dependencyType:"parentStateVariable",parentComponentType:"matrixInput",variableName:"displayDigits"}}),definition({dependencyValues:ns,usedDefault:ss}){let os={setValue:{displayDigits:ns.parentDisplayDigits}};return ss.parentDisplayDigits&&(os.markAsUsedDefault={displayDigits:!0}),os}},rs.displayDecimals={returnDependencies:()=>({parentDisplayDecimals:{dependencyType:"parentStateVariable",parentComponentType:"matrixInput",variableName:"displayDecimals"}}),definition({dependencyValues:ns,usedDefault:ss}){let os={setValue:{displayDecimals:ns.parentDisplayDecimals}};return ss.parentDisplayDecimals&&(os.markAsUsedDefault={displayDecimals:!0}),os}},rs.displaySmallAsZero={returnDependencies:()=>({parentDisplaySmallAsZero:{dependencyType:"parentStateVariable",parentComponentType:"matrixInput",variableName:"displaySmallAsZero"}}),definition({dependencyValues:ns}){return{setValue:{displaySmallAsZero:ns.parentDisplaySmallAsZero}}}},rs.unionFromU={returnDependencies:()=>({parentUnionFromU:{dependencyType:"parentStateVariable",parentComponentType:"matrixInput",variableName:"unionFromU"}}),definition({dependencyValues:ns}){return{setValue:{unionFromU:ns.parentUnionFromU}}}},rs.value={stateVariablesDeterminingDependencies:["rowInd","colInd"],returnDependencies:({stateValues:ns})=>{let ss="";return ns.rowInd!==null&&ns.colInd!==null&&(ss=`${ns.rowInd+1}_${ns.colInd+1}`),{parentComponentValue:{dependencyType:"parentStateVariable",parentComponentType:"matrixInput",variableName:`componentValue${ss}`}}},definition:function({dependencyValues:ns}){return ns.parentComponentValue?{setValue:{value:ns.parentComponentValue}}:{setValue:{value:Context.fromAst("_")}}},inverseDefinition:function({desiredStateVariableValues:ns,dependencyValues:ss}){return{success:!0,instructions:[{setDependency:"parentComponentValue",desiredValue:ns.value}]}}},rs.immediateValue={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},stateVariablesDeterminingDependencies:["rowInd","colInd"],returnDependencies:({stateValues:ns})=>{let ss="";return ns.rowInd!==null&&ns.colInd!==null&&(ss=`${ns.rowInd+1}_${ns.colInd+1}`),{parentComponentImmediateValue:{dependencyType:"parentStateVariable",parentComponentType:"matrixInput",variableName:`componentImmediateValue${ss}`}}},definition:function({dependencyValues:ns}){return{setValue:{immediateValue:ns.parentComponentImmediateValue}}},inverseDefinition:function({desiredStateVariableValues:ns,initialChange:ss}){return{success:!0,instructions:[{setDependency:"parentComponentImmediateValue",desiredValue:ns.immediateValue,treatAsInitialChange:ss}]}}},rs.valueForDisplay={forRenderer:!0,returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"}}),definition:function({dependencyValues:ns,usedDefault:ss}){return{setValue:{valueForDisplay:roundForDisplay({value:ns.value,dependencyValues:ns,usedDefault:ss})}}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({valueForDisplay:{dependencyType:"stateVariable",variableName:"valueForDisplay"}}),definition:function({dependencyValues:ns}){return{setValue:{text:ns.valueForDisplay.toString()}}}},rs.rawRendererValue={forRenderer:!0,hasEssential:!0,shadowVariable:!0,defaultValue:"",provideEssentialValuesInDefinition:!0,public:!0,shadowingInstructions:{createComponentOfType:"text"},additionalStateVariablesDefined:[{variableName:"lastValueForDisplay",hasEssential:!0,shadowVariable:!0,defaultValue:null,set:convertValueToMathExpression}],returnDependencies:()=>({immediateValue:{dependencyType:"stateVariable",variableName:"immediateValue"},valueForDisplay:{dependencyType:"stateVariable",variableName:"valueForDisplay"}}),definition({dependencyValues:ns,essentialValues:ss}){if(ss.rawRendererValue===void 0||!deepCompare(ss.lastValueForDisplay.tree,ns.valueForDisplay.tree)){let os=stripLatex(ns.valueForDisplay.toLatex());return os==="_"&&(os=""),{setValue:{rawRendererValue:os,lastValueForDisplay:ns.valueForDisplay},setEssentialValue:{rawRendererValue:os,lastValueForDisplay:ns.valueForDisplay}}}else return{useEssentialOrDefaultValue:{rawRendererValue:!0,lastValueForDisplay:!0}}},async inverseDefinition({desiredStateVariableValues:ns,stateValues:ss,essentialValues:os}){const ls=async cs=>{let ds;cs=normalizeLatexString(cs,{unionFromU:await ss.unionFromU}),cs=cs.replace(/\^(\w)/g,"^{$1}");let ps=getFromLatex({functionSymbols:await ss.functionSymbols,splitSymbols:await ss.splitSymbols,parseScientificNotation:await ss.parseScientificNotation});try{ds=ps(cs)}catch{ds=Context.fromAst("_")}return ds};let us=[];if(typeof ns.rawRendererValue=="string"){let cs=os.rawRendererValue,ds=ns.rawRendererValue;cs!==ds&&us.push({setEssentialValue:"rawRendererValue",value:ds});let ps=await ls(cs),fs=await ls(ds);deepCompare(fs.tree,ps.tree)||us.push({setDependency:"immediateValue",desiredValue:fs,treatAsInitialChange:!0})}else{us.push({setEssentialValue:"lastValueForDisplay",value:ns.rawRendererValue});let cs=await ls(os.rawRendererValue);if(!deepCompare(ns.rawRendererValue.tree,cs.tree)){let ds=stripLatex(ns.rawRendererValue.toLatex());ds==="_"&&(ds=""),us.push({setEssentialValue:"rawRendererValue",value:ds})}}return{success:!0,instructions:us}}},rs.componentType={returnDependencies:()=>({}),definition:()=>({setValue:{componentType:"math"}})},rs}async updateRawValue({rawRendererValue:rs,actionId:ns,sourceInformation:ss={},skipRendererUpdate:os=!1}){if(await this.stateValues.disabled)this.coreFunctions.resolveAction({actionId:ns});else return await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"rawRendererValue",value:rs},{updateType:"setComponentNeedingUpdateValue",componentName:this.componentName}],actionId:ns,sourceInformation:ss,skipRendererUpdate:os})}async updateValue({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){if(await this.stateValues.disabled)this.coreFunctions.resolveAction({actionId:rs});else{let os=await this.stateValues.immediateValue;if(deepCompare((await this.stateValues.value).tree,os.tree))await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"rawRendererValue",valueOfStateVariable:"rawRendererValue"}],actionId:rs,sourceInformation:ns,skipRendererUpdate:ss});else{let ls=[{updateType:"updateValue",componentName:this.componentName,stateVariable:"value",value:os},{updateType:"executeUpdate"},{updateType:"updateValue",componentName:this.componentName,stateVariable:"immediateValue",valueOfStateVariable:"value"},{updateType:"unsetComponentNeedingUpdateValue"}];os.tree!=="_"&&ls.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"rawRendererValue",valueOfStateVariable:"valueForDisplay"});let us={verb:"answered",object:{componentName:this.componentName,componentType:this.componentType},result:{response:os,responseText:os.toString()}},cs=await this.stateValues.answerAncestor;return cs&&(us.context={answerAncestor:cs.componentName}),await this.coreFunctions.performUpdate({updateInstructions:ls,actionId:rs,sourceInformation:ns,skipRendererUpdate:!0,event:us}),await this.coreFunctions.triggerChainedActions({componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss})}}}}zs(MatrixComponentInput,"componentType","matrixComponentInput"),zs(MatrixComponentInput,"rendererType","mathInput"),zs(MatrixComponentInput,"variableForPlainMacro","value"),zs(MatrixComponentInput,"variableForPlainCopy","value");const MatrixInput$1=Object.freeze(Object.defineProperty({__proto__:null,MatrixInput,MatrixInputGrid,MatrixInputRow,default:MatrixComponentInput},Symbol.toStringTag,{value:"Module"}));class Document extends BaseComponent{constructor(rs){super(rs),Object.assign(this.actions,{submitAllAnswers:this.submitAllAnswers.bind(this),recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return delete rs.hide,delete rs.disabled,delete rs.modifyIndirectly,delete rs.fixed,delete rs.styleNumber,delete rs.isResponse,rs.documentWideCheckWork={createComponentOfType:"boolean",createStateVariable:"documentWideCheckWork",defaultValue:!1,public:!0},rs.submitLabel={createComponentOfType:"text",createStateVariable:"submitLabel",defaultValue:"Check Work",public:!0,forRenderer:!0},rs.submitLabelNoCorrectness={createComponentOfType:"text",createStateVariable:"submitLabelNoCorrectness",defaultValue:"Submit Response",public:!0,forRenderer:!0},rs.displayDigitsForCreditAchieved={createComponentOfType:"integer",createStateVariable:"displayDigitsForCreditAchieved",defaultValue:3,public:!0},rs.xmlns={createPrimitiveOfType:"string"},rs.type={createPrimitiveOfType:"string"},rs}static returnChildGroups(){return[{group:"variantControl",componentTypes:["variantControl"]},{group:"title",componentTypes:["title"]},{group:"description",componentTypes:["description"]},{group:"setups",componentTypes:["setup"]},{group:"anything",componentTypes:["_base"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=returnStyleDefinitionStateVariables();Object.assign(rs,ns);let ss=returnFeedbackDefinitionStateVariables();return Object.assign(rs,ss),rs.titleChildName={forRenderer:!0,returnDependencies:()=>({titleChild:{dependencyType:"child",childGroups:["title"]}}),definition({dependencyValues:os}){let ls=null;return os.titleChild.length>0&&(ls=os.titleChild[0].componentName),{setValue:{titleChildName:ls}}}},rs.title={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies:()=>({titleChild:{dependencyType:"child",childGroups:["title"],variableNames:["text"]}}),definition({dependencyValues:os}){return os.titleChild.length===0?{setValue:{title:""}}:{setValue:{title:os.titleChild[0].stateValues.text}}}},rs.description={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({descriptionChild:{dependencyType:"child",childGroups:["description"],variableNames:["text"]}}),definition({dependencyValues:os}){return os.descriptionChild.length===0?{setValue:{description:""}}:{setValue:{description:os.descriptionChild[0].stateValues.text}}}},rs.theme={hasEssential:!0,defaultValue:"light",returnDependencies:()=>({documentAncestor:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition({dependencyValues:os}){return os.documentAncestor?{setValue:{theme:os.documentAncestor.stateValues.theme}}:{useEssentialOrDefaultValue:{theme:!0}}},inverseDefinition({desiredStateVariableValues:os,dependencyValues:ls}){return ls.documentAncestor?{success:!0,instructions:[{setDependency:"documentAncestor",desiredValue:os.theme}]}:{success:!0,instructions:[{setEssentialValue:"theme",value:os.theme}]}}},rs.level={forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{level:0}})},rs.viewedSolution={defaultValue:!1,hasEssential:!0,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{viewedSolution:!0}}),inverseDefinition({desiredStateVariableValues:os}){return{success:!0,instructions:[{setEssentialValue:"viewedSolution",value:os.viewedSolution}]}}},rs.scoredDescendants={returnDependencies:()=>({scoredDescendants:{dependencyType:"descendant",componentTypes:["_sectioningComponent","answer","setup"],variableNames:["scoredDescendants","aggregateScores","weight"],recurseToMatchedChildren:!1,variablesOptional:!0}}),definition({dependencyValues:os}){let ls=[];for(let us of os.scoredDescendants)us.componentType!=="setup"&&(us.stateValues.aggregateScores||us.stateValues.scoredDescendants===void 0?ls.push(us):ls.push(...us.stateValues.scoredDescendants));return{setValue:{scoredDescendants:ls}}}},rs.nScoredDescendants={returnDependencies:()=>({scoredDescendants:{dependencyType:"stateVariable",variableName:"scoredDescendants"}}),definition({dependencyValues:os}){return{setValue:{nScoredDescendants:os.scoredDescendants.length}}}},rs.itemCreditAchieved={isArray:!0,returnArraySizeDependencies:()=>({nScoredDescendants:{dependencyType:"stateVariable",variableName:"nScoredDescendants"}}),returnArraySize({dependencyValues:os}){return[os.nScoredDescendants]},stateVariablesDeterminingDependencies:["scoredDescendants"],returnArrayDependenciesByKey({arrayKeys:os,stateValues:ls}){let us={};for(let cs of os){let ds=ls.scoredDescendants[cs];ds&&(us[cs]={creditAchieved:{dependencyType:"stateVariable",componentName:ds.componentName,variableName:"creditAchieved"}})}return{dependenciesByKey:us}},arrayDefinitionByKey({dependencyValuesByKey:os,arrayKeys:ls}){let us={};for(let cs of ls)us[cs]=os[cs].creditAchieved;return{setValue:{itemCreditAchieved:us}}}},rs.itemNumberByAnswerName={stateVariablesDeterminingDependencies:["scoredDescendants"],returnDependencies({stateValues:os}){let ls={scoredDescendants:{dependencyType:"stateVariable",variableName:"scoredDescendants"}};for(let us in os.scoredDescendants){let cs=os.scoredDescendants[us];ls[`descendantsOf${us}`]={dependencyType:"descendant",ancestorName:cs.componentName,componentTypes:["answer"],recurseToMatchedChildren:!1}}return ls},definition({dependencyValues:os,componentInfoObjects:ls}){let us={};for(let[cs,ds]of os.scoredDescendants.entries()){let ps=cs+1;for(let fs of os[`descendantsOf${cs}`])us[fs.componentName]=ps;ls.isInheritedComponentType({inheritedComponentType:ds.componentType,baseComponentType:"answer"})&&(us[ds.componentName]=ps)}return{setValue:{itemNumberByAnswerName:us}}}},rs.itemVariantInfo={isArray:!0,returnArraySizeDependencies:()=>({nScoredDescendants:{dependencyType:"stateVariable",variableName:"nScoredDescendants"}}),returnArraySize({dependencyValues:os}){return[os.nScoredDescendants]},stateVariablesDeterminingDependencies:["scoredDescendants"],returnArrayDependenciesByKey({arrayKeys:os,stateValues:ls}){let us={};for(let cs of os){let ds=ls.scoredDescendants[cs];ds&&(us[cs]={generatedVariantInfo:{dependencyType:"stateVariable",componentName:ds.componentName,variableName:"generatedVariantInfo",variablesOptional:!0}})}return{dependenciesByKey:us}},arrayDefinitionByKey({dependencyValuesByKey:os,arrayKeys:ls}){let us={};for(let cs of ls)us[cs]=os[cs].generatedVariantInfo;return{setValue:{itemVariantInfo:us}}}},rs.answerDescendants={returnDependencies:()=>({answerDescendants:{dependencyType:"descendant",componentTypes:["answer"],variableNames:["justSubmitted"],recurseToMatchedChildren:!1}}),definition({dependencyValues:os}){return{setValue:{answerDescendants:os.answerDescendants}}}},rs.justSubmitted={forRenderer:!0,returnDependencies:()=>({answerDescendants:{dependencyType:"stateVariable",variableName:"answerDescendants"}}),definition({dependencyValues:os}){return{setValue:{justSubmitted:os.answerDescendants.every(ls=>ls.stateValues.justSubmitted)}}}},rs.showCorrectness={forRenderer:!0,returnDependencies:()=>({showCorrectnessFlag:{dependencyType:"flag",flagName:"showCorrectness"}}),definition({dependencyValues:os}){return{setValue:{showCorrectness:os.showCorrectnessFlag!==!1}}}},rs.creditAchieved={public:!0,forRenderer:!0,defaultValue:0,shadowingInstructions:{createComponentOfType:"number",addAttributeComponentsShadowingStateVariables:{displayDigits:{stateVariableToShadow:"displayDigitsForCreditAchieved"}}},additionalStateVariablesDefined:[{variableName:"percentCreditAchieved",public:!0,shadowingInstructions:{createComponentOfType:"number",addAttributeComponentsShadowingStateVariables:{displayDigits:{stateVariableToShadow:"displayDigitsForCreditAchieved"}}}}],returnDependencies:()=>({scoredDescendants:{dependencyType:"stateVariable",variableName:"scoredDescendants"},itemCreditAchieved:{dependencyType:"stateVariable",variableName:"itemCreditAchieved"}}),definition({dependencyValues:os}){let ls=0,us=0;for(let[ps,fs]of os.scoredDescendants.entries()){let hs=fs.stateValues.weight;ls+=os.itemCreditAchieved[ps]*hs,us+=hs}let cs;us>0?cs=ls/us:cs=1;let ds=cs*100;return{setValue:{creditAchieved:cs,percentCreditAchieved:ds}}}},rs.creditAchievedIfSubmit={defaultValue:0,stateVariablesDeterminingDependencies:["scoredDescendants"],returnDependencies({stateValues:os}){let ls={scoredDescendants:{dependencyType:"stateVariable",variableName:"scoredDescendants"}};for(let[us,cs]of os.scoredDescendants.entries())ls["creditAchievedIfSubmit"+us]={dependencyType:"stateVariable",componentName:cs.componentName,variableName:"creditAchievedIfSubmit"};return ls},definition({dependencyValues:os}){let ls=0,us=0;for(let[ds,ps]of os.scoredDescendants.entries()){let fs=ps.stateValues.weight;ls+=os["creditAchievedIfSubmit"+ds]*fs,us+=fs}return{setValue:{creditAchievedIfSubmit:ls/us}}}},rs.generatedVariantInfo={providePreviousValuesInDefinition:!0,returnDependencies:({sharedParameters:os,componentInfoObjects:ls})=>({variantIndex:{dependencyType:"value",value:os.variantIndex},variantName:{dependencyType:"value",value:os.variantName},variantDescendants:{dependencyType:"descendant",componentTypes:Object.keys(ls.componentTypesCreatingVariants),variableNames:["isVariantComponent","generatedVariantInfo"],recurseToMatchedChildren:!1,variablesOptional:!0,includeNonActiveChildren:!0,ignoreReplacementsOfEncounteredComposites:!0}}),definition({dependencyValues:os,componentName:ls,previousValues:us}){var ps;let cs={index:os.variantIndex,name:os.variantName,meta:{createdBy:ls}},ds=cs.subvariants=[];for(let fs of os.variantDescendants)fs.stateValues.isVariantComponent?ds.push(fs.stateValues.generatedVariantInfo):fs.stateValues.generatedVariantInfo&&ds.push(...fs.stateValues.generatedVariantInfo.subvariants);for(let[fs,hs]of ds.entries())if(!hs.subvariants&&us.generatedVariantInfo){let gs=us.generatedVariantInfo.subvariants;(ps=gs[fs])!=null&&ps.subvariants&&(ds[fs]=Object.assign({},ds[fs]),ds[fs].subvariants=gs[fs].subvariants)}return{setValue:{generatedVariantInfo:cs}}}},rs.createSubmitAllButton={forRenderer:!0,additionalStateVariablesDefined:[{variableName:"suppressAnswerSubmitButtons",forRenderer:!0}],returnDependencies:()=>({documentWideCheckWork:{dependencyType:"stateVariable",variableName:"documentWideCheckWork"}}),definition({dependencyValues:os,componentName:ls}){let us=!1,cs=!1;return os.documentWideCheckWork&&(us=!0,cs=!0),{setValue:{createSubmitAllButton:us,suppressAnswerSubmitButtons:cs}}}},rs.suppressCheckwork={forRenderer:!0,returnDependencies:()=>({autoSubmit:{dependencyType:"flag",flagName:"autoSubmit"}}),definition({dependencyValues:os}){return{setValue:{suppressCheckwork:os.autoSubmit}}}},rs}async submitAllAnswers({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){this.coreFunctions.requestRecordEvent({verb:"submitted",object:{componentName:this.componentName,componentType:this.componentType}});let os=await this.stateValues.answerDescendants;for(let[ls,us]of await this.stateValues.answerDescendants.entries())await us.stateValues.justSubmitted||await this.coreFunctions.performAction({componentName:us.componentName,actionName:"submitAnswer",args:{actionId:rs,sourceInformation:ns,skipRendererUpdate:ss||ls({}),definition:()=>({setValue:{overrideChildHide:!0}})},rs.textsShadow={defaultValue:null,hasEssential:!0,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{textsShadow:!0}})},rs.nComponents={public:!0,shadowingInstructions:{createComponentOfType:"number"},additionalStateVariablesDefined:["childIndexByArrayKey"],returnDependencies(){return{maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"},textListChildren:{dependencyType:"child",childGroups:["textLists"],variableNames:["nComponents"]},textAndTextListChildren:{dependencyType:"child",childGroups:["texts","textLists"],skipComponentNames:!0},textsShadow:{dependencyType:"stateVariable",variableName:"textsShadow"}}},definition:function({dependencyValues:ns,componentInfoObjects:ss}){let os=0,ls=[];if(ns.textAndTextListChildren.length>0){let cs=0;for(let[ds,ps]of ns.textAndTextListChildren.entries())if(ss.isInheritedComponentType({inheritedComponentType:ps.componentType,baseComponentType:"textList"})){let fs=ns.textListChildren[cs];cs++;for(let hs=0;hsus&&(os=us,ls=ls.slice(0,us)),{setValue:{nComponents:os,childIndexByArrayKey:ls},checkForActualChange:{nComponents:!0}}}},rs.texts={public:!0,shadowingInstructions:{createComponentOfType:"text"},isArray:!0,entryPrefixes:["text"],stateVariablesDeterminingDependencies:["childIndexByArrayKey"],returnArraySizeDependencies:()=>({nComponents:{dependencyType:"stateVariable",variableName:"nComponents"}}),returnArraySize({dependencyValues:ns}){return[ns.nComponents]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={},ls={childIndexByArrayKey:{dependencyType:"stateVariable",variableName:"childIndexByArrayKey"},textsShadow:{dependencyType:"stateVariable",variableName:"textsShadow"}};for(let us of ns){let cs=[],ds="1";ss.childIndexByArrayKey[us]&&(cs=[ss.childIndexByArrayKey[us][0]],ds=ss.childIndexByArrayKey[us][1]+1),os[us]={textAndTextListChildren:{dependencyType:"child",childGroups:["texts","textLists"],variableNames:["value","text"+ds],variablesOptional:!0,childIndices:cs}}}return{globalDependencies:ls,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=ss[us].textAndTextListChildren[0];if(cs)if(cs.stateValues.value!==void 0)ls[us]=cs.stateValues.value;else{let ds=ns.childIndexByArrayKey[us][1]+1;ls[us]=cs.stateValues["text"+ds]}else ns.textsShadow!==null&&(ls[us]=ns.textsShadow[us])}return{setValue:{texts:ls}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,arraySize:us}){let cs=[];for(let ds in ns.texts){if(!os[ds])continue;let ps=os[ds].textAndTextListChildren[0];ps&&(ps.stateValues.value!==void 0?cs.push({setDependency:ls[ds].textAndTextListChildren,desiredValue:ns.texts[ds],childIndex:0,variableIndex:0}):cs.push({setDependency:ls[ds].textAndTextListChildren,desiredValue:ns.texts[ds],childIndex:0,variableIndex:1}))}return{success:!0,instructions:cs}}},rs.nValues={isAlias:!0,targetVariableName:"nComponents"},rs.values={isAlias:!0,targetVariableName:"texts"},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies:()=>({texts:{dependencyType:"stateVariable",variableName:"texts"}}),definition:({dependencyValues:ns})=>({setValue:{text:ns.texts.join(", ")}})},rs.componentNamesInList={returnDependencies:()=>({textAndTextListChildren:{dependencyType:"child",childGroups:["texts","textLists"],variableNames:["componentNamesInList"],variablesOptional:!0},maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"}}),definition:function({dependencyValues:ns,componentInfoObjects:ss}){let os=[];for(let us of ns.textAndTextListChildren)ss.isInheritedComponentType({inheritedComponentType:us.componentType,baseComponentType:"textList"})?os.push(...us.stateValues.componentNamesInList):os.push(us.componentName);let ls=ns.maximumNumber;return ls!==null&&os.length>ls&&(ls=Math.max(0,Math.floor(ls)),os=os.slice(0,ls)),{setValue:{componentNamesInList:os}}}},rs.nComponentsToDisplayByChild={additionalStateVariablesDefined:["nChildrenToRender"],returnDependencies:()=>({nComponents:{dependencyType:"stateVariable",variableName:"nComponents"},textListChildren:{dependencyType:"child",childGroups:["textLists"],variableNames:["nComponents"]},textAndTextListChildren:{dependencyType:"child",childGroups:["texts","textLists"],skipComponentNames:!0},parentNComponentsToDisplayByChild:{dependencyType:"parentStateVariable",parentComponentType:"textList",variableName:"nComponentsToDisplayByChild"}}),definition:function({dependencyValues:ns,componentInfoObjects:ss,componentName:os}){let ls=ns.nComponents;ns.parentNComponentsToDisplayByChild!==null&&(ls=ns.parentNComponentsToDisplayByChild[os]);let us={},cs=0,ds=0,ps=0;for(let fs of ns.textAndTextListChildren){let hs=Math.max(0,ls-cs);if(hs>0&&ds++,ss.isInheritedComponentType({inheritedComponentType:fs.componentType,baseComponentType:"textList"})){let gs=ns.textListChildren[ps];ps++;let ys=Math.min(hs,gs.stateValues.nComponents);us[gs.componentName]=ys,cs+=ys}else cs+=1}return{setValue:{nComponentsToDisplayByChild:us,nChildrenToRender:ds}}},markStale:()=>({updateRenderedChildren:!0})},rs}},zs(Du,"componentType","textList"),zs(Du,"renderChildren",!0),zs(Du,"includeBlankStringChildren",!0),zs(Du,"removeBlankStringChildrenPostSugar",!0),zs(Du,"stateVariableForAttributeValue","texts"),zs(Du,"primaryStateVariableForDefinition","textsShadow"),zs(Du,"descendantCompositesMustHaveAReplacement",!1),zs(Du,"adapters",["text"]),Du);class TextList extends InlineComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.unordered={default:!1},rs.maximumNumber={default:null},rs}static returnChildLogic(rs){let ns=super.returnChildLogic(rs),ss=ns.newLeaf({name:"atLeastZeroTexts",componentType:"text",comparison:"atLeast",number:0}),os=ns.newLeaf({name:"atLeastZeroTextLists",componentType:"textList",comparison:"atLeast",number:0}),ls=function({dependencyValues:ds}){let ps=ds.stringChildren[0];return{success:!0,newChildren:ps.stateValues.value.split(",").map(hs=>({componentType:"text",state:{value:hs.trim()}})),toDelete:[ps.componentName]}},us=ns.newLeaf({name:"exactlyOneString",componentType:"string",number:1,isSugar:!0,returnSugarDependencies:()=>({stringChildren:{dependencyType:"child",childLogicName:"exactlyOneString",variableNames:["value"]}}),logicToWaitOnSugar:["atLeastZeroTexts"],replacementFunction:ls}),cs=ns.newOperator({name:"textAndTextLists",operator:"and",propositions:[ss,os]});return ns.newOperator({name:"TextsXorSugar",operator:"xor",propositions:[us,cs],setAsBase:!0}),ns}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.texts={public:!0,shadowingInstructions:{createComponentOfType:"text"},isArray:!0,entryPrefixes:["text"],returnDependencies:()=>({textAndTextListChildren:{dependencyType:"child",childLogicName:"textAndTextLists",variableNames:["value","texts"],variablesOptional:!0},maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"},childrenToRender:{dependencyType:"stateVariable",variableName:"childrenToRender"}}),definition:function({dependencyValues:ns}){let ss=[],os=ns.textAndTextListChildren.map(ls=>ls.componentName);for(let ls of ns.childrenToRender){let us=os.indexOf(ls),cs=ns.textAndTextListChildren[us];cs.stateValues.texts?ss.push(...cs.stateValues.texts):ss.push(cs.stateValues.value)}return{setValue:{texts:ss}}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({texts:{dependencyType:"stateVariable",variableName:"texts"}}),definition:({dependencyValues:ns})=>({setValue:{text:ns.texts.join(", ")}})},rs.nComponents={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({texts:{dependencyType:"stateVariable",variableName:"texts"}}),definition:function({dependencyValues:ns}){return{setValue:{nComponents:ns.texts.length}}}},rs.childrenToRender={returnDependencies:({sharedParameters:ns})=>({textAndTextListChildren:{dependencyType:"child",childLogicName:"textAndTextLists",variableNames:["childrenToRender"],variablesOptional:!0},maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"},selectRng:{dependencyType:"value",value:ns.selectRng,doNotProxy:!0}}),definition:function({dependencyValues:ns}){let ss=[];for(let us of ns.textAndTextListChildren)us.stateValues.childrenToRender?ss.push(...us.stateValues.childrenToRender):ss.push(us.componentName);let os=ns.maximumNumber;os!==null&&ss.length>os&&(os=Math.max(0,Math.floor(os)),ss=ss.slice(0,os)),console.log("randomizing children");for(let us=ss.length-1;us>0;us--){const cs=ns.selectRng(),ds=Math.floor(cs*(us+1));[ss[us],ss[ds]]=[ss[ds],ss[us]]}let ls=Math.ceil(ns.selectRng()*ss.length);return console.log(`numChildren: ${ls}`),ss=ss.slice(0,ls),{setValue:{childrenToRender:ss}}}},rs}initializeRenderer(){this.renderer===void 0&&(this.renderer=new this.availableRenderers.aslist({key:this.componentName}))}}zs(TextList,"componentType","randomizedTextList"),zs(TextList,"stateVariableForAttributeValue","texts");class TupleList extends MathList{static returnSugarInstructions(){let rs=[],ns=function({matchedChildren:ss}){let os=breakEmbeddedStringsIntoParensPieces({componentList:ss});return os.success!==!0?{success:!1}:{success:!0,newChildren:os.pieces.map(function(ls){return ls.length>1||typeof ls[0]=="string"?{componentType:"math",children:ls}:ls[0]})}};return rs.push({replacementFunction:ns}),rs}}zs(TupleList,"componentType","tupleList"),zs(TupleList,"rendererType","mathList"),zs(TupleList,"includeBlankStringChildren",!1);class NumberList extends InlineComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.unordered={createComponentOfType:"boolean",createStateVariable:"unordered",defaultValue:!1,public:!0},rs.maximumNumber={createComponentOfType:"number",createStateVariable:"maximumNumber",defaultValue:null,public:!0},rs.displayDigits={createComponentOfType:"integer"},rs.displayDecimals={createComponentOfType:"integer",createStateVariable:"displayDecimals",defaultValue:null,public:!0},rs.displaySmallAsZero={createComponentOfType:"number",createStateVariable:"displaySmallAsZero",valueForTrue:1e-14,valueForFalse:0,defaultValue:0,public:!0},rs.padZeros={createComponentOfType:"boolean",createStateVariable:"padZeros",defaultValue:!1,public:!0},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=returnGroupIntoComponentTypeSeparatedBySpaces({componentType:"number"}),ss=returnBreakStringsIntoComponentTypeBySpaces({componentType:"number"});return rs.push({replacementFunction:function({matchedChildren:os,isAttributeComponent:ls=!1,createdFromMacro:us=!1}){return ls&&!us?ns({matchedChildren:os}):ss({matchedChildren:os})}}),rs}static returnChildGroups(){return[{group:"numbers",componentTypes:["number"]},{group:"numberLists",componentTypes:["numberList"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.overrideChildHide={returnDependencies:()=>({}),definition:()=>({setValue:{overrideChildHide:!0}})},rs.displayDigits={public:!0,shadowingInstructions:{createComponentOfType:"integer"},hasEssential:!0,defaultValue:10,returnDependencies:()=>({displayDigitsAttr:{dependencyType:"attributeComponent",attributeName:"displayDigits",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]}}),definition({dependencyValues:ns,usedDefault:ss}){if(ns.displayDigitsAttr!==null){let os=ss.displayDigitsAttr,ls=ns.displayDecimalsAttr===null||ss.displayDecimalsAttr;if(!(os||ls)){let us=ns.displayDigitsAttr.shadowDepth;ns.displayDecimalsAttr.shadowDepth({}),definition:()=>({useEssentialOrDefaultValue:{numbersShadow:!0}})},rs.nComponents={public:!0,shadowingInstructions:{createComponentOfType:"number"},additionalStateVariablesDefined:["childIndexByArrayKey"],returnDependencies:()=>({maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"},numberListChildren:{dependencyType:"child",childGroups:["numberLists"],variableNames:["nComponents"]},numberAndNumberListChildren:{dependencyType:"child",childGroups:["numbers","numberLists"],skipComponentNames:!0},numbersShadow:{dependencyType:"stateVariable",variableName:"numbersShadow"}}),definition:function({dependencyValues:ns,componentInfoObjects:ss}){let os=0,ls=[],us=0;if(ns.numberAndNumberListChildren.length>0)for(let[ds,ps]of ns.numberAndNumberListChildren.entries())if(ss.isInheritedComponentType({inheritedComponentType:ps.componentType,baseComponentType:"numberList"})){let fs=ns.numberListChildren[us];us++;for(let hs=0;hscs&&(os=cs,ls=ls.slice(0,cs)),{setValue:{nComponents:os,childIndexByArrayKey:ls},checkForActualChange:{nComponents:!0}}}},rs.numbers={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},isArray:!0,entryPrefixes:["number"],stateVariablesDeterminingDependencies:["childIndexByArrayKey"],returnArraySizeDependencies:()=>({nComponents:{dependencyType:"stateVariable",variableName:"nComponents"}}),returnArraySize({dependencyValues:ns}){return[ns.nComponents]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={},ls={childIndexByArrayKey:{dependencyType:"stateVariable",variableName:"childIndexByArrayKey"},numbersShadow:{dependencyType:"stateVariable",variableName:"numbersShadow"}};for(let us of ns){let cs=[],ds="1";ss.childIndexByArrayKey[us]&&(cs=[ss.childIndexByArrayKey[us][0]],ds=ss.childIndexByArrayKey[us][1]+1),os[us]={numberAndNumberListChildren:{dependencyType:"child",childGroups:["numbers","numberLists"],variableNames:["value","number"+ds],variablesOptional:!0,childIndices:cs}}}return{globalDependencies:ls,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=ss[us].numberAndNumberListChildren[0];if(cs)if(cs.stateValues.value!==void 0)ls[us]=cs.stateValues.value;else{let ds=ns.childIndexByArrayKey[us][1]+1;ls[us]=cs.stateValues["number"+ds]}else ns.numbersShadow!==null&&(ls[us]=ns.numbersShadow[us])}return{setValue:{numbers:ls}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,arraySize:us}){let cs=[];for(let ds in ns.numbers){if(!os[ds])continue;let ps=os[ds].numberAndNumberListChildren[0];ps&&(ps.stateValues.value!==void 0?cs.push({setDependency:ls[ds].numberAndNumberListChildren,desiredValue:ns.numbers[ds],childIndex:0,variableIndex:0}):cs.push({setDependency:ls[ds].numberAndNumberListChildren,desiredValue:ns.numbers[ds],childIndex:0,variableIndex:1}))}return{success:!0,instructions:cs}}},rs.nValues={isAlias:!0,targetVariableName:"nComponents"},rs.values={isAlias:!0,targetVariableName:"numbers"},rs.math={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},returnDependencies:()=>({numbers:{dependencyType:"stateVariable",variableName:"numbers"}}),definition({dependencyValues:ns}){let ss;return ns.numbers.length===0?ss=Context.fromAst("_"):ns.numbers.length===1?ss=Context.fromAst(ns.numbers[0]):ss=Context.fromAst(["list",...ns.numbers]),{setValue:{math:ss}}}},rs.text={public:!0,forRenderer:!0,shadowingInstructions:{createComponentOfType:"text"},additionalStateVariablesDefined:["texts"],returnDependencies:()=>({numberAndNumberListChildren:{dependencyType:"child",childGroups:["numbers","numberLists"],variableNames:["valueForDisplay","text","texts"],variablesOptional:!0},maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"},numbersShadow:{dependencyType:"stateVariable",variableName:"numbersShadow"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"},padZeros:{dependencyType:"stateVariable",variableName:"padZeros"}}),definition:function({dependencyValues:ns,usedDefault:ss}){let os=[],ls={};if(ns.padZeros&&(ss.displayDigits&&!ss.displayDecimals?Number.isFinite(ns.displayDecimals)&&(ls.padToDecimals=ns.displayDecimals):ns.displayDigits>=1&&(ls.padToDigits=ns.displayDigits)),ns.numberAndNumberListChildren.length>0)for(let ds of ns.numberAndNumberListChildren)ds.stateValues.valueForDisplay!==void 0?os.push(ds.stateValues.text):os.push(...ds.stateValues.texts);else ns.numbersShadow!==null&&(os=ns.numbersShadow.map(ds=>roundForDisplay({value:Context.fromAst(ds),dependencyValues:ns,usedDefault:ss}).toString(ls)));let us=ns.maximumNumber;return us!==null&&os.length>us&&(us=Math.max(0,Math.floor(us)),os=os.slice(0,us)),{setValue:{text:os.join(", "),texts:os}}}},rs.componentNamesInList={returnDependencies:()=>({numberAndNumberListChildren:{dependencyType:"child",childGroups:["numbers","numberLists"],variableNames:["componentNamesInList"],variablesOptional:!0},maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"}}),definition:function({dependencyValues:ns,componentInfoObjects:ss}){let os=[];for(let us of ns.numberAndNumberListChildren)ss.isInheritedComponentType({inheritedComponentType:us.componentType,baseComponentType:"numberList"})?os.push(...us.stateValues.componentNamesInList):os.push(us.componentName);let ls=ns.maximumNumber;return ls!==null&&os.length>ls&&(ls=Math.max(0,Math.floor(ls)),os=os.slice(0,ls)),{setValue:{componentNamesInList:os}}}},rs.nComponentsToDisplayByChild={additionalStateVariablesDefined:["nChildrenToRender"],returnDependencies:()=>({nComponents:{dependencyType:"stateVariable",variableName:"nComponents"},numberListChildren:{dependencyType:"child",childGroups:["numberLists"],variableNames:["nComponents"]},numberAndNumberListChildren:{dependencyType:"child",childGroups:["numbers","numberLists"],skipComponentNames:!0},parentNComponentsToDisplayByChild:{dependencyType:"parentStateVariable",parentComponentType:"numberList",variableName:"nComponentsToDisplayByChild"}}),definition:function({dependencyValues:ns,componentInfoObjects:ss,componentName:os}){let ls=ns.nComponents;ns.parentNComponentsToDisplayByChild!==null&&(ls=ns.parentNComponentsToDisplayByChild[os]);let us={},cs=0,ds=0,ps=0;for(let fs of ns.numberAndNumberListChildren){let hs=Math.max(0,ls-cs);if(hs>0&&ds++,ss.isInheritedComponentType({inheritedComponentType:fs.componentType,baseComponentType:"numberList"})){let gs=ns.numberListChildren[ps];ps++;let ys=Math.min(hs,gs.stateValues.nComponents);us[gs.componentName]=ys,cs+=ys}else cs+=1}return{setValue:{nComponentsToDisplayByChild:us,nChildrenToRender:ds}}},markStale:()=>({updateRenderedChildren:!0})},rs}}zs(NumberList,"componentType","numberList"),zs(NumberList,"renderChildren",!0),zs(NumberList,"includeBlankStringChildren",!0),zs(NumberList,"removeBlankStringChildrenPostSugar",!0),zs(NumberList,"stateVariableForAttributeValue","numbers"),zs(NumberList,"primaryStateVariableForDefinition","numbersShadow"),zs(NumberList,"adapters",[{stateVariable:"math",stateVariablesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},"text"]);class NumberListFromString extends InlineComponent{static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss}){return{success:!0,newChildren:ss.reduce(function(ls,us){return typeof us=="string"?[...ls,...us.split(/\s+/).filter(cs=>cs)]:[...ls,us]},[])}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"strings",componentTypes:["string"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.nComponents={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({stringChildren:{dependencyType:"child",childGroups:["strings"]}}),definition:function({dependencyValues:ns}){return{setValue:{nComponents:ns.stringChildren.length}}}},rs.numbers={public:!0,shadowingInstructions:{createComponentOfType:"number"},isArray:!0,entryPrefixes:["number"],returnArraySizeDependencies:()=>({nComponents:{dependencyType:"stateVariable",variableName:"nComponents"}}),returnArraySize({dependencyValues:ns}){return[ns.nComponents]},returnArrayDependenciesByKey(){return{globalDependencies:{stringChildren:{dependencyType:"child",childGroups:["strings"]}}}},arrayDefinitionByKey({globalDependencyValues:ns,arrayKeys:ss}){let os={};for(let[ls,us]of ns.stringChildren.entries())os[ls]=Number(us);return{setValue:{numbers:os}}}},rs.nValues={isAlias:!0,targetVariableName:"nComponents"},rs.values={isAlias:!0,targetVariableName:"numbers"},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},additionalStateVariablesDefined:["texts"],returnDependencies:()=>({numbers:{dependencyType:"stateVariable",variableName:"numbers"}}),definition:function({dependencyValues:ns}){let ss=ns.numbers.map(ls=>ls.toString());return{setValue:{text:ss.join(", "),texts:ss}}}},rs}}zs(NumberListFromString,"componentType","numberListFromString"),zs(NumberListFromString,"rendererType","asList"),zs(NumberListFromString,"renderChildren",!0),zs(NumberListFromString,"stateVariableForAttributeValue","numbers");var ju;let P$2=(ju=class extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static returnChildGroups(){return[{group:"inlines",componentTypes:["_inline"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({inlineChildren:{dependencyType:"child",childGroups:["inlines"],variableNames:["text"],variablesOptional:!0}}),definition:function({dependencyValues:ns}){let ss="";for(let os of ns.inlineChildren)typeof os!="object"?ss+=os.toString():typeof os.stateValues.text=="string"?ss+=os.stateValues.text:ss+=" ";return{setValue:{text:ss}}}},rs}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}},zs(ju,"componentType","p"),zs(ju,"renderChildren",!0),zs(ju,"includeBlankStringChildren",!0),ju);class BooleanList extends InlineComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.unordered={createComponentOfType:"boolean",createStateVariable:"unordered",defaultValue:!1,public:!0},rs.maximumNumber={createComponentOfType:"number",createStateVariable:"maximumNumber",defaultValue:null,public:!0},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=returnGroupIntoComponentTypeSeparatedBySpaces({componentType:"boolean"}),ss=returnBreakStringsIntoComponentTypeBySpaces({componentType:"boolean"});return rs.push({replacementFunction:function({matchedChildren:os,isAttributeComponent:ls=!1,createdFromMacro:us=!1}){return ls&&!us?ns({matchedChildren:os}):ss({matchedChildren:os})}}),rs}static returnChildGroups(){return[{group:"booleans",componentTypes:["boolean"]},{group:"booleanLists",componentTypes:["booleanList"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.overrideChildHide={returnDependencies:()=>({}),definition:()=>({setValue:{overrideChildHide:!0}})},rs.nComponents={public:!0,shadowingInstructions:{createComponentOfType:"number"},additionalStateVariablesDefined:["childIndexByArrayKey"],returnDependencies(){return{maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"},booleanListChildren:{dependencyType:"child",childGroups:["booleanLists"],variableNames:["nComponents"]},booleanAndBooleanListChildren:{dependencyType:"child",childGroups:["booleans","booleanLists"],skipComponentNames:!0}}},definition:function({dependencyValues:ns,componentInfoObjects:ss}){let os=0,ls=[],us=0;for(let[ds,ps]of ns.booleanAndBooleanListChildren.entries())if(ss.isInheritedComponentType({inheritedComponentType:ps.componentType,baseComponentType:"booleanList"})){let fs=ns.booleanListChildren[us];us++;for(let hs=0;hscs&&(os=cs,ls=ls.slice(0,cs)),{setValue:{nComponents:os,childIndexByArrayKey:ls},checkForActualChange:{nComponents:!0}}}},rs.booleans={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},isArray:!0,entryPrefixes:["boolean"],stateVariablesDeterminingDependencies:["childIndexByArrayKey"],returnArraySizeDependencies:()=>({nComponents:{dependencyType:"stateVariable",variableName:"nComponents"}}),returnArraySize({dependencyValues:ns}){return[ns.nComponents]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={},ls={childIndexByArrayKey:{dependencyType:"stateVariable",variableName:"childIndexByArrayKey"}};for(let us of ns){let cs=[],ds="1";ss.childIndexByArrayKey[us]&&(cs=[ss.childIndexByArrayKey[us][0]],ds=ss.childIndexByArrayKey[us][1]+1),os[us]={booleanAndBooleanListChildren:{dependencyType:"child",childGroups:["booleans","booleanLists"],variableNames:["value","boolean"+ds],variablesOptional:!0,childIndices:cs}}}return{globalDependencies:ls,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=ss[us].booleanAndBooleanListChildren[0];if(cs)if(cs.stateValues.value!==void 0)ls[us]=cs.stateValues.value;else{let ds=ns.childIndexByArrayKey[us][1]+1;ls[us]=cs.stateValues["boolean"+ds]}}return{setValue:{booleans:ls}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,arraySize:us}){let cs=[];for(let ds in ns.booleans){if(!os[ds])continue;let ps=os[ds].booleanAndBooleanListChildren[0];ps&&(ps.stateValues.value!==void 0?cs.push({setDependency:ls[ds].booleanAndBooleanListChildren,desiredValue:ns.booleans[ds],childIndex:0,variableIndex:0}):cs.push({setDependency:ls[ds].booleanAndBooleanListChildren,desiredValue:ns.booleans[ds],childIndex:0,variableIndex:1}))}return{success:!0,instructions:cs}}},rs.nValues={isAlias:!0,targetVariableName:"nComponents"},rs.values={isAlias:!0,targetVariableName:"booleans"},rs.componentNamesInList={returnDependencies:()=>({booleanAndBooleanListChildren:{dependencyType:"child",childGroups:["booleans","booleanLists"],variableNames:["componentNamesInList"],variablesOptional:!0},maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"}}),definition:function({dependencyValues:ns,componentInfoObjects:ss}){let os=[];for(let us of ns.booleanAndBooleanListChildren)ss.isInheritedComponentType({inheritedComponentType:us.componentType,baseComponentType:"booleanList"})?os.push(...us.stateValues.componentNamesInList):os.push(us.componentName);let ls=ns.maximumNumber;return ls!==null&&os.length>ls&&(ls=Math.max(0,Math.floor(ls)),os=os.slice(0,ls)),{setValue:{componentNamesInList:os}}}},rs.nComponentsToDisplayByChild={additionalStateVariablesDefined:["nChildrenToRender"],returnDependencies:()=>({nComponents:{dependencyType:"stateVariable",variableName:"nComponents"},booleanListChildren:{dependencyType:"child",childGroups:["booleanLists"],variableNames:["nComponents"]},booleanAndBooleanListChildren:{dependencyType:"child",childGroups:["booleans","booleanLists"],skipComponentNames:!0},parentNComponentsToDisplayByChild:{dependencyType:"parentStateVariable",parentComponentType:"booleanList",variableName:"nComponentsToDisplayByChild"}}),definition:function({dependencyValues:ns,componentInfoObjects:ss,componentName:os}){let ls=ns.nComponents;ns.parentNComponentsToDisplayByChild!==null&&(ls=ns.parentNComponentsToDisplayByChild[os]);let us={},cs=0,ds=0,ps=0;for(let fs of ns.booleanAndBooleanListChildren){let hs=Math.max(0,ls-cs);if(hs>0&&ds++,ss.isInheritedComponentType({inheritedComponentType:fs.componentType,baseComponentType:"booleanList"})){let gs=ns.booleanListChildren[ps];ps++;let ys=Math.min(hs,gs.stateValues.nComponents);us[gs.componentName]=ys,cs+=ys}else cs+=1}return{setValue:{nComponentsToDisplayByChild:us,nChildrenToRender:ds}}},markStale:()=>({updateRenderedChildren:!0})},rs}}zs(BooleanList,"componentType","booleanList"),zs(BooleanList,"rendererType","asList"),zs(BooleanList,"renderChildren",!0),zs(BooleanList,"includeBlankStringChildren",!0),zs(BooleanList,"removeBlankStringChildrenPostSugar",!0),zs(BooleanList,"stateVariableForAttributeValue","booleans"),zs(BooleanList,"descendantCompositesMustHaveAReplacement",!1);class Copy extends CompositeComponent{static createAttributesObject(){let rs=super.createAttributesObject();return delete rs.disabled,delete rs.modifyIndirectly,delete rs.fixed,delete rs.styleNumber,delete rs.isResponse,rs.assignNewNamespaces={createPrimitiveOfType:"boolean"},rs.assignNamesSkip={createPrimitiveOfType:"number"},rs.prop={createPrimitiveOfType:"string"},rs.obtainPropFromComposite={createPrimitiveOfType:"boolean",createStateVariable:"obtainPropFromComposite",defaultValue:!1,public:!0},rs.createComponentOfType={createPrimitiveOfType:"string"},rs.nComponents={createPrimitiveOfType:"number"},rs.componentIndex={createComponentOfType:"integer",createStateVariable:"componentIndex",defaultValue:null,public:!0},rs.sourceSubnames={createPrimitiveOfType:"stringArray",createStateVariable:"targetSubnames",defaultValue:null,public:!0},rs.sourceSubnamesComponentIndex={createComponentOfType:"numberList",createStateVariable:"targetSubnamesComponentIndex",defaultValue:null,public:!0},rs.propIndex={createComponentOfType:"numberList",createStateVariable:"propIndex",defaultValue:null,public:!0},rs.uri={createPrimitiveOfType:"string",createStateVariable:"uri",defaultValue:null,public:!0},rs.sourceAttributesToIgnore={createPrimitiveOfType:"stringArray",createStateVariable:"sourceAttributesToIgnore",defaultValue:["hide"],public:!0},rs.sourceAttributesToIgnoreRecursively={createPrimitiveOfType:"stringArray",createStateVariable:"sourceAttributesToIgnoreRecursively",defaultValue:["isResponse"],public:!0},rs.link={createPrimitiveOfType:"boolean"},rs.removeEmptyArrayEntries={createPrimitiveOfType:"boolean",createStateVariable:"removeEmptyArrayEntries",defaultValue:!1},rs}static keepChildrenSerialized({serializedComponent:rs}){return rs.children===void 0?[]:Object.keys(rs.children)}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.target={returnDependencies:()=>({target:{dependencyType:"doenetAttribute",attributeName:"target"}}),definition:({dependencyValues:ns})=>({setValue:{target:ns.target}})},rs.targetSourcesName={additionalStateVariablesDefined:[{variableName:"sourcesChildNumber",hasEssential:!0,shadowVariable:!0}],stateVariablesDeterminingDependencies:["target"],determineDependenciesImmediately:!0,hasEssential:!0,shadowVariable:!0,returnDependencies:function({stateValues:ns,sharedParameters:ss}){let os=ss.sourceNameMappings;if(!os)return{};let ls=os[ns.target];return ls?{targetSourcesName:{dependencyType:"value",value:ls.name},sourcesChildNumber:{dependencyType:"value",value:ls.childNumber}}:{}},definition:function({dependencyValues:ns}){let ss=ns.targetSourcesName,os=ns.sourcesChildNumber;return ss||(ss=null,os=null),{setValue:{targetSourcesName:ss,sourcesChildNumber:os},setEssentialValue:{targetSourcesName:ss,sourcesChildNumber:os}}}},rs.targetSources={stateVariablesDeterminingDependencies:["targetSourcesName"],determineDependenciesImmediately:!0,returnDependencies({stateValues:ns}){return ns.targetSourcesName?{targetSourcesComponent:{dependencyType:"componentIdentity",componentName:ns.targetSourcesName}}:{}},definition:function({dependencyValues:ns}){let ss=ns.targetSourcesComponent;return ss||(ss=null),{setValue:{targetSources:ss}}}},rs.sourceIndex={stateVariablesDeterminingDependencies:["target"],determineDependenciesImmediately:!0,hasEssential:!0,shadowVariable:!0,returnDependencies:function({stateValues:ns,sharedParameters:ss}){let os=ss.sourceIndexMappings;if(!os)return{};let ls=os[ns.target];return ls===void 0?{}:{sourceIndex:{dependencyType:"value",value:ls}}},definition:function({dependencyValues:ns}){let ss=ns.sourceIndex;return ss===void 0&&(ss=null),{setValue:{sourceIndex:ss},setEssentialValue:{sourceIndex:ss}}}},rs.targetComponent={shadowVariable:!0,stateVariablesDeterminingDependencies:["targetSources","sourceIndex"],determineDependenciesImmediately:!0,returnDependencies({stateValues:ns}){return ns.sourceIndex!==null?{}:ns.targetSources!==null?{targetSourcesChildren:{dependencyType:"stateVariable",componentName:ns.targetSources.componentName,variableName:"childIdentities"},sourcesChildNumber:{dependencyType:"stateVariable",variableName:"sourcesChildNumber"}}:{targetComponent:{dependencyType:"targetComponent"}}},definition:function({dependencyValues:ns}){let ss=null;return ns.targetSourcesChildren?(ss=ns.targetSourcesChildren[ns.sourcesChildNumber],ss||(ss=null)):ns.targetComponent&&(ss=ns.targetComponent),{setValue:{targetComponent:ss}}}},rs.targetInactive={stateVariablesDeterminingDependencies:["targetComponent"],returnDependencies({stateValues:ns}){return ns.targetComponent?{targetIsInactiveCompositeReplacement:{dependencyType:"stateVariable",componentName:ns.targetComponent.componentName,variableName:"isInactiveCompositeReplacement"}}:{}},definition:function({dependencyValues:ns}){return{setValue:{targetInactive:!!ns.targetIsInactiveCompositeReplacement}}}},rs.cid={additionalStateVariablesDefined:["doenetId"],returnDependencies:()=>({uri:{dependencyType:"stateVariable",variableName:"uri"}}),definition:function({dependencyValues:ns}){if(!ns.uri||ns.uri.substring(0,7).toLowerCase()!=="doenet:")return{setValue:{cid:null,doenetId:null}};let ss=null,os=null,ls=ns.uri.match(/[:&]cid=([^&]+)/i);return ls&&(ss=ls[1]),ls=ns.uri.match(/[:&]doenetid=([^&]+)/i),ls&&(os=ls[1]),{setValue:{cid:ss,doenetId:os}}}},rs.serializedComponentsForCid={returnDependencies:()=>({cid:{dependencyType:"stateVariable",variableName:"cid"},serializedChildren:{dependencyType:"serializedChildren",doNotProxy:!0}}),definition:function({dependencyValues:ns}){var ss;return ns.cid?((ss=ns.serializedChildren)==null?void 0:ss.length)>0?{setValue:{serializedComponentsForCid:ns.serializedChildren}}:{setValue:{serializedComponentsForCid:null}}:{setValue:{serializedComponentsForCid:null}}}},rs.propName={shadowVariable:!0,returnDependencies:()=>({propName:{dependencyType:"attributePrimitive",attributeName:"prop"}}),definition:function({dependencyValues:ns}){return{setValue:{propName:ns.propName}}}},rs.isPlainMacro={returnDependencies:()=>({isPlainMacro:{dependencyType:"doenetAttribute",attributeName:"isPlainMacro"},targetComponent:{dependencyType:"stateVariable",variableName:"targetComponent"},typeAttr:{dependencyType:"attributePrimitive",attributeName:"createComponentOfType"},targetSubnames:{dependencyType:"stateVariable",variableName:"targetSubnames"}}),definition:function({dependencyValues:ns,componentInfoObjects:ss}){var ls,us;let os=ns.isPlainMacro&&(!ss.isCompositeComponent({componentType:(ls=ns.targetComponent)==null?void 0:ls.componentType})||ns.targetSubnames);if(os&&ns.typeAttr){os=!1;let cs=ss.componentTypeLowerCaseMapping[ns.typeAttr.toLowerCase()],ds=ss.allComponentClasses[(us=ns.targetComponent)==null?void 0:us.componentType];if(ds){let ps=ss.publicStateVariableInfo[ds.componentType].stateVariableDescriptions[ds.variableForPlainMacro];cs!==ds.componentType&&ps&&(ps.createComponentOfType===void 0||ps.createComponentOfType===cs)&&(os=!0)}}return{setValue:{isPlainMacro:os}}}},rs.isPlainCopy={returnDependencies:()=>({isPlainCopy:{dependencyType:"doenetAttribute",attributeName:"isPlainCopy"},targetComponent:{dependencyType:"stateVariable",variableName:"targetComponent"},typeAttr:{dependencyType:"attributePrimitive",attributeName:"createComponentOfType"},targetSubnames:{dependencyType:"stateVariable",variableName:"targetSubnames"}}),definition:function({dependencyValues:ns,componentInfoObjects:ss}){var ls,us;let os=ns.isPlainCopy&&(!ss.isCompositeComponent({componentType:(ls=ns.targetComponent)==null?void 0:ls.componentType})||ns.targetSubnames);if(os&&ns.typeAttr){os=!1;let cs=ss.componentTypeLowerCaseMapping[ns.typeAttr.toLowerCase()],ds=ss.allComponentClasses[(us=ns.targetComponent)==null?void 0:us.componentType];if(ds){let ps=ss.publicStateVariableInfo[ds.componentType].stateVariableDescriptions[ds.variableForPlainCopy];cs!==ds.componentType&&ps&&(ps.createComponentOfType===void 0||ps.createComponentOfType===cs)&&(os=!0)}}return{setValue:{isPlainCopy:os}}}},rs.linkAttrForDetermineDeps={returnDependencies:()=>({linkAttr:{dependencyType:"attributePrimitive",attributeName:"link"}}),definition({dependencyValues:ns}){let ss;return ns.linkAttr===null?ss=!0:ss=ns.linkAttr,{setValue:{linkAttrForDetermineDeps:ss}}}},rs.replacementSourceIdentities={stateVariablesDeterminingDependencies:["targetComponent","componentIndex","propName","targetSubnames","targetSubnamesComponentIndex","obtainPropFromComposite","linkAttrForDetermineDeps"],additionalStateVariablesDefined:["addLevelToAssignNames"],returnDependencies:function({stateValues:ns,componentInfoObjects:ss}){let os={},ls=!1,us=!1;if(ns.targetComponent!==null){if(ss.isCompositeComponent({componentType:ns.targetComponent.componentType,includeNonStandard:!1})&&!(ns.propName&&ns.obtainPropFromComposite))if(ns.linkAttrForDetermineDeps){us=!0;let cs=ns.targetSubnamesComponentIndex;cs&&(cs=[...cs]),os.targets={dependencyType:"replacement",compositeName:ns.targetComponent.componentName,recursive:!0,componentIndex:ns.componentIndex,targetSubnames:ns.targetSubnames,targetSubnamesComponentIndex:cs}}else ls=!0;!us&&(ns.componentIndex===null||ns.componentIndex===1)&&(os.targets={dependencyType:"stateVariable",variableName:"targetComponent"})}return os.addLevelToAssignNames={dependencyType:"value",value:ls},os},definition({dependencyValues:ns}){let ss=null;return ns.targets&&(ss=ns.targets,Array.isArray(ss)||(ss=[ss])),{setValue:{replacementSourceIdentities:ss,addLevelToAssignNames:ns.addLevelToAssignNames}}}},rs.replacementSources={stateVariablesDeterminingDependencies:["replacementSourceIdentities","propName","propIndex","isPlainMacro","isPlainCopy"],additionalStateVariablesDefined:["effectivePropNameBySource"],returnDependencies:function({stateValues:ns,componentInfoObjects:ss}){let os={replacementSourceIdentities:{dependencyType:"stateVariable",variableName:"replacementSourceIdentities"},propIndex:{dependencyType:"stateVariable",variableName:"propIndex"}};if(!ns.propName&&ns.propIndex!==null)throw Error("You cannot specify a propIndex without specifying a prop.");if(ns.replacementSourceIdentities!==null)for(let[ls,us]of ns.replacementSourceIdentities.entries()){let cs=ns.propName;ns.isPlainMacro?cs=ss.allComponentClasses[us.componentType].variableForPlainMacro:ns.isPlainCopy&&(cs=ss.allComponentClasses[us.componentType].variableForPlainCopy);let ds;if(cs){os["propName"+ls]={dependencyType:"value",value:cs};let ps=ns.propIndex;ps&&(ps=[...ps]),ds={dependencyType:"stateVariable",componentName:us.componentName,variableName:cs,returnAsComponentObject:!0,variablesOptional:!0,propIndex:ps,caseInsensitiveVariableMatch:!0,publicStateVariablesOnly:!0,useMappedVariableNames:!0}}else ds={dependencyType:"componentIdentity",componentName:us.componentName};os["target"+ls]=ds}return os},definition({dependencyValues:ns}){let ss=null,os=null;if(ns.replacementSourceIdentities!==null){ss=[],os=[];for(let ls in ns.replacementSourceIdentities){let us=ns["target"+ls];if(us){ss.push(us);let cs;us.stateValues&&(cs=Object.keys(us.stateValues)[0]),!cs&&ns["propName"+ls]&&(cs="__prop_name_not_found"),os.push(cs)}}}return{setValue:{replacementSources:ss,effectivePropNameBySource:os}}}},rs.nComponentsSpecified={returnDependencies:()=>({nComponentsAttr:{dependencyType:"attributePrimitive",attributeName:"nComponents"},typeAttr:{dependencyType:"attributePrimitive",attributeName:"createComponentOfType"}}),definition({dependencyValues:ns,componentInfoObjects:ss}){let os;if(ns.typeAttr){if(!(ss.componentTypeLowerCaseMapping[ns.typeAttr.toLowerCase()]in ss.allComponentClasses))throw Error(`Invalid componentType ${ns.typeAttr} of copy.`);ns.nComponentsAttr!==null?os=ns.nComponentsAttr:os=1}else{if(ns.nComponentsAttr!==null)throw Error("You must specify createComponentOfType when specifying nComponents for a copy.");os=null}return{setValue:{nComponentsSpecified:os}}}},rs.link={returnDependencies:()=>({linkAttr:{dependencyType:"attributePrimitive",attributeName:"link"},serializedComponentsForCid:{dependencyType:"stateVariable",variableName:"serializedComponentsForCid"},replacementSourceIdentities:{dependencyType:"stateVariable",variableName:"replacementSourceIdentities"}}),definition({dependencyValues:ns,componentInfoObjects:ss}){let os;return ns.linkAttr===null?ns.serializedComponentsForCid||ns.replacementSourceIdentities&&ns.replacementSourceIdentities.some(ls=>ss.isInheritedComponentType({inheritedComponentType:ls.componentType,baseComponentType:"module"}))?os=!1:os=!0:os=ns.linkAttr!==!1,{setValue:{link:os}}}},rs.readyToExpandWhenResolved={stateVariablesDeterminingDependencies:["targetComponent","propName","obtainPropFromComposite","link"],returnDependencies({stateValues:ns,componentInfoObjects:ss}){let os={targetComponent:{dependencyType:"stateVariable",variableName:"targetComponent"},needsReplacementsUpdatedWhenStale:{dependencyType:"stateVariable",variableName:"needsReplacementsUpdatedWhenStale"},serializedComponentsForCid:{dependencyType:"stateVariable",variableName:"serializedComponentsForCid"},link:{dependencyType:"stateVariable",variableName:"link"}};return ns.targetComponent&&ss.isCompositeComponent({componentType:ns.targetComponent.componentType,includeNonStandard:!1})&&!(ns.propName&&ns.obtainPropFromComposite)&&(os.targetReadyToExpandWhenResolved={dependencyType:"stateVariable",componentName:ns.targetComponent.componentName,variableName:"readyToExpandWhenResolved"}),ns.link||(os.replacementSources={dependencyType:"stateVariable",variableName:"replacementSources"}),os},definition(){return{setValue:{readyToExpandWhenResolved:!0}}}},rs.needsReplacementsUpdatedWhenStale={stateVariablesDeterminingDependencies:["targetComponent","replacementSourceIdentities","effectivePropNameBySource","propName","obtainPropFromComposite","link","removeEmptyArrayEntries"],returnDependencies:function({stateValues:ns,componentInfoObjects:ss}){if(!ns.link)return{};let os={targetComponent:{dependencyType:"stateVariable",variableName:"targetComponent"},targetInactive:{dependencyType:"stateVariable",variableName:"targetInactive"},replacementSourceIdentities:{dependencyType:"stateVariable",variableName:"replacementSourceIdentities"},propIndex:{dependencyType:"stateVariable",variableName:"propIndex"}};if(ns.effectivePropNameBySource!==null){for(let[ls,us]of ns.effectivePropNameBySource.entries())if(us){let cs=ns.replacementSourceIdentities[ls];os["sourceArraySize"+ls]={dependencyType:"stateVariableArraySize",componentName:cs.componentName,variableName:us,variablesOptional:!0,caseInsensitiveVariableMatch:!0},os["sourceComponentType"+ls]={dependencyType:"stateVariableComponentType",componentName:cs.componentName,variableName:us,variablesOptional:!0,caseInsensitiveVariableMatch:!0}}}return ns.targetComponent!==null&&ss.isCompositeComponent({componentType:ns.targetComponent.componentType,includeNonStandard:!1})&&!(ns.propName&&ns.obtainPropFromComposite)&&(os.allReplacementIdentities={dependencyType:"replacement",compositeName:ns.targetComponent.componentName,recursive:!0,variableNames:["isInactiveCompositeReplacement"]}),ns.removeEmptyArrayEntries&&(os.replacementSources={dependencyType:"stateVariable",variableName:"replacementSources"}),os},markStale(){return{updateReplacements:!0}},definition:()=>({setValue:{needsReplacementsUpdatedWhenStale:!0}})},rs.effectiveAssignNames={returnDependencies:()=>({assignNames:{dependencyType:"doenetAttribute",attributeName:"assignNames"},addLevelToAssignNames:{dependencyType:"stateVariable",variableName:"addLevelToAssignNames"}}),definition({dependencyValues:ns}){let ss=ns.assignNames;return ss&&ns.addLevelToAssignNames&&(ss=[ss]),{setValue:{effectiveAssignNames:ss}}}},rs}static async createSerializedReplacements({component:rs,components:ns,workspace:ss,componentInfoObjects:os,flags:ls,resolveItem:us,publicCaseInsensitiveAliasSubstitutions:cs}){var ws,Es,_s,$s,Rs;await rs.stateValues.nComponentsSpecified,ss.numReplacementsBySource=[],ss.numNonStringReplacementsBySource=[],ss.propVariablesCopiedBySource=[],ss.sourceNames=[],ss.uniqueIdentifiersUsedBySource={};let ds=(ws=rs.attributes.newNamespace)==null?void 0:ws.primitive,ps=this.createAttributesObject(),fs=await rs.stateValues.effectiveAssignNames,hs=await rs.stateValues.serializedComponentsForCid;if(hs){let Ds=deepClone([hs[0]]),Os=deepClone(hs.slice(1));if(Ds[0].children){let ks;if(Ds[0].componentName?ks=Ds[0].componentName+"/":ks=Ds[0].originalName+"/",rs.doenetAttributes.keptNewNamespaceOfLastChild){ks=ks.slice(0,ks.length-1);let Ps=ks.lastIndexOf("/");ks=ks.slice(0,Ps+1)}restrictTNamesToNamespace({components:Ds[0].children,namespace:ks,invalidateReferencesToBaseNamespace:rs.doenetAttributes.keptNewNamespaceOfLastChild})}if(Ds[0].componentType==="externalContent")for(let ks of Ds[0].children){if(typeof ks!="object")continue;ks.attributes||(ks.attributes={});let Ps=convertAttributesForComponentType({attributes:rs.attributes,componentType:ks.componentType,componentInfoObjects:os,compositeAttributesObj:ps,compositeCreatesNewNamespace:ds,flags:ls});for(let Bs in Ps){let Ms=Ps[Bs];Ms.component?setTNamesToAbsolute([Ms.component]):Ms.childrenForComponent&&setTNamesToAbsolute(Ms.childrenForComponent)}Object.assign(ks.attributes,Ps)}else{Ds[0].attributes||(Ds[0].attributes={});let ks=convertAttributesForComponentType({attributes:rs.attributes,componentType:Ds[0].componentType,componentInfoObjects:os,compositeAttributesObj:ps,compositeCreatesNewNamespace:ds,flags:ls});for(let Ps in ks){let Bs=ks[Ps];Bs.component?setTNamesToAbsolute([Bs.component]):Bs.childrenForComponent&&setTNamesToAbsolute(Bs.childrenForComponent)}Object.assign(Ds[0].attributes,ks)}return Ds=processAssignNames({assignNames:fs,assignNewNamespaces:(Es=rs.attributes.assignNewNamespaces)==null?void 0:Es.primitive,serializedComponents:Ds,parentName:rs.componentName,parentCreatesNewNamespace:ds,componentInfoObjects:os}).serializedComponents,rs.doenetAttributes.fromCopyFromURI&&Os.length>0&&this.addChildrenFromComposite({replacements:Ds,children:Os,assignNewNamespaces:(_s=rs.attributes.assignNewNamespaces)==null?void 0:_s.primitive,componentInfoObjects:os}),{replacements:(await verifyReplacementsMatchSpecifiedType({component:rs,replacements:Ds,assignNames:fs,workspace:ss,componentInfoObjects:os,compositeAttributesObj:ps,flags:ls})).replacements}}let gs=await rs.stateValues.sourceIndex;if(gs!==null){let Os=[{componentType:"number",attributes:convertAttributesForComponentType({attributes:rs.attributes,componentType:"number",componentInfoObjects:os,compositeAttributesObj:ps,compositeCreatesNewNamespace:ds,flags:ls}),state:{value:gs,fixed:!0}}],Is=processAssignNames({assignNames:fs,serializedComponents:Os,parentName:rs.componentName,parentCreatesNewNamespace:ds,componentInfoObjects:os});return{replacements:(await verifyReplacementsMatchSpecifiedType({component:rs,replacements:Is.serializedComponents,assignNames:fs,workspace:ss,componentInfoObjects:os,compositeAttributesObj:ps,flags:ls})).replacements}}let ys=await rs.stateValues.replacementSourceIdentities;if(!await rs.stateValues.targetComponent||!ys){let Ds=[];if(rs.doenetAttributes.fromCopyTarget){let Is=os.componentTypeLowerCaseMapping[rs.attributes.createComponentOfType.primitive.toLowerCase()],Vs=os.allComponentClasses[Is],ks=convertAttributesForComponentType({attributes:rs.attributes,componentType:Is,componentInfoObjects:os,compositeAttributesObj:ps,compositeCreatesNewNamespace:ds,flags:ls});ss.uniqueIdentifiersUsedBySource[0]=[];let Ps=Is+"|empty",Bs=getUniqueIdentifierFromBase(Ps,ss.uniqueIdentifiersUsedBySource[0]),Ms=deepClone(rs.serializedChildren);Vs.includeBlankStringChildren||(Ms=Ms.filter(js=>typeof js!="string"||js.trim()!==""));let Ws=ks;($s=rs.attributes.assignNewNamespaces)!=null&&$s.primitive&&(Ws.newNamespace={primitive:!0}),Ds=[{componentType:Is,attributes:Ws,children:Ms,uniqueIdentifier:Bs}],Ds=processAssignNames({assignNames:fs,serializedComponents:Ds,parentName:rs.componentName,componentInfoObjects:os,originalNamesAreConsistent:!0}).serializedComponents,ss.numReplacementsBySource.push(Ds.length),ss.numNonStringReplacementsBySource.push(Ds.filter(js=>typeof js!="string").length)}return{replacements:(await verifyReplacementsMatchSpecifiedType({component:rs,replacements:Ds,assignNames:fs,workspace:ss,componentInfoObjects:os,compositeAttributesObj:ps})).replacements}}let bs=await us({componentName:rs.componentName,type:"determineDependencies",stateVariable:"replacementSources",dependency:"__determine_dependencies",expandComposites:!1});if(!bs.success)throw Error(`Couldn't resolve determineDependencies of replacementSources of ${rs.componentName}`);let vs=await rs.stateValues.effectivePropNameBySource;for(let Ds in ys)if(vs[Ds]&&(bs=await us({componentName:rs.componentName,type:"recalculateDownstreamComponents",stateVariable:"replacementSources",dependency:"target"+Ds,expandComposites:!1}),!bs.success))throw Error(`Couldn't resolve recalculateDownstreamComponents for target${Ds} of replacementSources of ${rs.componentName}`);let xs=[],Cs=[],Ts=[],Ss=0,Ns=0;for(let Ds in ys){let Os=ss.uniqueIdentifiersUsedBySource[Ds]=[],Is;if((Rs=rs.attributes.createComponentOfType)!=null&&Rs.primitive){let Ps=await rs.stateValues.nComponentsSpecified,Bs=ys.length;Is=Math.floor(Ps/Bs);let Ms=Ps%Bs;Dstypeof Ps!="string").length,Ss+=Cs[Ds],Ns+=Ts[Ds],xs.push(...ks)}return ss.numReplacementsBySource=Cs,ss.numNonStringReplacementsBySource=Ts,ss.sourceNames=ys.map(Ds=>Ds.componentName),{replacements:(await verifyReplacementsMatchSpecifiedType({component:rs,replacements:xs,assignNames:fs,workspace:ss,componentInfoObjects:os,compositeAttributesObj:ps,flags:ls})).replacements}}static async createReplacementForSource({component:rs,sourceNum:ns,components:ss,numReplacementsSoFar:os,numNonStringReplacementsSoFar:ls,uniqueIdentifiersUsed:us,compositeAttributesObj:cs,componentInfoObjects:ds,nComponentsForSource:ps,publicCaseInsensitiveAliasSubstitutions:fs,flags:hs,fromCopyTarget:gs}){var Es,_s,$s,Rs,Ds,Os;let ys=(await rs.stateValues.replacementSourceIdentities)[ns];if(typeof ys!="object")return{serializedReplacements:[ys]};let bs=ss[ys.componentName],vs=await rs.stateValues.link;(!vs||await rs.stateValues.removeEmptyArrayEntries)&&(ys=(await rs.stateValues.replacementSources)[ns]);let xs=(Es=rs.attributes.newNamespace)==null?void 0:Es.primitive,Cs=await rs.stateValues.effectiveAssignNames,Ts=(await rs.stateValues.effectivePropNameBySource)[ns];if(Ts){let Is=await replacementFromProp({component:rs,components:ss,replacementSource:ys,propName:Ts,numReplacementsSoFar:os,numNonStringReplacementsSoFar:ls,uniqueIdentifiersUsed:us,compositeAttributesObj:cs,componentInfoObjects:ds,nComponentsForSource:ps,publicCaseInsensitiveAliasSubstitutions:fs,flags:hs});return{serializedReplacements:processAssignNames({assignNames:Cs,serializedComponents:Is.serializedReplacements,parentName:rs.componentName,parentCreatesNewNamespace:xs,indOffset:ls,componentInfoObjects:ds}).serializedComponents,propVariablesCopiedByReplacement:Is.propVariablesCopiedByReplacement}}let Ss=await rs.stateValues.sourceAttributesToIgnore,Ns=await rs.stateValues.sourceAttributesToIgnoreRecursively,As=[await bs.serialize({copyAll:!vs,copyVariants:!vs,sourceAttributesToIgnore:Ss,sourceAttributesToIgnoreRecursively:Ns})];!vs&&((_s=As[0].state)==null?void 0:_s.fixed)!==void 0&&delete As[0].state.fixed,As=postProcessCopy({serializedComponents:As,componentName:rs.componentName,uniqueIdentifiersUsed:us,addShadowDependencies:vs,unlinkExternalCopies:!vs}),As.length>0&&delete As[0].doenetAttributes.haveNewNamespaceOnlyFromShadow;for(let Is of As){if(typeof Is!="object")continue;Is.attributes||(Is.attributes={});let Vs=convertAttributesForComponentType({attributes:rs.attributes,componentType:Is.componentType,componentInfoObjects:ds,compositeAttributesObj:cs,compositeCreatesNewNamespace:xs,flags:hs});Object.assign(Is.attributes,Vs)}return($s=As[0].attributes.newNamespace)!=null&&$s.primitive&&!((Rs=rs.attributes.assignNewNamespaces)!=null&&Rs.primitive)&&(As[0].doenetAttributes.haveNewNamespaceOnlyFromShadow=!0),As=processAssignNames({assignNames:Cs,assignNewNamespaces:(Ds=rs.attributes.assignNewNamespaces)==null?void 0:Ds.primitive,serializedComponents:As,parentName:rs.componentName,parentCreatesNewNamespace:xs,indOffset:ls,componentInfoObjects:ds,originalNamesAreConsistent:xs&&!Cs}).serializedComponents,gs&&As.length===1&&rs.serializedChildren.length>0&&this.addChildrenFromComposite({replacements:As,children:rs.serializedChildren,assignNewNamespaces:(Os=rs.attributes.assignNewNamespaces)==null?void 0:Os.primitive,componentInfoObjects:ds}),{serializedReplacements:As}}static addChildrenFromComposite({replacements:rs,children:ns,assignNewNamespaces:ss,componentInfoObjects:os}){var ps,fs;let ls=rs[0];ls.children||(ls.children=[]);let us=deepClone(ns);if(os.allComponentClasses[ls.componentType].includeBlankStringChildren||(us=us.filter(hs=>typeof hs!="string"||hs.trim()!=="")),(ps=rs[0].attributes.newNamespace)!=null&&ps.primitive&&ss){let hs=countRegularComponentTypesInNamespace(ls.children);renameAutonameBasedOnNewCounts(us,hs)}let ds=processAssignNames({serializedComponents:us,parentName:rs[0].componentName,parentCreatesNewNamespace:ss,componentInfoObjects:os,originalNamesAreConsistent:!0});if((fs=rs[0].attributes.newNamespace)!=null&&fs.primitive&&!ss)for(let hs of ds.serializedComponents)typeof hs=="object"&&(hs.doenetAttributes.ignoreParentNewNamespace=!0);ls.children.push(...ds.serializedComponents)}static async calculateReplacementChanges({component:rs,componentChanges:ns,components:ss,workspace:os,componentInfoObjects:ls,flags:us,resolveItem:cs,publicCaseInsensitiveAliasSubstitutions:ds}){var _s;if(await rs.stateValues.serializedComponentsForCid)return[];if(await rs.stateValues.sourceIndex!==null)return[];let ps=this.createAttributesObject(),fs=await rs.stateValues.effectiveAssignNames,hs=await rs.stateValues.replacementSourceIdentities;if(!await rs.stateValues.targetComponent||!hs){if(await rs.stateValues.targetSources)return[];{let $s=[];if(rs.replacements.length>0){let Os={changeType:"delete",changeTopLevelReplacements:!0,firstReplacementInd:0,numberReplacementsToDelete:rs.replacements.length};$s.push(Os)}let Rs=os.sourceNames.length===0;os.sourceNames=[],os.numReplacementsBySource=[],os.numNonStringReplacementsBySource=[],os.propVariablesCopiedBySource=[];let Ds=await verifyReplacementsMatchSpecifiedType({component:rs,replacementChanges:$s,assignNames:fs,workspace:os,componentInfoObjects:ls,compositeAttributesObj:ps,flags:us});return Rs?[]:Ds.replacementChanges}}if(await rs.stateValues.targetInactive){let $s=[],Rs=rs.replacements.length;if(Rs>0){if(rs.replacementsToWithhold!==Rs){let Os={changeType:"changeReplacementsToWithhold",replacementsToWithhold:Rs};$s.push(Os)}$s=(await verifyReplacementsMatchSpecifiedType({component:rs,replacementChanges:$s,assignNames:fs,workspace:os,componentInfoObjects:ls,compositeAttributesObj:ps,flags:us})).replacementChanges}return $s}let gs=await cs({componentName:rs.componentName,type:"determineDependencies",stateVariable:"replacementSources",dependency:"__determine_dependencies",expandComposites:!1});if(!gs.success)throw Error(`Couldn't resolve determineDependencies of replacementSources of ${rs.componentName}`);let ys=await rs.stateValues.effectivePropNameBySource;for(let $s in hs)if(ys[$s]&&(gs=await cs({componentName:rs.componentName,type:"recalculateDownstreamComponents",stateVariable:"replacementSources",dependency:"target"+$s,expandComposites:!1}),!gs.success))throw Error(`Couldn't resolve recalculateDownstreamComponents for target${$s} of replacementSources of ${rs.componentName}`);let bs=[];if(rs.replacementsToWithhold>0){let $s={changeType:"changeReplacementsToWithhold",replacementsToWithhold:0};bs.push($s)}let vs=0,xs=0,Cs=[],Ts=[],Ss=[],Ns=Math.max(hs.length,os.numReplacementsBySource.length),As=!1;for(let $s=0;$s0){if(!As){let js=os.numReplacementsBySource.slice($s).reduce((Ls,Gs)=>Ls+Gs,0);if(js>0){let Ls={changeType:"delete",changeTopLevelReplacements:!0,firstReplacementInd:vs,numberReplacementsToDelete:js};bs.push(Ls)}As=!0,os.numReplacementsBySource.slice($s).forEach((Ls,Gs)=>os.numReplacementsBySource[Gs]=0),os.numNonStringReplacementsBySource.slice($s).forEach((Ls,Gs)=>os.numNonStringReplacementsBySource[Gs]=0)}os.uniqueIdentifiersUsedBySource[$s]=[]}Cs[$s]=0,Ts[$s]=0,Ss.push([]);continue}let Os=os.sourceNames[$s],Is=Os===void 0||Ds.componentName!==Os||As;if(!Is)for(let js=0;jsNl+yl,0);Ys.numberReplacementsToReplace=Zs,As=!0,os.numReplacementsBySource.slice($s).forEach((Nl,yl)=>os.numReplacementsBySource[yl]=0),os.numNonStringReplacementsBySource.slice($s).forEach((Nl,yl)=>os.numNonStringReplacementsBySource[yl]=0)}bs.push(Ys);continue}if(!ys[$s]&&os.numReplacementsBySource[$s]>0){vs+=os.numReplacementsBySource[$s],xs+=os.numNonStringReplacementsBySource[$s],Cs[$s]=os.numReplacementsBySource[$s],Ts[$s]=os.numNonStringReplacementsBySource[$s];continue}let Vs=os.uniqueIdentifiersUsedBySource[$s]=[],ks=await this.createReplacementForSource({component:rs,sourceNum:$s,components:ss,numReplacementsSoFar:vs,numNonStringReplacementsSoFar:xs,uniqueIdentifiersUsed:Vs,compositeAttributesObj:ps,componentInfoObjects:ls,nComponentsForSource:Rs,publicCaseInsensitiveAliasSubstitutions:ds,flags:us}),Ps=ks.propVariablesCopiedByReplacement,Bs=ks.serializedReplacements,Ms=Bs.length,Ws=os.numReplacementsBySource[$s];if(Ms!==Ws){let js=os.numReplacementsBySource.slice($s).reduce((Gs,Hs)=>Gs+Hs,0),Ls={changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:vs,numberReplacementsToReplace:js,serializedReplacements:Bs,assignNamesOffset:xs};bs.push(Ls),As=!0,os.numReplacementsBySource.slice($s).forEach((Gs,Hs)=>os.numReplacementsBySource[Hs]=0),os.numNonStringReplacementsBySource.slice($s).forEach((Gs,Hs)=>os.numNonStringReplacementsBySource[Hs]=0)}else{let js=0;for(let Ls=0;LsYs!==Ps[Ls][Zs])?(Hs=!1,Gs=!0):rs.replacements[vs+Ls].componentType!==Bs[Ls].componentType&&(Gs=!0)),Ls==0&&Gs&&Hs&&await rs.stateValues.nComponentsSpecified===1&&Ms===1&&!(rs.replacementsToWithhold>0)&&os.sourceNames.length===1&&(Gs=!1),Gs){let Ys={changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:vs+Ls,numberReplacementsToReplace:1,serializedReplacements:[Bs[Ls]],assignNamesOffset:xs+js};bs.push(Ys)}typeof Bs[Ls]!="string"&&js++}}let Us=Bs.filter(js=>typeof js!="string").length;vs+=Ms,xs+=Us,Cs[$s]=Ms,Ts[$s]=Us,Ss[$s]=Ps}let ws=os.sourceNames.length===0;os.numReplacementsBySource=Cs,os.numNonStringReplacementsBySource=Ts,os.sourceNames=hs.map($s=>$s.componentName),os.propVariablesCopiedBySource=Ss;let Es=await verifyReplacementsMatchSpecifiedType({component:rs,replacementChanges:bs,assignNames:fs,workspace:os,componentInfoObjects:ls,compositeAttributesObj:ps,flags:us});return ws&&os.sourceNames.length===0?[]:Es.replacementChanges}static async recreateReplacements({component:rs,sourceNum:ns,numReplacementsSoFar:ss,numNonStringReplacementsSoFar:os,numReplacementsToDelete:ls,uniqueIdentifiersUsed:us,components:cs,compositeAttributesObj:ds,componentInfoObjects:ps,nComponentsForSource:fs,publicCaseInsensitiveAliasSubstitutions:hs,flags:gs}){let ys=await this.createReplacementForSource({component:rs,sourceNum:ns,numReplacementsSoFar:ss,numNonStringReplacementsSoFar:os,components:cs,uniqueIdentifiersUsed:us,compositeAttributesObj:ds,componentInfoObjects:ps,nComponentsForSource:fs,publicCaseInsensitiveAliasSubstitutions:hs,flags:gs}),bs=ys.propVariablesCopiedByReplacement,vs=ys.serializedReplacements,xs={changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:ss,numberReplacementsToReplace:ls,serializedReplacements:vs,assignNamesOffset:os};return{numReplacements:vs.length,numNonStringReplacements:vs.filter(Cs=>typeof Cs!="string").length,propVariablesCopiedByReplacement:bs,replacementInstruction:xs}}}zs(Copy,"componentType","copy"),zs(Copy,"assignNamesToReplacements",!0),zs(Copy,"acceptTarget",!0),zs(Copy,"acceptAnyAttribute",!0),zs(Copy,"includeBlankStringChildren",!0),zs(Copy,"stateVariableToEvaluateAfterReplacements","needsReplacementsUpdatedWhenStale");async function replacementFromProp({component:as,components:rs,replacementSource:ns,propName:ss,uniqueIdentifiersUsed:os,compositeAttributesObj:ls,componentInfoObjects:us,nComponentsForSource:cs,publicCaseInsensitiveAliasSubstitutions:ds,flags:ps}){var Ss,Ns,As,ws,Es,_s,$s,Rs,Ds,Os;let fs=[],hs=[],gs=(Ss=as.attributes.newNamespace)==null?void 0:Ss.primitive,ys=-1,bs=rs[ns.componentName],vs=ds({stateVariables:[ss],componentClass:bs.constructor})[0];if(vs===void 0||vs.slice(0,12)==="__not_public")return ss!=="__prop_name_not_found"&&console.warn(`Could not find prop ${ss} on a component of type ${ns.componentType}`),{serializedReplacements:[],propVariablesCopiedByReplacement:[]};let xs=bs.state[vs],Cs=await xs.value,Ts=await as.stateValues.link;if(xs.isArray||xs.isArrayEntry){let Is,Vs,ks,Ps;if(xs.isArray?(Is=xs,ks=await xs.arraySize,Vs=xs.getAllArrayKeys(ks,!1)):(Is=bs.state[xs.arrayStateVariable],Vs=await xs.unflattenedArrayKeys,Ps=await xs.arrayKeys),(Ns=Is.shadowingInstructions)!=null&&Ns.hasVariableComponentType&&(await as.stateValues.replacementSources,!Is.shadowingInstructions.createComponentOfType))return{serializedReplacements:[],propVariablesCopiedByReplacement:[]};let Bs=xs.wrappingComponents,Ms=Bs.length,Ws=cs;if(xs.isArray)Ws=ks.slice(0,ks.length-Ms).reduce((Us,js)=>Us*js,1);else if(Ps.length===0)Ws=0;else if(Ms===0)Ws=Ps.length;else if(Ms>=xs.nDimensions)Ws=1;else if(Ms===xs.nDimensions-1)Ws=Vs.length;else{let Us=xs.nDimensions-Ms-1;Ws=flattenLevels(Vs,Us).length}if(Ms===0){let Us=flattenDeep(Vs);for(let js=0;js1)for(let Ml of Gs){let Ks=await Us(Ml,Hs-1);Ys.push(...Ks.pieces),Zs.push(...Ks.propVariablesCopiedByPiece)}else for(let Ml of Gs){let Ks=Is.arrayVarNameFromArrayKey(Ml),qs=[Ks],Qs=ns.componentName+"|shadow|"+Ks,Js=getUniqueIdentifierFromBase(Qs,os),El=Is.shadowingInstructions.createComponentOfType;Array.isArray(El)&&(El=El[Is.keyToIndex(Ml)]);let _l;if(Is.shadowingInstructions.addAttributeComponentsShadowingStateVariables){_l={};for(let xl in Is.shadowingInstructions.addAttributeComponentsShadowingStateVariables){let Al=Is.shadowingInstructions.addAttributeComponentsShadowingStateVariables[xl].stateVariableToShadow,Sl=bs.state[Al];Sl.isArray&&(Al=Sl.arrayVarNameFromArrayKey(Ml)),_l[xl]={stateVariableToShadow:Al}}}let Xs;if(Is.shadowingInstructions.addStateVariablesShadowingStateVariables){Xs={};for(let xl in Is.shadowingInstructions.addStateVariablesShadowingStateVariables){let Al=Is.shadowingInstructions.addStateVariablesShadowingStateVariables[xl].stateVariableToShadow,Sl=bs.state[Al];Sl.isArray&&(Al=Sl.arrayVarNameFromArrayKey(Ml)),Xs[xl]={stateVariableToShadow:Al}}}if(Ts){let xl={};if(_l){let Sl=us.allComponentClasses[El].createAttributesObject();for(let Vl in _l){let Fs=_l[Vl].stateVariableToShadow,Tl={componentType:Sl[Vl].createComponentOfType,downstreamDependencies:{[bs.componentName]:[{compositeName:as.componentName,dependencyType:"referenceShadow",propVariable:Fs}]}};xl[Vl]={component:Tl}}}Ys.push({componentType:El,attributes:xl,downstreamDependencies:{[ns.componentName]:[{dependencyType:"referenceShadow",compositeName:as.componentName,propVariable:Ks,additionalStateVariableShadowing:Xs}]},uniqueIdentifier:Js})}else{let xl={};if(_l){let Tl={};for(let Xl in _l){let Pl=_l[Xl].stateVariableToShadow,Bl=bs.state[Pl],Wl=await Bl.value;Bl.isArray&&(Wl=Wl[Bl.keyToIndex[Ml]]),bs.state[Pl].usedDefault||(Tl[Xl]=Wl)}let zl=convertAttributesForComponentType({attributes:Tl,componentType:El,componentInfoObjects:us,flags:ps});if(xs.shadowingInstructions.attributesToShadow)for(let Xl of xs.shadowingInstructions.attributesToShadow)(yl=bs.attributes[Xl])!=null&&yl.component?zl[Xl]={component:await((Dl=bs.attributes[Xl])==null?void 0:Dl.component.serialize({copyAll:!0,copyVariants:!0}))}:((Rl=bs.attributes[Xl])==null?void 0:Rl.primitive)!==void 0&&(zl[Xl]={primitive:JSON.parse(JSON.stringify(bs.attributes[Xl].primitive))});Object.assign(xl,zl)}let Al="value",Sl=us.allComponentClasses[El];Sl.primaryEssentialStateVariable?Al=Sl.primaryEssentialStateVariable:Sl.primaryStateVariableForDefinition&&(Al=Sl.primaryStateVariableForDefinition);let Vl=Is.keyToIndex(Ml);Array.isArray(Vl)||(Vl=[Vl]);let Fs=await Is.value;for(let Tl of Vl)Fs=Fs[Tl];let Cl={componentType:El,attributes:xl,state:{[Al]:Fs},uniqueIdentifier:Js};Ys.push(Cl)}Zs.push(qs)}let Nl=Bs[Hs-1];if(Ys.length>0&&Nl&&Nl.length>0){for(let Ml=Nl.length-1;Ml>=0;Ml--){let Ks=typeof Nl[Ml]=="object"?Nl[Ml].componentType:Nl[Ml],qs=Ks+"|wrapper",Qs=getUniqueIdentifierFromBase(qs,os),Js=[],El={};for(let _l of Ys)if(_l.isAttribute){let Xs=_l.isAttribute;delete _l.isAttribute,El[Xs]={component:_l}}else Js.push(_l);Ys=[{componentType:Ks,children:Js,attributes:El,uniqueIdentifier:Qs,skipSugar:!0}],typeof Nl[Ml]=="object"&&(Nl[Ml].doenetAttributes&&(Ys[0].doenetAttributes=Object.assign({},Nl[Ml].doenetAttributes)),Nl[Ml].isAttribute&&(Ys[0].isAttribute=Nl[Ml].isAttribute))}Zs=[flattenDeep(Zs)]}return{pieces:Ys,propVariablesCopiedByPiece:Zs}},js=await Us(Vs,xs.nDimensions),Ls=js.pieces;hs=js.propVariablesCopiedByPiece;for(let Gs of Ls){if(typeof Gs!="object")continue;Gs.attributes||(Gs.attributes={});let Hs=convertAttributesForComponentType({attributes:as.attributes,componentType:Gs.componentType,componentInfoObjects:us,compositeAttributesObj:ls,compositeCreatesNewNamespace:gs,flags:ps});Object.assign(Gs.attributes,Hs),Ts&&(Gs.downstreamDependencies={[ns.componentName]:[{dependencyType:"referenceShadow",compositeName:as.componentName,propVariable:vs,ignorePrimaryStateVariable:!0}]})}if(ys+=Ls.length,fs.push(...Ls),Ls.length0?typeof Ys[0]=="object"?(Hs=Ys[0].componentType,Zs=Object.assign({},Ys[0].doenetAttributes)):Hs=Ys[0]:(Hs=Is.shadowingInstructions.createComponentOfType,Array.isArray(Hs)&&(xs.isArrayEntry?Hs=Hs[Is.keyToIndex(Ps[Gs])]:Hs=Hs[Gs]));let Nl=Hs+"|empty",yl=getUniqueIdentifierFromBase(Nl,os),Dl={componentType:Hs,uniqueIdentifier:yl};Zs&&(Dl.doenetAttributes=Zs),fs.push(Dl)}else if(Ls>Ws)throw Error(`Something went wrong when creating replacements for ${as.componentName} as we ended up with too many replacements`)}}else{if((_s=xs.shadowingInstructions)!=null&&_s.hasVariableComponentType&&await xs.value,!(($s=xs.shadowingInstructions)!=null&&$s.createComponentOfType))return{serializedReplacements:[],propVariablesCopiedByReplacement:[]};ys++,(hs[ys]=[]).push(vs);let Vs=bs.componentName+"|shadow|"+vs,ks=getUniqueIdentifierFromBase(Vs,os);if(xs.shadowingInstructions.createComponentOfType==="string")fs.push(await xs.value);else{let Ps=convertAttributesForComponentType({attributes:as.attributes,componentType:xs.shadowingInstructions.createComponentOfType,componentInfoObjects:us,compositeAttributesObj:ls,compositeCreatesNewNamespace:gs,flags:ps});if(Ts){let Bs={};if(xs.shadowingInstructions.addAttributeComponentsShadowingStateVariables){let Ws=us.allComponentClasses[xs.shadowingInstructions.createComponentOfType].createAttributesObject();for(let Us in xs.shadowingInstructions.addAttributeComponentsShadowingStateVariables){let js=xs.shadowingInstructions.addAttributeComponentsShadowingStateVariables[Us].stateVariableToShadow,Gs={componentType:Ws[Us].createComponentOfType,downstreamDependencies:{[bs.componentName]:[{compositeName:as.componentName,dependencyType:"referenceShadow",propVariable:js}]}};Bs[Us]={component:Gs}}}Object.assign(Bs,Ps),fs.push({componentType:xs.shadowingInstructions.createComponentOfType,attributes:Bs,downstreamDependencies:{[bs.componentName]:[{dependencyType:"referenceShadow",compositeName:as.componentName,propVariable:vs,additionalStateVariableShadowing:xs.shadowingInstructions.addStateVariablesShadowingStateVariables}]},uniqueIdentifier:ks})}else{let Bs={};if(xs.shadowingInstructions.addAttributeComponentsShadowingStateVariables){let js={};for(let Gs in xs.shadowingInstructions.addAttributeComponentsShadowingStateVariables)if(Gs!=="fixed"){let Hs=xs.shadowingInstructions.addAttributeComponentsShadowingStateVariables[Gs].stateVariableToShadow,Ys=await bs.state[Hs].value;bs.state[Hs].usedDefault||(js[Gs]=Ys)}let Ls=convertAttributesForComponentType({attributes:js,componentType:xs.shadowingInstructions.createComponentOfType,componentInfoObjects:us,flags:ps});if(xs.shadowingInstructions.attributesToShadow)for(let Gs of xs.shadowingInstructions.attributesToShadow)(Rs=bs.attributes[Gs])!=null&&Rs.component?Ls[Gs]={component:await((Ds=bs.attributes[Gs])==null?void 0:Ds.component.serialize({copyAll:!0,copyVariants:!0}))}:((Os=bs.attributes[Gs])==null?void 0:Os.primitive)!==void 0&&(Ls[Gs]={primitive:JSON.parse(JSON.stringify(bs.attributes[Gs].primitive))});Object.assign(Bs,Ls)}Object.assign(Bs,Ps);let Ms="value",Ws=us.allComponentClasses[xs.shadowingInstructions.createComponentOfType];Ws.primaryEssentialStateVariable?Ms=Ws.primaryEssentialStateVariable:Ws.primaryStateVariableForDefinition&&(Ms=Ws.primaryStateVariableForDefinition);let Us={componentType:xs.shadowingInstructions.createComponentOfType,attributes:Bs,state:{[Ms]:Cs},uniqueIdentifier:ks};fs.push(Us)}}}return{serializedReplacements:fs,propVariablesCopiedByReplacement:hs}}class Extract extends CompositeComponent{static createAttributesObject(){let rs=super.createAttributesObject();return delete rs.disabled,delete rs.modifyIndirectly,delete rs.fixed,delete rs.styleNumber,delete rs.isResponse,rs.assignNamesSkip={createPrimitiveOfType:"number"},rs.prop={createPrimitiveOfType:"string"},rs.createComponentOfType={createPrimitiveOfType:"string"},rs.nComponents={createPrimitiveOfType:"number"},rs.componentIndex={createComponentOfType:"integer",createStateVariable:"componentIndex",defaultValue:null,public:!0},rs.propIndex={createComponentOfType:"numberList",createStateVariable:"propIndex",defaultValue:null,public:!0},rs}static returnChildGroups(){return[{group:"anything",componentTypes:["_base"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.nComponentsSpecified={returnDependencies:()=>({nComponentsAttr:{dependencyType:"attributePrimitive",attributeName:"nComponents"},typeAttr:{dependencyType:"attributePrimitive",attributeName:"createComponentOfType"}}),definition({dependencyValues:ns,componentInfoObjects:ss}){let os;if(ns.typeAttr){if(!(ss.componentTypeLowerCaseMapping[ns.typeAttr.toLowerCase()]in ss.allComponentClasses))throw Error(`Invalid componentType ${ns.typeAttr} of copy.`);ns.nComponentsAttr!==null?os=ns.nComponentsAttr:os=1}else{if(ns.nComponentsAttr!==null)throw Error("You must specify createComponentOfType when specifying nComponents for a copy.");os=null}return{setValue:{nComponentsSpecified:os}}}},rs.link={returnDependencies:()=>({}),definition:()=>({setValue:{link:!0}})},rs.propName={shadowVariable:!0,returnDependencies:()=>({propName:{dependencyType:"attributePrimitive",attributeName:"prop"}}),definition:function({dependencyValues:ns}){return{setValue:{propName:ns.propName}}}},rs.sourceComponents={stateVariablesDeterminingDependencies:["propName","componentIndex","propIndex"],additionalStateVariablesDefined:["effectivePropNameBySource"],returnDependencies:function({stateValues:ns}){let ss,os;ns.componentIndex!==null&&(os=Number(ns.componentIndex),Number.isInteger(os)?ss=[os-1]:ss=[]);let ls=ns.propIndex;return ls&&(ls=[...ls]),{children:{dependencyType:"child",childGroups:["anything"],variableNames:[ns.propName],variablesOptional:!0,childIndices:ss,propIndex:ls,caseInsensitiveVariableMatch:!0,publicStateVariablesOnly:!0,useMappedVariableNames:!0},propName:{dependencyType:"stateVariable",variableName:"propName"}}},definition:function({dependencyValues:ns}){let ss=ns.children,os=[];for(let ls of ss){let us;ls.stateValues&&(us=Object.keys(ls.stateValues)[0]),us||(us="__prop_name_not_found"),os.push(us)}return{setValue:{sourceComponents:ss,effectivePropNameBySource:os}}}},rs.readyToExpandWhenResolved={returnDependencies:()=>({replacementClasses:{dependencyType:"stateVariable",variableName:"sourceComponents"},needsReplacementsUpdatedWhenStale:{dependencyType:"stateVariable",variableName:"needsReplacementsUpdatedWhenStale"}}),definition(){return{setValue:{readyToExpandWhenResolved:!0}}}},rs.needsReplacementsUpdatedWhenStale={returnDependencies(){return{sourceComponents:{dependencyType:"stateVariable",variableName:"sourceComponents"}}},markStale:()=>({updateReplacements:!0}),definition:()=>({setValue:{needsReplacementsUpdatedWhenStale:!0}})},rs}static async createSerializedReplacements({component:rs,components:ns,workspace:ss,componentInfoObjects:os,flags:ls,publicCaseInsensitiveAliasSubstitutions:us}){let cs=[],ds=[],ps=0;ss.propVariablesCopiedBySource=[],ss.uniqueIdentifiersUsedBySource={};let fs=this.createAttributesObject(),hs=await rs.stateValues.sourceComponents;for(let ys=0;ysys.componentName),{replacements:(await verifyReplacementsMatchSpecifiedType({component:rs,replacements:cs,assignNames:rs.doenetAttributes.assignNames,workspace:ss,componentInfoObjects:os,compositeAttributesObj:fs,flags:ls})).replacements}}static async createReplacementForSource({component:rs,components:ns,sourceNum:ss,numReplacementsSoFar:os,uniqueIdentifiersUsed:ls,componentInfoObjects:us,compositeAttributesObj:cs,publicCaseInsensitiveAliasSubstitutions:ds}){var vs;let ps=(await rs.stateValues.effectivePropNameBySource)[ss],fs=await replacementFromProp({component:rs,components:ns,replacementSource:(await rs.stateValues.sourceComponents)[ss],propName:ps,uniqueIdentifiersUsed:ls,compositeAttributesObj:cs,componentInfoObjects:us,publicCaseInsensitiveAliasSubstitutions:ds}),hs=fs.serializedReplacements,gs=fs.propVariablesCopiedByReplacement,ys=(vs=rs.attributes.newNamespace)==null?void 0:vs.primitive;return hs=processAssignNames({assignNames:rs.doenetAttributes.assignNames,serializedComponents:hs,parentName:rs.componentName,indOffset:os,parentCreatesNewNamespace:ys,componentInfoObjects:us}).serializedComponents,{serializedReplacements:hs,propVariablesCopiedByReplacement:gs}}static async calculateReplacementChanges({component:rs,components:ns,workspace:ss,componentInfoObjects:os,flags:ls,publicCaseInsensitiveAliasSubstitutions:us}){let cs=[],ds=0,ps=[],fs=[],hs=this.createAttributesObject(),gs=await rs.stateValues.sourceComponents,ys=Math.max(gs.length,ss.numReplacementsBySource.length),bs=!1;for(let xs=0;xs0){if(!bs){let Rs=ss.numReplacementsBySource.slice(xs).reduce((Ds,Os)=>Ds+Os,0);if(Rs>0){let Ds={changeType:"delete",changeTopLevelReplacements:!0,firstReplacementInd:ds,numberReplacementsToDelete:Rs};cs.push(Ds)}bs=!0,ss.numReplacementsBySource.slice(xs).forEach((Ds,Os)=>ss.numReplacementsBySource[Os]=0)}ss.uniqueIdentifiersUsedBySource[xs]=[]}ps[xs]=0,fs.push([]);continue}let Ts=ss.sourceNames[xs],Ss=Ts===void 0||Cs.componentName!==Ts||bs;if(!Ss){for(let Rs=0;RsPs+Bs,0);Vs.numberReplacementsToReplace=ks,bs=!0,ss.numReplacementsBySource.slice(xs).forEach((Ps,Bs)=>ss.numReplacementsBySource[Bs]=0)}cs.push(Vs);continue}let Ns=ss.uniqueIdentifiersUsedBySource[xs]=[],As=await this.createReplacementForSource({component:rs,sourceNum:xs,components:ns,numReplacementsSoFar:ds,uniqueIdentifiersUsed:Ns,componentInfoObjects:os,compositeAttributesObj:hs,publicCaseInsensitiveAliasSubstitutions:us}),ws=As.propVariablesCopiedByReplacement,Es=As.serializedReplacements,_s=Es.length,$s=ss.numReplacementsBySource[xs];if(_s!==$s){let Rs=ss.numReplacementsBySource.slice(xs).reduce((Os,Is)=>Os+Is,0),Ds={changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:ds,numberReplacementsToReplace:Rs,serializedReplacements:Es,assignNamesOffset:ds};cs.push(Ds),bs=!0,ss.numReplacementsBySource.slice(xs).forEach((Os,Is)=>ss.numReplacementsBySource[Is]=0)}else for(let Rs=0;Rs<_s;Rs++)if(ws[Rs].length!==ss.propVariablesCopiedBySource[xs][Rs].length||ss.propVariablesCopiedBySource[xs][Rs].some((Ds,Os)=>Ds!==ws[Rs][Os])){let Ds={changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:ds+Rs,numberReplacementsToReplace:1,serializedReplacements:[Es[Rs]],assignNamesOffset:ds+Rs};cs.push(Ds)}ds+=_s,ps[xs]=_s,fs[xs]=ws}return ss.numReplacementsBySource=ps,ss.numNonStringReplacementsBySource=[...ps],ss.sourceNames=gs.map(xs=>xs.componentName),ss.propVariablesCopiedBySource=fs,(await verifyReplacementsMatchSpecifiedType({component:rs,replacementChanges:cs,assignNames:rs.doenetAttributes.assignNames,workspace:ss,componentInfoObjects:os,compositeAttributesObj:hs,flags:ls})).replacementChanges}static async recreateReplacements({component:rs,sourceNum:ns,numReplacementsSoFar:ss,numReplacementsToDelete:os,uniqueIdentifiersUsed:ls,components:us,componentInfoObjects:cs,compositeAttributesObj:ds,publicCaseInsensitiveAliasSubstitutions:ps}){let fs=await this.createReplacementForSource({component:rs,sourceNum:ns,numReplacementsSoFar:ss,components:us,uniqueIdentifiersUsed:ls,componentInfoObjects:cs,compositeAttributesObj:ds,publicCaseInsensitiveAliasSubstitutions:ps}),hs=fs.propVariablesCopiedByReplacement,gs=fs.serializedReplacements,ys={changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:ss,numberReplacementsToReplace:os,serializedReplacements:gs,assignNamesOffset:ss};return{numReplacements:gs.length,propVariablesCopiedByReplacement:hs,replacementInstruction:ys}}}zs(Extract,"componentType","extract"),zs(Extract,"assignNamesToReplacements",!0),zs(Extract,"acceptAnyAttribute",!0),zs(Extract,"stateVariableToEvaluateAfterReplacements","needsReplacementsUpdatedWhenStale");class Collect extends CompositeComponent{static createAttributesObject(){let rs=super.createAttributesObject();return delete rs.disabled,delete rs.modifyIndirectly,delete rs.fixed,delete rs.styleNumber,delete rs.isResponse,rs.assignNamesSkip={createPrimitiveOfType:"number"},rs.prop={createPrimitiveOfType:"string"},rs.maximumNumber={createComponentOfType:"number",createStateVariable:"maximumNumber",defaultValue:null,public:!0},rs.componentIndex={createComponentOfType:"integer",createStateVariable:"componentIndex",defaultValue:null,public:!0},rs.propIndex={createComponentOfType:"numberList",createStateVariable:"propIndex",defaultValue:null,public:!0},rs.sourceAttributesToIgnore={createPrimitiveOfType:"stringArray",createStateVariable:"sourceAttributesToIgnore",defaultValue:[],public:!0},rs.sourceAttributesToIgnoreRecursively={createPrimitiveOfType:"stringArray",createStateVariable:"sourceAttributesToIgnoreRecursively",defaultValue:["isResponse"],public:!0},rs.componentTypes={createComponentOfType:"textList"},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.link={returnDependencies:()=>({}),definition:()=>({setValue:{link:!0}})},rs.targetComponent={shadowVariable:!0,returnDependencies:()=>({targetComponent:{dependencyType:"targetComponent"}}),definition:function({dependencyValues:ns}){return{setValue:{targetComponent:ns.targetComponent}}}},rs.targetInactive={stateVariablesDeterminingDependencies:["targetComponent"],returnDependencies({stateValues:ns}){return ns.targetComponent?{targetIsInactiveCompositeReplacement:{dependencyType:"stateVariable",componentName:ns.targetComponent.componentName,variableName:"isInactiveCompositeReplacement"}}:{}},definition:function({dependencyValues:ns}){return{setValue:{targetInactive:!!ns.targetIsInactiveCompositeReplacement}}}},rs.targetName={returnDependencies:()=>({targetComponent:{dependencyType:"stateVariable",variableName:"targetComponent"}}),definition:function({dependencyValues:ns}){return ns.targetComponent===null?(console.warn("No copy target"),{setValue:{targetName:""}}):{setValue:{targetName:ns.targetComponent.componentName}}}},rs.propName={shadowVariable:!0,returnDependencies:()=>({propName:{dependencyType:"attributePrimitive",attributeName:"prop"}}),definition:function({dependencyValues:ns}){return{setValue:{propName:ns.propName}}}},rs.componentTypesToCollect={shadowVariable:!0,additionalStateVariablesDefined:[{variableName:"componentClassesToCollect",shadowVariable:!0}],returnDependencies:()=>({componentTypesAttr:{dependencyType:"attributeComponent",attributeName:"componentTypes",variableNames:["texts"]}}),definition:function({dependencyValues:ns,componentInfoObjects:ss}){let os=[],ls=[];if(ns.componentTypesAttr!==null)for(let us of ns.componentTypesAttr.stateValues.texts){let cs=ss.componentTypeLowerCaseMapping[us.toLowerCase()],ds=ss.allComponentClasses[cs];if(ds)os.push(cs),ls.push(ds);else{let ps="Cannot collect component type "+us+". Component type not found.";console.warn(ps)}}return{setValue:{componentTypesToCollect:os,componentClassesToCollect:ls}}}},rs.collectedComponents={stateVariablesDeterminingDependencies:["componentTypesToCollect","targetName","propName","componentIndex","propIndex"],additionalStateVariablesDefined:["effectivePropNameByComponent"],returnDependencies:function({stateValues:ns}){if(!ns.targetName)return{};let ss={dependencyType:"descendant",ancestorName:ns.targetName,componentTypes:ns.componentTypesToCollect,useReplacementsForComposites:!0,includeNonActiveChildren:!0,recurseToMatchedChildren:!1,componentIndex:ns.componentIndex};if(ns.propName){let os=ns.propIndex;os&&(os=[...os]),ss.variableNames=[ns.propName],ss.variablesOptional=!0,ss.propIndex=os,ss.caseInsensitiveVariableMatch=!0,ss.publicStateVariablesOnly=!0,ss.useMappedVariableNames=!0}return{descendants:ss,maximumNumber:{dependencyType:"stateVariable",variableName:"maximumNumber"},propName:{dependencyType:"stateVariable",variableName:"propName"}}},definition:function({dependencyValues:ns}){let ss=ns.descendants;if(ss||(ss=[]),ns.maximumNumber!==null&&ss.length>ns.maximumNumber){let ls=Math.max(0,Math.floor(ns.maximumNumber));ss=ss.slice(0,ls)}let os=[];for(let ls of ss){let us;ls.stateValues&&(us=Object.keys(ls.stateValues)[0]),!us&&ns.propName&&(us="__prop_name_not_found"),os.push(us)}return{setValue:{collectedComponents:ss,effectivePropNameByComponent:os}}}},rs.readyToExpandWhenResolved={returnDependencies:()=>({collectedComponents:{dependencyType:"stateVariable",variableName:"collectedComponents"},needsReplacementsUpdatedWhenStale:{dependencyType:"stateVariable",variableName:"needsReplacementsUpdatedWhenStale"}}),definition:()=>({setValue:{readyToExpandWhenResolved:!0}})},rs.needsReplacementsUpdatedWhenStale={returnDependencies(){return{collectedComponents:{dependencyType:"stateVariable",variableName:"collectedComponents"}}},markStale(){return{updateReplacements:!0}},definition(){return{setValue:{needsReplacementsUpdatedWhenStale:!0}}}},rs}static async createSerializedReplacements({component:rs,components:ns,workspace:ss,componentInfoObjects:os,nComponentsForSource:ls,publicCaseInsensitiveAliasSubstitutions:us,flags:cs}){if(!await rs.stateValues.targetComponent)return{replacements:[]};let ds=[],ps=[],fs=0,hs=[];ss.propVariablesCopiedByCollected=[],ss.uniqueIdentifiersUsedByCollected={};let gs=this.createAttributesObject(),ys=await rs.stateValues.collectedComponents;for(let bs=0;bsTs.componentName)}else ps[bs]=0,hs[bs]=[],ss.propVariablesCopiedByCollected[bs]=[];return ss.numReplacementsByCollected=ps,ss.collectedNames=ys.map(bs=>bs.componentName),ss.replacementNamesByCollected=hs,{replacements:ds}}static async createReplacementForCollected({component:rs,components:ns,collectedNum:ss,numReplacementsSoFar:os,uniqueIdentifiersUsed:ls,componentInfoObjects:us,compositeAttributesObj:cs,nComponentsForSource:ds,publicCaseInsensitiveAliasSubstitutions:ps,flags:fs}){var Ss;let hs=(await rs.stateValues.collectedComponents)[ss],gs=hs.componentName,ys=ns[gs],bs=[],vs=[];if(!ys)return{serializedReplacements:bs,propVariablesCopiedByReplacement:vs};let xs=(Ss=rs.attributes.newNamespace)==null?void 0:Ss.primitive,Cs=(await rs.stateValues.effectivePropNameByComponent)[ss];if(Cs){let Ns=await replacementFromProp({component:rs,components:ns,replacementSource:hs,propName:Cs,uniqueIdentifiersUsed:ls,compositeAttributesObj:cs,componentInfoObjects:us,nComponentsForSource:ds,publicCaseInsensitiveAliasSubstitutions:ps});bs=Ns.serializedReplacements,vs=Ns.propVariablesCopiedByReplacement}else{let Ns=await rs.stateValues.sourceAttributesToIgnore,As=await rs.stateValues.sourceAttributesToIgnoreRecursively,ws=[await ys.serialize({sourceAttributesToIgnore:Ns,sourceAttributesToIgnoreRecursively:As})];bs=postProcessCopy({serializedComponents:ws,componentName:rs.componentName,uniqueIdentifiersUsed:ls,identifierPrefix:ss+"|"});for(let Es of bs){Es.attributes||(Es.attributes={});let _s=convertAttributesForComponentType({attributes:rs.attributes,componentType:Es.componentType,componentInfoObjects:us,compositeAttributesObj:cs,compositeCreatesNewNamespace:xs,flags:fs});Object.assign(Es.attributes,_s)}}return bs=processAssignNames({assignNames:rs.doenetAttributes.assignNames,serializedComponents:bs,parentName:rs.componentName,indOffset:os,parentCreatesNewNamespace:xs,componentInfoObjects:us}).serializedComponents,{serializedReplacements:bs,propVariablesCopiedByReplacement:vs}}static async calculateReplacementChanges({component:rs,componentChanges:ns,components:ss,workspace:os,componentInfoObjects:ls,nComponentsForSource:us,publicCaseInsensitiveAliasSubstitutions:cs,flags:ds}){let ps=0;for(let Ss=0;Ss0){if(!Cs){let Os=os.numReplacementsByCollected.slice(Ss).reduce((Is,Vs)=>Is+Vs,0);if(Os>0){let Is={changeType:"delete",changeTopLevelReplacements:!0,firstReplacementInd:hs,numberReplacementsToDelete:Os};fs.push(Is)}Cs=!0,os.numReplacementsByCollected.slice(Ss).forEach((Is,Vs)=>os.numReplacementsByCollected[Vs]=0)}os.uniqueIdentifiersUsedByCollected[Ss]=[]}gs[Ss]=0,ys.push([]),bs.push([]);continue}let As=os.collectedNames[Ss];if(As===void 0||Ns.componentName!==As||Cs){let Os=0;As!==void 0&&(Os=os.numReplacementsByCollected[Ss]);let Is=Os;Cs&&(Is=0);let Vs=os.uniqueIdentifiersUsedByCollected[Ss]=[],ks=await this.recreateReplacements({component:rs,collectedNum:Ss,numReplacementsSoFar:hs,numReplacementsToDelete:Is,components:ss,uniqueIdentifiersUsed:Vs,componentInfoObjects:ls,compositeAttributesObj:Ts,nComponentsForSource:us,publicCaseInsensitiveAliasSubstitutions:cs,flags:ds});hs+=ks.numReplacements,gs[Ss]=ks.numReplacements,ys[Ss]=ks.propVariablesCopiedByReplacement;let Ps=ks.replacementInstruction;if(bs[Ss]=Ps.serializedReplacements.map(Bs=>Bs.componentName),!Cs&&ks.numReplacements!==Os){let Bs=os.numReplacementsByCollected.slice(Ss).reduce((Ms,Ws)=>Ms+Ws,0);Ps.numberReplacementsToReplace=Bs,Cs=!0,os.numReplacementsByCollected.slice(Ss).forEach((Ms,Ws)=>os.numReplacementsByCollected[Ws]=0)}fs.push(Ps);continue}if(!await rs.stateValues.propName){hs+=os.numReplacementsByCollected[Ss],gs[Ss]=os.numReplacementsByCollected[Ss],bs[Ss]=os.replacementNamesByCollected[Ss],ys[Ss]=[];continue}let ws=os.uniqueIdentifiersUsedByCollected[Ss]=[],Es=await this.createReplacementForCollected({component:rs,collectedNum:Ss,components:ss,numReplacementsSoFar:hs,uniqueIdentifiersUsed:ws,componentInfoObjects:ls,compositeAttributesObj:Ts,nComponentsForSource:us,publicCaseInsensitiveAliasSubstitutions:cs,flags:ds}),_s=Es.propVariablesCopiedByReplacement,$s=Es.serializedReplacements,Rs=$s.length,Ds=os.numReplacementsByCollected[Ss];if(Rs!==Ds){let Os=os.numReplacementsByCollected.slice(Ss).reduce((Vs,ks)=>Vs+ks,0),Is={changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:hs,numberReplacementsToReplace:Os,serializedReplacements:$s,assignNamesOffset:hs};fs.push(Is),Cs=!0,os.numReplacementsByCollected.slice(Ss).forEach((Vs,ks)=>os.numReplacementsByCollected[ks]=0)}else for(let Os=0;OsIs!==_s[Os][Vs])){let Is={changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:hs+Os,numberReplacementsToReplace:1,serializedReplacements:[$s[Os]],assignNamesOffset:hs+Os};fs.push(Is)}hs+=Rs,gs[Ss]=Rs,ys[Ss]=_s,bs[Ss]=$s.map(Os=>Os.componentName)}return os.numReplacementsByCollected=gs,os.collectedNames=vs.map(Ss=>Ss.componentName),os.propVariablesCopiedByCollected=ys,os.replacementNamesByCollected=bs,fs}static async recreateReplacements({component:rs,collectedNum:ns,numReplacementsSoFar:ss,numReplacementsToDelete:os,uniqueIdentifiersUsed:ls,components:us,componentInfoObjects:cs,compositeAttributesObj:ds,nComponentsForSource:ps,publicCaseInsensitiveAliasSubstitutions:fs,flags:hs}){let gs=await this.createReplacementForCollected({component:rs,collectedNum:ns,components:us,numReplacementsSoFar:ss,uniqueIdentifiersUsed:ls,componentInfoObjects:cs,compositeAttributesObj:ds,nComponentsForSource:ps,publicCaseInsensitiveAliasSubstitutions:fs,flags:hs}),ys=gs.propVariablesCopiedByReplacement,bs=gs.serializedReplacements,vs={changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:ss,numberReplacementsToReplace:os,serializedReplacements:bs,assignNamesOffset:ss};return{numReplacements:bs.length,propVariablesCopiedByReplacement:ys,replacementInstruction:vs}}}zs(Collect,"componentType","collect"),zs(Collect,"assignNamesToReplacements",!0),zs(Collect,"acceptTarget",!0),zs(Collect,"acceptAnyAttribute",!0),zs(Collect,"stateVariableToEvaluateAfterReplacements","needsReplacementsUpdatedWhenStale");class Ref extends InlineComponent{constructor(rs){super(rs),Object.assign(this.actions,{navigateToTarget:this.navigateToTarget.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.textType={createComponentOfType:"text",createStateVariable:"textType",defaultValue:"type-global",public:!0},rs.uri={createPrimitiveOfType:"string",createStateVariable:"uri",defaultValue:null,public:!0,forRenderer:!0},rs.page={createPrimitiveOfType:"integer",createStateVariable:"page",defaultValue:null,public:!0,forRenderer:!0},rs.createButton={createComponentOfType:"boolean",createStateVariable:"createButton",defaultValue:!1,forRenderer:!0},rs}static returnChildGroups(){return[{group:"anything",componentTypes:["_base"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.targetComponent={returnDependencies:()=>({targetComponent:{dependencyType:"targetComponent"}}),definition:function({dependencyValues:ns}){return{setValue:{targetComponent:ns.targetComponent}}}},rs.targetInactive={stateVariablesDeterminingDependencies:["targetComponent"],returnDependencies({stateValues:ns}){return ns.targetComponent?{targetIsInactiveCompositeReplacement:{dependencyType:"stateVariable",componentName:ns.targetComponent.componentName,variableName:"isInactiveCompositeReplacement"}}:{}},definition:function({dependencyValues:ns}){return{setValue:{targetInactive:!!ns.targetIsInactiveCompositeReplacement}}}},rs.targetName={forRenderer:!0,returnDependencies:()=>({targetComponent:{dependencyType:"stateVariable",variableName:"targetComponent"},uri:{dependencyType:"stateVariable",variableName:"uri"},page:{dependencyType:"stateVariable",variableName:"page"},targetInactive:{dependencyType:"stateVariable",variableName:"targetInactive"},targetAttribute:{dependencyType:"doenetAttribute",attributeName:"target"}}),definition:function({dependencyValues:ns}){if(ns.uri||ns.page)if(ns.targetAttribute){let ss=ns.targetAttribute;return ss[0]!=="/"&&(ss="/"+ss),{setValue:{targetName:ss}}}else return{setValue:{targetName:""}};else return ns.targetComponent===null||ns.targetInactive?{setValue:{targetName:""}}:{setValue:{targetName:ns.targetComponent.componentName}}}},rs.cid={forRenderer:!0,additionalStateVariablesDefined:[{variableName:"doenetId",forRenderer:!0},{variableName:"variantIndex",forRenderer:!0},{variableName:"edit",forRenderer:!0},{variableName:"draft",forRenderer:!0},{variableName:"hash",forRenderer:!0}],returnDependencies:()=>({uri:{dependencyType:"stateVariable",variableName:"uri"}}),definition:function({dependencyValues:ns}){if(!ns.uri||ns.uri.substring(0,7).toLowerCase()!=="doenet:")return{setValue:{cid:null,doenetId:null,variantIndex:null,edit:null,draft:null,hash:null}};let ss=null,os=null,ls=null,us=null,cs=null,ds=null,ps=ns.uri.match(/[:&]cid=([^&^#]+)/i);return ps&&(ss=ps[1]),ps=ns.uri.match(/[:&]doenetid=([^&^#]+)/i),ps&&(os=ps[1]),ps=ns.uri.match(/[:&]variant=([^&^#]+)/i),ps&&(ls=Number(ps[1]),!Number.isInteger(ls)&&ls>=1&&(ls=1)),ps=ns.uri.match(/[:&]edit=([^&^#]+)/i),ps&&(ps[1].toLowerCase()==="true"?cs=!0:cs=!1),ps=ns.uri.match(/[:&]draft=([^&^#]+)/i),ps&&(ps[1].toLowerCase()==="true"?us=!0:us=!1),ps=ns.uri.match(/(#.+)/i),ps&&(ds=ps[1]),{setValue:{cid:ss,doenetId:os,variantIndex:ls,edit:cs,draft:us,hash:ds}}}},rs.linkText={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,stateVariablesDeterminingDependencies:["targetName"],returnDependencies({stateValues:ns}){let ss={allChildren:{dependencyType:"child",childGroups:["anything"],variableNames:["text"],variablesOptional:!0},uri:{dependencyType:"stateVariable",variableName:"uri"},targetInactive:{dependencyType:"stateVariable",variableName:"targetInactive"}};return ns.targetName&&(ss.equationTag={dependencyType:"stateVariable",componentName:ns.targetName,variableName:"equationTag",variablesOptional:!0},ss.title={dependencyType:"stateVariable",componentName:ns.targetName,variableName:"title",variablesOptional:!0}),ss},definition:function({dependencyValues:ns}){let ss="";if(ns.allChildren.length===0)ns.uri!==null?ss=ns.uri:ns.targetInactive||(ns.title!==null?ss=ns.title:ns.equationTag!==null&&(ss="("+ns.equationTag+")"));else for(let os of ns.allChildren)typeof os!="object"?ss+=os.toString():typeof os.stateValues.text=="string"&&(ss+=os.stateValues.text);return ss||(ss="???"),{setValue:{linkText:ss}}}},rs}async navigateToTarget({actionId:rs}){if(await this.stateValues.disabled)this.coreFunctions.resolveAction({actionId:rs});else{let ns=await this.stateValues.cid,ss=await this.stateValues.doenetId,os=await this.stateValues.variantIndex,ls=await this.stateValues.edit,us=await this.stateValues.hash,cs=await this.stateValues.page,ds=await this.stateValues.uri,ps=await this.stateValues.targetName,fs=this.componentOrAdaptedName;this.coreFunctions.navigateToTarget({cid:ns,doenetId:ss,variantIndex:os,edit:ls,hash:us,page:cs,uri:ds,targetName:ps,actionId:rs,componentName:this.componentName,effectiveName:fs})}}}zs(Ref,"componentType","ref"),zs(Ref,"renderChildren",!0),zs(Ref,"acceptTarget",!0);class Coords extends MathComponent{static createAttributesObject(){let rs=super.createAttributesObject();return delete rs.createVectors,rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.createVectors={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},returnDependencies:()=>({}),definition:()=>({setValue:{createVectors:!0}})},rs}}zs(Coords,"componentType","coords"),zs(Coords,"rendererType","math");class LineSegment extends GraphicalComponent{constructor(rs){super(rs),Object.assign(this.actions,{moveLineSegment:this.moveLineSegment.bind(this),lineSegmentClicked:this.lineSegmentClicked.bind(this),mouseDownOnLineSegment:this.mouseDownOnLineSegment.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.endpointsDraggable={createComponentOfType:"boolean"},rs.endpoints={createComponentOfType:"_pointListComponent"},rs.showCoordsWhenDragging={createComponentOfType:"boolean",createStateVariable:"showCoordsWhenDragging",defaultValue:!0,public:!0,forRenderer:!0},rs.labelPosition={createComponentOfType:"text",createStateVariable:"labelPosition",defaultValue:"upperright",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft"]},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.styleDescription={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ns}){var ls;let ss;((ls=ns.document)==null?void 0:ls.stateValues.theme)==="dark"?ss=ns.selectedStyle.lineColorWordDarkMode:ss=ns.selectedStyle.lineColorWord;let os=ns.selectedStyle.lineWidthWord;return ns.selectedStyle.lineStyleWord&&(os&&(os+=" "),os+=ns.selectedStyle.lineStyleWord),os&&(os+=" "),os+=ss,{setValue:{styleDescription:os}}}},rs.styleDescriptionWithNoun={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({styleDescription:{dependencyType:"stateVariable",variableName:"styleDescription"}}),definition:function({dependencyValues:ns}){return{setValue:{styleDescriptionWithNoun:ns.styleDescription+" line segment"}}}},rs.endpointsDraggable={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},hasEssential:!0,forRenderer:!0,returnDependencies:()=>({endpointsDraggableAttr:{dependencyType:"attributeComponent",attributeName:"endpointsDraggable",variableNames:["value"]},draggable:{dependencyType:"stateVariable",variableName:"draggable"}}),definition({dependencyValues:ns}){return ns.endpointsDraggableAttr?{setValue:{endpointsDraggable:ns.endpointsDraggableAttr.stateValues.value}}:{useEssentialOrDefaultValue:{endpointsDraggable:{defaultValue:ns.draggable}}}}},rs.nDimensions={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({endpointsAttr:{dependencyType:"attributeComponent",attributeName:"endpoints",variableNames:["nDimensions"]}}),definition:function({dependencyValues:ns}){return ns.endpointsAttr!==null?{setValue:{nDimensions:ns.endpointsAttr.stateValues.nDimensions},checkForActualChange:{nDimensions:!0}}:{setValue:{nDimensions:2}}}},rs.endpoints={public:!0,shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(ns){return ns==="endpointX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,nDimensions:2,entryPrefixes:["endpointX","endpoint"],hasEssential:!0,set:convertValueToMathExpression,defaultValueByArrayKey:ns=>Context.fromAst(ns==="0,0"?1:0),getArrayKeysFromVarName({arrayEntryPrefix:ns,varEnding:ss,arraySize:os}){if(ns==="endpointX"){let ls=ss.split("_").map(us=>Number(us)-1);return ls.length===2&&ls.every((us,cs)=>Number.isInteger(us)&&us>=0)?os?ls.every((us,cs)=>us=0?os?lsls+","+cs):[]:[ls+",0"]:[]}},arrayVarNameFromPropIndex(ns,ss){if(ss==="endpoints")return ns.length===1?"endpoint"+ns[0]:`endpointX${ns[0]}_${ns[1]}`;if(ss.slice(0,8)==="endpoint"){let os=Number(ss.slice(8));if(Number.isInteger(os)&&os>0)return`endpointX${os}_${ns[0]}`}return null},returnArraySizeDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[2,ns.nDimensions]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={};for(let os of ns){let[ls,us]=os.split(","),cs=Number(ls)+1+"_"+(Number(us)+1);ss[os]={endpointsAttr:{dependencyType:"attributeComponent",attributeName:"endpoints",variableNames:["pointX"+cs]}}}return{dependenciesByKey:ss}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss,arraySize:os}){let ls={},us={};for(let ds of ss){let[ps,fs]=ds.split(","),hs=Number(ps)+1+"_"+(Number(fs)+1);ns[ds].endpointsAttr!==null&&ns[ds].endpointsAttr.stateValues["pointX"+hs]?ls[ds]=ns[ds].endpointsAttr.stateValues["pointX"+hs]:us[ds]=!0}let cs={};return Object.keys(ls).length>0&&(cs.setValue={endpoints:ls}),Object.keys(us).length>0&&(cs.useEssentialOrDefaultValue={endpoints:us}),cs},async inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyValuesByKey:ss,dependencyNamesByKey:os,initialChange:ls,stateValues:us}){let cs=[];for(let ds in ns.endpoints){let[ps,fs]=ds.split(","),hs=Number(ps)+1+"_"+(Number(fs)+1);ss[ds].endpointsAttr!==null&&ss[ds].endpointsAttr.stateValues["pointX"+hs]?cs.push({setDependency:os[ds].endpointsAttr,desiredValue:ns.endpoints[ds],childIndex:0,variableIndex:0}):cs.push({setEssentialValue:"endpoints",value:{[ds]:ns.endpoints[ds]}})}return{success:!0,instructions:cs}}},rs.length={public:!0,shadowingInstructions:{createComponentOfType:"math"},returnDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},endpoints:{dependencyType:"stateVariable",variableName:"endpoints"}}),definition({dependencyValues:ns}){let ss=0,os=ns.endpoints[0],ls=ns.endpoints[1],us=!0;for(let cs=0;csbs+vs*vs,0));ls=ls.map(bs=>bs/ps);let fs=ns.length.evaluate_to_constant();if(!Number.isFinite(fs)||fs<0)return{success:!1};let hs=[],gs=[],ys=fs/2;for(let bs=0;bs({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return Number.isNaN(ns.nDimensions)?[0]:[2]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}},os={};for(let ls of ns)os[ls]={endpoint:{dependencyType:"stateVariable",variableName:"endpoint"+(Number(ls)+1)}};return{globalDependencies:ss,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os}){if(Number.isNaN(ns.nDimensions))return{};let ls={};for(let us of os){let cs=ss[us].endpoint,ds=[];for(let ps=0;ps({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},numericalEndpoints:{dependencyType:"stateVariable",variableName:"numericalEndpoints"}}),definition({dependencyValues:ns}){let ss=ns.numericalEndpoints[0][0],os=ns.numericalEndpoints[0][1],ls=ns.numericalEndpoints[1][0],us=ns.numericalEndpoints[1][1],cs=Number.isFinite(ss)&&Number.isFinite(os)&&Number.isFinite(ls)&&Number.isFinite(us),ds=ns.nDimensions!==2||!cs||ls===ss&&us===os;return{setValue:{nearestPoint:function({variables:ps,scales:fs}){if(ds)return{};let hs=fs[0],gs=fs[1],ys=(ls-ss)/hs,bs=(us-os)/gs,vs=ys*ys+bs*bs,xs=((ps.x1-ss)/hs*ys+(ps.x2-os)/gs*bs)/vs,Cs={};return xs<=0?Cs={x1:ss,x2:os}:xs>=1?Cs={x1:ls,x2:us}:Cs={x1:ss+xs*ys*hs,x2:os+xs*bs*gs},ps.x3!==void 0&&(Cs.x3=0),Cs}}}}},rs.slope={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({numericalEndpoints:{dependencyType:"stateVariable",variableName:"numericalEndpoints"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),definition({dependencyValues:ns}){if(ns.nDimensions!==2)return{setValue:{slope:NaN}};let ss=ns.numericalEndpoints;return{setValue:{slope:(ss[1][1]-ss[0][1])/(ss[1][0]-ss[0][0])}}}},rs}async moveLineSegment({point1coords:rs,point2coords:ns,transient:ss,actionId:os,sourceDetails:ls,sourceInformation:us={},skipRendererUpdate:cs=!1}){if(rs===void 0||ns===void 0){if(!await this.stateValues.endpointsDraggable)return await this.coreFunctions.resolveAction({actionId:os})}else if(!await this.stateValues.draggable)return await this.coreFunctions.resolveAction({actionId:os});let ds={};return rs!==void 0&&(ds["0,0"]=Context.fromAst(rs[0]),ds["0,1"]=Context.fromAst(rs[1])),ns!==void 0&&(ds["1,0"]=Context.fromAst(ns[0]),ds["1,1"]=Context.fromAst(ns[1])),ss?await this.coreFunctions.performUpdate({updateInstructions:[{componentName:this.componentName,updateType:"updateValue",stateVariable:"endpoints",value:ds,sourceDetails:ls}],transient:!0,actionId:os,sourceInformation:us,skipRendererUpdate:cs}):await this.coreFunctions.performUpdate({updateInstructions:[{componentName:this.componentName,updateType:"updateValue",stateVariable:"endpoints",value:ds,sourceDetails:ls}],actionId:os,sourceInformation:us,skipRendererUpdate:cs,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{point1:rs,point2:ns}}})}async lineSegmentClicked({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){await this.coreFunctions.triggerChainedActions({triggeringAction:"click",componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss}),this.coreFunctions.resolveAction({actionId:rs})}async mouseDownOnLineSegment({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){await this.coreFunctions.triggerChainedActions({triggeringAction:"down",componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss}),this.coreFunctions.resolveAction({actionId:rs})}}zs(LineSegment,"componentType","lineSegment");class Ray extends GraphicalComponent{constructor(rs){super(rs),Object.assign(this.actions,{moveRay:this.moveRay.bind(this),rayClicked:this.rayClicked.bind(this),mouseDownOnRay:this.mouseDownOnRay.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.endpoint={createComponentOfType:"point"},rs.through={createComponentOfType:"point"},rs.direction={createComponentOfType:"vector"},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.styleDescription={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ns}){var ls;let ss;((ls=ns.document)==null?void 0:ls.stateValues.theme)==="dark"?ss=ns.selectedStyle.lineColorWordDarkMode:ss=ns.selectedStyle.lineColorWord;let os=ns.selectedStyle.lineWidthWord;return ns.selectedStyle.lineStyleWord&&(os&&(os+=" "),os+=ns.selectedStyle.lineStyleWord),os&&(os+=" "),os+=ss,{setValue:{styleDescription:os}}}},rs.styleDescriptionWithNoun={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({styleDescription:{dependencyType:"stateVariable",variableName:"styleDescription"}}),definition:function({dependencyValues:ns}){return{setValue:{styleDescriptionWithNoun:ns.styleDescription+" ray"}}}},rs.directionShadow={defaultValue:null,hasEssential:!0,essentialVarName:"direction",set:convertValueToMathExpression,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{directionShadow:!0}}),inverseDefinition:function({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setEssentialValue:"directionShadow",value:convertValueToMathExpression(ns.directionShadow)}]}}},rs.throughShadow={defaultValue:null,hasEssential:!0,essentialVarName:"through",set:convertValueToMathExpression,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{throughShadow:!0}}),inverseDefinition:function({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setEssentialValue:"throughShadow",value:convertValueToMathExpression(ns.throughShadow)}]}}},rs.endpointShadow={defaultValue:null,hasEssential:!0,essentialVarName:"endpoint",set:convertValueToMathExpression,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{endpointShadow:!0}}),inverseDefinition:function({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setEssentialValue:"endpointShadow",value:convertValueToMathExpression(ns.endpointShadow)}]}}},rs.basedOnThrough={returnDependencies:()=>({throughAttr:{dependencyType:"attributeComponent",attributeName:"through"},throughShadow:{dependencyType:"stateVariable",variableName:"throughShadow"},endpointAttr:{dependencyType:"attributeComponent",attributeName:"endpoint"},directionAttr:{dependencyType:"attributeComponent",attributeName:"direction"}}),definition:function({dependencyValues:ns}){return ns.endpointAttr!==null&&ns.directionAttr!==null?(ns.throughAttr!==null&&console.warn("Ray is prescribed by through, endpoint, and direction. Ignoring specified through."),{setValue:{basedOnThrough:!1},checkForActualChange:{basedOnThrough:!0}}):ns.throughAttr!==null?{setValue:{basedOnThrough:!0},checkForActualChange:{basedOnThrough:!0}}:{setValue:{basedOnThrough:ns.throughShadow!==null},checkForActualChange:{basedOnThrough:!0}}}},rs.basedOnEndpoint={returnDependencies:()=>({endpointAttr:{dependencyType:"attributeComponent",attributeName:"endpoint"},endpointShadow:{dependencyType:"stateVariable",variableName:"endpointShadow"}}),definition:function({dependencyValues:ns}){return ns.endpointAttr!==null?{setValue:{basedOnEndpoint:!0},checkForActualChange:{basedOnEndpoint:!0}}:{setValue:{basedOnEndpoint:ns.endpointShadow!==null},checkForActualChange:{basedOnEndpoint:!0}}}},rs.basedOnDirection={returnDependencies:()=>({directionAttr:{dependencyType:"attributeComponent",attributeName:"direction"},directionShadow:{dependencyType:"stateVariable",variableName:"directionShadow"}}),definition:function({dependencyValues:ns}){return ns.directionAttr!==null?{setValue:{basedOnDirection:!0},checkForActualChange:{basedOnDirection:!0}}:{setValue:{basedOnDirection:ns.directionShadow!==null},checkForActualChange:{basedOnDirection:!0}}}},rs.nDimDirection={stateVariablesDeterminingDependencies:["basedOnDirection","basedOnThrough","basedOnEndpoint"],returnDependencies({stateValues:ns}){let ss={basedOnThrough:{dependencyType:"stateVariable",variableName:"basedOnThrough"},basedOnEndpoint:{dependencyType:"stateVariable",variableName:"basedOnEndpoint"},basedOnDirection:{dependencyType:"stateVariable",variableName:"basedOnDirection"},directionShadow:{dependencyType:"stateVariable",variableName:"directionShadow"},directionAttr:{dependencyType:"attributeComponent",attributeName:"direction",variableNames:["nDimensions"]}};return ns.basedOnDirection||(ns.basedOnThrough&&(ss.nDimThrough={dependencyType:"stateVariable",variableName:"nDimThrough"}),ns.basedOnEndpoint&&(ss.nDimEndpoint={dependencyType:"stateVariable",variableName:"nDimEndpoint"})),ss},definition:function({dependencyValues:ns}){let ss;if(ns.basedOnDirection){if(ns.directionAttr!==null)ss=ns.directionAttr.stateValues.nDimensions;else if(ns.directionShadow){let os=ns.directionShadow.tree;Array.isArray(os)&&vectorOperators.includes(os[0])?ss=os.length-1:ss=2}}else ns.basedOnThrough?ns.basedOnEndpoint?ns.nDimThrough===ns.nDimEndpoint?ss=ns.nDimThrough:ss=NaN:ss=ns.nDimThrough:ns.basedOnEndpoint?ss=ns.nDimEndpoint:ss=2;return{setValue:{nDimDirection:ss},checkForActualChange:{nDimDirection:!0}}}},rs.nDimThrough={stateVariablesDeterminingDependencies:["basedOnDirection","basedOnThrough","basedOnEndpoint"],returnDependencies({stateValues:ns}){let ss={basedOnThrough:{dependencyType:"stateVariable",variableName:"basedOnThrough"},basedOnEndpoint:{dependencyType:"stateVariable",variableName:"basedOnEndpoint"},basedOnDirection:{dependencyType:"stateVariable",variableName:"basedOnDirection"},throughShadow:{dependencyType:"stateVariable",variableName:"throughShadow"},throughAttr:{dependencyType:"attributeComponent",attributeName:"through",variableNames:["nDimensions"]}};return ns.basedOnThrough||(ns.basedOnEndpoint&&(ss.nDimEndpoint={dependencyType:"stateVariable",variableName:"nDimEndpoint"}),ns.basedOnDirection&&(ss.nDimDirection={dependencyType:"stateVariable",variableName:"nDimDirection"})),ss},definition:function({dependencyValues:ns}){let ss;if(ns.basedOnThrough){if(ns.throughAttr!==null)ss=ns.throughAttr.stateValues.nDimensions;else if(ns.throughShadow){let os=ns.throughShadow.tree;Array.isArray(os)&&vectorOperators.includes(os[0])?ss=os.length-1:ss=2}}else ns.basedOnDirection?ns.basedOnEndpoint?ns.nDimDirection===ns.nDimEndpoint?ss=ns.nDimDirection:ss=NaN:ss=ns.nDimDirection:ns.basedOnEndpoint?ss=ns.nDimEndpoint:ss=2;return{setValue:{nDimThrough:ss},checkForActualChange:{nDimThrough:!0}}}},rs.nDimEndpoint={stateVariablesDeterminingDependencies:["basedOnDirection","basedOnThrough","basedOnEndpoint"],returnDependencies({stateValues:ns}){let ss={basedOnThrough:{dependencyType:"stateVariable",variableName:"basedOnThrough"},basedOnEndpoint:{dependencyType:"stateVariable",variableName:"basedOnEndpoint"},basedOnDirection:{dependencyType:"stateVariable",variableName:"basedOnDirection"},endpointShadow:{dependencyType:"stateVariable",variableName:"endpointShadow"},endpointAttr:{dependencyType:"attributeComponent",attributeName:"endpoint",variableNames:["nDimensions"]}};return ns.basedOnEndpoint||(ns.basedOnThrough&&(ss.nDimThrough={dependencyType:"stateVariable",variableName:"nDimThrough"}),ns.basedOnDirection&&(ss.nDimDirection={dependencyType:"stateVariable",variableName:"nDimDirection"})),ss},definition:function({dependencyValues:ns}){let ss;if(ns.basedOnEndpoint){if(ns.endpointAttr!==null)ss=ns.endpointAttr.stateValues.nDimensions;else if(ns.endpointShadow){let os=ns.endpointShadow.tree;Array.isArray(os)&&vectorOperators.includes(os[0])?ss=os.length-1:ss=2}}else ns.basedOnDirection?ns.basedOnThrough?ns.nDimDirection===ns.nDimThrough?ss=ns.nDimDirection:ss=NaN:ss=ns.nDimDirection:ns.basedOnThrough?ss=ns.nDimThrough:ss=2;return{setValue:{nDimEndpoint:ss},checkForActualChange:{nDimEndpoint:!0}}}},rs.nDimensions={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({basedOnThrough:{dependencyType:"stateVariable",variableName:"basedOnThrough"},basedOnEndpoint:{dependencyType:"stateVariable",variableName:"basedOnEndpoint"},basedOnDirection:{dependencyType:"stateVariable",variableName:"basedOnDirection"},nDimDirection:{dependencyType:"stateVariable",variableName:"nDimDirection"},nDimThrough:{dependencyType:"stateVariable",variableName:"nDimThrough"},nDimEndpoint:{dependencyType:"stateVariable",variableName:"nDimEndpoint"}}),definition:function({dependencyValues:ns}){let ss;if(ns.basedOnDirection){if(ns.basedOnEndpoint){if(ns.nDimDirection!==ns.nDimEndpoint)return console.warn("nDimensions mismatch in vector"),{setValue:{nDimensions:NaN}}}else if(ns.basedOnThrough&&ns.nDimDirection!==ns.nDimThrough)return console.warn("nDimensions mismatch in vector"),{setValue:{nDimensions:NaN}};ss=ns.nDimDirection}else if(ns.basedOnEndpoint){if(ns.basedOnThrough&&ns.nDimEndpoint!==ns.nDimThrough)return console.warn("nDimensions mismatch in vector"),{setValue:{nDimensions:NaN}};ss=ns.nDimEndpoint}else ns.basedOnThrough?ss=ns.nDimThrough:ss=2;return{setValue:{nDimensions:ss},checkForActualChange:{nDimensions:!0}}}},rs.direction={public:!0,shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(ns){return ns==="directionX"?[]:[["vector",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,entryPrefixes:["directionX"],hasEssential:!0,essentialVarName:"direction2",set:convertValueToMathExpression,stateVariablesDeterminingDependencies:["basedOnDirection","basedOnThrough"],returnArraySizeDependencies:()=>({nDimDirection:{dependencyType:"stateVariable",variableName:"nDimDirection"}}),returnArraySize({dependencyValues:ns}){return[ns.nDimDirection]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={basedOnThrough:{dependencyType:"stateVariable",variableName:"basedOnThrough"},basedOnEndpoint:{dependencyType:"stateVariable",variableName:"basedOnEndpoint"},basedOnDirection:{dependencyType:"stateVariable",variableName:"basedOnDirection"},directionShadow:{dependencyType:"stateVariable",variableName:"directionShadow"}},ls={};for(let us of ns){let cs=Number(us)+1;ls[us]={directionAttr:{dependencyType:"attributeComponent",attributeName:"direction",variableNames:["x"+cs]}},!ss.basedOnDirection&&ss.basedOnThrough&&(ls[us].endpointX={dependencyType:"stateVariable",variableName:"endpointX"+cs},ls[us].throughX={dependencyType:"stateVariable",variableName:"throughX"+cs})}return{globalDependencies:os,dependenciesByKey:ls}},arrayDefinitionByKey:function({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os}){let ls={},us={};for(let ds of os){let ps=Number(ds)+1;ns.basedOnDirection?ss[ds].directionAttr!==null?ls[ds]=ss[ds].directionAttr.stateValues["x"+ps]:ns.directionShadow!==null&&(ls[ds]=ns.directionShadow.get_component(Number(ds))):ns.basedOnThrough?ls[ds]=ss[ds].throughX.subtract(ss[ds].endpointX).simplify():us[ds]={defaultValue:Context.fromAst(ds==="0"?1:0)}}let cs={};return Object.keys(ls).length>0&&(cs.setValue={direction:ls}),Object.keys(us).length>0&&(cs.useEssentialOrDefaultValue={direction:us}),cs},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,arraySize:us}){let cs=[],ds=!1;for(let ps in ns.direction)ss.basedOnDirection?os[ps].directionAttr!==null?cs.push({setDependency:ls[ps].directionAttr,desiredValue:ns.direction[ps],variableIndex:0}):ds=!0:ss.basedOnThrough?cs.push({setDependency:ls[ps].throughX,desiredValue:os[ps].endpointX.add(ns.direction[ps]).simplify()}):cs.push({setEssentialValue:"direction",value:{[ps]:convertValueToMathExpression(ns.direction[ps])}});if(ds)if(us[0]>1){let ps=["vector"];for(let fs in ns.direction)ps[Number(fs)+1]=ns.direction[fs].tree;ps.length=us[0]+1,cs.push({setDependency:"directionShadow",desiredValue:Context.fromAst(ps)})}else us[0]===1&&"0"in ns.direction&&cs.push({setDependency:"directionShadow",desiredValue:ns.direction[0]});return{success:!0,instructions:cs}}},rs.through={public:!0,shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(ns){return ns==="throughX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,entryPrefixes:["throughX"],set:convertValueToMathExpression,stateVariablesDeterminingDependencies:["basedOnThrough"],returnArraySizeDependencies:()=>({nDimThrough:{dependencyType:"stateVariable",variableName:"nDimThrough"}}),returnArraySize({dependencyValues:ns}){return[ns.nDimThrough]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={basedOnDirection:{dependencyType:"stateVariable",variableName:"basedOnDirection"},basedOnEndpoint:{dependencyType:"stateVariable",variableName:"basedOnEndpoint"},basedOnThrough:{dependencyType:"stateVariable",variableName:"basedOnThrough"},throughShadow:{dependencyType:"stateVariable",variableName:"throughShadow"}},ls={};for(let us of ns){let cs=Number(us)+1;ls[us]={throughAttr:{dependencyType:"attributeComponent",attributeName:"through",variableNames:["x"+cs]}},ss.basedOnThrough||(ls[us].endpointX={dependencyType:"stateVariable",variableName:"endpointX"+cs},ls[us].directionX={dependencyType:"stateVariable",variableName:"directionX"+cs})}return{globalDependencies:os,dependenciesByKey:ls}},arrayDefinitionByKey:function({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=Number(us)+1;ns.basedOnThrough?ss[us].throughAttr!==null?ls[us]=ss[us].throughAttr.stateValues["x"+cs]:ns.throughShadow!==null&&(ls[us]=ns.throughShadow.get_component(Number(us))):ls[us]=ss[us].endpointX.add(ss[us].directionX).simplify()}return{setValue:{through:ls}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,arraySize:us}){let cs=[],ds=!1;for(let ps in ns.through)ss.basedOnThrough?os[ps].throughAttr&&os[ps].throughAttr!==null?cs.push({setDependency:ls[ps].throughAttr,desiredValue:ns.through[ps],variableIndex:0}):ss.throughShadow!==null&&(ds=!0):cs.push({setDependency:ls[ps].directionX,desiredValue:ns.through[ps].subtract(os[ps].endpointX).simplify()});if(ds)if(us[0]>1){let ps=["vector"];for(let fs in ns.through)ps[Number(fs)+1]=ns.through[fs].tree;ps.length=us[0]+1,cs.push({setDependency:"throughShadow",desiredValue:Context.fromAst(ps)})}else us[0]===1&&"0"in ns.through&&cs.push({setDependency:"throughShadow",desiredValue:ns.through[0]});return{success:!0,instructions:cs}}},rs.endpoint={public:!0,shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(ns){return ns==="endpointX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,entryPrefixes:["endpointX"],hasEssential:!0,defaultValueByArrayKey:()=>Context.fromAst(0),essentialVarName:"endpoint2",set:convertValueToMathExpression,stateVariablesDeterminingDependencies:["basedOnEndpoint","basedOnThrough","basedOnDirection"],returnArraySizeDependencies:()=>({nDimEndpoint:{dependencyType:"stateVariable",variableName:"nDimEndpoint"}}),returnArraySize({dependencyValues:ns}){return[ns.nDimEndpoint]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={basedOnDirection:{dependencyType:"stateVariable",variableName:"basedOnDirection"},basedOnThrough:{dependencyType:"stateVariable",variableName:"basedOnThrough"},endpointShadow:{dependencyType:"stateVariable",variableName:"endpointShadow"}},ls={};for(let us of ns){let cs=Number(us)+1;ls[us]={endpointAttr:{dependencyType:"attributeComponent",attributeName:"endpoint",variableNames:["x"+cs]}},ss.basedOnEndpoint||ss.basedOnThrough&&ss.basedOnDirection&&(ls[us].throughX={dependencyType:"stateVariable",variableName:"throughX"+cs},ls[us].directionX={dependencyType:"stateVariable",variableName:"directionX"+cs})}return{globalDependencies:os,dependenciesByKey:ls}},arrayDefinitionByKey:function({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os}){let ls={},us={};for(let ds of os){let ps=Number(ds)+1;ss[ds].endpointAttr!==null?ls[ds]=ss[ds].endpointAttr.stateValues["x"+ps]:ns.endpointShadow!==null?ls[ds]=ns.endpointShadow.get_component(Number(ds)):ns.basedOnThrough&&ns.basedOnDirection?ls[ds]=ss[ds].throughX.subtract(ss[ds].directionX).simplify():us[ds]=!0}let cs={};return Object.keys(ls).length>0&&(cs.setValue={endpoint:ls}),Object.keys(us).length>0&&(cs.useEssentialOrDefaultValue={endpoint:us}),cs},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,arraySize:us}){let cs=[],ds=!1;for(let ps in ns.endpoint)os[ps].endpointAttr&&os[ps].endpointAttr!==null?cs.push({setDependency:ls[ps].endpointAttr,desiredValue:ns.endpoint[ps],variableIndex:0}):ss.endpointShadow!==null?ds=!0:ss.basedOnThrough&&ss.basedOnDirection?cs.push({setDependency:ls[ps].directionX,desiredValue:os[ps].throughX.subtract(ns.endpoint[ps]).simplify()}):cs.push({setEssentialValue:"endpoint",value:{[ps]:convertValueToMathExpression(ns.endpoint[ps])}});if(ds)if(us[0]>1){let ps=["vector"];for(let fs in ns.endpoint)ps[Number(fs)+1]=ns.endpoint[fs].tree;ps.length=us[0]+1,cs.push({setDependency:"endpointShadow",desiredValue:Context.fromAst(ps)})}else us[0]===1&&"0"in ns.endpoint&&cs.push({setDependency:"endpointShadow",desiredValue:ns.endpoint[0]});return{success:!0,instructions:cs}}},rs.numericalEndpoint={forRenderer:!0,returnDependencies(){return{nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},endpoint:{dependencyType:"stateVariable",variableName:"endpoint"}}},definition({dependencyValues:ns}){if(Number.isNaN(ns.nDimensions))return null;let ss=ns.endpoint,os=[];for(let ls=0;ls({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},numericalEndpoint:{dependencyType:"stateVariable",variableName:"numericalEndpoint"},numericalThroughpoint:{dependencyType:"stateVariable",variableName:"numericalThroughpoint"}}),definition({dependencyValues:ns}){let ss=ns.numericalEndpoint[0],os=ns.numericalEndpoint[1],ls=ns.numericalThroughpoint[0],us=ns.numericalThroughpoint[1],cs=Number.isFinite(ss)&&Number.isFinite(os)&&Number.isFinite(ls)&&Number.isFinite(us),ds=ns.nDimensions!==2||!cs||ls===ss&&us===os;return{setValue:{nearestPoint:function({variables:ps,scales:fs}){if(ds)return{};let hs=fs[0],gs=fs[1],ys=(ls-ss)/hs,bs=(us-os)/gs,vs=ys*ys+bs*bs,xs=((ps.x1-ss)/hs*ys+(ps.x2-os)/gs*bs)/vs,Cs={};return xs<=0?Cs={x1:ss,x2:os}:Cs={x1:ss+xs*ys*hs,x2:os+xs*bs*gs},ps.x3!==void 0&&(Cs.x3=0),Cs}}}}},rs}async moveRay({endpointcoords:rs,throughcoords:ns,transient:ss,skippable:os,actionId:ls,sourceInformation:us={},skipRendererUpdate:cs=!1}){let ds=[];if(rs!==void 0){if(await this.stateValues.basedOnThrough&&await this.stateValues.basedOnDirection){let ps;if(ns===void 0){let fs=await this.stateValues.numericalThroughpoint;ps=rs.map((hs,gs)=>fs[gs]-hs)}else ps=rs.map((fs,hs)=>ns[hs]-fs);ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"direction",value:ps.map(fs=>Context.fromAst(fs))})}else ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"endpoint",value:rs.map(ps=>Context.fromAst(ps))});if(ns===void 0&&!await this.stateValues.basedOnThrough){let ps=await this.stateValues.numericalThroughpoint,fs=rs.map((hs,gs)=>ps[gs]-hs);ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"direction",value:fs.map(hs=>Context.fromAst(hs))})}}if(ns!==void 0){if(await this.stateValues.basedOnThrough)ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"through",value:ns.map(ps=>Context.fromAst(ps))});else{rs==null&&(rs=await this.stateValues.numericalEndpoint);let ps=rs.map((fs,hs)=>ns[hs]-fs);ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"direction",value:ps.map(fs=>Context.fromAst(fs))})}if(rs===void 0&&await this.stateValues.basedOnThrough&&await this.stateValues.basedOnDirection){let ps=await this.stateValues.numericalEndpoint,fs=ns.map((hs,gs)=>hs-ps[gs]);ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"direction",value:fs.map(hs=>Context.fromAst(hs))})}}return ss?await this.coreFunctions.performUpdate({updateInstructions:ds,transient:ss,skippable:os,actionId:ls,sourceInformation:us,skipRendererUpdate:cs}):await this.coreFunctions.performUpdate({updateInstructions:ds,actionId:ls,sourceInformation:us,skipRendererUpdate:cs,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{through:ns,endpoint:rs}}})}async rayClicked({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){await this.coreFunctions.triggerChainedActions({triggeringAction:"click",componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss}),this.coreFunctions.resolveAction({actionId:rs})}async mouseDownOnRay({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){await this.coreFunctions.triggerChainedActions({triggeringAction:"down",componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss}),this.coreFunctions.resolveAction({actionId:rs})}}zs(Ray,"componentType","ray");class Polygon extends Polyline{constructor(rs){super(rs),Object.assign(this.actions,{movePolygon:this.movePolygon.bind(this),polygonClicked:this.polygonClicked.bind(this),mouseDownOnPolygon:this.mouseDownOnPolygon.bind(this)})}get movePolygon(){return this.movePolyline}get polygonClicked(){return this.polylineClicked}get mouseDownOnPolygon(){return this.mouseDownOnPolyline}static createAttributesObject(){let rs=super.createAttributesObject();return rs.filled={createComponentOfType:"boolean",createStateVariable:"filled",defaultValue:!1,public:!0,forRenderer:!0},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.styleDescription={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},filled:{dependencyType:"stateVariable",variableName:"filled"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ns}){var us,cs;let ss;((us=ns.document)==null?void 0:us.stateValues.theme)==="dark"?ss=ns.selectedStyle.lineColorWordDarkMode:ss=ns.selectedStyle.lineColorWord;let os=ns.selectedStyle.lineWidthWord;ns.selectedStyle.lineStyleWord&&(os&&(os+=" "),os+=ns.selectedStyle.lineStyleWord),os&&(os+=" ");let ls;if(!ns.filled)ls=os+ss;else{let ds;((cs=ns.document)==null?void 0:cs.stateValues.theme)==="dark"?ds=ns.selectedStyle.fillColorWordDarkMode:ds=ns.selectedStyle.fillColorWord,ds===ss?(ls="filled "+ds,os&&(ls+=" with "+os+"border")):ls="filled "+ds+" with "+os+ss+" border"}return{setValue:{styleDescription:ls}}}},rs.styleDescriptionWithNoun={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},filled:{dependencyType:"stateVariable",variableName:"filled"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ns}){var us,cs;let ss;((us=ns.document)==null?void 0:us.stateValues.theme)==="dark"?ss=ns.selectedStyle.lineColorWordDarkMode:ss=ns.selectedStyle.lineColorWord;let os=ns.selectedStyle.lineWidthWord;ns.selectedStyle.lineStyleWord&&(os&&(os+=" "),os+=ns.selectedStyle.lineStyleWord),os&&(os+=" ");let ls;if(!ns.filled)ls=os+ss+" polygon";else{let ds;((cs=ns.document)==null?void 0:cs.stateValues.theme)==="dark"?ds=ns.selectedStyle.fillColorWordDarkMode:ds=ns.selectedStyle.fillColorWord,ds===ss?(ls="filled "+ds+" polygon",os&&(ls+=" with a "+os+"border")):ls="filled "+ds+" polygon with a "+os+ss+" border"}return{setValue:{styleDescriptionWithNoun:ls}}}},rs.borderStyleDescription={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ns}){var ls;let ss;((ls=ns.document)==null?void 0:ls.stateValues.theme)==="dark"?ss=ns.selectedStyle.lineColorWordDarkMode:ss=ns.selectedStyle.lineColorWord;let os=ns.selectedStyle.lineWidthWord;return ns.selectedStyle.lineStyleWord&&(os&&(os+=" "),os+=ns.selectedStyle.lineStyleWord),os&&(os+=" "),os+=ss,{setValue:{borderStyleDescription:os}}}},rs.fillStyleDescription={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},filled:{dependencyType:"stateVariable",variableName:"filled"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ns}){var ls;let ss;((ls=ns.document)==null?void 0:ls.stateValues.theme)==="dark"?ss=ns.selectedStyle.fillColorWordDarkMode:ss=ns.selectedStyle.fillColorWord;let os;return ns.filled?os=ss:os="unfilled",{setValue:{fillStyleDescription:os}}}},rs.nearestPoint={returnDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},numericalVertices:{dependencyType:"stateVariable",variableName:"numericalVertices"},nVertices:{dependencyType:"stateVariable",variableName:"nVertices"}}),definition({dependencyValues:ns}){var hs,gs,ys,bs;let ss=ns.nDimensions,os=ns.nVertices,ls=ns.numericalVertices,us=[],cs,ds,ps=(hs=ls[os-1])==null?void 0:hs[0],fs=(gs=ls[os-1])==null?void 0:gs[1];for(let vs=0;vs=1?Ws={x1:$s,x2:Rs}:Ws={x1:Es+Ms*ks*Cs,x2:_s+Ms*Ps*Ts};let Us=Math.pow((As-Ws.x1)/Cs,2)+Math.pow((ws-Ws.x2)/Ts,2);Us0&&(Ns.x3=0),Ns}}}}},rs}}zs(Polygon,"componentType","polygon"),zs(Polygon,"representsClosedPath",!0);class Triangle extends Polygon{static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=rs.styleDescriptionWithNoun.definition;return rs.styleDescriptionWithNoun.definition=function({dependencyValues:ss}){let os=ns({dependencyValues:ss}).setValue.styleDescriptionWithNoun;return os=os.replaceAll("polygon","triangle"),{setValue:{styleDescriptionWithNoun:os}}},rs.vertices.hasEssential=!0,rs.vertices.defaultValueByArrayKey=function(ss){return["0,1","1,0"].includes(ss)?Context.fromAst(1):Context.fromAst(0)},rs.vertices.returnArraySizeDependencies=()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),rs.vertices.returnArraySize=function({dependencyValues:ss}){return[3,ss.nDimensions]},rs.vertices.arrayDefinitionByKey=function({dependencyValuesByKey:ss,arrayKeys:os}){let ls={},us={};for(let cs of os){let[ds,ps]=cs.split(","),fs=Number(ds)+1+"_"+(Number(ps)+1),hs=ss[cs].vertices;hs!==null&&hs.stateValues["pointX"+fs]?ls[cs]=hs.stateValues["pointX"+fs]:us[cs]=!0}return{setValue:{vertices:ls},useEssentialOrDefaultValue:{vertices:us}}},rs.vertices.inverseArrayDefinitionByKey=async function({desiredStateVariableValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,initialChange:us,stateValues:cs}){if(us&&!await cs.draggable)return{success:!1};let ds=[];for(let ps in ss.vertices){let[fs,hs]=ps.split(","),gs=Number(fs)+1+"_"+(Number(hs)+1);os[ps].vertices!==null&&os[ps].vertices.stateValues["pointX"+gs]?ds.push({setDependency:ls[ps].vertices,desiredValue:ss.vertices[ps],variableIndex:0}):ds.push({setEssentialValue:"vertices",value:{[ps]:ss.vertices[ps].simplify()}})}return{success:!0,instructions:ds}},rs.nVertices={public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{nVertices:3}})},rs}}zs(Triangle,"componentType","triangle"),zs(Triangle,"rendererType","polygon");class Rectangle extends Polygon{static createAttributesObject(){let rs=super.createAttributesObject();return rs.center={createComponentOfType:"point"},rs.width={createComponentOfType:"number"},rs.height={createComponentOfType:"number"},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions(),ns=rs.styleDescriptionWithNoun.definition;return rs.styleDescriptionWithNoun.definition=function({dependencyValues:ss}){let os=ns({dependencyValues:ss}).setValue.styleDescriptionWithNoun;return os=os.replaceAll("polygon","rectangle"),{setValue:{styleDescriptionWithNoun:os}}},rs.nVerticesSpecified={returnDependencies:()=>({verticesAttr:{dependencyType:"attributeComponent",attributeName:"vertices",variableNames:["nPoints"]}}),definition:function({dependencyValues:ss}){return ss.verticesAttr!==null?{setValue:{nVerticesSpecified:ss.verticesAttr.stateValues.nPoints}}:{setValue:{nVerticesSpecified:0}}}},rs.essentialVertex={isArray:!0,entryPrefixes:["essentialVertexX"],defaultValueByArrayKey:()=>Context.fromAst(0),hasEssential:!0,returnArraySizeDependencies:()=>({nVerticesSpecified:{dependencyType:"stateVariable",variableName:"nVerticesSpecified"}}),returnArraySize({dependencyValues:ss}){return[ss.nVerticesSpecified===0?2:0]},returnArrayDependenciesByKey(){return{}},arrayDefinitionByKey:function({arrayKeys:ss}){let os={};for(let ls of ss)os[ls]=!0;return{useEssentialOrDefaultValue:{essentialVertex:os}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ss}){let os=[];for(let ls in ss.essentialVertex)os.push({setEssentialValue:"essentialVertex",value:{[ls]:ss.essentialVertex[ls]}});return{success:!0,instructions:os}}},rs.haveSpecifiedCenter={returnDependencies:()=>({centerAttr:{dependencyType:"attributeComponent",attributeName:"center"}}),definition:({dependencyValues:ss})=>({setValue:{haveSpecifiedCenter:ss.centerAttr!==null}})},rs.specifiedCenter={isArray:!0,entryPrefixes:["specifiedCenterX"],returnArraySizeDependencies:()=>({haveSpecifiedCenter:{dependencyType:"stateVariable",variableName:"haveSpecifiedCenter"}}),returnArraySize({dependencyValues:ss}){return[ss.haveSpecifiedCenter?2:0]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={};for(let ls of ss){let us=Number(ls)+1;os[ls]={centerAttr:{dependencyType:"attributeComponent",attributeName:"center",variableNames:["x"+us]}}}return{dependenciesByKey:os}},arrayDefinitionByKey:function({dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=Number(us)+1;ss[us].centerAttr!==null&&(ls[us]=ss[us].centerAttr.stateValues["x"+cs])}return{setValue:{specifiedCenter:ls}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls}){let us=[];for(let cs in ss.specifiedCenter)os[cs].centerAttr&&os[cs].centerAttr!==null&&us.push({setDependency:ls[cs].centerAttr,desiredValue:ss.specifiedCenter[cs],variableIndex:0});return{success:!0,instructions:us}}},rs.specifiedWidth={defaultValue:1,hasEssential:!0,essentialVarName:"width",returnDependencies(){return{widthAttr:{dependencyType:"attributeComponent",attributeName:"width",variableNames:["value"]},nVerticesSpecified:{dependencyType:"stateVariable",variableName:"nVerticesSpecified"},haveSpecifiedCenter:{dependencyType:"stateVariable",variableName:"haveSpecifiedCenter"}}},definition({dependencyValues:ss}){return ss.widthAttr!==null?{setValue:{specifiedWidth:ss.widthAttr.stateValues.value}}:(ss.haveSpecifiedCenter?1:0)+ss.nVerticesSpecified<=1?{useEssentialOrDefaultValue:{specifiedWidth:!0}}:{setValue:{specifiedWidth:null}}},inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os}){return os.widthAttr!==null?{success:!0,instructions:[{setDependency:"widthAttr",desiredValue:ss.specifiedWidth,childIndex:0,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"specifiedWidth",value:ss.specifiedWidth}]}}},rs.specifiedHeight={defaultValue:1,hasEssential:!0,essentialVarName:"height",returnDependencies(){return{heightAttr:{dependencyType:"attributeComponent",attributeName:"height",variableNames:["value"]},nVerticesSpecified:{dependencyType:"stateVariable",variableName:"nVerticesSpecified"},haveSpecifiedCenter:{dependencyType:"stateVariable",variableName:"haveSpecifiedCenter"}}},definition({dependencyValues:ss}){return ss.heightAttr!==null?{setValue:{specifiedHeight:ss.heightAttr.stateValues.value}}:(ss.haveSpecifiedCenter?1:0)+ss.nVerticesSpecified<=1?{useEssentialOrDefaultValue:{specifiedHeight:!0}}:{setValue:{specifiedHeight:null}}},inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os}){return os.heightAttr!==null?{success:!0,instructions:[{setDependency:"heightAttr",desiredValue:ss.specifiedHeight,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"specifiedHeight",value:ss.specifiedHeight}]}}},rs.center={public:!0,isArray:!0,entryPrefixes:["centerX"],shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(ss){return ss==="centerX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},returnArraySizeDependencies:()=>({}),returnArraySize:()=>[2],returnArrayDependenciesByKey({arrayKeys:ss}){let os={};for(let ls of ss){let us=Number(ls)+1;os[ls]={vertex0:{dependencyType:"stateVariable",variableName:"vertexX1_"+us},vertex2:{dependencyType:"stateVariable",variableName:"vertexX3_"+us}}}return{dependenciesByKey:os}},arrayDefinitionByKey({dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=ss[us].vertex0,ds=ss[us].vertex2;ls[us]=cs.add(ds).divide(2).simplify()}return{setValue:{center:ls}}},async inverseArrayDefinitionByKey({desiredStateVariableValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,stateValues:us}){let cs=[],ds=await us.center;for(let ps in ss.center){let fs=Number(ps),hs=os[ps].vertex0,gs=os[ps].vertex2,ys=ss.center[fs].subtract(ds[fs]),bs=hs.add(ys).simplify(),vs=gs.add(ys).simplify();cs.push({setDependency:ls[ps].vertex0,desiredValue:bs},{setDependency:ls[ps].vertex2,desiredValue:vs})}return{success:!0,instructions:cs}}},rs.width={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies({}){return{vertex0:{dependencyType:"stateVariable",variableName:"vertexX1_1"},vertex2:{dependencyType:"stateVariable",variableName:"vertexX3_1"}}},definition({dependencyValues:ss}){let os=ss.vertex0.evaluate_to_constant(),ls=ss.vertex2.evaluate_to_constant();return{setValue:{width:Math.abs(os-ls)}}},inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os}){let ls=os.vertex0.evaluate_to_constant(),us=os.vertex2.evaluate_to_constant(),cs=(us+ls)/2,ps=(us-ls<0?-1:1)*Math.max(0,ss.width)/2,fs=Context.fromAst(cs-ps),hs=Context.fromAst(cs+ps);return{success:!0,instructions:[{setDependency:"vertex0",desiredValue:fs},{setDependency:"vertex2",desiredValue:hs}]}}},rs.height={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies({}){return{vertex0:{dependencyType:"stateVariable",variableName:"vertexX1_2"},vertex2:{dependencyType:"stateVariable",variableName:"vertexX3_2"}}},definition({dependencyValues:ss}){let os=ss.vertex0.evaluate_to_constant(),ls=ss.vertex2.evaluate_to_constant();return{setValue:{height:Math.abs(os-ls)}}},inverseDefinition({desiredStateVariableValues:ss,dependencyValues:os}){let ls=os.vertex0.evaluate_to_constant(),us=os.vertex2.evaluate_to_constant(),cs=(us+ls)/2,ps=(us-ls<0?-1:1)*Math.max(0,ss.height)/2,fs=Context.fromAst(cs-ps),hs=Context.fromAst(cs+ps);return{success:!0,instructions:[{setDependency:"vertex0",desiredValue:fs},{setDependency:"vertex2",desiredValue:hs}]}}},rs.vertices={public:!0,shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(ss){return ss==="vertexX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,nDimensions:2,entryPrefixes:["vertexX","vertex"],getArrayKeysFromVarName({arrayEntryPrefix:ss,varEnding:os,arraySize:ls}){if(ss==="vertexX"){let us=os.split("_").map(cs=>Number(cs)-1);return us.length===2&&us.every((cs,ds)=>Number.isInteger(cs)&&cs>=0)?ls?us.every((cs,ds)=>cs=0?ls?usus+","+ds):[]:[us+",0"]:[]}},arrayVarNameFromPropIndex(ss,os){if(os==="vertices")return ss.length===1?"vertex"+ss[0]:`vertexX${ss[0]}_${ss[1]}`;if(os.slice(0,6)==="vertex"){let ls=Number(os.slice(6));if(Number.isInteger(ls)&&ls>0)return`vertexX${ls}_${ss[0]}`}return null},stateVariablesDeterminingDependencies:["nVerticesSpecified","haveSpecifiedCenter"],returnArraySizeDependencies:()=>({}),returnArraySize(){return[4,2]},returnArrayDependenciesByKey({arrayKeys:ss,stateValues:os}){let ls={},us={nVerticesSpecified:{dependencyType:"stateVariable",variableName:"nVerticesSpecified"}};if(os.nVerticesSpecified===0)if(us.haveSpecifiedCenter={dependencyType:"stateVariable",variableName:"haveSpecifiedCenter"},os.haveSpecifiedCenter)for(let cs of ss){let[ds,ps]=cs.split(",");ls[cs]={specifiedCenter:{dependencyType:"stateVariable",variableName:"specifiedCenterX"+(Number(ps)+1)}},ps==="0"?ls[cs].specifiedWidth={dependencyType:"stateVariable",variableName:"specifiedWidth"}:ls[cs].specifiedHeight={dependencyType:"stateVariable",variableName:"specifiedHeight"}}else for(let cs of ss){let[ds,ps]=cs.split(",");ls[cs]={essentialVertex:{dependencyType:"stateVariable",variableName:"essentialVertexX"+(Number(ps)+1)}},ps==="0"?(ds==="1"||ds==="2")&&(ls[cs].specifiedWidth={dependencyType:"stateVariable",variableName:"specifiedWidth"}):(ds==="2"||ds==="3")&&(ls[cs].specifiedHeight={dependencyType:"stateVariable",variableName:"specifiedHeight"})}else if(os.nVerticesSpecified===1)if(us.haveSpecifiedCenter={dependencyType:"stateVariable",variableName:"haveSpecifiedCenter"},os.haveSpecifiedCenter)for(let cs of ss){let[ds,ps]=cs.split(","),fs="1_"+(Number(ps)+1);ls[cs]={verticesAttr:{dependencyType:"attributeComponent",attributeName:"vertices",variableNames:["pointX"+fs]}},(ps==="0"&&ds==="1"||ds==="2"||ps==="1"&&ds==="2"||ds==="3")&&(ls[cs].specifiedCenter={dependencyType:"stateVariable",variableName:"specifiedCenterX"+(Number(ps)+1)})}else for(let cs of ss){let[ds,ps]=cs.split(","),fs="1_"+(Number(ps)+1);ls[cs]={verticesAttr:{dependencyType:"attributeComponent",attributeName:"vertices",variableNames:["pointX"+fs]}},ps==="0"?(ds==="1"||ds==="2")&&(ls[cs].specifiedWidth={dependencyType:"stateVariable",variableName:"specifiedWidth"}):(ds==="2"||ds==="3")&&(ls[cs].specifiedHeight={dependencyType:"stateVariable",variableName:"specifiedHeight"})}else for(let cs of ss){let[ds,ps]=cs.split(","),fs="1_"+(Number(ps)+1),hs="2_"+(Number(ps)+1),gs;ds==="0"?gs=fs:ds==="2"?gs=hs:ds==="1"?ps==="0"?gs=hs:gs=fs:ps==="0"?gs=fs:gs=hs,ls[cs]={verticesAttr:{dependencyType:"attributeComponent",attributeName:"vertices",variableNames:["pointX"+gs]}}}return{dependenciesByKey:ls,globalDependencies:us}},arrayDefinitionByKey({dependencyValuesByKey:ss,arrayKeys:os,globalDependencyValues:ls}){let us={};if(ls.nVerticesSpecified===0)if(ls.haveSpecifiedCenter)for(let cs of os){let[ds,ps]=cs.split(","),fs=ss[cs].specifiedCenter;if(ps==="0"){let hs=ss[cs].specifiedWidth;ds==="0"||ds==="3"?us[cs]=fs.subtract(hs/2):us[cs]=fs.add(hs/2)}else{let hs=ss[cs].specifiedHeight;ds==="0"||ds==="1"?us[cs]=fs.subtract(hs/2):us[cs]=fs.add(hs/2)}}else for(let cs of os){let[ds,ps]=cs.split(","),fs=ss[cs].essentialVertex;if(ps==="0")if(ds==="0"||ds==="3")us[cs]=fs;else{let hs=ss[cs].specifiedWidth;us[cs]=fs.add(hs)}else if(ds==="0"||ds==="1")us[cs]=fs;else{let hs=ss[cs].specifiedHeight;us[cs]=fs.add(hs)}}else if(ls.nVerticesSpecified===1)if(ls.haveSpecifiedCenter)for(let cs of os){let[ds,ps]=cs.split(","),fs=ss[cs].verticesAttr,hs;if(fs!==null&&Object.keys(fs.stateValues).length===1?hs=Object.values(fs.stateValues)[0]:hs=Context.fromAst("_"),ps==="0"&&(ds==="0"||ds==="3")||ps==="1"&&(ds==="0"||ds==="1"))us[cs]=hs;else{let gs=ss[cs].specifiedCenter;us[cs]=hs.add(gs.subtract(hs).multiply(2))}}else for(let cs of os){let[ds,ps]=cs.split(","),fs=ss[cs].verticesAttr,hs;if(fs!==null&&Object.keys(fs.stateValues).length===1?hs=Object.values(fs.stateValues)[0]:hs=Context.fromAst("_"),ps==="0")if(ds==="0"||ds==="3")us[cs]=hs;else{let gs=ss[cs].specifiedWidth;us[cs]=hs.add(gs)}else if(ds==="0"||ds==="1")us[cs]=hs;else{let gs=ss[cs].specifiedHeight;us[cs]=hs.add(gs)}}else for(let cs of os){let ds=ss[cs].verticesAttr;ds!==null&&Object.keys(ds.stateValues).length===1?us[cs]=Object.values(ds.stateValues)[0]:us[cs]=Context.fromAst("_")}return{setValue:{vertices:us}}},async inverseArrayDefinitionByKey({desiredStateVariableValues:ss,dependencyValuesByKey:os,globalDependencyValues:ls,stateValues:us,workspace:cs,initialChange:ds,dependencyNamesByKey:ps}){if(!cs.v0){let Cs=await us.vertices;cs.v0=[...Cs[0]],cs.v2=[...Cs[2]]}let fs,hs,gs,ys,bs,vs;for(let Cs in ss.vertices){let[Ts,Ss]=Cs.split(","),Ns=ss.vertices[Cs];Ts==="0"?cs.v0[Number(Ss)]=Ns:Ts==="2"?cs.v2[Number(Ss)]=Ns:Ts==="1"?Ss==="0"?cs.v2[Number(Ss)]=Ns:cs.v0[Number(Ss)]=Ns:Ss==="0"?cs.v0[Number(Ss)]=Ns:cs.v2[Number(Ss)]=Ns,Ss==="0"?(fs=Cs,Ts==="0"||Ts==="3"?gs=Cs:bs=Cs):(hs=Cs,Ts==="0"||Ts==="1"?ys=Cs:vs=Cs)}let xs=[];if(ls.nVerticesSpecified===0)if(ls.haveSpecifiedCenter){if(fs!==void 0){let Cs=cs.v2[0].subtract(cs.v0[0]).evaluate_to_constant(),Ts=cs.v2[0].add(cs.v0[0]).divide(2).simplify();xs.push({setDependency:ps[fs].specifiedWidth,desiredValue:Cs},{setDependency:ps[fs].specifiedCenter,desiredValue:Ts})}if(hs!==void 0){let Cs=cs.v2[1].subtract(cs.v0[1]).evaluate_to_constant(),Ts=cs.v2[1].add(cs.v0[1]).divide(2).simplify();xs.push({setDependency:ps[hs].specifiedHeight,desiredValue:Cs},{setDependency:ps[hs].specifiedCenter,desiredValue:Ts})}}else{if(gs!==void 0){let Cs=cs.v0[0].simplify();xs.push({setDependency:ps[gs].essentialVertex,desiredValue:Cs})}if(bs!==void 0){let Cs=cs.v2[0].subtract(cs.v0[0]).evaluate_to_constant();xs.push({setDependency:ps[bs].specifiedWidth,desiredValue:Cs})}if(ys!==void 0){let Cs=cs.v0[1].simplify();xs.push({setDependency:ps[ys].essentialVertex,desiredValue:Cs})}if(vs!==void 0){let Cs=cs.v2[1].subtract(cs.v0[1]).evaluate_to_constant();xs.push({setDependency:ps[vs].specifiedHeight,desiredValue:Cs})}}else if(ls.nVerticesSpecified===1)if(ls.haveSpecifiedCenter){if(gs!==void 0){let Cs=cs.v0[0].simplify();xs.push({setDependency:ps[gs].verticesAttr,desiredValue:Cs,variableIndex:0})}if(bs!==void 0){let Cs=cs.v2[0].add(cs.v0[0]).divide(2).simplify();xs.push({setDependency:ps[bs].specifiedCenter,desiredValue:Cs})}if(ys!==void 0){let Cs=cs.v0[1].simplify();xs.push({setDependency:ps[ys].verticesAttr,desiredValue:Cs,variableIndex:0})}if(vs!==void 0){let Cs=cs.v2[1].add(cs.v0[1]).divide(2).simplify();xs.push({setDependency:ps[vs].specifiedCenter,desiredValue:Cs})}}else{if(gs!==void 0){let Cs=cs.v0[0].simplify();xs.push({setDependency:ps[gs].verticesAttr,desiredValue:Cs,variableIndex:0})}if(bs!==void 0){let Cs=cs.v2[0].subtract(cs.v0[0]).evaluate_to_constant();xs.push({setDependency:ps[bs].specifiedWidth,desiredValue:Cs})}if(ys!==void 0){let Cs=cs.v0[1].simplify();xs.push({setDependency:ps[ys].verticesAttr,desiredValue:Cs,variableIndex:0})}if(vs!==void 0){let Cs=cs.v2[1].subtract(cs.v0[1]).evaluate_to_constant();xs.push({setDependency:ps[vs].specifiedHeight,desiredValue:Cs})}}else gs!==void 0&&xs.push({setDependency:ps[gs].verticesAttr,desiredValue:cs.v0[0],variableIndex:0}),bs!==void 0&&xs.push({setDependency:ps[bs].verticesAttr,desiredValue:cs.v2[0],variableIndex:0}),ys!==void 0&&xs.push({setDependency:ps[ys].verticesAttr,desiredValue:cs.v0[1],variableIndex:0}),vs!==void 0&&xs.push({setDependency:ps[vs].verticesAttr,desiredValue:cs.v2[1],variableIndex:0});return{success:!0,instructions:xs}}},rs.nVertices={public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{nVertices:4}})},rs}async movePolygon({pointCoords:rs,transient:ns,sourceDetails:ss,actionId:os,sourceInformation:ls={},skipRendererUpdate:us=!1}){if(Object.keys(rs).length===1){if(!await this.stateValues.verticesDraggable)return await this.coreFunctions.resolveAction({actionId:os})}else if(!await this.stateValues.draggable)return await this.coreFunctions.resolveAction({actionId:os});let ds=[],ps={};for(let fs in rs)ps[fs+",0"]=Context.fromAst(rs[fs][0]),ps[fs+",1"]=Context.fromAst(rs[fs][1]);if(ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"vertices",value:ps,sourceDetails:ss}),Object.keys(rs).length===1){let fs=Number(Object.keys(rs)[0]),hs=Context.fromAst(rs[fs][0]),gs=Context.fromAst(rs[fs][1]),ys=(fs+2)%4,bs=await this.stateValues.vertices,vs=bs[ys][0],xs=bs[ys][1];if(await this.stateValues.nVerticesSpecified<2)if(await this.stateValues.haveSpecifiedCenter){let Cs,Ts;fs===0?(Cs=hs.add(vs).divide(2),Ts=gs.add(xs).divide(2)):fs===1?Ts=gs.add(xs).divide(2):fs===3&&(Cs=hs.add(vs).divide(2)),Cs!==void 0&&ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"specifiedCenter",value:{0:Cs.simplify()}}),Ts!==void 0&&ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"specifiedCenter",value:{1:Ts.simplify()}})}else{let Cs,Ts;fs===0?(Cs=vs.subtract(hs),Ts=xs.subtract(gs)):fs===1?Ts=xs.subtract(gs):fs===3&&(Cs=vs.subtract(hs)),Cs!==void 0&&ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"specifiedWidth",value:Cs.simplify()}),Ts!==void 0&&ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"specifiedHeight",value:Ts.simplify()})}}return ns?await this.coreFunctions.performUpdate({updateInstructions:ds,transient:ns,actionId:os,sourceInformation:ls,skipRendererUpdate:us}):await this.coreFunctions.performUpdate({updateInstructions:ds,actionId:os,sourceInformation:ls,skipRendererUpdate:us,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{pointCoordinates:rs}}})}}zs(Rectangle,"componentType","rectangle"),zs(Rectangle,"rendererType","polygon");class RegularPolygon extends Polygon{static createAttributesObject(){let rs=super.createAttributesObject();return rs.nVertices={createComponentOfType:"number",createStateVariable:"nVertices",defaultValue:3,public:!0,forRenderer:!0},rs.center={createComponentOfType:"point"},rs.circumradius={createComponentOfType:"number"},rs.radius={createComponentOfType:"number"},rs.inradius={createComponentOfType:"number"},rs.apothem={createComponentOfType:"number"},rs.sideLength={createComponentOfType:"number"},rs.perimeter={createComponentOfType:"number"},rs.area={createComponentOfType:"number"},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();delete rs.nVertices;let ns=rs.styleDescriptionWithNoun.returnDependencies();ns.nSides={dependencyType:"stateVariable",variableName:"nSides"},rs.styleDescriptionWithNoun.returnDependencies=()=>ns;let ss=rs.styleDescriptionWithNoun.definition;return rs.styleDescriptionWithNoun.definition=function({dependencyValues:os}){let ls=ss({dependencyValues:os}).setValue.styleDescriptionWithNoun;return ls=ls.replaceAll("polygon",`${os.nSides}-sided regular polygon`),{setValue:{styleDescriptionWithNoun:ls}}},rs.nVerticesSpecified={returnDependencies:()=>({verticesAttr:{dependencyType:"attributeComponent",attributeName:"vertices",variableNames:["nPoints"]}}),definition:function({dependencyValues:os}){return os.verticesAttr!==null?{setValue:{nVerticesSpecified:os.verticesAttr.stateValues.nPoints}}:{setValue:{nVerticesSpecified:0}}}},rs.essentialDirection={isArray:!0,entryPrefixes:["essentialVertexX"],defaultValueByArrayKey:()=>0,hasEssential:!0,returnArraySizeDependencies:()=>({nVerticesSpecified:{dependencyType:"stateVariable",variableName:"nVerticesSpecified"},haveSpecifiedCenter:{dependencyType:"stateVariable",variableName:"haveSpecifiedCenter"}}),returnArraySize({dependencyValues:os}){return[(os.haveSpecifiedCenter?1:0)+os.nVerticesSpecified<=1?2:0]},returnArrayDependenciesByKey(){return{}},arrayDefinitionByKey:function({arrayKeys:os}){let ls={};for(let us of os)us==="0"?ls[us]={defaultValue:1}:ls[us]=!0;return{useEssentialOrDefaultValue:{essentialDirection:ls}}},inverseArrayDefinitionByKey({desiredStateVariableValues:os}){let ls=[];for(let us in os.essentialDirection)ls.push({setEssentialValue:"essentialDirection",value:{[us]:os.essentialDirection[us]}});return{success:!0,instructions:ls}}},rs.haveSpecifiedCenter={returnDependencies:()=>({centerAttr:{dependencyType:"attributeComponent",attributeName:"center"}}),definition:({dependencyValues:os})=>({setValue:{haveSpecifiedCenter:os.centerAttr!==null}})},rs.specifiedCenter={isArray:!0,entryPrefixes:["specifiedCenterX"],returnArraySizeDependencies:()=>({haveSpecifiedCenter:{dependencyType:"stateVariable",variableName:"haveSpecifiedCenter"}}),returnArraySize({dependencyValues:os}){return[os.haveSpecifiedCenter?2:0]},returnArrayDependenciesByKey({arrayKeys:os}){let ls={};for(let us of os){let cs=Number(us)+1;ls[us]={centerAttr:{dependencyType:"attributeComponent",attributeName:"center",variableNames:["x"+cs]}}}return{dependenciesByKey:ls}},arrayDefinitionByKey:function({dependencyValuesByKey:os,arrayKeys:ls}){let us={};for(let cs of ls){let ds=Number(cs)+1;os[cs].centerAttr!==null&&(us[cs]=os[cs].centerAttr.stateValues["x"+ds].evaluate_to_constant())}return{setValue:{specifiedCenter:us}}},inverseArrayDefinitionByKey({desiredStateVariableValues:os,dependencyValuesByKey:ls,dependencyNamesByKey:us}){let cs=[];for(let ds in os.specifiedCenter)ls[ds].centerAttr&&ls[ds].centerAttr!==null&&cs.push({setDependency:us[ds].centerAttr,desiredValue:Context.fromAst(os.specifiedCenter[ds]),variableIndex:0});return{success:!0,instructions:cs}}},rs.essentialCenter={isArray:!0,entryPrefixes:["essentialCenterX"],defaultValueByArrayKey:()=>0,hasEssential:!0,returnArraySizeDependencies:()=>({haveSpecifiedCenter:{dependencyType:"stateVariable",variableName:"haveSpecifiedCenter"}}),returnArraySize({dependencyValues:os}){return[os.haveSpecifiedCenter?0:2]},returnArrayDependenciesByKey(){return{}},arrayDefinitionByKey:function({arrayKeys:os}){let ls={};for(let us of os)ls[us]=!0;return{useEssentialOrDefaultValue:{essentialCenter:ls}}},inverseArrayDefinitionByKey({desiredStateVariableValues:os}){let ls=[];for(let us in os.essentialCenter)ls.push({setEssentialValue:"essentialCenter",value:{[us]:os.essentialCenter[us]}});return{success:!0,instructions:ls}}},rs.specifiedCircumradius={returnDependencies(){return{circumradiusAttr:{dependencyType:"attributeComponent",attributeName:"circumradius",variableNames:["value"]},radiusAttr:{dependencyType:"attributeComponent",attributeName:"radius",variableNames:["value"]},nVerticesSpecified:{dependencyType:"stateVariable",variableName:"nVerticesSpecified"},haveSpecifiedCenter:{dependencyType:"stateVariable",variableName:"haveSpecifiedCenter"}}},definition({dependencyValues:os}){return os.circumradiusAttr!==null?{setValue:{specifiedCircumradius:os.circumradiusAttr.stateValues.value}}:os.radiusAttr!==null?{setValue:{specifiedCircumradius:os.radiusAttr.stateValues.value}}:{setValue:{specifiedCircumradius:null}}},inverseDefinition({desiredStateVariableValues:os,dependencyValues:ls}){return ls.circumradiusAttr!==null?{success:!0,instructions:[{setDependency:"circumradiusAttr",desiredValue:os.specifiedCircumradius,childIndex:0,variableIndex:0}]}:ls.radiusAttr!==null?{success:!0,instructions:[{setDependency:"radiusAttr",desiredValue:os.specifiedCircumradius,childIndex:0,variableIndex:0}]}:{success:!1}}},rs.specifiedInradius={returnDependencies(){return{inradiusAttr:{dependencyType:"attributeComponent",attributeName:"inradius",variableNames:["value"]},apothemAttr:{dependencyType:"attributeComponent",attributeName:"apothem",variableNames:["value"]}}},definition({dependencyValues:os}){return os.inradiusAttr!==null?{setValue:{specifiedInradius:os.inradiusAttr.stateValues.value}}:os.apothemAttr!==null?{setValue:{specifiedInradius:os.apothemAttr.stateValues.value}}:{setValue:{specifiedInradius:null}}},inverseDefinition({desiredStateVariableValues:os,dependencyValues:ls}){return ls.inradiusAttr!==null?{success:!0,instructions:[{setDependency:"inradiusAttr",desiredValue:os.specifiedInradius,childIndex:0,variableIndex:0}]}:ls.apothemAttr!==null?{success:!0,instructions:[{setDependency:"apothemAttr",desiredValue:os.specifiedInradius,childIndex:0,variableIndex:0}]}:{sucess:!1}}},rs.specifiedSideLength={returnDependencies(){return{sideLengthAttr:{dependencyType:"attributeComponent",attributeName:"sideLength",variableNames:["value"]}}},definition({dependencyValues:os}){return os.sideLengthAttr!==null?{setValue:{specifiedSideLength:os.sideLengthAttr.stateValues.value}}:{setValue:{specifiedSideLength:null}}},inverseDefinition({desiredStateVariableValues:os,dependencyValues:ls}){return ls.sideLengthAttr!==null?{success:!0,instructions:[{setDependency:"sideLengthAttr",desiredValue:os.specifiedSideLength,childIndex:0,variableIndex:0}]}:{sucess:!1}}},rs.specifiedPerimeter={returnDependencies(){return{perimeterAttr:{dependencyType:"attributeComponent",attributeName:"perimeter",variableNames:["value"]}}},definition({dependencyValues:os}){return os.perimeterAttr!==null?{setValue:{specifiedPerimeter:os.perimeterAttr.stateValues.value}}:{setValue:{specifiedPerimeter:null}}},inverseDefinition({desiredStateVariableValues:os,dependencyValues:ls}){return ls.perimeterAttr!==null?{success:!0,instructions:[{setDependency:"perimeterAttr",desiredValue:os.specifiedPerimeter,childIndex:0,variableIndex:0}]}:{sucess:!1}}},rs.specifiedArea={returnDependencies(){return{areaAttr:{dependencyType:"attributeComponent",attributeName:"area",variableNames:["value"]}}},definition({dependencyValues:os}){return os.areaAttr!==null?{setValue:{specifiedArea:os.areaAttr.stateValues.value}}:{setValue:{specifiedArea:null}}},inverseDefinition({desiredStateVariableValues:os,dependencyValues:ls}){return ls.areaAttr!==null?{success:!0,instructions:[{setDependency:"areaAttr",desiredValue:os.specifiedArea,childIndex:0,variableIndex:0}]}:{sucess:!1}}},rs.essentialCircumradius={hasEssential:!0,defaultValue:1,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{essentialCircumradius:!0}}),inverseDefinition({desiredStateVariableValues:os}){return{success:!0,instructions:[{setEssentialValue:"essentialCircumradius",value:os.essentialCircumradius}]}}},rs.centerComponents={additionalStateVariablesDefined:["directionWithRadius"],returnDependencies:()=>({nVertices:{dependencyType:"stateVariable",variableName:"nVertices"},nVerticesSpecified:{dependencyType:"stateVariable",variableName:"nVerticesSpecified"},haveSpecifiedCenter:{dependencyType:"stateVariable",variableName:"haveSpecifiedCenter"},specifiedCircumradius:{dependencyType:"stateVariable",variableName:"specifiedCircumradius"},specifiedInradius:{dependencyType:"stateVariable",variableName:"specifiedInradius"},specifiedSideLength:{dependencyType:"stateVariable",variableName:"specifiedSideLength"},specifiedPerimeter:{dependencyType:"stateVariable",variableName:"specifiedPerimeter"},specifiedArea:{dependencyType:"stateVariable",variableName:"specifiedArea"},essentialCircumradius:{dependencyType:"stateVariable",variableName:"essentialCircumradius"},essentialDirection:{dependencyType:"stateVariable",variableName:"essentialDirection"},verticesAttr:{dependencyType:"attributeComponent",attributeName:"vertices",variableNames:["points"]},specifiedCenter:{dependencyType:"stateVariable",variableName:"specifiedCenter"},essentialCenter:{dependencyType:"stateVariable",variableName:"essentialCenter"}}),definition({dependencyValues:os}){let ls=os.nVertices,us,cs;if(os.nVerticesSpecified===0){os.haveSpecifiedCenter?us=os.specifiedCenter:us=os.essentialCenter;let ds;os.specifiedCircumradius!==null?ds=os.specifiedCircumradius:os.specifiedInradius!==null?ds=os.specifiedInradius/Math.cos(Math.PI/ls):os.specifiedSideLength!==null?ds=os.specifiedSideLength/(2*Math.sin(Math.PI/ls)):os.specifiedPerimeter!==null?ds=os.specifiedPerimeter/(2*ls*Math.sin(Math.PI/ls)):os.specifiedArea!==null?ds=Math.sqrt(os.specifiedArea/(ls/2*Math.sin(2*Math.PI/ls))):ds=os.essentialCircumradius,cs=os.essentialDirection.map(ps=>ps*ds)}else if(os.haveSpecifiedCenter){us=os.specifiedCenter;let ds=os.verticesAttr.stateValues.points[0].map(ps=>ps.evaluate_to_constant());cs=[ds[0]-us[0],ds[1]-us[1]]}else if(os.nVerticesSpecified===1){let ds;os.specifiedCircumradius!==null?ds=os.specifiedCircumradius:os.specifiedInradius!==null?ds=os.specifiedInradius/Math.cos(Math.PI/ls):os.specifiedSideLength!==null?ds=os.specifiedSideLength/(2*Math.sin(Math.PI/ls)):os.specifiedPerimeter!==null?ds=os.specifiedPerimeter/(2*ls*Math.sin(Math.PI/ls)):os.specifiedArea!==null?ds=Math.sqrt(os.specifiedArea/(ls/2*Math.sin(2*Math.PI/ls))):ds=os.essentialCircumradius,cs=os.essentialDirection.map(fs=>fs*ds);let ps=os.verticesAttr.stateValues.points[0].map(fs=>fs.evaluate_to_constant());us=[ps[0]-cs[0],ps[1]-cs[1]]}else{let ds=os.verticesAttr.stateValues.points[0].map(vs=>vs.evaluate_to_constant()),ps=os.verticesAttr.stateValues.points[1].map(vs=>vs.evaluate_to_constant()),fs=[ps[0]-ds[0],ps[1]-ds[1]],hs=[(ds[0]+ps[0])/2,(ds[1]+ps[1])/2],gs=Math.sqrt(fs[0]**2+fs[1]**2),ys=gs/(2*Math.tan(Math.PI/ls)),bs=[-fs[1]/gs,fs[0]/gs];us=[hs[0]+bs[0]*ys,hs[1]+bs[1]*ys],cs=[ds[0]-us[0],ds[1]-us[1]]}return{setValue:{centerComponents:us,directionWithRadius:cs}}},async inverseDefinition({desiredStateVariableValues:os,dependencyValues:ls,workspace:us,stateValues:cs}){let ds=ls.nVertices,ps=[],fs=os.centerComponents;fs||(fs=us.desiredCenter),fs||(fs=(await cs.center).map(gs=>gs.evaluate_to_constant()));let hs=os.directionWithRadius;if(hs||(hs=us.desiredDirectionWithRadius),!hs){let gs=(await cs.center).map(bs=>bs.evaluate_to_constant()),ys=(await cs.vertices)[0].map(bs=>bs.evaluate_to_constant());hs=[ys[0]-gs[0],ys[1]-gs[1]]}if(us.desiredCenter=fs,us.desiredDirectionWithRadius=hs,ls.nVerticesSpecified===0){ls.haveSpecifiedCenter?ps.push({setDependency:"specifiedCenter",desiredValue:fs}):ps.push({setDependency:"essentialCenter",desiredValue:fs});let gs=Math.sqrt(hs[0]**2+hs[1]**2),ys=hs.map(bs=>bs/gs);ls.specifiedCircumradius!==null?ps.push({setDependency:"specifiedCircumradius",desiredValue:gs}):ls.specifiedInradius!==null?ps.push({setDependency:"specifiedInradius",desiredValue:gs*Math.cos(Math.PI/ds)}):ls.specifiedSideLength!==null?ps.push({setDependency:"specifiedSideLength",desiredValue:gs*(2*Math.sin(Math.PI/ds))}):ls.specifiedPerimeter!==null?ps.push({setDependency:"specifiedPerimeter",desiredValue:gs*(2*ds*Math.sin(Math.PI/ds))}):ls.specifiedArea!==null?ps.push({setDependency:"specifiedArea",desiredValue:gs**2*(ds/2*Math.sin(2*Math.PI/ds))}):ps.push({setDependency:"essentialCircumradius",desiredValue:gs}),ps.push({setDependency:"essentialDirection",desiredValue:ys})}else if(ls.haveSpecifiedCenter){ps.push({setDependency:"specifiedCenter",desiredValue:fs});let gs={"0,0":Context.fromAst(hs[0]+fs[0]),"0,1":Context.fromAst(hs[1]+fs[1])};ps.push({setDependency:"verticesAttr",desiredValue:gs,variableIndex:0})}else if(ls.nVerticesSpecified===1){let gs=Math.sqrt(hs[0]**2+hs[1]**2),ys=hs.map(vs=>vs/gs);ls.specifiedCircumradius!==null?ps.push({setDependency:"specifiedCircumradius",desiredValue:gs}):ls.specifiedInradius!==null?ps.push({setDependency:"specifiedInradius",desiredValue:gs*Math.cos(Math.PI/ds)}):ls.specifiedSideLength!==null?ps.push({setDependency:"specifiedSideLength",desiredValue:gs*(2*Math.sin(Math.PI/ds))}):ls.specifiedPerimeter!==null?ps.push({setDependency:"specifiedPerimeter",desiredValue:gs*(2*ds*Math.sin(Math.PI/ds))}):ls.specifiedArea!==null?ps.push({setDependency:"specifiedArea",desiredValue:gs**2*(ds/2*Math.sin(2*Math.PI/ds))}):ps.push({setDependency:"essentialCircumradius",desiredValue:gs}),ps.push({setDependency:"essentialDirection",desiredValue:ys});let bs={"0,0":Context.fromAst(hs[0]+fs[0]),"0,1":Context.fromAst(hs[1]+fs[1])};ps.push({setDependency:"verticesAttr",desiredValue:bs,variableIndex:0})}else{let gs=2*Math.PI/ds,ys=Math.cos(gs),bs=Math.sin(gs),vs=[hs[0]*ys-hs[1]*bs,hs[0]*bs+hs[1]*ys],xs={"0,0":Context.fromAst(hs[0]+fs[0]),"0,1":Context.fromAst(hs[1]+fs[1]),"1,0":Context.fromAst(vs[0]+fs[0]),"1,1":Context.fromAst(vs[1]+fs[1])};ps.push({setDependency:"verticesAttr",desiredValue:xs,variableIndex:0})}return{success:!0,instructions:ps}}},rs.vertices={public:!0,shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(os){return os==="vertexX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,nDimensions:2,entryPrefixes:["vertexX","vertex"],getArrayKeysFromVarName({arrayEntryPrefix:os,varEnding:ls,arraySize:us}){if(os==="vertexX"){let cs=ls.split("_").map(ds=>Number(ds)-1);return cs.length===2&&cs.every((ds,ps)=>Number.isInteger(ds)&&ds>=0)?us?cs.every((ds,ps)=>ds=0?us?cscs+","+ps):[]:[cs+",0"]:[]}},arrayVarNameFromPropIndex(os,ls){if(ls==="vertices")return os.length===1?"vertex"+os[0]:`vertexX${os[0]}_${os[1]}`;if(ls.slice(0,6)==="vertex"){let us=Number(ls.slice(6));if(Number.isInteger(us)&&us>0)return`vertexX${us}_${os[0]}`}return null},returnArraySizeDependencies:()=>({nVertices:{dependencyType:"stateVariable",variableName:"nVertices"}}),returnArraySize({dependencyValues:os}){return[os.nVertices,2]},returnArrayDependenciesByKey(){return{globalDependencies:{nVertices:{dependencyType:"stateVariable",variableName:"nVertices"},centerComponents:{dependencyType:"stateVariable",variableName:"centerComponents"},directionWithRadius:{dependencyType:"stateVariable",variableName:"directionWithRadius"}}}},arrayDefinitionByKey({globalDependencyValues:os}){let ls=os.nVertices,us=os.centerComponents,cs=os.directionWithRadius,ds={};if(us.some(ps=>!Number.isFinite(ps))||cs.some(ps=>!Number.isFinite(ps)))for(let ps=0;psEs.split(",")[0]===fs),gs;if(hs)gs=(await us.center).map(Es=>Es.evaluate_to_constant());else{cs.allVertices||(cs.allVertices={}),Object.assign(cs.allVertices,cs.desiredVertices);let Es=0,_s=0;for(let $s=0;$s({}),returnArraySize:()=>[2],returnArrayDependenciesByKey(){return{globalDependencies:{centerComponents:{dependencyType:"stateVariable",variableName:"centerComponents"}}}},arrayDefinitionByKey({globalDependencyValues:os}){return{setValue:{center:os.centerComponents.map(ls=>Context.fromAst(ls))}}},async inverseArrayDefinitionByKey({desiredStateVariableValues:os,stateValues:ls,workspace:us}){let cs=os.center[0];cs||(cs=us.desired_center_x),cs||(cs=(await ls.center)[0]),us.desired_center_x=cs;let ds=os.center[1];return ds||(ds=us.desired_center_y),ds||(ds=(await ls.center)[1]),us.desired_center_y=ds,{success:!0,instructions:[{setDependency:"centerComponents",desiredValue:[cs.evaluate_to_constant(),ds.evaluate_to_constant()]}]}}},rs.circumradius={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({center:{dependencyType:"stateVariable",variableName:"center"},vertex1:{dependencyType:"stateVariable",variableName:"vertex1"}}),definition({dependencyValues:os}){let ls=os.center.map(ds=>ds.evaluate_to_constant()),us=os.vertex1.map(ds=>ds.evaluate_to_constant());return{setValue:{circumradius:Math.sqrt((us[0]-ls[0])**2+(us[1]-ls[1])**2)}}},inverseDefinition({desiredStateVariableValues:os,dependencyValues:ls}){let us=ls.center.map(ys=>ys.evaluate_to_constant()),cs=ls.vertex1.map(ys=>ys.evaluate_to_constant()),ds=[cs[0]-us[0],cs[1]-us[1]],ps=Math.sqrt(ds[0]**2+ds[1]**2),fs=os.circumradius,hs=ds.map(ys=>ys/ps*fs);return{success:!0,instructions:[{setDependency:"vertex1",desiredValue:[Context.fromAst(hs[0]+us[0]),Context.fromAst(hs[1]+us[1])]}]}}},rs.radius={isAlias:!0,targetVariableName:"circumradius"},rs.inradius={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({circumradius:{dependencyType:"stateVariable",variableName:"circumradius"},nVertices:{dependencyType:"stateVariable",variableName:"nVertices"}}),definition({dependencyValues:os}){let ls=os.circumradius,us=os.nVertices;return{setValue:{inradius:ls*Math.cos(Math.PI/us)}}},inverseDefinition({desiredStateVariableValues:os,dependencyValues:ls}){let us=os.inradius,cs=ls.nVertices;return{success:!0,instructions:[{setDependency:"circumradius",desiredValue:us/Math.cos(Math.PI/cs)}]}}},rs.apothem={isAlias:!0,targetVariableName:"inradius"},rs.sideLength={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({circumradius:{dependencyType:"stateVariable",variableName:"circumradius"},nVertices:{dependencyType:"stateVariable",variableName:"nVertices"}}),definition({dependencyValues:os}){let ls=os.circumradius,us=os.nVertices;return{setValue:{sideLength:ls*(2*Math.sin(Math.PI/us))}}},inverseDefinition({desiredStateVariableValues:os,dependencyValues:ls}){let us=os.sideLength,cs=ls.nVertices;return{success:!0,instructions:[{setDependency:"circumradius",desiredValue:us/(2*Math.sin(Math.PI/cs))}]}}},rs.perimeter={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({circumradius:{dependencyType:"stateVariable",variableName:"circumradius"},nVertices:{dependencyType:"stateVariable",variableName:"nVertices"}}),definition({dependencyValues:os}){let ls=os.circumradius,us=os.nVertices;return{setValue:{perimeter:ls*(2*us*Math.sin(Math.PI/us))}}},inverseDefinition({desiredStateVariableValues:os,dependencyValues:ls}){let us=os.perimeter,cs=ls.nVertices;return{success:!0,instructions:[{setDependency:"circumradius",desiredValue:us/(2*cs*Math.sin(Math.PI/cs))}]}}},rs.area={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({circumradius:{dependencyType:"stateVariable",variableName:"circumradius"},nVertices:{dependencyType:"stateVariable",variableName:"nVertices"}}),definition({dependencyValues:os}){let ls=os.circumradius,us=os.nVertices;return{setValue:{area:ls**2*(us/2*Math.sin(2*Math.PI/us))}}},inverseDefinition({desiredStateVariableValues:os,dependencyValues:ls}){let us=os.area,cs=ls.nVertices;return{success:!0,instructions:[{setDependency:"circumradius",desiredValue:Math.sqrt(us/(cs/2*Math.sin(2*Math.PI/cs)))}]}}},rs.nSides={isAlias:!0,targetVariableName:"nVertices"},rs}}zs(RegularPolygon,"componentType","regularPolygon"),zs(RegularPolygon,"rendererType","polygon");class Circle extends Curve{constructor(rs){super(rs),Object.assign(this.actions,{moveCircle:this.moveCircle.bind(this),circleClicked:this.circleClicked.bind(this),mouseDownOnCircle:this.mouseDownOnCircle.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.through={createComponentOfType:"_pointListComponent"},rs.center={createComponentOfType:"point"},rs.radius={createComponentOfType:"math"},rs.filled={createComponentOfType:"boolean",createStateVariable:"filled",defaultValue:!1,public:!0,forRenderer:!0},delete rs.parMin,delete rs.parMax,delete rs.variable,rs}static returnChildGroups(){return GraphicalComponent.returnChildGroups()}static returnStateVariableDefinitions(rs){let ns=GraphicalComponent.returnStateVariableDefinitions(rs);return ns.styleDescription={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},filled:{dependencyType:"stateVariable",variableName:"filled"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ss}){var cs,ds;let os;((cs=ss.document)==null?void 0:cs.stateValues.theme)==="dark"?os=ss.selectedStyle.lineColorWordDarkMode:os=ss.selectedStyle.lineColorWord;let ls=ss.selectedStyle.lineWidthWord;ss.selectedStyle.lineStyleWord&&(ls&&(ls+=" "),ls+=ss.selectedStyle.lineStyleWord),ls&&(ls+=" ");let us;if(!ss.filled)us=ls+os;else{let ps;((ds=ss.document)==null?void 0:ds.stateValues.theme)==="dark"?ps=ss.selectedStyle.fillColorWordDarkMode:ps=ss.selectedStyle.fillColorWord,ps===os?(us="filled "+ps,ls&&(us+=" with "+ls+"border")):us="filled "+ps+" with "+ls+os+" border"}return{setValue:{styleDescription:us}}}},ns.styleDescriptionWithNoun={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},filled:{dependencyType:"stateVariable",variableName:"filled"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ss}){var cs,ds;let os;((cs=ss.document)==null?void 0:cs.stateValues.theme)==="dark"?os=ss.selectedStyle.lineColorWordDarkMode:os=ss.selectedStyle.lineColorWord;let ls=ss.selectedStyle.lineWidthWord;ss.selectedStyle.lineStyleWord&&(ls&&(ls+=" "),ls+=ss.selectedStyle.lineStyleWord),ls&&(ls+=" ");let us;if(!ss.filled)us=ls+os+" circle";else{let ps;((ds=ss.document)==null?void 0:ds.stateValues.theme)==="dark"?ps=ss.selectedStyle.fillColorWordDarkMode:ps=ss.selectedStyle.fillColorWord,ps===os?(us="filled "+ps+" circle",ls&&(us+=" with a "+ls+"border")):us="filled "+ps+" circle with a "+ls+os+" border"}return{setValue:{styleDescriptionWithNoun:us}}}},ns.borderStyleDescription={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ss}){var us;let os;((us=ss.document)==null?void 0:us.stateValues.theme)==="dark"?os=ss.selectedStyle.lineColorWordDarkMode:os=ss.selectedStyle.lineColorWord;let ls=ss.selectedStyle.lineWidthWord;return ss.selectedStyle.lineStyleWord&&(ls&&(ls+=" "),ls+=ss.selectedStyle.lineStyleWord),ls&&(ls+=" "),ls+=os,{setValue:{borderStyleDescription:ls}}}},ns.fillStyleDescription={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},filled:{dependencyType:"stateVariable",variableName:"filled"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ss}){var us;let os;((us=ss.document)==null?void 0:us.stateValues.theme)==="dark"?os=ss.selectedStyle.fillColorWordDarkMode:os=ss.selectedStyle.fillColorWord;let ls;return ss.filled?ls=os:ls="unfilled",{setValue:{fillStyleDescription:ls}}}},ns.curveType={forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{curveType:"circle"}})},ns.parMax={public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{parMax:NaN}})},ns.parMin={public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{parMin:NaN}})},ns.fs={forRenderer:!0,isArray:!0,entryPrefixes:["f"],returnArraySizeDependencies:()=>({}),returnArraySize:()=>[0],returnArrayDependenciesByKey:()=>({}),arrayDefinitionByKey:()=>({setValue:{fs:{}}})},ns.nThroughPoints={returnDependencies:()=>({throughAttr:{dependencyType:"attributeComponent",attributeName:"through",variableNames:["nPoints"]}}),definition:function({dependencyValues:ss}){return ss.throughAttr!==null?{setValue:{nThroughPoints:ss.throughAttr.stateValues.nPoints}}:{setValue:{nThroughPoints:0}}}},ns.throughPoints={public:!0,shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(ss){return ss==="throughPointX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,nDimensions:2,entryPrefixes:["throughPointX","throughPoint"],getArrayKeysFromVarName({arrayEntryPrefix:ss,varEnding:os,arraySize:ls}){if(ss==="throughPointX"){let us=os.split("_").map(cs=>Number(cs)-1);return us.length===2&&us.every((cs,ds)=>Number.isInteger(cs)&&cs>=0)?ls?us.every((cs,ds)=>cs=0?ls?usus+","+ds):[]:[us+",0"]:[]}},arrayVarNameFromPropIndex(ss,os){if(os==="throughPoints")return ss.length===1?"throughPoint"+ss[0]:`throughPointX${ss[0]}_${ss[1]}`;if(os.slice(0,12)==="throughPoint"){let ls=Number(os.slice(12));if(Number.isInteger(ls)&&ls>0)return`throughPointX${ls}_${ss[0]}`}return null},returnArraySizeDependencies:()=>({nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"}}),returnArraySize({dependencyValues:ss}){return[ss.nThroughPoints,2]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={};for(let ls of ss){let[us,cs]=ls.split(","),ds=Number(us)+1+"_"+(Number(cs)+1);os[ls]={throughAttr:{dependencyType:"attributeComponent",attributeName:"through",variableNames:["pointX"+ds]}}}return{dependenciesByKey:os}},arrayDefinitionByKey({dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let[cs,ds]=us.split(","),ps=Number(cs)+1+"_"+(Number(ds)+1),fs=ss[us].throughAttr;fs!==null&&fs.stateValues["pointX"+ps]?ls[us]=fs.stateValues["pointX"+ps]:ls[us]=Context.fromAst("_")}return{setValue:{throughPoints:ls}}},async inverseArrayDefinitionByKey({desiredStateVariableValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,initialChange:us,stateValues:cs}){if(us&&!await cs.draggable)return{success:!1};let ds=[];for(let ps in ss.throughPoints){let[fs,hs]=ps.split(","),gs=Number(fs)+1+"_"+(Number(hs)+1);if(os[ps].throughAttr!==null&&os[ps].throughAttr.stateValues["pointX"+gs])ds.push({setDependency:ls[ps].throughAttr,desiredValue:ss.throughPoints[ps],variableIndex:0});else return{success:!1}}return{success:!0,instructions:ds}}},ns.havePrescribedCenter={returnDependencies:()=>({centerAttr:{dependencyType:"attributeComponent",attributeName:"center"}}),definition:({dependencyValues:ss})=>({setValue:{havePrescribedCenter:ss.centerAttr!==null},checkForActualChange:{havePrescribedCenter:!0}})},ns.prescribedCenter={isArray:!0,entryPrefixes:["prescribedCenterX"],returnArraySizeDependencies:()=>({havePrescribedCenter:{dependencyType:"stateVariable",variableName:"havePrescribedCenter"}}),returnArraySize({dependencyValues:ss}){return[ss.havePrescribedCenter?2:0]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={};for(let ls of ss){let us=Number(ls)+1;os[ls]={centerAttr:{dependencyType:"attributeComponent",attributeName:"center",variableNames:["x"+us]}}}return{dependenciesByKey:os}},arrayDefinitionByKey:function({globalDependencyValues:ss,dependencyValuesByKey:os,arrayKeys:ls}){let us={};for(let cs of ls){let ds=Number(cs)+1;os[cs].centerAttr!==null&&(us[cs]=os[cs].centerAttr.stateValues["x"+ds],us[cs]||(us[cs]=Context.fromAst("_")))}return{setValue:{prescribedCenter:us}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ss,globalDependencyValues:os,dependencyValuesByKey:ls,dependencyNamesByKey:us,arraySize:cs}){let ds=[];for(let ps of Object.keys(ss.prescribedCenter).reverse())ls[ps].centerAttr!==null&&ds.push({setDependency:us[ps].centerAttr,desiredValue:ss.prescribedCenter[ps],variableIndex:0});return{success:!0,instructions:ds}}},ns.prescribedRadius={defaultValue:null,returnDependencies:()=>({radiusAttr:{dependencyType:"attributeComponent",attributeName:"radius",variableNames:["value"]}}),definition:function({dependencyValues:ss}){return ss.radiusAttr!==null?{setValue:{prescribedRadius:ss.radiusAttr.stateValues.value}}:{setValue:{prescribedRadius:null}}},inverseDefinition:function({desiredStateVariableValues:ss,dependencyValues:os}){return os.radiusAttr!==null?{success:!0,instructions:[{setDependency:"radiusAttr",desiredValue:ss.prescribedRadius,childIndex:0,variableIndex:0}]}:{success:!1}}},ns.havePrescribedRadius={returnDependencies:()=>({radiusAttr:{dependencyType:"attributeComponent",attributeName:"radius"}}),definition:({dependencyValues:ss})=>({setValue:{havePrescribedRadius:ss.radiusAttr!==null},checkForActualChange:{havePrescribedRadius:!0}})},ns.numericalPrescribedRadius={returnDependencies:()=>({prescribedRadius:{dependencyType:"stateVariable",variableName:"prescribedRadius"}}),additionalStateVariablesDefined:["haveNonNumericalPrescribedRadius"],definition:function({dependencyValues:ss}){let os=!1,ls;return ss.prescribedRadius===null?ls=null:(ls=ss.prescribedRadius.evaluate_to_constant(),Number.isFinite(ls)||(ls=NaN,os=!0)),{setValue:{haveNonNumericalPrescribedRadius:os,numericalPrescribedRadius:ls},checkForActualChange:{haveNonNumericalEntriesNumericalRadius:!0}}},inverseDefinition:async function({desiredStateVariableValues:ss,dependencyValues:os,stateValues:ls}){return await ls.haveNonNumericalPrescribedRadius?{success:!1}:ss.numericalPrescribedRadius!==void 0?os.prescribedRadius===null?{success:!1}:{success:!0,instructions:[{setDependency:"prescribedRadius",desiredValue:Context.fromAst(ss.numericalPrescribedRadius)}]}:{success:!1}}},ns.numericalPrescribedCenter={isArray:!0,entryPrefixes:["numericalPrescribedCenterX"],returnArraySizeDependencies:()=>({havePrescribedCenter:{dependencyType:"stateVariable",variableName:"havePrescribedCenter"}}),returnArraySize({dependencyValues:ss}){return[ss.havePrescribedCenter?2:0]},returnArrayDependenciesByKey({arrayKeys:ss}){let os={};for(let ls of ss){let us=Number(ls)+1;os[ls]={prescribedCenterX:{dependencyType:"stateVariable",variableName:"prescribedCenterX"+us}}}return{dependenciesByKey:os}},arrayDefinitionByKey:function({dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=ss[us].prescribedCenterX;cs?ls[us]=cs.evaluate_to_constant():ls[us]=NaN}return{setValue:{numericalPrescribedCenter:ls}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ss,dependencyNamesByKey:os}){let ls=[];for(let us in ss.numericalPrescribedCenter)ls.push({setDependency:os[us].prescribedCenterX,desiredValue:Context.fromAst(ss.numericalPrescribedCenter[us])});return{success:!0,instructions:ls}}},ns.haveNonNumericalPrescribedCenter={returnDependencies:()=>({numericalPrescribedCenter:{dependencyType:"stateVariable",variableName:"numericalPrescribedCenter"}}),definition({dependencyValues:ss}){return{setValue:{haveNonNumericalPrescribedCenter:ss.numericalPrescribedCenter.some(ls=>!Number.isFinite(ls))},checkForActualChange:{haveNonNumericalPrescribedCenter:!0}}}},ns.numericalThroughPoints={returnDependencies:()=>({throughPoints:{dependencyType:"stateVariable",variableName:"throughPoints"}}),additionalStateVariablesDefined:["haveNonNumericalThroughPoints"],definition:function({dependencyValues:ss}){let os=!1,ls=[];for(let us of ss.throughPoints){let cs=[];for(let ds=0;ds<2;ds++){let ps;try{ps=us[ds].evaluate_to_constant()}catch{console.warn("Invalid point of circle"),os=!0,cs=[];break}if(Number.isFinite(ps))cs.push(ps);else{os=!0,cs=[];break}}if(cs.length>0)ls.push(cs);else{ls=[];break}}return{setValue:{haveNonNumericalThroughPoints:os,numericalThroughPoints:ls},checkForActualChange:{haveNonNumericalThroughPoints:!0}}},inverseDefinition:async function({desiredStateVariableValues:ss,dependencyValues:os,stateValues:ls}){if(await ls.haveNonNumericalThroughPoints)return{success:!1};if(ss.numericalThroughPoints!==void 0){let us={};for(let[cs,ds]of ss.numericalThroughPoints.entries())us[cs+",0"]=Context.fromAst(ds[0]),us[cs+",1"]=Context.fromAst(ds[1]);return{success:!0,instructions:[{setDependency:"throughPoints",desiredValue:us}]}}return{success:!1}}},ns.haveNumericalEntries={returnDependencies:()=>({haveNonNumericalPrescribedCenter:{dependencyType:"stateVariable",variableName:"haveNonNumericalPrescribedCenter"},haveNonNumericalPrescribedRadius:{dependencyType:"stateVariable",variableName:"haveNonNumericalPrescribedRadius"},haveNonNumericalThroughPoints:{dependencyType:"stateVariable",variableName:"haveNonNumericalThroughPoints"}}),definition:({dependencyValues:ss})=>({setValue:{haveNumericalEntries:!(ss.haveNonNumericalPrescribedCenter||ss.haveNonNumericalPrescribedRadius||ss.haveNonNumericalThroughPoints)}})},ns.numericalRadiusCalculatedWithCenter={additionalStateVariablesDefined:["numericalCenterCalculatedWithRadius"],returnDependencies:()=>({nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"},numericalThroughPoints:{dependencyType:"stateVariable",variableName:"numericalThroughPoints"},haveNumericalEntries:{dependencyType:"stateVariable",variableName:"haveNonNumericalThroughPoints"}}),definition:function({dependencyValues:ss}){if(ss.haveNonNumericalThroughPoints){let os="Haven't implemented circle through "+ss.nThroughPoints+" points";return os+=" in case where don't have numerical values.",console.warn(os),{setValue:{numericalRadiusCalculatedWithCenter:null,numericalCenterCalculatedWithRadius:null}}}if(ss.nThroughPoints===2){let{numericalCenter:os,numericalRadius:ls}=circleFromTwoNumericalPoints({point1:ss.numericalThroughPoints[0],point2:ss.numericalThroughPoints[1]});return{setValue:{numericalCenterCalculatedWithRadius:os,numericalRadiusCalculatedWithCenter:ls}}}else if(ss.nThroughPoints===3){let os=ss.numericalThroughPoints[0][0],ls=ss.numericalThroughPoints[1][0],us=ss.numericalThroughPoints[2][0],cs=ss.numericalThroughPoints[0][1],ds=ss.numericalThroughPoints[1][1],ps=ss.numericalThroughPoints[2][1],fs,hs;if(os===ls&&cs===ds)if(os===us&&cs===ps)fs=[os,cs],hs=0;else{let gs=circleFromTwoNumericalPoints({point1:[os,cs],point2:[us,ps]});fs=gs.numericalCenter,hs=gs.numericalRadius}else if(os===us&&cs===ps||ls===us&&ds===ps){let gs=circleFromTwoNumericalPoints({point1:[os,cs],point2:[ls,ds]});fs=gs.numericalCenter,hs=gs.numericalRadius}else{let gs=os*os+cs*cs,ys=ls*ls+ds*ds,bs=us*us+ps*ps,vs=os*(ds-ps)-cs*(ls-us)+ls*ps-us*ds,xs=gs*(ps-ds)+ys*(cs-ps)+bs*(ds-cs),Cs=gs*(ls-us)+ys*(us-os)+bs*(os-ls),Ts=gs*(us*ds-ls*ps)+ys*(os*ps-us*cs)+bs*(ls*cs-os*ds);vs!==0?(fs=[-xs/(2*vs),-Cs/(2*vs)],hs=Math.sqrt((xs*xs+Cs*Cs-4*vs*Ts)/(4*vs*vs))):(fs=[NaN,NaN],hs=NaN)}return{setValue:{numericalCenterCalculatedWithRadius:fs,numericalRadiusCalculatedWithCenter:hs}}}else return ss.nThroughPoints>3?(console.warn("Can't calculate circle through more than 3 points"),{setValue:{numericalRadiusCalculatedWithCenter:null,numericalCenterCalculatedWithRadius:null}}):{setValue:{numericalRadiusCalculatedWithCenter:null,numericalCenterCalculatedWithRadius:null}}}},ns.essentialRadius={defaultValue:1,hasEssential:!0,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{essentialRadius:!0}}),inverseDefinition:function({desiredStateVariableValues:ss}){return{success:!0,instructions:[{setEssentialValue:"essentialRadius",value:ss.essentialRadius}]}}},ns.numericalRadius={forRenderer:!0,stateVariablesDeterminingDependencies:["nThroughPoints","havePrescribedCenter","havePrescribedRadius"],returnDependencies:function({stateValues:ss}){let os={haveNonNumericalPrescribedRadius:{dependencyType:"stateVariable",variableName:"haveNonNumericalPrescribedRadius"},nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"},essentialRadius:{dependencyType:"stateVariable",variableName:"essentialRadius"}};return ss.havePrescribedRadius?(os.numericalPrescribedRadius={dependencyType:"stateVariable",variableName:"numericalPrescribedRadius"},ss.havePrescribedCenter&&ss.nThroughPoints>0&&(os.haveCenterRadiusPoints={dependencyType:"value",value:!0})):ss.havePrescribedCenter?ss.nThroughPoints===1&&(os.haveNonNumericalPrescribedCenter={dependencyType:"stateVariable",variableName:"haveNonNumericalPrescribedCenter"},os.numericalPrescribedCenter={dependencyType:"stateVariable",variableName:"numericalPrescribedCenter"},os.haveNonNumericalThroughPoints={dependencyType:"stateVariable",variableName:"haveNonNumericalThroughPoints"},os.numericalThroughPoints={dependencyType:"stateVariable",variableName:"numericalThroughPoints"}):ss.nThroughPoints>1&&(os.numericalRadiusCalculatedWithCenter={dependencyType:"stateVariable",variableName:"numericalRadiusCalculatedWithCenter"},os.numericalThroughPoints={dependencyType:"stateVariable",variableName:"numericalThroughPoints"}),os},definition:function({dependencyValues:ss}){if(ss.haveNonNumericalPrescribedRadius||ss.haveNonNumericalPrescribedCenter||ss.haveNonNumericalThroughPoints)return{setValue:{numericalRadius:NaN}};if(ss.numericalPrescribedRadius!==void 0)return ss.haveCenterRadiusPoints?(console.warn("Can't calculate circle with specified radius and center and through points"),{setValue:{numericalRadius:NaN}}):{setValue:{numericalRadius:Math.max(0,ss.numericalPrescribedRadius)}};if(ss.numericalPrescribedCenter!==void 0)if(ss.nThroughPoints===0){let os=ss.essentialRadius;return os instanceof Context.class&&(os=os.evaluate_to_constant()),{setValue:{numericalRadius:os}}}else if(ss.nThroughPoints===1){let os=ss.numericalThroughPoints[0];return os===void 0?{setValue:{numericalRadius:NaN}}:{setValue:{numericalRadius:Math.sqrt(Math.pow(os[0]-ss.numericalPrescribedCenter[0],2)+Math.pow(os[1]-ss.numericalPrescribedCenter[1],2))}}}else return console.warn("Can't calculate circle with specified center through more than 1 point"),{setValue:{numericalRadius:NaN}};if(ss.nThroughPoints<2){let os=ss.essentialRadius;return os instanceof Context.class&&(os=os.evaluate_to_constant()),{setValue:{numericalRadius:os}}}else return{setValue:{numericalRadius:ss.numericalRadiusCalculatedWithCenter}}},inverseDefinition:async function({desiredStateVariableValues:ss,dependencyValues:os,stateValues:ls}){if(os.numericalPrescribedRadius!==void 0)return{success:!0,instructions:[{setDependency:"numericalPrescribedRadius",desiredValue:Math.max(0,ss.numericalRadius)}]};if(os.numericalPrescribedCenter!==void 0){if(os.nThroughPoints===0)return{success:!0,instructions:[{setDependency:"essentialRadius",desiredValue:Math.max(0,ss.numericalRadius)}]};if(os.nThroughPoints===1){let us=Math.max(0,ss.numericalRadius),cs=(await ls.throughAngles)[0];if(!Number.isFinite(cs))return{success:!1};let ds=await ls.numericalCenter;return{success:!0,instructions:[{setDependency:"numericalThroughPoints",desiredValue:[[ds[0]+us*Math.cos(cs),ds[1]+us*Math.sin(cs)]]}]}}else return{success:!1}}if(os.nThroughPoints<2)return{success:!0,instructions:[{setDependency:"essentialRadius",desiredValue:Math.max(0,ss.numericalRadius)}]};{let us=[],cs=Math.max(0,ss.numericalRadius);for(let ds=0;ds0,returnArraySizeDependencies:()=>({}),returnArraySize(){return[2]},returnArrayDependenciesByKey:()=>({}),arrayDefinitionByKey:function({arrayKeys:ss}){let os={};for(let ls of ss)os[ls]=!0;return{useEssentialOrDefaultValue:{essentialCenter:os}}},async inverseArrayDefinitionByKey({desiredStateVariableValues:ss,stateValues:os,workspace:ls}){let us=[];for(let cs in ss.essentialCenter)us.push({setEssentialValue:"essentialCenter",value:{[cs]:ss.essentialCenter[cs]}});return{success:!0,instructions:us}}},ns.numericalCenter={forRenderer:!0,isArray:!0,entryPrefixes:["numericalCenterX"],stateVariablesDeterminingDependencies:["nThroughPoints","havePrescribedCenter","havePrescribedRadius"],returnArraySizeDependencies:()=>({}),returnArraySize(){return[2]},returnArrayDependenciesByKey({arrayKeys:ss,stateValues:os}){let ls={},us={};if(os.havePrescribedCenter){for(let cs of ss){let ds=Number(cs)+1;us[cs]={numericalPrescribedCenterX:{dependencyType:"stateVariable",variableName:"numericalPrescribedCenterX"+ds}}}os.havePrescribedRadius&&os.nThroughPoints>0&&(ls.haveCenterRadiusPoints={dependencyType:"value",value:!0})}else{for(let cs of ss){let ds=Number(cs)+1;us[cs]={essentialCenterX:{dependencyType:"stateVariable",variableName:"essentialCenterX"+ds}}}ls.nThroughPoints={dependencyType:"stateVariable",variableName:"nThroughPoints"},ls.numericalThroughPoints={dependencyType:"stateVariable",variableName:"numericalThroughPoints"},ls.haveNonNumericalThroughPoints={dependencyType:"stateVariable",variableName:"haveNonNumericalThroughPoints"},os.havePrescribedRadius?ls.numericalRadius={dependencyType:"stateVariable",variableName:"numericalRadius"}:os.nThroughPoints==1?ls.numericalRadius={dependencyType:"stateVariable",variableName:"numericalRadius"}:os.nThroughPoints>1&&(ls.numericalCenterCalculatedWithRadius={dependencyType:"stateVariable",variableName:"numericalCenterCalculatedWithRadius"})}return{globalDependencies:ls,dependenciesByKey:us}},arrayDefinitionByKey:function({globalDependencyValues:ss,dependencyValuesByKey:os,arrayKeys:ls}){let us={};for(let cs of ls)if(os[cs].numericalPrescribedCenterX!==void 0){if(ss.haveCenterRadiusPoints)return console.warn("Can't calculate circle with specified radius and center and through points"),{setValue:{numericalCenter:[NaN,NaN]}};us[cs]=os[cs].numericalPrescribedCenterX}if(Object.keys(us).length>0)return{setValue:{numericalCenter:us}};if(ss.haveNonNumericalPrescribedRadius||ss.haveNonNumericalThroughPoints)return{setValue:{numericalCenter:[NaN,NaN]}};if(ss.numericalRadius!==void 0)if(ss.nThroughPoints===0){for(let cs of ls){let ds=os[cs].essentialCenterX;ds instanceof Context.class&&(ds=ds.evaluate_to_constant()),us[cs]=ds}return{setValue:{numericalCenter:us}}}else{if(ss.nThroughPoints===1)return ss.numericalThroughPoints.length<1?{setValue:{numericalCenter:[NaN,NaN]}}:{setValue:{numericalCenter:[ss.numericalThroughPoints[0][0],ss.numericalThroughPoints[0][1]-ss.numericalRadius]}};if(ss.nThroughPoints===2){if(ss.numericalThroughPoints.length<2)return{setValue:{numericalCenter:[NaN,NaN]}};let cs=ss.numericalRadius,ds=ss.numericalThroughPoints[0][0],ps=ss.numericalThroughPoints[1][0],fs=ss.numericalThroughPoints[0][1],hs=ss.numericalThroughPoints[1][1],gs=Math.pow(ds-ps,2)+Math.pow(fs-hs,2),ys=cs*cs;if(cs<0||4*ys0)return{success:!0,instructions:ps};if(os.nThroughPoints===0){for(let fs in ss.numericalCenter)ps.push({setDependency:us[fs].essentialCenterX,desiredValue:ss.numericalCenter[fs]});return{success:!0,instructions:ps}}else{ds.desiredCenter||(ds.desiredCenter={});for(let ys=0;ys<2;ys++)ss.numericalCenter[ys]!==void 0?ds.desiredCenter[ys]=ss.numericalCenter[ys]:ds.desiredCenter[ys]===void 0&&(ds.desiredCenter[ys]=cs.numericalCenter[ys]);let fs=[],hs=await cs.throughAngles,gs=await cs.numericalRadius;for(let ys=0;ys({haveNumericalEntries:{dependencyType:"stateVariable",variableName:"haveNumericalEntries"},nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"},numericalThroughPoints:{dependencyType:"stateVariable",variableName:"numericalThroughPoints"},numericalRadius:{dependencyType:"stateVariable",variableName:"numericalRadius"},numericalCenter:{dependencyType:"stateVariable",variableName:"numericalCenter"}}),definition:function({dependencyValues:ss}){if(!(ss.haveNumericalEntries&&ss.nThroughPoints>0&&ss.numericalRadius>0&&ss.numericalCenter.every(ls=>Number.isFinite(ls))))return{useEssentialOrDefaultValue:{throughAngles:!0}};let os=[];for(let ls of ss.numericalThroughPoints)os.push(Math.atan2(ls[1]-ss.numericalCenter[1],ls[0]-ss.numericalCenter[0]));return{setValue:{throughAngles:os},setEssentialValue:{throughAngles:os}}}},ns.radius={public:!0,shadowingInstructions:{createComponentOfType:"math"},stateVariablesDeterminingDependencies:["nThroughPoints","havePrescribedCenter","havePrescribedRadius"],returnDependencies:function({stateValues:ss}){let os={numericalRadius:{dependencyType:"stateVariable",variableName:"numericalRadius"},nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"},essentialRadius:{dependencyType:"stateVariable",variableName:"essentialRadius"}};return ss.havePrescribedRadius?(os.prescribedRadius={dependencyType:"stateVariable",variableName:"prescribedRadius"},ss.havePrescribedCenter&&ss.nThroughPoints>0&&(os.haveCenterRadiusPoints={dependencyType:"value",value:!0})):ss.havePrescribedCenter&&ss.nThroughPoints===1&&(os.prescribedCenter={dependencyType:"stateVariable",variableName:"prescribedCenter"},os.throughPoints={dependencyType:"stateVariable",variableName:"throughPoints"}),os},definition:function({dependencyValues:ss}){if(Number.isFinite(ss.numericalRadius))return{setValue:{radius:Context.fromAst(ss.numericalRadius)}};if(ss.prescribedRadius!==void 0)return ss.haveCenterRadiusPoints?(console.warn("Can't calculate circle with specified radius and center and through points"),{setValue:{radius:Context.fromAst("_")}}):{setValue:{radius:ss.prescribedRadius}};if(ss.prescribedCenter!==void 0)if(ss.nThroughPoints===0){let os=ss.essentialRadius;return os instanceof Context.class||(Number.isFinite(os)?os=Context.fromAst(os):os=Context.fromAst("_")),{setValue:{radius:os}}}else if(ss.nThroughPoints===1)try{let os=ss.throughPoints[0],ls=os[0],us=os[1],cs=ss.prescribedCenter[0],ds=ss.prescribedCenter[1];return{setValue:{radius:ls.subtract(cs).pow(2).add(us.subtract(ds).pow(2)).pow(.5).simplify()}}}catch{return console.warn("Invalid center or through points of circle"),{setValue:{radius:Context.fromAst("_")}}}else return console.warn("Can't calculate circle with specified center through more than 1 point"),{setValue:{radius:Context.fromAst("_")}};if(ss.nThroughPoints<2){let os=ss.essentialRadius;return os instanceof Context.class||(Number.isFinite(os)?os=Context.fromAst(os):os=Context.fromAst("_")),{setValue:{radius:os}}}else return console.warn(`Have not implemented circle through ${ss.nThroughPoints} points when non-numerical values`),{setValue:{radius:Context.fromAst("_")}}},inverseDefinition:function({desiredStateVariableValues:ss,dependencyValues:os}){let ls=ss.radius.evaluate_to_constant();return Number.isFinite(ls)&&Number.isFinite(os.numericalRadius)?{success:!0,instructions:[{setDependency:"numericalRadius",desiredValue:ls}]}:os.prescribedRadius!==void 0?{success:!0,instructions:[{setDependency:"prescribedRadius",desiredValue:ss.radius}]}:os.nThroughPoints===0?{success:!0,instructions:[{setDependency:"essentialRadius",desiredValue:ss.radius}]}:(console.warn("Can't change radius of circle with non-numerical values through points"),{success:!1})}},ns.diameter={public:!0,shadowingInstructions:{createComponentOfType:"math"},returnDependencies:()=>({radius:{dependencyType:"stateVariable",variableName:"radius"}}),definition({dependencyValues:ss}){return{setValue:{diameter:ss.radius.multiply(2).simplify()}}},inverseDefinition:function({desiredStateVariableValues:ss,dependencyValues:os}){return{success:!0,instructions:[{setDependency:"radius",desiredValue:ss.diameter.divide(2).simplify()}]}}},ns.center={forRenderer:!0,public:!0,shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(ss){return ss==="centerX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,entryPrefixes:["centerX"],stateVariablesDeterminingDependencies:["nThroughPoints","havePrescribedCenter","havePrescribedRadius"],returnArraySizeDependencies:()=>({}),returnArraySize(){return[2]},returnArrayDependenciesByKey({arrayKeys:ss,stateValues:os}){let ls={},us={};if(os.havePrescribedCenter){ls.havePrescribedCenter={dependencyType:"value",value:!0};for(let cs of ss){let ds=Number(cs)+1;us[cs]={numericalCenterX:{dependencyType:"stateVariable",variableName:"numericalCenterX"+ds},prescribedCenterX:{dependencyType:"stateVariable",variableName:"prescribedCenterX"+ds}}}os.havePrescribedRadius&&os.nThroughPoints>0&&(ls.haveCenterRadiusPoints={dependencyType:"value",value:!0})}else{for(let cs of ss){let ds=Number(cs)+1;us[cs]={essentialCenterX:{dependencyType:"stateVariable",variableName:"essentialCenterX"+ds}}}ls.numericalCenter={dependencyType:"stateVariable",variableName:"numericalCenter"},ls.nThroughPoints={dependencyType:"stateVariable",variableName:"nThroughPoints"},ls.throughPoints={dependencyType:"stateVariable",variableName:"throughPoints"},os.havePrescribedRadius?ls.radius={dependencyType:"stateVariable",variableName:"prescribedRadius"}:os.nThroughPoints==1&&(ls.radius={dependencyType:"stateVariable",variableName:"radius"})}return{dependenciesByKey:us,globalDependencies:ls}},arrayDefinitionByKey:function({globalDependencyValues:ss,dependencyValuesByKey:os,arrayKeys:ls}){if(ss.havePrescribedCenter){if(ss.haveCenterRadiusPoints)return console.warn("Can't calculate circle with specified radius and center and through points"),{setValue:{center:[Context.fromAst("_"),Context.fromAst("_")]}};let us={};for(let cs of ls)Number.isFinite(os[cs].numericalCenterX)?us[cs]=Context.fromAst(os[cs].numericalCenterX):us[cs]=os[cs].prescribedCenterX;return{setValue:{center:us}}}if(ss.numericalCenter.every(us=>Number.isFinite(us)))return{setValue:{center:ss.numericalCenter.map(us=>Context.fromAst(us))}};if(ss.radius!==void 0)if(ss.nThroughPoints===0){let us={};for(let cs of ls){let ds=os[cs].essentialCenterX;ds instanceof Context.class||(Number.isFinite(ds)?ds=Context.fromAst(ds):ds=Context.fromAst("_")),us[cs]=ds}return{setValue:{center:us}}}else if(ss.nThroughPoints===1){let us;try{us=[ss.throughPoints[0][0],ss.throughPoints[0][1].subtract(ss.radius).simplify()]}catch{us=[Context.fromAst("_"),Context.fromAst("_")]}return{setValue:{center:us}}}else return console.warn("Can't create circle through more than one point with given radius when don't have numerical values"),{setValue:{center:[Context.fromAst("_"),Context.fromAst("_")]}};if(ss.nThroughPoints===0){let us={};for(let cs of ls){let ds=os[cs].essentialCenterX;ds instanceof Context.class||(Number.isFinite(ds)?ds=Context.fromAst(ds):ds=Context.fromAst("_")),us[cs]=ds}return{setValue:{center:us}}}else return console.warn("Can't create circle through more than one point when don't have numerical values"),{setValue:{center:[Context.fromAst("_"),Context.fromAst("_")]}}},async inverseArrayDefinitionByKey({desiredStateVariableValues:ss,globalDependencyValues:os,stateValues:ls,dependencyNamesByKey:us,workspace:cs}){if(os.havePrescribedCenter){let fs=[];for(let hs in ss.center)fs.push({setDependency:us[hs].prescribedCenterX,desiredValue:ss.center[hs],arrayKey:hs});return{success:!0,instructions:fs}}cs.desiredCenter||(cs.desiredCenter={});for(let fs=0;fs<2;fs++)ss.center[fs]!==void 0?cs.desiredCenter[fs]=ss.center[fs]:cs.desiredCenter[fs]===void 0&&(cs.desiredCenter[fs]=(await ls.center)[fs]);let ds=[],ps=!0;for(let fs=0;fs<2;fs++){let hs=cs.desiredCenter[fs].evaluate_to_constant();if(!Number.isFinite(hs)){ps=!1;break}ds.push(hs)}if(ps&&os.numericalCenter.every(fs=>Number.isFinite(fs)))return{success:!0,instructions:[{setDependency:"numericalCenter",desiredValue:ds}]};if(os.nThroughPoints===0){let fs=[];for(let hs in ss.center)fs.push({setDependency:us[hs].essentialCenterX,desiredValue:ss.center[hs],arrayKey:hs});return{success:!0,instructions:fs}}else return console.warn("Haven't implemented changing center of circle through points with non numerical values"),{success:!1}}},ns.nearestPoint={returnDependencies:()=>({numericalCenter:{dependencyType:"stateVariable",variableName:"numericalCenter"},numericalRadius:{dependencyType:"stateVariable",variableName:"numericalRadius"}}),definition({dependencyValues:ss}){let os=ss.numericalRadius,ls=ss.numericalCenter[0],us=ss.numericalCenter[1];return{setValue:{nearestPoint:function({variables:cs,scales:ds}){var ys,bs;let ps=(ys=cs.x1)==null?void 0:ys.evaluate_to_constant(),fs=(bs=cs.x2)==null?void 0:bs.evaluate_to_constant();if(!(Number.isFinite(ps)&&Number.isFinite(fs)))return{};if(!(Number.isFinite(ls)&&Number.isFinite(us)&&Number.isFinite(os)))return{};let hs=Math.atan2(fs-us,ps-ls),gs={x1:ls+os*Math.cos(hs),x2:us+os*Math.sin(hs)};return cs.x3!==void 0&&(gs.x3=0),gs}}}}},ns}async moveCircle({center:rs,radius:ns,throughAngles:ss,transient:os,actionId:ls,sourceInformation:us={},skipRendererUpdate:cs=!1}){let ds=[],ps=await this.stateValues.nThroughPoints,fs=await this.stateValues.numericalPrescribedCenter;if((ps<=1||fs!==null)&&ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"numericalCenter",value:rs}),ps>=1){let hs=[];ss===void 0&&(ss=await this.stateValues.throughAngles),ns===void 0&&(ns=await this.stateValues.numericalRadius);for(let gs=0;gs({styleDescription:{dependencyType:"stateVariable",variableName:"styleDescription"}}),definition:function({dependencyValues:os}){return{setValue:{styleDescriptionWithNoun:os.styleDescription+" parabola"}}}},ns.curveType={forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{curveType:"function"}})},ns.parMax={public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{parMax:1/0}})},ns.parMin={public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{parMin:-1/0}})},ns.aShadow={defaultValue:1,hasEssential:!0,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{aShadow:!0}}),inverseDefinition:function({desiredStateVariableValues:os}){return{success:!0,instructions:[{setEssentialValue:"aShadow",value:os.aShadow}]}}},ns.nThroughPoints={returnDependencies:()=>({throughAttr:{dependencyType:"attributeComponent",attributeName:"through",variableNames:["nPoints"]}}),definition:function({dependencyValues:os}){return os.throughAttr===null?{setValue:{nThroughPoints:0}}:{setValue:{nThroughPoints:os.throughAttr.stateValues.nPoints}}}},ns.throughPoints={public:!0,shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(os){return os==="throughPointX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,nDimensions:2,entryPrefixes:["throughPointX","throughPoint"],getArrayKeysFromVarName({arrayEntryPrefix:os,varEnding:ls,arraySize:us}){if(os==="throughPointX"){let cs=ls.split("_").map(ds=>Number(ds)-1);return cs.length===2&&cs.every((ds,ps)=>Number.isInteger(ds)&&ds>=0)?us?cs.every((ds,ps)=>ds=0?us?cscs+","+ps):[]:[cs+",0"]:[]}},arrayVarNameFromPropIndex(os,ls){if(ls==="throughPoints")return os.length===1?"throughPoint"+os[0]:`throughPointX${os[0]}_${os[1]}`;if(ls.slice(0,12)==="throughPoint"){let us=Number(ls.slice(12));if(Number.isInteger(us)&&us>0)return`throughPointX${us}_${os[0]}`}return null},returnArraySizeDependencies:()=>({nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"}}),returnArraySize({dependencyValues:os}){return[os.nThroughPoints,2]},returnArrayDependenciesByKey({arrayKeys:os}){let ls={};for(let us of os){let[cs,ds]=us.split(","),ps=Number(cs)+1+"_"+(Number(ds)+1);ls[us]={throughAttr:{dependencyType:"attributeComponent",attributeName:"through",variableNames:["pointX"+ps]}}}return{dependenciesByKey:ls}},arrayDefinitionByKey({dependencyValuesByKey:os,arrayKeys:ls}){let us={};for(let cs of ls){let[ds,ps]=cs.split(","),fs=Number(ds)+1+"_"+(Number(ps)+1),hs=os[cs].throughAttr;if(hs!==null&&hs.stateValues["pointX"+fs]){let gs=hs.stateValues["pointX"+fs].evaluate_to_constant();Number.isFinite(gs)?us[cs]=Context.fromAst(gs):us[cs]=Context.fromAst("_")}else us[cs]=Context.fromAst("_")}return{setValue:{throughPoints:us}}},async inverseArrayDefinitionByKey({desiredStateVariableValues:os,dependencyValuesByKey:ls,dependencyNamesByKey:us,initialChange:cs,stateValues:ds}){if(cs&&!await ds.draggable)return{success:!1};let ps=[];for(let fs in os.throughPoints){let[hs,gs]=fs.split(","),ys=Number(hs)+1+"_"+(Number(gs)+1);if(ls[fs].throughAttr!==null&&ls[fs].throughAttr.stateValues["pointX"+ys])ps.push({setDependency:us[fs].throughAttr,desiredValue:os.throughPoints[fs],childIndex:0,variableIndex:0});else return{success:!1}}return{success:!0,instructions:ps}}},ns.numericalThroughPoints={isArray:!0,forRenderer:!0,returnArraySizeDependencies:()=>({nThroughPoints:{dependencyType:"stateVariable",variableName:"nThroughPoints"}}),returnArraySize({dependencyValues:os}){return[os.nThroughPoints]},returnArrayDependenciesByKey({arrayKeys:os}){let ls={};for(let us of os)ls[us]={throughPoint:{dependencyType:"stateVariable",variableName:"throughPoint"+(Number(us)+1)}};return{dependenciesByKey:ls}},arrayDefinitionByKey({dependencyValuesByKey:os,arrayKeys:ls}){let us={};for(let cs of ls){let ds=os[cs].throughPoint.map(ps=>ps.tree);ds.every(ps=>Number.isFinite(ps))||(ds=Array(ds.length).fill(NaN)),us[cs]=ds}return{setValue:{numericalThroughPoints:us}}},inverseArrayDefinitionByKey({desiredStateVariableValues:os,dependencyValuesByKey:ls,dependencyNamesByKey:us}){let cs=[];for(let ds in os.numericalThroughPoints)if(ls[ds].throughPoint)cs.push({setDependency:us[ds].throughPoint,desiredValue:os.numericalThroughPoints[ds].map(ps=>Context.fromAst(ps))});else return{success:!1};return{success:!0,instructions:cs}}},ns.numericalPrescribedVertex={returnDependencies:()=>({prescribedVertex:{dependencyType:"stateVariable",variableName:"prescribedVertex"}}),definition({dependencyValues:os}){if(os.prescribedVertex===null)return{setValue:{numericalPrescribedVertex:null}};let ls,us;try{ls=os.prescribedVertex.get_component(0).evaluate_to_constant(),us=os.prescribedVertex.get_component(1).evaluate_to_constant(),Number.isFinite(ls)&&Number.isFinite(us)||(ls=NaN,us=NaN)}catch{ls=NaN,us=NaN}return{setValue:{numericalPrescribedVertex:[ls,us]}}}},ns.pointsAreNumerical={returnDependencies:()=>({numericalThroughPoints:{dependencyType:"stateVariable",variableName:"numericalThroughPoints"},numericalPrescribedVertex:{dependencyType:"stateVariable",variableName:"numericalPrescribedVertex"}}),definition:({dependencyValues:os})=>({setValue:{pointsAreNumerical:os.numericalThroughPoints.every(ls=>Number.isFinite(ls[0]))&&(!os.numericalPrescribedVertex||Number.isFinite(os.numericalPrescribedVertex[0]))},checkForActualChange:{pointsAreNumerical:!0}})},ns.a={public:!0,shadowingInstructions:{createComponentOfType:"number"},additionalStateVariablesDefined:[{variableName:"b",public:!0,shadowingInstructions:{createComponentOfType:"number"},hasEssential:!0,defaultValue:0},{variableName:"c",public:!0,shadowingInstructions:{createComponentOfType:"number"},hasEssential:!0,defaultValue:0},"realValued"],returnDependencies:()=>({numericalThroughPoints:{dependencyType:"stateVariable",variableName:"numericalThroughPoints"},numericalPrescribedVertex:{dependencyType:"stateVariable",variableName:"numericalPrescribedVertex"},pointsAreNumerical:{dependencyType:"stateVariable",variableName:"pointsAreNumerical"},aShadow:{dependencyType:"stateVariable",variableName:"aShadow"}}),definition:function({dependencyValues:os,componentName:ls}){if(!os.pointsAreNumerical)return{setValue:{a:NaN,b:NaN,c:NaN,realValued:!1}};let us,cs,ds,ps=!0;if(os.numericalPrescribedVertex)if(os.numericalThroughPoints.length===0){let fs=os.numericalPrescribedVertex,hs=fs[0],gs=fs[1];return us=os.aShadow,cs=-2*us*hs,ds=us*hs*hs+gs,{setValue:{a:us,b:cs,c:ds,realValued:!0}}}else{let fs=os.numericalPrescribedVertex,hs=fs[0],gs=fs[1],ys=os.numericalThroughPoints[0],bs=ys[0];return us=(ys[1]-gs)/(bs-hs)**2,cs=-2*us*hs,ds=us*hs*hs+gs,{setValue:{a:us,b:cs,c:ds,realValued:!0}}}if(os.numericalThroughPoints.length===0)return{setValue:{a:os.aShadow,realValued:!0},useEssentialOrDefaultValue:{b:!0,c:!0}};if(os.numericalThroughPoints.length===1){let fs=os.numericalThroughPoints[0],hs=fs[0],gs=fs[1];return us=os.aShadow,cs=-2*us*hs,ds=us*hs*hs+gs,{setValue:{a:us,b:cs,c:ds,realValued:!0}}}else if(os.numericalThroughPoints.length===2){us=os.aShadow;let fs=os.numericalThroughPoints[0],hs=fs[0],gs=fs[1],ys=hs*hs,bs=os.numericalThroughPoints[1],vs=bs[0],xs=bs[1],Cs=vs*vs;return hs===vs?gs==xs?(cs=-2*us*hs,ds=us*ys+gs):(ps=!1,us=NaN,cs=NaN,ds=NaN):(cs=(gs-xs-us*(ys-Cs))/(hs-vs),ds=gs-us*ys-cs*hs),{setValue:{a:us,b:cs,c:ds,realValued:ps}}}else if(os.numericalThroughPoints.length===3){let fs=os.numericalThroughPoints[0],hs=fs[0],gs=fs[1],ys=hs*hs,bs=os.numericalThroughPoints[1],vs=bs[0],xs=bs[1],Cs=vs*vs,Ts=os.numericalThroughPoints[2],Ss=Ts[0],Ns=Ts[1],As=Ss*Ss,ws=ys-As,Es=Cs-As,_s=hs-Ss,$s=vs-Ss,Rs=gs-Ns,Ds=xs-Ns,Os=ws*$s-Es*_s;if(Os===0){let Is=!1,Vs,ks,Ps;hs===vs?gs===xs?hs===Ss?gs==Ns?Vs=1:Is=!0:(Vs=2,ks=Ss,Ps=Ns):Is=!0:hs===Ss?gs===Ns?(Vs=2,ks=vs,Ps=xs):Is=!0:vs===Ss&&xs===Ns?(Vs=2,ks=vs,Ps=xs):Is=!0,Is?(ps=!1,us=NaN,cs=NaN,ds=NaN):Vs===1?(us=os.aShadow,cs=-2*us*hs,ds=us*hs*hs+gs):(us=os.aShadow,cs=(gs-Ps-us*(ys-ks*ks))/(hs-ks),ds=gs-us*ys-cs*hs)}else us=(Rs*$s-Ds*_s)/Os,cs=(Ds*ws-Rs*Es)/Os,ds=gs-cs*hs-us*ys;return{setValue:{a:us,b:cs,c:ds,realValued:ps}}}else return console.warn("Haven't implemented parabola through more than 3 points"),{setValue:{a:NaN,b:NaN,c:NaN,realValued:!1}}},inverseDefinition:async function({desiredStateVariableValues:os,dependencyValues:ls,stateValues:us,workspace:cs}){if(!ls.pointsAreNumerical)return{success:!1};let ds={},ps=function(hs){if(Number.isFinite(hs))return{success:!0,value:hs};if(hs instanceof Context.class){let gs=hs.evaluate_to_constant();if(Number.isFinite(gs))return{success:!0,value:gs}}return{success:!1}};if(os.a!==void 0){let hs=ps(os.a);if(hs.success)ds.a=hs.value;else return{success:!1}}if(os.b!==void 0){let hs=ps(os.b);if(hs.success)ds.b=hs.value;else return{success:!1}}if(os.c!==void 0){let hs=ps(os.c);if(hs.success)ds.c=hs.value;else return{success:!1}}Object.assign(cs,ds);let fs=async function(hs){return cs[hs]!==void 0?cs[hs]:await us[hs]};if(ls.numericalThroughPoints.length===0){let hs=[];return ds.a!==void 0&&hs.push({setDependency:"aShadow",desiredValue:ds.a}),ds.b!==void 0&&hs.push({setEssentialValue:"b",value:ds.b}),ds.c!==void 0&&hs.push({setEssentialValue:"c",value:ds.c}),{success:!0,instructions:hs}}else if(ls.numericalThroughPoints.length===1){let hs=await fs("a"),gs=await fs("b"),ys=await fs("c"),bs=-gs/(2*hs),vs=ys-gs*gs/(4*hs),xs=[{setDependency:"numericalThroughPoints",desiredValue:[[bs,vs]]}];return ds.a!==void 0&&xs.push({setDependency:"aShadow",desiredValue:ds.a}),{success:!0,instructions:xs}}else if(ls.numericalThroughPoints.length===2){let hs=await fs("a"),gs=await fs("b"),ys=await fs("c"),vs=ls.numericalThroughPoints[0][0],Cs=ls.numericalThroughPoints[1][0];if(vs===Cs){vs=-gs/(2*hs);let Ts=ys-gs*gs/(4*hs),Ss=[{setDependency:"numericalThroughPoints",desiredValue:[[vs,Ts],[vs,Ts]]}];return ds.a!==void 0&&Ss.push({setDependency:"aShadow",desiredValue:ds.a}),{success:!0,instructions:Ss}}else{let Ts=hs*vs*vs+gs*vs+ys,Ss=hs*Cs*Cs+gs*Cs+ys,Ns=[{setDependency:"numericalThroughPoints",desiredValue:[[vs,Ts],[Cs,Ss]]}];return ds.a!==void 0&&Ns.push({setDependency:"aShadow",desiredValue:ds.a}),{success:!0,instructions:Ns}}}else if(ls.numericalThroughPoints.length===3){let hs=await fs("a"),gs=await fs("b"),ys=await fs("c"),vs=ls.numericalThroughPoints[0][0],Cs=ls.numericalThroughPoints[1][0],Ss=ls.numericalThroughPoints[2][0],Ns=3,As;if(vs===Cs?vs===Ss?Ns=1:(Ns=2,As=3):vs===Ss?(Ns=2,As=2):Cs===Ss&&(Ns=2,As=1),Ns===3){let ws=hs*vs*vs+gs*vs+ys,Es=hs*Cs*Cs+gs*Cs+ys,_s=hs*Ss*Ss+gs*Ss+ys,$s=[{setDependency:"numericalThroughPoints",desiredValue:[[vs,ws],[Cs,Es],[Ss,_s]]}];return ds.a!==void 0&&$s.push({setDependency:"aShadow",desiredValue:ds.a}),{success:!0,instructions:$s}}else if(Ns===2)if(As===1){let ws=vs,Es=Cs,_s=hs*ws*ws+gs*ws+ys,$s=hs*Es*Es+gs*Es+ys,Rs=[{setDependency:"numericalThroughPoints",desiredValue:[[ws,_s],[Es,$s],[Es,$s]]}];return ds.a!==void 0&&Rs.push({setDependency:"aShadow",desiredValue:ds.a}),{success:!0,instructions:Rs}}else if(As===2){let ws=vs,Es=Cs,_s=hs*ws*ws+gs*ws+ys,$s=hs*Es*Es+gs*Es+ys,Rs=[{setDependency:"numericalThroughPoints",desiredValue:[[ws,_s],[Es,$s],[ws,_s]]}];return ds.a!==void 0&&Rs.push({setDependency:"aShadow",desiredValue:ds.a}),{success:!0,instructions:Rs}}else{let ws=vs,Es=Ss,_s=hs*ws*ws+gs*ws+ys,$s=hs*Es*Es+gs*Es+ys,Rs=[{setDependency:"numericalThroughPoints",desiredValue:[[ws,_s],[ws,_s],[Es,$s]]}];return ds.a!==void 0&&Rs.push({setDependency:"aShadow",desiredValue:ds.a}),{success:!0,instructions:Rs}}else{vs=-gs/(2*hs);let ws=ys-gs*gs/(4*hs),Es=[{setDependency:"numericalThroughPoints",desiredValue:[[vs,ws],[vs,ws],[vs,ws]]}];return ds.a!==void 0&&Es.push({setDependency:"aShadow",desiredValue:ds.a}),{success:!0,instructions:Es}}}else return{success:!1}}},ns.vertex={public:!0,shadowingInstructions:{createComponentOfType:"math",returnWrappingComponents(os){return os==="vertexX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,entryPrefixes:["vertexX"],returnArraySizeDependencies:()=>({}),returnArraySize(){return[2]},returnArrayDependenciesByKey(){return{globalDependencies:{a:{dependencyType:"stateVariable",variableName:"a"},b:{dependencyType:"stateVariable",variableName:"b"},c:{dependencyType:"stateVariable",variableName:"c"},realValued:{dependencyType:"stateVariable",variableName:"realValued"}}}},arrayDefinitionByKey:function({globalDependencyValues:os}){let ls={};return os.realValued&&os.a!==0?(ls[0]=Context.fromAst(-os.b/(2*os.a)),ls[1]=Context.fromAst(os.c-os.b**2/(4*os.a))):(ls[0]=Context.fromAst("_"),ls[1]=Context.fromAst("_")),{setValue:{vertex:ls}}},inverseArrayDefinitionByKey:async function({desiredStateVariableValues:os,globalDependencyValues:ls,workspace:us,stateValues:cs}){let ds;if("0"in os.vertex?ds=os.vertex[0].evaluate_to_constant():us.x!==void 0?ds=us.x:ds=(await cs.vertex)[0].tree,Number.isFinite(ds))us.x=ds;else return{success:!1};let ps;if("1"in os.vertex?ps=os.vertex[1].evaluate_to_constant():us.y!==void 0?ps=us.y:ps=(await cs.vertex)[1].tree,Number.isFinite(ps))us.y=ps;else return{success:!1};let fs=ls.a,hs=-2*fs*ds,gs=ps+fs*ds*ds;return{success:!0,instructions:[{setDependency:"b",desiredValue:hs,additionalDependencyValues:{c:gs}}]}}},ns.equation={public:!0,shadowingInstructions:{createComponentOfType:"math"},additionalProperties:{simplify:"numberspreserveorder",displaysmallaszero:!0},returnDependencies:()=>({a:{dependencyType:"stateVariable",variableName:"a"},b:{dependencyType:"stateVariable",variableName:"b"},c:{dependencyType:"stateVariable",variableName:"c"}}),definition:function({dependencyValues:os}){let ls=["=","y",["+",["*",os.a,["^","x",2]],["*",os.b,"x"],os.c]];return{setValue:{equation:Context.fromAst(ls).evaluate_numbers({skip_ordering:!0})}}}},ns.fs={forRenderer:!0,isArray:!0,entryPrefixes:["f"],additionalStateVariablesDefined:[{variableName:"fDefinitions",isArray:!0,forRenderer:!0}],returnArraySizeDependencies:()=>({}),returnArraySize:()=>[1],returnArrayDependenciesByKey(){return{globalDependencies:{a:{dependencyType:"stateVariable",variableName:"a"},b:{dependencyType:"stateVariable",variableName:"b"},c:{dependencyType:"stateVariable",variableName:"c"}}}},arrayDefinitionByKey({globalDependencyValues:os}){return{setValue:{fs:[function(us){return os.a*us*us+os.b*us+os.c}],fDefinitions:[{functionType:"formula",formula:["+",["*",os.a,"x","x"],["*",os.b,"x"],os.c],variables:["x"],nInputs:1,nOutputs:1,domain:null}]}}}},ns.f={isAlias:!0,targetVariableName:"f1"},ns.nearestPoint={returnDependencies:()=>({f:{dependencyType:"stateVariable",variableName:"f"},a:{dependencyType:"stateVariable",variableName:"a"},b:{dependencyType:"stateVariable",variableName:"b"},c:{dependencyType:"stateVariable",variableName:"c"}}),definition({dependencyValues:os,componentName:ls}){let us=!(Number.isFinite(os.a)&&Number.isFinite(os.b)&&Number.isFinite(os.c));return{setValue:{nearestPoint:function({variables:cs,scales:ds}){var Rs,Ds;if(us)return{};let ps=ds[0],fs=ds[1],hs=(Rs=cs.x1)==null?void 0:Rs.evaluate_to_constant(),gs=(Ds=cs.x2)==null?void 0:Ds.evaluate_to_constant();if(!(Number.isFinite(hs)&&Number.isFinite(gs)))return{};hs/=ps,gs/=fs;let ys=os.a*ps*ps/fs,bs=os.b*ps/fs,vs=os.c/fs;if(ys===0){let Os=bs*bs+1,Is={};return Is.x1=(hs+bs*gs-bs*vs)/Os*ps,Is.x2=(bs*(hs+bs*gs)+vs)/Os*fs,cs.x3!==void 0&&(Is.x3=0),Is}let xs=vs-gs,Cs=2*ys**2,Ts=3*ys*bs/Cs,Ss=(2*ys*xs+bs**2+1)/Cs,Ns=(bs*xs-hs)/Cs,As=cardano(Ts,Ss,Ns,1e-14),ws=As[0],Es=os.f(ws*ps)/fs,_s=(hs-ws)**2+(gs-Es)**2;for(let Os of As.slice(1)){let Is=Os,Vs=os.f(Is*ps)/fs,ks=(hs-Is)**2+(gs-Vs)**2;ks<_s&&(ws=Is,Es=Vs,_s=ks)}let $s={x1:ws*ps,x2:Es*fs};return cs.x3!==void 0&&($s.x3=0),$s}}}}},ns}}zs(Parabola,"componentType","parabola"),zs(Parabola,"rendererType","curve");function cardano(as,rs,ns,ss=1e-10){const[os,ls]=[-.3333333333333333*as*as+rs,.07407407407407407*as*as*as-.3333333333333333*as*rs+ns];if(Math.abs(ls)<=ss){if(Math.abs(os)<=ss)return[-as/3];let hs=Math.sqrt(Math.abs(os));return os<0?[-hs-as/3,-as/3,hs-as/3]:[-as/3]}const us=-27*ls*ls-4*os*os*os;if(Math.abs(us)<=ss){const hs=Math.cbrt(-ls/2);return[2*hs-as/3,-hs-as/3]}if(us>0){const hs=Math.sqrt(us/108),gs=Math.sqrt(Math.cbrt(ls*ls/4+us/108))*2,ys=Math.atan2(hs,-ls/2);return[Math.cos(ys/3),Math.cos(ys/3+2*Math.PI/3),Math.cos(ys/3-2*Math.PI/3)].sort((bs,vs)=>bs-vs).map(bs=>gs*bs-as/3)}const cs=Math.sqrt(-us/108),ds=Math.cbrt(-ls/2+cs),ps=Math.cbrt(-ls/2-cs);return[ds+ps-as/3]}class BezierControls extends InlineComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.alwaysVisible={createComponentOfType:"boolean",createStateVariable:"alwaysVisible",defaultValue:!1,public:!0},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss}){let os=breakEmbeddedStringsIntoParensPieces({componentList:ss});return os.success!==!0?{success:!1}:{success:!0,newChildren:os.pieces.map(function(ls){return ls.length>1||typeof ls[0]=="string"?{componentType:"controlVectors",children:[{componentType:"vector",children:ls}]}:ls[0]})}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"controlVectors",componentTypes:["controlVectors"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.nControls={returnDependencies:()=>({nParentPoints:{dependencyType:"parentStateVariable",variableName:"nThroughPoints",skipComponentNames:!0}}),definition({dependencyValues:ns}){let ss=ns.nParentPoints;return Number.isInteger(ss)&&ss>=0||(ss=0),{setValue:{nControls:ss}}}},rs.pointIndMap={returnDependencies:()=>({controlChildren:{dependencyType:"child",childGroups:["controlVectors"],variableNames:["pointNumber"]}}),definition:function({dependencyValues:ns}){let ss=[],os=-1;for(let[ls,us]of ns.controlChildren.entries()){let cs=us.stateValues.pointNumber;Number.isFinite(cs)?os=Math.round(cs)-1:os+=1,ss[os]=ls}return{setValue:{pointIndMap:ss}}}},rs.directions={isArray:!0,entryPrefixes:["direction"],hasEssential:!0,defaultValueByArrayKey:()=>"none",stateVariablesDeterminingDependencies:["pointIndMap"],returnArraySizeDependencies:()=>({nControls:{dependencyType:"stateVariable",variableName:"nControls"}}),returnArraySize({dependencyValues:ns}){return[ns.nControls]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={};for(let ls of ns){let us=ss.pointIndMap[ls];us!==void 0&&(os[ls]={controlChild:{dependencyType:"child",childGroups:["controlVectors"],variableNames:["direction"],childIndices:[us]}})}return{dependenciesByKey:os}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={},ls={};for(let us of ss){let cs=ns[us].controlChild;cs&&cs.length===1?os[us]=cs[0].stateValues.direction:ls[us]=!0}return{setValue:{directions:os},useEssentialOrDefaultValue:{directions:ls}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyNamesByKey:ss,dependencyValuesByKey:os}){let ls=[],us={};for(let cs in ns.directions){let ds=os[cs].controlChild;ds&&ds.length===1?ls.push({setDependency:ss[cs].controlChild,desiredValue:ns.directions[cs],childIndex:0,variableIndex:0}):us[cs]=ns.directions[cs]}return Object.keys(us).length>0&&ls.push({setEssentialValue:"directions",value:us}),{success:!0,instructions:ls}}},rs.hiddenControls={isArray:!0,entryPrefixes:["hiddenControl"],hasEssential:!0,defaultValueByArrayKey:()=>!1,stateVariablesDeterminingDependencies:["pointIndMap"],returnArraySizeDependencies:()=>({nControls:{dependencyType:"stateVariable",variableName:"nControls"}}),returnArraySize({dependencyValues:ns}){return[ns.nControls]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={};for(let ls of ns){let us=ss.pointIndMap[ls];us!==void 0&&(os[ls]={controlChild:{dependencyType:"child",childGroups:["controlVectors"],variableNames:["hide"],childIndices:[us]}})}return{dependenciesByKey:os}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={},ls={};for(let us of ss){let cs=ns[us].controlChild;cs&&cs.length===1?os[us]=cs[0].stateValues.hide:ls[us]=!0}return{setValue:{hiddenControls:os},useEssentialOrDefaultValue:{hiddenControls:ls}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyNamesByKey:ss,dependencyValuesByKey:os}){let ls=[],us={};for(let cs in ns.hiddenControls){let ds=os[cs].controlChild;ds&&ds.length===1?ls.push({setDependency:ss[cs].controlChild,desiredValue:ns.hiddenControls[cs],childIndex:0,variableIndex:0}):us[cs]=ns.hiddenControls[cs]}return Object.keys(us).length>0&&ls.push({setEssentialValue:"hiddenControls",value:us}),{success:!0,instructions:ls}}},rs.nDimensions={returnDependencies(){return{nParentDimensions:{dependencyType:"parentStateVariable",variableName:"nDimensions"}}},definition:function({dependencyValues:ns}){let ss=ns.nParentDimensions;return Number.isInteger(ss)&&ss>=0||(ss=0),{setValue:{nDimensions:ss},checkForActualChange:{nDimensions:!0}}}},rs.essentialSymmetricControls={isArray:!0,entryPrefixes:["essentialSymmetricControl"],nDimensions:2,hasEssential:!0,defaultValueByArrayKey:()=>Context.fromAst(1),returnArraySizeDependencies:()=>({nControls:{dependencyType:"stateVariable",variableName:"nControls"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[ns.nControls,ns.nDimensions]},returnArrayDependenciesByKey:()=>({}),arrayDefinitionByKey({arrayKeys:ns}){let ss={};for(let os of ns)os.split(",").map(ls=>Number(ls)),ss[os]=!0;return{useEssentialOrDefaultValue:{essentialSymmetricControls:ss}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns}){let ss=[],os={};for(let ls in ns.essentialSymmetricControls)os[ls]=ns.essentialSymmetricControls[ls];return Object.keys(os).length>0&&ss.push({setEssentialValue:"essentialSymmetricControls",value:os}),{success:!0,instructions:ss}}},rs.controls={isArray:!0,entryPrefixes:["control"],nDimensions:3,hasEssential:!0,shadowVariable:!0,defaultValueByArrayKey:()=>Context.fromAst(1),stateVariablesDeterminingDependencies:["pointIndMap","directions"],returnArraySizeDependencies:()=>({nControls:{dependencyType:"stateVariable",variableName:"nControls"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[ns.nControls,2,ns.nDimensions]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={};for(let ls of ns){let us=ls.split(",").map(ps=>Number(ps)),cs=us.map(ps=>ps+1);os[ls]={direction:{dependencyType:"stateVariable",variableName:"direction"+cs[0]}};let ds=ss.directions[us[0]];if(ds!=="none"&&(us[1]===0||us[1]===1)){let ps=ss.pointIndMap[us[0]];ps!==void 0&&(ds==="symmetric"||ds==="previous"&&us[1]===0||ds==="next"&&us[1]===1?os[ls].controlChild={dependencyType:"child",childGroups:["controlVectors"],variableNames:["vectorX1_"+cs[2]],childIndices:[ps]}:ds==="both"&&(os[ls].controlChild={dependencyType:"child",childGroups:["controlVectors"],variableNames:["vectorX"+cs[1]+"_"+cs[2]],childIndices:[ps]})),ds==="symmetric"&&(os[ls].essentialSymmetricControl={dependencyType:"stateVariable",variableName:"essentialSymmetricControl"+cs[0]+"_"+cs[2]})}}return{dependenciesByKey:os}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss,componentName:os}){let ls={},us={};for(let cs of ss){let ds=cs.split(",").map(hs=>Number(hs)),ps=ds.map(hs=>hs+1),fs=ns[cs].direction;if(ds[1]===0)if(fs==="none"||fs==="next")ls[cs]=null;else{let hs=ns[cs].controlChild,gs=!0;if(hs&&hs.length===1){let ys=hs[0].stateValues["vectorX1_"+ps[2]];ys&&(gs=!1,ys=ys.evaluate_to_constant(),ls[cs]=Context.fromAst(ys))}gs&&(fs==="symmetric"?ls[cs]=ns[cs].essentialSymmetricControl:us[cs]=!0)}else if(ds[1]===1)if(fs==="none"||fs==="previous")ls[cs]=null;else{let hs=ns[cs].controlChild,gs=!0;if(hs&&hs.length===1)if(fs==="both"){let ys=hs[0].stateValues["vectorX2_"+ps[2]];ys&&(gs=!1,ys=ys.evaluate_to_constant(),ls[cs]=Context.fromAst(ys))}else{let ys=hs[0].stateValues["vectorX1_"+ps[2]];ys&&(gs=!1,ys=ys.evaluate_to_constant(),fs==="symmetric"?ls[cs]=Context.fromAst(-ys):ls[cs]=Context.fromAst(ys))}gs&&(fs==="symmetric"?ns[cs].essentialSymmetricControl&&(ls[cs]=Context.fromAst(-ns[cs].essentialSymmetricControl.tree)):us[cs]=!0)}}return{setValue:{controls:ls},useEssentialOrDefaultValue:{controls:us}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyNamesByKey:ss,dependencyValuesByKey:os}){let ls=[],us={};for(let cs in ns.controls){let ds=cs.split(",").map(hs=>Number(hs)),ps=ds.map(hs=>hs+1),fs=os[cs].direction;if(fs){if(ds[1]===0){if(!(fs==="none"||fs==="next")){let hs=os[cs].controlChild,gs=!0;if(hs&&hs.length===1&&hs[0].stateValues["vectorX1_"+ps[2]]&&(gs=!1,ls.push({setDependency:ss[cs].controlChild,desiredValue:ns.controls[cs],childIndex:0,variableIndex:0})),gs){let ys=Context.fromAst(ns.controls[cs].evaluate_to_constant());fs==="symmetric"?ls.push({setDependency:ss[cs].essentialSymmetricControl,desiredValue:ys}):us[cs]=ys}}}else if(ds[1]===1&&!(fs==="none"||fs==="previous")){let hs=os[cs].controlChild,gs=!0;hs&&hs.length===1&&(fs==="both"?hs[0].stateValues["vectorX2_"+ps[2]]&&(gs=!1):hs[0].stateValues["vectorX1_"+ps[2]]&&(gs=!1));let ys;fs==="symmetric"?ys=Context.fromAst(["-",ns.controls[cs].tree]):ys=ns.controls[cs],gs?(ys=Context.fromAst(ys.evaluate_to_constant()),fs==="symmetric"?ls.push({setDependency:ss[cs].essentialSymmetricControl,desiredValue:ys}):us[cs]=ys):ls.push({setDependency:ss[cs].controlChild,desiredValue:ys,childIndex:0,variableIndex:0})}}}return Object.keys(us).length>0&&ls.push({setEssentialValue:"controls",value:us}),{success:!0,instructions:ls}}},rs}}zs(BezierControls,"componentType","bezierControls"),zs(BezierControls,"rendererType","containerInline");class VectorListComponent extends BaseComponent{static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss}){let os=breakEmbeddedStringsIntoParensPieces({componentList:ss});return os.success!==!0?{success:!1}:{success:!0,newChildren:os.pieces.map(function(ls){return ls.length>1||typeof ls[0]=="string"?{componentType:"vector",children:ls}:ls[0]})}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"vectors",componentTypes:["vector"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.nVectors={returnDependencies:()=>({vectorChildren:{dependencyType:"child",childGroups:["vectors"],skipComponentNames:!0}}),definition:({dependencyValues:ns})=>({setValue:{nVectors:ns.vectorChildren.length},checkForActualChange:{nVectors:!0}})},rs.nDimensions={returnDependencies:()=>({vectorChildren:{dependencyType:"child",childGroups:["vectors"],variableNames:["nDimensions"],skipPlaceholders:!0}}),definition:function({dependencyValues:ns}){let ss;if(ns.vectorChildren.length===0)ss=2;else{ss=1;for(let os of ns.vectorChildren)Number.isFinite(os.stateValues.nDimensions)&&(ss=Math.max(ss,os.stateValues.nDimensions))}return{setValue:{nDimensions:ss},checkForActualChange:{nDimensions:!0}}}},rs.vectors={isArray:!0,nDimensions:2,entryPrefixes:["vectorX","vector"],getArrayKeysFromVarName({arrayEntryPrefix:ns,varEnding:ss,arraySize:os}){if(ns==="vectorX"){let ls=ss.split("_").map(us=>Number(us)-1);return ls.length===2&&ls.every((us,cs)=>Number.isInteger(us)&&us>=0)?os?ls.every((us,cs)=>us=0?os?lsls+","+cs):[]:[ls+",0"]:[]}},arrayVarNameFromPropIndex(ns,ss){if(ss==="vectors")return ns.length===1?"vector"+ns[0]:`vectorX${ns[0]}_${ns[1]}`;if(ss.slice(0,6)==="vector"){let os=Number(ss.slice(6));if(Number.isInteger(os)&&os>0)return`vectorX${os}_${ns[0]}`}return null},returnArraySizeDependencies:()=>({nVectors:{dependencyType:"stateVariable",variableName:"nVectors"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[ns.nVectors,ns.nDimensions]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={};for(let os of ns){let[ls,us]=os.split(",");ss[os]={vectorChild:{dependencyType:"child",childGroups:["vectors"],variableNames:["x"+(Number(us)+1)],childIndices:[ls]}}}return{dependenciesByKey:ss}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={};for(let ls of ss){let us=ls.split(",")[1],cs=ns[ls].vectorChild[0];cs&&(os[ls]=cs.stateValues["x"+(Number(us)+1)])}return{setValue:{vectors:os}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyNamesByKey:ss}){let os=[];for(let ls in ns.vectors)os.push({setDependency:ss[ls].vectorChild,desiredValue:ns.vectors[ls],childIndex:0,variableIndex:0});return{success:!0,instructions:os}}},rs}}zs(VectorListComponent,"componentType","_vectorListComponent"),zs(VectorListComponent,"rendererType","containerInline"),zs(VectorListComponent,"renderChildren",!0);class ControlVectors extends VectorListComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.direction={createComponentOfType:"text",createStateVariable:"direction",defaultValue:"symmetric",public:!0,toLowerCase:!0,validValues:["symmetric","previous","next","both","none"]},rs.pointNumber={createComponentOfType:"number",createStateVariable:"pointNumber",defaultValue:null,public:!0},rs}}zs(ControlVectors,"componentType","controlVectors");class PointListComponent extends BaseComponent{static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss}){let os=breakEmbeddedStringsIntoParensPieces({componentList:ss});return os.success!==!0?{success:!1}:{success:!0,newChildren:os.pieces.map(function(ls){return ls.length>1||typeof ls[0]=="string"?{componentType:"point",children:ls}:ls[0]})}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"points",componentTypes:["point"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.nPoints={returnDependencies:()=>({pointChildren:{dependencyType:"child",childGroups:["points"],skipComponentNames:!0}}),definition:function({dependencyValues:ns}){return{setValue:{nPoints:ns.pointChildren.length},checkForActualChange:{nPoints:!0}}}},rs.nDimensions={returnDependencies:()=>({pointChildren:{dependencyType:"child",childGroups:["points"],variableNames:["nDimensions"],skipPlaceholders:!0}}),definition:function({dependencyValues:ns}){let ss;if(ns.pointChildren.length===0)ss=2;else{ss=1;for(let os of ns.pointChildren)Number.isFinite(os.stateValues.nDimensions)&&(ss=Math.max(ss,os.stateValues.nDimensions))}return{setValue:{nDimensions:ss},checkForActualChange:{nDimensions:!0}}}},rs.points={isArray:!0,nDimensions:2,entryPrefixes:["pointX","point"],getArrayKeysFromVarName({arrayEntryPrefix:ns,varEnding:ss,arraySize:os}){if(ns==="pointX"){let ls=ss.split("_").map(us=>Number(us)-1);return ls.length===2&&ls.every((us,cs)=>Number.isInteger(us)&&us>=0)?os?ls.every((us,cs)=>us=0?os?lsls+","+cs):[]:[ls+",0"]:[]}},arrayVarNameFromPropIndex(ns,ss){if(ss==="points")return ns.length===1?"point"+ns[0]:`pointX${ns[0]}_${ns[1]}`;if(ss.slice(0,5)==="point"){let os=Number(ss.slice(5));if(Number.isInteger(os)&&os>0)return`pointX${os}_${ns[0]}`}return null},returnArraySizeDependencies:()=>({nPoints:{dependencyType:"stateVariable",variableName:"nPoints"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),returnArraySize({dependencyValues:ns}){return[ns.nPoints,ns.nDimensions]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={};for(let os of ns){let[ls,us]=os.split(",");ss[os]={pointChild:{dependencyType:"child",childGroups:["points"],variableNames:["x"+(Number(us)+1)],childIndices:[ls]}}}return{dependenciesByKey:ss}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={};for(let ls of ss){let us=ls.split(",")[1],cs=ns[ls].pointChild[0];cs&&(os[ls]=cs.stateValues["x"+(Number(us)+1)])}return{setValue:{points:os}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyNamesByKey:ss}){let os=[];for(let ls in ns.points)os.push({setDependency:ss[ls].pointChild,desiredValue:ns.points[ls],childIndex:0,variableIndex:0});return{success:!0,instructions:os}}},rs}}zs(PointListComponent,"componentType","_pointListComponent"),zs(PointListComponent,"rendererType","containerInline"),zs(PointListComponent,"renderChildren",!0);class IntervalListComponent extends BaseComponent{static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss}){let os=breakEmbeddedStringsIntoIntervalPieces({componentList:ss});return os.success!==!0?{success:!1}:{success:!0,newChildren:os.pieces.map(function(ls){return ls.length>1||typeof ls[0]=="string"?{componentType:"interval",children:ls}:ls[0]})}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"intervals",componentTypes:["interval"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.nIntervals={returnDependencies:()=>({intervalChildren:{dependencyType:"child",childGroups:["intervals"],skipComponentNames:!0}}),definition:function({dependencyValues:ns}){return{setValue:{nIntervals:ns.intervalChildren.length},checkForActualChange:{nIntervals:!0}}}},rs.intervals={isArray:!0,nDimensions:1,entryPrefixes:["interval"],returnArraySizeDependencies:()=>({nIntervals:{dependencyType:"stateVariable",variableName:"nIntervals"}}),returnArraySize({dependencyValues:ns}){return[ns.nIntervals]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={};for(let os of ns)ss[os]={intervalChild:{dependencyType:"child",childGroups:["intervals"],variableNames:["value"],childIndices:[os]}};return{dependenciesByKey:ss}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={};for(let ls of ss){let us=ns[ls].intervalChild[0];us&&(os[ls]=us.stateValues.value)}return{setValue:{intervals:os}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,dependencyNamesByKey:ss}){let os=[];for(let ls in ns.intervals)os.push({setDependency:ss[ls].intervalChild,desiredValue:ns.intervals[ls],childIndex:0,variableIndex:0});return{success:!0,instructions:os}}},rs}}zs(IntervalListComponent,"componentType","_intervalListComponent"),zs(IntervalListComponent,"rendererType","containerInline"),zs(IntervalListComponent,"renderChildren",!0);function breakEmbeddedStringsIntoIntervalPieces({componentList:as}){let rs=0,ns=[],ss=[];for(let os of as){if(typeof os!="string"){if(rs===0)return{success:!1};ss.push(os);continue}let ls=os.trim(),us=0;for(let cs=0;csus){let ps=cs+1,fs=ls.substring(us,ps).trim();fs.length>0&&ss.push(fs)}ns.push(ss),ss=[],us=cs+1}rs--}else if(rs===0&&!ds.match(/\s/))return{success:!1}}if(ls.length>us){let cs=ls.substring(us,ls.length).trim();ss.push(cs)}}return rs!==0?{success:!1}:ss.length>0?{success:!1}:{success:!0,pieces:ns}}class LineListComponent extends BaseComponent{static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss}){return{success:!0,newChildren:ss.reduce(function(ls,us){return typeof us=="string"?[...ls,...us.split(/\s+/).filter(cs=>cs).map(cs=>({componentType:"line",children:[cs]}))]:[...ls,us]},[])}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"lines",componentTypes:["line"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.nLines={returnDependencies:()=>({lineChildren:{dependencyType:"child",childGroups:["lines"],skipComponentNames:!0}}),definition:function({dependencyValues:ns}){return{setValue:{nLines:ns.lineChildren.length},checkForActualChange:{nLines:!0}}}},rs.lineNames={isArray:!0,entryPrefixes:["lineName"],returnArraySizeDependencies:()=>({nLines:{dependencyType:"stateVariable",variableName:"nLines"}}),returnArraySize({dependencyValues:ns}){return[ns.nLines]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={};for(let os of ns)ss[os]={lineChild:{dependencyType:"child",childGroups:["lines"],childIndices:[os]}};return{dependenciesByKey:ss}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={};for(let ls of ss){let us=ns[ls].lineChild[0];us&&(os[ls]=us.componentName)}return{setValue:{lineNames:os}}}},rs}}zs(LineListComponent,"componentType","_lineListComponent"),zs(LineListComponent,"rendererType","containerInline"),zs(LineListComponent,"renderChildren",!0);class AngleListComponent extends BaseComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.hide={default:!0},rs}static returnChildLogic(rs){let ns=super.returnChildLogic(rs),ss=ns.newLeaf({name:"AtLeastZeroAngles",componentType:"angle",comparison:"atLeast",number:0}),os=breakStringsAndOthersIntoComponentsByStringCommas(),ls=ns.newLeaf({name:"AtLeastOneString",componentType:"string",comparison:"atLeast",number:1}),us=ns.newLeaf({name:"AtLeastOneMath",componentType:"math",comparison:"atLeast",number:1}),cs=ns.newOperator({name:"StringsAndMaths",operator:"or",propositions:[ls,us],requireConsecutive:!0,isSugar:!0,replacementFunction:os});return ns.newOperator({name:"AnglesXorSugar",operator:"xor",propositions:[ss,cs],setAsBase:!0}),ns}updateState(rs={}){if(rs.init&&(this._state.angles={trackChanges:!0}),super.updateState(rs),!this.childLogicSatisfied){this.unresolvedState.angles=!0,this.unresolvedState.nAngles=!0;return}if(this.currentTracker.trackChanges.childrenChanged(this.componentName)){delete this.unresolvedState.angles,delete this.unresolvedState.nAngles;let os=this.childLogic.returnMatches("AtLeastZeroAngles");this.state.nAngles=os.length,this.state.angles=os.map(ls=>this.activeChildren[ls])}}initializeRenderer(){this.renderer===void 0&&(this.renderer=new this.availableRenderers.container({key:this.componentName}))}updateChildrenWhoRender(){this.childrenWhoRender=this.state.angles.map(rs=>rs.componentName)}}zs(AngleListComponent,"componentType","_angleListComponent");class Vector extends GraphicalComponent{constructor(rs){super(rs),Object.assign(this.actions,{moveVector:this.moveVector.bind(this),vectorClicked:this.vectorClicked.bind(this),mouseDownOnVector:this.mouseDownOnVector.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.headDraggable={createComponentOfType:"boolean"},rs.tailDraggable={createComponentOfType:"boolean"},rs.x={createComponentOfType:"math"},rs.y={createComponentOfType:"math"},rs.z={createComponentOfType:"math"},rs.xs={createComponentOfType:"mathList"},rs.displacement={createComponentOfType:"vector"},rs.head={createComponentOfType:"point"},rs.tail={createComponentOfType:"point"},rs.displayDigits={createComponentOfType:"integer",createStateVariable:"displayDigits",defaultValue:10,public:!0},rs.displayDecimals={createComponentOfType:"integer",createStateVariable:"displayDecimals",defaultValue:null,public:!0},rs.displaySmallAsZero={createComponentOfType:"number",createStateVariable:"displaySmallAsZero",valueForTrue:1e-14,valueForFalse:0,defaultValue:0,public:!0},rs.padZeros={createComponentOfType:"boolean",createStateVariable:"padZeros",defaultValue:!1,public:!0},rs.displayWithAngleBrackets={createComponentOfType:"boolean",createStateVariable:"displayWithAngleBrackets",defaultValue:!1,public:!0},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss,componentInfoObjects:os}){let us=returnBreakStringsSugarFunction({childrenToComponentFunction:gs=>({componentType:"math",children:gs}),mustStripOffOuterParentheses:!0}),cs=ss.map(gs=>typeof gs),ds=cs.indexOf("string"),ps=cs.lastIndexOf("string");if(ds===-1){let gs=os.componentIsSpecifiedType,ys=ss.filter(bs=>!(gs(bs,"point")||gs(bs,"vector")||gs(bs,"label")));if(ys.length===1){let bs=ys[0],vs=ss.indexOf(bs),xs=[...ss.slice(0,vs),...ss.slice(vs+1)];return{success:!0,newAttributes:{displacement:{component:{componentType:"math",children:ys}}},newChildren:xs}}else return{success:!1}}let fs=[...ss.slice(0,ds),...ss.slice(ps+1)];ss=ss.slice(ds,ps+1);let hs=us({matchedChildren:ss});return!hs.success&&ss.length===1?{success:!0,newAttributes:{x:{component:{componentType:"math",children:ss}}},newChildren:fs}:hs.success?{success:!0,newAttributes:{xs:{component:{componentType:"mathList",children:hs.newChildren,skipSugar:!0}}},newChildren:fs}:{success:!1}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){let rs=super.returnChildGroups();return rs.push({group:"points",componentTypes:["point"]},{group:"vectors",componentTypes:["vector"]}),rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.styleDescription={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ns}){var ls;let ss;((ls=ns.document)==null?void 0:ls.stateValues.theme)==="dark"?ss=ns.selectedStyle.lineColorWordDarkMode:ss=ns.selectedStyle.lineColorWord;let os=ns.selectedStyle.lineWidthWord;return ns.selectedStyle.lineStyleWord&&(os&&(os+=" "),os+=ns.selectedStyle.lineStyleWord),os&&(os+=" "),os+=ss,{setValue:{styleDescription:os}}}},rs.styleDescriptionWithNoun={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({styleDescription:{dependencyType:"stateVariable",variableName:"styleDescription"}}),definition:function({dependencyValues:ns}){return{setValue:{styleDescriptionWithNoun:ns.styleDescription+" vector"}}}},rs.tailDraggable={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},hasEssential:!0,forRenderer:!0,returnDependencies:()=>({tailDraggableAttr:{dependencyType:"attributeComponent",attributeName:"tailDraggable",variableNames:["value"]},draggable:{dependencyType:"stateVariable",variableName:"draggable"}}),definition({dependencyValues:ns}){return ns.tailDraggableAttr?{setValue:{tailDraggable:ns.tailDraggableAttr.stateValues.value}}:{useEssentialOrDefaultValue:{tailDraggable:{defaultValue:ns.draggable}}}}},rs.headDraggable={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},hasEssential:!0,forRenderer:!0,returnDependencies:()=>({headDraggableAttr:{dependencyType:"attributeComponent",attributeName:"headDraggable",variableNames:["value"]},draggable:{dependencyType:"stateVariable",variableName:"draggable"}}),definition({dependencyValues:ns}){return ns.headDraggableAttr?{setValue:{headDraggable:ns.headDraggableAttr.stateValues.value}}:{useEssentialOrDefaultValue:{headDraggable:{defaultValue:ns.draggable}}}}},rs.displacementShadow={defaultValue:null,hasEssential:!0,essentialVarName:"displacement",set:convertValueToMathExpression,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{displacementShadow:!0}}),inverseDefinition:function({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setEssentialValue:"displacementShadow",value:convertValueToMathExpression(ns.displacementShadow)}]}}},rs.headShadow={defaultValue:null,hasEssential:!0,essentialVarName:"head",set:convertValueToMathExpression,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{headShadow:!0}}),inverseDefinition:function({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setEssentialValue:"headShadow",value:convertValueToMathExpression(ns.headShadow)}]}}},rs.tailShadow={defaultValue:null,hasEssential:!0,essentialVarName:"tail",set:convertValueToMathExpression,returnDependencies:()=>({}),definition:()=>({useEssentialOrDefaultValue:{tailShadow:!0}}),inverseDefinition:function({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setEssentialValue:"tailShadow",value:convertValueToMathExpression(ns.tailShadow)}]}}},rs.sourceOfDisplacement={returnDependencies:()=>({xAttr:{dependencyType:"attributeComponent",attributeName:"x"},yAttr:{dependencyType:"attributeComponent",attributeName:"y"},zAttr:{dependencyType:"attributeComponent",attributeName:"z"},xsAttr:{dependencyType:"attributeComponent",attributeName:"xs"},displacementAttr:{dependencyType:"attributeComponent",attributeName:"displacement"},pointChild:{dependencyType:"child",childGroups:["points"]},vectorChild:{dependencyType:"child",childGroups:["vectors"]}}),definition({dependencyValues:ns}){let ss=null;return ns.vectorChild.length>0?ss="vectorChild":ns.pointChild.length>0?ss="pointChild":ns.displacementAttr!==null?ss="displacementAttr":ns.xsAttr!==null?ss="xsAttr":(ns.xAttr!==null||ns.yAttr!==null||ns.zAttr!==null)&&(ss="componentAttrs"),{setValue:{sourceOfDisplacement:ss}}}},rs.basedOnHead={returnDependencies:()=>({headAttr:{dependencyType:"attributeComponent",attributeName:"head"},headShadow:{dependencyType:"stateVariable",variableName:"headShadow"},tailAttr:{dependencyType:"attributeComponent",attributeName:"tail"},sourceOfDisplacement:{dependencyType:"stateVariable",variableName:"sourceOfDisplacement"}}),definition:function({dependencyValues:ns}){return ns.tailAttr!==null&&ns.sourceOfDisplacement!==null?(ns.headAttr!==null&&console.warn("Vector is prescribed by head, tail, and displacement. Ignoring specified head."),{setValue:{basedOnHead:!1},checkForActualChange:{basedOnHead:!0}}):ns.headAttr!==null?{setValue:{basedOnHead:!0},checkForActualChange:{basedOnHead:!0}}:{setValue:{basedOnHead:ns.headShadow!==null},checkForActualChange:{basedOnHead:!0}}}},rs.basedOnTail={returnDependencies:()=>({tailAttr:{dependencyType:"attributeComponent",attributeName:"tail"},tailShadow:{dependencyType:"stateVariable",variableName:"tailShadow"}}),definition:function({dependencyValues:ns}){return ns.tailAttr!==null?{setValue:{basedOnTail:!0},checkForActualChange:{basedOnTail:!0}}:{setValue:{basedOnTail:ns.tailShadow!==null},checkForActualChange:{basedOnTail:!0}}}},rs.basedOnDisplacement={returnDependencies:()=>({sourceOfDisplacement:{dependencyType:"stateVariable",variableName:"sourceOfDisplacement"},displacementShadow:{dependencyType:"stateVariable",variableName:"displacementShadow"}}),definition:function({dependencyValues:ns}){return ns.sourceOfDisplacement!==null?{setValue:{basedOnDisplacement:!0},checkForActualChange:{basedOnDisplacement:!0}}:{setValue:{basedOnDisplacement:ns.displacementShadow!==null},checkForActualChange:{basedOnDisplacement:!0}}}},rs.nDimDisplacement={stateVariablesDeterminingDependencies:["basedOnDisplacement","basedOnHead","basedOnTail"],returnDependencies({stateValues:ns}){let ss={basedOnHead:{dependencyType:"stateVariable",variableName:"basedOnHead"},basedOnTail:{dependencyType:"stateVariable",variableName:"basedOnTail"},basedOnDisplacement:{dependencyType:"stateVariable",variableName:"basedOnDisplacement"},sourceOfDisplacement:{dependencyType:"stateVariable",variableName:"sourceOfDisplacement"},displacementShadow:{dependencyType:"stateVariable",variableName:"displacementShadow"},displacementAttr:{dependencyType:"attributeComponent",attributeName:"displacement",variableNames:["nDimensions"]},vectorChild:{dependencyType:"child",childGroups:["vectors"],variableNames:["nDimensions"]},pointChild:{dependencyType:"child",childGroups:["points"],variableNames:["nDimensions"]},xAttr:{dependencyType:"attributeComponent",attributeName:"x"},yAttr:{dependencyType:"attributeComponent",attributeName:"y"},zAttr:{dependencyType:"attributeComponent",attributeName:"z"},xsAttr:{dependencyType:"attributeComponent",attributeName:"xs",variableNames:["nComponents"]}};return ns.basedOnDisplacement||(ns.basedOnHead&&(ss.nDimHead={dependencyType:"stateVariable",variableName:"nDimHead"}),ns.basedOnTail&&(ss.nDimTail={dependencyType:"stateVariable",variableName:"nDimTail"})),ss},definition:function({dependencyValues:ns}){let ss;if(ns.basedOnDisplacement)switch(ns.sourceOfDisplacement){case"vectorChild":ss=ns.vectorChild[0].stateValues.nDimensions;break;case"pointChild":ss=ns.pointChild[0].stateValues.nDimensions;break;case"displacementAttr":ss=ns.displacementAttr.stateValues.nDimensions;break;case"xsAttr":ss=ns.xsAttr.stateValues.nComponents;break;case"componentAttrs":ns.zAttr!==null?ss=3:ns.yAttr!==null?ss=2:ss=1;break;default:let os=ns.displacementShadow.tree;Array.isArray(os)&&vectorOperators.includes(os[0])?ss=os.length-1:ss=1}else ns.basedOnHead?ns.basedOnTail?ns.nDimHead===ns.nDimTail?ss=ns.nDimHead:ss=NaN:ss=ns.nDimHead:ns.basedOnTail?ss=ns.nDimTail:ss=2;return{setValue:{nDimDisplacement:ss},checkForActualChange:{nDimDisplacement:!0}}}},rs.nDimHead={stateVariablesDeterminingDependencies:["basedOnDisplacement","basedOnHead","basedOnTail"],returnDependencies({stateValues:ns}){let ss={basedOnHead:{dependencyType:"stateVariable",variableName:"basedOnHead"},basedOnTail:{dependencyType:"stateVariable",variableName:"basedOnTail"},basedOnDisplacement:{dependencyType:"stateVariable",variableName:"basedOnDisplacement"},headShadow:{dependencyType:"stateVariable",variableName:"headShadow"},headAttr:{dependencyType:"attributeComponent",attributeName:"head",variableNames:["nDimensions"]}};return ns.basedOnHead||(ns.basedOnTail&&(ss.nDimTail={dependencyType:"stateVariable",variableName:"nDimTail"}),ns.basedOnDisplacement&&(ss.nDimDisplacement={dependencyType:"stateVariable",variableName:"nDimDisplacement"})),ss},definition:function({dependencyValues:ns}){let ss;if(ns.basedOnHead){if(ns.headAttr!==null)ss=ns.headAttr.stateValues.nDimensions;else if(ns.headShadow){let os=ns.headShadow.tree;Array.isArray(os)&&vectorOperators.includes(os[0])?ss=os.length-1:ss=2}}else ns.basedOnDisplacement?ns.basedOnTail?ns.nDimDisplacement===ns.nDimTail?ss=ns.nDimDisplacement:ss=NaN:ss=ns.nDimDisplacement:ns.basedOnTail?ss=ns.nDimTail:ss=2;return{setValue:{nDimHead:ss},checkForActualChange:{nDimHead:!0}}}},rs.nDimTail={stateVariablesDeterminingDependencies:["basedOnDisplacement","basedOnHead","basedOnTail"],returnDependencies({stateValues:ns}){let ss={basedOnHead:{dependencyType:"stateVariable",variableName:"basedOnHead"},basedOnTail:{dependencyType:"stateVariable",variableName:"basedOnTail"},basedOnDisplacement:{dependencyType:"stateVariable",variableName:"basedOnDisplacement"},tailShadow:{dependencyType:"stateVariable",variableName:"tailShadow"},tailAttr:{dependencyType:"attributeComponent",attributeName:"tail",variableNames:["nDimensions"]}};return ns.basedOnTail||(ns.basedOnHead&&(ss.nDimHead={dependencyType:"stateVariable",variableName:"nDimHead"}),ns.basedOnDisplacement&&(ss.nDimDisplacement={dependencyType:"stateVariable",variableName:"nDimDisplacement"})),ss},definition:function({dependencyValues:ns}){let ss;if(ns.basedOnTail){if(ns.tailAttr!==null)ss=ns.tailAttr.stateValues.nDimensions;else if(ns.tailShadow){let os=ns.tailShadow.tree;Array.isArray(os)&&vectorOperators.includes(os[0])?ss=os.length-1:ss=2}}else ns.basedOnDisplacement?ns.basedOnHead?ns.nDimDisplacement===ns.nDimHead?ss=ns.nDimDisplacement:ss=NaN:ss=ns.nDimDisplacement:ns.basedOnHead?ss=ns.nDimHead:ss=2;return{setValue:{nDimTail:ss},checkForActualChange:{nDimTail:!0}}}},rs.nDimensions={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({basedOnHead:{dependencyType:"stateVariable",variableName:"basedOnHead"},basedOnTail:{dependencyType:"stateVariable",variableName:"basedOnTail"},basedOnDisplacement:{dependencyType:"stateVariable",variableName:"basedOnDisplacement"},nDimDisplacement:{dependencyType:"stateVariable",variableName:"nDimDisplacement"},nDimHead:{dependencyType:"stateVariable",variableName:"nDimHead"},nDimTail:{dependencyType:"stateVariable",variableName:"nDimTail"}}),definition:function({dependencyValues:ns}){let ss;if(ns.basedOnDisplacement){if(ns.basedOnTail){if(ns.nDimDisplacement!==ns.nDimTail)return console.warn("nDimensions mismatch in vector"),{setValue:{nDimensions:NaN}}}else if(ns.basedOnHead&&ns.nDimDisplacement!==ns.nDimHead)return console.warn("nDimensions mismatch in vector"),{setValue:{nDimensions:NaN}};ss=ns.nDimDisplacement}else if(ns.basedOnTail){if(ns.basedOnHead&&ns.nDimTail!==ns.nDimHead)return console.warn("nDimensions mismatch in vector"),{setValue:{nDimensions:NaN}};ss=ns.nDimTail}else ns.basedOnHead?ss=ns.nDimHead:ss=2;return{setValue:{nDimensions:ss},checkForActualChange:{nDimensions:!0}}}},rs.displacement={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros","displayWithAngleBrackets"],returnWrappingComponents(ns){return ns==="x"?[]:[["vector",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,entryPrefixes:["x"],hasEssential:!0,essentialVarName:"displacement2",set:convertValueToMathExpression,stateVariablesDeterminingDependencies:["basedOnDisplacement","basedOnHead","sourceOfDisplacement"],returnArraySizeDependencies:()=>({nDimDisplacement:{dependencyType:"stateVariable",variableName:"nDimDisplacement"}}),returnArraySize({dependencyValues:ns}){return[ns.nDimDisplacement]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={basedOnHead:{dependencyType:"stateVariable",variableName:"basedOnHead"},basedOnTail:{dependencyType:"stateVariable",variableName:"basedOnTail"},basedOnDisplacement:{dependencyType:"stateVariable",variableName:"basedOnDisplacement"},displacementShadow:{dependencyType:"stateVariable",variableName:"displacementShadow"},sourceOfDisplacement:{dependencyType:"stateVariable",variableName:"sourceOfDisplacement"}},ls={};for(let us of ns){let cs=Number(us)+1;ls[us]={xsAttr:{dependencyType:"attributeComponent",attributeName:"xs",variableNames:["math"+cs]},displacementAttr:{dependencyType:"attributeComponent",attributeName:"displacement",variableNames:["x"+cs]},pointChild:{dependencyType:"child",childGroups:["points"],variableNames:["x"+cs]},vectorChild:{dependencyType:"child",childGroups:["vectors"],variableNames:["x"+cs]}},us==="0"?ls[us].componentAttr={dependencyType:"attributeComponent",attributeName:"x",variableNames:["value"]}:us==="1"?ls[us].componentAttr={dependencyType:"attributeComponent",attributeName:"y",variableNames:["value"]}:us==="2"&&(ls[us].componentAttr={dependencyType:"attributeComponent",attributeName:"z",variableNames:["value"]}),!ss.basedOnDisplacement&&ss.basedOnHead&&(ls[us].tailX={dependencyType:"stateVariable",variableName:"tailX"+cs},ls[us].headX={dependencyType:"stateVariable",variableName:"headX"+cs})}return{globalDependencies:os,dependenciesByKey:ls}},arrayDefinitionByKey:function({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os}){let ls={},us={};for(let ds of os){let ps=Number(ds)+1;if(ns.basedOnDisplacement)switch(ns.sourceOfDisplacement){case"vectorChild":ls[ds]=ss[ds].vectorChild[0].stateValues["x"+ps];break;case"pointChild":ls[ds]=ss[ds].pointChild[0].stateValues["x"+ps];break;case"displacementAttr":ls[ds]=ss[ds].displacementAttr.stateValues["x"+ps];break;case"xsAttr":ls[ds]=ss[ds].xsAttr.stateValues["math"+ps].simplify();break;case"componentAttrs":let fs=ss[ds].componentAttr;fs===null?us[ds]={defaultValue:Context.fromAst(0)}:ls[ds]=fs.stateValues.value.simplify();break;default:let hs=ns.displacementShadow.tree;Array.isArray(hs)&&vectorOperators.includes(hs[0])?ls[ds]=ns.displacementShadow.get_component(Number(ds)):ls[ds]=ns.displacementShadow}else ns.basedOnHead?ls[ds]=ss[ds].headX.subtract(ss[ds].tailX).simplify():us[ds]={defaultValue:Context.fromAst(ds==="0"?1:0)}}let cs={};return Object.keys(ls).length>0&&(cs.setValue={displacement:ls}),Object.keys(us).length>0&&(cs.useEssentialOrDefaultValue={displacement:us}),cs},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,arraySize:us}){let cs=[],ds=!1;for(let ps in ns.displacement)if(ss.basedOnDisplacement)switch(ss.sourceOfDisplacement){case"vectorChild":cs.push({setDependency:ls[ps].vectorChild,desiredValue:ns.displacement[ps],childIndex:0,variableIndex:0});break;case"pointChild":cs.push({setDependency:ls[ps].pointChild,desiredValue:ns.displacement[ps],childIndex:0,variableIndex:0});break;case"displacementAttr":cs.push({setDependency:ls[ps].displacementAttr,desiredValue:ns.displacement[ps],variableIndex:0});break;case"xsAttr":cs.push({setDependency:ls[ps].xsAttr,desiredValue:ns.displacement[ps],variableIndex:0});break;case"componentAttrs":os[ps].componentAttr===null?cs.push({setEssentialValue:"displacement",value:{[ps]:convertValueToMathExpression(ns.displacement[ps])}}):cs.push({setDependency:ls[ps].componentAttr,desiredValue:ns.displacement[ps],variableIndex:0});break;default:ds=!0}else ss.basedOnHead?cs.push({setDependency:ls[ps].headX,desiredValue:os[ps].tailX.add(ns.displacement[ps]).simplify()}):cs.push({setEssentialValue:"displacement",value:{[ps]:convertValueToMathExpression(ns.displacement[ps])}});if(ds)if(us[0]>1){let ps=["vector"];for(let fs in ns.displacement)ps[Number(fs)+1]=ns.displacement[fs].tree;ps.length=us[0]+1,cs.push({setDependency:"displacementShadow",desiredValue:Context.fromAst(ps)})}else us[0]===1&&"0"in ns.displacement&&cs.push({setDependency:"displacementShadow",desiredValue:ns.displacement[0]});return{success:!0,instructions:cs}}},rs.x={isAlias:!0,targetVariableName:"x1"},rs.y={isAlias:!0,targetVariableName:"x2"},rs.z={isAlias:!0,targetVariableName:"x3"},rs.head={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"],returnWrappingComponents(ns){return ns==="headX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,entryPrefixes:["headX"],set:convertValueToMathExpression,stateVariablesDeterminingDependencies:["basedOnHead"],returnArraySizeDependencies:()=>({nDimHead:{dependencyType:"stateVariable",variableName:"nDimHead"}}),returnArraySize({dependencyValues:ns}){return[ns.nDimHead]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={basedOnDisplacement:{dependencyType:"stateVariable",variableName:"basedOnDisplacement"},basedOnTail:{dependencyType:"stateVariable",variableName:"basedOnTail"},basedOnHead:{dependencyType:"stateVariable",variableName:"basedOnHead"},headShadow:{dependencyType:"stateVariable",variableName:"headShadow"}},ls={};for(let us of ns){let cs=Number(us)+1;ls[us]={headAttr:{dependencyType:"attributeComponent",attributeName:"head",variableNames:["x"+cs]}},ss.basedOnHead||(ls[us].tailX={dependencyType:"stateVariable",variableName:"tailX"+cs},ls[us].x={dependencyType:"stateVariable",variableName:"x"+cs})}return{globalDependencies:os,dependenciesByKey:ls}},arrayDefinitionByKey:function({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os}){let ls={};for(let us of os){let cs=Number(us)+1;ns.basedOnHead?ss[us].headAttr!==null?ls[us]=ss[us].headAttr.stateValues["x"+cs]:ns.headShadow!==null&&(ls[us]=ns.headShadow.get_component(Number(us))):ls[us]=ss[us].tailX.add(ss[us].x).simplify()}return{setValue:{head:ls}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,arraySize:us}){let cs=[],ds=!1;for(let ps in ns.head)ss.basedOnHead?os[ps].headAttr&&os[ps].headAttr!==null?cs.push({setDependency:ls[ps].headAttr,desiredValue:ns.head[ps],variableIndex:0}):ss.headShadow!==null&&(ds=!0):cs.push({setDependency:ls[ps].x,desiredValue:ns.head[ps].subtract(os[ps].tailX).simplify()});if(ds)if(us[0]>1){let ps=["vector"];for(let fs in ns.head)ps[Number(fs)+1]=ns.head[fs].tree;ps.length=us[0]+1,cs.push({setDependency:"headShadow",desiredValue:Context.fromAst(ps)})}else us[0]===1&&"0"in ns.head&&cs.push({setDependency:"headShadow",desiredValue:ns.head[0]});return{success:!0,instructions:cs}}},rs.tail={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"],returnWrappingComponents(ns){return ns==="tailX"?[]:[["point",{componentType:"mathList",isAttribute:"xs"}]]}},isArray:!0,entryPrefixes:["tailX"],hasEssential:!0,defaultValueByArrayKey:()=>Context.fromAst(0),essentialVarName:"tail2",set:convertValueToMathExpression,stateVariablesDeterminingDependencies:["basedOnTail","basedOnHead","basedOnDisplacement"],returnArraySizeDependencies:()=>({nDimTail:{dependencyType:"stateVariable",variableName:"nDimTail"}}),returnArraySize({dependencyValues:ns}){return[ns.nDimTail]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={basedOnDisplacement:{dependencyType:"stateVariable",variableName:"basedOnDisplacement"},basedOnHead:{dependencyType:"stateVariable",variableName:"basedOnHead"},tailShadow:{dependencyType:"stateVariable",variableName:"tailShadow"}},ls={};for(let us of ns){let cs=Number(us)+1;ls[us]={tailAttr:{dependencyType:"attributeComponent",attributeName:"tail",variableNames:["x"+cs]}},ss.basedOnTail||ss.basedOnHead&&ss.basedOnDisplacement&&(ls[us].headX={dependencyType:"stateVariable",variableName:"headX"+cs},ls[us].x={dependencyType:"stateVariable",variableName:"x"+cs})}return{globalDependencies:os,dependenciesByKey:ls}},arrayDefinitionByKey:function({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os}){let ls={},us={};for(let ds of os){let ps=Number(ds)+1;ss[ds].tailAttr!==null?ls[ds]=ss[ds].tailAttr.stateValues["x"+ps]:ns.tailShadow!==null?ls[ds]=ns.tailShadow.get_component(Number(ds)):ns.basedOnHead&&ns.basedOnDisplacement?ls[ds]=ss[ds].headX.subtract(ss[ds].x).simplify():us[ds]=!0}let cs={};return Object.keys(ls).length>0&&(cs.setValue={tail:ls}),Object.keys(us).length>0&&(cs.useEssentialOrDefaultValue={tail:us}),cs},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,arraySize:us}){let cs=[],ds=!1;for(let ps in ns.tail)os[ps].tailAttr&&os[ps].tailAttr!==null?cs.push({setDependency:ls[ps].tailAttr,desiredValue:ns.tail[ps],variableIndex:0}):ss.tailShadow!==null?ds=!0:ss.basedOnHead&&ss.basedOnDisplacement?cs.push({setDependency:ls[ps].x,desiredValue:os[ps].headX.subtract(ns.tail[ps]).simplify()}):cs.push({setEssentialValue:"tail",value:{[ps]:convertValueToMathExpression(ns.tail[ps])}});if(ds)if(us[0]>1){let ps=["vector"];for(let fs in ns.tail)ps[Number(fs)+1]=ns.tail[fs].tree;ps.length=us[0]+1,cs.push({setDependency:"tailShadow",desiredValue:Context.fromAst(ps)})}else us[0]===1&&"0"in ns.tail&&cs.push({setDependency:"tailShadow",desiredValue:ns.tail[0]});return{success:!0,instructions:cs}}},rs.magnitude={public:!0,shadowingInstructions:{createComponentOfType:"math"},returnDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},displacement:{dependencyType:"stateVariable",variableName:"displacement"}}),definition({dependencyValues:ns}){let ss=0,os=!0;for(let ls=0;lsfs/cs);let ds=ns.magnitude.evaluate_to_constant();if(!Number.isFinite(ds)||ds<0)return{success:!1};let ps=[];for(let fs=0;fs({head:{dependencyType:"stateVariable",variableName:"head"},tail:{dependencyType:"stateVariable",variableName:"tail"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"}}),definition:function({dependencyValues:ns}){let ss,os;if(ns.nDimensions===1)ss=ns.head[0].evaluate_to_constant(),os=ns.tail[0].evaluate_to_constant();else{ss=[],os=[];for(let ls=0;ls({displacement:{dependencyType:"stateVariable",variableName:"displacement"},displayWithAngleBrackets:{dependencyType:"stateVariable",variableName:"displayWithAngleBrackets"}}),definition({dependencyValues:ns}){let ss=[];for(let os of ns.displacement)os?ss.push(os.tree):ss.push("_");return ss.length>1?ss=[ns.displayWithAngleBrackets?"altvector":"vector",...ss]:ss.length===1?ss=ss[0]:ss="_",{setValue:{displacementCoords:Context.fromAst(ss)}}},inverseDefinition({desiredStateVariableValues:ns}){let ss=ns.displacementCoords.tree,os;return Array.isArray(ss)&&vectorOperators.includes(ss[0])?os=ss.slice(1).map(ls=>Context.fromAst(ls)):os=[ns.displacementCoords],{success:!0,instructions:[{setDependency:"displacement",desiredValue:os}]}}},rs.latex={forRenderer:!0,public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({displacementCoords:{dependencyType:"stateVariable",variableName:"displacementCoords"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"},padZeros:{dependencyType:"stateVariable",variableName:"padZeros"}}),definition:function({dependencyValues:ns,usedDefault:ss}){let os={};return ns.padZeros&&(ss.displayDigits&&!ss.displayDecimals?Number.isFinite(ns.displayDecimals)&&(os.padToDecimals=ns.displayDecimals):ns.displayDigits>=1&&(os.padToDigits=ns.displayDigits)),{setValue:{latex:roundForDisplay({value:ns.displacementCoords,dependencyValues:ns,usedDefault:ss}).toLatex(os)}}}},rs.nearestPoint={returnDependencies:()=>({nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},numericalEndpoints:{dependencyType:"stateVariable",variableName:"numericalEndpoints"}}),definition({dependencyValues:ns}){var ps,fs,hs,gs;let ss=(ps=ns.numericalEndpoints[0])==null?void 0:ps[0],os=(fs=ns.numericalEndpoints[0])==null?void 0:fs[1],ls=(hs=ns.numericalEndpoints[1])==null?void 0:hs[0],us=(gs=ns.numericalEndpoints[1])==null?void 0:gs[1],cs=Number.isFinite(ss)&&Number.isFinite(os)&&Number.isFinite(ls)&&Number.isFinite(us),ds=ns.nDimensions!==2||!cs||ls===ss&&us===os;return{setValue:{nearestPoint:function({variables:ys,scales:bs}){if(ds)return{};let vs=bs[0],xs=bs[1],Cs=(ls-ss)/vs,Ts=(us-os)/xs,Ss=Cs*Cs+Ts*Ts,Ns=((ys.x1-ss)/vs*Cs+(ys.x2-os)/xs*Ts)/Ss,As={};return Ns<=0?As={x1:ss,x2:os}:Ns>=1?As={x1:ls,x2:us}:As={x1:ss+Ns*Cs*vs,x2:os+Ns*Ts*xs},ys.x3!==void 0&&(As.x3=0),As}}}}},rs}async moveVector({tailcoords:rs,headcoords:ns,transient:ss,skippable:os,sourceDetails:ls,actionId:us,sourceInformation:cs={},skipRendererUpdate:ds=!1}){if(rs!==void 0){if(ns!==void 0){if(!await this.stateValues.draggable)return await this.coreFunctions.resolveAction({actionId:us})}else if(!await this.stateValues.tailDraggable)return await this.coreFunctions.resolveAction({actionId:us})}else if(!await this.stateValues.headDraggable)return await this.coreFunctions.resolveAction({actionId:us});let ps=[];if(rs!==void 0){if(await this.stateValues.basedOnHead&&await this.stateValues.basedOnDisplacement){let fs;if(ns===void 0){let hs=await this.stateValues.numericalEndpoints;fs=rs.map((gs,ys)=>hs[1][ys]-gs)}else fs=rs.map((hs,gs)=>ns[gs]-hs);ps.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"displacement",value:fs.map(hs=>Context.fromAst(hs)),sourceDetails:ls})}else ps.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"tail",value:rs.map(fs=>Context.fromAst(fs)),sourceDetails:ls});if(ns===void 0&&!await this.stateValues.basedOnHead){let fs=await this.stateValues.numericalEndpoints,hs=rs.map((gs,ys)=>fs[1][ys]-gs);ps.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"displacement",value:hs.map(gs=>Context.fromAst(gs)),sourceDetails:ls})}}if(ns!==void 0){if(await this.stateValues.basedOnHead)ps.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"head",value:ns.map(fs=>Context.fromAst(fs)),sourceDetails:ls});else{rs==null&&(rs=(await this.stateValues.numericalEndpoints)[0]);let fs=rs.map((hs,gs)=>ns[gs]-hs);ps.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"displacement",value:fs.map(hs=>Context.fromAst(hs)),sourceDetails:ls})}if(rs===void 0&&await this.stateValues.basedOnHead&&await this.stateValues.basedOnDisplacement){let fs=await this.stateValues.numericalEndpoints,hs=ns.map((gs,ys)=>gs-fs[0][ys]);ps.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"displacement",value:hs.map(gs=>Context.fromAst(gs)),sourceDetails:ls})}}return ss?await this.coreFunctions.performUpdate({updateInstructions:ps,transient:ss,skippable:os,actionId:us,sourceInformation:cs,skipRendererUpdate:ds}):await this.coreFunctions.performUpdate({updateInstructions:ps,actionId:us,sourceInformation:cs,skipRendererUpdate:ds,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{head:ns,tail:rs}}})}async vectorClicked({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){await this.coreFunctions.triggerChainedActions({triggeringAction:"click",componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss}),this.coreFunctions.resolveAction({actionId:rs})}async mouseDownOnVector({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){await this.coreFunctions.triggerChainedActions({triggeringAction:"down",componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss}),this.coreFunctions.resolveAction({actionId:rs})}}zs(Vector,"componentType","vector"),zs(Vector,"primaryStateVariableForDefinition","displacementShadow"),zs(Vector,"adapters",[{stateVariable:"displacementCoords",componentType:"coords",stateVariablesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]}]);class Angle extends GraphicalComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.draggable={createComponentOfType:"boolean",createStateVariable:"draggable",defaultValue:!0,public:!0,forRenderer:!0},rs.radius={createComponentOfType:"math",createStateVariable:"radius",defaultValue:Context.fromAst(1),public:!0},rs.chooseReflexAngle={createComponentOfType:"text",createStateVariable:"chooseReflexAngle",defaultValue:"never",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["never","allowed","always"]},rs.inDegrees={createComponentOfType:"boolean",createStateVariable:"inDegrees",defaultValue:!1,public:!0,forRenderer:!0},rs.radians={createComponentOfType:"math"},rs.degrees={createComponentOfType:"math"},rs.through={createComponentOfType:"_pointListComponent"},rs.betweenLines={createComponentOfType:"_lineListComponent"},rs.displayDigits={createComponentOfType:"integer"},rs.displayDecimals={createComponentOfType:"integer",createStateVariable:"displayDecimals",defaultValue:null,public:!0},rs.displaySmallAsZero={createComponentOfType:"number",createStateVariable:"displaySmallAsZero",valueForTrue:1e-14,valueForFalse:0,defaultValue:0,public:!0},rs.padZeros={createComponentOfType:"boolean",createStateVariable:"padZeros",defaultValue:!1,public:!0},rs.emphasizeRightAngle={createComponentOfType:"boolean",createStateVariable:"emphasizeRightAngle",defaultValue:!0,public:!0,forRenderer:!0},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss,componentInfoObjects:os}){let ls=ps=>os.componentIsSpecifiedType(ps,"label"),us=ss.map(ls),cs=[],ds=[];if(us.filter(ps=>ps).length===0)cs=ss;else{if(us[0]){let fs=us.indexOf(!1);fs!==-1&&(ds.push(...ss.slice(0,fs)),ss=ss.slice(fs),us=us.slice(fs))}let ps=us.indexOf(!0);ps===-1?cs=ss:(cs=ss.slice(0,ps),ds.push(...ss.slice(ps)))}return cs.length===0?{success:!1}:{success:!0,newAttributes:{radians:{component:{componentType:"math",children:cs}}},newChildren:ds}};return rs.push({replacementFunction:ns}),rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.displayDigits={public:!0,shadowingInstructions:{createComponentOfType:"integer"},hasEssential:!0,defaultValue:10,returnDependencies:()=>({displayDigitsAttr:{dependencyType:"attributeComponent",attributeName:"displayDigits",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]}}),definition({dependencyValues:ns,usedDefault:ss}){if(ns.displayDigitsAttr!==null){let os=ss.displayDigitsAttr,ls=ns.displayDecimalsAttr===null||ss.displayDecimalsAttr;if(!(os||ls)){let us=ns.displayDigitsAttr.shadowDepth;ns.displayDecimalsAttr.shadowDepth({betweenLines:{dependencyType:"attributeComponent",attributeName:"betweenLines"}}),definition({dependencyValues:ns}){let ss=null;return ns.betweenLines!==null&&(ss=ns.betweenLines.componentName),{setValue:{betweenLinesName:ss}}}},rs.nPointsSpecified={returnDependencies:()=>({through:{dependencyType:"attributeComponent",attributeName:"through",variableNames:["nPoints"]}}),definition({dependencyValues:ns}){return ns.through!==null?{setValue:{nPointsSpecified:ns.through.stateValues.nPoints}}:{setValue:{nPointsSpecified:0}}}},rs.points={isArray:!0,nDimensions:2,entryPrefixes:["pointX","point"],stateVariablesDeterminingDependencies:["betweenLinesName"],returnArraySizeDependencies:()=>({}),returnArraySize(){return[3,2]},getArrayKeysFromVarName({arrayEntryPrefix:ns,varEnding:ss,arraySize:os}){if(ns==="pointX"){let ls=ss.split("_").map(us=>Number(us)-1);return ls.length===2&&ls.every((us,cs)=>Number.isInteger(us)&&us>=0)?os?ls.every((us,cs)=>us=0?os?lsls+","+cs):[]:[ls+",0"]:[]}},returnArrayDependenciesByKey({stateValues:ns}){let ss={nPointsSpecified:{dependencyType:"stateVariable",variableName:"nPointsSpecified"},throughAttr:{dependencyType:"attributeComponent",attributeName:"through",variableNames:["points"]},radiansAttr:{dependencyType:"attributeComponent",attributeName:"radians",variableNames:["value"]},degreesAttr:{dependencyType:"attributeComponent",attributeName:"degrees",variableNames:["value"]}};return ns.betweenLinesName!==null&&(ss.lineChildren={dependencyType:"child",parentName:ns.betweenLinesName,childGroups:["lines"],variableNames:["points","nDimensions","coeff0","coeffvar1","coeffvar2","nearestPoint"]}),{globalDependencies:ss}},arrayDefinitionByKey({globalDependencyValues:ns}){if(ns.lineChildren)if(ns.lineChildren.length>2){console.warn(`Cannot define an angle between ${ns.lineChildren.length} line(s)`);let us={};for(let cs=0;cs<3;cs++)for(let ds=0;ds<2;ds++)us[cs+","+ds]=Context.fromAst("_");return{setValue:{points:us}}}else if(ns.lineChildren.length===1){let us=ns.lineChildren[0];if(us.stateValues.nDimensions!==2){let xs={};for(let Cs=0;Cs<3;Cs++)for(let Ts=0;Ts<2;Ts++)xs[Cs+","+Ts]=Context.fromAst("_");return{setValue:{points:xs}}}let cs=us.stateValues.nearestPoint({variables:{x1:Context.fromAst(0),x2:Context.fromAst(0)}}),ds=us.stateValues.points[0][0].evaluate_to_constant(),ps=us.stateValues.points[0][1].evaluate_to_constant(),fs=us.stateValues.points[1][0].evaluate_to_constant(),hs=us.stateValues.points[1][1].evaluate_to_constant(),gs=Math.atan2(hs-ps,fs-ds),ys={"0,0":Context.fromAst(cs.x1+Math.cos(gs)),"0,1":Context.fromAst(cs.x2+Math.sin(gs)),"1,0":Context.fromAst(cs.x1),"1,1":Context.fromAst(cs.x2)},bs=null;if(ns.radiansAttr){if(bs=ns.radiansAttr.stateValues.value.evaluate_to_constant(),!Number.isFinite(bs)){let xs={};return xs["2,0"]=Context.fromAst("_"),xs["2,1"]=Context.fromAst("_"),{setValue:{points:xs}}}}else if(ns.degreesAttr){let xs=ns.degreesAttr.stateValues.value.evaluate_to_constant();if(Number.isFinite(xs))bs=xs/180*Math.PI;else return ys["2,0"]=Context.fromAst("_"),ys["2,1"]=Context.fromAst("_"),{setValue:{points:ys}}}else bs=Math.PI/2;let vs=gs+bs;return ys["2,0"]=Context.fromAst(cs.x1+Math.cos(vs)),ys["2,1"]=Context.fromAst(cs.x2+Math.sin(vs)),{setValue:{points:ys}}}else{let us=ns.lineChildren[0],cs=ns.lineChildren[1],ds=calculateLineIntersection(us,cs);if(ds===void 0){let xs={};for(let Cs=0;Cs<3;Cs++)for(let Ts=0;Ts<2;Ts++)xs[Cs+","+Ts]=Context.fromAst("_");return{setValue:{points:xs}}}let ps=ds,fs=us.stateValues.points[0][0].evaluate_to_constant(),hs=us.stateValues.points[0][1].evaluate_to_constant(),gs=us.stateValues.points[1][0].evaluate_to_constant(),ys=us.stateValues.points[1][1].evaluate_to_constant(),bs=[Context.fromAst(ps[0].tree+gs-fs),Context.fromAst(ps[1].tree+ys-hs)];fs=cs.stateValues.points[0][0].evaluate_to_constant(),hs=cs.stateValues.points[0][1].evaluate_to_constant(),gs=cs.stateValues.points[1][0].evaluate_to_constant(),ys=cs.stateValues.points[1][1].evaluate_to_constant();let vs=[Context.fromAst(ps[0].tree+gs-fs),Context.fromAst(ps[1].tree+ys-hs)];return{setValue:{points:{"0,0":bs[0],"0,1":bs[1],"1,0":ps[0],"1,1":ps[1],"2,0":vs[0],"2,1":vs[1]}}}}let ss=ns.nPointsSpecified,os;ns.throughAttr?os=ns.throughAttr.stateValues.points:os=[];let ls={};for(let[us,cs]of os.entries())ls[us+",0"]=cs[0],ls[us+",1"]=cs[1];if(ss===0&&(ls["0,0"]=Context.fromAst(1),ls["0,1"]=Context.fromAst(0)),ss<2&&(ls["1,0"]=Context.fromAst(0),ls["1,1"]=Context.fromAst(0)),ss<3){let us=null;if(ns.radiansAttr){if(us=ns.radiansAttr.stateValues.value.evaluate_to_constant(),!Number.isFinite(us))return ls["2,0"]=Context.fromAst("_"),ls["2,1"]=Context.fromAst("_"),{setValue:{points:ls}}}else if(ns.degreesAttr){let ys=ns.degreesAttr.stateValues.value.evaluate_to_constant();if(Number.isFinite(ys))us=ys/180*Math.PI;else return ls["2,0"]=Context.fromAst("_"),ls["2,1"]=Context.fromAst("_"),{setValue:{points:ls}}}else us=Math.PI/2;let cs=ls["0,0"].evaluate_to_constant(),ds=ls["0,1"].evaluate_to_constant(),ps=ls["1,0"].evaluate_to_constant(),fs=ls["1,1"].evaluate_to_constant(),gs=Math.atan2(ds-fs,cs-ps)+us;ls["2,0"]=Context.fromAst(ps+Math.cos(gs)),ls["2,1"]=Context.fromAst(fs+Math.sin(gs))}return{setValue:{points:ls}}}},rs.radians={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},additionalStateVariablesDefined:[{variableName:"swapPointOrder",forRenderer:!0}],returnDependencies:()=>({radians:{dependencyType:"attributeComponent",attributeName:"radians",variableNames:["value"]},degrees:{dependencyType:"attributeComponent",attributeName:"degrees",variableNames:["value"]},points:{dependencyType:"stateVariable",variableName:"points"},chooseReflexAngle:{dependencyType:"stateVariable",variableName:"chooseReflexAngle"}}),definition({dependencyValues:ns}){let ss=!1;if(ns.radians!==null)return{setValue:{radians:ns.radians.stateValues.value.simplify(),swapPointOrder:ss}};if(ns.degrees!==null)return{setValue:{radians:ns.degrees.stateValues.value.divide(Context.fromAst(180)).simplify().multiply(Context.fromAst("pi")).simplify(),swapPointOrder:ss}};let os=[],ls=!1;for(let cs=0;cs<3;cs++)os.push([ns.points[cs][0].evaluate_to_constant(),ns.points[cs][1].evaluate_to_constant()]),(Number.isNaN(os[cs][0])||Number.isNaN(os[cs][1]))&&(ls=!0);let us;return ls?{setValue:{radians:Context.fromAst("_"),swapPointOrder:ss}}:(us=Math.atan2(os[2][1]-os[1][1],os[2][0]-os[1][0])-Math.atan2(os[0][1]-os[1][1],os[0][0]-os[1][0]),us<0&&(us+=2*Math.PI),us>Math.PI?ns.chooseReflexAngle==="never"&&(us=2*Math.PI-us,ss=!0):ns.chooseReflexAngle==="always"&&(us=2*Math.PI-us,ss=!0),{setValue:{radians:Context.fromAst(us),swapPointOrder:ss}})}},rs.value={isAlias:!0,targetVariableName:"radians"},rs.angle={isAlias:!0,targetVariableName:"radians"},rs.degrees={public:!0,shadowingInstructions:{createComponentOfType:"math",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero","padZeros"]},returnDependencies:()=>({radians:{dependencyType:"stateVariable",variableName:"radians"}}),definition({dependencyValues:ns}){let ss;if(ns.radians.tree==="_"||Number.isNaN(ns.radians.tree))ss=ns.radians;else{let os=ns.radians.evaluate_to_constant();Number.isFinite(os)?ss=Context.fromAst(os*180/Math.PI):ss=ns.radians.multiply(Context.fromAst(["/",180,"pi"])).simplify()}return{setValue:{degrees:ss}}}},rs.latexForRenderer={forRenderer:!0,returnDependencies:()=>({inDegrees:{dependencyType:"stateVariable",variableName:"inDegrees"},radians:{dependencyType:"stateVariable",variableName:"radians"},degrees:{dependencyType:"stateVariable",variableName:"degrees"},displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"},padZeros:{dependencyType:"stateVariable",variableName:"padZeros"}}),definition:function({dependencyValues:ns,usedDefault:ss}){let os={};ns.padZeros&&(ss.displayDigits&&!ss.displayDecimals?Number.isFinite(ns.displayDecimals)&&(os.padToDecimals=ns.displayDecimals):ns.displayDigits>=1&&(os.padToDigits=ns.displayDigits));let ls=ns.inDegrees?ns.degrees:ns.radians,us=roundForDisplay({value:ls,dependencyValues:ns,usedDefault:ss}).toLatex(os);return ns.inDegrees&&(us+="^\\circ"),{setValue:{latexForRenderer:us}}}},rs.numericalPoints={isArray:!0,entryPrefixes:["numericalPoint"],forRenderer:!0,returnArraySizeDependencies:()=>({}),returnArraySize(){return[3]},returnArrayDependenciesByKey({arrayKeys:ns}){let ss={};for(let os of ns)ss[os]={point:{dependencyType:"stateVariable",variableName:"point"+(Number(os)+1)}};return{dependenciesByKey:ss}},arrayDefinitionByKey({dependencyValuesByKey:ns,arrayKeys:ss}){let os={};for(let ls of ss){let us=ns[ls].point,cs=[];for(let ds=0;ds<2;ds++){let ps=us[ds].evaluate_to_constant();cs.push(ps)}os[ls]=cs}return{setValue:{numericalPoints:os}}}},rs.numericalRadius={forRenderer:!0,returnDependencies:()=>({radius:{dependencyType:"stateVariable",variableName:"radius"}}),definition({dependencyValues:ns}){return{setValue:{numericalRadius:ns.radius.evaluate_to_constant()}}}},rs}}zs(Angle,"componentType","angle"),zs(Angle,"adapters",["radians"]);function calculateLineIntersection(as,rs){if(as.stateValues.nDimensions!==2||rs.stateValues.nDimensions!==2){console.log("Calculating angle between two lines implemented only in 2D");return}let ns=as.stateValues.coeffvar1.evaluate_to_constant(),ss=as.stateValues.coeffvar2.evaluate_to_constant(),os=as.stateValues.coeff0.evaluate_to_constant(),ls=rs.stateValues.coeffvar1.evaluate_to_constant(),us=rs.stateValues.coeffvar2.evaluate_to_constant(),cs=rs.stateValues.coeff0.evaluate_to_constant();if(!(Number.isFinite(ns)&&Number.isFinite(ss)&&Number.isFinite(os)&&Number.isFinite(ls)&&Number.isFinite(us)&&Number.isFinite(cs))){console.log("Calculating angle between two lines implemented only for constant coefficients");return}let ds=ns*us-ls*ss;if(Math.abs(ds)<1e-14)if(Math.abs(cs*ns-os*ls)>1e-14){console.log("Cannot calculate angle between two parallel lines");return}else return ns===0&&ss===0&&os===0||ls===0&&us===0&&cs===0?void 0:ss!==0?[Context.fromAst(0),Context.fromAst(-os/ss)]:[Context.fromAst(-os/ns),Context.fromAst(0)];let ps=(cs*ss-os*us)/ds,fs=(os*ls-cs*ns)/ds;return[Context.fromAst(ps),Context.fromAst(fs)]}var defaults$1={space:"",cycles:!1,replacer:(as,rs)=>rs,stringify:JSON.stringify},util$1={isArray:Array.isArray,assign:Object.assign,isObject:as=>typeof as=="object",isFunction:as=>typeof as=="function",isBoolean:as=>typeof as=="boolean",isRegex:as=>as instanceof RegExp,keys:Object.keys};const DEFAULTS=defaults$1,isFunction$1=util$1.isFunction,isBoolean$1=util$1.isBoolean,isObject$2=util$1.isObject,isArray$1=util$1.isArray,isRegex=util$1.isRegex,assign$1=util$1.assign,keys$1=util$1.keys;function serialize(as){return as==null?as:isRegex(as)?as.toString():as.toJSON?as.toJSON():as}function stringifyDeterministic(as,rs){rs=rs||assign$1({},DEFAULTS),isFunction$1(rs)&&(rs={compare:rs});const ns=rs.space||DEFAULTS.space,ss=isBoolean$1(rs.cycles)?rs.cycles:DEFAULTS.cycles,os=rs.replacer||DEFAULTS.replacer,ls=rs.stringify||DEFAULTS.stringify,us=rs.compare&&function(ds){return function(ps){return function(fs,hs){const gs={key:fs,value:ps[fs]},ys={key:hs,value:ps[hs]};return ds(gs,ys)}}}(rs.compare);ss||ls(as);const cs=[];return function ds(ps,fs,hs,gs){const ys=ns?` @@ -2737,7 +2746,7 @@ Make sure that all grammar rule definitions are done before 'performSelfAnalysis `,WIN32:`\r `};lineEndings.LINE_ENDINGS=LINE_ENDINGS;var generator={},util={},capitalize={};(function(as){Object.defineProperty(as,"__esModule",{value:!0}),as.default=void 0;var rs=function(os){var ls=os.trim();return ls.charAt(0).toUpperCase()+ls.slice(1)},ns=rs;as.default=ns})(capitalize);var isNodeExports={},isNode={get exports(){return isNodeExports},set exports(as){isNodeExports=as}};(function(as,rs){Object.defineProperty(rs,"__esModule",{value:!0}),rs.default=void 0;var ns=function(){return!!as.exports},ss=ns;rs.default=ss})(isNode,isNodeExports);var isReactNative={};(function(as){Object.defineProperty(as,"__esModule",{value:!0}),as.default=void 0;var rs=function(){var os=!1;try{os=navigator.product==="ReactNative"}catch{os=!1}return os},ns=rs;as.default=ns})(isReactNative);var isWindows={},platforms={};Object.defineProperty(platforms,"__esModule",{value:!0});platforms.SUPPORTED_PLATFORMS=void 0;var SUPPORTED_PLATFORMS={DARWIN:"darwin",LINUX:"linux",WIN32:"win32"};platforms.SUPPORTED_PLATFORMS=SUPPORTED_PLATFORMS;(function(as){Object.defineProperty(as,"__esModule",{value:!0}),as.default=void 0;var rs=platforms,ns=function(){var ls=!1;try{ls=browser$1$2.platform===rs.SUPPORTED_PLATFORMS.WIN32}catch{ls=!1}return ls},ss=ns;as.default=ss})(isWindows);var makeArrayOfLength={};(function(as){Object.defineProperty(as,"__esModule",{value:!0}),as.default=void 0;var rs=function(){var os=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return Array.apply(null,Array(os)).map(function(ls,us){return us})},ns=rs;as.default=ns})(makeArrayOfLength);var makeArrayOfStrings={};(function(as){Object.defineProperty(as,"__esModule",{value:!0}),as.default=void 0;var rs=ns(makeArrayOfLength);function ns(ls){return ls&&ls.__esModule?ls:{default:ls}}var ss=function(us,cs){var ds=(0,rs.default)(us);return ds.map(function(){return cs()})},os=ss;as.default=os})(makeArrayOfStrings);(function(as){Object.defineProperty(as,"__esModule",{value:!0}),Object.defineProperty(as,"capitalize",{enumerable:!0,get:function(){return rs.default}}),Object.defineProperty(as,"isNode",{enumerable:!0,get:function(){return ns.default}}),Object.defineProperty(as,"isReactNative",{enumerable:!0,get:function(){return ss.default}}),Object.defineProperty(as,"isWindows",{enumerable:!0,get:function(){return os.default}}),Object.defineProperty(as,"makeArrayOfLength",{enumerable:!0,get:function(){return ls.default}}),Object.defineProperty(as,"makeArrayOfStrings",{enumerable:!0,get:function(){return us.default}});var rs=cs(capitalize),ns=cs(isNodeExports),ss=cs(isReactNative),os=cs(isWindows),ls=cs(makeArrayOfLength),us=cs(makeArrayOfStrings);function cs(ds){return ds&&ds.__esModule?ds:{default:ds}}})(util);(function(as){Object.defineProperty(as,"__esModule",{value:!0}),as.default=void 0;var rs=words,ns=util;function ss(ps,fs){if(!(ps instanceof fs))throw new TypeError("Cannot call a class as a function")}function os(ps,fs){for(var hs=0;hs0&&arguments[0]!==void 0?arguments[0]:{},hs=fs.sentencesPerParagraph,gs=hs===void 0?{max:7,min:3}:hs,ys=fs.wordsPerSentence,bs=ys===void 0?{max:15,min:5}:ys,vs=fs.random;fs.seed;var xs=fs.words,Cs=xs===void 0?rs.WORDS:xs;if(ss(this,ps),us(this,"sentencesPerParagraph",void 0),us(this,"wordsPerSentence",void 0),us(this,"random",void 0),us(this,"words",void 0),gs.min>gs.max)throw new Error("Minimum number of sentences per paragraph (".concat(gs.min,") cannot exceed maximum (").concat(gs.max,")."));if(bs.min>bs.max)throw new Error("Minimum number of words per sentence (".concat(bs.min,") cannot exceed maximum (").concat(bs.max,")."));this.sentencesPerParagraph=gs,this.words=Cs,this.wordsPerSentence=bs,this.random=vs||Math.random}return ls(ps,[{key:"generateRandomInteger",value:function(hs,gs){return Math.floor(this.random()*(gs-hs+1)+hs)}},{key:"generateRandomWords",value:function(hs){var gs=this,ys=this.wordsPerSentence,bs=ys.min,vs=ys.max,xs=hs||this.generateRandomInteger(bs,vs);return(0,ns.makeArrayOfLength)(xs).reduce(function(Cs,Ts){return"".concat(gs.pluckRandomWord()," ").concat(Cs)},"").trim()}},{key:"generateRandomSentence",value:function(hs){return"".concat((0,ns.capitalize)(this.generateRandomWords(hs)),".")}},{key:"generateRandomParagraph",value:function(hs){var gs=this,ys=this.sentencesPerParagraph,bs=ys.min,vs=ys.max,xs=hs||this.generateRandomInteger(bs,vs);return(0,ns.makeArrayOfLength)(xs).reduce(function(Cs,Ts){return"".concat(gs.generateRandomSentence()," ").concat(Cs)},"").trim()}},{key:"pluckRandomWord",value:function(){var hs=0,gs=this.words.length-1,ys=this.generateRandomInteger(hs,gs);return this.words[ys]}}]),ps}(),ds=cs;as.default=ds})(generator);(function(as){Object.defineProperty(as,"__esModule",{value:!0}),as.default=void 0;var rs=formats,ns=lineEndings,ss=ls(generator),os=util;function ls(gs){return gs&&gs.__esModule?gs:{default:gs}}function us(gs,ys){if(!(gs instanceof ys))throw new TypeError("Cannot call a class as a function")}function cs(gs,ys){for(var bs=0;bs0&&arguments[0]!==void 0?arguments[0]:{},bs=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rs.FORMAT_PLAIN,vs=arguments.length>2?arguments[2]:void 0;if(us(this,gs),this.format=bs,this.suffix=vs,ps(this,"generator",void 0),rs.FORMATS.indexOf(bs.toLowerCase())===-1)throw new Error("".concat(bs," is an invalid format. Please use ").concat(rs.FORMATS.join(" or "),"."));this.generator=new ss.default(ys)}return ds(gs,[{key:"getLineEnding",value:function(){return this.suffix?this.suffix:!(0,os.isReactNative)()&&(0,os.isNode)()&&(0,os.isWindows)()?ns.LINE_ENDINGS.WIN32:ns.LINE_ENDINGS.POSIX}},{key:"formatString",value:function(bs){return this.format===rs.FORMAT_HTML?"

".concat(bs,"

"):bs}},{key:"formatStrings",value:function(bs){var vs=this;return bs.map(function(xs){return vs.formatString(xs)})}},{key:"generateWords",value:function(bs){return this.formatString(this.generator.generateRandomWords(bs))}},{key:"generateSentences",value:function(bs){return this.formatString(this.generator.generateRandomParagraph(bs))}},{key:"generateParagraphs",value:function(bs){var vs=this.generator.generateRandomParagraph.bind(this.generator);return this.formatStrings((0,os.makeArrayOfStrings)(bs,vs)).join(this.getLineEnding())}}]),gs}(),hs=fs;as.default=hs})(LoremIpsum);(function(as){Object.defineProperty(as,"__esModule",{value:!0}),Object.defineProperty(as,"LoremIpsum",{enumerable:!0,get:function(){return os.default}}),as.loremIpsum=void 0;var rs=formats,ns=units,ss=words,os=ls(LoremIpsum);function ls(cs){return cs&&cs.__esModule?cs:{default:cs}}var us=function(){var ds=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ps=ds.count,fs=ps===void 0?1:ps,hs=ds.format,gs=hs===void 0?rs.FORMAT_PLAIN:hs,ys=ds.paragraphLowerBound,bs=ys===void 0?3:ys,vs=ds.paragraphUpperBound,xs=vs===void 0?7:vs,Cs=ds.random,Ts=ds.sentenceLowerBound,Ss=Ts===void 0?5:Ts,Ns=ds.sentenceUpperBound,As=Ns===void 0?15:Ns,ws=ds.units,Es=ws===void 0?ns.UNIT_SENTENCES:ws,_s=ds.words,$s=_s===void 0?ss.WORDS:_s,Rs=ds.suffix,Ds=Rs===void 0?"":Rs,Os={random:Cs,sentencesPerParagraph:{max:xs,min:bs},words:$s,wordsPerSentence:{max:As,min:Ss}},Is=new os.default(Os,gs,Ds);switch(Es){case ns.UNIT_PARAGRAPHS:case ns.UNIT_PARAGRAPH:return Is.generateParagraphs(fs);case ns.UNIT_SENTENCES:case ns.UNIT_SENTENCE:return Is.generateSentences(fs);case ns.UNIT_WORDS:case ns.UNIT_WORD:return Is.generateWords(fs);default:return""}};as.loremIpsum=us})(dist);class Lorem extends CompositeComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.minSentencesPerParagraph={createComponentOfType:"number",createStateVariable:"minSentencesPerParagraph",defaultValue:4,public:!0},rs.maxSentencesPerParagraph={createComponentOfType:"number",createStateVariable:"maxSentencesPerParagraph",defaultValue:8,public:!0},rs.minWordsPerSentence={createComponentOfType:"number",createStateVariable:"minWordsPerSentence",defaultValue:4,public:!0},rs.maxWordsPerSentence={createComponentOfType:"number",createStateVariable:"maxWordsPerSentence",defaultValue:8,public:!0},rs.generateWords={createComponentOfType:"number",createStateVariable:"generateWords",defaultValue:null},rs.generateSentences={createComponentOfType:"number",createStateVariable:"generateSentences",defaultValue:null},rs.generateParagraphs={createComponentOfType:"number",createStateVariable:"generateParagraphs",defaultValue:null},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.readyToExpandWhenResolved={returnDependencies:()=>({minSentencesPerParagraph:{dependencyType:"stateVariable",variableName:"minSentencesPerParagraph"},maxSentencesPerParagraph:{dependencyType:"stateVariable",variableName:"maxSentencesPerParagraph"},minWordsPerSentence:{dependencyType:"stateVariable",variableName:"minWordsPerSentence"},maxWordsPerSentence:{dependencyType:"stateVariable",variableName:"maxWordsPerSentence"},generateWords:{dependencyType:"stateVariable",variableName:"generateWords"},generateSentences:{dependencyType:"stateVariable",variableName:"generateSentences"},generateParagraphs:{dependencyType:"stateVariable",variableName:"generateParagraphs"}}),markStale:()=>({updateReplacements:!0}),definition(){return{setValue:{readyToExpandWhenResolved:!0}}}},rs.isVariantComponent={returnDependencies:()=>({}),definition:()=>({setValue:{isVariantComponent:!0}})},rs.generatedVariantInfo={returnDependencies:({sharedParameters:ns,componentInfoObjects:ss})=>({variantSeed:{dependencyType:"value",value:ns.variantSeed}}),definition({dependencyValues:ns,componentName:ss}){return{setValue:{generatedVariantInfo:{seed:ns.variantSeed,meta:{createdBy:ss}}}}}},rs}static async createSerializedReplacements({component:rs,componentInfoObjects:ns}){var cs;const ss=new dist.LoremIpsum({sentencesPerParagraph:{max:await rs.stateValues.maxSentencesPerParagraph,min:await rs.stateValues.minSentencesPerParagraph},wordsPerSentence:{max:await rs.stateValues.maxWordsPerSentence,min:await rs.stateValues.minWordsPerSentence},random:rs.sharedParameters.variantRng});let os=[];if(await rs.stateValues.generateParagraphs!==null){let ds=await rs.stateValues.generateParagraphs;Number.isInteger(ds)&&ds>0&&(os=ss.generateParagraphs(ds).split(` `).map(fs=>({componentType:"p",children:[fs]})))}else if(await rs.stateValues.generateSentences!==null){let ds=await rs.stateValues.generateSentences;if(Number.isInteger(ds)&&ds>0){let ps=ss.generateSentences(ds).split(". ");for(let fs of ps.slice(0,ps.length-1))os.push({componentType:"text",children:[fs+"."]}),os.push(" ");os.push({componentType:"text",children:[ps[ps.length-1]]})}}else if(await rs.stateValues.generateWords!==null){let ds=await rs.stateValues.generateWords;if(Number.isInteger(ds)&&ds>0){let ps=ss.generateWords(ds).split(" ").map(fs=>({componentType:"text",children:[fs]}));os.push(ps[0]);for(let fs of ps.slice(1))os.push(" "),os.push(fs)}}let ls=(cs=rs.attributes.newNamespace)==null?void 0:cs.primitive;return{replacements:processAssignNames({assignNames:rs.doenetAttributes.assignNames,serializedComponents:os,parentName:rs.componentName,parentCreatesNewNamespace:ls,componentInfoObjects:ns}).serializedComponents}}static async calculateReplacementChanges({component:rs,componentInfoObjects:ns}){let ss=await this.createSerializedReplacements({component:rs,componentInfoObjects:ns});return[{changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:0,numberReplacementsToReplace:rs.replacements.length,serializedReplacements:ss.replacements}]}static setUpVariant({serializedComponent:rs,sharedParameters:ns,descendantVariantComponents:ss}){setUpVariantSeedAndRng({serializedComponent:rs,sharedParameters:ns,descendantVariantComponents:ss})}}zs(Lorem,"componentType","lorem"),zs(Lorem,"assignNamesToReplacements",!0),zs(Lorem,"createsVariants",!0),zs(Lorem,"stateVariableToEvaluateAfterReplacements","readyToExpandWhenResolved");function returnStandardTriggeringAttributes(as){return{triggerWhen:{createComponentOfType:"boolean",createStateVariable:"triggerWhen",defaultValue:!1,triggerActionOnChange:as},triggerWith:{createTargetComponentNames:!0},triggerWhenObjectsClicked:{createTargetComponentNames:!0},triggerWhenObjectsFocused:{createTargetComponentNames:!0}}}function addStandardTriggeringStateVariableDefinitions(as,rs){as.insideTriggerSet={returnDependencies:()=>({parentTriggerSet:{dependencyType:"parentStateVariable",parentComponentType:"triggerSet",variableName:"updateValueAndActionsToTrigger"}}),definition({dependencyValues:os}){return{setValue:{insideTriggerSet:os.parentTriggerSet!==null}}}},as.triggerWith={returnDependencies:()=>({triggerWith:{dependencyType:"attributeTargetComponentNames",attributeName:"triggerWith"},triggerWhenObjectsClicked:{dependencyType:"attributeTargetComponentNames",attributeName:"triggerWhenObjectsClicked"},triggerWhenObjectsFocused:{dependencyType:"attributeTargetComponentNames",attributeName:"triggerWhenObjectsFocused"},triggerWhen:{dependencyType:"attributeComponent",attributeName:"triggerWhen"},insideTriggerSet:{dependencyType:"stateVariable",variableName:"insideTriggerSet"}}),definition({dependencyValues:os}){if(os.triggerWhen||os.insideTriggerSet)return{setValue:{triggerWith:null}};{let ls=[];if(os.triggerWith!==null)for(let us of os.triggerWith)ls.push({target:us.absoluteName});if(os.triggerWhenObjectsClicked!==null)for(let us of os.triggerWhenObjectsClicked)ls.push({target:us.absoluteName,triggeringAction:"click"});if(os.triggerWhenObjectsFocused!==null)for(let us of os.triggerWhenObjectsFocused)ls.push({target:us.absoluteName,triggeringAction:"down"});return ls.length===0&&(ls=null),{setValue:{triggerWith:ls}}}}},as.triggerWithTargetIds={chainActionOnActionOfStateVariableTargets:{triggeredAction:rs},returnDependencies:()=>({triggerWith:{dependencyType:"stateVariable",variableName:"triggerWith"}}),definition({dependencyValues:os}){let ls=[];if(os.triggerWith)for(let us of os.triggerWith){let cs=us.target;us.triggeringAction&&(cs+="|"+us.triggeringAction),ls.includes(cs)||ls.push(cs)}return{setValue:{triggerWithTargetIds:ls}}},markStale(){return{updateActionChaining:!0}}};let ns=as.hidden.returnDependencies,ss=as.hidden.definition;as.hidden.returnDependencies=function(os){let ls=ns(os);return ls.triggerWhen={dependencyType:"attributeComponent",attributeName:"triggerWhen"},ls.triggerWith={dependencyType:"stateVariable",variableName:"triggerWith"},ls.insideTriggerSet={dependencyType:"stateVariable",variableName:"insideTriggerSet"},ls},as.hidden.definition=function(os){return os.dependencyValues.triggerWhen||os.dependencyValues.triggerWith||os.dependencyValues.insideTriggerSet?{setValue:{hidden:!0}}:ss(os)}}class UpdateValue extends InlineComponent{constructor(rs){super(rs),Object.assign(this.actions,{updateValue:this.updateValue.bind(this),updateValueIfTriggerNewlyTrue:this.updateValueIfTriggerNewlyTrue.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();rs.labelIsName={createComponentOfType:"boolean",createStateVariable:"labelIsName",defaultValue:!1,public:!0},rs.type={createPrimitiveOfType:"string",createStateVariable:"type",defaultPrimitiveValue:"math",toLowerCase:!0,validValues:["math","number","boolean","text"]},rs.prop={createPrimitiveOfType:"string"},rs.newValue={createComponentOfType:"_componentWithSelectableType"},rs.componentIndex={createComponentOfType:"integer",createStateVariable:"componentIndex",defaultValue:null,public:!0},rs.propIndex={createComponentOfType:"numberList",createStateVariable:"propIndex",defaultValue:null,public:!0};let ns=returnStandardTriggeringAttributes("updateValueIfTriggerNewlyTrue");return Object.assign(rs,ns),rs.simplify={createComponentOfType:"text",createStateVariable:"simplify",defaultValue:"none",public:!0,toLowerCase:!0,valueTransformations:{"":"full",true:"full",false:"none"},validValues:["none","full","numbers","numberspreserveorder"]},rs}static returnChildGroups(){return[{group:"labels",componentTypes:["label"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();addStandardTriggeringStateVariableDefinitions(rs,"updateValue");let ns=returnLabelStateVariableDefinitions();return Object.assign(rs,ns),rs.target={returnDependencies:()=>({target:{dependencyType:"doenetAttribute",attributeName:"target"}}),definition:({dependencyValues:ss})=>({setValue:{target:ss.target}})},rs.targetComponent={returnDependencies(){return{targetComponent:{dependencyType:"targetComponent"}}},definition:function({dependencyValues:ss}){let os=null;return ss.targetComponent&&(os=ss.targetComponent),{setValue:{targetComponent:os}}}},rs.propName={returnDependencies:()=>({propName:{dependencyType:"attributePrimitive",attributeName:"prop"}}),definition:function({dependencyValues:ss}){return{setValue:{propName:ss.propName}}}},rs.targetIdentities={stateVariablesDeterminingDependencies:["targetComponent","componentIndex"],returnDependencies:function({stateValues:ss,componentInfoObjects:os}){let ls={};return ss.targetComponent!==null&&(os.isCompositeComponent({componentType:ss.targetComponent.componentType,includeNonStandard:!1})?ls.targets={dependencyType:"replacement",compositeName:ss.targetComponent.componentName,recursive:!0,componentIndex:ss.componentIndex}:(ss.componentIndex===null||ss.componentIndex===1)&&(ls.targets={dependencyType:"stateVariable",variableName:"targetComponent"})),ls},definition({dependencyValues:ss}){let os=null;return ss.targets&&(os=ss.targets,Array.isArray(os)||(os=[os])),{setValue:{targetIdentities:os}}}},rs.targets={stateVariablesDeterminingDependencies:["targetIdentities","propName","propIndex"],returnDependencies:function({stateValues:ss}){let os={targetIdentities:{dependencyType:"stateVariable",variableName:"targetIdentities"}};if(ss.targetIdentities!==null)for(let[ls,us]of ss.targetIdentities.entries()){let cs;if(ss.propName){let ds=ss.propIndex;ds&&(ds=[...ds]),cs={dependencyType:"stateVariable",componentName:us.componentName,variableName:ss.propName,returnAsComponentObject:!0,variablesOptional:!0,propIndex:ds,caseInsensitiveVariableMatch:!0,publicStateVariablesOnly:!0,useMappedVariableNames:!0}}else cs={dependencyType:"componentIdentity",componentName:us.componentName};os["target"+ls]=cs}return os},definition({dependencyValues:ss}){let os=null;if(ss.targetIdentities!==null){os=[];for(let ls in ss.targetIdentities)ss["target"+ls]&&os.push(ss["target"+ls])}return{setValue:{targets:os}}}},rs.newValue={returnDependencies:()=>({newValueAttr:{dependencyType:"attributeComponent",attributeName:"newValue",variableNames:["value"]},type:{dependencyType:"stateVariable",variableName:"type"},simplify:{dependencyType:"stateVariable",variableName:"simplify"}}),definition:function({dependencyValues:ss}){if(ss.newValueAttr===null)return{setValue:{newValue:null}};let os=ss.newValueAttr.stateValues.value;return ss.type==="math"&&(os=normalizeMathExpression({value:os,simplify:ss.simplify})),{setValue:{newValue:os}}}},rs}async updateValue({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){let os=await this.stateValues.targets,ls=await this.stateValues.newValue;if(os===null||ls===null)return;let us=[];for(let cs of os){let ds="value";if(cs.stateValues&&(ds=Object.keys(cs.stateValues)[0],ds===void 0)){console.warn(`Cannot update prop="${await this.stateValues.propName}" of ${await this.stateValues.target} as could not find prop ${await this.stateValues.propName} on a component of type ${cs.componentType}`);continue}us.push({updateType:"updateValue",componentName:cs.componentName,stateVariable:ds,value:ls})}return await this.coreFunctions.performUpdate({updateInstructions:us,actionId:rs,sourceInformation:ns,skipRendererUpdate:!0,event:{verb:"selected",object:{componentName:this.componentName,componentType:this.componentType},result:{response:ls,responseText:ls.toString()}}}),await this.coreFunctions.triggerChainedActions({componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss})}async updateValueIfTriggerNewlyTrue({stateValues:rs,previousValues:ns,actionId:ss}){if(await rs.triggerWhen&&ns.triggerWhen===!1&&!await this.stateValues.insideTriggerSet)return await this.updateValue({actionId:ss,skipRendererUpdate:!0});this.coreFunctions.resolveAction({actionId:ss})}}zs(UpdateValue,"componentType","updateValue"),zs(UpdateValue,"acceptTarget",!0);class CallAction extends InlineComponent{constructor(rs){super(rs),Object.assign(this.actions,{callAction:this.callAction.bind(this),callActionIfTriggerNewlyTrue:this.callActionIfTriggerNewlyTrue.bind(this)})}static keepChildrenSerialized({serializedComponent:rs,componentInfoObjects:ns}){if(rs.children===void 0)return[];{let ss=[];for(let[os,ls]of rs.children.entries())ns.componentIsSpecifiedType(ls,"label")||ss.push(os);return ss}}static createAttributesObject(){let rs=super.createAttributesObject();rs.labelIsName={createComponentOfType:"boolean",createStateVariable:"labelIsName",defaultValue:!1,public:!0},rs.actionName={createComponentOfType:"text",createStateVariable:"actionName",defaultValue:null,public:!0};let ns=returnStandardTriggeringAttributes("callActionIfTriggerNewlyTrue");return Object.assign(rs,ns),rs.numbers={createComponentOfType:"numberList"},rs.number={createComponentOfType:"number"},rs}static returnChildGroups(){return[{group:"labels",componentTypes:["label"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();addStandardTriggeringStateVariableDefinitions(rs,"callAction");let ns=returnLabelStateVariableDefinitions();return Object.assign(rs,ns),rs.target={returnDependencies:()=>({target:{dependencyType:"doenetAttribute",attributeName:"target"}}),definition:({dependencyValues:ss})=>({setValue:{target:ss.target}})},rs.targetComponent={returnDependencies(){return{targetComponent:{dependencyType:"targetComponent"}}},definition:function({dependencyValues:ss}){let os=null;return ss.targetComponent&&(os=ss.targetComponent),{setValue:{targetComponent:os}}}},rs.targetName={returnDependencies:()=>({targetComponent:{dependencyType:"stateVariable",variableName:"targetComponent"}}),definition({dependencyValues:ss}){let os=null;return ss.targetComponent&&(os=ss.targetComponent.componentName),{setValue:{targetName:os}}}},rs}async callAction({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){let os=await this.stateValues.targetName,ls=await this.stateValues.actionName;if(os!==null&&ls!==null){let us={sourceInformation:ns,skipRendererUpdate:!0};this.serializedChildren.length>0&&(us.serializedComponents=deepClone(this.serializedChildren)),this.attributes.number&&(us.number=await this.attributes.number.component.stateValues.value),this.attributes.numbers&&(us.numbers=await this.attributes.numbers.component.stateValues.numbers),rs&&(us.actionId=rs),await this.coreFunctions.performAction({componentName:os,actionName:ls,args:us,event:{verb:"selected",object:{componentName:this.componentName,componentType:this.componentType}},caseInsensitiveMatch:!0}),await this.coreFunctions.triggerChainedActions({componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss})}else this.coreFunctions.resolveAction({actionId:rs})}async callActionIfTriggerNewlyTrue({stateValues:rs,previousValues:ns,actionId:ss}){if(rs.triggerWhen&&ns.triggerWhen===!1&&!await this.stateValues.insideTriggerSet)return await this.callAction({actionId:ss});this.coreFunctions.resolveAction({actionId:ss})}}zs(CallAction,"componentType","callAction"),zs(CallAction,"acceptTarget",!0);class triggerSet extends InlineComponent{constructor(rs){super(rs),Object.assign(this.actions,{triggerActions:this.triggerActions.bind(this),triggerActionsIfTriggerNewlyTrue:this.triggerActionsIfTriggerNewlyTrue.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();rs.labelIsName={createComponentOfType:"boolean",createStateVariable:"labelIsName",defaultValue:!1,public:!0};let ns=returnStandardTriggeringAttributes("triggerActionsIfTriggerNewlyTrue");return Object.assign(rs,ns),rs}static returnChildGroups(){return[{group:"updateValuesCallActions",componentTypes:["updateValue","callAction"]},{group:"labels",componentTypes:["label"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();addStandardTriggeringStateVariableDefinitions(rs,"triggerActions");let ns=returnLabelStateVariableDefinitions();return Object.assign(rs,ns),rs.updateValueAndActionsToTrigger={returnDependencies:()=>({updateValueAndCallActionChildren:{dependencyType:"child",childGroups:["updateValuesCallActions"]}}),definition({dependencyValues:ss}){return{setValue:{updateValueAndActionsToTrigger:ss.updateValueAndCallActionChildren}}}},rs}async triggerActions({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){for(let os of await this.stateValues.updateValueAndActionsToTrigger)this.componentInfoObjects.isInheritedComponentType({inheritedComponentType:os.componentType,baseComponentType:"updateValue"})?await this.coreFunctions.performAction({componentName:os.componentName,actionName:"updateValue",args:{actionId:rs,sourceInformation:ns,skipRendererUpdate:!0}}):this.componentInfoObjects.isInheritedComponentType({inheritedComponentType:os.componentType,baseComponentType:"callAction"})&&await this.coreFunctions.performAction({componentName:os.componentName,actionName:"callAction",args:{actionId:rs,sourceInformation:ns,skipRendererUpdate:!0}});return this.coreFunctions.resolveAction({actionId:rs}),await this.coreFunctions.triggerChainedActions({componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss})}async triggerActionsIfTriggerNewlyTrue({stateValues:rs,previousValues:ns,actionId:ss}){if(rs.triggerWhen&&ns.triggerWhen===!1)return await this.triggerActions({actionId:ss,skipRendererUpdate:!0});this.coreFunctions.resolveAction({actionId:ss})}}zs(triggerSet,"componentType","triggerSet");class FunctionIterates extends InlineComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.nIterates={createComponentOfType:"integer",createStateVariable:"nIterates",defaultValue:0,public:!0},rs.forceSymbolic={createComponentOfType:"boolean",createStateVariable:"forceSymbolic",defaultValue:!1,public:!0},rs.forceNumeric={createComponentOfType:"boolean",createStateVariable:"forceNumeric",defaultValue:!1,public:!0},rs.initialValue={createComponentOfType:"math",createStateVariable:"initialValue",defaultValue:Context.fromAst("_")},rs.function={createComponentOfType:"function"},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.nDimensions={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({functionAttr:{dependencyType:"attributeComponent",attributeName:"function",variableNames:["nInputs","nOutputs"]}}),definition({dependencyValues:ns}){return ns.functionAttr?ns.functionAttr.stateValues.nInputs!==ns.functionAttr.stateValues.nOutputs?(console.warn("Function iterates are possible only if the number of inputs is equal to the number of outputs"),{setValue:{nDimensions:0}}):{setValue:{nDimensions:ns.functionAttr.stateValues.nInputs}}:{setValue:{nDimensions:0}}}},rs.allIterates={public:!0,shadowingInstructions:{createComponentOfType:"mathList"},returnDependencies:()=>({functionAttr:{dependencyType:"attributeComponent",attributeName:"function",variableNames:["symbolicfs","numericalfs","symbolic"]},forceSymbolic:{dependencyType:"stateVariable",variableName:"forceSymbolic"},forceNumeric:{dependencyType:"stateVariable",variableName:"forceNumeric"},nDimensions:{dependencyType:"stateVariable",variableName:"nDimensions"},initialValue:{dependencyType:"stateVariable",variableName:"initialValue"},nIterates:{dependencyType:"stateVariable",variableName:"nIterates"}}),definition({dependencyValues:ns}){let ss=[],os=ns.functionAttr,ls=ns.initialValue,us=!ns.forceNumeric&&(os.stateValues.symbolic||ns.forceSymbolic),cs=ns.nIterates;if(!os||ns.nDimensions===0||!(ns.nDimensions===1||Array.isArray(ls.tree)&&vectorOperators.includes(ls.tree[0])&&ls.tree.length===ns.nDimensions+1))return ss=Array(cs).fill(Context.fromAst("_")),{setValue:{allIterates:ss}};if(us)if(ns.nDimensions===1){let ds=os.stateValues.symbolicfs[0],ps=ls;for(let fs=0;fsContext.fromAst(fs).evaluate_to_constant());for(let fs=0;fs({initialValue:{dependencyType:"stateVariable",variableName:"initialValue"},allIterates:{dependencyType:"stateVariable",variableName:"allIterates"}}),definition({dependencyValues:ns}){return{setValue:{allIteratesWithInitial:[ns.initialValue,...ns.allIterates]}}}},rs.iterates={isArray:!0,public:!0,shadowingInstructions:{createComponentOfType:"math"},entryPrefixes:["iterate"],returnArraySizeDependencies:()=>({nIterates:{dependencyType:"stateVariable",variableName:"nIterates"}}),returnArraySize({dependencyValues:ns}){return[ns.nIterates]},returnArrayDependenciesByKey(){return{globalDependencies:{allIterates:{dependencyType:"stateVariable",variableName:"allIterates"}}}},arrayDefinitionByKey({globalDependencyValues:ns,arraySize:ss}){let os={};for(let ls=0;ls0?{finalIterate:{dependencyType:"stateVariable",variableName:`iterate${ns.nIterates}`}}:{finalIterate:{dependencyType:"stateVariable",variableName:"initialValue"}}},definition({dependencyValues:ns}){return{setValue:{finalIterate:ns.finalIterate}}}},rs}}zs(FunctionIterates,"componentType","functionIterates"),zs(FunctionIterates,"rendererType");class Module extends Template{static createAttributesObject(){let rs=super.createAttributesObject();return delete rs.styleNumber,rs}}zs(Module,"componentType","module"),zs(Module,"renderedDefault",!0),zs(Module,"acceptAnyAttribute",!0);class CustomAttribute extends CompositeComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.componentType={createPrimitiveOfType:"string"},rs.attribute={createPrimitiveOfType:"string"},rs.defaultValue={leaveRaw:!0},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.componentNameForAttributes={returnDependencies:()=>({parentVariableContainingName:{dependencyType:"parentStateVariable",variableName:"componentNameForAttributes"}}),definition({dependencyValues:ns}){return{setValue:{componentNameForAttributes:ns.parentVariableContainingName}}}},rs.attributeName={returnDependencies:()=>({attribute:{dependencyType:"attributePrimitive",attributeName:"attribute"}}),definition({dependencyValues:ns}){return{setValue:{attributeName:ns.attribute}}}},rs.readyToExpandWhenResolved={stateVariablesDeterminingDependencies:["componentNameForAttributes"],returnDependencies:({stateValues:ns})=>({componentIdentity:{dependencyType:"componentIdentity",componentName:ns.componentNameForAttributes}}),definition(){return{setValue:{readyToExpandWhenResolved:!0}}}},rs}static async createSerializedReplacements({component:rs,components:ns,workspace:ss,componentInfoObjects:os,flags:ls}){var Ss;let us=(Ss=rs.attributes.newNamespace)==null?void 0:Ss.primitive,cs=os.componentTypeLowerCaseMapping[rs.attributes.componentType.primitive.toLowerCase()];if(!os.allComponentClasses[cs])return console.warn(`Could not find component type ${cs}`),{replacements:[]};let ps=ns[await rs.stateValues.componentNameForAttributes],fs={};for(let Ns in ps.attributes)fs[Ns.toLowerCase()]=Ns;let hs=await rs.stateValues.attributeName,gs=fs[hs.toLowerCase()],ys=ps.attributes[gs];if(ys===void 0){if(rs.attributes.defaultValue===void 0)return console.warn("Cannot create component from attribute if neither attribute nor default value specified"),{replacements:[]};ys=rs.attributes.defaultValue}let bs=ps.constructor,vs=Object.keys(bs.createAttributesObject()).map(Ns=>Ns.toLowerCase());if(vs.push("name","target","assignnames"),vs.includes(hs.toLowerCase()))return console.warn(`Cannot add attribute ${hs} of a ${bs.componentType} as it already exists in ${bs.componentType} class`),{replacements:[]};let Cs=componentFromAttribute({attrObj:{createComponentOfType:cs},value:ys,componentInfoObjects:os}).component;if(Cs.children&&(applyMacros(Cs.children,os),us)){for(let Ns of Cs.children)if(Ns.componentType==="copy"){let As=Ns.doenetAttributes.target;/[a-zA-Z_]/.test(As[0])&&(Ns.doenetAttributes.target="../"+As)}}return applySugar({serializedComponents:[Cs],isAttributeComponent:!0,componentInfoObjects:os}),setTNamesToAbsolute([Cs]),{replacements:processAssignNames({assignNames:rs.doenetAttributes.assignNames,serializedComponents:[Cs],parentName:rs.componentName,parentCreatesNewNamespace:us,componentInfoObjects:os}).serializedComponents}}}zs(CustomAttribute,"componentType","customAttribute"),zs(CustomAttribute,"assignNamesToReplacements",!0);class Setup extends CompositeComponent{static returnChildGroups(){return[{group:"styleDefinitions",componentTypes:["styleDefinitions"]},{group:"feedbackDefinitions",componentTypes:["feedbackDefinitions"]},{group:"anything",componentTypes:["_base"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.componentNameForAttributes={returnDependencies:()=>({sourceCompositeIdentity:{dependencyType:"sourceCompositeIdentity"}}),definition({dependencyValues:ns}){let ss=null;return ns.sourceCompositeIdentity&&(ss=ns.sourceCompositeIdentity.componentName),{setValue:{componentNameForAttributes:ss}}}},rs.readyToExpandWhenResolved={returnDependencies:()=>({}),definition(){return{setValue:{readyToExpandWhenResolved:!0}}}},rs}}zs(Setup,"componentType","setup");class Footnote extends InlineComponent{static returnChildGroups(){return[{group:"inlines",componentTypes:["_inline"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies:()=>({inlineChildren:{dependencyType:"child",childGroups:["inlines"],variableNames:["text"],variablesOptional:!0}}),definition:function({dependencyValues:ns}){let ss="";for(let os of ns.inlineChildren)typeof os!="object"?ss+=os.toString():typeof os.stateValues.text=="string"?ss+=os.stateValues.text:ss+=" ";return{setValue:{text:ss}}}},rs.footnoteTag={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies:()=>({footnoteCounter:{dependencyType:"counter",counterName:"footnote"}}),definition({dependencyValues:ns}){return{setValue:{footnoteTag:String(ns.footnoteCounter)}}}},rs}}zs(Footnote,"componentType","footnote"),zs(Footnote,"renderChildren",!0),zs(Footnote,"includeBlankStringChildren",!0);class Caption extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static returnChildGroups(){return[{group:"inlinesBlocks",componentTypes:["_inline","_block"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({inlineChildren:{dependencyType:"child",childGroups:["inlinesBlocks"],variableNames:["text"],variablesOptional:!0}}),definition:function({dependencyValues:ns}){let ss="";for(let os of ns.inlineChildren)typeof os!="object"?ss+=os.toString():typeof os.stateValues.text=="string"?ss+=os.stateValues.text:ss+=" ";return{setValue:{text:ss}}}},rs}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}}zs(Caption,"componentType","caption"),zs(Caption,"rendererType","containerInline"),zs(Caption,"renderChildren",!0),zs(Caption,"includeBlankStringChildren",!0);class Endpoint extends Point{static createAttributesObject(){let rs=super.createAttributesObject();return rs.open={createComponentOfType:"boolean",createStateVariable:"open",defaultValue:!1,public:!0,forRenderer:!0},rs.switchable={createComponentOfType:"boolean",createStateVariable:"switchable",defaultValue:!1,public:!0,forRenderer:!0},rs}async switchPoint({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){if(await this.stateValues.switchable)return await this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"open",value:!await this.stateValues.open}],actionId:rs,sourceInformation:ns,skipRendererUpdate:ss,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{open:!await this.stateValues.open}}});this.coreFunctions.resolveAction({actionId:rs})}}zs(Endpoint,"componentType","endpoint"),zs(Endpoint,"rendererType","point");class Sort extends CompositeComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.assignNamesSkip={createPrimitiveOfType:"number"},rs.sortVectorsBy={createComponentOfType:"text",createStateVariable:"sortVectorsBy",defaultValue:"displacement",public:!0,toLowerCase:!0,validValues:["displacement","tail"]},rs.sortByComponent={createComponentOfType:"integer",createStateVariable:"sortByComponent",defaultValue:"1",public:!0},rs.sortByProp={createPrimitiveOfType:"string"},rs}static returnChildGroups(){return[{group:"anything",componentTypes:["_base"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.propName={returnDependencies:()=>({propName:{dependencyType:"attributePrimitive",attributeName:"sortByProp"}}),definition:function({dependencyValues:ns}){return{setValue:{propName:ns.propName}}}},rs.componentNamesForValues={returnDependencies:()=>({children:{dependencyType:"child",childGroups:["anything"],variableNames:["componentNamesInList"],variablesOptional:!0}}),definition({dependencyValues:ns}){let ss=[];for(let os of ns.children)os.stateValues.componentNamesInList?ss.push(...os.stateValues.componentNamesInList):ss.push(os.componentName);return{setValue:{componentNamesForValues:ss}}}},rs.sortedValues={stateVariablesDeterminingDependencies:["componentNamesForValues","sortByComponent","propName"],returnDependencies({stateValues:ns}){let ss={sortVectorsBy:{dependencyType:"stateVariable",variableName:"sortVectorsBy"},sortByComponent:{dependencyType:"stateVariable",variableName:"sortByComponent"},propName:{dependencyType:"stateVariable",variableName:"propName"}};if(ns.propName)for(let[os,ls]of ns.componentNamesForValues.entries())ss[`component${os}`]={dependencyType:"stateVariable",componentName:ls,variableName:ns.propName,variablesOptional:!0,caseInsensitiveVariableMatch:!0,publicStateVariablesOnly:!0,returnAsComponentObject:!0};else for(let[os,ls]of ns.componentNamesForValues.entries())ss[`component${os}`]={dependencyType:"multipleStateVariables",componentName:ls,variableNames:["value",`x${ns.sortByComponent}`,`tailX${ns.sortByComponent}`],variablesOptional:!0};return ss},definition({dependencyValues:ns,componentInfoObjects:ss}){let os=[],ls=!0;for(let us in ns){if(us.substring(0,9)!=="component")continue;let cs=ns[us];if(ns.propName){let ds=Object.values(cs.stateValues)[0];os.push({componentName:cs.componentName,numericalValue:Number(ds),textValue:String(ds)}),Number.isFinite(ds)||(ls=!1)}else if(ss.isInheritedComponentType({inheritedComponentType:cs.componentType,baseComponentType:"number"}))os.push({componentName:cs.componentName,numericalValue:cs.stateValues.value,textValue:String(cs.stateValues.value)});else if(ss.isInheritedComponentType({inheritedComponentType:cs.componentType,baseComponentType:"text"})){let ds=NaN,ps=cs.stateValues.value;os.push({componentName:cs.componentName,numericalValue:ds,textValue:ps}),ls=!1}else if(ss.isInheritedComponentType({inheritedComponentType:cs.componentType,baseComponentType:"math"})){let ds=cs.stateValues.value.evaluate_to_constant();Number.isNaN(ds)&&(ls=!1),os.push({componentName:cs.componentName,numericalValue:ds,textValue:cs.stateValues.value.toString()})}else if(ss.isInheritedComponentType({inheritedComponentType:cs.componentType,baseComponentType:"point"})){let ds=cs.stateValues[`x${ns.sortByComponent}`],ps=NaN,fs="";ds&&(ps=ds.evaluate_to_constant(),Number.isNaN(ps)&&(ls=!1),fs=ds.toString()),os.push({componentName:cs.componentName,numericalValue:ps,textValue:fs})}else if(ss.isInheritedComponentType({inheritedComponentType:cs.componentType,baseComponentType:"vector"})){let ds=NaN,ps="",fs=cs.stateValues[`x${ns.sortByComponent}`];ns.sortVectorsBy==="displacement"?fs=cs.stateValues[`x${ns.sortByComponent}`]:fs=cs.stateValues[`tailX${ns.sortByComponent}`],fs&&(ds=fs.evaluate_to_constant(),Number.isNaN(ds)&&(ls=!1),ps=fs.toString()),os.push({componentName:cs.componentName,numericalValue:ds,textValue:ps})}}return ls?os.sort((us,cs)=>us.numericalValue-cs.numericalValue):os.sort((us,cs)=>us.textValue>cs.textValue?1:us.textValue({sortedValues:{dependencyType:"stateVariable",variableName:"sortedValues"}}),markStale:()=>({updateReplacements:!0}),definition:function(){return{setValue:{readyToExpandWhenResolved:!0}}}},rs}static async createSerializedReplacements({component:rs,components:ns,componentInfoObjects:ss,workspace:os}){let ls=[],us=[];for(let ds of await rs.stateValues.sortedValues){let ps;ds.listInd===void 0?ps=ns[ds.componentName]:ps=ns[ds.componentName].activeChildren[ds.listInd],ps&&(us.push(ps.componentName),ls.push(await ps.serialize({sourceAttributesToIgnoreRecursively:["isResponse"]})))}os.uniqueIdentifiersUsed=[],ls=postProcessCopy({serializedComponents:ls,componentName:rs.componentName,uniqueIdentifiersUsed:os.uniqueIdentifiersUsed,addShadowDependencies:!0,markAsPrimaryShadow:!0});let cs=processAssignNames({assignNames:rs.doenetAttributes.assignNames,serializedComponents:ls,parentName:rs.componentName,parentCreatesNewNamespace:await rs.stateValues.newNamespace,componentInfoObjects:ss});return os.componentsCopied=us,{replacements:cs.serializedComponents}}static async calculateReplacementChanges({component:rs,components:ns,componentInfoObjects:ss,workspace:os}){let ls=[];for(let ds of await rs.stateValues.sortedValues){let ps;ds.listInd===void 0?ps=ns[ds.componentName]:ps=ns[ds.componentName].activeChildren[ds.listInd],ps&&ls.push(ps.componentName)}if(ls.length==os.componentsCopied.length&&os.componentsCopied.every((ds,ps)=>ds===ls[ps]))return[];let us=(await this.createSerializedReplacements({component:rs,components:ns,componentInfoObjects:ss,workspace:os})).replacements;return[{changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:0,numberReplacementsToReplace:rs.replacements.length,serializedReplacements:us}]}}zs(Sort,"componentType","sort"),zs(Sort,"stateVariableToEvaluateAfterReplacements","readyToExpandWhenResolved"),zs(Sort,"assignNamesToReplacements",!0);class Shuffle extends CompositeComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.assignNamesSkip={createPrimitiveOfType:"number"},rs}static returnChildGroups(){return[{group:"anything",componentTypes:["_base"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.originalComponentNames={additionalStateVariablesDefined:["nComponents"],returnDependencies:()=>({children:{dependencyType:"child",childGroups:["anything"],variableNames:["componentNamesInList"],variablesOptional:!0}}),definition({dependencyValues:ns}){let ss=[];for(let os of ns.children)os.stateValues.componentNamesInList?ss.push(...os.stateValues.componentNamesInList):ss.push(os.componentName);return{setValue:{originalComponentNames:ss,nComponents:ss.length}}}},rs.componentOrder={returnDependencies({sharedParameters:ns}){return{variantSeed:{dependencyType:"value",value:ns.variantSeed},rngClass:{dependencyType:"value",value:ns.rngClass,doNotProxy:!0},nComponents:{dependencyType:"stateVariable",variableName:"nComponents"},variants:{dependencyType:"variants"}}},definition({dependencyValues:ns}){var cs,ds;let ss=ns.nComponents,os=(ds=(cs=ns.variants)==null?void 0:cs.desiredVariant)==null?void 0:ds.indices;if(os!==void 0)if(os.length!==ss)console.warn("Ignoring indices specified for shuffle as number of indices doesn't match number of components.");else{if(os=os.map(Number),!os.every(Number.isInteger))throw Error("All indices specified for shuffle must be integers");if(!os.every(ps=>ps>=1&&ps<=ss))console.warn("Ignoring indices specified for shuffle as some indices out of range.");else return{setValue:{componentOrder:os}}}let ls=ns.rngClass(ns.variantSeed+"co"),us=[...Array(ss).keys()].map(ps=>ps+1);for(let ps=ss-1;ps>0;ps--){const fs=ls(),hs=Math.floor(fs*(ps+1));[us[ps],us[hs]]=[us[hs],us[ps]]}return{setValue:{componentOrder:us}}}},rs.readyToExpandWhenResolved={returnDependencies:()=>({sortedValues:{dependencyType:"stateVariable",variableName:"componentOrder"}}),markStale:()=>({updateReplacements:!0}),definition:function(){return{setValue:{readyToExpandWhenResolved:!0}}}},rs.generatedVariantInfo={additionalStateVariablesDefined:["isVariantComponent"],returnDependencies:({componentInfoObjects:ns,sharedParameters:ss})=>({variantSeed:{dependencyType:"value",value:ss.variantSeed},componentOrder:{dependencyType:"stateVariable",variableName:"componentOrder"},variantDescendants:{dependencyType:"descendant",componentTypes:Object.keys(ns.componentTypesCreatingVariants),variableNames:["isVariantComponent","generatedVariantInfo"],useReplacementsForComposites:!0,recurseToMatchedChildren:!1,variablesOptional:!0,includeNonActiveChildren:!0,ignoreReplacementsOfEncounteredComposites:!0}}),definition({dependencyValues:ns,componentName:ss}){let os={seed:ns.variantSeed,meta:{createdBy:ss},indices:ns.componentOrder},ls=os.subvariants=[];for(let us of ns.variantDescendants)us.stateValues.isVariantComponent?ls.push(us.stateValues.generatedVariantInfo):us.stateValues.generatedVariantInfo&&ls.push(...us.stateValues.generatedVariantInfo.subvariants);return{setValue:{generatedVariantInfo:os,isVariantComponent:!0}}}},rs}static setUpVariant({serializedComponent:rs,sharedParameters:ns,descendantVariantComponents:ss}){setUpVariantSeedAndRng({serializedComponent:rs,sharedParameters:ns,descendantVariantComponents:ss})}static async createSerializedReplacements({component:rs,components:ns,componentInfoObjects:ss,workspace:os}){let ls=[],us=[],cs=await rs.stateValues.originalComponentNames;for(let ps of await rs.stateValues.componentOrder){let fs=ns[cs[ps-1]];fs&&(us.push(fs.componentName),ls.push(await fs.serialize({sourceAttributesToIgnoreRecursively:["isResponse"]})))}os.uniqueIdentifiersUsed=[],ls=postProcessCopy({serializedComponents:ls,componentName:rs.componentName,uniqueIdentifiersUsed:os.uniqueIdentifiersUsed,addShadowDependencies:!0,markAsPrimaryShadow:!0});let ds=processAssignNames({assignNames:rs.doenetAttributes.assignNames,serializedComponents:ls,parentName:rs.componentName,parentCreatesNewNamespace:await rs.stateValues.newNamespace,componentInfoObjects:ss});return os.componentsCopied=us,{replacements:ds.serializedComponents}}static async calculateReplacementChanges({component:rs,components:ns,componentInfoObjects:ss,workspace:os}){let ls=[],us=await rs.stateValues.originalComponentNames;for(let ps of await rs.stateValues.componentOrder){let fs=ns[us[ps-1]];fs&&ls.push(fs.componentName)}if(ls.length==os.componentsCopied.length&&os.componentsCopied.every((ps,fs)=>ps===ls[fs]))return[];let cs=(await this.createSerializedReplacements({component:rs,components:ns,componentInfoObjects:ss,workspace:os})).replacements;return[{changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:0,numberReplacementsToReplace:rs.replacements.length,serializedReplacements:cs}]}static determineNumberOfUniqueVariants({serializedComponent:rs,componentInfoObjects:ns}){var cs,ds,ps;let ss=0;for(let fs of rs.children)if(ns.isInheritedComponentType({inheritedComponentType:fs.componentType,baseComponentType:"_composite"}))if((cs=fs.attributes.createComponentOfType)!=null&&cs.primitive)if(((ds=fs.attributes.nComponents)==null?void 0:ds.primitive)!==void 0){let hs=Number((ps=fs.attributes.nComponents)==null?void 0:ps.primitive);if(Number.isInteger(hs)&&hs>=0)ss+=hs;else return{success:!1}}else ss++;else return{success:!1};else ss++;let os=1;for(let fs=2;fs<=ss;fs++)os*=fs;let ls=super.determineNumberOfUniqueVariants({serializedComponent:rs,componentInfoObjects:ns});if(!ls.success)return{success:!1};let us=ls.numberOfVariants*os;return rs.variants.numberOfVariants=us,rs.variants.uniqueVariantData={numberOfVariantsByDescendant:rs.variants.uniqueVariantData.numberOfVariantsByDescendant,numberOfPermutations:os,nComponents:ss},{success:!0,numberOfVariants:us}}static getUniqueVariant({serializedComponent:rs,variantIndex:ns,componentInfoObjects:ss}){var Ts;let os=(Ts=rs.variants)==null?void 0:Ts.numberOfVariants;if(os===void 0)return{success:!1};if(!Number.isInteger(ns)||ns<1||ns>os)return{success:!1};let ls=rs.variants.uniqueVariantData.numberOfVariantsByDescendant,us=rs.variants.descendantVariantComponents,cs=rs.variants.uniqueVariantData.numberOfPermutations,ds=rs.variants.uniqueVariantData.nComponents,ps=[...ls];ps.push(cs);let fs=enumerateCombinations({numberOfOptionsByIndex:ps,maxNumber:ns})[ns-1].map(Ss=>Ss+1),hs=fs.pop(),gs=fs,ys=[...Array(ds).keys()].map(Ss=>Ss+1),bs=enumeratePermutations({values:ys,maxNumber:hs})[hs-1],vs=!1,xs=[];for(let Ss=0;Ss1){let Ns=us[Ss],ws=ss.allComponentClasses[Ns.componentType].getUniqueVariant({serializedComponent:Ns,variantIndex:gs[Ss],componentInfoObjects:ss});if(!ws.success)return{success:!1};xs.push(ws.desiredVariant),vs=!0}else xs.push({});let Cs={indices:bs};return vs&&(Cs.subvariants=xs),{success:!0,desiredVariant:Cs}}}zs(Shuffle,"componentType","shuffle"),zs(Shuffle,"createsVariants",!0),zs(Shuffle,"stateVariableToEvaluateAfterReplacements","readyToExpandWhenResolved"),zs(Shuffle,"assignNamesToReplacements",!0);class SolveEquations extends InlineComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.variables={createComponentOfType:"variables"},rs.nDiscretizationPoints={createComponentOfType:"number",createStateVariable:"nDiscretizationPoints",defaultValue:100,public:!0},rs.minVar={createComponentOfType:"number",createStateVariable:"minVar",defaultValue:null},rs.maxVar={createComponentOfType:"number",createStateVariable:"maxVar",defaultValue:null},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss}){return ss.every(os=>typeof os=="string"||os.doenetAttributes&&os.doenetAttributes.createdFromMacro)?ss.length===1&&typeof ss[0]!="string"?{success:!1}:{success:!0,newChildren:[{componentType:"math",children:ss}]}:{success:!1}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"maths",componentTypes:["math"]},{group:"strings",componentTypes:["string"]}]}static returnStateVariableDefinitions({numerics:rs}){let ns=super.returnStateVariableDefinitions({numerics:rs});return ns.variables={isArray:!0,public:!0,shadowingInstructions:{createComponentOfType:"variable"},entryPrefixes:["variable"],returnArraySizeDependencies:()=>({}),returnArraySize({dependencyValues:ss}){return[1]},returnArrayDependenciesByKey({arrayKeys:ss}){return{globalDependencies:{variablesAttr:{dependencyType:"attributeComponent",attributeName:"variables",variableNames:["variables"]}}}},arrayDefinitionByKey({globalDependencyValues:ss,arraySize:os,arrayKeys:ls,usedDefault:us}){let cs=[];return ss.variablesAttr!==null&&(cs=ss.variablesAttr.stateValues.variables),{setValue:{variables:returnNVariables(os[0],cs)}}}},ns.variable={isAlias:!0,targetVariableName:"variable1"},ns.allSolutions={returnDependencies:()=>({mathChild:{dependencyType:"child",childGroups:["maths"],variableNames:["value"]},variables:{dependencyType:"stateVariable",variableName:"variables"},minVar:{dependencyType:"stateVariable",variableName:"minVar"},maxVar:{dependencyType:"stateVariable",variableName:"maxVar"},nDiscretizationPoints:{dependencyType:"stateVariable",variableName:"nDiscretizationPoints"}}),definition({dependencyValues:ss}){if(ss.mathChild.length===0)return{setValue:{allSolutions:[]}};let os=ss.mathChild[0].stateValues.value;if(!(Array.isArray(os.tree)&&os.tree.length===3&&os.tree[0]==="="))return{setValue:{allSolutions:[]}};let ls=ss.minVar,us=ss.maxVar,cs=[],ds=ss.variables[0].subscripts_to_strings().tree,ps=Context.fromAst(["+",os.tree[1],["-",os.tree[2]]]).subscripts_to_strings(),fs=ps.f(),hs=Es=>fs({[ds]:Es}),gs=Es=>normalizeMathExpression({value:ps.substitute({[ds]:Es}).strings_to_subscripts(),simplify:!0,expand:!0}).evaluate_to_constant(),ys=function(Es){try{return hs(Es)}catch{return NaN}},bs=function(Es){try{return hs(Es)}catch{let $s=gs(Es);return $s!==null?$s:NaN}};if(Number.isFinite(ls)||(ls=-10),Number.isFinite(us)||(us=10),ls>us)return{setValue:{allSolutions:[]}};let vs=[ls,us],xs=[ls];for(let Es=0;Es0){for(let ks=0;ks<10;ks++)if(Ns=.1*Ns+.9*_s,Ds=.1*Ds+.9*_s,As=ys(Ns),Os=ys(Ds),As*Os<0){As*Vs<0?(cs.push(rs.fzero(ys,[Is,Ns])),cs.push(_s)):(cs.includes(_s)||cs.push(_s),_s=Ds,$s=Os),Rs=!0;break}}}!Rs&&!cs.includes(_s)&&cs.push(_s)}else if($s*As<0)cs.push(rs.fzero(ys,[Ns,_s]));else if(As!==0&&Es0&&($s>0&&As>$s||$s<0&&As<$s)){let Os;As>$s?Os=ys:Os=Vs=>-ys(Vs);let Is=rs.fminbr(Os,[Ns,Rs],void 0,1e-10);if(Is.success){let Vs=Is.x,ks=ys(Vs);ks*As<0?(cs.push(rs.fzero(ys,[Ns,Vs])),_s=Vs,$s=ks):ks===0&&cs.push(Vs)}}}Ns=_s,As=$s}return cs=cs.filter(Es=>Es>=ls&&Es<=us),{setValue:{allSolutions:cs.map(Es=>Context.fromAst(Es))}}}},ns.numberSolutions={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({allSolutions:{dependencyType:"stateVariable",variableName:"allSolutions"}}),definition({dependencyValues:ss}){return{setValue:{numberSolutions:ss.allSolutions.length}}}},ns.solutions={public:!0,shadowingInstructions:{createComponentOfType:"math"},isArray:!0,entryPrefixes:["solution"],returnArraySizeDependencies:()=>({numberSolutions:{dependencyType:"stateVariable",variableName:"numberSolutions"}}),returnArraySize({dependencyValues:ss}){return[ss.numberSolutions]},returnArrayDependenciesByKey(){return{globalDependencies:{allSolutions:{dependencyType:"stateVariable",variableName:"allSolutions"}}}},arrayDefinitionByKey({globalDependencyValues:ss}){let os={};for(let ls=0;ls({parentOpen:{dependencyType:"parentStateVariable",variableName:"open"}}),markStale:()=>({updateReplacements:!0}),definition({dependencyValues:ns}){return{setValue:{rendered:!!ns.parentOpen}}}},rs}static async calculateReplacementChanges({component:rs,componentInfoObjects:ns}){if(await rs.stateValues.rendered&&rs.replacements.length===0){let ss=(await this.createSerializedReplacements({component:rs,componentInfoObjects:ns})).replacements;return ss.length>0?[{changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:0,numberReplacementsToReplace:0,serializedReplacements:ss}]:[]}else return[]}}zs(SolutionContainer,"componentType","_solutionContainer"),zs(SolutionContainer,"stateVariableToEvaluateAfterReplacements","open");class SubsetOfRealsInput extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{addPoint:this.addPoint.bind(this),deletePoint:this.deletePoint.bind(this),movePoint:this.movePoint.bind(this),togglePoint:this.togglePoint.bind(this),toggleInterval:this.toggleInterval.bind(this),clear:this.clear.bind(this),setToR:this.setToR.bind(this),recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.xmin={createComponentOfType:"number",createStateVariable:"xmin",defaultValue:-10,public:!0,forRenderer:!0},rs.xmax={createComponentOfType:"number",createStateVariable:"xmax",defaultValue:10,public:!0,forRenderer:!0},rs.width={createComponentOfType:"_componentSize",createStateVariable:"width",defaultValue:800,public:!0,forRenderer:!0},rs.height={createComponentOfType:"_componentSize",createStateVariable:"height",defaultValue:300,public:!0,forRenderer:!0},rs.xlabel={createComponentOfType:"text",createStateVariable:"xlabel",defaultValue:"",public:!0,forRenderer:!0},rs.dx={createComponentOfType:"number",createStateVariable:"dx",defaultValue:.5,public:!0},rs.variable={createComponentOfType:"variable",createStateVariable:"variable",defaultValue:Context.fromAst("x"),public:!0},rs.format={createComponentOfType:"text",createStateVariable:"format",defaultValue:"text",public:!0},rs.prefill={createComponentOfType:"text",createStateVariable:"prefill",defaultValue:"",public:!0},rs.bindValueTo={createComponentOfType:"subsetOfReals"},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.subsetValue={public:!0,shadowingInstructions:{createComponentOfType:"subsetOfReals"},hasEssential:!0,returnDependencies:()=>({bindValueTo:{dependencyType:"attributeComponent",attributeName:"bindValueTo",variableNames:["subsetValue"]},prefill:{dependencyType:"stateVariable",variableName:"prefill"},variable:{dependencyType:"stateVariable",variableName:"variable"},format:{dependencyType:"stateVariable",variableName:"format"}}),definition:function({dependencyValues:ns}){return ns.bindValueTo?{setValue:{subsetValue:ns.bindValueTo.stateValues.subsetValue}}:{useEssentialOrDefaultValue:{subsetValue:{get defaultValue(){return parseValueIntoSubset({inputString:ns.prefill,format:ns.format,variable:ns.variable})}}}}},inverseDefinition({desiredStateVariableValues:ns,dependencyValues:ss}){return ss.bindValueTo?{success:!0,instructions:[{setDependency:"bindValueTo",desiredValue:ns.subsetValue,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"subsetValue",value:ns.subsetValue}]}}},rs.pointsFromSubset={additionalStateVariablesDefined:["intervalsFromSubset"],returnDependencies:()=>({subsetValue:{dependencyType:"stateVariable",variableName:"subsetValue"}}),definition({dependencyValues:ns}){function ss(ps,fs){var ys;let hs=[],gs=[];if(ps.points&&(hs=ps.points),ps.intervals&&(gs=ps.intervals),fs.points){let bs=hs.map(vs=>vs.value);for(let vs of fs.points){let xs=bs.indexOf(vs.value);xs===-1?hs.push(vs):(ys=hs[xs]).inSubset||(ys.inSubset=vs.inSubset)}}return fs.intervals&&gs.push(...fs.intervals),{points:hs,intervals:gs}}function os(ps){if(ps===null||ps.isEmpty())return{};if(ps instanceof theModule.Union){let fs=[],hs=[];for(let gs of ps.subsets){let ys=os(gs);({points:fs,intervals:hs}=ss({points:fs,intervals:hs},ys))}return{points:fs,intervals:hs}}else{if(ps instanceof theModule.RealLine)return{intervals:[[-1/0,1/0]]};if(ps instanceof theModule.Singleton)return{points:[{value:ps.element,inSubset:!0}]};if(ps instanceof theModule.OpenInterval){let fs=[[ps.left,ps.right]],hs=[];return Number.isFinite(ps.left)&&hs.push({value:ps.left,inSubset:!1}),Number.isFinite(ps.right)&&hs.push({value:ps.right,inSubset:!1}),{intervals:fs,points:hs}}}return{}}let{points:ls,intervals:us}=os(ns.subsetValue),cs=ls||[],ds=us||[];return cs.sort((ps,fs)=>ps.value-fs.value),ds.sort((ps,fs)=>ps[0]-fs[0]),{setValue:{pointsFromSubset:cs,intervalsFromSubset:ds}}}},rs.additionalPoints={defaultValue:[],hasEssential:!0,returnDependencies:()=>({}),definition(){return{useEssentialOrDefaultValue:{additionalPoints:!0}}},inverseDefinition({desiredStateVariableValues:ns}){return ns.additionalPoints.every(Number.isFinite)?{success:!0,instructions:[{setEssentialValue:"additionalPoints",value:[...ns.additionalPoints].sort((ss,os)=>ss-os)}]}:{success:!1}}},rs.points={additionalStateVariablesDefined:[{variableName:"intervals",forRenderer:!0}],forRenderer:!0,returnDependencies:()=>({pointsFromSubset:{dependencyType:"stateVariable",variableName:"pointsFromSubset"},intervalsFromSubset:{dependencyType:"stateVariable",variableName:"intervalsFromSubset"},additionalPoints:{dependencyType:"stateVariable",variableName:"additionalPoints"}}),definition({dependencyValues:ns}){let ss=[...ns.pointsFromSubset],os=[...ns.intervalsFromSubset],ls=[...ns.additionalPoints].sort((ys,bs)=>ys-bs),us=[],cs=[],ds=0,ps=1/0,fs=0;ls.length>0&&(ps=ls[0]);let hs=os[0],gs=-1/0;ss.push({value:1/0,inSubset:!1});for(let ys of ss){let bs=!1;for(hs&&hs[0]hs.value).includes(us)){let hs=!1;for(let gs of ds)if(gs[0]us){hs=!0;break}if(hs)return ps.push(us),await this.coreFunctions.performUpdate({updateInstructions:[{componentName:this.componentName,updateType:"updateValue",stateVariable:"additionalPoints",value:ps}],actionId:ns,sourceInformation:ss,skipRendererUpdate:os,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{addedPoint:us,intervalsFromSubset:ds,pointsFromSubset:cs,additionalPoints:ps}}});{cs.push({value:us,inSubset:!0});let gs=await this.createUpdateInstructions({intervalsFromSubset:ds,pointsFromSubset:cs,modifiedAdditionalPoints:!1,additionalPoints:ps});return await this.coreFunctions.performUpdate({updateInstructions:gs,actionId:ns,sourceInformation:ss,skipRendererUpdate:os,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{addedPoint:us,intervalsFromSubset:ds,pointsFromSubset:cs,additionalPoints:ps}}})}}this.coreFunctions.resolveAction({actionId:ns})}async deletePoint({pointInd:rs,actionId:ns,sourceInformation:ss={},skipRendererUpdate:os=!1}){let ls=await this.stateValues.points[rs],us=[...await this.stateValues.additionalPoints],cs=[...await this.stateValues.pointsFromSubset],ds=[...await this.stateValues.intervalsFromSubset];if(ls.isAdditional)return us.splice(ls.additionalPointInd,1),await this.coreFunctions.performUpdate({updateInstructions:[{componentName:this.componentName,updateType:"updateValue",stateVariable:"additionalPoints",value:us}],actionId:ns,sourceInformation:ss,skipRendererUpdate:os,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{deletedPoint:ls.value,intervalsFromSubset:ds,pointsFromSubset:cs,additionalPoints:us}}});{let ps=!1,fs=cs.map(bs=>bs.value).indexOf(ls.value),hs=ds.map(bs=>bs[1]).indexOf(ls.value),gs=ds.map(bs=>bs[0]).indexOf(ls.value);if(hs!==-1)if(gs!==-1)ds[hs]=[ds[hs][0],ds[gs][1]],ds.splice(gs,1),cs.splice(fs,1);else{let bs=(await this.stateValues.points)[rs-1];bs&&bs.isAdditional?(ds[hs]=[ds[hs][0],bs.value],us.splice(ls.additionalPointInd,1),ps=!0,cs.splice(fs,1,bs)):(ds.splice(hs,1),cs.splice(fs,1),bs&&!bs.inSubset&&ds.map(xs=>xs[1]).indexOf(bs.value)===-1&&(us.push(bs.value),ps=!0))}else if(gs!==-1){let bs=(await this.stateValues.points)[rs+1];bs&&bs.isAdditional?(ds[gs]=[bs.value,ds[gs][1]],us.splice(ls.additionalPointInd,1),ps=!0,cs.splice(fs,1,bs)):(ds.splice(gs,1),cs.splice(fs,1),bs&&!bs.inSubset&&ds.map(xs=>xs[0]).indexOf(bs.value)===-1&&(us.push(bs.value),ps=!0))}else cs.splice(fs,1);let ys=await this.createUpdateInstructions({intervalsFromSubset:ds,pointsFromSubset:cs,modifiedAdditionalPoints:ps,additionalPoints:us});return await this.coreFunctions.performUpdate({updateInstructions:ys,actionId:ns,sourceInformation:ss,skipRendererUpdate:os,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{deletedPoint:ls.value,intervalsFromSubset:ds,pointsFromSubset:cs,additionalPoints:us}}})}}async createUpdateInstructions({intervalsFromSubset:rs,pointsFromSubset:ns,modifiedAdditionalPoints:ss,additionalPoints:os}){let ls=await this.stateValues.dx,us=fs=>Math.round(fs/ls)*ls,cs=[];for(let fs of rs)cs.push(new theModule.OpenInterval(us(fs[0]),us(fs[1])));for(let fs of ns)fs.inSubset&&cs.push(new theModule.Singleton(us(fs.value)));let ds;cs.length===0?ds=new theModule.EmptySet:cs.length===1?ds=cs[0]:ds=new theModule.Union(cs);let ps=[{componentName:this.componentName,updateType:"updateValue",stateVariable:"subsetValue",value:ds}];return ss&&ps.push({componentName:this.componentName,updateType:"updateValue",stateVariable:"additionalPoints",value:os.map(us)}),ps}async movePoint({pointInd:rs,value:ns,transient:ss,actionId:os,sourceInformation:ls={},skipRendererUpdate:us=!1}){let cs=await this.stateValues.dx,ds=Math.round(Math.max(await this.stateValues.xmin,Math.min(await this.stateValues.xmax,ns))/cs)*cs,ps=await this.stateValues.points,fs=ps[rs],hs=ps[rs-1];hs&&(ds=Math.max(ds,hs.value+cs));let gs=ps[rs+1];gs&&(ds=Math.min(ds,gs.value-cs));let ys=[...await this.stateValues.additionalPoints],bs=[...await this.stateValues.pointsFromSubset],vs=[...await this.stateValues.intervalsFromSubset];if(fs.isAdditional)return ys[fs.additionalPointInd]=ds,ss?await this.coreFunctions.performUpdate({updateInstructions:[{componentName:this.componentName,updateType:"updateValue",stateVariable:"additionalPoints",value:ys}],transient:!0,actionId:os,sourceInformation:ls,skipRendererUpdate:us}):await this.coreFunctions.performUpdate({updateInstructions:[{componentName:this.componentName,updateType:"updateValue",stateVariable:"additionalPoints",value:ys}],actionId:os,sourceInformation:ls,skipRendererUpdate:us,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{movedPoint:ds,intervalsFromSubset:vs,pointsFromSubset:bs,additionalPoints:ys}}});{let xs=bs.map(Ns=>Ns.value).indexOf(fs.value),Cs=vs.map(Ns=>Ns[1]).indexOf(fs.value),Ts=vs.map(Ns=>Ns[0]).indexOf(fs.value);bs[xs]={value:ds,inSubset:bs[xs].inSubset},Cs!==-1&&(vs[Cs]=[vs[Cs][0],ds]),Ts!==-1&&(vs[Ts]=[ds,vs[Ts][1]]);let Ss=await this.createUpdateInstructions({intervalsFromSubset:vs,pointsFromSubset:bs,modifiedAdditionalPoints:!1});return ss?await this.coreFunctions.performUpdate({updateInstructions:Ss,transient:!0,actionId:os,sourceInformation:ls,skipRendererUpdate:us}):await this.coreFunctions.performUpdate({updateInstructions:Ss,actionId:os,sourceInformation:ls,skipRendererUpdate:us,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{movedPoint:ds,intervalsFromSubset:vs,pointsFromSubset:bs,additionalPoints:ys}}})}}async togglePoint({pointInd:rs,actionId:ns,sourceInformation:ss={},skipRendererUpdate:os=!1}){let ls=(await this.stateValues.points)[rs],us=[...await this.stateValues.pointsFromSubset],cs=[...await this.stateValues.intervalsFromSubset],ds=[...await this.stateValues.additionalPoints],ps=!1;if(ls.isAdditional)if(ds.splice(ls.additionalPointInd,1),ps=!0,ls.inSubset){for(let[hs,gs]of cs.entries())if(gs[0]ls.value){let ys=[[gs[0],ls.value],[ls.value,gs[1]]];cs.splice(hs,1,...ys);break}}else us.push({value:ls.value,inSubset:!0});else{let hs=us.map(bs=>bs.value).indexOf(ls.value),gs=cs.map(bs=>bs[1]).indexOf(ls.value),ys=cs.map(bs=>bs[0]).indexOf(ls.value);gs!==-1?ys!==-1?(cs[gs]=[cs[gs][0],cs[ys][1]],cs.splice(ys,1),us.splice(hs,1),ds.push(ls.value),ps=!0):us[hs]={value:ls.value,inSubset:!ls.inSubset}:ys!==-1?us[hs]={value:ls.value,inSubset:!ls.inSubset}:(us.splice(hs,1),ds.push(ls.value),ps=!0)}let fs=await this.createUpdateInstructions({intervalsFromSubset:cs,pointsFromSubset:us,modifiedAdditionalPoints:ps,additionalPoints:ds});return await this.coreFunctions.performUpdate({updateInstructions:fs,actionId:ns,sourceInformation:ss,skipRendererUpdate:os,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{toggledPoint:ls.value,intervalsFromSubset:cs,pointsFromSubset:us,additionalPoints:ds}}})}async toggleInterval({intervalInd:rs,actionId:ns,sourceInformation:ss={},skipRendererUpdate:os=!1}){let ls=(await this.stateValues.intervals)[rs],us=await this.stateValues.points,cs=us[rs-1],ds=us[rs],ps=[...await this.stateValues.pointsFromSubset],fs=[...await this.stateValues.intervalsFromSubset],hs=[...await this.stateValues.additionalPoints],gs=!1;if(ls.inSubset){let bs,vs;for(let[xs,Cs]of fs.entries())if(Cs[0]<=ls.left&&Cs[1]>=ls.right){vs=Cs,bs=xs;break}if(ls.left===vs[0])if(ls.right===vs[1]){if(fs.splice(bs,1),cs&&!cs.inSubset&&fs.map(Cs=>Cs[1]).indexOf(cs.value)===-1){let Cs=ps.map(Ts=>Ts.value).indexOf(cs.value);ps.splice(Cs,1),hs.push(cs.value),gs=!0}if(ds&&!ds.inSubset&&fs.map(Cs=>Cs[0]).indexOf(ds.value)===-1){let Cs=ps.map(Ts=>Ts.value).indexOf(ds.value);ps.splice(Cs,1),hs.push(ds.value),gs=!0}}else{if(fs[bs]=[ls.right,vs[1]],cs&&!cs.inSubset&&fs.map(Cs=>Cs[1]).indexOf(cs.value)===-1){let Cs=ps.map(Ts=>Ts.value).indexOf(cs.value);ps.splice(Cs,1),hs.push(cs.value),gs=!0}ps.push({value:ds.value,inSubset:!0}),hs.splice(ds.additionalPointInd,1),gs=!0}else if(ls.right===vs[1]){if(fs[bs]=[vs[0],ls.left],ds&&!ds.inSubset&&fs.map(Cs=>Cs[0]).indexOf(ds.value)===-1){let Cs=ps.map(Ts=>Ts.value).indexOf(ds.value);ps.splice(Cs,1),hs.push(ds.value),gs=!0}ps.push({value:cs.value,inSubset:!0}),hs.splice(cs.additionalPointInd,1),gs=!0}else{let xs=[[vs[0],ls.left],[ls.right,vs[1]]];fs.splice(bs,1,...xs),ps.push({value:cs.value,inSubset:!0}),ps.push({value:ds.value,inSubset:!0}),hs.splice(ds.additionalPointInd,1),hs.splice(cs.additionalPointInd,1),gs=!0}}else{let bs=fs.map(xs=>xs[1]).indexOf(ls.left),vs=fs.map(xs=>xs[0]).indexOf(ls.right);if(bs===-1)vs===-1?(fs.push([ls.left,ls.right]),ds&&ds.isAdditional&&(hs.splice(ds.additionalPointInd,1),gs=!0),cs&&cs.isAdditional&&(hs.splice(cs.additionalPointInd,1),gs=!0)):(ds.inSubset?(fs[vs]=[ls.left,fs[vs][1]],hs.push(ds.value),gs=!0):fs.push([ls.left,ls.right]),cs&&cs.isAdditional&&(hs.splice(cs.additionalPointInd,1),gs=!0));else if(vs===-1)cs.inSubset?(fs[bs]=[fs[bs][0],ls.right],hs.push(cs.value),gs=!0):fs.push([ls.left,ls.right]),ds&&ds.isAdditional&&(hs.splice(ds.additionalPointInd,1),gs=!0);else if(cs.inSubset)if(ds.inSubset){let xs=[fs[bs][0],fs[vs][1]];fs.splice(bs,2,xs),hs.push(cs.value),hs.push(ds.value),gs=!0}else fs[bs]=[fs[bs][0],ls.right],hs.push(cs.value),gs=!0;else ds.inSubset?(fs[vs]=[ls.left,fs[vs][1]],hs.push(ds.value),gs=!0):fs.push([ls.left,ls.right])}let ys=await this.createUpdateInstructions({intervalsFromSubset:fs,pointsFromSubset:ps,modifiedAdditionalPoints:gs,additionalPoints:hs});return await this.coreFunctions.performUpdate({updateInstructions:ys,actionId:ns,sourceInformation:ss,skipRendererUpdate:os,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{toggledInterval:[ls.left,ls.right],intervalsFromSubset:fs,pointsFromSubset:ps,additionalPoints:hs}}})}async clear({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){let os=await this.createUpdateInstructions({intervalsFromSubset:[],pointsFromSubset:[],modifiedAdditionalPoints:!0,additionalPoints:[]});return await this.coreFunctions.performUpdate({updateInstructions:os,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{cleared:!0,intervalsFromSubset:[],pointsFromSubset:[],additionalPoints:[]}}})}async setToR({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){let os=await this.createUpdateInstructions({intervalsFromSubset:[[-1/0,1/0]],pointsFromSubset:[],modifiedAdditionalPoints:!0,additionalPoints:[]});return await this.coreFunctions.performUpdate({updateInstructions:os,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{setToR:!0,intervalsFromSubset:[[-1/0,1/0]],pointsFromSubset:[],additionalPoints:[]}}})}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}}zs(SubsetOfRealsInput,"componentType","subsetOfRealsInput"),zs(SubsetOfRealsInput,"variableForPlainMacro","subsetValue"),zs(SubsetOfRealsInput,"variableForPlainCopy","subsetValue");function parseValueIntoSubset({inputString:as,format:rs,variable:ns}){if(!as)return new theModule.EmptySet;let ss;if(rs==="latex")try{ss=Context.fromLatex(as)}catch{return console.warn(`Invalid latex for subsetOfRealsInput: ${as}`),new theModule.EmptySet}else if(rs==="text")try{ss=Context.fromText(as)}catch{return console.warn(`Invalid text for subsetOfRealsInput: ${as}`),new theModule.EmptySet}return buildSubsetFromMathExpression(ss,ns)}class SubsetOfReals extends MathComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.createIntervals.defaultValue=!0,rs.variable={createComponentOfType:"variable",createStateVariable:"variable",defaultValue:Context.fromAst("x")},rs.displayMode={createComponentOfType:"text",createStateVariable:"displayMode",defaultValue:"intervals",public:!0,toLowerCase:!0,validValues:["intervals","inequalities"]},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return renameStateVariable({stateVariableDefinitions:rs,oldName:"unnormalizedValue",newName:"unnormalizedValuePreliminary"}),rs.value.shadowingInstructions.createComponentOfType="math",rs.haveSingleSubsetChild={returnDependencies:()=>({mathChildren:{dependencyType:"child",childGroups:["maths"]}}),definition({dependencyValues:ns,componentInfoObjects:ss}){return{setValue:{haveSingleSubsetChild:ns.mathChildren.length===1&&ns.mathChildren.filter(ls=>ss.isInheritedComponentType({inheritedComponentType:ls.componentType,baseComponentType:"subsetOfReals"})).length===1}}}},rs.subsetValue={stateVariablesDeterminingDependencies:["haveSingleSubsetChild"],returnDependencies({stateValues:ns}){let ss={haveSingleSubsetChild:{dependencyType:"stateVariable",variableName:"haveSingleSubsetChild"}};return ns.haveSingleSubsetChild?ss.subsetChild={dependencyType:"child",childGroups:["maths"],variableNames:["subsetValue"]}:(ss.unnormalizedValuePreliminary={dependencyType:"stateVariable",variableName:"unnormalizedValuePreliminary"},ss.variable={dependencyType:"stateVariable",variableName:"variable"}),ss},definition({dependencyValues:ns}){let ss;return ns.haveSingleSubsetChild?ss=ns.subsetChild[0].stateValues.subsetValue:ss=buildSubsetFromMathExpression(ns.unnormalizedValuePreliminary,ns.variable),{setValue:{subsetValue:ss}}},async inverseDefinition({desiredStateVariableValues:ns,dependencyValues:ss,stateValues:os}){return ss.haveSingleSubsetChild?{success:!0,instructions:[{setDependency:"subsetChild",desiredValue:ns.subsetValue,childIndex:0,variableIndex:0}]}:{success:!0,instructions:[{setDependency:"unnormalizedValuePreliminary",desiredValue:mathExpressionFromSubsetValue({subsetValue:ns.subsetValue,variable:ss.variable,displayMode:await os.displayMode})}]}}},rs.unnormalizedValue={returnDependencies:()=>({subsetValue:{dependencyType:"stateVariable",variableName:"subsetValue"},displayMode:{dependencyType:"stateVariable",variableName:"displayMode"},variable:{dependencyType:"stateVariable",variableName:"variable"}}),definition({dependencyValues:ns}){return{setValue:{unnormalizedValue:mathExpressionFromSubsetValue(ns)}}},inverseDefinition({desiredStateVariableValues:ns,dependencyValues:ss}){return{success:!0,instructions:[{setDependency:"subsetValue",desiredValue:buildSubsetFromMathExpression(ns.unnormalizedValue,ss.variable)}]}}},rs}}zs(SubsetOfReals,"componentType","subsetOfReals"),zs(SubsetOfReals,"rendererType","math"),zs(SubsetOfReals,"primaryStateVariableForDefinition","subsetValue");function mathExpressionFromSubsetValue({subsetValue:as,variable:rs,displayMode:ns="intervals"}){function ss(ls){return ls===null?"_":ns==="intervals"?ls.closedInterval?["interval",["tuple",ls.left,ls.right],["tuple",!0,!0]]:ls.openClosedInterval?["interval",["tuple",ls.left,ls.right],["tuple",!1,!0]]:ls.closedOpenInterval?["interval",["tuple",ls.left,ls.right],["tuple",!0,!1]]:ls.toMathExpression().tree:ls.closedInterval?["lts",["tuple",ls.left,rs,ls.right],["tuple",!1,!1]]:ls.openClosedInterval?ls.left===-1/0?["le",rs,ls.right]:["lts",["tuple",ls.left,rs,ls.right],["tuple",!0,!1]]:ls.closedOpenInterval?ls.right===1/0?["ge",rs,ls.left]:["lts",["tuple",ls.left,rs,ls.right],["tuple",!1,!0]]:ls instanceof theModule.OpenInterval?ls.left===-1/0?["<",rs,ls.right]:ls.right===1/0?[">",rs,ls.left]:["lts",["tuple",ls.left,rs,ls.right],["tuple",!0,!0]]:ls instanceof theModule.Singleton?["=",rs,ls.element]:ls.isEmpty()?["in",rs,"∅"]:ls instanceof theModule.RealLine?["in",rs,"R"]:null}let os;if(as instanceof theModule.Union){let ls=as.subsets.filter(ds=>ds instanceof theModule.Singleton),us=as.subsets.filter(ds=>ds instanceof theModule.OpenInterval);for(let ds=0;ds(ds.left===void 0?ds.element:ds.left)-(ps.left===void 0?ps.element:ps.left)).map(ds=>ss(ds));cs.length>1?ns==="intervals"?os=Context.fromAst(["union",...cs]):os=Context.fromAst(["or",...cs]):os=Context.fromAst(cs[0])}else os=Context.fromAst(ss(as));return os}class Split extends CompositeComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.assignNamesSkip={createPrimitiveOfType:"number"},rs.type={createPrimitiveOfType:"string",createStateVariable:"type",defaultPrimitiveValue:"text",toLowerCase:!0,validValues:["text"]},rs.splitBy={createComponentOfType:"text",createStateVariable:"splitBy",defaultValue:"letter",toLowerCase:!0,validValues:["letter","word","comma"]},rs}static returnSugarInstructions(){let rs=[];function ns({matchedChildren:ss,componentAttributes:os}){let ls=os.type;return["text"].includes(ls)||(ls="text"),{success:!0,newChildren:[{componentType:ls,children:ss}]}}return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"anything",componentTypes:["_base"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.originalValue={returnDependencies:()=>({child:{dependencyType:"child",childGroups:["anything"],variableNames:["value"]}}),definition({dependencyValues:ns}){return ns.child.length>0?{setValue:{originalValue:ns.child[0].stateValues.value}}:{setValue:{originalValue:null}}},inverseDefinition({desiredStateVariableValues:ns,dependencyValues:ss}){return ss.child.length>0?{success:!0,instructions:[{setDependency:"child",desiredValue:ns.originalValue,childIndex:0,variableIndex:0}]}:{success:!1}}},rs.splitValues={returnDependencies:()=>({type:{dependencyType:"stateVariable",variableName:"type"},originalValue:{dependencyType:"stateVariable",variableName:"originalValue"},splitBy:{dependencyType:"stateVariable",variableName:"splitBy"}}),definition({dependencyValues:ns}){if(ns.originalValue===null)return{setValue:{splitValues:[]}};let ss=[];return ns.splitBy==="letter"?ss=[...ns.originalValue]:ns.splitBy==="word"?ss=ns.originalValue.split(/\s+/):ns.splitBy==="comma"?ss=ns.originalValue.split(/\s*,\s*/):ss=[ns.originalValue],{setValue:{splitValues:ss}}}},rs.readyToExpandWhenResolved={returnDependencies:()=>({splitValues:{dependencyType:"stateVariable",variableName:"splitValues"}}),markStale:()=>({updateReplacements:!0}),definition:function(){return{setValue:{readyToExpandWhenResolved:!0}}}},rs}static async createSerializedReplacements({component:rs,componentInfoObjects:ns}){var us;let ss=(us=rs.attributes.newNamespace)==null?void 0:us.primitive,os={componentType:"textList",state:{textsShadow:await rs.stateValues.splitValues},downstreamDependencies:{[rs.componentName]:[{dependencyType:"referenceShadow",compositeName:rs.componentName,propVariable:"splitValues"}]}};return{replacements:processAssignNames({assignNames:rs.doenetAttributes.assignNames,serializedComponents:[os],parentName:rs.componentName,parentCreatesNewNamespace:ss,componentInfoObjects:ns}).serializedComponents}}}zs(Split,"componentType","split"),zs(Split,"assignNamesToReplacements",!0),zs(Split,"stateVariableToEvaluateAfterReplacements","readyToExpandWhenResolved");class BestFitLine extends Line{static createAttributesObject(){let rs=super.createAttributesObject();return delete rs.draggable,delete rs.equation,delete rs.through,delete rs.slope,rs.points={createComponentOfType:"_pointListComponent"},rs}static returnSugarInstructions(){return[]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.draggable={shadowingInstructions:{createComponentOfType:"boolean"},public:!0,forRenderer:!0,returnDependencies:()=>({}),definition:()=>({setValue:{draggable:!1}})},rs.nDimensions={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({}),definition:()=>({setValue:{nDimensions:2}})},delete rs.nPointsPrescribed,delete rs.basedOnSlope,delete rs.dForSlope,delete rs.essentialPoint1x,delete rs.essentialPoint1y,delete rs.equationIdentity,delete rs.equation.stateVariablesDeterminingDependencies,rs.equation.returnDependencies=()=>({points:{dependencyType:"attributeComponent",attributeName:"points",variableNames:["points","nDimensions"]},variables:{dependencyType:"stateVariable",variableName:"variables"}}),rs.equation.definition=function({dependencyValues:ns}){if(!ns.points||ns.points.stateValues.nDimensions<2||ns.points.stateValues.points.length<1){let vs=Context.fromAst("_");return{setValue:{equation:vs,coeff0:vs,coeffvar1:vs,coeffvar2:vs}}}let ss=[],os=[];for(let vs of ns.points.stateValues.points){let xs=vs.slice(0,2).map(Cs=>Cs&&Cs.evaluate_to_constant());xs.every(Number.isFinite)&&(ss.push([1,xs[0]]),os.push([xs[1]]))}if(ss.length===0){let vs=Context.fromAst("_");return{setValue:{equation:vs,coeff0:vs,coeffvar1:vs,coeffvar2:vs}}}ss=Context.math.matrix(ss),os=Context.math.matrix(os);let ls=Context.math.transpose(ss),us=Context.math.multiply(ls,os),cs=Context.math.multiply(ls,ss),ds=Context.math.lusolve(cs,us),ps=Context.fromAst(Context.math.subset(ds,Context.math.index(0,0))),fs=Context.fromAst(Context.math.subset(ds,Context.math.index(1,0))),hs=Context.fromAst(-1),gs=ns.variables,ys=Context.fromAst(["+",["*","a","x"],"c"]).substitute({a:fs,c:ps,x:gs[0],y:gs[1]}).simplify();return{setValue:{equation:Context.fromAst(["=","y","r"]).substitute({r:ys}),coeff0:ps,coeffvar1:fs,coeffvar2:hs}}},delete rs.equation.inverseDefinition,delete rs.points.stateVariablesDeterminingDependencies,rs.points.returnArrayDependenciesByKey=function(){return{globalDependencies:{coeff0:{dependencyType:"stateVariable",variableName:"coeff0"},coeffvar1:{dependencyType:"stateVariable",variableName:"coeffvar1"},coeffvar2:{dependencyType:"stateVariable",variableName:"coeffvar2"},variables:{dependencyType:"stateVariable",variableName:"variables"},lastPointsFromInverting:{dependencyType:"stateVariable",variableName:"lastPointsFromInverting"}}}},rs}}zs(BestFitLine,"componentType","bestFitLine"),zs(BestFitLine,"rendererType","line");class RegionBetweenCurveXAxis extends GraphicalComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.boundaryValues={createComponentOfType:"numberList",createStateVariable:"boundaryValues",defaultValue:[0,1],forRenderer:!0,public:!0},rs.function={createComponentOfType:"function"},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.styleDescription={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({selectedStyle:{dependencyType:"stateVariable",variableName:"selectedStyle"},document:{dependencyType:"ancestor",componentType:"document",variableNames:["theme"]}}),definition:function({dependencyValues:ns}){var os;let ss;return((os=ns.document)==null?void 0:os.stateValues.theme)==="dark"?ss=ns.selectedStyle.fillColorWordDarkMode:ss=ns.selectedStyle.fillColorWord,{setValue:{styleDescription:ss}}}},rs.styleDescriptionWithNoun={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({styleDescription:{dependencyType:"stateVariable",variableName:"styleDescription"}}),definition:function({dependencyValues:ns}){return{setValue:{styleDescriptionWithNoun:ns.styleDescription+" region"}}}},rs.function={additionalStateVariablesDefined:[{variableName:"haveFunction",forRenderer:!0},{variableName:"fDefinition",forRenderer:!0}],returnDependencies:()=>({functionAttr:{dependencyType:"attributeComponent",attributeName:"function",variableNames:["numericalfs","nInputs","nOutputs","fDefinition"]}}),definition({dependencyValues:ns}){return ns.functionAttr===null||ns.functionAttr.stateValues.nInputs!==1||ns.functionAttr.stateValues.nOutputs!==1?{setValue:{function:()=>NaN,haveFunction:!1,fDefinition:{}}}:{setValue:{function:ns.functionAttr.stateValues.numericalfs[0],haveFunction:!0,fDefinition:ns.functionAttr.stateValues.fDefinition}}}},rs}}zs(RegionBetweenCurveXAxis,"componentType","regionBetweenCurveXAxis");class RegionHalfPlane extends GraphicalComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.horizontal={createComponentOfType:"boolean",createStateVariable:"horizontal",defaultValue:!0,public:!0},rs.boundaryValue={createComponentOfType:"number",createStateVariable:"boundaryValue",defaultValue:0,public:!0},rs.greaterThan={createComponentOfType:"boolean",createStateVariable:"greaterThan",defaultValue:!0,public:!0},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.nearestPoint={returnDependencies:()=>({horizontal:{dependencyType:"stateVariable",variableName:"horizontal"},boundaryValue:{dependencyType:"stateVariable",variableName:"boundaryValue"},greaterThan:{dependencyType:"stateVariable",variableName:"greaterThan"}}),definition({dependencyValues:ns}){let ss=ns.boundaryValue;return{setValue:{nearestPoint:function({variables:os,scales:ls}){if(!Number.isFinite(ss))return{};if(ns.horizontal)if(ns.greaterThan)if(os.x1ss){let us=Object.assign({},os);return us.x1=ss,us}else return{};else if(ns.greaterThan)if(os.x2ss){let us=Object.assign({},os);return us.x2=ss,us}else return{}}}}}},rs}}zs(RegionHalfPlane,"componentType","regionHalfPlane"),zs(RegionHalfPlane,"rendererType");class CodeEditor extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{updateImmediateValue:this.updateImmediateValue.bind(this),updateValue:this.updateValue.bind(this),updateComponents:this.updateComponents.bind(this),recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static get stateVariablesShadowedForReference(){return["value"]}static createAttributesObject(){let rs=super.createAttributesObject();return rs.prefill={createComponentOfType:"text",createStateVariable:"prefill",defaultValue:"",public:!0},rs.bindValueTo={createComponentOfType:"text"},rs.width={createComponentOfType:"_componentSize",createStateVariable:"width",defaultValue:{size:600,isAbsolute:!0},forRenderer:!0,public:!0},rs.height={createComponentOfType:"_componentSize",createStateVariable:"height",defaultValue:{size:400,isAbsolute:!0},forRenderer:!0,public:!0},rs.viewerRatio={createComponentOfType:"number",createStateVariable:"viewerRatio",defaultValue:.5,forRenderer:!0,public:!0},rs.showResults={createComponentOfType:"boolean",createStateVariable:"showResults",defaultValue:!1,forRenderer:!0,public:!0},rs.renderedName={createPrimitiveOfType:"string"},rs.staticName={createPrimitiveOfType:"string"},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss,componentAttributes:os}){if(ss.length>0)return{success:!1};let ls={componentType:"codeViewer",children:[{componentType:"renderDoenetML"}]},us=[ls];if(os.renderedName&&(ls.attributes={renderedName:{primitive:os.renderedName}},ls.children[0].props={name:os.renderedName}),os.staticName){let cs={componentType:"codeViewer",attributes:{hide:{component:{componentType:"boolean",state:{value:!0}}}},children:[{componentType:"renderDoenetML",props:{name:os.staticName}}]};us.push(cs)}return{success:!0,newChildren:us}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"codeViewers",componentTypes:["codeViewer"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.viewerHeight={returnDependencies:()=>({height:{dependencyType:"stateVariable",variableName:"height"},viewerRatio:{dependencyType:"stateVariable",variableName:"viewerRatio"}}),definition:function({dependencyValues:ns}){if(!ns.height.isAbsolute)throw Error("Codeeditor relative height not implemented");return{setValue:{viewerHeight:{size:ns.height.size*ns.viewerRatio,isAbsolute:!0}}}}},rs.value={public:!0,shadowingInstructions:{createComponentOfType:"text"},hasEssential:!0,forRenderer:!0,returnDependencies:()=>({bindValueTo:{dependencyType:"attributeComponent",attributeName:"bindValueTo",variableNames:["value"]},prefill:{dependencyType:"stateVariable",variableName:"prefill"}}),definition:function({dependencyValues:ns}){return ns.bindValueTo?{setValue:{value:ns.bindValueTo.stateValues.value}}:{useEssentialOrDefaultValue:{value:{variablesToCheck:"value",defaultValue:ns.prefill}}}},inverseDefinition:function({desiredStateVariableValues:ns,dependencyValues:ss}){return ss.bindValueTo?{success:!0,instructions:[{setDependency:"bindValueTo",desiredValue:ns.value,variableIndex:0}]}:{success:!0,instructions:[{setEssentialValue:"value",value:ns.value}]}}},rs.immediateValue={public:!0,shadowingInstructions:{createComponentOfType:"text"},hasEssential:!0,forRenderer:!0,returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition:function({dependencyValues:ns,changes:ss,justUpdatedForNewComponent:os}){return ss.value&&!os?{setValue:{immediateValue:ns.value},makeEssential:{immediateValue:!0}}:{useEssentialOrDefaultValue:{immediateValue:{variablesToCheck:"immediateValue",defaultValue:ns.value}}}},inverseDefinition:function({desiredStateVariableValues:ns,initialChange:ss,shadowedVariable:os}){let ls=[{setEssentialValue:"immediateValue",value:ns.immediateValue}];return ss||os||ls.push({setDependency:"value",desiredValue:ns.immediateValue}),{success:!0,instructions:ls}}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition:function({dependencyValues:ns}){return{setValue:{text:ns.value}}}},rs.componentType={returnDependencies:()=>({}),definition:()=>({setValue:{componentType:"text"}})},rs.viewerChild={returnDependencies:()=>({viewerChild:{dependencyType:"child",childGroups:["codeViewers"]}}),definition({dependencyValues:ns}){return ns.viewerChild.length>0?{setValue:{viewerChild:ns.viewerChild}}:{setValue:{viewerChild:null}}}},rs}updateImmediateValue({text:rs,actionId:ns,sourceInformation:ss={},skipRendererUpdate:os=!1}){if(this.stateValues.disabled)this.coreFunctions.resolveAction({actionId:ns});else return this.coreFunctions.performUpdate({updateInstructions:[{updateType:"updateValue",componentName:this.componentName,stateVariable:"immediateValue",value:rs},{updateType:"setComponentNeedingUpdateValue",componentName:this.componentName}],actionId:ns,sourceInformation:ss,skipRendererUpdate:os})}updateValue({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){if(!this.stateValues.disabled&&this.stateValues.immediateValue!==this.stateValues.value){let os=[{updateType:"updateValue",componentName:this.componentName,stateVariable:"value",value:this.stateValues.immediateValue},{updateType:"executeUpdate"},{updateType:"updateValue",componentName:this.componentName,stateVariable:"immediateValue",valueOfStateVariable:"value"},{updateType:"unsetComponentNeedingUpdateValue"}],ls={verb:"answered",object:{componentName:this.componentName,componentType:this.componentType},result:{response:this.stateValues.immediateValue,responseText:this.stateValues.immediateValue}};return this.stateValues.answerAncestor&&(ls.context={answerAncestor:this.stateValues.answerAncestor.componentName}),this.coreFunctions.performUpdate({updateInstructions:os,actionId:rs,sourceInformation:ns,skipRendererUpdate:!0,event:ls}).then(()=>{this.coreFunctions.triggerChainedActions({componentName:this.componentName,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss}),this.attributes.staticName&&this.definingChildren.length===2&&this.definingChildren[1].componentType==="codeViewer"&&this.coreFunctions.performAction({componentName:this.definingChildren[1].componentName,actionName:"updateComponents",args:{sourceInformation:ns,skipRendererUpdate:ss}})})}else this.coreFunctions.resolveAction({actionId:rs})}async updateComponents(){this.definingChildren.length===1&&this.definingChildren[0].componentType==="codeViewer"&&await this.coreFunctions.performAction({componentName:this.definingChildren[0].componentName,actionName:"updateComponents"})}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}}zs(CodeEditor,"componentType","codeEditor"),zs(CodeEditor,"variableForPlainMacro","value"),zs(CodeEditor,"variableForPlainCopy","value"),zs(CodeEditor,"renderChildren",!0),zs(CodeEditor,"processWhenJustUpdatedForNewComponent",!0);class CodeViewer extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{updateComponents:this.updateComponents.bind(this),recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.codeSource={createTargetComponentNames:!0},rs.width={createComponentOfType:"_componentSize"},rs.height={createComponentOfType:"_componentSize"},rs.hasCodeEditorParent={createComponentOfType:"boolean"},rs.renderedName={createPrimitiveOfType:"string"},rs}static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss,componentAttributes:os}){if(ss.length>0)return{success:!1};let ls={componentType:"renderDoenetML"};return os.codeSource&&(ls.attributes={codeSource:{targetComponentNames:os.codeSource}}),os.renderedName&&(ls.props={name:os.renderedName}),{success:!0,newChildren:[ls]}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"children",componentTypes:["_base"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.hasCodeEditorParent={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},forRenderer:!0,returnDependencies:()=>({codeEditorParent:{dependencyType:"parentIdentity",parentComponentType:"codeEditor"}}),definition:function({dependencyValues:ns}){return ns.codeEditorParent?{setValue:{hasCodeEditorParent:!0}}:{setValue:{hasCodeEditorParent:!1}}}},rs.width={public:!0,shadowingInstructions:{createComponentOfType:"_componentSize"},hasEssential:!0,forRenderer:!0,defaultValue:{size:600,isAbsolute:!0},returnDependencies:()=>({widthAttr:{dependencyType:"attributeComponent",attributeName:"width",variableNames:["componentSize"]},parentWidth:{dependencyType:"parentStateVariable",variableName:"width",parentComponentType:"codeEditor"}}),definition:function({dependencyValues:ns}){return ns.widthAttr?{setValue:{width:ns.widthAttr.stateValues.componentSize}}:ns.parentWidth?{setValue:{width:ns.parentWidth}}:{useEssentialOrDefaultValue:{width:!0}}}},rs.height={public:!0,shadowingInstructions:{createComponentOfType:"_componentSize"},hasEssential:!0,forRenderer:!0,defaultValue:{size:400,isAbsolute:!0},returnDependencies:()=>({heightAttr:{dependencyType:"attributeComponent",attributeName:"height",variableNames:["componentSize"]},parentViewerHeight:{dependencyType:"parentStateVariable",variableName:"viewerHeight",parentComponentType:"codeEditor"}}),definition:function({dependencyValues:ns}){return ns.heightAttr?{setValue:{height:ns.heightAttr.stateValues.componentSize}}:ns.parentViewerHeight?{setValue:{height:ns.parentViewerHeight}}:{useEssentialOrDefaultValue:{height:!0}}}},rs.codeSourceComponentName={returnDependencies:()=>({codeSource:{dependencyType:"attributeTargetComponentNames",attributeName:"codeSource"}}),definition({dependencyValues:ns}){var os;let ss;return((os=ns.codeSource)==null?void 0:os.length)===1?ss=ns.codeSource[0].absoluteName:ss=null,{setValue:{codeSourceComponentName:ss}}}},rs.codeSource={returnDependencies:()=>({codeSourceComponentName:{dependencyType:"stateVariable",variableName:"codeSourceComponentName"},codeEditorParent:{dependencyType:"parentIdentity",parentComponentType:"codeEditor"}}),definition:function({dependencyValues:ns}){return ns.codeSourceComponentName?{setValue:{codeSource:ns.codeSourceComponentName}}:ns.codeEditorParent?{setValue:{codeSource:ns.codeEditorParent.componentName}}:{setValue:{codeSource:null}}}},rs}async updateComponents(){this.definingChildren.length===1&&this.definingChildren[0].componentType==="renderDoenetML"&&await this.coreFunctions.performAction({componentName:this.definingChildren[0].componentName,actionName:"updateComponents"})}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}}zs(CodeViewer,"componentType","codeViewer"),zs(CodeViewer,"renderChildren",!0),zs(CodeViewer,"includeBlankStringChildren",!0);class RenderDoenetML extends CompositeComponent{constructor(rs){super(rs),Object.assign(this.actions,{updateComponents:this.updateComponents.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.assignNamesSkip={createPrimitiveOfType:"number"},rs.codeSource={createTargetComponentNames:!0},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.codeSourceComponentName={returnDependencies:()=>({codeSource:{dependencyType:"attributeTargetComponentNames",attributeName:"codeSource"}}),definition({dependencyValues:ns}){var os;let ss;return((os=ns.codeSource)==null?void 0:os.length)===1?ss=ns.codeSource[0].absoluteName:ss=null,{setValue:{codeSourceComponentName:ss}}}},rs.codeSource={returnDependencies:()=>({codeSourceComponentName:{dependencyType:"stateVariable",variableName:"codeSourceComponentName"},parentCodeSource:{dependencyType:"parentStateVariable",parentComponentType:"codeViewer",variableName:"codeSource"}}),definition:function({dependencyValues:ns}){return ns.codeSourceComponentName?{setValue:{codeSource:ns.codeSourceComponentName}}:ns.parentCodeSource?{setValue:{codeSource:ns.parentCodeSource}}:{setValue:{codeSource:null}}}},rs.doenetML={stateVariablesDeterminingDependencies:["codeSource"],returnDependencies:({stateValues:ns})=>({doenetML:{dependencyType:"stateVariable",componentName:ns.codeSource,variableName:"text",variablesOptional:!0}}),definition({dependencyValues:ns}){let ss="";return ns.doenetML&&(ss=ns.doenetML,typeof ss!="string"&&(ss="")),{setValue:{doenetML:ss}}}},rs.readyToExpandWhenResolved={returnDependencies:()=>({doenetML:{dependencyType:"stateVariable",variableName:"doenetML"}}),definition(){return{setValue:{readyToExpandWhenResolved:!0}}}},rs.triggerUpdates={defaultValue:!0,hasEssential:!0,returnDependencies:()=>({}),markStale(){return{updateReplacements:!0}},definition(){return{useEssentialOrDefaultValue:{triggerUpdates:{}}}},inverseDefinition({desiredStateVariableValues:ns}){return{success:!0,instructions:[{setEssentialValue:"triggerUpdates",value:ns.triggerUpdates}]}}},rs.isVariantComponent={returnDependencies:()=>({}),definition:()=>({setValue:{isVariantComponent:!0}})},rs.generatedVariantInfo={returnDependencies:({sharedParameters:ns,componentInfoObjects:ss})=>({variantSeed:{dependencyType:"value",value:ns.variantSeed},variantDescendants:{dependencyType:"descendant",componentTypes:Object.keys(ss.componentTypesCreatingVariants),variableNames:["isVariantComponent","generatedVariantInfo"],useReplacementsForComposites:!0,recurseToMatchedChildren:!1,variablesOptional:!0,includeNonActiveChildren:!0,ignoreReplacementsOfEncounteredComposites:!0}}),definition({dependencyValues:ns,componentName:ss}){let os={seed:ns.variantSeed,meta:{createdBy:ss}},ls=os.subvariants=[];for(let us of ns.variantDescendants)us.stateValues.isVariantComponent?ls.push(us.stateValues.generatedVariantInfo):us.stateValues.generatedVariantInfo&&ls.push(...us.stateValues.generatedVariantInfo.subvariants);return{setValue:{generatedVariantInfo:os}}}},rs}static async createSerializedReplacements({component:rs,componentInfoObjects:ns,flags:ss,workspace:os}){let ls=[],us=(await rs.stateValues.doenetML).trim();os.previousDoenetML=us;try{ls=(await expandDoenetMLsToFullSerializedComponents({cids:[],doenetMLs:[us],componentInfoObjects:ns,flags:ss})).fullSerializedComponents[0]}catch(ps){return console.warn("error in user entered doenetML"),console.warn(ps.message),{replacements:[]}}let cs=rs.componentName.split("/").map(ps=>({namespace:ps,componentCounts:{},namesUsed:{}}));return createComponentNames({serializedComponents:ls,componentInfoObjects:ns,namespaceStack:cs}),restrictTNamesToNamespace({components:ls,namespace:`${rs.componentName}/`}),{replacements:processAssignNames({assignNames:rs.doenetAttributes.assignNames,serializedComponents:ls,parentName:rs.componentName,parentCreatesNewNamespace:!0,componentInfoObjects:ns,originalNamesAreConsistent:!0}).serializedComponents}}static async calculateReplacementChanges({component:rs,componentChanges:ns,componentInfoObjects:ss,flags:os,workspace:ls}){let us=(await rs.stateValues.doenetML).trim();if(ls.previousDoenetML===us)return[];ls.previousDoenetML=us;let cs=(await this.createSerializedReplacements({component:rs,componentInfoObjects:ss,flags:os,workspace:ls})).replacements;return[{changeType:"add",changeTopLevelReplacements:!0,firstReplacementInd:0,numberReplacementsToReplace:rs.replacements.length,serializedReplacements:cs}]}static setUpVariant({serializedComponent:rs,sharedParameters:ns,descendantVariantComponents:ss}){setUpVariantSeedAndRng({serializedComponent:rs,sharedParameters:ns,descendantVariantComponents:ss,useSubpartVariantRng:!0})}async updateComponents({actionId:rs,sourceInformation:ns={},skipRendererUpdate:ss=!1}){let os=[{updateType:"updateValue",componentName:this.componentName,stateVariable:"triggerUpdates",value:!0}];await this.coreFunctions.performUpdate({updateInstructions:os,actionId:rs,sourceInformation:ns,skipRendererUpdate:ss})}}zs(RenderDoenetML,"componentType","renderDoenetML"),zs(RenderDoenetML,"assignNamesToReplacements",!0),zs(RenderDoenetML,"createsVariants",!0),zs(RenderDoenetML,"stateVariableToEvaluateAfterReplacements","triggerUpdates");class HasSameFactoring extends BooleanComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.variable={createComponentOfType:"variable",createStateVariable:"variable",defaultValue:Context.fromAst("x")},rs.restrictDivision={createComponentOfType:"boolean",createStateVariable:"restrictDivision",defaultValue:!1},rs.monomialFactorMustMatch={createComponentOfType:"boolean",createStateVariable:"monomialFactorMustMatch",defaultValue:!1},rs.allowOnlySignDifferences={createComponentOfType:"boolean",createStateVariable:"allowOnlySignDifferences",defaultValue:!1},rs}static returnChildGroups(){return[{group:"maths",componentTypes:["math"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return delete rs.parsedExpression,delete rs.mathChildrenByCode,rs.value={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},forRenderer:!0,returnDependencies:()=>({mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["value"]},allowedErrorInNumbers:{dependencyType:"stateVariable",variableName:"allowedErrorInNumbers"},includeErrorInNumberExponents:{dependencyType:"stateVariable",variableName:"includeErrorInNumberExponents"},allowedErrorIsAbsolute:{dependencyType:"stateVariable",variableName:"allowedErrorIsAbsolute"},nSignErrorsMatched:{dependencyType:"stateVariable",variableName:"nSignErrorsMatched"},variable:{dependencyType:"stateVariable",variableName:"variable"},restrictDivision:{dependencyType:"stateVariable",variableName:"restrictDivision"},monomialFactorMustMatch:{dependencyType:"stateVariable",variableName:"monomialFactorMustMatch"},allowOnlySignDifferences:{dependencyType:"stateVariable",variableName:"allowOnlySignDifferences"}}),definition:function({dependencyValues:ns}){if(ns.mathChildren.length!==2)return{setValue:{value:!1}};let ss=ns.mathChildren[0].stateValues.value,os=ns.mathChildren[1].stateValues.value;if(checkEquality({object1:ss,object2:os,isUnordered:!1,partialMatches:!1,symbolicEquality:!1,allowedErrorInNumbers:ns.allowedErrorInNumbers,includeErrorInNumberExponents:ns.includeErrorInNumberExponents,allowedErrorIsAbsolute:ns.allowedErrorIsAbsolute,nSignErrorsMatched:ns.nSignErrorsMatched}).fraction_equal!==1)return{setValue:{value:!1}};if(Array.isArray(ss.tree)&&ss.tree[0]==="-"&&(ss=Context.fromAst(ss.tree[1])),Array.isArray(os.tree)&&os.tree[0]==="-"&&(os=Context.fromAst(os.tree[1])),!ns.restrictDivision&&!ns.monomialFactorMustMatch&&!ns.allowOnlySignDifferences&&(Array.isArray(ss.tree)&&ss.tree[0]==="/"&&Context.fromAst(ss.tree[2]).variables().length===0&&(ss=Context.fromAst(ss.tree[1]),Array.isArray(ss.tree)&&ss.tree[0]==="-"&&(ss=Context.fromAst(ss.tree[1]))),Array.isArray(os.tree)&&os.tree[0]==="/"&&Context.fromAst(os.tree[2]).variables().length===0&&(os=Context.fromAst(os.tree[1]),Array.isArray(os.tree)&&os.tree[0]==="-"&&(os=Context.fromAst(os.tree[1])))),ss=Context.fromAst(expandPositiveIntegerPowers(ss.tree)),os=Context.fromAst(expandPositiveIntegerPowers(os.tree)),Array.isArray(ss.tree)&&ss.tree[0]==="*"){if(!(Array.isArray(os.tree)&&os.tree[0]==="*"))return{setValue:{value:!1}}}else return Array.isArray(os.tree)&&os.tree[0]==="*"?{setValue:{value:!1}}:{setValue:{value:!0}};if(ns.monomialFactorMustMatch||ns.allowOnlySignDifferences){let bs=findMonomialFromFactors(ss.tree.slice(1)),vs=findMonomialFromFactors(os.tree.slice(1));if(!bs.equals(vs)){let xs=Context.fromAst(["-",vs.tree]);if(!bs.equals(xs))return{setValue:{value:!1}}}}if(ns.allowOnlySignDifferences){let bs=normalizeFactorSigns(ss),vs=normalizeFactorSigns(os);return{setValue:{value:bs.equalsViaSyntax(vs,{allowed_error_in_numbers:ns.allowedErrorInNumbers,include_error_in_number_exponents:ns.includeErrorInNumberExponents,allowed_error_is_absolute:ns.allowedErrorIsAbsolute})}}}let us=ss.tree.slice(1).filter(bs=>Context.fromAst(bs).variables().length>0),cs=os.tree.slice(1).filter(bs=>Context.fromAst(bs).variables().length>0);if(us.length!==cs.length)return{setValue:{value:!1}};let ds=0,ps=0,fs=0,hs=0,gs=ns.variable.subscripts_to_strings().tree;for(let bs of us){let vs=Context.fromAst(bs).subscripts_to_strings().derivative(gs).derivative(gs).simplify();if(vs.tree===0)ps++;else if(vs.variables().length===0)ds++;else return{setValue:{value:!1}}}for(let bs of cs){let vs=Context.fromAst(bs).subscripts_to_strings().derivative(gs).derivative(gs).simplify();if(vs.tree===0)hs++;else if(vs.variables().length===0)fs++;else return{setValue:{value:!1}}}return{setValue:{value:ps===hs&&ds===fs}}}},rs}}zs(HasSameFactoring,"componentType","hasSameFactoring"),zs(HasSameFactoring,"rendererType","boolean");function expandPositiveIntegerPowers(as){if(!Array.isArray(as))return as;if(as[0]==="^"){let rs=as[1],ns=as[2];Number.isInteger(ns)&&ns>0&&(as=["*",...Array(ns).fill(rs)])}if(as[0]==="*"){let rs=as;as=["*"];for(let ns of rs.slice(1))if(Array.isArray(ns)&&ns[0]==="^"){let ss=ns[1],os=ns[2];Number.isInteger(os)&&os>0?as.push(...Array(os).fill(ss)):as.push(ns)}else as.push(ns)}return as}function findMonomialFromFactors(as){let rs=[],ns=!1;for(let os of as)if(typeof os=="string"||Context.fromAst(os).variables().length===0){if(!ns){if(rs.length>0)return Context.fromAst("_");ns=!0}rs.push(os)}else ns=!1;let ss;return rs.length===0?ss=1:rs.length===1?ss=rs[0]:ss=["*",...rs],Context.fromAst(ss)}function normalizeFactorSigns(as){let rs=as.simplify().tree;if(rs[0]==="-"&&(rs=rs[1]),rs[0]!=="*")return Context.fromAst(rs).simplify();let ns=["*"];for(let ss of rs.slice(1))if(typeof ss=="number")ss<0?ns.push(-ss):ns.push(ss);else if(!Array.isArray(ss))ns.push(ss);else if(ss[0]==="-")ns.push(ss[1]);else if(ss[0]==="+"){let os=!1,ls=ss[1];if(typeof ls=="number")ls<0&&(os=!0);else if(Array.isArray(ls)){if(ls[0]==="-")os=!0;else if(ls[0]==="*"){let us=ls[1];typeof us=="number"?us<0&&(os=!0):Array.isArray(us)&&us[0]==="-"&&(os=!0)}}os?ns.push(Context.fromAst(["-",ss]).simplify().tree):ns.push(ss)}else ns.push(ss);return Context.fromAst(ns).simplify()}class DataFrame extends BaseComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.source={createComponentOfType:"text",createStateVariable:"source",required:!0,public:!0,forRenderer:!0},rs.hasHeader={createComponentOfType:"boolean",createStateVariable:"hasHeader",defaultValue:!0,public:!0},rs.columnTypes={createComponentOfType:"textList",createStateVariable:"columnTypesPrelim",defaultValue:[]},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.cid={forRenderer:!0,returnDependencies:()=>({source:{dependencyType:"stateVariable",variableName:"source"}}),definition:function({dependencyValues:ns}){if(!ns.source||ns.source.substring(0,7).toLowerCase()!=="doenet:")return{setValue:{cid:null}};let ss=null,os=ns.source.match(/[:&]cid=([^&]+)/i);return os&&(ss=os[1]),{setValue:{cid:ss}}}},rs.dataFrame={stateVariablesDeterminingDependencies:["cid","source"],additionalStateVariablesDefined:[{variableName:"numRows",public:!0,shadowingInstructions:{createComponentOfType:"integer"}},{variableName:"numColumns",public:!0,shadowingInstructions:{createComponentOfType:"integer"}},{variableName:"columnTypes",public:!0,shadowingInstructions:{createComponentOfType:"textList"}},{variableName:"columnNames",public:!0,shadowingInstructions:{createComponentOfType:"textList"}}],returnDependencies:({stateValues:ns})=>({fileContents:{dependencyType:"file",cid:ns.cid,uri:ns.source,fileType:"csv"},hasHeader:{dependencyType:"stateVariable",variableName:"hasHeader"},columnTypesPrelim:{dependencyType:"stateVariable",variableName:"columnTypesPrelim"}}),definition:function({dependencyValues:ns,componentName:ss}){var gs,ys;let os=[],ls=[],us=ns.fileContents.trim().split(` -`).map(bs=>bs.trim().split(",").map(vs=>vs.trim())),cs=(gs=us[0])==null?void 0:gs.length,ds=!1;for(let bs of us.slice(1))if(bs.length!==cs){ds=!0;break}if(ds)return console.warn(`Data has invalid shape. Rows has inconsistent lengths. Found in componentName :${ss}`),{setValue:{dataFrame:null,numRows:hs,numColumns:cs,columnTypes:os,columnNames:ls}};let ps={},fs=[];if(ns.hasHeader?(ps.columnNames=us[0].map(bs=>(['"',"'"].includes(bs[0])&&bs[bs.length-1]===bs[0]&&(bs=bs.substring(1,bs.length-1)),bs)),fs=us.slice(1)):(ps.columnNames=[...Array(cs).keys()].map(bs=>`col${bs+1}`),fs=us),[...new Set(ps.columnNames)].length({numColumns:{dependencyType:"stateVariable",variableName:"numColumns"}}),returnArraySize({dependencyValues:ns}){return[ns.numColumns]},returnArrayDependenciesByKey(){return{globalDependencies:{dataFrame:{dependencyType:"stateVariable",variableName:"dataFrame"},numColumns:{dependencyType:"stateVariable",variableName:"numColumns"},numRows:{dependencyType:"stateVariable",variableName:"numRows"},columnTypes:{dependencyType:"stateVariable",variableName:"columnTypes"}}}},arrayDefinitionByKey({globalDependencyValues:ns,arrayKeys:ss}){let os={};for(let ls of ss){let us=0,cs=0;if(ns.columnTypes[ls]==="number"){for(let ds=0;ds({displayDigitsAttr:{dependencyType:"attributeComponent",attributeName:"displayDigits",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]}}),definition({dependencyValues:ns,usedDefault:ss}){if(ns.displayDigitsAttr!==null){let os=ss.displayDigitsAttr,ls=ns.displayDecimalsAttr===null||ss.displayDecimalsAttr;if(!(os||ls)){let us=ns.displayDigitsAttr.shadowDepth;ns.displayDecimalsAttr.shadowDepth({statisticsToDisplayPrelim:{dependencyType:"stateVariable",variableName:"statisticsToDisplayPrelim"}}),definition:function({dependencyValues:ns}){let ss=["mean","stdev","variance","stderr","count","minimum","quartile1","median","quartile3","maximum","range","sum"],os=[],ls=ns.statisticsToDisplayPrelim.map(us=>us.toLowerCase());if(ls.includes("default"))os=["mean","stdev","count","minimum","quartile1","median","quartile3","maximum"];else if(ls.includes("all"))os=[...ss];else for(let us of ss)ls.includes(us)&&os.push(us);return{setValue:{statisticsToDisplay:os}}}},rs.sourceName={returnDependencies:()=>({source:{dependencyType:"attributeTargetComponentNames",attributeName:"source"}}),definition({dependencyValues:ns}){var os;let ss;return((os=ns.source)==null?void 0:os.length)===1?ss=ns.source[0].absoluteName:ss=null,{setValue:{sourceName:ss}}}},rs.dataColumn={stateVariablesDeterminingDependencies:["sourceName"],additionalStateVariablesDefined:[{variableName:"columnName",public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0}],returnDependencies({stateValues:ns}){return{dataFrame:{dependencyType:"stateVariable",componentName:ns.sourceName,variableName:"dataFrame",variableOptional:!0},desiredColumn:{dependencyType:"stateVariable",variableName:"desiredColumn"}}},definition({dependencyValues:ns}){let ss=null,os=null;if(ns.dataFrame){let ls=ns.dataFrame,us=ls.columnNames.indexOf(ns.desiredColumn);if(us!==-1){os=ns.desiredColumn,ss=[];for(let cs of ls.data)cs[us]!==null&&ss.push(cs[us])}}return{setValue:{dataColumn:ss,columnName:os}}}},rs.count={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=ns.dataColumn.length),{setValue:{count:ss}}}},rs.sum={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=ns.dataColumn.reduce((os,ls)=>os+ls)),{setValue:{sum:ss}}}},rs.mean={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn!==null&&(ss=Context.math.mean(ns.dataColumn)),{setValue:{mean:ss}}}},rs.stdev={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=Context.math.std(ns.dataColumn)),{setValue:{stdev:ss}}}},rs.variance={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=Context.math.variance(ns.dataColumn)),{setValue:{variance:ss}}}},rs.stderr={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({stdev:{dependencyType:"stateVariable",variableName:"stdev"},count:{dependencyType:"stateVariable",variableName:"count"}}),definition({dependencyValues:ns}){let ss=null;return ns.stdev!==null&&(ss=ns.stdev/Math.sqrt(ns.count)),{setValue:{stderr:ss}}}},rs.minimum={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=Math.min(...ns.dataColumn)),{setValue:{minimum:ss}}}},rs.maximum={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=Math.max(...ns.dataColumn)),{setValue:{maximum:ss}}}},rs.median={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=Context.math.median(ns.dataColumn)),{setValue:{median:ss}}}},rs.quartile1={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=Context.math.quantileSeq(ns.dataColumn,.25)),{setValue:{quartile1:ss}}}},rs.quartile3={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=Context.math.quantileSeq(ns.dataColumn,.75)),{setValue:{quartile3:ss}}}},rs.range={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({minimum:{dependencyType:"stateVariable",variableName:"minimum"},maximum:{dependencyType:"stateVariable",variableName:"maximum"}}),definition({dependencyValues:ns}){let ss=null;return ns.minimum!==null&&(ss=ns.maximum-ns.minimum),{setValue:{range:ss}}}},rs.summaryStatistics={forRenderer:!0,stateVariablesDeterminingDependencies:["statisticsToDisplay"],returnDependencies({stateValues:ns}){let ss={displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"}};return ns.statisticsToDisplay.includes("mean")&&(ss.mean={dependencyType:"stateVariable",variableName:"mean"}),ns.statisticsToDisplay.includes("stdev")&&(ss.stdev={dependencyType:"stateVariable",variableName:"stdev"}),ns.statisticsToDisplay.includes("variance")&&(ss.variance={dependencyType:"stateVariable",variableName:"variance"}),ns.statisticsToDisplay.includes("stderr")&&(ss.stderr={dependencyType:"stateVariable",variableName:"stderr"}),ns.statisticsToDisplay.includes("count")&&(ss.count={dependencyType:"stateVariable",variableName:"count"}),ns.statisticsToDisplay.includes("minimum")&&(ss.minimum={dependencyType:"stateVariable",variableName:"minimum"}),ns.statisticsToDisplay.includes("quartile1")&&(ss.quartile1={dependencyType:"stateVariable",variableName:"quartile1"}),ns.statisticsToDisplay.includes("median")&&(ss.median={dependencyType:"stateVariable",variableName:"median"}),ns.statisticsToDisplay.includes("quartile3")&&(ss.quartile3={dependencyType:"stateVariable",variableName:"quartile3"}),ns.statisticsToDisplay.includes("maximum")&&(ss.maximum={dependencyType:"stateVariable",variableName:"maximum"}),ns.statisticsToDisplay.includes("range")&&(ss.range={dependencyType:"stateVariable",variableName:"range"}),ns.statisticsToDisplay.includes("sum")&&(ss.sum={dependencyType:"stateVariable",variableName:"sum"}),ss},definition({dependencyValues:ns,usedDefault:ss}){let os={};return ns.mean!==void 0&&(os.mean=roundForDisplay({value:ns.mean,dependencyValues:ns,usedDefault:ss})),ns.stdev!==void 0&&(os.stdev=roundForDisplay({value:ns.stdev,dependencyValues:ns,usedDefault:ss})),ns.variance!==void 0&&(os.variance=roundForDisplay({value:ns.variance,dependencyValues:ns,usedDefault:ss})),ns.stderr!==void 0&&(os.stderr=roundForDisplay({value:ns.stderr,dependencyValues:ns,usedDefault:ss})),ns.count!==void 0&&(os.count=roundForDisplay({value:ns.count,dependencyValues:ns,usedDefault:ss})),ns.minimum!==void 0&&(os.minimum=roundForDisplay({value:ns.minimum,dependencyValues:ns,usedDefault:ss})),ns.quartile1!==void 0&&(os.quartile1=roundForDisplay({value:ns.quartile1,dependencyValues:ns,usedDefault:ss})),ns.median!==void 0&&(os.median=roundForDisplay({value:ns.median,dependencyValues:ns,usedDefault:ss})),ns.quartile3!==void 0&&(os.quartile3=roundForDisplay({value:ns.quartile3,dependencyValues:ns,usedDefault:ss})),ns.maximum!==void 0&&(os.maximum=roundForDisplay({value:ns.maximum,dependencyValues:ns,usedDefault:ss})),ns.range!==void 0&&(os.range=roundForDisplay({value:ns.range,dependencyValues:ns,usedDefault:ss})),ns.sum!==void 0&&(os.sum=roundForDisplay({value:ns.sum,dependencyValues:ns,usedDefault:ss})),{setValue:{summaryStatistics:os}}}},rs}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}}zs(SummaryStatistics,"componentType","summaryStatistics");class Chart extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{changeAxisLimits:this.changeAxisLimits.bind(this),recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.type={createComponentOfType:"text",createStateVariable:"type",defaultValue:"histogram",toLowerCase:!0,validValues:["histogram","dotplot","frequencytable","box","bar"],forRenderer:!0},rs.column={createComponentOfType:"text",createStateVariable:"desiredColumn",defaultValue:null},rs.xmin={createComponentOfType:"number",createStateVariable:"xminPrelim",defaultValue:-10},rs.xmax={createComponentOfType:"number",createStateVariable:"xmaxPrelim",defaultValue:10},rs.ymin={createComponentOfType:"number",createStateVariable:"yminPrelim",defaultValue:-10},rs.ymax={createComponentOfType:"number",createStateVariable:"ymaxPrelim",defaultValue:10},rs.width={createComponentOfType:"_componentSize",createStateVariable:"width",defaultValue:{size:300,isAbsolute:!0},public:!0,forRenderer:!0},rs.height={createComponentOfType:"_componentSize",createStateVariable:"height",defaultValue:{size:300,isAbsolute:!0},public:!0,forRenderer:!0},rs.identicalAxisScales={createComponentOfType:"boolean",createStateVariable:"identicalAxisScales",defaultValue:!1,public:!0,forRenderer:!0},rs.displayXAxis={createComponentOfType:"boolean",createStateVariable:"displayXAxis",defaultValue:!0,public:!0,forRenderer:!0},rs.displayYAxis={createComponentOfType:"boolean",createStateVariable:"displayYAxis",defaultValue:!0,public:!0,forRenderer:!0},rs.displayXAxisTickLabels={createComponentOfType:"boolean",createStateVariable:"displayXAxisTickLabels",defaultValue:!0,public:!0,forRenderer:!0},rs.displayYAxisTickLabels={createComponentOfType:"boolean",createStateVariable:"displayYAxisTickLabels",defaultValue:!0,public:!0,forRenderer:!0},rs.xlabel={createComponentOfType:"text",createStateVariable:"xlabel",defaultValue:"",public:!0,forRenderer:!0},rs.xlabelPosition={createComponentOfType:"text",createStateVariable:"xlabelPosition",defaultValue:"right",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["right","left"]},rs.ylabel={createComponentOfType:"text",createStateVariable:"ylabel",defaultValue:"",public:!0,forRenderer:!0},rs.ylabelPosition={createComponentOfType:"text",createStateVariable:"ylabelPosition",defaultValue:"top",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["top","bottom"]},rs.ylabelAlignment={createComponentOfType:"text",createStateVariable:"ylabelAlignment",defaultValue:"left",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["left","right"]},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.dataFrame={forRenderer:!0,returnDependencies(){return{targetComponent:{dependencyType:"targetComponent",variableNames:["dataFrame"],variablesOptional:!0}}},definition({dependencyValues:ns}){var os;console.log("definition of dataFrame",ns);let ss=null;return(os=ns.targetComponent)!=null&&os.stateValues.dataFrame&&(ss=ns.targetComponent.stateValues.dataFrame),{setValue:{dataFrame:ss}}}},rs.columnName={public:!0,shadowingInstructions:{createComponentOfType:"text"},additionalStateVariablesDefined:[{variableName:"colInd",forRenderer:!0}],returnDependencies(){return{desiredColumn:{dependencyType:"stateVariable",variableName:"desiredColumn"},dataFrame:{dependencyType:"stateVariable",variableName:"dataFrame"}}},definition({dependencyValues:ns}){let ss=null,os=null;return ns.dataFrame&&(os=ns.dataFrame.columnNames.indexOf(ns.desiredColumn),os!==-1?ss=ns.desiredColumn:os=null),{setValue:{columnName:ss,colInd:os}}}},rs.xmin={stateVariablesDeterminingDependencies:["identicalAxisScales"],defaultValue:-10,public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies({stateValues:ns}){let ss={identicalAxisScales:{dependencyType:"stateVariable",variableName:"identicalAxisScales"},xminPrelim:{dependencyType:"stateVariable",variableName:"xminPrelim"}};return ns.identicalAxisScales&&(ss.xmaxPrelim={dependencyType:"stateVariable",variableName:"xmaxPrelim"},ss.yminPrelim={dependencyType:"stateVariable",variableName:"yminPrelim"},ss.ymaxPrelim={dependencyType:"stateVariable",variableName:"ymaxPrelim"},ss.width={dependencyType:"stateVariable",variableName:"width"},ss.height={dependencyType:"stateVariable",variableName:"height"}),ss},definition({dependencyValues:ns,usedDefault:ss}){if(!ns.identicalAxisScales)return{setValue:{xmin:ns.xminPrelim}};if(!ss.xminPrelim)return{setValue:{xmin:ns.xminPrelim}};let ls=!ss.xmaxPrelim,us=!ss.yminPrelim,cs=!ss.ymaxPrelim;if(us&&cs){let ps=ns.width.size/ns.height.size,fs=(ns.ymaxPrelim-ns.yminPrelim)*ps;return ls?{setValue:{xmin:ns.xmaxPrelim-fs}}:{setValue:{xmin:-fs/2}}}else return ls?{setValue:{xmin:ns.xmaxPrelim-20}}:{setValue:{xmin:-10}}},async inverseDefinition({desiredStateVariableValues:ns,stateValues:ss}){return await ss.fixAxes?{success:!1}:{success:!0,instructions:[{setDependency:"xminPrelim",desiredValue:ns.xmin}]}}},rs.xmax={stateVariablesDeterminingDependencies:["identicalAxisScales"],defaultValue:-10,public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies({stateValues:ns}){let ss={identicalAxisScales:{dependencyType:"stateVariable",variableName:"identicalAxisScales"},xmaxPrelim:{dependencyType:"stateVariable",variableName:"xmaxPrelim"}};return ns.identicalAxisScales&&(ss.xminPrelim={dependencyType:"stateVariable",variableName:"xminPrelim"},ss.yminPrelim={dependencyType:"stateVariable",variableName:"yminPrelim"},ss.ymaxPrelim={dependencyType:"stateVariable",variableName:"ymaxPrelim"},ss.width={dependencyType:"stateVariable",variableName:"width"},ss.height={dependencyType:"stateVariable",variableName:"height"}),ss},definition({dependencyValues:ns,usedDefault:ss}){if(!ns.identicalAxisScales)return{setValue:{xmax:ns.xmaxPrelim}};let os=!ss.xminPrelim,ls=!ss.xmaxPrelim,us=!ss.yminPrelim,cs=!ss.ymaxPrelim,ds=us&&cs,ps=os&&ls,fs=ns.xminPrelim;if(ds){let hs=ns.width.size/ns.height.size,gs=(ns.ymaxPrelim-ns.yminPrelim)*hs;if(ps){let ys=ns.xmaxPrelim-fs,bs=Math.max(ys,gs);return{setValue:{xmax:fs+bs}}}else return os?{setValue:{xmax:fs+gs}}:ls?{setValue:{xmax:ns.xmaxPrelim}}:{setValue:{xmax:gs/2}}}else return ls?{setValue:{xmax:ns.xmaxPrelim}}:os?{setValue:{xmax:fs+20}}:{setValue:{xmax:10}}},async inverseDefinition({desiredStateVariableValues:ns,stateValues:ss}){return await ss.fixAxes?{success:!1}:{success:!0,instructions:[{setDependency:"xmaxPrelim",desiredValue:ns.xmax}]}}},rs.ymin={stateVariablesDeterminingDependencies:["identicalAxisScales"],defaultValue:-10,public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies({stateValues:ns}){let ss={identicalAxisScales:{dependencyType:"stateVariable",variableName:"identicalAxisScales"},yminPrelim:{dependencyType:"stateVariable",variableName:"yminPrelim"}};return ns.identicalAxisScales&&(ss.xmaxPrelim={dependencyType:"stateVariable",variableName:"xmaxPrelim"},ss.xminPrelim={dependencyType:"stateVariable",variableName:"xminPrelim"},ss.ymaxPrelim={dependencyType:"stateVariable",variableName:"ymaxPrelim"},ss.width={dependencyType:"stateVariable",variableName:"width"},ss.height={dependencyType:"stateVariable",variableName:"height"}),ss},definition({dependencyValues:ns,usedDefault:ss}){if(!ns.identicalAxisScales)return{setValue:{ymin:ns.yminPrelim}};if(!ss.yminPrelim)return{setValue:{ymin:ns.yminPrelim}};let ls=!ss.ymaxPrelim,us=!ss.xminPrelim,cs=!ss.xmaxPrelim,ds=us&&cs,ps=ns.width.size/ns.height.size;if(ds){let fs=(ns.xmaxPrelim-ns.xminPrelim)/ps;return ls?{setValue:{ymin:ns.ymaxPrelim-fs}}:{setValue:{ymin:-fs/2}}}else return ls?{setValue:{ymin:ns.ymaxPrelim-20/ps}}:{setValue:{ymin:-10/ps}}},async inverseDefinition({desiredStateVariableValues:ns,stateValues:ss}){return await ss.fixAxes?{success:!1}:{success:!0,instructions:[{setDependency:"yminPrelim",desiredValue:ns.ymin}]}}},rs.ymax={stateVariablesDeterminingDependencies:["identicalAxisScales"],defaultValue:-10,public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies({stateValues:ns}){let ss={identicalAxisScales:{dependencyType:"stateVariable",variableName:"identicalAxisScales"},ymaxPrelim:{dependencyType:"stateVariable",variableName:"ymaxPrelim"}};return ns.identicalAxisScales&&(ss.xminPrelim={dependencyType:"stateVariable",variableName:"xminPrelim"},ss.yminPrelim={dependencyType:"stateVariable",variableName:"yminPrelim"},ss.xmaxPrelim={dependencyType:"stateVariable",variableName:"xmaxPrelim"},ss.width={dependencyType:"stateVariable",variableName:"width"},ss.height={dependencyType:"stateVariable",variableName:"height"}),ss},definition({dependencyValues:ns,usedDefault:ss}){if(!ns.identicalAxisScales)return{setValue:{ymax:ns.ymaxPrelim}};let os=!ss.xminPrelim,ls=!ss.xmaxPrelim,us=!ss.yminPrelim,cs=!ss.ymaxPrelim,ds=us&&cs,ps=os&&ls,fs=ns.yminPrelim,hs=ns.width.size/ns.height.size;if(ps){let gs=(ns.xmaxPrelim-ns.xminPrelim)/hs;if(ds){let ys=ns.ymaxPrelim-fs,bs=Math.max(ys,gs);return{setValue:{ymax:fs+bs}}}else return us?{setValue:{ymax:fs+gs}}:cs?{setValue:{ymax:ns.ymaxPrelim}}:{setValue:{ymax:gs/2}}}else return cs?{setValue:{ymax:ns.ymaxPrelim}}:us?{setValue:{ymax:fs+20/hs}}:{setValue:{ymax:10/hs}}},async inverseDefinition({desiredStateVariableValues:ns,stateValues:ss}){return await ss.fixAxes?{success:!1}:{success:!0,instructions:[{setDependency:"ymaxPrelim",desiredValue:ns.ymax}]}}},rs.xscale={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({xmin:{dependencyType:"stateVariable",variableName:"xmin"},xmax:{dependencyType:"stateVariable",variableName:"xmax"}}),definition({dependencyValues:ns}){return{setValue:{xscale:ns.xmax-ns.xmin}}}},rs.yscale={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({ymin:{dependencyType:"stateVariable",variableName:"ymin"},ymax:{dependencyType:"stateVariable",variableName:"ymax"}}),definition({dependencyValues:ns}){return{setValue:{yscale:ns.ymax-ns.ymin}}}},rs}async changeAxisLimits({xmin:rs,xmax:ns,ymin:ss,ymax:os,actionId:ls,sourceInformation:us={},skipRendererUpdate:cs=!1}){let ds=[];return rs!==void 0&&ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"xmin",value:rs}),ns!==void 0&&ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"xmax",value:ns}),ss!==void 0&&ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"ymin",value:ss}),os!==void 0&&ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"ymax",value:os}),await this.coreFunctions.performUpdate({updateInstructions:ds,actionId:ls,sourceInformation:us,skipRendererUpdate:cs,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{xmin:rs,xmax:ns,ymin:ss,ymax:os}}})}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}}zs(Chart,"componentType","chart"),zs(Chart,"acceptTarget",!0);class Legend extends GraphicalComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.position={createComponentOfType:"text",createStateVariable:"position",defaultValue:"upperright",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft"]},rs.displayClosedSwatches={createComponentOfType:"boolean",createStateVariable:"displayClosedSwatches",defaultValue:!1,public:!0},rs}static returnChildGroups(){return[{group:"labels",componentTypes:["label"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.graphicalElementNames={returnDependencies:()=>({graphAncestor:{dependencyType:"ancestor",componentType:"graph",variableNames:["graphicalDescendants"]}}),definition({dependencyValues:ns}){return ns.graphAncestor?{setValue:{graphicalElementNames:ns.graphAncestor.stateValues.graphicalDescendants.map(ss=>ss.componentName)}}:{setValue:{graphicalElementNames:null}}}},rs.legendElements={forRenderer:!0,stateVariablesDeterminingDependencies:["graphicalElementNames"],returnDependencies:({stateValues:ns})=>{let ss={labelChildren:{dependencyType:"child",childGroups:["labels"],variableNames:["value","hasLatex","forObjectComponentName"]},displayClosedSwatches:{dependencyType:"stateVariable",variableName:"displayClosedSwatches"}};if(ns.graphicalElementNames){ss.numGraphicalElements={dependencyType:"value",value:ns.graphicalElementNames.length};for(let[os,ls]of ns.graphicalElementNames.entries())ss[`graphicalElement${os}`]={dependencyType:"multipleStateVariables",componentName:ls,variableNames:["selectedStyle","styleNumber","filled"],variablesOptional:!0},ss[`graphicalElement${os}AdapterSource`]={dependencyType:"adapterSource",componentName:ls},ss[`graphicalElement${os}ShadowSource`]={dependencyType:"shadowSource",componentName:ls}}return ss},definition({dependencyValues:ns,componentInfoObjects:ss}){let os=[];if(ns.numGraphicalElements>0){let ls=[],us=[],cs=[],ds=[];for(let gs=0;gsgs.componentName),fs=[],hs={};for(let gs of ns.labelChildren){let ys={value:gs.stateValues.value,hasLatex:gs.stateValues.hasLatex};if(gs.stateValues.forObjectComponentName){hs[gs.stateValues.forObjectComponentName]=ys;let bs=ps.indexOf(gs.stateValues.forObjectComponentName);if(bs!==-1){let vs=ds[bs];ss.isInheritedComponentType({inheritedComponentType:vs.componentType,baseComponentType:"point"})?ls.push(vs.stateValues.styleNumber):ns.displayClosedSwatches&&ss.allComponentClasses[vs.componentType].representsClosedPath?us.push(vs.stateValues.styleNumber):vs.componentType!=="legend"&&cs.push(vs.stateValues.styleNumber)}}fs.push({labelInfo:ys,forObject:gs.stateValues.forObjectComponentName})}for(let gs of fs){let ys;if(gs.forObject){let bs=ps.indexOf(gs.forObject);bs!==-1&&(ys=ds[bs],ds.splice(bs,1),ps.splice(bs,1))}else for(let bs=0;bs({graphAncestor:{dependencyType:"ancestor",componentType:"graph",variableNames:["xmin","xmax","ymin","ymax"]}}),definition({dependencyValues:ns}){return ns.graphAncestor?{setValue:{graphLimits:ns.graphAncestor.stateValues}}:{setValue:{graphLimits:null}}}},rs}}zs(Legend,"componentType","legend");class MatchesPattern extends BooleanComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.pattern={createComponentOfType:"math"},rs.allowImplicitIdentities={createComponentOfType:"boolean",createStateVariable:"allowImplicitIdentities",defaultValue:!1,public:!0},rs.allowPermutations={createComponentOfType:"boolean",createStateVariable:"allowPermutations",defaultValue:!0,public:!0},rs.requireNumericMatches={createComponentOfType:"boolean",createStateVariable:"requireNumericMatches",defaultValue:!1,public:!0},rs.requireVariableMatches={createComponentOfType:"boolean",createStateVariable:"requireVariableMatches",defaultValue:!1,public:!0},rs.excludeMatches={createComponentOfType:"mathList",createStateVariable:"excludeMatches",defaultValue:[],public:!0},rs.matchExpressionWithBlanks={createComponentOfType:"boolean",createStateVariable:"matchExpressionWithBlanks",defaultValue:!1,public:!0},rs}static returnSugarInstructions(){let rs=[],ns=function({matchedChildren:ss,componentInfoObjects:os}){return ss.length===0||ss.length===1&&os.componentIsSpecifiedType(ss[0],"math")?{success:!1}:{success:!0,newChildren:[{componentType:"math",children:ss}]}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"maths",componentTypes:["math"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return delete rs.parsedExpression,delete rs.mathChildrenByCode,rs.pattern={additionalStateVariablesDefined:["patternVariables"],returnDependencies:()=>({patternAttr:{dependencyType:"attributeComponent",attributeName:"pattern",variableNames:["value"]}}),definition({dependencyValues:ns}){let ss=[];if(!ns.patternAttr)return{setValue:{pattern:"_",patternVariables:ss}};let os=ns.patternAttr.stateValues.value.variables(),ls=26*27+1;function us(ds){if(ds==="_"){let ps=numberToLetters(ls);for(ls++;os.includes(ps);)ps=numberToLetters(ls),ls++;return ss.push(ps),ps}else return Array.isArray(ds)?[ds[0],...ds.slice(1).map(us)]:ds}return{setValue:{pattern:us(ns.patternAttr.stateValues.value.tree),patternVariables:ss}}}},rs.value={additionalStateVariablesDefined:[{variableName:"allPatternMatches"}],public:!0,shadowingInstructions:{createComponentOfType:"boolean"},forRenderer:!0,returnDependencies:()=>({pattern:{dependencyType:"stateVariable",variableName:"pattern"},patternVariables:{dependencyType:"stateVariable",variableName:"patternVariables"},mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["value"]},allowImplicitIdentities:{dependencyType:"stateVariable",variableName:"allowImplicitIdentities"},allowPermutations:{dependencyType:"stateVariable",variableName:"allowPermutations"},requireNumericMatches:{dependencyType:"stateVariable",variableName:"requireNumericMatches"},requireVariableMatches:{dependencyType:"stateVariable",variableName:"requireVariableMatches"},excludeMatches:{dependencyType:"stateVariable",variableName:"excludeMatches"},matchExpressionWithBlanks:{dependencyType:"stateVariable",variableName:"matchExpressionWithBlanks"}}),definition:function({dependencyValues:ns}){if(ns.mathChildren.length===0)return{setValue:{value:!1,allPatternMatches:[]}};let ss=ns.mathChildren[0].stateValues.value;if(ss.variables().includes("_")&&!ns.matchExpressionWithBlanks)return{setValue:{value:!1,allPatternMatches:[]}};let os={};if(ns.requireNumericMatches){let ps=fs=>!Number.isNaN(Context.fromAst(fs).evaluate_to_constant());ns.patternVariables.forEach(fs=>os[fs]=ps)}else if(ns.requireVariableMatches){let ps=fs=>typeof fs=="string";ns.patternVariables.forEach(fs=>os[fs]=ps)}else ns.patternVariables.forEach(ps=>os[ps]=!0);let ls={variables:os,allow_permutations:ns.allowPermutations};ns.allowImplicitIdentities&&(ls.allow_implicit_identities=ns.patternVariables);let us=ss.match(ns.pattern,ls),cs=!1,ds=[];return us&&(Object.values(us).map(ps=>Context.fromAst(ps)).some(ps=>ns.excludeMatches.some(fs=>ps.variables().some(hs=>fs.equalsViaSyntax(Context.fromAst(hs)))))||(cs=!0,ds=ns.patternVariables.map(ps=>Context.fromAst(us[ps])))),{setValue:{value:cs,allPatternMatches:ds}}}},rs.nMatches={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({allPatternMatches:{dependencyType:"stateVariable",variableName:"allPatternMatches"}}),definition({dependencyValues:ns}){return{setValue:{nMatches:ns.allPatternMatches.length},checkForActualChange:{nMatches:!0}}}},rs.patternMatches={public:!0,shadowingInstructions:{createComponentOfType:"math"},isArray:!0,nDimensions:1,entryPrefixes:["patternMatch"],returnArraySizeDependencies:()=>({nMatches:{dependencyType:"stateVariable",variableName:"nMatches"}}),returnArraySize({dependencyValues:ns}){return[ns.nMatches]},returnArrayDependenciesByKey(){return{globalDependencies:{allPatternMatches:{dependencyType:"stateVariable",variableName:"allPatternMatches"}}}},arrayDefinitionByKey({globalDependencyValues:ns}){let ss={};for(let os=0;os({displayDigitsAttr:{dependencyType:"attributeComponent",attributeName:"displayDigits",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]}}),definition({dependencyValues:ns,usedDefault:ss}){if(ns.displayDigitsAttr!==null){let os=ss.displayDigitsAttr,ls=ns.displayDecimalsAttr===null||ss.displayDecimalsAttr;if(!(os||ls)){let us=ns.displayDigitsAttr.shadowDepth;ns.displayDecimalsAttr.shadowDepth({}),definition(){return{setValue:{unordered:!1}}}},rs.matrixSizePre={returnDependencies:()=>({rowChildren:{dependencyType:"child",childGroups:["rows"],variableNames:["nComponents"]},colChildren:{dependencyType:"child",childGroups:["columns"],variableNames:["nComponents"]},mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["matrixSize"]},nRowsAttr:{dependencyType:"attributeComponent",attributeName:"nRows",variableNames:["value"]},nColumnsAttr:{dependencyType:"attributeComponent",attributeName:"nColumns",variableNames:["value"]}}),definition({dependencyValues:ns}){let ss=null,os=null;return ns.nRowsAttr&&(ss=ns.nRowsAttr.stateValues.value,Number.isFinite(ss)&&ss>0||(ss=null)),ns.nColumnsAttr&&(os=ns.nColumnsAttr.stateValues.value,Number.isFinite(os)&&os>0||(os=null)),ns.rowChildren.length>0?(ss===null&&(ss=ns.rowChildren.length),os===null&&(os=Math.max(1,...ns.rowChildren.map(ls=>ls.stateValues.nComponents)))):ns.colChildren.length>0?(os===null&&(os=ns.colChildren.length),ss===null&&(ss=Math.max(1,...ns.colChildren.map(ls=>ls.stateValues.nComponents)))):ns.mathChildren.length===1?(ss===null&&(ss=ns.mathChildren[0].stateValues.matrixSize[0]),os===null&&(os=ns.mathChildren[0].stateValues.matrixSize[1])):ss===null?os===null?(ss=0,os=0):ss=1:os===null&&(os=1),{setValue:{matrixSizePre:[ss,os]}}}},rs.matrixPre={isArray:!0,nDimensions:2,hasEssential:!0,returnArraySizeDependencies:()=>({matrixSizePre:{dependencyType:"stateVariable",variableName:"matrixSizePre"}}),returnArraySize({dependencyValues:ns}){return ns.matrixSizePre},returnArrayDependenciesByKey:({arrayKeys:ns})=>{let ss={defaultEntry:{dependencyType:"stateVariable",variableName:"defaultEntry"},rowChildIdentities:{dependencyType:"child",childGroups:["rows"]},colChildIdentities:{dependencyType:"child",childGroups:["columns"]}},os={};for(let ls of ns){let[us,cs]=ls.split(",");os[ls]={rowChild:{dependencyType:"child",childGroups:["rows"],childIndices:[us],variableNames:["math"+(Number(cs)+1)]},colChild:{dependencyType:"child",childGroups:["columns"],childIndices:[cs],variableNames:["math"+(Number(us)+1)]},mathChild:{dependencyType:"child",childGroups:["maths"],childIndices:[0],variableNames:["matrixEntry"+(Number(us)+1)+"_"+(Number(cs)+1)]}}}return{globalDependencies:ss,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os,arraySize:ls}){var fs,hs,gs;let us={},cs={},ds=ns.rowChildIdentities.length>0,ps=ns.colChildIdentities.length>0;for(let ys of os){let[bs,vs]=ys.split(","),xs;ds?xs=(fs=ss[ys].rowChild[0])==null?void 0:fs.stateValues["math"+(Number(vs)+1)]:ps?xs=(hs=ss[ys].colChild[0])==null?void 0:hs.stateValues["math"+(Number(bs)+1)]:xs=(gs=ss[ys].mathChild[0])==null?void 0:gs.stateValues["matrixEntry"+(Number(bs)+1)+"_"+(Number(vs)+1)],xs===void 0?cs[ys]={defaultValue:ns.defaultEntry}:us[ys]=xs}return{setValue:{matrixPre:us},useEssentialOrDefaultValue:{matrixPre:cs}}},async inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls}){var fs,hs,gs;let us=[],cs={},ds=ss.rowChildIdentities.length>0,ps=ss.colChildIdentities.length>0;for(let ys in ns.matrixPre){let[bs,vs]=ys.split(",");ds?((fs=os[ys].rowChild[0])==null?void 0:fs.stateValues["math"+(Number(vs)+1)])===void 0?cs[ys]=ns.matrixPre[ys]:us.push({setDependency:ls[ys].rowChild,desiredValue:ns.matrixPre[ys],childIndex:0,variableIndex:0}):ps?((hs=os[ys].colChild[0])==null?void 0:hs.stateValues["math"+(Number(bs)+1)])===void 0?cs[ys]=ns.matrixPre[ys]:us.push({setDependency:ls[ys].colChild,desiredValue:ns.matrixPre[ys],childIndex:0,variableIndex:0}):((gs=os[ys].mathChild[0])==null?void 0:gs.stateValues["matrixEntry"+(Number(bs)+1)+"_"+(Number(vs)+1)])===void 0?cs[ys]=ns.matrixPre[ys]:us.push({setDependency:ls[ys].mathChild,desiredValue:ns.matrixPre[ys],childIndex:0,variableIndex:0})}return Object.keys(cs).length>0&&us.push({setEssentialValue:"matrixPre",value:cs}),{success:!0,instructions:us}}},rs.unnormalizedValue={returnDependencies:()=>({matrixPre:{dependencyType:"stateVariable",variableName:"matrixPre"},matrixSizePre:{dependencyType:"stateVariable",variableName:"matrixSizePre"}}),definition({dependencyValues:ns}){let ss=["tuple"];for(let ls=0;lsus.tree)]);return{setValue:{unnormalizedValue:Context.fromAst(["matrix",["tuple",...ns.matrixSizePre],ss])}}},inverseDefinition({dependencyValues:ns,desiredStateVariableValues:ss}){var us,cs;let os=ss.unnormalizedValue.tree;if(!(Array.isArray(os)&&os[0]==="matrix"&&((us=os[1])==null?void 0:us[1])===ns.matrixSizePre[0]&&((cs=os[1])==null?void 0:cs[2])===ns.matrixSizePre[1]))return{success:!1};let ls={};for(let ds=0;ds({modifyIndirectly:{dependencyType:"stateVariable",variableName:"modifyIndirectly"},fixed:{dependencyType:"stateVariable",variableName:"fixed"}}),definition({dependencyValues:ns}){return{setValue:{canBeModified:ns.modifyIndirectly&&!ns.fixed}}}},rs}}zs(Matrix,"componentType","matrix"),zs(Matrix,"rendererType","math");class EigenDecomposition extends BaseComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.displayDigits={createComponentOfType:"integer",createStateVariable:"displayDigits",defaultValue:14,public:!0},rs.displayDecimals={createComponentOfType:"integer",createStateVariable:"displayDecimals",defaultValue:null,public:!0},rs.displaySmallAsZero={createComponentOfType:"number",createStateVariable:"displaySmallAsZero",valueForTrue:1e-14,valueForFalse:0,defaultValue:0,public:!0},rs.padZeros={createComponentOfType:"boolean",createStateVariable:"padZeros",defaultValue:!1,public:!0},rs}static returnChildGroups(){return[{group:"maths",componentTypes:["math"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.decomposition={returnDependencies:()=>({mathChild:{dependencyType:"child",childGroups:["maths"],variableNames:["value"]}}),definition({dependencyValues:ns}){if(ns.mathChild.length===0)return{setValue:{decomposition:null}};let ss=ns.mathChild[0].stateValues.value.tree;if(!Array.isArray(ss)||ss[0]!=="matrix")return{setValue:{decomposition:null}};let os=ss[1][1],ls=ss[1][2];if(!(Number.isInteger(os)&&ls===os))return{setValue:{decomposition:null}};let us=[];for(let ds=0;ds({decomposition:{dependencyType:"stateVariable",variableName:"decomposition"}}),returnArraySize({dependencyValues:ns}){let ss;return ns.decomposition?ss=ns.decomposition.values.length:ss=0,[ss]},returnArrayDependenciesByKey(){return{globalDependencies:{decomposition:{dependencyType:"stateVariable",variableName:"decomposition"}}}},arrayDefinitionByKey({globalDependencyValues:ns,arraySize:ss}){let os=[];for(let ls=0;lsNumber(us)-1);return ls.length===2&&ls.every((us,cs)=>Number.isInteger(us)&&us>=0)?os?ls.every((us,cs)=>us=0?os?lsls+","+cs):[]:[ls+",0"]:[]}},arrayVarNameFromPropIndex(ns,ss){if(ss==="eigenvectors")return ns.length===1?"eigenvector"+ns[0]:`eigenvectorX${ns[0]}_${ns[1]}`;if(ss.slice(0,11)==="eigenvector"){let os=Number(ss.slice(11));if(Number.isInteger(os)&&os>0)return`eigenvectorX${os}_${ns[0]}`}return null},entryPrefixes:["eigenvectorX","eigenvector"],returnArraySizeDependencies:()=>({decomposition:{dependencyType:"stateVariable",variableName:"decomposition"}}),returnArraySize({dependencyValues:ns}){let ss;return ns.decomposition?ss=ns.decomposition.values.length:ss=0,[ss,ss]},returnArrayDependenciesByKey(){return{globalDependencies:{decomposition:{dependencyType:"stateVariable",variableName:"decomposition"}}}},arrayDefinitionByKey({globalDependencyValues:ns,arraySize:ss}){let os={};for(let ls=0;lsContext.math.divide(ds,cs));for(let ds=0;ds({mathTextLikeChildren:{dependencyType:"child",childGroups:["mathTextLike"],variableNames:["text","latex"]}}),rs.value.definition=function({dependencyValues:ns}){if(ns.mathTextLikeChildren.length===0)return{useEssentialOrDefaultValue:{value:!0}};let ss="";for(let os of ns.mathTextLikeChildren)typeof os=="string"?ss+=os:os.stateValues.latex!==void 0?ss+=os.stateValues.latex:ss+=os.stateValues.text;return{setValue:{value:ss}}},rs.value.inverseDefinition=function({desiredStateVariableValues:ns,dependencyValues:ss}){var ls;let os=ss.mathTextLikeChildren.length;return os>1?{success:!1}:os===1?{success:!0,instructions:[{setDependency:"textLikeChildren",desiredValue:ns.value,childIndex:0,variableIndex:((ls=ss.textLikeChildren[0].stateValues)==null?void 0:ls.latex)===void 0?0:1}]}:{success:!0,instructions:[{setEssentialValue:"value",value:ns.value===null?"":String(ns.value)}]}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition:({dependencyValues:ns})=>({setValue:{text:ns.value}}),inverseDefinition:({desiredStateVariableValues:ns})=>({success:!0,instructions:[{setDependency:"value",desiredValue:ns.text}]})},rs.latex={isAlias:!0,targetVariableName:"value"},rs}}zs(Latex,"componentType","latex"),zs(Latex,"rendererType","text");const unitConversions={"":1,px:1,pixel:1,pixels:1,"%":1,em:100,in:96,inch:96,inches:96,pt:1.333333333333,mm:3.7795296,millimeter:3.7795296,millimeters:3.7795296,cm:37.795296,centimeter:37.795296,centimeters:37.795296};class ComponentSize extends InlineComponent{static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss}){let os=ss[ss.length-1];if(typeof os=="string"){let ls=/([a-zA-z]+|%)$/,us=os.trim(),cs=us.match(ls);if(cs){let ds=cs[1];if(ds in unitConversions){let ps=us.slice(0,cs.index),fs=ss.slice(0,ss.length-1);return ps.length>0&&fs.push(ps),{success:!0,newChildren:[{componentType:"number",children:fs},ds]}}}}return{success:!0,newChildren:[{componentType:"number",children:ss}]}};return rs.push({childrenRegex:/..+/,replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"strings",componentTypes:["string"]},{group:"numbers",componentTypes:["number"]},{group:"componentSizes",componentTypes:["_componentSize"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.componentSize={public:!0,shadowingInstructions:{createComponentOfType:"_componentSize"},hasEssential:!0,returnDependencies:()=>({componentSizeChild:{dependencyType:"child",childGroups:["componentSizes"],variableNames:["componentSize"]},numberChild:{dependencyType:"child",childGroups:["numbers"],variableNames:["value"]},stringChild:{dependencyType:"child",childGroups:["strings"],variableNames:["value"]},parentDefaultAbsoluteSize:{dependencyType:"parentStateVariable",variableName:"defaultAbsoluteSize"}}),definition({dependencyValues:ns}){let ss=ns.parentDefaultAbsoluteSize===void 0?!1:ns.parentDefaultAbsoluteSize;if(ns.stringChild.length===0)return ns.numberChild.length===0?ns.componentSizeChild.length===0?{useEssentialOrDefaultValue:{componentSize:{defaultValue:{size:100,isAbsolute:ss}}}}:{setValue:{componentSize:ns.componentSizeChild[0].stateValues.componentSize}}:{setValue:{componentSize:{size:ns.numberChild[0].stateValues.value,isAbsolute:!0}}};{let os,ls;if(ns.numberChild.length>0)os=ns.numberChild[0].stateValues.value,ls=ns.stringChild[0].trim();else{let ps=ns.stringChild[0].trim().match(/^(-?[\d.]+)\s*(.*)$/);if(ps===null)return{setValue:{componentSize:null}};os=ps[1],ls=ps[2].trim()}if(os=Number(os),!Number.isFinite(os))return{setValue:{componentSize:null}};let us=!(ls==="%"||ls==="em"),cs=unitConversions[ls];return cs===void 0&&(cs=1),{setValue:{componentSize:{size:cs*os,isAbsolute:us}}}}},inverseDefinition({desiredStateVariableValues:ns,dependencyValues:ss}){if(ss.stringChild.length===0)return ss.numberChild.length===0?ss.componentSizeChild.length===0?{success:!0,instructions:[{setEssentialValue:"componentSize",value:ns.componentSize}]}:{success:!0,instructions:[{setDependency:"componentSizeChild",desiredValue:ns.componentSize,childIndex:0,variableIndex:0}]}:ns.componentSize.isAbsolute?{success:!0,instructions:[{setDependency:"numberChild",desiredValue:ns.componentSize.size,childIndex:0,variableIndex:0}]}:{success:!1};if(ss.numberChild.length>0){let os=ss.stringChild[0].trim(),ls=!(os==="%"||os==="em");if(ns.componentSize.isAbsolute!==ls)return{success:!1};let us=unitConversions[os];return us===void 0&&(us=1),{success:!0,instructions:[{setDependency:"numberChild",desiredValue:ns.componentSize.size/us,childIndex:0,variableIndex:0}]}}else{let os=ns.componentSize.size;return ns.componentSize.isAbsolute?os+="px":os+="%",{success:!0,instructions:[{setDependency:"stringChild",desiredValue:os,childIndex:0,variableIndex:0}]}}}},rs.number={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({componentSize:{dependencyType:"stateVariable",variableName:"componentSize"}}),definition({dependencyValues:ns}){let ss=null;return ns.componentSize&&(ss=ns.componentSize.size),{setValue:{number:ss}}},inverseDefinition({desiredStateVariableValues:ns,dependencyValues:ss}){return ss.componentSize?{success:!0,instructions:[{setDependency:"componentSize",desiredValue:{size:ns.number,isAbsolute:ss.componentSize.isAbsolute}}]}:{success:!1}}},rs.math=mathStateVariableFromNumberStateVariable({numberVariableName:"number",mathVariableName:"math",isPublic:!0}),rs.isAbsolute={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},returnDependencies:()=>({componentSize:{dependencyType:"stateVariable",variableName:"componentSize"}}),definition({dependencyValues:ns}){let ss=null;return ns.componentSize&&(ss=ns.componentSize.isAbsolute),{setValue:{isAbsolute:ss}}}},rs.text={forRenderer:!0,returnDependencies:()=>({componentSize:{dependencyType:"stateVariable",variableName:"componentSize"}}),definition({dependencyValues:ns}){let ss="";return ns.componentSize&&(ss=ns.componentSize.size,ns.componentSize.isAbsolute?ss+="px":ss+="%"),{setValue:{text:ss}}}},rs}}zs(ComponentSize,"componentType","_componentSize"),zs(ComponentSize,"rendererType","text"),zs(ComponentSize,"primaryStateVariableForDefinition","componentSize"),zs(ComponentSize,"stateVariableForAttributeValue","componentSize"),zs(ComponentSize,"adapters",["number","math"]);class ComponentSizeList extends BaseComponent{static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss}){let os=[],ls=[],us=function(){ls.length>0&&(os.push({componentType:"_componentSize",children:ls}),ls=[])};for(let cs of ss)if(typeof cs=="string"){let ds=cs.split(/\s+/);ds[0].length===0&&(us(),ds=ds.slice(1));for(let[ps,fs]of ds.entries())fs.length>0?(ls.push(fs),ps({}),definition:()=>({setValue:{overrideChildHide:!0}})},rs.nComponents={public:!0,shadowingInstructions:{createComponentOfType:"number"},additionalStateVariablesDefined:["childIndexByArrayKey"],returnDependencies(){return{componentSizeListChildren:{dependencyType:"child",childGroups:["componentSizeLists"],variableNames:["nComponents"]},componentSizeAndComponentSizeListChildren:{dependencyType:"child",childGroups:["componentSizes","componentSizeLists"],skipComponentNames:!0}}},definition:function({dependencyValues:ns,componentInfoObjects:ss}){let os=0,ls=[],us=0;for(let[cs,ds]of ns.componentSizeAndComponentSizeListChildren.entries())if(ss.isInheritedComponentType({inheritedComponentType:ds.componentType,baseComponentType:"_componentSizeList"})){let ps=ns.componentSizeListChildren[us];us++;for(let fs=0;fs({nComponents:{dependencyType:"stateVariable",variableName:"nComponents"}}),returnArraySize({dependencyValues:ns}){return[ns.nComponents]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={},ls={childIndexByArrayKey:{dependencyType:"stateVariable",variableName:"childIndexByArrayKey"}};for(let us of ns){let cs=[],ds="1";ss.childIndexByArrayKey[us]&&(cs=[ss.childIndexByArrayKey[us][0]],ds=ss.childIndexByArrayKey[us][1]+1),os[us]={componentSizeAndComponentSizeListChildren:{dependencyType:"child",childGroups:["componentSizes","componentSizeLists"],variableNames:["componentSize","componentSize"+ds],variablesOptional:!0,childIndices:cs}}}return{globalDependencies:ls,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os,componentInfoObjects:ls}){let us={};for(let cs of os){let ds=ss[cs].componentSizeAndComponentSizeListChildren[0];if(ds)if(ls.isInheritedComponentType({inheritedComponentType:ds.componentType,baseComponentType:"_componentSizeList"})){let ps=ns.childIndexByArrayKey[cs][1]+1;us[cs]=ds.stateValues["componentSize"+ps]}else us[cs]=ds.stateValues.componentSize}return{setValue:{componentSizes:us}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,arraySize:us,componentInfoObjects:cs}){let ds=[];for(let ps in ns.componentSizes){if(!os[ps])continue;let fs=os[ps].componentSizeAndComponentSizeListChildren[0];fs&&(cs.isInheritedComponentType({inheritedComponentType:fs.componentType,baseComponentType:"_componentSizeList"})?ds.push({setDependency:ls[ps].componentSizeAndComponentSizeListChildren,desiredValue:ns.componentSizes[ps],childIndex:0,variableIndex:1}):ds.push({setDependency:ls[ps].componentSizeAndComponentSizeListChildren,desiredValue:ns.componentSizes[ps],childIndex:0,variableIndex:0}))}return{success:!0,instructions:ds}}},rs.nValues={isAlias:!0,targetVariableName:"nComponents"},rs.values={isAlias:!0,targetVariableName:"componentSizes"},rs}}zs(ComponentSizeList,"componentType","_componentSizeList"),zs(ComponentSizeList,"rendererType","asList"),zs(ComponentSizeList,"renderChildren",!0),zs(ComponentSizeList,"stateVariableForAttributeValue","componentSizes");const ComponentSize$1=Object.freeze(Object.defineProperty({__proto__:null,ComponentSize,ComponentSizeList},Symbol.toStringTag,{value:"Module"})),componentTypeArray=[...Object.values(Aliases),...Object.values(MMeMen),...Object.values(MdMdnMrow),...Object.values(BooleanOperators),...Object.values(BooleanOperatorsOfMath),...Object.values(MathOperators),...Object.values(FunctionOperators),...Object.values(TextOperatorsOfMath),...Object.values(Extrema$1),...Object.values(ParagraphMarkup),...Object.values(SingleCharacterComponents),...Object.values(Sectioning),...Object.values(Lists),...Object.values(DynamicalSystems),...Object.values(Chemistry),...Object.values(FeedbackDefinitions$1),...Object.values(StyleDefinitions$1),...Object.values(SideBySide$2),...Object.values(ComponentWithSelectableType$1),...Object.values(Indexing),...Object.values(Divisions),...Object.values(Verbatim),...Object.values(Paginator$1),...Object.values(MatrixInput$1),Document,Text,TextList$1,TextList,P$2,BooleanComponent,BooleanList,MathComponent,MathList,TupleList,NumberList,NumberListFromString,Copy,Extract,Collect,Ref,Point,Coords,Line,LineSegment,Ray,Polyline,Polygon,Triangle,Rectangle,RegularPolygon,Circle,Parabola,Curve,BezierControls,ControlVectors,Vector,Angle,Answer,Award,When,MathInput,Textinput,BooleanInput,Choiceinput,Choice,NumberComponent,Integer,Graph$1,Variables,Variable,Function$1,PiecewiseFunction,Interval,Template,Option$1,Sequence,Slider,Spreadsheet,DiscreteSimulationResultList,DiscreteSimulationResultPolyline,Cell,Row,Column,CellBlock,Tabular,Table$1,Figure,Markers,Panel,Map$1,Sources,Pegboard,Constraints,ConstrainToGrid,ConstrainToGraph,AttractToGrid,ConstrainTo,AttractTo,ConstraintUnion,AttractToConstraint,Intersection,ConstrainToAngles,AttractToAngles,ConditionalContent,AsList,VariantControl,TextListFromString,SelectFromSequence,Select,Group,AnimateFromSequence,Evaluate,SelectRandomNumbers,SampleRandomNumbers,Substitute,PeriodicSet,Image$1,Video,Embed,Hint,Solution,IntComma,Pluralize,Feedback,CollaborateGroups,CollaborateGroupSetup,ConsiderAsResponses,Case,Lorem,UpdateValue,CallAction,triggerSet,FunctionIterates,Module,CustomAttribute,Setup,Footnote,Caption,Endpoint,Sort,Shuffle,SolveEquations,SolutionContainer,SubsetOfRealsInput,SubsetOfReals,Split,BestFitLine,RegionBetweenCurveXAxis,RegionHalfPlane,CodeEditor,CodeViewer,RenderDoenetML,HasSameFactoring,DataFrame,SummaryStatistics,Chart,Legend,Label$1,MatchesPattern,Matrix,EigenDecomposition,Latex,BaseComponent,InlineComponent,BlockComponent,GraphicalComponent,ConstraintComponent,Input,CompositeComponent,PointListComponent,IntervalListComponent,LineListComponent,VectorListComponent,AngleListComponent,BooleanOperator,BooleanBaseOperatorOfMath,MathOperator,MathOperatorOneInput,FunctionOperator,...Object.values(ComponentSize$1),SectioningComponent,InlineRenderInlineChildren,TextOrInline,SingleCharacter];function allComponentClasses(){const as={},rs=new Set;for(let ns of componentTypeArray){let ss=ns.componentType;if(ss===void 0)throw Error("Cannot create component as componentType is undefined for class "+ns);let os=ss.toLowerCase();if(rs.has(os))throw Error("component type "+ss+" defined in two classes");as[ss]=ns,rs.add(os)}return as}function componentTypesCreatingVariants(){const as={},rs=new Set;for(let ns of componentTypeArray)if(ns.createsVariants){let ss=ns.componentType;if(ss===void 0)throw Error("Cannot create component as componentType is undefined for class "+ns);let os=ss.toLowerCase();if(rs.has(os))throw Error("component type "+ss+" defined in two classes");as[ss]=ns,rs.add(os)}return as}/*! https://mths.be/cssesc v3.0.0 by @mathias */var object={},hasOwnProperty$1=object.hasOwnProperty,merge=function as(rs,ns){if(!rs)return ns;var ss={};for(var os in ns)ss[os]=hasOwnProperty$1.call(rs,os)?rs[os]:ns[os];return ss},regexAnySingleEscape=/[ -,\.\/:-@\[-\^`\{-~]/,regexSingleEscape=/[ -,\.\/:-@\[\]\^`\{-~]/,regexExcessiveSpaces=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,cssesc=function as(rs,ns){ns=merge(ns,as.options),ns.quotes!="single"&&ns.quotes!="double"&&(ns.quotes="single");for(var ss=ns.quotes=="double"?'"':"'",os=ns.isIdentifier,ls=rs.charAt(0),us="",cs=0,ds=rs.length;cs126){if(fs>=55296&&fs<=56319&&csasync({coreId:Ql,componentName:Kl,stateValues:Il,childrenInstructions:$l,sourceOfUpdate:Yl,baseStateVariable:Zl,actionId:eu})=>{let tu=!1,nu=Ql+Kl;if(Zl){let iu=Ll.getLoadable(rendererUpdatesToIgnore(nu)).contents;if(Object.keys(iu).length>0){let su=iu[eu],lu=Il[Zl];su===lu||Array.isArray(su)&&Array.isArray(lu)&&su.length==lu.length&&su.every((fu,ou)=>lu[ou]===fu)?(tu=!0,Hl(rendererUpdatesToIgnore(nu),fu=>{let ou={...fu};return delete ou[eu],ou})):Hl(rendererUpdatesToIgnore(nu),{})}}let ru={stateValues:Il,childrenInstructions:$l,sourceOfUpdate:Yl,ignoreUpdate:tu,prefixForIds:js};if($l===void 0){let iu=Ll.getLoadable(rendererState(nu)).contents;ru.childrenInstructions=iu.childrenInstructions}Hl(rendererState(nu),ru)}),ss=Recoil_index_31(({snapshot:Ll,set:Hl})=>async({coreId:Ql,componentName:Kl,baseVariableValue:Il,actionId:$l})=>{let Yl=Ql+Kl;Hl(rendererUpdatesToIgnore(Yl),Zl=>{let eu={...Zl};return eu[$l]=Il,eu})}),[os,ls]=reactExports.useState(null),[us,cs]=reactExports.useState(null),[ds,ps]=reactExports.useState(null),[fs,hs]=reactExports.useState(null),[gs,ys]=reactExports.useState(null),[bs,vs]=reactExports.useState(null),[xs,Cs]=reactExports.useState(null),[Ts,Ss]=reactExports.useState(null),[Ns,As]=reactExports.useState("initial"),[ws,Es]=reactExports.useState(!1),[_s,$s]=reactExports.useState(null),Rs=reactExports.useRef({}),Ds=reactExports.useRef({}),Os=reactExports.useRef(null),Is=reactExports.useRef(!1),Vs=reactExports.useRef(null),ks=reactExports.useRef(null),Ps=reactExports.useRef([]),Bs=reactExports.useRef(null),Ms=reactExports.useRef(!1),Ws=reactExports.useRef({}),Us=reactExports.useRef({}),js=as.prefixForIds||"",Ls=reactExports.useRef([]),Gs=Recoil_index_20(darkModeAtom),Hs=Recoil_index_20(pageToolViewAtom),Ys=Recoil_index_20(itemByDoenetId(as.doenetId));Recoil_index_20(scrollableContainerAtom);let Zs=useNavigate(),Nl=useLocation(),yl=Nl.hash;reactExports.useEffect(()=>{Bs.current&&(Bs.current.onmessage=function(Ll){var Hl,Ql,Kl;Ll.data.messageType==="updateRenderers"?Ll.data.init&&Os.current||qs(Ll.data.args):Ll.data.messageType==="requestAnimationFrame"?Al(Ll.data.args):Ll.data.messageType==="cancelAnimationFrame"?Vl(Ll.data.args):Ll.data.messageType==="coreCreated"?(Is.current=!0,Ms.current=!1,As("coreCreated"),(Hl=as.coreCreatedCallback)==null||Hl.call(as,Bs.current)):Ll.data.messageType==="initializeRenderers"?Os.current&&JSON.stringify(Os.current)===JSON.stringify(Ll.data.args.coreInfo)||Ks(Ll.data.args):Ll.data.messageType==="updateCreditAchieved"?(Ql=as.updateCreditAchievedCallback)==null||Ql.call(as,Ll.data.args):Ll.data.messageType==="savedState"?(Kl=as.saveStateCallback)==null||Kl.call(as):Ll.data.messageType==="sendToast"?(console.log(`Sending toast message: ${Ll.data.args.message}`),rs(Ll.data.args.message,Ll.data.args.toastType)):Ll.data.messageType==="resolveAction"?Qs(Ll.data.args):Ll.data.messageType==="returnAllStateVariables"?(console.log(Ll.data.args),ks.current(Ll.data.args)):Ll.data.messageType==="componentRangePieces"?window["componentRangePieces"+bs]=Ll.data.args.componentRangePieces:Ll.data.messageType==="inErrorState"?(as.setIsInErrorState&&as.setIsInErrorState(!0),ls(Ll.data.args.errMsg)):Ll.data.messageType==="resetPage"?Js(Ll.data.args):Ll.data.messageType==="copyToClipboard"?Fs(Ll.data.args):Ll.data.messageType==="navigateToTarget"?Cl(Ll.data.args):Ll.data.messageType==="terminated"&&Dl()})},[Bs.current]),reactExports.useEffect(()=>()=>{Bs.current&&Bs.current.postMessage({messageType:"terminate"})},[]),reactExports.useEffect(()=>{bs!==null&&(window["returnAllStateVariables"+bs]=function(){return Bs.current.postMessage({messageType:"returnAllStateVariables"}),new Promise((Ll,Hl)=>{ks.current=Ll})},window["callAction"+bs]=async function({actionName:Ll,componentName:Hl,args:Ql}){await Rl({action:{actionName:Ll,componentName:Hl},args:Ql})})},[bs]),reactExports.useEffect(()=>()=>{Ms.current=!0;for(let Ll in Ws.current)Vl(Ll);Ws.current={}},[]),reactExports.useEffect(()=>{document.addEventListener("visibilitychange",()=>{Bs.current&&Bs.current.postMessage({messageType:"visibilityChange",args:{visible:document.visibilityState==="visible"}})})},[]),reactExports.useEffect(()=>{if(yl&&Is.current&&Bs.current){let Ll=yl.slice(1);Ll.substring(0,js.length)===js&&Bs.current.postMessage({messageType:"navigatingToComponent",args:{componentName:Ll.substring(js.length)}})}},[Nl,yl,Is.current,Bs.current]),reactExports.useEffect(()=>{var Ll;if(yl&&_s&&as.pageIsActive){let Hl=yl.slice(1);(!Ls.current.includes(Nl.key)||Nl.key==="default")&&Hl.length>js.length&&Hl.substring(0,js.length)===js&&((Ll=document.getElementById(cssesc_1(Hl)))==null||Ll.scrollIntoView()),Ls.current.push(Nl.key)}},[Nl,yl,_s,as.pageIsActive]),reactExports.useEffect(()=>{Rl({action:{actionName:"setTheme"},args:{theme:Gs}})},[Gs]);function Dl(){Ms.current=!0,Bs.current.terminate(),Bs.current=null;for(let Ll in Ws.current)Vl(Ll);Ws.current={}}async function Rl({action:Ll,args:Hl,baseVariableValue:Ql,componentName:Kl,rendererType:Il}){var $l,Yl;if(Is.current||!(($l=Ds.current[Il])!=null&&$l.ignoreActionsWithoutCore)){let Zl=nanoid();Hl={...Hl},Hl.actionId=Zl,Ql!==void 0&&Kl&&ss({coreId:Vs.current,componentName:Kl,baseVariableValue:Ql,actionId:Zl});let eu={actionName:Ll.actionName,componentName:Ll.componentName,args:Hl};return(Yl=Bs.current)==null||Yl.postMessage({messageType:"requestAction",args:eu}),Is.current||Ps.current.push(eu),new Promise((tu,nu)=>{Us.current[Zl]=tu})}}function Ml({rendererState:Ll,forceDisable:Hl,forceShowCorrectness:Ql,forceShowSolution:Kl,forceUnsuppressCheckwork:Il}){var $l;for(let Yl in Ll){let Zl=Ll[Yl].stateValues;if(Hl&&Zl.disabled===!1&&(Zl.disabled=!0),Ql&&Zl.showCorrectness===!1&&(Zl.showCorrectness=!0),Il&&Zl.suppressCheckwork===!0&&(Zl.suppressCheckwork=!1),Kl&&(($l=Ll[Yl].childrenInstructions)==null?void 0:$l.length)>0){for(let eu of Ll[Yl].childrenInstructions)if(eu.componentType==="solution"){let tu=eu.componentName;Ll[tu].stateValues.hidden&&(Ll[tu].stateValues.hidden=!1)}}}}function Ks(Ll){if(Ll.rendererState){delete Ll.rendererState.__componentNeedingUpdateValue,(as.forceDisable||as.forceShowCorrectness||as.forceShowSolution||as.forceUnsuppressCheckwork)&&Ml({rendererState:Ll.rendererState,...as});for(let Il in Ll.rendererState)ns({coreId:Vs.current,componentName:Il,stateValues:Ll.rendererState[Il].stateValues,childrenInstructions:Ll.rendererState[Il].childrenInstructions})}Os.current=Ll.coreInfo,as.generatedVariantCallback&&as.generatedVariantCallback(JSON.parse(Os.current.generatedVariantString,serializedComponentsReviver),Os.current.allPossibleVariants);let Hl=[],Ql=[];for(let Il of Os.current.rendererTypesInDocument)Ql.push(Il),Hl.push(__variableDynamicImportRuntimeHelper(Object.assign({"./renderers/alert.jsx":()=>__vitePreload(()=>import("./alert-c90a8781.js"),[]),"./renderers/angle.jsx":()=>__vitePreload(()=>import("./angle-30091d5d.js"),["assets/angle-30091d5d.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/answer.jsx":()=>__vitePreload(()=>import("./answer-5798aa41.js"),[]),"./renderers/asList.jsx":()=>__vitePreload(()=>import("./asList-c29bc521.js"),[]),"./renderers/boolean.jsx":()=>__vitePreload(()=>import("./boolean-437e292f.js"),[]),"./renderers/booleanInput.jsx":()=>__vitePreload(()=>import("./booleanInput-5b19956a.js"),["assets/booleanInput-5b19956a.js","assets/ToggleButton-57def544.js","assets/booleanInput-01650bf1.css"]),"./renderers/c.jsx":()=>__vitePreload(()=>import("./c-328881f4.js"),[]),"./renderers/callAction.jsx":()=>__vitePreload(()=>import("./callAction-4954fd7b.js"),[]),"./renderers/cell.jsx":()=>__vitePreload(()=>import("./cell-ec2c6a75.js"),[]),"./renderers/chart.jsx":()=>__vitePreload(()=>import("./chart-7ea2262d.js"),["assets/chart-7ea2262d.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/choiceInput.jsx":()=>__vitePreload(()=>import("./choiceInput-9c4307b4.js"),["assets/choiceInput-9c4307b4.js","assets/choiceInput-92287600.css"]),"./renderers/circle.jsx":()=>__vitePreload(()=>import("./circle-e7253084.js"),["assets/circle-e7253084.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/cobwebPolyline.jsx":()=>__vitePreload(()=>import("./cobwebPolyline-97c56c48.js"),["assets/cobwebPolyline-97c56c48.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/codeEditor.jsx":()=>__vitePreload(()=>import("./codeEditor-9456a083.js"),["assets/codeEditor-9456a083.js","assets/css-14ccef8c.js","assets/CodeMirror-35f8e4ac.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/codeViewer.jsx":()=>__vitePreload(()=>import("./codeViewer-b9183700.js"),["assets/codeViewer-b9183700.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/containerBlock.jsx":()=>__vitePreload(()=>import("./containerBlock-f5e1b6af.js"),["assets/containerBlock-f5e1b6af.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/containerInline.jsx":()=>__vitePreload(()=>import("./containerInline-c98df7cf.js"),[]),"./renderers/curve.jsx":()=>__vitePreload(()=>import("./curve-c366682a.js"),["assets/curve-c366682a.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/ellipsis.jsx":()=>__vitePreload(()=>import("./ellipsis-195ae941.js"),[]),"./renderers/em.jsx":()=>__vitePreload(()=>import("./em-6796dd6a.js"),[]),"./renderers/embed.jsx":()=>__vitePreload(()=>import("./embed-c6a7dbcf.js"),["assets/embed-c6a7dbcf.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/feedback.jsx":()=>__vitePreload(()=>import("./feedback-0d6d8ff8.js"),["assets/feedback-0d6d8ff8.js","assets/index-47ca4f11.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/figure.jsx":()=>__vitePreload(()=>import("./figure-ef236daa.js"),["assets/figure-ef236daa.js","assets/visibility-sensor-55e75ed1.js","assets/index.esm-b3e258be.js","assets/setPrototypeOf-51e8cf87.js"]),"./renderers/footnote.jsx":()=>__vitePreload(()=>import("./footnote-093a9cc2.js"),[]),"./renderers/graph.jsx":()=>__vitePreload(()=>import("./graph-57e1e537.js"),["assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/hint.jsx":()=>__vitePreload(()=>import("./hint-e6c88621.js"),["assets/hint-e6c88621.js","assets/index-47ca4f11.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/image.jsx":()=>__vitePreload(()=>import("./image-da34720e.js"),["assets/image-da34720e.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/label.jsx":()=>__vitePreload(()=>import("./label-1c306ce3.js"),["assets/label-1c306ce3.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/legend.jsx":()=>__vitePreload(()=>import("./legend-78658a1d.js"),["assets/legend-78658a1d.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/line.jsx":()=>__vitePreload(()=>import("./line-43a0ad82.js"),["assets/line-43a0ad82.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/lineSegment.jsx":()=>__vitePreload(()=>import("./lineSegment-97164a85.js"),["assets/lineSegment-97164a85.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/list.jsx":()=>__vitePreload(()=>import("./list-6cb6dea9.js"),["assets/list-6cb6dea9.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/math.jsx":()=>__vitePreload(()=>import("./math-7187d78d.js"),["assets/math-7187d78d.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/mathInput.jsx":()=>__vitePreload(()=>import("./mathInput-ff25072a.js"),["assets/mathInput-ff25072a.js","assets/MathInputSelector-58bfc077.js","assets/mathInput-cbd86307.css"]),"./renderers/mathList.jsx":()=>__vitePreload(()=>import("./mathList-4fb8f8ad.js"),[]),"./renderers/matrixInput.jsx":()=>__vitePreload(()=>import("./matrixInput-baa0ea60.js"),["assets/matrixInput-baa0ea60.js","assets/ActionButton-f612d279.js","assets/ActionButtonGroup-a395ceaf.js","assets/mathInput-cbd86307.css"]),"./renderers/mdash.jsx":()=>__vitePreload(()=>import("./mdash-fe43836d.js"),[]),"./renderers/nbsp.jsx":()=>__vitePreload(()=>import("./nbsp-39cd594f.js"),[]),"./renderers/ndash.jsx":()=>__vitePreload(()=>import("./ndash-6390eb8f.js"),[]),"./renderers/number.jsx":()=>__vitePreload(()=>import("./number-9609086c.js"),[]),"./renderers/numberList.jsx":()=>__vitePreload(()=>import("./numberList-0a281efa.js"),[]),"./renderers/orbitalDiagram.jsx":()=>__vitePreload(()=>import("./orbitalDiagram-f11dd287.js"),["assets/orbitalDiagram-f11dd287.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/orbitalDiagramInput.jsx":()=>__vitePreload(()=>import("./orbitalDiagramInput-7f035ba9.js"),["assets/orbitalDiagramInput-7f035ba9.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/p.jsx":()=>__vitePreload(()=>import("./p-518868cc.js"),["assets/p-518868cc.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/paginatorControls.jsx":()=>__vitePreload(()=>import("./paginatorControls-99bfd825.js"),[]),"./renderers/pegboard.jsx":()=>__vitePreload(()=>import("./pegboard-c9abe2cd.js"),["assets/pegboard-c9abe2cd.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/point.jsx":()=>__vitePreload(()=>import("./point-b3a7f195.js"),["assets/point-b3a7f195.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/polygon.jsx":()=>__vitePreload(()=>import("./polygon-07cd896e.js"),["assets/polygon-07cd896e.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/polyline.jsx":()=>__vitePreload(()=>import("./polyline-a05315bf.js"),["assets/polyline-a05315bf.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/pre.jsx":()=>__vitePreload(()=>import("./pre-c97cad3a.js"),["assets/pre-c97cad3a.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/q.jsx":()=>__vitePreload(()=>import("./q-6e12a53c.js"),[]),"./renderers/ray.jsx":()=>__vitePreload(()=>import("./ray-c17c1d64.js"),["assets/ray-c17c1d64.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/ref.jsx":()=>__vitePreload(()=>import("./ref-b907f9de.js"),[]),"./renderers/regionBetweenCurveXAxis.jsx":()=>__vitePreload(()=>import("./regionBetweenCurveXAxis-a859244d.js"),["assets/regionBetweenCurveXAxis-a859244d.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/row.jsx":()=>__vitePreload(()=>import("./row-53a40069.js"),[]),"./renderers/section.jsx":()=>__vitePreload(()=>import("./section-b73f2819.js"),["assets/section-b73f2819.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/sideBySide.jsx":()=>__vitePreload(()=>import("./sideBySide-5d149b57.js"),["assets/sideBySide-5d149b57.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/slider.jsx":()=>__vitePreload(()=>import("./slider-4de8a392.js"),["assets/slider-4de8a392.js","assets/ActionButton-f612d279.js","assets/ActionButtonGroup-a395ceaf.js"]),"./renderers/solution.jsx":()=>__vitePreload(()=>import("./solution-3639bb17.js"),["assets/solution-3639bb17.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/spreadsheet.jsx":()=>__vitePreload(()=>import("./spreadsheet-ec3406bb.js"),["assets/spreadsheet-ec3406bb.js","assets/moment-f5bb98f1.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js","assets/spreadsheet-f0a2a11b.css"]),"./renderers/sq.jsx":()=>__vitePreload(()=>import("./sq-c120de61.js"),[]),"./renderers/subsetOfRealsInput.jsx":()=>__vitePreload(()=>import("./subsetOfRealsInput-552c7467.js"),["assets/subsetOfRealsInput-552c7467.js","assets/ActionButton-f612d279.js","assets/ActionButtonGroup-a395ceaf.js","assets/ToggleButton-57def544.js","assets/ToggleButtonGroup-c2629620.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/summaryStatistics.jsx":()=>__vitePreload(()=>import("./summaryStatistics-32543040.js"),["assets/summaryStatistics-32543040.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/table.jsx":()=>__vitePreload(()=>import("./table-5d256c10.js"),["assets/table-5d256c10.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/tabular.jsx":()=>__vitePreload(()=>import("./tabular-c4050873.js"),["assets/tabular-c4050873.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/tag.jsx":()=>__vitePreload(()=>import("./tag-ff0e0cde.js"),[]),"./renderers/text.jsx":()=>__vitePreload(()=>import("./text-74742579.js"),["assets/text-74742579.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/textInput.jsx":()=>__vitePreload(()=>import("./textInput-1f45908d.js"),["assets/textInput-1f45908d.js","assets/css-14ccef8c.js"]),"./renderers/textList.jsx":()=>__vitePreload(()=>import("./textList-4e0545b9.js"),[]),"./renderers/triggerSet.jsx":()=>__vitePreload(()=>import("./triggerSet-5e33735f.js"),[]),"./renderers/updateValue.jsx":()=>__vitePreload(()=>import("./updateValue-488877e4.js"),[]),"./renderers/vector.jsx":()=>__vitePreload(()=>import("./vector-a4f5b9ff.js"),["assets/vector-a4f5b9ff.js","assets/graph-57e1e537.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"]),"./renderers/video.jsx":()=>__vitePreload(()=>import("./video-88119a6d.js"),["assets/video-88119a6d.js","assets/css-14ccef8c.js","assets/visibility-sensor-55e75ed1.js"])}),`./renderers/${Il}.jsx`));let Kl=Os.current.documentToRender;renderersloadComponent(Hl,Ql).then(Il=>{var Yl;Ds.current=Il;let $l=Il[Kl.rendererType];$s(React.createElement($l,{key:Vs.current+Kl.componentName,componentInstructions:Kl,rendererClasses:Il,flags:as.flags,coreId:Vs.current,callAction:Rl})),(Yl=as.renderersInitializedCallback)==null||Yl.call(as)})}function qs({updateInstructions:Ll,actionId:Hl}){var Ql;for(let Kl of Ll)if(Kl.instructionType==="updateRendererStates")for(let{componentName:Il,stateValues:$l,rendererType:Yl,childrenInstructions:Zl}of Kl.rendererStatesToUpdate)ns({coreId:Vs.current,componentName:Il,stateValues:$l,childrenInstructions:Zl,sourceOfUpdate:Kl.sourceOfUpdate,baseStateVariable:(Ql=Ds.current[Yl])==null?void 0:Ql.baseStateVariable,actionId:Hl});Qs({actionId:Hl})}function Qs({actionId:Ll}){var Hl,Ql;Ll&&((Ql=(Hl=Us.current)[Ll])==null||Ql.call(Hl),delete Us.current[Ll])}function Js({changedOnDevice:Ll,newCid:Hl,newAttemptNumber:Ql}){Ql!==xs?(rs("Reverted activity as attempt number changed on other device",toastType.ERROR),as.updateAttemptNumber?as.updateAttemptNumber(Ql):(as.setIsInErrorState&&as.setIsInErrorState(!0),ls("how to reset attempt number when not given updateAttemptNumber function?"))):(rs(`Reverted page to state saved on device ${Ll}`,toastType.ERROR),Vs.current=nanoid(),Es(!0))}function El(){const Ll=Vs.current;ds!==void 0?us?cidFromText(ds).then(Hl=>{Ll===Vs.current&&(Hl===us?(ys(ds),hs(us),As("continue")):(as.setIsInErrorState&&as.setIsInErrorState(!0),ls(`doenetML did not match specified cid: ${us}`)))}):cidFromText(ds).then(Hl=>{Ll===Vs.current&&(ys(ds),hs(Hl),As("continue"))}):retrieveTextFileForCid(us,"doenet").then(Hl=>{Ll===Vs.current&&(ys(Hl),hs(us),As("continue"))}).catch(Hl=>{Ll===Vs.current&&(as.setIsInErrorState&&as.setIsInErrorState(!0),ls(`doenetML not found for cid: ${us}`))})}async function _l(){const Ll=Vs.current;let Hl=!1;if(as.flags.allowLocalState){let Ql;try{Ql=await get(`${as.doenetId}|${bs}|${xs}|${fs}`)}catch{}if(Ql){if(as.flags.allowSaveState){let Kl=await Xs(Ql);if(Kl.changedOnDevice){if(Number(Kl.newAttemptNumber)!==xs){Js({changedOnDevice:Kl.changedOnDevice,newCid:Kl.newCid,newAttemptNumber:Number(Kl.newAttemptNumber)});return}else Kl.newCid!==fs&&(as.setIsInErrorState&&as.setIsInErrorState(!0),ls("content changed unexpectedly!"));Ql=Kl.newLocalInfo,console.log(`sending toast: Reverted page to state saved on device ${Kl.changedOnDevice}`),rs(`Reverted page to state saved on device ${Kl.changedOnDevice}`,toastType.ERROR)}}Ql.rendererState.__componentNeedingUpdateValue&&Rl({action:{actionName:"updateValue",componentName:Ql.rendererState.__componentNeedingUpdateValue}}),Ks({rendererState:Ql.rendererState,coreInfo:Ql.coreInfo}),Rs.current={coreState:Ql.coreState,serverSaveId:Ql.saveId,requestedVariant:JSON.parse(Ql.coreInfo.generatedVariantString,serializedComponentsReviver)},Hl=!0}}if(!Hl){const Ql={params:{cid:fs,pageNumber:bs,attemptNumber:xs,doenetId:as.doenetId,userId:as.userId,requestedVariantIndex:Ts,allowLoadState:as.flags.allowLoadState,showCorrectness:as.flags.showCorrectness,solutionDisplayMode:as.flags.solutionDisplayMode,showFeedback:as.flags.showFeedback,showHints:as.flags.showHints,autoSubmit:as.flags.autoSubmit}};try{let Kl=await axios.get("/api/loadPageState.php",Ql);if(!Kl.data.success&&as.flags.allowLoadState){as.setIsInErrorState&&as.setIsInErrorState(!0),ls(`Error loading page state: ${Kl.data.message}`);return}if(Kl.data.loadedState){let Il=JSON.parse(Kl.data.coreInfo,serializedComponentsReviver),$l=JSON.parse(Kl.data.rendererState,serializedComponentsReviver);$l.__componentNeedingUpdateValue&&Rl({action:{actionName:"updateValue",componentName:$l.__componentNeedingUpdateValue}}),Ks({rendererState:$l,coreInfo:Il}),Rs.current={coreState:JSON.parse(Kl.data.coreState,serializedComponentsReviver),serverSaveId:Kl.data.saveId,requestedVariant:JSON.parse(Il.generatedVariantString,serializedComponentsReviver)}}}catch(Kl){if(as.flags.allowLoadState){as.setIsInErrorState&&as.setIsInErrorState(!0),ls(`Error loading page state: ${Kl.message}`);return}}}Ll===Vs.current&&(as.pageIsActive?xl():As("readyToCreateCore"))}async function Xs(Ll){let Hl=await get(`${as.doenetId}|${bs}|${xs}|${fs}|ServerSaveId`),Ql={cid:fs,coreInfo:JSON.stringify(Ll.coreInfo,serializedComponentsReplacer),coreState:JSON.stringify(Ll.coreState,serializedComponentsReplacer),rendererState:JSON.stringify(Ll.rendererState,serializedComponentsReplacer),pageNumber:bs,attemptNumber:xs,doenetId:as.doenetId,saveId:Ll.saveId,serverSaveId:Hl,updateDataOnContentChange:as.updateDataOnContentChange},Kl;try{Kl=await axios.post("/api/savePageState.php",Ql)}catch{return{localInfo:Ll,cid:fs,attemptNumber:xs}}let Il=Kl.data;if(!Il.success)return{localInfo:Ll,cid:fs,attemptNumber:xs};if(await set(`${as.doenetId}|${bs}|${xs}|${fs}|ServerSaveId`,Il.saveId),Il.stateOverwritten){let $l={coreState:JSON.parse(Il.coreState,serializedComponentsReviver),rendererState:JSON.parse(Il.rendererState,serializedComponentsReviver),coreInfo:JSON.parse(Il.coreInfo,serializedComponentsReviver),saveId:Il.saveId};return await set(`${as.doenetId}|${bs}|${Il.attemptNumber}|${Il.cid}`,$l),{changedOnDevice:Il.device,newLocalInfo:$l,newCid:Il.cid,newAttemptNumber:Il.attemptNumber}}return{localInfo:Ll,cid:fs,attemptNumber:xs}}function xl(){var Ll;Bs.current&&Dl(),Bs.current=new Worker(new URL("/assets/CoreWorker-94b9bfba.js",self.location),{type:"module"}),Bs.current.postMessage({messageType:"createCore",args:{coreId:Vs.current,userId:as.userId,doenetML:gs,doenetId:as.doenetId,previousComponentTypeCounts:as.previousComponentTypeCounts,activityCid:as.activityCid,flags:as.flags,theme:Gs,requestedVariantIndex:Ts,pageNumber:bs,attemptNumber:xs,itemNumber:as.itemNumber,updateDataOnContentChange:as.updateDataOnContentChange,serverSaveId:Rs.current.serverSaveId,activityVariantIndex:as.activityVariantIndex,requestedVariant:Rs.current.requestedVariant,stateVariableChanges:Rs.current.coreState?Rs.current.coreState:void 0}}),As("waitingOnCore");for(let Hl of Ps.current)(Ll=Bs.current)==null||Ll.postMessage({messageType:"requestAction",args:Hl})}function Al({action:Ll,actionArgs:Hl,delay:Ql,animationId:Kl}){if(!Ms.current)if(Ql){let Il=window.setTimeout(()=>Sl({action:Ll,actionArgs:Hl,animationId:Kl}),Ql);Ws.current[Kl]={timeoutId:Il}}else Ws.current[Kl]={},Sl({action:Ll,actionArgs:Hl,animationId:Kl})}function Sl({action:Ll,actionArgs:Hl,animationId:Ql}){let Kl=window.requestAnimationFrame(()=>Rl({action:Ll,args:Hl})),Il=Ws.current[Ql];delete Il.timeoutId,Il.animationFrameID=Kl}async function Vl(Ll){let Hl=Ws.current[Ll],Ql=Hl==null?void 0:Hl.timeoutId;Ql!==void 0&&window.clearTimeout(Ql);let Kl=Hl==null?void 0:Hl.animationFrameID;Kl!==void 0&&window.cancelAnimationFrame(Kl),delete Ws.current[Ll]}async function Fs({text:Ll,actionId:Hl}){await navigator.clipboard.writeText(Ll),Qs({actionId:Hl})}async function Cl({cid:Ll,doenetId:Hl,variantIndex:Ql,edit:Kl,hash:Il,page:$l,uri:Yl,targetName:Zl,actionId:eu,componentName:tu,effectiveName:nu}){let ru=js+nu,{targetForATag:iu,url:su,haveValidTarget:lu,externalUri:fu}=getURLFromRef({cid:Ll,doenetId:Hl,variantIndex:Ql,edit:Kl,hash:Il,page:$l,givenUri:Yl,targetName:Zl,pageToolView:Hs,inCourse:Object.keys(Ys).length>0,search:Nl.search,id:ru});lu&&(iu==="_blank"?window.open(su,iu):Zs(su)),Qs({actionId:eu})}if(os!==null)return jsxs("div",{style:{fontSize:"1.3em",marginLeft:"20px",marginTop:"20px"},children:[jsx$1("span",{style:{fontSize:"1em",color:"#C1292E"},children:jsx$1(FontAwesomeIcon,{icon:faExclamationCircle})})," ",os]});let Tl=!1;ds!==as.doenetML&&(ps(as.doenetML),Tl=!0),us!==as.cid&&(cs(as.cid),Tl=!0);let zl=as.pageNumber;zl===void 0&&(zl="1"),zl!==bs&&(vs(zl),Tl=!0);let Xl=as.attemptNumber;Xl===void 0&&(Xl=1),Xl!==xs&&(Cs(Xl),Tl=!0);let Pl=as.requestedVariantIndex;if(Pl===void 0&&(Pl=Xl),Ts!==Pl&&(Ss(Pl),Tl=!0),Tl)return Bs.current&&Dl(),As("recalcParams"),Vs.current=nanoid(),Rs.current={},Es(!0),null;if(Ns==="wait")return null;if(Ns=="recalcParams")return As("wait"),El(),null;if(ws)return Es(!1),Os.current=null,$s(null),Is.current=!1,As("wait"),_l(),null;if(Ns==="readyToCreateCore"&&as.pageIsActive?xl():Ns==="waitingOnCore"&&!as.pageIsActive&&(Dl(),As("readyToCreateCore")),as.hideWhenNotCurrent&&!as.pageIsCurrent)return null;let Bl=null,Wl={maxWidth:"850px",paddingLeft:"20px",paddingRight:"20px"};return Is.current||(_s||(Bl=jsx$1("div",{style:{backgroundColor:"lightCyan",padding:"10px"},children:jsx$1("p",{children:"Initializing...."})})),Wl.backgroundColor="#F0F0F0"),jsxs(ErrorBoundary,{setIsInErrorState:as.setIsInErrorState,children:[Bl,jsx$1("div",{style:Wl,children:_s})]})}async function renderersloadComponent(as,rs){var ns={};for(let[ss,os]of as.entries())try{let ls=await os;ns[rs[ss]]=ls.default}catch(ls){throw console.log("here:",ls),Error(`loading ${rs[ss]} failed.`)}return ns}class ErrorBoundary extends React.Component{constructor(rs){super(rs),this.state={hasError:!1}}static getDerivedStateFromError(rs){return{hasError:!0}}componentDidCatch(rs,ns){var ss,os;(os=(ss=this.props).setIsInErrorState)==null||os.call(ss,!0)}render(){return this.state.hasError?jsx$1("h1",{children:"Something went wrong."}):this.props.children}}function getURLFromRef({cid:as,doenetId:rs,variantIndex:ns,edit:ss,hash:os,page:ls,givenUri:us,targetName:cs="",pageToolView:ds={},inCourse:ps=!1,search:fs="",id:hs=""}){let gs="",ys="_blank",bs=!1,vs=!1;if(as||rs){as?gs=`cid=${as}`:gs=`doenetId=${rs}`,ns&&(gs+=`&variant=${ns}`);let xs=!1;ds.page==="public"?xs=!0:ps||(xs=!0),xs?((ss===!0||ss===null&&ds.page==="public"&&ds.tool==="editor")&&(gs=`tool=editor&${gs}`),gs=`/public?${gs}`):ds.page==="placementexam"?gs=`?tool=exam&${gs}`:gs=`?tool=assignment&${gs}`,bs=!0,os?gs+=os:ls?(gs+=`#page${ls}`,cs&&(gs+=cs)):cs&&(gs+="#"+cs)}else if(us)gs=us,(gs.substring(0,8)==="https://"||gs.substring(0,7)==="http://"||gs.substring(0,7)==="mailto:")&&(bs=!0,vs=!0);else{if(gs+=fs,ls)gs+=`#page${ls}`;else{let xs=hs.indexOf("/"),Cs=hs.substring(0,xs);gs+="#"+Cs}gs+=cs,ys=null,bs=!0}return{targetForATag:ys,url:gs,haveValidTarget:bs,externalUri:vs}}const pageVariantInfoAtom=Recoil_index_8({key:"pageVariantInfoAtom",default:{index:1}}),pageVariantPanelAtom=Recoil_index_8({key:"pageVariantPanelAtom",default:{index:1,allPossibleVariants:[]}}),activityVariantPanelAtom=Recoil_index_8({key:"activityVariantPanelAtom",default:{index:1,numberOfVariants:0}});function HiOutlineMail(as){return GenIcon({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"}}]})(as)}function BsDiscord(as){return GenIcon({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M13.545 2.907a13.227 13.227 0 0 0-3.257-1.011.05.05 0 0 0-.052.025c-.141.25-.297.577-.406.833a12.19 12.19 0 0 0-3.658 0 8.258 8.258 0 0 0-.412-.833.051.051 0 0 0-.052-.025c-1.125.194-2.22.534-3.257 1.011a.041.041 0 0 0-.021.018C.356 6.024-.213 9.047.066 12.032c.001.014.01.028.021.037a13.276 13.276 0 0 0 3.995 2.02.05.05 0 0 0 .056-.019c.308-.42.582-.863.818-1.329a.05.05 0 0 0-.01-.059.051.051 0 0 0-.018-.011 8.875 8.875 0 0 1-1.248-.595.05.05 0 0 1-.02-.066.051.051 0 0 1 .015-.019c.084-.063.168-.129.248-.195a.05.05 0 0 1 .051-.007c2.619 1.196 5.454 1.196 8.041 0a.052.052 0 0 1 .053.007c.08.066.164.132.248.195a.051.051 0 0 1-.004.085 8.254 8.254 0 0 1-1.249.594.05.05 0 0 0-.03.03.052.052 0 0 0 .003.041c.24.465.515.909.817 1.329a.05.05 0 0 0 .056.019 13.235 13.235 0 0 0 4.001-2.02.049.049 0 0 0 .021-.037c.334-3.451-.559-6.449-2.366-9.106a.034.034 0 0 0-.02-.019Zm-8.198 7.307c-.789 0-1.438-.724-1.438-1.612 0-.889.637-1.613 1.438-1.613.807 0 1.45.73 1.438 1.613 0 .888-.637 1.612-1.438 1.612Zm5.316 0c-.788 0-1.438-.724-1.438-1.612 0-.889.637-1.613 1.438-1.613.807 0 1.451.73 1.438 1.613 0 .888-.631 1.612-1.438 1.612Z"}}]})(as)}function BsGithub(as){return GenIcon({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"}}]})(as)}async function loader$5(){return await(await fetch("/api/getHPCarouselData.php")).json()}const HomeIntroVideo=reactExports.lazy(()=>__vitePreload(()=>import("./HomeIntroVideo-4970a3d2.js"),[])),CarouselSection=styled$1.div` +`).map(bs=>bs.trim().split(",").map(vs=>vs.trim())),cs=(gs=us[0])==null?void 0:gs.length,ds=!1;for(let bs of us.slice(1))if(bs.length!==cs){ds=!0;break}if(ds)return console.warn(`Data has invalid shape. Rows has inconsistent lengths. Found in componentName :${ss}`),{setValue:{dataFrame:null,numRows:hs,numColumns:cs,columnTypes:os,columnNames:ls}};let ps={},fs=[];if(ns.hasHeader?(ps.columnNames=us[0].map(bs=>(['"',"'"].includes(bs[0])&&bs[bs.length-1]===bs[0]&&(bs=bs.substring(1,bs.length-1)),bs)),fs=us.slice(1)):(ps.columnNames=[...Array(cs).keys()].map(bs=>`col${bs+1}`),fs=us),[...new Set(ps.columnNames)].length({numColumns:{dependencyType:"stateVariable",variableName:"numColumns"}}),returnArraySize({dependencyValues:ns}){return[ns.numColumns]},returnArrayDependenciesByKey(){return{globalDependencies:{dataFrame:{dependencyType:"stateVariable",variableName:"dataFrame"},numColumns:{dependencyType:"stateVariable",variableName:"numColumns"},numRows:{dependencyType:"stateVariable",variableName:"numRows"},columnTypes:{dependencyType:"stateVariable",variableName:"columnTypes"}}}},arrayDefinitionByKey({globalDependencyValues:ns,arrayKeys:ss}){let os={};for(let ls of ss){let us=0,cs=0;if(ns.columnTypes[ls]==="number"){for(let ds=0;ds({displayDigitsAttr:{dependencyType:"attributeComponent",attributeName:"displayDigits",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]}}),definition({dependencyValues:ns,usedDefault:ss}){if(ns.displayDigitsAttr!==null){let os=ss.displayDigitsAttr,ls=ns.displayDecimalsAttr===null||ss.displayDecimalsAttr;if(!(os||ls)){let us=ns.displayDigitsAttr.shadowDepth;ns.displayDecimalsAttr.shadowDepth({statisticsToDisplayPrelim:{dependencyType:"stateVariable",variableName:"statisticsToDisplayPrelim"}}),definition:function({dependencyValues:ns}){let ss=["mean","stdev","variance","stderr","count","minimum","quartile1","median","quartile3","maximum","range","sum"],os=[],ls=ns.statisticsToDisplayPrelim.map(us=>us.toLowerCase());if(ls.includes("default"))os=["mean","stdev","count","minimum","quartile1","median","quartile3","maximum"];else if(ls.includes("all"))os=[...ss];else for(let us of ss)ls.includes(us)&&os.push(us);return{setValue:{statisticsToDisplay:os}}}},rs.sourceName={returnDependencies:()=>({source:{dependencyType:"attributeTargetComponentNames",attributeName:"source"}}),definition({dependencyValues:ns}){var os;let ss;return((os=ns.source)==null?void 0:os.length)===1?ss=ns.source[0].absoluteName:ss=null,{setValue:{sourceName:ss}}}},rs.dataColumn={stateVariablesDeterminingDependencies:["sourceName"],additionalStateVariablesDefined:[{variableName:"columnName",public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0}],returnDependencies({stateValues:ns}){return{dataFrame:{dependencyType:"stateVariable",componentName:ns.sourceName,variableName:"dataFrame",variableOptional:!0},desiredColumn:{dependencyType:"stateVariable",variableName:"desiredColumn"}}},definition({dependencyValues:ns}){let ss=null,os=null;if(ns.dataFrame){let ls=ns.dataFrame,us=ls.columnNames.indexOf(ns.desiredColumn);if(us!==-1){os=ns.desiredColumn,ss=[];for(let cs of ls.data)cs[us]!==null&&ss.push(cs[us])}}return{setValue:{dataColumn:ss,columnName:os}}}},rs.count={public:!0,shadowingInstructions:{createComponentOfType:"integer"},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=ns.dataColumn.length),{setValue:{count:ss}}}},rs.sum={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=ns.dataColumn.reduce((os,ls)=>os+ls)),{setValue:{sum:ss}}}},rs.mean={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn!==null&&(ss=Context.math.mean(ns.dataColumn)),{setValue:{mean:ss}}}},rs.stdev={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=Context.math.std(ns.dataColumn)),{setValue:{stdev:ss}}}},rs.variance={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=Context.math.variance(ns.dataColumn)),{setValue:{variance:ss}}}},rs.stderr={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({stdev:{dependencyType:"stateVariable",variableName:"stdev"},count:{dependencyType:"stateVariable",variableName:"count"}}),definition({dependencyValues:ns}){let ss=null;return ns.stdev!==null&&(ss=ns.stdev/Math.sqrt(ns.count)),{setValue:{stderr:ss}}}},rs.minimum={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=Math.min(...ns.dataColumn)),{setValue:{minimum:ss}}}},rs.maximum={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=Math.max(...ns.dataColumn)),{setValue:{maximum:ss}}}},rs.median={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=Context.math.median(ns.dataColumn)),{setValue:{median:ss}}}},rs.quartile1={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=Context.math.quantileSeq(ns.dataColumn,.25)),{setValue:{quartile1:ss}}}},rs.quartile3={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({dataColumn:{dependencyType:"stateVariable",variableName:"dataColumn"}}),definition({dependencyValues:ns}){let ss=null;return ns.dataColumn&&(ss=Context.math.quantileSeq(ns.dataColumn,.75)),{setValue:{quartile3:ss}}}},rs.range={public:!0,shadowingInstructions:{createComponentOfType:"number",attributesToShadow:["displayDigits","displayDecimals","displaySmallAsZero"]},returnDependencies:()=>({minimum:{dependencyType:"stateVariable",variableName:"minimum"},maximum:{dependencyType:"stateVariable",variableName:"maximum"}}),definition({dependencyValues:ns}){let ss=null;return ns.minimum!==null&&(ss=ns.maximum-ns.minimum),{setValue:{range:ss}}}},rs.summaryStatistics={forRenderer:!0,stateVariablesDeterminingDependencies:["statisticsToDisplay"],returnDependencies({stateValues:ns}){let ss={displayDigits:{dependencyType:"stateVariable",variableName:"displayDigits"},displayDecimals:{dependencyType:"stateVariable",variableName:"displayDecimals"},displaySmallAsZero:{dependencyType:"stateVariable",variableName:"displaySmallAsZero"}};return ns.statisticsToDisplay.includes("mean")&&(ss.mean={dependencyType:"stateVariable",variableName:"mean"}),ns.statisticsToDisplay.includes("stdev")&&(ss.stdev={dependencyType:"stateVariable",variableName:"stdev"}),ns.statisticsToDisplay.includes("variance")&&(ss.variance={dependencyType:"stateVariable",variableName:"variance"}),ns.statisticsToDisplay.includes("stderr")&&(ss.stderr={dependencyType:"stateVariable",variableName:"stderr"}),ns.statisticsToDisplay.includes("count")&&(ss.count={dependencyType:"stateVariable",variableName:"count"}),ns.statisticsToDisplay.includes("minimum")&&(ss.minimum={dependencyType:"stateVariable",variableName:"minimum"}),ns.statisticsToDisplay.includes("quartile1")&&(ss.quartile1={dependencyType:"stateVariable",variableName:"quartile1"}),ns.statisticsToDisplay.includes("median")&&(ss.median={dependencyType:"stateVariable",variableName:"median"}),ns.statisticsToDisplay.includes("quartile3")&&(ss.quartile3={dependencyType:"stateVariable",variableName:"quartile3"}),ns.statisticsToDisplay.includes("maximum")&&(ss.maximum={dependencyType:"stateVariable",variableName:"maximum"}),ns.statisticsToDisplay.includes("range")&&(ss.range={dependencyType:"stateVariable",variableName:"range"}),ns.statisticsToDisplay.includes("sum")&&(ss.sum={dependencyType:"stateVariable",variableName:"sum"}),ss},definition({dependencyValues:ns,usedDefault:ss}){let os={};return ns.mean!==void 0&&(os.mean=roundForDisplay({value:ns.mean,dependencyValues:ns,usedDefault:ss})),ns.stdev!==void 0&&(os.stdev=roundForDisplay({value:ns.stdev,dependencyValues:ns,usedDefault:ss})),ns.variance!==void 0&&(os.variance=roundForDisplay({value:ns.variance,dependencyValues:ns,usedDefault:ss})),ns.stderr!==void 0&&(os.stderr=roundForDisplay({value:ns.stderr,dependencyValues:ns,usedDefault:ss})),ns.count!==void 0&&(os.count=roundForDisplay({value:ns.count,dependencyValues:ns,usedDefault:ss})),ns.minimum!==void 0&&(os.minimum=roundForDisplay({value:ns.minimum,dependencyValues:ns,usedDefault:ss})),ns.quartile1!==void 0&&(os.quartile1=roundForDisplay({value:ns.quartile1,dependencyValues:ns,usedDefault:ss})),ns.median!==void 0&&(os.median=roundForDisplay({value:ns.median,dependencyValues:ns,usedDefault:ss})),ns.quartile3!==void 0&&(os.quartile3=roundForDisplay({value:ns.quartile3,dependencyValues:ns,usedDefault:ss})),ns.maximum!==void 0&&(os.maximum=roundForDisplay({value:ns.maximum,dependencyValues:ns,usedDefault:ss})),ns.range!==void 0&&(os.range=roundForDisplay({value:ns.range,dependencyValues:ns,usedDefault:ss})),ns.sum!==void 0&&(os.sum=roundForDisplay({value:ns.sum,dependencyValues:ns,usedDefault:ss})),{setValue:{summaryStatistics:os}}}},rs}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}}zs(SummaryStatistics,"componentType","summaryStatistics");class Chart extends BlockComponent{constructor(rs){super(rs),Object.assign(this.actions,{changeAxisLimits:this.changeAxisLimits.bind(this),recordVisibilityChange:this.recordVisibilityChange.bind(this)})}static createAttributesObject(){let rs=super.createAttributesObject();return rs.type={createComponentOfType:"text",createStateVariable:"type",defaultValue:"histogram",toLowerCase:!0,validValues:["histogram","dotplot","frequencytable","box","bar"],forRenderer:!0},rs.column={createComponentOfType:"text",createStateVariable:"desiredColumn",defaultValue:null},rs.xmin={createComponentOfType:"number",createStateVariable:"xminPrelim",defaultValue:-10},rs.xmax={createComponentOfType:"number",createStateVariable:"xmaxPrelim",defaultValue:10},rs.ymin={createComponentOfType:"number",createStateVariable:"yminPrelim",defaultValue:-10},rs.ymax={createComponentOfType:"number",createStateVariable:"ymaxPrelim",defaultValue:10},rs.width={createComponentOfType:"_componentSize",createStateVariable:"width",defaultValue:{size:300,isAbsolute:!0},public:!0,forRenderer:!0},rs.height={createComponentOfType:"_componentSize",createStateVariable:"height",defaultValue:{size:300,isAbsolute:!0},public:!0,forRenderer:!0},rs.identicalAxisScales={createComponentOfType:"boolean",createStateVariable:"identicalAxisScales",defaultValue:!1,public:!0,forRenderer:!0},rs.displayXAxis={createComponentOfType:"boolean",createStateVariable:"displayXAxis",defaultValue:!0,public:!0,forRenderer:!0},rs.displayYAxis={createComponentOfType:"boolean",createStateVariable:"displayYAxis",defaultValue:!0,public:!0,forRenderer:!0},rs.displayXAxisTickLabels={createComponentOfType:"boolean",createStateVariable:"displayXAxisTickLabels",defaultValue:!0,public:!0,forRenderer:!0},rs.displayYAxisTickLabels={createComponentOfType:"boolean",createStateVariable:"displayYAxisTickLabels",defaultValue:!0,public:!0,forRenderer:!0},rs.xlabel={createComponentOfType:"text",createStateVariable:"xlabel",defaultValue:"",public:!0,forRenderer:!0},rs.xlabelPosition={createComponentOfType:"text",createStateVariable:"xlabelPosition",defaultValue:"right",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["right","left"]},rs.ylabel={createComponentOfType:"text",createStateVariable:"ylabel",defaultValue:"",public:!0,forRenderer:!0},rs.ylabelPosition={createComponentOfType:"text",createStateVariable:"ylabelPosition",defaultValue:"top",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["top","bottom"]},rs.ylabelAlignment={createComponentOfType:"text",createStateVariable:"ylabelAlignment",defaultValue:"left",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["left","right"]},rs}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.dataFrame={forRenderer:!0,returnDependencies(){return{targetComponent:{dependencyType:"targetComponent",variableNames:["dataFrame"],variablesOptional:!0}}},definition({dependencyValues:ns}){var os;console.log("definition of dataFrame",ns);let ss=null;return(os=ns.targetComponent)!=null&&os.stateValues.dataFrame&&(ss=ns.targetComponent.stateValues.dataFrame),{setValue:{dataFrame:ss}}}},rs.columnName={public:!0,shadowingInstructions:{createComponentOfType:"text"},additionalStateVariablesDefined:[{variableName:"colInd",forRenderer:!0}],returnDependencies(){return{desiredColumn:{dependencyType:"stateVariable",variableName:"desiredColumn"},dataFrame:{dependencyType:"stateVariable",variableName:"dataFrame"}}},definition({dependencyValues:ns}){let ss=null,os=null;return ns.dataFrame&&(os=ns.dataFrame.columnNames.indexOf(ns.desiredColumn),os!==-1?ss=ns.desiredColumn:os=null),{setValue:{columnName:ss,colInd:os}}}},rs.xmin={stateVariablesDeterminingDependencies:["identicalAxisScales"],defaultValue:-10,public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies({stateValues:ns}){let ss={identicalAxisScales:{dependencyType:"stateVariable",variableName:"identicalAxisScales"},xminPrelim:{dependencyType:"stateVariable",variableName:"xminPrelim"}};return ns.identicalAxisScales&&(ss.xmaxPrelim={dependencyType:"stateVariable",variableName:"xmaxPrelim"},ss.yminPrelim={dependencyType:"stateVariable",variableName:"yminPrelim"},ss.ymaxPrelim={dependencyType:"stateVariable",variableName:"ymaxPrelim"},ss.width={dependencyType:"stateVariable",variableName:"width"},ss.height={dependencyType:"stateVariable",variableName:"height"}),ss},definition({dependencyValues:ns,usedDefault:ss}){if(!ns.identicalAxisScales)return{setValue:{xmin:ns.xminPrelim}};if(!ss.xminPrelim)return{setValue:{xmin:ns.xminPrelim}};let ls=!ss.xmaxPrelim,us=!ss.yminPrelim,cs=!ss.ymaxPrelim;if(us&&cs){let ps=ns.width.size/ns.height.size,fs=(ns.ymaxPrelim-ns.yminPrelim)*ps;return ls?{setValue:{xmin:ns.xmaxPrelim-fs}}:{setValue:{xmin:-fs/2}}}else return ls?{setValue:{xmin:ns.xmaxPrelim-20}}:{setValue:{xmin:-10}}},async inverseDefinition({desiredStateVariableValues:ns,stateValues:ss}){return await ss.fixAxes?{success:!1}:{success:!0,instructions:[{setDependency:"xminPrelim",desiredValue:ns.xmin}]}}},rs.xmax={stateVariablesDeterminingDependencies:["identicalAxisScales"],defaultValue:-10,public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies({stateValues:ns}){let ss={identicalAxisScales:{dependencyType:"stateVariable",variableName:"identicalAxisScales"},xmaxPrelim:{dependencyType:"stateVariable",variableName:"xmaxPrelim"}};return ns.identicalAxisScales&&(ss.xminPrelim={dependencyType:"stateVariable",variableName:"xminPrelim"},ss.yminPrelim={dependencyType:"stateVariable",variableName:"yminPrelim"},ss.ymaxPrelim={dependencyType:"stateVariable",variableName:"ymaxPrelim"},ss.width={dependencyType:"stateVariable",variableName:"width"},ss.height={dependencyType:"stateVariable",variableName:"height"}),ss},definition({dependencyValues:ns,usedDefault:ss}){if(!ns.identicalAxisScales)return{setValue:{xmax:ns.xmaxPrelim}};let os=!ss.xminPrelim,ls=!ss.xmaxPrelim,us=!ss.yminPrelim,cs=!ss.ymaxPrelim,ds=us&&cs,ps=os&&ls,fs=ns.xminPrelim;if(ds){let hs=ns.width.size/ns.height.size,gs=(ns.ymaxPrelim-ns.yminPrelim)*hs;if(ps){let ys=ns.xmaxPrelim-fs,bs=Math.max(ys,gs);return{setValue:{xmax:fs+bs}}}else return os?{setValue:{xmax:fs+gs}}:ls?{setValue:{xmax:ns.xmaxPrelim}}:{setValue:{xmax:gs/2}}}else return ls?{setValue:{xmax:ns.xmaxPrelim}}:os?{setValue:{xmax:fs+20}}:{setValue:{xmax:10}}},async inverseDefinition({desiredStateVariableValues:ns,stateValues:ss}){return await ss.fixAxes?{success:!1}:{success:!0,instructions:[{setDependency:"xmaxPrelim",desiredValue:ns.xmax}]}}},rs.ymin={stateVariablesDeterminingDependencies:["identicalAxisScales"],defaultValue:-10,public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies({stateValues:ns}){let ss={identicalAxisScales:{dependencyType:"stateVariable",variableName:"identicalAxisScales"},yminPrelim:{dependencyType:"stateVariable",variableName:"yminPrelim"}};return ns.identicalAxisScales&&(ss.xmaxPrelim={dependencyType:"stateVariable",variableName:"xmaxPrelim"},ss.xminPrelim={dependencyType:"stateVariable",variableName:"xminPrelim"},ss.ymaxPrelim={dependencyType:"stateVariable",variableName:"ymaxPrelim"},ss.width={dependencyType:"stateVariable",variableName:"width"},ss.height={dependencyType:"stateVariable",variableName:"height"}),ss},definition({dependencyValues:ns,usedDefault:ss}){if(!ns.identicalAxisScales)return{setValue:{ymin:ns.yminPrelim}};if(!ss.yminPrelim)return{setValue:{ymin:ns.yminPrelim}};let ls=!ss.ymaxPrelim,us=!ss.xminPrelim,cs=!ss.xmaxPrelim,ds=us&&cs,ps=ns.width.size/ns.height.size;if(ds){let fs=(ns.xmaxPrelim-ns.xminPrelim)/ps;return ls?{setValue:{ymin:ns.ymaxPrelim-fs}}:{setValue:{ymin:-fs/2}}}else return ls?{setValue:{ymin:ns.ymaxPrelim-20/ps}}:{setValue:{ymin:-10/ps}}},async inverseDefinition({desiredStateVariableValues:ns,stateValues:ss}){return await ss.fixAxes?{success:!1}:{success:!0,instructions:[{setDependency:"yminPrelim",desiredValue:ns.ymin}]}}},rs.ymax={stateVariablesDeterminingDependencies:["identicalAxisScales"],defaultValue:-10,public:!0,shadowingInstructions:{createComponentOfType:"number"},forRenderer:!0,returnDependencies({stateValues:ns}){let ss={identicalAxisScales:{dependencyType:"stateVariable",variableName:"identicalAxisScales"},ymaxPrelim:{dependencyType:"stateVariable",variableName:"ymaxPrelim"}};return ns.identicalAxisScales&&(ss.xminPrelim={dependencyType:"stateVariable",variableName:"xminPrelim"},ss.yminPrelim={dependencyType:"stateVariable",variableName:"yminPrelim"},ss.xmaxPrelim={dependencyType:"stateVariable",variableName:"xmaxPrelim"},ss.width={dependencyType:"stateVariable",variableName:"width"},ss.height={dependencyType:"stateVariable",variableName:"height"}),ss},definition({dependencyValues:ns,usedDefault:ss}){if(!ns.identicalAxisScales)return{setValue:{ymax:ns.ymaxPrelim}};let os=!ss.xminPrelim,ls=!ss.xmaxPrelim,us=!ss.yminPrelim,cs=!ss.ymaxPrelim,ds=us&&cs,ps=os&&ls,fs=ns.yminPrelim,hs=ns.width.size/ns.height.size;if(ps){let gs=(ns.xmaxPrelim-ns.xminPrelim)/hs;if(ds){let ys=ns.ymaxPrelim-fs,bs=Math.max(ys,gs);return{setValue:{ymax:fs+bs}}}else return us?{setValue:{ymax:fs+gs}}:cs?{setValue:{ymax:ns.ymaxPrelim}}:{setValue:{ymax:gs/2}}}else return cs?{setValue:{ymax:ns.ymaxPrelim}}:us?{setValue:{ymax:fs+20/hs}}:{setValue:{ymax:10/hs}}},async inverseDefinition({desiredStateVariableValues:ns,stateValues:ss}){return await ss.fixAxes?{success:!1}:{success:!0,instructions:[{setDependency:"ymaxPrelim",desiredValue:ns.ymax}]}}},rs.xscale={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({xmin:{dependencyType:"stateVariable",variableName:"xmin"},xmax:{dependencyType:"stateVariable",variableName:"xmax"}}),definition({dependencyValues:ns}){return{setValue:{xscale:ns.xmax-ns.xmin}}}},rs.yscale={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({ymin:{dependencyType:"stateVariable",variableName:"ymin"},ymax:{dependencyType:"stateVariable",variableName:"ymax"}}),definition({dependencyValues:ns}){return{setValue:{yscale:ns.ymax-ns.ymin}}}},rs}async changeAxisLimits({xmin:rs,xmax:ns,ymin:ss,ymax:os,actionId:ls,sourceInformation:us={},skipRendererUpdate:cs=!1}){let ds=[];return rs!==void 0&&ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"xmin",value:rs}),ns!==void 0&&ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"xmax",value:ns}),ss!==void 0&&ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"ymin",value:ss}),os!==void 0&&ds.push({updateType:"updateValue",componentName:this.componentName,stateVariable:"ymax",value:os}),await this.coreFunctions.performUpdate({updateInstructions:ds,actionId:ls,sourceInformation:us,skipRendererUpdate:cs,event:{verb:"interacted",object:{componentName:this.componentName,componentType:this.componentType},result:{xmin:rs,xmax:ns,ymin:ss,ymax:os}}})}recordVisibilityChange({isVisible:rs,actionId:ns}){this.coreFunctions.requestRecordEvent({verb:"visibilityChanged",object:{componentName:this.componentName,componentType:this.componentType},result:{isVisible:rs}}),this.coreFunctions.resolveAction({actionId:ns})}}zs(Chart,"componentType","chart"),zs(Chart,"acceptTarget",!0);class Legend extends GraphicalComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.position={createComponentOfType:"text",createStateVariable:"position",defaultValue:"upperright",public:!0,forRenderer:!0,toLowerCase:!0,validValues:["upperright","upperleft","lowerright","lowerleft"]},rs.displayClosedSwatches={createComponentOfType:"boolean",createStateVariable:"displayClosedSwatches",defaultValue:!1,public:!0},rs}static returnChildGroups(){return[{group:"labels",componentTypes:["label"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.graphicalElementNames={returnDependencies:()=>({graphAncestor:{dependencyType:"ancestor",componentType:"graph",variableNames:["graphicalDescendants"]}}),definition({dependencyValues:ns}){return ns.graphAncestor?{setValue:{graphicalElementNames:ns.graphAncestor.stateValues.graphicalDescendants.map(ss=>ss.componentName)}}:{setValue:{graphicalElementNames:null}}}},rs.legendElements={forRenderer:!0,stateVariablesDeterminingDependencies:["graphicalElementNames"],returnDependencies:({stateValues:ns})=>{let ss={labelChildren:{dependencyType:"child",childGroups:["labels"],variableNames:["value","hasLatex","forObjectComponentName"]},displayClosedSwatches:{dependencyType:"stateVariable",variableName:"displayClosedSwatches"}};if(ns.graphicalElementNames){ss.numGraphicalElements={dependencyType:"value",value:ns.graphicalElementNames.length};for(let[os,ls]of ns.graphicalElementNames.entries())ss[`graphicalElement${os}`]={dependencyType:"multipleStateVariables",componentName:ls,variableNames:["selectedStyle","styleNumber","filled"],variablesOptional:!0},ss[`graphicalElement${os}AdapterSource`]={dependencyType:"adapterSource",componentName:ls},ss[`graphicalElement${os}ShadowSource`]={dependencyType:"shadowSource",componentName:ls}}return ss},definition({dependencyValues:ns,componentInfoObjects:ss}){let os=[];if(ns.numGraphicalElements>0){let ls=[],us=[],cs=[],ds=[];for(let gs=0;gsgs.componentName),fs=[],hs={};for(let gs of ns.labelChildren){let ys={value:gs.stateValues.value,hasLatex:gs.stateValues.hasLatex};if(gs.stateValues.forObjectComponentName){hs[gs.stateValues.forObjectComponentName]=ys;let bs=ps.indexOf(gs.stateValues.forObjectComponentName);if(bs!==-1){let vs=ds[bs];ss.isInheritedComponentType({inheritedComponentType:vs.componentType,baseComponentType:"point"})?ls.push(vs.stateValues.styleNumber):ns.displayClosedSwatches&&ss.allComponentClasses[vs.componentType].representsClosedPath?us.push(vs.stateValues.styleNumber):vs.componentType!=="legend"&&cs.push(vs.stateValues.styleNumber)}}fs.push({labelInfo:ys,forObject:gs.stateValues.forObjectComponentName})}for(let gs of fs){let ys;if(gs.forObject){let bs=ps.indexOf(gs.forObject);bs!==-1&&(ys=ds[bs],ds.splice(bs,1),ps.splice(bs,1))}else for(let bs=0;bs({graphAncestor:{dependencyType:"ancestor",componentType:"graph",variableNames:["xmin","xmax","ymin","ymax"]}}),definition({dependencyValues:ns}){return ns.graphAncestor?{setValue:{graphLimits:ns.graphAncestor.stateValues}}:{setValue:{graphLimits:null}}}},rs}}zs(Legend,"componentType","legend");class MatchesPattern extends BooleanComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.pattern={createComponentOfType:"math"},rs.allowImplicitIdentities={createComponentOfType:"boolean",createStateVariable:"allowImplicitIdentities",defaultValue:!1,public:!0},rs.allowPermutations={createComponentOfType:"boolean",createStateVariable:"allowPermutations",defaultValue:!0,public:!0},rs.requireNumericMatches={createComponentOfType:"boolean",createStateVariable:"requireNumericMatches",defaultValue:!1,public:!0},rs.requireVariableMatches={createComponentOfType:"boolean",createStateVariable:"requireVariableMatches",defaultValue:!1,public:!0},rs.excludeMatches={createComponentOfType:"mathList",createStateVariable:"excludeMatches",defaultValue:[],public:!0},rs.matchExpressionWithBlanks={createComponentOfType:"boolean",createStateVariable:"matchExpressionWithBlanks",defaultValue:!1,public:!0},rs}static returnSugarInstructions(){let rs=[],ns=function({matchedChildren:ss,componentInfoObjects:os}){return ss.length===0||ss.length===1&&os.componentIsSpecifiedType(ss[0],"math")?{success:!1}:{success:!0,newChildren:[{componentType:"math",children:ss}]}};return rs.push({replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"maths",componentTypes:["math"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return delete rs.parsedExpression,delete rs.mathChildrenByCode,rs.pattern={additionalStateVariablesDefined:["patternVariables"],returnDependencies:()=>({patternAttr:{dependencyType:"attributeComponent",attributeName:"pattern",variableNames:["value"]}}),definition({dependencyValues:ns}){let ss=[];if(!ns.patternAttr)return{setValue:{pattern:"_",patternVariables:ss}};let os=ns.patternAttr.stateValues.value.variables(),ls=26*27+1;function us(ds){if(ds==="_"){let ps=numberToLetters(ls);for(ls++;os.includes(ps);)ps=numberToLetters(ls),ls++;return ss.push(ps),ps}else return Array.isArray(ds)?[ds[0],...ds.slice(1).map(us)]:ds}return{setValue:{pattern:us(ns.patternAttr.stateValues.value.tree),patternVariables:ss}}}},rs.value={additionalStateVariablesDefined:[{variableName:"allPatternMatches"}],public:!0,shadowingInstructions:{createComponentOfType:"boolean"},forRenderer:!0,returnDependencies:()=>({pattern:{dependencyType:"stateVariable",variableName:"pattern"},patternVariables:{dependencyType:"stateVariable",variableName:"patternVariables"},mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["value"]},allowImplicitIdentities:{dependencyType:"stateVariable",variableName:"allowImplicitIdentities"},allowPermutations:{dependencyType:"stateVariable",variableName:"allowPermutations"},requireNumericMatches:{dependencyType:"stateVariable",variableName:"requireNumericMatches"},requireVariableMatches:{dependencyType:"stateVariable",variableName:"requireVariableMatches"},excludeMatches:{dependencyType:"stateVariable",variableName:"excludeMatches"},matchExpressionWithBlanks:{dependencyType:"stateVariable",variableName:"matchExpressionWithBlanks"}}),definition:function({dependencyValues:ns}){if(ns.mathChildren.length===0)return{setValue:{value:!1,allPatternMatches:[]}};let ss=ns.mathChildren[0].stateValues.value;if(ss.variables().includes("_")&&!ns.matchExpressionWithBlanks)return{setValue:{value:!1,allPatternMatches:[]}};let os={};if(ns.requireNumericMatches){let ps=fs=>!Number.isNaN(Context.fromAst(fs).evaluate_to_constant());ns.patternVariables.forEach(fs=>os[fs]=ps)}else if(ns.requireVariableMatches){let ps=fs=>typeof fs=="string";ns.patternVariables.forEach(fs=>os[fs]=ps)}else ns.patternVariables.forEach(ps=>os[ps]=!0);let ls={variables:os,allow_permutations:ns.allowPermutations};ns.allowImplicitIdentities&&(ls.allow_implicit_identities=ns.patternVariables);let us=ss.match(ns.pattern,ls),cs=!1,ds=[];return us&&(Object.values(us).map(ps=>Context.fromAst(ps)).some(ps=>ns.excludeMatches.some(fs=>ps.variables().some(hs=>fs.equalsViaSyntax(Context.fromAst(hs)))))||(cs=!0,ds=ns.patternVariables.map(ps=>Context.fromAst(us[ps])))),{setValue:{value:cs,allPatternMatches:ds}}}},rs.nMatches={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({allPatternMatches:{dependencyType:"stateVariable",variableName:"allPatternMatches"}}),definition({dependencyValues:ns}){return{setValue:{nMatches:ns.allPatternMatches.length},checkForActualChange:{nMatches:!0}}}},rs.patternMatches={public:!0,shadowingInstructions:{createComponentOfType:"math"},isArray:!0,nDimensions:1,entryPrefixes:["patternMatch"],returnArraySizeDependencies:()=>({nMatches:{dependencyType:"stateVariable",variableName:"nMatches"}}),returnArraySize({dependencyValues:ns}){return[ns.nMatches]},returnArrayDependenciesByKey(){return{globalDependencies:{allPatternMatches:{dependencyType:"stateVariable",variableName:"allPatternMatches"}}}},arrayDefinitionByKey({globalDependencyValues:ns}){let ss={};for(let os=0;os({displayDigitsAttr:{dependencyType:"attributeComponent",attributeName:"displayDigits",variableNames:["value"]},displayDecimalsAttr:{dependencyType:"attributeComponent",attributeName:"displayDecimals",variableNames:["value"]}}),definition({dependencyValues:ns,usedDefault:ss}){if(ns.displayDigitsAttr!==null){let os=ss.displayDigitsAttr,ls=ns.displayDecimalsAttr===null||ss.displayDecimalsAttr;if(!(os||ls)){let us=ns.displayDigitsAttr.shadowDepth;ns.displayDecimalsAttr.shadowDepth({}),definition(){return{setValue:{unordered:!1}}}},rs.matrixSizePre={returnDependencies:()=>({rowChildren:{dependencyType:"child",childGroups:["rows"],variableNames:["nComponents"]},colChildren:{dependencyType:"child",childGroups:["columns"],variableNames:["nComponents"]},mathChildren:{dependencyType:"child",childGroups:["maths"],variableNames:["matrixSize"]},nRowsAttr:{dependencyType:"attributeComponent",attributeName:"nRows",variableNames:["value"]},nColumnsAttr:{dependencyType:"attributeComponent",attributeName:"nColumns",variableNames:["value"]}}),definition({dependencyValues:ns}){let ss=null,os=null;return ns.nRowsAttr&&(ss=ns.nRowsAttr.stateValues.value,Number.isFinite(ss)&&ss>0||(ss=null)),ns.nColumnsAttr&&(os=ns.nColumnsAttr.stateValues.value,Number.isFinite(os)&&os>0||(os=null)),ns.rowChildren.length>0?(ss===null&&(ss=ns.rowChildren.length),os===null&&(os=Math.max(1,...ns.rowChildren.map(ls=>ls.stateValues.nComponents)))):ns.colChildren.length>0?(os===null&&(os=ns.colChildren.length),ss===null&&(ss=Math.max(1,...ns.colChildren.map(ls=>ls.stateValues.nComponents)))):ns.mathChildren.length===1?(ss===null&&(ss=ns.mathChildren[0].stateValues.matrixSize[0]),os===null&&(os=ns.mathChildren[0].stateValues.matrixSize[1])):ss===null?os===null?(ss=0,os=0):ss=1:os===null&&(os=1),{setValue:{matrixSizePre:[ss,os]}}}},rs.matrixPre={isArray:!0,nDimensions:2,hasEssential:!0,returnArraySizeDependencies:()=>({matrixSizePre:{dependencyType:"stateVariable",variableName:"matrixSizePre"}}),returnArraySize({dependencyValues:ns}){return ns.matrixSizePre},returnArrayDependenciesByKey:({arrayKeys:ns})=>{let ss={defaultEntry:{dependencyType:"stateVariable",variableName:"defaultEntry"},rowChildIdentities:{dependencyType:"child",childGroups:["rows"]},colChildIdentities:{dependencyType:"child",childGroups:["columns"]}},os={};for(let ls of ns){let[us,cs]=ls.split(",");os[ls]={rowChild:{dependencyType:"child",childGroups:["rows"],childIndices:[us],variableNames:["math"+(Number(cs)+1)]},colChild:{dependencyType:"child",childGroups:["columns"],childIndices:[cs],variableNames:["math"+(Number(us)+1)]},mathChild:{dependencyType:"child",childGroups:["maths"],childIndices:[0],variableNames:["matrixEntry"+(Number(us)+1)+"_"+(Number(cs)+1)]}}}return{globalDependencies:ss,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os,arraySize:ls}){var fs,hs,gs;let us={},cs={},ds=ns.rowChildIdentities.length>0,ps=ns.colChildIdentities.length>0;for(let ys of os){let[bs,vs]=ys.split(","),xs;ds?xs=(fs=ss[ys].rowChild[0])==null?void 0:fs.stateValues["math"+(Number(vs)+1)]:ps?xs=(hs=ss[ys].colChild[0])==null?void 0:hs.stateValues["math"+(Number(bs)+1)]:xs=(gs=ss[ys].mathChild[0])==null?void 0:gs.stateValues["matrixEntry"+(Number(bs)+1)+"_"+(Number(vs)+1)],xs===void 0?cs[ys]={defaultValue:ns.defaultEntry}:us[ys]=xs}return{setValue:{matrixPre:us},useEssentialOrDefaultValue:{matrixPre:cs}}},async inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls}){var fs,hs,gs;let us=[],cs={},ds=ss.rowChildIdentities.length>0,ps=ss.colChildIdentities.length>0;for(let ys in ns.matrixPre){let[bs,vs]=ys.split(",");ds?((fs=os[ys].rowChild[0])==null?void 0:fs.stateValues["math"+(Number(vs)+1)])===void 0?cs[ys]=ns.matrixPre[ys]:us.push({setDependency:ls[ys].rowChild,desiredValue:ns.matrixPre[ys],childIndex:0,variableIndex:0}):ps?((hs=os[ys].colChild[0])==null?void 0:hs.stateValues["math"+(Number(bs)+1)])===void 0?cs[ys]=ns.matrixPre[ys]:us.push({setDependency:ls[ys].colChild,desiredValue:ns.matrixPre[ys],childIndex:0,variableIndex:0}):((gs=os[ys].mathChild[0])==null?void 0:gs.stateValues["matrixEntry"+(Number(bs)+1)+"_"+(Number(vs)+1)])===void 0?cs[ys]=ns.matrixPre[ys]:us.push({setDependency:ls[ys].mathChild,desiredValue:ns.matrixPre[ys],childIndex:0,variableIndex:0})}return Object.keys(cs).length>0&&us.push({setEssentialValue:"matrixPre",value:cs}),{success:!0,instructions:us}}},rs.unnormalizedValue={returnDependencies:()=>({matrixPre:{dependencyType:"stateVariable",variableName:"matrixPre"},matrixSizePre:{dependencyType:"stateVariable",variableName:"matrixSizePre"}}),definition({dependencyValues:ns}){let ss=["tuple"];for(let ls=0;lsus.tree)]);return{setValue:{unnormalizedValue:Context.fromAst(["matrix",["tuple",...ns.matrixSizePre],ss])}}},inverseDefinition({dependencyValues:ns,desiredStateVariableValues:ss}){var us,cs;let os=ss.unnormalizedValue.tree;if(!(Array.isArray(os)&&os[0]==="matrix"&&((us=os[1])==null?void 0:us[1])===ns.matrixSizePre[0]&&((cs=os[1])==null?void 0:cs[2])===ns.matrixSizePre[1]))return{success:!1};let ls={};for(let ds=0;ds({modifyIndirectly:{dependencyType:"stateVariable",variableName:"modifyIndirectly"},fixed:{dependencyType:"stateVariable",variableName:"fixed"}}),definition({dependencyValues:ns}){return{setValue:{canBeModified:ns.modifyIndirectly&&!ns.fixed}}}},rs}}zs(Matrix,"componentType","matrix"),zs(Matrix,"rendererType","math");class EigenDecomposition extends BaseComponent{static createAttributesObject(){let rs=super.createAttributesObject();return rs.displayDigits={createComponentOfType:"integer",createStateVariable:"displayDigits",defaultValue:14,public:!0},rs.displayDecimals={createComponentOfType:"integer",createStateVariable:"displayDecimals",defaultValue:null,public:!0},rs.displaySmallAsZero={createComponentOfType:"number",createStateVariable:"displaySmallAsZero",valueForTrue:1e-14,valueForFalse:0,defaultValue:0,public:!0},rs.padZeros={createComponentOfType:"boolean",createStateVariable:"padZeros",defaultValue:!1,public:!0},rs}static returnChildGroups(){return[{group:"maths",componentTypes:["math"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.decomposition={returnDependencies:()=>({mathChild:{dependencyType:"child",childGroups:["maths"],variableNames:["value"]}}),definition({dependencyValues:ns}){if(ns.mathChild.length===0)return{setValue:{decomposition:null}};let ss=ns.mathChild[0].stateValues.value.tree;if(!Array.isArray(ss)||ss[0]!=="matrix")return{setValue:{decomposition:null}};let os=ss[1][1],ls=ss[1][2];if(!(Number.isInteger(os)&&ls===os))return{setValue:{decomposition:null}};let us=[];for(let ds=0;ds({decomposition:{dependencyType:"stateVariable",variableName:"decomposition"}}),returnArraySize({dependencyValues:ns}){let ss;return ns.decomposition?ss=ns.decomposition.values.length:ss=0,[ss]},returnArrayDependenciesByKey(){return{globalDependencies:{decomposition:{dependencyType:"stateVariable",variableName:"decomposition"}}}},arrayDefinitionByKey({globalDependencyValues:ns,arraySize:ss}){let os=[];for(let ls=0;lsNumber(us)-1);return ls.length===2&&ls.every((us,cs)=>Number.isInteger(us)&&us>=0)?os?ls.every((us,cs)=>us=0?os?lsls+","+cs):[]:[ls+",0"]:[]}},arrayVarNameFromPropIndex(ns,ss){if(ss==="eigenvectors")return ns.length===1?"eigenvector"+ns[0]:`eigenvectorX${ns[0]}_${ns[1]}`;if(ss.slice(0,11)==="eigenvector"){let os=Number(ss.slice(11));if(Number.isInteger(os)&&os>0)return`eigenvectorX${os}_${ns[0]}`}return null},entryPrefixes:["eigenvectorX","eigenvector"],returnArraySizeDependencies:()=>({decomposition:{dependencyType:"stateVariable",variableName:"decomposition"}}),returnArraySize({dependencyValues:ns}){let ss;return ns.decomposition?ss=ns.decomposition.values.length:ss=0,[ss,ss]},returnArrayDependenciesByKey(){return{globalDependencies:{decomposition:{dependencyType:"stateVariable",variableName:"decomposition"}}}},arrayDefinitionByKey({globalDependencyValues:ns,arraySize:ss}){let os={};for(let ls=0;lsContext.math.divide(ds,cs));for(let ds=0;ds({mathTextLikeChildren:{dependencyType:"child",childGroups:["mathTextLike"],variableNames:["text","latex"]}}),rs.value.definition=function({dependencyValues:ns}){if(ns.mathTextLikeChildren.length===0)return{useEssentialOrDefaultValue:{value:!0}};let ss="";for(let os of ns.mathTextLikeChildren)typeof os=="string"?ss+=os:os.stateValues.latex!==void 0?ss+=os.stateValues.latex:ss+=os.stateValues.text;return{setValue:{value:ss}}},rs.value.inverseDefinition=function({desiredStateVariableValues:ns,dependencyValues:ss}){var ls;let os=ss.mathTextLikeChildren.length;return os>1?{success:!1}:os===1?{success:!0,instructions:[{setDependency:"textLikeChildren",desiredValue:ns.value,childIndex:0,variableIndex:((ls=ss.textLikeChildren[0].stateValues)==null?void 0:ls.latex)===void 0?0:1}]}:{success:!0,instructions:[{setEssentialValue:"value",value:ns.value===null?"":String(ns.value)}]}},rs.text={public:!0,shadowingInstructions:{createComponentOfType:"text"},forRenderer:!0,returnDependencies:()=>({value:{dependencyType:"stateVariable",variableName:"value"}}),definition:({dependencyValues:ns})=>({setValue:{text:ns.value}}),inverseDefinition:({desiredStateVariableValues:ns})=>({success:!0,instructions:[{setDependency:"value",desiredValue:ns.text}]})},rs.latex={isAlias:!0,targetVariableName:"value"},rs}}zs(Latex,"componentType","latex"),zs(Latex,"rendererType","text");const unitConversions={"":1,px:1,pixel:1,pixels:1,"%":1,em:100,in:96,inch:96,inches:96,pt:1.333333333333,mm:3.7795296,millimeter:3.7795296,millimeters:3.7795296,cm:37.795296,centimeter:37.795296,centimeters:37.795296};class ComponentSize extends InlineComponent{static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss}){let os=ss[ss.length-1];if(typeof os=="string"){let ls=/([a-zA-z]+|%)$/,us=os.trim(),cs=us.match(ls);if(cs){let ds=cs[1];if(ds in unitConversions){let ps=us.slice(0,cs.index),fs=ss.slice(0,ss.length-1);return ps.length>0&&fs.push(ps),{success:!0,newChildren:[{componentType:"number",children:fs},ds]}}}}return{success:!0,newChildren:[{componentType:"number",children:ss}]}};return rs.push({childrenRegex:/..+/,replacementFunction:ns}),rs}static returnChildGroups(){return[{group:"strings",componentTypes:["string"]},{group:"numbers",componentTypes:["number"]},{group:"componentSizes",componentTypes:["_componentSize"]}]}static returnStateVariableDefinitions(){let rs=super.returnStateVariableDefinitions();return rs.componentSize={public:!0,shadowingInstructions:{createComponentOfType:"_componentSize"},hasEssential:!0,returnDependencies:()=>({componentSizeChild:{dependencyType:"child",childGroups:["componentSizes"],variableNames:["componentSize"]},numberChild:{dependencyType:"child",childGroups:["numbers"],variableNames:["value"]},stringChild:{dependencyType:"child",childGroups:["strings"],variableNames:["value"]},parentDefaultAbsoluteSize:{dependencyType:"parentStateVariable",variableName:"defaultAbsoluteSize"}}),definition({dependencyValues:ns}){let ss=ns.parentDefaultAbsoluteSize===void 0?!1:ns.parentDefaultAbsoluteSize;if(ns.stringChild.length===0)return ns.numberChild.length===0?ns.componentSizeChild.length===0?{useEssentialOrDefaultValue:{componentSize:{defaultValue:{size:100,isAbsolute:ss}}}}:{setValue:{componentSize:ns.componentSizeChild[0].stateValues.componentSize}}:{setValue:{componentSize:{size:ns.numberChild[0].stateValues.value,isAbsolute:!0}}};{let os,ls;if(ns.numberChild.length>0)os=ns.numberChild[0].stateValues.value,ls=ns.stringChild[0].trim();else{let ps=ns.stringChild[0].trim().match(/^(-?[\d.]+)\s*(.*)$/);if(ps===null)return{setValue:{componentSize:null}};os=ps[1],ls=ps[2].trim()}if(os=Number(os),!Number.isFinite(os))return{setValue:{componentSize:null}};let us=!(ls==="%"||ls==="em"),cs=unitConversions[ls];return cs===void 0&&(cs=1),{setValue:{componentSize:{size:cs*os,isAbsolute:us}}}}},inverseDefinition({desiredStateVariableValues:ns,dependencyValues:ss}){if(ss.stringChild.length===0)return ss.numberChild.length===0?ss.componentSizeChild.length===0?{success:!0,instructions:[{setEssentialValue:"componentSize",value:ns.componentSize}]}:{success:!0,instructions:[{setDependency:"componentSizeChild",desiredValue:ns.componentSize,childIndex:0,variableIndex:0}]}:ns.componentSize.isAbsolute?{success:!0,instructions:[{setDependency:"numberChild",desiredValue:ns.componentSize.size,childIndex:0,variableIndex:0}]}:{success:!1};if(ss.numberChild.length>0){let os=ss.stringChild[0].trim(),ls=!(os==="%"||os==="em");if(ns.componentSize.isAbsolute!==ls)return{success:!1};let us=unitConversions[os];return us===void 0&&(us=1),{success:!0,instructions:[{setDependency:"numberChild",desiredValue:ns.componentSize.size/us,childIndex:0,variableIndex:0}]}}else{let os=ns.componentSize.size;return ns.componentSize.isAbsolute?os+="px":os+="%",{success:!0,instructions:[{setDependency:"stringChild",desiredValue:os,childIndex:0,variableIndex:0}]}}}},rs.number={public:!0,shadowingInstructions:{createComponentOfType:"number"},returnDependencies:()=>({componentSize:{dependencyType:"stateVariable",variableName:"componentSize"}}),definition({dependencyValues:ns}){let ss=null;return ns.componentSize&&(ss=ns.componentSize.size),{setValue:{number:ss}}},inverseDefinition({desiredStateVariableValues:ns,dependencyValues:ss}){return ss.componentSize?{success:!0,instructions:[{setDependency:"componentSize",desiredValue:{size:ns.number,isAbsolute:ss.componentSize.isAbsolute}}]}:{success:!1}}},rs.math=mathStateVariableFromNumberStateVariable({numberVariableName:"number",mathVariableName:"math",isPublic:!0}),rs.isAbsolute={public:!0,shadowingInstructions:{createComponentOfType:"boolean"},returnDependencies:()=>({componentSize:{dependencyType:"stateVariable",variableName:"componentSize"}}),definition({dependencyValues:ns}){let ss=null;return ns.componentSize&&(ss=ns.componentSize.isAbsolute),{setValue:{isAbsolute:ss}}}},rs.text={forRenderer:!0,returnDependencies:()=>({componentSize:{dependencyType:"stateVariable",variableName:"componentSize"}}),definition({dependencyValues:ns}){let ss="";return ns.componentSize&&(ss=ns.componentSize.size,ns.componentSize.isAbsolute?ss+="px":ss+="%"),{setValue:{text:ss}}}},rs}}zs(ComponentSize,"componentType","_componentSize"),zs(ComponentSize,"rendererType","text"),zs(ComponentSize,"primaryStateVariableForDefinition","componentSize"),zs(ComponentSize,"stateVariableForAttributeValue","componentSize"),zs(ComponentSize,"adapters",["number","math"]);class ComponentSizeList extends BaseComponent{static returnSugarInstructions(){let rs=super.returnSugarInstructions(),ns=function({matchedChildren:ss}){let os=[],ls=[],us=function(){ls.length>0&&(os.push({componentType:"_componentSize",children:ls}),ls=[])};for(let cs of ss)if(typeof cs=="string"){let ds=cs.split(/\s+/);ds[0].length===0&&(us(),ds=ds.slice(1));for(let[ps,fs]of ds.entries())fs.length>0?(ls.push(fs),ps({}),definition:()=>({setValue:{overrideChildHide:!0}})},rs.nComponents={public:!0,shadowingInstructions:{createComponentOfType:"number"},additionalStateVariablesDefined:["childIndexByArrayKey"],returnDependencies(){return{componentSizeListChildren:{dependencyType:"child",childGroups:["componentSizeLists"],variableNames:["nComponents"]},componentSizeAndComponentSizeListChildren:{dependencyType:"child",childGroups:["componentSizes","componentSizeLists"],skipComponentNames:!0}}},definition:function({dependencyValues:ns,componentInfoObjects:ss}){let os=0,ls=[],us=0;for(let[cs,ds]of ns.componentSizeAndComponentSizeListChildren.entries())if(ss.isInheritedComponentType({inheritedComponentType:ds.componentType,baseComponentType:"_componentSizeList"})){let ps=ns.componentSizeListChildren[us];us++;for(let fs=0;fs({nComponents:{dependencyType:"stateVariable",variableName:"nComponents"}}),returnArraySize({dependencyValues:ns}){return[ns.nComponents]},returnArrayDependenciesByKey({arrayKeys:ns,stateValues:ss}){let os={},ls={childIndexByArrayKey:{dependencyType:"stateVariable",variableName:"childIndexByArrayKey"}};for(let us of ns){let cs=[],ds="1";ss.childIndexByArrayKey[us]&&(cs=[ss.childIndexByArrayKey[us][0]],ds=ss.childIndexByArrayKey[us][1]+1),os[us]={componentSizeAndComponentSizeListChildren:{dependencyType:"child",childGroups:["componentSizes","componentSizeLists"],variableNames:["componentSize","componentSize"+ds],variablesOptional:!0,childIndices:cs}}}return{globalDependencies:ls,dependenciesByKey:os}},arrayDefinitionByKey({globalDependencyValues:ns,dependencyValuesByKey:ss,arrayKeys:os,componentInfoObjects:ls}){let us={};for(let cs of os){let ds=ss[cs].componentSizeAndComponentSizeListChildren[0];if(ds)if(ls.isInheritedComponentType({inheritedComponentType:ds.componentType,baseComponentType:"_componentSizeList"})){let ps=ns.childIndexByArrayKey[cs][1]+1;us[cs]=ds.stateValues["componentSize"+ps]}else us[cs]=ds.stateValues.componentSize}return{setValue:{componentSizes:us}}},inverseArrayDefinitionByKey({desiredStateVariableValues:ns,globalDependencyValues:ss,dependencyValuesByKey:os,dependencyNamesByKey:ls,arraySize:us,componentInfoObjects:cs}){let ds=[];for(let ps in ns.componentSizes){if(!os[ps])continue;let fs=os[ps].componentSizeAndComponentSizeListChildren[0];fs&&(cs.isInheritedComponentType({inheritedComponentType:fs.componentType,baseComponentType:"_componentSizeList"})?ds.push({setDependency:ls[ps].componentSizeAndComponentSizeListChildren,desiredValue:ns.componentSizes[ps],childIndex:0,variableIndex:1}):ds.push({setDependency:ls[ps].componentSizeAndComponentSizeListChildren,desiredValue:ns.componentSizes[ps],childIndex:0,variableIndex:0}))}return{success:!0,instructions:ds}}},rs.nValues={isAlias:!0,targetVariableName:"nComponents"},rs.values={isAlias:!0,targetVariableName:"componentSizes"},rs}}zs(ComponentSizeList,"componentType","_componentSizeList"),zs(ComponentSizeList,"rendererType","asList"),zs(ComponentSizeList,"renderChildren",!0),zs(ComponentSizeList,"stateVariableForAttributeValue","componentSizes");const ComponentSize$1=Object.freeze(Object.defineProperty({__proto__:null,ComponentSize,ComponentSizeList},Symbol.toStringTag,{value:"Module"})),componentTypeArray=[...Object.values(Aliases),...Object.values(MMeMen),...Object.values(MdMdnMrow),...Object.values(BooleanOperators),...Object.values(BooleanOperatorsOfMath),...Object.values(MathOperators),...Object.values(FunctionOperators),...Object.values(TextOperatorsOfMath),...Object.values(Extrema$1),...Object.values(ParagraphMarkup),...Object.values(SingleCharacterComponents),...Object.values(Sectioning),...Object.values(Lists),...Object.values(DynamicalSystems),...Object.values(Chemistry),...Object.values(FeedbackDefinitions$1),...Object.values(StyleDefinitions$1),...Object.values(SideBySide$2),...Object.values(ComponentWithSelectableType$1),...Object.values(Indexing),...Object.values(Divisions),...Object.values(Verbatim),...Object.values(Paginator$1),...Object.values(MatrixInput$1),Document,Text,TextList$1,TextList,P$2,BooleanComponent,BooleanList,MathComponent,MathList,TupleList,NumberList,NumberListFromString,Copy,Extract,Collect,Ref,Point,Coords,Line,LineSegment,Ray,Polyline,Polygon,Triangle,Rectangle,RegularPolygon,Circle,Parabola,Curve,BezierControls,ControlVectors,Vector,Angle,Answer,Award,When,MathInput,Textinput,BooleanInput,Choiceinput,Choice,NumberComponent,Integer,Graph$1,Variables,Variable,Function$1,PiecewiseFunction,Interval,Template,Option$1,Sequence,Slider,Spreadsheet,DiscreteSimulationResultList,DiscreteSimulationResultPolyline,Cell,Row,Column,CellBlock,Tabular,Table$1,Figure,Markers,Panel,Map$1,Sources,Pegboard,Constraints,ConstrainToGrid,ConstrainToGraph,AttractToGrid,ConstrainTo,AttractTo,ConstraintUnion,AttractToConstraint,Intersection,ConstrainToAngles,AttractToAngles,ConditionalContent,AsList,VariantControl,TextListFromString,SelectFromSequence,Select,Group,AnimateFromSequence,Evaluate,SelectRandomNumbers,SampleRandomNumbers,Substitute,PeriodicSet,Image$1,Video,Embed,Hint,Solution,IntComma,Pluralize,Feedback,CollaborateGroups,CollaborateGroupSetup,ConsiderAsResponses,Case,Lorem,UpdateValue,CallAction,triggerSet,FunctionIterates,Module,CustomAttribute,Setup,Footnote,Caption,Endpoint,Sort,Shuffle,SolveEquations,SolutionContainer,SubsetOfRealsInput,SubsetOfReals,Split,BestFitLine,RegionBetweenCurveXAxis,RegionHalfPlane,CodeEditor,CodeViewer,RenderDoenetML,HasSameFactoring,DataFrame,SummaryStatistics,Chart,Legend,Label$1,MatchesPattern,Matrix,EigenDecomposition,Latex,BaseComponent,InlineComponent,BlockComponent,GraphicalComponent,ConstraintComponent,Input,CompositeComponent,PointListComponent,IntervalListComponent,LineListComponent,VectorListComponent,AngleListComponent,BooleanOperator,BooleanBaseOperatorOfMath,MathOperator,MathOperatorOneInput,FunctionOperator,...Object.values(ComponentSize$1),SectioningComponent,InlineRenderInlineChildren,TextOrInline,SingleCharacter];function allComponentClasses(){const as={},rs=new Set;for(let ns of componentTypeArray){let ss=ns.componentType;if(ss===void 0)throw Error("Cannot create component as componentType is undefined for class "+ns);let os=ss.toLowerCase();if(rs.has(os))throw Error("component type "+ss+" defined in two classes");as[ss]=ns,rs.add(os)}return as}function componentTypesCreatingVariants(){const as={},rs=new Set;for(let ns of componentTypeArray)if(ns.createsVariants){let ss=ns.componentType;if(ss===void 0)throw Error("Cannot create component as componentType is undefined for class "+ns);let os=ss.toLowerCase();if(rs.has(os))throw Error("component type "+ss+" defined in two classes");as[ss]=ns,rs.add(os)}return as}/*! https://mths.be/cssesc v3.0.0 by @mathias */var object={},hasOwnProperty$1=object.hasOwnProperty,merge=function as(rs,ns){if(!rs)return ns;var ss={};for(var os in ns)ss[os]=hasOwnProperty$1.call(rs,os)?rs[os]:ns[os];return ss},regexAnySingleEscape=/[ -,\.\/:-@\[-\^`\{-~]/,regexSingleEscape=/[ -,\.\/:-@\[\]\^`\{-~]/,regexExcessiveSpaces=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,cssesc=function as(rs,ns){ns=merge(ns,as.options),ns.quotes!="single"&&ns.quotes!="double"&&(ns.quotes="single");for(var ss=ns.quotes=="double"?'"':"'",os=ns.isIdentifier,ls=rs.charAt(0),us="",cs=0,ds=rs.length;cs126){if(fs>=55296&&fs<=56319&&csasync({coreId:Ql,componentName:Kl,stateValues:Il,childrenInstructions:$l,sourceOfUpdate:Yl,baseStateVariable:Zl,actionId:eu})=>{let tu=!1,nu=Ql+Kl;if(Zl){let iu=Ll.getLoadable(rendererUpdatesToIgnore(nu)).contents;if(Object.keys(iu).length>0){let su=iu[eu],lu=Il[Zl];su===lu||Array.isArray(su)&&Array.isArray(lu)&&su.length==lu.length&&su.every((fu,ou)=>lu[ou]===fu)?(tu=!0,Hl(rendererUpdatesToIgnore(nu),fu=>{let ou={...fu};return delete ou[eu],ou})):Hl(rendererUpdatesToIgnore(nu),{})}}let ru={stateValues:Il,childrenInstructions:$l,sourceOfUpdate:Yl,ignoreUpdate:tu,prefixForIds:js};if($l===void 0){let iu=Ll.getLoadable(rendererState(nu)).contents;ru.childrenInstructions=iu.childrenInstructions}Hl(rendererState(nu),ru)}),ss=Recoil_index_31(({snapshot:Ll,set:Hl})=>async({coreId:Ql,componentName:Kl,baseVariableValue:Il,actionId:$l})=>{let Yl=Ql+Kl;Hl(rendererUpdatesToIgnore(Yl),Zl=>{let eu={...Zl};return eu[$l]=Il,eu})}),[os,ls]=reactExports.useState(null),[us,cs]=reactExports.useState(null),[ds,ps]=reactExports.useState(null),[fs,hs]=reactExports.useState(null),[gs,ys]=reactExports.useState(null),[bs,vs]=reactExports.useState(null),[xs,Cs]=reactExports.useState(null),[Ts,Ss]=reactExports.useState(null),[Ns,As]=reactExports.useState("initial"),[ws,Es]=reactExports.useState(!1),[_s,$s]=reactExports.useState(null),Rs=reactExports.useRef({}),Ds=reactExports.useRef({}),Os=reactExports.useRef(null),Is=reactExports.useRef(!1),Vs=reactExports.useRef(null),ks=reactExports.useRef(null),Ps=reactExports.useRef([]),Bs=reactExports.useRef(null),Ms=reactExports.useRef(!1),Ws=reactExports.useRef({}),Us=reactExports.useRef({}),js=as.prefixForIds||"",Ls=reactExports.useRef([]),Gs=Recoil_index_20(darkModeAtom),Hs=Recoil_index_20(pageToolViewAtom),Ys=Recoil_index_20(itemByDoenetId(as.doenetId));Recoil_index_20(scrollableContainerAtom);let Zs=useNavigate(),Nl=useLocation(),yl=Nl.hash;reactExports.useEffect(()=>{Bs.current&&(Bs.current.onmessage=function(Ll){var Hl,Ql,Kl;Ll.data.messageType==="updateRenderers"?Ll.data.init&&Os.current||qs(Ll.data.args):Ll.data.messageType==="requestAnimationFrame"?Al(Ll.data.args):Ll.data.messageType==="cancelAnimationFrame"?Vl(Ll.data.args):Ll.data.messageType==="coreCreated"?(Is.current=!0,Ms.current=!1,As("coreCreated"),(Hl=as.coreCreatedCallback)==null||Hl.call(as,Bs.current)):Ll.data.messageType==="initializeRenderers"?Os.current&&JSON.stringify(Os.current)===JSON.stringify(Ll.data.args.coreInfo)||Ks(Ll.data.args):Ll.data.messageType==="updateCreditAchieved"?(Ql=as.updateCreditAchievedCallback)==null||Ql.call(as,Ll.data.args):Ll.data.messageType==="savedState"?(Kl=as.saveStateCallback)==null||Kl.call(as):Ll.data.messageType==="sendToast"?(console.log(`Sending toast message: ${Ll.data.args.message}`),rs(Ll.data.args.message,Ll.data.args.toastType)):Ll.data.messageType==="resolveAction"?Qs(Ll.data.args):Ll.data.messageType==="returnAllStateVariables"?(console.log(Ll.data.args),ks.current(Ll.data.args)):Ll.data.messageType==="componentRangePieces"?window["componentRangePieces"+bs]=Ll.data.args.componentRangePieces:Ll.data.messageType==="inErrorState"?(as.setIsInErrorState&&as.setIsInErrorState(!0),ls(Ll.data.args.errMsg)):Ll.data.messageType==="resetPage"?Js(Ll.data.args):Ll.data.messageType==="copyToClipboard"?Fs(Ll.data.args):Ll.data.messageType==="navigateToTarget"?Cl(Ll.data.args):Ll.data.messageType==="terminated"&&Dl()})},[Bs.current]),reactExports.useEffect(()=>()=>{Bs.current&&Bs.current.postMessage({messageType:"terminate"})},[]),reactExports.useEffect(()=>{bs!==null&&(window["returnAllStateVariables"+bs]=function(){return Bs.current.postMessage({messageType:"returnAllStateVariables"}),new Promise((Ll,Hl)=>{ks.current=Ll})},window["callAction"+bs]=async function({actionName:Ll,componentName:Hl,args:Ql}){await Rl({action:{actionName:Ll,componentName:Hl},args:Ql})})},[bs]),reactExports.useEffect(()=>()=>{Ms.current=!0;for(let Ll in Ws.current)Vl(Ll);Ws.current={}},[]),reactExports.useEffect(()=>{document.addEventListener("visibilitychange",()=>{Bs.current&&Bs.current.postMessage({messageType:"visibilityChange",args:{visible:document.visibilityState==="visible"}})})},[]),reactExports.useEffect(()=>{if(yl&&Is.current&&Bs.current){let Ll=yl.slice(1);Ll.substring(0,js.length)===js&&Bs.current.postMessage({messageType:"navigatingToComponent",args:{componentName:Ll.substring(js.length)}})}},[Nl,yl,Is.current,Bs.current]),reactExports.useEffect(()=>{var Ll;if(yl&&_s&&as.pageIsActive){let Hl=yl.slice(1);(!Ls.current.includes(Nl.key)||Nl.key==="default")&&Hl.length>js.length&&Hl.substring(0,js.length)===js&&((Ll=document.getElementById(cssesc_1(Hl)))==null||Ll.scrollIntoView()),Ls.current.push(Nl.key)}},[Nl,yl,_s,as.pageIsActive]),reactExports.useEffect(()=>{Rl({action:{actionName:"setTheme"},args:{theme:Gs}})},[Gs]);function Dl(){Ms.current=!0,Bs.current.terminate(),Bs.current=null;for(let Ll in Ws.current)Vl(Ll);Ws.current={}}async function Rl({action:Ll,args:Hl,baseVariableValue:Ql,componentName:Kl,rendererType:Il}){var $l,Yl;if(Is.current||!(($l=Ds.current[Il])!=null&&$l.ignoreActionsWithoutCore)){let Zl=nanoid();Hl={...Hl},Hl.actionId=Zl,Ql!==void 0&&Kl&&ss({coreId:Vs.current,componentName:Kl,baseVariableValue:Ql,actionId:Zl});let eu={actionName:Ll.actionName,componentName:Ll.componentName,args:Hl};return(Yl=Bs.current)==null||Yl.postMessage({messageType:"requestAction",args:eu}),Is.current||Ps.current.push(eu),new Promise((tu,nu)=>{Us.current[Zl]=tu})}}function Ml({rendererState:Ll,forceDisable:Hl,forceShowCorrectness:Ql,forceShowSolution:Kl,forceUnsuppressCheckwork:Il}){var $l;for(let Yl in Ll){let Zl=Ll[Yl].stateValues;if(Hl&&Zl.disabled===!1&&(Zl.disabled=!0),Ql&&Zl.showCorrectness===!1&&(Zl.showCorrectness=!0),Il&&Zl.suppressCheckwork===!0&&(Zl.suppressCheckwork=!1),Kl&&(($l=Ll[Yl].childrenInstructions)==null?void 0:$l.length)>0){for(let eu of Ll[Yl].childrenInstructions)if(eu.componentType==="solution"){let tu=eu.componentName;Ll[tu].stateValues.hidden&&(Ll[tu].stateValues.hidden=!1)}}}}function Ks(Ll){if(Ll.rendererState){delete Ll.rendererState.__componentNeedingUpdateValue,(as.forceDisable||as.forceShowCorrectness||as.forceShowSolution||as.forceUnsuppressCheckwork)&&Ml({rendererState:Ll.rendererState,...as});for(let Il in Ll.rendererState)ns({coreId:Vs.current,componentName:Il,stateValues:Ll.rendererState[Il].stateValues,childrenInstructions:Ll.rendererState[Il].childrenInstructions})}Os.current=Ll.coreInfo,as.generatedVariantCallback&&as.generatedVariantCallback(JSON.parse(Os.current.generatedVariantString,serializedComponentsReviver),Os.current.allPossibleVariants);let Hl=[],Ql=[];for(let Il of Os.current.rendererTypesInDocument)Ql.push(Il),Hl.push(__variableDynamicImportRuntimeHelper(Object.assign({"./renderers/alert.jsx":()=>__vitePreload(()=>import("./alert-7670faad.js"),[]),"./renderers/angle.jsx":()=>__vitePreload(()=>import("./angle-a79a8ada.js"),["assets/angle-a79a8ada.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/answer.jsx":()=>__vitePreload(()=>import("./answer-ec00b2c9.js"),[]),"./renderers/asList.jsx":()=>__vitePreload(()=>import("./asList-3a660e37.js"),[]),"./renderers/boolean.jsx":()=>__vitePreload(()=>import("./boolean-75566a42.js"),[]),"./renderers/booleanInput.jsx":()=>__vitePreload(()=>import("./booleanInput-b5eb97fc.js"),["assets/booleanInput-b5eb97fc.js","assets/ToggleButton-faf565eb.js","assets/booleanInput-01650bf1.css"]),"./renderers/c.jsx":()=>__vitePreload(()=>import("./c-c3cef1f1.js"),[]),"./renderers/callAction.jsx":()=>__vitePreload(()=>import("./callAction-0d868376.js"),[]),"./renderers/cell.jsx":()=>__vitePreload(()=>import("./cell-0157179d.js"),[]),"./renderers/chart.jsx":()=>__vitePreload(()=>import("./chart-815ca470.js"),["assets/chart-815ca470.js","assets/visibility-sensor-7d414852.js"]),"./renderers/choiceInput.jsx":()=>__vitePreload(()=>import("./choiceInput-5177cadb.js"),["assets/choiceInput-5177cadb.js","assets/choiceInput-92287600.css"]),"./renderers/circle.jsx":()=>__vitePreload(()=>import("./circle-83bf1e74.js"),["assets/circle-83bf1e74.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/cobwebPolyline.jsx":()=>__vitePreload(()=>import("./cobwebPolyline-32ff0a06.js"),["assets/cobwebPolyline-32ff0a06.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/codeEditor.jsx":()=>__vitePreload(()=>import("./codeEditor-3b7bb2dd.js"),["assets/codeEditor-3b7bb2dd.js","assets/css-14ccef8c.js","assets/CodeMirror-87ecbb8f.js","assets/visibility-sensor-7d414852.js"]),"./renderers/codeViewer.jsx":()=>__vitePreload(()=>import("./codeViewer-74dc4db9.js"),["assets/codeViewer-74dc4db9.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/containerBlock.jsx":()=>__vitePreload(()=>import("./containerBlock-cf29dd99.js"),["assets/containerBlock-cf29dd99.js","assets/visibility-sensor-7d414852.js"]),"./renderers/containerInline.jsx":()=>__vitePreload(()=>import("./containerInline-df5cd01f.js"),[]),"./renderers/curve.jsx":()=>__vitePreload(()=>import("./curve-a288db30.js"),["assets/curve-a288db30.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/ellipsis.jsx":()=>__vitePreload(()=>import("./ellipsis-23f4589c.js"),[]),"./renderers/em.jsx":()=>__vitePreload(()=>import("./em-c600ba78.js"),[]),"./renderers/embed.jsx":()=>__vitePreload(()=>import("./embed-e7f1d893.js"),["assets/embed-e7f1d893.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/feedback.jsx":()=>__vitePreload(()=>import("./feedback-2ba4856e.js"),["assets/feedback-2ba4856e.js","assets/index-47ca4f11.js","assets/visibility-sensor-7d414852.js"]),"./renderers/figure.jsx":()=>__vitePreload(()=>import("./figure-c70e4517.js"),["assets/figure-c70e4517.js","assets/visibility-sensor-7d414852.js","assets/index.esm-5b62de19.js","assets/setPrototypeOf-51e8cf87.js"]),"./renderers/footnote.jsx":()=>__vitePreload(()=>import("./footnote-31adff59.js"),[]),"./renderers/graph.jsx":()=>__vitePreload(()=>import("./graph-71cec529.js"),["assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/hint.jsx":()=>__vitePreload(()=>import("./hint-06657f21.js"),["assets/hint-06657f21.js","assets/index-47ca4f11.js","assets/visibility-sensor-7d414852.js"]),"./renderers/image.jsx":()=>__vitePreload(()=>import("./image-c0f70d24.js"),["assets/image-c0f70d24.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/label.jsx":()=>__vitePreload(()=>import("./label-95b19c73.js"),["assets/label-95b19c73.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/legend.jsx":()=>__vitePreload(()=>import("./legend-4044edd9.js"),["assets/legend-4044edd9.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/line.jsx":()=>__vitePreload(()=>import("./line-c1a7164a.js"),["assets/line-c1a7164a.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/lineSegment.jsx":()=>__vitePreload(()=>import("./lineSegment-3e0035f9.js"),["assets/lineSegment-3e0035f9.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/list.jsx":()=>__vitePreload(()=>import("./list-6bbf4bcf.js"),["assets/list-6bbf4bcf.js","assets/visibility-sensor-7d414852.js"]),"./renderers/math.jsx":()=>__vitePreload(()=>import("./math-52fe5cc4.js"),["assets/math-52fe5cc4.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/mathInput.jsx":()=>__vitePreload(()=>import("./mathInput-4f892c75.js"),["assets/mathInput-4f892c75.js","assets/MathInputSelector-50cc4d06.js","assets/mathInput-cbd86307.css"]),"./renderers/mathList.jsx":()=>__vitePreload(()=>import("./mathList-e4fc0d9b.js"),[]),"./renderers/matrixInput.jsx":()=>__vitePreload(()=>import("./matrixInput-900c080a.js"),["assets/matrixInput-900c080a.js","assets/ActionButton-e5ea2a2f.js","assets/ActionButtonGroup-f4ce05e4.js","assets/mathInput-cbd86307.css"]),"./renderers/mdash.jsx":()=>__vitePreload(()=>import("./mdash-33408b70.js"),[]),"./renderers/nbsp.jsx":()=>__vitePreload(()=>import("./nbsp-f0190b99.js"),[]),"./renderers/ndash.jsx":()=>__vitePreload(()=>import("./ndash-5b905601.js"),[]),"./renderers/number.jsx":()=>__vitePreload(()=>import("./number-56f4821a.js"),[]),"./renderers/numberList.jsx":()=>__vitePreload(()=>import("./numberList-7136c931.js"),[]),"./renderers/orbitalDiagram.jsx":()=>__vitePreload(()=>import("./orbitalDiagram-01886706.js"),["assets/orbitalDiagram-01886706.js","assets/visibility-sensor-7d414852.js"]),"./renderers/orbitalDiagramInput.jsx":()=>__vitePreload(()=>import("./orbitalDiagramInput-3cb02455.js"),["assets/orbitalDiagramInput-3cb02455.js","assets/visibility-sensor-7d414852.js"]),"./renderers/p.jsx":()=>__vitePreload(()=>import("./p-b709c326.js"),["assets/p-b709c326.js","assets/visibility-sensor-7d414852.js"]),"./renderers/paginatorControls.jsx":()=>__vitePreload(()=>import("./paginatorControls-9cf5c4a4.js"),[]),"./renderers/pegboard.jsx":()=>__vitePreload(()=>import("./pegboard-30708879.js"),["assets/pegboard-30708879.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/point.jsx":()=>__vitePreload(()=>import("./point-922dded5.js"),["assets/point-922dded5.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/polygon.jsx":()=>__vitePreload(()=>import("./polygon-8f87d0c3.js"),["assets/polygon-8f87d0c3.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/polyline.jsx":()=>__vitePreload(()=>import("./polyline-bd178059.js"),["assets/polyline-bd178059.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/pre.jsx":()=>__vitePreload(()=>import("./pre-f575ed61.js"),["assets/pre-f575ed61.js","assets/visibility-sensor-7d414852.js"]),"./renderers/q.jsx":()=>__vitePreload(()=>import("./q-2ee17014.js"),[]),"./renderers/ray.jsx":()=>__vitePreload(()=>import("./ray-8d758dd7.js"),["assets/ray-8d758dd7.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/ref.jsx":()=>__vitePreload(()=>import("./ref-9e5f0fce.js"),[]),"./renderers/regionBetweenCurveXAxis.jsx":()=>__vitePreload(()=>import("./regionBetweenCurveXAxis-eaed737c.js"),["assets/regionBetweenCurveXAxis-eaed737c.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/row.jsx":()=>__vitePreload(()=>import("./row-83da3eab.js"),[]),"./renderers/section.jsx":()=>__vitePreload(()=>import("./section-ed8954fc.js"),["assets/section-ed8954fc.js","assets/visibility-sensor-7d414852.js"]),"./renderers/sideBySide.jsx":()=>__vitePreload(()=>import("./sideBySide-29763439.js"),["assets/sideBySide-29763439.js","assets/visibility-sensor-7d414852.js"]),"./renderers/slider.jsx":()=>__vitePreload(()=>import("./slider-3c30e9ab.js"),["assets/slider-3c30e9ab.js","assets/ActionButton-e5ea2a2f.js","assets/ActionButtonGroup-f4ce05e4.js"]),"./renderers/solution.jsx":()=>__vitePreload(()=>import("./solution-1f60217a.js"),["assets/solution-1f60217a.js","assets/visibility-sensor-7d414852.js"]),"./renderers/spreadsheet.jsx":()=>__vitePreload(()=>import("./spreadsheet-2720b9d5.js"),["assets/spreadsheet-2720b9d5.js","assets/moment-3cda1086.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js","assets/spreadsheet-f0a2a11b.css"]),"./renderers/sq.jsx":()=>__vitePreload(()=>import("./sq-02280959.js"),[]),"./renderers/subsetOfRealsInput.jsx":()=>__vitePreload(()=>import("./subsetOfRealsInput-5a92c517.js"),["assets/subsetOfRealsInput-5a92c517.js","assets/ActionButton-e5ea2a2f.js","assets/ActionButtonGroup-f4ce05e4.js","assets/ToggleButton-faf565eb.js","assets/ToggleButtonGroup-6decfcc6.js","assets/visibility-sensor-7d414852.js"]),"./renderers/summaryStatistics.jsx":()=>__vitePreload(()=>import("./summaryStatistics-0ee64249.js"),["assets/summaryStatistics-0ee64249.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/table.jsx":()=>__vitePreload(()=>import("./table-64ddd443.js"),["assets/table-64ddd443.js","assets/visibility-sensor-7d414852.js"]),"./renderers/tabular.jsx":()=>__vitePreload(()=>import("./tabular-c18e7770.js"),["assets/tabular-c18e7770.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/tag.jsx":()=>__vitePreload(()=>import("./tag-36b858d8.js"),[]),"./renderers/text.jsx":()=>__vitePreload(()=>import("./text-a4ea3b78.js"),["assets/text-a4ea3b78.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/textInput.jsx":()=>__vitePreload(()=>import("./textInput-ac28802f.js"),["assets/textInput-ac28802f.js","assets/css-14ccef8c.js"]),"./renderers/textList.jsx":()=>__vitePreload(()=>import("./textList-6cb5330d.js"),[]),"./renderers/triggerSet.jsx":()=>__vitePreload(()=>import("./triggerSet-ef3bd2fe.js"),[]),"./renderers/updateValue.jsx":()=>__vitePreload(()=>import("./updateValue-83b7ae1f.js"),[]),"./renderers/vector.jsx":()=>__vitePreload(()=>import("./vector-52de4831.js"),["assets/vector-52de4831.js","assets/graph-71cec529.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"]),"./renderers/video.jsx":()=>__vitePreload(()=>import("./video-964a54d0.js"),["assets/video-964a54d0.js","assets/css-14ccef8c.js","assets/visibility-sensor-7d414852.js"])}),`./renderers/${Il}.jsx`));let Kl=Os.current.documentToRender;renderersloadComponent(Hl,Ql).then(Il=>{var Yl;Ds.current=Il;let $l=Il[Kl.rendererType];$s(React.createElement($l,{key:Vs.current+Kl.componentName,componentInstructions:Kl,rendererClasses:Il,flags:as.flags,coreId:Vs.current,callAction:Rl})),(Yl=as.renderersInitializedCallback)==null||Yl.call(as)})}function qs({updateInstructions:Ll,actionId:Hl}){var Ql;for(let Kl of Ll)if(Kl.instructionType==="updateRendererStates")for(let{componentName:Il,stateValues:$l,rendererType:Yl,childrenInstructions:Zl}of Kl.rendererStatesToUpdate)ns({coreId:Vs.current,componentName:Il,stateValues:$l,childrenInstructions:Zl,sourceOfUpdate:Kl.sourceOfUpdate,baseStateVariable:(Ql=Ds.current[Yl])==null?void 0:Ql.baseStateVariable,actionId:Hl});Qs({actionId:Hl})}function Qs({actionId:Ll}){var Hl,Ql;Ll&&((Ql=(Hl=Us.current)[Ll])==null||Ql.call(Hl),delete Us.current[Ll])}function Js({changedOnDevice:Ll,newCid:Hl,newAttemptNumber:Ql}){Ql!==xs?(rs("Reverted activity as attempt number changed on other device",toastType.ERROR),as.updateAttemptNumber?as.updateAttemptNumber(Ql):(as.setIsInErrorState&&as.setIsInErrorState(!0),ls("how to reset attempt number when not given updateAttemptNumber function?"))):(rs(`Reverted page to state saved on device ${Ll}`,toastType.ERROR),Vs.current=nanoid(),Es(!0))}function El(){const Ll=Vs.current;ds!==void 0?us?cidFromText(ds).then(Hl=>{Ll===Vs.current&&(Hl===us?(ys(ds),hs(us),As("continue")):(as.setIsInErrorState&&as.setIsInErrorState(!0),ls(`doenetML did not match specified cid: ${us}`)))}):cidFromText(ds).then(Hl=>{Ll===Vs.current&&(ys(ds),hs(Hl),As("continue"))}):retrieveTextFileForCid(us,"doenet").then(Hl=>{Ll===Vs.current&&(ys(Hl),hs(us),As("continue"))}).catch(Hl=>{Ll===Vs.current&&(as.setIsInErrorState&&as.setIsInErrorState(!0),ls(`doenetML not found for cid: ${us}`))})}async function _l(){const Ll=Vs.current;let Hl=!1;if(as.flags.allowLocalState){let Ql;try{Ql=await get$3(`${as.doenetId}|${bs}|${xs}|${fs}`)}catch{}if(Ql){if(as.flags.allowSaveState){let Kl=await Xs(Ql);if(Kl.changedOnDevice){if(Number(Kl.newAttemptNumber)!==xs){Js({changedOnDevice:Kl.changedOnDevice,newCid:Kl.newCid,newAttemptNumber:Number(Kl.newAttemptNumber)});return}else Kl.newCid!==fs&&(as.setIsInErrorState&&as.setIsInErrorState(!0),ls("content changed unexpectedly!"));Ql=Kl.newLocalInfo,console.log(`sending toast: Reverted page to state saved on device ${Kl.changedOnDevice}`),rs(`Reverted page to state saved on device ${Kl.changedOnDevice}`,toastType.ERROR)}}Ql.rendererState.__componentNeedingUpdateValue&&Rl({action:{actionName:"updateValue",componentName:Ql.rendererState.__componentNeedingUpdateValue}}),Ks({rendererState:Ql.rendererState,coreInfo:Ql.coreInfo}),Rs.current={coreState:Ql.coreState,serverSaveId:Ql.saveId,requestedVariant:JSON.parse(Ql.coreInfo.generatedVariantString,serializedComponentsReviver)},Hl=!0}}if(!Hl){const Ql={params:{cid:fs,pageNumber:bs,attemptNumber:xs,doenetId:as.doenetId,userId:as.userId,requestedVariantIndex:Ts,allowLoadState:as.flags.allowLoadState,showCorrectness:as.flags.showCorrectness,solutionDisplayMode:as.flags.solutionDisplayMode,showFeedback:as.flags.showFeedback,showHints:as.flags.showHints,autoSubmit:as.flags.autoSubmit}};try{let Kl=await axios.get("/api/loadPageState.php",Ql);if(!Kl.data.success&&as.flags.allowLoadState){as.setIsInErrorState&&as.setIsInErrorState(!0),ls(`Error loading page state: ${Kl.data.message}`);return}if(Kl.data.loadedState){let Il=JSON.parse(Kl.data.coreInfo,serializedComponentsReviver),$l=JSON.parse(Kl.data.rendererState,serializedComponentsReviver);$l.__componentNeedingUpdateValue&&Rl({action:{actionName:"updateValue",componentName:$l.__componentNeedingUpdateValue}}),Ks({rendererState:$l,coreInfo:Il}),Rs.current={coreState:JSON.parse(Kl.data.coreState,serializedComponentsReviver),serverSaveId:Kl.data.saveId,requestedVariant:JSON.parse(Il.generatedVariantString,serializedComponentsReviver)}}}catch(Kl){if(as.flags.allowLoadState){as.setIsInErrorState&&as.setIsInErrorState(!0),ls(`Error loading page state: ${Kl.message}`);return}}}Ll===Vs.current&&(as.pageIsActive?xl():As("readyToCreateCore"))}async function Xs(Ll){let Hl=await get$3(`${as.doenetId}|${bs}|${xs}|${fs}|ServerSaveId`),Ql={cid:fs,coreInfo:JSON.stringify(Ll.coreInfo,serializedComponentsReplacer),coreState:JSON.stringify(Ll.coreState,serializedComponentsReplacer),rendererState:JSON.stringify(Ll.rendererState,serializedComponentsReplacer),pageNumber:bs,attemptNumber:xs,doenetId:as.doenetId,saveId:Ll.saveId,serverSaveId:Hl,updateDataOnContentChange:as.updateDataOnContentChange},Kl;try{Kl=await axios.post("/api/savePageState.php",Ql)}catch{return{localInfo:Ll,cid:fs,attemptNumber:xs}}let Il=Kl.data;if(!Il.success)return{localInfo:Ll,cid:fs,attemptNumber:xs};if(await set(`${as.doenetId}|${bs}|${xs}|${fs}|ServerSaveId`,Il.saveId),Il.stateOverwritten){let $l={coreState:JSON.parse(Il.coreState,serializedComponentsReviver),rendererState:JSON.parse(Il.rendererState,serializedComponentsReviver),coreInfo:JSON.parse(Il.coreInfo,serializedComponentsReviver),saveId:Il.saveId};return await set(`${as.doenetId}|${bs}|${Il.attemptNumber}|${Il.cid}`,$l),{changedOnDevice:Il.device,newLocalInfo:$l,newCid:Il.cid,newAttemptNumber:Il.attemptNumber}}return{localInfo:Ll,cid:fs,attemptNumber:xs}}function xl(){var Ll;Bs.current&&Dl(),Bs.current=new Worker(new URL("/assets/CoreWorker-94b9bfba.js",self.location),{type:"module"}),Bs.current.postMessage({messageType:"createCore",args:{coreId:Vs.current,userId:as.userId,doenetML:gs,doenetId:as.doenetId,previousComponentTypeCounts:as.previousComponentTypeCounts,activityCid:as.activityCid,flags:as.flags,theme:Gs,requestedVariantIndex:Ts,pageNumber:bs,attemptNumber:xs,itemNumber:as.itemNumber,updateDataOnContentChange:as.updateDataOnContentChange,serverSaveId:Rs.current.serverSaveId,activityVariantIndex:as.activityVariantIndex,requestedVariant:Rs.current.requestedVariant,stateVariableChanges:Rs.current.coreState?Rs.current.coreState:void 0}}),As("waitingOnCore");for(let Hl of Ps.current)(Ll=Bs.current)==null||Ll.postMessage({messageType:"requestAction",args:Hl})}function Al({action:Ll,actionArgs:Hl,delay:Ql,animationId:Kl}){if(!Ms.current)if(Ql){let Il=window.setTimeout(()=>Sl({action:Ll,actionArgs:Hl,animationId:Kl}),Ql);Ws.current[Kl]={timeoutId:Il}}else Ws.current[Kl]={},Sl({action:Ll,actionArgs:Hl,animationId:Kl})}function Sl({action:Ll,actionArgs:Hl,animationId:Ql}){let Kl=window.requestAnimationFrame(()=>Rl({action:Ll,args:Hl})),Il=Ws.current[Ql];delete Il.timeoutId,Il.animationFrameID=Kl}async function Vl(Ll){let Hl=Ws.current[Ll],Ql=Hl==null?void 0:Hl.timeoutId;Ql!==void 0&&window.clearTimeout(Ql);let Kl=Hl==null?void 0:Hl.animationFrameID;Kl!==void 0&&window.cancelAnimationFrame(Kl),delete Ws.current[Ll]}async function Fs({text:Ll,actionId:Hl}){await navigator.clipboard.writeText(Ll),Qs({actionId:Hl})}async function Cl({cid:Ll,doenetId:Hl,variantIndex:Ql,edit:Kl,hash:Il,page:$l,uri:Yl,targetName:Zl,actionId:eu,componentName:tu,effectiveName:nu}){let ru=js+nu,{targetForATag:iu,url:su,haveValidTarget:lu,externalUri:fu}=getURLFromRef({cid:Ll,doenetId:Hl,variantIndex:Ql,edit:Kl,hash:Il,page:$l,givenUri:Yl,targetName:Zl,pageToolView:Hs,inCourse:Object.keys(Ys).length>0,search:Nl.search,id:ru});lu&&(iu==="_blank"?window.open(su,iu):Zs(su)),Qs({actionId:eu})}if(os!==null)return jsxs("div",{style:{fontSize:"1.3em",marginLeft:"20px",marginTop:"20px"},children:[jsx$1("span",{style:{fontSize:"1em",color:"#C1292E"},children:jsx$1(FontAwesomeIcon,{icon:faExclamationCircle})})," ",os]});let Tl=!1;ds!==as.doenetML&&(ps(as.doenetML),Tl=!0),us!==as.cid&&(cs(as.cid),Tl=!0);let zl=as.pageNumber;zl===void 0&&(zl="1"),zl!==bs&&(vs(zl),Tl=!0);let Xl=as.attemptNumber;Xl===void 0&&(Xl=1),Xl!==xs&&(Cs(Xl),Tl=!0);let Pl=as.requestedVariantIndex;if(Pl===void 0&&(Pl=Xl),Ts!==Pl&&(Ss(Pl),Tl=!0),Tl)return Bs.current&&Dl(),As("recalcParams"),Vs.current=nanoid(),Rs.current={},Es(!0),null;if(Ns==="wait")return null;if(Ns=="recalcParams")return As("wait"),El(),null;if(ws)return Es(!1),Os.current=null,$s(null),Is.current=!1,As("wait"),_l(),null;if(Ns==="readyToCreateCore"&&as.pageIsActive?xl():Ns==="waitingOnCore"&&!as.pageIsActive&&(Dl(),As("readyToCreateCore")),as.hideWhenNotCurrent&&!as.pageIsCurrent)return null;let Bl=null,Wl={maxWidth:"850px",paddingLeft:"20px",paddingRight:"20px"};return Is.current||(_s||(Bl=jsx$1("div",{style:{backgroundColor:"lightCyan",padding:"10px"},children:jsx$1("p",{children:"Initializing...."})})),Wl.backgroundColor="#F0F0F0"),jsxs(ErrorBoundary,{setIsInErrorState:as.setIsInErrorState,children:[Bl,jsx$1("div",{style:Wl,children:_s})]})}async function renderersloadComponent(as,rs){var ns={};for(let[ss,os]of as.entries())try{let ls=await os;ns[rs[ss]]=ls.default}catch(ls){throw console.log("here:",ls),Error(`loading ${rs[ss]} failed.`)}return ns}class ErrorBoundary extends React.Component{constructor(rs){super(rs),this.state={hasError:!1}}static getDerivedStateFromError(rs){return{hasError:!0}}componentDidCatch(rs,ns){var ss,os;(os=(ss=this.props).setIsInErrorState)==null||os.call(ss,!0)}render(){return this.state.hasError?jsx$1("h1",{children:"Something went wrong."}):this.props.children}}function getURLFromRef({cid:as,doenetId:rs,variantIndex:ns,edit:ss,hash:os,page:ls,givenUri:us,targetName:cs="",pageToolView:ds={},inCourse:ps=!1,search:fs="",id:hs=""}){let gs="",ys="_blank",bs=!1,vs=!1;if(as||rs){as?gs=`cid=${as}`:gs=`doenetId=${rs}`,ns&&(gs+=`&variant=${ns}`);let xs=!1;ds.page==="public"?xs=!0:ps||(xs=!0),xs?((ss===!0||ss===null&&ds.page==="public"&&ds.tool==="editor")&&(gs=`tool=editor&${gs}`),gs=`/public?${gs}`):ds.page==="placementexam"?gs=`?tool=exam&${gs}`:gs=`?tool=assignment&${gs}`,bs=!0,os?gs+=os:ls?(gs+=`#page${ls}`,cs&&(gs+=cs)):cs&&(gs+="#"+cs)}else if(us)gs=us,(gs.substring(0,8)==="https://"||gs.substring(0,7)==="http://"||gs.substring(0,7)==="mailto:")&&(bs=!0,vs=!0);else{if(gs+=fs,ls)gs+=`#page${ls}`;else{let xs=hs.indexOf("/"),Cs=hs.substring(0,xs);gs+="#"+Cs}gs+=cs,ys=null,bs=!0}return{targetForATag:ys,url:gs,haveValidTarget:bs,externalUri:vs}}const pageVariantInfoAtom=Recoil_index_8({key:"pageVariantInfoAtom",default:{index:1}}),pageVariantPanelAtom=Recoil_index_8({key:"pageVariantPanelAtom",default:{index:1,allPossibleVariants:[]}}),activityVariantPanelAtom=Recoil_index_8({key:"activityVariantPanelAtom",default:{index:1,numberOfVariants:0}});function HiOutlineMail(as){return GenIcon({tag:"svg",attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"}}]})(as)}function BsDiscord(as){return GenIcon({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M13.545 2.907a13.227 13.227 0 0 0-3.257-1.011.05.05 0 0 0-.052.025c-.141.25-.297.577-.406.833a12.19 12.19 0 0 0-3.658 0 8.258 8.258 0 0 0-.412-.833.051.051 0 0 0-.052-.025c-1.125.194-2.22.534-3.257 1.011a.041.041 0 0 0-.021.018C.356 6.024-.213 9.047.066 12.032c.001.014.01.028.021.037a13.276 13.276 0 0 0 3.995 2.02.05.05 0 0 0 .056-.019c.308-.42.582-.863.818-1.329a.05.05 0 0 0-.01-.059.051.051 0 0 0-.018-.011 8.875 8.875 0 0 1-1.248-.595.05.05 0 0 1-.02-.066.051.051 0 0 1 .015-.019c.084-.063.168-.129.248-.195a.05.05 0 0 1 .051-.007c2.619 1.196 5.454 1.196 8.041 0a.052.052 0 0 1 .053.007c.08.066.164.132.248.195a.051.051 0 0 1-.004.085 8.254 8.254 0 0 1-1.249.594.05.05 0 0 0-.03.03.052.052 0 0 0 .003.041c.24.465.515.909.817 1.329a.05.05 0 0 0 .056.019 13.235 13.235 0 0 0 4.001-2.02.049.049 0 0 0 .021-.037c.334-3.451-.559-6.449-2.366-9.106a.034.034 0 0 0-.02-.019Zm-8.198 7.307c-.789 0-1.438-.724-1.438-1.612 0-.889.637-1.613 1.438-1.613.807 0 1.45.73 1.438 1.613 0 .888-.637 1.612-1.438 1.612Zm5.316 0c-.788 0-1.438-.724-1.438-1.612 0-.889.637-1.613 1.438-1.613.807 0 1.451.73 1.438 1.613 0 .888-.631 1.612-1.438 1.612Z"}}]})(as)}function BsGithub(as){return GenIcon({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"}}]})(as)}async function loader$5(){return await(await fetch("/api/getHPCarouselData.php")).json()}const HomeIntroVideo=reactExports.lazy(()=>__vitePreload(()=>import("./HomeIntroVideo-cd1e31f9.js"),[])),CarouselSection=styled$1.div` display: flex; flex-direction: column; padding: 60px 10px 60px 10px; @@ -2913,7 +2922,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho grid-template-rows: 80px min-content auto; /* grid-template-rows: 80px min-content min-content; */ height: 100vh; -`;function Portfolio(){let as=useOutletContext(),rs=useLoaderData();const ns=Recoil_index_24(pageToolViewAtom);return as.signedIn==null?null:jsx$1(Fragment,{children:jsxs(PortfolioGrid$1,{children:[jsxs(Box,{gridRow:"1/2",backgroundColor:"#fff",color:"#000",height:"80px",position:"fixed",width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",zIndex:"1200",children:[jsx$1(Text$1,{fontSize:"24px",fontWeight:"700",children:rs.fullName}),jsx$1(Text$1,{fontSize:"16px",fontWeight:"700",children:"Portfolio"}),jsx$1("div",{style:{position:"absolute",top:"48px",right:"10px"},children:jsxs(Form,{method:"post",children:[jsx$1(Button$2,{value:"Add Activity",onClick:()=>{ns({page:"portfolioeditor",tool:"editor",view:"",params:{}})}}),jsx$1("input",{type:"hidden",name:"_action",value:"Add Activity"})]})})]}),jsxs(PublicActivitiesSection$1,{children:[jsx$1(Text$1,{fontSize:"20px",fontWeight:"700",children:"Public"}),jsx$1(CardsContainer$1,{children:rs.publicActivities.length<1?jsx$1("div",{children:"No Public Activities"}):jsx$1(Fragment,{children:rs.publicActivities.map(ss=>jsx$1(Card$1,{...ss,fullName:rs.fullName,isPublic:!0,courseId:rs.courseId},`Card${ss.doenetId}`))})})]}),jsxs(PrivateActivitiesSection,{children:[jsx$1(Text$1,{fontSize:"20px",fontWeight:"700",children:"Private"}),jsx$1(CardsContainer$1,{children:rs.privateActivities.length<1?jsx$1("div",{children:"No Private Activities"}):jsx$1(Fragment,{children:rs.privateActivities.map(ss=>jsx$1(Card$1,{...ss,fullName:rs.fullName,isPublic:!1,courseId:rs.courseId},`Card${ss.doenetId}`))})})]})]})})}async function loader$2({params:as}){const rs=as.doenetId;return(await(await fetch(`/api/getPortfolioActivityData.php?doenetId=${rs}`)).json()).activityData}function PortfilioEditorInfoCap(){let as=useLoaderData();return jsxs(Fragment,{children:[jsx$1(Box,{height:"130px",width:"100%",background:"black",overflow:"hidden",margin:"auto",children:jsx$1(Image$2,{width:"100%",height:"100%",objectFit:"contain",src:as.imagePath,alt:"Activity Image"})}),jsx$1("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:"Portfolio Activity Editor"})]})}const PortfilioEditorInfoCap$1=Object.freeze(Object.defineProperty({__proto__:null,default:PortfilioEditorInfoCap,loader:loader$2},Symbol.toStringTag,{value:"Module"}));async function loader$1({params:as}){const ns=await(await fetch(`/api/getPublicPortfolio.php?courseId=${as.courseId}`)).json();return{fullName:ns.fullName,publicActivities:ns.publicActivities}}const PublicActivitiesSection=styled$1.div` +`;function Portfolio(){let as=useOutletContext(),rs=useLoaderData();const ns=Recoil_index_24(pageToolViewAtom);return as.signedIn==null?null:jsx$1(Fragment,{children:jsxs(PortfolioGrid$1,{children:[jsxs(Box,{gridRow:"1/2",backgroundColor:"#fff",color:"#000",height:"80px",position:"fixed",width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",zIndex:"1200",children:[jsx$1(Text$1,{fontSize:"24px",fontWeight:"700",children:rs.fullName}),jsx$1(Text$1,{fontSize:"16px",fontWeight:"700",children:"Portfolio"}),jsx$1("div",{style:{position:"absolute",top:"48px",right:"10px"},children:jsxs(Form,{method:"post",children:[jsx$1(Button$2,{value:"Add Activity",onClick:()=>{ns({page:"portfolioeditor",tool:"editor",view:"",params:{}})}}),jsx$1("input",{type:"hidden",name:"_action",value:"Add Activity"})]})})]}),jsxs(PublicActivitiesSection$1,{children:[jsx$1(Text$1,{fontSize:"20px",fontWeight:"700",children:"Public"}),jsx$1(CardsContainer$1,{children:rs.publicActivities.length<1?jsxs(Flex,{flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minHeight:200,background:"doenet.canvas",padding:20,width:"100%",children:[jsx$1(Icon,{fontSize:"48pt",as:RiEmotionSadLine}),jsx$1(Text$1,{fontSize:"36pt",children:"No Public Activities"})]}):jsx$1(Fragment,{children:rs.publicActivities.map(ss=>jsx$1(Card$1,{...ss,fullName:rs.fullName,isPublic:!0,courseId:rs.courseId},`Card${ss.doenetId}`))})})]}),jsxs(PrivateActivitiesSection,{children:[jsx$1(Text$1,{fontSize:"20px",fontWeight:"700",children:"Private"}),jsx$1(CardsContainer$1,{children:rs.privateActivities.length<1?jsxs(Flex,{flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center",minHeight:200,background:"doenet.canvas",padding:20,width:"100%",children:[jsx$1(Icon,{fontSize:"48pt",as:RiEmotionSadLine}),jsx$1(Text$1,{fontSize:"36pt",children:"No Private Activities"})]}):jsx$1(Fragment,{children:rs.privateActivities.map(ss=>jsx$1(Card$1,{...ss,fullName:rs.fullName,isPublic:!1,courseId:rs.courseId},`Card${ss.doenetId}`))})})]})]})})}async function loader$2({params:as}){const rs=as.doenetId;return(await(await fetch(`/api/getPortfolioActivityData.php?doenetId=${rs}`)).json()).activityData}function PortfilioEditorInfoCap(){let as=useLoaderData();return jsxs(Fragment,{children:[jsx$1(Box,{height:"130px",width:"100%",background:"black",overflow:"hidden",margin:"auto",children:jsx$1(Image$2,{width:"100%",height:"100%",objectFit:"contain",src:as.imagePath,alt:"Activity Image"})}),jsx$1("div",{style:{marginBottom:"5px",padding:"1px 5px"},children:"Portfolio Activity Editor"})]})}const PortfilioEditorInfoCap$1=Object.freeze(Object.defineProperty({__proto__:null,default:PortfilioEditorInfoCap,loader:loader$2},Symbol.toStringTag,{value:"Module"}));async function loader$1({params:as}){const ns=await(await fetch(`/api/getPublicPortfolio.php?courseId=${as.courseId}`)).json();return{fullName:ns.fullName,publicActivities:ns.publicActivities}}const PublicActivitiesSection=styled$1.div` grid-row: 2/3; display: flex; flex-direction: column; @@ -3002,4 +3011,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho left: 36px; top: 8px; width: 400px; -`;function PortfolioActivityViewer(){const{doenetML:as,signedIn:rs,label:ns,fullName:ss,courseId:os,doenetId:ls,pageDoenetId:us}=useLoaderData(),cs=useNavigate(),ds=Recoil_index_24(pageToolViewAtom),ps=Recoil_index_24(pageVariantPanelAtom),[fs,hs]=Recoil_index_22(pageVariantInfoAtom);function gs(ys,bs){const vs=JSON.parse(JSON.stringify(ys));ps({index:vs.index,allPossibleVariants:bs}),hs({index:vs.index})}return jsx$1(Fragment,{children:jsxs(PageContainer,{children:[jsx$1(Header,{children:jsxs(HeaderContent,{children:[jsxs("div",{children:[jsx$1(HeaderSectionLeft,{children:jsx$1(Label,{children:ns})}),jsx$1(HeaderSectionLeft,{children:jsxs(AvatarLink,{to:`/publicportfolio/${os}`,children:[jsx$1(Avatar,{size:"sm",name:ss})," ",jsxs(Byline,{children:["By ",ss]})]})})]}),jsxs("div",{children:[jsx$1(HeaderSectionRight,{children:jsx$1(Button$2,{value:"See Inside",onClick:()=>{ds({page:"public",tool:"editor",view:"",params:{}}),cs(`/public?tool=editor&doenetId=${ls}&pageId=${us}`)}})}),rs?jsx$1(HeaderSectionRight,{children:jsx$1(Form,{method:"post",children:jsx$1(Button$2,{value:"Remix",onClick:()=>{}})})}):null]})]})}),jsx$1(ViewerOutsideContainer,{children:jsx$1(ViewerInsideContainer,{children:jsx$1(PageViewer,{doenetML:as,flags:{showCorrectness:!0,solutionDisplayMode:!0,showFeedback:!0,showHints:!0,autoSubmit:!1,allowLoadState:!1,allowSaveState:!1,allowLocalState:!1,allowSaveSubmissions:!1,allowSaveEvents:!1},attemptNumber:1,generatedVariantCallback:gs,requestedVariantIndex:fs.index,pageIsActive:!0},"HPpageViewer")})})]})})}const index="",theme=extendTheme({fonts:{body:"Jost"},textStyles:{primary:{fontFamily:"Jost"}},colors:{doenet:{mainBlue:"#1a5a99",lightBlue:"#b8d2ea",solidLightBlue:"#8fb8de",mainGray:"#e3e3e3",donutBody:"#eea177",donutTopping:"#6d4445",mainRed:"#c1292e",lightRed:"#eab8b8",mainGreen:"#459152",canvas:"#ffffff",canvastext:"#000000",lightGreen:"#a6f19f",lightYellow:"#f5ed85",whiteBlankLink:"#6d4445",mainYellow:"#94610a",mainPurple:"#4a03d9"}},components:{Button:{baseStyle:{fontWeight:"normal",letterSpacing:".5px",_focus:{outline:"2px solid #2D5994",outlineOffset:"2px"},_disabled:{bg:"#E2E2E2",color:"black",cursor:"none"}},variants:{solid:{bg:"doenet.mainBlue",color:"white",_hover:{bg:"doenet.solidLightBlue",color:"black"}},outline:{borderColor:"#2D5994",_hover:{bg:"solidLightBlue"}},ghost:{_hover:{bg:"solidLightBlue"}},link:{color:"solidLightBlue"}}}}}),router=createBrowserRouter([{path:"/",loader:loader$6,element:jsx$1(ChakraProvider,{theme,children:jsx$1(SiteHeader,{})}),children:[{path:"/",loader:loader$5,element:jsx$1(DarkmodeController,{children:jsx$1(betterReactMathjax.MathJaxContext,{version:2,config:mathjaxConfig,onStartup:as=>as.Hub.processSectionDelay=0,children:jsx$1(ChakraProvider,{theme,children:jsx$1(Home,{})})})})},{path:"community",loader:loader$7,element:jsx$1(ChakraProvider,{theme,children:jsx$1(Community,{})})},{path:"portfolio/:courseId",loader:loader$3,action:action$1,element:jsx$1(ChakraProvider,{theme,children:jsx$1(Portfolio,{})})},{path:"publicportfolio/:courseId",loader:loader$1,element:jsx$1(ChakraProvider,{theme,children:jsx$1(PublicPortfolio,{})})},{path:"/portfolioviewer/:doenetId",loader,action,element:jsx$1(DarkmodeController,{children:jsx$1(betterReactMathjax.MathJaxContext,{version:2,config:mathjaxConfig,onStartup:as=>as.Hub.processSectionDelay=0,children:jsx$1(ChakraProvider,{theme,children:jsx$1(PortfolioActivityViewer,{})})})})}]},{path:"/portfolio/:doenetId/settings",loader:loader$4,action:action$2,ErrorBoundary:ErrorBoundry,element:jsx$1(ChakraProvider,{theme,children:jsx$1(PortfolioActivitySettings,{})})},{path:"/portfolioeditor/:doenetId",loader:loader$2,element:jsx$1(DarkmodeController,{children:jsx$1(betterReactMathjax.MathJaxContext,{version:2,config:mathjaxConfig,onStartup:as=>as.Hub.processSectionDelay=0,children:jsx$1(ToolRoot,{})})})},{path:"/public",loader:loader$8,action:action$3,element:jsx$1(DarkmodeController,{children:jsx$1(betterReactMathjax.MathJaxContext,{version:2,config:mathjaxConfig,onStartup:as=>as.Hub.processSectionDelay=0,children:jsx$1(ToolRoot,{})})})},{path:"*",element:jsx$1(DarkmodeController,{children:jsx$1(betterReactMathjax.MathJaxContext,{version:2,config:mathjaxConfig,onStartup:as=>as.Hub.processSectionDelay=0,children:jsx$1(ToolRoot,{})})})}]),root=createRoot(document.getElementById("root"));root.render(jsx$1(Recoil_index_5,{children:jsx$1(RouterProvider,{router})}));export{faLink as $,CheckboxButton as A,Button$2 as B,Carousel as C,clearUsersInformationFromTheBrowser as D,suppressMenusAtom as E,Fragment as F,itemByDoenetId as G,findFirstPageOfActivity as H,coursePermissionsAndSettingsByCourseId as I,faCode as J,faUser as K,faChartPie as L,faTasks as M,UTCDateStringToDate as N,activityVariantPanelAtom as O,PageViewer as P,useSetCourseIdFromDoenetId as Q,Recoil_index_24 as R,useInitCourseItems as S,selectedCourseItems as T,Ue$1 as U,studentCourseItemOrderByCourseIdBySection as V,faFolderTree as W,faFileCode as X,authorCourseItemOrderByCourseIdBySection as Y,faLayerGroup as Z,faFileExport as _,jsxs as a,useValidateEmail as a$,faCheck as a0,faChevronDown as a1,faChevronRight as a2,serializedComponentsReviver as a3,useLoaderData as a4,peopleByCourseId as a5,useCourse as a6,formatAMPM as a7,Searchbar as a8,clear as a9,DateToUTCDateString as aA,faExternalLinkAlt as aB,global$2 as aC,propTypesExports as aD,_extends$2 as aE,courseRolePermissionsByCourseIdRoleId as aF,courseRolesByCourseId as aG,keyframes$1 as aH,jsx as aI,css$2 as aJ,faChevronLeft as aK,faThumbtack as aL,faSortDown as aM,faSortUp as aN,faSort as aO,faTimes as aP,Tree as aQ,NodeProp as aR,TreeFragment as aS,Parser$1 as aT,NodeType as aU,ContextTracker as aV,ExternalTokenizer as aW,LRParser as aX,parser as aY,fileByPageId as aZ,Ce$2 as a_,commonjsGlobal$1 as aa,scrollableContainerAtom as ab,retrieveTextFileForCid as ac,cssesc_1 as ad,nanoid as ae,set as af,Recoil_index_8 as ag,cidFromText as ah,get as ai,faExclamationCircle as aj,allComponentClasses as ak,componentTypesCreatingVariants as al,expandDoenetMLsToFullSerializedComponents as am,addDocumentIfItsMissing as an,getNumberOfVariants as ao,numberToLetters as ap,parseAndCompile as aq,enumerateCombinations as ar,countComponentTypes as as,getDefaultExportFromCjs$1 as at,reactDomExports as au,React as av,Fe$2 as aw,Recoil_index_9 as ax,Recoil_index_10 as ay,Recoil_index_11 as az,Recoil_index_21 as b,DateToDateString as b0,useDropzone as b1,faCaretRight as b2,getAugmentedNamespace$1 as b3,supportPanelHandleLeft as b4,authorCourseItemOrderByCourseId as b5,studentCourseItemOrderByCourseId as b6,faArrowUp as b7,faBackspace as b8,betterReactMathjax as b9,faPuzzlePiece as bA,ReactDOM as bB,HyperFormula as bC,cutCourseItems as ba,copiedCourseItems as bb,faChalkboard as bc,faCalendarPlus as bd,faCalendarTimes as be,DateToDisplayDateString as bf,faAngleLeft as bg,faAngleRight as bh,DateToUTCDateWithoutSecondsString as bi,authorCollectionsByCourseId as bj,useCreateCourse as bk,Recoil_index_25 as bl,faPlus as bm,useDoenetRenderer as bn,Context as bo,faLevelDownAlt as bp,faCloud as bq,rendererState as br,darkModeAtom as bs,createFunctionFromDefinition as bt,faLightbulb as bu,cidFromArrayBuffer as bv,deepCompare as bw,getURLFromRef as bx,Link$1 as by,faCaretDown as bz,profileAtom as c,checkIfUserClearedOut as d,useNavigate as e,pageVariantPanelAtom as f,Recoil_index_22 as g,pageVariantInfoAtom as h,FontAwesomeIcon as i,jsx$1 as j,axios as k,Recoil_index_20 as l,searchParamAtomFamily as m,coursePermissionsAndSettings as n,mainPanelClickAtom as o,pageToolViewAtom as p,selectedMenuPanelAtom as q,reactExports as r,styled$1 as s,useTransition as t,useLocation as u,Recoil_index_31 as v,courseIdAtom as w,animated as x,useToast as y,toastType as z}; +`;function PortfolioActivityViewer(){const{doenetML:as,signedIn:rs,label:ns,fullName:ss,courseId:os,doenetId:ls,pageDoenetId:us}=useLoaderData(),cs=useNavigate(),ds=Recoil_index_24(pageToolViewAtom),ps=Recoil_index_24(pageVariantPanelAtom),[fs,hs]=Recoil_index_22(pageVariantInfoAtom);function gs(ys,bs){const vs=JSON.parse(JSON.stringify(ys));ps({index:vs.index,allPossibleVariants:bs}),hs({index:vs.index})}return jsx$1(Fragment,{children:jsxs(PageContainer,{children:[jsx$1(Header,{children:jsxs(HeaderContent,{children:[jsxs("div",{children:[jsx$1(HeaderSectionLeft,{children:jsx$1(Label,{children:ns})}),jsx$1(HeaderSectionLeft,{children:jsxs(AvatarLink,{to:`/publicportfolio/${os}`,children:[jsx$1(Avatar,{size:"sm",name:ss})," ",jsxs(Byline,{children:["By ",ss]})]})})]}),jsxs("div",{children:[jsx$1(HeaderSectionRight,{children:jsx$1(Button$2,{value:"See Inside",onClick:()=>{ds({page:"public",tool:"editor",view:"",params:{}}),cs(`/public?tool=editor&doenetId=${ls}&pageId=${us}`)}})}),rs?jsx$1(HeaderSectionRight,{children:jsx$1(Form,{method:"post",children:jsx$1(Button$2,{value:"Remix",onClick:()=>{}})})}):null]})]})}),jsx$1(ViewerOutsideContainer,{children:jsx$1(ViewerInsideContainer,{children:jsx$1(PageViewer,{doenetML:as,flags:{showCorrectness:!0,solutionDisplayMode:!0,showFeedback:!0,showHints:!0,autoSubmit:!1,allowLoadState:!1,allowSaveState:!1,allowLocalState:!1,allowSaveSubmissions:!1,allowSaveEvents:!1},attemptNumber:1,generatedVariantCallback:gs,requestedVariantIndex:fs.index,pageIsActive:!0},"HPpageViewer")})})]})})}const index="",theme=extendTheme({fonts:{body:"Jost"},textStyles:{primary:{fontFamily:"Jost"}},colors:{doenet:{mainBlue:"#1a5a99",lightBlue:"#b8d2ea",solidLightBlue:"#8fb8de",mainGray:"#e3e3e3",donutBody:"#eea177",donutTopping:"#6d4445",mainRed:"#c1292e",lightRed:"#eab8b8",mainGreen:"#459152",canvas:"#ffffff",canvastext:"#000000",lightGreen:"#a6f19f",lightYellow:"#f5ed85",whiteBlankLink:"#6d4445",mainYellow:"#94610a",mainPurple:"#4a03d9"}},components:{Button:{baseStyle:{fontWeight:"normal",letterSpacing:".5px",_focus:{outline:"2px solid #2D5994",outlineOffset:"2px"},_disabled:{bg:"#E2E2E2",color:"black",cursor:"none"}},variants:{solid:{bg:"doenet.mainBlue",color:"white",_hover:{bg:"doenet.solidLightBlue",color:"black"}},outline:{borderColor:"#2D5994",_hover:{bg:"solidLightBlue"}},ghost:{_hover:{bg:"solidLightBlue"}},link:{color:"solidLightBlue"}}}}}),router=createBrowserRouter([{path:"/",loader:loader$6,element:jsx$1(ChakraProvider,{theme,children:jsx$1(SiteHeader,{})}),children:[{path:"/",loader:loader$5,element:jsx$1(DarkmodeController,{children:jsx$1(betterReactMathjax.MathJaxContext,{version:2,config:mathjaxConfig,onStartup:as=>as.Hub.processSectionDelay=0,children:jsx$1(ChakraProvider,{theme,children:jsx$1(Home,{})})})})},{path:"community",loader:loader$7,element:jsx$1(ChakraProvider,{theme,children:jsx$1(Community,{})})},{path:"portfolio/:courseId",loader:loader$3,action:action$1,element:jsx$1(ChakraProvider,{theme,children:jsx$1(Portfolio,{})})},{path:"publicportfolio/:courseId",loader:loader$1,element:jsx$1(ChakraProvider,{theme,children:jsx$1(PublicPortfolio,{})})},{path:"/portfolioviewer/:doenetId",loader,action,element:jsx$1(DarkmodeController,{children:jsx$1(betterReactMathjax.MathJaxContext,{version:2,config:mathjaxConfig,onStartup:as=>as.Hub.processSectionDelay=0,children:jsx$1(ChakraProvider,{theme,children:jsx$1(PortfolioActivityViewer,{})})})})}]},{path:"/portfolio/:doenetId/settings",loader:loader$4,action:action$2,ErrorBoundary:ErrorBoundry,element:jsx$1(ChakraProvider,{theme,children:jsx$1(PortfolioActivitySettings,{})})},{path:"/portfolioeditor/:doenetId",loader:loader$2,element:jsx$1(DarkmodeController,{children:jsx$1(betterReactMathjax.MathJaxContext,{version:2,config:mathjaxConfig,onStartup:as=>as.Hub.processSectionDelay=0,children:jsx$1(ToolRoot,{})})})},{path:"/public",loader:loader$8,action:action$3,element:jsx$1(DarkmodeController,{children:jsx$1(betterReactMathjax.MathJaxContext,{version:2,config:mathjaxConfig,onStartup:as=>as.Hub.processSectionDelay=0,children:jsx$1(ToolRoot,{})})})},{path:"*",element:jsx$1(DarkmodeController,{children:jsx$1(betterReactMathjax.MathJaxContext,{version:2,config:mathjaxConfig,onStartup:as=>as.Hub.processSectionDelay=0,children:jsx$1(ToolRoot,{})})})}]),root=createRoot(document.getElementById("root"));root.render(jsx$1(Recoil_index_5,{children:jsx$1(RouterProvider,{router})}));export{faLink as $,CheckboxButton as A,Button$2 as B,Carousel as C,clearUsersInformationFromTheBrowser as D,suppressMenusAtom as E,Fragment as F,itemByDoenetId as G,findFirstPageOfActivity as H,coursePermissionsAndSettingsByCourseId as I,faCode as J,faUser as K,faChartPie as L,faTasks as M,UTCDateStringToDate as N,activityVariantPanelAtom as O,PageViewer as P,useSetCourseIdFromDoenetId as Q,Recoil_index_24 as R,useInitCourseItems as S,selectedCourseItems as T,Ue$1 as U,studentCourseItemOrderByCourseIdBySection as V,faFolderTree as W,faFileCode as X,authorCourseItemOrderByCourseIdBySection as Y,faLayerGroup as Z,faFileExport as _,jsxs as a,useValidateEmail as a$,faCheck as a0,faChevronDown as a1,faChevronRight as a2,serializedComponentsReviver as a3,useLoaderData as a4,peopleByCourseId as a5,useCourse as a6,formatAMPM as a7,Searchbar as a8,clear as a9,DateToUTCDateString as aA,faExternalLinkAlt as aB,global$2 as aC,propTypesExports as aD,_extends$2 as aE,courseRolePermissionsByCourseIdRoleId as aF,courseRolesByCourseId as aG,keyframes$1 as aH,jsx as aI,css$2 as aJ,faChevronLeft as aK,faThumbtack as aL,faSortDown as aM,faSortUp as aN,faSort as aO,faTimes as aP,Tree as aQ,NodeProp as aR,TreeFragment as aS,Parser$1 as aT,NodeType as aU,ContextTracker as aV,ExternalTokenizer as aW,LRParser as aX,parser as aY,fileByPageId as aZ,Ce$2 as a_,commonjsGlobal$1 as aa,scrollableContainerAtom as ab,retrieveTextFileForCid as ac,cssesc_1 as ad,nanoid as ae,set as af,Recoil_index_8 as ag,cidFromText as ah,get$3 as ai,faExclamationCircle as aj,allComponentClasses as ak,componentTypesCreatingVariants as al,expandDoenetMLsToFullSerializedComponents as am,addDocumentIfItsMissing as an,getNumberOfVariants as ao,numberToLetters as ap,parseAndCompile as aq,enumerateCombinations as ar,countComponentTypes as as,getDefaultExportFromCjs$1 as at,reactDomExports as au,React as av,Fe$2 as aw,Recoil_index_9 as ax,Recoil_index_10 as ay,Recoil_index_11 as az,Recoil_index_21 as b,DateToDateString as b0,useDropzone as b1,faCaretRight as b2,getAugmentedNamespace$1 as b3,supportPanelHandleLeft as b4,authorCourseItemOrderByCourseId as b5,studentCourseItemOrderByCourseId as b6,faArrowUp as b7,faBackspace as b8,betterReactMathjax as b9,Link$1 as bA,faCaretDown as bB,faPuzzlePiece as bC,ReactDOM as bD,HyperFormula as bE,cutCourseItems as ba,copiedCourseItems as bb,Box as bc,Image$2 as bd,faChalkboard as be,faCalendarPlus as bf,faCalendarTimes as bg,DateToDisplayDateString as bh,faAngleLeft as bi,faAngleRight as bj,DateToUTCDateWithoutSecondsString as bk,authorCollectionsByCourseId as bl,useCreateCourse as bm,Recoil_index_25 as bn,faPlus as bo,useDoenetRenderer as bp,Context as bq,faLevelDownAlt as br,faCloud as bs,rendererState as bt,darkModeAtom as bu,createFunctionFromDefinition as bv,faLightbulb as bw,cidFromArrayBuffer as bx,deepCompare as by,getURLFromRef as bz,profileAtom as c,checkIfUserClearedOut as d,useNavigate as e,pageVariantPanelAtom as f,Recoil_index_22 as g,pageVariantInfoAtom as h,FontAwesomeIcon as i,jsx$1 as j,axios as k,Recoil_index_20 as l,searchParamAtomFamily as m,coursePermissionsAndSettings as n,mainPanelClickAtom as o,pageToolViewAtom as p,selectedMenuPanelAtom as q,reactExports as r,styled$1 as s,useTransition as t,useLocation as u,Recoil_index_31 as v,courseIdAtom as w,animated as x,useToast as y,toastType as z}; diff --git a/dist/assets/index-2e9c8a8a.js b/dist/assets/index-a475a6f9.js similarity index 99% rename from dist/assets/index-2e9c8a8a.js rename to dist/assets/index-a475a6f9.js index b017857ad8..9cca9efe1e 100644 --- a/dist/assets/index-2e9c8a8a.js +++ b/dist/assets/index-a475a6f9.js @@ -1,4 +1,4 @@ -import{aC as We}from"./index-99a56692.js";var ie=typeof We<"u"?We:typeof self<"u"?self:typeof window<"u"?window:{},k=[],M=[],Qt=typeof Uint8Array<"u"?Uint8Array:Array,Pe=!1;function at(){Pe=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[f-2]==="="?2:t[f-1]==="="?1:0,s=new Qt(f*3/4-o),n=o>0?f-4:f;var u=0;for(e=0,r=0;e>16&255,s[u++]=i>>8&255,s[u++]=i&255;return o===2?(i=M[t.charCodeAt(e)]<<2|M[t.charCodeAt(e+1)]>>4,s[u++]=i&255):o===1&&(i=M[t.charCodeAt(e)]<<10|M[t.charCodeAt(e+1)]<<4|M[t.charCodeAt(e+2)]>>2,s[u++]=i>>8&255,s[u++]=i&255),s}function Gt(t){return k[t>>18&63]+k[t>>12&63]+k[t>>6&63]+k[t&63]}function Zt(t,e,r){for(var n,i=[],o=e;ou?u:f+s));return n===1?(e=t[r-1],i+=k[e>>2],i+=k[e<<4&63],i+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],i+=k[e>>10],i+=k[e>>4&63],i+=k[e<<2&63],i+="="),o.push(i),o.join("")}function ye(t,e,r,n,i){var o,s,f=i*8-n-1,u=(1<>1,h=-7,c=r?i-1:0,v=r?-1:1,b=t[e+c];for(c+=v,o=b&(1<<-h)-1,b>>=-h,h+=f;h>0;o=o*256+t[e+c],c+=v,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=s*256+t[e+c],c+=v,h-=8);if(o===0)o=1-l;else{if(o===u)return s?NaN:(b?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-l}return(b?-1:1)*s*Math.pow(2,o-n)}function ut(t,e,r,n,i,o){var s,f,u,l=o*8-i-1,h=(1<>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:o-1,O=n?1:-1,x=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+c>=1?e+=v/u:e+=v*Math.pow(2,1-c),e*u>=2&&(s++,u/=2),s+c>=h?(f=0,s=h):s+c>=1?(f=(e*u-1)*Math.pow(2,i),s=s+c):(f=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+b]=f&255,b+=O,f/=256,i-=8);for(s=s<0;t[r+b]=s&255,b+=O,s/=256,l-=8);t[r+b-O]|=x*128}var Xt={}.toString,lt=Array.isArray||function(t){return Xt.call(t)=="[object Array]"},Kt=50;a.TYPED_ARRAY_SUPPORT=ie.TYPED_ARRAY_SUPPORT!==void 0?ie.TYPED_ARRAY_SUPPORT:!0;me();function me(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function j(t,e){if(me()=me())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+me().toString(16)+" bytes");return t|0}a.isBuffer=T;function P(t){return!!(t!=null&&t._isBuffer)}a.compare=function(e,r){if(!P(e)||!P(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,s=Math.min(n,i);o>>1;case"base64":return vt(t).length;default:if(n)return _e(t).length;e=(""+e).toLowerCase(),n=!0}}a.byteLength=dt;function ir(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return pr(this,e,r);case"utf8":case"utf-8":return mt(this,e,r);case"ascii":return cr(this,e,r);case"latin1":case"binary":return dr(this,e,r);case"base64":return lr(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gr(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}a.prototype._isBuffer=!0;function Z(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""};a.prototype.compare=function(e,r,n,i,o){if(!P(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var s=o-i,f=n-r,u=Math.min(s,f),l=this.slice(i,o),h=e.slice(r,n),c=0;c2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=a.from(e,n)),P(e))return e.length===0?-1:He(t,e,r,n,i);if(typeof e=="number")return e=e&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):He(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function He(t,e,r,n,i){var o=1,s=t.length,f=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,f/=2,r/=2}function u(b,O){return o===1?b[O]:b.readUInt16BE(O*o)}var l;if(i){var h=-1;for(l=r;ls&&(r=s-f),l=r;l>=0;l--){for(var c=!0,v=0;vi&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;so)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return or(this,e,r,n);case"utf8":case"utf-8":return sr(this,e,r,n);case"ascii":return gt(this,e,r,n);case"latin1":case"binary":return fr(this,e,r,n);case"base64":return ar(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ur(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function lr(t,e,r){return e===0&&r===t.length?Qe(t):Qe(t.slice(e,r))}function mt(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:o>223?3:o>191?2:1;if(i+f<=r){var u,l,h,c;switch(f){case 1:o<128&&(s=o);break;case 2:u=t[i+1],(u&192)===128&&(c=(o&31)<<6|u&63,c>127&&(s=c));break;case 3:u=t[i+1],l=t[i+2],(u&192)===128&&(l&192)===128&&(c=(o&15)<<12|(u&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:u=t[i+1],l=t[i+2],h=t[i+3],(u&192)===128&&(l&192)===128&&(h&192)===128&&(c=(o&15)<<18|(u&63)<<12|(l&63)<<6|h&63,c>65535&&c<1114112&&(s=c))}}s===null?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=f}return hr(n)}var Ge=4096;function hr(t){var e=t.length;if(e<=Ge)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",o=e;on&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),rr)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||I(e,r,this.length);for(var i=this[e],o=1,s=0;++s0&&(o*=256);)i+=this[e+--r]*o;return i};a.prototype.readUInt8=function(e,r){return r||I(e,1,this.length),this[e]};a.prototype.readUInt16LE=function(e,r){return r||I(e,2,this.length),this[e]|this[e+1]<<8};a.prototype.readUInt16BE=function(e,r){return r||I(e,2,this.length),this[e]<<8|this[e+1]};a.prototype.readUInt32LE=function(e,r){return r||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};a.prototype.readUInt32BE=function(e,r){return r||I(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};a.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||I(e,r,this.length);for(var i=this[e],o=1,s=0;++s=o&&(i-=Math.pow(2,8*r)),i};a.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||I(e,r,this.length);for(var i=r,o=1,s=this[e+--i];i>0&&(o*=256);)s+=this[e+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s};a.prototype.readInt8=function(e,r){return r||I(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};a.prototype.readInt16LE=function(e,r){r||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(e,r){r||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(e,r){return r||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};a.prototype.readInt32BE=function(e,r){return r||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};a.prototype.readFloatLE=function(e,r){return r||I(e,4,this.length),ye(this,e,!0,23,4)};a.prototype.readFloatBE=function(e,r){return r||I(e,4,this.length),ye(this,e,!1,23,4)};a.prototype.readDoubleLE=function(e,r){return r||I(e,8,this.length),ye(this,e,!0,52,8)};a.prototype.readDoubleBE=function(e,r){return r||I(e,8,this.length),ye(this,e,!1,52,8)};function N(t,e,r,n,i,o){if(!P(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;N(this,e,r,n,o,0)}var s=1,f=0;for(this[r]=e&255;++f=0&&(f*=256);)this[r+s]=e/f&255;return r+n};a.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function ve(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>(n?i:1-i)*8}a.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ve(this,e,r,!0),r+2};a.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ve(this,e,r,!1),r+2};function be(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>(n?i:3-i)*8&255}a.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):be(this,e,r,!0),r+4};a.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):be(this,e,r,!1),r+4};a.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);N(this,e,r,n,o-1,-o)}var s=0,f=1,u=0;for(this[r]=e&255;++s>0)-u&255;return r+n};a.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);N(this,e,r,n,o-1,-o)}var s=n-1,f=1,u=0;for(this[r+s]=e&255;--s>=0&&(f*=256);)e<0&&u===0&&this[r+s+1]!==0&&(u=1),this[r+s]=(e/f>>0)-u&255;return r+n};a.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};a.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ve(this,e,r,!0),r+2};a.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ve(this,e,r,!1),r+2};a.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):be(this,e,r,!0),r+4};a.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):be(this,e,r,!1),r+4};function _t(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function wt(t,e,r,n,i){return i||_t(t,e,r,4),ut(t,e,r,n,23,4),r+4}a.prototype.writeFloatLE=function(e,r,n){return wt(this,e,r,!0,n)};a.prototype.writeFloatBE=function(e,r,n){return wt(this,e,r,!1,n)};function yt(t,e,r,n,i){return i||_t(t,e,r,8),ut(t,e,r,n,52,8),r+8}a.prototype.writeDoubleLE=function(e,r,n){return yt(this,e,r,!0,n)};a.prototype.writeDoubleBE=function(e,r,n){return yt(this,e,r,!1,n)};a.prototype.copy=function(e,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r=0;--s)e[s+r]=this[s+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var s;if(typeof e=="number")for(s=r;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function vr(t){for(var e=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function vt(t){return Ht(_r(t))}function xe(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function xr(t){return t!==t}function T(t){return t!=null&&(!!t._isBuffer||bt(t)||Er(t))}function bt(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Er(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&bt(t.slice(0,0))}var Sr;function Q(){}Q.prototype=Object.create(null);function p(){p.init.call(this)}p.EventEmitter=p;p.usingDomains=!1;p.prototype.domain=void 0;p.prototype._events=void 0;p.prototype._maxListeners=void 0;p.defaultMaxListeners=10;p.init=function(){this.domain=null,p.usingDomains&&Sr.active,(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new Q,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};p.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this};function xt(t){return t._maxListeners===void 0?p.defaultMaxListeners:t._maxListeners}p.prototype.getMaxListeners=function(){return xt(this)};function Rr(t,e,r){if(e)t.call(r);else for(var n=t.length,i=ue(t,n),o=0;o0&&s.length>i)){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=s.length,Lr(f)}return t}function Lr(t){typeof console.warn=="function"?console.warn(t):console.log(t)}p.prototype.addListener=function(e,r){return Et(this,e,r,!1)};p.prototype.on=p.prototype.addListener;p.prototype.prependListener=function(e,r){return Et(this,e,r,!0)};function St(t,e,r){var n=!1;function i(){t.removeListener(e,i),n||(n=!0,r.apply(t,arguments))}return i.listener=r,i}p.prototype.once=function(e,r){if(typeof r!="function")throw new TypeError('"listener" argument must be a function');return this.on(e,St(this,e,r)),this};p.prototype.prependOnceListener=function(e,r){if(typeof r!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(e,St(this,e,r)),this};p.prototype.removeListener=function(e,r){var n,i,o,s,f;if(typeof r!="function")throw new TypeError('"listener" argument must be a function');if(i=this._events,!i)return this;if(n=i[e],!n)return this;if(n===r||n.listener&&n.listener===r)--this._eventsCount===0?this._events=new Q:(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,s=n.length;s-- >0;)if(n[s]===r||n[s].listener&&n[s].listener===r){f=n[s].listener,o=s;break}if(o<0)return this;if(n.length===1){if(n[0]=void 0,--this._eventsCount===0)return this._events=new Q,this;delete i[e]}else Tr(n,o);i.removeListener&&this.emit("removeListener",e,f||r)}return this};p.prototype.removeAllListeners=function(e){var r,n;if(n=this._events,!n)return this;if(!n.removeListener)return arguments.length===0?(this._events=new Q,this._eventsCount=0):n[e]&&(--this._eventsCount===0?this._events=new Q:delete n[e]),this;if(arguments.length===0){for(var i=Object.keys(n),o=0,s;o0?Reflect.ownKeys(this._events):[]};function Tr(t,e){for(var r=e,n=r+1,i=t.length;n1)for(var r=1;r=i)return f;switch(f){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return f}}),s=n[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Nt(e)?r.showHidden=e:e&&_n(r,e),W(r.showHidden)&&(r.showHidden=!1),W(r.depth)&&(r.depth=2),W(r.colors)&&(r.colors=!1),W(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=un),we(r,t,r.depth)}H.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};H.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function un(t,e){var r=H.styles[e];return r?"\x1B["+H.colors[r][0]+"m"+t+"\x1B["+H.colors[r][1]+"m":t}function ln(t,e){return t}function hn(t){var e={};return t.forEach(function(r,n){e[r]=!0}),e}function we(t,e,r){if(t.customInspect&&e&&Te(e.inspect)&&e.inspect!==H&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(r,t);return ze(n)||(n=we(t,n,r)),n}var i=cn(t,e);if(i)return i;var o=Object.keys(e),s=hn(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),Le(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Ce(e);if(o.length===0){if(Te(e)){var f=e.name?": "+e.name:"";return t.stylize("[Function"+f+"]","special")}if(Ae(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Ze(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Le(e))return Ce(e)}var u="",l=!1,h=["{","}"];if(gn(e)&&(l=!0,h=["[","]"]),Te(e)){var c=e.name?": "+e.name:"";u=" [Function"+c+"]"}if(Ae(e)&&(u=" "+RegExp.prototype.toString.call(e)),Ze(e)&&(u=" "+Date.prototype.toUTCString.call(e)),Le(e)&&(u=" "+Ce(e)),o.length===0&&(!l||e.length==0))return h[0]+u+h[1];if(r<0)return Ae(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var v;return l?v=dn(t,e,r,s,o):v=o.map(function(b){return Ue(t,e,r,s,b,l)}),t.seen.pop(),pn(v,u,h)}function cn(t,e){if(W(e))return t.stylize("undefined","undefined");if(ze(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(mn(e))return t.stylize(""+e,"number");if(Nt(e))return t.stylize(""+e,"boolean");if($e(e))return t.stylize("null","null")}function Ce(t){return"["+Error.prototype.toString.call(t)+"]"}function dn(t,e,r,n,i){for(var o=[],s=0,f=e.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");o=t[f-2]==="="?2:t[f-1]==="="?1:0,s=new Qt(f*3/4-o),n=o>0?f-4:f;var u=0;for(e=0,r=0;e>16&255,s[u++]=i>>8&255,s[u++]=i&255;return o===2?(i=M[t.charCodeAt(e)]<<2|M[t.charCodeAt(e+1)]>>4,s[u++]=i&255):o===1&&(i=M[t.charCodeAt(e)]<<10|M[t.charCodeAt(e+1)]<<4|M[t.charCodeAt(e+2)]>>2,s[u++]=i>>8&255,s[u++]=i&255),s}function Gt(t){return k[t>>18&63]+k[t>>12&63]+k[t>>6&63]+k[t&63]}function Zt(t,e,r){for(var n,i=[],o=e;ou?u:f+s));return n===1?(e=t[r-1],i+=k[e>>2],i+=k[e<<4&63],i+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],i+=k[e>>10],i+=k[e>>4&63],i+=k[e<<2&63],i+="="),o.push(i),o.join("")}function ye(t,e,r,n,i){var o,s,f=i*8-n-1,u=(1<>1,h=-7,c=r?i-1:0,v=r?-1:1,b=t[e+c];for(c+=v,o=b&(1<<-h)-1,b>>=-h,h+=f;h>0;o=o*256+t[e+c],c+=v,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=s*256+t[e+c],c+=v,h-=8);if(o===0)o=1-l;else{if(o===u)return s?NaN:(b?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-l}return(b?-1:1)*s*Math.pow(2,o-n)}function ut(t,e,r,n,i,o){var s,f,u,l=o*8-i-1,h=(1<>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:o-1,O=n?1:-1,x=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(f=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),s+c>=1?e+=v/u:e+=v*Math.pow(2,1-c),e*u>=2&&(s++,u/=2),s+c>=h?(f=0,s=h):s+c>=1?(f=(e*u-1)*Math.pow(2,i),s=s+c):(f=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+b]=f&255,b+=O,f/=256,i-=8);for(s=s<0;t[r+b]=s&255,b+=O,s/=256,l-=8);t[r+b-O]|=x*128}var Xt={}.toString,lt=Array.isArray||function(t){return Xt.call(t)=="[object Array]"},Kt=50;a.TYPED_ARRAY_SUPPORT=ie.TYPED_ARRAY_SUPPORT!==void 0?ie.TYPED_ARRAY_SUPPORT:!0;me();function me(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function j(t,e){if(me()=me())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+me().toString(16)+" bytes");return t|0}a.isBuffer=T;function P(t){return!!(t!=null&&t._isBuffer)}a.compare=function(e,r){if(!P(e)||!P(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,s=Math.min(n,i);o>>1;case"base64":return vt(t).length;default:if(n)return _e(t).length;e=(""+e).toLowerCase(),n=!0}}a.byteLength=dt;function ir(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return pr(this,e,r);case"utf8":case"utf-8":return mt(this,e,r);case"ascii":return cr(this,e,r);case"latin1":case"binary":return dr(this,e,r);case"base64":return lr(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gr(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}a.prototype._isBuffer=!0;function Z(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}a.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""};a.prototype.compare=function(e,r,n,i,o){if(!P(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var s=o-i,f=n-r,u=Math.min(s,f),l=this.slice(i,o),h=e.slice(r,n),c=0;c2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=a.from(e,n)),P(e))return e.length===0?-1:He(t,e,r,n,i);if(typeof e=="number")return e=e&255,a.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):He(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function He(t,e,r,n,i){var o=1,s=t.length,f=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,f/=2,r/=2}function u(b,O){return o===1?b[O]:b.readUInt16BE(O*o)}var l;if(i){var h=-1;for(l=r;ls&&(r=s-f),l=r;l>=0;l--){for(var c=!0,v=0;vi&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;so)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return or(this,e,r,n);case"utf8":case"utf-8":return sr(this,e,r,n);case"ascii":return gt(this,e,r,n);case"latin1":case"binary":return fr(this,e,r,n);case"base64":return ar(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ur(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function lr(t,e,r){return e===0&&r===t.length?Qe(t):Qe(t.slice(e,r))}function mt(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:o>223?3:o>191?2:1;if(i+f<=r){var u,l,h,c;switch(f){case 1:o<128&&(s=o);break;case 2:u=t[i+1],(u&192)===128&&(c=(o&31)<<6|u&63,c>127&&(s=c));break;case 3:u=t[i+1],l=t[i+2],(u&192)===128&&(l&192)===128&&(c=(o&15)<<12|(u&63)<<6|l&63,c>2047&&(c<55296||c>57343)&&(s=c));break;case 4:u=t[i+1],l=t[i+2],h=t[i+3],(u&192)===128&&(l&192)===128&&(h&192)===128&&(c=(o&15)<<18|(u&63)<<12|(l&63)<<6|h&63,c>65535&&c<1114112&&(s=c))}}s===null?(s=65533,f=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=f}return hr(n)}var Ge=4096;function hr(t){var e=t.length;if(e<=Ge)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",o=e;on&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),rr)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||I(e,r,this.length);for(var i=this[e],o=1,s=0;++s0&&(o*=256);)i+=this[e+--r]*o;return i};a.prototype.readUInt8=function(e,r){return r||I(e,1,this.length),this[e]};a.prototype.readUInt16LE=function(e,r){return r||I(e,2,this.length),this[e]|this[e+1]<<8};a.prototype.readUInt16BE=function(e,r){return r||I(e,2,this.length),this[e]<<8|this[e+1]};a.prototype.readUInt32LE=function(e,r){return r||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};a.prototype.readUInt32BE=function(e,r){return r||I(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};a.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||I(e,r,this.length);for(var i=this[e],o=1,s=0;++s=o&&(i-=Math.pow(2,8*r)),i};a.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||I(e,r,this.length);for(var i=r,o=1,s=this[e+--i];i>0&&(o*=256);)s+=this[e+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s};a.prototype.readInt8=function(e,r){return r||I(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};a.prototype.readInt16LE=function(e,r){r||I(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};a.prototype.readInt16BE=function(e,r){r||I(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};a.prototype.readInt32LE=function(e,r){return r||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};a.prototype.readInt32BE=function(e,r){return r||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};a.prototype.readFloatLE=function(e,r){return r||I(e,4,this.length),ye(this,e,!0,23,4)};a.prototype.readFloatBE=function(e,r){return r||I(e,4,this.length),ye(this,e,!1,23,4)};a.prototype.readDoubleLE=function(e,r){return r||I(e,8,this.length),ye(this,e,!0,52,8)};a.prototype.readDoubleBE=function(e,r){return r||I(e,8,this.length),ye(this,e,!1,52,8)};function N(t,e,r,n,i,o){if(!P(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}a.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r|0,n=n|0,!i){var o=Math.pow(2,8*n)-1;N(this,e,r,n,o,0)}var s=1,f=0;for(this[r]=e&255;++f=0&&(f*=256);)this[r+s]=e/f&255;return r+n};a.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function ve(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>(n?i:1-i)*8}a.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ve(this,e,r,!0),r+2};a.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ve(this,e,r,!1),r+2};function be(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>(n?i:3-i)*8&255}a.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):be(this,e,r,!0),r+4};a.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):be(this,e,r,!1),r+4};a.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);N(this,e,r,n,o-1,-o)}var s=0,f=1,u=0;for(this[r]=e&255;++s>0)-u&255;return r+n};a.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r|0,!i){var o=Math.pow(2,8*n-1);N(this,e,r,n,o-1,-o)}var s=n-1,f=1,u=0;for(this[r+s]=e&255;--s>=0&&(f*=256);)e<0&&u===0&&this[r+s+1]!==0&&(u=1),this[r+s]=(e/f>>0)-u&255;return r+n};a.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1};a.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):ve(this,e,r,!0),r+2};a.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):ve(this,e,r,!1),r+2};a.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):be(this,e,r,!0),r+4};a.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||N(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):be(this,e,r,!1),r+4};function _t(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function wt(t,e,r,n,i){return i||_t(t,e,r,4),ut(t,e,r,n,23,4),r+4}a.prototype.writeFloatLE=function(e,r,n){return wt(this,e,r,!0,n)};a.prototype.writeFloatBE=function(e,r,n){return wt(this,e,r,!1,n)};function yt(t,e,r,n,i){return i||_t(t,e,r,8),ut(t,e,r,n,52,8),r+8}a.prototype.writeDoubleLE=function(e,r,n){return yt(this,e,r,!0,n)};a.prototype.writeDoubleBE=function(e,r,n){return yt(this,e,r,!1,n)};a.prototype.copy=function(e,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r=0;--s)e[s+r]=this[s+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(s=0;s>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var s;if(typeof e=="number")for(s=r;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function vr(t){for(var e=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function vt(t){return Ht(_r(t))}function xe(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function xr(t){return t!==t}function T(t){return t!=null&&(!!t._isBuffer||bt(t)||Er(t))}function bt(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function Er(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&bt(t.slice(0,0))}var Sr;function Q(){}Q.prototype=Object.create(null);function p(){p.init.call(this)}p.EventEmitter=p;p.usingDomains=!1;p.prototype.domain=void 0;p.prototype._events=void 0;p.prototype._maxListeners=void 0;p.defaultMaxListeners=10;p.init=function(){this.domain=null,p.usingDomains&&Sr.active,(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new Q,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};p.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this};function xt(t){return t._maxListeners===void 0?p.defaultMaxListeners:t._maxListeners}p.prototype.getMaxListeners=function(){return xt(this)};function Rr(t,e,r){if(e)t.call(r);else for(var n=t.length,i=ue(t,n),o=0;o0&&s.length>i)){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=s.length,Lr(f)}return t}function Lr(t){typeof console.warn=="function"?console.warn(t):console.log(t)}p.prototype.addListener=function(e,r){return Et(this,e,r,!1)};p.prototype.on=p.prototype.addListener;p.prototype.prependListener=function(e,r){return Et(this,e,r,!0)};function St(t,e,r){var n=!1;function i(){t.removeListener(e,i),n||(n=!0,r.apply(t,arguments))}return i.listener=r,i}p.prototype.once=function(e,r){if(typeof r!="function")throw new TypeError('"listener" argument must be a function');return this.on(e,St(this,e,r)),this};p.prototype.prependOnceListener=function(e,r){if(typeof r!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(e,St(this,e,r)),this};p.prototype.removeListener=function(e,r){var n,i,o,s,f;if(typeof r!="function")throw new TypeError('"listener" argument must be a function');if(i=this._events,!i)return this;if(n=i[e],!n)return this;if(n===r||n.listener&&n.listener===r)--this._eventsCount===0?this._events=new Q:(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,s=n.length;s-- >0;)if(n[s]===r||n[s].listener&&n[s].listener===r){f=n[s].listener,o=s;break}if(o<0)return this;if(n.length===1){if(n[0]=void 0,--this._eventsCount===0)return this._events=new Q,this;delete i[e]}else Tr(n,o);i.removeListener&&this.emit("removeListener",e,f||r)}return this};p.prototype.removeAllListeners=function(e){var r,n;if(n=this._events,!n)return this;if(!n.removeListener)return arguments.length===0?(this._events=new Q,this._eventsCount=0):n[e]&&(--this._eventsCount===0?this._events=new Q:delete n[e]),this;if(arguments.length===0){for(var i=Object.keys(n),o=0,s;o0?Reflect.ownKeys(this._events):[]};function Tr(t,e){for(var r=e,n=r+1,i=t.length;n1)for(var r=1;r=i)return f;switch(f){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return f}}),s=n[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Nt(e)?r.showHidden=e:e&&_n(r,e),W(r.showHidden)&&(r.showHidden=!1),W(r.depth)&&(r.depth=2),W(r.colors)&&(r.colors=!1),W(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=un),we(r,t,r.depth)}H.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};H.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function un(t,e){var r=H.styles[e];return r?"\x1B["+H.colors[r][0]+"m"+t+"\x1B["+H.colors[r][1]+"m":t}function ln(t,e){return t}function hn(t){var e={};return t.forEach(function(r,n){e[r]=!0}),e}function we(t,e,r){if(t.customInspect&&e&&Te(e.inspect)&&e.inspect!==H&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(r,t);return ze(n)||(n=we(t,n,r)),n}var i=cn(t,e);if(i)return i;var o=Object.keys(e),s=hn(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),Le(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Ce(e);if(o.length===0){if(Te(e)){var f=e.name?": "+e.name:"";return t.stylize("[Function"+f+"]","special")}if(Ae(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Ze(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Le(e))return Ce(e)}var u="",l=!1,h=["{","}"];if(gn(e)&&(l=!0,h=["[","]"]),Te(e)){var c=e.name?": "+e.name:"";u=" [Function"+c+"]"}if(Ae(e)&&(u=" "+RegExp.prototype.toString.call(e)),Ze(e)&&(u=" "+Date.prototype.toUTCString.call(e)),Le(e)&&(u=" "+Ce(e)),o.length===0&&(!l||e.length==0))return h[0]+u+h[1];if(r<0)return Ae(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var v;return l?v=dn(t,e,r,s,o):v=o.map(function(b){return Ue(t,e,r,s,b,l)}),t.seen.pop(),pn(v,u,h)}function cn(t,e){if(W(e))return t.stylize("undefined","undefined");if(ze(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(mn(e))return t.stylize(""+e,"number");if(Nt(e))return t.stylize(""+e,"boolean");if($e(e))return t.stylize("null","null")}function Ce(t){return"["+Error.prototype.toString.call(t)+"]"}function dn(t,e,r,n,i){for(var o=[],s=0,f=e.length;s-1&&(o?f=f.split(` `).map(function(l){return" "+l}).join(` `).substr(2):f=` diff --git a/dist/assets/index.esm-b3e258be.js b/dist/assets/index.esm-5b62de19.js similarity index 99% rename from dist/assets/index.esm-b3e258be.js rename to dist/assets/index.esm-5b62de19.js index cde030f379..34915d6976 100644 --- a/dist/assets/index.esm-b3e258be.js +++ b/dist/assets/index.esm-5b62de19.js @@ -1 +1 @@ -import{aC as _,aD as u,r as g,aE as D}from"./index-99a56692.js";import{_ as C,a as S}from"./setPrototypeOf-51e8cf87.js";function W(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,C(e,t)}var E=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(i,s){return i[0]===n?(r=s,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(n,r){var i=e(this.__entries__,n);~i?this.__entries__[i][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,i=e(r,n);~i&&r.splice(i,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var i=0,s=this.__entries__;i0},e.prototype.connect_=function(){!w||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),G?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!w||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=j.some(function(s){return!!~r.indexOf(s)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),z=function(e,t){for(var n=0,r=Object.keys(t);n"u"||!(Element instanceof Object))){if(!(t instanceof d(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new K(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof d(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new Y(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),x=typeof WeakMap<"u"?new WeakMap:new E,T=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=H.getInstance(),r=new J(t,n,this);x.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){T.prototype[e]=function(){var t;return(t=x.get(this))[e].apply(t,arguments)}});var Q=function(){return typeof v.ResizeObserver<"u"?v.ResizeObserver:T}(),X=["client","offset","scroll","bounds","margin"];function O(e){var t=[];return X.forEach(function(n){e[n]&&t.push(n)}),t}function R(e,t){var n={};if(t.indexOf("client")>-1&&(n.client={top:e.clientTop,left:e.clientLeft,width:e.clientWidth,height:e.clientHeight}),t.indexOf("offset")>-1&&(n.offset={top:e.offsetTop,left:e.offsetLeft,width:e.offsetWidth,height:e.offsetHeight}),t.indexOf("scroll")>-1&&(n.scroll={top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}),t.indexOf("bounds")>-1){var r=e.getBoundingClientRect();n.bounds={top:r.top,right:r.right,bottom:r.bottom,left:r.left,width:r.width,height:r.height}}if(t.indexOf("margin")>-1){var i=getComputedStyle(e);n.margin={top:i?parseInt(i.marginTop):0,right:i?parseInt(i.marginRight):0,bottom:i?parseInt(i.marginBottom):0,left:i?parseInt(i.marginLeft):0}}return n}function Z(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||window}function ee(e){return function(t){var n,r;return r=n=function(i){W(s,i);function s(){for(var o,c=arguments.length,h=new Array(c),l=0;l0},e.prototype.connect_=function(){!w||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),G?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!w||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=j.some(function(s){return!!~r.indexOf(s)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),z=function(e,t){for(var n=0,r=Object.keys(t);n"u"||!(Element instanceof Object))){if(!(t instanceof d(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new K(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof d(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new Y(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),x=typeof WeakMap<"u"?new WeakMap:new E,T=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=H.getInstance(),r=new J(t,n,this);x.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){T.prototype[e]=function(){var t;return(t=x.get(this))[e].apply(t,arguments)}});var Q=function(){return typeof v.ResizeObserver<"u"?v.ResizeObserver:T}(),X=["client","offset","scroll","bounds","margin"];function O(e){var t=[];return X.forEach(function(n){e[n]&&t.push(n)}),t}function R(e,t){var n={};if(t.indexOf("client")>-1&&(n.client={top:e.clientTop,left:e.clientLeft,width:e.clientWidth,height:e.clientHeight}),t.indexOf("offset")>-1&&(n.offset={top:e.offsetTop,left:e.offsetLeft,width:e.offsetWidth,height:e.offsetHeight}),t.indexOf("scroll")>-1&&(n.scroll={top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}),t.indexOf("bounds")>-1){var r=e.getBoundingClientRect();n.bounds={top:r.top,right:r.right,bottom:r.bottom,left:r.left,width:r.width,height:r.height}}if(t.indexOf("margin")>-1){var i=getComputedStyle(e);n.margin={top:i?parseInt(i.marginTop):0,right:i?parseInt(i.marginRight):0,bottom:i?parseInt(i.marginBottom):0,left:i?parseInt(i.marginLeft):0}}return n}function Z(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||window}function ee(e){return function(t){var n,r;return r=n=function(i){W(s,i);function s(){for(var o,c=arguments.length,h=new Array(c),l=0;l()=>{t.current!==null&&(t.current.off("drag"),t.current.off("down"),t.current.off("up"),o==null||o.removeObject(t.current),t.current=null)},[]);function D(){let s=!e.draggable||e.fixed,i={visible:!e.hidden,fixed:s,layer:10*e.layer+N,highlight:!s,useMathJax:e.hasLatex,parse:!1},u;try{let r=M.fromAst(e.anchor),f=[r.get_component(0).evaluate_to_constant(),r.get_component(1).evaluate_to_constant()];Number.isFinite(f[0])||(f[0]=0,i.visible=!1),Number.isFinite(f[1])||(f[1]=0,i.visible=!1),u=o.create("point",f,{visible:!1})}catch{i.visible=!1,u=o.create("point",[0,0],{visible:!1})}i.anchor=u;let a,l;e.positionFromAnchor==="center"?(a="middle",l="middle"):e.positionFromAnchor==="lowerleft"?(a="right",l="top"):e.positionFromAnchor==="lowerright"?(a="left",l="top"):e.positionFromAnchor==="upperleft"?(a="right",l="bottom"):e.positionFromAnchor==="upperright"?(a="left",l="bottom"):e.positionFromAnchor==="bottom"?(a="middle",l="top"):e.positionFromAnchor==="top"?(a="middle",l="bottom"):e.positionFromAnchor==="right"?(a="left",l="middle"):(a="right",l="middle"),i.anchorx=a,i.anchory=l,b.current=[a,l];let n=o.create("text",[0,0,e.value],i);n.on("down",function(r){h.current=[r.x,r.y],F.current=[...u.coords.scrCoords],g.current=!1}),n.on("up",function(r){g.current&&O({action:L.moveLabel,args:{x:m.current,y:p.current}}),g.current=!1}),n.on("drag",function(r){var f=o.origin.scrCoords;let[C,_,P,X]=o.getBoundingBox(),w=n.size[0]/o.unitX,J=n.size[1]/o.unitY,E=b.current[0],G=b.current[1],v=0;E==="middle"?v=-w/2:E==="right"&&(v=-w);let A=0;G==="middle"?A=-J/2:G==="top"&&(A=-J);let T=C+.04*(P-C)-v-w,z=P-.04*(P-C)-v,V=X+.04*(_-X)-A-J,k=_-.04*(_-X)-A;m.current=(F.current[1]+r.x-h.current[0]-f[1])/o.unitX,m.current=Math.min(z,Math.max(T,m.current)),p.current=(f[2]-(F.current[2]+r.y-h.current[1]))/o.unitY,p.current=Math.min(k,Math.max(V,p.current)),O({action:L.moveLabel,args:{x:m.current,y:p.current,transient:!0,skippable:!0}}),n.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,[0,0]),u.coords.setCoordinates(JXG.COORDS_BY_USER,S.current),(Math.abs(r.x-h.current[0])>.1||Math.abs(r.y-h.current[1])>.1)&&(g.current=!0)}),t.current=n,x.current=u,R.current=e.positionFromAnchor,e.hasLatex&&setTimeout(()=>{t.current&&(t.current.needsUpdate=!0,t.current.setText(e.value),t.current.update(),o==null||o.updateRenderer())},1e3)}if(o){let s;try{let i=M.fromAst(e.anchor);s=[i.get_component(0).evaluate_to_constant(),i.get_component(1).evaluate_to_constant()]}catch{s=[NaN,NaN]}if(S.current=s,t.current===null)D();else{t.current.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,[0,0]),x.current.coords.setCoordinates(JXG.COORDS_BY_USER,s),t.current.setText(e.value);let i=!e.hidden;if(Number.isFinite(s[0])&&Number.isFinite(s[1])){let n=t.current.visProp.visible!==i;t.current.visProp.visible=i,t.current.visPropCalc.visible=i,n&&t.current.setAttribute({visible:i})}else t.current.visProp.visible=!1,t.current.visPropCalc.visible=!1;let u=10*e.layer+N;t.current.visProp.layer!==u&&t.current.setAttribute({layer:u});let l=!e.draggable||e.fixed;if(t.current.visProp.highlight=!l,t.current.visProp.fixed=l,t.current.needsUpdate=!0,e.positionFromAnchor!==R.current){let n,r;e.positionFromAnchor==="center"?(n="middle",r="middle"):e.positionFromAnchor==="lowerleft"?(n="right",r="top"):e.positionFromAnchor==="lowerright"?(n="left",r="top"):e.positionFromAnchor==="upperleft"?(n="right",r="bottom"):e.positionFromAnchor==="upperright"?(n="left",r="bottom"):e.positionFromAnchor==="bottom"?(n="middle",r="top"):e.positionFromAnchor==="top"?(n="middle",r="bottom"):e.positionFromAnchor==="right"?(n="left",r="middle"):(n="right",r="middle"),t.current.visProp.anchorx=n,t.current.visProp.anchory=r,b.current=[n,r],R.current=e.positionFromAnchor,t.current.fullUpdate()}else t.current.update();x.current.needsUpdate=!0,x.current.update(),o.updateRenderer()}return y("a",{name:d})}if(e.hidden)return null;if(j.length>0)return U("span",{id:d,style:{marginRight:"12px"},children:[y("a",{name:d}),j]});{let s=e.value;return e.hasLatex&&(s=y(H.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:s})),U("span",{id:d,children:[y("a",{name:d}),s]})}});export{te as default}; +import{av as q,bp as W,r as c,bq as M,j as y,a as U,b9 as H}from"./index-7074710c.js";import{BoardContext as I,TEXT_LAYER_OFFSET as N}from"./graph-71cec529.js";import"./css-14ccef8c.js";import"./visibility-sensor-7d414852.js";const te=q.memo(function Y(B){let{name:K,id:d,SVs:e,children:j,actions:L,callAction:O}=W(B);Y.ignoreActionsWithoutCore=!0;let t=c.useRef(null),x=c.useRef(null),b=c.useRef(null);const o=c.useContext(I);let h=c.useRef(!1),F=c.useRef(!1),g=c.useRef(!1),m=c.useRef(null),p=c.useRef(null),S=c.useRef(null),R=c.useRef(null);c.useEffect(()=>()=>{t.current!==null&&(t.current.off("drag"),t.current.off("down"),t.current.off("up"),o==null||o.removeObject(t.current),t.current=null)},[]);function D(){let s=!e.draggable||e.fixed,i={visible:!e.hidden,fixed:s,layer:10*e.layer+N,highlight:!s,useMathJax:e.hasLatex,parse:!1},u;try{let r=M.fromAst(e.anchor),f=[r.get_component(0).evaluate_to_constant(),r.get_component(1).evaluate_to_constant()];Number.isFinite(f[0])||(f[0]=0,i.visible=!1),Number.isFinite(f[1])||(f[1]=0,i.visible=!1),u=o.create("point",f,{visible:!1})}catch{i.visible=!1,u=o.create("point",[0,0],{visible:!1})}i.anchor=u;let a,l;e.positionFromAnchor==="center"?(a="middle",l="middle"):e.positionFromAnchor==="lowerleft"?(a="right",l="top"):e.positionFromAnchor==="lowerright"?(a="left",l="top"):e.positionFromAnchor==="upperleft"?(a="right",l="bottom"):e.positionFromAnchor==="upperright"?(a="left",l="bottom"):e.positionFromAnchor==="bottom"?(a="middle",l="top"):e.positionFromAnchor==="top"?(a="middle",l="bottom"):e.positionFromAnchor==="right"?(a="left",l="middle"):(a="right",l="middle"),i.anchorx=a,i.anchory=l,b.current=[a,l];let n=o.create("text",[0,0,e.value],i);n.on("down",function(r){h.current=[r.x,r.y],F.current=[...u.coords.scrCoords],g.current=!1}),n.on("up",function(r){g.current&&O({action:L.moveLabel,args:{x:m.current,y:p.current}}),g.current=!1}),n.on("drag",function(r){var f=o.origin.scrCoords;let[C,_,P,X]=o.getBoundingBox(),w=n.size[0]/o.unitX,J=n.size[1]/o.unitY,E=b.current[0],G=b.current[1],v=0;E==="middle"?v=-w/2:E==="right"&&(v=-w);let A=0;G==="middle"?A=-J/2:G==="top"&&(A=-J);let T=C+.04*(P-C)-v-w,z=P-.04*(P-C)-v,V=X+.04*(_-X)-A-J,k=_-.04*(_-X)-A;m.current=(F.current[1]+r.x-h.current[0]-f[1])/o.unitX,m.current=Math.min(z,Math.max(T,m.current)),p.current=(f[2]-(F.current[2]+r.y-h.current[1]))/o.unitY,p.current=Math.min(k,Math.max(V,p.current)),O({action:L.moveLabel,args:{x:m.current,y:p.current,transient:!0,skippable:!0}}),n.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,[0,0]),u.coords.setCoordinates(JXG.COORDS_BY_USER,S.current),(Math.abs(r.x-h.current[0])>.1||Math.abs(r.y-h.current[1])>.1)&&(g.current=!0)}),t.current=n,x.current=u,R.current=e.positionFromAnchor,e.hasLatex&&setTimeout(()=>{t.current&&(t.current.needsUpdate=!0,t.current.setText(e.value),t.current.update(),o==null||o.updateRenderer())},1e3)}if(o){let s;try{let i=M.fromAst(e.anchor);s=[i.get_component(0).evaluate_to_constant(),i.get_component(1).evaluate_to_constant()]}catch{s=[NaN,NaN]}if(S.current=s,t.current===null)D();else{t.current.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,[0,0]),x.current.coords.setCoordinates(JXG.COORDS_BY_USER,s),t.current.setText(e.value);let i=!e.hidden;if(Number.isFinite(s[0])&&Number.isFinite(s[1])){let n=t.current.visProp.visible!==i;t.current.visProp.visible=i,t.current.visPropCalc.visible=i,n&&t.current.setAttribute({visible:i})}else t.current.visProp.visible=!1,t.current.visPropCalc.visible=!1;let u=10*e.layer+N;t.current.visProp.layer!==u&&t.current.setAttribute({layer:u});let l=!e.draggable||e.fixed;if(t.current.visProp.highlight=!l,t.current.visProp.fixed=l,t.current.needsUpdate=!0,e.positionFromAnchor!==R.current){let n,r;e.positionFromAnchor==="center"?(n="middle",r="middle"):e.positionFromAnchor==="lowerleft"?(n="right",r="top"):e.positionFromAnchor==="lowerright"?(n="left",r="top"):e.positionFromAnchor==="upperleft"?(n="right",r="bottom"):e.positionFromAnchor==="upperright"?(n="left",r="bottom"):e.positionFromAnchor==="bottom"?(n="middle",r="top"):e.positionFromAnchor==="top"?(n="middle",r="bottom"):e.positionFromAnchor==="right"?(n="left",r="middle"):(n="right",r="middle"),t.current.visProp.anchorx=n,t.current.visProp.anchory=r,b.current=[n,r],R.current=e.positionFromAnchor,t.current.fullUpdate()}else t.current.update();x.current.needsUpdate=!0,x.current.update(),o.updateRenderer()}return y("a",{name:d})}if(e.hidden)return null;if(j.length>0)return U("span",{id:d,style:{marginRight:"12px"},children:[y("a",{name:d}),j]});{let s=e.value;return e.hasLatex&&(s=y(H.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:s})),U("span",{id:d,children:[y("a",{name:d}),s]})}});export{te as default}; diff --git a/dist/assets/legend-78658a1d.js b/dist/assets/legend-4044edd9.js similarity index 90% rename from dist/assets/legend-78658a1d.js rename to dist/assets/legend-4044edd9.js index 900e63474f..70265ce3aa 100644 --- a/dist/assets/legend-78658a1d.js +++ b/dist/assets/legend-4044edd9.js @@ -1 +1 @@ -import{av as Y,bn as w,r as g,bw as J,j as R,F as L}from"./index-99a56692.js";import{BoardContext as G}from"./graph-57e1e537.js";import"./css-14ccef8c.js";import"./visibility-sensor-55e75ed1.js";const N=Y.memo(function(k){let{name:W,id:_,SVs:n}=w(k);const a=g.useContext(G);let c=g.useRef([]),d=g.useRef([]),b=g.useRef(null),E=g.useRef(null),v=g.useRef(null);g.useEffect(()=>()=>{U()},[]);function B(){let{xmin:f,xmax:m,ymin:x,ymax:S}=n.graphLimits,s=(S-x)*.06,i=(m-f)*.05,C=(m-f)*.02,t=f+(m-f)*.05,O;n.position.slice(0,5)==="upper"?O=x+(S-x)*.95:O=x+(S-x)*.05+s*n.legendElements.length;let y=n.position.slice(n.position.length-5,n.position.length)==="right";c.current=[],d.current=[];let u=0,D=!1;for(let[o,e]of n.legendElements.entries())if(e.label){let r=O-o*s,l={fixed:!0,highlight:!1};e.label.hasLatex&&(l.useMathJax=!0,l.parse=!1,D=!0);let p=a.create("text",[t+i+C,r,e.label.value],l);d.current.push(p),u=Math.max(u,p.rendNode.offsetWidth)}u/=a.unitX,y&&(t=Math.max(t,m-i-3*C-u));for(let[o,e]of n.legendElements.entries()){let r=O-o*s;if(e.swatchType==="marker"){let l={fillColor:e.markerColor,fillOpacity:e.lineOpacity,strokeColor:"none",size:e.markerSize,face:M(e.markerStyle),fixed:!0,highlight:!1,withLabel:!1,showInfoBox:!1},p=a.create("point",[t+i/2,r],l);c.current.push(p)}else if(e.swatchType==="rectangle"){let l={fillColor:e.filled?e.fillColor.toLowerCase():"none",fillOpacity:e.fillOpacity,fixed:!0,highlight:!1,vertices:{visible:!1},borders:{strokeColor:e.lineColor,strokeWidth:e.lineWidth,strokeOpacity:e.lineOpacity,dash:X(e.lineStyle),fixed:!0,highlight:!1}},p=a.create("polygon",[[t,r+s/4],[t+i,r+s/4],[t+i,r-s/4],[t,r-s/4]],l);c.current.push(p)}else{let l={strokeColor:e.lineColor,strokeWidth:e.lineWidth,strokeOpacity:e.lineOpacity,dash:X(e.lineStyle),fixed:!0,highlight:!1},p=a.create("segment",[[t,r],[t+i,r]],l);c.current.push(p)}y&&e.label&&d.current[o].coords.setCoordinates(JXG.COORDS_BY_USER,[t+i+C,r])}y&&D&&MathJax.Hub.Queue(()=>{u=0;for(let o of d.current)u=Math.max(u,o.rendNode.offsetWidth);u/=a.unitX,t=Math.max(t,m-i-3*C-u);for(let[o,e]of c.current.entries()){let r=O-o*s;if(e.elType==="point")e.coords.setCoordinates(JXG.COORDS_BY_USER,[t+i/2,r]),e.needsUpdate=!0,e.update();else if(e.elType==="polygon"){e.vertices[0].coords.setCoordinates(JXG.COORDS_BY_USER,[t,r+s/4]),e.vertices[1].coords.setCoordinates(JXG.COORDS_BY_USER,[t+i,r+s/4]),e.vertices[2].coords.setCoordinates(JXG.COORDS_BY_USER,[t+i,r-s/4]),e.vertices[3].coords.setCoordinates(JXG.COORDS_BY_USER,[t,r-s/4]);for(let l=0;l<4;l++)e.vertices[l].needsUpdate=!0,e.vertices[l].update(),e.borders[l].needsUpdate=!0,e.borders[l].update();e.needsUpdate=!0,e.update()}else e.point1.coords.setCoordinates(JXG.COORDS_BY_USER,[t,r]),e.point2.coords.setCoordinates(JXG.COORDS_BY_USER,[t+i,r]),e.needsUpdate=!0,e.update();d.current[o]&&(d.current[o].coords.setCoordinates(JXG.COORDS_BY_USER,[t+i+C,r]),d.current[o].needsUpdate=!0,d.current[o].update())}a.updateRenderer()})}function U(){for(let f of c.current)a.removeObject(f);for(let f of d.current)a.removeObject(f);c.current=[],d.current=[]}return a?((!J(b.current,n.legendElements)||!J(v.current,n.graphLimits)||E.current!==n.position)&&(c.current.length>0&&U(),B()),b.current=[...n.legendElements],v.current=Object.assign({},n.graphLimits),E.current=n.position,R(L,{children:R("a",{name:_})})):n.hidden?null:R(L,{children:R("a",{name:_})})});function X(h){return h==="dashed"?2:h==="solid"?0:h==="dotted"?1:0}function M(h){return h==="triangle"?"triangleup":h}export{N as default}; +import{av as Y,bp as G,r as g,by as J,j as R,F as L}from"./index-7074710c.js";import{BoardContext as w}from"./graph-71cec529.js";import"./css-14ccef8c.js";import"./visibility-sensor-7d414852.js";const N=Y.memo(function(k){let{name:W,id:_,SVs:n}=G(k);const a=g.useContext(w);let c=g.useRef([]),d=g.useRef([]),b=g.useRef(null),E=g.useRef(null),v=g.useRef(null);g.useEffect(()=>()=>{U()},[]);function B(){let{xmin:f,xmax:m,ymin:x,ymax:S}=n.graphLimits,s=(S-x)*.06,i=(m-f)*.05,C=(m-f)*.02,t=f+(m-f)*.05,O;n.position.slice(0,5)==="upper"?O=x+(S-x)*.95:O=x+(S-x)*.05+s*n.legendElements.length;let y=n.position.slice(n.position.length-5,n.position.length)==="right";c.current=[],d.current=[];let u=0,D=!1;for(let[o,e]of n.legendElements.entries())if(e.label){let r=O-o*s,l={fixed:!0,highlight:!1};e.label.hasLatex&&(l.useMathJax=!0,l.parse=!1,D=!0);let p=a.create("text",[t+i+C,r,e.label.value],l);d.current.push(p),u=Math.max(u,p.rendNode.offsetWidth)}u/=a.unitX,y&&(t=Math.max(t,m-i-3*C-u));for(let[o,e]of n.legendElements.entries()){let r=O-o*s;if(e.swatchType==="marker"){let l={fillColor:e.markerColor,fillOpacity:e.lineOpacity,strokeColor:"none",size:e.markerSize,face:M(e.markerStyle),fixed:!0,highlight:!1,withLabel:!1,showInfoBox:!1},p=a.create("point",[t+i/2,r],l);c.current.push(p)}else if(e.swatchType==="rectangle"){let l={fillColor:e.filled?e.fillColor.toLowerCase():"none",fillOpacity:e.fillOpacity,fixed:!0,highlight:!1,vertices:{visible:!1},borders:{strokeColor:e.lineColor,strokeWidth:e.lineWidth,strokeOpacity:e.lineOpacity,dash:X(e.lineStyle),fixed:!0,highlight:!1}},p=a.create("polygon",[[t,r+s/4],[t+i,r+s/4],[t+i,r-s/4],[t,r-s/4]],l);c.current.push(p)}else{let l={strokeColor:e.lineColor,strokeWidth:e.lineWidth,strokeOpacity:e.lineOpacity,dash:X(e.lineStyle),fixed:!0,highlight:!1},p=a.create("segment",[[t,r],[t+i,r]],l);c.current.push(p)}y&&e.label&&d.current[o].coords.setCoordinates(JXG.COORDS_BY_USER,[t+i+C,r])}y&&D&&MathJax.Hub.Queue(()=>{u=0;for(let o of d.current)u=Math.max(u,o.rendNode.offsetWidth);u/=a.unitX,t=Math.max(t,m-i-3*C-u);for(let[o,e]of c.current.entries()){let r=O-o*s;if(e.elType==="point")e.coords.setCoordinates(JXG.COORDS_BY_USER,[t+i/2,r]),e.needsUpdate=!0,e.update();else if(e.elType==="polygon"){e.vertices[0].coords.setCoordinates(JXG.COORDS_BY_USER,[t,r+s/4]),e.vertices[1].coords.setCoordinates(JXG.COORDS_BY_USER,[t+i,r+s/4]),e.vertices[2].coords.setCoordinates(JXG.COORDS_BY_USER,[t+i,r-s/4]),e.vertices[3].coords.setCoordinates(JXG.COORDS_BY_USER,[t,r-s/4]);for(let l=0;l<4;l++)e.vertices[l].needsUpdate=!0,e.vertices[l].update(),e.borders[l].needsUpdate=!0,e.borders[l].update();e.needsUpdate=!0,e.update()}else e.point1.coords.setCoordinates(JXG.COORDS_BY_USER,[t,r]),e.point2.coords.setCoordinates(JXG.COORDS_BY_USER,[t+i,r]),e.needsUpdate=!0,e.update();d.current[o]&&(d.current[o].coords.setCoordinates(JXG.COORDS_BY_USER,[t+i+C,r]),d.current[o].needsUpdate=!0,d.current[o].update())}a.updateRenderer()})}function U(){for(let f of c.current)a.removeObject(f);for(let f of d.current)a.removeObject(f);c.current=[],d.current=[]}return a?((!J(b.current,n.legendElements)||!J(v.current,n.graphLimits)||E.current!==n.position)&&(c.current.length>0&&U(),B()),b.current=[...n.legendElements],v.current=Object.assign({},n.graphLimits),E.current=n.position,R(L,{children:R("a",{name:_})})):n.hidden?null:R(L,{children:R("a",{name:_})})});function X(h){return h==="dashed"?2:h==="solid"?0:h==="dotted"?1:0}function M(h){return h==="triangle"?"triangleup":h}export{N as default}; diff --git a/dist/assets/line-43a0ad82.js b/dist/assets/line-c1a7164a.js similarity index 95% rename from dist/assets/line-43a0ad82.js rename to dist/assets/line-c1a7164a.js index 75239b695f..50000e7986 100644 --- a/dist/assets/line-43a0ad82.js +++ b/dist/assets/line-c1a7164a.js @@ -1 +1 @@ -import{av as E,bn as W,r as u,l as j,bs as U,j as v,F,a as Y,b9 as B}from"./index-99a56692.js";import{BoardContext as T,LINE_LAYER_OFFSET as J}from"./graph-57e1e537.js";import"./css-14ccef8c.js";import"./visibility-sensor-55e75ed1.js";const z=E.memo(function b(C){var D;let{name:N,id:S,SVs:e,actions:h,callAction:f}=W(C);b.ignoreActionsWithoutCore=!0;const d=u.useContext(T);let t=u.useRef({}),g=u.useRef(!1),k=u.useRef(!1),x=u.useRef(!1),L=u.useRef(null),w=u.useRef(null),p=u.useRef(null),R=u.useRef(null);R.current=e.numericalPoints;const O=j(U);u.useEffect(()=>()=>{Object.keys(t.current).length!==0&&G()},[]);function A(){var y;if(((y=e.numericalPoints)==null?void 0:y.length)!==2||e.numericalPoints.some(r=>r.length!==2)){t.current={};return}let s=!e.draggable||e.fixed,c=e.showLabel&&e.labelForGraph!=="",o=O==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;o=o.toLowerCase();var n={name:e.labelForGraph,visible:!e.hidden,withlabel:c,fixed:s,layer:10*e.layer+J,strokeColor:o,strokeOpacity:e.selectedStyle.lineOpacity,highlightStrokeColor:o,highlightStrokeOpacity:e.selectedStyle.lineOpacity*.5,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,dash:_(e.selectedStyle.lineStyle,e.dashed),highlight:!s};if(c){let r,l,a;e.labelPosition==="upperright"?(a=[5,5],r="left",l="bottom"):e.labelPosition==="upperleft"?(a=[-5,5],r="right",l="bottom"):e.labelPosition==="lowerright"?(a=[5,-5],r="left",l="top"):(a=[-5,-5],r="right",l="top"),n.label={offset:a,anchorx:r,anchory:l,position:"top",highlight:!1},e.labelHasLatex&&(n.label.useMathJax=!0),e.applyStyleToLabel?n.label.strokeColor=o:n.label.strokeColor="var(--canvastext)"}else n.label={highlight:!1},e.labelHasLatex&&(n.label.useMathJax=!0);let m=[[...e.numericalPoints[0]],[...e.numericalPoints[1]]],i=d.create("line",m,n);i.on("drag",function(r){(Math.abs(r.x-g.current[0])>.1||Math.abs(r.y-g.current[1])>.1)&&(x.current=!0),M(r),f({action:h.moveLine,args:{point1coords:p.current[0],point2coords:p.current[1],transient:!0,skippable:!0}}),i.point1.coords.setCoordinates(JXG.COORDS_BY_USER,R.current[0]),i.point2.coords.setCoordinates(JXG.COORDS_BY_USER,R.current[1])}),i.on("up",function(r){x.current?f({action:h.moveLine,args:{point1coords:p.current[0],point2coords:p.current[1]}}):e.switchable&&!e.fixed?(f({action:h.switchLine}),f({action:h.lineClicked})):f({action:h.lineClicked})}),i.on("down",function(r){x.current=!1,g.current=[r.x,r.y],k.current=[[...i.point1.coords.scrCoords],[...i.point2.coords.scrCoords]],f({action:h.mouseDownOnLine})}),L.current=e.showLabel&&e.labelForGraph!=="",t.current=i}function M(s){var c=d.origin.scrCoords;p.current=[];for(let o=0;o<2;o++){let n=(k.current[o][1]+s.x-g.current[0]-c[1])/d.unitX,m=(c[2]-(k.current[o][2]+s.y-g.current[1]))/d.unitY;p.current.push([n,m])}}function G(){t.current.off("drag"),t.current.off("down"),t.current.off("up"),d.removeObject(t.current),t.current={}}if(d){if(Object.keys(t.current).length===0)A();else if(((D=e.numericalPoints)==null?void 0:D.length)!==2||e.numericalPoints.some(s=>s.length!==2))G();else{let s=!0;for(let l of[e.numericalPoints[0],e.numericalPoints[1]])Number.isFinite(l[0])||(s=!1),Number.isFinite(l[1])||(s=!1);t.current.point1.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalPoints[0]),t.current.point2.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalPoints[1]);let c=!e.hidden;if(s){let l=t.current.visProp.visible!==c;t.current.visProp.visible=c,t.current.visPropCalc.visible=c,l&&t.current.setAttribute({visible:c})}else t.current.visProp.visible=!1,t.current.visPropCalc.visible=!1;let o=!e.draggable||e.fixed;t.current.visProp.fixed=o,t.current.visProp.highlight=!o;let n=10*e.layer+J;t.current.visProp.layer!==n&&t.current.setAttribute({layer:n});let i=O==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;i=i.toLowerCase(),t.current.visProp.strokecolor!==i&&(t.current.visProp.strokecolor=i,t.current.visProp.highlightstrokecolor=i),t.current.visProp.strokewidth!==e.selectedStyle.lineWidth&&(t.current.visProp.strokewidth=e.selectedStyle.lineWidth,t.current.visProp.highlightstrokewidth=e.selectedStyle.lineWidth),t.current.visProp.strokeopacity!==e.selectedStyle.lineOpacity&&(t.current.visProp.strokeopacity=e.selectedStyle.lineOpacity,t.current.visProp.highlightstrokeopacity=e.selectedStyle.lineOpacity*.5);let y=_(e.selectedStyle.lineStyle,e.dashed);t.current.visProp.dash!==y&&(t.current.visProp.dash=y),t.current.name=e.labelForGraph;let r=e.showLabel&&e.labelForGraph!=="";if(r!=L.current&&(t.current.setAttribute({withlabel:r}),L.current=r),t.current.needsUpdate=!0,t.current.update(),t.current.hasLabel)if(t.current.label.needsUpdate=!0,e.applyStyleToLabel?t.current.label.visProp.strokecolor=i:t.current.label.visProp.strokecolor="var(--canvastext)",e.labelPosition!==w.current){let l,a,P;e.labelPosition==="upperright"?(P=[5,5],l="left",a="bottom"):e.labelPosition==="upperleft"?(P=[-5,5],l="right",a="bottom"):e.labelPosition==="lowerright"?(P=[5,-5],l="left",a="top"):(P=[-5,-5],l="right",a="top"),t.current.label.visProp.anchorx=l,t.current.label.visProp.anchory=a,t.current.label.visProp.offset=P,w.current=e.labelPosition,t.current.label.fullUpdate()}else t.current.label.update();d.updateRenderer()}return v(F,{children:v("a",{name:S})})}if(e.hidden)return null;let X="\\("+e.latex+"\\)";return Y(F,{children:[v("a",{name:S}),v("span",{id:S,children:v(B.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:X})})]})});function _(b,C){return b==="dashed"||C?2:b==="solid"?0:b==="dotted"?1:0}export{z as default}; +import{av as E,bp as W,r as u,l as j,bu as U,j as v,F,a as Y,b9 as B}from"./index-7074710c.js";import{BoardContext as T,LINE_LAYER_OFFSET as J}from"./graph-71cec529.js";import"./css-14ccef8c.js";import"./visibility-sensor-7d414852.js";const z=E.memo(function b(C){var D;let{name:N,id:S,SVs:e,actions:h,callAction:f}=W(C);b.ignoreActionsWithoutCore=!0;const d=u.useContext(T);let t=u.useRef({}),g=u.useRef(!1),k=u.useRef(!1),x=u.useRef(!1),L=u.useRef(null),w=u.useRef(null),p=u.useRef(null),R=u.useRef(null);R.current=e.numericalPoints;const O=j(U);u.useEffect(()=>()=>{Object.keys(t.current).length!==0&&G()},[]);function A(){var y;if(((y=e.numericalPoints)==null?void 0:y.length)!==2||e.numericalPoints.some(r=>r.length!==2)){t.current={};return}let s=!e.draggable||e.fixed,c=e.showLabel&&e.labelForGraph!=="",o=O==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;o=o.toLowerCase();var n={name:e.labelForGraph,visible:!e.hidden,withlabel:c,fixed:s,layer:10*e.layer+J,strokeColor:o,strokeOpacity:e.selectedStyle.lineOpacity,highlightStrokeColor:o,highlightStrokeOpacity:e.selectedStyle.lineOpacity*.5,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,dash:_(e.selectedStyle.lineStyle,e.dashed),highlight:!s};if(c){let r,l,a;e.labelPosition==="upperright"?(a=[5,5],r="left",l="bottom"):e.labelPosition==="upperleft"?(a=[-5,5],r="right",l="bottom"):e.labelPosition==="lowerright"?(a=[5,-5],r="left",l="top"):(a=[-5,-5],r="right",l="top"),n.label={offset:a,anchorx:r,anchory:l,position:"top",highlight:!1},e.labelHasLatex&&(n.label.useMathJax=!0),e.applyStyleToLabel?n.label.strokeColor=o:n.label.strokeColor="var(--canvastext)"}else n.label={highlight:!1},e.labelHasLatex&&(n.label.useMathJax=!0);let m=[[...e.numericalPoints[0]],[...e.numericalPoints[1]]],i=d.create("line",m,n);i.on("drag",function(r){(Math.abs(r.x-g.current[0])>.1||Math.abs(r.y-g.current[1])>.1)&&(x.current=!0),M(r),f({action:h.moveLine,args:{point1coords:p.current[0],point2coords:p.current[1],transient:!0,skippable:!0}}),i.point1.coords.setCoordinates(JXG.COORDS_BY_USER,R.current[0]),i.point2.coords.setCoordinates(JXG.COORDS_BY_USER,R.current[1])}),i.on("up",function(r){x.current?f({action:h.moveLine,args:{point1coords:p.current[0],point2coords:p.current[1]}}):e.switchable&&!e.fixed?(f({action:h.switchLine}),f({action:h.lineClicked})):f({action:h.lineClicked})}),i.on("down",function(r){x.current=!1,g.current=[r.x,r.y],k.current=[[...i.point1.coords.scrCoords],[...i.point2.coords.scrCoords]],f({action:h.mouseDownOnLine})}),L.current=e.showLabel&&e.labelForGraph!=="",t.current=i}function M(s){var c=d.origin.scrCoords;p.current=[];for(let o=0;o<2;o++){let n=(k.current[o][1]+s.x-g.current[0]-c[1])/d.unitX,m=(c[2]-(k.current[o][2]+s.y-g.current[1]))/d.unitY;p.current.push([n,m])}}function G(){t.current.off("drag"),t.current.off("down"),t.current.off("up"),d.removeObject(t.current),t.current={}}if(d){if(Object.keys(t.current).length===0)A();else if(((D=e.numericalPoints)==null?void 0:D.length)!==2||e.numericalPoints.some(s=>s.length!==2))G();else{let s=!0;for(let l of[e.numericalPoints[0],e.numericalPoints[1]])Number.isFinite(l[0])||(s=!1),Number.isFinite(l[1])||(s=!1);t.current.point1.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalPoints[0]),t.current.point2.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalPoints[1]);let c=!e.hidden;if(s){let l=t.current.visProp.visible!==c;t.current.visProp.visible=c,t.current.visPropCalc.visible=c,l&&t.current.setAttribute({visible:c})}else t.current.visProp.visible=!1,t.current.visPropCalc.visible=!1;let o=!e.draggable||e.fixed;t.current.visProp.fixed=o,t.current.visProp.highlight=!o;let n=10*e.layer+J;t.current.visProp.layer!==n&&t.current.setAttribute({layer:n});let i=O==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;i=i.toLowerCase(),t.current.visProp.strokecolor!==i&&(t.current.visProp.strokecolor=i,t.current.visProp.highlightstrokecolor=i),t.current.visProp.strokewidth!==e.selectedStyle.lineWidth&&(t.current.visProp.strokewidth=e.selectedStyle.lineWidth,t.current.visProp.highlightstrokewidth=e.selectedStyle.lineWidth),t.current.visProp.strokeopacity!==e.selectedStyle.lineOpacity&&(t.current.visProp.strokeopacity=e.selectedStyle.lineOpacity,t.current.visProp.highlightstrokeopacity=e.selectedStyle.lineOpacity*.5);let y=_(e.selectedStyle.lineStyle,e.dashed);t.current.visProp.dash!==y&&(t.current.visProp.dash=y),t.current.name=e.labelForGraph;let r=e.showLabel&&e.labelForGraph!=="";if(r!=L.current&&(t.current.setAttribute({withlabel:r}),L.current=r),t.current.needsUpdate=!0,t.current.update(),t.current.hasLabel)if(t.current.label.needsUpdate=!0,e.applyStyleToLabel?t.current.label.visProp.strokecolor=i:t.current.label.visProp.strokecolor="var(--canvastext)",e.labelPosition!==w.current){let l,a,P;e.labelPosition==="upperright"?(P=[5,5],l="left",a="bottom"):e.labelPosition==="upperleft"?(P=[-5,5],l="right",a="bottom"):e.labelPosition==="lowerright"?(P=[5,-5],l="left",a="top"):(P=[-5,-5],l="right",a="top"),t.current.label.visProp.anchorx=l,t.current.label.visProp.anchory=a,t.current.label.visProp.offset=P,w.current=e.labelPosition,t.current.label.fullUpdate()}else t.current.label.update();d.updateRenderer()}return v(F,{children:v("a",{name:S})})}if(e.hidden)return null;let X="\\("+e.latex+"\\)";return Y(F,{children:[v("a",{name:S}),v("span",{id:S,children:v(B.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:X})})]})});function _(b,C){return b==="dashed"||C?2:b==="solid"?0:b==="dotted"?1:0}export{z as default}; diff --git a/dist/assets/lineSegment-97164a85.js b/dist/assets/lineSegment-3e0035f9.js similarity index 96% rename from dist/assets/lineSegment-97164a85.js rename to dist/assets/lineSegment-3e0035f9.js index e29e25d3f5..013b9e8b97 100644 --- a/dist/assets/lineSegment-97164a85.js +++ b/dist/assets/lineSegment-3e0035f9.js @@ -1 +1 @@ -import{av as T,bn as V,r as d,l as H,bs as N,j as L,F as W}from"./index-99a56692.js";import{BoardContext as q,LINE_LAYER_OFFSET as Y,VERTEX_LAYER_OFFSET as G}from"./graph-57e1e537.js";import"./css-14ccef8c.js";import"./visibility-sensor-55e75ed1.js";const $=T.memo(function C(I){let{name:X,id:_,SVs:e,actions:p,sourceOfUpdate:O,callAction:f}=V(I);C.ignoreActionsWithoutCore=!0;const s=d.useContext(q);let t=d.useRef(null),l=d.useRef(null),i=d.useRef(null),v=d.useRef(!1),R=d.useRef(!1),g=d.useRef(null),E=d.useRef(null),D=d.useRef(null),c=d.useRef(null),S=d.useRef(null),F=d.useRef(null);F.current=e.numericalEndpoints;const J=H(N);d.useEffect(()=>()=>{t.current&&U()},[]);function M(){if(e.numericalEndpoints.length!==2||e.numericalEndpoints.some(r=>r.length!==2)){t.current=null,l.current=null,i.current=null;return}let n=!e.draggable||e.fixed,u=e.showLabel&&e.labelForGraph!=="",a=J==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;a=a.toLowerCase();var h={name:e.labelForGraph,visible:!e.hidden,withlabel:u,fixed:n,layer:10*e.layer+Y,strokeColor:a,strokeOpacity:e.selectedStyle.lineOpacity,highlightStrokeColor:a,highlightStrokeOpacity:e.selectedStyle.lineOpacity*.5,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,dash:j(e.selectedStyle.lineStyle),highlight:!n};if(u){let r,m,o;e.labelPosition==="upperright"?(o=[5,5],r="left",m="bottom"):e.labelPosition==="upperleft"?(o=[-5,5],r="right",m="bottom"):e.labelPosition==="lowerright"?(o=[5,-5],r="left",m="top"):(o=[-5,-5],r="right",m="top"),h.label={offset:o,anchorx:r,anchory:m,highlight:!1},e.labelHasLatex&&(h.label.useMathJax=!0),e.applyStyleToLabel?h.label.strokeColor=a:h.label.strokeColor="var(--canvastext)"}else h.label={highlight:!1},e.labelHasLatex&&(h.label.useMathJax=!0);let k=!(!e.endpointsDraggable||e.fixed)&&!e.hidden,w=Object.assign({},h);Object.assign(w,{withLabel:!1,fixed:!1,highlight:!0,fillColor:"none",strokeColor:"none",highlightStrokeColor:"none",highlightFillColor:getComputedStyle(document.documentElement).getPropertyValue("--mainGray"),layer:10*e.layer+G,showInfoBox:e.showCoordsWhenDragging,visible:k});let b=[[...e.numericalEndpoints[0]],[...e.numericalEndpoints[1]]];return l.current=s.create("point",b[0],w),i.current=s.create("point",b[1],w),t.current=s.create("segment",[l.current,i.current],h),l.current.on("drag",r=>A(1,r)),i.current.on("drag",r=>A(2,r)),t.current.on("drag",r=>A(0,r)),l.current.on("up",()=>{g.current===1?f({action:p.moveLineSegment,args:{point1coords:c.current}}):g.current===null&&f({action:p.lineSegmentClicked}),S.current=null}),i.current.on("up",()=>{g.current===2?f({action:p.moveLineSegment,args:{point2coords:c.current}}):g.current===null&&f({action:p.lineSegmentClicked}),S.current=null}),t.current.on("up",function(r){g.current===0?f({action:p.moveLineSegment,args:{point1coords:c.current[0],point2coords:c.current[1]}}):g.current===null&&S.current===null&&f({action:p.lineSegmentClicked})}),l.current.on("down",r=>{g.current=null,v.current=[r.x,r.y],S.current=1,f({action:p.mouseDownOnLineSegment})}),i.current.on("down",r=>{g.current=null,v.current=[r.x,r.y],S.current=2,f({action:p.mouseDownOnLineSegment})}),t.current.on("down",function(r){g.current=null,v.current=[r.x,r.y],R.current=[[...l.current.coords.scrCoords],[...i.current.coords.scrCoords]],S.current===null&&f({action:p.mouseDownOnLineSegment})}),D.current=e.labelPosition,E.current=u,t.current}function A(n,u){(Math.abs(u.x-v.current[0])>.1||Math.abs(u.y-v.current[1])>.1)&&(g.current=n,n==1?(c.current=[t.current.point1.X(),t.current.point1.Y()],f({action:p.moveLineSegment,args:{point1coords:c.current,transient:!0,skippable:!0,sourceDetails:{endpoint:n}}})):n==2?(c.current=[t.current.point2.X(),t.current.point2.Y()],f({action:p.moveLineSegment,args:{point2coords:c.current,transient:!0,skippable:!0,sourceDetails:{endpoint:n}}})):(B(u),f({action:p.moveLineSegment,args:{point1coords:c.current[0],point2coords:c.current[1],transient:!0,skippable:!0}}))),t.current.point1.coords.setCoordinates(JXG.COORDS_BY_USER,F.current[0]),t.current.point2.coords.setCoordinates(JXG.COORDS_BY_USER,F.current[1]),n==1?s.updateInfobox(t.current.point1):n==2&&s.updateInfobox(t.current.point2)}function B(n){var u=s.origin.scrCoords;c.current=[];for(let a=0;a<2;a++){let h=(R.current[a][1]+n.x-v.current[0]-u[1])/s.unitX,y=(u[2]-(R.current[a][2]+n.y-v.current[1]))/s.unitY;c.current.push([h,y])}return c.current}function U(){t.current.off("drag"),t.current.off("down"),t.current.off("up"),s.removeObject(t.current),t.current=null,l.current.off("drag"),l.current.off("down"),l.current.off("up"),s.removeObject(l.current),l.current=null,i.current.off("drag"),i.current.off("down"),i.current.off("up"),s.removeObject(i.current),i.current=null}if(s){if(t.current===null)M();else if(e.numericalEndpoints.length!==2||e.numericalEndpoints.some(n=>n.length!==2))U();else{let n=!0;for(let o of[e.numericalEndpoints[0],e.numericalEndpoints[1]])Number.isFinite(o[0])||(n=!1),Number.isFinite(o[1])||(n=!1);if(t.current.point1.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalEndpoints[0]),t.current.point2.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalEndpoints[1]),O.sourceInformation&&X in O.sourceInformation){let o=O.sourceInformation[X].endpoint;o===1?s.updateInfobox(t.current.point1):o===2&&s.updateInfobox(t.current.point2)}let u=!e.hidden&&n;if(n){let o=t.current.visProp.visible!==u;t.current.visProp.visible=u,t.current.visPropCalc.visible=u,o&&t.current.setAttribute({visible:u})}else t.current.visProp.visible=!1,t.current.visPropCalc.visible=!1;let a=!e.draggable||e.fixed,y=!(!e.endpointsDraggable||e.fixed)&&u;l.current.visProp.visible=y,l.current.visPropCalc.visible=y,i.current.visProp.visible=y,i.current.visPropCalc.visible=y,t.current.visProp.fixed=a,t.current.visProp.highlight=!a;let k=10*e.layer+Y;t.current.visProp.layer!==k&&(t.current.setAttribute({layer:k}),l.current.setAttribute({layer:10*e.layer+G}),i.current.setAttribute({layer:10*e.layer+G}));let b=J==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;b=b.toLowerCase(),t.current.visProp.strokecolor!==b&&(t.current.visProp.strokecolor=b,t.current.visProp.highlightstrokecolor=b),t.current.visProp.strokewidth!==e.selectedStyle.lineWidth&&(t.current.visProp.strokewidth=e.selectedStyle.lineWidth,t.current.visProp.highlightstrokewidth=e.selectedStyle.lineWidth),t.current.visProp.strokeopacity!==e.selectedStyle.lineOpacity&&(t.current.visProp.strokeopacity=e.selectedStyle.lineOpacity,t.current.visProp.highlightstrokeopacity=e.selectedStyle.lineOpacity*.5);let r=j(e.selectedStyle.lineStyle);t.current.visProp.dash!==r&&(t.current.visProp.dash=r),t.current.name=e.labelForGraph;let m=e.showLabel&&e.labelForGraph!=="";if(m!=E.current&&(t.current.setAttribute({withlabel:m}),E.current=m),t.current.needsUpdate=!0,t.current.update(),t.current.hasLabel)if(t.current.label.needsUpdate=!0,e.applyStyleToLabel?t.current.label.visProp.strokecolor=b:t.current.label.visProp.strokecolor="var(--canvastext)",e.labelPosition!==D.current){let o,P,x;e.labelPosition==="upperright"?(x=[5,5],o="left",P="bottom"):e.labelPosition==="upperleft"?(x=[-5,5],o="right",P="bottom"):e.labelPosition==="lowerright"?(x=[5,-5],o="left",P="top"):(x=[-5,-5],o="right",P="top"),t.current.label.visProp.anchorx=o,t.current.label.visProp.anchory=P,t.current.label.visProp.offset=x,D.current=e.labelPosition,t.current.label.fullUpdate()}else t.current.label.update();l.current.needsUpdate=!0,l.current.update(),i.current.needsUpdate=!0,i.current.update(),s.updateRenderer()}return L(W,{children:L("a",{name:_})})}return e.hidden?null:L(W,{children:L("a",{name:_})})});function j(C){return C==="solid"?0:C==="dashed"?2:C==="dotted"?1:0}export{$ as default}; +import{av as T,bp as V,r as d,l as H,bu as N,j as L,F as W}from"./index-7074710c.js";import{BoardContext as q,LINE_LAYER_OFFSET as Y,VERTEX_LAYER_OFFSET as G}from"./graph-71cec529.js";import"./css-14ccef8c.js";import"./visibility-sensor-7d414852.js";const $=T.memo(function C(I){let{name:X,id:_,SVs:e,actions:p,sourceOfUpdate:O,callAction:f}=V(I);C.ignoreActionsWithoutCore=!0;const s=d.useContext(q);let t=d.useRef(null),l=d.useRef(null),i=d.useRef(null),v=d.useRef(!1),R=d.useRef(!1),g=d.useRef(null),E=d.useRef(null),D=d.useRef(null),c=d.useRef(null),S=d.useRef(null),F=d.useRef(null);F.current=e.numericalEndpoints;const J=H(N);d.useEffect(()=>()=>{t.current&&U()},[]);function M(){if(e.numericalEndpoints.length!==2||e.numericalEndpoints.some(r=>r.length!==2)){t.current=null,l.current=null,i.current=null;return}let n=!e.draggable||e.fixed,u=e.showLabel&&e.labelForGraph!=="",a=J==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;a=a.toLowerCase();var h={name:e.labelForGraph,visible:!e.hidden,withlabel:u,fixed:n,layer:10*e.layer+Y,strokeColor:a,strokeOpacity:e.selectedStyle.lineOpacity,highlightStrokeColor:a,highlightStrokeOpacity:e.selectedStyle.lineOpacity*.5,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,dash:j(e.selectedStyle.lineStyle),highlight:!n};if(u){let r,m,o;e.labelPosition==="upperright"?(o=[5,5],r="left",m="bottom"):e.labelPosition==="upperleft"?(o=[-5,5],r="right",m="bottom"):e.labelPosition==="lowerright"?(o=[5,-5],r="left",m="top"):(o=[-5,-5],r="right",m="top"),h.label={offset:o,anchorx:r,anchory:m,highlight:!1},e.labelHasLatex&&(h.label.useMathJax=!0),e.applyStyleToLabel?h.label.strokeColor=a:h.label.strokeColor="var(--canvastext)"}else h.label={highlight:!1},e.labelHasLatex&&(h.label.useMathJax=!0);let k=!(!e.endpointsDraggable||e.fixed)&&!e.hidden,w=Object.assign({},h);Object.assign(w,{withLabel:!1,fixed:!1,highlight:!0,fillColor:"none",strokeColor:"none",highlightStrokeColor:"none",highlightFillColor:getComputedStyle(document.documentElement).getPropertyValue("--mainGray"),layer:10*e.layer+G,showInfoBox:e.showCoordsWhenDragging,visible:k});let b=[[...e.numericalEndpoints[0]],[...e.numericalEndpoints[1]]];return l.current=s.create("point",b[0],w),i.current=s.create("point",b[1],w),t.current=s.create("segment",[l.current,i.current],h),l.current.on("drag",r=>A(1,r)),i.current.on("drag",r=>A(2,r)),t.current.on("drag",r=>A(0,r)),l.current.on("up",()=>{g.current===1?f({action:p.moveLineSegment,args:{point1coords:c.current}}):g.current===null&&f({action:p.lineSegmentClicked}),S.current=null}),i.current.on("up",()=>{g.current===2?f({action:p.moveLineSegment,args:{point2coords:c.current}}):g.current===null&&f({action:p.lineSegmentClicked}),S.current=null}),t.current.on("up",function(r){g.current===0?f({action:p.moveLineSegment,args:{point1coords:c.current[0],point2coords:c.current[1]}}):g.current===null&&S.current===null&&f({action:p.lineSegmentClicked})}),l.current.on("down",r=>{g.current=null,v.current=[r.x,r.y],S.current=1,f({action:p.mouseDownOnLineSegment})}),i.current.on("down",r=>{g.current=null,v.current=[r.x,r.y],S.current=2,f({action:p.mouseDownOnLineSegment})}),t.current.on("down",function(r){g.current=null,v.current=[r.x,r.y],R.current=[[...l.current.coords.scrCoords],[...i.current.coords.scrCoords]],S.current===null&&f({action:p.mouseDownOnLineSegment})}),D.current=e.labelPosition,E.current=u,t.current}function A(n,u){(Math.abs(u.x-v.current[0])>.1||Math.abs(u.y-v.current[1])>.1)&&(g.current=n,n==1?(c.current=[t.current.point1.X(),t.current.point1.Y()],f({action:p.moveLineSegment,args:{point1coords:c.current,transient:!0,skippable:!0,sourceDetails:{endpoint:n}}})):n==2?(c.current=[t.current.point2.X(),t.current.point2.Y()],f({action:p.moveLineSegment,args:{point2coords:c.current,transient:!0,skippable:!0,sourceDetails:{endpoint:n}}})):(B(u),f({action:p.moveLineSegment,args:{point1coords:c.current[0],point2coords:c.current[1],transient:!0,skippable:!0}}))),t.current.point1.coords.setCoordinates(JXG.COORDS_BY_USER,F.current[0]),t.current.point2.coords.setCoordinates(JXG.COORDS_BY_USER,F.current[1]),n==1?s.updateInfobox(t.current.point1):n==2&&s.updateInfobox(t.current.point2)}function B(n){var u=s.origin.scrCoords;c.current=[];for(let a=0;a<2;a++){let h=(R.current[a][1]+n.x-v.current[0]-u[1])/s.unitX,y=(u[2]-(R.current[a][2]+n.y-v.current[1]))/s.unitY;c.current.push([h,y])}return c.current}function U(){t.current.off("drag"),t.current.off("down"),t.current.off("up"),s.removeObject(t.current),t.current=null,l.current.off("drag"),l.current.off("down"),l.current.off("up"),s.removeObject(l.current),l.current=null,i.current.off("drag"),i.current.off("down"),i.current.off("up"),s.removeObject(i.current),i.current=null}if(s){if(t.current===null)M();else if(e.numericalEndpoints.length!==2||e.numericalEndpoints.some(n=>n.length!==2))U();else{let n=!0;for(let o of[e.numericalEndpoints[0],e.numericalEndpoints[1]])Number.isFinite(o[0])||(n=!1),Number.isFinite(o[1])||(n=!1);if(t.current.point1.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalEndpoints[0]),t.current.point2.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalEndpoints[1]),O.sourceInformation&&X in O.sourceInformation){let o=O.sourceInformation[X].endpoint;o===1?s.updateInfobox(t.current.point1):o===2&&s.updateInfobox(t.current.point2)}let u=!e.hidden&&n;if(n){let o=t.current.visProp.visible!==u;t.current.visProp.visible=u,t.current.visPropCalc.visible=u,o&&t.current.setAttribute({visible:u})}else t.current.visProp.visible=!1,t.current.visPropCalc.visible=!1;let a=!e.draggable||e.fixed,y=!(!e.endpointsDraggable||e.fixed)&&u;l.current.visProp.visible=y,l.current.visPropCalc.visible=y,i.current.visProp.visible=y,i.current.visPropCalc.visible=y,t.current.visProp.fixed=a,t.current.visProp.highlight=!a;let k=10*e.layer+Y;t.current.visProp.layer!==k&&(t.current.setAttribute({layer:k}),l.current.setAttribute({layer:10*e.layer+G}),i.current.setAttribute({layer:10*e.layer+G}));let b=J==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;b=b.toLowerCase(),t.current.visProp.strokecolor!==b&&(t.current.visProp.strokecolor=b,t.current.visProp.highlightstrokecolor=b),t.current.visProp.strokewidth!==e.selectedStyle.lineWidth&&(t.current.visProp.strokewidth=e.selectedStyle.lineWidth,t.current.visProp.highlightstrokewidth=e.selectedStyle.lineWidth),t.current.visProp.strokeopacity!==e.selectedStyle.lineOpacity&&(t.current.visProp.strokeopacity=e.selectedStyle.lineOpacity,t.current.visProp.highlightstrokeopacity=e.selectedStyle.lineOpacity*.5);let r=j(e.selectedStyle.lineStyle);t.current.visProp.dash!==r&&(t.current.visProp.dash=r),t.current.name=e.labelForGraph;let m=e.showLabel&&e.labelForGraph!=="";if(m!=E.current&&(t.current.setAttribute({withlabel:m}),E.current=m),t.current.needsUpdate=!0,t.current.update(),t.current.hasLabel)if(t.current.label.needsUpdate=!0,e.applyStyleToLabel?t.current.label.visProp.strokecolor=b:t.current.label.visProp.strokecolor="var(--canvastext)",e.labelPosition!==D.current){let o,P,x;e.labelPosition==="upperright"?(x=[5,5],o="left",P="bottom"):e.labelPosition==="upperleft"?(x=[-5,5],o="right",P="bottom"):e.labelPosition==="lowerright"?(x=[5,-5],o="left",P="top"):(x=[-5,-5],o="right",P="top"),t.current.label.visProp.anchorx=o,t.current.label.visProp.anchory=P,t.current.label.visProp.offset=x,D.current=e.labelPosition,t.current.label.fullUpdate()}else t.current.label.update();l.current.needsUpdate=!0,l.current.update(),i.current.needsUpdate=!0,i.current.update(),s.updateRenderer()}return L(W,{children:L("a",{name:_})})}return e.hidden?null:L(W,{children:L("a",{name:_})})});function j(C){return C==="solid"?0:C==="dashed"?2:C==="dotted"?1:0}export{$ as default}; diff --git a/dist/assets/list-6cb6dea9.js b/dist/assets/list-6bbf4bcf.js similarity index 82% rename from dist/assets/list-6cb6dea9.js rename to dist/assets/list-6bbf4bcf.js index 8070e0d624..80af8c891f 100644 --- a/dist/assets/list-6cb6dea9.js +++ b/dist/assets/list-6bbf4bcf.js @@ -1 +1 @@ -import{av as h,bn as y,r as b,j as e,a as s,F as o}from"./index-99a56692.js";import{V as u}from"./visibility-sensor-55e75ed1.js";const C=h.memo(function(m){let{name:f,id:i,SVs:l,children:t,actions:c,callAction:d}=y(m),a=r=>{d({action:c.recordVisibilityChange,args:{isVisible:r}})};if(b.useEffect(()=>()=>{d({action:c.recordVisibilityChange,args:{isVisible:!1}})},[]),l.hidden)return null;if(l.item)return e(u,{partialVisibility:!0,onChange:a,requireContentsSize:!1,children:s(o,{children:[e("a",{name:i}),e("li",{id:i,children:t})]})});if(l.numbered){let r=n.numbered[(l.level-1)%n.numbered.length];return e(u,{partialVisibility:!0,onChange:a,children:e(o,{children:s("ol",{id:i,style:{listStyleType:r},children:[e("a",{name:i}),t]})})})}else{let r=n.unnumbered[(l.level-1)%n.unnumbered.length];return e(u,{partialVisibility:!0,onChange:a,children:e(o,{children:s("ul",{id:i,style:{listStyleType:r},children:[e("a",{name:i}),t]})})})}}),n={numbered:["decimal","lower-alpha","lower-roman","upper-alpha","upper-roman"],unnumbered:["disc","circle","square"]};export{C as default}; +import{av as h,bp as y,r as p,j as e,a as s,F as o}from"./index-7074710c.js";import{V as u}from"./visibility-sensor-7d414852.js";const C=h.memo(function(m){let{name:f,id:i,SVs:l,children:t,actions:c,callAction:d}=y(m),a=r=>{d({action:c.recordVisibilityChange,args:{isVisible:r}})};if(p.useEffect(()=>()=>{d({action:c.recordVisibilityChange,args:{isVisible:!1}})},[]),l.hidden)return null;if(l.item)return e(u,{partialVisibility:!0,onChange:a,requireContentsSize:!1,children:s(o,{children:[e("a",{name:i}),e("li",{id:i,children:t})]})});if(l.numbered){let r=n.numbered[(l.level-1)%n.numbered.length];return e(u,{partialVisibility:!0,onChange:a,children:e(o,{children:s("ol",{id:i,style:{listStyleType:r},children:[e("a",{name:i}),t]})})})}else{let r=n.unnumbered[(l.level-1)%n.unnumbered.length];return e(u,{partialVisibility:!0,onChange:a,children:e(o,{children:s("ul",{id:i,style:{listStyleType:r},children:[e("a",{name:i}),t]})})})}}),n={numbered:["decimal","lower-alpha","lower-roman","upper-alpha","upper-roman"],unnumbered:["disc","circle","square"]};export{C as default}; diff --git a/dist/assets/math-7187d78d.js b/dist/assets/math-52fe5cc4.js similarity index 95% rename from dist/assets/math-7187d78d.js rename to dist/assets/math-52fe5cc4.js index 27d4f5d28e..89c95f4923 100644 --- a/dist/assets/math-7187d78d.js +++ b/dist/assets/math-52fe5cc4.js @@ -1 +1 @@ -import{av as Z,bn as ee,r as u,bo as W,j as h,a as F,F as D,b9 as E}from"./index-99a56692.js";import{BoardContext as te,TEXT_LAYER_OFFSET as $}from"./graph-57e1e537.js";import"./css-14ccef8c.js";import"./visibility-sensor-55e75ed1.js";const se=Z.memo(function z(V){let{name:re,id:p,SVs:e,actions:G,sourceOfUpdate:ne,callAction:Y}=ee(V);z.ignoreActionsWithoutCore=!0;let t=u.useRef(null),M=u.useRef(null),R=u.useRef(null);const a=u.useContext(te);let y=u.useRef(!1),J=u.useRef(!1),_=u.useRef(!1),A=u.useRef(null),v=u.useRef(null),B=u.useRef(null),X=u.useRef(null);u.useEffect(()=>()=>{t.current!==null&&(t.current.off("drag"),t.current.off("down"),t.current.off("up"),a==null||a.removeObject(t.current),t.current=null)},[]);function k(){let o=!e.draggable||e.fixed,i={visible:!e.hidden,fixed:o,layer:10*e.layer+$,highlight:!o,useMathJax:!0,parse:!1},c;try{let r=W.fromAst(e.anchor),m=[r.get_component(0).evaluate_to_constant(),r.get_component(1).evaluate_to_constant()];Number.isFinite(m[0])||(m[0]=0,i.visible=!1),Number.isFinite(m[1])||(m[1]=0,i.visible=!1),c=a.create("point",m,{visible:!1})}catch{i.visible=!1,c=a.create("point",[0,0],{visible:!1})}i.anchor=c;let l,s;e.positionFromAnchor==="center"?(l="middle",s="middle"):e.positionFromAnchor==="lowerleft"?(l="right",s="top"):e.positionFromAnchor==="lowerright"?(l="left",s="top"):e.positionFromAnchor==="upperleft"?(l="right",s="bottom"):e.positionFromAnchor==="upperright"?(l="left",s="bottom"):e.positionFromAnchor==="bottom"?(l="middle",s="top"):e.positionFromAnchor==="top"?(l="middle",s="bottom"):e.positionFromAnchor==="right"?(l="left",s="middle"):(l="right",s="middle"),i.anchorx=l,i.anchory=s,R.current=[l,s];let f,d;e.renderMode==="inline"?(f="\\(",d="\\)"):e.renderMode==="display"?(f="\\[",d="\\]"):e.renderMode==="numbered"?(f=`\\begin{gather}\\tag{${e.equationTag}}`,d="\\end{gather}"):e.renderMode==="align"?(f="\\begin{align}",d="\\end{align}"):(f="\\(",d="\\)");let n=a.create("text",[0,0,f+e.latex+d],i);n.on("down",function(r){y.current=[r.x,r.y],J.current=[...c.coords.scrCoords],_.current=!1}),n.on("up",function(r){_.current&&Y({action:G.moveMath,args:{x:A.current,y:v.current}}),_.current=!1}),n.on("drag",function(r){var m=a.origin.scrCoords;let[O,T,U,j]=a.getBoundingBox(),N=n.size[0]/a.unitX,S=n.size[1]/a.unitY,q=R.current[0],I=R.current[1],P=0;q==="middle"?P=-N/2:q==="right"&&(P=-N);let w=0;I==="middle"?w=-S/2:I==="top"&&(w=-S);let L=O+.04*(U-O)-P-N,H=U-.04*(U-O)-P,K=j+.04*(T-j)-w-S,Q=T-.04*(T-j)-w;A.current=(J.current[1]+r.x-y.current[0]-m[1])/a.unitX,A.current=Math.min(H,Math.max(L,A.current)),v.current=(m[2]-(J.current[2]+r.y-y.current[1]))/a.unitY,v.current=Math.min(Q,Math.max(K,v.current)),Y({action:G.moveMath,args:{x:A.current,y:v.current,transient:!0,skippable:!0}}),n.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,[0,0]),c.coords.setCoordinates(JXG.COORDS_BY_USER,B.current),(Math.abs(r.x-y.current[0])>.1||Math.abs(r.y-y.current[1])>.1)&&(_.current=!0)}),t.current=n,M.current=c,X.current=e.positionFromAnchor,setTimeout(()=>{t.current&&(t.current.needsUpdate=!0,t.current.setText(f+e.latex+d),t.current.update(),a.updateRenderer())},1e3)}if(a){let o;try{let i=W.fromAst(e.anchor);o=[i.get_component(0).evaluate_to_constant(),i.get_component(1).evaluate_to_constant()]}catch{o=[NaN,NaN]}if(B.current=o,t.current===null)k();else{t.current.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,[0,0]),M.current.coords.setCoordinates(JXG.COORDS_BY_USER,o);let i,c;e.renderMode==="inline"?(i="\\(",c="\\)"):e.renderMode==="display"?(i="\\[",c="\\]"):e.renderMode==="numbered"?(i=`\\begin{gather}\\tag{${e.equationTag}}`,c="\\end{gather}"):e.renderMode==="align"?(i="\\begin{align}",c="\\end{align}"):(i="\\(",c="\\)"),t.current.setText(i+e.latex+c);let l=!e.hidden;if(Number.isFinite(o[0])&&Number.isFinite(o[1])){let n=t.current.visProp.visible!==l;t.current.visProp.visible=l,t.current.visPropCalc.visible=l,n&&t.current.setAttribute({visible:l})}else t.current.visProp.visible=!1,t.current.visPropCalc.visible=!1;let s=10*e.layer+$;t.current.visProp.layer!==s&&t.current.setAttribute({layer:s});let d=!e.draggable||e.fixed;if(t.current.visProp.highlight=!d,t.current.visProp.fixed=d,t.current.needsUpdate=!0,e.positionFromAnchor!==X.current){let n,r;e.positionFromAnchor==="center"?(n="middle",r="middle"):e.positionFromAnchor==="lowerleft"?(n="right",r="top"):e.positionFromAnchor==="lowerright"?(n="left",r="top"):e.positionFromAnchor==="upperleft"?(n="right",r="bottom"):e.positionFromAnchor==="upperright"?(n="left",r="bottom"):e.positionFromAnchor==="bottom"?(n="middle",r="top"):e.positionFromAnchor==="top"?(n="middle",r="bottom"):e.positionFromAnchor==="right"?(n="left",r="middle"):(n="right",r="middle"),t.current.visProp.anchorx=n,t.current.visProp.anchory=r,R.current=[n,r],X.current=e.positionFromAnchor,t.current.fullUpdate()}else t.current.update();M.current.needsUpdate=!0,M.current.update(),a.updateRenderer()}return h("a",{name:p})}if(e.hidden)return null;let b,x;if(e.renderMode==="inline"?(b="\\(",x="\\)"):e.renderMode==="display"?(b="\\[",x="\\]"):e.renderMode==="numbered"?(b=`\\begin{gather}\\tag{${e.equationTag}}`,x="\\end{gather}"):e.renderMode==="align"?(b="\\begin{align}",x="\\end{align}"):(b="\\(",x="\\)"),!e.latexWithInputChildren)return null;let g=e.latexWithInputChildren.map(o=>typeof o=="number"?this.children[o]:b+o+x),C=[h("a",{name:p},p)];return e.mrowChildNames&&C.push(...e.mrowChildNames.map(o=>h("a",{name:o,id:o},o))),g.length===0?F(D,{children:[C,h("span",{id:p})]}):g.length===1?F(D,{children:[C,h("span",{id:p,children:h(E.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:g[0]})})]}):g.length===2?F(D,{children:[C,h("span",{id:p,children:F(E.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:[g[0],g[1]]})})]}):F(D,{children:[C,h("span",{id:p,children:h(E.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:g[0]})})]})});export{se as default}; +import{av as Z,bp as ee,r as u,bq as W,j as h,a as F,F as D,b9 as E}from"./index-7074710c.js";import{BoardContext as te,TEXT_LAYER_OFFSET as $}from"./graph-71cec529.js";import"./css-14ccef8c.js";import"./visibility-sensor-7d414852.js";const se=Z.memo(function z(V){let{name:re,id:p,SVs:e,actions:G,sourceOfUpdate:ne,callAction:Y}=ee(V);z.ignoreActionsWithoutCore=!0;let t=u.useRef(null),M=u.useRef(null),R=u.useRef(null);const a=u.useContext(te);let y=u.useRef(!1),J=u.useRef(!1),_=u.useRef(!1),A=u.useRef(null),v=u.useRef(null),B=u.useRef(null),X=u.useRef(null);u.useEffect(()=>()=>{t.current!==null&&(t.current.off("drag"),t.current.off("down"),t.current.off("up"),a==null||a.removeObject(t.current),t.current=null)},[]);function k(){let o=!e.draggable||e.fixed,i={visible:!e.hidden,fixed:o,layer:10*e.layer+$,highlight:!o,useMathJax:!0,parse:!1},c;try{let r=W.fromAst(e.anchor),m=[r.get_component(0).evaluate_to_constant(),r.get_component(1).evaluate_to_constant()];Number.isFinite(m[0])||(m[0]=0,i.visible=!1),Number.isFinite(m[1])||(m[1]=0,i.visible=!1),c=a.create("point",m,{visible:!1})}catch{i.visible=!1,c=a.create("point",[0,0],{visible:!1})}i.anchor=c;let l,s;e.positionFromAnchor==="center"?(l="middle",s="middle"):e.positionFromAnchor==="lowerleft"?(l="right",s="top"):e.positionFromAnchor==="lowerright"?(l="left",s="top"):e.positionFromAnchor==="upperleft"?(l="right",s="bottom"):e.positionFromAnchor==="upperright"?(l="left",s="bottom"):e.positionFromAnchor==="bottom"?(l="middle",s="top"):e.positionFromAnchor==="top"?(l="middle",s="bottom"):e.positionFromAnchor==="right"?(l="left",s="middle"):(l="right",s="middle"),i.anchorx=l,i.anchory=s,R.current=[l,s];let f,d;e.renderMode==="inline"?(f="\\(",d="\\)"):e.renderMode==="display"?(f="\\[",d="\\]"):e.renderMode==="numbered"?(f=`\\begin{gather}\\tag{${e.equationTag}}`,d="\\end{gather}"):e.renderMode==="align"?(f="\\begin{align}",d="\\end{align}"):(f="\\(",d="\\)");let n=a.create("text",[0,0,f+e.latex+d],i);n.on("down",function(r){y.current=[r.x,r.y],J.current=[...c.coords.scrCoords],_.current=!1}),n.on("up",function(r){_.current&&Y({action:G.moveMath,args:{x:A.current,y:v.current}}),_.current=!1}),n.on("drag",function(r){var m=a.origin.scrCoords;let[O,T,U,j]=a.getBoundingBox(),N=n.size[0]/a.unitX,S=n.size[1]/a.unitY,q=R.current[0],I=R.current[1],P=0;q==="middle"?P=-N/2:q==="right"&&(P=-N);let w=0;I==="middle"?w=-S/2:I==="top"&&(w=-S);let L=O+.04*(U-O)-P-N,H=U-.04*(U-O)-P,K=j+.04*(T-j)-w-S,Q=T-.04*(T-j)-w;A.current=(J.current[1]+r.x-y.current[0]-m[1])/a.unitX,A.current=Math.min(H,Math.max(L,A.current)),v.current=(m[2]-(J.current[2]+r.y-y.current[1]))/a.unitY,v.current=Math.min(Q,Math.max(K,v.current)),Y({action:G.moveMath,args:{x:A.current,y:v.current,transient:!0,skippable:!0}}),n.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,[0,0]),c.coords.setCoordinates(JXG.COORDS_BY_USER,B.current),(Math.abs(r.x-y.current[0])>.1||Math.abs(r.y-y.current[1])>.1)&&(_.current=!0)}),t.current=n,M.current=c,X.current=e.positionFromAnchor,setTimeout(()=>{t.current&&(t.current.needsUpdate=!0,t.current.setText(f+e.latex+d),t.current.update(),a.updateRenderer())},1e3)}if(a){let o;try{let i=W.fromAst(e.anchor);o=[i.get_component(0).evaluate_to_constant(),i.get_component(1).evaluate_to_constant()]}catch{o=[NaN,NaN]}if(B.current=o,t.current===null)k();else{t.current.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,[0,0]),M.current.coords.setCoordinates(JXG.COORDS_BY_USER,o);let i,c;e.renderMode==="inline"?(i="\\(",c="\\)"):e.renderMode==="display"?(i="\\[",c="\\]"):e.renderMode==="numbered"?(i=`\\begin{gather}\\tag{${e.equationTag}}`,c="\\end{gather}"):e.renderMode==="align"?(i="\\begin{align}",c="\\end{align}"):(i="\\(",c="\\)"),t.current.setText(i+e.latex+c);let l=!e.hidden;if(Number.isFinite(o[0])&&Number.isFinite(o[1])){let n=t.current.visProp.visible!==l;t.current.visProp.visible=l,t.current.visPropCalc.visible=l,n&&t.current.setAttribute({visible:l})}else t.current.visProp.visible=!1,t.current.visPropCalc.visible=!1;let s=10*e.layer+$;t.current.visProp.layer!==s&&t.current.setAttribute({layer:s});let d=!e.draggable||e.fixed;if(t.current.visProp.highlight=!d,t.current.visProp.fixed=d,t.current.needsUpdate=!0,e.positionFromAnchor!==X.current){let n,r;e.positionFromAnchor==="center"?(n="middle",r="middle"):e.positionFromAnchor==="lowerleft"?(n="right",r="top"):e.positionFromAnchor==="lowerright"?(n="left",r="top"):e.positionFromAnchor==="upperleft"?(n="right",r="bottom"):e.positionFromAnchor==="upperright"?(n="left",r="bottom"):e.positionFromAnchor==="bottom"?(n="middle",r="top"):e.positionFromAnchor==="top"?(n="middle",r="bottom"):e.positionFromAnchor==="right"?(n="left",r="middle"):(n="right",r="middle"),t.current.visProp.anchorx=n,t.current.visProp.anchory=r,R.current=[n,r],X.current=e.positionFromAnchor,t.current.fullUpdate()}else t.current.update();M.current.needsUpdate=!0,M.current.update(),a.updateRenderer()}return h("a",{name:p})}if(e.hidden)return null;let b,x;if(e.renderMode==="inline"?(b="\\(",x="\\)"):e.renderMode==="display"?(b="\\[",x="\\]"):e.renderMode==="numbered"?(b=`\\begin{gather}\\tag{${e.equationTag}}`,x="\\end{gather}"):e.renderMode==="align"?(b="\\begin{align}",x="\\end{align}"):(b="\\(",x="\\)"),!e.latexWithInputChildren)return null;let g=e.latexWithInputChildren.map(o=>typeof o=="number"?this.children[o]:b+o+x),C=[h("a",{name:p},p)];return e.mrowChildNames&&C.push(...e.mrowChildNames.map(o=>h("a",{name:o,id:o},o))),g.length===0?F(D,{children:[C,h("span",{id:p})]}):g.length===1?F(D,{children:[C,h("span",{id:p,children:h(E.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:g[0]})})]}):g.length===2?F(D,{children:[C,h("span",{id:p,children:F(E.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:[g[0],g[1]]})})]}):F(D,{children:[C,h("span",{id:p,children:h(E.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:g[0]})})]})});export{se as default}; diff --git a/dist/assets/mathInput-ff25072a.js b/dist/assets/mathInput-4f892c75.js similarity index 99% rename from dist/assets/mathInput-ff25072a.js rename to dist/assets/mathInput-4f892c75.js index 5f9ec82bc8..b968a39609 100644 --- a/dist/assets/mathInput-ff25072a.js +++ b/dist/assets/mathInput-4f892c75.js @@ -1,4 +1,4 @@ -import{r as sn,aa as hi,bn as mi,R as mr,br as gi,l as Pr,j as de,i as Zn,bp as vi,a0 as bi,aP as yi,bq as xi,a as yn,F as gr,av as qi,s as wi}from"./index-99a56692.js";import{f as ki,a as Ti,p as Ci,h as Oi}from"./MathInputSelector-58bfc077.js";/* empty css */var Jn={},Si={get exports(){return Jn},set exports(Re){Jn=Re}},vr={},ji={get exports(){return vr},set exports(Re){vr=Re}};/*! For license information please see react-mathquill.min.js.LICENSE.txt */(function(Re,zr){(function(Ae,Ot){Re.exports=Ot(sn)})(hi,function(Ae){return(()=>{var Ot={991:(it,pt,X)=>{X.d(pt,{Z:()=>Bt});var M=X(156),ut=X.n(M),ct=X(697),at=X.n(ct),gt=X(700),_t=["latex","onChange","config","mathquillDidMount"];function Pt(){return Pt=Object.assign||function(v){for(var z=1;z=0||(Ue[Le]=re[Le]);return Ue}(a,lt);if(Object.getOwnPropertySymbols){var Tt=Object.getOwnPropertySymbols(a);for(Et=0;Et=0||Object.prototype.propertyIsEnumerable.call(a,Z)&&(qt[Z]=a[Z])}return qt}(v,_t),Nt=(0,M.useRef)(2),yt=(0,M.useRef)(null),kt=(0,M.useRef)(null),s=(0,M.useRef)(D);return(0,M.useEffect)(function(){s.current=D},[D]),(0,M.useEffect)(function(){if(kt.current){var a={restrictMismatchedBrackets:!0,handlers:{}};m&&(a=zt(zt({},a),m));var lt=a.handlers.edit;a.handlers.edit=function(Z){lt&<(),Nt.current>0?Nt.current-=1:s.current&&s.current(Z)},yt.current=gt.Z.MathField(kt.current,a),yt.current.latex(z||""),V&&V(yt.current)}},[kt]),(0,M.useEffect)(function(){yt.current&&yt.current.latex()!==z&&yt.current.latex(z)},[z]),ut().createElement("span",Pt({},dt,{ref:kt}))};Ft.propTypes={latex:at().string,onChange:at().func,config:at().object,mathquillDidMount:at().func};const Bt=Ft},717:(it,pt,X)=>{X.d(pt,{Z:()=>zt});var M=X(156),ut=X.n(M),ct=X(697),at=X.n(ct),gt=X(700),_t=["mathquillDidMount","children"];function Pt(){return Pt=Object.assign||function(ft){for(var Ft=1;Ft=0||(Et[lt]=s[lt]);return Et}(m,V);if(Object.getOwnPropertySymbols){var kt=Object.getOwnPropertySymbols(m);for(Nt=0;Nt=0||Object.prototype.propertyIsEnumerable.call(m,dt)&&(yt[dt]=m[dt])}return yt}(ft,_t),z=(0,M.useRef)(null),D=(0,M.useRef)(null);return(0,M.useLayoutEffect)(function(){z&&(D.current=gt.Z.StaticMath(z.current),Ft&&Ft(D.current))},[z,Bt]),ut().createElement("span",Pt({},v,{ref:z}),Bt)};ht.propTypes={children:at().string,mathquillDidMount:at().func};const zt=ht},700:(it,pt,X)=>{X.d(pt,{Z:()=>M});const M=X(338).getInterface(2)},527:(it,pt,X)=>{X.d(pt,{Z:()=>gt});var M=X(81),ut=X.n(M),ct=X(645),at=X.n(ct)()(ut());at.push([it.id,`/* +import{r as sn,aa as hi,bp as mi,R as mr,bt as gi,l as Pr,j as de,i as Zn,br as vi,a0 as bi,aP as yi,bs as xi,a as yn,F as gr,av as qi,s as wi}from"./index-7074710c.js";import{f as ki,a as Ti,p as Ci,h as Oi}from"./MathInputSelector-50cc4d06.js";/* empty css */var Jn={},Si={get exports(){return Jn},set exports(Re){Jn=Re}},vr={},ji={get exports(){return vr},set exports(Re){vr=Re}};/*! For license information please see react-mathquill.min.js.LICENSE.txt */(function(Re,zr){(function(Ae,Ot){Re.exports=Ot(sn)})(hi,function(Ae){return(()=>{var Ot={991:(it,pt,X)=>{X.d(pt,{Z:()=>Bt});var M=X(156),ut=X.n(M),ct=X(697),at=X.n(ct),gt=X(700),_t=["latex","onChange","config","mathquillDidMount"];function Pt(){return Pt=Object.assign||function(v){for(var z=1;z=0||(Ue[Le]=re[Le]);return Ue}(a,lt);if(Object.getOwnPropertySymbols){var Tt=Object.getOwnPropertySymbols(a);for(Et=0;Et=0||Object.prototype.propertyIsEnumerable.call(a,Z)&&(qt[Z]=a[Z])}return qt}(v,_t),Nt=(0,M.useRef)(2),yt=(0,M.useRef)(null),kt=(0,M.useRef)(null),s=(0,M.useRef)(D);return(0,M.useEffect)(function(){s.current=D},[D]),(0,M.useEffect)(function(){if(kt.current){var a={restrictMismatchedBrackets:!0,handlers:{}};m&&(a=zt(zt({},a),m));var lt=a.handlers.edit;a.handlers.edit=function(Z){lt&<(),Nt.current>0?Nt.current-=1:s.current&&s.current(Z)},yt.current=gt.Z.MathField(kt.current,a),yt.current.latex(z||""),V&&V(yt.current)}},[kt]),(0,M.useEffect)(function(){yt.current&&yt.current.latex()!==z&&yt.current.latex(z)},[z]),ut().createElement("span",Pt({},dt,{ref:kt}))};Ft.propTypes={latex:at().string,onChange:at().func,config:at().object,mathquillDidMount:at().func};const Bt=Ft},717:(it,pt,X)=>{X.d(pt,{Z:()=>zt});var M=X(156),ut=X.n(M),ct=X(697),at=X.n(ct),gt=X(700),_t=["mathquillDidMount","children"];function Pt(){return Pt=Object.assign||function(ft){for(var Ft=1;Ft=0||(Et[lt]=s[lt]);return Et}(m,V);if(Object.getOwnPropertySymbols){var kt=Object.getOwnPropertySymbols(m);for(Nt=0;Nt=0||Object.prototype.propertyIsEnumerable.call(m,dt)&&(yt[dt]=m[dt])}return yt}(ft,_t),z=(0,M.useRef)(null),D=(0,M.useRef)(null);return(0,M.useLayoutEffect)(function(){z&&(D.current=gt.Z.StaticMath(z.current),Ft&&Ft(D.current))},[z,Bt]),ut().createElement("span",Pt({},v,{ref:z}),Bt)};ht.propTypes={children:at().string,mathquillDidMount:at().func};const zt=ht},700:(it,pt,X)=>{X.d(pt,{Z:()=>M});const M=X(338).getInterface(2)},527:(it,pt,X)=>{X.d(pt,{Z:()=>gt});var M=X(81),ut=X.n(M),ct=X(645),at=X.n(ct)()(ut());at.push([it.id,`/* * MathQuill v0.11.0, by Han, Jeanine, and Mary * http://mathquill.com | maintainers@mathquill.com * diff --git a/dist/assets/mathList-4fb8f8ad.js b/dist/assets/mathList-4fb8f8ad.js deleted file mode 100644 index af72b1a5a3..0000000000 --- a/dist/assets/mathList-4fb8f8ad.js +++ /dev/null @@ -1 +0,0 @@ -import{av as a,bn as m,a as i,j as t,b9 as c}from"./index-99a56692.js";const x=a.memo(function(s){let{name:o,id:e,SVs:r,children:n}=m(s);if(r.hidden)return null;if(n.length===0&&r.latex)return i(a.Fragment,{children:[t("a",{name:e}),t("span",{id:e,children:t(c.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:"\\("+r.latex+"\\)"})})]},e);if(n.length===0)return t(a.Fragment,{},e);let l=n.slice(1).reduce((h,d)=>[...h,", ",d],[n[0]]);return i(a.Fragment,{children:[t("a",{name:e}),t("span",{id:e,children:l})]},e)});export{x as default}; diff --git a/dist/assets/mathList-e4fc0d9b.js b/dist/assets/mathList-e4fc0d9b.js new file mode 100644 index 0000000000..403392cf41 --- /dev/null +++ b/dist/assets/mathList-e4fc0d9b.js @@ -0,0 +1 @@ +import{av as n,bp as m,a as i,j as t,b9 as c}from"./index-7074710c.js";const x=n.memo(function(s){let{name:o,id:e,SVs:r,children:a}=m(s);if(r.hidden)return null;if(a.length===0&&r.latex)return i(n.Fragment,{children:[t("a",{name:e}),t("span",{id:e,children:t(c.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:"\\("+r.latex+"\\)"})})]},e);if(a.length===0)return t(n.Fragment,{},e);let l=a.slice(1).reduce((h,d)=>[...h,", ",d],[a[0]]);return i(n.Fragment,{children:[t("a",{name:e}),t("span",{id:e,children:l})]},e)});export{x as default}; diff --git a/dist/assets/matrixInput-baa0ea60.js b/dist/assets/matrixInput-900c080a.js similarity index 94% rename from dist/assets/matrixInput-baa0ea60.js rename to dist/assets/matrixInput-900c080a.js index de2744d6bd..16b268d155 100644 --- a/dist/assets/matrixInput-baa0ea60.js +++ b/dist/assets/matrixInput-900c080a.js @@ -1,4 +1,4 @@ -import{av as y,bn as B,r as _,j as t,i as p,bp as I,a0 as S,aP as N,bq as V,a as l,F as x,s as w}from"./index-99a56692.js";import{A as h}from"./ActionButton-f612d279.js";import{A as v}from"./ActionButtonGroup-a395ceaf.js";/* empty css */const E=w.div` +import{av as y,bp as B,r as _,j as t,i as p,br as I,a0 as S,aP as N,bs as V,a as l,F as x,s as w}from"./index-7074710c.js";import{A as h}from"./ActionButton-e5ea2a2f.js";import{A as v}from"./ActionButtonGroup-f4ce05e4.js";/* empty css */const E=w.div` position: relative; margin: 6px; display: inline-block; diff --git a/dist/assets/mdash-33408b70.js b/dist/assets/mdash-33408b70.js new file mode 100644 index 0000000000..64b7a44e76 --- /dev/null +++ b/dist/assets/mdash-33408b70.js @@ -0,0 +1 @@ +import{av as s,bp as n,j as r,F as t}from"./index-7074710c.js";const l=s.memo(function(e){let{SVs:a}=n(e,!1);return a.hidden?null:r(t,{children:"—"})});export{l as default}; diff --git a/dist/assets/mdash-fe43836d.js b/dist/assets/mdash-fe43836d.js deleted file mode 100644 index b44b00e398..0000000000 --- a/dist/assets/mdash-fe43836d.js +++ /dev/null @@ -1 +0,0 @@ -import{av as n,bn as s,j as r,F as t}from"./index-99a56692.js";const l=n.memo(function(e){let{SVs:a}=s(e,!1);return a.hidden?null:r(t,{children:"—"})});export{l as default}; diff --git a/dist/assets/moment-f5bb98f1.js b/dist/assets/moment-3cda1086.js similarity index 99% rename from dist/assets/moment-f5bb98f1.js rename to dist/assets/moment-3cda1086.js index 1226b762d4..d4e21038f1 100644 --- a/dist/assets/moment-f5bb98f1.js +++ b/dist/assets/moment-3cda1086.js @@ -1,4 +1,4 @@ -import{b3 as gs}from"./index-99a56692.js";function Ds(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}//! moment.js +import{b3 as gs}from"./index-7074710c.js";function Ds(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}//! moment.js //! version : 2.29.4 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT diff --git a/dist/assets/nbsp-39cd594f.js b/dist/assets/nbsp-f0190b99.js similarity index 63% rename from dist/assets/nbsp-39cd594f.js rename to dist/assets/nbsp-f0190b99.js index 1a61ceb0b8..fe674bfde3 100644 --- a/dist/assets/nbsp-39cd594f.js +++ b/dist/assets/nbsp-f0190b99.js @@ -1 +1 @@ -import{av as s,bn as r,j as t,F as a}from"./index-99a56692.js";const u=s.memo(function(e){let{SVs:n}=r(e,!1);return n.hidden?null:t(a,{children:" "})});export{u as default}; +import{av as s,bp as r,j as t,F as a}from"./index-7074710c.js";const u=s.memo(function(e){let{SVs:n}=r(e,!1);return n.hidden?null:t(a,{children:" "})});export{u as default}; diff --git a/dist/assets/ndash-6390eb8f.js b/dist/assets/ndash-5b905601.js similarity index 63% rename from dist/assets/ndash-6390eb8f.js rename to dist/assets/ndash-5b905601.js index 35f22f2164..6328d26696 100644 --- a/dist/assets/ndash-6390eb8f.js +++ b/dist/assets/ndash-5b905601.js @@ -1 +1 @@ -import{av as a,bn as r,j as s,F as t}from"./index-99a56692.js";const u=a.memo(function(e){let{SVs:n}=r(e);return n.hidden?null:s(t,{children:"–"})});export{u as default}; +import{av as a,bp as r,j as s,F as t}from"./index-7074710c.js";const u=a.memo(function(e){let{SVs:n}=r(e);return n.hidden?null:s(t,{children:"–"})});export{u as default}; diff --git a/dist/assets/number-56f4821a.js b/dist/assets/number-56f4821a.js new file mode 100644 index 0000000000..0a293489e6 --- /dev/null +++ b/dist/assets/number-56f4821a.js @@ -0,0 +1 @@ +import{av as s,bp as i,a as d,F as m,j as a,b9 as u}from"./index-7074710c.js";const o=s.memo(function(r){let{name:c,id:n,SVs:e}=i(r);if(e.hidden)return null;let t=e.text;return e.renderAsMath&&(t="\\("+t+"\\)"),d(m,{children:[a("a",{name:n}),a("span",{id:n,children:a(u.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:t})})]})});export{o as default}; diff --git a/dist/assets/number-9609086c.js b/dist/assets/number-9609086c.js deleted file mode 100644 index 5ea78248b0..0000000000 --- a/dist/assets/number-9609086c.js +++ /dev/null @@ -1 +0,0 @@ -import{av as s,bn as i,a as d,F as m,j as n,b9 as u}from"./index-99a56692.js";const o=s.memo(function(r){let{name:c,id:a,SVs:e}=i(r);if(e.hidden)return null;let t=e.text;return e.renderAsMath&&(t="\\("+t+"\\)"),d(m,{children:[n("a",{name:a}),n("span",{id:a,children:n(u.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:t})})]})});export{o as default}; diff --git a/dist/assets/numberList-0a281efa.js b/dist/assets/numberList-7136c931.js similarity index 86% rename from dist/assets/numberList-0a281efa.js rename to dist/assets/numberList-7136c931.js index 835debfc8d..fbb828d999 100644 --- a/dist/assets/numberList-0a281efa.js +++ b/dist/assets/numberList-7136c931.js @@ -1 +1 @@ -import{av as r,bn as c,a as s,j as n}from"./index-99a56692.js";const f=r.memo(function(i){let{name:u,id:e,SVs:a,children:t}=c(i);if(a.hidden)return null;if(t.length===0&&a.text)return s(r.Fragment,{children:[n("a",{name:e}),n("span",{id:e,children:a.text})]},e);if(t.length===0)return n(r.Fragment,{},e);let l=t.slice(1).reduce((m,d)=>[...m,", ",d],[t[0]]);return s(r.Fragment,{children:[n("a",{name:e}),n("span",{id:e,children:l})]},e)});export{f as default}; +import{av as r,bp as c,a as s,j as n}from"./index-7074710c.js";const f=r.memo(function(i){let{name:u,id:e,SVs:a,children:t}=c(i);if(a.hidden)return null;if(t.length===0&&a.text)return s(r.Fragment,{children:[n("a",{name:e}),n("span",{id:e,children:a.text})]},e);if(t.length===0)return n(r.Fragment,{},e);let l=t.slice(1).reduce((m,d)=>[...m,", ",d],[t[0]]);return s(r.Fragment,{children:[n("a",{name:e}),n("span",{id:e,children:l})]},e)});export{f as default}; diff --git a/dist/assets/orbitalDiagram-f11dd287.js b/dist/assets/orbitalDiagram-01886706.js similarity index 94% rename from dist/assets/orbitalDiagram-f11dd287.js rename to dist/assets/orbitalDiagram-01886706.js index 1f2d49b112..b98aea031f 100644 --- a/dist/assets/orbitalDiagram-f11dd287.js +++ b/dist/assets/orbitalDiagram-01886706.js @@ -1,4 +1,4 @@ -import{av as f,bn as O,r as w,j as i,F as u,s as U,a as $}from"./index-99a56692.js";import{V as R}from"./visibility-sensor-55e75ed1.js";const V=U.svg` +import{av as f,bp as O,r as w,j as i,F as u,s as U,a as $}from"./index-7074710c.js";import{V as R}from"./visibility-sensor-7d414852.js";const V=U.svg` border: '2px solid red'; margin: 2px; outline: none; diff --git a/dist/assets/orbitalDiagramInput-7f035ba9.js b/dist/assets/orbitalDiagramInput-3cb02455.js similarity index 97% rename from dist/assets/orbitalDiagramInput-7f035ba9.js rename to dist/assets/orbitalDiagramInput-3cb02455.js index 07340d120e..6d06237462 100644 --- a/dist/assets/orbitalDiagramInput-7f035ba9.js +++ b/dist/assets/orbitalDiagramInput-3cb02455.js @@ -1,4 +1,4 @@ -import{av as B,bn as S,r as m,j as l,a as R,F as V,s as W}from"./index-99a56692.js";import{V as I}from"./visibility-sensor-55e75ed1.js";const j=W.svg` +import{av as B,bp as S,r as m,j as l,a as R,F as V,s as W}from"./index-7074710c.js";import{V as I}from"./visibility-sensor-7d414852.js";const j=W.svg` border: '2px solid red'; margin: 2px; outline: none; diff --git a/dist/assets/p-518868cc.js b/dist/assets/p-518868cc.js deleted file mode 100644 index ecb3ed98fb..0000000000 --- a/dist/assets/p-518868cc.js +++ /dev/null @@ -1 +0,0 @@ -import{av as c,bn as d,r as u,j as r,a as f}from"./index-99a56692.js";import{V as h}from"./visibility-sensor-55e75ed1.js";const g=c.memo(function(n){let{name:V,id:i,SVs:s,children:t,actions:e,callAction:a}=d(n),o=l=>{a({action:e.recordVisibilityChange,args:{isVisible:l}})};return u.useEffect(()=>()=>{a({action:e.recordVisibilityChange,args:{isVisible:!1}})},[]),s.hidden?null:r(h,{partialVisibility:!0,onChange:o,children:f("p",{id:i,children:[r("a",{name:i}),t]})})});export{g as default}; diff --git a/dist/assets/p-b709c326.js b/dist/assets/p-b709c326.js new file mode 100644 index 0000000000..b0c00ff899 --- /dev/null +++ b/dist/assets/p-b709c326.js @@ -0,0 +1 @@ +import{av as c,bp as d,r as u,j as r,a as f}from"./index-7074710c.js";import{V as h}from"./visibility-sensor-7d414852.js";const g=c.memo(function(s){let{name:p,id:i,SVs:t,children:n,actions:e,callAction:a}=d(s),o=l=>{a({action:e.recordVisibilityChange,args:{isVisible:l}})};return u.useEffect(()=>()=>{a({action:e.recordVisibilityChange,args:{isVisible:!1}})},[]),t.hidden?null:r(h,{partialVisibility:!0,onChange:o,children:f("p",{id:i,children:[r("a",{name:i}),n]})})});export{g as default}; diff --git a/dist/assets/paginatorControls-99bfd825.js b/dist/assets/paginatorControls-9cf5c4a4.js similarity index 89% rename from dist/assets/paginatorControls-99bfd825.js rename to dist/assets/paginatorControls-9cf5c4a4.js index 81f512e7b3..8e181031ed 100644 --- a/dist/assets/paginatorControls-99bfd825.js +++ b/dist/assets/paginatorControls-9cf5c4a4.js @@ -1 +1 @@ -import{av as i,bn as o,a as l,j as n}from"./index-99a56692.js";const g=i.memo(function(s){let{name:d,id:a,SVs:e,actions:r,callAction:t}=o(s,!1);return e.hidden?null:l("p",{id:a,children:[n("a",{name:a}),n("button",{id:a+"_previous",onClick:()=>{t({action:r.setPage,args:{number:e.currentPage-1}})},disabled:e.disabled||!(e.currentPage>1),children:e.previousLabel})," "+e.pageLabel," ",e.currentPage," of ",e.nPages+" ",n("button",{id:a+"_next",onClick:()=>{t({action:r.setPage,args:{number:e.currentPage+1}})},disabled:e.disabled||!(e.currentPage{t({action:r.setPage,args:{number:e.currentPage-1}})},disabled:e.disabled||!(e.currentPage>1),children:e.previousLabel})," "+e.pageLabel," ",e.currentPage," of ",e.nPages+" ",n("button",{id:a+"_next",onClick:()=>{t({action:r.setPage,args:{number:e.currentPage+1}})},disabled:e.disabled||!(e.currentPage()=>{P()},[]);function O(){let[o,b,g,M]=l.getBoundingBox(),R=(o-p.current)/x.current,C=(g-p.current)/x.current,w=(M-y.current)/h.current,B=(b-y.current)/h.current,d=f.math.round(Math.min(R,C)+1),m=f.math.round(Math.max(R,C)-1),i=f.math.round(Math.min(w,B)+1),a=f.math.round(Math.max(w,B)-1);if(N.current=[d,m,i,a],Number.isFinite(d)&&Number.isFinite(m)&&Number.isFinite(i)&&Number.isFinite(a)){let t=[];for(let r=i;r<=a;r++){let c=r*u.dy+u.yoffset,e=[];for(let n=d;n<=m;n++)e.push(l.create("point",[n*u.dx+u.xoffset,c],F.current));t.push(e)}s.current=t}l.on("boundingbox",()=>{let[t,r,c,e]=l.getBoundingBox(),n=(t-p.current)/x.current,E=(c-p.current)/x.current,Y=(e-y.current)/h.current,S=(r-y.current)/h.current,G=f.math.round(Math.min(n,E)+1),J=f.math.round(Math.max(n,E)-1),_=f.math.round(Math.min(Y,S)+1),k=f.math.round(Math.max(Y,S)-1),[z,L,T,V]=N.current;(G!==z||J!==L||_!==T||k!==V)&&X(G,J,_,k)})}function P(){if(s.current!==null)for(let o of s.current)for(let b of o)l.removeObject(b);s.current=null}function X(o,b,g,M){if(s.current===null)return O();if(!Number.isFinite(o)||!Number.isFinite(b)||!Number.isFinite(g)||!Number.isFinite(M))return P();let[R,C,w,B]=N.current,d=M-g+1,m=B-w+1,i=b-o+1,a=C-R+1;for(let t=0;ti)for(let e=i;ed)for(let t=d;t()=>{P()},[]);function O(){let[o,b,g,M]=l.getBoundingBox(),R=(o-p.current)/x.current,C=(g-p.current)/x.current,w=(M-y.current)/h.current,B=(b-y.current)/h.current,d=f.math.round(Math.min(R,C)+1),m=f.math.round(Math.max(R,C)-1),i=f.math.round(Math.min(w,B)+1),a=f.math.round(Math.max(w,B)-1);if(N.current=[d,m,i,a],Number.isFinite(d)&&Number.isFinite(m)&&Number.isFinite(i)&&Number.isFinite(a)){let t=[];for(let r=i;r<=a;r++){let c=r*u.dy+u.yoffset,e=[];for(let n=d;n<=m;n++)e.push(l.create("point",[n*u.dx+u.xoffset,c],F.current));t.push(e)}s.current=t}l.on("boundingbox",()=>{let[t,r,c,e]=l.getBoundingBox(),n=(t-p.current)/x.current,E=(c-p.current)/x.current,Y=(e-y.current)/h.current,S=(r-y.current)/h.current,G=f.math.round(Math.min(n,E)+1),J=f.math.round(Math.max(n,E)-1),_=f.math.round(Math.min(Y,S)+1),k=f.math.round(Math.max(Y,S)-1),[q,z,L,T]=N.current;(G!==q||J!==z||_!==L||k!==T)&&X(G,J,_,k)})}function P(){if(s.current!==null)for(let o of s.current)for(let b of o)l.removeObject(b);s.current=null}function X(o,b,g,M){if(s.current===null)return O();if(!Number.isFinite(o)||!Number.isFinite(b)||!Number.isFinite(g)||!Number.isFinite(M))return P();let[R,C,w,B]=N.current,d=M-g+1,m=B-w+1,i=b-o+1,a=C-R+1;for(let t=0;ti)for(let e=i;ed)for(let t=d;t()=>{t.current!==null&&(r.current.off("drag"),r.current.off("down"),r.current.off("up"),s.removeObject(t.current),s.removeObject(r.current),t.current=null,r.current=null)},[]);function Y(){let c=B==="dark"?e.selectedStyle.markerColorDarkMode:e.selectedStyle.markerColor;c=c.toLowerCase();let C=A?"var(--canvas)":c,R=A?c:"none",h=!e.draggable||e.fixed,m=e.showLabel&&e.labelForGraph!=="",o={name:e.labelForGraph,visible:!e.hidden,withlabel:m,fixed:!0,layer:10*e.layer+U,fillColor:C,strokeColor:R,strokeOpacity:e.selectedStyle.lineOpacity,fillOpacity:e.selectedStyle.lineOpacity,highlightFillColor:getComputedStyle(document.documentElement).getPropertyValue("--mainGray"),highlightStrokeColor:getComputedStyle(document.documentElement).getPropertyValue("--lightBlue"),size:I(e.selectedStyle.markerSize,e.selectedStyle.markerStyle),face:j(e.selectedStyle.markerStyle),highlight:!h};if(m){let i,n,l;e.labelPosition==="upperright"?(l=[5,5],i="left",n="bottom"):e.labelPosition==="upperleft"?(l=[-5,5],i="right",n="bottom"):e.labelPosition==="lowerright"?(l=[5,-5],i="left",n="top"):e.labelPosition==="lowerleft"?(l=[-5,-5],i="right",n="top"):e.labelPosition==="top"?(l=[0,10],i="middle",n="bottom"):e.labelPosition==="bottom"?(l=[0,-10],i="middle",n="top"):e.labelPosition==="left"?(l=[-10,0],i="right",n="middle"):(l=[10,0],i="left",n="middle"),o.label={offset:l,anchorx:i,anchory:n,highlight:!1},e.labelHasLatex&&(o.label.useMathJax=!0),e.applyStyleToLabel?o.label.strokeColor=c:o.label.strokeColor="var(--canvastext)"}else o.label={highlight:!1},e.labelHasLatex&&(o.label.useMathJax=!0);h?o.showInfoBox=!1:o.showInfoBox=e.showCoordsWhenDragging;let d=[e.numericalXs[0],e.numericalXs[1]];Number.isFinite(d[0])||(d[0]=0,o.visible=!1),Number.isFinite(d[1])||(d[1]=0,o.visible=!1);let P={...o};P.fixed=h,P.showInfoBox=!1,P.withlabel=!1,P.fillOpacity=0,P.strokeOpacity=0;let b=s.create("point",d,P),y=s.create("point",d,o);b.on("down",function(i){S.current=[i.x,i.y],M.current=[...b.coords.scrCoords],k.current=!1,r.current.visProp.fillopacity=t.current.visProp.fillopacity,r.current.visProp.strokeopacity=t.current.visProp.strokeopacity,x({action:g.mouseDownOnPoint})}),b.on("up",function(i){k.current?x({action:g.movePoint,args:{x:w.current,y:O.current}}):e.switchable&&!e.fixed?(x({action:g.switchPoint}),x({action:g.pointClicked})):x({action:g.pointClicked}),k.current=!1,r.current.visProp.fillopacity=0,r.current.visProp.strokeopacity=0}),b.on("drag",function(i){var n=s.origin.scrCoords;let[l,u,f,T]=s.getBoundingBox();w.current=(M.current[1]+i.x-S.current[0]-n[1])/s.unitX,w.current=Math.min(f,Math.max(l,w.current)),O.current=(n[2]-(M.current[2]+i.y-S.current[1]))/s.unitY,O.current=Math.min(u,Math.max(T,O.current)),x({action:g.movePoint,args:{x:w.current,y:O.current,transient:!0,skippable:!0}}),y.coords.setCoordinates(JXG.COORDS_BY_USER,D.current),s.updateInfobox(y),(Math.abs(i.x-S.current[0])>.1||Math.abs(i.y-S.current[1])>.1)&&(k.current=!0)}),t.current=y,r.current=b,J.current=e.labelPosition,G.current=m}if(s){if(t.current===null)Y();else{let c=B==="dark"?e.selectedStyle.markerColorDarkMode:e.selectedStyle.markerColor;c=c.toLowerCase();let C=A?"var(--canvas)":c,R=A?c:"none";t.current.visProp.fillcolor!==C&&(t.current.visProp.fillcolor=C);let h=(_=e.numericalXs)==null?void 0:_[0],m=(E=e.numericalXs)==null?void 0:E[1];t.current.coords.setCoordinates(JXG.COORDS_BY_USER,[h,m]),k.current||r.current.coords.setCoordinates(JXG.COORDS_BY_USER,[h,m]);let o=!e.hidden;if(Number.isFinite(h)&&Number.isFinite(m)){let l=t.current.visProp.visible!==o;t.current.visProp.visible=o,t.current.visPropCalc.visible=o,r.current.visProp.visible=o,r.current.visPropCalc.visible=o,l&&(t.current.setAttribute({visible:o}),r.current.setAttribute({visible:o}))}else t.current.visProp.visible=!1,t.current.visPropCalc.visible=!1,r.current.visProp.visible=!1,r.current.visPropCalc.visible=!1;let d=10*e.layer+U;t.current.visProp.layer!==d&&(t.current.setAttribute({layer:d}),r.current.setAttribute({layer:d}));let b=!e.draggable||e.fixed;t.current.visProp.highlight=!b,r.current.visProp.highlight=!b,r.current.visProp.fixed=b,t.current.visProp.strokecolor!==R&&(t.current.visProp.strokecolor=R,r.current.visProp.strokecolor=R,t.current.visProp.fillColor=C,r.current.visProp.fillColor=C),t.current.visProp.strokeopacity!==e.selectedStyle.lineOpacity&&(t.current.visProp.strokeopacity=e.selectedStyle.lineOpacity,t.current.visProp.fillopacity=e.selectedStyle.lineOpacity);let y=j(e.selectedStyle.markerStyle);t.current.visProp.face!==y&&(t.current.setAttribute({face:y}),r.current.setAttribute({face:y}));let i=I(e.selectedStyle.markerSize,e.selectedStyle.markerStyle);t.current.visProp.size!==i&&(t.current.setAttribute({size:i}),r.current.setAttribute({size:i})),b?t.current.visProp.showinfobox=!1:t.current.visProp.showinfobox=e.showCoordsWhenDragging,L.sourceInformation&&z in L.sourceInformation&&s.updateInfobox(t.current),t.current.name=e.labelForGraph;let n=e.showLabel&&e.labelForGraph!=="";if(n!=G.current&&(t.current.setAttribute({withlabel:n}),G.current=n),t.current.hasLabel)if(t.current.label.needsUpdate=!0,e.applyStyleToLabel?t.current.label.visProp.strokecolor=c:t.current.label.visProp.strokecolor="var(--canvastext)",e.labelPosition!==J.current){let l,u,f;e.labelPosition==="upperright"?(f=[5,5],l="left",u="bottom"):e.labelPosition==="upperleft"?(f=[-5,5],l="right",u="bottom"):e.labelPosition==="lowerright"?(f=[5,-5],l="left",u="top"):e.labelPosition==="lowerleft"?(f=[-5,-5],l="right",u="top"):e.labelPosition==="top"?(f=[0,10],l="middle",u="bottom"):e.labelPosition==="bottom"?(f=[0,-10],l="middle",u="top"):e.labelPosition==="left"?(f=[-10,0],l="right",u="middle"):(f=[10,0],l="left",u="middle"),t.current.label.visProp.anchorx=l,t.current.label.visProp.anchory=u,t.current.label.visProp.offset=f,J.current=e.labelPosition,t.current.label.fullUpdate()}else t.current.label.update();t.current.needsUpdate=!0,t.current.update(),r.current.needsUpdate=!0,r.current.update(),s.updateRenderer()}return F("a",{name:X})}if(e.hidden)return null;let N="\\("+e.latex+"\\)";return K(Q,{children:[F("a",{name:X}),F("span",{id:X,children:F(Z.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:N})})]})});function I(p,v){return v==="diamond"?p*1.4:v==="plus"?p*1.2:v==="square"?p*1.1:v.substring(0,8)==="triangle"?p*1.5:p}function j(p){return p==="triangle"?"triangleup":p}export{ie as default}; +import{av as V,bp as W,r as a,l as H,bu as q,j as F,a as K,F as Q,b9 as Z}from"./index-7074710c.js";import{BoardContext as $,POINT_LAYER_OFFSET as U}from"./graph-71cec529.js";import"./css-14ccef8c.js";import"./visibility-sensor-7d414852.js";const ie=V.memo(function p(v){var _,E;let{name:z,id:X,SVs:e,actions:g,sourceOfUpdate:L,callAction:x}=W(v);p.ignoreActionsWithoutCore=!0;const s=a.useContext($);let t=a.useRef(null),r=a.useRef(null),S=a.useRef(!1),M=a.useRef(!1),k=a.useRef(!1),G=a.useRef(null),J=a.useRef(null),w=a.useRef(null),O=a.useRef(null),D=a.useRef(null);D.current=e.numericalXs;const B=H(q),A=e.open||["cross","plus"].includes(e.selectedStyle.markerStyle);a.useEffect(()=>()=>{t.current!==null&&(r.current.off("drag"),r.current.off("down"),r.current.off("up"),s.removeObject(t.current),s.removeObject(r.current),t.current=null,r.current=null)},[]);function Y(){let c=B==="dark"?e.selectedStyle.markerColorDarkMode:e.selectedStyle.markerColor;c=c.toLowerCase();let C=A?"var(--canvas)":c,R=A?c:"none",h=!e.draggable||e.fixed,m=e.showLabel&&e.labelForGraph!=="",o={name:e.labelForGraph,visible:!e.hidden,withlabel:m,fixed:!0,layer:10*e.layer+U,fillColor:C,strokeColor:R,strokeOpacity:e.selectedStyle.lineOpacity,fillOpacity:e.selectedStyle.lineOpacity,highlightFillColor:getComputedStyle(document.documentElement).getPropertyValue("--mainGray"),highlightStrokeColor:getComputedStyle(document.documentElement).getPropertyValue("--lightBlue"),size:I(e.selectedStyle.markerSize,e.selectedStyle.markerStyle),face:j(e.selectedStyle.markerStyle),highlight:!h};if(m){let i,n,l;e.labelPosition==="upperright"?(l=[5,5],i="left",n="bottom"):e.labelPosition==="upperleft"?(l=[-5,5],i="right",n="bottom"):e.labelPosition==="lowerright"?(l=[5,-5],i="left",n="top"):e.labelPosition==="lowerleft"?(l=[-5,-5],i="right",n="top"):e.labelPosition==="top"?(l=[0,10],i="middle",n="bottom"):e.labelPosition==="bottom"?(l=[0,-10],i="middle",n="top"):e.labelPosition==="left"?(l=[-10,0],i="right",n="middle"):(l=[10,0],i="left",n="middle"),o.label={offset:l,anchorx:i,anchory:n,highlight:!1},e.labelHasLatex&&(o.label.useMathJax=!0),e.applyStyleToLabel?o.label.strokeColor=c:o.label.strokeColor="var(--canvastext)"}else o.label={highlight:!1},e.labelHasLatex&&(o.label.useMathJax=!0);h?o.showInfoBox=!1:o.showInfoBox=e.showCoordsWhenDragging;let d=[e.numericalXs[0],e.numericalXs[1]];Number.isFinite(d[0])||(d[0]=0,o.visible=!1),Number.isFinite(d[1])||(d[1]=0,o.visible=!1);let P={...o};P.fixed=h,P.showInfoBox=!1,P.withlabel=!1,P.fillOpacity=0,P.strokeOpacity=0;let b=s.create("point",d,P),y=s.create("point",d,o);b.on("down",function(i){S.current=[i.x,i.y],M.current=[...b.coords.scrCoords],k.current=!1,r.current.visProp.fillopacity=t.current.visProp.fillopacity,r.current.visProp.strokeopacity=t.current.visProp.strokeopacity,x({action:g.mouseDownOnPoint})}),b.on("up",function(i){k.current?x({action:g.movePoint,args:{x:w.current,y:O.current}}):e.switchable&&!e.fixed?(x({action:g.switchPoint}),x({action:g.pointClicked})):x({action:g.pointClicked}),k.current=!1,r.current.visProp.fillopacity=0,r.current.visProp.strokeopacity=0}),b.on("drag",function(i){var n=s.origin.scrCoords;let[l,u,f,T]=s.getBoundingBox();w.current=(M.current[1]+i.x-S.current[0]-n[1])/s.unitX,w.current=Math.min(f,Math.max(l,w.current)),O.current=(n[2]-(M.current[2]+i.y-S.current[1]))/s.unitY,O.current=Math.min(u,Math.max(T,O.current)),x({action:g.movePoint,args:{x:w.current,y:O.current,transient:!0,skippable:!0}}),y.coords.setCoordinates(JXG.COORDS_BY_USER,D.current),s.updateInfobox(y),(Math.abs(i.x-S.current[0])>.1||Math.abs(i.y-S.current[1])>.1)&&(k.current=!0)}),t.current=y,r.current=b,J.current=e.labelPosition,G.current=m}if(s){if(t.current===null)Y();else{let c=B==="dark"?e.selectedStyle.markerColorDarkMode:e.selectedStyle.markerColor;c=c.toLowerCase();let C=A?"var(--canvas)":c,R=A?c:"none";t.current.visProp.fillcolor!==C&&(t.current.visProp.fillcolor=C);let h=(_=e.numericalXs)==null?void 0:_[0],m=(E=e.numericalXs)==null?void 0:E[1];t.current.coords.setCoordinates(JXG.COORDS_BY_USER,[h,m]),k.current||r.current.coords.setCoordinates(JXG.COORDS_BY_USER,[h,m]);let o=!e.hidden;if(Number.isFinite(h)&&Number.isFinite(m)){let l=t.current.visProp.visible!==o;t.current.visProp.visible=o,t.current.visPropCalc.visible=o,r.current.visProp.visible=o,r.current.visPropCalc.visible=o,l&&(t.current.setAttribute({visible:o}),r.current.setAttribute({visible:o}))}else t.current.visProp.visible=!1,t.current.visPropCalc.visible=!1,r.current.visProp.visible=!1,r.current.visPropCalc.visible=!1;let d=10*e.layer+U;t.current.visProp.layer!==d&&(t.current.setAttribute({layer:d}),r.current.setAttribute({layer:d}));let b=!e.draggable||e.fixed;t.current.visProp.highlight=!b,r.current.visProp.highlight=!b,r.current.visProp.fixed=b,t.current.visProp.strokecolor!==R&&(t.current.visProp.strokecolor=R,r.current.visProp.strokecolor=R,t.current.visProp.fillColor=C,r.current.visProp.fillColor=C),t.current.visProp.strokeopacity!==e.selectedStyle.lineOpacity&&(t.current.visProp.strokeopacity=e.selectedStyle.lineOpacity,t.current.visProp.fillopacity=e.selectedStyle.lineOpacity);let y=j(e.selectedStyle.markerStyle);t.current.visProp.face!==y&&(t.current.setAttribute({face:y}),r.current.setAttribute({face:y}));let i=I(e.selectedStyle.markerSize,e.selectedStyle.markerStyle);t.current.visProp.size!==i&&(t.current.setAttribute({size:i}),r.current.setAttribute({size:i})),b?t.current.visProp.showinfobox=!1:t.current.visProp.showinfobox=e.showCoordsWhenDragging,L.sourceInformation&&z in L.sourceInformation&&s.updateInfobox(t.current),t.current.name=e.labelForGraph;let n=e.showLabel&&e.labelForGraph!=="";if(n!=G.current&&(t.current.setAttribute({withlabel:n}),G.current=n),t.current.hasLabel)if(t.current.label.needsUpdate=!0,e.applyStyleToLabel?t.current.label.visProp.strokecolor=c:t.current.label.visProp.strokecolor="var(--canvastext)",e.labelPosition!==J.current){let l,u,f;e.labelPosition==="upperright"?(f=[5,5],l="left",u="bottom"):e.labelPosition==="upperleft"?(f=[-5,5],l="right",u="bottom"):e.labelPosition==="lowerright"?(f=[5,-5],l="left",u="top"):e.labelPosition==="lowerleft"?(f=[-5,-5],l="right",u="top"):e.labelPosition==="top"?(f=[0,10],l="middle",u="bottom"):e.labelPosition==="bottom"?(f=[0,-10],l="middle",u="top"):e.labelPosition==="left"?(f=[-10,0],l="right",u="middle"):(f=[10,0],l="left",u="middle"),t.current.label.visProp.anchorx=l,t.current.label.visProp.anchory=u,t.current.label.visProp.offset=f,J.current=e.labelPosition,t.current.label.fullUpdate()}else t.current.label.update();t.current.needsUpdate=!0,t.current.update(),r.current.needsUpdate=!0,r.current.update(),s.updateRenderer()}return F("a",{name:X})}if(e.hidden)return null;let N="\\("+e.latex+"\\)";return K(Q,{children:[F("a",{name:X}),F("span",{id:X,children:F(Z.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:N})})]})});function I(p,v){return v==="diamond"?p*1.4:v==="plus"?p*1.2:v==="square"?p*1.1:v.substring(0,8)==="triangle"?p*1.5:p}function j(p){return p==="triangle"?"triangleup":p}export{ie as default}; diff --git a/dist/assets/polygon-07cd896e.js b/dist/assets/polygon-8f87d0c3.js similarity index 81% rename from dist/assets/polygon-07cd896e.js rename to dist/assets/polygon-8f87d0c3.js index 9545b6831e..8122952399 100644 --- a/dist/assets/polygon-07cd896e.js +++ b/dist/assets/polygon-8f87d0c3.js @@ -1 +1 @@ -import{av as T,bn as B,r as d,l as N,bs as H,j as X,F as z}from"./index-99a56692.js";import{BoardContext as q,LINE_LAYER_OFFSET as V,VERTEX_LAYER_OFFSET as M}from"./graph-57e1e537.js";import"./css-14ccef8c.js";import"./visibility-sensor-55e75ed1.js";const ee=T.memo(function S(W){let{name:A,id:Y,SVs:e,actions:y,sourceOfUpdate:R,callAction:v}=B(W);S.ignoreActionsWithoutCore=!0;const c=d.useContext(q);let r=d.useRef(null),g=d.useRef(null),m=d.useRef(null),O=d.useRef(null),b=d.useRef(null),D=d.useRef(null),P=d.useRef(null),x=d.useRef(null),F=d.useRef(null);F.current=e.numericalVertices;const w=N(H);d.useEffect(()=>()=>{r.current&&E()},[]);function j(){if(!(e.nVertices>=2))return null;let l=!e.draggable||e.fixed,i=!e.verticesDraggable||e.fixed,o=w==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;o=o.toLowerCase();let s=w==="dark"?e.selectedStyle.fillColorDarkMode:e.selectedStyle.fillColor;s=e.filled?s.toLowerCase():"none",x.current={fillColor:"none",strokeColor:"none",highlightStrokeColor:"none",highlightFillColor:getComputedStyle(document.documentElement).getPropertyValue("--mainGray"),visible:!i&&!e.hidden,withLabel:!1,layer:10*e.layer+M,highlight:!0};let f={highlight:!1,visible:!e.hidden,layer:10*e.layer+V,fixed:!0,strokeColor:o,strokeOpacity:e.selectedStyle.lineOpacity,highlightStrokeColor:o,highlightStrokeOpacity:e.selectedStyle.lineOpacity*.5,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,dash:J(e.selectedStyle.lineStyle)},a={name:e.labelForGraph,visible:!e.hidden,withLabel:e.showLabel&&e.labelForGraph!=="",fixed:l,layer:10*e.layer+V,fillColor:s,fillOpacity:e.selectedStyle.fillOpacity,highlightFillColor:s,highlightFillOpacity:e.selectedStyle.fillOpacity*.5,highlight:!l,vertices:x.current,borders:f};a.label={highlight:!1},e.labelHasLatex&&(a.label.useMathJax=!0),e.applyStyleToLabel?a.label.strokeColor=o:a.label.strokeColor="var(--canvastext)",e.filled&&(a.hasInnerPoints=!0),c.suspendUpdate();let C=[];for(let u of e.numericalVertices)C.push(c.create("point",[...u],x.current));let p=c.create("polygon",C,a);return L(p),p.on("drag",u=>_(-1,u)),p.on("up",u=>G(-1)),p.on("down",function(u){m.current=null,b.current=[u.x,u.y],D.current=p.vertices.map(h=>[...h.coords.scrCoords]),O.current===null&&v({action:y.mouseDownOnPolygon})}),c.unsuspendUpdate(),P.current=e.nVertices,p}function L(l){for(let i=0;i_(i,s)),o.off("up"),o.on("up",()=>G(i)),o.off("down"),o.on("down",s=>{m.current=null,b.current=[s.x,s.y],O.current=i,v({action:y.mouseDownOnPolygon})})}}function E(){for(let l=0;l.1||Math.abs(i.y-b.current[1])>.1)if(m.current=l,l===-1){g.current=I(i),v({action:y.movePolygon,args:{pointCoords:g.current,transient:!0,skippable:!0}});for(let o=0;o=2))E();else{let l=!0;for(let t of e.numericalVertices)Number.isFinite(t[0])||(l=!1),Number.isFinite(t[1])||(l=!1);if(e.nVertices>P.current){for(let t=P.current;t=e.nVertices;t--)r.current.vertices[t].off("drag"),r.current.vertices[t].off("down"),r.current.vertices[t].off("up"),r.current.removePoints(r.current.vertices[t]);L(r.current)}let i=!e.draggable||e.fixed,s=!(!e.verticesDraggable||e.fixed)&&!e.hidden;for(let t=0;t()=>{r.current&&E()},[]);function j(){if(!(e.nVertices>=2))return null;let l=!e.draggable||e.fixed,i=!e.verticesDraggable||e.fixed,o=w==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;o=o.toLowerCase();let s=w==="dark"?e.selectedStyle.fillColorDarkMode:e.selectedStyle.fillColor;s=e.filled?s.toLowerCase():"none",x.current={fillColor:"none",strokeColor:"none",highlightStrokeColor:"none",highlightFillColor:getComputedStyle(document.documentElement).getPropertyValue("--mainGray"),visible:!i&&!e.hidden,withLabel:!1,layer:10*e.layer+M,highlight:!0};let f={highlight:!1,visible:!e.hidden,layer:10*e.layer+V,fixed:!0,strokeColor:o,strokeOpacity:e.selectedStyle.lineOpacity,highlightStrokeColor:o,highlightStrokeOpacity:e.selectedStyle.lineOpacity*.5,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,dash:J(e.selectedStyle.lineStyle)},u={name:e.labelForGraph,visible:!e.hidden,withLabel:e.showLabel&&e.labelForGraph!=="",fixed:l,layer:10*e.layer+V,fillColor:s,fillOpacity:e.selectedStyle.fillOpacity,highlightFillColor:s,highlightFillOpacity:e.selectedStyle.fillOpacity*.5,highlight:!l,vertices:x.current,borders:f};u.label={highlight:!1},e.labelHasLatex&&(u.label.useMathJax=!0),e.applyStyleToLabel?u.label.strokeColor=o:u.label.strokeColor="var(--canvastext)",e.filled&&(u.hasInnerPoints=!0),c.suspendUpdate();let C=[];for(let a of e.numericalVertices)C.push(c.create("point",[...a],x.current));let p=c.create("polygon",C,u);return L(p),p.on("drag",a=>_(-1,a)),p.on("up",a=>G(-1)),p.on("down",function(a){m.current=null,b.current=[a.x,a.y],D.current=p.vertices.map(h=>[...h.coords.scrCoords]),O.current===null&&v({action:y.mouseDownOnPolygon})}),c.unsuspendUpdate(),P.current=e.nVertices,p}function L(l){for(let i=0;i_(i,s)),o.off("up"),o.on("up",()=>G(i)),o.off("down"),o.on("down",s=>{m.current=null,b.current=[s.x,s.y],O.current=i,v({action:y.mouseDownOnPolygon})})}}function E(){for(let l=0;l.1||Math.abs(i.y-b.current[1])>.1)if(m.current=l,l===-1){g.current=I(i),v({action:y.movePolygon,args:{pointCoords:g.current,transient:!0,skippable:!0}});for(let o=0;o=2))E();else{let l=!0;for(let t of e.numericalVertices)Number.isFinite(t[0])||(l=!1),Number.isFinite(t[1])||(l=!1);if(e.nVertices>P.current){for(let t=P.current;t=e.nVertices;t--)r.current.vertices[t].off("drag"),r.current.vertices[t].off("down"),r.current.vertices[t].off("up"),r.current.removePoints(r.current.vertices[t]);L(r.current)}let i=!e.draggable||e.fixed,s=!(!e.verticesDraggable||e.fixed)&&!e.hidden;for(let t=0;t()=>{r.current&&L()},[]);function T(){if(e.numericalVertices.length!==e.nVertices||e.numericalVertices.some(l=>l.length!==2))return null;let n=!0;for(let l of e.numericalVertices)Number.isFinite(l[0])||(n=!1),Number.isFinite(l[1])||(n=!1);let a=!e.draggable||e.fixed,u=E==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;u=u.toLowerCase();let o={name:e.labelForGraph,visible:!e.hidden&&n,withLabel:e.showLabel&&e.labelForGraph!=="",layer:10*e.layer+Y,fixed:a,strokeColor:u,strokeOpacity:e.selectedStyle.lineOpacity,highlightStrokeColor:u,highlightStrokeOpacity:e.selectedStyle.lineOpacity*.5,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,dash:A(e.selectedStyle.lineStyle),highlight:!a,lineCap:"butt"},c=!e.verticesDraggable||e.fixed;P.current=Object.assign({},o),Object.assign(P.current,{fixed:!1,highlight:!0,withLabel:!1,fillColor:"none",strokeColor:"none",highlightStrokeColor:"none",highlightFillColor:getComputedStyle(document.documentElement).getPropertyValue("--mainGray"),layer:10*e.layer+_}),(c||e.hidden||!n)&&(P.current.visible=!1),o.label={highlight:!1},e.labelHasLatex&&(o.label.useMathJax=!0),e.applyStyleToLabel?o.label.strokeColor=u:o.label.strokeColor="var(--canvastext)",i.current=[];for(let l=0;l{x.push(l[0]),R.push(l[1])});let p=s.create("curve",[x,R],o);for(let l=0;lO(l,h)),i.current[l].on("up",()=>M(l)),i.current[l].on("down",h=>{b.current=null,m.current=[h.x,h.y],k.current=l,g({action:y.mouseDownOnPolyline})});return p.on("drag",l=>O(-1,l)),p.on("up",()=>M(-1)),p.on("down",function(l){b.current=null,m.current=[l.x,l.y],X.current=p.points.map(h=>[...h.scrCoords]),k.current===null&&g({action:y.mouseDownOnPolyline})}),C.current=e.nVertices,p}function L(){r.current.off("drag"),r.current.off("down"),r.current.off("up"),s.removeObject(r.current),r.current=null;for(let n=0;n.1||Math.abs(a.y-m.current[1])>.1)if(b.current=n,n===-1){v.current=U(a),g({action:y.movePolyline,args:{pointCoords:v.current,transient:!0,skippable:!0}}),r.current.updateTransformMatrix();let u=r.current.transformMat[1][0],o=r.current.transformMat[2][0];for(let c=0;cn.length!==2))L();else{let n=!0;for(let t of e.numericalVertices)Number.isFinite(t[0])||(n=!1),Number.isFinite(t[1])||(n=!1);let a=!e.draggable||e.fixed;r.current.visProp.fixed=a,r.current.visProp.highlight=!a;let u=10*e.layer+Y,o=r.current.visProp.layer!==u,c=10*e.layer+_;if(o&&(r.current.setAttribute({layer:u}),P.current.layer=c),e.nVertices>C.current)for(let t=C.current;tO(t,!0)),i.current[t].on("up",f=>O(t,!1)),i.current[t].on("down",f=>b.current=null);else if(e.nVertices()=>{r.current&&L()},[]);function T(){if(e.numericalVertices.length!==e.nVertices||e.numericalVertices.some(l=>l.length!==2))return null;let n=!0;for(let l of e.numericalVertices)Number.isFinite(l[0])||(n=!1),Number.isFinite(l[1])||(n=!1);let a=!e.draggable||e.fixed,u=E==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;u=u.toLowerCase();let o={name:e.labelForGraph,visible:!e.hidden&&n,withLabel:e.showLabel&&e.labelForGraph!=="",layer:10*e.layer+Y,fixed:a,strokeColor:u,strokeOpacity:e.selectedStyle.lineOpacity,highlightStrokeColor:u,highlightStrokeOpacity:e.selectedStyle.lineOpacity*.5,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,dash:A(e.selectedStyle.lineStyle),highlight:!a,lineCap:"butt"},c=!e.verticesDraggable||e.fixed;P.current=Object.assign({},o),Object.assign(P.current,{fixed:!1,highlight:!0,withLabel:!1,fillColor:"none",strokeColor:"none",highlightStrokeColor:"none",highlightFillColor:getComputedStyle(document.documentElement).getPropertyValue("--mainGray"),layer:10*e.layer+_}),(c||e.hidden||!n)&&(P.current.visible=!1),o.label={highlight:!1},e.labelHasLatex&&(o.label.useMathJax=!0),e.applyStyleToLabel?o.label.strokeColor=u:o.label.strokeColor="var(--canvastext)",i.current=[];for(let l=0;l{x.push(l[0]),R.push(l[1])});let p=s.create("curve",[x,R],o);for(let l=0;lO(l,h)),i.current[l].on("up",()=>M(l)),i.current[l].on("down",h=>{b.current=null,m.current=[h.x,h.y],k.current=l,g({action:y.mouseDownOnPolyline})});return p.on("drag",l=>O(-1,l)),p.on("up",()=>M(-1)),p.on("down",function(l){b.current=null,m.current=[l.x,l.y],X.current=p.points.map(h=>[...h.scrCoords]),k.current===null&&g({action:y.mouseDownOnPolyline})}),C.current=e.nVertices,p}function L(){r.current.off("drag"),r.current.off("down"),r.current.off("up"),s.removeObject(r.current),r.current=null;for(let n=0;n.1||Math.abs(a.y-m.current[1])>.1)if(b.current=n,n===-1){v.current=U(a),g({action:y.movePolyline,args:{pointCoords:v.current,transient:!0,skippable:!0}}),r.current.updateTransformMatrix();let u=r.current.transformMat[1][0],o=r.current.transformMat[2][0];for(let c=0;cn.length!==2))L();else{let n=!0;for(let t of e.numericalVertices)Number.isFinite(t[0])||(n=!1),Number.isFinite(t[1])||(n=!1);let a=!e.draggable||e.fixed;r.current.visProp.fixed=a,r.current.visProp.highlight=!a;let u=10*e.layer+Y,o=r.current.visProp.layer!==u,c=10*e.layer+_;if(o&&(r.current.setAttribute({layer:u}),P.current.layer=c),e.nVertices>C.current)for(let t=C.current;tO(t,!0)),i.current[t].on("up",f=>O(t,!1)),i.current[t].on("down",f=>b.current=null);else if(e.nVertices{r({action:i.recordVisibilityChange,args:{isVisible:o}})};return m.useEffect(()=>()=>{r({action:i.recordVisibilityChange,args:{isVisible:!1}})},[]),s.hidden?null:a(f,{partialVisibility:!0,onChange:l,children:u("pre",{id:e,style:{margin:"12px 0"},children:[a("a",{name:e}),t]})})});export{g as default}; diff --git a/dist/assets/pre-f575ed61.js b/dist/assets/pre-f575ed61.js new file mode 100644 index 0000000000..58efdd84d9 --- /dev/null +++ b/dist/assets/pre-f575ed61.js @@ -0,0 +1 @@ +import{av as c,bp as d,r as m,j as a,a as p}from"./index-7074710c.js";import{V as u}from"./visibility-sensor-7d414852.js";const g=c.memo(function(s){let{name:h,id:e,SVs:t,children:n,actions:i,callAction:r}=d(s),l=o=>{r({action:i.recordVisibilityChange,args:{isVisible:o}})};return m.useEffect(()=>()=>{r({action:i.recordVisibilityChange,args:{isVisible:!1}})},[]),t.hidden?null:a(u,{partialVisibility:!0,onChange:l,children:p("pre",{id:e,style:{margin:"12px 0"},children:[a("a",{name:e}),n]})})});export{g as default}; diff --git a/dist/assets/q-2ee17014.js b/dist/assets/q-2ee17014.js new file mode 100644 index 0000000000..32befa4155 --- /dev/null +++ b/dist/assets/q-2ee17014.js @@ -0,0 +1 @@ +import{av as s,bp as t,a as d,F as i,j as m}from"./index-7074710c.js";const c=s.memo(function(e){let{name:l,id:a,SVs:n,children:r}=t(e);return n.hidden?null:d(i,{children:[m("a",{name:a}),"“",r,"”"]})});export{c as default}; diff --git a/dist/assets/q-6e12a53c.js b/dist/assets/q-6e12a53c.js deleted file mode 100644 index 19cccec4c0..0000000000 --- a/dist/assets/q-6e12a53c.js +++ /dev/null @@ -1 +0,0 @@ -import{av as s,bn as t,a as d,F as i,j as m}from"./index-99a56692.js";const c=s.memo(function(e){let{name:l,id:n,SVs:a,children:r}=t(e);return a.hidden?null:d(i,{children:[m("a",{name:n}),"“",r,"”"]})});export{c as default}; diff --git a/dist/assets/ray-c17c1d64.js b/dist/assets/ray-8d758dd7.js similarity index 94% rename from dist/assets/ray-c17c1d64.js rename to dist/assets/ray-8d758dd7.js index 0dbf275314..ef3da15255 100644 --- a/dist/assets/ray-c17c1d64.js +++ b/dist/assets/ray-8d758dd7.js @@ -1 +1 @@ -import{av as D,bn as _,r as n,l as T,bs as A,j as O,F as X}from"./index-99a56692.js";import{BoardContext as J,LINE_LAYER_OFFSET as x}from"./graph-57e1e537.js";import"./css-14ccef8c.js";import"./visibility-sensor-55e75ed1.js";const N=D.memo(function u(E){let{name:W,id:F,SVs:e,actions:p,sourceOfUpdate:M,callAction:f}=_(E);u.ignoreActionsWithoutCore=!0;const c=n.useContext(J);let r=n.useRef(null),d=n.useRef(!1),g=n.useRef(!1),b=n.useRef(!1),v=n.useRef(!1),h=n.useRef(null),m=n.useRef(null),S=n.useRef(null);m.current=e.numericalEndpoint,S.current=e.numericalThroughpoint;const R=T(A);n.useEffect(()=>()=>{Object.keys(r.current).length!==0&&k()},[]);function G(){if(e.numericalEndpoint.length!==2||e.numericalThroughpoint.length!==2){r.current=null;return}let i=!e.draggable||e.fixed,l=R==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;l=l.toLowerCase();var o={name:e.labelForGraph,visible:!e.hidden,withLabel:e.showLabel&&e.labelForGraph!=="",layer:10*e.layer+x,fixed:i,strokeColor:l,strokeOpacity:e.selectedStyle.lineOpacity,highlightStrokeColor:l,highlightStrokeOpacity:e.selectedStyle.lineOpacity*.5,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,dash:w(e.selectedStyle.lineStyle),highlight:!i,straightFirst:!1};o.label={highlight:!1},e.labelHasLatex&&(o.label.useMathJax=!0),e.applyStyleToLabel?o.label.strokeColor=l:o.label.strokeColor="var(--canvastext)";let s=[[...e.numericalEndpoint],[...e.numericalThroughpoint]],a=c.create("line",s,o);a.on("drag",function(t){(Math.abs(t.x-d.current[0])>.1||Math.abs(t.y-d.current[1])>.1)&&(b.current=!0,h.current=L(t),f({action:p.moveRay,args:{endpointcoords:h.current[0],throughcoords:h.current[1],transient:!0,skippable:!0}})),r.current.point1.coords.setCoordinates(JXG.COORDS_BY_USER,m.current),r.current.point2.coords.setCoordinates(JXG.COORDS_BY_USER,S.current)}),a.on("up",function(t){b.current?f({action:p.moveRay,args:{endpointcoords:h.current[0],throughcoords:h.current[1]}}):f({action:p.rayClicked})}),a.on("down",function(t){b.current=!1,d.current=[t.x,t.y],g.current=[[...a.point1.coords.scrCoords],[...a.point2.coords.scrCoords]],f({action:p.mouseDownOnRay})}),v.current=e.showLabel&&e.labelForGraph!=="",r.current=a}function k(){r.current.off("drag"),r.current.off("down"),r.current.off("up"),c.removeObject(r.current),r.current=null}function L(i){var l=c.origin.scrCoords;let o=[];for(let s=0;s<2;s++){let a=(g.current[s][1]+i.x-d.current[0]-l[1])/c.unitX,t=(l[2]-(g.current[s][2]+i.y-d.current[1]))/c.unitY;o.push([a,t])}return o}if(c)if(r.current===null)G();else if(e.numericalEndpoint.length!==2||e.numericalThroughpoint.length!==2)k();else{let i=!0;for(let y of[e.numericalEndpoint,e.numericalThroughpoint])Number.isFinite(y[0])||(i=!1),Number.isFinite(y[1])||(i=!1);r.current.point1.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalEndpoint),r.current.point2.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalThroughpoint);let l=!e.hidden;if(i){let y=r.current.visProp.visible!==l;r.current.visProp.visible=l,r.current.visPropCalc.visible=l,y&&r.current.setAttribute({visible:l})}else r.current.visProp.visible=!1,r.current.visPropCalc.visible=!1;let o=!e.draggable||e.fixed;r.current.visProp.fixed=o,r.current.visProp.highlight=!o;let s=10*e.layer+x;r.current.visProp.layer!==s&&r.current.setAttribute({layer:s});let t=R==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;t=t.toLowerCase(),r.current.visProp.strokecolor!==t&&(r.current.visProp.strokecolor=t,r.current.visProp.highlightstrokecolor=t),r.current.visProp.strokewidth!==e.selectedStyle.lineWidth&&(r.current.visProp.strokewidth=e.selectedStyle.lineWidth,r.current.visProp.highlightstrokewidth=e.selectedStyle.lineWidth),r.current.visProp.strokeopacity!==e.selectedStyle.lineOpacity&&(r.current.visProp.strokeopacity=e.selectedStyle.lineOpacity,r.current.visProp.highlightstrokeopacity=e.selectedStyle.lineOpacity*.5);let P=w(e.selectedStyle.lineStyle);r.current.visProp.dash!==P&&(r.current.visProp.dash=P),r.current.name=e.labelForGraph;let C=e.showLabel&&e.labelForGraph!=="";C!=v.current&&(r.current.setAttribute({withlabel:C}),v.current=C),r.current.needsUpdate=!0,r.current.update(),r.current.hasLabel&&(e.applyStyleToLabel?r.current.label.visProp.strokecolor=t:r.current.label.visProp.strokecolor="var(--canvastext)",r.current.label.needsUpdate=!0,r.current.label.update()),c.updateRenderer()}return e.hidden?null:O(X,{children:O("a",{name:F})})});function w(u){return u==="solid"?0:u==="dashed"?2:u==="dotted"?1:0}export{N as default}; +import{av as D,bp as _,r as n,l as T,bu as A,j as O,F as X}from"./index-7074710c.js";import{BoardContext as J,LINE_LAYER_OFFSET as x}from"./graph-71cec529.js";import"./css-14ccef8c.js";import"./visibility-sensor-7d414852.js";const N=D.memo(function u(E){let{name:W,id:F,SVs:e,actions:p,sourceOfUpdate:M,callAction:f}=_(E);u.ignoreActionsWithoutCore=!0;const c=n.useContext(J);let r=n.useRef(null),d=n.useRef(!1),g=n.useRef(!1),b=n.useRef(!1),v=n.useRef(!1),h=n.useRef(null),m=n.useRef(null),S=n.useRef(null);m.current=e.numericalEndpoint,S.current=e.numericalThroughpoint;const R=T(A);n.useEffect(()=>()=>{Object.keys(r.current).length!==0&&k()},[]);function G(){if(e.numericalEndpoint.length!==2||e.numericalThroughpoint.length!==2){r.current=null;return}let i=!e.draggable||e.fixed,l=R==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;l=l.toLowerCase();var o={name:e.labelForGraph,visible:!e.hidden,withLabel:e.showLabel&&e.labelForGraph!=="",layer:10*e.layer+x,fixed:i,strokeColor:l,strokeOpacity:e.selectedStyle.lineOpacity,highlightStrokeColor:l,highlightStrokeOpacity:e.selectedStyle.lineOpacity*.5,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,dash:w(e.selectedStyle.lineStyle),highlight:!i,straightFirst:!1};o.label={highlight:!1},e.labelHasLatex&&(o.label.useMathJax=!0),e.applyStyleToLabel?o.label.strokeColor=l:o.label.strokeColor="var(--canvastext)";let s=[[...e.numericalEndpoint],[...e.numericalThroughpoint]],a=c.create("line",s,o);a.on("drag",function(t){(Math.abs(t.x-d.current[0])>.1||Math.abs(t.y-d.current[1])>.1)&&(b.current=!0,h.current=L(t),f({action:p.moveRay,args:{endpointcoords:h.current[0],throughcoords:h.current[1],transient:!0,skippable:!0}})),r.current.point1.coords.setCoordinates(JXG.COORDS_BY_USER,m.current),r.current.point2.coords.setCoordinates(JXG.COORDS_BY_USER,S.current)}),a.on("up",function(t){b.current?f({action:p.moveRay,args:{endpointcoords:h.current[0],throughcoords:h.current[1]}}):f({action:p.rayClicked})}),a.on("down",function(t){b.current=!1,d.current=[t.x,t.y],g.current=[[...a.point1.coords.scrCoords],[...a.point2.coords.scrCoords]],f({action:p.mouseDownOnRay})}),v.current=e.showLabel&&e.labelForGraph!=="",r.current=a}function k(){r.current.off("drag"),r.current.off("down"),r.current.off("up"),c.removeObject(r.current),r.current=null}function L(i){var l=c.origin.scrCoords;let o=[];for(let s=0;s<2;s++){let a=(g.current[s][1]+i.x-d.current[0]-l[1])/c.unitX,t=(l[2]-(g.current[s][2]+i.y-d.current[1]))/c.unitY;o.push([a,t])}return o}if(c)if(r.current===null)G();else if(e.numericalEndpoint.length!==2||e.numericalThroughpoint.length!==2)k();else{let i=!0;for(let y of[e.numericalEndpoint,e.numericalThroughpoint])Number.isFinite(y[0])||(i=!1),Number.isFinite(y[1])||(i=!1);r.current.point1.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalEndpoint),r.current.point2.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalThroughpoint);let l=!e.hidden;if(i){let y=r.current.visProp.visible!==l;r.current.visProp.visible=l,r.current.visPropCalc.visible=l,y&&r.current.setAttribute({visible:l})}else r.current.visProp.visible=!1,r.current.visPropCalc.visible=!1;let o=!e.draggable||e.fixed;r.current.visProp.fixed=o,r.current.visProp.highlight=!o;let s=10*e.layer+x;r.current.visProp.layer!==s&&r.current.setAttribute({layer:s});let t=R==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;t=t.toLowerCase(),r.current.visProp.strokecolor!==t&&(r.current.visProp.strokecolor=t,r.current.visProp.highlightstrokecolor=t),r.current.visProp.strokewidth!==e.selectedStyle.lineWidth&&(r.current.visProp.strokewidth=e.selectedStyle.lineWidth,r.current.visProp.highlightstrokewidth=e.selectedStyle.lineWidth),r.current.visProp.strokeopacity!==e.selectedStyle.lineOpacity&&(r.current.visProp.strokeopacity=e.selectedStyle.lineOpacity,r.current.visProp.highlightstrokeopacity=e.selectedStyle.lineOpacity*.5);let P=w(e.selectedStyle.lineStyle);r.current.visProp.dash!==P&&(r.current.visProp.dash=P),r.current.name=e.labelForGraph;let C=e.showLabel&&e.labelForGraph!=="";C!=v.current&&(r.current.setAttribute({withlabel:C}),v.current=C),r.current.needsUpdate=!0,r.current.update(),r.current.hasLabel&&(e.applyStyleToLabel?r.current.label.visProp.strokecolor=t:r.current.label.visProp.strokecolor="var(--canvastext)",r.current.label.needsUpdate=!0,r.current.label.update()),c.updateRenderer()}return e.hidden?null:O(X,{children:O("a",{name:F})})});function w(u){return u==="solid"?0:u==="dashed"?2:u==="dotted"?1:0}export{N as default}; diff --git a/dist/assets/ref-b907f9de.js b/dist/assets/ref-9e5f0fce.js similarity index 73% rename from dist/assets/ref-b907f9de.js rename to dist/assets/ref-9e5f0fce.js index 28d25a7e14..f69ed241c7 100644 --- a/dist/assets/ref-b907f9de.js +++ b/dist/assets/ref-9e5f0fce.js @@ -1,4 +1,4 @@ -import{av as R,bn as B,l as s,p as w,G as T,ab as I,u as j,e as C,bx as _,a as p,j as r,by as $,s as A}from"./index-99a56692.js";const b=A.button` +import{av as y,bp as B,l as s,p as w,G as T,ab as I,u as j,e as A,bz as C,a as p,j as r,bA as _,s as $}from"./index-7074710c.js";const b=$.button` position: relative; height: 24px; display: inline-block; @@ -22,4 +22,4 @@ import{av as R,bn as B,l as s,p as w,G as T,ab as I,u as j,e as C,bx as _,a as p outline: 2px solid var(--mainBlue); outline-offset: 2px; } -`,V=R.memo(function(v){let{name:d,id:t,SVs:e,children:c}=B(v);const g=s(w),m=s(T(e.doenetId)),i=s(I);let{search:h}=j(),x=C();if(e.hidden)return null;let o=c;c.length===0&&(o=e.linkText);let{targetForATag:l,url:n,haveValidTarget:f,externalUri:k}=_({cid:e.cid,doenetId:e.doenetId,variantIndex:e.variantIndex,edit:e.edit,hash:e.hash,page:e.page,givenUri:e.uri,targetName:e.targetName,pageToolView:g,inCourse:Object.keys(m).length>0,search:h,id:t});if(e.createButton)return l==="_blank"?p("span",{id:t,children:[r("a",{name:t}),r(b,{id:t+"_button",onClick:()=>window.open(n,l),disabled:e.disabled,children:e.linkText})]}):p("span",{id:t,children:[r("a",{name:t}),r(b,{id:t+"_button",onClick:()=>x(n),disabled:e.disabled,children:e.linkText})]});if(f){if(k||n==="#")return r("a",{style:{color:"var(--mainBlue)",borderRadius:"5px"},target:l,id:d,name:d,href:n,children:o});{let y=i===window?"scrollY":"scrollTop",u={fromLink:!0};return Object.defineProperty(u,"previousScrollPosition",{get:()=>i==null?void 0:i[y],enumerable:!0}),r($,{style:{color:"var(--mainBlue)",borderRadius:"5px"},target:l,id:t,name:t,to:n,state:u,children:o})}}else return r("span",{id:t,children:o})});export{V as default}; +`,V=y.memo(function(v){let{name:d,id:t,SVs:e,children:c}=B(v);const g=s(w),m=s(T(e.doenetId)),i=s(I);let{search:h}=j(),x=A();if(e.hidden)return null;let o=c;c.length===0&&(o=e.linkText);let{targetForATag:l,url:n,haveValidTarget:f,externalUri:k}=C({cid:e.cid,doenetId:e.doenetId,variantIndex:e.variantIndex,edit:e.edit,hash:e.hash,page:e.page,givenUri:e.uri,targetName:e.targetName,pageToolView:g,inCourse:Object.keys(m).length>0,search:h,id:t});if(e.createButton)return l==="_blank"?p("span",{id:t,children:[r("a",{name:t}),r(b,{id:t+"_button",onClick:()=>window.open(n,l),disabled:e.disabled,children:e.linkText})]}):p("span",{id:t,children:[r("a",{name:t}),r(b,{id:t+"_button",onClick:()=>x(n),disabled:e.disabled,children:e.linkText})]});if(f){if(k||n==="#")return r("a",{style:{color:"var(--mainBlue)",borderRadius:"5px"},target:l,id:d,name:d,href:n,children:o});{let R=i===window?"scrollY":"scrollTop",u={fromLink:!0};return Object.defineProperty(u,"previousScrollPosition",{get:()=>i==null?void 0:i[R],enumerable:!0}),r(_,{style:{color:"var(--mainBlue)",borderRadius:"5px"},target:l,id:t,name:t,to:n,state:u,children:o})}}else return r("span",{id:t,children:o})});export{V as default}; diff --git a/dist/assets/regionBetweenCurveXAxis-a859244d.js b/dist/assets/regionBetweenCurveXAxis-eaed737c.js similarity index 89% rename from dist/assets/regionBetweenCurveXAxis-a859244d.js rename to dist/assets/regionBetweenCurveXAxis-eaed737c.js index 2d511712ad..a393d3cfe2 100644 --- a/dist/assets/regionBetweenCurveXAxis-a859244d.js +++ b/dist/assets/regionBetweenCurveXAxis-eaed737c.js @@ -1 +1 @@ -import{av as L,bn as S,r as a,l as x,bs as F,bt as v,j as o,F as y}from"./index-99a56692.js";import{BoardContext as O,LINE_LAYER_OFFSET as b}from"./graph-57e1e537.js";import"./css-14ccef8c.js";import"./visibility-sensor-55e75ed1.js";const P=L.memo(function h(g){let{name:U,id:s,SVs:e}=S(g);h.ignoreActionsWithoutCore=!0;const t=a.useContext(O);let n=a.useRef(null),r=a.useRef(null);const d=x(F);a.useEffect(()=>()=>{r.current!==null&&f()},[]);function m(){if(!e.haveFunction||e.boundaryValues.length!==2||!e.boundaryValues.every(Number.isFinite))return null;let l=d==="dark"?e.selectedStyle.fillColorDarkMode:e.selectedStyle.fillColor;l=l.toLowerCase();let i={name:e.labelForGraph,visible:!e.hidden,withLabel:e.showLabel&&e.labelForGraph!=="",fixed:!0,layer:10*e.layer+b,fillColor:l,fillOpacity:e.selectedStyle.fillOpacity,highlight:!1,curveLeft:{visible:!1},curveRight:{visible:!1}};i.label={highlight:!1};let c=v(e.fDefinition);return n.current=t.create("functiongraph",c,{visible:!1}),t.create("integral",[e.boundaryValues,n.current],i)}function f(){r.current&&(t.removeObject(r.current),r.current=null,t.removeObject(n.current),n.current=null)}if(t){if(r.current===null)r.current=m();else if(!e.haveFunction||e.boundaryValues.length!==2||!e.boundaryValues.every(Number.isFinite))f();else{let l=v(e.fDefinition);n.current.Y=l,r.current.visProp.visible=!e.hidden,r.current.visPropCalc.visible=!e.hidden;let[i,c]=e.boundaryValues,[C,R]=e.boundaryValues.map(l);r.current.curveLeft.coords.setCoordinates(JXG.COORDS_BY_USER,[i,C]),r.current.curveRight.coords.setCoordinates(JXG.COORDS_BY_USER,[c,R]);let p=10*e.layer+b;r.current.visProp.layer!==p&&r.current.setAttribute({layer:p});let u=d==="dark"?e.selectedStyle.fillColorDarkMode:e.selectedStyle.fillColor;u=u.toLowerCase(),r.current.visProp.fillcolor!==u&&(r.current.visProp.fillcolor=u),r.current.visProp.fillopacity!==e.selectedStyle.fillOpacity&&(r.current.visProp.fillopacity=e.selectedStyle.fillOpacity),r.current.curveLeft.needsUpdate=!0,r.current.curveLeft.update(),r.current.curveLeft.fullUpdate(),r.current.curveRight.needsUpdate=!0,r.current.curveLeft.update(),r.current.curveRight.fullUpdate(),r.current.needsUpdate=!0,r.current.curveLeft.update(),r.current.fullUpdate(),t.update(),t.fullUpdate(),t.updateRenderer()}return o(y,{children:o("a",{name:s})})}return e.hidden?null:o(y,{children:o("a",{name:s})})});export{P as default}; +import{av as L,bp as S,r as a,l as x,bu as F,bv as v,j as o,F as y}from"./index-7074710c.js";import{BoardContext as O,LINE_LAYER_OFFSET as b}from"./graph-71cec529.js";import"./css-14ccef8c.js";import"./visibility-sensor-7d414852.js";const P=L.memo(function h(g){let{name:U,id:s,SVs:e}=S(g);h.ignoreActionsWithoutCore=!0;const t=a.useContext(O);let n=a.useRef(null),r=a.useRef(null);const d=x(F);a.useEffect(()=>()=>{r.current!==null&&f()},[]);function m(){if(!e.haveFunction||e.boundaryValues.length!==2||!e.boundaryValues.every(Number.isFinite))return null;let l=d==="dark"?e.selectedStyle.fillColorDarkMode:e.selectedStyle.fillColor;l=l.toLowerCase();let i={name:e.labelForGraph,visible:!e.hidden,withLabel:e.showLabel&&e.labelForGraph!=="",fixed:!0,layer:10*e.layer+b,fillColor:l,fillOpacity:e.selectedStyle.fillOpacity,highlight:!1,curveLeft:{visible:!1},curveRight:{visible:!1}};i.label={highlight:!1};let c=v(e.fDefinition);return n.current=t.create("functiongraph",c,{visible:!1}),t.create("integral",[e.boundaryValues,n.current],i)}function f(){r.current&&(t.removeObject(r.current),r.current=null,t.removeObject(n.current),n.current=null)}if(t){if(r.current===null)r.current=m();else if(!e.haveFunction||e.boundaryValues.length!==2||!e.boundaryValues.every(Number.isFinite))f();else{let l=v(e.fDefinition);n.current.Y=l,r.current.visProp.visible=!e.hidden,r.current.visPropCalc.visible=!e.hidden;let[i,c]=e.boundaryValues,[C,R]=e.boundaryValues.map(l);r.current.curveLeft.coords.setCoordinates(JXG.COORDS_BY_USER,[i,C]),r.current.curveRight.coords.setCoordinates(JXG.COORDS_BY_USER,[c,R]);let p=10*e.layer+b;r.current.visProp.layer!==p&&r.current.setAttribute({layer:p});let u=d==="dark"?e.selectedStyle.fillColorDarkMode:e.selectedStyle.fillColor;u=u.toLowerCase(),r.current.visProp.fillcolor!==u&&(r.current.visProp.fillcolor=u),r.current.visProp.fillopacity!==e.selectedStyle.fillOpacity&&(r.current.visProp.fillopacity=e.selectedStyle.fillOpacity),r.current.curveLeft.needsUpdate=!0,r.current.curveLeft.update(),r.current.curveLeft.fullUpdate(),r.current.curveRight.needsUpdate=!0,r.current.curveLeft.update(),r.current.curveRight.fullUpdate(),r.current.needsUpdate=!0,r.current.curveLeft.update(),r.current.fullUpdate(),t.update(),t.fullUpdate(),t.updateRenderer()}return o(y,{children:o("a",{name:s})})}return e.hidden?null:o(y,{children:o("a",{name:s})})});export{P as default}; diff --git a/dist/assets/row-53a40069.js b/dist/assets/row-83da3eab.js similarity index 84% rename from dist/assets/row-53a40069.js rename to dist/assets/row-83da3eab.js index b4d3a87a9a..600d6557bc 100644 --- a/dist/assets/row-53a40069.js +++ b/dist/assets/row-83da3eab.js @@ -1 +1 @@ -import{av as n,bn as d,j as o}from"./index-99a56692.js";const m=n.memo(function(i){let{name:s,id:r,SVs:e,children:l}=d(i);if(e.hidden)return null;let t={};return e.valign!==null&&(t.verticalAlign=e.valign),e.left!=="none"&&(t.borderLeftStyle="solid",e.left==="minor"?t.borderLeftWidth="thin":e.left==="medium"?t.borderLeftWidth="medium":t.borderLeftWidth="thick"),o("tr",{id:r,style:t,children:l})});export{m as default}; +import{av as n,bp as d,j as o}from"./index-7074710c.js";const m=n.memo(function(i){let{name:s,id:r,SVs:e,children:l}=d(i);if(e.hidden)return null;let t={};return e.valign!==null&&(t.verticalAlign=e.valign),e.left!=="none"&&(t.borderLeftStyle="solid",e.left==="minor"?t.borderLeftWidth="thin":e.left==="medium"?t.borderLeftWidth="medium":t.borderLeftWidth="thick"),o("tr",{id:r,style:t,children:l})});export{m as default}; diff --git a/dist/assets/section-b73f2819.js b/dist/assets/section-ed8954fc.js similarity index 95% rename from dist/assets/section-b73f2819.js rename to dist/assets/section-ed8954fc.js index f001c461cb..6888807bc7 100644 --- a/dist/assets/section-b73f2819.js +++ b/dist/assets/section-ed8954fc.js @@ -1 +1 @@ -import{av as A,bn as S,r as x,a as n,F as m,j as r,i as p,bz as V,b2 as T,bp as _,a0 as I,aP as L,bq as j}from"./index-99a56692.js";import{V as g}from"./visibility-sensor-55e75ed1.js";const F=A.memo(function(R){var C;let{name:P,id:t,SVs:e,children:d,actions:b,callAction:f}=S(R),v=i=>{f({action:b.recordVisibilityChange,args:{isVisible:i}})};if(x.useEffect(()=>()=>{f({action:b.recordVisibilityChange,args:{isVisible:!1}})},[]),e.hidden)return null;let c=x.useRef(null);const B=()=>{c.current="unvalidated",e.justSubmitted&&(e.creditAchieved===1?c.current="correct":e.creditAchieved===0?c.current="incorrect":c.current="partialcorrect")};let k=()=>f({action:b.submitAllAnswers}),a;if(e.titleChildName){for(let[i,h]of d.entries())if(((C=h==null?void 0:h.props)==null?void 0:C.componentInstructions.componentName)===e.titleChildName){a=d[i],d.splice(i,1);break}}a?a=n(m,{children:[e.titlePrefix,a]}):a=e.title;let l=null,s=t+"_title";switch(e.collapsible&&(e.open?a=n(m,{children:[r(p,{icon:V})," ",a," (click to close)"]}):a=n(m,{children:[r(p,{icon:T})," ",a," (click to open)"]})),e.level){case 0:l=r("h1",{id:s,children:a});break;case 1:l=r("h2",{id:s,children:a});break;case 2:l=r("h3",{id:s,children:a});break;case 3:l=r("h4",{id:s,children:a});break;case 4:l=r("h5",{id:s,children:a});break;default:l=r("h6",{id:s,children:a});break}let o=null;if(e.createSubmitAllButton&&!e.suppressCheckwork){B();let i={height:"23px",display:"inline-block",backgroundColor:"var(--mainBlue)",padding:"1px 6px 1px 6px",color:"white",fontWeight:"bold",marginBottom:"30px"},h=e.submitLabel;if(e.showCorrectness||(h=e.submitLabelNoCorrectness),o=n("button",{id:t+"_submit",tabIndex:"0",style:i,onClick:k,onKeyPress:y=>{y.key==="Enter"&&k()},children:[r(p,{icon:_,transform:{rotate:90}})," ",h]}),e.showCorrectness){if(c.current==="correct")i.backgroundColor="var(--mainGreen)",o=n("span",{id:t+"_correct",style:i,children:[r(p,{icon:I}),"  Correct"]});else if(c.current==="incorrect")i.backgroundColor="var(--mainRed)",o=n("span",{id:t+"_incorrect",style:i,children:[r(p,{icon:L}),"  Incorrect"]});else if(c.current==="partialcorrect"){i.backgroundColor="var(--mainYellow)";let w=`${Math.round(e.creditAchieved*100)}% Correct`;o=r("span",{id:t+"_partial",style:i,children:w})}}else c.current!=="unvalidated"&&(i.backgroundColor="var(--mainPurple)",o=n("span",{id:t+"_saved",style:i,children:[r(p,{icon:j}),"  Response Saved"]}));o=r("div",{children:o})}let u=n(m,{children:[r("a",{name:t}),l,d,o]});if(e.collapsible){let i=null;e.open&&(i=n("div",{style:{display:"block",padding:"6px"},children:[d,o]})),u=n("div",{style:{border:"var(--mainBorder)",borderRadius:"var(--mainBorderRadius)"},children:[n("div",{style:{backgroundColor:"var(--mainGray)",cursor:"pointer",padding:"6px",borderBottom:e.open?"var(--mainBorder)":"none",borderTopLeftRadius:"var(--mainBorderRadius)",borderTopRightRadius:"var(--mainBorderRadius)"},onClick:()=>f({action:e.open?b.closeSection:b.revealSection}),children:[r("a",{name:t}),l]}),i]})}else e.boxed&&(u=n("div",{style:{border:"var(--mainBorder)",borderRadius:"var(--mainBorderRadius)"},children:[n("div",{style:{padding:"6px",borderBottom:"var(--mainBorder)",backgroundColor:"var(--mainGray)",borderTopLeftRadius:"var(--mainBorderRadius)",borderTopRightRadius:"var(--mainBorderRadius)"},children:[r("a",{name:t}),l,r("br",{})]}),n("div",{style:{display:"block",padding:"6px"},children:[d,o]})]}));switch(e.containerTag){case"aside":return r(g,{partialVisibility:!0,onChange:v,children:n("aside",{id:t,style:{margin:"12px 0"},children:[" ",u," "]})});case"div":return r(g,{partialVisibility:!0,onChange:v,children:n("div",{id:t,style:{margin:"12px 0"},children:[" ",u," "]})});case"none":return r(m,{children:u});default:return r(g,{partialVisibility:!0,onChange:v,children:n("section",{id:t,style:{margin:"12px 0"},children:[" ",u," "]})})}});export{F as default}; +import{av as A,bp as S,r as x,a as n,F as m,j as r,i as p,bB as V,b2 as T,br as _,a0 as I,aP as L,bs as j}from"./index-7074710c.js";import{V as g}from"./visibility-sensor-7d414852.js";const F=A.memo(function(R){var C;let{name:P,id:t,SVs:e,children:d,actions:b,callAction:f}=S(R),v=i=>{f({action:b.recordVisibilityChange,args:{isVisible:i}})};if(x.useEffect(()=>()=>{f({action:b.recordVisibilityChange,args:{isVisible:!1}})},[]),e.hidden)return null;let c=x.useRef(null);const B=()=>{c.current="unvalidated",e.justSubmitted&&(e.creditAchieved===1?c.current="correct":e.creditAchieved===0?c.current="incorrect":c.current="partialcorrect")};let k=()=>f({action:b.submitAllAnswers}),a;if(e.titleChildName){for(let[i,h]of d.entries())if(((C=h==null?void 0:h.props)==null?void 0:C.componentInstructions.componentName)===e.titleChildName){a=d[i],d.splice(i,1);break}}a?a=n(m,{children:[e.titlePrefix,a]}):a=e.title;let l=null,s=t+"_title";switch(e.collapsible&&(e.open?a=n(m,{children:[r(p,{icon:V})," ",a," (click to close)"]}):a=n(m,{children:[r(p,{icon:T})," ",a," (click to open)"]})),e.level){case 0:l=r("h1",{id:s,children:a});break;case 1:l=r("h2",{id:s,children:a});break;case 2:l=r("h3",{id:s,children:a});break;case 3:l=r("h4",{id:s,children:a});break;case 4:l=r("h5",{id:s,children:a});break;default:l=r("h6",{id:s,children:a});break}let o=null;if(e.createSubmitAllButton&&!e.suppressCheckwork){B();let i={height:"23px",display:"inline-block",backgroundColor:"var(--mainBlue)",padding:"1px 6px 1px 6px",color:"white",fontWeight:"bold",marginBottom:"30px"},h=e.submitLabel;if(e.showCorrectness||(h=e.submitLabelNoCorrectness),o=n("button",{id:t+"_submit",tabIndex:"0",style:i,onClick:k,onKeyPress:y=>{y.key==="Enter"&&k()},children:[r(p,{icon:_,transform:{rotate:90}})," ",h]}),e.showCorrectness){if(c.current==="correct")i.backgroundColor="var(--mainGreen)",o=n("span",{id:t+"_correct",style:i,children:[r(p,{icon:I}),"  Correct"]});else if(c.current==="incorrect")i.backgroundColor="var(--mainRed)",o=n("span",{id:t+"_incorrect",style:i,children:[r(p,{icon:L}),"  Incorrect"]});else if(c.current==="partialcorrect"){i.backgroundColor="var(--mainYellow)";let w=`${Math.round(e.creditAchieved*100)}% Correct`;o=r("span",{id:t+"_partial",style:i,children:w})}}else c.current!=="unvalidated"&&(i.backgroundColor="var(--mainPurple)",o=n("span",{id:t+"_saved",style:i,children:[r(p,{icon:j}),"  Response Saved"]}));o=r("div",{children:o})}let u=n(m,{children:[r("a",{name:t}),l,d,o]});if(e.collapsible){let i=null;e.open&&(i=n("div",{style:{display:"block",padding:"6px"},children:[d,o]})),u=n("div",{style:{border:"var(--mainBorder)",borderRadius:"var(--mainBorderRadius)"},children:[n("div",{style:{backgroundColor:"var(--mainGray)",cursor:"pointer",padding:"6px",borderBottom:e.open?"var(--mainBorder)":"none",borderTopLeftRadius:"var(--mainBorderRadius)",borderTopRightRadius:"var(--mainBorderRadius)"},onClick:()=>f({action:e.open?b.closeSection:b.revealSection}),children:[r("a",{name:t}),l]}),i]})}else e.boxed&&(u=n("div",{style:{border:"var(--mainBorder)",borderRadius:"var(--mainBorderRadius)"},children:[n("div",{style:{padding:"6px",borderBottom:"var(--mainBorder)",backgroundColor:"var(--mainGray)",borderTopLeftRadius:"var(--mainBorderRadius)",borderTopRightRadius:"var(--mainBorderRadius)"},children:[r("a",{name:t}),l,r("br",{})]}),n("div",{style:{display:"block",padding:"6px"},children:[d,o]})]}));switch(e.containerTag){case"aside":return r(g,{partialVisibility:!0,onChange:v,children:n("aside",{id:t,style:{margin:"12px 0"},children:[" ",u," "]})});case"div":return r(g,{partialVisibility:!0,onChange:v,children:n("div",{id:t,style:{margin:"12px 0"},children:[" ",u," "]})});case"none":return r(m,{children:u});default:return r(g,{partialVisibility:!0,onChange:v,children:n("section",{id:t,style:{margin:"12px 0"},children:[" ",u," "]})})}});export{F as default}; diff --git a/dist/assets/sideBySide-29763439.js b/dist/assets/sideBySide-29763439.js new file mode 100644 index 0000000000..6ca2ba6d64 --- /dev/null +++ b/dist/assets/sideBySide-29763439.js @@ -0,0 +1 @@ +import{av as u,bp as x,r as V,j as t,a as b}from"./index-7074710c.js";import{V as C}from"./visibility-sensor-7d414852.js";const L=u.memo(function(g){let{name:S,id:s,SVs:i,children:n,actions:a,callAction:r}=x(g),c=e=>{r({action:a.recordVisibilityChange,args:{isVisible:e}})};if(V.useEffect(()=>()=>{r({action:a.recordVisibilityChange,args:{isVisible:!1}})},[]),i.hidden)return null;let l=[];const f=i.margins[0],m=i.margins[1],p=n.length;for(let[e,d]of n.entries()){let y=i.widths[e],o=f,h=m;e>0&&(o+=i.gapWidth/2),e{r({action:a.recordVisibilityChange,args:{isVisible:e}})};if(V.useEffect(()=>()=>{r({action:a.recordVisibilityChange,args:{isVisible:!1}})},[]),i.hidden)return null;let l=[];const f=i.margins[0],m=i.margins[1],p=s.length;for(let[e,d]of s.entries()){let y=i.widths[e],o=f,h=m;e>0&&(o+=i.gapWidth/2),ese.round_numbers_to_decimals(l,u).tree;const q=z.div` +import{av as ae,bp as ne,r as L,R as re,bt as ie,a as T,j as n,s as z,b9 as J,bq as se}from"./index-7074710c.js";import{A as U}from"./ActionButton-e5ea2a2f.js";import{A as K}from"./ActionButtonGroup-f4ce05e4.js";let A=(l,u)=>se.round_numbers_to_decimals(l,u).tree;const q=z.div` width: fit-content; height: ${l=>l.labeled&&l.noTicked?"60px":l.labeled?"80px":l.noTicked?"40px":"60px"}; margin-bottom: 12px; diff --git a/dist/assets/solution-3639bb17.js b/dist/assets/solution-1f60217a.js similarity index 88% rename from dist/assets/solution-3639bb17.js rename to dist/assets/solution-1f60217a.js index 6304052ecf..e29b73b9ef 100644 --- a/dist/assets/solution-3639bb17.js +++ b/dist/assets/solution-1f60217a.js @@ -1,4 +1,4 @@ -import{av as y,bn as h,r as k,j as t,a as x,s as S,i as u,bA as b}from"./index-99a56692.js";import{V as R}from"./visibility-sensor-55e75ed1.js";const v=S.span` +import{av as y,bp as h,r as k,j as t,a as x,s as S,i as u,bC as b}from"./index-7074710c.js";import{V as R}from"./visibility-sensor-7d414852.js";const v=S.span` // display: block; // margin: SVs.open ? 12px 4px 0px 4px : 12px 4px 12px 4px; // padding: 6px; @@ -13,4 +13,4 @@ import{av as y,bn as h,r as k,j as t,a as x,s as S,i as u,bA as b}from"./index-9 outline: 2px solid var(--canvastext); outline-offset: 2px; } -`,E=y.memo(function(g){let{name:C,id:a,SVs:o,children:f,actions:e,callAction:i}=h(g),m=n=>{i({action:e.recordVisibilityChange,args:{isVisible:n}})};k.useEffect(()=>()=>{i({action:e.recordVisibilityChange,args:{isVisible:!1}})},[]);let p="open";if(o.hidden)return null;let s,d=null,c={display:"none"},r,l;return o.open?(s=t(u,{icon:b}),p="close",d=f,c={display:"block",margin:"0px 4px 12px 4px",padding:"6px",border:"2px solid var(--canvastext)",borderTop:"0px",borderBottomLeftRadius:"5px",borderBottomRightRadius:"5px",backgroundColor:"var(--canvas)"},l=n=>{n.key==="Enter"&&i({action:e.closeSolution})},o.canBeClosed?r=()=>{i({action:e.closeSolution})}:r=()=>{}):(s=t(u,{icon:b,rotation:90}),r=()=>{i({action:e.revealSolution})},l=n=>{n.key==="Enter"&&i({action:e.revealSolution})}),t(R,{partialVisibility:!0,onChange:m,children:x("aside",{id:a,style:{margin:"12px 0"},children:[t("a",{name:a}),x(v,{style:{display:"block",margin:o.open?"12px 4px 0px 4px":"12px 4px 12px 4px",padding:"6px",border:"2px solid black",borderTopLeftRadius:"5px",borderTopRightRadius:"5px",borderBottomLeftRadius:o.open?"0px":"5px",borderBottomRightRadius:o.open?"0px":"5px",backgroundColor:"var(--mainGray)",cursor:"pointer"},tabIndex:"0",id:a+"_button",onClick:r,onKeyDown:l,children:[s," Solution ",o.message," (click to ",p,")"]}),t("span",{style:c,children:d})]})})});export{E as default}; +`,E=y.memo(function(g){let{name:V,id:a,SVs:o,children:f,actions:e,callAction:i}=h(g),m=n=>{i({action:e.recordVisibilityChange,args:{isVisible:n}})};k.useEffect(()=>()=>{i({action:e.recordVisibilityChange,args:{isVisible:!1}})},[]);let p="open";if(o.hidden)return null;let s,d=null,c={display:"none"},r,l;return o.open?(s=t(u,{icon:b}),p="close",d=f,c={display:"block",margin:"0px 4px 12px 4px",padding:"6px",border:"2px solid var(--canvastext)",borderTop:"0px",borderBottomLeftRadius:"5px",borderBottomRightRadius:"5px",backgroundColor:"var(--canvas)"},l=n=>{n.key==="Enter"&&i({action:e.closeSolution})},o.canBeClosed?r=()=>{i({action:e.closeSolution})}:r=()=>{}):(s=t(u,{icon:b,rotation:90}),r=()=>{i({action:e.revealSolution})},l=n=>{n.key==="Enter"&&i({action:e.revealSolution})}),t(R,{partialVisibility:!0,onChange:m,children:x("aside",{id:a,style:{margin:"12px 0"},children:[t("a",{name:a}),x(v,{style:{display:"block",margin:o.open?"12px 4px 0px 4px":"12px 4px 12px 4px",padding:"6px",border:"2px solid black",borderTopLeftRadius:"5px",borderTopRightRadius:"5px",borderBottomLeftRadius:o.open?"0px":"5px",borderBottomRightRadius:o.open?"0px":"5px",backgroundColor:"var(--mainGray)",cursor:"pointer"},tabIndex:"0",id:a+"_button",onClick:r,onKeyDown:l,children:[s," Solution ",o.message," (click to ",p,")"]}),t("span",{style:c,children:d})]})})});export{E as default}; diff --git a/dist/assets/spreadsheet-ec3406bb.js b/dist/assets/spreadsheet-2720b9d5.js similarity index 99% rename from dist/assets/spreadsheet-ec3406bb.js rename to dist/assets/spreadsheet-2720b9d5.js index a0cf5539c1..7f5172e29a 100644 --- a/dist/assets/spreadsheet-ec3406bb.js +++ b/dist/assets/spreadsheet-2720b9d5.js @@ -1,4 +1,4 @@ -import{aa as Vp,av as Et,bB as mM,bn as Nj,r as Lj,j as Od,a as jj,bC as Bj}from"./index-99a56692.js";import{h as Xe,c as bu,r as Fj}from"./moment-f5bb98f1.js";import{s as DO}from"./css-14ccef8c.js";import{V as Vj}from"./visibility-sensor-55e75ed1.js";var wu=function(e){return e&&e.Math==Math&&e},et=wu(typeof globalThis=="object"&&globalThis)||wu(typeof window=="object"&&window)||wu(typeof self=="object"&&self)||wu(typeof Vp=="object"&&Vp)||function(){return this}()||Function("return this")(),nn={},Le=function(e){try{return!!e()}catch{return!0}},Wj=Le,St=!Wj(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Uj=Le,Ds=!Uj(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),zj=Ds,Su=Function.prototype.call,kt=zj?Su.bind(Su):function(){return Su.apply(Su,arguments)},Hs={},bM={}.propertyIsEnumerable,wM=Object.getOwnPropertyDescriptor,Gj=wM&&!bM.call({1:2},1);Hs.f=Gj?function(t){var r=wM(this,t);return!!r&&r.enumerable}:bM;var Ns=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},SM=Ds,CM=Function.prototype,Wp=CM.call,Yj=SM&&CM.bind.bind(Wp,Wp),_M=SM?Yj:function(e){return function(){return Wp.apply(e,arguments)}},OM=_M,Kj=OM({}.toString),Xj=OM("".slice),Un=function(e){return Xj(Kj(e),8,-1)},qj=Un,Qj=_M,He=function(e){if(qj(e)==="Function")return Qj(e)},Zj=He,Jj=Le,eB=Un,Rd=Object,tB=Zj("".split),Ls=Jj(function(){return!Rd("z").propertyIsEnumerable(0)})?function(e){return eB(e)=="String"?tB(e,""):Rd(e)}:Rd,Nr=function(e){return e==null},rB=Nr,nB=TypeError,rr=function(e){if(rB(e))throw nB("Can't call method on "+e);return e},oB=Ls,iB=rr,dr=function(e){return oB(iB(e))},Up=typeof document=="object"&&document.all,aB=typeof Up>"u"&&Up!==void 0,RM={all:Up,IS_HTMLDDA:aB},EM=RM,lB=EM.all,ut=EM.IS_HTMLDDA?function(e){return typeof e=="function"||e===lB}:function(e){return typeof e=="function"},HO=ut,TM=RM,sB=TM.all,mt=TM.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:HO(e)||e===sB}:function(e){return typeof e=="object"?e!==null:HO(e)},Ed=et,uB=ut,cB=function(e){return uB(e)?e:void 0},on=function(e,t){return arguments.length<2?cB(Ed[e]):Ed[e]&&Ed[e][t]},fB=He,Ro=fB({}.isPrototypeOf),hB=on,Li=hB("navigator","userAgent")||"",kM=et,Td=Li,NO=kM.process,LO=kM.Deno,jO=NO&&NO.versions||LO&&LO.version,BO=jO&&jO.v8,$r,lf;BO&&($r=BO.split("."),lf=$r[0]>0&&$r[0]<4?1:+($r[0]+$r[1]));!lf&&Td&&($r=Td.match(/Edge\/(\d+)/),(!$r||$r[1]>=74)&&($r=Td.match(/Chrome\/(\d+)/),$r&&(lf=+$r[1])));var js=lf,FO=js,dB=Le,sl=!!Object.getOwnPropertySymbols&&!dB(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&FO&&FO<41}),vB=sl,PM=vB&&!Symbol.sham&&typeof Symbol.iterator=="symbol",pB=on,gB=ut,yB=Ro,mB=PM,bB=Object,Bs=mB?function(e){return typeof e=="symbol"}:function(e){var t=pB("Symbol");return gB(t)&&yB(t.prototype,bB(e))},wB=String,ul=function(e){try{return wB(e)}catch{return"Object"}},SB=ut,CB=ul,_B=TypeError,cl=function(e){if(SB(e))return e;throw _B(CB(e)+" is not a function")},OB=cl,RB=Nr,ji=function(e,t){var r=e[t];return RB(r)?void 0:OB(r)},kd=kt,Pd=ut,Ad=mt,EB=TypeError,TB=function(e,t){var r,n;if(t==="string"&&Pd(r=e.toString)&&!Ad(n=kd(r,e))||Pd(r=e.valueOf)&&!Ad(n=kd(r,e))||t!=="string"&&Pd(r=e.toString)&&!Ad(n=kd(r,e)))return n;throw EB("Can't convert object to primitive value")},_o={},kB={get exports(){return _o},set exports(e){_o=e}},VO=et,PB=Object.defineProperty,gS=function(e,t){try{PB(VO,e,{value:t,configurable:!0,writable:!0})}catch{VO[e]=t}return t},AB=et,IB=gS,WO="__core-js_shared__",$B=AB[WO]||IB(WO,{}),yS=$B,UO=yS;(kB.exports=function(e,t){return UO[e]||(UO[e]=t!==void 0?t:{})})("versions",[]).push({version:"3.26.0",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE",source:"https://github.com/zloirock/core-js"});var MB=rr,xB=Object,nr=function(e){return xB(MB(e))},DB=He,HB=nr,NB=DB({}.hasOwnProperty),bt=Object.hasOwn||function(t,r){return NB(HB(t),r)},LB=He,jB=0,BB=Math.random(),FB=LB(1 .toString),Sh=function(e){return"Symbol("+(e===void 0?"":e)+")_"+FB(++jB+BB,36)},VB=et,WB=_o,zO=bt,UB=Sh,GO=sl,AM=PM,Qi=WB("wks"),wi=VB.Symbol,YO=wi&&wi.for,zB=AM?wi:wi&&wi.withoutSetter||UB,lt=function(e){if(!zO(Qi,e)||!(GO||typeof Qi[e]=="string")){var t="Symbol."+e;GO&&zO(wi,e)?Qi[e]=wi[e]:AM&&YO?Qi[e]=YO(t):Qi[e]=zB(t)}return Qi[e]},GB=kt,KO=mt,XO=Bs,YB=ji,KB=TB,XB=lt,qB=TypeError,QB=XB("toPrimitive"),IM=function(e,t){if(!KO(e)||XO(e))return e;var r=YB(e,QB),n;if(r){if(t===void 0&&(t="default"),n=GB(r,e,t),!KO(n)||XO(n))return n;throw qB("Can't convert object to primitive value")}return t===void 0&&(t="number"),KB(e,t)},ZB=IM,JB=Bs,Ch=function(e){var t=ZB(e,"string");return JB(t)?t:t+""},eF=et,qO=mt,zp=eF.document,tF=qO(zp)&&qO(zp.createElement),_h=function(e){return tF?zp.createElement(e):{}},rF=St,nF=Le,oF=_h,$M=!rF&&!nF(function(){return Object.defineProperty(oF("div"),"a",{get:function(){return 7}}).a!=7}),iF=St,aF=kt,lF=Hs,sF=Ns,uF=dr,cF=Ch,fF=bt,hF=$M,QO=Object.getOwnPropertyDescriptor;nn.f=iF?QO:function(t,r){if(t=uF(t),r=cF(r),hF)try{return QO(t,r)}catch{}if(fF(t,r))return sF(!aF(lF.f,t,r),t[r])};var Nt={},dF=St,vF=Le,MM=dF&&vF(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),pF=mt,gF=String,yF=TypeError,Ct=function(e){if(pF(e))return e;throw yF(gF(e)+" is not an object")},mF=St,bF=$M,wF=MM,Cu=Ct,ZO=Ch,SF=TypeError,Id=Object.defineProperty,CF=Object.getOwnPropertyDescriptor,$d="enumerable",Md="configurable",xd="writable";Nt.f=mF?wF?function(t,r,n){if(Cu(t),r=ZO(r),Cu(n),typeof t=="function"&&r==="prototype"&&"value"in n&&xd in n&&!n[xd]){var o=CF(t,r);o&&o[xd]&&(t[r]=n.value,n={configurable:Md in n?n[Md]:o[Md],enumerable:$d in n?n[$d]:o[$d],writable:!1})}return Id(t,r,n)}:Id:function(t,r,n){if(Cu(t),r=ZO(r),Cu(n),bF)try{return Id(t,r,n)}catch{}if("get"in n||"set"in n)throw SF("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var _F=St,OF=Nt,RF=Ns,Bi=_F?function(e,t,r){return OF.f(e,t,RF(1,r))}:function(e,t,r){return e[t]=r,e},Gp={},EF={get exports(){return Gp},set exports(e){Gp=e}},Yp=St,TF=bt,xM=Function.prototype,kF=Yp&&Object.getOwnPropertyDescriptor,mS=TF(xM,"name"),PF=mS&&function(){}.name==="something",AF=mS&&(!Yp||Yp&&kF(xM,"name").configurable),Fs={EXISTS:mS,PROPER:PF,CONFIGURABLE:AF},IF=He,$F=ut,Kp=yS,MF=IF(Function.toString);$F(Kp.inspectSource)||(Kp.inspectSource=function(e){return MF(e)});var DM=Kp.inspectSource,xF=et,DF=ut,JO=xF.WeakMap,HM=DF(JO)&&/native code/.test(String(JO)),HF=_o,NF=Sh,eR=HF("keys"),Oh=function(e){return eR[e]||(eR[e]=NF(e))},Vs={},LF=HM,NM=et,jF=mt,BF=Bi,Dd=bt,Hd=yS,FF=Oh,VF=Vs,tR="Object already initialized",Xp=NM.TypeError,WF=NM.WeakMap,sf,vs,uf,UF=function(e){return uf(e)?vs(e):sf(e,{})},zF=function(e){return function(t){var r;if(!jF(t)||(r=vs(t)).type!==e)throw Xp("Incompatible receiver, "+e+" required");return r}};if(LF||Hd.state){var jr=Hd.state||(Hd.state=new WF);jr.get=jr.get,jr.has=jr.has,jr.set=jr.set,sf=function(e,t){if(jr.has(e))throw Xp(tR);return t.facade=e,jr.set(e,t),t},vs=function(e){return jr.get(e)||{}},uf=function(e){return jr.has(e)}}else{var Zi=FF("state");VF[Zi]=!0,sf=function(e,t){if(Dd(e,Zi))throw Xp(tR);return t.facade=e,BF(e,Zi,t),t},vs=function(e){return Dd(e,Zi)?e[Zi]:{}},uf=function(e){return Dd(e,Zi)}}var zn={set:sf,get:vs,has:uf,enforce:UF,getterFor:zF},GF=Le,YF=ut,_u=bt,qp=St,KF=Fs.CONFIGURABLE,XF=DM,LM=zn,qF=LM.enforce,QF=LM.get,Cc=Object.defineProperty,ZF=qp&&!GF(function(){return Cc(function(){},"length",{value:8}).length!==8}),JF=String(String).split("String"),eV=EF.exports=function(e,t,r){String(t).slice(0,7)==="Symbol("&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!_u(e,"name")||KF&&e.name!==t)&&(qp?Cc(e,"name",{value:t,configurable:!0}):e.name=t),ZF&&r&&_u(r,"arity")&&e.length!==r.arity&&Cc(e,"length",{value:r.arity});try{r&&_u(r,"constructor")&&r.constructor?qp&&Cc(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=qF(e);return _u(n,"source")||(n.source=JF.join(typeof t=="string"?t:"")),e};Function.prototype.toString=eV(function(){return YF(this)&&QF(this).source||XF(this)},"toString");var tV=ut,rV=Nt,nV=Gp,oV=gS,_r=function(e,t,r,n){n||(n={});var o=n.enumerable,i=n.name!==void 0?n.name:t;if(tV(r)&&nV(r,i,n),n.global)o?e[t]=r:oV(t,r);else{try{n.unsafe?e[t]&&(o=!0):delete e[t]}catch{}o?e[t]=r:rV.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Fi={},iV=Math.ceil,aV=Math.floor,lV=Math.trunc||function(t){var r=+t;return(r>0?aV:iV)(r)},sV=lV,Eo=function(e){var t=+e;return t!==t||t===0?0:sV(t)},uV=Eo,cV=Math.max,fV=Math.min,Ws=function(e,t){var r=uV(e);return r<0?cV(r+t,0):fV(r,t)},hV=Eo,dV=Math.min,Vi=function(e){return e>0?dV(hV(e),9007199254740991):0},vV=Vi,Or=function(e){return vV(e.length)},pV=dr,gV=Ws,yV=Or,rR=function(e){return function(t,r,n){var o=pV(t),i=yV(o),a=gV(n,i),l;if(e&&r!=r){for(;i>a;)if(l=o[a++],l!=l)return!0}else for(;i>a;a++)if((e||a in o)&&o[a]===r)return e||a||0;return!e&&-1}},bS={includes:rR(!0),indexOf:rR(!1)},mV=He,Nd=bt,bV=dr,wV=bS.indexOf,SV=Vs,nR=mV([].push),jM=function(e,t){var r=bV(e),n=0,o=[],i;for(i in r)!Nd(SV,i)&&Nd(r,i)&&nR(o,i);for(;t.length>n;)Nd(r,i=t[n++])&&(~wV(o,i)||nR(o,i));return o},wS=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],CV=jM,_V=wS,OV=_V.concat("length","prototype");Fi.f=Object.getOwnPropertyNames||function(t){return CV(t,OV)};var Us={};Us.f=Object.getOwnPropertySymbols;var RV=on,EV=He,TV=Fi,kV=Us,PV=Ct,AV=EV([].concat),BM=RV("Reflect","ownKeys")||function(t){var r=TV.f(PV(t)),n=kV.f;return n?AV(r,n(t)):r},oR=bt,IV=BM,$V=nn,MV=Nt,FM=function(e,t,r){for(var n=IV(t),o=MV.f,i=$V.f,a=0;aa;)uW.f(t,l=o[a++],n[l]);return t};var dW=on,UM=dW("document","documentElement"),vW=Ct,pW=SS,aR=wS,gW=Vs,yW=UM,mW=_h,bW=Oh,lR=">",sR="<",Zp="prototype",Jp="script",zM=bW("IE_PROTO"),jd=function(){},GM=function(e){return sR+Jp+lR+e+sR+"/"+Jp+lR},uR=function(e){e.write(GM("")),e.close();var t=e.parentWindow.Object;return e=null,t},wW=function(){var e=mW("iframe"),t="java"+Jp+":",r;return e.style.display="none",yW.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(GM("document.F=Object")),r.close(),r.F},Ou,_c=function(){try{Ou=new ActiveXObject("htmlfile")}catch{}_c=typeof document<"u"?document.domain&&Ou?uR(Ou):wW():uR(Ou);for(var e=aR.length;e--;)delete _c[Zp][aR[e]];return _c()};gW[zM]=!0;var fl=Object.create||function(t,r){var n;return t!==null?(jd[Zp]=vW(t),n=new jd,jd[Zp]=null,n[zM]=t):n=_c(),r===void 0?n:pW.f(n,r)},SW=lt,CW=fl,_W=Nt.f,eg=SW("unscopables"),tg=Array.prototype;tg[eg]==null&&_W(tg,eg,{configurable:!0,value:CW(null)});var Ys=function(e){tg[eg][e]=!0},OW=Ae,RW=bS.includes,EW=Le,TW=Ys,kW=EW(function(){return!Array(1).includes()});OW({target:"Array",proto:!0,forced:kW},{includes:function(t){return RW(this,t,arguments.length>1?arguments[1]:void 0)}});TW("includes");var PW=mt,AW=Un,IW=lt,$W=IW("match"),CS=function(e){var t;return PW(e)&&((t=e[$W])!==void 0?!!t:AW(e)=="RegExp")},MW=CS,xW=TypeError,_S=function(e){if(MW(e))throw xW("The method doesn't accept regular expressions");return e},DW=lt,HW=DW("toStringTag"),YM={};YM[HW]="z";var OS=String(YM)==="[object z]",NW=OS,LW=ut,Oc=Un,jW=lt,BW=jW("toStringTag"),FW=Object,VW=Oc(function(){return arguments}())=="Arguments",WW=function(e,t){try{return e[t]}catch{}},Th=NW?Oc:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=WW(t=FW(e),BW))=="string"?r:VW?Oc(t):(n=Oc(t))=="Object"&&LW(t.callee)?"Arguments":n},UW=Th,zW=String,Pt=function(e){if(UW(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return zW(e)},GW=lt,YW=GW("match"),RS=function(e){var t=/./;try{"/./"[e](t)}catch{try{return t[YW]=!1,"/./"[e](t)}catch{}}return!1},KW=Ae,XW=He,qW=_S,QW=rr,cR=Pt,ZW=RS,JW=XW("".indexOf);KW({target:"String",proto:!0,forced:!ZW("includes")},{includes:function(t){return!!~JW(cR(QW(this)),cR(qW(t)),arguments.length>1?arguments[1]:void 0)}});var eU=Un,hl=Array.isArray||function(t){return eU(t)=="Array"},tU=He,rU=Le,KM=ut,nU=Th,oU=on,iU=DM,XM=function(){},aU=[],qM=oU("Reflect","construct"),ES=/^\s*(?:class|function)\b/,lU=tU(ES.exec),sU=!ES.exec(XM),Sl=function(t){if(!KM(t))return!1;try{return qM(XM,aU,t),!0}catch{return!1}},QM=function(t){if(!KM(t))return!1;switch(nU(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return sU||!!lU(ES,iU(t))}catch{return!0}};QM.sham=!0;var kh=!qM||rU(function(){var e;return Sl(Sl.call)||!Sl(Object)||!Sl(function(){e=!0})||e})?QM:Sl,uU=Ch,cU=Nt,fU=Ns,dl=function(e,t,r){var n=uU(t);n in e?cU.f(e,n,fU(0,r)):e[n]=r},hU=Le,dU=lt,vU=js,pU=dU("species"),Ks=function(e){return vU>=51||!hU(function(){var t=[],r=t.constructor={};return r[pU]=function(){return{foo:1}},t[e](Boolean).foo!==1})},gU=He,Xs=gU([].slice),yU=Ae,fR=hl,mU=kh,bU=mt,hR=Ws,wU=Or,SU=dr,CU=dl,_U=lt,OU=Ks,RU=Xs,EU=OU("slice"),TU=_U("species"),Bd=Array,kU=Math.max;yU({target:"Array",proto:!0,forced:!EU},{slice:function(t,r){var n=SU(this),o=wU(n),i=hR(t,o),a=hR(r===void 0?o:r,o),l,s,u;if(fR(n)&&(l=n.constructor,mU(l)&&(l===Bd||fR(l.prototype))?l=void 0:bU(l)&&(l=l[TU],l===null&&(l=void 0)),l===Bd||l===void 0))return RU(n,i,a);for(s=new(l===void 0?Bd:l)(kU(a-i,0)),u=0;i1?arguments[1]:void 0;return dR?rg(this,t,r)||0:$U(this,t,r)}});var vR=He,DU=cl,HU=Ds,NU=vR(vR.bind),qs=function(e,t){return DU(e),t===void 0?e:HU?NU(e,t):function(){return e.apply(t,arguments)}},pR=hl,LU=kh,jU=mt,BU=lt,FU=BU("species"),gR=Array,VU=function(e){var t;return pR(e)&&(t=e.constructor,LU(t)&&(t===gR||pR(t.prototype))?t=void 0:jU(t)&&(t=t[FU],t===null&&(t=void 0))),t===void 0?gR:t},WU=VU,TS=function(e,t){return new(WU(e))(t===0?0:t)},UU=qs,zU=He,GU=Ls,YU=nr,KU=Or,XU=TS,yR=zU([].push),Yn=function(e){var t=e==1,r=e==2,n=e==3,o=e==4,i=e==6,a=e==7,l=e==5||i;return function(s,u,c,f){for(var h=YU(s),d=GU(h),v=UU(u,c),g=KU(d),y=0,w=f||XU,C=t?w(s,g):r||a?w(s,0):void 0,_,I;g>y;y++)if((l||y in d)&&(_=d[y],I=v(_,y,h),e))if(t)C[y]=I;else if(I)switch(e){case 3:return!0;case 5:return _;case 6:return y;case 2:yR(C,_)}else switch(e){case 4:return!1;case 7:yR(C,_)}return i?-1:n||o?o:C}},Wi={forEach:Yn(0),map:Yn(1),filter:Yn(2),some:Yn(3),every:Yn(4),find:Yn(5),findIndex:Yn(6),filterReject:Yn(7)},qU=Ae,QU=Wi.filter,ZU=Ks,JU=ZU("filter");qU({target:"Array",proto:!0,forced:!JU},{filter:function(t){return QU(this,t,arguments.length>1?arguments[1]:void 0)}});var e2=OS,t2=Th,r2=e2?{}.toString:function(){return"[object "+t2(this)+"]"},n2=OS,o2=_r,i2=r2;n2||o2(Object.prototype,"toString",i2,{unsafe:!0});var a2=ut,l2=String,s2=TypeError,u2=function(e){if(typeof e=="object"||a2(e))return e;throw s2("Can't set "+l2(e)+" as a prototype")},c2=He,f2=Ct,h2=u2,kS=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=c2(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),r(t,[]),e=t instanceof Array}catch{}return function(o,i){return f2(o),h2(i),e?r(o,i):o.__proto__=i,o}}():void 0),d2=ut,v2=mt,mR=kS,PS=function(e,t,r){var n,o;return mR&&d2(n=t.constructor)&&n!==r&&v2(o=n.prototype)&&o!==r.prototype&&mR(e,o),e},p2=Ct,ZM=function(){var e=p2(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},g2=kt,y2=bt,m2=Ro,b2=ZM,bR=RegExp.prototype,JM=function(e){var t=e.flags;return t===void 0&&!("flags"in bR)&&!y2(e,"flags")&&m2(bR,e)?g2(b2,e):t},AS=Le,w2=et,IS=w2.RegExp,$S=AS(function(){var e=IS("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),S2=$S||AS(function(){return!IS("a","y").sticky}),C2=$S||AS(function(){var e=IS("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),MS={BROKEN_CARET:C2,MISSED_STICKY:S2,UNSUPPORTED_Y:$S},_2=Nt.f,O2=function(e,t,r){r in e||_2(e,r,{configurable:!0,get:function(){return t[r]},set:function(n){t[r]=n}})},R2=on,E2=Nt,T2=lt,k2=St,wR=T2("species"),ex=function(e){var t=R2(e),r=E2.f;k2&&t&&!t[wR]&&r(t,wR,{configurable:!0,get:function(){return this}})},P2=Le,A2=et,I2=A2.RegExp,tx=P2(function(){var e=I2(".","s");return!(e.dotAll&&e.exec(` +import{aa as Vp,av as Et,bD as mM,bp as Nj,r as Lj,j as Od,a as jj,bE as Bj}from"./index-7074710c.js";import{h as Xe,c as bu,r as Fj}from"./moment-3cda1086.js";import{s as DO}from"./css-14ccef8c.js";import{V as Vj}from"./visibility-sensor-7d414852.js";var wu=function(e){return e&&e.Math==Math&&e},et=wu(typeof globalThis=="object"&&globalThis)||wu(typeof window=="object"&&window)||wu(typeof self=="object"&&self)||wu(typeof Vp=="object"&&Vp)||function(){return this}()||Function("return this")(),nn={},Le=function(e){try{return!!e()}catch{return!0}},Wj=Le,St=!Wj(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Uj=Le,Ds=!Uj(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),zj=Ds,Su=Function.prototype.call,kt=zj?Su.bind(Su):function(){return Su.apply(Su,arguments)},Hs={},bM={}.propertyIsEnumerable,wM=Object.getOwnPropertyDescriptor,Gj=wM&&!bM.call({1:2},1);Hs.f=Gj?function(t){var r=wM(this,t);return!!r&&r.enumerable}:bM;var Ns=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},SM=Ds,CM=Function.prototype,Wp=CM.call,Yj=SM&&CM.bind.bind(Wp,Wp),_M=SM?Yj:function(e){return function(){return Wp.apply(e,arguments)}},OM=_M,Kj=OM({}.toString),Xj=OM("".slice),Un=function(e){return Xj(Kj(e),8,-1)},qj=Un,Qj=_M,He=function(e){if(qj(e)==="Function")return Qj(e)},Zj=He,Jj=Le,eB=Un,Rd=Object,tB=Zj("".split),Ls=Jj(function(){return!Rd("z").propertyIsEnumerable(0)})?function(e){return eB(e)=="String"?tB(e,""):Rd(e)}:Rd,Nr=function(e){return e==null},rB=Nr,nB=TypeError,rr=function(e){if(rB(e))throw nB("Can't call method on "+e);return e},oB=Ls,iB=rr,dr=function(e){return oB(iB(e))},Up=typeof document=="object"&&document.all,aB=typeof Up>"u"&&Up!==void 0,RM={all:Up,IS_HTMLDDA:aB},EM=RM,lB=EM.all,ut=EM.IS_HTMLDDA?function(e){return typeof e=="function"||e===lB}:function(e){return typeof e=="function"},HO=ut,TM=RM,sB=TM.all,mt=TM.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:HO(e)||e===sB}:function(e){return typeof e=="object"?e!==null:HO(e)},Ed=et,uB=ut,cB=function(e){return uB(e)?e:void 0},on=function(e,t){return arguments.length<2?cB(Ed[e]):Ed[e]&&Ed[e][t]},fB=He,Ro=fB({}.isPrototypeOf),hB=on,Li=hB("navigator","userAgent")||"",kM=et,Td=Li,NO=kM.process,LO=kM.Deno,jO=NO&&NO.versions||LO&&LO.version,BO=jO&&jO.v8,$r,lf;BO&&($r=BO.split("."),lf=$r[0]>0&&$r[0]<4?1:+($r[0]+$r[1]));!lf&&Td&&($r=Td.match(/Edge\/(\d+)/),(!$r||$r[1]>=74)&&($r=Td.match(/Chrome\/(\d+)/),$r&&(lf=+$r[1])));var js=lf,FO=js,dB=Le,sl=!!Object.getOwnPropertySymbols&&!dB(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&FO&&FO<41}),vB=sl,PM=vB&&!Symbol.sham&&typeof Symbol.iterator=="symbol",pB=on,gB=ut,yB=Ro,mB=PM,bB=Object,Bs=mB?function(e){return typeof e=="symbol"}:function(e){var t=pB("Symbol");return gB(t)&&yB(t.prototype,bB(e))},wB=String,ul=function(e){try{return wB(e)}catch{return"Object"}},SB=ut,CB=ul,_B=TypeError,cl=function(e){if(SB(e))return e;throw _B(CB(e)+" is not a function")},OB=cl,RB=Nr,ji=function(e,t){var r=e[t];return RB(r)?void 0:OB(r)},kd=kt,Pd=ut,Ad=mt,EB=TypeError,TB=function(e,t){var r,n;if(t==="string"&&Pd(r=e.toString)&&!Ad(n=kd(r,e))||Pd(r=e.valueOf)&&!Ad(n=kd(r,e))||t!=="string"&&Pd(r=e.toString)&&!Ad(n=kd(r,e)))return n;throw EB("Can't convert object to primitive value")},_o={},kB={get exports(){return _o},set exports(e){_o=e}},VO=et,PB=Object.defineProperty,gS=function(e,t){try{PB(VO,e,{value:t,configurable:!0,writable:!0})}catch{VO[e]=t}return t},AB=et,IB=gS,WO="__core-js_shared__",$B=AB[WO]||IB(WO,{}),yS=$B,UO=yS;(kB.exports=function(e,t){return UO[e]||(UO[e]=t!==void 0?t:{})})("versions",[]).push({version:"3.26.0",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE",source:"https://github.com/zloirock/core-js"});var MB=rr,xB=Object,nr=function(e){return xB(MB(e))},DB=He,HB=nr,NB=DB({}.hasOwnProperty),bt=Object.hasOwn||function(t,r){return NB(HB(t),r)},LB=He,jB=0,BB=Math.random(),FB=LB(1 .toString),Sh=function(e){return"Symbol("+(e===void 0?"":e)+")_"+FB(++jB+BB,36)},VB=et,WB=_o,zO=bt,UB=Sh,GO=sl,AM=PM,Qi=WB("wks"),wi=VB.Symbol,YO=wi&&wi.for,zB=AM?wi:wi&&wi.withoutSetter||UB,lt=function(e){if(!zO(Qi,e)||!(GO||typeof Qi[e]=="string")){var t="Symbol."+e;GO&&zO(wi,e)?Qi[e]=wi[e]:AM&&YO?Qi[e]=YO(t):Qi[e]=zB(t)}return Qi[e]},GB=kt,KO=mt,XO=Bs,YB=ji,KB=TB,XB=lt,qB=TypeError,QB=XB("toPrimitive"),IM=function(e,t){if(!KO(e)||XO(e))return e;var r=YB(e,QB),n;if(r){if(t===void 0&&(t="default"),n=GB(r,e,t),!KO(n)||XO(n))return n;throw qB("Can't convert object to primitive value")}return t===void 0&&(t="number"),KB(e,t)},ZB=IM,JB=Bs,Ch=function(e){var t=ZB(e,"string");return JB(t)?t:t+""},eF=et,qO=mt,zp=eF.document,tF=qO(zp)&&qO(zp.createElement),_h=function(e){return tF?zp.createElement(e):{}},rF=St,nF=Le,oF=_h,$M=!rF&&!nF(function(){return Object.defineProperty(oF("div"),"a",{get:function(){return 7}}).a!=7}),iF=St,aF=kt,lF=Hs,sF=Ns,uF=dr,cF=Ch,fF=bt,hF=$M,QO=Object.getOwnPropertyDescriptor;nn.f=iF?QO:function(t,r){if(t=uF(t),r=cF(r),hF)try{return QO(t,r)}catch{}if(fF(t,r))return sF(!aF(lF.f,t,r),t[r])};var Nt={},dF=St,vF=Le,MM=dF&&vF(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),pF=mt,gF=String,yF=TypeError,Ct=function(e){if(pF(e))return e;throw yF(gF(e)+" is not an object")},mF=St,bF=$M,wF=MM,Cu=Ct,ZO=Ch,SF=TypeError,Id=Object.defineProperty,CF=Object.getOwnPropertyDescriptor,$d="enumerable",Md="configurable",xd="writable";Nt.f=mF?wF?function(t,r,n){if(Cu(t),r=ZO(r),Cu(n),typeof t=="function"&&r==="prototype"&&"value"in n&&xd in n&&!n[xd]){var o=CF(t,r);o&&o[xd]&&(t[r]=n.value,n={configurable:Md in n?n[Md]:o[Md],enumerable:$d in n?n[$d]:o[$d],writable:!1})}return Id(t,r,n)}:Id:function(t,r,n){if(Cu(t),r=ZO(r),Cu(n),bF)try{return Id(t,r,n)}catch{}if("get"in n||"set"in n)throw SF("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var _F=St,OF=Nt,RF=Ns,Bi=_F?function(e,t,r){return OF.f(e,t,RF(1,r))}:function(e,t,r){return e[t]=r,e},Gp={},EF={get exports(){return Gp},set exports(e){Gp=e}},Yp=St,TF=bt,xM=Function.prototype,kF=Yp&&Object.getOwnPropertyDescriptor,mS=TF(xM,"name"),PF=mS&&function(){}.name==="something",AF=mS&&(!Yp||Yp&&kF(xM,"name").configurable),Fs={EXISTS:mS,PROPER:PF,CONFIGURABLE:AF},IF=He,$F=ut,Kp=yS,MF=IF(Function.toString);$F(Kp.inspectSource)||(Kp.inspectSource=function(e){return MF(e)});var DM=Kp.inspectSource,xF=et,DF=ut,JO=xF.WeakMap,HM=DF(JO)&&/native code/.test(String(JO)),HF=_o,NF=Sh,eR=HF("keys"),Oh=function(e){return eR[e]||(eR[e]=NF(e))},Vs={},LF=HM,NM=et,jF=mt,BF=Bi,Dd=bt,Hd=yS,FF=Oh,VF=Vs,tR="Object already initialized",Xp=NM.TypeError,WF=NM.WeakMap,sf,vs,uf,UF=function(e){return uf(e)?vs(e):sf(e,{})},zF=function(e){return function(t){var r;if(!jF(t)||(r=vs(t)).type!==e)throw Xp("Incompatible receiver, "+e+" required");return r}};if(LF||Hd.state){var jr=Hd.state||(Hd.state=new WF);jr.get=jr.get,jr.has=jr.has,jr.set=jr.set,sf=function(e,t){if(jr.has(e))throw Xp(tR);return t.facade=e,jr.set(e,t),t},vs=function(e){return jr.get(e)||{}},uf=function(e){return jr.has(e)}}else{var Zi=FF("state");VF[Zi]=!0,sf=function(e,t){if(Dd(e,Zi))throw Xp(tR);return t.facade=e,BF(e,Zi,t),t},vs=function(e){return Dd(e,Zi)?e[Zi]:{}},uf=function(e){return Dd(e,Zi)}}var zn={set:sf,get:vs,has:uf,enforce:UF,getterFor:zF},GF=Le,YF=ut,_u=bt,qp=St,KF=Fs.CONFIGURABLE,XF=DM,LM=zn,qF=LM.enforce,QF=LM.get,Cc=Object.defineProperty,ZF=qp&&!GF(function(){return Cc(function(){},"length",{value:8}).length!==8}),JF=String(String).split("String"),eV=EF.exports=function(e,t,r){String(t).slice(0,7)==="Symbol("&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!_u(e,"name")||KF&&e.name!==t)&&(qp?Cc(e,"name",{value:t,configurable:!0}):e.name=t),ZF&&r&&_u(r,"arity")&&e.length!==r.arity&&Cc(e,"length",{value:r.arity});try{r&&_u(r,"constructor")&&r.constructor?qp&&Cc(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=qF(e);return _u(n,"source")||(n.source=JF.join(typeof t=="string"?t:"")),e};Function.prototype.toString=eV(function(){return YF(this)&&QF(this).source||XF(this)},"toString");var tV=ut,rV=Nt,nV=Gp,oV=gS,_r=function(e,t,r,n){n||(n={});var o=n.enumerable,i=n.name!==void 0?n.name:t;if(tV(r)&&nV(r,i,n),n.global)o?e[t]=r:oV(t,r);else{try{n.unsafe?e[t]&&(o=!0):delete e[t]}catch{}o?e[t]=r:rV.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Fi={},iV=Math.ceil,aV=Math.floor,lV=Math.trunc||function(t){var r=+t;return(r>0?aV:iV)(r)},sV=lV,Eo=function(e){var t=+e;return t!==t||t===0?0:sV(t)},uV=Eo,cV=Math.max,fV=Math.min,Ws=function(e,t){var r=uV(e);return r<0?cV(r+t,0):fV(r,t)},hV=Eo,dV=Math.min,Vi=function(e){return e>0?dV(hV(e),9007199254740991):0},vV=Vi,Or=function(e){return vV(e.length)},pV=dr,gV=Ws,yV=Or,rR=function(e){return function(t,r,n){var o=pV(t),i=yV(o),a=gV(n,i),l;if(e&&r!=r){for(;i>a;)if(l=o[a++],l!=l)return!0}else for(;i>a;a++)if((e||a in o)&&o[a]===r)return e||a||0;return!e&&-1}},bS={includes:rR(!0),indexOf:rR(!1)},mV=He,Nd=bt,bV=dr,wV=bS.indexOf,SV=Vs,nR=mV([].push),jM=function(e,t){var r=bV(e),n=0,o=[],i;for(i in r)!Nd(SV,i)&&Nd(r,i)&&nR(o,i);for(;t.length>n;)Nd(r,i=t[n++])&&(~wV(o,i)||nR(o,i));return o},wS=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],CV=jM,_V=wS,OV=_V.concat("length","prototype");Fi.f=Object.getOwnPropertyNames||function(t){return CV(t,OV)};var Us={};Us.f=Object.getOwnPropertySymbols;var RV=on,EV=He,TV=Fi,kV=Us,PV=Ct,AV=EV([].concat),BM=RV("Reflect","ownKeys")||function(t){var r=TV.f(PV(t)),n=kV.f;return n?AV(r,n(t)):r},oR=bt,IV=BM,$V=nn,MV=Nt,FM=function(e,t,r){for(var n=IV(t),o=MV.f,i=$V.f,a=0;aa;)uW.f(t,l=o[a++],n[l]);return t};var dW=on,UM=dW("document","documentElement"),vW=Ct,pW=SS,aR=wS,gW=Vs,yW=UM,mW=_h,bW=Oh,lR=">",sR="<",Zp="prototype",Jp="script",zM=bW("IE_PROTO"),jd=function(){},GM=function(e){return sR+Jp+lR+e+sR+"/"+Jp+lR},uR=function(e){e.write(GM("")),e.close();var t=e.parentWindow.Object;return e=null,t},wW=function(){var e=mW("iframe"),t="java"+Jp+":",r;return e.style.display="none",yW.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(GM("document.F=Object")),r.close(),r.F},Ou,_c=function(){try{Ou=new ActiveXObject("htmlfile")}catch{}_c=typeof document<"u"?document.domain&&Ou?uR(Ou):wW():uR(Ou);for(var e=aR.length;e--;)delete _c[Zp][aR[e]];return _c()};gW[zM]=!0;var fl=Object.create||function(t,r){var n;return t!==null?(jd[Zp]=vW(t),n=new jd,jd[Zp]=null,n[zM]=t):n=_c(),r===void 0?n:pW.f(n,r)},SW=lt,CW=fl,_W=Nt.f,eg=SW("unscopables"),tg=Array.prototype;tg[eg]==null&&_W(tg,eg,{configurable:!0,value:CW(null)});var Ys=function(e){tg[eg][e]=!0},OW=Ae,RW=bS.includes,EW=Le,TW=Ys,kW=EW(function(){return!Array(1).includes()});OW({target:"Array",proto:!0,forced:kW},{includes:function(t){return RW(this,t,arguments.length>1?arguments[1]:void 0)}});TW("includes");var PW=mt,AW=Un,IW=lt,$W=IW("match"),CS=function(e){var t;return PW(e)&&((t=e[$W])!==void 0?!!t:AW(e)=="RegExp")},MW=CS,xW=TypeError,_S=function(e){if(MW(e))throw xW("The method doesn't accept regular expressions");return e},DW=lt,HW=DW("toStringTag"),YM={};YM[HW]="z";var OS=String(YM)==="[object z]",NW=OS,LW=ut,Oc=Un,jW=lt,BW=jW("toStringTag"),FW=Object,VW=Oc(function(){return arguments}())=="Arguments",WW=function(e,t){try{return e[t]}catch{}},Th=NW?Oc:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=WW(t=FW(e),BW))=="string"?r:VW?Oc(t):(n=Oc(t))=="Object"&&LW(t.callee)?"Arguments":n},UW=Th,zW=String,Pt=function(e){if(UW(e)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return zW(e)},GW=lt,YW=GW("match"),RS=function(e){var t=/./;try{"/./"[e](t)}catch{try{return t[YW]=!1,"/./"[e](t)}catch{}}return!1},KW=Ae,XW=He,qW=_S,QW=rr,cR=Pt,ZW=RS,JW=XW("".indexOf);KW({target:"String",proto:!0,forced:!ZW("includes")},{includes:function(t){return!!~JW(cR(QW(this)),cR(qW(t)),arguments.length>1?arguments[1]:void 0)}});var eU=Un,hl=Array.isArray||function(t){return eU(t)=="Array"},tU=He,rU=Le,KM=ut,nU=Th,oU=on,iU=DM,XM=function(){},aU=[],qM=oU("Reflect","construct"),ES=/^\s*(?:class|function)\b/,lU=tU(ES.exec),sU=!ES.exec(XM),Sl=function(t){if(!KM(t))return!1;try{return qM(XM,aU,t),!0}catch{return!1}},QM=function(t){if(!KM(t))return!1;switch(nU(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return sU||!!lU(ES,iU(t))}catch{return!0}};QM.sham=!0;var kh=!qM||rU(function(){var e;return Sl(Sl.call)||!Sl(Object)||!Sl(function(){e=!0})||e})?QM:Sl,uU=Ch,cU=Nt,fU=Ns,dl=function(e,t,r){var n=uU(t);n in e?cU.f(e,n,fU(0,r)):e[n]=r},hU=Le,dU=lt,vU=js,pU=dU("species"),Ks=function(e){return vU>=51||!hU(function(){var t=[],r=t.constructor={};return r[pU]=function(){return{foo:1}},t[e](Boolean).foo!==1})},gU=He,Xs=gU([].slice),yU=Ae,fR=hl,mU=kh,bU=mt,hR=Ws,wU=Or,SU=dr,CU=dl,_U=lt,OU=Ks,RU=Xs,EU=OU("slice"),TU=_U("species"),Bd=Array,kU=Math.max;yU({target:"Array",proto:!0,forced:!EU},{slice:function(t,r){var n=SU(this),o=wU(n),i=hR(t,o),a=hR(r===void 0?o:r,o),l,s,u;if(fR(n)&&(l=n.constructor,mU(l)&&(l===Bd||fR(l.prototype))?l=void 0:bU(l)&&(l=l[TU],l===null&&(l=void 0)),l===Bd||l===void 0))return RU(n,i,a);for(s=new(l===void 0?Bd:l)(kU(a-i,0)),u=0;i1?arguments[1]:void 0;return dR?rg(this,t,r)||0:$U(this,t,r)}});var vR=He,DU=cl,HU=Ds,NU=vR(vR.bind),qs=function(e,t){return DU(e),t===void 0?e:HU?NU(e,t):function(){return e.apply(t,arguments)}},pR=hl,LU=kh,jU=mt,BU=lt,FU=BU("species"),gR=Array,VU=function(e){var t;return pR(e)&&(t=e.constructor,LU(t)&&(t===gR||pR(t.prototype))?t=void 0:jU(t)&&(t=t[FU],t===null&&(t=void 0))),t===void 0?gR:t},WU=VU,TS=function(e,t){return new(WU(e))(t===0?0:t)},UU=qs,zU=He,GU=Ls,YU=nr,KU=Or,XU=TS,yR=zU([].push),Yn=function(e){var t=e==1,r=e==2,n=e==3,o=e==4,i=e==6,a=e==7,l=e==5||i;return function(s,u,c,f){for(var h=YU(s),d=GU(h),v=UU(u,c),g=KU(d),y=0,w=f||XU,C=t?w(s,g):r||a?w(s,0):void 0,_,I;g>y;y++)if((l||y in d)&&(_=d[y],I=v(_,y,h),e))if(t)C[y]=I;else if(I)switch(e){case 3:return!0;case 5:return _;case 6:return y;case 2:yR(C,_)}else switch(e){case 4:return!1;case 7:yR(C,_)}return i?-1:n||o?o:C}},Wi={forEach:Yn(0),map:Yn(1),filter:Yn(2),some:Yn(3),every:Yn(4),find:Yn(5),findIndex:Yn(6),filterReject:Yn(7)},qU=Ae,QU=Wi.filter,ZU=Ks,JU=ZU("filter");qU({target:"Array",proto:!0,forced:!JU},{filter:function(t){return QU(this,t,arguments.length>1?arguments[1]:void 0)}});var e2=OS,t2=Th,r2=e2?{}.toString:function(){return"[object "+t2(this)+"]"},n2=OS,o2=_r,i2=r2;n2||o2(Object.prototype,"toString",i2,{unsafe:!0});var a2=ut,l2=String,s2=TypeError,u2=function(e){if(typeof e=="object"||a2(e))return e;throw s2("Can't set "+l2(e)+" as a prototype")},c2=He,f2=Ct,h2=u2,kS=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=c2(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),r(t,[]),e=t instanceof Array}catch{}return function(o,i){return f2(o),h2(i),e?r(o,i):o.__proto__=i,o}}():void 0),d2=ut,v2=mt,mR=kS,PS=function(e,t,r){var n,o;return mR&&d2(n=t.constructor)&&n!==r&&v2(o=n.prototype)&&o!==r.prototype&&mR(e,o),e},p2=Ct,ZM=function(){var e=p2(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},g2=kt,y2=bt,m2=Ro,b2=ZM,bR=RegExp.prototype,JM=function(e){var t=e.flags;return t===void 0&&!("flags"in bR)&&!y2(e,"flags")&&m2(bR,e)?g2(b2,e):t},AS=Le,w2=et,IS=w2.RegExp,$S=AS(function(){var e=IS("a","y");return e.lastIndex=2,e.exec("abcd")!=null}),S2=$S||AS(function(){return!IS("a","y").sticky}),C2=$S||AS(function(){var e=IS("^r","gy");return e.lastIndex=2,e.exec("str")!=null}),MS={BROKEN_CARET:C2,MISSED_STICKY:S2,UNSUPPORTED_Y:$S},_2=Nt.f,O2=function(e,t,r){r in e||_2(e,r,{configurable:!0,get:function(){return t[r]},set:function(n){t[r]=n}})},R2=on,E2=Nt,T2=lt,k2=St,wR=T2("species"),ex=function(e){var t=R2(e),r=E2.f;k2&&t&&!t[wR]&&r(t,wR,{configurable:!0,get:function(){return this}})},P2=Le,A2=et,I2=A2.RegExp,tx=P2(function(){var e=I2(".","s");return!(e.dotAll&&e.exec(` `)&&e.flags==="s")}),$2=Le,M2=et,x2=M2.RegExp,rx=$2(function(){var e=x2("(?b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$c")!=="bc"}),D2=St,xS=et,Qs=He,H2=Rh,N2=PS,L2=Bi,j2=Fi.f,SR=Ro,B2=CS,CR=Pt,F2=JM,nx=MS,V2=O2,W2=_r,U2=Le,z2=bt,G2=zn.enforce,Y2=ex,K2=lt,ox=tx,ix=rx,X2=K2("match"),uo=xS.RegExp,Sa=uo.prototype,q2=xS.SyntaxError,Q2=Qs(Sa.exec),cf=Qs("".charAt),_R=Qs("".replace),OR=Qs("".indexOf),Z2=Qs("".slice),J2=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Si=/a/g,Fd=/a/g,ez=new uo(Si)!==Si,ax=nx.MISSED_STICKY,tz=nx.UNSUPPORTED_Y,rz=D2&&(!ez||ax||ox||ix||U2(function(){return Fd[X2]=!1,uo(Si)!=Si||uo(Fd)==Fd||uo(Si,"i")!="/a/i"})),nz=function(e){for(var t=e.length,r=0,n="",o=!1,i;r<=t;r++){if(i=cf(e,r),i==="\\"){n+=i+cf(e,++r);continue}!o&&i==="."?n+="[\\s\\S]":(i==="["?o=!0:i==="]"&&(o=!1),n+=i)}return n},oz=function(e){for(var t=e.length,r=0,n="",o=[],i={},a=!1,l=!1,s=0,u="",c;r<=t;r++){if(c=cf(e,r),c==="\\")c=c+cf(e,++r);else if(c==="]")a=!1;else if(!a)switch(!0){case c==="[":a=!0;break;case c==="(":Q2(J2,Z2(e,r+1))&&(r+=2,l=!0),n+=c,s++;continue;case(c===">"&&l):if(u===""||z2(i,u))throw new q2("Invalid capture group name");i[u]=!0,o[o.length]=[u,s],l=!1,u="";continue}l?u+=c:n+=c}return[n,o]};if(H2("RegExp",rz)){for(var Ao=function(t,r){var n=SR(Sa,this),o=B2(t),i=r===void 0,a=[],l=t,s,u,c,f,h,d;if(!n&&o&&i&&t.constructor===Ao)return t;if((o||SR(Sa,t))&&(t=t.source,i&&(r=F2(l))),t=t===void 0?"":CR(t),r=r===void 0?"":CR(r),l=t,ox&&"dotAll"in Si&&(u=!!r&&OR(r,"s")>-1,u&&(r=_R(r,/s/g,""))),s=r,ax&&"sticky"in Si&&(c=!!r&&OR(r,"y")>-1,c&&tz&&(r=_R(r,/y/g,""))),ix&&(f=oz(t),t=f[0],a=f[1]),h=N2(uo(t,r),n?this:Sa,Ao),(u||c||a.length)&&(d=G2(h),u&&(d.dotAll=!0,d.raw=Ao(nz(t),s)),c&&(d.sticky=!0),a.length&&(d.groups=a)),t!==l)try{L2(h,"source",l===""?"(?:)":l)}catch{}return h},RR=j2(uo),ER=0;RR.length>ER;)V2(Ao,uo,RR[ER++]);Sa.constructor=Ao,Ao.prototype=Sa,W2(xS,"RegExp",Ao,{constructor:!0})}Y2("RegExp");var Oa=kt,Ph=He,iz=Pt,az=ZM,lz=MS,sz=_o,uz=fl,cz=zn.get,fz=tx,hz=rx,dz=sz("native-string-replace",String.prototype.replace),ff=RegExp.prototype.exec,ng=ff,vz=Ph("".charAt),pz=Ph("".indexOf),gz=Ph("".replace),Vd=Ph("".slice),og=function(){var e=/a/,t=/b*/g;return Oa(ff,e,"a"),Oa(ff,t,"a"),e.lastIndex!==0||t.lastIndex!==0}(),lx=lz.BROKEN_CARET,ig=/()??/.exec("")[1]!==void 0,yz=og||ig||lx||fz||hz;yz&&(ng=function(t){var r=this,n=cz(r),o=iz(t),i=n.raw,a,l,s,u,c,f,h;if(i)return i.lastIndex=r.lastIndex,a=Oa(ng,i,o),r.lastIndex=i.lastIndex,a;var d=n.groups,v=lx&&r.sticky,g=Oa(az,r),y=r.source,w=0,C=o;if(v&&(g=gz(g,"y",""),pz(g,"g")===-1&&(g+="g"),C=Vd(o,r.lastIndex),r.lastIndex>0&&(!r.multiline||r.multiline&&vz(o,r.lastIndex-1)!==` `)&&(y="(?: "+y+")",C=" "+C,w++),l=new RegExp("^(?:"+y+")",g)),ig&&(l=new RegExp("^"+y+"$(?!\\s)",g)),og&&(s=r.lastIndex),u=Oa(ff,v?l:r,C),v?u?(u.input=Vd(u.input,w),u[0]=Vd(u[0],w),u.index=r.lastIndex,r.lastIndex+=u[0].length):r.lastIndex=0:og&&u&&(r.lastIndex=r.global?u.index+u[0].length:s),ig&&u&&u.length>1&&Oa(dz,u[0],l,function(){for(c=1;c=i?e?"":void 0:(a=NR(n,o),a<55296||a>56319||o+1===i||(l=NR(n,o+1))<56320||l>57343?e?eG(n,o):a:e?tG(n,o,o+2):(a-55296<<10)+(l-56320)+65536)}},NS={codeAt:LR(!1),charAt:LR(!0)},rG=NS.charAt,LS=function(e,t,r){return t+(r?rG(e,t).length:1)},jS=He,nG=nr,oG=Math.floor,zd=jS("".charAt),iG=jS("".replace),Gd=jS("".slice),aG=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,lG=/\$([$&'`]|\d{1,2})/g,sG=function(e,t,r,n,o,i){var a=r+e.length,l=n.length,s=lG;return o!==void 0&&(o=nG(o),s=aG),iG(i,s,function(u,c){var f;switch(zd(c,0)){case"$":return"$";case"&":return e;case"`":return Gd(t,0,r);case"'":return Gd(t,a);case"<":f=o[Gd(c,1,-1)];break;default:var h=+c;if(h===0)return u;if(h>l){var d=oG(h/10);return d===0?u:d<=l?n[d-1]===void 0?zd(c,1):n[d-1]+zd(c,1):u}f=n[h-1]}return f===void 0?"":f})},jR=kt,uG=Ct,cG=ut,fG=Un,hG=Ah,dG=TypeError,$h=function(e,t){var r=e.exec;if(cG(r)){var n=jR(r,e,t);return n!==null&&uG(n),n}if(fG(e)==="RegExp")return jR(hG,e,t);throw dG("RegExp#exec called on incompatible receiver")},vG=Ui,BR=kt,Mh=He,pG=Ih,gG=Le,yG=Ct,mG=ut,bG=Nr,wG=Eo,SG=Vi,Ji=Pt,CG=rr,_G=LS,OG=ji,RG=sG,EG=$h,TG=lt,ag=TG("replace"),kG=Math.max,PG=Math.min,AG=Mh([].concat),Yd=Mh([].push),FR=Mh("".indexOf),VR=Mh("".slice),IG=function(e){return e===void 0?e:String(e)},$G=function(){return"a".replace(/./,"$0")==="$0"}(),WR=function(){return/./[ag]?/./[ag]("a","$0")==="":!1}(),MG=!gG(function(){var e=/./;return e.exec=function(){var t=[];return t.groups={a:"7"},t},"".replace(e,"$")!=="7"});pG("replace",function(e,t,r){var n=WR?"$":"$0";return[function(i,a){var l=CG(this),s=bG(i)?void 0:OG(i,ag);return s?BR(s,i,l,a):BR(t,Ji(l),i,a)},function(o,i){var a=yG(this),l=Ji(o);if(typeof i=="string"&&FR(i,n)===-1&&FR(i,"$<")===-1){var s=r(t,a,l,i);if(s.done)return s.value}var u=mG(i);u||(i=Ji(i));var c=a.global;if(c){var f=a.unicode;a.lastIndex=0}for(var h=[];;){var d=EG(a,l);if(d===null||(Yd(h,d),!c))break;var v=Ji(d[0]);v===""&&(a.lastIndex=_G(l,SG(a.lastIndex),f))}for(var g="",y=0,w=0;w=y&&(g+=VR(l,y,_)+Q,y=_+C.length)}return g+VR(l,y)}]},!MG||!$G||WR);var xG=TypeError,DG=9007199254740991,dx=function(e){if(e>DG)throw xG("Maximum allowed index exceeded");return e},HG=Ae,NG=Le,LG=hl,jG=mt,BG=nr,FG=Or,UR=dx,zR=dl,VG=TS,WG=Ks,UG=lt,zG=js,vx=UG("isConcatSpreadable"),GG=zG>=51||!NG(function(){var e=[];return e[vx]=!1,e.concat()[0]!==e}),YG=WG("concat"),KG=function(e){if(!jG(e))return!1;var t=e[vx];return t!==void 0?!!t:LG(e)},XG=!GG||!YG;HG({target:"Array",proto:!0,arity:1,forced:XG},{concat:function(t){var r=BG(this),n=VG(r,0),o=0,i,a,l,s,u;for(i=-1,l=arguments.length;i=t.length?(e.target=void 0,Pu(void 0,!0)):r=="keys"?Pu(n,!1):r=="values"?Pu(t[n],!1):Pu([n,t[n]],!1)},"values"),hE=fE.Arguments=fE.Array;qS("keys");qS("values");qS("entries");if(tK&&hE.name!=="values")try{JY(hE,"name",{value:"values"})}catch{}var iK=NS.charAt,aK=Pt,Ux=zn,lK=KS,dE=XS,zx="String Iterator",sK=Ux.set,uK=Ux.getterFor(zx);lK(String,"String",function(e){sK(this,{type:zx,string:aK(e),index:0})},function(){var t=uK(this),r=t.string,n=t.index,o;return n>=r.length?dE(void 0,!0):(o=iK(r,n),t.index+=o.length,dE(o,!1))});var Gx={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},cK=_h,tv=cK("span").classList,vE=tv&&tv.constructor&&tv.constructor.prototype,Yx=vE===Object.prototype?void 0:vE,pE=et,Kx=Gx,fK=Yx,Xl=oK,rv=Bi,Xx=lt,nv=Xx("iterator"),gE=Xx("toStringTag"),ov=Xl.values,qx=function(e,t){if(e){if(e[nv]!==ov)try{rv(e,nv,ov)}catch{e[nv]=ov}if(e[gE]||rv(e,gE,t),Kx[t]){for(var r in Xl)if(e[r]!==Xl[r])try{rv(e,r,Xl[r])}catch{e[r]=Xl[r]}}}};for(var iv in Kx)qx(pE[iv]&&pE[iv].prototype,iv);qx(fK,"DOMTokenList");var hK=kt,yE=Ct,dK=ji,Qx=function(e,t,r){var n,o;yE(e);try{if(n=dK(e,"return"),!n){if(t==="throw")throw r;return r}n=hK(n,e)}catch(i){o=!0,n=i}if(t==="throw")throw r;if(o)throw n;return yE(n),r},vK=Ct,pK=Qx,gK=function(e,t,r,n){try{return n?t(vK(r)[0],r[1]):t(r)}catch(o){pK(e,"throw",o)}},yK=lt,mK=eu,bK=yK("iterator"),wK=Array.prototype,Zx=function(e){return e!==void 0&&(mK.Array===e||wK[bK]===e)},SK=Th,mE=ji,CK=Nr,_K=eu,OK=lt,RK=OK("iterator"),QS=function(e){if(!CK(e))return mE(e,RK)||mE(e,"@@iterator")||_K[SK(e)]},EK=kt,TK=cl,kK=Ct,PK=ul,AK=QS,IK=TypeError,Jx=function(e,t){var r=arguments.length<2?AK(e):t;if(TK(r))return kK(EK(r,e));throw IK(PK(e)+" is not iterable")},$K=qs,MK=kt,xK=nr,DK=gK,HK=Zx,NK=kh,LK=Or,bE=dl,jK=Jx,BK=QS,wE=Array,FK=function(t){var r=xK(t),n=NK(this),o=arguments.length,i=o>1?arguments[1]:void 0,a=i!==void 0;a&&(i=$K(i,o>2?arguments[2]:void 0));var l=BK(r),s=0,u,c,f,h,d,v;if(l&&!(this===wE&&HK(l)))for(h=jK(r,l),d=h.next,c=n?new this:[];!(f=MK(d,h)).done;s++)v=a?DK(h,i,[f.value,s],!0):f.value,bE(c,s,v);else for(u=LK(r),c=n?new this(u):wE(u);u>s;s++)v=a?i(r[s],s):r[s],bE(c,s,v);return c.length=s,c},VK=lt,eD=VK("iterator"),tD=!1;try{var WK=0,SE={next:function(){return{done:!!WK++}},return:function(){tD=!0}};SE[eD]=function(){return this},Array.from(SE,function(){throw 2})}catch{}var rD=function(e,t){if(!t&&!tD)return!1;var r=!1;try{var n={};n[eD]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},UK=Ae,zK=FK,GK=rD,YK=!GK(function(e){Array.from(e)});UK({target:"Array",stat:!0,forced:YK},{from:zK});var KK=St,XK=Fs.EXISTS,nD=He,qK=Nt.f,oD=Function.prototype,QK=nD(oD.toString),iD=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,ZK=nD(iD.exec),JK="name";KK&&!XK&&qK(oD,JK,{configurable:!0,get:function(){try{return ZK(iD,QK(this))[1]}catch{return""}}});var e8=TypeError,aD=function(e,t){if(e2,o=r8(t)?t:l8(t),i=n?o8(arguments,2):void 0;return e(n?function(){t8(o,this,i)}:o,r)}:e},lD={setTimeout:CE(dg.setTimeout),setInterval:CE(dg.setInterval)},s8=Ae,u8=et,_E=lD.setInterval;s8({global:!0,bind:!0,forced:u8.setInterval!==_E},{setInterval:_E});var c8=Ae,f8=et,OE=lD.setTimeout;c8({global:!0,bind:!0,forced:f8.setTimeout!==OE},{setTimeout:OE});function vg(e){return vg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vg(e)}var RE=0,Au=["ms","moz","webkit","o"],ys=window.requestAnimationFrame,df=window.cancelAnimationFrame;for(var Ol=0;Olt
t";var r=document.createElement("CAPTION");r.innerHTML="c
c
c
c",r.style.padding="0",r.style.margin="0",e.insertBefore(r,t),document.body.appendChild(e),pg=e.offsetHeight<2*e.lastChild.offsetHeight,document.body.removeChild(e)}function cD(){return pg===void 0&&p8(),pg}var ea;function g8(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ea||((typeof Intl>"u"?"undefined":vg(Intl))==="object"?ea=new Intl.Collator(e,t).compare:typeof String.prototype.localeCompare=="function"?ea=function(n,o){return"".concat(n).localeCompare(o)}:ea=function(n,o){return n===o?0:n>o?-1:1},ea)}var Rl;function y8(){if(Rl!==void 0)return Rl;try{var e={get passive(){Rl=!0}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch{Rl=!1}return Rl}var m8=Wi.forEach,b8=vl,w8=b8("forEach"),S8=w8?[].forEach:function(t){return m8(this,t,arguments.length>1?arguments[1]:void 0)},EE=et,TE=Gx,C8=Yx,av=S8,_8=Bi,fD=function(e){if(e&&e.forEach!==av)try{_8(e,"forEach",av)}catch{e.forEach=av}};for(var lv in TE)TE[lv]&&fD(EE[lv]&&EE[lv].prototype);fD(C8);var Ei={},O8={get exports(){return Ei},set exports(e){Ei=e}},R8=Le,E8=R8(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),T8=Le,k8=mt,P8=Un,kE=E8,Rc=Object.isExtensible,A8=T8(function(){Rc(1)}),hD=A8||kE?function(t){return!k8(t)||kE&&P8(t)=="ArrayBuffer"?!1:Rc?Rc(t):!0}:Rc,I8=Le,dD=!I8(function(){return Object.isExtensible(Object.preventExtensions({}))}),$8=Ae,M8=He,x8=Vs,D8=mt,ZS=bt,H8=Nt.f,PE=Fi,N8=BS,JS=hD,L8=Sh,j8=dD,vD=!1,Vn=L8("meta"),B8=0,eC=function(e){H8(e,Vn,{value:{objectID:"O"+B8++,weakData:{}}})},F8=function(e,t){if(!D8(e))return typeof e=="symbol"?e:(typeof e=="string"?"S":"P")+e;if(!ZS(e,Vn)){if(!JS(e))return"F";if(!t)return"E";eC(e)}return e[Vn].objectID},V8=function(e,t){if(!ZS(e,Vn)){if(!JS(e))return!0;if(!t)return!1;eC(e)}return e[Vn].weakData},W8=function(e){return j8&&vD&&JS(e)&&!ZS(e,Vn)&&eC(e),e},U8=function(){z8.enable=function(){},vD=!0;var e=PE.f,t=M8([].splice),r={};r[Vn]=1,e(r).length&&(PE.f=function(n){for(var o=e(n),i=0,a=o.length;if;f++)if(d=w(e[f]),d&&AE($E,d))return d;return new Ec(!1)}u=Z8(e,c)}for(v=i?e.next:u.next;!(g=Y8(v,u)).done;){try{d=w(g.value)}catch(C){IE(u,"throw",C)}if(typeof d=="object"&&d&&AE($E,d))return d}return new Ec(!1)},t4=Ro,r4=TypeError,rC=function(e,t){if(t4(t,e))return e;throw r4("Incorrect invocation")},n4=Ae,o4=et,i4=He,ME=Rh,a4=_r,l4=Ei,s4=tC,u4=rC,c4=ut,f4=Nr,sv=mt,uv=Le,h4=rD,d4=xh,v4=PS,Bh=function(e,t,r){var n=e.indexOf("Map")!==-1,o=e.indexOf("Weak")!==-1,i=n?"set":"add",a=o4[e],l=a&&a.prototype,s=a,u={},c=function(w){var C=i4(l[w]);a4(l,w,w=="add"?function(I){return C(this,I===0?0:I),this}:w=="delete"?function(_){return o&&!sv(_)?!1:C(this,_===0?0:_)}:w=="get"?function(I){return o&&!sv(I)?void 0:C(this,I===0?0:I)}:w=="has"?function(I){return o&&!sv(I)?!1:C(this,I===0?0:I)}:function(I,E){return C(this,I===0?0:I,E),this})},f=ME(e,!c4(a)||!(o||l.forEach&&!uv(function(){new a().entries().next()})));if(f)s=r.getConstructor(t,e,n,i),l4.enable();else if(ME(e,!0)){var h=new s,d=h[i](o?{}:-0,1)!=h,v=uv(function(){h.has(1)}),g=h4(function(w){new a(w)}),y=!o&&uv(function(){for(var w=new a,C=5;C--;)w[i](C,C);return!w.has(-0)});g||(s=t(function(w,C){u4(w,l);var _=v4(new a,w,s);return f4(C)||s4(C,_[i],{that:_,AS_ENTRIES:n}),_}),s.prototype=l,l.constructor=s),(v||y)&&(c("delete"),c("has"),n&&c("get")),(y||d)&&c(i),o&&l.clear&&delete l.clear}return u[e]=s,n4({global:!0,constructor:!0,forced:s!=a},u),d4(s,e),o||r.setStrong(s,e,n),s},p4=_r,nC=function(e,t,r){for(var n in t)p4(e,n,t[n],r);return e},g4=Nt.f,y4=fl,xE=nC,m4=qs,b4=rC,w4=Nr,S4=tC,C4=KS,Iu=XS,_4=ex,El=St,DE=Ei.fastKey,pD=zn,HE=pD.set,cv=pD.getterFor,gD={getConstructor:function(e,t,r,n){var o=e(function(u,c){b4(u,i),HE(u,{type:t,index:y4(null),first:void 0,last:void 0,size:0}),El||(u.size=0),w4(c)||S4(c,u[n],{that:u,AS_ENTRIES:r})}),i=o.prototype,a=cv(t),l=function(u,c,f){var h=a(u),d=s(u,c),v,g;return d?d.value=f:(h.last=d={index:g=DE(c,!0),key:c,value:f,previous:v=h.last,next:void 0,removed:!1},h.first||(h.first=d),v&&(v.next=d),El?h.size++:u.size++,g!=="F"&&(h.index[g]=d)),u},s=function(u,c){var f=a(u),h=DE(c),d;if(h!=="F")return f.index[h];for(d=f.first;d;d=d.next)if(d.key==c)return d};return xE(i,{clear:function(){for(var c=this,f=a(c),h=f.index,d=f.first;d;)d.removed=!0,d.previous&&(d.previous=d.previous.next=void 0),delete h[d.index],d=d.next;f.first=f.last=void 0,El?f.size=0:c.size=0},delete:function(u){var c=this,f=a(c),h=s(c,u);if(h){var d=h.next,v=h.previous;delete f.index[h.index],h.removed=!0,v&&(v.next=d),d&&(d.previous=v),f.first==h&&(f.first=d),f.last==h&&(f.last=v),El?f.size--:c.size--}return!!h},forEach:function(c){for(var f=a(this),h=m4(c,arguments.length>1?arguments[1]:void 0),d;d=d?d.next:f.first;)for(h(d.value,d.key,this);d&&d.removed;)d=d.previous},has:function(c){return!!s(this,c)}}),xE(i,r?{get:function(c){var f=s(this,c);return f&&f.value},set:function(c,f){return l(this,c===0?0:c,f)}}:{add:function(c){return l(this,c=c===0?0:c,c)}}),El&&g4(i,"size",{get:function(){return a(this).size}}),o},setStrong:function(e,t,r){var n=t+" Iterator",o=cv(t),i=cv(n);C4(e,t,function(a,l){HE(this,{type:n,target:a,state:o(a),kind:l,last:void 0})},function(){for(var a=i(this),l=a.kind,s=a.last;s&&s.removed;)s=s.previous;return!a.target||!(a.last=s=s?s.next:a.state.first)?(a.target=void 0,Iu(void 0,!0)):l=="keys"?Iu(s.key,!1):l=="values"?Iu(s.value,!1):Iu([s.key,s.value],!1)},r?"entries":"values",!r,!0),_4(t)}},O4=Bh,R4=gD;O4("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},R4);var E4=kh,T4=ul,k4=TypeError,yD=function(e){if(E4(e))return e;throw k4(T4(e)+" is not a constructor")},NE=Ct,P4=yD,A4=Nr,I4=lt,$4=I4("species"),M4=function(e,t){var r=NE(e).constructor,n;return r===void 0||A4(n=NE(r)[$4])?t:P4(n)},x4=Ui,Tl=kt,oC=He,D4=Ih,H4=Ct,N4=Nr,L4=CS,LE=rr,j4=M4,B4=LS,F4=Vi,fv=Pt,V4=ji,jE=FS,BE=$h,W4=Ah,U4=MS,z4=Le,ta=U4.UNSUPPORTED_Y,FE=4294967295,G4=Math.min,mD=[].push,Y4=oC(/./.exec),ra=oC(mD),kl=oC("".slice),K4=!z4(function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return r.length!==2||r[0]!=="a"||r[1]!=="b"});D4("split",function(e,t,r){var n;return"abbc".split(/(b)*/)[1]=="c"||"test".split(/(?:)/,-1).length!=4||"ab".split(/(?:ab)*/).length!=2||".".split(/(.?)(.?)/).length!=4||".".split(/()()/).length>1||"".split(/.?/).length?n=function(o,i){var a=fv(LE(this)),l=i===void 0?FE:i>>>0;if(l===0)return[];if(o===void 0)return[a];if(!L4(o))return Tl(t,a,o,l);for(var s=[],u=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(o.sticky?"y":""),c=0,f=new RegExp(o.source,u+"g"),h,d,v;(h=Tl(W4,f,a))&&(d=f.lastIndex,!(d>c&&(ra(s,kl(a,c,h.index)),h.length>1&&h.index=l)));)f.lastIndex===h.index&&f.lastIndex++;return c===a.length?(v||!Y4(f,""))&&ra(s,""):ra(s,kl(a,c)),s.length>l?jE(s,0,l):s}:"0".split(void 0,0).length?n=function(o,i){return o===void 0&&i===0?[]:Tl(t,this,o,i)}:n=t,[function(i,a){var l=LE(this),s=N4(i)?void 0:V4(i,e);return s?Tl(s,i,l,a):Tl(n,fv(l),i,a)},function(o,i){var a=H4(this),l=fv(o),s=r(n,a,l,i,n!==t);if(s.done)return s.value;var u=j4(a,RegExp),c=a.unicode,f=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(ta?"g":"y"),h=new u(ta?"^(?:"+a.source+")":a,f),d=i===void 0?FE:i>>>0;if(d===0)return[];if(l.length===0)return BE(h,l)===null?[l]:[];for(var v=0,g=0,y=[];g1&&arguments[1]!==void 0?arguments[1]:" ";return e.split(t)}function zE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function La(e){return La=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},La(e)}function ms(e){var t;return Array.isArray(e)?t=[]:(t={},Ve(e,function(r,n){n!=="__children"&&(r&&La(r)==="object"&&!Array.isArray(r)?t[n]=ms(r):Array.isArray(r)?r.length&&La(r[0])==="object"&&!Array.isArray(r[0])?t[n]=[ms(r[0])]:t[n]=[]:t[n]=null)})),t}function To(e,t){return t.prototype.constructor=t,e.prototype=new t,e.prototype.constructor=e,e}function ht(e,t,r){var n=Array.isArray(r);return Ve(t,function(o,i){(n===!1||r.includes(i))&&(e[i]=o)}),e}function Fh(e,t){Ve(t,function(r,n){t[n]&&La(t[n])==="object"?(e[n]||(Array.isArray(t[n])?e[n]=[]:Object.prototype.toString.call(t[n])==="[object Date]"?e[n]=t[n]:e[n]={}),Fh(e[n],t[n])):e[n]=t[n]})}function Kt(e){return La(e)==="object"?JSON.parse(JSON.stringify(e)):e}function tr(e){var t={};return Ve(e,function(r,n){t[n]=r}),t}function rt(e){e.MIXINS||(e.MIXINS=[]);for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n1&&arguments[1]!==void 0?arguments[1]:"value",n="_".concat(r),o=(t={_touched:!1},zE(t,n,e),zE(t,"isTouched",function(){return this._touched}),t);return Object.defineProperty(o,r,{get:function(){return this[n]},set:function(a){this._touched=!0,this[n]=a},enumerable:!0,configurable:!0}),o}function it(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Jt=function(t){var r={value:!1};return r.test=function(n,o){r.value=t(n,o)},r},an={chrome:Jt(function(e,t){return/Chrome/.test(e)&&/Google/.test(t)}),chromeWebKit:Jt(function(e){return/CriOS/.test(e)}),edge:Jt(function(e){return/Edge/.test(e)}),edgeWebKit:Jt(function(e){return/EdgiOS/.test(e)}),firefox:Jt(function(e){return/Firefox/.test(e)}),firefoxWebKit:Jt(function(e){return/FxiOS/.test(e)}),ie:Jt(function(e){return/Trident/.test(e)}),ie9:Jt(function(){return!!document.documentMode}),mobile:Jt(function(e){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e)}),safari:Jt(function(e,t){return/Safari/.test(e)&&/Apple Computer/.test(t)})},tu={mac:Jt(function(e){return/^Mac/.test(e)}),win:Jt(function(e){return/^Win/.test(e)}),linux:Jt(function(e){return/^Linux/.test(e)}),ios:Jt(function(e){return/iPhone|iPad|iPod/i.test(e)})};function Q4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.userAgent,r=t===void 0?navigator.userAgent:t,n=e.vendor,o=n===void 0?navigator.vendor:n;Ve(an,function(i){var a=i.test;return void a(r,o)})}function Z4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.platform,r=t===void 0?navigator.platform:t;Ve(tu,function(n){var o=n.test;return void o(r)})}Q4();Z4();function J4(){return an.chrome.value}function e6(){return an.chromeWebKit.value}function dv(){return an.firefox.value}function t6(){return an.firefoxWebKit.value}function r6(){return an.safari.value}function n6(){return an.edge.value}function o6(){return an.ie.value}function i6(){return an.ie9.value}function Jr(){return an.mobile.value}function SD(){return tu.ios.value}function CD(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:navigator,t=e.maxTouchPoints;return t>2&&tu.mac.value}function GE(){return tu.win.value}function YE(){return tu.mac.value}/*! @license DOMPurify 2.4.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.0/LICENSE */function io(e){return io=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},io(e)}function gg(e,t){return gg=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n},gg(e,t)}function a6(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function kc(e,t,r){return a6()?kc=Reflect.construct:kc=function(o,i,a){var l=[null];l.push.apply(l,i);var s=Function.bind.apply(o,l),u=new s;return a&&gg(u,a.prototype),u},kc.apply(null,arguments)}function Ar(e){return l6(e)||s6(e)||u6(e)||c6()}function l6(e){if(Array.isArray(e))return yg(e)}function s6(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function u6(e,t){if(e){if(typeof e=="string")return yg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yg(e,t)}}function yg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{r({action:s.recordVisibilityChange,args:{isVisible:e}})};if(v.useEffect(()=>()=>{r({action:s.recordVisibilityChange,args:{isVisible:!1}})},[]),f.hidden)return null;function $(e){e===0?(console.log(e),b("add remove points")):e===1?(console.log(e),b("toggle")):e===2&&(console.log(e),b("move points"))}let V=null;f.fixed||(V=h(A,{children:[h(O,{onClick:$,children:[o(P,{value:"Add/Remove points"}),o(P,{value:"Toggle points and intervals"}),o(P,{value:"Move Points"})]}),h(K,{children:[o(M,{onClick:()=>r({action:s.clear}),value:"Clear"}),o(M,{onClick:()=>r({action:s.setToR}),value:"R"})]})]}));let y=40,k=36,I=[],C=[];for(let e=-10;e<=10;e++)C.push(e);let T=[];for(let e=y;e<780;e=e+k){I.push(o("line",{x1:e,y1:"35",x2:e,y2:"45",style:{stroke:"black",strokeWidth:"1"},shapeRendering:"geometricPrecision"},"hash"+e));let t=C.shift();T.push(o(D,{x:e,y:"66",textAnchor:"middle",children:t},"label"+e))}let p=[];for(let e of f.points){let t=e.inSubset,i=x(e.value),n="var(--mainPurple)";t||(n="white");let a=`point-${i}`;p.push(o("circle",{cx:i,cy:"40",r:"6",stroke:"black",strokeWidth:"1",fill:n},a))}let R=[];for(let e of f.intervals){if(e.right778&&(W=782,p.push(o("polygon",{points:"795,40 780,46 780,34",style:{fill:c,stroke:c,strokeWidth:"1"}},a))),R.push(o("line",{x1:m,y1:"40",x2:W,y2:"40",style:{stroke:c,strokeWidth:"8"}},u))}function x(e){let t=10,i=1,n=e+t;return y+n/i*k}function j(e){let t=e-y,i=10,n=1,a=t/k*n;return a=a-i,a}async function g(e,t){let i=e.clientX-w.current.offsetLeft,n=j(i),a=.2;if(t==="up"){if(d==="move points"&&l.current!==null&&(r({action:s.movePoint,args:{pointInd:l.current,value:n,transient:!1}}),l.current=null),d==="add remove points")l.current!==null?r({action:s.deletePoint,args:{pointInd:l.current}}):f.points.map(u=>u.value).includes(n)||r({action:s.addPoint,args:{value:n}});else if(d==="toggle")if(l.current!==null)r({action:s.togglePoint,args:{pointInd:l.current}});else{let u=0;for(let c of f.points)c.value{g(e,"down")},onMouseUp:e=>{g(e,"up")},onMouseMove:e=>{g(e,"move")},onMouseLeave:e=>{g(e,"leave")},children:[o("polygon",{points:"5,40 20,50 20,30",style:{fill:"black",stroke:"black",strokeWidth:"1"}}),o("polygon",{points:"795,40 780,50 780,30",style:{fill:"black",stroke:"black",strokeWidth:"1"}}),R,I,o("line",{x1:"20",y1:"40",x2:"780",y2:"40",style:{stroke:"black",strokeWidth:"2"}}),p,T]})]})})});export{Z as default}; +`,Z=F.memo(function(X){let{name:z,id:L,SVs:f,actions:s,callAction:r}=G(X,!1),[d,b]=v.useState("add remove points"),w=v.useRef(null),l=v.useRef(null),B=e=>{r({action:s.recordVisibilityChange,args:{isVisible:e}})};if(v.useEffect(()=>()=>{r({action:s.recordVisibilityChange,args:{isVisible:!1}})},[]),f.hidden)return null;function $(e){e===0?(console.log(e),b("add remove points")):e===1?(console.log(e),b("toggle")):e===2&&(console.log(e),b("move points"))}let V=null;f.fixed||(V=p(A,{children:[p(O,{onClick:$,children:[o(P,{value:"Add/Remove points"}),o(P,{value:"Toggle points and intervals"}),o(P,{value:"Move Points"})]}),p(K,{children:[o(M,{onClick:()=>r({action:s.clear}),value:"Clear"}),o(M,{onClick:()=>r({action:s.setToR}),value:"R"})]})]}));let y=40,k=36,I=[],C=[];for(let e=-10;e<=10;e++)C.push(e);let T=[];for(let e=y;e<780;e=e+k){I.push(o("line",{x1:e,y1:"35",x2:e,y2:"45",style:{stroke:"black",strokeWidth:"1"},shapeRendering:"geometricPrecision"},"hash"+e));let t=C.shift();T.push(o(D,{x:e,y:"66",textAnchor:"middle",children:t},"label"+e))}let h=[];for(let e of f.points){let t=e.inSubset,i=x(e.value),n="var(--mainPurple)";t||(n="white");let a=`point-${i}`;h.push(o("circle",{cx:i,cy:"40",r:"6",stroke:"black",strokeWidth:"1",fill:n},a))}let R=[];for(let e of f.intervals){if(e.right778&&(W=782,h.push(o("polygon",{points:"795,40 780,46 780,34",style:{fill:c,stroke:c,strokeWidth:"1"}},a))),R.push(o("line",{x1:m,y1:"40",x2:W,y2:"40",style:{stroke:c,strokeWidth:"8"}},u))}function x(e){let t=10,i=1,n=e+t;return y+n/i*k}function j(e){let t=e-y,i=10,n=1,a=t/k*n;return a=a-i,a}async function g(e,t){let i=e.clientX-w.current.offsetLeft,n=j(i),a=.2;if(t==="up"){if(d==="move points"&&l.current!==null&&(r({action:s.movePoint,args:{pointInd:l.current,value:n,transient:!1}}),l.current=null),d==="add remove points")l.current!==null?r({action:s.deletePoint,args:{pointInd:l.current}}):f.points.map(u=>u.value).includes(n)||r({action:s.addPoint,args:{value:n}});else if(d==="toggle")if(l.current!==null)r({action:s.togglePoint,args:{pointInd:l.current}});else{let u=0;for(let c of f.points)c.value{g(e,"down")},onMouseUp:e=>{g(e,"up")},onMouseMove:e=>{g(e,"move")},onMouseLeave:e=>{g(e,"leave")},children:[o("polygon",{points:"5,40 20,50 20,30",style:{fill:"black",stroke:"black",strokeWidth:"1"}}),o("polygon",{points:"795,40 780,50 780,30",style:{fill:"black",stroke:"black",strokeWidth:"1"}}),R,I,o("line",{x1:"20",y1:"40",x2:"780",y2:"40",style:{stroke:"black",strokeWidth:"2"}}),h,T]})]})})});export{Z as default}; diff --git a/dist/assets/summaryStatistics-32543040.js b/dist/assets/summaryStatistics-0ee64249.js similarity index 82% rename from dist/assets/summaryStatistics-32543040.js rename to dist/assets/summaryStatistics-0ee64249.js index fc7fbbf7d4..47d93e5505 100644 --- a/dist/assets/summaryStatistics-32543040.js +++ b/dist/assets/summaryStatistics-0ee64249.js @@ -1 +1 @@ -import{av as p,bn as y,r as f,j as e,a as r}from"./index-99a56692.js";import{s as m}from"./css-14ccef8c.js";import{V as g}from"./visibility-sensor-55e75ed1.js";const q=p.memo(function(c){let{name:V,id:s,SVs:t,children:C,actions:n,callAction:l}=y(c),d=i=>{l({action:n.recordVisibilityChange,args:{isVisible:i}})};if(f.useEffect(()=>()=>{l({action:n.recordVisibilityChange,args:{isVisible:!1}})},[]),t.hidden)return null;const u={width:m(t.width),height:m(t.height),borderCollapse:"collapse",borderColor:"black",borderRadius:"var(--mainBorderRadius)"};let o=["mean","stdev","variance","stderr","count","minimum","quartile1","median","quartile3","maximum","range","sum"].filter(i=>i in t.summaryStatistics),h=e("tr",{children:o.map((i,a)=>e("th",{children:i},a))}),b=e("tr",{children:o.map((i,a)=>e("td",{children:t.summaryStatistics[i]},a))});return e(g,{partialVisibility:!0,onChange:d,children:r("div",{style:{margin:"12px 0"},children:[e("a",{name:s}),r("p",{children:["Summary statistics of ",t.columnName]}),e("table",{id:s,style:u,children:r("tbody",{children:[h,b]})})]})})});export{q as default}; +import{av as p,bp as y,r as f,j as e,a as r}from"./index-7074710c.js";import{s as m}from"./css-14ccef8c.js";import{V as g}from"./visibility-sensor-7d414852.js";const q=p.memo(function(c){let{name:V,id:s,SVs:t,children:C,actions:n,callAction:l}=y(c),d=i=>{l({action:n.recordVisibilityChange,args:{isVisible:i}})};if(f.useEffect(()=>()=>{l({action:n.recordVisibilityChange,args:{isVisible:!1}})},[]),t.hidden)return null;const u={width:m(t.width),height:m(t.height),borderCollapse:"collapse",borderColor:"black",borderRadius:"var(--mainBorderRadius)"};let o=["mean","stdev","variance","stderr","count","minimum","quartile1","median","quartile3","maximum","range","sum"].filter(i=>i in t.summaryStatistics),h=e("tr",{children:o.map((i,a)=>e("th",{children:i},a))}),b=e("tr",{children:o.map((i,a)=>e("td",{children:t.summaryStatistics[i]},a))});return e(g,{partialVisibility:!0,onChange:d,children:r("div",{style:{margin:"12px 0"},children:[e("a",{name:s}),r("p",{children:["Summary statistics of ",t.columnName]}),e("table",{id:s,style:u,children:r("tbody",{children:[h,b]})})]})})});export{q as default}; diff --git a/dist/assets/table-5d256c10.js b/dist/assets/table-64ddd443.js similarity index 58% rename from dist/assets/table-5d256c10.js rename to dist/assets/table-64ddd443.js index dca0cc6f0e..357dded143 100644 --- a/dist/assets/table-5d256c10.js +++ b/dist/assets/table-64ddd443.js @@ -1 +1 @@ -import{av as u,bn as g,r as V,j as l,a as h,F as C}from"./index-99a56692.js";import{V as y}from"./visibility-sensor-55e75ed1.js";const v=u.memo(function(f){var m;let{name:x,id:n,SVs:t,children:a,actions:s,callAction:o}=g(f),b=e=>{o({action:s.recordVisibilityChange,args:{isVisible:e}})};if(V.useEffect(()=>()=>{o({action:s.recordVisibilityChange,args:{isVisible:!1}})},[]),t.hidden)return null;let d=null,c=[...a],i;if(t.titleChildName){let e;for(let[p,r]of a.entries())if(((m=r==null?void 0:r.props)==null?void 0:m.componentInstructions.componentName)===t.titleChildName){e=p;break}i=a[e],c.splice(e,1)}else i=t.title;if(!t.suppressTableNameInTitle){let e=l("strong",{children:t.tableName});i?i=h(C,{children:[e,": ",i]}):i=e}return d=l("div",{id:n+"_title",children:i}),l(y,{partialVisibility:!0,onChange:b,children:h("div",{id:n,style:{margin:"12px 0"},children:[l("a",{name:n}),d,c]})})});export{v as default}; +import{av as u,bp as g,r as V,j as l,a as h,F as C}from"./index-7074710c.js";import{V as y}from"./visibility-sensor-7d414852.js";const v=u.memo(function(f){var m;let{name:x,id:n,SVs:t,children:a,actions:s,callAction:o}=g(f),p=e=>{o({action:s.recordVisibilityChange,args:{isVisible:e}})};if(V.useEffect(()=>()=>{o({action:s.recordVisibilityChange,args:{isVisible:!1}})},[]),t.hidden)return null;let d=null,c=[...a],i;if(t.titleChildName){let e;for(let[b,r]of a.entries())if(((m=r==null?void 0:r.props)==null?void 0:m.componentInstructions.componentName)===t.titleChildName){e=b;break}i=a[e],c.splice(e,1)}else i=t.title;if(!t.suppressTableNameInTitle){let e=l("strong",{children:t.tableName});i?i=h(C,{children:[e,": ",i]}):i=e}return d=l("div",{id:n+"_title",children:i}),l(y,{partialVisibility:!0,onChange:p,children:h("div",{id:n,style:{margin:"12px 0"},children:[l("a",{name:n}),d,c]})})});export{v as default}; diff --git a/dist/assets/tabular-c4050873.js b/dist/assets/tabular-c18e7770.js similarity index 79% rename from dist/assets/tabular-c4050873.js rename to dist/assets/tabular-c18e7770.js index caf8591846..ef53b89d4e 100644 --- a/dist/assets/tabular-c4050873.js +++ b/dist/assets/tabular-c18e7770.js @@ -1 +1 @@ -import{av as c,bn as h,r as m,j as r,a as p}from"./index-99a56692.js";import{s}from"./css-14ccef8c.js";import{V as u}from"./visibility-sensor-55e75ed1.js";const C=c.memo(function(l){let{name:y,id:t,SVs:e,children:n,actions:a,callAction:o}=h(l),d=b=>{o({action:a.recordVisibilityChange,args:{isVisible:b}})};if(m.useEffect(()=>()=>{o({action:a.recordVisibilityChange,args:{isVisible:!1}})},[]),e.hidden)return null;const i={width:s(e.width),height:s(e.height),borderCollapse:"collapse",borderColor:"var(--canvastext)",borderRadius:"var(--mainBorderRadius)",tableLayout:"fixed"};return e.top!=="none"&&(i.borderTopStyle="solid",e.top==="minor"?i.borderTopWidth="thin":e.top==="medium"?i.borderTopWidth="medium":i.borderTopWidth="thick"),r(u,{partialVisibility:!0,onChange:d,children:p("div",{style:{margin:"12px 0"},children:[r("a",{name:t}),r("table",{id:t,style:i,children:r("tbody",{children:n})})]})})});export{C as default}; +import{av as c,bp as h,r as m,j as r,a as p}from"./index-7074710c.js";import{s}from"./css-14ccef8c.js";import{V as u}from"./visibility-sensor-7d414852.js";const C=c.memo(function(l){let{name:y,id:t,SVs:e,children:n,actions:a,callAction:o}=h(l),d=b=>{o({action:a.recordVisibilityChange,args:{isVisible:b}})};if(m.useEffect(()=>()=>{o({action:a.recordVisibilityChange,args:{isVisible:!1}})},[]),e.hidden)return null;const i={width:s(e.width),height:s(e.height),borderCollapse:"collapse",borderColor:"var(--canvastext)",borderRadius:"var(--mainBorderRadius)",tableLayout:"fixed"};return e.top!=="none"&&(i.borderTopStyle="solid",e.top==="minor"?i.borderTopWidth="thin":e.top==="medium"?i.borderTopWidth="medium":i.borderTopWidth="thick"),r(u,{partialVisibility:!0,onChange:d,children:p("div",{style:{margin:"12px 0"},children:[r("a",{name:t}),r("table",{id:t,style:i,children:r("tbody",{children:n})})]})})});export{C as default}; diff --git a/dist/assets/tag-36b858d8.js b/dist/assets/tag-36b858d8.js new file mode 100644 index 0000000000..b74c94c6a0 --- /dev/null +++ b/dist/assets/tag-36b858d8.js @@ -0,0 +1 @@ +import{av as l,bp as o,a as d,j as i}from"./index-7074710c.js";const u=l.memo(function(s){let{name:m,id:e,SVs:a,children:r}=o(s);if(a.hidden)return null;let t="<",n=">";return a.selfClosed&&(n="/>"),d("code",{id:e,style:{color:"var(--mainGreen)"},children:[i("a",{name:e}),t,r,n]})});export{u as default}; diff --git a/dist/assets/tag-ff0e0cde.js b/dist/assets/tag-ff0e0cde.js deleted file mode 100644 index 4057b07fa6..0000000000 --- a/dist/assets/tag-ff0e0cde.js +++ /dev/null @@ -1 +0,0 @@ -import{av as l,bn as o,a as d,j as i}from"./index-99a56692.js";const u=l.memo(function(s){let{name:m,id:e,SVs:n,children:r}=o(s);if(n.hidden)return null;let t="<",a=">";return n.selfClosed&&(a="/>"),d("code",{id:e,style:{color:"var(--mainGreen)"},children:[i("a",{name:e}),t,r,a]})});export{u as default}; diff --git a/dist/assets/text-74742579.js b/dist/assets/text-a4ea3b78.js similarity index 91% rename from dist/assets/text-74742579.js rename to dist/assets/text-a4ea3b78.js index c350f93d06..e9a2558517 100644 --- a/dist/assets/text-74742579.js +++ b/dist/assets/text-a4ea3b78.js @@ -1 +1 @@ -import{av as k,bn as L,r as c,bo as J,j as O,a as W,F as q}from"./index-99a56692.js";import{BoardContext as H,TEXT_LAYER_OFFSET as N}from"./graph-57e1e537.js";import"./css-14ccef8c.js";import"./visibility-sensor-55e75ed1.js";const te=k.memo(function U(Y){let{name:I,id:v,SVs:e,actions:S,sourceOfUpdate:K,callAction:T}=L(Y);U.ignoreActionsWithoutCore=!0;let t=c.useRef(null),p=c.useRef(null),x=c.useRef(null);const i=c.useContext(H);let d=c.useRef(!1),F=c.useRef(!1),g=c.useRef(!1),m=c.useRef(null),h=c.useRef(null),j=c.useRef(null),y=c.useRef(null);c.useEffect(()=>()=>{t.current!==null&&(t.current.off("drag"),t.current.off("down"),t.current.off("up"),i==null||i.removeObject(t.current),t.current=null)},[]);function B(){let u=!e.draggable||e.fixed,n={visible:!e.hidden,fixed:u,layer:10*e.layer+N,highlight:!u},a;try{let r=J.fromAst(e.anchor),f=[r.get_component(0).evaluate_to_constant(),r.get_component(1).evaluate_to_constant()];Number.isFinite(f[0])||(f[0]=0,n.visible=!1),Number.isFinite(f[1])||(f[1]=0,n.visible=!1),a=i.create("point",f,{visible:!1})}catch{n.visible=!1,a=i.create("point",[0,0],{visible:!1})}n.anchor=a;let s,l;e.positionFromAnchor==="center"?(s="middle",l="middle"):e.positionFromAnchor==="lowerleft"?(s="right",l="top"):e.positionFromAnchor==="lowerright"?(s="left",l="top"):e.positionFromAnchor==="upperleft"?(s="right",l="bottom"):e.positionFromAnchor==="upperright"?(s="left",l="bottom"):e.positionFromAnchor==="bottom"?(s="middle",l="top"):e.positionFromAnchor==="top"?(s="middle",l="bottom"):e.positionFromAnchor==="right"?(s="left",l="middle"):(s="right",l="middle"),n.anchorx=s,n.anchory=l,x.current=[s,l];let o=i.create("text",[0,0,e.text],n);o.on("down",function(r){d.current=[r.x,r.y],F.current=[...a.coords.scrCoords],g.current=!1}),o.on("up",function(r){g.current&&T({action:S.moveText,args:{x:m.current,y:h.current}}),g.current=!1}),o.on("drag",function(r){var f=i.origin.scrCoords;let[C,R,_,P]=i.getBoundingBox(),X=o.size[0]/i.unitX,w=o.size[1]/i.unitY,E=x.current[0],G=x.current[1],b=0;E==="middle"?b=-X/2:E==="right"&&(b=-X);let A=0;G==="middle"?A=-w/2:G==="top"&&(A=-w);let D=C+.04*(_-C)-b-X,M=_-.04*(_-C)-b,z=P+.04*(R-P)-A-w,V=R-.04*(R-P)-A;m.current=(F.current[1]+r.x-d.current[0]-f[1])/i.unitX,m.current=Math.min(M,Math.max(D,m.current)),h.current=(f[2]-(F.current[2]+r.y-d.current[1]))/i.unitY,h.current=Math.min(V,Math.max(z,h.current)),T({action:S.moveText,args:{x:m.current,y:h.current,transient:!0,skippable:!0}}),o.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,[0,0]),a.coords.setCoordinates(JXG.COORDS_BY_USER,j.current),(Math.abs(r.x-d.current[0])>.1||Math.abs(r.y-d.current[1])>.1)&&(g.current=!0)}),t.current=o,p.current=a,y.current=e.positionFromAnchor}if(i){let u;try{let n=J.fromAst(e.anchor);u=[n.get_component(0).evaluate_to_constant(),n.get_component(1).evaluate_to_constant()]}catch{u=[NaN,NaN]}if(j.current=u,t.current===null)B();else{t.current.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,[0,0]),p.current.coords.setCoordinates(JXG.COORDS_BY_USER,u),t.current.setText(e.text);let n=!e.hidden;if(Number.isFinite(u[0])&&Number.isFinite(u[1])){let o=t.current.visProp.visible!==n;t.current.visProp.visible=n,t.current.visPropCalc.visible=n,o&&t.current.setAttribute({visible:n})}else t.current.visProp.visible=!1,t.current.visPropCalc.visible=!1;let a=10*e.layer+N;t.current.visProp.layer!==a&&t.current.setAttribute({layer:a});let l=!e.draggable||e.fixed;if(t.current.visProp.highlight=!l,t.current.visProp.fixed=l,t.current.needsUpdate=!0,e.positionFromAnchor!==y.current){let o,r;e.positionFromAnchor==="center"?(o="middle",r="middle"):e.positionFromAnchor==="lowerleft"?(o="right",r="top"):e.positionFromAnchor==="lowerright"?(o="left",r="top"):e.positionFromAnchor==="upperleft"?(o="right",r="bottom"):e.positionFromAnchor==="upperright"?(o="left",r="bottom"):e.positionFromAnchor==="bottom"?(o="middle",r="top"):e.positionFromAnchor==="top"?(o="middle",r="bottom"):e.positionFromAnchor==="right"?(o="left",r="middle"):(o="right",r="middle"),t.current.visProp.anchorx=o,t.current.visProp.anchory=r,x.current=[o,r],y.current=e.positionFromAnchor,t.current.fullUpdate()}else t.current.update();p.current.needsUpdate=!0,p.current.update(),i.updateRenderer()}return O("a",{name:v})}return e.hidden?null:W(q,{children:[O("a",{name:v}),O("span",{id:v,children:e.text})]})});export{te as default}; +import{av as k,bp as q,r as c,bq as J,j as O,a as L,F as W}from"./index-7074710c.js";import{BoardContext as H,TEXT_LAYER_OFFSET as N}from"./graph-71cec529.js";import"./css-14ccef8c.js";import"./visibility-sensor-7d414852.js";const te=k.memo(function U(Y){let{name:I,id:v,SVs:e,actions:S,sourceOfUpdate:K,callAction:T}=q(Y);U.ignoreActionsWithoutCore=!0;let t=c.useRef(null),p=c.useRef(null),x=c.useRef(null);const i=c.useContext(H);let d=c.useRef(!1),F=c.useRef(!1),g=c.useRef(!1),m=c.useRef(null),h=c.useRef(null),j=c.useRef(null),y=c.useRef(null);c.useEffect(()=>()=>{t.current!==null&&(t.current.off("drag"),t.current.off("down"),t.current.off("up"),i==null||i.removeObject(t.current),t.current=null)},[]);function B(){let u=!e.draggable||e.fixed,n={visible:!e.hidden,fixed:u,layer:10*e.layer+N,highlight:!u},a;try{let r=J.fromAst(e.anchor),f=[r.get_component(0).evaluate_to_constant(),r.get_component(1).evaluate_to_constant()];Number.isFinite(f[0])||(f[0]=0,n.visible=!1),Number.isFinite(f[1])||(f[1]=0,n.visible=!1),a=i.create("point",f,{visible:!1})}catch{n.visible=!1,a=i.create("point",[0,0],{visible:!1})}n.anchor=a;let s,l;e.positionFromAnchor==="center"?(s="middle",l="middle"):e.positionFromAnchor==="lowerleft"?(s="right",l="top"):e.positionFromAnchor==="lowerright"?(s="left",l="top"):e.positionFromAnchor==="upperleft"?(s="right",l="bottom"):e.positionFromAnchor==="upperright"?(s="left",l="bottom"):e.positionFromAnchor==="bottom"?(s="middle",l="top"):e.positionFromAnchor==="top"?(s="middle",l="bottom"):e.positionFromAnchor==="right"?(s="left",l="middle"):(s="right",l="middle"),n.anchorx=s,n.anchory=l,x.current=[s,l];let o=i.create("text",[0,0,e.text],n);o.on("down",function(r){d.current=[r.x,r.y],F.current=[...a.coords.scrCoords],g.current=!1}),o.on("up",function(r){g.current&&T({action:S.moveText,args:{x:m.current,y:h.current}}),g.current=!1}),o.on("drag",function(r){var f=i.origin.scrCoords;let[C,R,_,P]=i.getBoundingBox(),X=o.size[0]/i.unitX,w=o.size[1]/i.unitY,E=x.current[0],G=x.current[1],b=0;E==="middle"?b=-X/2:E==="right"&&(b=-X);let A=0;G==="middle"?A=-w/2:G==="top"&&(A=-w);let D=C+.04*(_-C)-b-X,M=_-.04*(_-C)-b,z=P+.04*(R-P)-A-w,V=R-.04*(R-P)-A;m.current=(F.current[1]+r.x-d.current[0]-f[1])/i.unitX,m.current=Math.min(M,Math.max(D,m.current)),h.current=(f[2]-(F.current[2]+r.y-d.current[1]))/i.unitY,h.current=Math.min(V,Math.max(z,h.current)),T({action:S.moveText,args:{x:m.current,y:h.current,transient:!0,skippable:!0}}),o.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,[0,0]),a.coords.setCoordinates(JXG.COORDS_BY_USER,j.current),(Math.abs(r.x-d.current[0])>.1||Math.abs(r.y-d.current[1])>.1)&&(g.current=!0)}),t.current=o,p.current=a,y.current=e.positionFromAnchor}if(i){let u;try{let n=J.fromAst(e.anchor);u=[n.get_component(0).evaluate_to_constant(),n.get_component(1).evaluate_to_constant()]}catch{u=[NaN,NaN]}if(j.current=u,t.current===null)B();else{t.current.relativeCoords.setCoordinates(JXG.COORDS_BY_USER,[0,0]),p.current.coords.setCoordinates(JXG.COORDS_BY_USER,u),t.current.setText(e.text);let n=!e.hidden;if(Number.isFinite(u[0])&&Number.isFinite(u[1])){let o=t.current.visProp.visible!==n;t.current.visProp.visible=n,t.current.visPropCalc.visible=n,o&&t.current.setAttribute({visible:n})}else t.current.visProp.visible=!1,t.current.visPropCalc.visible=!1;let a=10*e.layer+N;t.current.visProp.layer!==a&&t.current.setAttribute({layer:a});let l=!e.draggable||e.fixed;if(t.current.visProp.highlight=!l,t.current.visProp.fixed=l,t.current.needsUpdate=!0,e.positionFromAnchor!==y.current){let o,r;e.positionFromAnchor==="center"?(o="middle",r="middle"):e.positionFromAnchor==="lowerleft"?(o="right",r="top"):e.positionFromAnchor==="lowerright"?(o="left",r="top"):e.positionFromAnchor==="upperleft"?(o="right",r="bottom"):e.positionFromAnchor==="upperright"?(o="left",r="bottom"):e.positionFromAnchor==="bottom"?(o="middle",r="top"):e.positionFromAnchor==="top"?(o="middle",r="bottom"):e.positionFromAnchor==="right"?(o="left",r="middle"):(o="right",r="middle"),t.current.visProp.anchorx=o,t.current.visProp.anchory=r,x.current=[o,r],y.current=e.positionFromAnchor,t.current.fullUpdate()}else t.current.update();p.current.needsUpdate=!0,p.current.update(),i.updateRenderer()}return O("a",{name:v})}return e.hidden?null:L(W,{children:[O("a",{name:v}),O("span",{id:v,children:e.text})]})});export{te as default}; diff --git a/dist/assets/textInput-1f45908d.js b/dist/assets/textInput-ac28802f.js similarity index 92% rename from dist/assets/textInput-1f45908d.js rename to dist/assets/textInput-ac28802f.js index 185d48fc0f..2ebcb58821 100644 --- a/dist/assets/textInput-1f45908d.js +++ b/dist/assets/textInput-ac28802f.js @@ -1,4 +1,4 @@ -import{bn as D,r as g,R as L,br as j,j as r,i as y,bp as z,a0 as G,aP as H,bq as N,a as p,F as v,av as U,s as w}from"./index-99a56692.js";import{s as K}from"./css-14ccef8c.js";const h=w.button` +import{bp as D,r as g,R as L,bt as j,j as r,i as y,br as z,a0 as G,aP as H,bs as N,a as p,F as v,av as U,s as w}from"./index-7074710c.js";import{s as K}from"./css-14ccef8c.js";const h=w.button` position: relative; height: 24px; width: 24px; @@ -15,7 +15,7 @@ import{bn as D,r as g,R as L,br as j,j as r,i as y,bp as z,a0 as G,aP as H,bq as background-color: var(--lightBlue); color: black; }; -`,q=w.textarea` +`,M=w.textarea` width: ${t=>t.textAreaWidth}; height: ${t=>t.textAreaHeight}; // Same height as the checkWorkButton, accounting for the borders font-size: 14px; @@ -26,7 +26,7 @@ import{bn as D,r as g,R as L,br as j,j as r,i as y,bp as z,a0 as G,aP as H,bq as outline: var(--mainBorder); outline-offset: 2px; } -`,M=w.input` +`,q=w.input` width: ${t=>t.inputWidth}px; height: 20px; // Same height as the checkWorkButton, accounting for the borders font-size: 14px; @@ -37,4 +37,4 @@ import{bn as D,r as g,R as L,br as j,j as r,i as y,bp as z,a0 as G,aP as H,bq as outline: var(--mainBorder); outline-offset: 2px; } -`;function J(t){let{name:Q,id:l,SVs:e,actions:s,sourceOfUpdate:X,ignoreUpdate:P,rendererName:_,callAction:u}=D(t),$=K(e.width),E=K(e.height),I=e.size*10;J.baseStateVariable="immediateValue";const[d,V]=g.useState(e.immediateValue),O=L(j(_));let f=g.useRef(e.immediateValue),C=g.useRef(null),m=g.useRef(null);!P&&m.current!==e.immediateValue?(V(e.immediateValue),m.current=e.immediateValue,f.current=e.immediateValue):m.current=null;let c="unvalidated";e.valueHasBeenValidated&&(e.creditAchieved===1?c="correct":e.creditAchieved===0?c="incorrect":c="partialcorrect");function A(o){o.key==="Enter"&&(f.current=d,u({action:s.updateValue,baseVariableValue:d}),e.includeCheckWork&&!e.suppressCheckwork&&!e.expanded&&c==="unvalidated"&&u({action:s.submitAnswer}))}function B(o){if(o.key==="Escape"){let i=f.current;i!==d&&(V(i),m.current=e.immediateValue,u({action:s.updateImmediateValue,args:{text:i},baseVariableValue:i}))}}function S(o){C.current=!0}function R(o){C.current=!1,f.current=d,u({action:s.updateValue,baseVariableValue:d})}function W(o){let i=o.target.value;i!==d&&(V(i),O(T=>{let F={...T};return F.ignoreUpdate=!0,F}),m.current=e.immediateValue,u({action:s.updateImmediateValue,args:{text:i},baseVariableValue:i}))}if(e.hidden)return null;let x=e.disabled;const b=l+"_input";let a={cursor:"pointer",padding:"1px 6px 1px 6px"};x&&(a.backgroundColor=getComputedStyle(document.documentElement).getPropertyValue("--mainGray"),a.cursor="not-allowed",a.color="black");let n=null;if(e.includeCheckWork&&!e.suppressCheckwork){if(c==="unvalidated")n=r(h,{id:l+"_submit",tabIndex:"0",disabled:x,style:a,onClick:()=>u({action:s.submitAnswer}),onKeyPress:o=>{o.key==="Enter"&&u({action:s.submitAnswer})},children:r(y,{style:{},icon:z,transform:{rotate:90}})});else if(e.showCorrectness)if(c==="correct")a.backgroundColor=getComputedStyle(document.documentElement).getPropertyValue("--mainGreen"),n=r(h,{id:l+"_correct",style:a,children:r(y,{icon:G})});else if(c==="partialcorrect"){let i=`${Math.round(e.creditAchieved*100)} %`;a.width="44px",a.backgroundColor="#efab34",n=r(h,{id:l+"_partial",style:a,children:i})}else a.backgroundColor=getComputedStyle(document.documentElement).getPropertyValue("--mainRed"),n=r(h,{id:l+"_incorrect",style:a,children:r(y,{icon:H})});else a.backgroundColor="rgb(74, 3, 217)",a.padding="1px 8px 1px 4px",n=r(h,{id:l+"_saved",style:a,children:r(y,{icon:N})});e.numberOfAttemptsLeft<0?n=p(v,{children:[n,r("span",{children:"(no attempts remaining)"})]}):e.numberOfAttemptsLeft==1?n=p(v,{children:[n,r("span",{children:"(1 attempt remaining)"})]}):Number.isFinite(e.numberOfAttemptsLeft)&&(n=p(v,{children:[n,p("span",{children:["(attempts remaining: ",e.numberOfAttemptsLeft,")"]})]}))}let k;return e.expanded?k=r(q,{id:b,value:d,disabled:x,onChange:W,onKeyPress:A,onKeyDown:B,onBlur:R,onFocus:S,textAreaWidth:$,textAreaHeight:E,style:{margin:"0px 4px 4px 4px"}},b):k=r(M,{id:b,value:d,disabled:x,onChange:W,onKeyPress:A,onKeyDown:B,onBlur:R,onFocus:S,inputWidth:I,style:{margin:"0px 4px 4px 4px"}},b),p(U.Fragment,{children:[r("a",{name:l}),p("span",{className:"textInputSurroundingBox",id:l,style:{display:"inline-flex",maxWidth:"100%"},children:[k,n]})]})}export{J as default}; +`;function J(t){let{name:Q,id:l,SVs:e,actions:s,sourceOfUpdate:X,ignoreUpdate:P,rendererName:_,callAction:u}=D(t),$=K(e.width),E=K(e.height),I=e.size*10;J.baseStateVariable="immediateValue";const[d,V]=g.useState(e.immediateValue),O=L(j(_));let f=g.useRef(e.immediateValue),C=g.useRef(null),m=g.useRef(null);!P&&m.current!==e.immediateValue?(V(e.immediateValue),m.current=e.immediateValue,f.current=e.immediateValue):m.current=null;let c="unvalidated";e.valueHasBeenValidated&&(e.creditAchieved===1?c="correct":e.creditAchieved===0?c="incorrect":c="partialcorrect");function A(o){o.key==="Enter"&&(f.current=d,u({action:s.updateValue,baseVariableValue:d}),e.includeCheckWork&&!e.suppressCheckwork&&!e.expanded&&c==="unvalidated"&&u({action:s.submitAnswer}))}function B(o){if(o.key==="Escape"){let i=f.current;i!==d&&(V(i),m.current=e.immediateValue,u({action:s.updateImmediateValue,args:{text:i},baseVariableValue:i}))}}function S(o){C.current=!0}function R(o){C.current=!1,f.current=d,u({action:s.updateValue,baseVariableValue:d})}function W(o){let i=o.target.value;i!==d&&(V(i),O(T=>{let F={...T};return F.ignoreUpdate=!0,F}),m.current=e.immediateValue,u({action:s.updateImmediateValue,args:{text:i},baseVariableValue:i}))}if(e.hidden)return null;let x=e.disabled;const b=l+"_input";let a={cursor:"pointer",padding:"1px 6px 1px 6px"};x&&(a.backgroundColor=getComputedStyle(document.documentElement).getPropertyValue("--mainGray"),a.cursor="not-allowed",a.color="black");let n=null;if(e.includeCheckWork&&!e.suppressCheckwork){if(c==="unvalidated")n=r(h,{id:l+"_submit",tabIndex:"0",disabled:x,style:a,onClick:()=>u({action:s.submitAnswer}),onKeyPress:o=>{o.key==="Enter"&&u({action:s.submitAnswer})},children:r(y,{style:{},icon:z,transform:{rotate:90}})});else if(e.showCorrectness)if(c==="correct")a.backgroundColor=getComputedStyle(document.documentElement).getPropertyValue("--mainGreen"),n=r(h,{id:l+"_correct",style:a,children:r(y,{icon:G})});else if(c==="partialcorrect"){let i=`${Math.round(e.creditAchieved*100)} %`;a.width="44px",a.backgroundColor="#efab34",n=r(h,{id:l+"_partial",style:a,children:i})}else a.backgroundColor=getComputedStyle(document.documentElement).getPropertyValue("--mainRed"),n=r(h,{id:l+"_incorrect",style:a,children:r(y,{icon:H})});else a.backgroundColor="rgb(74, 3, 217)",a.padding="1px 8px 1px 4px",n=r(h,{id:l+"_saved",style:a,children:r(y,{icon:N})});e.numberOfAttemptsLeft<0?n=p(v,{children:[n,r("span",{children:"(no attempts remaining)"})]}):e.numberOfAttemptsLeft==1?n=p(v,{children:[n,r("span",{children:"(1 attempt remaining)"})]}):Number.isFinite(e.numberOfAttemptsLeft)&&(n=p(v,{children:[n,p("span",{children:["(attempts remaining: ",e.numberOfAttemptsLeft,")"]})]}))}let k;return e.expanded?k=r(M,{id:b,value:d,disabled:x,onChange:W,onKeyPress:A,onKeyDown:B,onBlur:R,onFocus:S,textAreaWidth:$,textAreaHeight:E,style:{margin:"0px 4px 4px 4px"}},b):k=r(q,{id:b,value:d,disabled:x,onChange:W,onKeyPress:A,onKeyDown:B,onBlur:R,onFocus:S,inputWidth:I,style:{margin:"0px 4px 4px 4px"}},b),p(U.Fragment,{children:[r("a",{name:l}),p("span",{className:"textInputSurroundingBox",id:l,style:{display:"inline-flex",maxWidth:"100%"},children:[k,n]})]})}export{J as default}; diff --git a/dist/assets/textList-4e0545b9.js b/dist/assets/textList-6cb5330d.js similarity index 83% rename from dist/assets/textList-4e0545b9.js rename to dist/assets/textList-6cb5330d.js index ebb032a7a4..6a03cfffba 100644 --- a/dist/assets/textList-4e0545b9.js +++ b/dist/assets/textList-6cb5330d.js @@ -1 +1 @@ -import{av as a,bn as c,a as s,j as r}from"./index-99a56692.js";const x=a.memo(function(i){let{name:u,id:e,SVs:t,children:n}=c(i);if(t.hidden)return null;if(n.length===0&&t.text)return s(a.Fragment,{children:[r("a",{name:e}),r("span",{id:e,children:t.text})]},e);let l=n.slice(1).reduce((m,d)=>[...m,", ",d],[n[0]]);return s(a.Fragment,{children:[r("a",{name:e}),l]},e)});export{x as default}; +import{av as a,bp as c,a as s,j as r}from"./index-7074710c.js";const x=a.memo(function(i){let{name:u,id:e,SVs:t,children:n}=c(i);if(t.hidden)return null;if(n.length===0&&t.text)return s(a.Fragment,{children:[r("a",{name:e}),r("span",{id:e,children:t.text})]},e);let l=n.slice(1).reduce((m,d)=>[...m,", ",d],[n[0]]);return s(a.Fragment,{children:[r("a",{name:e}),l]},e)});export{x as default}; diff --git a/dist/assets/triggerSet-5e33735f.js b/dist/assets/triggerSet-5e33735f.js deleted file mode 100644 index e49bb094a1..0000000000 --- a/dist/assets/triggerSet-5e33735f.js +++ /dev/null @@ -1 +0,0 @@ -import{av as s,bn as r,a as o,j as t,B as d}from"./index-99a56692.js";const g=s.memo(function(n){let{name:u,id:a,SVs:e,actions:i,callAction:l}=r(n,!1);return e.hidden?null:o("div",{id:a,style:{margin:"12px 0",display:"inline-block"},children:[t("a",{name:a}),t(d,{id:a+"_button",onClick:()=>l({action:i.triggerActions}),disabled:e.disabled,value:e.label,valueHasLatex:e.labelHasLatex})]})});export{g as default}; diff --git a/dist/assets/triggerSet-ef3bd2fe.js b/dist/assets/triggerSet-ef3bd2fe.js new file mode 100644 index 0000000000..441aff0bd5 --- /dev/null +++ b/dist/assets/triggerSet-ef3bd2fe.js @@ -0,0 +1 @@ +import{av as s,bp as r,a as o,j as t,B as d}from"./index-7074710c.js";const g=s.memo(function(i){let{name:u,id:a,SVs:e,actions:n,callAction:l}=r(i,!1);return e.hidden?null:o("div",{id:a,style:{margin:"12px 0",display:"inline-block"},children:[t("a",{name:a}),t(d,{id:a+"_button",onClick:()=>l({action:n.triggerActions}),disabled:e.disabled,value:e.label,valueHasLatex:e.labelHasLatex})]})});export{g as default}; diff --git a/dist/assets/updateValue-488877e4.js b/dist/assets/updateValue-83b7ae1f.js similarity index 62% rename from dist/assets/updateValue-488877e4.js rename to dist/assets/updateValue-83b7ae1f.js index 3414e019fa..891ecce824 100644 --- a/dist/assets/updateValue-488877e4.js +++ b/dist/assets/updateValue-83b7ae1f.js @@ -1 +1 @@ -import{av as i,bn as d,a as u,j as l,B as o}from"./index-99a56692.js";const m=i.memo(function(t){let{name:c,id:e,SVs:a,actions:n,callAction:s}=d(t,!1);return a.hidden?null:u("div",{id:e,margin:"12px 0",style:{display:"inline-block"},children:[l("a",{name:e}),l(o,{id:e+"_button",onClick:()=>s({action:n.updateValue}),disabled:a.disabled,value:a.label,valueHasLatex:a.labelHasLatex})]})});export{m as default}; +import{av as i,bp as d,a as u,j as l,B as o}from"./index-7074710c.js";const b=i.memo(function(t){let{name:c,id:e,SVs:a,actions:n,callAction:s}=d(t,!1);return a.hidden?null:u("div",{id:e,margin:"12px 0",style:{display:"inline-block"},children:[l("a",{name:e}),l(o,{id:e+"_button",onClick:()=>s({action:n.updateValue}),disabled:a.disabled,value:a.label,valueHasLatex:a.labelHasLatex})]})});export{b as default}; diff --git a/dist/assets/useSaveDraft-a42d0f94.js b/dist/assets/useSaveDraft-5f9f3fe4.js similarity index 75% rename from dist/assets/useSaveDraft-a42d0f94.js rename to dist/assets/useSaveDraft-5f9f3fe4.js index 0df4b0ef93..17d7b697a9 100644 --- a/dist/assets/useSaveDraft-a42d0f94.js +++ b/dist/assets/useSaveDraft-5f9f3fe4.js @@ -1 +1 @@ -import{y as m,v as u,k as p,aZ as d,z as v}from"./index-99a56692.js";import{t as y}from"./EditorViewerRecoil-41e59102.js";function x(){const a=m();return{saveDraft:u(({snapshot:r,set:n})=>async({pageId:t,courseId:c,backup:i=!1})=>{const e=await r.getPromise(y);try{const s={doenetML:e,pageId:t,courseId:c,backup:i},{data:{success:o,message:f}}=await p.post("/api/saveDoenetML.php",s);if(!o)throw new Error(f);return n(d(t),e),{success:o}}catch(s){return a(s.message,v.ERROR),{success:!1}}},[a])}}export{x as u}; +import{y as m,v as u,k as p,aZ as d,z as v}from"./index-7074710c.js";import{t as y}from"./EditorViewerRecoil-fb47fc9d.js";function x(){const a=m();return{saveDraft:u(({snapshot:r,set:n})=>async({pageId:t,courseId:c,backup:i=!1})=>{const e=await r.getPromise(y);try{const s={doenetML:e,pageId:t,courseId:c,backup:i},{data:{success:o,message:f}}=await p.post("/api/saveDoenetML.php",s);if(!o)throw new Error(f);return n(d(t),e),{success:o}}catch(s){return a(s.message,v.ERROR),{success:!1}}},[a])}}export{x as u}; diff --git a/dist/assets/vector-a4f5b9ff.js b/dist/assets/vector-52de4831.js similarity index 95% rename from dist/assets/vector-a4f5b9ff.js rename to dist/assets/vector-52de4831.js index 8094aaf2ca..e1ab49ea9e 100644 --- a/dist/assets/vector-a4f5b9ff.js +++ b/dist/assets/vector-52de4831.js @@ -1 +1 @@ -import{av as Z,bn as $,r as o,l as ee,bs as te,j as V,F as W,a as re,b9 as ne}from"./index-99a56692.js";import{BoardContext as oe,LINE_LAYER_OFFSET as B,VERTEX_LAYER_OFFSET as T}from"./graph-57e1e537.js";import"./css-14ccef8c.js";import"./visibility-sensor-55e75ed1.js";const se=Z.memo(function O(z){let{name:_,id:A,SVs:e,actions:d,sourceOfUpdate:L,callAction:f}=$(z);O.ignoreActionsWithoutCore=!0;const n=o.useContext(oe);let t=o.useRef({}),l=o.useRef({}),i=o.useRef({}),x=o.useRef(!1),j=o.useRef(!1),a=o.useRef(!1),c=o.useRef(!1),D=o.useRef(null),w=o.useRef(null),R=o.useRef(null),U=o.useRef(!1),J=o.useRef(null);J.current=e.numericalEndpoints;const Y=ee(te);o.useEffect(()=>()=>{Object.keys(t.current).length!==0&&I()},[]);function H(){if(e.numericalEndpoints.length!==2||e.numericalEndpoints.some(r=>r.length!==2)){t.current={},l.current={},i.current={};return}let p=10*e.layer+B,h=10*e.layer+T,v=!e.draggable||e.fixed,m=Y==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;m=m.toLowerCase();var u={name:e.labelForGraph,visible:!e.hidden,withLabel:e.showLabel&&e.labelForGraph!=="",fixed:v,layer:p,strokeColor:m,strokeOpacity:e.selectedStyle.lineOpacity,highlightStrokeColor:m,highlightStrokeOpacity:e.selectedStyle.lineOpacity*.5,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,dash:N(e.selectedStyle.lineStyle),highlight:!v,lastArrow:{type:1,size:3,highlightSize:3}};let G=[[...e.numericalEndpoints[0]],[...e.numericalEndpoints[1]]],S=Object.assign({},u);Object.assign(S,{withLabel:!1,fixed:!1,highlight:!0,fillColor:"none",strokeColor:"none",highlightStrokeColor:"none",highlightFillColor:getComputedStyle(document.documentElement).getPropertyValue("--mainGray"),layer:h});let E=Object.assign({},S),C=e.tailDraggable&&!e.fixed&&!e.hidden;E.visible=C;let g=n.create("point",G[0],E),k=Object.assign({},S),Q=e.headDraggable&&!e.fixed&&!e.hidden;k.visible=Q;let P=n.create("point",G[1],k);u.label={highlight:!1},e.labelHasLatex&&(u.label.useMathJax=!0),e.applyStyleToLabel?u.label.strokeColor=m:u.label.strokeColor="var(--canvastext)";let s=n.create("arrow",[g,P],u);g.on("drag",r=>F(r,0)),P.on("drag",r=>F(r,1)),s.on("drag",r=>F(r,-1)),g.on("up",r=>{!a.current&&c.current?f({action:d.moveVector,args:{tailcoords:R.current}}):!a.current&&!c.current&&f({action:d.vectorClicked}),D.current=null}),P.on("up",r=>{a.current&&!c.current?f({action:d.moveVector,args:{headcoords:w.current}}):!a.current&&!c.current&&f({action:d.vectorClicked}),D.current=null}),s.on("up",r=>{a.current&&c.current?f({action:d.moveVector,args:{headcoords:w.current,tailcoords:R.current}}):!a.current&&!c.current&&D.current===null&&f({action:d.vectorClicked})}),g.on("down",function(r){a.current=!1,c.current=!1,x.current=[r.x,r.y],D.current=1,f({action:d.mouseDownOnVector})}),P.on("down",function(r){a.current=!1,c.current=!1,x.current=[r.x,r.y],D.current=2,f({action:d.mouseDownOnVector})}),s.on("down",function(r){a.current=!1,c.current=!1,x.current=[r.x,r.y],j.current=[[...s.point1.coords.scrCoords],[...s.point2.coords.scrCoords]],f({action:d.mouseDownOnVector})});function F(r,y){if(Math.abs(r.x-x.current[0])>.1||Math.abs(r.y-x.current[1])>.1){y===0?c.current=!0:y===1?a.current=!0:(a.current=!0,c.current=!0);let X={transient:!0,skippable:!0};a.current&&(y===-1?w.current=M(r,1):w.current=[s.point2.X(),s.point2.Y()],X.headcoords=w.current),c.current&&(y===-1?R.current=M(r,0):R.current=[s.point1.X(),s.point1.Y()],X.tailcoords=R.current),(y===0||y===1)&&(X.sourceDetails={vertex:y}),f({action:d.moveVector,args:X}),s.point1.coords.setCoordinates(JXG.COORDS_BY_USER,J.current[0]),s.point2.coords.setCoordinates(JXG.COORDS_BY_USER,J.current[1]),y===0?n.updateInfobox(g):y===1&&n.updateInfobox(P)}}t.current=s,l.current=g,i.current=P}function I(){t.current.off("drag"),t.current.off("down"),t.current.off("up"),n.removeObject(t.current),t.current={},l.current.off("drag"),l.current.off("down"),l.current.off("up"),n.removeObject(l.current),l.current={},i.current.off("drag"),i.current.off("down"),i.current.off("up"),n.removeObject(i.current),i.current={}}function M(p,h){var v=n.origin.scrCoords;let m=(j.current[h][1]+p.x-x.current[0]-v[1])/n.unitX,u=(v[2]-(j.current[h][2]+p.y-x.current[1]))/n.unitY;return[m,u]}if(n){if(Object.keys(t.current).length===0)H();else if(e.numericalEndpoints.length!==2||e.numericalEndpoints.some(p=>p.length!==2))I();else{let p=!0;for(let b of[e.numericalEndpoints[0],e.numericalEndpoints[1]])Number.isFinite(b[0])||(p=!1),Number.isFinite(b[1])||(p=!1);t.current.point1.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalEndpoints[0]),t.current.point2.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalEndpoints[1]);let h=!e.hidden&&p,v=!e.draggable||e.fixed,u=e.tailDraggable&&!e.fixed&&h,S=e.headDraggable&&!e.fixed&&h;if(t.current.visProp.fixed=v,t.current.visProp.highlight=!v,t.current.visProp.visible=h,t.current.visPropCalc.visible=h,l.current.visProp.visible=u,l.current.visPropCalc.visible=u,i.current.visProp.visible=S,i.current.visPropCalc.visible=S,L.sourceInformation&&_ in L.sourceInformation){let b=L.sourceInformation[_];b.vertex===0?n.updateInfobox(l.current):b.vertex===1&&n.updateInfobox(i.current)}let E=10*e.layer+B;if(t.current.visProp.layer!==E){let b=10*e.layer+T;t.current.setAttribute({layer:E}),l.current.setAttribute({layer:b}),i.current.setAttribute({layer:b})}let C=Y==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;C=C.toLowerCase(),t.current.visProp.strokecolor!==C&&(t.current.visProp.strokecolor=C,t.current.visProp.highlightstrokecolor=C),t.current.visProp.strokewidth!==e.selectedStyle.lineWidth&&(t.current.visProp.strokewidth=e.selectedStyle.lineWidth,t.current.visProp.highlightstrokewidth=e.selectedStyle.lineWidth),t.current.visProp.strokeopacity!==e.selectedStyle.lineOpacity&&(t.current.visProp.strokeopacity=e.selectedStyle.lineOpacity,t.current.visProp.highlightstrokeopacity=e.selectedStyle.lineOpacity*.5);let g=N(e.selectedStyle.lineStyle);t.current.visProp.dash!==g&&(t.current.visProp.dash=g),t.current.name=e.labelForGraph;let k=e.showLabel&&e.labelForGraph!=="";k!=U.current&&(t.current.setAttribute({withlabel:k}),U.current=k),t.current.needsUpdate=!0,t.current.update(),t.current.hasLabel&&(e.applyStyleToLabel?t.current.label.visProp.strokecolor=C:t.current.label.visProp.strokecolor="var(--canvastext)",t.current.label.needsUpdate=!0,t.current.label.update()),l.current.needsUpdate=!0,l.current.update(),i.current.needsUpdate=!0,i.current.update(),n.updateRenderer()}return V(W,{children:V("a",{name:A})})}if(e.hidden)return null;let q="\\("+e.latex+"\\)";return re(W,{children:[V("a",{name:A}),V("span",{id:A,children:V(ne.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:q})})]})});function N(O){return O==="solid"?0:O==="dashed"?2:O==="dotted"?1:0}export{se as default}; +import{av as Z,bp as $,r as o,l as ee,bu as te,j as V,F as W,a as re,b9 as ne}from"./index-7074710c.js";import{BoardContext as oe,LINE_LAYER_OFFSET as B,VERTEX_LAYER_OFFSET as T}from"./graph-71cec529.js";import"./css-14ccef8c.js";import"./visibility-sensor-7d414852.js";const se=Z.memo(function O(z){let{name:_,id:A,SVs:e,actions:d,sourceOfUpdate:L,callAction:f}=$(z);O.ignoreActionsWithoutCore=!0;const n=o.useContext(oe);let t=o.useRef({}),l=o.useRef({}),i=o.useRef({}),x=o.useRef(!1),j=o.useRef(!1),a=o.useRef(!1),c=o.useRef(!1),D=o.useRef(null),w=o.useRef(null),R=o.useRef(null),U=o.useRef(!1),J=o.useRef(null);J.current=e.numericalEndpoints;const Y=ee(te);o.useEffect(()=>()=>{Object.keys(t.current).length!==0&&I()},[]);function H(){if(e.numericalEndpoints.length!==2||e.numericalEndpoints.some(r=>r.length!==2)){t.current={},l.current={},i.current={};return}let p=10*e.layer+B,h=10*e.layer+T,v=!e.draggable||e.fixed,m=Y==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;m=m.toLowerCase();var u={name:e.labelForGraph,visible:!e.hidden,withLabel:e.showLabel&&e.labelForGraph!=="",fixed:v,layer:p,strokeColor:m,strokeOpacity:e.selectedStyle.lineOpacity,highlightStrokeColor:m,highlightStrokeOpacity:e.selectedStyle.lineOpacity*.5,strokeWidth:e.selectedStyle.lineWidth,highlightStrokeWidth:e.selectedStyle.lineWidth,dash:N(e.selectedStyle.lineStyle),highlight:!v,lastArrow:{type:1,size:3,highlightSize:3}};let G=[[...e.numericalEndpoints[0]],[...e.numericalEndpoints[1]]],S=Object.assign({},u);Object.assign(S,{withLabel:!1,fixed:!1,highlight:!0,fillColor:"none",strokeColor:"none",highlightStrokeColor:"none",highlightFillColor:getComputedStyle(document.documentElement).getPropertyValue("--mainGray"),layer:h});let E=Object.assign({},S),C=e.tailDraggable&&!e.fixed&&!e.hidden;E.visible=C;let g=n.create("point",G[0],E),k=Object.assign({},S),Q=e.headDraggable&&!e.fixed&&!e.hidden;k.visible=Q;let P=n.create("point",G[1],k);u.label={highlight:!1},e.labelHasLatex&&(u.label.useMathJax=!0),e.applyStyleToLabel?u.label.strokeColor=m:u.label.strokeColor="var(--canvastext)";let s=n.create("arrow",[g,P],u);g.on("drag",r=>F(r,0)),P.on("drag",r=>F(r,1)),s.on("drag",r=>F(r,-1)),g.on("up",r=>{!a.current&&c.current?f({action:d.moveVector,args:{tailcoords:R.current}}):!a.current&&!c.current&&f({action:d.vectorClicked}),D.current=null}),P.on("up",r=>{a.current&&!c.current?f({action:d.moveVector,args:{headcoords:w.current}}):!a.current&&!c.current&&f({action:d.vectorClicked}),D.current=null}),s.on("up",r=>{a.current&&c.current?f({action:d.moveVector,args:{headcoords:w.current,tailcoords:R.current}}):!a.current&&!c.current&&D.current===null&&f({action:d.vectorClicked})}),g.on("down",function(r){a.current=!1,c.current=!1,x.current=[r.x,r.y],D.current=1,f({action:d.mouseDownOnVector})}),P.on("down",function(r){a.current=!1,c.current=!1,x.current=[r.x,r.y],D.current=2,f({action:d.mouseDownOnVector})}),s.on("down",function(r){a.current=!1,c.current=!1,x.current=[r.x,r.y],j.current=[[...s.point1.coords.scrCoords],[...s.point2.coords.scrCoords]],f({action:d.mouseDownOnVector})});function F(r,y){if(Math.abs(r.x-x.current[0])>.1||Math.abs(r.y-x.current[1])>.1){y===0?c.current=!0:y===1?a.current=!0:(a.current=!0,c.current=!0);let X={transient:!0,skippable:!0};a.current&&(y===-1?w.current=M(r,1):w.current=[s.point2.X(),s.point2.Y()],X.headcoords=w.current),c.current&&(y===-1?R.current=M(r,0):R.current=[s.point1.X(),s.point1.Y()],X.tailcoords=R.current),(y===0||y===1)&&(X.sourceDetails={vertex:y}),f({action:d.moveVector,args:X}),s.point1.coords.setCoordinates(JXG.COORDS_BY_USER,J.current[0]),s.point2.coords.setCoordinates(JXG.COORDS_BY_USER,J.current[1]),y===0?n.updateInfobox(g):y===1&&n.updateInfobox(P)}}t.current=s,l.current=g,i.current=P}function I(){t.current.off("drag"),t.current.off("down"),t.current.off("up"),n.removeObject(t.current),t.current={},l.current.off("drag"),l.current.off("down"),l.current.off("up"),n.removeObject(l.current),l.current={},i.current.off("drag"),i.current.off("down"),i.current.off("up"),n.removeObject(i.current),i.current={}}function M(p,h){var v=n.origin.scrCoords;let m=(j.current[h][1]+p.x-x.current[0]-v[1])/n.unitX,u=(v[2]-(j.current[h][2]+p.y-x.current[1]))/n.unitY;return[m,u]}if(n){if(Object.keys(t.current).length===0)H();else if(e.numericalEndpoints.length!==2||e.numericalEndpoints.some(p=>p.length!==2))I();else{let p=!0;for(let b of[e.numericalEndpoints[0],e.numericalEndpoints[1]])Number.isFinite(b[0])||(p=!1),Number.isFinite(b[1])||(p=!1);t.current.point1.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalEndpoints[0]),t.current.point2.coords.setCoordinates(JXG.COORDS_BY_USER,e.numericalEndpoints[1]);let h=!e.hidden&&p,v=!e.draggable||e.fixed,u=e.tailDraggable&&!e.fixed&&h,S=e.headDraggable&&!e.fixed&&h;if(t.current.visProp.fixed=v,t.current.visProp.highlight=!v,t.current.visProp.visible=h,t.current.visPropCalc.visible=h,l.current.visProp.visible=u,l.current.visPropCalc.visible=u,i.current.visProp.visible=S,i.current.visPropCalc.visible=S,L.sourceInformation&&_ in L.sourceInformation){let b=L.sourceInformation[_];b.vertex===0?n.updateInfobox(l.current):b.vertex===1&&n.updateInfobox(i.current)}let E=10*e.layer+B;if(t.current.visProp.layer!==E){let b=10*e.layer+T;t.current.setAttribute({layer:E}),l.current.setAttribute({layer:b}),i.current.setAttribute({layer:b})}let C=Y==="dark"?e.selectedStyle.lineColorDarkMode:e.selectedStyle.lineColor;C=C.toLowerCase(),t.current.visProp.strokecolor!==C&&(t.current.visProp.strokecolor=C,t.current.visProp.highlightstrokecolor=C),t.current.visProp.strokewidth!==e.selectedStyle.lineWidth&&(t.current.visProp.strokewidth=e.selectedStyle.lineWidth,t.current.visProp.highlightstrokewidth=e.selectedStyle.lineWidth),t.current.visProp.strokeopacity!==e.selectedStyle.lineOpacity&&(t.current.visProp.strokeopacity=e.selectedStyle.lineOpacity,t.current.visProp.highlightstrokeopacity=e.selectedStyle.lineOpacity*.5);let g=N(e.selectedStyle.lineStyle);t.current.visProp.dash!==g&&(t.current.visProp.dash=g),t.current.name=e.labelForGraph;let k=e.showLabel&&e.labelForGraph!=="";k!=U.current&&(t.current.setAttribute({withlabel:k}),U.current=k),t.current.needsUpdate=!0,t.current.update(),t.current.hasLabel&&(e.applyStyleToLabel?t.current.label.visProp.strokecolor=C:t.current.label.visProp.strokecolor="var(--canvastext)",t.current.label.needsUpdate=!0,t.current.label.update()),l.current.needsUpdate=!0,l.current.update(),i.current.needsUpdate=!0,i.current.update(),n.updateRenderer()}return V(W,{children:V("a",{name:A})})}if(e.hidden)return null;let q="\\("+e.latex+"\\)";return re(W,{children:[V("a",{name:A}),V("span",{id:A,children:V(ne.MathJax,{hideUntilTypeset:"first",inline:!0,dynamic:!0,children:q})})]})});function N(O){return O==="solid"?0:O==="dashed"?2:O==="dotted"?1:0}export{se as default}; diff --git a/dist/assets/video-88119a6d.js b/dist/assets/video-964a54d0.js similarity index 95% rename from dist/assets/video-88119a6d.js rename to dist/assets/video-964a54d0.js index 362b4c8203..e95294c920 100644 --- a/dist/assets/video-88119a6d.js +++ b/dist/assets/video-964a54d0.js @@ -1,4 +1,4 @@ -import{av as W,bn as L,r as u,ad as M,j as p,a as I,s as z}from"./index-99a56692.js";import{s as F}from"./css-14ccef8c.js";import{V as _}from"./visibility-sensor-55e75ed1.js";const B=z.div` +import{av as W,bp as L,r as u,ad as M,j as p,a as I,s as z}from"./index-7074710c.js";import{s as F}from"./css-14ccef8c.js";import{V as _}from"./visibility-sensor-7d414852.js";const B=z.div` &: focus { outline: 2px solid var(--canvastext); outline-offset: 2px; diff --git a/dist/assets/visibility-sensor-55e75ed1.js b/dist/assets/visibility-sensor-7d414852.js similarity index 99% rename from dist/assets/visibility-sensor-55e75ed1.js rename to dist/assets/visibility-sensor-7d414852.js index 65176795b1..804c99c9be 100644 --- a/dist/assets/visibility-sensor-55e75ed1.js +++ b/dist/assets/visibility-sensor-7d414852.js @@ -1 +1 @@ -import{at as F,r as N,au as H,aa as G}from"./index-99a56692.js";var z={},Y={get exports(){return z},set exports(w){z=w}};(function(w,J){(function(U,p){w.exports=p(N,H)})(G,function(j,U){return function(p){var b={};function n(e){if(b[e])return b[e].exports;var o=b[e]={i:e,l:!1,exports:{}};return p[e].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=p,n.c=b,n.d=function(e,o,h){n.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:h})},n.r=function(e){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,o){if(o&1&&(e=n(e)),o&8||o&4&&typeof e=="object"&&e&&e.__esModule)return e;var h=Object.create(null);if(n.r(h),Object.defineProperty(h,"default",{enumerable:!0,value:e}),o&2&&typeof e!="string")for(var s in e)n.d(h,s,function(d){return e[d]}.bind(null,s));return h},n.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(o,"a",o),o},n.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},n.p="",n(n.s=4)}([function(p,b,n){p.exports=n(5)()},function(p,b){p.exports=j},function(p,b){p.exports=U},function(p,b){p.exports=function(n,e,o){var h=n.direction,s=n.value;switch(h){case"top":return o.top+se.bottom&&o.lefte.right;case"left":return o.left+se.bottom&&o.tope.right;case"bottom":return o.bottom-s>e.bottom&&o.lefte.right&&o.tope.right&&o.lefte.bottom}}},function(p,b,n){n.r(b),n.d(b,"default",function(){return W});var e=n(1),o=n.n(e),h=n(2),s=n.n(h),d=n(0),i=n.n(d),R=n(3),B=n.n(R);function _(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_=function(l){return typeof l}:_=function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},_(r)}function A(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}function S(r,a){for(var l=0;l-1?C=function(){c||(c=setTimeout(m,g||0))}:C=function(){clearTimeout(c),c=setTimeout(m,u||0)};var D={target:y,fn:C,getLastTimeout:function(){return c}};y.addEventListener(f,D.fn),t.debounceCheck[f]=D}),v(O(t),"startWatching",function(){t.debounceCheck||t.interval||(t.props.intervalCheck&&(t.interval=setInterval(t.check,t.props.intervalDelay)),t.props.scrollCheck&&t.addEventListener(t.getContainer(),"scroll",t.props.scrollDelay,t.props.scrollThrottle),t.props.resizeCheck&&t.addEventListener(window,"resize",t.props.resizeDelay,t.props.resizeThrottle),!t.props.delayedCall&&t.check())}),v(O(t),"stopWatching",function(){if(t.debounceCheck){for(var y in t.debounceCheck)if(t.debounceCheck.hasOwnProperty(y)){var f=t.debounceCheck[y];clearTimeout(f.getLastTimeout()),f.target.removeEventListener(y,f.fn),t.debounceCheck[y]=null}}t.debounceCheck=null,t.interval&&(t.interval=clearInterval(t.interval))}),v(O(t),"check",function(){var y=t.node,f,u;if(!y)return t.state;if(f=K(t.roundRectDown(y.getBoundingClientRect())),t.props.containment){var g=t.props.containment.getBoundingClientRect();u={top:g.top,left:g.left,bottom:g.bottom,right:g.right}}else u={top:0,left:0,bottom:window.innerHeight||document.documentElement.clientHeight,right:window.innerWidth||document.documentElement.clientWidth};var c=t.props.offset||{},C=_(c)==="object";C&&(u.top+=c.top||0,u.left+=c.left||0,u.bottom-=c.bottom||0,u.right-=c.right||0);var m={top:f.top>=u.top,left:f.left>=u.left,bottom:f.bottom<=u.bottom,right:f.right<=u.right},D=f.height>0&&f.width>0,T=D||!t.props.requireContentsSize,E=T&&m.top&&m.left&&m.bottom&&m.right;if(T&&t.props.partialVisibility){var V=f.top<=u.bottom&&f.bottom>=u.top&&f.left<=u.right&&f.right>=u.left;typeof t.props.partialVisibility=="string"&&(V=m[t.props.partialVisibility]),E=t.props.minTopValue?V&&f.top<=u.bottom-t.props.minTopValue:V}typeof c.direction=="string"&&typeof c.value=="number"&&(console.warn("[notice] offset.direction and offset.value have been deprecated. They still work for now, but will be removed in next major version. Please upgrade to the new syntax: { %s: %d }",c.direction,c.value),E=B()(c,f,u));var L=t.state;return t.state.isVisible!==E&&(L={isVisible:E,visibilityRect:m},t.setState(L),t.props.onChange&&t.props.onChange(E)),L}),t.state={isVisible:null,visibilityRect:{}},t}return x(a,[{key:"componentDidMount",value:function(){this.node=s.a.findDOMNode(this),this.props.active&&this.startWatching()}},{key:"componentWillUnmount",value:function(){this.stopWatching()}},{key:"componentDidUpdate",value:function(t){this.node=s.a.findDOMNode(this),this.props.active&&!t.active?(this.setState({isVisible:null,visibilityRect:{}}),this.startWatching()):this.props.active||this.stopWatching()}},{key:"roundRectDown",value:function(t){return{top:Math.floor(t.top),left:Math.floor(t.left),bottom:Math.floor(t.bottom),right:Math.floor(t.right)}}},{key:"render",value:function(){return this.props.children instanceof Function?this.props.children({isVisible:this.state.isVisible,visibilityRect:this.state.visibilityRect}):o.a.Children.only(this.props.children)}}]),a}(o.a.Component);v(W,"defaultProps",{active:!0,partialVisibility:!1,minTopValue:0,scrollCheck:!1,scrollDelay:250,scrollThrottle:-1,resizeCheck:!1,resizeDelay:250,resizeThrottle:-1,intervalCheck:!0,intervalDelay:100,delayedCall:!1,offset:{},containment:null,children:o.a.createElement("span",null),requireContentsSize:!0}),v(W,"propTypes",{onChange:i.a.func,active:i.a.bool,partialVisibility:i.a.oneOfType([i.a.bool,i.a.oneOf(["top","right","bottom","left"])]),delayedCall:i.a.bool,offset:i.a.oneOfType([i.a.shape({top:i.a.number,left:i.a.number,bottom:i.a.number,right:i.a.number}),i.a.shape({direction:i.a.oneOf(["top","right","bottom","left"]),value:i.a.number})]),scrollCheck:i.a.bool,scrollDelay:i.a.number,scrollThrottle:i.a.number,resizeCheck:i.a.bool,resizeDelay:i.a.number,resizeThrottle:i.a.number,intervalCheck:i.a.bool,intervalDelay:i.a.number,containment:typeof window<"u"?i.a.instanceOf(window.Element):i.a.any,children:i.a.oneOfType([i.a.element,i.a.func]),minTopValue:i.a.number,requireContentsSize:i.a.bool})},function(p,b,n){var e=n(6);function o(){}function h(){}h.resetWarningCache=o,p.exports=function(){function s(R,B,_,A,S,x){if(x!==e){var P=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw P.name="Invariant Violation",P}}s.isRequired=s;function d(){return s}var i={array:s,bool:s,func:s,number:s,object:s,string:s,symbol:s,any:s,arrayOf:d,element:s,elementType:s,instanceOf:d,node:s,objectOf:d,oneOf:d,oneOfType:d,shape:d,exact:d,checkPropTypes:h,resetWarningCache:o};return i.PropTypes=i,i}},function(p,b,n){var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";p.exports=e}])})})(Y);const X=F(z);export{X as V}; +import{at as F,r as N,au as H,aa as G}from"./index-7074710c.js";var z={},Y={get exports(){return z},set exports(w){z=w}};(function(w,J){(function(U,p){w.exports=p(N,H)})(G,function(j,U){return function(p){var b={};function n(e){if(b[e])return b[e].exports;var o=b[e]={i:e,l:!1,exports:{}};return p[e].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=p,n.c=b,n.d=function(e,o,h){n.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:h})},n.r=function(e){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,o){if(o&1&&(e=n(e)),o&8||o&4&&typeof e=="object"&&e&&e.__esModule)return e;var h=Object.create(null);if(n.r(h),Object.defineProperty(h,"default",{enumerable:!0,value:e}),o&2&&typeof e!="string")for(var s in e)n.d(h,s,function(d){return e[d]}.bind(null,s));return h},n.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(o,"a",o),o},n.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},n.p="",n(n.s=4)}([function(p,b,n){p.exports=n(5)()},function(p,b){p.exports=j},function(p,b){p.exports=U},function(p,b){p.exports=function(n,e,o){var h=n.direction,s=n.value;switch(h){case"top":return o.top+se.bottom&&o.lefte.right;case"left":return o.left+se.bottom&&o.tope.right;case"bottom":return o.bottom-s>e.bottom&&o.lefte.right&&o.tope.right&&o.lefte.bottom}}},function(p,b,n){n.r(b),n.d(b,"default",function(){return W});var e=n(1),o=n.n(e),h=n(2),s=n.n(h),d=n(0),i=n.n(d),R=n(3),B=n.n(R);function _(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_=function(l){return typeof l}:_=function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},_(r)}function A(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}function S(r,a){for(var l=0;l-1?C=function(){c||(c=setTimeout(m,g||0))}:C=function(){clearTimeout(c),c=setTimeout(m,u||0)};var D={target:y,fn:C,getLastTimeout:function(){return c}};y.addEventListener(f,D.fn),t.debounceCheck[f]=D}),v(O(t),"startWatching",function(){t.debounceCheck||t.interval||(t.props.intervalCheck&&(t.interval=setInterval(t.check,t.props.intervalDelay)),t.props.scrollCheck&&t.addEventListener(t.getContainer(),"scroll",t.props.scrollDelay,t.props.scrollThrottle),t.props.resizeCheck&&t.addEventListener(window,"resize",t.props.resizeDelay,t.props.resizeThrottle),!t.props.delayedCall&&t.check())}),v(O(t),"stopWatching",function(){if(t.debounceCheck){for(var y in t.debounceCheck)if(t.debounceCheck.hasOwnProperty(y)){var f=t.debounceCheck[y];clearTimeout(f.getLastTimeout()),f.target.removeEventListener(y,f.fn),t.debounceCheck[y]=null}}t.debounceCheck=null,t.interval&&(t.interval=clearInterval(t.interval))}),v(O(t),"check",function(){var y=t.node,f,u;if(!y)return t.state;if(f=K(t.roundRectDown(y.getBoundingClientRect())),t.props.containment){var g=t.props.containment.getBoundingClientRect();u={top:g.top,left:g.left,bottom:g.bottom,right:g.right}}else u={top:0,left:0,bottom:window.innerHeight||document.documentElement.clientHeight,right:window.innerWidth||document.documentElement.clientWidth};var c=t.props.offset||{},C=_(c)==="object";C&&(u.top+=c.top||0,u.left+=c.left||0,u.bottom-=c.bottom||0,u.right-=c.right||0);var m={top:f.top>=u.top,left:f.left>=u.left,bottom:f.bottom<=u.bottom,right:f.right<=u.right},D=f.height>0&&f.width>0,T=D||!t.props.requireContentsSize,E=T&&m.top&&m.left&&m.bottom&&m.right;if(T&&t.props.partialVisibility){var V=f.top<=u.bottom&&f.bottom>=u.top&&f.left<=u.right&&f.right>=u.left;typeof t.props.partialVisibility=="string"&&(V=m[t.props.partialVisibility]),E=t.props.minTopValue?V&&f.top<=u.bottom-t.props.minTopValue:V}typeof c.direction=="string"&&typeof c.value=="number"&&(console.warn("[notice] offset.direction and offset.value have been deprecated. They still work for now, but will be removed in next major version. Please upgrade to the new syntax: { %s: %d }",c.direction,c.value),E=B()(c,f,u));var L=t.state;return t.state.isVisible!==E&&(L={isVisible:E,visibilityRect:m},t.setState(L),t.props.onChange&&t.props.onChange(E)),L}),t.state={isVisible:null,visibilityRect:{}},t}return x(a,[{key:"componentDidMount",value:function(){this.node=s.a.findDOMNode(this),this.props.active&&this.startWatching()}},{key:"componentWillUnmount",value:function(){this.stopWatching()}},{key:"componentDidUpdate",value:function(t){this.node=s.a.findDOMNode(this),this.props.active&&!t.active?(this.setState({isVisible:null,visibilityRect:{}}),this.startWatching()):this.props.active||this.stopWatching()}},{key:"roundRectDown",value:function(t){return{top:Math.floor(t.top),left:Math.floor(t.left),bottom:Math.floor(t.bottom),right:Math.floor(t.right)}}},{key:"render",value:function(){return this.props.children instanceof Function?this.props.children({isVisible:this.state.isVisible,visibilityRect:this.state.visibilityRect}):o.a.Children.only(this.props.children)}}]),a}(o.a.Component);v(W,"defaultProps",{active:!0,partialVisibility:!1,minTopValue:0,scrollCheck:!1,scrollDelay:250,scrollThrottle:-1,resizeCheck:!1,resizeDelay:250,resizeThrottle:-1,intervalCheck:!0,intervalDelay:100,delayedCall:!1,offset:{},containment:null,children:o.a.createElement("span",null),requireContentsSize:!0}),v(W,"propTypes",{onChange:i.a.func,active:i.a.bool,partialVisibility:i.a.oneOfType([i.a.bool,i.a.oneOf(["top","right","bottom","left"])]),delayedCall:i.a.bool,offset:i.a.oneOfType([i.a.shape({top:i.a.number,left:i.a.number,bottom:i.a.number,right:i.a.number}),i.a.shape({direction:i.a.oneOf(["top","right","bottom","left"]),value:i.a.number})]),scrollCheck:i.a.bool,scrollDelay:i.a.number,scrollThrottle:i.a.number,resizeCheck:i.a.bool,resizeDelay:i.a.number,resizeThrottle:i.a.number,intervalCheck:i.a.bool,intervalDelay:i.a.number,containment:typeof window<"u"?i.a.instanceOf(window.Element):i.a.any,children:i.a.oneOfType([i.a.element,i.a.func]),minTopValue:i.a.number,requireContentsSize:i.a.bool})},function(p,b,n){var e=n(6);function o(){}function h(){}h.resetWarningCache=o,p.exports=function(){function s(R,B,_,A,S,x){if(x!==e){var P=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw P.name="Invariant Violation",P}}s.isRequired=s;function d(){return s}var i={array:s,bool:s,func:s,number:s,object:s,string:s,symbol:s,any:s,arrayOf:d,element:s,elementType:s,instanceOf:d,node:s,objectOf:d,oneOf:d,oneOfType:d,shape:d,exact:d,checkPropTypes:h,resetWarningCache:o};return i.PropTypes=i,i}},function(p,b,n){var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";p.exports=e}])})})(Y);const X=F(z);export{X as V}; diff --git a/dist/index.html b/dist/index.html index 77c593fc71..aaed3a7ad0 100644 --- a/dist/index.html +++ b/dist/index.html @@ -125,7 +125,7 @@ margin: 0; } - +