promptfoo 0.33.1 → 0.33.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/package.json +1 -1
- package/dist/src/assertions.d.ts.map +1 -1
- package/dist/src/assertions.js +67 -15
- package/dist/src/assertions.js.map +1 -1
- package/dist/src/providers/openai.d.ts +8 -1
- package/dist/src/providers/openai.d.ts.map +1 -1
- package/dist/src/providers/openai.js +3 -1
- package/dist/src/providers/openai.js.map +1 -1
- package/dist/src/providers/openaiUtil.d.ts +4 -0
- package/dist/src/providers/openaiUtil.d.ts.map +1 -1
- package/dist/src/providers/openaiUtil.js.map +1 -1
- package/dist/src/table.d.ts.map +1 -1
- package/dist/src/table.js +9 -10
- package/dist/src/table.js.map +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/src/web/nextui/404/index.html +0 -1
- package/dist/src/web/nextui/404.html +0 -1
- package/dist/src/web/nextui/_next/static/-LL1eIF6a-GyAntT7tzmp/_buildManifest.js +0 -1
- package/dist/src/web/nextui/_next/static/-LL1eIF6a-GyAntT7tzmp/_ssgManifest.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/21-8a2c661f5df627d6.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/293-f7537306415679fd.js +0 -89
- package/dist/src/web/nextui/_next/static/chunks/339-501c32916b785ef1.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/396-ddebcf106bb56e13.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/420-2e5cd10f16aeaa4f.js +0 -2
- package/dist/src/web/nextui/_next/static/chunks/548-46c7c1d35ca1bc02.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/596-297f7ff4a0436e87.js +0 -25
- package/dist/src/web/nextui/_next/static/chunks/753-f62bfa32dbd9ff14.js +0 -8
- package/dist/src/web/nextui/_next/static/chunks/756-1adee6171fcb68fb.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/808-90426be34a5d9784.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/82-ca0360e473d81167.js +0 -7
- package/dist/src/web/nextui/_next/static/chunks/860-af67976c17d7f0d3.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/886-0c6a1912422ba9af.js +0 -37
- package/dist/src/web/nextui/_next/static/chunks/919-d71c386cf4a86911.js +0 -44
- package/dist/src/web/nextui/_next/static/chunks/975-380318b3b26ba688.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/auth/login/page-0c87ef00a5707e79.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/auth/signup/page-d9f9ec167e1619d3.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/datasets/page-8e6de69fb0c49d64.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/eval/[id]/not-found-366629541fd598e9.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/eval/[id]/page-8acbea67f7657585.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/eval/page-7ba5274606a00cb2.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/layout-13f47c15bd8e5db9.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/page-1ae60660130041b2.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/prompts/page-d00bb3e4da795d59.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/app/setup/page-a09e091ef71a0a45.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/ca377847-26b462611379a4f7.js +0 -6
- package/dist/src/web/nextui/_next/static/chunks/fd9d1056-fba4b53a2f01213b.js +0 -9
- package/dist/src/web/nextui/_next/static/chunks/framework-8883d1e9be70c3da.js +0 -25
- package/dist/src/web/nextui/_next/static/chunks/main-app-581ccf0003955b21.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/main-b81070c77c77982d.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/pages/_app-52924524f99094ab.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/pages/_error-c92d5c4bb2b49926.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/polyfills-78c92fac7aa8fdd8.js +0 -1
- package/dist/src/web/nextui/_next/static/chunks/webpack-e0942e16d7068577.js +0 -1
- package/dist/src/web/nextui/_next/static/css/16c1dd82fc87c9d7.css +0 -1
- package/dist/src/web/nextui/_next/static/css/47ee2c14c17ee975.css +0 -1
- package/dist/src/web/nextui/_next/static/css/48d388184a2f4ce3.css +0 -1
- package/dist/src/web/nextui/_next/static/css/6de4b83ebb0d35d6.css +0 -1
- package/dist/src/web/nextui/_next/static/css/8119d8bd13a8adab.css +0 -1
- package/dist/src/web/nextui/_next/static/css/d214f868fd093747.css +0 -1
- package/dist/src/web/nextui/_next/static/media/0e4fe491bf84089c-s.p.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/1c57ca6f5208a29b-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/3dbd163d3bb09d47-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/42d52f46a26971a3-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/5647e4c23315a2d2-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/627622453ef56b0d-s.p.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/7be645d133f3ee22-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/7c53f7419436e04b-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/8fb72f69fba4e3d2-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/912a9cfe43c928d9-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/934c4b7cb736f2a3-s.p.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/a5b77b63ef20339c-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/a6d330d7873e7320-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/baf12dd90520ae41-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/bbdb6f0234009aba-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/cff529cd86cc0276-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/d117eea74e01de14-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/dfa8b99978df7bbc-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/e25729ca87cc7df9-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/eb52b768f62eeeb4-s.woff2 +0 -0
- package/dist/src/web/nextui/_next/static/media/f06116e890b3dadb-s.woff2 +0 -0
- package/dist/src/web/nextui/api/config +0 -1
- package/dist/src/web/nextui/auth/callback +0 -1
- package/dist/src/web/nextui/auth/login/index.html +0 -1
- package/dist/src/web/nextui/auth/login/index.txt +0 -12
- package/dist/src/web/nextui/auth/signup/index.html +0 -1
- package/dist/src/web/nextui/auth/signup/index.txt +0 -12
- package/dist/src/web/nextui/datasets/index.html +0 -1
- package/dist/src/web/nextui/datasets/index.txt +0 -12
- package/dist/src/web/nextui/eval/index.html +0 -1
- package/dist/src/web/nextui/eval/index.txt +0 -14
- package/dist/src/web/nextui/favicon.ico +0 -0
- package/dist/src/web/nextui/index.html +0 -1
- package/dist/src/web/nextui/index.txt +0 -13
- package/dist/src/web/nextui/logo.svg +0 -30
- package/dist/src/web/nextui/prompts/index.html +0 -1
- package/dist/src/web/nextui/prompts/index.txt +0 -12
- package/dist/src/web/nextui/setup/index.html +0 -27
- package/dist/src/web/nextui/setup/index.txt +0 -14
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[753],{6446:function(e,t,r){"use strict";var n=r(6314);t.Z=void 0;var o=n(r(984)),a=r(7437),i=(0,o.default)((0,a.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}),"Delete");t.Z=i},1280:function(e,t,r){"use strict";var n=r(6314);t.Z=void 0;var o=n(r(984)),a=r(7437),i=(0,o.default)((0,a.jsx)("path",{d:"M5 4v2h14V4H5zm0 10h4v6h6v-6h4l-7-7-7 7z"}),"Publish");t.Z=i},9963:function(e,t,r){"use strict";var n=r(6314);t.Z=void 0;var o=n(r(984)),a=r(7437),i=(0,o.default)((0,a.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"}),"Save");t.Z=i},3295:function(e,t,r){"use strict";var n=r(6314);t.Z=void 0;var o=n(r(984)),a=r(7437),i=(0,o.default)((0,a.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");t.Z=i},2057:function(e,t,r){"use strict";r.d(t,{Z:function(){return A}});var n=r(791),o=r(3428),a=r(2265);r(9176);var i=r(7042),l=r(5600),s=r(5843),c=r(7927),u=r(8731),d=r(7039),p=r(324),f=r(1101),g=r(7663),h=r(6520),m=r(5702);function v(e){return(0,m.Z)("MuiCollapse",e)}(0,h.Z)("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);var b=r(7437);let y=["addEndListener","children","className","collapsedSize","component","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","orientation","style","timeout","TransitionComponent"],x=e=>{let{orientation:t,classes:r}=e,n={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return(0,l.Z)(n,v,r)},Z=(0,s.ZP)("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[r.orientation],"entered"===r.state&&t.entered,"exited"===r.state&&!r.in&&"0px"===r.collapsedSize&&t.hidden]}})(({theme:e,ownerState:t})=>(0,o.Z)({height:0,overflow:"hidden",transition:e.transitions.create("height")},"horizontal"===t.orientation&&{height:"auto",width:0,transition:e.transitions.create("width")},"entered"===t.state&&(0,o.Z)({height:"auto",overflow:"visible"},"horizontal"===t.orientation&&{width:"auto"}),"exited"===t.state&&!t.in&&"0px"===t.collapsedSize&&{visibility:"hidden"})),k=(0,s.ZP)("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})(({ownerState:e})=>(0,o.Z)({display:"flex",width:"100%"},"horizontal"===e.orientation&&{width:"auto",height:"100%"})),C=(0,s.ZP)("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(e,t)=>t.wrapperInner})(({ownerState:e})=>(0,o.Z)({width:"100%"},"horizontal"===e.orientation&&{width:"auto",height:"100%"})),$=a.forwardRef(function(e,t){let r=(0,c.Z)({props:e,name:"MuiCollapse"}),{addEndListener:l,children:s,className:h,collapsedSize:m="0px",component:v,easing:$,in:S,onEnter:w,onEntered:I,onEntering:O,onExit:P,onExited:R,onExiting:_,orientation:L="vertical",style:E,timeout:A=d.x9.standard,TransitionComponent:M=u.ZP}=r,z=(0,n.Z)(r,y),N=(0,o.Z)({},r,{orientation:L,collapsedSize:m}),T=x(N),j=(0,f.Z)(),D=a.useRef(),W=a.useRef(null),F=a.useRef(),V="number"==typeof m?`${m}px`:m,K="horizontal"===L,H=K?"width":"height";a.useEffect(()=>()=>{clearTimeout(D.current)},[]);let q=a.useRef(null),B=(0,g.Z)(t,q),G=e=>t=>{if(e){let r=q.current;void 0===t?e(r):e(r,t)}},U=()=>W.current?W.current[K?"clientWidth":"clientHeight"]:0,J=G((e,t)=>{W.current&&K&&(W.current.style.position="absolute"),e.style[H]=V,w&&w(e,t)}),Q=G((e,t)=>{let r=U();W.current&&K&&(W.current.style.position="");let{duration:n,easing:o}=(0,p.C)({style:E,timeout:A,easing:$},{mode:"enter"});if("auto"===A){let t=j.transitions.getAutoHeightDuration(r);e.style.transitionDuration=`${t}ms`,F.current=t}else e.style.transitionDuration="string"==typeof n?n:`${n}ms`;e.style[H]=`${r}px`,e.style.transitionTimingFunction=o,O&&O(e,t)}),X=G((e,t)=>{e.style[H]="auto",I&&I(e,t)}),Y=G(e=>{e.style[H]=`${U()}px`,P&&P(e)}),ee=G(R),et=G(e=>{let t=U(),{duration:r,easing:n}=(0,p.C)({style:E,timeout:A,easing:$},{mode:"exit"});if("auto"===A){let r=j.transitions.getAutoHeightDuration(t);e.style.transitionDuration=`${r}ms`,F.current=r}else e.style.transitionDuration="string"==typeof r?r:`${r}ms`;e.style[H]=V,e.style.transitionTimingFunction=n,_&&_(e)});return(0,b.jsx)(M,(0,o.Z)({in:S,onEnter:J,onEntered:X,onEntering:Q,onExit:Y,onExited:ee,onExiting:et,addEndListener:e=>{"auto"===A&&(D.current=setTimeout(e,F.current||0)),l&&l(q.current,e)},nodeRef:q,timeout:"auto"===A?null:A},z,{children:(e,t)=>(0,b.jsx)(Z,(0,o.Z)({as:v,className:(0,i.Z)(T.root,h,{entered:T.entered,exited:!S&&"0px"===V&&T.hidden}[e]),style:(0,o.Z)({[K?"minWidth":"minHeight"]:V},E),ownerState:(0,o.Z)({},N,{state:e}),ref:B},t,{children:(0,b.jsx)(k,{ownerState:(0,o.Z)({},N,{state:e}),className:T.wrapper,ref:W,children:(0,b.jsx)(C,{ownerState:(0,o.Z)({},N,{state:e}),className:T.wrapperInner,children:s})})}))}))});$.muiSupportAuto=!0;var S=r(9872),w=r(6579),I=r(3292);function O(e){return(0,m.Z)("MuiAccordion",e)}let P=(0,h.Z)("MuiAccordion",["root","rounded","expanded","disabled","gutters","region"]),R=["children","className","defaultExpanded","disabled","disableGutters","expanded","onChange","square","TransitionComponent","TransitionProps"],_=e=>{let{classes:t,square:r,expanded:n,disabled:o,disableGutters:a}=e;return(0,l.Z)({root:["root",!r&&"rounded",n&&"expanded",o&&"disabled",!a&&"gutters"],region:["region"]},O,t)},L=(0,s.ZP)(S.Z,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[{[`& .${P.region}`]:t.region},t.root,!r.square&&t.rounded,!r.disableGutters&&t.gutters]}})(({theme:e})=>{let t={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],t),overflowAnchor:"none","&:before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-of-type":{"&:before":{display:"none"}},[`&.${P.expanded}`]:{"&:before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&:before":{display:"none"}}},[`&.${P.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}},({theme:e,ownerState:t})=>(0,o.Z)({},!t.square&&{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}},!t.disableGutters&&{[`&.${P.expanded}`]:{margin:"16px 0"}})),E=a.forwardRef(function(e,t){let r=(0,c.Z)({props:e,name:"MuiAccordion"}),{children:l,className:s,defaultExpanded:u=!1,disabled:d=!1,disableGutters:p=!1,expanded:f,onChange:g,square:h=!1,TransitionComponent:m=$,TransitionProps:v}=r,y=(0,n.Z)(r,R),[x,Z]=(0,I.Z)({controlled:f,default:u,name:"Accordion",state:"expanded"}),k=a.useCallback(e=>{Z(!x),g&&g(e,!x)},[x,g,Z]),[C,...S]=a.Children.toArray(l),O=a.useMemo(()=>({expanded:x,disabled:d,disableGutters:p,toggle:k}),[x,d,p,k]),P=(0,o.Z)({},r,{square:h,disabled:d,disableGutters:p,expanded:x}),E=_(P);return(0,b.jsxs)(L,(0,o.Z)({className:(0,i.Z)(E.root,s),ref:t,ownerState:P,square:h},y,{children:[(0,b.jsx)(w.Z.Provider,{value:O,children:C}),(0,b.jsx)(m,(0,o.Z)({in:x,timeout:"auto"},v,{children:(0,b.jsx)("div",{"aria-labelledby":C.props.id,id:C.props["aria-controls"],role:"region",className:E.region,children:S})}))]}))});var A=E},6579:function(e,t,r){"use strict";var n=r(2265);let o=n.createContext({});t.Z=o},8768:function(e,t,r){"use strict";r.d(t,{Z:function(){return b}});var n=r(3428),o=r(791),a=r(2265),i=r(7042),l=r(5600),s=r(5843),c=r(7927),u=r(6520),d=r(5702);function p(e){return(0,d.Z)("MuiAccordionDetails",e)}(0,u.Z)("MuiAccordionDetails",["root"]);var f=r(7437);let g=["className"],h=e=>{let{classes:t}=e;return(0,l.Z)({root:["root"]},p,t)},m=(0,s.ZP)("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({padding:e.spacing(1,2,2)})),v=a.forwardRef(function(e,t){let r=(0,c.Z)({props:e,name:"MuiAccordionDetails"}),{className:a}=r,l=(0,o.Z)(r,g),s=h(r);return(0,f.jsx)(m,(0,n.Z)({className:(0,i.Z)(s.root,a),ref:t,ownerState:r},l))});var b=v},5873:function(e,t,r){"use strict";r.d(t,{Z:function(){return C}});var n=r(791),o=r(3428),a=r(2265),i=r(7042),l=r(5600),s=r(5843),c=r(7927),u=r(6659),d=r(6579),p=r(6520),f=r(5702);function g(e){return(0,f.Z)("MuiAccordionSummary",e)}let h=(0,p.Z)("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]);var m=r(7437);let v=["children","className","expandIcon","focusVisibleClassName","onClick"],b=e=>{let{classes:t,expanded:r,disabled:n,disableGutters:o}=e;return(0,l.Z)({root:["root",r&&"expanded",n&&"disabled",!o&&"gutters"],focusVisible:["focusVisible"],content:["content",r&&"expanded",!o&&"contentGutters"],expandIconWrapper:["expandIconWrapper",r&&"expanded"]},g,t)},y=(0,s.ZP)(u.Z,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{let r={duration:e.transitions.duration.shortest};return(0,o.Z)({display:"flex",minHeight:48,padding:e.spacing(0,2),transition:e.transitions.create(["min-height","background-color"],r),[`&.${h.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${h.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`&:hover:not(.${h.disabled})`]:{cursor:"pointer"}},!t.disableGutters&&{[`&.${h.expanded}`]:{minHeight:64}})}),x=(0,s.ZP)("div",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(e,t)=>t.content})(({theme:e,ownerState:t})=>(0,o.Z)({display:"flex",flexGrow:1,margin:"12px 0"},!t.disableGutters&&{transition:e.transitions.create(["margin"],{duration:e.transitions.duration.shortest}),[`&.${h.expanded}`]:{margin:"20px 0"}})),Z=(0,s.ZP)("div",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(e,t)=>t.expandIconWrapper})(({theme:e})=>({display:"flex",color:(e.vars||e).palette.action.active,transform:"rotate(0deg)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),[`&.${h.expanded}`]:{transform:"rotate(180deg)"}})),k=a.forwardRef(function(e,t){let r=(0,c.Z)({props:e,name:"MuiAccordionSummary"}),{children:l,className:s,expandIcon:u,focusVisibleClassName:p,onClick:f}=r,g=(0,n.Z)(r,v),{disabled:h=!1,disableGutters:k,expanded:C,toggle:$}=a.useContext(d.Z),S=(0,o.Z)({},r,{expanded:C,disabled:h,disableGutters:k}),w=b(S);return(0,m.jsxs)(y,(0,o.Z)({focusRipple:!1,disableRipple:!0,disabled:h,component:"div","aria-expanded":C,className:(0,i.Z)(w.root,s),focusVisibleClassName:(0,i.Z)(w.focusVisible,p),onClick:e=>{$&&$(e),f&&f(e)},ref:t,ownerState:S},g,{children:[(0,m.jsx)(x,{className:w.content,ownerState:S,children:l}),u&&(0,m.jsx)(Z,{className:w.expandIconWrapper,ownerState:S,children:u})]}))});var C=k},8440:function(e,t,r){"use strict";r.d(t,{Z:function(){return ea}});var n,o,a=r(791),i=r(3428),l=r(2265),s=r(7042),c=r(5600),u=r(3449),d=r(4625),p=e=>{let t=l.useRef({});return l.useEffect(()=>{t.current=e}),t.current},f=r(8136),g=r(3406);function h(e){return void 0!==e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function m(e,t){for(let r=0;r<e.length;r+=1)if(t(e[r]))return r;return -1}let v=function(e={}){let{ignoreAccents:t=!0,ignoreCase:r=!0,limit:n,matchFrom:o="any",stringify:a,trim:i=!1}=e;return(e,{inputValue:l,getOptionLabel:s})=>{let c=i?l.trim():l;r&&(c=c.toLowerCase()),t&&(c=h(c));let u=c?e.filter(e=>{let n=(a||s)(e);return r&&(n=n.toLowerCase()),t&&(n=h(n)),"start"===o?0===n.indexOf(c):n.indexOf(c)>-1}):e;return"number"==typeof n?u.slice(0,n):u}}(),b=e=>{var t;return null!==e.current&&(null==(t=e.current.parentElement)?void 0:t.contains(document.activeElement))};var y=r(9975),x=r(3989),Z=r(5843),k=r(7927),C=r(8702),$=r(6520),S=r(5702);function w(e){return(0,S.Z)("MuiListSubheader",e)}(0,$.Z)("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);var I=r(7437);let O=["className","color","component","disableGutters","disableSticky","inset"],P=e=>{let{classes:t,color:r,disableGutters:n,inset:o,disableSticky:a}=e,i={root:["root","default"!==r&&`color${(0,C.Z)(r)}`,!n&&"gutters",o&&"inset",!a&&"sticky"]};return(0,c.Z)(i,w,t)},R=(0,Z.ZP)("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,"default"!==r.color&&t[`color${(0,C.Z)(r.color)}`],!r.disableGutters&&t.gutters,r.inset&&t.inset,!r.disableSticky&&t.sticky]}})(({theme:e,ownerState:t})=>(0,i.Z)({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14)},"primary"===t.color&&{color:(e.vars||e).palette.primary.main},"inherit"===t.color&&{color:"inherit"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.inset&&{paddingLeft:72},!t.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper})),_=l.forwardRef(function(e,t){let r=(0,k.Z)({props:e,name:"MuiListSubheader"}),{className:n,color:o="default",component:l="li",disableGutters:c=!1,disableSticky:u=!1,inset:d=!1}=r,p=(0,a.Z)(r,O),f=(0,i.Z)({},r,{color:o,component:l,disableGutters:c,disableSticky:u,inset:d}),g=P(f);return(0,I.jsx)(R,(0,i.Z)({as:l,className:(0,s.Z)(g.root,n),ref:t,ownerState:f},p))});_.muiSkipListHighlight=!0;var L=r(9872),E=r(2653),A=r(7827),M=r(466),z=r(7044),N=r(130),T=r(9274),j=(0,r(9782).Z)((0,I.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),D=r(2246);function W(e){return(0,S.Z)("MuiAutocomplete",e)}let F=(0,$.Z)("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var V=r(7663);let K=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],H=["ref"],q=e=>{let{classes:t,disablePortal:r,expanded:n,focused:o,fullWidth:a,hasClearIcon:i,hasPopupIcon:l,inputFocused:s,popupOpen:u,size:d}=e,p={root:["root",n&&"expanded",o&&"focused",a&&"fullWidth",i&&"hasClearIcon",l&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",s&&"inputFocused"],tag:["tag",`tagSize${(0,C.Z)(d)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",r&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return(0,c.Z)(p,W,t)},B=(0,Z.ZP)("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e,{fullWidth:n,hasClearIcon:o,hasPopupIcon:a,inputFocused:i,size:l}=r;return[{[`& .${F.tag}`]:t.tag},{[`& .${F.tag}`]:t[`tagSize${(0,C.Z)(l)}`]},{[`& .${F.inputRoot}`]:t.inputRoot},{[`& .${F.input}`]:t.input},{[`& .${F.input}`]:i&&t.inputFocused},t.root,n&&t.fullWidth,a&&t.hasPopupIcon,o&&t.hasClearIcon]}})(({ownerState:e})=>(0,i.Z)({[`&.${F.focused} .${F.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${F.clearIndicator}`]:{visibility:"visible"}}},e.fullWidth&&{width:"100%"},{[`& .${F.tag}`]:(0,i.Z)({margin:3,maxWidth:"calc(100% - 6px)"},"small"===e.size&&{margin:2,maxWidth:"calc(100% - 4px)"}),[`& .${F.inputRoot}`]:{flexWrap:"wrap",[`.${F.hasPopupIcon}&, .${F.hasClearIcon}&`]:{paddingRight:30},[`.${F.hasPopupIcon}.${F.hasClearIcon}&`]:{paddingRight:56},[`& .${F.input}`]:{width:0,minWidth:30}},[`& .${M.Z.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${M.Z.root}.${z.Z.sizeSmall}`]:{[`& .${M.Z.input}`]:{padding:"2px 4px 3px 0"}},[`& .${N.Z.root}`]:{padding:9,[`.${F.hasPopupIcon}&, .${F.hasClearIcon}&`]:{paddingRight:39},[`.${F.hasPopupIcon}.${F.hasClearIcon}&`]:{paddingRight:65},[`& .${F.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${F.endAdornment}`]:{right:9}},[`& .${N.Z.root}.${z.Z.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${F.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${T.Z.root}`]:{paddingTop:19,paddingLeft:8,[`.${F.hasPopupIcon}&, .${F.hasClearIcon}&`]:{paddingRight:39},[`.${F.hasPopupIcon}.${F.hasClearIcon}&`]:{paddingRight:65},[`& .${T.Z.input}`]:{padding:"7px 4px"},[`& .${F.endAdornment}`]:{right:9}},[`& .${T.Z.root}.${z.Z.sizeSmall}`]:{paddingBottom:1,[`& .${T.Z.input}`]:{padding:"2.5px 4px"}},[`& .${z.Z.hiddenLabel}`]:{paddingTop:8},[`& .${T.Z.root}.${z.Z.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${F.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${T.Z.root}.${z.Z.hiddenLabel}.${z.Z.sizeSmall}`]:{[`& .${F.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${F.input}`]:(0,i.Z)({flexGrow:1,textOverflow:"ellipsis",opacity:0},e.inputFocused&&{opacity:1})})),G=(0,Z.ZP)("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,t)=>t.endAdornment})({position:"absolute",right:0,top:"calc(50% - 14px)"}),U=(0,Z.ZP)(E.Z,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,t)=>t.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),J=(0,Z.ZP)(E.Z,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:e},t)=>(0,i.Z)({},t.popupIndicator,e.popupOpen&&t.popupIndicatorOpen)})(({ownerState:e})=>(0,i.Z)({padding:2,marginRight:-2},e.popupOpen&&{transform:"rotate(180deg)"})),Q=(0,Z.ZP)(x.Z,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[{[`& .${F.option}`]:t.option},t.popper,r.disablePortal&&t.popperDisablePortal]}})(({theme:e,ownerState:t})=>(0,i.Z)({zIndex:(e.vars||e).zIndex.modal},t.disablePortal&&{position:"absolute"})),X=(0,Z.ZP)(L.Z,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>(0,i.Z)({},e.typography.body1,{overflow:"auto"})),Y=(0,Z.ZP)("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,t)=>t.loading})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),ee=(0,Z.ZP)("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,t)=>t.noOptions})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),et=(0,Z.ZP)("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,t)=>t.listbox})(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${F.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${F.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${F.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:(0,y.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${F.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,y.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${F.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,y.Fq)(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}})),er=(0,Z.ZP)(_,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,t)=>t.groupLabel})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8})),en=(0,Z.ZP)("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,t)=>t.groupUl})({padding:0,[`& .${F.option}`]:{paddingLeft:24}}),eo=l.forwardRef(function(e,t){var r,c,h,y;let Z;let C=(0,k.Z)({props:e,name:"MuiAutocomplete"}),{autoComplete:$=!1,autoHighlight:S=!1,autoSelect:w=!1,blurOnSelect:O=!1,ChipProps:P,className:R,clearIcon:_=n||(n=(0,I.jsx)(j,{fontSize:"small"})),clearOnBlur:E=!C.freeSolo,clearOnEscape:M=!1,clearText:z="Clear",closeText:N="Close",componentsProps:T={},defaultValue:W=C.multiple?[]:null,disableClearable:F=!1,disableCloseOnSelect:eo=!1,disabled:ea=!1,disabledItemsFocusable:ei=!1,disableListWrap:el=!1,disablePortal:es=!1,filterSelectedOptions:ec=!1,forcePopupIcon:eu="auto",freeSolo:ed=!1,fullWidth:ep=!1,getLimitTagsText:ef=e=>`+${e}`,getOptionLabel:eg,groupBy:eh,handleHomeEndKeys:em=!C.freeSolo,includeInputInList:ev=!1,limitTags:eb=-1,ListboxComponent:ey="ul",ListboxProps:ex,loading:eZ=!1,loadingText:ek="Loading…",multiple:eC=!1,noOptionsText:e$="No options",openOnFocus:eS=!1,openText:ew="Open",PaperComponent:eI=L.Z,PopperComponent:eO=x.Z,popupIcon:eP=o||(o=(0,I.jsx)(D.Z,{})),readOnly:eR=!1,renderGroup:e_,renderInput:eL,renderOption:eE,renderTags:eA,selectOnFocus:eM=!C.freeSolo,size:ez="medium",slotProps:eN={}}=C,eT=(0,a.Z)(C,K),{getRootProps:ej,getInputProps:eD,getInputLabelProps:eW,getPopupIndicatorProps:eF,getClearProps:eV,getTagProps:eK,getListboxProps:eH,getOptionProps:eq,value:eB,dirty:eG,expanded:eU,id:eJ,popupOpen:eQ,focused:eX,focusedTag:eY,anchorEl:e0,setAnchorEl:e1,inputValue:e2,groupedOptions:e4}=function(e){let{unstable_isActiveElementInListbox:t=b,unstable_classNamePrefix:r="Mui",autoComplete:n=!1,autoHighlight:o=!1,autoSelect:a=!1,blurOnSelect:s=!1,clearOnBlur:c=!e.freeSolo,clearOnEscape:h=!1,componentName:y="useAutocomplete",defaultValue:x=e.multiple?[]:null,disableClearable:Z=!1,disableCloseOnSelect:k=!1,disabled:C,disabledItemsFocusable:$=!1,disableListWrap:S=!1,filterOptions:w=v,filterSelectedOptions:I=!1,freeSolo:O=!1,getOptionDisabled:P,getOptionLabel:R=e=>{var t;return null!=(t=e.label)?t:e},groupBy:_,handleHomeEndKeys:L=!e.freeSolo,id:E,includeInputInList:A=!1,inputValue:M,isOptionEqualToValue:z=(e,t)=>e===t,multiple:N=!1,onChange:T,onClose:j,onHighlightChange:D,onInputChange:W,onOpen:F,open:V,openOnFocus:K=!1,options:H,readOnly:q=!1,selectOnFocus:B=!e.freeSolo,value:G}=e,U=(0,u.Z)(E),J=R;J=e=>{let t=R(e);return"string"!=typeof t?String(t):t};let Q=l.useRef(!1),X=l.useRef(!0),Y=l.useRef(null),ee=l.useRef(null),[et,er]=l.useState(null),[en,eo]=l.useState(-1),ea=o?0:-1,ei=l.useRef(ea),[el,es]=(0,d.Z)({controlled:G,default:x,name:y}),[ec,eu]=(0,d.Z)({controlled:M,default:"",name:y,state:"inputValue"}),[ed,ep]=l.useState(!1),ef=l.useCallback((e,t)=>{let r;let n=N?el.length<t.length:null!==t;if(n||c){if(N)r="";else if(null==t)r="";else{let e=J(t);r="string"==typeof e?e:""}ec!==r&&(eu(r),W&&W(e,r,"reset"))}},[J,ec,N,W,eu,c,el]),[eg,eh]=(0,d.Z)({controlled:V,default:!1,name:y,state:"open"}),[em,ev]=l.useState(!0),eb=!N&&null!=el&&ec===J(el),ey=eg&&!q,ex=ey?w(H.filter(e=>!(I&&(N?el:[el]).some(t=>null!==t&&z(e,t)))),{inputValue:eb&&em?"":ec,getOptionLabel:J}):[],eZ=p({filteredOptions:ex,value:el,inputValue:ec});l.useEffect(()=>{let e=el!==eZ.value;(!ed||e)&&(!O||e)&&ef(null,el)},[el,ef,ed,eZ.value,O]);let ek=eg&&ex.length>0&&!q,eC=(0,f.Z)(e=>{-1===e?Y.current.focus():et.querySelector(`[data-tag-index="${e}"]`).focus()});l.useEffect(()=>{N&&en>el.length-1&&(eo(-1),eC(-1))},[el,N,en,eC]);let e$=(0,f.Z)(({event:e,index:t,reason:n="auto"})=>{if(ei.current=t,-1===t?Y.current.removeAttribute("aria-activedescendant"):Y.current.setAttribute("aria-activedescendant",`${U}-option-${t}`),D&&D(e,-1===t?null:ex[t],n),!ee.current)return;let o=ee.current.querySelector(`[role="option"].${r}-focused`);o&&(o.classList.remove(`${r}-focused`),o.classList.remove(`${r}-focusVisible`));let a=ee.current;if("listbox"!==ee.current.getAttribute("role")&&(a=ee.current.parentElement.querySelector('[role="listbox"]')),!a)return;if(-1===t){a.scrollTop=0;return}let i=ee.current.querySelector(`[data-option-index="${t}"]`);if(i&&(i.classList.add(`${r}-focused`),"keyboard"===n&&i.classList.add(`${r}-focusVisible`),a.scrollHeight>a.clientHeight&&"mouse"!==n&&"touch"!==n)){let e=a.clientHeight+a.scrollTop,t=i.offsetTop+i.offsetHeight;t>e?a.scrollTop=t-a.clientHeight:i.offsetTop-i.offsetHeight*(_?1.3:0)<a.scrollTop&&(a.scrollTop=i.offsetTop-i.offsetHeight*(_?1.3:0))}}),eS=(0,f.Z)(({event:e,diff:t,direction:r="next",reason:o="auto"})=>{if(!ey)return;let a=function(e,t){if(!ee.current||-1===e)return -1;let r=e;for(;;){if("next"===t&&r===ex.length||"previous"===t&&-1===r)return -1;let e=ee.current.querySelector(`[data-option-index="${r}"]`),n=!$&&(!e||e.disabled||"true"===e.getAttribute("aria-disabled"));if((!e||e.hasAttribute("tabindex"))&&!n)return r;r+="next"===t?1:-1}}((()=>{let e=ex.length-1;if("reset"===t)return ea;if("start"===t)return 0;if("end"===t)return e;let r=ei.current+t;return r<0?-1===r&&A?-1:S&&-1!==ei.current||Math.abs(t)>1?0:e:r>e?r===e+1&&A?-1:S||Math.abs(t)>1?e:0:r})(),r);if(e$({index:a,reason:o,event:e}),n&&"reset"!==t){if(-1===a)Y.current.value=ec;else{let e=J(ex[a]);Y.current.value=e;let t=e.toLowerCase().indexOf(ec.toLowerCase());0===t&&ec.length>0&&Y.current.setSelectionRange(ec.length,e.length)}}}),ew=()=>{if(-1!==ei.current&&eZ.filteredOptions&&eZ.filteredOptions.length!==ex.length&&eZ.inputValue===ec&&(N?el.length===eZ.value.length&&eZ.value.every((e,t)=>J(el[t])===J(e)):((e,t)=>{let r=e?J(e):"",n=t?J(t):"";return r===n})(eZ.value,el))){let e=eZ.filteredOptions[ei.current];if(e){let t=ex.some(t=>J(t)===J(e));if(t)return!0}}return!1},eI=l.useCallback(()=>{if(!ey||ew())return;let e=N?el[0]:el;if(0===ex.length||null==e){eS({diff:"reset"});return}if(ee.current){if(null!=e){let t=ex[ei.current];if(N&&t&&-1!==m(el,e=>z(t,e)))return;let r=m(ex,t=>z(t,e));-1===r?eS({diff:"reset"}):e$({index:r});return}if(ei.current>=ex.length-1){e$({index:ex.length-1});return}e$({index:ei.current})}},[ex.length,!N&&el,I,eS,e$,ey,ec,N]),eO=(0,f.Z)(e=>{(0,g.Z)(ee,e),e&&eI()});l.useEffect(()=>{eI()},[eI]);let eP=e=>{!eg&&(eh(!0),ev(!0),F&&F(e))},eR=(e,t)=>{eg&&(eh(!1),j&&j(e,t))},e_=(e,t,r,n)=>{if(N){if(el.length===t.length&&el.every((e,r)=>e===t[r]))return}else if(el===t)return;T&&T(e,t,r,n),es(t)},eL=l.useRef(!1),eE=(e,t,r="selectOption",n="options")=>{let o=r,a=t;if(N){a=Array.isArray(el)?el.slice():[];let e=m(a,e=>z(t,e));-1===e?a.push(t):"freeSolo"!==n&&(a.splice(e,1),o="removeOption")}ef(e,a),e_(e,a,o,{option:t}),k||e&&(e.ctrlKey||e.metaKey)||eR(e,o),(!0===s||"touch"===s&&eL.current||"mouse"===s&&!eL.current)&&Y.current.blur()},eA=(e,t)=>{if(!N)return;""===ec&&eR(e,"toggleInput");let r=en;-1===en?""===ec&&"previous"===t&&(r=el.length-1):((r+="next"===t?1:-1)<0&&(r=0),r===el.length&&(r=-1)),eo(r=function(e,t){if(-1===e)return -1;let r=e;for(;;){if("next"===t&&r===el.length||"previous"===t&&-1===r)return -1;let e=et.querySelector(`[data-tag-index="${r}"]`);if(e&&e.hasAttribute("tabindex")&&!e.disabled&&"true"!==e.getAttribute("aria-disabled"))return r;r+="next"===t?1:-1}}(r,t)),eC(r)},eM=e=>{Q.current=!0,eu(""),W&&W(e,"","clear"),e_(e,N?[]:null,"clear")},ez=e=>t=>{if(e.onKeyDown&&e.onKeyDown(t),!t.defaultMuiPrevented&&(-1!==en&&-1===["ArrowLeft","ArrowRight"].indexOf(t.key)&&(eo(-1),eC(-1)),229!==t.which))switch(t.key){case"Home":ey&&L&&(t.preventDefault(),eS({diff:"start",direction:"next",reason:"keyboard",event:t}));break;case"End":ey&&L&&(t.preventDefault(),eS({diff:"end",direction:"previous",reason:"keyboard",event:t}));break;case"PageUp":t.preventDefault(),eS({diff:-5,direction:"previous",reason:"keyboard",event:t}),eP(t);break;case"PageDown":t.preventDefault(),eS({diff:5,direction:"next",reason:"keyboard",event:t}),eP(t);break;case"ArrowDown":t.preventDefault(),eS({diff:1,direction:"next",reason:"keyboard",event:t}),eP(t);break;case"ArrowUp":t.preventDefault(),eS({diff:-1,direction:"previous",reason:"keyboard",event:t}),eP(t);break;case"ArrowLeft":eA(t,"previous");break;case"ArrowRight":eA(t,"next");break;case"Enter":if(-1!==ei.current&&ey){let e=ex[ei.current],r=!!P&&P(e);if(t.preventDefault(),r)return;eE(t,e,"selectOption"),n&&Y.current.setSelectionRange(Y.current.value.length,Y.current.value.length)}else O&&""!==ec&&!1===eb&&(N&&t.preventDefault(),eE(t,ec,"createOption","freeSolo"));break;case"Escape":ey?(t.preventDefault(),t.stopPropagation(),eR(t,"escape")):h&&(""!==ec||N&&el.length>0)&&(t.preventDefault(),t.stopPropagation(),eM(t));break;case"Backspace":if(N&&!q&&""===ec&&el.length>0){let e=-1===en?el.length-1:en,r=el.slice();r.splice(e,1),e_(t,r,"removeOption",{option:el[e]})}break;case"Delete":if(N&&!q&&""===ec&&el.length>0&&-1!==en){let e=el.slice();e.splice(en,1),e_(t,e,"removeOption",{option:el[en]})}}},eN=e=>{ep(!0),K&&!Q.current&&eP(e)},eT=e=>{if(t(ee)){Y.current.focus();return}ep(!1),X.current=!0,Q.current=!1,a&&-1!==ei.current&&ey?eE(e,ex[ei.current],"blur"):a&&O&&""!==ec?eE(e,ec,"blur","freeSolo"):c&&ef(e,el),eR(e,"blur")},ej=e=>{let t=e.target.value;ec!==t&&(eu(t),ev(!1),W&&W(e,t,"input")),""===t?Z||N||e_(e,null,"clear"):eP(e)},eD=e=>{let t=Number(e.currentTarget.getAttribute("data-option-index"));ei.current!==t&&e$({event:e,index:t,reason:"mouse"})},eW=e=>{e$({event:e,index:Number(e.currentTarget.getAttribute("data-option-index")),reason:"touch"}),eL.current=!0},eF=e=>{let t=Number(e.currentTarget.getAttribute("data-option-index"));eE(e,ex[t],"selectOption"),eL.current=!1},eV=e=>t=>{let r=el.slice();r.splice(e,1),e_(t,r,"removeOption",{option:el[e]})},eK=e=>{eg?eR(e,"toggleInput"):eP(e)},eH=e=>{e.currentTarget.contains(e.target)&&e.target.getAttribute("id")!==U&&e.preventDefault()},eq=e=>{e.currentTarget.contains(e.target)&&(Y.current.focus(),B&&X.current&&Y.current.selectionEnd-Y.current.selectionStart==0&&Y.current.select(),X.current=!1)},eB=e=>{""!==ec&&eg||eK(e)},eG=O&&ec.length>0;eG=eG||(N?el.length>0:null!==el);let eU=ex;return _&&(eU=ex.reduce((e,t,r)=>{let n=_(t);return e.length>0&&e[e.length-1].group===n?e[e.length-1].options.push(t):e.push({key:r,index:r,group:n,options:[t]}),e},[])),C&&ed&&eT(),{getRootProps:(e={})=>(0,i.Z)({"aria-owns":ek?`${U}-listbox`:null},e,{onKeyDown:ez(e),onMouseDown:eH,onClick:eq}),getInputLabelProps:()=>({id:`${U}-label`,htmlFor:U}),getInputProps:()=>({id:U,value:ec,onBlur:eT,onFocus:eN,onChange:ej,onMouseDown:eB,"aria-activedescendant":ey?"":null,"aria-autocomplete":n?"both":"list","aria-controls":ek?`${U}-listbox`:void 0,"aria-expanded":ek,autoComplete:"off",ref:Y,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:C}),getClearProps:()=>({tabIndex:-1,onClick:eM}),getPopupIndicatorProps:()=>({tabIndex:-1,onClick:eK}),getTagProps:({index:e})=>(0,i.Z)({key:e,"data-tag-index":e,tabIndex:-1},!q&&{onDelete:eV(e)}),getListboxProps:()=>({role:"listbox",id:`${U}-listbox`,"aria-labelledby":`${U}-label`,ref:eO,onMouseDown:e=>{e.preventDefault()}}),getOptionProps:({index:e,option:t})=>{let r=(N?el:[el]).some(e=>null!=e&&z(t,e)),n=!!P&&P(t);return{key:J(t),tabIndex:-1,role:"option",id:`${U}-option-${e}`,onMouseMove:eD,onClick:eF,onTouchStart:eW,"data-option-index":e,"aria-disabled":n,"aria-selected":r}},id:U,inputValue:ec,value:el,dirty:eG,expanded:ey&&et,popupOpen:ey,focused:ed||-1!==en,anchorEl:et,setAnchorEl:er,focusedTag:en,groupedOptions:eU}}((0,i.Z)({},C,{componentName:"Autocomplete"})),e7=!F&&!ea&&eG&&!eR,e3=(!ed||!0===eu)&&!1!==eu,{onMouseDown:e6}=eD(),{ref:e5}=null!=ex?ex:{},e9=eH(),{ref:e8}=e9,te=(0,a.Z)(e9,H),tt=(0,V.Z)(e8,e5),tr=eg||(e=>{var t;return null!=(t=e.label)?t:e}),tn=(0,i.Z)({},C,{disablePortal:es,expanded:eU,focused:eX,fullWidth:ep,getOptionLabel:tr,hasClearIcon:e7,hasPopupIcon:e3,inputFocused:-1===eY,popupOpen:eQ,size:ez}),to=q(tn);if(eC&&eB.length>0){let e=e=>(0,i.Z)({className:to.tag,disabled:ea},eK(e));Z=eA?eA(eB,e,tn):eB.map((t,r)=>(0,I.jsx)(A.Z,(0,i.Z)({label:tr(t),size:ez},e({index:r}),P)))}if(eb>-1&&Array.isArray(Z)){let e=Z.length-eb;!eX&&e>0&&(Z=Z.splice(0,eb)).push((0,I.jsx)("span",{className:to.tag,children:ef(e)},Z.length))}let ta=e_||(e=>(0,I.jsxs)("li",{children:[(0,I.jsx)(er,{className:to.groupLabel,ownerState:tn,component:"div",children:e.group}),(0,I.jsx)(en,{className:to.groupUl,ownerState:tn,children:e.children})]},e.key)),ti=eE||((e,t)=>(0,I.jsx)("li",(0,i.Z)({},e,{children:tr(t)}))),tl=(e,t)=>{let r=eq({option:e,index:t});return ti((0,i.Z)({},r,{className:to.option}),e,{selected:r["aria-selected"],index:t,inputValue:e2},tn)},ts=null!=(r=eN.clearIndicator)?r:T.clearIndicator,tc=null!=(c=eN.paper)?c:T.paper,tu=null!=(h=eN.popper)?h:T.popper,td=null!=(y=eN.popupIndicator)?y:T.popupIndicator;return(0,I.jsxs)(l.Fragment,{children:[(0,I.jsx)(B,(0,i.Z)({ref:t,className:(0,s.Z)(to.root,R),ownerState:tn},ej(eT),{children:eL({id:eJ,disabled:ea,fullWidth:!0,size:"small"===ez?"small":void 0,InputLabelProps:eW(),InputProps:(0,i.Z)({ref:e1,className:to.inputRoot,startAdornment:Z,onClick:e=>{e.target===e.currentTarget&&e6(e)}},(e7||e3)&&{endAdornment:(0,I.jsxs)(G,{className:to.endAdornment,ownerState:tn,children:[e7?(0,I.jsx)(U,(0,i.Z)({},eV(),{"aria-label":z,title:z,ownerState:tn},ts,{className:(0,s.Z)(to.clearIndicator,null==ts?void 0:ts.className),children:_})):null,e3?(0,I.jsx)(J,(0,i.Z)({},eF(),{disabled:ea,"aria-label":eQ?N:ew,title:eQ?N:ew,ownerState:tn},td,{className:(0,s.Z)(to.popupIndicator,null==td?void 0:td.className),children:eP})):null]})}),inputProps:(0,i.Z)({className:to.input,disabled:ea,readOnly:eR},eD())})})),e0?(0,I.jsx)(Q,(0,i.Z)({as:eO,disablePortal:es,style:{width:e0?e0.clientWidth:null},ownerState:tn,role:"presentation",anchorEl:e0,open:eQ},tu,{className:(0,s.Z)(to.popper,null==tu?void 0:tu.className),children:(0,I.jsxs)(X,(0,i.Z)({ownerState:tn,as:eI},tc,{className:(0,s.Z)(to.paper,null==tc?void 0:tc.className),children:[eZ&&0===e4.length?(0,I.jsx)(Y,{className:to.loading,ownerState:tn,children:ek}):null,0!==e4.length||ed||eZ?null:(0,I.jsx)(ee,{className:to.noOptions,ownerState:tn,role:"presentation",onMouseDown:e=>{e.preventDefault()},children:e$}),e4.length>0?(0,I.jsx)(et,(0,i.Z)({as:ey,className:to.listbox,ownerState:tn},te,ex,{ref:tt,children:e4.map((e,t)=>eh?ta({key:e.key,group:e.group,children:e.options.map((t,r)=>tl(t,e.index+r))}):tl(e,t))})):null]}))})):null]})});var ea=eo},7827:function(e,t,r){"use strict";r.d(t,{Z:function(){return I}});var n=r(791),o=r(3428),a=r(2265),i=r(7042),l=r(5600),s=r(9975),c=r(9782),u=r(7437),d=(0,c.Z)((0,u.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel"),p=r(7663),f=r(8702),g=r(6659),h=r(7927),m=r(5843),v=r(6520),b=r(5702);function y(e){return(0,b.Z)("MuiChip",e)}let x=(0,v.Z)("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),Z=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],k=e=>{let{classes:t,disabled:r,size:n,color:o,iconColor:a,onDelete:i,clickable:s,variant:c}=e,u={root:["root",c,r&&"disabled",`size${(0,f.Z)(n)}`,`color${(0,f.Z)(o)}`,s&&"clickable",s&&`clickableColor${(0,f.Z)(o)}`,i&&"deletable",i&&`deletableColor${(0,f.Z)(o)}`,`${c}${(0,f.Z)(o)}`],label:["label",`label${(0,f.Z)(n)}`],avatar:["avatar",`avatar${(0,f.Z)(n)}`,`avatarColor${(0,f.Z)(o)}`],icon:["icon",`icon${(0,f.Z)(n)}`,`iconColor${(0,f.Z)(a)}`],deleteIcon:["deleteIcon",`deleteIcon${(0,f.Z)(n)}`,`deleteIconColor${(0,f.Z)(o)}`,`deleteIcon${(0,f.Z)(c)}Color${(0,f.Z)(o)}`]};return(0,l.Z)(u,y,t)},C=(0,m.ZP)("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e,{color:n,iconColor:o,clickable:a,onDelete:i,size:l,variant:s}=r;return[{[`& .${x.avatar}`]:t.avatar},{[`& .${x.avatar}`]:t[`avatar${(0,f.Z)(l)}`]},{[`& .${x.avatar}`]:t[`avatarColor${(0,f.Z)(n)}`]},{[`& .${x.icon}`]:t.icon},{[`& .${x.icon}`]:t[`icon${(0,f.Z)(l)}`]},{[`& .${x.icon}`]:t[`iconColor${(0,f.Z)(o)}`]},{[`& .${x.deleteIcon}`]:t.deleteIcon},{[`& .${x.deleteIcon}`]:t[`deleteIcon${(0,f.Z)(l)}`]},{[`& .${x.deleteIcon}`]:t[`deleteIconColor${(0,f.Z)(n)}`]},{[`& .${x.deleteIcon}`]:t[`deleteIcon${(0,f.Z)(s)}Color${(0,f.Z)(n)}`]},t.root,t[`size${(0,f.Z)(l)}`],t[`color${(0,f.Z)(n)}`],a&&t.clickable,a&&"default"!==n&&t[`clickableColor${(0,f.Z)(n)})`],i&&t.deletable,i&&"default"!==n&&t[`deletableColor${(0,f.Z)(n)}`],t[s],t[`${s}${(0,f.Z)(n)}`]]}})(({theme:e,ownerState:t})=>{let r="light"===e.palette.mode?e.palette.grey[700]:e.palette.grey[300];return(0,o.Z)({maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:16,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${x.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${x.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:r,fontSize:e.typography.pxToRem(12)},[`& .${x.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${x.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${x.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${x.icon}`]:(0,o.Z)({marginLeft:5,marginRight:-6},"small"===t.size&&{fontSize:18,marginLeft:4,marginRight:-4},t.iconColor===t.color&&(0,o.Z)({color:e.vars?e.vars.palette.Chip.defaultIconColor:r},"default"!==t.color&&{color:"inherit"})),[`& .${x.deleteIcon}`]:(0,o.Z)({WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:(0,s.Fq)(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:(0,s.Fq)(e.palette.text.primary,.4)}},"small"===t.size&&{fontSize:16,marginRight:4,marginLeft:-4},"default"!==t.color&&{color:e.vars?`rgba(${e.vars.palette[t.color].contrastTextChannel} / 0.7)`:(0,s.Fq)(e.palette[t.color].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].contrastText}})},"small"===t.size&&{height:24},"default"!==t.color&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.onDelete&&{[`&.${x.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,s.Fq)(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},t.onDelete&&"default"!==t.color&&{[`&.${x.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}})},({theme:e,ownerState:t})=>(0,o.Z)({},t.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:(0,s.Fq)(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${x.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:(0,s.Fq)(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}},t.clickable&&"default"!==t.color&&{[`&:hover, &.${x.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}}),({theme:e,ownerState:t})=>(0,o.Z)({},"outlined"===t.variant&&{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${"light"===e.palette.mode?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${x.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${x.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${x.avatar}`]:{marginLeft:4},[`& .${x.avatarSmall}`]:{marginLeft:2},[`& .${x.icon}`]:{marginLeft:4},[`& .${x.iconSmall}`]:{marginLeft:2},[`& .${x.deleteIcon}`]:{marginRight:5},[`& .${x.deleteIconSmall}`]:{marginRight:3}},"outlined"===t.variant&&"default"!==t.color&&{color:(e.vars||e).palette[t.color].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:(0,s.Fq)(e.palette[t.color].main,.7)}`,[`&.${x.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,s.Fq)(e.palette[t.color].main,e.palette.action.hoverOpacity)},[`&.${x.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.focusOpacity})`:(0,s.Fq)(e.palette[t.color].main,e.palette.action.focusOpacity)},[`& .${x.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:(0,s.Fq)(e.palette[t.color].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].main}}})),$=(0,m.ZP)("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{let{ownerState:r}=e,{size:n}=r;return[t.label,t[`label${(0,f.Z)(n)}`]]}})(({ownerState:e})=>(0,o.Z)({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},"small"===e.size&&{paddingLeft:8,paddingRight:8}));function S(e){return"Backspace"===e.key||"Delete"===e.key}let w=a.forwardRef(function(e,t){let r=(0,h.Z)({props:e,name:"MuiChip"}),{avatar:l,className:s,clickable:c,color:f="default",component:m,deleteIcon:v,disabled:b=!1,icon:y,label:x,onClick:w,onDelete:I,onKeyDown:O,onKeyUp:P,size:R="medium",variant:_="filled",tabIndex:L,skipFocusWhenDisabled:E=!1}=r,A=(0,n.Z)(r,Z),M=a.useRef(null),z=(0,p.Z)(M,t),N=e=>{e.stopPropagation(),I&&I(e)},T=!1!==c&&!!w||c,j=T||I?g.Z:m||"div",D=(0,o.Z)({},r,{component:j,disabled:b,size:R,color:f,iconColor:a.isValidElement(y)&&y.props.color||f,onDelete:!!I,clickable:T,variant:_}),W=k(D),F=j===g.Z?(0,o.Z)({component:m||"div",focusVisibleClassName:W.focusVisible},I&&{disableRipple:!0}):{},V=null;I&&(V=v&&a.isValidElement(v)?a.cloneElement(v,{className:(0,i.Z)(v.props.className,W.deleteIcon),onClick:N}):(0,u.jsx)(d,{className:(0,i.Z)(W.deleteIcon),onClick:N}));let K=null;l&&a.isValidElement(l)&&(K=a.cloneElement(l,{className:(0,i.Z)(W.avatar,l.props.className)}));let H=null;return y&&a.isValidElement(y)&&(H=a.cloneElement(y,{className:(0,i.Z)(W.icon,y.props.className)})),(0,u.jsxs)(C,(0,o.Z)({as:j,className:(0,i.Z)(W.root,s),disabled:!!T&&!!b||void 0,onClick:w,onKeyDown:e=>{e.currentTarget===e.target&&S(e)&&e.preventDefault(),O&&O(e)},onKeyUp:e=>{e.currentTarget===e.target&&(I&&S(e)?I(e):"Escape"===e.key&&M.current&&M.current.blur()),P&&P(e)},ref:z,tabIndex:E&&b?-1:L,ownerState:D},F,A,{children:[K||H,(0,u.jsx)($,{className:(0,i.Z)(W.label),ownerState:D,children:x}),V]}))});var I=w},8938:function(e,t,r){"use strict";r.d(t,{Z:function(){return C}});var n=r(791),o=r(3428),a=r(2265),i=r(7042),l=r(1380),s=r(5702),c=r(5600),u=r(8153),d=r(9190),p=r(4775),f=r(7437);let g=["className","component","disableGutters","fixed","maxWidth","classes"],h=(0,p.Z)(),m=(0,d.Z)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[`maxWidth${(0,l.Z)(String(r.maxWidth))}`],r.fixed&&t.fixed,r.disableGutters&&t.disableGutters]}}),v=e=>(0,u.Z)({props:e,name:"MuiContainer",defaultTheme:h}),b=(e,t)=>{let{classes:r,fixed:n,disableGutters:o,maxWidth:a}=e,i={root:["root",a&&`maxWidth${(0,l.Z)(String(a))}`,n&&"fixed",o&&"disableGutters"]};return(0,c.Z)(i,e=>(0,s.Z)(t,e),r)};var y=r(8702),x=r(5843),Z=r(7927);let k=function(e={}){let{createStyledComponent:t=m,useThemeProps:r=v,componentName:l="MuiContainer"}=e,s=t(({theme:e,ownerState:t})=>(0,o.Z)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,r)=>{let n=e.breakpoints.values[r];return 0!==n&&(t[e.breakpoints.up(r)]={maxWidth:`${n}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:t})=>(0,o.Z)({},"xs"===t.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},t.maxWidth&&"xs"!==t.maxWidth&&{[e.breakpoints.up(t.maxWidth)]:{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`}})),c=a.forwardRef(function(e,t){let a=r(e),{className:c,component:u="div",disableGutters:d=!1,fixed:p=!1,maxWidth:h="lg"}=a,m=(0,n.Z)(a,g),v=(0,o.Z)({},a,{component:u,disableGutters:d,fixed:p,maxWidth:h}),y=b(v,l);return(0,f.jsx)(s,(0,o.Z)({as:u,ownerState:v,className:(0,i.Z)(y.root,c),ref:t},m))});return c}({createStyledComponent:(0,x.ZP)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,t[`maxWidth${(0,y.Z)(String(r.maxWidth))}`],r.fixed&&t.fixed,r.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,Z.Z)({props:e,name:"MuiContainer"})});var C=k},7555:function(){},4759:function(e,t,r){/**
|
|
2
|
-
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
3
|
-
*
|
|
4
|
-
* @license MIT <https://opensource.org/licenses/MIT>
|
|
5
|
-
* @author Lea Verou <https://lea.verou.me>
|
|
6
|
-
* @namespace
|
|
7
|
-
* @public
|
|
8
|
-
*/var n=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,r=0,n={},o={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++r}),e.__id},clone:function e(t,r){var n,a;switch(r=r||{},o.util.type(t)){case"Object":if(r[a=o.util.objId(t)])return r[a];for(var i in n={},r[a]=n,t)t.hasOwnProperty(i)&&(n[i]=e(t[i],r));return n;case"Array":if(r[a=o.util.objId(t)])return r[a];return n=[],r[a]=n,t.forEach(function(t,o){n[o]=e(t,r)}),n;default:return t}},getLanguage:function(e){for(;e;){var r=t.exec(e.className);if(r)return r[1].toLowerCase();e=e.parentElement}return"none"},setLanguage:function(e,r){e.className=e.className.replace(RegExp(t,"gi"),""),e.classList.add("language-"+r)},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw Error()}catch(n){var e=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(n.stack)||[])[1];if(e){var t=document.getElementsByTagName("script");for(var r in t)if(t[r].src==e)return t[r]}return null}},isActive:function(e,t,r){for(var n="no-"+t;e;){var o=e.classList;if(o.contains(t))return!0;if(o.contains(n))return!1;e=e.parentElement}return!!r}},languages:{plain:n,plaintext:n,text:n,txt:n,extend:function(e,t){var r=o.util.clone(o.languages[e]);for(var n in t)r[n]=t[n];return r},insertBefore:function(e,t,r,n){var a=(n=n||o.languages)[e],i={};for(var l in a)if(a.hasOwnProperty(l)){if(l==t)for(var s in r)r.hasOwnProperty(s)&&(i[s]=r[s]);r.hasOwnProperty(l)||(i[l]=a[l])}var c=n[e];return n[e]=i,o.languages.DFS(o.languages,function(t,r){r===c&&t!=e&&(this[t]=i)}),i},DFS:function e(t,r,n,a){a=a||{};var i=o.util.objId;for(var l in t)if(t.hasOwnProperty(l)){r.call(t,l,t[l],n||l);var s=t[l],c=o.util.type(s);"Object"!==c||a[i(s)]?"Array"!==c||a[i(s)]||(a[i(s)]=!0,e(s,r,l,a)):(a[i(s)]=!0,e(s,r,null,a))}}},plugins:{},highlightAll:function(e,t){o.highlightAllUnder(document,e,t)},highlightAllUnder:function(e,t,r){var n={callback:r,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",n),n.elements=Array.prototype.slice.apply(n.container.querySelectorAll(n.selector)),o.hooks.run("before-all-elements-highlight",n);for(var a,i=0;a=n.elements[i++];)o.highlightElement(a,!0===t,n.callback)},highlightElement:function(t,r,n){var a=o.util.getLanguage(t),i=o.languages[a];o.util.setLanguage(t,a);var l=t.parentElement;l&&"pre"===l.nodeName.toLowerCase()&&o.util.setLanguage(l,a);var s=t.textContent,c={element:t,language:a,grammar:i,code:s};function u(e){c.highlightedCode=e,o.hooks.run("before-insert",c),c.element.innerHTML=c.highlightedCode,o.hooks.run("after-highlight",c),o.hooks.run("complete",c),n&&n.call(c.element)}if(o.hooks.run("before-sanity-check",c),(l=c.element.parentElement)&&"pre"===l.nodeName.toLowerCase()&&!l.hasAttribute("tabindex")&&l.setAttribute("tabindex","0"),!c.code){o.hooks.run("complete",c),n&&n.call(c.element);return}if(o.hooks.run("before-highlight",c),!c.grammar){u(o.util.encode(c.code));return}if(r&&e.Worker){var d=new Worker(o.filename);d.onmessage=function(e){u(e.data)},d.postMessage(JSON.stringify({language:c.language,code:c.code,immediateClose:!0}))}else u(o.highlight(c.code,c.grammar,c.language))},highlight:function(e,t,r){var n={code:e,grammar:t,language:r};if(o.hooks.run("before-tokenize",n),!n.grammar)throw Error('The language "'+n.language+'" has no grammar.');return n.tokens=o.tokenize(n.code,n.grammar),o.hooks.run("after-tokenize",n),a.stringify(o.util.encode(n.tokens),n.language)},tokenize:function(e,t){var r=t.rest;if(r){for(var n in r)t[n]=r[n];delete t.rest}var c=new l;return s(c,c.head,e),function e(t,r,n,l,c,u){for(var d in n)if(n.hasOwnProperty(d)&&n[d]){var p=n[d];p=Array.isArray(p)?p:[p];for(var f=0;f<p.length;++f){if(u&&u.cause==d+","+f)return;var g=p[f],h=g.inside,m=!!g.lookbehind,v=!!g.greedy,b=g.alias;if(v&&!g.pattern.global){var y=g.pattern.toString().match(/[imsuy]*$/)[0];g.pattern=RegExp(g.pattern.source,y+"g")}for(var x=g.pattern||g,Z=l.next,k=c;Z!==r.tail&&(!u||!(k>=u.reach));k+=Z.value.length,Z=Z.next){var C,$=Z.value;if(r.length>t.length)return;if(!($ instanceof a)){var S=1;if(v){if(!(C=i(x,k,t,m))||C.index>=t.length)break;var w=C.index,I=C.index+C[0].length,O=k;for(O+=Z.value.length;w>=O;)O+=(Z=Z.next).value.length;if(O-=Z.value.length,k=O,Z.value instanceof a)continue;for(var P=Z;P!==r.tail&&(O<I||"string"==typeof P.value);P=P.next)S++,O+=P.value.length;S--,$=t.slice(k,O),C.index-=k}else if(!(C=i(x,0,$,m)))continue;var w=C.index,R=C[0],_=$.slice(0,w),L=$.slice(w+R.length),E=k+$.length;u&&E>u.reach&&(u.reach=E);var A=Z.prev;_&&(A=s(r,A,_),k+=_.length),function(e,t,r){for(var n=t.next,o=0;o<r&&n!==e.tail;o++)n=n.next;t.next=n,n.prev=t,e.length-=o}(r,A,S);var M=new a(d,h?o.tokenize(R,h):R,b,R);if(Z=s(r,A,M),L&&s(r,Z,L),S>1){var z={cause:d+","+f,reach:E};e(t,r,n,Z.prev,k,z),u&&z.reach>u.reach&&(u.reach=z.reach)}}}}}}(e,c,t,c.head,0),function(e){for(var t=[],r=e.head.next;r!==e.tail;)t.push(r.value),r=r.next;return t}(c)},hooks:{all:{},add:function(e,t){var r=o.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){var r=o.hooks.all[e];if(r&&r.length)for(var n,a=0;n=r[a++];)n(t)}},Token:a};function a(e,t,r,n){this.type=e,this.content=t,this.alias=r,this.length=0|(n||"").length}function i(e,t,r,n){e.lastIndex=t;var o=e.exec(r);if(o&&n&&o[1]){var a=o[1].length;o.index+=a,o[0]=o[0].slice(a)}return o}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function s(e,t,r){var n=t.next,o={value:r,prev:t,next:n};return t.next=o,n.prev=o,e.length++,o}if(e.Prism=o,a.stringify=function e(t,r){if("string"==typeof t)return t;if(Array.isArray(t)){var n="";return t.forEach(function(t){n+=e(t,r)}),n}var a={type:t.type,content:e(t.content,r),tag:"span",classes:["token",t.type],attributes:{},language:r},i=t.alias;i&&(Array.isArray(i)?Array.prototype.push.apply(a.classes,i):a.classes.push(i)),o.hooks.run("wrap",a);var l="";for(var s in a.attributes)l+=" "+s+'="'+(a.attributes[s]||"").replace(/"/g,""")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'"'+l+">"+a.content+"</"+a.tag+">"},!e.document)return e.addEventListener&&(o.disableWorkerMessageHandler||e.addEventListener("message",function(t){var r=JSON.parse(t.data),n=r.language,a=r.code,i=r.immediateClose;e.postMessage(o.highlight(a,o.languages[n],n)),i&&e.close()},!1)),o;var c=o.util.currentScript();function u(){o.manual||o.highlightAll()}if(c&&(o.filename=c.src,c.hasAttribute("data-manual")&&(o.manual=!0)),!o.manual){var d=document.readyState;"loading"===d||"interactive"===d&&c&&c.defer?document.addEventListener("DOMContentLoaded",u):window.requestAnimationFrame?window.requestAnimationFrame(u):window.setTimeout(u,16)}return o}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=n),void 0!==r.g&&(r.g.Prism=n)},5341:function(){!function(e){var t=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,n="(?:"+r.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+r.source+")?)",o=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(e,t){return t=(t||"").replace(/m/g,"")+"m",RegExp(/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return n}).replace(/<<value>>/g,function(){return e}),t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return n})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return n}).replace(/<<key>>/g,function(){return"(?:"+o+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(a),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Prism)},3425:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__assign||function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),l=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return l(t,e),t},c=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)0>t.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r};Object.defineProperty(t,"__esModule",{value:!0});var u=s(r(2265)),d="undefined"!=typeof window&&"navigator"in window&&/Win/i.test(navigator.platform),p="undefined"!=typeof window&&"navigator"in window&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),f="npm__react-simple-code-editor__textarea",g="\n/**\n * Reset the text fill color so that placeholder is visible\n */\n.".concat(f,":empty {\n -webkit-text-fill-color: inherit !important;\n}\n\n/**\n * Hack to apply on some CSS on IE10 and IE11\n */\n@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {\n /**\n * IE doesn't support '-webkit-text-fill-color'\n * So we use 'color: transparent' to make the text transparent on IE\n * Unlike other browsers, it doesn't affect caret color in IE\n */\n .").concat(f," {\n color: transparent !important;\n }\n\n .").concat(f,"::selection {\n background-color: #accef7 !important;\n color: transparent !important;\n }\n}\n"),h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={capture:!0},t._recordCurrentState=function(){var e=t._input;if(e){var r=e.value,n=e.selectionStart,o=e.selectionEnd;t._recordChange({value:r,selectionStart:n,selectionEnd:o})}},t._getLines=function(e,t){return e.substring(0,t).split("\n")},t._recordChange=function(e,r){void 0===r&&(r=!1);var n,o,i,l=t._history,s=l.stack,c=l.offset;if(s.length&&c>-1){t._history.stack=s.slice(0,c+1);var u=t._history.stack.length;if(u>100){var d=u-100;t._history.stack=s.slice(d,u),t._history.offset=Math.max(t._history.offset-d,0)}}var p=Date.now();if(r){var f=t._history.stack[t._history.offset];if(f&&p-f.timestamp<3e3){var g=/[^a-z0-9]([a-z0-9]+)$/i,h=null===(n=t._getLines(f.value,f.selectionStart).pop())||void 0===n?void 0:n.match(g),m=null===(o=t._getLines(e.value,e.selectionStart).pop())||void 0===o?void 0:o.match(g);if((null==h?void 0:h[1])&&(null===(i=null==m?void 0:m[1])||void 0===i?void 0:i.startsWith(h[1]))){t._history.stack[t._history.offset]=a(a({},e),{timestamp:p});return}}}t._history.stack.push(a(a({},e),{timestamp:p})),t._history.offset++},t._updateInput=function(e){var r=t._input;r&&(r.value=e.value,r.selectionStart=e.selectionStart,r.selectionEnd=e.selectionEnd,t.props.onValueChange(e.value))},t._applyEdits=function(e){var r=t._input,n=t._history.stack[t._history.offset];n&&r&&(t._history.stack[t._history.offset]=a(a({},n),{selectionStart:r.selectionStart,selectionEnd:r.selectionEnd})),t._recordChange(e),t._updateInput(e)},t._undoEdit=function(){var e=t._history,r=e.offset,n=e.stack[r-1];n&&(t._updateInput(n),t._history.offset=Math.max(r-1,0))},t._redoEdit=function(){var e=t._history,r=e.stack,n=e.offset,o=r[n+1];o&&(t._updateInput(o),t._history.offset=Math.min(n+1,r.length-1))},t._handleKeyDown=function(e){var r=t.props,n=r.tabSize,o=r.insertSpaces,a=r.ignoreTabKey,i=r.onKeyDown;if(!i||(i(e),!e.defaultPrevented)){27===e.keyCode&&e.currentTarget.blur();var l=e.currentTarget,s=l.value,c=l.selectionStart,u=l.selectionEnd,f=(o?" ":" ").repeat(n);if(9===e.keyCode&&!a&&t.state.capture){if(e.preventDefault(),e.shiftKey){var g=t._getLines(s,c),h=g.length-1,m=t._getLines(s,u).length-1,v=s.split("\n").map(function(e,t){return t>=h&&t<=m&&e.startsWith(f)?e.substring(f.length):e}).join("\n");if(s!==v){var b=g[h];t._applyEdits({value:v,selectionStart:(null==b?void 0:b.startsWith(f))?c-f.length:c,selectionEnd:u-(s.length-v.length)})}}else if(c!==u){var g=t._getLines(s,c),y=g.length-1,x=t._getLines(s,u).length-1,b=g[y];t._applyEdits({value:s.split("\n").map(function(e,t){return t>=y&&t<=x?f+e:e}).join("\n"),selectionStart:b&&/\S/.test(b)?c+f.length:c,selectionEnd:u+f.length*(x-y+1)})}else{var Z=c+f.length;t._applyEdits({value:s.substring(0,c)+f+s.substring(u),selectionStart:Z,selectionEnd:Z})}}else if(8===e.keyCode){var k=c!==u;if(s.substring(0,c).endsWith(f)&&!k){e.preventDefault();var Z=c-f.length;t._applyEdits({value:s.substring(0,c-f.length)+s.substring(u),selectionStart:Z,selectionEnd:Z})}}else if(13===e.keyCode){if(c===u){var C=t._getLines(s,c).pop(),$=null==C?void 0:C.match(/^\s+/);if(null==$?void 0:$[0]){e.preventDefault();var S="\n"+$[0],Z=c+S.length;t._applyEdits({value:s.substring(0,c)+S+s.substring(u),selectionStart:Z,selectionEnd:Z})}}}else if(57===e.keyCode||219===e.keyCode||222===e.keyCode||192===e.keyCode){var w=void 0;57===e.keyCode&&e.shiftKey?w=["(",")"]:219===e.keyCode?w=e.shiftKey?["{","}"]:["[","]"]:222===e.keyCode?w=e.shiftKey?['"','"']:["'","'"]:192!==e.keyCode||e.shiftKey||(w=["`","`"]),c!==u&&w&&(e.preventDefault(),t._applyEdits({value:s.substring(0,c)+w[0]+s.substring(c,u)+w[1]+s.substring(u),selectionStart:c,selectionEnd:u+2}))}else(p?e.metaKey&&90===e.keyCode:e.ctrlKey&&90===e.keyCode)&&!e.shiftKey&&!e.altKey?(e.preventDefault(),t._undoEdit()):(p?e.metaKey&&90===e.keyCode&&e.shiftKey:d?e.ctrlKey&&89===e.keyCode:e.ctrlKey&&90===e.keyCode&&e.shiftKey)&&!e.altKey?(e.preventDefault(),t._redoEdit()):77===e.keyCode&&e.ctrlKey&&(!p||e.shiftKey)&&(e.preventDefault(),t.setState(function(e){return{capture:!e.capture}}))}},t._handleChange=function(e){var r=e.currentTarget,n=r.value,o=r.selectionStart,a=r.selectionEnd;t._recordChange({value:n,selectionStart:o,selectionEnd:a},!0),t.props.onValueChange(n)},t._history={stack:[],offset:-1},t._input=null,t}return o(t,e),t.prototype.componentDidMount=function(){this._recordCurrentState()},Object.defineProperty(t.prototype,"session",{get:function(){return{history:this._history}},set:function(e){this._history=e.history},enumerable:!1,configurable:!0}),t.prototype.render=function(){var e=this,t=this.props,r=t.value,n=t.style,o=t.padding,i=t.highlight,l=t.textareaId,s=t.textareaClassName,d=t.autoFocus,p=t.disabled,h=t.form,v=t.maxLength,b=t.minLength,y=t.name,x=t.placeholder,Z=t.readOnly,k=t.required,C=t.onClick,$=t.onFocus,S=t.onBlur,w=t.onKeyUp,I=(t.onKeyDown,t.onValueChange,t.tabSize,t.insertSpaces,t.ignoreTabKey,t.preClassName),O=c(t,["value","style","padding","highlight","textareaId","textareaClassName","autoFocus","disabled","form","maxLength","minLength","name","placeholder","readOnly","required","onClick","onFocus","onBlur","onKeyUp","onKeyDown","onValueChange","tabSize","insertSpaces","ignoreTabKey","preClassName"]),P={paddingTop:"object"==typeof o?o.top:o,paddingRight:"object"==typeof o?o.right:o,paddingBottom:"object"==typeof o?o.bottom:o,paddingLeft:"object"==typeof o?o.left:o},R=i(r);return u.createElement("div",a({},O,{style:a(a({},m.container),n)}),u.createElement("pre",a({className:I,"aria-hidden":"true",style:a(a(a({},m.editor),m.highlight),P)},"string"==typeof R?{dangerouslySetInnerHTML:{__html:R+"<br />"}}:{children:R})),u.createElement("textarea",{ref:function(t){return e._input=t},style:a(a(a({},m.editor),m.textarea),P),className:f+(s?" ".concat(s):""),id:l,value:r,onChange:this._handleChange,onKeyDown:this._handleKeyDown,onClick:C,onKeyUp:w,onFocus:$,onBlur:S,disabled:p,form:h,maxLength:v,minLength:b,name:y,placeholder:x,readOnly:Z,required:k,autoFocus:d,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),u.createElement("style",{dangerouslySetInnerHTML:{__html:g}}))},t.defaultProps={tabSize:2,insertSpaces:!0,ignoreTabKey:!1,padding:0},t}(u.Component);t.default=h;var m={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[756],{984:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.createSvgIcon}});var n=r(3135)},2653:function(e,t,r){"use strict";r.d(t,{Z:function(){return x}});var n=r(791),o=r(3428),i=r(2265),u=r(7042),a=r(5600),c=r(9975),l=r(5843),s=r(7927),f=r(6659),d=r(8702),p=r(6520),v=r(5702);function h(e){return(0,v.Z)("MuiIconButton",e)}let m=(0,p.Z)("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]);var g=r(7437);let Z=["edge","children","className","color","disabled","disableFocusRipple","size"],b=e=>{let{classes:t,disabled:r,color:n,edge:o,size:i}=e,u={root:["root",r&&"disabled","default"!==n&&`color${(0,d.Z)(n)}`,o&&`edge${(0,d.Z)(o)}`,`size${(0,d.Z)(i)}`]};return(0,a.Z)(u,h,t)},y=(0,l.ZP)(f.Z,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:r}=e;return[t.root,"default"!==r.color&&t[`color${(0,d.Z)(r.color)}`],r.edge&&t[`edge${(0,d.Z)(r.edge)}`],t[`size${(0,d.Z)(r.size)}`]]}})(({theme:e,ownerState:t})=>(0,o.Z)({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,c.Fq)(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"start"===t.edge&&{marginLeft:"small"===t.size?-3:-12},"end"===t.edge&&{marginRight:"small"===t.size?-3:-12}),({theme:e,ownerState:t})=>{var r;let n=null==(r=(e.vars||e).palette)?void 0:r[t.color];return(0,o.Z)({},"inherit"===t.color&&{color:"inherit"},"inherit"!==t.color&&"default"!==t.color&&(0,o.Z)({color:null==n?void 0:n.main},!t.disableRipple&&{"&:hover":(0,o.Z)({},n&&{backgroundColor:e.vars?`rgba(${n.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,c.Fq)(n.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),"small"===t.size&&{padding:5,fontSize:e.typography.pxToRem(18)},"large"===t.size&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${m.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),k=i.forwardRef(function(e,t){let r=(0,s.Z)({props:e,name:"MuiIconButton"}),{edge:i=!1,children:a,className:c,color:l="default",disabled:f=!1,disableFocusRipple:d=!1,size:p="medium"}=r,v=(0,n.Z)(r,Z),h=(0,o.Z)({},r,{edge:i,color:l,disabled:f,disableFocusRipple:d,size:p}),m=b(h);return(0,g.jsx)(y,(0,o.Z)({className:(0,u.Z)(m.root,c),centerRipple:!0,focusRipple:!d,disabled:f,ref:t,ownerState:h},v,{children:a}))});var x=k},3457:function(e,t,r){"use strict";r.d(t,{Z:function(){return S}});var n=r(791),o=r(3428),i=r(2265),u=r(7042),a=r(5959),c=r(5600),l=r(5702),s=r(9190),f=r(8153),d=r(3381),p=r(4775),v=r(5425),h=r(7508),m=r(7437);let g=["component","direction","spacing","divider","children","className","useFlexGap"],Z=(0,p.Z)(),b=(0,s.Z)("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function y(e){return(0,f.Z)({props:e,name:"MuiStack",defaultTheme:Z})}let k=e=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],x=({ownerState:e,theme:t})=>{let r=(0,o.Z)({display:"flex",flexDirection:"column"},(0,v.k9)({theme:t},(0,v.P$)({values:e.direction,breakpoints:t.breakpoints.values}),e=>({flexDirection:e})));if(e.spacing){let n=(0,h.hB)(t),o=Object.keys(t.breakpoints.values).reduce((t,r)=>(("object"==typeof e.spacing&&null!=e.spacing[r]||"object"==typeof e.direction&&null!=e.direction[r])&&(t[r]=!0),t),{}),i=(0,v.P$)({values:e.direction,base:o}),u=(0,v.P$)({values:e.spacing,base:o});"object"==typeof i&&Object.keys(i).forEach((e,t,r)=>{let n=i[e];if(!n){let n=t>0?i[r[t-1]]:"column";i[e]=n}}),r=(0,a.Z)(r,(0,v.k9)({theme:t},u,(t,r)=>e.useFlexGap?{gap:(0,h.NA)(n,t)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${k(r?i[r]:e.direction)}`]:(0,h.NA)(n,t)}}))}return(0,v.dt)(t.breakpoints,r)};var T=r(5843),R=r(7927);let w=function(e={}){let{createStyledComponent:t=b,useThemeProps:r=y,componentName:a="MuiStack"}=e,s=()=>(0,c.Z)({root:["root"]},e=>(0,l.Z)(a,e),{}),f=t(x),p=i.forwardRef(function(e,t){let a=r(e),c=(0,d.Z)(a),{component:l="div",direction:p="column",spacing:v=0,divider:h,children:Z,className:b,useFlexGap:y=!1}=c,k=(0,n.Z)(c,g),x=s();return(0,m.jsx)(f,(0,o.Z)({as:l,ownerState:{direction:p,spacing:v,useFlexGap:y},ref:t,className:(0,u.Z)(x.root,b)},k,{children:h?function(e,t){let r=i.Children.toArray(e).filter(Boolean);return r.reduce((e,n,o)=>(e.push(n),o<r.length-1&&e.push(i.cloneElement(t,{key:`separator-${o}`})),e),[])}(Z,h):Z}))});return p}({createStyledComponent:(0,T.ZP)("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>(0,R.Z)({props:e,name:"MuiStack"})});var S=w},3135:function(e,t,r){"use strict";r.r(t),r.d(t,{capitalize:function(){return o.Z},createChainedFunction:function(){return i},createSvgIcon:function(){return u.Z},debounce:function(){return a.Z},deprecatedPropType:function(){return c},isMuiElement:function(){return l.Z},ownerDocument:function(){return s.Z},ownerWindow:function(){return f.Z},requirePropFactory:function(){return d},setRef:function(){return p},unstable_ClassNameGenerator:function(){return k},unstable_useEnhancedEffect:function(){return v.Z},unstable_useId:function(){return h.Z},unsupportedProp:function(){return m},useControlled:function(){return g.Z},useEventCallback:function(){return Z.Z},useForkRef:function(){return b.Z},useIsFocusVisible:function(){return y.Z}});var n=r(5097),o=r(8702),i=r(2940).Z,u=r(9782),a=r(494),c=function(e,t){return()=>null},l=r(673),s=r(3931),f=r(6649);r(3428);var d=function(e,t){return()=>null},p=r(3406).Z,v=r(8519),h=r(419),m=function(e,t,r,n,o){return null},g=r(3292),Z=r(96),b=r(7663),y=r(2143);let k={configure:e=>{n.Z.configure(e)}}},2601:function(e,t,r){"use strict";var n,o;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(o=r.g.process)?void 0:o.env)?r.g.process:r(8960)},8960:function(e){!function(){var t={229:function(e){var t,r,n,o=e.exports={};function i(){throw Error("setTimeout has not been defined")}function u(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}}();var c=[],l=!1,s=-1;function f(){l&&n&&(l=!1,n.length?c=n.concat(c):s=-1,c.length&&d())}function d(){if(!l){var e=a(f);l=!0;for(var t=c.length;t;){for(n=c,c=[];++s<t;)n&&n[s].run();s=-1,t=c.length}n=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new p(e,t)),1!==c.length||l||a(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw Error("process.chdir is not supported")},o.umask=function(){return 0}}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}},u=!0;try{t[e](i,i.exports,n),u=!1}finally{u&&delete r[e]}return i.exports}n.ab="//";var o=n(229);e.exports=o}()},6314:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[808],{5446:function(e,t,a){a.d(t,{u:function(){return m}});var r=a(3428),o=a(791),n=a(2265),i=a(4887),l=a(5137),s=a(8221),d=a(8078),c=a(1091),p=a(7437);let u=["onChange","maxRows","minRows","style","value"];function h(e){return parseInt(e,10)||0}let v={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function g(e){return null==e||0===Object.keys(e).length||0===e.outerHeightStyle&&!e.overflow}let m=n.forwardRef(function(e,t){let{onChange:a,maxRows:m,minRows:b=1,style:x,value:y}=e,f=(0,o.Z)(e,u),{current:S}=n.useRef(null!=y),Z=n.useRef(null),z=(0,l.Z)(t,Z),w=n.useRef(null),C=n.useRef(0),[R,$]=n.useState({outerHeightStyle:0}),I=n.useCallback(()=>{let t=Z.current,a=(0,s.Z)(t),r=a.getComputedStyle(t);if("0px"===r.width)return{outerHeightStyle:0};let o=w.current;o.style.width=r.width,o.value=t.value||e.placeholder||"x","\n"===o.value.slice(-1)&&(o.value+=" ");let n=r.boxSizing,i=h(r.paddingBottom)+h(r.paddingTop),l=h(r.borderBottomWidth)+h(r.borderTopWidth),d=o.scrollHeight;o.value="x";let c=o.scrollHeight,p=d;b&&(p=Math.max(Number(b)*c,p)),m&&(p=Math.min(Number(m)*c,p)),p=Math.max(p,c);let u=p+("border-box"===n?i+l:0),v=1>=Math.abs(p-d);return{outerHeightStyle:u,overflow:v}},[m,b,e.placeholder]),k=(e,t)=>{let{outerHeightStyle:a,overflow:r}=t;return C.current<20&&(a>0&&Math.abs((e.outerHeightStyle||0)-a)>1||e.overflow!==r)?(C.current+=1,{overflow:r,outerHeightStyle:a}):e},B=n.useCallback(()=>{let e=I();g(e)||$(t=>k(t,e))},[I]),M=()=>{let e=I();g(e)||i.flushSync(()=>{$(t=>k(t,e))})};return n.useEffect(()=>{let e;let t=(0,d.Z)(()=>{C.current=0,Z.current&&M()}),a=Z.current,r=(0,s.Z)(a);return r.addEventListener("resize",t),"undefined"!=typeof ResizeObserver&&(e=new ResizeObserver(t)).observe(a),()=>{t.clear(),r.removeEventListener("resize",t),e&&e.disconnect()}}),(0,c.Z)(()=>{B()}),n.useEffect(()=>{C.current=0},[y]),(0,p.jsxs)(n.Fragment,{children:[(0,p.jsx)("textarea",(0,r.Z)({value:y,onChange:e=>{C.current=0,S||B(),a&&a(e)},ref:z,rows:b,style:(0,r.Z)({height:R.outerHeightStyle,overflow:R.overflow?"hidden":void 0},x)},f)),(0,p.jsx)("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:w,tabIndex:-1,style:(0,r.Z)({},v.shadow,x,{paddingTop:0,paddingBottom:0})})]})})},5551:function(e,t,a){a.d(t,{Z:function(){return $}});var r=a(791),o=a(3428),n=a(2265),i=a(7042),l=a(98),s=a(5600),d=a(9975),c=a(5843),p=a(7927),u=a(6659),h=a(8702),v=a(6520),g=a(5702);function m(e){return(0,g.Z)("MuiButton",e)}let b=(0,v.Z)("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),x=n.createContext({});var y=a(7437);let f=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],S=e=>{let{color:t,disableElevation:a,fullWidth:r,size:n,variant:i,classes:l}=e,d={root:["root",i,`${i}${(0,h.Z)(t)}`,`size${(0,h.Z)(n)}`,`${i}Size${(0,h.Z)(n)}`,"inherit"===t&&"colorInherit",a&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${(0,h.Z)(n)}`],endIcon:["endIcon",`iconSize${(0,h.Z)(n)}`]},c=(0,s.Z)(d,m,l);return(0,o.Z)({},l,c)},Z=e=>(0,o.Z)({},"small"===e.size&&{"& > *:nth-of-type(1)":{fontSize:18}},"medium"===e.size&&{"& > *:nth-of-type(1)":{fontSize:20}},"large"===e.size&&{"& > *:nth-of-type(1)":{fontSize:22}}),z=(0,c.ZP)(u.Z,{shouldForwardProp:e=>(0,c.FO)(e)||"classes"===e,name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,t[a.variant],t[`${a.variant}${(0,h.Z)(a.color)}`],t[`size${(0,h.Z)(a.size)}`],t[`${a.variant}Size${(0,h.Z)(a.size)}`],"inherit"===a.color&&t.colorInherit,a.disableElevation&&t.disableElevation,a.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var a,r;let n="light"===e.palette.mode?e.palette.grey[300]:e.palette.grey[800],i="light"===e.palette.mode?e.palette.grey.A100:e.palette.grey[700];return(0,o.Z)({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":(0,o.Z)({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,d.Fq)(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"text"===t.variant&&"inherit"!==t.color&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,d.Fq)(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"outlined"===t.variant&&"inherit"!==t.color&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,d.Fq)(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"contained"===t.variant&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:i,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},"contained"===t.variant&&"inherit"!==t.color&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":(0,o.Z)({},"contained"===t.variant&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${b.focusVisible}`]:(0,o.Z)({},"contained"===t.variant&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${b.disabled}`]:(0,o.Z)({color:(e.vars||e).palette.action.disabled},"outlined"===t.variant&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"contained"===t.variant&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},"text"===t.variant&&{padding:"6px 8px"},"text"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].main},"outlined"===t.variant&&{padding:"5px 15px",border:"1px solid currentColor"},"outlined"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${(0,d.Fq)(e.palette[t.color].main,.5)}`},"contained"===t.variant&&{color:e.vars?e.vars.palette.text.primary:null==(a=(r=e.palette).getContrastText)?void 0:a.call(r,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:n,boxShadow:(e.vars||e).shadows[2]},"contained"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},"inherit"===t.color&&{color:"inherit",borderColor:"currentColor"},"small"===t.size&&"text"===t.variant&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"text"===t.variant&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},"small"===t.size&&"outlined"===t.variant&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"outlined"===t.variant&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},"small"===t.size&&"contained"===t.variant&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"contained"===t.variant&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${b.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${b.disabled}`]:{boxShadow:"none"}}),w=(0,c.ZP)("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.startIcon,t[`iconSize${(0,h.Z)(a.size)}`]]}})(({ownerState:e})=>(0,o.Z)({display:"inherit",marginRight:8,marginLeft:-4},"small"===e.size&&{marginLeft:-2},Z(e))),C=(0,c.ZP)("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.endIcon,t[`iconSize${(0,h.Z)(a.size)}`]]}})(({ownerState:e})=>(0,o.Z)({display:"inherit",marginRight:-4,marginLeft:8},"small"===e.size&&{marginRight:-2},Z(e))),R=n.forwardRef(function(e,t){let a=n.useContext(x),s=(0,l.Z)(a,e),d=(0,p.Z)({props:s,name:"MuiButton"}),{children:c,color:u="primary",component:h="button",className:v,disabled:g=!1,disableElevation:m=!1,disableFocusRipple:b=!1,endIcon:Z,focusVisibleClassName:R,fullWidth:$=!1,size:I="medium",startIcon:k,type:B,variant:M="text"}=d,W=(0,r.Z)(d,f),E=(0,o.Z)({},d,{color:u,component:h,disabled:g,disableElevation:m,disableFocusRipple:b,fullWidth:$,size:I,type:B,variant:M}),N=S(E),T=k&&(0,y.jsx)(w,{className:N.startIcon,ownerState:E,children:k}),O=Z&&(0,y.jsx)(C,{className:N.endIcon,ownerState:E,children:Z});return(0,y.jsxs)(z,(0,o.Z)({ownerState:E,className:(0,i.Z)(a.className,N.root,v),component:h,disabled:g,focusRipple:!b,focusVisibleClassName:(0,i.Z)(N.focusVisible,R),ref:t,type:B},W,{classes:N,children:[T,c,O]}))});var $=R},3226:function(e,t,a){a.d(t,{Z:function(){return z}});var r=a(791),o=a(3428),n=a(2265),i=a(7042),l=a(3381),s=a(5600),d=a(5843),c=a(7927),p=a(8702),u=a(6520),h=a(5702);function v(e){return(0,h.Z)("MuiTypography",e)}(0,u.Z)("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);var g=a(7437);let m=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],b=e=>{let{align:t,gutterBottom:a,noWrap:r,paragraph:o,variant:n,classes:i}=e,l={root:["root",n,"inherit"!==e.align&&`align${(0,p.Z)(t)}`,a&&"gutterBottom",r&&"noWrap",o&&"paragraph"]};return(0,s.Z)(l,v,i)},x=(0,d.ZP)("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:a}=e;return[t.root,a.variant&&t[a.variant],"inherit"!==a.align&&t[`align${(0,p.Z)(a.align)}`],a.noWrap&&t.noWrap,a.gutterBottom&&t.gutterBottom,a.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>(0,o.Z)({margin:0},"inherit"===t.variant&&{font:"inherit"},"inherit"!==t.variant&&e.typography[t.variant],"inherit"!==t.align&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),y={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},f={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},S=e=>f[e]||e,Z=n.forwardRef(function(e,t){let a=(0,c.Z)({props:e,name:"MuiTypography"}),n=S(a.color),s=(0,l.Z)((0,o.Z)({},a,{color:n})),{align:d="inherit",className:p,component:u,gutterBottom:h=!1,noWrap:v=!1,paragraph:f=!1,variant:Z="body1",variantMapping:z=y}=s,w=(0,r.Z)(s,m),C=(0,o.Z)({},s,{align:d,color:n,className:p,component:u,gutterBottom:h,noWrap:v,paragraph:f,variant:Z,variantMapping:z}),R=u||(f?"p":z[Z]||y[Z])||"span",$=b(C);return(0,g.jsx)(x,(0,o.Z)({as:R,ref:t,ownerState:C,className:(0,i.Z)($.root,p)},w))});var z=Z}}]);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[82],{3082:function(e,t,r){"use strict";var s,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,l={};((e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})})(l,{createBrowserSupabaseClient:()=>C,createClientComponentClient:()=>c,createMiddlewareClient:()=>b,createMiddlewareSupabaseClient:()=>I,createPagesBrowserClient:()=>u,createPagesServerClient:()=>y,createRouteHandlerClient:()=>T,createServerActionClient:()=>E,createServerComponentClient:()=>k,createServerSupabaseClient:()=>j}),e.exports=((e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of o(t))a.call(e,r)||void 0===r||i(e,r,{get:()=>t[r],enumerable:!(s=n(t,r))||s.enumerable});return e})(i({},"__esModule",{value:!0}),l);var h=r(9335);function c({supabaseUrl:e="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:t="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02",options:r,cookieOptions:i,isSingleton:n=!0}={}){if(!e||!t)throw Error("either NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY env variables or supabaseUrl and supabaseKey are required!");let o=()=>{var s;return(0,h.createSupabaseClient)(e,t,{...r,global:{...null==r?void 0:r.global,headers:{...null==(s=null==r?void 0:r.global)?void 0:s.headers,"X-Client-Info":"@supabase/auth-helpers-nextjs@0.7.4"}},auth:{storageKey:null==i?void 0:i.name,storage:new h.BrowserCookieAuthStorageAdapter(i)}})};if(n){let e=s??o();return"undefined"==typeof window?e:(s||(s=e),s)}return o()}var u=c,d=r(9335),f=r(8027),p=class extends d.CookieAuthStorageAdapter{constructor(e,t){super(t),this.context=e}getCookie(e){var t;let r=(0,f.splitCookiesString)((null==(t=this.context.res.getHeader("set-cookie"))?void 0:t.toString())??"").map(t=>(0,d.parseCookies)(t)[e]).find(e=>!!e),s=r??this.context.req.cookies[e];return s}setCookie(e,t){this._setCookie(e,t)}deleteCookie(e){this._setCookie(e,"",{maxAge:0})}_setCookie(e,t,r){var s;let i=(0,f.splitCookiesString)((null==(s=this.context.res.getHeader("set-cookie"))?void 0:s.toString())??"").filter(t=>!(e in(0,d.parseCookies)(t))),n=(0,d.serializeCookie)(e,t,{...this.cookieOptions,...r,httpOnly:!1});this.context.res.setHeader("set-cookie",[...i,n])}};function y(e,{supabaseUrl:t="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:r="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02",options:s,cookieOptions:i}={}){var n;if(!t||!r)throw Error("either NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY env variables or supabaseUrl and supabaseKey are required!");return(0,d.createSupabaseClient)(t,r,{...s,global:{...null==s?void 0:s.global,headers:{...null==(n=null==s?void 0:s.global)?void 0:n.headers,"X-Client-Info":"@supabase/auth-helpers-nextjs@0.7.4"}},auth:{storageKey:null==i?void 0:i.name,storage:new p(e,i)}})}var g=r(9335),m=r(8027),v=class extends g.CookieAuthStorageAdapter{constructor(e,t){super(t),this.context=e}getCookie(e){var t;let r=(0,m.splitCookiesString)((null==(t=this.context.res.headers.get("set-cookie"))?void 0:t.toString())??"").map(t=>(0,g.parseCookies)(t)[e]).find(e=>!!e);return r||(0,g.parseCookies)(this.context.req.headers.get("cookie")??"")[e]}setCookie(e,t){this._setCookie(e,t)}deleteCookie(e){this._setCookie(e,"",{maxAge:0})}_setCookie(e,t,r){let s=(0,g.serializeCookie)(e,t,{...this.cookieOptions,...r,httpOnly:!1});this.context.res.headers&&(this.context.res.headers.append("set-cookie",s),this.context.res.headers.append("cookie",s))}};function b(e,{supabaseUrl:t="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:r="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02",options:s,cookieOptions:i}={}){var n;if(!t||!r)throw Error("either NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY env variables or supabaseUrl and supabaseKey are required!");return(0,g.createSupabaseClient)(t,r,{...s,global:{...null==s?void 0:s.global,headers:{...null==(n=null==s?void 0:s.global)?void 0:n.headers,"X-Client-Info":"@supabase/auth-helpers-nextjs@0.7.4"}},auth:{storageKey:null==i?void 0:i.name,storage:new v(e,i)}})}var _=r(9335),w=class extends _.CookieAuthStorageAdapter{constructor(e,t){super(t),this.context=e}getCookie(e){var t;let r=this.context.cookies();return null==(t=r.get(e))?void 0:t.value}setCookie(e,t){}deleteCookie(e){}};function k(e,{supabaseUrl:t="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:r="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02",options:s,cookieOptions:i}={}){var n;if(!t||!r)throw Error("either NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY env variables or supabaseUrl and supabaseKey are required!");return(0,_.createSupabaseClient)(t,r,{...s,global:{...null==s?void 0:s.global,headers:{...null==(n=null==s?void 0:s.global)?void 0:n.headers,"X-Client-Info":"@supabase/auth-helpers-nextjs@0.7.4"}},auth:{storageKey:null==i?void 0:i.name,storage:new w(e,i)}})}var S=r(9335),O=class extends S.CookieAuthStorageAdapter{constructor(e,t){super(t),this.context=e}getCookie(e){var t;let r=this.context.cookies();return null==(t=r.get(e))?void 0:t.value}setCookie(e,t){let r=this.context.cookies();r.set(e,t,this.cookieOptions)}deleteCookie(e){let t=this.context.cookies();t.set(e,"",{maxAge:0})}};function T(e,{supabaseUrl:t="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:r="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02",options:s,cookieOptions:i}={}){var n;if(!t||!r)throw Error("either NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY env variables or supabaseUrl and supabaseKey are required!");return(0,S.createSupabaseClient)(t,r,{...s,global:{...null==s?void 0:s.global,headers:{...null==(n=null==s?void 0:s.global)?void 0:n.headers,"X-Client-Info":"@supabase/auth-helpers-nextjs@0.7.4"}},auth:{storageKey:null==i?void 0:i.name,storage:new O(e,i)}})}var E=T;function C({supabaseUrl:e="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:t="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02",options:r,cookieOptions:s}={}){return console.warn("Please utilize the `createPagesBrowserClient` function instead of the deprecated `createBrowserSupabaseClient` function. Learn more: https://supabase.com/docs/guides/auth/auth-helpers/nextjs-pages"),u({supabaseUrl:e,supabaseKey:t,options:r,cookieOptions:s})}function j(e,{supabaseUrl:t="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:r="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02",options:s,cookieOptions:i}={}){return console.warn("Please utilize the `createPagesServerClient` function instead of the deprecated `createServerSupabaseClient` function. Learn more: https://supabase.com/docs/guides/auth/auth-helpers/nextjs-pages"),y(e,{supabaseUrl:t,supabaseKey:r,options:s,cookieOptions:i})}function I(e,{supabaseUrl:t="https://vhywkeydkitmauabqnwv.supabase.co",supabaseKey:r="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZoeXdrZXlka2l0bWF1YWJxbnd2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2OTI5OTAwMjQsImV4cCI6MjAwODU2NjAyNH0.C02",options:s,cookieOptions:i}={}){return console.warn("Please utilize the `createMiddlewareClient` function instead of the deprecated `createMiddlewareSupabaseClient` function. Learn more: https://supabase.com/docs/guides/auth/auth-helpers/nextjs#middleware"),b(e,{supabaseUrl:t,supabaseKey:r,options:s,cookieOptions:i})}},7992:function(e,t,r){"use strict";var s=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw Error("unable to locate global object")}();e.exports=t=s.fetch,s.fetch&&(t.default=s.fetch.bind(s)),t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response},9366:function(e,t){var r="undefined"!=typeof self?self:this,s=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();(function(e){var t={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};if(t.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(e){return e&&r.indexOf(Object.prototype.toString.call(e))>-1};function n(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw TypeError("Invalid character in header field name");return e.toLowerCase()}function o(e){return"string"!=typeof e&&(e=String(e)),e}function a(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function l(e){this.map={},e instanceof l?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function h(e){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function u(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function d(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e){if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var r;t.arrayBuffer&&t.blob&&(r=e)&&DataView.prototype.isPrototypeOf(r)?(this._bodyArrayBuffer=d(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||i(e))?this._bodyArrayBuffer=d(e):this._bodyText=e=Object.prototype.toString.call(e)}}else this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")},this.arrayBuffer=function(){return this._bodyArrayBuffer?h(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(u)}),this.text=function(){var e,t,r,s=h(this);if(s)return s;if(this._bodyBlob)return e=this._bodyBlob,r=c(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=Array(t.length),s=0;s<t.length;s++)r[s]=String.fromCharCode(t[s]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},t.formData&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(e,t){e=n(e),t=o(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},l.prototype.delete=function(e){delete this.map[n(e)]},l.prototype.get=function(e){return e=n(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(n(e))},l.prototype.set=function(e,t){this.map[n(e)]=o(t)},l.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},l.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),a(e)},l.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),a(e)},l.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),a(e)},t.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(e,t){var r,s,i=(t=t||{}).body;if(e instanceof y){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new l(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new l(t.headers)),this.method=(s=(r=t.method||this.method||"GET").toUpperCase(),p.indexOf(s)>-1?s:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function g(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),s=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(s),decodeURIComponent(i))}}),t}function m(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},f.call(y.prototype),f.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var v=[301,302,303,307,308];m.redirect=function(e,t){if(-1===v.indexOf(t))throw RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},e.DOMException=s.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function b(r,s){return new Promise(function(i,n){var o=new y(r,s);if(o.signal&&o.signal.aborted)return n(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function h(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),s=r.shift().trim();if(s){var i=r.join(":").trim();t.append(s,i)}}),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var s="response"in a?a.response:a.responseText;i(new m(s,r))},a.onerror=function(){n(TypeError("Network request failed"))},a.ontimeout=function(){n(TypeError("Network request failed"))},a.onabort=function(){n(new e.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&t.blob&&(a.responseType="blob"),o.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),o.signal&&(o.signal.addEventListener("abort",h),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",h)}),a.send(void 0===o._bodyInit?null:o._bodyInit)})}b.polyfill=!0,s.fetch||(s.fetch=b,s.Headers=l,s.Request=y,s.Response=m),e.Headers=l,e.Request=y,e.Response=m,e.fetch=b,Object.defineProperty(e,"__esModule",{value:!0})})({}),s.fetch.ponyfill=!0,delete s.fetch.polyfill,(t=s.fetch).default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,e.exports=t},9472:function(e){var t=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{if(!__global__)return t();return __global__}finally{delete Object.prototype.__global__}}()},8027:function(e){"use strict";var t={decodeValues:!0,map:!1,silent:!1};function r(e){return"string"==typeof e&&!!e.trim()}function s(e,s){var i,n,o,a,l=e.split(";").filter(r),h=(i=l.shift(),n="",o="",(a=i.split("=")).length>1?(n=a.shift(),o=a.join("=")):o=i,{name:n,value:o}),c=h.name,u=h.value;s=s?Object.assign({},t,s):t;try{u=s.decodeValues?decodeURIComponent(u):u}catch(e){console.error("set-cookie-parser encountered an error while decoding a cookie with value '"+u+"'. Set options.decodeValues to false to disable this feature.",e)}var d={name:c,value:u};return l.forEach(function(e){var t=e.split("="),r=t.shift().trimLeft().toLowerCase(),s=t.join("=");"expires"===r?d.expires=new Date(s):"max-age"===r?d.maxAge=parseInt(s,10):"secure"===r?d.secure=!0:"httponly"===r?d.httpOnly=!0:"samesite"===r?d.sameSite=s:d[r]=s}),d}function i(e,i){if(i=i?Object.assign({},t,i):t,!e)return i.map?{}:[];if(e.headers){if("function"==typeof e.headers.getSetCookie)e=e.headers.getSetCookie();else if(e.headers["set-cookie"])e=e.headers["set-cookie"];else{var n=e.headers[Object.keys(e.headers).find(function(e){return"set-cookie"===e.toLowerCase()})];n||!e.headers.cookie||i.silent||console.warn("Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."),e=n}}return(Array.isArray(e)||(e=[e]),(i=i?Object.assign({},t,i):t).map)?e.filter(r).reduce(function(e,t){var r=s(t,i);return e[r.name]=r,e},{}):e.filter(r).map(function(e){return s(e,i)})}e.exports=i,e.exports.parse=i,e.exports.parseString=s,e.exports.splitCookiesString=function(e){if(Array.isArray(e))return e;if("string"!=typeof e)return[];var t,r,s,i,n,o=[],a=0;function l(){for(;a<e.length&&/\s/.test(e.charAt(a));)a+=1;return a<e.length}for(;a<e.length;){for(t=a,n=!1;l();)if(","===(r=e.charAt(a))){for(s=a,a+=1,l(),i=a;a<e.length&&"="!==(r=e.charAt(a))&&";"!==r&&","!==r;)a+=1;a<e.length&&"="===e.charAt(a)?(n=!0,a=i,o.push(e.substring(t,s)),t=a):a=s+1}else a+=1;(!n||a>=e.length)&&o.push(e.substring(t,e.length))}return o}},1775:function(e,t,r){if("object"==typeof globalThis)s=globalThis;else try{s=r(9472)}catch(e){}finally{if(s||"undefined"==typeof window||(s=window),!s)throw Error("Could not determine global this")}var s,i=s.WebSocket||s.MozWebSocket,n=r(5506);function o(e,t){return t?new i(e,t):new i(e)}i&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(e){Object.defineProperty(o,e,{get:function(){return i[e]}})}),e.exports={w3cwebsocket:i?o:null,version:n}},5506:function(e,t,r){e.exports=r(2151).version},9335:function(e,t,r){"use strict";r.r(t),r.d(t,{BrowserCookieAuthStorageAdapter:function(){return tq},CookieAuthStorageAdapter:function(){return tz},DEFAULT_COOKIE_OPTIONS:function(){return tM},createSupabaseClient:function(){return tK},isBrowser:function(){return tF},parseCookies:function(){return tH},parseSupabaseCookie:function(){return tJ},serializeCookie:function(){return tX},stringifySupabaseSession:function(){return tB}}),new TextEncoder;let s=new TextDecoder,i=e=>{let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r};var n,o,a,l,h,c,u,d,f,p,y,g,m,v,b,_,w,k,S,O,T,E=crypto;E.getRandomValues.bind(E),Symbol();let C=e=>{let t=e;t instanceof Uint8Array&&(t=s.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return i(t)}catch(e){throw TypeError("The input to be decoded is not correctly encoded.")}},j=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>{var t,s,i,n;return t=void 0,s=void 0,i=void 0,n=function*(){return yield(yield Promise.resolve().then(r.t.bind(r,9366,23))).fetch(...e)},new(i||(i=Promise))(function(e,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof i?r:new i(function(e){e(r)})).then(o,a)}l((n=n.apply(t,s||[])).next())})}:fetch),(...e)=>t(...e)};class I extends Error{constructor(e,t="FunctionsError",r){super(e),this.name=t,this.context=r}}class x extends I{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class A extends I{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class P extends I{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}class ${constructor(e,{headers:t={},customFetch:r}={}){this.url=e,this.headers=t,this.fetch=j(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var r,s,i,n,o;return s=this,i=void 0,n=void 0,o=function*(){try{let s;let{headers:i,method:n,body:o}=t,a={};o&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&("undefined"!=typeof Blob&&o instanceof Blob||o instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",s=o):"string"==typeof o?(a["Content-Type"]="text/plain",s=o):"undefined"!=typeof FormData&&o instanceof FormData?s=o:(a["Content-Type"]="application/json",s=JSON.stringify(o)));let l=yield this.fetch(`${this.url}/${e}`,{method:n||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:s}).catch(e=>{throw new x(e)}),h=l.headers.get("x-relay-error");if(h&&"true"===h)throw new A(l);if(!l.ok)throw new P(l);let c=(null!==(r=l.headers.get("Content-Type"))&&void 0!==r?r:"text/plain").split(";")[0].trim();return{data:"application/json"===c?yield l.json():"application/octet-stream"===c?yield l.blob():"multipart/form-data"===c?yield l.formData():yield l.text(),error:null}}catch(e){return{data:null,error:e}}},new(n||(n=Promise))(function(e,t){function r(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var s;t.done?e(t.value):((s=t.value)instanceof n?s:new n(function(e){e(s)})).then(r,a)}l((o=o.apply(s,i||[])).next())})}}var R=r(7992),U=r.n(R);class L{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:"undefined"==typeof fetch?this.fetch=U():this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}then(e,t){void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),"GET"!==this.method&&"HEAD"!==this.method&&(this.headers["Content-Type"]="application/json");let r=this.fetch,s=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async e=>{var t,r,s;let i=null,n=null,o=null,a=e.status,l=e.statusText;if(e.ok){if("HEAD"!==this.method){let t=await e.text();""===t||(n="text/csv"===this.headers.Accept?t:this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?t:JSON.parse(t))}let s=null===(t=this.headers.Prefer)||void 0===t?void 0:t.match(/count=(exact|planned|estimated)/),h=null===(r=e.headers.get("content-range"))||void 0===r?void 0:r.split("/");s&&h&&h.length>1&&(o=parseInt(h[1])),this.isMaybeSingle&&"GET"===this.method&&Array.isArray(n)&&(n.length>1?(i={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,o=null,a=406,l="Not Acceptable"):n=1===n.length?n[0]:null)}else{let t=await e.text();try{i=JSON.parse(t),Array.isArray(i)&&404===e.status&&(n=[],i=null,a=200,l="OK")}catch(r){404===e.status&&""===t?(a=204,l="No Content"):i={message:t}}if(i&&this.isMaybeSingle&&(null===(s=null==i?void 0:i.details)||void 0===s?void 0:s.includes("Results contain 0 rows"))&&(i=null,a=200,l="OK"),i&&this.shouldThrowOnError)throw i}let h={error:i,data:n,count:o,status:a,statusText:l};return h});return this.shouldThrowOnError||(s=s.catch(e=>{var t,r,s;return{error:{message:`${null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"FetchError"}: ${null==e?void 0:e.message}`,details:`${null!==(r=null==e?void 0:e.stack)&&void 0!==r?r:""}`,hint:"",code:`${null!==(s=null==e?void 0:e.code)&&void 0!==s?s:""}`},data:null,count:null,status:0,statusText:""}})),s.then(e,t)}}class N extends L{select(e){let t=!1,r=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",r),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:s}={}){let i=s?`${s}.order`:"order",n=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${n?`${n},`:""}${e}.${t?"asc":"desc"}${void 0===r?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t}={}){let r=void 0===t?"limit":`${t}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:r}={}){let s=void 0===r?"offset":`${r}.offset`,i=void 0===r?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return"GET"===this.method?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:s=!1,wal:i=!1,format:n="text"}={}){let o=[e?"analyze":null,t?"verbose":null,r?"settings":null,s?"buffers":null,i?"wal":null].filter(Boolean).join("|"),a=this.headers.Accept;return this.headers.Accept=`application/vnd.pgrst.plan+${n}; for="${a}"; options=${o};`,this}rollback(){var e;return(null!==(e=this.headers.Prefer)&&void 0!==e?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}class D extends N{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}in(e,t){let r=t.map(e=>"string"==typeof e&&RegExp("[,()]").test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}contains(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return"string"==typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:s}={}){let i="";"plain"===s?i="pl":"phrase"===s?i="ph":"websearch"===s&&(i="w");let n=void 0===r?"":`(${r})`;return this.url.searchParams.append(e,`${i}fts${n}.${t}`),this}match(e){return Object.entries(e).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t}={}){let r=t?`${t}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}}class J{constructor(e,{headers:t={},schema:r,fetch:s}){this.url=e,this.headers=t,this.schema=r,this.fetch=s}select(e,{head:t=!1,count:r}={}){let s=!1,i=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!s?"":('"'===e&&(s=!s),e)).join("");return this.url.searchParams.set("select",i),r&&(this.headers.Prefer=`count=${r}`),new D({method:t?"HEAD":"GET",url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:t,defaultToNull:r=!0}={}){let s=[];if(this.headers.Prefer&&s.push(this.headers.Prefer),t&&s.push(`count=${t}`),r||s.push("missing=default"),this.headers.Prefer=s.join(","),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);this.url.searchParams.set("columns",e.join(","))}}return new D({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:s,defaultToNull:i=!0}={}){let n=[`resolution=${r?"ignore":"merge"}-duplicates`];if(void 0!==t&&this.url.searchParams.set("on_conflict",t),this.headers.Prefer&&n.push(this.headers.Prefer),s&&n.push(`count=${s}`),i||n.push("missing=default"),this.headers.Prefer=n.join(","),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);this.url.searchParams.set("columns",e.join(","))}}return new D({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:t}={}){let r=[];return this.headers.Prefer&&r.push(this.headers.Prefer),t&&r.push(`count=${t}`),this.headers.Prefer=r.join(","),new D({method:"PATCH",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){let t=[];return e&&t.push(`count=${e}`),this.headers.Prefer&&t.unshift(this.headers.Prefer),this.headers.Prefer=t.join(","),new D({method:"DELETE",url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}let B={"X-Client-Info":"postgrest-js/1.8.4"};class F{constructor(e,{headers:t={},schema:r,fetch:s}={}){this.url=e,this.headers=Object.assign(Object.assign({},B),t),this.schemaName=r,this.fetch=s}from(e){let t=new URL(`${this.url}/${e}`);return new J(t,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new F(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,t={},{head:r=!1,count:s}={}){let i,n;let o=new URL(`${this.url}/rpc/${e}`);r?(i="HEAD",Object.entries(t).forEach(([e,t])=>{o.searchParams.append(e,`${t}`)})):(i="POST",n=t);let a=Object.assign({},this.headers);return s&&(a.Prefer=`count=${s}`),new D({method:i,url:o,headers:a,schema:this.schemaName,body:n,fetch:this.fetch,allowEmpty:!1})}}var M=r(1775);let z={"X-Client-Info":"realtime-js/2.7.4"};(n=g||(g={}))[n.connecting=0]="connecting",n[n.open=1]="open",n[n.closing=2]="closing",n[n.closed=3]="closed",(o=m||(m={})).closed="closed",o.errored="errored",o.joined="joined",o.joining="joining",o.leaving="leaving",(a=v||(v={})).close="phx_close",a.error="phx_error",a.join="phx_join",a.reply="phx_reply",a.leave="phx_leave",a.access_token="access_token",(b||(b={})).websocket="websocket",(l=_||(_={})).Connecting="connecting",l.Open="open",l.Closing="closing",l.Closed="closed";class q{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}class K{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):"string"==typeof e?t(JSON.parse(e)):t({})}_binaryDecode(e){let t=new DataView(e),r=new TextDecoder;return this._decodeBroadcast(e,t,r)}_decodeBroadcast(e,t,r){let s=t.getUint8(1),i=t.getUint8(2),n=this.HEADER_LENGTH+2,o=r.decode(e.slice(n,n+s));n+=s;let a=r.decode(e.slice(n,n+i));n+=i;let l=JSON.parse(r.decode(e.slice(n,e.byteLength)));return{ref:null,topic:o,event:a,payload:l}}}class H{constructor(e,t,r={},s=1e4){this.channel=e,this.event=t,this.payload=r,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null,this.rateLimited=!1}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){if(this._hasReceived("timeout"))return;this.startTimeout(),this.sent=!0;let e=this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()});"rate limited"===e&&(this.rateLimited=!0)}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var r;return this._hasReceived(e)&&t(null===(r=this.receivedResp)||void 0===r?void 0:r.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){this.timeoutTimer||(this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref),this.channel._on(this.refEvent,{},e=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=e,this._matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout))}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(t=>t.status===e).forEach(e=>e.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}(h=w||(w={})).SYNC="sync",h.JOIN="join",h.LEAVE="leave";class X{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};let r=(null==t?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},e=>{let{onJoin:t,onLeave:r,onSync:s}=this.caller;this.joinRef=this.channel._joinRef(),this.state=X.syncState(this.state,e,t,r),this.pendingDiffs.forEach(e=>{this.state=X.syncDiff(this.state,e,t,r)}),this.pendingDiffs=[],s()}),this.channel._on(r.diff,{},e=>{let{onJoin:t,onLeave:r,onSync:s}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(e):(this.state=X.syncDiff(this.state,e,t,r),s())}),this.onJoin((e,t,r)=>{this.channel._trigger("presence",{event:"join",key:e,currentPresences:t,newPresences:r})}),this.onLeave((e,t,r)=>{this.channel._trigger("presence",{event:"leave",key:e,currentPresences:t,leftPresences:r})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,r,s){let i=this.cloneDeep(e),n=this.transformState(t),o={},a={};return this.map(i,(e,t)=>{n[e]||(a[e]=t)}),this.map(n,(e,t)=>{let r=i[e];if(r){let s=t.map(e=>e.presence_ref),i=r.map(e=>e.presence_ref),n=t.filter(e=>0>i.indexOf(e.presence_ref)),l=r.filter(e=>0>s.indexOf(e.presence_ref));n.length>0&&(o[e]=n),l.length>0&&(a[e]=l)}else o[e]=t}),this.syncDiff(i,{joins:o,leaves:a},r,s)}static syncDiff(e,t,r,s){let{joins:i,leaves:n}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return r||(r=()=>{}),s||(s=()=>{}),this.map(i,(t,s)=>{var i;let n=null!==(i=e[t])&&void 0!==i?i:[];if(e[t]=this.cloneDeep(s),n.length>0){let r=e[t].map(e=>e.presence_ref),s=n.filter(e=>0>r.indexOf(e.presence_ref));e[t].unshift(...s)}r(t,n,s)}),this.map(n,(t,r)=>{let i=e[t];if(!i)return;let n=r.map(e=>e.presence_ref);i=i.filter(e=>0>n.indexOf(e.presence_ref)),e[t]=i,s(t,i,r),0===i.length&&delete e[t]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(r=>t(r,e[r]))}static transformState(e){return Object.getOwnPropertyNames(e=this.cloneDeep(e)).reduce((t,r)=>{let s=e[r];return"metas"in s?t[r]=s.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e)):t[r]=s,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}(c=k||(k={})).abstime="abstime",c.bool="bool",c.date="date",c.daterange="daterange",c.float4="float4",c.float8="float8",c.int2="int2",c.int4="int4",c.int4range="int4range",c.int8="int8",c.int8range="int8range",c.json="json",c.jsonb="jsonb",c.money="money",c.numeric="numeric",c.oid="oid",c.reltime="reltime",c.text="text",c.time="time",c.timestamp="timestamp",c.timestamptz="timestamptz",c.timetz="timetz",c.tsrange="tsrange",c.tstzrange="tstzrange";let G=(e,t,r={})=>{var s;let i=null!==(s=r.skipTypes)&&void 0!==s?s:[];return Object.keys(t).reduce((r,s)=>(r[s]=V(s,e,t,i),r),{})},V=(e,t,r,s)=>{let i=t.find(t=>t.name===e),n=null==i?void 0:i.type,o=r[e];return n&&!s.includes(n)?Z(n,o):Y(o)},Z=(e,t)=>{if("_"===e.charAt(0)){let r=e.slice(1,e.length);return et(t,r)}switch(e){case k.bool:return W(t);case k.float4:case k.float8:case k.int2:case k.int4:case k.int8:case k.numeric:case k.oid:return Q(t);case k.json:case k.jsonb:return ee(t);case k.timestamp:return er(t);case k.abstime:case k.date:case k.daterange:case k.int4range:case k.int8range:case k.money:case k.reltime:case k.text:case k.time:case k.timestamptz:case k.timetz:case k.tsrange:case k.tstzrange:default:return Y(t)}},Y=e=>e,W=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},Q=e=>{if("string"==typeof e){let t=parseFloat(e);if(!Number.isNaN(t))return t}return e},ee=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){console.log(`JSON parse error: ${e}`)}return e},et=(e,t)=>{if("string"!=typeof e)return e;let r=e.length-1,s=e[r],i=e[0];if("{"===i&&"}"===s){let s;let i=e.slice(1,r);try{s=JSON.parse("["+i+"]")}catch(e){s=i?i.split(","):[]}return s.map(e=>Z(t,e))}return e},er=e=>"string"==typeof e?e.replace(" ","T"):e;var es=function(e,t,r,s){return new(r||(r=Promise))(function(i,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})};(u=S||(S={})).ALL="*",u.INSERT="INSERT",u.UPDATE="UPDATE",u.DELETE="DELETE",(d=O||(O={})).BROADCAST="broadcast",d.PRESENCE="presence",d.POSTGRES_CHANGES="postgres_changes",(f=T||(T={})).SUBSCRIBED="SUBSCRIBED",f.TIMED_OUT="TIMED_OUT",f.CLOSED="CLOSED",f.CHANNEL_ERROR="CHANNEL_ERROR";class ei{constructor(e,t={config:{}},r){this.topic=e,this.params=t,this.socket=r,this.bindings={},this.state=m.closed,this.joinedOnce=!1,this.pushBuffer=[],this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""}},t.config),this.timeout=this.socket.timeout,this.joinPush=new H(this,v.join,this.params,this.timeout),this.rejoinTimer=new q(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=m.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=m.closed,this.socket._remove(this)}),this._onError(e=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,e),this.state=m.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=m.errored,this.rejoinTimer.scheduleTimeout())}),this._on(v.reply,{},(e,t)=>{this._trigger(this._replyEventName(t),e)}),this.presence=new X(this)}subscribe(e,t=this.timeout){var r,s;if(this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{let{config:{broadcast:i,presence:n}}=this.params;this._onError(t=>e&&e("CHANNEL_ERROR",t)),this._onClose(()=>e&&e("CLOSED"));let o={},a={broadcast:i,presence:n,postgres_changes:null!==(s=null===(r=this.bindings.postgres_changes)||void 0===r?void 0:r.map(e=>e.filter))&&void 0!==s?s:[]};this.socket.accessToken&&(o.access_token=this.socket.accessToken),this.updateJoinPayload(Object.assign({config:a},o)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",({postgres_changes:t})=>{var r;if(this.socket.accessToken&&this.socket.setAuth(this.socket.accessToken),void 0===t){e&&e("SUBSCRIBED");return}{let s=this.bindings.postgres_changes,i=null!==(r=null==s?void 0:s.length)&&void 0!==r?r:0,n=[];for(let r=0;r<i;r++){let i=s[r],{filter:{event:o,schema:a,table:l,filter:h}}=i,c=t&&t[r];if(c&&c.event===o&&c.schema===a&&c.table===l&&c.filter===h)n.push(Object.assign(Object.assign({},i),{id:c.id}));else{this.unsubscribe(),e&&e("CHANNEL_ERROR",Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=n,e&&e("SUBSCRIBED");return}}).receive("error",t=>{e&&e("CHANNEL_ERROR",Error(JSON.stringify(Object.values(t).join(", ")||"error")))}).receive("timeout",()=>{e&&e("TIMED_OUT")})}return this}presenceState(){return this.presence.state}track(e,t={}){return es(this,void 0,void 0,function*(){return yield this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)})}untrack(e={}){return es(this,void 0,void 0,function*(){return yield this.send({type:"presence",event:"untrack"},e)})}on(e,t,r){return this._on(e,t,r)}send(e,t={}){return new Promise(r=>{var s,i,n;let o=this._push(e.type,e,t.timeout||this.timeout);o.rateLimited&&r("rate limited"),"broadcast"!==e.type||(null===(n=null===(i=null===(s=this.params)||void 0===s?void 0:s.config)||void 0===i?void 0:i.broadcast)||void 0===n?void 0:n.ack)||r("ok"),o.receive("ok",()=>r("ok")),o.receive("timeout",()=>r("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=m.leaving;let t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(v.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(r=>{let s=new H(this,v.leave,{},e);s.receive("ok",()=>{t(),r("ok")}).receive("timeout",()=>{t(),r("timed out")}).receive("error",()=>{r("error")}),s.send(),this._canPush()||s.trigger("ok",{})})}_push(e,t,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new H(this,e,t,r);return this._canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}_onMessage(e,t,r){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,r){var s,i;let n=e.toLocaleLowerCase(),{close:o,error:a,leave:l,join:h}=v;if(r&&[o,a,l,h].indexOf(n)>=0&&r!==this._joinRef())return;let c=this._onMessage(n,t,r);if(t&&!c)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(n)?null===(s=this.bindings.postgres_changes)||void 0===s||s.filter(e=>{var t,r,s;return(null===(t=e.filter)||void 0===t?void 0:t.event)==="*"||(null===(s=null===(r=e.filter)||void 0===r?void 0:r.event)||void 0===s?void 0:s.toLocaleLowerCase())===n}).map(e=>e.callback(c,r)):null===(i=this.bindings[n])||void 0===i||i.filter(e=>{var r,s,i,o,a,l;if(!["broadcast","presence","postgres_changes"].includes(n))return e.type.toLocaleLowerCase()===n;if("id"in e){let n=e.id,o=null===(r=e.filter)||void 0===r?void 0:r.event;return n&&(null===(s=t.ids)||void 0===s?void 0:s.includes(n))&&("*"===o||(null==o?void 0:o.toLocaleLowerCase())===(null===(i=t.data)||void 0===i?void 0:i.type.toLocaleLowerCase()))}{let r=null===(a=null===(o=null==e?void 0:e.filter)||void 0===o?void 0:o.event)||void 0===a?void 0:a.toLocaleLowerCase();return"*"===r||r===(null===(l=null==t?void 0:t.event)||void 0===l?void 0:l.toLocaleLowerCase())}}).map(e=>{if("object"==typeof c&&"ids"in c){let e=c.data,{schema:t,table:r,commit_timestamp:s,type:i,errors:n}=e;c=Object.assign(Object.assign({},{schema:t,table:r,commit_timestamp:s,eventType:i,new:{},old:{},errors:n}),this._getPayloadRecords(e))}e.callback(c,r)})}_isClosed(){return this.state===m.closed}_isJoined(){return this.state===m.joined}_isJoining(){return this.state===m.joining}_isLeaving(){return this.state===m.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,r){let s=e.toLocaleLowerCase(),i={type:s,filter:t,callback:r};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],this}_off(e,t){let r=e.toLocaleLowerCase();return this.bindings[r]=this.bindings[r].filter(e=>{var s;return!((null===(s=e.type)||void 0===s?void 0:s.toLocaleLowerCase())===r&&ei.isEqual(e.filter,t))}),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(v.close,{},e)}_onError(e){this._on(v.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=m.joining,this.joinPush.resend(e))}_getPayloadRecords(e){let t={new:{},old:{}};return("INSERT"===e.type||"UPDATE"===e.type)&&(t.new=G(e.columns,e.record)),("UPDATE"===e.type||"DELETE"===e.type)&&(t.old=G(e.columns,e.old_record)),t}}var en=function(e,t,r,s){return new(r||(r=Promise))(function(i,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})};let eo=()=>{};class ea{constructor(e,t){var r,s;this.accessToken=null,this.channels=[],this.endPoint="",this.headers=z,this.params={},this.timeout=1e4,this.transport=M.w3cwebsocket,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=eo,this.conn=null,this.sendBuffer=[],this.serializer=new K,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.eventsPerSecondLimitMs=100,this.inThrottle=!1,this.endPoint=`${e}/${b.websocket}`,(null==t?void 0:t.params)&&(this.params=t.params),(null==t?void 0:t.headers)&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),(null==t?void 0:t.timeout)&&(this.timeout=t.timeout),(null==t?void 0:t.logger)&&(this.logger=t.logger),(null==t?void 0:t.transport)&&(this.transport=t.transport),(null==t?void 0:t.heartbeatIntervalMs)&&(this.heartbeatIntervalMs=t.heartbeatIntervalMs);let i=null===(r=null==t?void 0:t.params)||void 0===r?void 0:r.eventsPerSecond;i&&(this.eventsPerSecondLimitMs=Math.floor(1e3/i));let n=null===(s=null==t?void 0:t.params)||void 0===s?void 0:s.apikey;n&&(this.accessToken=n),this.reconnectAfterMs=(null==t?void 0:t.reconnectAfterMs)?t.reconnectAfterMs:e=>[1e3,2e3,5e3,1e4][e-1]||1e4,this.encode=(null==t?void 0:t.encode)?t.encode:(e,t)=>t(JSON.stringify(e)),this.decode=(null==t?void 0:t.decode)?t.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new q(()=>en(this,void 0,void 0,function*(){this.disconnect(),this.connect()}),this.reconnectAfterMs)}connect(){!this.conn&&(this.conn=new this.transport(this._endPointURL(),[],null,this.headers),this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e)))}disconnect(e,t){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,null!=t?t:""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}removeChannel(e){return en(this,void 0,void 0,function*(){let t=yield e.unsubscribe();return 0===this.channels.length&&this.disconnect(),t})}removeAllChannels(){return en(this,void 0,void 0,function*(){let e=yield Promise.all(this.channels.map(e=>e.unsubscribe()));return this.disconnect(),e})}log(e,t,r){this.logger(e,t,r)}connectionState(){switch(this.conn&&this.conn.readyState){case g.connecting:return _.Connecting;case g.open:return _.Open;case g.closing:return _.Closing;default:return _.Closed}}isConnected(){return this.connectionState()===_.Open}channel(e,t={config:{}}){this.isConnected()||this.connect();let r=new ei(`realtime:${e}`,t,this);return this.channels.push(r),r}push(e){let{topic:t,event:r,payload:s,ref:i}=e,n=()=>{this.encode(e,e=>{var t;null===(t=this.conn)||void 0===t||t.send(e)})};if(this.log("push",`${t} ${r} (${i})`,s),this.isConnected()){if(["broadcast","presence","postgres_changes"].includes(r)){let e=this._throttle(n)();if(e)return"rate limited"}else n()}else this.sendBuffer.push(n)}setAuth(e){this.accessToken=e,this.channels.forEach(t=>{e&&t.updateJoinPayload({access_token:e}),t.joinedOnce&&t._isJoined()&&t._push(v.access_token,{access_token:e})})}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(t=>t.topic===e&&(t._isJoined()||t._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t._joinRef()!==e._joinRef())}_endPointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:"1.0.0"}))}_onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:r,payload:s,ref:i}=e;(i&&i===this.pendingHeartbeatRef||r===(null==s?void 0:s.type))&&(this.pendingHeartbeatRef=null),this.log("receive",`${s.status||""} ${t} ${r} ${i&&"("+i+")"||""}`,s),this.channels.filter(e=>e._isMember(t)).forEach(e=>e._trigger(r,s,i)),this.stateChangeCallbacks.message.forEach(t=>t(e))})}_onConnOpen(){this.log("transport",`connected to ${this._endPointURL()}`),this._flushSendBuffer(),this.reconnectTimer.reset(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this._sendHeartbeat(),this.heartbeatIntervalMs),this.stateChangeCallbacks.open.forEach(e=>e())}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(t=>t(e))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(t=>t(e))}_triggerChanError(){this.channels.forEach(e=>e._trigger(v.error))}_appendParams(e,t){if(0===Object.keys(t).length)return e;let r=e.match(/\?/)?"&":"?",s=new URLSearchParams(t);return`${e}${r}${s}`}_flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),null===(e=this.conn)||void 0===e||e.close(1e3,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth(this.accessToken)}}_throttle(e,t=this.eventsPerSecondLimitMs){return()=>!!this.inThrottle||(e(),t>0&&(this.inThrottle=!0,setTimeout(()=>{this.inThrottle=!1},t)),!1)}}class el extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function eh(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}class ec extends el{constructor(e,t){super(e),this.name="StorageApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class eu extends el{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}var ed=function(e,t,r,s){return new(r||(r=Promise))(function(i,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})};let ef=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>ed(void 0,void 0,void 0,function*(){return yield(yield Promise.resolve().then(r.t.bind(r,9366,23))).fetch(...e)}):fetch),(...e)=>t(...e)},ep=()=>ed(void 0,void 0,void 0,function*(){return"undefined"==typeof Response?(yield Promise.resolve().then(r.t.bind(r,9366,23))).Response:Response});var ey=function(e,t,r,s){return new(r||(r=Promise))(function(i,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})};let eg=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),em=(e,t)=>ey(void 0,void 0,void 0,function*(){let r=yield ep();e instanceof r?e.json().then(r=>{t(new ec(eg(r),e.status||500))}).catch(e=>{t(new eu(eg(e),e))}):t(new eu(eg(e),e))}),ev=(e,t,r,s)=>{let i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?i:(i.headers=Object.assign({"Content-Type":"application/json"},null==t?void 0:t.headers),i.body=JSON.stringify(s),Object.assign(Object.assign({},i),r))};function eb(e,t,r,s,i,n){return ey(this,void 0,void 0,function*(){return new Promise((o,a)=>{e(r,ev(t,s,i,n)).then(e=>{if(!e.ok)throw e;return(null==s?void 0:s.noResolveJson)?e:e.json()}).then(e=>o(e)).catch(e=>em(e,a))})})}function e_(e,t,r,s){return ey(this,void 0,void 0,function*(){return eb(e,"GET",t,r,s)})}function ew(e,t,r,s,i){return ey(this,void 0,void 0,function*(){return eb(e,"POST",t,s,i,r)})}function ek(e,t,r,s,i){return ey(this,void 0,void 0,function*(){return eb(e,"DELETE",t,s,i,r)})}var eS=function(e,t,r,s){return new(r||(r=Promise))(function(i,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})};let eO={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},eT={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class eE{constructor(e,t={},r,s){this.url=e,this.headers=t,this.bucketId=r,this.fetch=ef(s)}uploadOrUpdate(e,t,r,s){return eS(this,void 0,void 0,function*(){try{let i;let n=Object.assign(Object.assign({},eT),s),o=Object.assign(Object.assign({},this.headers),"POST"===e&&{"x-upsert":String(n.upsert)});"undefined"!=typeof Blob&&r instanceof Blob?((i=new FormData).append("cacheControl",n.cacheControl),i.append("",r)):"undefined"!=typeof FormData&&r instanceof FormData?(i=r).append("cacheControl",n.cacheControl):(i=r,o["cache-control"]=`max-age=${n.cacheControl}`,o["content-type"]=n.contentType);let a=this._removeEmptyFolders(t),l=this._getFinalPath(a),h=yield this.fetch(`${this.url}/object/${l}`,Object.assign({method:e,body:i,headers:o},(null==n?void 0:n.duplex)?{duplex:n.duplex}:{}));if(h.ok)return{data:{path:a},error:null};{let e=yield h.json();return{data:null,error:e}}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}upload(e,t,r){return eS(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,r)})}uploadToSignedUrl(e,t,r,s){return eS(this,void 0,void 0,function*(){let i=this._removeEmptyFolders(e),n=this._getFinalPath(i),o=new URL(this.url+`/object/upload/sign/${n}`);o.searchParams.set("token",t);try{let e;let t=Object.assign({upsert:eT.upsert},s),n=Object.assign(Object.assign({},this.headers),{"x-upsert":String(t.upsert)});"undefined"!=typeof Blob&&r instanceof Blob?((e=new FormData).append("cacheControl",t.cacheControl),e.append("",r)):"undefined"!=typeof FormData&&r instanceof FormData?(e=r).append("cacheControl",t.cacheControl):(e=r,n["cache-control"]=`max-age=${t.cacheControl}`,n["content-type"]=t.contentType);let a=yield this.fetch(o.toString(),{method:"PUT",body:e,headers:n});if(a.ok)return{data:{path:i},error:null};{let e=yield a.json();return{data:null,error:e}}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}createSignedUploadUrl(e){return eS(this,void 0,void 0,function*(){try{let t=this._getFinalPath(e),r=yield ew(this.fetch,`${this.url}/object/upload/sign/${t}`,{},{headers:this.headers}),s=new URL(this.url+r.url),i=s.searchParams.get("token");if(!i)throw new el("No token returned by API");return{data:{signedUrl:s.toString(),path:e,token:i},error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}update(e,t,r){return eS(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,r)})}move(e,t){return eS(this,void 0,void 0,function*(){try{let r=yield ew(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers});return{data:r,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}copy(e,t){return eS(this,void 0,void 0,function*(){try{let r=yield ew(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers});return{data:{path:r.Key},error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}createSignedUrl(e,t,r){return eS(this,void 0,void 0,function*(){try{let s=this._getFinalPath(e),i=yield ew(this.fetch,`${this.url}/object/sign/${s}`,Object.assign({expiresIn:t},(null==r?void 0:r.transform)?{transform:r.transform}:{}),{headers:this.headers}),n=(null==r?void 0:r.download)?`&download=${!0===r.download?"":r.download}`:"",o=encodeURI(`${this.url}${i.signedURL}${n}`);return{data:i={signedUrl:o},error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}createSignedUrls(e,t,r){return eS(this,void 0,void 0,function*(){try{let s=yield ew(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),i=(null==r?void 0:r.download)?`&download=${!0===r.download?"":r.download}`:"";return{data:s.map(e=>Object.assign(Object.assign({},e),{signedUrl:e.signedURL?encodeURI(`${this.url}${e.signedURL}${i}`):null})),error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}download(e,t){return eS(this,void 0,void 0,function*(){let r=void 0!==(null==t?void 0:t.transform),s=this.transformOptsToQueryString((null==t?void 0:t.transform)||{}),i=s?`?${s}`:"";try{let t=this._getFinalPath(e),s=yield e_(this.fetch,`${this.url}/${r?"render/image/authenticated":"object"}/${t}${i}`,{headers:this.headers,noResolveJson:!0}),n=yield s.blob();return{data:n,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}getPublicUrl(e,t){let r=this._getFinalPath(e),s=[],i=(null==t?void 0:t.download)?`download=${!0===t.download?"":t.download}`:"";""!==i&&s.push(i);let n=void 0!==(null==t?void 0:t.transform),o=this.transformOptsToQueryString((null==t?void 0:t.transform)||{});""!==o&&s.push(o);let a=s.join("&");return""!==a&&(a=`?${a}`),{data:{publicUrl:encodeURI(`${this.url}/${n?"render/image":"object"}/public/${r}${a}`)}}}remove(e){return eS(this,void 0,void 0,function*(){try{let t=yield ek(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers});return{data:t,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}list(e,t,r){return eS(this,void 0,void 0,function*(){try{let s=Object.assign(Object.assign(Object.assign({},eO),t),{prefix:e||""}),i=yield ew(this.fetch,`${this.url}/object/list/${this.bucketId}`,s,{headers:this.headers},r);return{data:i,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}}let eC={"X-Client-Info":"storage-js/2.5.3"};var ej=function(e,t,r,s){return new(r||(r=Promise))(function(i,n){function o(e){try{l(s.next(e))}catch(e){n(e)}}function a(e){try{l(s.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})};class eI{constructor(e,t={},r){this.url=e,this.headers=Object.assign(Object.assign({},eC),t),this.fetch=ef(r)}listBuckets(){return ej(this,void 0,void 0,function*(){try{let e=yield e_(this.fetch,`${this.url}/bucket`,{headers:this.headers});return{data:e,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}getBucket(e){return ej(this,void 0,void 0,function*(){try{let t=yield e_(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers});return{data:t,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}createBucket(e,t={public:!1}){return ej(this,void 0,void 0,function*(){try{let r=yield ew(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers});return{data:r,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}updateBucket(e,t){return ej(this,void 0,void 0,function*(){try{let r=yield function(e,t,r,s,i){return ey(this,void 0,void 0,function*(){return eb(e,"PUT",t,s,void 0,r)})}(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers});return{data:r,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}emptyBucket(e){return ej(this,void 0,void 0,function*(){try{let t=yield ew(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers});return{data:t,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}deleteBucket(e){return ej(this,void 0,void 0,function*(){try{let t=yield ek(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers});return{data:t,error:null}}catch(e){if(eh(e))return{data:null,error:e};throw e}})}}class ex extends eI{constructor(e,t={},r){super(e,t,r)}from(e){return new eE(this.url,this.headers,e,this.fetch)}}var eA=r(9366),eP=r.n(eA);let e$=e=>{let t;return t=e||("undefined"==typeof fetch?eP():fetch),(...e)=>t(...e)},eR=()=>"undefined"==typeof Headers?eA.Headers:Headers,eU=(e,t,r)=>{let s=e$(r),i=eR();return(r,n)=>{var o,a,l,h;return o=void 0,a=void 0,l=void 0,h=function*(){var o;let a=null!==(o=yield t())&&void 0!==o?o:e,l=new i(null==n?void 0:n.headers);return l.has("apikey")||l.set("apikey",e),l.has("Authorization")||l.set("Authorization",`Bearer ${a}`),s(r,Object.assign(Object.assign({},n),{headers:l}))},new(l||(l=Promise))(function(e,t){function r(e){try{i(h.next(e))}catch(e){t(e)}}function s(e){try{i(h.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):((i=t.value)instanceof l?i:new l(function(e){e(i)})).then(r,s)}i((h=h.apply(o,a||[])).next())})}},eL=()=>"undefined"!=typeof document,eN={tested:!1,writable:!1},eD=()=>{if(!eL())return!1;try{if("object"!=typeof globalThis.localStorage)return!1}catch(e){return!1}if(eN.tested)return eN.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),eN.tested=!0,eN.writable=!0}catch(e){eN.tested=!0,eN.writable=!1}return eN.writable};function eJ(e){let t={},r=new URL(e);if(r.hash&&"#"===r.hash[0])try{let e=new URLSearchParams(r.hash.substring(1));e.forEach((e,r)=>{t[r]=e})}catch(e){}return r.searchParams.forEach((e,r)=>{t[r]=e}),t}let eB=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>Promise.resolve().then(r.t.bind(r,7992,23)).then(({default:t})=>t(...e)):fetch),(...e)=>t(...e)},eF=e=>"object"==typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"==typeof e.json,eM=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},ez=async(e,t)=>{let r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch(e){return r}},eq=async(e,t)=>{await e.removeItem(t)};class eK{constructor(){this.promise=new eK.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function eH(e){let t=e.split(".");if(3!==t.length)throw Error("JWT is not valid: not a JWT structure");if(!/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i.test(t[1]))throw Error("JWT is not valid: payload is not in base64url format");let r=t[1];return JSON.parse(function(e){let t,r,s,i,n,o,a;let l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",h="",c=0;for(e=e.replace("-","+").replace("_","/");c<e.length;)i=l.indexOf(e.charAt(c++)),n=l.indexOf(e.charAt(c++)),o=l.indexOf(e.charAt(c++)),a=l.indexOf(e.charAt(c++)),t=i<<2|n>>4,r=(15&n)<<4|o>>2,s=(3&o)<<6|a,h+=String.fromCharCode(t),64!=o&&0!=r&&(h+=String.fromCharCode(r)),64!=a&&0!=s&&(h+=String.fromCharCode(s));return h}(r))}async function eX(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function eG(e){return("0"+e.toString(16)).substr(-2)}function eV(){let e=new Uint32Array(56);if("undefined"==typeof crypto){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=e.length,r="";for(let s=0;s<56;s++)r+=e.charAt(Math.floor(Math.random()*t));return r}return crypto.getRandomValues(e),Array.from(e,eG).join("")}async function eZ(e){let t=new TextEncoder,r=t.encode(e),s=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(s);return Array.from(i).map(e=>String.fromCharCode(e)).join("")}async function eY(e){if("undefined"==typeof crypto)return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;let t=await eZ(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}eK.promiseConstructor=Promise;class eW extends Error{constructor(e,t){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t}}function eQ(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class e0 extends eW{constructor(e,t){super(e,t),this.name="AuthApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class e1 extends eW{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class e2 extends eW{constructor(e,t,r){super(e),this.name=t,this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class e3 extends e2{constructor(){super("Auth session missing!","AuthSessionMissingError",400)}}class e6 extends e2{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500)}}class e4 extends e2{constructor(e){super(e,"AuthInvalidCredentialsError",400)}}class e5 extends e2{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class e9 extends e2{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class e8 extends e2{constructor(e,t){super(e,"AuthRetryableFetchError",t)}}function e7(e){return eQ(e)&&"AuthRetryableFetchError"===e.name}var te=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&0>t.indexOf(s)&&(r[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)0>t.indexOf(s[i])&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(r[s[i]]=e[s[i]]);return r};let tt=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),tr=[502,503,504];async function ts(e){let t;if(!eF(e))throw new e8(tt(e),0);if(tr.includes(e.status))throw new e8(tt(e),e.status);try{t=await e.json()}catch(e){throw new e1(tt(e),e)}throw new e0(tt(t),e.status||500)}let ti=(e,t,r,s)=>{let i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==t?void 0:t.headers),i.body=JSON.stringify(s),Object.assign(Object.assign({},i),r))};async function tn(e,t,r,s){var i;let n=Object.assign({},null==s?void 0:s.headers);(null==s?void 0:s.jwt)&&(n.Authorization=`Bearer ${s.jwt}`);let o=null!==(i=null==s?void 0:s.query)&&void 0!==i?i:{};(null==s?void 0:s.redirectTo)&&(o.redirect_to=s.redirectTo);let a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await to(e,t,r+a,{headers:n,noResolveJson:null==s?void 0:s.noResolveJson},{},null==s?void 0:s.body);return(null==s?void 0:s.xform)?null==s?void 0:s.xform(l):{data:Object.assign({},l),error:null}}async function to(e,t,r,s,i,n){let o;let a=ti(t,s,i,n);try{o=await e(r,a)}catch(e){throw console.error(e),new e8(tt(e),0)}if(o.ok||await ts(o),null==s?void 0:s.noResolveJson)return o;try{return await o.json()}catch(e){await ts(e)}}function ta(e){var t;let r=null;e.access_token&&e.refresh_token&&e.expires_in&&(r=Object.assign({},e),e.expires_at||(r.expires_at=function(e){let t=Math.round(Date.now()/1e3);return t+e}(e.expires_in)));let s=null!==(t=e.user)&&void 0!==t?t:e;return{data:{session:r,user:s},error:null}}function tl(e){var t;let r=null!==(t=e.user)&&void 0!==t?t:e;return{data:{user:r},error:null}}function th(e){return{data:e,error:null}}function tc(e){let{action_link:t,email_otp:r,hashed_token:s,redirect_to:i,verification_type:n}=e,o=te(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a=Object.assign({},o);return{data:{properties:{action_link:t,email_otp:r,hashed_token:s,redirect_to:i,verification_type:n},user:a},error:null}}function tu(e){return e}var td=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&0>t.indexOf(s)&&(r[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,s=Object.getOwnPropertySymbols(e);i<s.length;i++)0>t.indexOf(s[i])&&Object.prototype.propertyIsEnumerable.call(e,s[i])&&(r[s[i]]=e[s[i]]);return r};class tf{constructor({url:e="",headers:t={},fetch:r}){this.url=e,this.headers=t,this.fetch=eB(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,t="global"){try{return await tn(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await tn(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:tl})}catch(e){if(eQ(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,r=td(e,["options"]),s=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(s.new_email=null==r?void 0:r.newEmail,delete s.newEmail),await tn(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:tc,redirectTo:null==t?void 0:t.redirectTo})}catch(e){if(eQ(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await tn(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:tl})}catch(e){if(eQ(e))return{data:{user:null},error:e};throw e}}async listUsers(e){var t,r,s,i,n,o,a;try{let l={nextPage:null,lastPage:0,total:0},h=await tn(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:null!==(r=null===(t=null==e?void 0:e.page)||void 0===t?void 0:t.toString())&&void 0!==r?r:"",per_page:null!==(i=null===(s=null==e?void 0:e.perPage)||void 0===s?void 0:s.toString())&&void 0!==i?i:""},xform:tu});if(h.error)throw h.error;let c=await h.json(),u=null!==(n=h.headers.get("x-total-count"))&&void 0!==n?n:0,d=null!==(a=null===(o=h.headers.get("link"))||void 0===o?void 0:o.split(","))&&void 0!==a?a:[];return d.length>0&&(d.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);l[`${r}Page`]=t}),l.total=parseInt(u)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(e){if(eQ(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){try{return await tn(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:tl})}catch(e){if(eQ(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){try{return await tn(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:tl})}catch(e){if(eQ(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){try{return await tn(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:tl})}catch(e){if(eQ(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){try{let{data:t,error:r}=await tn(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:r}}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async _deleteFactor(e){try{let t=await tn(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers});return{data:t,error:null}}catch(e){if(eQ(e))return{data:null,error:e};throw e}}}let tp="2.51.0",ty={"X-Client-Info":`gotrue-js/${tp}`};var tg={getItem:e=>eD()?globalThis.localStorage.getItem(e):null,setItem:(e,t)=>{eD()&&globalThis.localStorage.setItem(e,t)},removeItem:e=>{eD()&&globalThis.localStorage.removeItem(e)}};globalThis&&eD()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class tm extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}!function(){if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"undefined"!=typeof self&&(self.globalThis=self)}}();let tv={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:ty,flowType:"implicit",debug:!1};async function tb(e,t,r){return await r()}class t_{constructor(e){var t;this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.instanceID=t_.nextInstanceID,t_.nextInstanceID+=1,this.instanceID>0&&eL()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");let r=Object.assign(Object.assign({},tv),e);if(this.logDebugMessages=r.debug,this.inMemorySession=null,this.storageKey=r.storageKey,this.autoRefreshToken=r.autoRefreshToken,this.persistSession=r.persistSession,this.storage=r.storage||tg,this.admin=new tf({url:r.url,headers:r.headers,fetch:r.fetch}),this.url=r.url,this.headers=r.headers,this.fetch=eB(r.fetch),this.lock=r.lock||tb,this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession&&this.storage===tg&&!eD()&&console.warn(`No storage option exists to persist the session, which may result in unexpected behavior when using auth.
|
|
2
|
-
If you want to set persistSession to true, please provide a storage option or you may set persistSession to false to disable this warning.`),eL()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",e)}null===(t=this.broadcastChannel)||void 0===t||t.addEventListener("message",async e=>{this._debug("received broadcast notification from other tab or client",e),await this._notifyAllSubscribers(e.data.event,e.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&console.log(`GoTrueClient@${this.instanceID} (${tp}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise||(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))()),await this.initializePromise}async _initialize(){try{let e=!!eL()&&await this._isPKCEFlow();if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){let{data:t,error:r}=await this._getSessionFromURL(e);if(r)return this._debug("#_initialize()","error detecting session from URL",r),await this._removeSession(),{error:r};let{session:s,redirectType:i}=t;return this._debug("#_initialize()","detected session in URL",s,"redirect type",i),await this._saveSession(s),setTimeout(async()=>{"recovery"===i?await this._notifyAllSubscribers("PASSWORD_RECOVERY",s):await this._notifyAllSubscribers("SIGNED_IN",s)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){if(eQ(e))return{error:e};return{error:new e1("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signUp(e){var t,r,s;try{let i;if(await this._removeSession(),"email"in e){let{email:r,password:s,options:n}=e,o=null,a=null;if("pkce"===this.flowType){let e=eV();await eM(this.storage,`${this.storageKey}-code-verifier`,e),o=await eY(e),a=e===o?"plain":"s256"}i=await tn(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==n?void 0:n.emailRedirectTo,body:{email:r,password:s,data:null!==(t=null==n?void 0:n.data)&&void 0!==t?t:{},gotrue_meta_security:{captcha_token:null==n?void 0:n.captchaToken},code_challenge:o,code_challenge_method:a},xform:ta})}else if("phone"in e){let{phone:t,password:n,options:o}=e;i=await tn(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:n,data:null!==(r=null==o?void 0:o.data)&&void 0!==r?r:{},channel:null!==(s=null==o?void 0:o.channel)&&void 0!==s?s:"sms",gotrue_meta_security:{captcha_token:null==o?void 0:o.captchaToken}},xform:ta})}else throw new e4("You must provide either an email or phone number and a password");let{data:n,error:o}=i;if(o||!n)return{data:{user:null,session:null},error:o};let a=n.session,l=n.user;return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",a)),{data:{user:l,session:a},error:null}}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithPassword(e){try{let t;if(await this._removeSession(),"email"in e){let{email:r,password:s,options:i}=e;t=await tn(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:r,password:s,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:ta})}else if("phone"in e){let{phone:r,password:s,options:i}=e;t=await tn(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:r,password:s,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:ta})}else throw new e4("You must provide either an email or phone number and a password");let{data:r,error:s}=t;if(s)return{data:{user:null,session:null},error:s};if(!r||!r.session||!r.user)return{data:{user:null,session:null},error:new e6};return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:{user:r.user,session:r.session},error:s}}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithOAuth(e){var t,r,s,i;return await this._removeSession(),await this._handleProviderSignIn(e.provider,{redirectTo:null===(t=e.options)||void 0===t?void 0:t.redirectTo,scopes:null===(r=e.options)||void 0===r?void 0:r.scopes,queryParams:null===(s=e.options)||void 0===s?void 0:s.queryParams,skipBrowserRedirect:null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){let t=await ez(this.storage,`${this.storageKey}-code-verifier`),{data:r,error:s}=await tn(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:ta});return(await eq(this.storage,`${this.storageKey}-code-verifier`),s)?{data:{user:null,session:null},error:s}:r&&r.session&&r.user?(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:r,error:s}):{data:{user:null,session:null},error:new e6}}async signInWithIdToken(e){await this._removeSession();try{let{options:t,provider:r,token:s,access_token:i,nonce:n}=e,o=await tn(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:i,nonce:n,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:ta}),{data:a,error:l}=o;if(l)return{data:{user:null,session:null},error:l};if(!a||!a.session||!a.user)return{data:{user:null,session:null},error:new e6};return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),{data:a,error:l}}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithOtp(e){var t,r,s,i,n;try{if(await this._removeSession(),"email"in e){let{email:s,options:i}=e,n=null,o=null;if("pkce"===this.flowType){let e=eV();await eM(this.storage,`${this.storageKey}-code-verifier`,e),n=await eY(e),o=e===n?"plain":"s256"}let{error:a}=await tn(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:s,data:null!==(t=null==i?void 0:i.data)&&void 0!==t?t:{},create_user:null===(r=null==i?void 0:i.shouldCreateUser)||void 0===r||r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:n,code_challenge_method:o},redirectTo:null==i?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:a}}if("phone"in e){let{phone:t,options:r}=e,{data:o,error:a}=await tn(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!==(s=null==r?void 0:r.data)&&void 0!==s?s:{},create_user:null===(i=null==r?void 0:r.shouldCreateUser)||void 0===i||i,gotrue_meta_security:{captcha_token:null==r?void 0:r.captchaToken},channel:null!==(n=null==r?void 0:r.channel)&&void 0!==n?n:"sms"}});return{data:{user:null,session:null,messageId:null==o?void 0:o.message_id},error:a}}throw new e4("You must provide either an email or phone number.")}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async verifyOtp(e){var t,r;try{let s,i;"email_change"!==e.type&&"phone_change"!==e.type&&await this._removeSession(),"options"in e&&(s=null===(t=e.options)||void 0===t?void 0:t.redirectTo,i=null===(r=e.options)||void 0===r?void 0:r.captchaToken);let{data:n,error:o}=await tn(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:ta});if(o)throw o;if(!n)throw Error("An error occurred on token verification.");let a=n.session,l=n.user;return(null==a?void 0:a.access_token)&&(await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)),{data:{user:l,session:a},error:null}}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithSSO(e){var t,r,s;try{return await this._removeSession(),await tn(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!==(r=null===(t=e.options)||void 0===t?void 0:t.redirectTo)&&void 0!==r?r:void 0}),(null===(s=null==e?void 0:e.options)||void 0===s?void 0:s.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0}),headers:this.headers,xform:th})}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)throw r;if(!t)throw new e3;let{error:s}=await tn(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:s}})}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{"email_change"!=e.type&&"phone_change"!=e.type&&await this._removeSession();let t=`${this.url}/resend`;if("email"in e){let{email:r,type:s,options:i}=e,{error:n}=await tn(this.fetch,"POST",t,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},redirectTo:null==i?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:n}}if("phone"in e){let{phone:r,type:s,options:i}=e,{data:n,error:o}=await tn(this.fetch,"POST",t,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:null==n?void 0:n.message_id},error:o}}throw new e4("You must provide either an email or phone number and a type")}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async getSession(){return await this.initializePromise,this._acquireLock(-1,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){let e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await r}catch(e){}})()),r}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;let e=t();for(this.pendingInLock.push((async()=>{try{await e}catch(e){}})()),await e;this.pendingInLock.length;){let e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{let t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",Error().stack);try{let e=null;if(this.persistSession){let t=await ez(this.storage,this.storageKey);this._debug("#getSession()","session from storage",t),null!==t&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession()))}else e=this.inMemorySession,this._debug("#getSession()","session from memory",e);if(!e)return{data:{session:null},error:null};let t=!!e.expires_at&&e.expires_at<=Date.now()/1e3;if(this._debug("#__loadSession()",`session has${t?"":" not"} expired`,"expires_at",e.expires_at),!t)return{data:{session:e},error:null};let{session:r,error:s}=await this._callRefreshToken(e.refresh_token);if(s)return{data:{session:null},error:s};return{data:{session:r},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{if(e)return await tn(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:tl});return await this._useSession(async e=>{var t,r;let{data:s,error:i}=e;if(i)throw i;return await tn(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:null!==(r=null===(t=s.session)||void 0===t?void 0:t.access_token)&&void 0!==r?r:void 0,xform:tl})})}catch(e){if(eQ(e))return{data:{user:null},error:e};throw e}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async r=>{let{data:s,error:i}=r;if(i)throw i;if(!s.session)throw new e3;let n=s.session,o=null,a=null;if("pkce"===this.flowType&&null!=e.email){let e=eV();await eM(this.storage,`${this.storageKey}-code-verifier`,e),o=await eY(e),a=e===o?"plain":"s256"}let{data:l,error:h}=await tn(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:a}),jwt:n.access_token,xform:tl});if(h)throw h;return n.user=l.user,await this._saveSession(n),await this._notifyAllSubscribers("USER_UPDATED",n),{data:{user:n.user},error:null}})}catch(e){if(eQ(e))return{data:{user:null},error:e};throw e}}_decodeJWT(e){return eH(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new e3;let t=Date.now()/1e3,r=t,s=!0,i=null,n=eH(e.access_token);if(n.exp&&(s=(r=n.exp)<=t),s){let{session:t,error:r}=await this._callRefreshToken(e.refresh_token);if(r)return{data:{user:null,session:null},error:r};if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:s,error:n}=await this._getUser(e.access_token);if(n)throw n;i={access_token:e.access_token,refresh_token:e.refresh_token,user:s.user,token_type:"bearer",expires_in:r-t,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(e){if(eQ(e))return{data:{session:null,user:null},error:e};throw e}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var r;if(!e){let{data:s,error:i}=t;if(i)throw i;e=null!==(r=s.session)&&void 0!==r?r:void 0}if(!(null==e?void 0:e.refresh_token))throw new e3;let{session:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{user:null,session:null},error:i}:s?{data:{user:s.user,session:s},error:null}:{data:{user:null,session:null},error:null}})}catch(e){if(eQ(e))return{data:{user:null,session:null},error:e};throw e}}async _getSessionFromURL(e){try{if(!eL())throw new e5("No browser detected.");if("implicit"!==this.flowType||this._isImplicitGrantFlow()){if("pkce"==this.flowType&&!e)throw new e9("Not a valid PKCE flow url.")}else throw new e5("Not a valid implicit grant flow url.");let t=eJ(window.location.href);if(e){if(!t.code)throw new e9("No code detected.");let{data:e,error:r}=await this._exchangeCodeForSession(t.code);if(r)throw r;let s=new URL(window.location.href);return s.searchParams.delete("code"),window.history.replaceState(window.history.state,"",s.toString()),{data:{session:e.session,redirectType:null},error:null}}if(t.error||t.error_description||t.error_code)throw new e5(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});let{provider_token:r,provider_refresh_token:s,access_token:i,refresh_token:n,expires_in:o,expires_at:a,token_type:l}=t;if(!i||!o||!n||!l)throw new e5("No session defined in URL");let h=Math.round(Date.now()/1e3),c=parseInt(o),u=h+c;a&&(u=parseInt(a));let d=u-h;1e3*d<=3e4&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${c}s`);let f=u-c;h-f>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",f,u,h):h-f<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clok for skew",f,u,h);let{data:p,error:y}=await this._getUser(i);if(y)throw y;let g={provider_token:r,provider_refresh_token:s,access_token:i,expires_in:c,expires_at:u,refresh_token:n,token_type:l,user:p.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:g,redirectType:t.type},error:null}}catch(e){if(eQ(e))return{data:{session:null,redirectType:null},error:e};throw e}}_isImplicitGrantFlow(){let e=eJ(window.location.href);return!!(eL()&&(e.access_token||e.error_description))}async _isPKCEFlow(){let e=eJ(window.location.href),t=await ez(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var r;let{data:s,error:i}=t;if(i)return{error:i};let n=null===(r=s.session)||void 0===r?void 0:r.access_token;if(n){let{error:t}=await this.admin.signOut(n,e);if(t&&!(eQ(t)&&"AuthApiError"===t.name&&(404===t.status||401===t.status)))return{error:t}}return"others"!==e&&(await this._removeSession(),await eq(this.storage,`${this.storageKey}-code-verifier`),await this._notifyAllSubscribers("SIGNED_OUT",null)),{error:null}})}onAuthStateChange(e){let t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),r={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,r),(async()=>{await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(t)})})(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async t=>{var r,s;try{let{data:{session:s},error:i}=t;if(i)throw i;await (null===(r=this.stateChangeEmitters.get(e))||void 0===r?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",e,"session",s)}catch(t){await (null===(s=this.stateChangeEmitters.get(e))||void 0===s?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",t),console.error(t)}})}async resetPasswordForEmail(e,t={}){let r=null,s=null;if("pkce"===this.flowType){let e=eV();await eM(this.storage,`${this.storageKey}-code-verifier`,e),r=await eY(e),s=e===r?"plain":"s256"}try{return await tn(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{let r=Date.now();return await function(e,t){let r=new Promise((r,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{let s=await e(i);if(!t(i,null,s)){r(s);return}}catch(e){if(!t(i,e)){s(e);return}}})()});return r}(async r=>(await eX(200*r),this._debug(t,"refreshing attempt",r),await tn(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ta})),(e,t,s)=>s&&s.error&&e7(s.error)&&Date.now()+(e+1)*200-r<3e4)}catch(e){if(this._debug(t,"error",e),eQ(e))return{data:{session:null,user:null},error:e};throw e}finally{this._debug(t,"end")}}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){let r=await this._getUrlForProvider(e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",r),eL()&&!t.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e;let t="#_recoverAndRefresh()";this._debug(t,"begin");try{let r=await ez(this.storage,this.storageKey);if(this._debug(t,"session from storage",r),!this._isValidSession(r)){this._debug(t,"session is not valid"),null!==r&&await this._removeSession();return}let s=Math.round(Date.now()/1e3),i=(null!==(e=r.expires_at)&&void 0!==e?e:1/0)<s+10;if(this._debug(t,`session has${i?"":" not"} expired with margin of 10s`),i){if(this.autoRefreshToken&&r.refresh_token){let{error:e}=await this._callRefreshToken(r.refresh_token);e&&(console.error(e),e7(e)||(this._debug(t,"refresh failed with a non-retryable error, removing the session",e),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",r)}catch(e){this._debug(t,"error",e),console.error(e);return}finally{this._debug(t,"end")}}async _callRefreshToken(e){var t,r;if(!e)throw new e3;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new eK;let{data:t,error:r}=await this._refreshAccessToken(e);if(r)throw r;if(!t.session)throw new e3;await this._saveSession(t.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",t.session);let s={session:t.session,error:null};return this.refreshingDeferred.resolve(s),s}catch(e){if(this._debug(s,"error",e),eQ(e)){let r={session:null,error:e};return null===(t=this.refreshingDeferred)||void 0===t||t.resolve(r),r}throw null===(r=this.refreshingDeferred)||void 0===r||r.reject(e),e}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,t,r=!0){let s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",t,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:t});let s=[],i=Array.from(this.stateChangeEmitters.values()).map(async r=>{try{await r.callback(e,t)}catch(e){s.push(e)}});if(await Promise.all(i),s.length>0){for(let e=0;e<s.length;e+=1)console.error(s[e]);throw s[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.persistSession||(this.inMemorySession=e),this.persistSession&&e.expires_at&&await this._persistSession(e)}_persistSession(e){return this._debug("#_persistSession()",e),eM(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),this.persistSession?await eq(this.storage,this.storageKey):this.inMemorySession=null}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&eL()&&(null==window?void 0:window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(e){console.error("removing visibilitychange callback failed",e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),3e4);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"undefined"!=typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let s=Math.floor((1e3*r.expires_at-e)/3e4);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),s<=3&&await this._callRefreshToken(r.refresh_token)})}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof tm)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!eL()||!(null==window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),null==window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){let t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if("visible"!==document.visibilityState){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t){let r=[`provider=${encodeURIComponent(e)}`];if((null==t?void 0:t.redirectTo)&&r.push(`redirect_to=${encodeURIComponent(t.redirectTo)}`),(null==t?void 0:t.scopes)&&r.push(`scopes=${encodeURIComponent(t.scopes)}`),"pkce"===this.flowType){let e=eV();await eM(this.storage,`${this.storageKey}-code-verifier`,e);let t=await eY(e),s=e===t?"plain":"s256";this._debug("PKCE","code verifier",`${e.substring(0,5)}...`,"code challenge",t,"method",s);let i=new URLSearchParams({code_challenge:`${encodeURIComponent(t)}`,code_challenge_method:`${encodeURIComponent(s)}`});r.push(i.toString())}if(null==t?void 0:t.queryParams){let e=new URLSearchParams(t.queryParams);r.push(e.toString())}return`${this.url}/authorize?${r.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var r;let{data:s,error:i}=t;return i?{data:null,error:i}:await tn(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null===(r=null==s?void 0:s.session)||void 0===r?void 0:r.access_token})})}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async _enroll(e){try{return await this._useSession(async t=>{var r,s;let{data:i,error:n}=t;if(n)return{data:null,error:n};let{data:o,error:a}=await tn(this.fetch,"POST",`${this.url}/factors`,{body:{friendly_name:e.friendlyName,factor_type:e.factorType,issuer:e.issuer},headers:this.headers,jwt:null===(r=null==i?void 0:i.session)||void 0===r?void 0:r.access_token});return a?{data:null,error:a}:((null===(s=null==o?void 0:o.totp)||void 0===s?void 0:s.qr_code)&&(o.totp.qr_code=`data:image/svg+xml;utf-8,${o.totp.qr_code}`),{data:o,error:null})})}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async _verify(e){try{return await this._useSession(async t=>{var r;let{data:s,error:i}=t;if(i)return{data:null,error:i};let{data:n,error:o}=await tn(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:null===(r=null==s?void 0:s.session)||void 0===r?void 0:r.access_token});return o?{data:null,error:o}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+n.expires_in},n)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",n),{data:n,error:o})})}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async _challenge(e){try{return await this._useSession(async t=>{var r;let{data:s,error:i}=t;return i?{data:null,error:i}:await tn(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{headers:this.headers,jwt:null===(r=null==s?void 0:s.session)||void 0===r?void 0:r.access_token})})}catch(e){if(eQ(e))return{data:null,error:e};throw e}}async _challengeAndVerify(e){let{data:t,error:r}=await this._challenge({factorId:e.factorId});return r?{data:null,error:r}:await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){let{data:{user:e},error:t}=await this._getUser();if(t)return{data:null,error:t};let r=(null==e?void 0:e.factors)||[],s=r.filter(e=>"totp"===e.factor_type&&"verified"===e.status);return{data:{all:r,totp:s},error:null}}async _getAuthenticatorAssuranceLevel(){return await this._useSession(async e=>{var t,r;let{data:{session:s},error:i}=e;if(i)return{data:null,error:i};if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let n=this._decodeJWT(s.access_token),o=null;n.aal&&(o=n.aal);let a=o,l=null!==(r=null===(t=s.user.factors)||void 0===t?void 0:t.filter(e=>"verified"===e.status))&&void 0!==r?r:[];l.length>0&&(a="aal2");let h=n.amr||[];return{data:{currentLevel:o,nextLevel:a,currentAuthenticationMethods:h},error:null}})}}t_.nextInstanceID=0;class tw extends t_{constructor(e){super(e)}}let tk={headers:{"X-Client-Info":"supabase-js/2.33.1"}},tS={schema:"public"},tO={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},tT={};class tE{constructor(e,t,r){var s,i,n,o,a,l,h,c;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw Error("supabaseUrl is required.");if(!t)throw Error("supabaseKey is required.");let u=e.replace(/\/$/,"");this.realtimeUrl=`${u}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${u}/auth/v1`,this.storageUrl=`${u}/storage/v1`,this.functionsUrl=`${u}/functions/v1`;let d=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,f={db:tS,realtime:tT,auth:Object.assign(Object.assign({},tO),{storageKey:d}),global:tk},p=function(e,t){let{db:r,auth:s,realtime:i,global:n}=e,{db:o,auth:a,realtime:l,global:h}=t;return{db:Object.assign(Object.assign({},o),r),auth:Object.assign(Object.assign({},a),s),realtime:Object.assign(Object.assign({},l),i),global:Object.assign(Object.assign({},h),n)}}(null!=r?r:{},f);this.storageKey=null!==(i=null===(s=p.auth)||void 0===s?void 0:s.storageKey)&&void 0!==i?i:"",this.headers=null!==(o=null===(n=p.global)||void 0===n?void 0:n.headers)&&void 0!==o?o:{},this.auth=this._initSupabaseAuthClient(null!==(a=p.auth)&&void 0!==a?a:{},this.headers,null===(l=p.global)||void 0===l?void 0:l.fetch),this.fetch=eU(t,this._getAccessToken.bind(this),null===(h=p.global)||void 0===h?void 0:h.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},p.realtime)),this.rest=new F(`${u}/rest/v1`,{headers:this.headers,schema:null===(c=p.db)||void 0===c?void 0:c.schema,fetch:this.fetch}),this._listenForAuthEvents()}get functions(){return new $(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new ex(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r){return this.rest.rpc(e,t,r)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,t,r,s,i,n;return r=this,s=void 0,i=void 0,n=function*(){let{data:r}=yield this.auth.getSession();return null!==(t=null===(e=r.session)||void 0===e?void 0:e.access_token)&&void 0!==t?t:null},new(i||(i=Promise))(function(e,t){function o(e){try{l(n.next(e))}catch(e){t(e)}}function a(e){try{l(n.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof i?r:new i(function(e){e(r)})).then(o,a)}l((n=n.apply(r,s||[])).next())})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:s,storageKey:i,flowType:n,debug:o},a,l){let h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new tw({url:this.authUrl,headers:Object.assign(Object.assign({},h),a),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:s,flowType:n,debug:o,fetch:l})}_initRealtimeClient(e){return new ea(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",null==t?void 0:t.access_token)})}_handleTokenChanged(e,t,r){("TOKEN_REFRESHED"===e||"SIGNED_IN"===e)&&this.changedAccessToken!==r?(this.realtime.setAuth(null!=r?r:null),this.changedAccessToken=r):"SIGNED_OUT"===e&&(this.realtime.setAuth(this.supabaseKey),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0)}}let tC=(e,t,r)=>new tE(e,t,r);var tj=Object.create,tI=Object.defineProperty,tx=Object.getOwnPropertyDescriptor,tA=Object.getOwnPropertyNames,tP=Object.getPrototypeOf,t$=Object.prototype.hasOwnProperty,tR=(e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of tA(t))t$.call(e,i)||i===r||tI(e,i,{get:()=>t[i],enumerable:!(s=tx(t,i))||s.enumerable});return e},tU=(e,t,r)=>(r=null!=e?tj(tP(e)):{},tR(!t&&e&&e.__esModule?r:tI(r,"default",{value:e,enumerable:!0}),e)),tL=(p={"../../node_modules/.pnpm/cookie@0.5.0/node_modules/cookie/index.js"(e){e.parse=function(e,t){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var r={},i=(t||{}).decode||s,n=0;n<e.length;){var o=e.indexOf("=",n);if(-1===o)break;var a=e.indexOf(";",n);if(-1===a)a=e.length;else if(a<o){n=e.lastIndexOf(";",o-1)+1;continue}var l=e.slice(n,o).trim();if(void 0===r[l]){var h=e.slice(o+1,a).trim();34===h.charCodeAt(0)&&(h=h.slice(1,-1)),r[l]=function(e,t){try{return t(e)}catch(t){return e}}(h,i)}n=a+1}return r},e.serialize=function(e,s,n){var o=n||{},a=o.encode||i;if("function"!=typeof a)throw TypeError("option encode is invalid");if(!r.test(e))throw TypeError("argument name is invalid");var l=a(s);if(l&&!r.test(l))throw TypeError("argument val is invalid");var h=e+"="+l;if(null!=o.maxAge){var c=o.maxAge-0;if(isNaN(c)||!isFinite(c))throw TypeError("option maxAge is invalid");h+="; Max-Age="+Math.floor(c)}if(o.domain){if(!r.test(o.domain))throw TypeError("option domain is invalid");h+="; Domain="+o.domain}if(o.path){if(!r.test(o.path))throw TypeError("option path is invalid");h+="; Path="+o.path}if(o.expires){var u=o.expires;if("[object Date]"!==t.call(u)&&!(u instanceof Date)||isNaN(u.valueOf()))throw TypeError("option expires is invalid");h+="; Expires="+u.toUTCString()}if(o.httpOnly&&(h+="; HttpOnly"),o.secure&&(h+="; Secure"),o.priority)switch("string"==typeof o.priority?o.priority.toLowerCase():o.priority){case"low":h+="; Priority=Low";break;case"medium":h+="; Priority=Medium";break;case"high":h+="; Priority=High";break;default:throw TypeError("option priority is invalid")}if(o.sameSite)switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:case"strict":h+="; SameSite=Strict";break;case"lax":h+="; SameSite=Lax";break;case"none":h+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return h};var t=Object.prototype.toString,r=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(e){return -1!==e.indexOf("%")?decodeURIComponent(e):e}function i(e){return encodeURIComponent(e)}}},function(){return y||(0,p[tA(p)[0]])((y={exports:{}}).exports,y),y.exports}),tN=tU(tL()),tD=tU(tL());function tJ(e){if(!e)return null;try{let t=JSON.parse(e);if(!t)return null;if("Object"===t.constructor.name)return t;if("Array"!==t.constructor.name)throw Error(`Unexpected format: ${t.constructor.name}`);let[r,s,i]=t[0].split("."),n=C(s),o=new TextDecoder,{exp:a,sub:l,...h}=JSON.parse(o.decode(n));return{expires_at:a,expires_in:a-Math.round(Date.now()/1e3),token_type:"bearer",access_token:t[0],refresh_token:t[1],provider_token:t[2],provider_refresh_token:t[3],user:{id:l,factors:t[4],...h}}}catch(e){return console.warn("Failed to parse cookie string:",e),null}}function tB(e){var t;return JSON.stringify([e.access_token,e.refresh_token,e.provider_token,e.provider_refresh_token,(null==(t=e.user)?void 0:t.factors)??null])}function tF(){return"undefined"!=typeof window&&void 0!==window.document}var tM={path:"/",maxAge:31536e6},tz=class{constructor(e){this.cookieOptions={...tM,...e}}getItem(e){let t=this.getCookie(e);return t?e.endsWith("-code-verifier")?t:JSON.stringify(tJ(t)):null}setItem(e,t){if(e.endsWith("-code-verifier")){this.setCookie(e,t);return}let r=JSON.parse(t),s=tB(r);this.setCookie(e,s)}removeItem(e){this.deleteCookie(e)}},tq=class extends tz{constructor(e){super(e)}getCookie(e){if(!tF())return null;let t=(0,tN.parse)(document.cookie);return t[e]}setCookie(e,t){if(!tF())return null;document.cookie=(0,tN.serialize)(e,t,{...this.cookieOptions,httpOnly:!1})}deleteCookie(e){if(!tF())return null;document.cookie=(0,tN.serialize)(e,"",{...this.cookieOptions,maxAge:0,httpOnly:!1})}};function tK(e,t,r){var s;let i=tF();return tC(e,t,{...r,auth:{flowType:"pkce",autoRefreshToken:i,detectSessionInUrl:i,persistSession:!0,storage:r.auth.storage,...(null==(s=r.auth)?void 0:s.storageKey)?{storageKey:r.auth.storageKey}:{}}})}var tH=tD.parse,tX=tD.serialize;/*!
|
|
3
|
-
* cookie
|
|
4
|
-
* Copyright(c) 2012-2014 Roman Shtylman
|
|
5
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
6
|
-
* MIT Licensed
|
|
7
|
-
*/},2151:function(e){"use strict";e.exports={version:"1.0.34"}}}]);
|