UNPKG

@viamedici-spc/configurator-framer

Version:

Component library to build configurator apps with Framer based on Viamedici SPC.

191 lines (182 loc) 143 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),f=require("framer"),p=require("@viamedici-spc/configurator-ts"),U=require("@viamedici-spc/configurator-react"),T=require("react"),Li=require("url-join"),M=require("ts-pattern"),O=require("styled-components"),Mi=require("react-error-boundary"),h=require("@viamedici-spc/fp-ts-extensions"),et=require("@fortawesome/free-solid-svg-icons"),tt=require("@fortawesome/react-fontawesome"),no=require("react-dom"),Bi=require("clsx"),oo=require("merge-props"),$i=require("dyna-guid"),J=require("zod"),zi=require("zod-validation-error"),Ki=require("mustache"),qi=require("react-number-format"),Wi=require("use-debounce"),_i=require("framer-motion"),Hi=require("hex-to-css-filter"),Ui=require("rgb-hex"),Qi=require("camelcase");function io(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const E=io(T),Gi=io(no);function X(){return f.RenderTarget.current()!==f.RenderTarget.preview}const Yi=O.div` padding: var(--space-md); margin: var(--space-md); border-radius: var(--shape-border-radius-sm); background: white; &.warning { border: 1px solid orange; border-left-width: 15px; } &.error { border: 1px solid #DB0100; border-left-width: 15px; } `,Xi=O.h3` margin: 0 0 var(--space-xs); `,Ji=O.div` white-space: break-spaces; `;function ro(e){return d.jsxs(Yi,{className:e.type,children:[d.jsx(Xi,{children:e.title}),d.jsx(Ji,{children:e.message})]})}function Zi(e){if(X())return null;const{error:n}=U.useConfigurationInitialization();if(!n)return null;const o=r=>d.jsx(ro,{type:"error",title:"Configuration initialization failed",message:r});switch(n.type){case p.ConfiguratorErrorType.ConfigurationModelNotFound:return T.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:o("Configuration Model not found for the specified deployment name.");case p.ConfiguratorErrorType.AuthenticationFailure:return T.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:o("The HCA access token is invalid.");case p.ConfiguratorErrorType.SpecifiedDeploymentForbidden:return T.Children.toArray(e.accessTokenRestrictionContent).length>0?e.accessTokenRestrictionContent:o("The HCA access token does not permit using the specified Configuration Model.");case p.ConfiguratorErrorType.DecisionsToRespectInvalid:return o("The definition of Attribute Relations is invalid.");default:return T.Children.toArray(e.errorContent).length>0?e.errorContent:o("An error occurred while initializing the configuration.")}}function se(e){return T.forwardRef((t,n)=>d.jsx(Mi.ErrorBoundary,{fallbackRender:()=>d.jsx("span",{children:"Component crashed"}),children:d.jsx(e,{...t,ref:n})}))}const er=O.createGlobalStyle` :root { --font-primary: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif); --font-heading: "Inter-Medium", "Inter", "Inter Placeholder", sans-serif; } /* font sizes */ :root { --text-base-size: calc(var(--framer-font-size, 16px) * var(--framer-font-size-scale, 1)); --text-scale-ratio: 1.2; --text-xs: calc(1em / (var(--text-scale-ratio) * var(--text-scale-ratio))); --text-sm: calc(1em / var(--text-scale-ratio)); --text-md: calc(1em * var(--text-scale-ratio)); --text-lg: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio)); --text-xl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio)); --text-xxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio)); --text-xxxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio)); } `,tr=er,nr=O.createGlobalStyle` :root { --space-unit: 1em; --space-xxs: calc(0.25 * var(--space-unit)); --space-xs: calc(0.5 * var(--space-unit)); --space-sm: calc(0.75 * var(--space-unit)); --space-md: calc(1.25 * var(--space-unit)); --space-lg: calc(2 * var(--space-unit)); --space-xl: calc(3.25 * var(--space-unit)); --space-xxl: calc(5.25 * var(--space-unit)); --space-unit-fixed: var(--text-base-size); --space-xxs-fixed: calc(0.25 * var(--space-unit-fixed)); --space-xs-fixed: calc(0.5 * var(--space-unit-fixed)); --space-sm-fixed: calc(0.75 * var(--space-unit-fixed)); --space-md-fixed: calc(1.25 * var(--space-unit-fixed)); --space-lg-fixed: calc(2 * var(--space-unit-fixed)); --space-xl-fixed: calc(3.25 * var(--space-unit-fixed)); --space-xxl-fixed: calc(5.25 * var(--space-unit-fixed)); } `,or=nr,ir=O.createGlobalStyle` :root { --shape-border-radius-xs: 5px; --shape-border-radius-sm: 7px; --shape-border-radius-md: 12px; --shape-border-radius-lg: 20px; } `,rr=ir,lr=O.createGlobalStyle` :root { --shadows-popover: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.4)); --shadows-dialog: 0.2px 0.4px 2.3px rgba(0, 0, 0, 0.02), 0.6px 1px 5.7px rgba(0, 0, 0, 0.025), 1.2px 2.1px 10.6px rgba(0, 0, 0, 0.03), 2.3px 4px 17.2px rgba(0, 0, 0, 0.034), 4.2px 7.2px 25.9px rgba(0, 0, 0, 0.04), 7.6px 12.8px 37.7px rgba(0, 0, 0, 0.048), 13.9px 23.6px 54.7px rgba(0, 0, 0, 0.061), 40px 68px 96px rgba(0, 0, 0, 0.1); } `,ar=lr;function sn(){return d.jsxs(d.Fragment,{children:[d.jsx(ar,{}),d.jsx(rr,{}),d.jsx(or,{}),d.jsx(tr,{})]})}const Ke=T.createContext(null);function ge(){const{process:e,switchMode:t,applySolution:n,dismiss:o}=T.useContext(Ke);return e?{...e,switchMode:t,applySolution:n,dismiss:o}:null}function lo(e){const{explanation:t,...n}=e,o=ge();return d.jsx("button",{...n,onClick:()=>o.applySolution(t.solution),children:e.children})}function ao(e,t,n){return M.match(e).returnType().with({type:p.AttributeType.Choice},o=>t.get(o.choiceValueId)??o.choiceValueId).with({type:p.AttributeType.Boolean,state:!0},()=>n.booleanDecisionStateTrueLabel).with({type:p.AttributeType.Boolean,state:!1},()=>n.booleanDecisionStateFalseLabel).with({type:p.AttributeType.Component,state:p.ComponentDecisionState.Included},()=>n.componentDecisionStateIncludedLabel).with({type:p.AttributeType.Component,state:p.ComponentDecisionState.Excluded},()=>n.componentDecisionStateExcludedLabel).with({type:p.AttributeType.Numeric},o=>o.state.toString()).exhaustive()}const so={applySolutionButtonCaption:{title:"Apply Solution Button Caption",type:f.ControlType.String,defaultValue:"Apply Solution"},configurationSubjectTitle:{title:"Configuration Subject Title",type:f.ControlType.String,defaultValue:"Configuration"},generalConflictTitle:{title:"General Conflict Title",type:f.ControlType.String,defaultValue:"Conflict"},componentDecisionStateIncludedLabel:{title:"Component Decision State Included Label",type:f.ControlType.String,defaultValue:"Included"},componentDecisionStateExcludedLabel:{title:"Component Decision State Excluded Label",type:f.ControlType.String,defaultValue:"Excluded"},booleanDecisionStateTrueLabel:{title:"Boolean Decision State True Label",type:f.ControlType.String,defaultValue:"Yes"},booleanDecisionStateFalseLabel:{title:"Boolean Decision State False Label",type:f.ControlType.String,defaultValue:"No"},isBlockedSuffix:{title:"Is Blocked Suffix",type:f.ControlType.String,defaultValue:"is blocked"},isNotSatisfiedSuffix:{title:"Is Not Satisfied Suffix",type:f.ControlType.String,defaultValue:"is not satisfied"}},sr={fill:{title:"Fill",type:f.ControlType.Color,defaultValue:"#002134"},color:{title:"Color",type:f.ControlType.Color,defaultValue:"white"},attributeValueFill:{title:"Attribute Value Fill",type:f.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.2)"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:f.ControlType.Color,defaultValue:"rgba(47, 255, 0, 0.2)"},attributeValueAddColor:{title:"Attribute Value Add Color",type:f.ControlType.Color,defaultValue:"#63e446"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:f.ControlType.Color,defaultValue:"#ff00004a"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:f.ControlType.Color,defaultValue:"#ff6060"},headerValueColor:{title:"Header Value Color",type:f.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},closeButtonOutline:{title:"Close Button Outline",type:f.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},listSeparator:{title:"List Separator",type:f.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.3)"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:f.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:f.ControlType.Color,defaultValue:"white"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:f.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},showMoreButtonOutline:{title:"Show More Button Outline",type:f.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},solutionTitle:{title:"Solution Title",type:f.ControlType.String,defaultValue:"Solution"},showMoreButtonCaption:{title:"Show More Button Caption",type:f.ControlType.String,defaultValue:"Show more ({{amount}})"},showConstraintsButtonCaption:{title:"Show Constraints Button Caption",type:f.ControlType.String,defaultValue:"Show Constraints"},...so},$t=T.createContext(null),zt=()=>T.useContext($t),cr={fill:{title:"Fill",type:f.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.7)"},color:{title:"Color",type:f.ControlType.Color,defaultValue:"#171717"},attributeValueFill:{title:"Attribute Value Fill",type:f.ControlType.Color,defaultValue:"#efefef"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:f.ControlType.Color,defaultValue:"#cfefc7"},attributeValueAddColor:{title:"Attribute Value Add Color",type:f.ControlType.Color,defaultValue:"#48c52b"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:f.ControlType.Color,defaultValue:"#ffdada"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:f.ControlType.Color,defaultValue:"#c52b2b"},headerValueColor:{title:"Header Value Color",type:f.ControlType.Color,defaultValue:"#00a1e6"},closeButtonOutline:{title:"Close Button Outline",type:f.ControlType.Color,defaultValue:"#00a1e6"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:f.ControlType.Color,defaultValue:"#F2F2F2"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:f.ControlType.Color,defaultValue:"#171717"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:f.ControlType.Color,defaultValue:"#00a1e6"},explanationCard:{title:"Explanation Card",type:f.ControlType.Color,defaultValue:"white"},scrollShadowBorder:{title:"Scroll Shadow Border",type:f.ControlType.Color,defaultValue:"rgba(0, 0, 0, 0.3)"},backdropFilter:{title:"Backdrop Filter",type:f.ControlType.String,defaultValue:"blur(10px) saturate(200%)"},decisionExplanationSolutionsTitle:{title:"Decision Explanation Solutions Title",type:f.ControlType.String,defaultValue:"Solutions"},constraintExplanationSolutionsTitle:{title:"Constraint Explanation Solutions Title",type:f.ControlType.String,defaultValue:"Constraint Explanations"},...so},Kt=T.createContext(null),co=()=>T.useContext(Kt),ur=()=>T.useContext($t)||T.useContext(Kt),qt=ur,dr=O.div` display: flex; gap: var(--space-xs); align-items: center; background-color: var(--color-explain-attribute-value-fill); border-radius: 360px; padding-right: var(--space-sm); font-size: 0.9em; font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif); font-weight: 500; min-width: 0; `,fr=O.div` display: grid; place-content: center; border-top-left-radius: 360px; border-bottom-left-radius: 360px; height: 1.5em; width: 1.5em; flex-shrink: 0; &.mode-add { background-color: var(--color-explain-attribute-value-add-fill); color: var(--color-explain-attribute-value-add-color); } &.mode-remove { background-color: var(--color-explain-attribute-value-remove-fill); color: var(--color-explain-attribute-value-remove-color); } `,pr=O.div` white-space: nowrap; overflow: hidden; text-overflow: ellipsis; `;function hr(e){const{decision:t,choiceValuesNames:n}=e,o=t.intention,r=qt(),i=ao(t,n,r);return d.jsxs(dr,{children:[d.jsxs(fr,{className:`mode-${o}`,children:[o==="remove"&&d.jsx(tt.FontAwesomeIcon,{icon:et.faMinus}),o==="add"&&d.jsx(tt.FontAwesomeIcon,{icon:et.faPlus})]}),d.jsx(pr,{children:i})]})}function Z(e){var t;return{localId:e.attributeId,componentPath:e.componentPath===""?[]:((t=e.componentPath)==null?void 0:t.split(" -> "))??[],sharedConfigurationModelId:e.sharedConfigurationModel===""?null:e.sharedConfigurationModel}}const ft=T.createContext(null);function pt(e){const{attributes:t}=T.useContext(ft),{activeLocale:n}=f.useLocaleInfo(),o=n.code;return T.useMemo(()=>h.pipe(t,h.RA.findFirst(r=>p.globalAttributeIdEq.equals(Z(r),e)),h.O.map(r=>r.name),h.RA.fromOption,h.RA.flatten,Wt(o),h.O.toUndefined),[t,o,e.localId,e.componentPath,e.sharedConfigurationModelId])}function _e(e){const{choiceValues:t}=T.useContext(ft),{activeLocale:n}=f.useLocaleInfo(),o=U.useChoiceAttribute(e);if(!o)return h.RM.empty;const r=T.useMemo(()=>h.pipe(t,h.RA.filter(a=>p.globalAttributeIdEq.equals(Z(a),e))),[t,e.localId,e.componentPath,e.sharedConfigurationModelId]),i=n.code,l=o.attribute.values;return T.useMemo(()=>h.pipe(l,h.RM.mapWithIndex((a,s)=>h.pipe(r,h.RA.findFirst(c=>c.choiceValueId===a),h.O.map(c=>c.name),h.RA.fromOption,h.RA.flatten,Wt(i))),h.RM.compact),[l,r,i])}function uo(e,t){const{choiceValues:n}=T.useContext(ft),{activeLocale:o}=f.useLocaleInfo(),r=o.code;return T.useMemo(()=>h.pipe(n,h.RA.findFirst(i=>p.globalAttributeIdEq.equals(Z(i),e)&&i.choiceValueId===t),h.O.map(i=>i.name),h.RA.fromOption,h.RA.flatten,Wt(r),h.O.toUndefined),[n,r,e.localId,e.componentPath,e.sharedConfigurationModelId,t])}function Wt(e){return h.flow(h.RA.findFirst(t=>t.localeCode.localeCompare(e,void 0,{sensitivity:"accent"})===0),h.O.map(t=>t.translation))}const mr=O.div` display: grid; grid-template-columns: subgrid; grid-column: span 2; align-items: center; `,yr=O.div` grid-area: name; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; `,gr=O.div` grid-area: values; display: flex; flex-wrap: wrap; min-width: 0; gap: var(--space-xxs); `;function br(e){const{decisions:t}=e,n=t[0].attributeId,o=_e(n),r=pt(n),i=qt(),l=h.pipe(h.Str.Ord,h.Ord.contramap(s=>ao(s,o,i))),a=h.pipe(t,h.RA.sort(l));return d.jsxs(mr,{children:[d.jsx(yr,{children:r??n.localId}),d.jsx(gr,{children:a.map((s,c)=>d.jsx(hr,{decision:s,choiceValuesNames:o},c))})]})}function xr(e){const t=e.sharedConfigurationModelId&&`shared::${e.sharedConfigurationModelId}`,n=(e.componentPath??[]).join("::");return[t,n,e.localId].filter(o=>(o==null?void 0:o.length)>0).join("::")}const Cr=h.pipe(h.Str.Ord,h.Ord.contramap(e=>e.attributeId.localId));function fo(e){const{blockingDecisions:t,desiredDecisions:n,...o}=e,r=h.pipe([...n.map(i=>({...i,intention:"add"})),...t.map(i=>({...i,intention:"remove"}))],h.RNEA.groupBy(i=>xr(i.attributeId)),h.RR.collect(h.Ord.trivial)((i,l)=>({key:i,attributeId:h.RNEA.head(l).attributeId,decisions:l})),h.RA.sort(Cr));return d.jsx("div",{...o,children:r.map(i=>d.jsx(br,{decisions:i.decisions},i.key))})}const vr=O.div` background-color: var(--color-explain-dialog-explanation-card); padding: var(--space-sm-fixed); box-shadow: 2px 1px 10px -5px rgba(0, 0, 0, 0.4); border-radius: var(--shape-border-radius-sm); `,po=vr,wr=O(fo)` display: grid; grid-template-columns: [name] minmax(150px, auto) [values] minmax(0px, 1fr); gap: var(--space-sm); `,Sr=O(lo)` border-radius: var(--shape-border-radius-sm); background-color: var(--color-explain-dialog-apply-solution-button-fill); color: var(--color-explain-dialog-apply-solution-button-color); font-size: 0.9em; font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif); font-weight: 600; appearance: none; padding: 0.6em 1em; border: none; width: auto; margin-top: var(--space-md); &:focus { outline: 2px solid var(--color-explain-dialog-apply-solution-button-outline); outline-offset: 1px; } `;function Tr(e){const{explanation:t}=e,{applySolutionButtonCaption:n}=co(),o=t.solution.decisions.filter(r=>r.state!=null);return d.jsxs(po,{children:[d.jsx(wr,{blockingDecisions:t.causedByDecisions,desiredDecisions:o}),d.jsx(Sr,{explanation:t,children:n})]})}const Er=O(po)` ul { margin: 0; } line-height: 1.5em; `,Ar=O.ul` list-style-type: none; margin-inline-start: 0; padding-inline-start: 0; `,cn=O.ul` list-style-type: disc; margin-inline-start: 0; padding-inline-start: var(--space-lg); `,un=O.li` font-size: 0.9em; font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif); font-weight: 500; `;function Rr(e){const{explanation:t}=e,n=t.causedByCardinalities,o=h.pipe(t.causedByRules,h.RNEA.groupBy(r=>r.configurationModelId),h.RR.collect(h.Str.Ord)((r,i)=>({configurationModelId:r,rules:h.pipe(i,h.RA.map(l=>l.localId),h.RA.sort(h.Str.Ord))})));return d.jsx(Er,{children:d.jsxs(Ar,{children:[o.map(r=>d.jsxs("li",{children:[d.jsx("span",{children:r.configurationModelId}),d.jsx(cn,{children:r.rules.map(i=>d.jsx(un,{children:i}))})]})),n.length>0&&d.jsxs("li",{children:[d.jsx("span",{children:"Cardinality"}),d.jsx(cn,{children:n.map(r=>d.jsx(un,{children:r.localId}))})]})]})})}function ho(e){const{variant:t,...n}=e,{explainQuestion:o}=ge(),r=M.match(o).returnType().with({question:p.ExplainQuestionType.whyIsStateNotPossible},()=>"why your selection is not possible").with({question:p.ExplainQuestionType.whyIsNotSatisfied,subject:p.ExplainQuestionSubject.configuration},()=>"why your configuration is not satisfied").with({question:p.ExplainQuestionType.whyIsNotSatisfied,subject:p.ExplainQuestionSubject.attribute},()=>"why your attribute is not satisfied").with(M.P.nullish,()=>"why your selections are not possible").exhaustive(),i=M.match(t).returnType().with("failedToExplain",()=>d.jsxs(d.Fragment,{children:["Failed to explain ",r,".",d.jsx("br",{}),"Please check your internet connection and try again."]})).with("noExplanationFound",()=>d.jsxs(d.Fragment,{children:["There was no explanation found for ",r,"."]})).with("noSolutionFound",()=>d.jsxs(d.Fragment,{children:["There was no solution found for ",r,"."]})).exhaustive();return d.jsx("div",{...n,children:i})}const dn=O.div` font-weight: 500; font-family: var(--font-heading); margin-bottom: var(--space-xs); margin-left: var(--space-sm-fixed); `,fn=O.div` display: flex; flex-direction: column; gap: var(--space-xs); `,Ir=O.div` display: flex; flex-direction: column; gap: var(--space-md); `,pn=O(ho)` width: min-content; min-width: 400px; margin: var(--space-sm-fixed) var(--space-md-fixed) var(--space-sm-fixed) var(--space-sm-fixed); `;function Vr(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=ge(),{decisionExplanationSolutionsTitle:o,constraintExplanationSolutionsTitle:r}=co();return n?d.jsx(pn,{variant:"failedToExplain"}):e.length===0&&t.length===0?d.jsx(pn,{variant:"noExplanationFound"}):d.jsxs(Ir,{children:[e.length>0&&d.jsxs("div",{children:[d.jsx(dn,{children:o}),d.jsx(fn,{children:e.map(i=>d.jsx(Tr,{explanation:i},e.indexOf(i)))})]}),t.length>0&&d.jsxs("div",{children:[d.jsx(dn,{children:r}),d.jsx(fn,{children:t.map(i=>d.jsx(Rr,{explanation:i},t.indexOf(i)))})]})]})}function ye(e){return mo(e)?(e.nodeName||"").toLowerCase():"#document"}function ie(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function be(e){var t;return(t=(mo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mo(e){return e instanceof Node||e instanceof ie(e).Node}function Y(e){return e instanceof Element||e instanceof ie(e).Element}function ne(e){return e instanceof HTMLElement||e instanceof ie(e).HTMLElement}function Ot(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ie(e).ShadowRoot}function He(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=re(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function Pr(e){return["table","td","th"].includes(ye(e))}function _t(e){const t=Ht(),n=re(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function yo(e){let t=Te(e);for(;ne(t)&&!Oe(t);){if(_t(t))return t;t=Te(t)}return null}function Ht(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Oe(e){return["html","body","#document"].includes(ye(e))}function re(e){return ie(e).getComputedStyle(e)}function ht(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Te(e){if(ye(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ot(e)&&e.host||be(e);return Ot(t)?t.host:t}function go(e){const t=Te(e);return Oe(t)?e.ownerDocument?e.ownerDocument.body:e.body:ne(t)&&He(t)?t:go(t)}function xe(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=go(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),l=ie(r);return i?t.concat(l,l.visualViewport||[],He(r)?r:[],l.frameElement&&n?xe(l.frameElement):[]):t.concat(r,xe(r,[],n))}function Ie(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function oe(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ot(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function bo(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function xo(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:o}=t;return n+"/"+o}).join(" "):navigator.userAgent}function Dr(e){return e.mozInputSource===0&&e.isTrusted?!0:jt()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Or(e){return kr()?!1:!jt()&&e.width===0&&e.height===0||jt()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function jr(){return/apple/i.test(navigator.vendor)}function jt(){const e=/android/i;return e.test(bo())||e.test(xo())}function kr(){return xo().includes("jsdom/")}function hn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Fr(e){return"nativeEvent"in e}function Nr(e){return e.matches("html,body")}function me(e){return(e==null?void 0:e.ownerDocument)||document}function bt(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Ve(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Lr="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Co(e){return ne(e)&&e.matches(Lr)}function xt(e){e.preventDefault(),e.stopPropagation()}function Mr(e){return e?e.getAttribute("role")==="combobox"&&Co(e):!1}const je=Math.min,Se=Math.max,nt=Math.round,Ye=Math.floor,Ce=e=>({x:e,y:e}),Br={left:"right",right:"left",bottom:"top",top:"bottom"},$r={start:"end",end:"start"};function kt(e,t,n){return Se(e,je(t,n))}function Ue(e,t){return typeof e=="function"?e(t):e}function Ee(e){return e.split("-")[0]}function Qe(e){return e.split("-")[1]}function vo(e){return e==="x"?"y":"x"}function Ut(e){return e==="y"?"height":"width"}function mt(e){return["top","bottom"].includes(Ee(e))?"y":"x"}function Qt(e){return vo(mt(e))}function zr(e,t,n){n===void 0&&(n=!1);const o=Qe(e),r=Qt(e),i=Ut(r);let l=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=ot(l)),[l,ot(l)]}function Kr(e){const t=ot(e);return[Ft(e),t,Ft(t)]}function Ft(e){return e.replace(/start|end/g,t=>$r[t])}function qr(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:l;default:return[]}}function Wr(e,t,n,o){const r=Qe(e);let i=qr(Ee(e),n==="start",o);return r&&(i=i.map(l=>l+"-"+r),t&&(i=i.concat(i.map(Ft)))),i}function ot(e){return e.replace(/left|right|bottom|top/g,t=>Br[t])}function _r(e){return{top:0,right:0,bottom:0,left:0,...e}}function wo(e){return typeof e!="number"?_r(e):{top:e,right:e,bottom:e,left:e}}function it(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function mn(e,t,n){let{reference:o,floating:r}=e;const i=mt(t),l=Qt(t),a=Ut(l),s=Ee(t),c=i==="y",C=o.x+o.width/2-r.width/2,m=o.y+o.height/2-r.height/2,b=o[a]/2-r[a]/2;let u;switch(s){case"top":u={x:C,y:o.y-r.height};break;case"bottom":u={x:C,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:m};break;case"left":u={x:o.x-r.width,y:m};break;default:u={x:o.x,y:o.y}}switch(Qe(t)){case"start":u[l]-=b*(n&&c?-1:1);break;case"end":u[l]+=b*(n&&c?-1:1);break}return u}const Hr=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),s=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:r}),{x:C,y:m}=mn(c,o,s),b=o,u={},x=0;for(let w=0;w<a.length;w++){const{name:g,fn:y}=a[w],{x:v,y:P,data:S,reset:R}=await y({x:C,y:m,initialPlacement:o,placement:b,strategy:r,middlewareData:u,rects:c,platform:l,elements:{reference:e,floating:t}});C=v??C,m=P??m,u={...u,[g]:{...u[g],...S}},R&&x<=50&&(x++,typeof R=="object"&&(R.placement&&(b=R.placement),R.rects&&(c=R.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:r}):R.rects),{x:C,y:m}=mn(c,b,s)),w=-1)}return{x:C,y:m,placement:b,strategy:r,middlewareData:u}};async function So(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:l,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:C="viewport",elementContext:m="floating",altBoundary:b=!1,padding:u=0}=Ue(t,e),x=wo(u),g=a[b?m==="floating"?"reference":"floating":m],y=it(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(g)))==null||n?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:C,strategy:s})),v=m==="floating"?{...l.floating,x:o,y:r}:l.reference,P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(P))?await(i.getScale==null?void 0:i.getScale(P))||{x:1,y:1}:{x:1,y:1},R=it(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:P,strategy:s}):v);return{top:(y.top-R.top+x.top)/S.y,bottom:(R.bottom-y.bottom+x.bottom)/S.y,left:(y.left-R.left+x.left)/S.x,right:(R.right-y.right+x.right)/S.x}}const Ur=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:l,elements:a,middlewareData:s}=t,{element:c,padding:C=0}=Ue(e,t)||{};if(c==null)return{};const m=wo(C),b={x:n,y:o},u=Qt(r),x=Ut(u),w=await l.getDimensions(c),g=u==="y",y=g?"top":"left",v=g?"bottom":"right",P=g?"clientHeight":"clientWidth",S=i.reference[x]+i.reference[u]-b[u]-i.floating[x],R=b[u]-i.reference[u],I=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let D=I?I[P]:0;(!D||!await(l.isElement==null?void 0:l.isElement(I)))&&(D=a.floating[P]||i.floating[x]);const V=S/2-R/2,F=D/2-w[x]/2-1,A=je(m[y],F),N=je(m[v],F),B=A,K=D-w[x]-N,_=D/2-w[x]/2+V,k=kt(B,_,K),$=!s.arrow&&Qe(r)!=null&&_!==k&&i.reference[x]/2-(_<B?A:N)-w[x]/2<0,j=$?_<B?_-B:_-K:0;return{[u]:b[u]+j,data:{[u]:k,centerOffset:_-k-j,...$&&{alignmentOffset:j}},reset:$}}}),Qr=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:l,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:C=!0,crossAxis:m=!0,fallbackPlacements:b,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:w=!0,...g}=Ue(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Ee(r),v=Ee(a)===a,P=await(s.isRTL==null?void 0:s.isRTL(c.floating)),S=b||(v||!w?[ot(a)]:Kr(a));!b&&x!=="none"&&S.push(...Wr(a,w,x,P));const R=[a,...S],I=await So(t,g),D=[];let V=((o=i.flip)==null?void 0:o.overflows)||[];if(C&&D.push(I[y]),m){const B=zr(r,l,P);D.push(I[B[0]],I[B[1]])}if(V=[...V,{placement:r,overflows:D}],!D.every(B=>B<=0)){var F,A;const B=(((F=i.flip)==null?void 0:F.index)||0)+1,K=R[B];if(K)return{data:{index:B,overflows:V},reset:{placement:K}};let _=(A=V.filter(k=>k.overflows[0]<=0).sort((k,$)=>k.overflows[1]-$.overflows[1])[0])==null?void 0:A.placement;if(!_)switch(u){case"bestFit":{var N;const k=(N=V.map($=>[$.placement,$.overflows.filter(j=>j>0).reduce((j,L)=>j+L,0)]).sort(($,j)=>$[1]-j[1])[0])==null?void 0:N[0];k&&(_=k);break}case"initialPlacement":_=a;break}if(r!==_)return{reset:{placement:_}}}return{}}}};async function Gr(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),l=Ee(n),a=Qe(n),s=mt(n)==="y",c=["left","top"].includes(l)?-1:1,C=i&&s?-1:1,m=Ue(t,e);let{mainAxis:b,crossAxis:u,alignmentAxis:x}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return a&&typeof x=="number"&&(u=a==="end"?x*-1:x),s?{x:u*C,y:b*c}:{x:b*c,y:u*C}}const Yr=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:l,middlewareData:a}=t,s=await Gr(t,e);return l===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:l}}}}},Xr=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...s}=Ue(e,t),c={x:n,y:o},C=await So(t,s),m=mt(Ee(r)),b=vo(m);let u=c[b],x=c[m];if(i){const g=b==="y"?"top":"left",y=b==="y"?"bottom":"right",v=u+C[g],P=u-C[y];u=kt(v,u,P)}if(l){const g=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=x+C[g],P=x-C[y];x=kt(v,x,P)}const w=a.fn({...t,[b]:u,[m]:x});return{...w,data:{x:w.x-n,y:w.y-o}}}}};function To(e){const t=re(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ne(e),i=r?e.offsetWidth:n,l=r?e.offsetHeight:o,a=nt(n)!==i||nt(o)!==l;return a&&(n=i,o=l),{width:n,height:o,$:a}}function Gt(e){return Y(e)?e:e.contextElement}function De(e){const t=Gt(e);if(!ne(t))return Ce(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=To(t);let l=(i?nt(n.width):n.width)/o,a=(i?nt(n.height):n.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const Jr=Ce(0);function Eo(e){const t=ie(e);return!Ht()||!t.visualViewport?Jr:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Zr(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ie(e)?!1:t}function Ae(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=Gt(e);let l=Ce(1);t&&(o?Y(o)&&(l=De(o)):l=De(e));const a=Zr(i,n,o)?Eo(i):Ce(0);let s=(r.left+a.x)/l.x,c=(r.top+a.y)/l.y,C=r.width/l.x,m=r.height/l.y;if(i){const b=ie(i),u=o&&Y(o)?ie(o):o;let x=b.frameElement;for(;x&&o&&u!==b;){const w=De(x),g=x.getBoundingClientRect(),y=re(x),v=g.left+(x.clientLeft+parseFloat(y.paddingLeft))*w.x,P=g.top+(x.clientTop+parseFloat(y.paddingTop))*w.y;s*=w.x,c*=w.y,C*=w.x,m*=w.y,s+=v,c+=P,x=ie(x).frameElement}}return it({width:C,height:m,x:s,y:c})}const el=[":popover-open",":modal"];function Ao(e){let t=!1,n=0,o=0;function r(i){try{t=t||e.matches(i)}catch{}}if(el.forEach(i=>{r(i)}),t){const i=yo(e);if(i){const l=i.getBoundingClientRect();n=l.x,o=l.y}}return[t,n,o]}function tl(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=be(o),[l]=t?Ao(t.floating):[!1];if(o===i||l)return n;let a={scrollLeft:0,scrollTop:0},s=Ce(1);const c=Ce(0),C=ne(o);if((C||!C&&r!=="fixed")&&((ye(o)!=="body"||He(i))&&(a=ht(o)),ne(o))){const m=Ae(o);s=De(o),c.x=m.x+o.clientLeft,c.y=m.y+o.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-a.scrollLeft*s.x+c.x,y:n.y*s.y-a.scrollTop*s.y+c.y}}function nl(e){return Array.from(e.getClientRects())}function Ro(e){return Ae(be(e)).left+ht(e).scrollLeft}function ol(e){const t=be(e),n=ht(e),o=e.ownerDocument.body,r=Se(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Se(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Ro(e);const a=-n.scrollTop;return re(o).direction==="rtl"&&(l+=Se(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:a}}function il(e,t){const n=ie(e),o=be(e),r=n.visualViewport;let i=o.clientWidth,l=o.clientHeight,a=0,s=0;if(r){i=r.width,l=r.height;const c=Ht();(!c||c&&t==="fixed")&&(a=r.offsetLeft,s=r.offsetTop)}return{width:i,height:l,x:a,y:s}}function rl(e,t){const n=Ae(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=ne(e)?De(e):Ce(1),l=e.clientWidth*i.x,a=e.clientHeight*i.y,s=r*i.x,c=o*i.y;return{width:l,height:a,x:s,y:c}}function yn(e,t,n){let o;if(t==="viewport")o=il(e,n);else if(t==="document")o=ol(be(e));else if(Y(t))o=rl(t,n);else{const r=Eo(e);o={...t,x:t.x-r.x,y:t.y-r.y}}return it(o)}function Io(e,t){const n=Te(e);return n===t||!Y(n)||Oe(n)?!1:re(n).position==="fixed"||Io(n,t)}function ll(e,t){const n=t.get(e);if(n)return n;let o=xe(e,[],!1).filter(a=>Y(a)&&ye(a)!=="body"),r=null;const i=re(e).position==="fixed";let l=i?Te(e):e;for(;Y(l)&&!Oe(l);){const a=re(l),s=_t(l);!s&&a.position==="fixed"&&(r=null),(i?!s&&!r:!s&&a.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||He(l)&&!s&&Io(e,l))?o=o.filter(C=>C!==l):r=a,l=Te(l)}return t.set(e,o),o}function al(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const l=[...n==="clippingAncestors"?ll(t,this._c):[].concat(n),o],a=l[0],s=l.reduce((c,C)=>{const m=yn(t,C,r);return c.top=Se(m.top,c.top),c.right=je(m.right,c.right),c.bottom=je(m.bottom,c.bottom),c.left=Se(m.left,c.left),c},yn(t,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function sl(e){const{width:t,height:n}=To(e);return{width:t,height:n}}function cl(e,t,n,o){const r=ne(t),i=be(t),l=n==="fixed",a=Ae(e,!0,l,t);let s={scrollLeft:0,scrollTop:0};const c=Ce(0);if(r||!r&&!l)if((ye(t)!=="body"||He(i))&&(s=ht(t)),r){const w=Ae(t,!0,l,t);c.x=w.x+t.clientLeft,c.y=w.y+t.clientTop}else i&&(c.x=Ro(i));let C=a.left+s.scrollLeft-c.x,m=a.top+s.scrollTop-c.y;const[b,u,x]=Ao(o);return b&&(C+=u,m+=x,r&&(C+=t.clientLeft,m+=t.clientTop)),{x:C,y:m,width:a.width,height:a.height}}function gn(e,t){return!ne(e)||re(e).position==="fixed"?null:t?t(e):e.offsetParent}function Vo(e,t){const n=ie(e);if(!ne(e))return n;let o=gn(e,t);for(;o&&Pr(o)&&re(o).position==="static";)o=gn(o,t);return o&&(ye(o)==="html"||ye(o)==="body"&&re(o).position==="static"&&!_t(o))?n:o||yo(e)||n}const ul=async function(e){const t=this.getOffsetParent||Vo,n=this.getDimensions;return{reference:cl(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function dl(e){return re(e).direction==="rtl"}const Po={convertOffsetParentRelativeRectToViewportRelativeRect:tl,getDocumentElement:be,getClippingRect:al,getOffsetParent:Vo,getElementRects:ul,getClientRects:nl,getDimensions:sl,getScale:De,isElement:Y,isRTL:dl};function fl(e,t){let n=null,o;const r=be(e);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function l(a,s){a===void 0&&(a=!1),s===void 0&&(s=1),i();const{left:c,top:C,width:m,height:b}=e.getBoundingClientRect();if(a||t(),!m||!b)return;const u=Ye(C),x=Ye(r.clientWidth-(c+m)),w=Ye(r.clientHeight-(C+b)),g=Ye(c),v={rootMargin:-u+"px "+-x+"px "+-w+"px "+-g+"px",threshold:Se(0,je(1,s))||1};let P=!0;function S(R){const I=R[0].intersectionRatio;if(I!==s){if(!P)return l();I?l(!1,I):o=setTimeout(()=>{l(!1,1e-7)},100)}P=!1}try{n=new IntersectionObserver(S,{...v,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,v)}n.observe(e)}return l(!0),i}function pl(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:s=!1}=o,c=Gt(e),C=r||i?[...c?xe(c):[],...xe(t)]:[];C.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const m=c&&a?fl(c,n):null;let b=-1,u=null;l&&(u=new ResizeObserver(y=>{let[v]=y;v&&v.target===c&&u&&(u.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var P;(P=u)==null||P.observe(t)})),n()}),c&&!s&&u.observe(c),u.observe(t));let x,w=s?Ae(e):null;s&&g();function g(){const y=Ae(e);w&&(y.x!==w.x||y.y!==w.y||y.width!==w.width||y.height!==w.height)&&n(),w=y,x=requestAnimationFrame(g)}return n(),()=>{var y;C.forEach(v=>{r&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),m==null||m(),(y=u)==null||y.disconnect(),u=null,s&&cancelAnimationFrame(x)}}const hl=Xr,ml=Qr,bn=Ur,yl=(e,t,n)=>{const o=new Map,r={platform:Po,...n},i={...r.platform,_c:o};return Hr(e,t,{...r,platform:i})},gl=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?bn({element:o.current,padding:r}).fn(n):{}:o?bn({element:o,padding:r}).fn(n):{}}}};var Ze=typeof document<"u"?T.useLayoutEffect:T.useEffect;function rt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!rt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!rt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Do(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xn(e,t){const n=Do(e);return Math.round(t*n)/n}function Cn(e){const t=E.useRef(e);return Ze(()=>{t.current=e}),t}function bl(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:l}={},transform:a=!0,whileElementsMounted:s,open:c}=e,[C,m]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,u]=E.useState(o);rt(b,o)||u(o);const[x,w]=E.useState(null),[g,y]=E.useState(null),v=E.useCallback(j=>{j!==I.current&&(I.current=j,w(j))},[]),P=E.useCallback(j=>{j!==D.current&&(D.current=j,y(j))},[]),S=i||x,R=l||g,I=E.useRef(null),D=E.useRef(null),V=E.useRef(C),F=s!=null,A=Cn(s),N=Cn(r),B=E.useCallback(()=>{if(!I.current||!D.current)return;const j={placement:t,strategy:n,middleware:b};N.current&&(j.platform=N.current),yl(I.current,D.current,j).then(L=>{const te={...L,isPositioned:!0};K.current&&!rt(V.current,te)&&(V.current=te,Gi.flushSync(()=>{m(te)}))})},[b,t,n,N]);Ze(()=>{c===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,m(j=>({...j,isPositioned:!1})))},[c]);const K=E.useRef(!1);Ze(()=>(K.current=!0,()=>{K.current=!1}),[]),Ze(()=>{if(S&&(I.current=S),R&&(D.current=R),S&&R){if(A.current)return A.current(S,R,B);B()}},[S,R,B,A,F]);const _=E.useMemo(()=>({reference:I,floating:D,setReference:v,setFloating:P}),[v,P]),k=E.useMemo(()=>({reference:S,floating:R}),[S,R]),$=E.useMemo(()=>{const j={position:n,left:0,top:0};if(!k.floating)return j;const L=xn(k.floating,C.x),te=xn(k.floating,C.y);return a?{...j,transform:"translate("+L+"px, "+te+"px)",...Do(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:te}},[n,a,k.floating,C.x,C.y]);return E.useMemo(()=>({...C,update:B,refs:_,elements:k,floatingStyles:$}),[C,B,_,k,$])}/*! * tabbable 6.2.0 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE */var xl=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Nt=xl.join(","),Oo=typeof Element>"u",qe=Oo?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,lt=!Oo&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},at=function e(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),i=r===""||r==="true",l=i||n&&t&&e(t.parentNode);return l},Cl=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},vl=function(t,n,o){if(at(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Nt));return n&&qe.call(t,Nt)&&r.unshift(t),r=r.filter(o),r},wl=function e(t,n,o){for(var r=[],i=Array.from(t);i.length;){var l=i.shift();if(!at(l,!1))if(l.tagName==="SLOT"){var a=l.assignedElements(),s=a.length?a:l.children,c=e(s,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:l,candidates:c})}else{var C=qe.call(l,Nt);C&&o.filter(l)&&(n||!t.includes(l))&&r.push(l);var m=l.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(l),b=!at(m,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(l));if(m&&b){var u=e(m===!0?l.children:m.children,!0,o);o.flatten?r.push.apply(r,u):r.push({scopeParent:l,candidates:u})}else i.unshift.apply(i,l.children)}}return r},jo=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ko=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Cl(t))&&!jo(t)?0:t.tabIndex},Sl=function(t,n){var o=ko(t);return o<0&&n&&!jo(t)?0:o},Tl=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Fo=function(t){return t.tagName==="INPUT"},El=function(t){return Fo(t)&&t.type==="hidden"},Al=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Rl=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Il=function(t){if(!t.name)return!0;var n=t.form||lt(t),o=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(t.name)}catch(l){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",l.message),!1}var i=Rl(r,t.form);return!i||i===t},Vl=function(t){return Fo(t)&&t.type==="radio"},Pl=function(t){return Vl(t)&&!Il(t)},Dl=function(t){var n,o=t&&lt(t),r=(n=o)===null||n===void 0?void 0:n.host,i=!1;if(o&&o!==t){var l,a,s;for(i=!!((l=r)!==null&&l!==void 0&&(a=l.ownerDocument)!==null&&a!==void 0&&a.contains(r)||t!=null&&(s=t.ownerDocument)!==null&&s!==void 0&&s.contains(t));!i&&r;){var c,C,m;o=lt(r),r=(c=o)===null||c===void 0?void 0:c.host,i=!!((C=r)!==null&&C!==void 0&&(m=C.ownerDocument)!==null&&m!==void 0&&m.contains(r))}}return i},vn=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},Ol=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=qe.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(qe.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="legacy-full"){if(typeof r=="function"){for(var a=t;t;){var s=t.parentElement,c=lt(t);if(s&&!s.shadowRoot&&r(s)===!0)return vn(t);t.assignedSlot?t=t.assignedSlot:!s&&c!==t.ownerDocument?t=c.host:t=s}t=a}if(Dl(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return vn(t);return!1},jl=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return qe.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},kl=function(t,n){return!(n.disabled||at(n)||El(n)||Ol(n,t)||Al(n)||jl(n))},wn=function(t,n){return!(Pl(n)||ko(n)<0||!kl(t,n))},Fl=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Nl=function e(t){var n=[],o=[];return t.forEach(function(r,i){var l=!!r.scopeParent,a=l?r.scopeParent:r,s=Sl(a,l),c=l?e(r.candidates):a;s===0?l?n.push.apply(n,c):n.push(a):o.push({documentOrder:i,tabIndex:s,item:r,isScope:l,content:c})}),o.sort(Tl).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(n)},Yt=function(t,n){n=n||{};var o;return n.getShadowRoot?o=wl([t],n.includeContainer,{filter:wn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Fl}):o=vl(t,n.includeContainer,wn.bind(null,n)),Nl(o)};function Xt(e){return E.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const Ll=E["useInsertionEffect".toString()],Ml=Ll||(e=>e());function Pe(e){const t=E.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Ml(()=>{t.current=e}),E.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}let Sn=0;function ve(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(Sn);const i=()=>e==null?void 0:e.focus({preventScroll:n});r?i():Sn=requestAnimationFrame(i)}var ae=typeof document<"u"?T.useLayoutEffect:T.useEffect;function ke(){return ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ke.apply(this,arguments)}let Ct=!1,Bl=0;const Tn=()=>"floating-ui-"+Bl++;function $l(){const[e,t]=E.useState(()=>Ct?Tn():void 0);return ae(()=>{e==null&&t(Tn())},[]),E.useEffect(()=>{Ct||(Ct=!0)},[]),e}const zl=E["useId".toString()],yt=zl||$l,Kl=E.forwardRef(function(t,n){let{context:{placement:o,elements:{floating:r},middlewareData:{arrow:i}},width:l=14,height:a=7,tipRadius:s=0,strokeWidth:c=0,staticOffset:C,stroke:m,d:b,style:{transform:u,...x}={},...w}=t;process.env.NODE_ENV!=="production"&&(n||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const g=yt();if(!r)return null;c*=2;const y=c/2,v=l/2*(s/-8+1),P=a/2*s/4,[S,R]=o.split("-"),I=Po.isRTL(r),D=!!b,V=S==="top"||S==="bottom",F=C&&R==="end"?"bottom":"top";let A=C&&R==="end"?"right":"left";C&&I&&(A=R==="end"?"left":"right");const N=(i==null?void 0:i.x)!=null?C||i.x:"",B=(i==null?void 0:i.y)!=null?C||i.y:"",K=b||"M0,0"+(" H"+l)+(" L"+(l-v)+","+(a-P))+(" Q"+l/2+","+a+" "+v+","+(a-P))+" Z",_={top:D?"rotate(180deg)":"",left:D?"rotate(90deg)":"rotate(-90deg)",bottom:D?"":"rotate(180deg)",right:D?"rotate(-90deg)":"rotate(90deg)"}[S];return E.createElement("svg",ke({},w,{"aria-hidden":!0,ref:n,width:D?l:l+c,height:l,viewBox:"0 0 "+l+" "+(a>l?a:l),style:{position:"absolute",pointerEvents:"none",[A]:N,[F]:B,[S]:V||D?"100%":"calc(100% - "+c/2+"px)",transform:""+_+(u??""),...x}}),c>0&&E.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:m,strokeWidth:c+(b?0:1),d:K}),E.createElement("path",{stroke:c&&!b?w.fill:"none",d:K}),E.createElement("clipPath",{id:g},E.createElement("rect",{x:-y,y:y*(D?-1:1),width:l+c,height:l})))});function ql(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(r=>r(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,((o=e.get(t))==null?void 0:o.filter(r=>r!==n))||[])}}}const Wl=E.createContext(null),_l=E.createContext(null),Hl=()=>{var e;return((e=E.useContext(Wl))==null?void 0:e.id)||null},Jt=()=>E.useContext(_l);function We(e){return"data-floating-ui-"+e}function vt(e){const t=T.useRef(e);return ae(()=>{t.current=e}),t}function Ul(e,t){var n;let o=[],r=(n=e.find(i=>i.id===t))==null?void 0:n.parentId;for(;r;){const i=e.find(l=>l.id===r);r=i==null?void 0:i.parentId,i&&(o=o.concat(i))}return o}function $e(e,t){let n=e.filter(r=>{var i;return r.parentId===t&&((i=r.context)==null?void 0:i.open)}),o=n;for(;o.length;)o=e.filter(r=>{var i;return(i=o)==null?void 0:i.some(l=>{var a;return r.parentId===l.id&&((a=r.context)==null?void 0:a.open)})}),n=n.concat(o);return n}let Re=new WeakMap,Xe=new WeakSet,Je={},wt=0;const Ql=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,No=e=>e&&(e.host||No(e.parentNode)),Gl=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=No(n);return e.contains(o)?o:null}).filter(n=>n!=null);function Yl(e,t,n,o){const r="data-floating-ui-inert",i=o?"inert":n?"aria-hidden":null,l=Gl(t,e),a=new Set,s=new Set(l),c=[];Je[r]||(Je[r]=new WeakMap);const C=Je[r];l.forEach(m),b(t),a.