@viamedici-spc/configurator-framer 2.1.1 → 2.1.2-rc0004
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/dist/index.cjs +119 -231
- package/dist/index.d.ts +94 -45
- package/dist/index.js +2981 -2593
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),d=require("framer"),h=require("@viamedici-spc/configurator-ts"),U=require("@viamedici-spc/configurator-react"),T=require("react"),Yi=require("url-join"),N=require("ts-pattern"),k=require("styled-components"),Gi=require("react-error-boundary"),p=require("@viamedici-spc/fp-ts-extensions"),rt=require("@fortawesome/free-solid-svg-icons"),lt=require("@fortawesome/react-fontawesome"),ho=require("react-dom"),Xi=require("clsx"),go=require("merge-props"),Ji=require("dyna-guid"),J=require("zod"),Zi=require("zod-validation-error"),er=require("mustache"),tr=require("react-number-format"),nr=require("use-debounce"),or=require("framer-motion"),ir=require("hex-to-css-filter"),rr=require("rgb-hex"),lr=require("camelcase");function mo(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=mo(T),sr=mo(ho);function G(){return d.RenderTarget.current()!==d.RenderTarget.preview}const ar=k.div`
|
|
2
2
|
padding: var(--space-md);
|
|
3
3
|
margin: var(--space-md);
|
|
4
4
|
border-radius: var(--shape-border-radius-sm);
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
border: 1px solid #DB0100;
|
|
14
14
|
border-left-width: 15px;
|
|
15
15
|
}
|
|
16
|
-
`,
|
|
16
|
+
`,cr=k.h3`
|
|
17
17
|
margin: 0 0 var(--space-xs);
|
|
18
|
-
`,
|
|
18
|
+
`,ur=k.div`
|
|
19
19
|
white-space: break-spaces;
|
|
20
|
-
`;function
|
|
20
|
+
`;function yo(e){return f.jsxs(ar,{className:e.type,children:[f.jsx(cr,{children:e.title}),f.jsx(ur,{children:e.message})]})}function dr(e){var i,r,l;if(G())return null;const{error:n}=U.useConfigurationInitialization();if(!n)return null;const o=s=>f.jsx(yo,{type:"error",title:"Configuration initialization failed",message:s});switch(n.type){case h.ConfiguratorErrorType.ConfigurationModelNotFound:return T.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:o("The Configuration Model was not found for the specified deployment name.");case h.ConfiguratorErrorType.AuthenticationFailure:return T.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:o("The HCA access token is invalid.");case h.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 h.ConfiguratorErrorType.DecisionsToRespectInvalid:const s=`Attribute Id: ${((i=n.globalAttributeId)==null?void 0:i.localId)??""}`,a=`Component Path: ${((r=n.globalAttributeId.componentPath)==null?void 0:r.join(" -> "))??""}`,c=`Shared Configuration Model: ${((l=n.globalAttributeId)==null?void 0:l.sharedConfigurationModelId)??""}`;return o(`The definition of Attribute Relations is invalid: ${n.validationMessage}
|
|
21
21
|
|
|
22
|
-
${a}
|
|
23
22
|
${s}
|
|
24
|
-
${
|
|
23
|
+
${a}
|
|
24
|
+
${c}`);case h.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configuration Session parameters are invalid: ${n.detail}`);default:return T.Children.toArray(e.errorContent).length>0?e.errorContent:o("An error occurred while initializing the configuration.")}}function ae(e){return T.forwardRef((t,n)=>f.jsx(Gi.ErrorBoundary,{fallbackRender:()=>f.jsx("span",{children:"Component crashed"}),children:f.jsx(e,{...t,ref:n})}))}const fr=k.createGlobalStyle`
|
|
25
25
|
:root {
|
|
26
26
|
--font-primary: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
27
27
|
--font-heading: "Inter-Medium", "Inter", "Inter Placeholder", sans-serif;
|
|
@@ -40,7 +40,7 @@ ${c}`);case h.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
40
40
|
--text-xxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
41
41
|
--text-xxxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
42
42
|
}
|
|
43
|
-
`,
|
|
43
|
+
`,pr=fr,hr=k.createGlobalStyle`
|
|
44
44
|
:root {
|
|
45
45
|
--space-unit: 1em;
|
|
46
46
|
--space-xxs: calc(0.25 * var(--space-unit));
|
|
@@ -60,37 +60,31 @@ ${c}`);case h.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
60
60
|
--space-xl-fixed: calc(3.25 * var(--space-unit-fixed));
|
|
61
61
|
--space-xxl-fixed: calc(5.25 * var(--space-unit-fixed));
|
|
62
62
|
}
|
|
63
|
-
`,
|
|
63
|
+
`,gr=hr,mr=k.createGlobalStyle`
|
|
64
64
|
:root {
|
|
65
65
|
--shape-border-radius-xs: 5px;
|
|
66
66
|
--shape-border-radius-sm: 7px;
|
|
67
67
|
--shape-border-radius-md: 12px;
|
|
68
68
|
--shape-border-radius-lg: 20px;
|
|
69
69
|
}
|
|
70
|
-
`,rr=ir,lr=O.createGlobalStyle`
|
|
71
|
-
:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
2.3px 4px 17.2px rgba(0, 0, 0, 0.034),
|
|
77
|
-
4.2px 7.2px 25.9px rgba(0, 0, 0, 0.04),
|
|
78
|
-
7.6px 12.8px 37.7px rgba(0, 0, 0, 0.048),
|
|
79
|
-
13.9px 23.6px 54.7px rgba(0, 0, 0, 0.061),
|
|
80
|
-
40px 68px 96px rgba(0, 0, 0, 0.1);
|
|
70
|
+
`,yr=mr;function Cn(){return f.jsxs(f.Fragment,{children:[f.jsx(yr,{}),f.jsx(gr,{}),f.jsx(pr,{})]})}const He=T.createContext(null);function xe(){const{process:e,switchMode:t,applySolution:n,dismiss:o}=T.useContext(He);return e?{...e,switchMode:t,applySolution:n,dismiss:o}:null}const bo=(e={})=>({padding:{type:d.ControlType.FusedNumber,title:"Padding",toggleKey:"isMixedPadding",toggleTitles:["Padding","Padding per Side"],valueKeys:["paddingTop","paddingRight","paddingBottom","paddingLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:e.padding??0}}),xo=e=>({paddingTop:e.isMixedPadding?e.paddingTop:e.padding,paddingRight:e.isMixedPadding?e.paddingRight:e.padding,paddingBottom:e.isMixedPadding?e.paddingBottom:e.padding,paddingLeft:e.isMixedPadding?e.paddingLeft:e.padding}),Ht=(e={})=>{var t,n;return{radius:{title:"Radius",type:d.ControlType.Number,defaultValue:e.radius??0},border:{title:"Border",type:d.ControlType.Object,controls:{color:{type:d.ControlType.Color,title:"Color",defaultValue:(t=e.border)==null?void 0:t.color},width:{type:d.ControlType.FusedNumber,title:"Width",toggleKey:"isMixedWidth",toggleTitles:["Width","Width per Side"],valueKeys:["widthTop","widthRight","widthBottom","widthLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:((n=e.border)==null?void 0:n.width)??0}}}}},Co=e=>{var t,n,o,i,r,l,s,a,c,x,g,C,u;return{borderRadius:e.radius,borderColor:(t=e.border)==null?void 0:t.color,borderTopWidth:(n=e.border)!=null&&n.isMixedWidth?(o=e.border)==null?void 0:o.widthTop:(i=e.border)==null?void 0:i.width,borderRightWidth:(r=e.border)!=null&&r.isMixedWidth?(l=e.border)==null?void 0:l.widthRight:(s=e.border)==null?void 0:s.width,borderBottomWidth:(a=e.border)!=null&&a.isMixedWidth?(c=e.border)==null?void 0:c.widthBottom:(x=e.border)==null?void 0:x.width,borderLeftWidth:(g=e.border)!=null&&g.isMixedWidth?(C=e.border)==null?void 0:C.widthLeft:(u=e.border)==null?void 0:u.width,borderStyle:"solid"}},_e=(e={})=>({fill:{title:"Fill",type:d.ControlType.Color,defaultValue:e.fill},backdropFilter:{title:"Backdrop Filter",type:d.ControlType.String,defaultValue:e.backdropFilter??"none"},shadow:{title:"Shadow",type:d.ControlType.String,defaultValue:e.shadow??"none"},filter:{title:"Filter",type:d.ControlType.String,defaultValue:e.filter??"none"},...bo(e),...Ht(e)}),Be=e=>({...xo(e),...Co(e),backgroundColor:e.fill,backdropFilter:e.backdropFilter,boxShadow:e.shadow,filter:e.filter}),de=(e={})=>{var t,n;return{color:{title:"Color",type:d.ControlType.Color,defaultValue:e.color??"black"},text:{title:"Text",type:d.ControlType.Font,controls:"basic",displayTextAlignment:!0,displayFontSize:!0,defaultValue:{fontSize:(t=e.text)==null?void 0:t.fontSize,textAlign:(n=e.text)==null?void 0:n.textAlign}}}},fe=e=>({...e.text,color:e.color}),st=(e={})=>({staticText:{title:"Text",type:d.ControlType.String,defaultValue:e.staticText},...de(e)}),at=e=>fe(e),ct=(e={})=>{var t,n,o;return{fillHover:{title:"Fill – Hover",type:d.ControlType.Color,defaultValue:e.fillHover},focusOutline:{title:"Focus Outline",type:d.ControlType.Object,controls:{color:{title:"Color",type:d.ControlType.Color,defaultValue:(t=e.focusOutline)==null?void 0:t.color},size:{title:"Size",type:d.ControlType.Number,defaultValue:(n=e.focusOutline)==null?void 0:n.size},offset:{title:"Offset",type:d.ControlType.Number,defaultValue:(o=e.focusOutline)==null?void 0:o.offset}}},..._e(e),...st(e)}},vt=e=>({...Be(e),...at(e),"--color-button-fill-hover":e.fillHover,"--color-button-focus-outline":e.focusOutline.color,"--size-button-focus-outline":`${e.focusOutline.size}px`,"--size-button-focus-outline-offset":`${e.focusOutline.offset}px`}),ut=(e={})=>({margin:{type:d.ControlType.FusedNumber,title:"Margin",toggleKey:"isMixedMargin",toggleTitles:["Margin","Margin per Side"],valueKeys:["marginTop","marginRight","marginBottom","marginLeft"],valueLabels:["Top","Right","Bottom","Left"],defaultValue:e.margin??0}}),wt=e=>({marginTop:e.isMixedMargin?e.marginTop:e.margin,marginRight:e.isMixedMargin?e.marginRight:e.margin,marginBottom:e.isMixedMargin?e.marginBottom:e.margin,marginLeft:e.isMixedMargin?e.marginLeft:e.margin}),br=(e={})=>{var t,n,o,i;return{subject:{title:"Subject",type:d.ControlType.Object,controls:{...de(e.subject??{}),configurationSubjectTitle:{title:"Configuration Subject Title",type:d.ControlType.String,defaultValue:((t=e.subject)==null?void 0:t.configurationSubjectTitle)??"Configuration"},generalConflictTitle:{title:"General Conflict Title",type:d.ControlType.String,defaultValue:((n=e.subject)==null?void 0:n.generalConflictTitle)??"Conflict"}}},suffix:{title:"Suffix",type:d.ControlType.Object,controls:{...de(e.suffix??{}),isBlockedSuffix:{title:"Is Blocked Suffix",type:d.ControlType.String,defaultValue:((o=e.suffix)==null?void 0:o.isBlockedSuffix)??"is blocked"},isNotSatisfiedSuffix:{title:"Is Not Satisfied Suffix",type:d.ControlType.String,defaultValue:((i=e.suffix)==null?void 0:i.isNotSatisfiedSuffix)??"is not satisfied"}}}}},vo=(e={})=>{var t,n,o,i,r,l,s,a,c,x,g,C,u,b,w,y,m,v,P,S;return{header:{title:"Header",type:d.ControlType.Object,controls:{...br(e.header??{})}},attributeName:{title:"Attribute Name",type:d.ControlType.Object,controls:{...de(e.attributeName??{})}},attributeValue:{title:"Attribute Value",type:d.ControlType.Object,controls:{add:{title:"Adding",type:d.ControlType.Object,controls:{...de(((t=e.attributeValue)==null?void 0:t.add)??{}),...Ht(((n=e.attributeValue)==null?void 0:n.add)??{}),fill:{title:"Fill",type:d.ControlType.Color,defaultValue:(i=(o=e.attributeValue)==null?void 0:o.add)==null?void 0:i.fill},iconFill:{title:"Icon Fill",type:d.ControlType.Color,defaultValue:(l=(r=e.attributeValue)==null?void 0:r.add)==null?void 0:l.iconFill},iconColor:{title:"Icon Color",type:d.ControlType.Color,defaultValue:(a=(s=e.attributeValue)==null?void 0:s.add)==null?void 0:a.iconColor}}},remove:{title:"Removing",type:d.ControlType.Object,controls:{...de(((c=e.attributeValue)==null?void 0:c.remove)??{}),...Ht(((x=e.attributeValue)==null?void 0:x.remove)??{}),fill:{title:"Fill",type:d.ControlType.Color,defaultValue:(C=(g=e.attributeValue)==null?void 0:g.remove)==null?void 0:C.fill},iconFill:{title:"Icon Fill",type:d.ControlType.Color,defaultValue:(b=(u=e.attributeValue)==null?void 0:u.remove)==null?void 0:b.iconFill},iconColor:{title:"Icon Color",type:d.ControlType.Color,defaultValue:(y=(w=e.attributeValue)==null?void 0:w.remove)==null?void 0:y.iconColor}}},...bo(e.attributeValue??{}),componentDecisionStateIncludedLabel:{title:"Component Decision State Included Label",type:d.ControlType.String,defaultValue:((m=e.attributeValue)==null?void 0:m.componentDecisionStateIncludedLabel)??"Included"},componentDecisionStateExcludedLabel:{title:"Component Decision State Excluded Label",type:d.ControlType.String,defaultValue:((v=e.attributeValue)==null?void 0:v.componentDecisionStateExcludedLabel)??"Excluded"},booleanDecisionStateTrueLabel:{title:"Boolean Decision State True Label",type:d.ControlType.String,defaultValue:((P=e.attributeValue)==null?void 0:P.booleanDecisionStateTrueLabel)??"Yes"},booleanDecisionStateFalseLabel:{title:"Boolean Decision State False Label",type:d.ControlType.String,defaultValue:((S=e.attributeValue)==null?void 0:S.booleanDecisionStateFalseLabel)??"No"}}},applySolutionButton:{title:"Apply Solution Button",type:d.ControlType.Object,controls:{...ct(e.applySolutionButton??{}),...ut(e.applySolutionButton??{})}},closeButton:{title:"Close Button",type:d.ControlType.Object,controls:{...ct(e.closeButton??{})}},infoMessage:{title:"Info Message",type:d.ControlType.Object,controls:{...de(e.infoMessage??{})}}}},xr={popoverBox:{title:"Popover Box",type:d.ControlType.Object,controls:_e({fill:"#002134",radius:12,padding:18,isMixedPadding:!1,filter:"drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.4))"})},subline:{title:"Subline",type:d.ControlType.Object,controls:{...st({color:"white",staticText:"Solution",text:{fontWeight:"500",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})}},...vo({header:{subject:{color:"rgb(0, 161, 230)",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},suffix:{color:"white",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}},attributeName:{color:"white",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},attributeValue:{add:{color:"white",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"rgba(255, 255, 255, 0.2)",iconFill:"rgba(47, 255, 0, 0.2)",iconColor:"#63e446"},remove:{color:"white",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"rgba(255, 255, 255, 0.2)",iconFill:"#ff00004a",iconColor:"#ff6060"},paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:10,isMixedPadding:!0},applySolutionButton:{fill:"rgb(0, 161, 230)",fillHover:"#15ACED",radius:300,paddingTop:9,paddingBottom:9,paddingLeft:29,paddingRight:29,isMixedPadding:!0,color:"white",staticText:"Apply Solution",text:{textAlign:"center",fontWeight:"600",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1},marginTop:18,isMixedMargin:!0},closeButton:{fill:"transparent",fillHover:"#FFFFFF26",radius:300,paddingTop:2,paddingBottom:2,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"white",staticText:"Close",text:{textAlign:"center",fontWeight:"400",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1}},infoMessage:{color:"white",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}}),showConstraintsButton:{title:"Show Constraints Button",type:d.ControlType.Object,controls:{...ct({fill:"transparent",fillHover:"transparent",radius:5,paddingTop:1,paddingBottom:1,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"white",staticText:"Show Constraints",text:{textAlign:"center",fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1}}),...ut({marginTop:13})}},showMoreButton:{title:"Show More Button",type:d.ControlType.Object,controls:{...ct({fill:"transparent",fillHover:"transparent",radius:5,paddingTop:1,paddingBottom:1,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"white",staticText:"Show more ({{amount}})",text:{textAlign:"center",fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1}}),...ut({marginTop:13})}},listSeparator:{title:"List Separator",type:d.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.3)"}},en=T.createContext(null),St=()=>T.useContext(en),Cr={dialogBox:{title:"Dialog Box",type:d.ControlType.Object,controls:_e({fill:"rgba(255, 255, 255, 0.7)",backdropFilter:"blur(10px) saturate(200%)",shadow:"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)",radius:12,paddingTop:18,paddingBottom:0,paddingLeft:24,paddingRight:24,isMixedPadding:!0})},explanationCard:{title:"Explanation Card",type:d.ControlType.Object,controls:{..._e({fill:"white",shadow:"2px 1px 10px -5px rgba(0, 0, 0, 0.4)",radius:7,padding:12,isMixedPadding:!1}),...ut({marginLeft:-12,marginRight:-12,isMixedMargin:!0})}},constraintExplanation:{title:"Constraint Explanation",type:d.ControlType.Object,controls:{configurationModelId:{title:"Configuration Model Id",type:d.ControlType.Object,controls:de({color:"#171717",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})},ruleId:{title:"Rule Id",type:d.ControlType.Object,controls:de({color:"#171717",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})}}},...vo({header:{subject:{color:"rgb(0, 161, 230)",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},suffix:{color:"#171717",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}},attributeName:{color:"#171717",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},attributeValue:{add:{color:"#171717",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"#efefef",iconFill:"#cfefc7",iconColor:"#48c52b"},remove:{color:"#171717",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"#efefef",iconFill:"#ffdada",iconColor:"#c52b2b"},paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:10,isMixedPadding:!0},applySolutionButton:{fill:"#F2F2F2",fillHover:"#F7F7F7",radius:7,paddingTop:9,paddingBottom:9,paddingLeft:29,paddingRight:29,isMixedPadding:!0,color:"#171717",staticText:"Apply Solution",text:{textAlign:"center",fontWeight:"600",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"#00a1e6",size:2,offset:-1},marginTop:18,isMixedMargin:!0},closeButton:{fill:"transparent",fillHover:"00000012",radius:300,paddingTop:2,paddingBottom:2,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"#171717",staticText:"Close",text:{textAlign:"center",fontWeight:"400",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"#00a1e6",size:2,offset:-1}},infoMessage:{color:"#171717",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}}),decisionExplanationSolutionsTitle:{title:"Decision Explanation Solutions Title",type:d.ControlType.Object,controls:{...st({color:"#171717",staticText:"Solutions",text:{fontWeight:"500",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})}},constraintExplanationSolutionsTitle:{title:"Constraint Explanation Solutions Title",type:d.ControlType.Object,controls:{...st({color:"#171717",staticText:"Constraint Explanations",text:{fontWeight:"500",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})}},scrollShadowBorder:{title:"Scroll Shadow Border",type:d.ControlType.Color,defaultValue:"rgba(0, 0, 0, 0.3)"}},tn=T.createContext(null),Tt=()=>T.useContext(tn),vr=()=>T.useContext(en)||T.useContext(tn),Ye=vr,wr=k.button`
|
|
71
|
+
appearance: none;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
|
|
74
|
+
&:hover {
|
|
75
|
+
background-color: var(--color-button-fill-hover) !important;
|
|
81
76
|
}
|
|
82
|
-
|
|
77
|
+
|
|
78
|
+
&:focus {
|
|
79
|
+
outline: var(--size-button-focus-outline) solid var(--color-button-focus-outline);
|
|
80
|
+
outline-offset: var(--size-button-focus-outline-offset);
|
|
81
|
+
}
|
|
82
|
+
`;function wo(e){const{explanation:t,...n}=e,o=xe(),{applySolutionButton:i}=Ye();return f.jsx(wr,{...n,onClick:()=>o.applySolution(t.solution),style:{...vt(i),...wt(i)},children:i.staticText})}function So(e,t,n){return N.match(e).returnType().with({type:h.AttributeType.Choice},o=>t.get(o.choiceValueId)??o.choiceValueId).with({type:h.AttributeType.Boolean,state:!0},()=>n.attributeValue.booleanDecisionStateTrueLabel).with({type:h.AttributeType.Boolean,state:!1},()=>n.attributeValue.booleanDecisionStateFalseLabel).with({type:h.AttributeType.Component,state:h.ComponentDecisionState.Included},()=>n.attributeValue.componentDecisionStateIncludedLabel).with({type:h.AttributeType.Component,state:h.ComponentDecisionState.Excluded},()=>n.attributeValue.componentDecisionStateExcludedLabel).with({type:h.AttributeType.Numeric},o=>o.state.toString()).exhaustive()}const Sr=k.div`
|
|
83
83
|
display: flex;
|
|
84
84
|
gap: var(--space-xs);
|
|
85
85
|
align-items: center;
|
|
86
|
-
background-color: var(--color-explain-attribute-value-fill);
|
|
87
|
-
border-radius: 360px;
|
|
88
|
-
padding-right: var(--space-sm);
|
|
89
|
-
font-size: 0.9em;
|
|
90
|
-
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
91
|
-
font-weight: 500;
|
|
92
86
|
min-width: 0;
|
|
93
|
-
`,
|
|
87
|
+
`,Tr=k.div`
|
|
94
88
|
display: grid;
|
|
95
89
|
place-content: center;
|
|
96
90
|
border-top-left-radius: 360px;
|
|
@@ -98,114 +92,74 @@ ${c}`);case h.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
98
92
|
height: 1.5em;
|
|
99
93
|
width: 1.5em;
|
|
100
94
|
flex-shrink: 0;
|
|
101
|
-
|
|
102
|
-
&.mode-add {
|
|
103
|
-
background-color: var(--color-explain-attribute-value-add-fill);
|
|
104
|
-
color: var(--color-explain-attribute-value-add-color);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
&.mode-remove {
|
|
108
|
-
background-color: var(--color-explain-attribute-value-remove-fill);
|
|
109
|
-
color: var(--color-explain-attribute-value-remove-color);
|
|
110
|
-
}
|
|
111
|
-
`,pr=O.div`
|
|
95
|
+
`,Er=k.div`
|
|
112
96
|
white-space: nowrap;
|
|
113
97
|
overflow: hidden;
|
|
114
98
|
text-overflow: ellipsis;
|
|
115
|
-
`;function
|
|
99
|
+
`;function Ar(e){const{decision:t,choiceValuesNames:n}=e,o=t.intention,i=Ye(),r=So(t,n,i),l=N.match(o).with("remove",()=>i.attributeValue.remove).with("add",()=>i.attributeValue.add).exhaustive();return f.jsxs(Sr,{style:{...xo(i.attributeValue),...fe(l),...Co(l),backgroundColor:l.fill},children:[f.jsxs(Tr,{style:{backgroundColor:l.iconFill,color:l.iconColor},children:[o==="remove"&&f.jsx(lt.FontAwesomeIcon,{icon:rt.faMinus}),o==="add"&&f.jsx(lt.FontAwesomeIcon,{icon:rt.faPlus})]}),f.jsx(Er,{children:r})]})}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 Et=T.createContext(null);function At(e){const{attributes:t}=T.useContext(Et),{activeLocale:n}=d.useLocaleInfo(),o=n.code;return T.useMemo(()=>p.pipe(t,p.RA.findFirst(i=>h.globalAttributeIdEq.equals(Z(i),e)),p.O.map(i=>i.name),p.RA.fromOption,p.RA.flatten,nn(o),p.O.toUndefined),[t,o,e.localId,e.componentPath,e.sharedConfigurationModelId])}function Ge(e){const{choiceValues:t}=T.useContext(Et),{activeLocale:n}=d.useLocaleInfo(),o=U.useChoiceAttribute(e);if(!o)return p.RM.empty;const i=T.useMemo(()=>p.pipe(t,p.RA.filter(s=>h.globalAttributeIdEq.equals(Z(s),e))),[t,e.localId,e.componentPath,e.sharedConfigurationModelId]),r=n.code,l=o.attribute.values;return T.useMemo(()=>p.pipe(l,p.RM.mapWithIndex((s,a)=>p.pipe(i,p.RA.findFirst(c=>c.choiceValueId===s),p.O.map(c=>c.name),p.RA.fromOption,p.RA.flatten,nn(r))),p.RM.compact),[l,i,r])}function To(e,t){const{choiceValues:n}=T.useContext(Et),{activeLocale:o}=d.useLocaleInfo(),i=o.code;return T.useMemo(()=>p.pipe(n,p.RA.findFirst(r=>h.globalAttributeIdEq.equals(Z(r),e)&&r.choiceValueId===t),p.O.map(r=>r.name),p.RA.fromOption,p.RA.flatten,nn(i),p.O.toUndefined),[n,i,e.localId,e.componentPath,e.sharedConfigurationModelId,t])}function nn(e){return p.flow(p.RA.findFirst(t=>t.localeCode.localeCompare(e,void 0,{sensitivity:"accent"})===0),p.O.map(t=>t.translation))}const Ir=k.div`
|
|
116
100
|
display: grid;
|
|
117
101
|
grid-template-columns: subgrid;
|
|
118
102
|
grid-column: span 2;
|
|
119
103
|
align-items: center;
|
|
120
|
-
`,
|
|
104
|
+
`,Rr=k.div`
|
|
121
105
|
grid-area: name;
|
|
122
106
|
white-space: nowrap;
|
|
123
107
|
overflow: hidden;
|
|
124
108
|
text-overflow: ellipsis;
|
|
125
|
-
`,
|
|
109
|
+
`,Pr=k.div`
|
|
126
110
|
grid-area: values;
|
|
127
111
|
display: flex;
|
|
128
112
|
flex-wrap: wrap;
|
|
129
113
|
min-width: 0;
|
|
130
114
|
gap: var(--space-xxs);
|
|
131
|
-
`;function
|
|
132
|
-
background-color: var(--color-explain-dialog-explanation-card);
|
|
133
|
-
padding: var(--space-sm-fixed);
|
|
134
|
-
box-shadow: 2px 1px 10px -5px rgba(0, 0, 0, 0.4);
|
|
135
|
-
border-radius: var(--shape-border-radius-sm);
|
|
136
|
-
`,po=vr,wr=O(fo)`
|
|
115
|
+
`;function Or(e){const{decisions:t}=e,n=t[0].attributeId,o=Ge(n),i=At(n),r=Ye(),l=p.pipe(p.Str.Ord,p.Ord.contramap(a=>So(a,o,r))),s=p.pipe(t,p.RA.sort(l));return f.jsxs(Ir,{children:[f.jsx(Rr,{style:fe(r.attributeName),children:i??n.localId}),f.jsx(Pr,{children:s.map((a,c)=>f.jsx(Ar,{decision:a,choiceValuesNames:o},c))})]})}function Dr(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 Vr=p.pipe(p.Str.Ord,p.Ord.contramap(e=>e.attributeId.localId));function Eo(e){const{blockingDecisions:t,desiredDecisions:n,...o}=e,i=p.pipe([...n.map(r=>({...r,intention:"add"})),...t.map(r=>({...r,intention:"remove"}))],p.RNEA.groupBy(r=>Dr(r.attributeId)),p.RR.collect(p.Ord.trivial)((r,l)=>({key:r,attributeId:p.RNEA.head(l).attributeId,decisions:l})),p.RA.sort(Vr));return f.jsx("div",{...o,children:i.map(r=>f.jsx(Or,{decisions:r.decisions},r.key))})}const jr=k(Eo)`
|
|
137
116
|
display: grid;
|
|
138
117
|
grid-template-columns: [name] minmax(150px, auto) [values] minmax(0px, 1fr);
|
|
139
118
|
gap: var(--space-sm);
|
|
140
|
-
|
|
141
|
-
border-radius: var(--shape-border-radius-sm);
|
|
142
|
-
background-color: var(--color-explain-dialog-apply-solution-button-fill);
|
|
143
|
-
color: var(--color-explain-dialog-apply-solution-button-color);
|
|
144
|
-
font-size: 0.9em;
|
|
145
|
-
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
146
|
-
font-weight: 600;
|
|
147
|
-
appearance: none;
|
|
148
|
-
padding: 0.6em 1em;
|
|
149
|
-
border: none;
|
|
150
|
-
width: auto;
|
|
151
|
-
margin-top: var(--space-md);
|
|
152
|
-
|
|
153
|
-
&:focus {
|
|
154
|
-
outline: 2px solid var(--color-explain-dialog-apply-solution-button-outline);
|
|
155
|
-
outline-offset: 1px;
|
|
156
|
-
}
|
|
157
|
-
`;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 Ar=O(po)`
|
|
119
|
+
`;function kr(e){const{explanation:t}=e,{explanationCard:n}=Tt(),o=t.solution.decisions.filter(i=>i.state!=null);return f.jsxs("div",{style:{...Be(n),...wt(n)},children:[f.jsx(jr,{blockingDecisions:t.causedByDecisions,desiredDecisions:o}),f.jsx(wo,{explanation:t})]})}const Mr=k.div`
|
|
158
120
|
ul {
|
|
159
121
|
margin: 0;
|
|
160
122
|
}
|
|
161
123
|
|
|
162
124
|
line-height: 1.5em;
|
|
163
|
-
`,
|
|
125
|
+
`,Fr=k.ul`
|
|
164
126
|
list-style-type: none;
|
|
165
127
|
margin-inline-start: 0;
|
|
166
128
|
padding-inline-start: 0;
|
|
167
|
-
`,
|
|
129
|
+
`,vn=k.ul`
|
|
168
130
|
list-style-type: disc;
|
|
169
131
|
margin-inline-start: 0;
|
|
170
132
|
padding-inline-start: var(--space-lg);
|
|
171
|
-
|
|
172
|
-
font-size: 0.9em;
|
|
173
|
-
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
174
|
-
font-weight: 500;
|
|
175
|
-
`;function Rr(e){const{explanation:t}=e,n=t.causedByCardinalities,o=p.pipe(t.causedByRules,p.RNEA.groupBy(r=>r.configurationModelId),p.RR.collect(p.Str.Ord)((r,i)=>({configurationModelId:r,rules:p.pipe(i,p.RA.map(l=>l.localId),p.RA.sort(p.Str.Ord))})));return d.jsx(Ar,{children:d.jsxs(Er,{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:h.ExplainQuestionType.whyIsStateNotPossible},()=>"why your selection is not possible").with({question:h.ExplainQuestionType.whyIsNotSatisfied,subject:h.ExplainQuestionSubject.configuration},()=>"why your configuration is not satisfied").with({question:h.ExplainQuestionType.whyIsNotSatisfied,subject:h.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`
|
|
176
|
-
font-weight: 500;
|
|
177
|
-
font-family: var(--font-heading);
|
|
133
|
+
`;function Lr(e){const{explanation:t}=e,{explanationCard:n,constraintExplanation:o}=Tt(),i=t.causedByCardinalities,r=p.pipe(t.causedByRules,p.RNEA.groupBy(l=>l.configurationModelId),p.RR.collect(p.Str.Ord)((l,s)=>({configurationModelId:l,rules:p.pipe(s,p.RA.map(a=>a.localId),p.RA.sort(p.Str.Ord))})));return f.jsx(Mr,{style:{...Be(n),...wt(n)},children:f.jsxs(Fr,{children:[r.map(l=>f.jsxs("li",{children:[f.jsx("span",{style:fe(o.configurationModelId),children:l.configurationModelId}),f.jsx(vn,{style:fe(o.ruleId),children:l.rules.map(s=>f.jsx("li",{children:s}))})]})),i.length>0&&f.jsxs("li",{style:fe(o.ruleId),children:[f.jsx("span",{children:"Cardinality"}),f.jsx(vn,{children:i.map(l=>f.jsx("li",{children:l.localId}))})]})]})})}function Ao(e){const{variant:t,...n}=e,{explainQuestion:o}=xe(),{infoMessage:i}=Ye(),r=N.match(o).returnType().with({question:h.ExplainQuestionType.whyIsStateNotPossible},()=>"why your selection is not possible").with({question:h.ExplainQuestionType.whyIsNotSatisfied,subject:h.ExplainQuestionSubject.configuration},()=>"why your configuration is not satisfied").with({question:h.ExplainQuestionType.whyIsNotSatisfied,subject:h.ExplainQuestionSubject.attribute},()=>"why your attribute is not satisfied").with(N.P.nullish,()=>"why your selections are not possible").exhaustive(),l=N.match(t).returnType().with("failedToExplain",()=>f.jsxs(f.Fragment,{children:["Failed to explain ",r,".",f.jsx("br",{}),"Please check your internet connection and try again."]})).with("noExplanationFound",()=>f.jsxs(f.Fragment,{children:["There was no explanation found for ",r,"."]})).with("noSolutionFound",()=>f.jsxs(f.Fragment,{children:["There was no solution found for ",r,"."]})).exhaustive();return f.jsx("div",{...n,style:fe(i),children:l})}const wn=k.div`
|
|
178
134
|
margin-bottom: var(--space-xs);
|
|
179
|
-
|
|
180
|
-
`,fn=O.div`
|
|
135
|
+
`,Sn=k.div`
|
|
181
136
|
display: flex;
|
|
182
137
|
flex-direction: column;
|
|
183
138
|
gap: var(--space-xs);
|
|
184
|
-
`,
|
|
139
|
+
`,Nr=k.div`
|
|
185
140
|
display: flex;
|
|
186
141
|
flex-direction: column;
|
|
187
142
|
gap: var(--space-md);
|
|
188
|
-
`,
|
|
143
|
+
`,Tn=k(Ao)`
|
|
189
144
|
width: min-content;
|
|
190
145
|
min-width: 400px;
|
|
191
146
|
margin: var(--space-sm-fixed) var(--space-md-fixed) var(--space-sm-fixed) var(--space-sm-fixed);
|
|
192
|
-
`;function Pr(){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 re(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 re(e).Node}function Y(e){return e instanceof Element||e instanceof re(e).Element}function ne(e){return e instanceof HTMLElement||e instanceof re(e).HTMLElement}function Ot(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof re(e).ShadowRoot}function He(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=le(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function Vr(e){return["table","td","th"].includes(ye(e))}function _t(e){const t=Ht(),n=le(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 le(e){return re(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=re(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 ie(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 Pe(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 Ae(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(Ae(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 Wr(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 qr(e,t,n,o){const r=Qe(e);let i=Wr(Ae(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=Ae(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:V,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=V??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,V=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(V))?await(i.getScale==null?void 0:i.getScale(V))||{x:1,y:1}:{x:1,y:1},R=it(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:V,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",V=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[V]:0;(!D||!await(l.isElement==null?void 0:l.isElement(I)))&&(D=a.floating[V]||i.floating[x]);const P=S/2-R/2,k=D/2-w[x]/2-1,E=je(m[y],k),N=je(m[v],k),B=E,K=D-w[x]-N,_=D/2-w[x]/2+P,F=kt(B,_,K),$=!s.arrow&&Qe(r)!=null&&_!==F&&i.reference[x]/2-(_<B?E:N)-w[x]/2<0,j=$?_<B?_-B:_-K:0;return{[u]:b[u]+j,data:{[u]:F,centerOffset:_-F-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=Ae(r),v=Ae(a)===a,V=await(s.isRTL==null?void 0:s.isRTL(c.floating)),S=b||(v||!w?[ot(a)]:Kr(a));!b&&x!=="none"&&S.push(...qr(a,w,x,V));const R=[a,...S],I=await So(t,g),D=[];let P=((o=i.flip)==null?void 0:o.overflows)||[];if(C&&D.push(I[y]),m){const B=zr(r,l,V);D.push(I[B[0]],I[B[1]])}if(P=[...P,{placement:r,overflows:D}],!D.every(B=>B<=0)){var k,E;const B=(((k=i.flip)==null?void 0:k.index)||0)+1,K=R[B];if(K)return{data:{index:B,overflows:P},reset:{placement:K}};let _=(E=P.filter(F=>F.overflows[0]<=0).sort((F,$)=>F.overflows[1]-$.overflows[1])[0])==null?void 0:E.placement;if(!_)switch(u){case"bestFit":{var N;const F=(N=P.map($=>[$.placement,$.overflows.filter(j=>j>0).reduce((j,L)=>j+L,0)]).sort(($,j)=>$[1]-j[1])[0])==null?void 0:N[0];F&&(_=F);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=Ae(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(Ae(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],V=u-C[y];u=kt(v,u,V)}if(l){const g=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=x+C[g],V=x-C[y];x=kt(v,x,V)}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=le(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 Ao(e){const t=re(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!==re(e)?!1:t}function Ee(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)?Ao(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=re(i),u=o&&Y(o)?re(o):o;let x=b.frameElement;for(;x&&o&&u!==b;){const w=De(x),g=x.getBoundingClientRect(),y=le(x),v=g.left+(x.clientLeft+parseFloat(y.paddingLeft))*w.x,V=g.top+(x.clientTop+parseFloat(y.paddingTop))*w.y;s*=w.x,c*=w.y,C*=w.x,m*=w.y,s+=v,c+=V,x=re(x).frameElement}}return it({width:C,height:m,x:s,y:c})}const el=[":popover-open",":modal"];function Eo(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?Eo(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=Ee(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 Ee(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 le(o).direction==="rtl"&&(l+=Se(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:a}}function il(e,t){const n=re(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=Ee(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=Ao(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:le(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=le(e).position==="fixed";let l=i?Te(e):e;for(;Y(l)&&!Oe(l);){const a=le(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=Ee(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=Ee(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]=Eo(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)||le(e).position==="fixed"?null:t?t(e):e.offsetParent}function Po(e,t){const n=re(e);if(!ne(e))return n;let o=gn(e,t);for(;o&&Vr(o)&&le(o).position==="static";)o=gn(o,t);return o&&(ye(o)==="html"||ye(o)==="body"&&le(o).position==="static"&&!_t(o))?n:o||yo(e)||n}const ul=async function(e){const t=this.getOffsetParent||Po,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 le(e).direction==="rtl"}const Vo={convertOffsetParentRelativeRectToViewportRelativeRect:tl,getDocumentElement:be,getClippingRect:al,getOffsetParent:Po,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 V=!0;function S(R){const I=R[0].intersectionRatio;if(I!==s){if(!V)return l();I?l(!1,I):o=setTimeout(()=>{l(!1,1e-7)},100)}V=!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 V;(V=u)==null||V.observe(t)})),n()}),c&&!s&&u.observe(c),u.observe(t));let x,w=s?Ee(e):null;s&&g();function g(){const y=Ee(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:Vo,...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=A.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]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,u]=A.useState(o);rt(b,o)||u(o);const[x,w]=A.useState(null),[g,y]=A.useState(null),v=A.useCallback(j=>{j!==I.current&&(I.current=j,w(j))},[]),V=A.useCallback(j=>{j!==D.current&&(D.current=j,y(j))},[]),S=i||x,R=l||g,I=A.useRef(null),D=A.useRef(null),P=A.useRef(C),k=s!=null,E=Cn(s),N=Cn(r),B=A.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(P.current,te)&&(P.current=te,Gi.flushSync(()=>{m(te)}))})},[b,t,n,N]);Ze(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,m(j=>({...j,isPositioned:!1})))},[c]);const K=A.useRef(!1);Ze(()=>(K.current=!0,()=>{K.current=!1}),[]),Ze(()=>{if(S&&(I.current=S),R&&(D.current=R),S&&R){if(E.current)return E.current(S,R,B);B()}},[S,R,B,E,k]);const _=A.useMemo(()=>({reference:I,floating:D,setReference:v,setFloating:V}),[v,V]),F=A.useMemo(()=>({reference:S,floating:R}),[S,R]),$=A.useMemo(()=>{const j={position:n,left:0,top:0};if(!F.floating)return j;const L=xn(F.floating,C.x),te=xn(F.floating,C.y);return a?{...j,transform:"translate("+L+"px, "+te+"px)",...Do(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:te}},[n,a,F.floating,C.x,C.y]);return A.useMemo(()=>({...C,update:B,refs:_,elements:F,floatingStyles:$}),[C,B,_,F,$])}/*!
|
|
147
|
+
`;function Br(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=xe(),{decisionExplanationSolutionsTitle:o,constraintExplanationSolutionsTitle:i}=Tt();return n?f.jsx(Tn,{variant:"failedToExplain"}):e.length===0&&t.length===0?f.jsx(Tn,{variant:"noExplanationFound"}):f.jsxs(Nr,{children:[e.length>0&&f.jsxs("div",{children:[f.jsx(wn,{style:at(o),children:o.staticText}),f.jsx(Sn,{children:e.map(r=>f.jsx(kr,{explanation:r},e.indexOf(r)))})]}),t.length>0&&f.jsxs("div",{children:[f.jsx(wn,{style:at(i),children:i.staticText}),f.jsx(Sn,{children:t.map(r=>f.jsx(Lr,{explanation:r},t.indexOf(r)))})]})]})}function be(e){return Io(e)?(e.nodeName||"").toLowerCase():"#document"}function re(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ce(e){var t;return(t=(Io(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Io(e){return e instanceof Node||e instanceof re(e).Node}function X(e){return e instanceof Element||e instanceof re(e).Element}function ne(e){return e instanceof HTMLElement||e instanceof re(e).HTMLElement}function _t(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof re(e).ShadowRoot}function Xe(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=le(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function $r(e){return["table","td","th"].includes(be(e))}function on(e){const t=rn(),n=le(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 Ro(e){let t=Ae(e);for(;ne(t)&&!ke(t);){if(on(t))return t;t=Ae(t)}return null}function rn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ke(e){return["html","body","#document"].includes(be(e))}function le(e){return re(e).getComputedStyle(e)}function It(e){return X(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ae(e){if(be(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_t(e)&&e.host||Ce(e);return _t(t)?t.host:t}function Po(e){const t=Ae(e);return ke(t)?e.ownerDocument?e.ownerDocument.body:e.body:ne(t)&&Xe(t)?t:Po(t)}function ve(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Po(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=re(i);return r?t.concat(l,l.visualViewport||[],Xe(i)?i:[],l.frameElement&&n?ve(l.frameElement):[]):t.concat(i,ve(i,[],n))}function Oe(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 ie(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&_t(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Oo(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Do(){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 zr(e){return e.mozInputSource===0&&e.isTrusted?!0:Ut()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Wr(e){return qr()?!1:!Ut()&&e.width===0&&e.height===0||Ut()&&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 Kr(){return/apple/i.test(navigator.vendor)}function Ut(){const e=/android/i;return e.test(Oo())||e.test(Do())}function qr(){return Do().includes("jsdom/")}function En(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Hr(e){return"nativeEvent"in e}function _r(e){return e.matches("html,body")}function ye(e){return(e==null?void 0:e.ownerDocument)||document}function Dt(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 De(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Ur="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Vo(e){return ne(e)&&e.matches(Ur)}function Vt(e){e.preventDefault(),e.stopPropagation()}function Qr(e){return e?e.getAttribute("role")==="combobox"&&Vo(e):!1}const Me=Math.min,Ee=Math.max,dt=Math.round,tt=Math.floor,we=e=>({x:e,y:e}),Yr={left:"right",right:"left",bottom:"top",top:"bottom"},Gr={start:"end",end:"start"};function Qt(e,t,n){return Ee(e,Me(t,n))}function Je(e,t){return typeof e=="function"?e(t):e}function Ie(e){return e.split("-")[0]}function Ze(e){return e.split("-")[1]}function jo(e){return e==="x"?"y":"x"}function ln(e){return e==="y"?"height":"width"}function Rt(e){return["top","bottom"].includes(Ie(e))?"y":"x"}function sn(e){return jo(Rt(e))}function Xr(e,t,n){n===void 0&&(n=!1);const o=Ze(e),i=sn(e),r=ln(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=ft(l)),[l,ft(l)]}function Jr(e){const t=ft(e);return[Yt(e),t,Yt(t)]}function Yt(e){return e.replace(/start|end/g,t=>Gr[t])}function Zr(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:l;default:return[]}}function el(e,t,n,o){const i=Ze(e);let r=Zr(Ie(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(Yt)))),r}function ft(e){return e.replace(/left|right|bottom|top/g,t=>Yr[t])}function tl(e){return{top:0,right:0,bottom:0,left:0,...e}}function ko(e){return typeof e!="number"?tl(e):{top:e,right:e,bottom:e,left:e}}function pt(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function An(e,t,n){let{reference:o,floating:i}=e;const r=Rt(t),l=sn(t),s=ln(l),a=Ie(t),c=r==="y",x=o.x+o.width/2-i.width/2,g=o.y+o.height/2-i.height/2,C=o[s]/2-i[s]/2;let u;switch(a){case"top":u={x,y:o.y-i.height};break;case"bottom":u={x,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:g};break;case"left":u={x:o.x-i.width,y:g};break;default:u={x:o.x,y:o.y}}switch(Ze(t)){case"start":u[l]-=C*(n&&c?-1:1);break;case"end":u[l]+=C*(n&&c?-1:1);break}return u}const nl=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,s=r.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x,y:g}=An(c,o,a),C=o,u={},b=0;for(let w=0;w<s.length;w++){const{name:y,fn:m}=s[w],{x:v,y:P,data:S,reset:I}=await m({x,y:g,initialPlacement:o,placement:C,strategy:i,middlewareData:u,rects:c,platform:l,elements:{reference:e,floating:t}});x=v??x,g=P??g,u={...u,[y]:{...u[y],...S}},I&&b<=50&&(b++,typeof I=="object"&&(I.placement&&(C=I.placement),I.rects&&(c=I.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):I.rects),{x,y:g}=An(c,C,a)),w=-1)}return{x,y:g,placement:C,strategy:i,middlewareData:u}};async function Mo(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:r,rects:l,elements:s,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:x="viewport",elementContext:g="floating",altBoundary:C=!1,padding:u=0}=Je(t,e),b=ko(u),y=s[C?g==="floating"?"reference":"floating":g],m=pt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(y)))==null||n?y:y.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:x,strategy:a})),v=g==="floating"?{...l.floating,x:o,y:i}:l.reference,P=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),S=await(r.isElement==null?void 0:r.isElement(P))?await(r.getScale==null?void 0:r.getScale(P))||{x:1,y:1}:{x:1,y:1},I=pt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:P,strategy:a}):v);return{top:(m.top-I.top+b.top)/S.y,bottom:(I.bottom-m.bottom+b.bottom)/S.y,left:(m.left-I.left+b.left)/S.x,right:(I.right-m.right+b.right)/S.x}}const ol=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:l,elements:s,middlewareData:a}=t,{element:c,padding:x=0}=Je(e,t)||{};if(c==null)return{};const g=ko(x),C={x:n,y:o},u=sn(i),b=ln(u),w=await l.getDimensions(c),y=u==="y",m=y?"top":"left",v=y?"bottom":"right",P=y?"clientHeight":"clientWidth",S=r.reference[b]+r.reference[u]-C[u]-r.floating[b],I=C[u]-r.reference[u],R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let D=R?R[P]:0;(!D||!await(l.isElement==null?void 0:l.isElement(R)))&&(D=s.floating[P]||r.floating[b]);const O=S/2-I/2,j=D/2-w[b]/2-1,A=Me(g[m],j),F=Me(g[v],j),B=A,W=D-w[b]-F,H=D/2-w[b]/2+O,M=Qt(B,H,W),$=!a.arrow&&Ze(i)!=null&&H!==M&&r.reference[b]/2-(H<B?A:F)-w[b]/2<0,V=$?H<B?H-B:H-W:0;return{[u]:C[u]+V,data:{[u]:M,centerOffset:H-M-V,...$&&{alignmentOffset:V}},reset:$}}}),il=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:s,platform:a,elements:c}=t,{mainAxis:x=!0,crossAxis:g=!0,fallbackPlacements:C,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...y}=Je(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const m=Ie(i),v=Ie(s)===s,P=await(a.isRTL==null?void 0:a.isRTL(c.floating)),S=C||(v||!w?[ft(s)]:Jr(s));!C&&b!=="none"&&S.push(...el(s,w,b,P));const I=[s,...S],R=await Mo(t,y),D=[];let O=((o=r.flip)==null?void 0:o.overflows)||[];if(x&&D.push(R[m]),g){const B=Xr(i,l,P);D.push(R[B[0]],R[B[1]])}if(O=[...O,{placement:i,overflows:D}],!D.every(B=>B<=0)){var j,A;const B=(((j=r.flip)==null?void 0:j.index)||0)+1,W=I[B];if(W)return{data:{index:B,overflows:O},reset:{placement:W}};let H=(A=O.filter(M=>M.overflows[0]<=0).sort((M,$)=>M.overflows[1]-$.overflows[1])[0])==null?void 0:A.placement;if(!H)switch(u){case"bestFit":{var F;const M=(F=O.map($=>[$.placement,$.overflows.filter(V=>V>0).reduce((V,L)=>V+L,0)]).sort(($,V)=>$[1]-V[1])[0])==null?void 0:F[0];M&&(H=M);break}case"initialPlacement":H=s;break}if(i!==H)return{reset:{placement:H}}}return{}}}};async function rl(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=Ie(n),s=Ze(n),a=Rt(n)==="y",c=["left","top"].includes(l)?-1:1,x=r&&a?-1:1,g=Je(t,e);let{mainAxis:C,crossAxis:u,alignmentAxis:b}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return s&&typeof b=="number"&&(u=s==="end"?b*-1:b),a?{x:u*x,y:C*c}:{x:C*c,y:u*x}}const ll=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:l,middlewareData:s}=t,a=await rl(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:l}}}}},sl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:s={fn:y=>{let{x:m,y:v}=y;return{x:m,y:v}}},...a}=Je(e,t),c={x:n,y:o},x=await Mo(t,a),g=Rt(Ie(i)),C=jo(g);let u=c[C],b=c[g];if(r){const y=C==="y"?"top":"left",m=C==="y"?"bottom":"right",v=u+x[y],P=u-x[m];u=Qt(v,u,P)}if(l){const y=g==="y"?"top":"left",m=g==="y"?"bottom":"right",v=b+x[y],P=b-x[m];b=Qt(v,b,P)}const w=s.fn({...t,[C]:u,[g]:b});return{...w,data:{x:w.x-n,y:w.y-o}}}}};function Fo(e){const t=le(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=ne(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,s=dt(n)!==r||dt(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function an(e){return X(e)?e:e.contextElement}function je(e){const t=an(e);if(!ne(t))return we(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Fo(t);let l=(r?dt(n.width):n.width)/o,s=(r?dt(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const al=we(0);function Lo(e){const t=re(e);return!rn()||!t.visualViewport?al:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==re(e)?!1:t}function Re(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=an(e);let l=we(1);t&&(o?X(o)&&(l=je(o)):l=je(e));const s=cl(r,n,o)?Lo(r):we(0);let a=(i.left+s.x)/l.x,c=(i.top+s.y)/l.y,x=i.width/l.x,g=i.height/l.y;if(r){const C=re(r),u=o&&X(o)?re(o):o;let b=C.frameElement;for(;b&&o&&u!==C;){const w=je(b),y=b.getBoundingClientRect(),m=le(b),v=y.left+(b.clientLeft+parseFloat(m.paddingLeft))*w.x,P=y.top+(b.clientTop+parseFloat(m.paddingTop))*w.y;a*=w.x,c*=w.y,x*=w.x,g*=w.y,a+=v,c+=P,b=re(b).frameElement}}return pt({width:x,height:g,x:a,y:c})}const ul=[":popover-open",":modal"];function No(e){let t=!1,n=0,o=0;function i(r){try{t=t||e.matches(r)}catch{}}if(ul.forEach(r=>{i(r)}),t){const r=Ro(e);if(r){const l=r.getBoundingClientRect();n=l.x,o=l.y}}return[t,n,o]}function dl(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=Ce(o),[l]=t?No(t.floating):[!1];if(o===r||l)return n;let s={scrollLeft:0,scrollTop:0},a=we(1);const c=we(0),x=ne(o);if((x||!x&&i!=="fixed")&&((be(o)!=="body"||Xe(r))&&(s=It(o)),ne(o))){const g=Re(o);a=je(o),c.x=g.x+o.clientLeft,c.y=g.y+o.clientTop}return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-s.scrollLeft*a.x+c.x,y:n.y*a.y-s.scrollTop*a.y+c.y}}function fl(e){return Array.from(e.getClientRects())}function Bo(e){return Re(Ce(e)).left+It(e).scrollLeft}function pl(e){const t=Ce(e),n=It(e),o=e.ownerDocument.body,i=Ee(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Ee(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Bo(e);const s=-n.scrollTop;return le(o).direction==="rtl"&&(l+=Ee(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:s}}function hl(e,t){const n=re(e),o=Ce(e),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,a=0;if(i){r=i.width,l=i.height;const c=rn();(!c||c&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}return{width:r,height:l,x:s,y:a}}function gl(e,t){const n=Re(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=ne(e)?je(e):we(1),l=e.clientWidth*r.x,s=e.clientHeight*r.y,a=i*r.x,c=o*r.y;return{width:l,height:s,x:a,y:c}}function In(e,t,n){let o;if(t==="viewport")o=hl(e,n);else if(t==="document")o=pl(Ce(e));else if(X(t))o=gl(t,n);else{const i=Lo(e);o={...t,x:t.x-i.x,y:t.y-i.y}}return pt(o)}function $o(e,t){const n=Ae(e);return n===t||!X(n)||ke(n)?!1:le(n).position==="fixed"||$o(n,t)}function ml(e,t){const n=t.get(e);if(n)return n;let o=ve(e,[],!1).filter(s=>X(s)&&be(s)!=="body"),i=null;const r=le(e).position==="fixed";let l=r?Ae(e):e;for(;X(l)&&!ke(l);){const s=le(l),a=on(l);!a&&s.position==="fixed"&&(i=null),(r?!a&&!i:!a&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Xe(l)&&!a&&$o(e,l))?o=o.filter(x=>x!==l):i=s,l=Ae(l)}return t.set(e,o),o}function yl(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?ml(t,this._c):[].concat(n),o],s=l[0],a=l.reduce((c,x)=>{const g=In(t,x,i);return c.top=Ee(g.top,c.top),c.right=Me(g.right,c.right),c.bottom=Me(g.bottom,c.bottom),c.left=Ee(g.left,c.left),c},In(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function bl(e){const{width:t,height:n}=Fo(e);return{width:t,height:n}}function xl(e,t,n,o){const i=ne(t),r=Ce(t),l=n==="fixed",s=Re(e,!0,l,t);let a={scrollLeft:0,scrollTop:0};const c=we(0);if(i||!i&&!l)if((be(t)!=="body"||Xe(r))&&(a=It(t)),i){const w=Re(t,!0,l,t);c.x=w.x+t.clientLeft,c.y=w.y+t.clientTop}else r&&(c.x=Bo(r));let x=s.left+a.scrollLeft-c.x,g=s.top+a.scrollTop-c.y;const[C,u,b]=No(o);return C&&(x+=u,g+=b,i&&(x+=t.clientLeft,g+=t.clientTop)),{x,y:g,width:s.width,height:s.height}}function Rn(e,t){return!ne(e)||le(e).position==="fixed"?null:t?t(e):e.offsetParent}function zo(e,t){const n=re(e);if(!ne(e))return n;let o=Rn(e,t);for(;o&&$r(o)&&le(o).position==="static";)o=Rn(o,t);return o&&(be(o)==="html"||be(o)==="body"&&le(o).position==="static"&&!on(o))?n:o||Ro(e)||n}const Cl=async function(e){const t=this.getOffsetParent||zo,n=this.getDimensions;return{reference:xl(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function vl(e){return le(e).direction==="rtl"}const Wo={convertOffsetParentRelativeRectToViewportRelativeRect:dl,getDocumentElement:Ce,getClippingRect:yl,getOffsetParent:zo,getElementRects:Cl,getClientRects:fl,getDimensions:bl,getScale:je,isElement:X,isRTL:vl};function wl(e,t){let n=null,o;const i=Ce(e);function r(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),r();const{left:c,top:x,width:g,height:C}=e.getBoundingClientRect();if(s||t(),!g||!C)return;const u=tt(x),b=tt(i.clientWidth-(c+g)),w=tt(i.clientHeight-(x+C)),y=tt(c),v={rootMargin:-u+"px "+-b+"px "+-w+"px "+-y+"px",threshold:Ee(0,Me(1,a))||1};let P=!0;function S(I){const R=I[0].intersectionRatio;if(R!==a){if(!P)return l();R?l(!1,R):o=setTimeout(()=>{l(!1,1e-7)},100)}P=!1}try{n=new IntersectionObserver(S,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,v)}n.observe(e)}return l(!0),r}function Sl(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,c=an(e),x=i||r?[...c?ve(c):[],...ve(t)]:[];x.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),r&&m.addEventListener("resize",n)});const g=c&&s?wl(c,n):null;let C=-1,u=null;l&&(u=new ResizeObserver(m=>{let[v]=m;v&&v.target===c&&u&&(u.unobserve(t),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var P;(P=u)==null||P.observe(t)})),n()}),c&&!a&&u.observe(c),u.observe(t));let b,w=a?Re(e):null;a&&y();function y(){const m=Re(e);w&&(m.x!==w.x||m.y!==w.y||m.width!==w.width||m.height!==w.height)&&n(),w=m,b=requestAnimationFrame(y)}return n(),()=>{var m;x.forEach(v=>{i&&v.removeEventListener("scroll",n),r&&v.removeEventListener("resize",n)}),g==null||g(),(m=u)==null||m.disconnect(),u=null,a&&cancelAnimationFrame(b)}}const Tl=sl,El=il,Pn=ol,Al=(e,t,n)=>{const o=new Map,i={platform:Wo,...n},r={...i.platform,_c:o};return nl(e,t,{...i,platform:r})},Il=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:i}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Pn({element:o.current,padding:i}).fn(n):{}:o?Pn({element:o,padding:i}).fn(n):{}}}};var it=typeof document<"u"?T.useLayoutEffect:T.useEffect;function ht(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,i;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(!ht(e[o],t[o]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,i[o]))return!1;for(o=n;o--!==0;){const r=i[o];if(!(r==="_owner"&&e.$$typeof)&&!ht(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function Ko(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function On(e,t){const n=Ko(e);return Math.round(t*n)/n}function Dn(e){const t=E.useRef(e);return it(()=>{t.current=e}),t}function Rl(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:r,floating:l}={},transform:s=!0,whileElementsMounted:a,open:c}=e,[x,g]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[C,u]=E.useState(o);ht(C,o)||u(o);const[b,w]=E.useState(null),[y,m]=E.useState(null),v=E.useCallback(V=>{V!==R.current&&(R.current=V,w(V))},[]),P=E.useCallback(V=>{V!==D.current&&(D.current=V,m(V))},[]),S=r||b,I=l||y,R=E.useRef(null),D=E.useRef(null),O=E.useRef(x),j=a!=null,A=Dn(a),F=Dn(i),B=E.useCallback(()=>{if(!R.current||!D.current)return;const V={placement:t,strategy:n,middleware:C};F.current&&(V.platform=F.current),Al(R.current,D.current,V).then(L=>{const te={...L,isPositioned:!0};W.current&&!ht(O.current,te)&&(O.current=te,sr.flushSync(()=>{g(te)}))})},[C,t,n,F]);it(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,g(V=>({...V,isPositioned:!1})))},[c]);const W=E.useRef(!1);it(()=>(W.current=!0,()=>{W.current=!1}),[]),it(()=>{if(S&&(R.current=S),I&&(D.current=I),S&&I){if(A.current)return A.current(S,I,B);B()}},[S,I,B,A,j]);const H=E.useMemo(()=>({reference:R,floating:D,setReference:v,setFloating:P}),[v,P]),M=E.useMemo(()=>({reference:S,floating:I}),[S,I]),$=E.useMemo(()=>{const V={position:n,left:0,top:0};if(!M.floating)return V;const L=On(M.floating,x.x),te=On(M.floating,x.y);return s?{...V,transform:"translate("+L+"px, "+te+"px)",...Ko(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:te}},[n,s,M.floating,x.x,x.y]);return E.useMemo(()=>({...x,update:B,refs:H,elements:M,floatingStyles:$}),[x,B,H,M,$])}/*!
|
|
193
148
|
* tabbable 6.2.0
|
|
194
149
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
195
|
-
*/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",We=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&&We.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=We.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"},Al=function(t){return Fo(t)&&t.type==="hidden"},El=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},Pl=function(t){return Fo(t)&&t.type==="radio"},Vl=function(t){return Pl(t)&&!Il(t)},Dl=function(t){var n,o=t&<(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=We.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(We.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 We.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},kl=function(t,n){return!(n.disabled||at(n)||Al(n)||Ol(n,t)||El(n)||jl(n))},wn=function(t,n){return!(Vl(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 A.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const Ll=A["useInsertionEffect".toString()],Ml=Ll||(e=>e());function Ve(e){const t=A.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Ml(()=>{t.current=e}),A.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]=A.useState(()=>Ct?Tn():void 0);return ae(()=>{e==null&&t(Tn())},[]),A.useEffect(()=>{Ct||(Ct=!0)},[]),e}const zl=A["useId".toString()],yt=zl||$l,Kl=A.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),V=a/2*s/4,[S,R]=o.split("-"),I=Vo.isRTL(r),D=!!b,P=S==="top"||S==="bottom",k=C&&R==="end"?"bottom":"top";let E=C&&R==="end"?"right":"left";C&&I&&(E=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-V))+(" Q"+l/2+","+a+" "+v+","+(a-V))+" Z",_={top:D?"rotate(180deg)":"",left:D?"rotate(90deg)":"rotate(-90deg)",bottom:D?"":"rotate(180deg)",right:D?"rotate(-90deg)":"rotate(90deg)"}[S];return A.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",[E]:N,[k]:B,[S]:P||D?"100%":"calc(100% - "+c/2+"px)",transform:""+_+(u??""),...x}}),c>0&&A.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:m,strokeWidth:c+(b?0:1),d:K}),A.createElement("path",{stroke:c&&!b?w.fill:"none",d:K}),A.createElement("clipPath",{id:g},A.createElement("rect",{x:-y,y:y*(D?-1:1),width:l+c,height:l})))});function Wl(){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 ql=A.createContext(null),_l=A.createContext(null),Hl=()=>{var e;return((e=A.useContext(ql))==null?void 0:e.id)||null},Jt=()=>A.useContext(_l);function qe(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.clear();function m(u){!u||a.has(u)||(a.add(u),u.parentNode&&m(u.parentNode))}function b(u){!u||s.has(u)||Array.prototype.forEach.call(u.children,x=>{if(a.has(x))b(x);else{const w=i?x.getAttribute(i):null,g=w!==null&&w!=="false",y=(Re.get(x)||0)+1,v=(C.get(x)||0)+1;Re.set(x,y),C.set(x,v),c.push(x),y===1&&g&&Xe.add(x),v===1&&x.setAttribute(r,""),!g&&i&&x.setAttribute(i,"true")}})}return wt++,()=>{c.forEach(u=>{const x=(Re.get(u)||0)-1,w=(C.get(u)||0)-1;Re.set(u,x),C.set(u,w),x||(!Xe.has(u)&&i&&u.removeAttribute(i),Xe.delete(u)),w||u.removeAttribute(r)}),wt--,wt||(Re=new WeakMap,Re=new WeakMap,Xe=new WeakSet,Je={})}}function An(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=me(e[0]).body;return Yl(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const Zt=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Lo(e,t){const n=Yt(e,Zt());t==="prev"&&n.reverse();const o=n.indexOf(Ie(me(e)));return n.slice(o+1)[0]}function Mo(){return Lo(document.body,"next")}function Bo(){return Lo(document.body,"prev")}function ze(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!ie(n,o)}function Xl(e){Yt(e,Zt()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Jl(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}const en={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let Zl;function En(e){e.key==="Tab"&&(e.target,clearTimeout(Zl))}const st=A.forwardRef(function(t,n){const[o,r]=A.useState();ae(()=>(jr()&&r("button"),document.addEventListener("keydown",En),()=>{document.removeEventListener("keydown",En)}),[]);const i={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[qe("focus-guard")]:"",style:en};return A.createElement("span",ke({},t,i))}),$o=A.createContext(null),Rn=qe("portal");function ea(e){let{id:t,root:n}=e===void 0?{}:e;const[o,r]=A.useState(null),i=yt(),l=Ko(),a=A.useRef(null);return ae(()=>()=>{o==null||o.remove(),queueMicrotask(()=>{a.current=null})},[o]),ae(()=>{if(a.current)return;const s=t?document.getElementById(t):null;if(!s)return;const c=document.createElement("div");c.id=i,c.setAttribute(Rn,""),s.appendChild(c),a.current=c,r(c)},[t,i]),ae(()=>{if(a.current)return;let s=n||(l==null?void 0:l.portalNode);s&&!Y(s)&&(s=s.current),s=s||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,s.appendChild(c));const C=document.createElement("div");C.id=i,C.setAttribute(Rn,""),s=c||s,s.appendChild(C),a.current=C,r(C)},[t,n,i,l]),o}function zo(e){let{children:t,id:n,root:o=null,preserveTabOrder:r=!0}=e;const i=ea({id:n,root:o}),[l,a]=A.useState(null),s=A.useRef(null),c=A.useRef(null),C=A.useRef(null),m=A.useRef(null),b=!!l&&!l.modal&&l.open&&r&&!!(o||i);return A.useEffect(()=>{if(!i||!r||l!=null&&l.modal)return;function u(x){i&&ze(x)&&(x.type==="focusin"?Jl:Xl)(i)}return i.addEventListener("focusin",u,!0),i.addEventListener("focusout",u,!0),()=>{i.removeEventListener("focusin",u,!0),i.removeEventListener("focusout",u,!0)}},[i,r,l==null?void 0:l.modal]),A.createElement($o.Provider,{value:A.useMemo(()=>({preserveTabOrder:r,beforeOutsideRef:s,afterOutsideRef:c,beforeInsideRef:C,afterInsideRef:m,portalNode:i,setFocusManagerState:a}),[r,i])},b&&i&&A.createElement(st,{"data-type":"outside",ref:s,onFocus:u=>{if(ze(u,i)){var x;(x=C.current)==null||x.focus()}else{const w=Bo()||(l==null?void 0:l.refs.domReference.current);w==null||w.focus()}}}),b&&i&&A.createElement("span",{"aria-owns":i.id,style:en}),i&&no.createPortal(t,i),b&&i&&A.createElement(st,{"data-type":"outside",ref:c,onFocus:u=>{if(ze(u,i)){var x;(x=m.current)==null||x.focus()}else{const w=Mo()||(l==null?void 0:l.refs.domReference.current);w==null||w.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,u.nativeEvent))}}}))}const Ko=()=>A.useContext($o),In=20;let we=[];function St(e){we=we.filter(t=>t.isConnected),e&&ye(e)!=="body"&&(we.push(e),we.length>In&&(we=we.slice(-In)))}function Pn(){return we.slice().reverse().find(e=>e.isConnected)}const ta=A.forwardRef(function(t,n){return A.createElement("button",ke({},t,{type:"button",ref:n,tabIndex:-1,style:en}))});function Wo(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:l=0,returnFocus:a=!0,modal:s=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:C=!0}=e,{open:m,refs:b,nodeId:u,onOpenChange:x,events:w,dataRef:g,elements:{domReference:y,floating:v}}=t,V=typeof l=="number"&&l<0,S=Mr(y)&&V,R=Ql()?i:!0,I=vt(r),D=vt(l),P=vt(a),k=Jt(),E=Ko(),N=A.useRef(null),B=A.useRef(null),K=A.useRef(!1),_=A.useRef(!1),F=E!=null,$=A.useCallback(function(q){return q===void 0&&(q=v),q?Yt(q,Zt()):[]},[v]),j=A.useCallback(q=>{const W=$(q);return I.current.map(z=>y&&z==="reference"?y:v&&z==="floating"?v:W).filter(Boolean).flat()},[y,v,I,$]);A.useEffect(()=>{if(o||!s)return;function q(z){if(z.key==="Tab"){ie(v,Ie(me(v)))&&$().length===0&&!S&&xt(z);const H=j(),Q=Pe(z);I.current[0]==="reference"&&Q===y&&(xt(z),z.shiftKey?ve(H[H.length-1]):ve(H[1])),I.current[1]==="floating"&&Q===v&&z.shiftKey&&(xt(z),ve(H[0]))}}const W=me(v);return W.addEventListener("keydown",q),()=>{W.removeEventListener("keydown",q)}},[o,y,v,s,I,S,$,j]),A.useEffect(()=>{if(o||!C)return;function q(){_.current=!0,setTimeout(()=>{_.current=!1})}function W(z){const H=z.relatedTarget;queueMicrotask(()=>{const Q=!(ie(y,H)||ie(v,H)||ie(H,v)||ie(E==null?void 0:E.portalNode,H)||H!=null&&H.hasAttribute(qe("focus-guard"))||k&&($e(k.nodesRef.current,u).find(G=>{var ee,ue;return ie((ee=G.context)==null?void 0:ee.elements.floating,H)||ie((ue=G.context)==null?void 0:ue.elements.domReference,H)})||Ul(k.nodesRef.current,u).find(G=>{var ee,ue;return((ee=G.context)==null?void 0:ee.elements.floating)===H||((ue=G.context)==null?void 0:ue.elements.domReference)===H})));H&&Q&&!_.current&&H!==Pn()&&(K.current=!0,x(!1,z))})}if(v&&ne(y))return y.addEventListener("focusout",W),y.addEventListener("pointerdown",q),!s&&v.addEventListener("focusout",W),()=>{y.removeEventListener("focusout",W),y.removeEventListener("pointerdown",q),!s&&v.removeEventListener("focusout",W)}},[o,y,v,s,u,k,E,x,C]),A.useEffect(()=>{var q;if(o)return;const W=Array.from((E==null||(q=E.portalNode)==null?void 0:q.querySelectorAll("["+qe("portal")+"]"))||[]);if(v){const z=[v,...W,N.current,B.current,I.current.includes("reference")||S?y:null].filter(Q=>Q!=null),H=s||S?An(z,R,!R):An(z);return()=>{H()}}},[o,y,v,s,I,E,S,R]),ae(()=>{if(o||!v)return;const q=me(v),W=Ie(q);queueMicrotask(()=>{const z=j(v),H=D.current,Q=(typeof H=="number"?z[H]:H.current)||v,G=ie(v,W);!V&&!G&&m&&ve(Q,{preventScroll:Q===v})})},[o,m,v,V,j,D]),ae(()=>{if(o||!v)return;let q=!1;const W=me(v),z=Ie(W),H=g.current;St(z);function Q(G){let{reason:ee,event:ue,nested:Be}=G;ee==="escape-key"&&b.domReference.current&&St(b.domReference.current),ee==="hover"&&ue.type==="mouseleave"&&(K.current=!0),ee==="outside-press"&&(Be?(K.current=!1,q=!0):K.current=!(Dr(ue)||Or(ue)))}return w.on("openchange",Q),()=>{w.off("openchange",Q);const G=Ie(W),ee=ie(v,G)||k&&$e(k.nodesRef.current,u).some(Ni=>{var an;return ie((an=Ni.context)==null?void 0:an.elements.floating,G)});(ee||H.openEvent&&["click","mousedown"].includes(H.openEvent.type))&&b.domReference.current&&St(b.domReference.current);const Be=Pn();P.current&&!K.current&&ne(Be)&&(!(Be!==G&&G!==W.body)||ee)&&ve(Be,{cancelPrevious:!1,preventScroll:q})}},[o,v,P,g,b,w,k,u]),ae(()=>{if(!(o||!E))return E.setFocusManagerState({modal:s,closeOnFocusOut:C,open:m,onOpenChange:x,refs:b}),()=>{E.setFocusManagerState(null)}},[o,E,s,m,x,b,C]),ae(()=>{if(o||!v||typeof MutationObserver!="function"||V)return;const q=()=>{const z=v.getAttribute("tabindex");I.current.includes("floating")||Ie(me(v))!==b.domReference.current&&$().length===0?z!=="0"&&v.setAttribute("tabindex","0"):z!=="-1"&&v.setAttribute("tabindex","-1")};q();const W=new MutationObserver(q);return W.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{W.disconnect()}},[o,v,b,I,$,V]);function L(q){return o||!c||!s?null:A.createElement(ta,{ref:q==="start"?N:B,onClick:W=>x(!1,W.nativeEvent)},typeof c=="string"?c:"Dismiss")}const te=!o&&R&&(F||s);return A.createElement(A.Fragment,null,te&&A.createElement(st,{"data-type":"inside",ref:E==null?void 0:E.beforeInsideRef,onFocus:q=>{if(s){const z=j();ve(r[0]==="reference"?z[0]:z[z.length-1])}else if(E!=null&&E.preserveTabOrder&&E.portalNode)if(K.current=!1,ze(q,E.portalNode)){const z=Mo()||y;z==null||z.focus()}else{var W;(W=E.beforeOutsideRef.current)==null||W.focus()}}}),!S&&L("start"),n,L("end"),te&&A.createElement(st,{"data-type":"inside",ref:E==null?void 0:E.afterInsideRef,onFocus:q=>{if(s)ve(j()[0]);else if(E!=null&&E.preserveTabOrder&&E.portalNode)if(C&&(K.current=!0),ze(q,E.portalNode)){const z=Bo()||y;z==null||z.focus()}else{var W;(W=E.afterOutsideRef.current)==null||W.focus()}}}))}const Tt=new Set,qo=A.forwardRef(function(t,n){let{lockScroll:o=!1,...r}=t;const i=yt();return ae(()=>{if(!o)return;Tt.add(i);const l=/iP(hone|ad|od)|iOS/.test(bo()),a=document.body.style,c=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",C=window.innerWidth-document.documentElement.clientWidth,m=a.left?parseFloat(a.left):window.pageXOffset,b=a.top?parseFloat(a.top):window.pageYOffset;if(a.overflow="hidden",C&&(a[c]=C+"px"),l){var u,x;const w=((u=window.visualViewport)==null?void 0:u.offsetLeft)||0,g=((x=window.visualViewport)==null?void 0:x.offsetTop)||0;Object.assign(a,{position:"fixed",top:-(b-Math.floor(g))+"px",left:-(m-Math.floor(w))+"px",right:"0"})}return()=>{Tt.delete(i),Tt.size===0&&(Object.assign(a,{overflow:"",[c]:""}),l&&(Object.assign(a,{position:"",top:"",left:"",right:""}),window.scrollTo(m,b)))}},[i,o]),A.createElement("div",ke({ref:n},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))});function Vn(e){return ne(e.target)&&e.target.tagName==="BUTTON"}function Dn(e){return Co(e)}function _o(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,elements:{domReference:i}}=e,{enabled:l=!0,event:a="click",toggle:s=!0,ignoreMouse:c=!1,keyboardHandlers:C=!0}=t,m=A.useRef(),b=A.useRef(!1);return A.useMemo(()=>l?{reference:{onPointerDown(u){m.current=u.pointerType},onMouseDown(u){u.button===0&&(hn(m.current,!0)&&c||a!=="click"&&(n&&s&&(!r.current.openEvent||r.current.openEvent.type==="mousedown")?o(!1,u.nativeEvent,"click"):(u.preventDefault(),o(!0,u.nativeEvent,"click"))))},onClick(u){if(a==="mousedown"&&m.current){m.current=void 0;return}hn(m.current,!0)&&c||(n&&s&&(!r.current.openEvent||r.current.openEvent.type==="click")?o(!1,u.nativeEvent,"click"):o(!0,u.nativeEvent,"click"))},onKeyDown(u){m.current=void 0,!(u.defaultPrevented||!C||Vn(u))&&(u.key===" "&&!Dn(i)&&(u.preventDefault(),b.current=!0),u.key==="Enter"&&o(!(n&&s),u.nativeEvent,"click"))},onKeyUp(u){u.defaultPrevented||!C||Vn(u)||Dn(i)||u.key===" "&&b.current&&(b.current=!1,o(!(n&&s),u.nativeEvent,"click"))}}}:{},[l,r,a,c,C,i,s,n,o])}const na={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},oa={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},On=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function Ho(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,nodeId:r,elements:{reference:i,domReference:l,floating:a},dataRef:s}=e,{enabled:c=!0,escapeKey:C=!0,outsidePress:m=!0,outsidePressEvent:b="pointerdown",referencePress:u=!1,referencePressEvent:x="pointerdown",ancestorScroll:w=!1,bubbles:g,capture:y}=t,v=Jt(),V=Ve(typeof m=="function"?m:()=>!1),S=typeof m=="function"?V:m,R=A.useRef(!1),I=A.useRef(!1),{escapeKey:D,outsidePress:P}=On(g),{escapeKey:k,outsidePress:E}=On(y),N=Ve(F=>{if(!n||!c||!C||F.key!=="Escape")return;const $=v?$e(v.nodesRef.current,r):[];if(!D&&(F.stopPropagation(),$.length>0)){let j=!0;if($.forEach(L=>{var te;if((te=L.context)!=null&&te.open&&!L.context.dataRef.current.__escapeKeyBubbles){j=!1;return}}),!j)return}o(!1,Fr(F)?F.nativeEvent:F,"escape-key")}),B=Ve(F=>{var $;const j=()=>{var L;N(F),(L=Pe(F))==null||L.removeEventListener("keydown",j)};($=Pe(F))==null||$.addEventListener("keydown",j)}),K=Ve(F=>{const $=R.current;R.current=!1;const j=I.current;if(I.current=!1,b==="click"&&j||$||typeof S=="function"&&!S(F))return;const L=Pe(F),te="["+qe("inert")+"]",q=me(a).querySelectorAll(te);let W=Y(L)?L:null;for(;W&&!Oe(W);){const Q=Te(W);if(Oe(Q)||!Y(Q))break;W=Q}if(q.length&&Y(L)&&!Nr(L)&&!ie(L,a)&&Array.from(q).every(Q=>!ie(W,Q)))return;if(ne(L)&&a){const Q=L.clientWidth>0&&L.scrollWidth>L.clientWidth,G=L.clientHeight>0&&L.scrollHeight>L.clientHeight;let ee=G&&F.offsetX>L.clientWidth;if(G&&le(L).direction==="rtl"&&(ee=F.offsetX<=L.offsetWidth-L.clientWidth),ee||Q&&F.offsetY>L.clientHeight)return}const z=v&&$e(v.nodesRef.current,r).some(Q=>{var G;return bt(F,(G=Q.context)==null?void 0:G.elements.floating)});if(bt(F,a)||bt(F,l)||z)return;const H=v?$e(v.nodesRef.current,r):[];if(H.length>0){let Q=!0;if(H.forEach(G=>{var ee;if((ee=G.context)!=null&&ee.open&&!G.context.dataRef.current.__outsidePressBubbles){Q=!1;return}}),!Q)return}o(!1,F,"outside-press")}),_=Ve(F=>{var $;const j=()=>{var L;K(F),(L=Pe(F))==null||L.removeEventListener(b,j)};($=Pe(F))==null||$.addEventListener(b,j)});return A.useEffect(()=>{if(!n||!c)return;s.current.__escapeKeyBubbles=D,s.current.__outsidePressBubbles=P;function F(L){o(!1,L,"ancestor-scroll")}const $=me(a);C&&$.addEventListener("keydown",k?B:N,k),S&&$.addEventListener(b,E?_:K,E);let j=[];return w&&(Y(l)&&(j=xe(l)),Y(a)&&(j=j.concat(xe(a))),!Y(i)&&i&&i.contextElement&&(j=j.concat(xe(i.contextElement)))),j=j.filter(L=>{var te;return L!==((te=$.defaultView)==null?void 0:te.visualViewport)}),j.forEach(L=>{L.addEventListener("scroll",F,{passive:!0})}),()=>{C&&$.removeEventListener("keydown",k?B:N,k),S&&$.removeEventListener(b,E?_:K,E),j.forEach(L=>{L.removeEventListener("scroll",F)})}},[s,a,l,i,C,S,b,n,o,w,c,D,P,N,k,B,K,E,_]),A.useEffect(()=>{R.current=!1},[S,b]),A.useMemo(()=>c?{reference:{onKeyDown:N,[na[x]]:F=>{u&&o(!1,F.nativeEvent,"reference-press")}},floating:{onKeyDown:N,onMouseDown(){I.current=!0},onMouseUp(){I.current=!0},[oa[b]]:()=>{R.current=!0}}}:{},[c,u,b,x,o,N])}let Lt;process.env.NODE_ENV!=="production"&&(Lt=new Set);function Uo(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:o,nodeId:r}=e;if(process.env.NODE_ENV!=="production"){var i;const P="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((i=e.elements)!=null&&i.reference&&!Y(e.elements.reference)){var l;if(!((l=Lt)!=null&&l.has(P))){var a;(a=Lt)==null||a.add(P),console.error(P)}}}const[s,c]=A.useState(null),C=((t=e.elements)==null?void 0:t.reference)||s,m=bl(e),b=Jt(),u=Hl()!=null,x=Ve((P,k,E)=>{P&&(g.current.openEvent=k),y.emit("openchange",{open:P,event:k,reason:E,nested:u}),o==null||o(P,k,E)}),w=A.useRef(null),g=A.useRef({}),y=A.useState(()=>Wl())[0],v=yt(),V=A.useCallback(P=>{const k=Y(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),contextElement:P}:P;m.refs.setReference(k)},[m.refs]),S=A.useCallback(P=>{(Y(P)||P===null)&&(w.current=P,c(P)),(Y(m.refs.reference.current)||m.refs.reference.current===null||P!==null&&!Y(P))&&m.refs.setReference(P)},[m.refs]),R=A.useMemo(()=>({...m.refs,setReference:S,setPositionReference:V,domReference:w}),[m.refs,S,V]),I=A.useMemo(()=>({...m.elements,domReference:C}),[m.elements,C]),D=A.useMemo(()=>({...m,refs:R,elements:I,dataRef:g,nodeId:r,floatingId:v,events:y,open:n,onOpenChange:x}),[m,r,v,y,n,x,R,I]);return ae(()=>{const P=b==null?void 0:b.nodesRef.current.find(k=>k.id===r);P&&(P.context=D)}),A.useMemo(()=>({...m,context:D,refs:R,elements:I}),[m,R,I,D])}const jn="active",kn="selected";function At(e,t,n){const o=new Map,r=n==="item";let i=e;if(r&&e){const{[jn]:l,[kn]:a,...s}=e;i=s}return{...n==="floating"&&{tabIndex:-1},...i,...t.map(l=>{const a=l?l[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((l,a)=>(a&&Object.entries(a).forEach(s=>{let[c,C]=s;if(!(r&&[jn,kn].includes(c)))if(c.indexOf("on")===0){if(o.has(c)||o.set(c,[]),typeof C=="function"){var m;(m=o.get(c))==null||m.push(C),l[c]=function(){for(var b,u=arguments.length,x=new Array(u),w=0;w<u;w++)x[w]=arguments[w];return(b=o.get(c))==null?void 0:b.map(g=>g(...x)).find(g=>g!==void 0)}}}else l[c]=C}),l),{})}}function Qo(e){e===void 0&&(e=[]);const t=e,n=A.useCallback(i=>At(i,e,"reference"),t),o=A.useCallback(i=>At(i,e,"floating"),t),r=A.useCallback(i=>At(i,e,"item"),e.map(i=>i==null?void 0:i.item));return A.useMemo(()=>({getReferenceProps:n,getFloatingProps:o,getItemProps:r}),[n,o,r])}function ia(e={}){const{initialOpen:t=!1,open:n,onOpenChange:o}=e,[r,i]=A.useState(t),l=n??r,a=o??i,s=Uo({open:l,onOpenChange:a}),c=s.context,C=_o(c,{enabled:n==null}),m=Ho(c,{outsidePressEvent:"mousedown"}),b=Qo([C,m]);return A.useMemo(()=>({open:l,setOpen:a,...b,...s}),[l,a,b,s])}const Go=A.createContext(null),Yo=()=>{const e=A.useContext(Go);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function ra({children:e,...t}){const n=ia(t);return d.jsx(Go.Provider,{value:n,children:e})}const Xo=O.css`
|
|
150
|
+
*/var Pl=["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])"],Gt=Pl.join(","),qo=typeof Element>"u",Ue=qo?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,gt=!qo&&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},mt=function e(t,n){var o;n===void 0&&(n=!0);var i=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),r=i===""||i==="true",l=r||n&&t&&e(t.parentNode);return l},Ol=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},Dl=function(t,n,o){if(mt(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Gt));return n&&Ue.call(t,Gt)&&i.unshift(t),i=i.filter(o),i},Vl=function e(t,n,o){for(var i=[],r=Array.from(t);r.length;){var l=r.shift();if(!mt(l,!1))if(l.tagName==="SLOT"){var s=l.assignedElements(),a=s.length?s:l.children,c=e(a,!0,o);o.flatten?i.push.apply(i,c):i.push({scopeParent:l,candidates:c})}else{var x=Ue.call(l,Gt);x&&o.filter(l)&&(n||!t.includes(l))&&i.push(l);var g=l.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(l),C=!mt(g,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(l));if(g&&C){var u=e(g===!0?l.children:g.children,!0,o);o.flatten?i.push.apply(i,u):i.push({scopeParent:l,candidates:u})}else r.unshift.apply(r,l.children)}}return i},Ho=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},_o=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Ol(t))&&!Ho(t)?0:t.tabIndex},jl=function(t,n){var o=_o(t);return o<0&&n&&!Ho(t)?0:o},kl=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Uo=function(t){return t.tagName==="INPUT"},Ml=function(t){return Uo(t)&&t.type==="hidden"},Fl=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Ll=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Nl=function(t){if(!t.name)return!0;var n=t.form||gt(t),o=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=o(window.CSS.escape(t.name));else try{i=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 r=Ll(i,t.form);return!r||r===t},Bl=function(t){return Uo(t)&&t.type==="radio"},$l=function(t){return Bl(t)&&!Nl(t)},zl=function(t){var n,o=t&>(t),i=(n=o)===null||n===void 0?void 0:n.host,r=!1;if(o&&o!==t){var l,s,a;for(r=!!((l=i)!==null&&l!==void 0&&(s=l.ownerDocument)!==null&&s!==void 0&&s.contains(i)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!r&&i;){var c,x,g;o=gt(i),i=(c=o)===null||c===void 0?void 0:c.host,r=!!((x=i)!==null&&x!==void 0&&(g=x.ownerDocument)!==null&&g!==void 0&&g.contains(i))}}return r},Vn=function(t){var n=t.getBoundingClientRect(),o=n.width,i=n.height;return o===0&&i===0},Wl=function(t,n){var o=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var r=Ue.call(t,"details>summary:first-of-type"),l=r?t.parentElement:t;if(Ue.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="legacy-full"){if(typeof i=="function"){for(var s=t;t;){var a=t.parentElement,c=gt(t);if(a&&!a.shadowRoot&&i(a)===!0)return Vn(t);t.assignedSlot?t=t.assignedSlot:!a&&c!==t.ownerDocument?t=c.host:t=a}t=s}if(zl(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Vn(t);return!1},Kl=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 i=n.children.item(o);if(i.tagName==="LEGEND")return Ue.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},ql=function(t,n){return!(n.disabled||mt(n)||Ml(n)||Wl(n,t)||Fl(n)||Kl(n))},jn=function(t,n){return!($l(n)||_o(n)<0||!ql(t,n))},Hl=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},_l=function e(t){var n=[],o=[];return t.forEach(function(i,r){var l=!!i.scopeParent,s=l?i.scopeParent:i,a=jl(s,l),c=l?e(i.candidates):s;a===0?l?n.push.apply(n,c):n.push(s):o.push({documentOrder:r,tabIndex:a,item:i,isScope:l,content:c})}),o.sort(kl).reduce(function(i,r){return r.isScope?i.push.apply(i,r.content):i.push(r.content),i},[]).concat(n)},cn=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Vl([t],n.includeContainer,{filter:jn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Hl}):o=Dl(t,n.includeContainer,jn.bind(null,n)),_l(o)};function un(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 Ul=E["useInsertionEffect".toString()],Ql=Ul||(e=>e());function Ve(e){const t=E.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Ql(()=>{t.current=e}),E.useCallback(function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return t.current==null?void 0:t.current(...o)},[])}let kn=0;function Se(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:i=!1}=t;o&&cancelAnimationFrame(kn);const r=()=>e==null?void 0:e.focus({preventScroll:n});i?r():kn=requestAnimationFrame(r)}var se=typeof document<"u"?T.useLayoutEffect:T.useEffect;function Fe(){return Fe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Fe.apply(this,arguments)}let jt=!1,Yl=0;const Mn=()=>"floating-ui-"+Yl++;function Gl(){const[e,t]=E.useState(()=>jt?Mn():void 0);return se(()=>{e==null&&t(Mn())},[]),E.useEffect(()=>{jt||(jt=!0)},[]),e}const Xl=E["useId".toString()],Pt=Xl||Gl,Jl=E.forwardRef(function(t,n){let{context:{placement:o,elements:{floating:i},middlewareData:{arrow:r}},width:l=14,height:s=7,tipRadius:a=0,strokeWidth:c=0,staticOffset:x,stroke:g,d:C,style:{transform:u,...b}={},...w}=t;process.env.NODE_ENV!=="production"&&(n||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const y=Pt();if(!i)return null;c*=2;const m=c/2,v=l/2*(a/-8+1),P=s/2*a/4,[S,I]=o.split("-"),R=Wo.isRTL(i),D=!!C,O=S==="top"||S==="bottom",j=x&&I==="end"?"bottom":"top";let A=x&&I==="end"?"right":"left";x&&R&&(A=I==="end"?"left":"right");const F=(r==null?void 0:r.x)!=null?x||r.x:"",B=(r==null?void 0:r.y)!=null?x||r.y:"",W=C||"M0,0"+(" H"+l)+(" L"+(l-v)+","+(s-P))+(" Q"+l/2+","+s+" "+v+","+(s-P))+" Z",H={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",Fe({},w,{"aria-hidden":!0,ref:n,width:D?l:l+c,height:l,viewBox:"0 0 "+l+" "+(s>l?s:l),style:{position:"absolute",pointerEvents:"none",[A]:F,[j]:B,[S]:O||D?"100%":"calc(100% - "+c/2+"px)",transform:""+H+(u??""),...b}}),c>0&&E.createElement("path",{clipPath:"url(#"+y+")",fill:"none",stroke:g,strokeWidth:c+(C?0:1),d:W}),E.createElement("path",{stroke:c&&!C?w.fill:"none",d:W}),E.createElement("clipPath",{id:y},E.createElement("rect",{x:-m,y:m*(D?-1:1),width:l+c,height:l})))});function Zl(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(i=>i(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(i=>i!==n))||[])}}}const es=E.createContext(null),ts=E.createContext(null),ns=()=>{var e;return((e=E.useContext(es))==null?void 0:e.id)||null},dn=()=>E.useContext(ts);function Qe(e){return"data-floating-ui-"+e}function kt(e){const t=T.useRef(e);return se(()=>{t.current=e}),t}function os(e,t){var n;let o=[],i=(n=e.find(r=>r.id===t))==null?void 0:n.parentId;for(;i;){const r=e.find(l=>l.id===i);i=r==null?void 0:r.parentId,r&&(o=o.concat(r))}return o}function Ke(e,t){let n=e.filter(i=>{var r;return i.parentId===t&&((r=i.context)==null?void 0:r.open)}),o=n;for(;o.length;)o=e.filter(i=>{var r;return(r=o)==null?void 0:r.some(l=>{var s;return i.parentId===l.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(o);return n}let Pe=new WeakMap,nt=new WeakSet,ot={},Mt=0;const is=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Qo=e=>e&&(e.host||Qo(e.parentNode)),rs=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=Qo(n);return e.contains(o)?o:null}).filter(n=>n!=null);function ls(e,t,n,o){const i="data-floating-ui-inert",r=o?"inert":n?"aria-hidden":null,l=rs(t,e),s=new Set,a=new Set(l),c=[];ot[i]||(ot[i]=new WeakMap);const x=ot[i];l.forEach(g),C(t),s.clear();function g(u){!u||s.has(u)||(s.add(u),u.parentNode&&g(u.parentNode))}function C(u){!u||a.has(u)||Array.prototype.forEach.call(u.children,b=>{if(s.has(b))C(b);else{const w=r?b.getAttribute(r):null,y=w!==null&&w!=="false",m=(Pe.get(b)||0)+1,v=(x.get(b)||0)+1;Pe.set(b,m),x.set(b,v),c.push(b),m===1&&y&&nt.add(b),v===1&&b.setAttribute(i,""),!y&&r&&b.setAttribute(r,"true")}})}return Mt++,()=>{c.forEach(u=>{const b=(Pe.get(u)||0)-1,w=(x.get(u)||0)-1;Pe.set(u,b),x.set(u,w),b||(!nt.has(u)&&r&&u.removeAttribute(r),nt.delete(u)),w||u.removeAttribute(i)}),Mt--,Mt||(Pe=new WeakMap,Pe=new WeakMap,nt=new WeakSet,ot={})}}function Fn(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=ye(e[0]).body;return ls(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const fn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Yo(e,t){const n=cn(e,fn());t==="prev"&&n.reverse();const o=n.indexOf(Oe(ye(e)));return n.slice(o+1)[0]}function Go(){return Yo(document.body,"next")}function Xo(){return Yo(document.body,"prev")}function qe(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!ie(n,o)}function ss(e){cn(e,fn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function as(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}const pn={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let cs;function Ln(e){e.key==="Tab"&&(e.target,clearTimeout(cs))}const yt=E.forwardRef(function(t,n){const[o,i]=E.useState();se(()=>(Kr()&&i("button"),document.addEventListener("keydown",Ln),()=>{document.removeEventListener("keydown",Ln)}),[]);const r={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[Qe("focus-guard")]:"",style:pn};return E.createElement("span",Fe({},t,r))}),Jo=E.createContext(null),Nn=Qe("portal");function us(e){let{id:t,root:n}=e===void 0?{}:e;const[o,i]=E.useState(null),r=Pt(),l=ei(),s=E.useRef(null);return se(()=>()=>{o==null||o.remove(),queueMicrotask(()=>{s.current=null})},[o]),se(()=>{if(s.current)return;const a=t?document.getElementById(t):null;if(!a)return;const c=document.createElement("div");c.id=r,c.setAttribute(Nn,""),a.appendChild(c),s.current=c,i(c)},[t,r]),se(()=>{if(s.current)return;let a=n||(l==null?void 0:l.portalNode);a&&!X(a)&&(a=a.current),a=a||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,a.appendChild(c));const x=document.createElement("div");x.id=r,x.setAttribute(Nn,""),a=c||a,a.appendChild(x),s.current=x,i(x)},[t,n,r,l]),o}function Zo(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const r=us({id:n,root:o}),[l,s]=E.useState(null),a=E.useRef(null),c=E.useRef(null),x=E.useRef(null),g=E.useRef(null),C=!!l&&!l.modal&&l.open&&i&&!!(o||r);return E.useEffect(()=>{if(!r||!i||l!=null&&l.modal)return;function u(b){r&&qe(b)&&(b.type==="focusin"?as:ss)(r)}return r.addEventListener("focusin",u,!0),r.addEventListener("focusout",u,!0),()=>{r.removeEventListener("focusin",u,!0),r.removeEventListener("focusout",u,!0)}},[r,i,l==null?void 0:l.modal]),E.createElement(Jo.Provider,{value:E.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:c,beforeInsideRef:x,afterInsideRef:g,portalNode:r,setFocusManagerState:s}),[i,r])},C&&r&&E.createElement(yt,{"data-type":"outside",ref:a,onFocus:u=>{if(qe(u,r)){var b;(b=x.current)==null||b.focus()}else{const w=Xo()||(l==null?void 0:l.refs.domReference.current);w==null||w.focus()}}}),C&&r&&E.createElement("span",{"aria-owns":r.id,style:pn}),r&&ho.createPortal(t,r),C&&r&&E.createElement(yt,{"data-type":"outside",ref:c,onFocus:u=>{if(qe(u,r)){var b;(b=g.current)==null||b.focus()}else{const w=Go()||(l==null?void 0:l.refs.domReference.current);w==null||w.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,u.nativeEvent))}}}))}const ei=()=>E.useContext(Jo),Bn=20;let Te=[];function Ft(e){Te=Te.filter(t=>t.isConnected),e&&be(e)!=="body"&&(Te.push(e),Te.length>Bn&&(Te=Te.slice(-Bn)))}function $n(){return Te.slice().reverse().find(e=>e.isConnected)}const ds=E.forwardRef(function(t,n){return E.createElement("button",Fe({},t,{type:"button",ref:n,tabIndex:-1,style:pn}))});function ti(e){const{context:t,children:n,disabled:o=!1,order:i=["content"],guards:r=!0,initialFocus:l=0,returnFocus:s=!0,modal:a=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:x=!0}=e,{open:g,refs:C,nodeId:u,onOpenChange:b,events:w,dataRef:y,elements:{domReference:m,floating:v}}=t,P=typeof l=="number"&&l<0,S=Qr(m)&&P,I=is()?r:!0,R=kt(i),D=kt(l),O=kt(s),j=dn(),A=ei(),F=E.useRef(null),B=E.useRef(null),W=E.useRef(!1),H=E.useRef(!1),M=A!=null,$=E.useCallback(function(q){return q===void 0&&(q=v),q?cn(q,fn()):[]},[v]),V=E.useCallback(q=>{const K=$(q);return R.current.map(z=>m&&z==="reference"?m:v&&z==="floating"?v:K).filter(Boolean).flat()},[m,v,R,$]);E.useEffect(()=>{if(o||!a)return;function q(z){if(z.key==="Tab"){ie(v,Oe(ye(v)))&&$().length===0&&!S&&Vt(z);const _=V(),Q=De(z);R.current[0]==="reference"&&Q===m&&(Vt(z),z.shiftKey?Se(_[_.length-1]):Se(_[1])),R.current[1]==="floating"&&Q===v&&z.shiftKey&&(Vt(z),Se(_[0]))}}const K=ye(v);return K.addEventListener("keydown",q),()=>{K.removeEventListener("keydown",q)}},[o,m,v,a,R,S,$,V]),E.useEffect(()=>{if(o||!x)return;function q(){H.current=!0,setTimeout(()=>{H.current=!1})}function K(z){const _=z.relatedTarget;queueMicrotask(()=>{const Q=!(ie(m,_)||ie(v,_)||ie(_,v)||ie(A==null?void 0:A.portalNode,_)||_!=null&&_.hasAttribute(Qe("focus-guard"))||j&&(Ke(j.nodesRef.current,u).find(Y=>{var ee,ue;return ie((ee=Y.context)==null?void 0:ee.elements.floating,_)||ie((ue=Y.context)==null?void 0:ue.elements.domReference,_)})||os(j.nodesRef.current,u).find(Y=>{var ee,ue;return((ee=Y.context)==null?void 0:ee.elements.floating)===_||((ue=Y.context)==null?void 0:ue.elements.domReference)===_})));_&&Q&&!H.current&&_!==$n()&&(W.current=!0,b(!1,z))})}if(v&&ne(m))return m.addEventListener("focusout",K),m.addEventListener("pointerdown",q),!a&&v.addEventListener("focusout",K),()=>{m.removeEventListener("focusout",K),m.removeEventListener("pointerdown",q),!a&&v.removeEventListener("focusout",K)}},[o,m,v,a,u,j,A,b,x]),E.useEffect(()=>{var q;if(o)return;const K=Array.from((A==null||(q=A.portalNode)==null?void 0:q.querySelectorAll("["+Qe("portal")+"]"))||[]);if(v){const z=[v,...K,F.current,B.current,R.current.includes("reference")||S?m:null].filter(Q=>Q!=null),_=a||S?Fn(z,I,!I):Fn(z);return()=>{_()}}},[o,m,v,a,R,A,S,I]),se(()=>{if(o||!v)return;const q=ye(v),K=Oe(q);queueMicrotask(()=>{const z=V(v),_=D.current,Q=(typeof _=="number"?z[_]:_.current)||v,Y=ie(v,K);!P&&!Y&&g&&Se(Q,{preventScroll:Q===v})})},[o,g,v,P,V,D]),se(()=>{if(o||!v)return;let q=!1;const K=ye(v),z=Oe(K),_=y.current;Ft(z);function Q(Y){let{reason:ee,event:ue,nested:We}=Y;ee==="escape-key"&&C.domReference.current&&Ft(C.domReference.current),ee==="hover"&&ue.type==="mouseleave"&&(W.current=!0),ee==="outside-press"&&(We?(W.current=!1,q=!0):W.current=!(zr(ue)||Wr(ue)))}return w.on("openchange",Q),()=>{w.off("openchange",Q);const Y=Oe(K),ee=ie(v,Y)||j&&Ke(j.nodesRef.current,u).some(Qi=>{var xn;return ie((xn=Qi.context)==null?void 0:xn.elements.floating,Y)});(ee||_.openEvent&&["click","mousedown"].includes(_.openEvent.type))&&C.domReference.current&&Ft(C.domReference.current);const We=$n();O.current&&!W.current&&ne(We)&&(!(We!==Y&&Y!==K.body)||ee)&&Se(We,{cancelPrevious:!1,preventScroll:q})}},[o,v,O,y,C,w,j,u]),se(()=>{if(!(o||!A))return A.setFocusManagerState({modal:a,closeOnFocusOut:x,open:g,onOpenChange:b,refs:C}),()=>{A.setFocusManagerState(null)}},[o,A,a,g,b,C,x]),se(()=>{if(o||!v||typeof MutationObserver!="function"||P)return;const q=()=>{const z=v.getAttribute("tabindex");R.current.includes("floating")||Oe(ye(v))!==C.domReference.current&&$().length===0?z!=="0"&&v.setAttribute("tabindex","0"):z!=="-1"&&v.setAttribute("tabindex","-1")};q();const K=new MutationObserver(q);return K.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{K.disconnect()}},[o,v,C,R,$,P]);function L(q){return o||!c||!a?null:E.createElement(ds,{ref:q==="start"?F:B,onClick:K=>b(!1,K.nativeEvent)},typeof c=="string"?c:"Dismiss")}const te=!o&&I&&(M||a);return E.createElement(E.Fragment,null,te&&E.createElement(yt,{"data-type":"inside",ref:A==null?void 0:A.beforeInsideRef,onFocus:q=>{if(a){const z=V();Se(i[0]==="reference"?z[0]:z[z.length-1])}else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(W.current=!1,qe(q,A.portalNode)){const z=Go()||m;z==null||z.focus()}else{var K;(K=A.beforeOutsideRef.current)==null||K.focus()}}}),!S&&L("start"),n,L("end"),te&&E.createElement(yt,{"data-type":"inside",ref:A==null?void 0:A.afterInsideRef,onFocus:q=>{if(a)Se(V()[0]);else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(x&&(W.current=!0),qe(q,A.portalNode)){const z=Xo()||m;z==null||z.focus()}else{var K;(K=A.afterOutsideRef.current)==null||K.focus()}}}))}const Lt=new Set,ni=E.forwardRef(function(t,n){let{lockScroll:o=!1,...i}=t;const r=Pt();return se(()=>{if(!o)return;Lt.add(r);const l=/iP(hone|ad|od)|iOS/.test(Oo()),s=document.body.style,c=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",x=window.innerWidth-document.documentElement.clientWidth,g=s.left?parseFloat(s.left):window.pageXOffset,C=s.top?parseFloat(s.top):window.pageYOffset;if(s.overflow="hidden",x&&(s[c]=x+"px"),l){var u,b;const w=((u=window.visualViewport)==null?void 0:u.offsetLeft)||0,y=((b=window.visualViewport)==null?void 0:b.offsetTop)||0;Object.assign(s,{position:"fixed",top:-(C-Math.floor(y))+"px",left:-(g-Math.floor(w))+"px",right:"0"})}return()=>{Lt.delete(r),Lt.size===0&&(Object.assign(s,{overflow:"",[c]:""}),l&&(Object.assign(s,{position:"",top:"",left:"",right:""}),window.scrollTo(g,C)))}},[r,o]),E.createElement("div",Fe({ref:n},i,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}}))});function zn(e){return ne(e.target)&&e.target.tagName==="BUTTON"}function Wn(e){return Vo(e)}function oi(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:i,elements:{domReference:r}}=e,{enabled:l=!0,event:s="click",toggle:a=!0,ignoreMouse:c=!1,keyboardHandlers:x=!0}=t,g=E.useRef(),C=E.useRef(!1);return E.useMemo(()=>l?{reference:{onPointerDown(u){g.current=u.pointerType},onMouseDown(u){u.button===0&&(En(g.current,!0)&&c||s!=="click"&&(n&&a&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?o(!1,u.nativeEvent,"click"):(u.preventDefault(),o(!0,u.nativeEvent,"click"))))},onClick(u){if(s==="mousedown"&&g.current){g.current=void 0;return}En(g.current,!0)&&c||(n&&a&&(!i.current.openEvent||i.current.openEvent.type==="click")?o(!1,u.nativeEvent,"click"):o(!0,u.nativeEvent,"click"))},onKeyDown(u){g.current=void 0,!(u.defaultPrevented||!x||zn(u))&&(u.key===" "&&!Wn(r)&&(u.preventDefault(),C.current=!0),u.key==="Enter"&&o(!(n&&a),u.nativeEvent,"click"))},onKeyUp(u){u.defaultPrevented||!x||zn(u)||Wn(r)||u.key===" "&&C.current&&(C.current=!1,o(!(n&&a),u.nativeEvent,"click"))}}}:{},[l,i,s,c,x,r,a,n,o])}const fs={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ps={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Kn=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function ii(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,nodeId:i,elements:{reference:r,domReference:l,floating:s},dataRef:a}=e,{enabled:c=!0,escapeKey:x=!0,outsidePress:g=!0,outsidePressEvent:C="pointerdown",referencePress:u=!1,referencePressEvent:b="pointerdown",ancestorScroll:w=!1,bubbles:y,capture:m}=t,v=dn(),P=Ve(typeof g=="function"?g:()=>!1),S=typeof g=="function"?P:g,I=E.useRef(!1),R=E.useRef(!1),{escapeKey:D,outsidePress:O}=Kn(y),{escapeKey:j,outsidePress:A}=Kn(m),F=Ve(M=>{if(!n||!c||!x||M.key!=="Escape")return;const $=v?Ke(v.nodesRef.current,i):[];if(!D&&(M.stopPropagation(),$.length>0)){let V=!0;if($.forEach(L=>{var te;if((te=L.context)!=null&&te.open&&!L.context.dataRef.current.__escapeKeyBubbles){V=!1;return}}),!V)return}o(!1,Hr(M)?M.nativeEvent:M,"escape-key")}),B=Ve(M=>{var $;const V=()=>{var L;F(M),(L=De(M))==null||L.removeEventListener("keydown",V)};($=De(M))==null||$.addEventListener("keydown",V)}),W=Ve(M=>{const $=I.current;I.current=!1;const V=R.current;if(R.current=!1,C==="click"&&V||$||typeof S=="function"&&!S(M))return;const L=De(M),te="["+Qe("inert")+"]",q=ye(s).querySelectorAll(te);let K=X(L)?L:null;for(;K&&!ke(K);){const Q=Ae(K);if(ke(Q)||!X(Q))break;K=Q}if(q.length&&X(L)&&!_r(L)&&!ie(L,s)&&Array.from(q).every(Q=>!ie(K,Q)))return;if(ne(L)&&s){const Q=L.clientWidth>0&&L.scrollWidth>L.clientWidth,Y=L.clientHeight>0&&L.scrollHeight>L.clientHeight;let ee=Y&&M.offsetX>L.clientWidth;if(Y&&le(L).direction==="rtl"&&(ee=M.offsetX<=L.offsetWidth-L.clientWidth),ee||Q&&M.offsetY>L.clientHeight)return}const z=v&&Ke(v.nodesRef.current,i).some(Q=>{var Y;return Dt(M,(Y=Q.context)==null?void 0:Y.elements.floating)});if(Dt(M,s)||Dt(M,l)||z)return;const _=v?Ke(v.nodesRef.current,i):[];if(_.length>0){let Q=!0;if(_.forEach(Y=>{var ee;if((ee=Y.context)!=null&&ee.open&&!Y.context.dataRef.current.__outsidePressBubbles){Q=!1;return}}),!Q)return}o(!1,M,"outside-press")}),H=Ve(M=>{var $;const V=()=>{var L;W(M),(L=De(M))==null||L.removeEventListener(C,V)};($=De(M))==null||$.addEventListener(C,V)});return E.useEffect(()=>{if(!n||!c)return;a.current.__escapeKeyBubbles=D,a.current.__outsidePressBubbles=O;function M(L){o(!1,L,"ancestor-scroll")}const $=ye(s);x&&$.addEventListener("keydown",j?B:F,j),S&&$.addEventListener(C,A?H:W,A);let V=[];return w&&(X(l)&&(V=ve(l)),X(s)&&(V=V.concat(ve(s))),!X(r)&&r&&r.contextElement&&(V=V.concat(ve(r.contextElement)))),V=V.filter(L=>{var te;return L!==((te=$.defaultView)==null?void 0:te.visualViewport)}),V.forEach(L=>{L.addEventListener("scroll",M,{passive:!0})}),()=>{x&&$.removeEventListener("keydown",j?B:F,j),S&&$.removeEventListener(C,A?H:W,A),V.forEach(L=>{L.removeEventListener("scroll",M)})}},[a,s,l,r,x,S,C,n,o,w,c,D,O,F,j,B,W,A,H]),E.useEffect(()=>{I.current=!1},[S,C]),E.useMemo(()=>c?{reference:{onKeyDown:F,[fs[b]]:M=>{u&&o(!1,M.nativeEvent,"reference-press")}},floating:{onKeyDown:F,onMouseDown(){R.current=!0},onMouseUp(){R.current=!0},[ps[C]]:()=>{I.current=!0}}}:{},[c,u,C,b,o,F])}let Xt;process.env.NODE_ENV!=="production"&&(Xt=new Set);function ri(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:o,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var r;const O="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((r=e.elements)!=null&&r.reference&&!X(e.elements.reference)){var l;if(!((l=Xt)!=null&&l.has(O))){var s;(s=Xt)==null||s.add(O),console.error(O)}}}const[a,c]=E.useState(null),x=((t=e.elements)==null?void 0:t.reference)||a,g=Rl(e),C=dn(),u=ns()!=null,b=Ve((O,j,A)=>{O&&(y.current.openEvent=j),m.emit("openchange",{open:O,event:j,reason:A,nested:u}),o==null||o(O,j,A)}),w=E.useRef(null),y=E.useRef({}),m=E.useState(()=>Zl())[0],v=Pt(),P=E.useCallback(O=>{const j=X(O)?{getBoundingClientRect:()=>O.getBoundingClientRect(),contextElement:O}:O;g.refs.setReference(j)},[g.refs]),S=E.useCallback(O=>{(X(O)||O===null)&&(w.current=O,c(O)),(X(g.refs.reference.current)||g.refs.reference.current===null||O!==null&&!X(O))&&g.refs.setReference(O)},[g.refs]),I=E.useMemo(()=>({...g.refs,setReference:S,setPositionReference:P,domReference:w}),[g.refs,S,P]),R=E.useMemo(()=>({...g.elements,domReference:x}),[g.elements,x]),D=E.useMemo(()=>({...g,refs:I,elements:R,dataRef:y,nodeId:i,floatingId:v,events:m,open:n,onOpenChange:b}),[g,i,v,m,n,b,I,R]);return se(()=>{const O=C==null?void 0:C.nodesRef.current.find(j=>j.id===i);O&&(O.context=D)}),E.useMemo(()=>({...g,context:D,refs:I,elements:R}),[g,I,R,D])}const qn="active",Hn="selected";function Nt(e,t,n){const o=new Map,i=n==="item";let r=e;if(i&&e){const{[qn]:l,[Hn]:s,...a}=e;r=a}return{...n==="floating"&&{tabIndex:-1},...r,...t.map(l=>{const s=l?l[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((l,s)=>(s&&Object.entries(s).forEach(a=>{let[c,x]=a;if(!(i&&[qn,Hn].includes(c)))if(c.indexOf("on")===0){if(o.has(c)||o.set(c,[]),typeof x=="function"){var g;(g=o.get(c))==null||g.push(x),l[c]=function(){for(var C,u=arguments.length,b=new Array(u),w=0;w<u;w++)b[w]=arguments[w];return(C=o.get(c))==null?void 0:C.map(y=>y(...b)).find(y=>y!==void 0)}}}else l[c]=x}),l),{})}}function li(e){e===void 0&&(e=[]);const t=e,n=E.useCallback(r=>Nt(r,e,"reference"),t),o=E.useCallback(r=>Nt(r,e,"floating"),t),i=E.useCallback(r=>Nt(r,e,"item"),e.map(r=>r==null?void 0:r.item));return E.useMemo(()=>({getReferenceProps:n,getFloatingProps:o,getItemProps:i}),[n,o,i])}function hs(e={}){const{initialOpen:t=!1,open:n,onOpenChange:o}=e,[i,r]=E.useState(t),l=n??i,s=o??r,a=ri({open:l,onOpenChange:s}),c=a.context,x=oi(c,{enabled:n==null}),g=ii(c,{outsidePressEvent:"mousedown"}),C=li([x,g]);return E.useMemo(()=>({open:l,setOpen:s,...C,...a}),[l,s,C,a])}const si=E.createContext(null),ai=()=>{const e=E.useContext(si);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function gs({children:e,...t}){const n=hs(t);return f.jsx(si.Provider,{value:n,children:e})}const ci=k.css`
|
|
196
151
|
display: flex;
|
|
197
152
|
justify-content: center;
|
|
198
153
|
align-items: center;
|
|
199
154
|
z-index: 100;
|
|
200
155
|
padding: var(--space-md-fixed);
|
|
201
|
-
`,
|
|
202
|
-
${
|
|
203
|
-
`,
|
|
204
|
-
color: var(--color-explain-header-value-color);
|
|
156
|
+
`,ms=k(ni)`
|
|
157
|
+
${ci};
|
|
158
|
+
`,ys=T.forwardRef((e,t)=>{const{style:n,children:o,components:i,...r}=e,l=ai(),s=un([l.refs.setFloating,t]),a=(i==null?void 0:i.Overlay)??ms;return f.jsx(Zo,{children:f.jsx(a,{lockScroll:!0,children:f.jsx(ti,{context:l.context,children:f.jsx("div",{ref:s,...l.getFloatingProps(r),children:o})})})})}),bs=ys;function ui(e){const t=T.useContext(He),[n,o]=T.useState(t);return f.jsx(He.Provider,{value:n,children:e.children})}const xs=T.forwardRef((e,t)=>{const{setOpen:n}=ai();return f.jsx("button",{type:"button",ref:t,...e,onClick:o=>{var i;(i=e.onClick)==null||i.call(e,o),n(!1)}})}),Cs=xs,vs=k.span`
|
|
205
159
|
overflow: hidden;
|
|
206
160
|
white-space: nowrap;
|
|
207
161
|
text-overflow: ellipsis;
|
|
208
|
-
`;function
|
|
162
|
+
`;function di(e){const{explainQuestion:t}=xe(),{header:n,attributeValue:o}=Ye();if(!t)return f.jsx("div",{...e,children:n.subject.generalConflictTitle});const i=N.match(t).returnType().with({subject:h.ExplainQuestionSubject.configuration},()=>n.subject.configurationSubjectTitle).with({subject:h.ExplainQuestionSubject.attribute},l=>At(l.attributeId)??l.attributeId.localId).with({subject:h.ExplainQuestionSubject.choiceValue},l=>Ge(l.attributeId).get(l.choiceValueId)??l.choiceValueId).with({subject:h.ExplainQuestionSubject.component,state:h.ComponentDecisionState.Included},()=>o.componentDecisionStateIncludedLabel).with({subject:h.ExplainQuestionSubject.component,state:h.ComponentDecisionState.Excluded},()=>o.componentDecisionStateExcludedLabel).with({subject:h.ExplainQuestionSubject.boolean,state:!0},()=>o.booleanDecisionStateTrueLabel).with({subject:h.ExplainQuestionSubject.boolean,state:!1},()=>o.booleanDecisionStateFalseLabel).with({subject:h.ExplainQuestionSubject.numeric},l=>l.state.toString()).exhaustive(),r=N.match(t).returnType().with({question:h.ExplainQuestionType.whyIsStateNotPossible},()=>n.suffix.isBlockedSuffix).with({question:h.ExplainQuestionType.whyIsNotSatisfied},()=>n.suffix.isNotSatisfiedSuffix).exhaustive();return f.jsxs("div",{...e,style:fe(n.suffix),children:[f.jsx(vs,{style:fe(n.subject),children:i})," ",r]})}const ws=k.div`
|
|
209
163
|
position: sticky;
|
|
210
164
|
top: 0;
|
|
211
165
|
transition: all 0.1s;
|
|
@@ -219,248 +173,182 @@ ${c}`);case h.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
219
173
|
@media only screen and (min-resolution: 2dppx) {
|
|
220
174
|
border-top-width: 0.5px;
|
|
221
175
|
}
|
|
222
|
-
`;function
|
|
176
|
+
`;function Ss(e){const[t,n]=T.useState(!1),o=T.useRef(null);return T.useEffect(()=>{const i=new IntersectionObserver(([l])=>n(!l.isIntersecting),{root:null,threshold:1}),r=o.current;return r&&i.observe(r),()=>{r&&i.unobserve(r)}},[]),f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:o}),f.jsx(ws,{...go(e,{className:Xi(t&&"active")})})]})}const Ts=k(d.motion.div)`
|
|
223
177
|
position: relative;
|
|
224
|
-
background-color: var(--color-explain-dialog-fill);
|
|
225
|
-
backdrop-filter: var(--backdrop-filter-explain-dialog);
|
|
226
|
-
color: var(--color-explain-dialog-color);
|
|
227
178
|
outline-offset: -1px;
|
|
228
|
-
padding-top: 1.1em;
|
|
229
|
-
border-radius: var(--shape-border-radius-md);
|
|
230
|
-
box-shadow: var(--shadows-dialog);
|
|
231
|
-
font-size: var(--text-base-size);
|
|
232
|
-
font-family: var(--font-primary);
|
|
233
179
|
display: grid;
|
|
234
180
|
grid-template-rows: [header] auto [content] auto;
|
|
235
181
|
grid-template-columns: [header content] 1fr;
|
|
236
182
|
align-content: start;
|
|
183
|
+
padding-top: var(--size-explain-dialog-box-padding-top) !important;
|
|
237
184
|
min-height: min(calc(100vh - var(--space-md) * 2), 350px);
|
|
238
185
|
max-height: min(calc(100vh - var(--space-md) * 2), 700px);
|
|
239
186
|
max-width: min(calc(100vw - var(--space-md) * 2), 700px);
|
|
240
187
|
min-width: min(calc(100vw - var(--space-md) * 2), 500px);
|
|
241
|
-
`,
|
|
188
|
+
`,Es=k.div`
|
|
242
189
|
overflow-y: auto;
|
|
243
190
|
grid-area: content;
|
|
244
|
-
padding-left: var(--
|
|
245
|
-
padding-right: var(--
|
|
191
|
+
padding-left: var(--size-explain-dialog-box-padding-left);
|
|
192
|
+
padding-right: var(--size-explain-dialog-box-padding-right);
|
|
246
193
|
padding-bottom: var(--space-xs-fixed);
|
|
247
|
-
`,
|
|
248
|
-
margin-left: calc(var(--
|
|
249
|
-
margin-right: calc(var(--
|
|
250
|
-
`,
|
|
194
|
+
`,As=k(Ss)`
|
|
195
|
+
margin-left: calc(var(--size-explain-dialog-box-padding-left) * -1);
|
|
196
|
+
margin-right: calc(var(--size-explain-dialog-box-padding-right) * -1);
|
|
197
|
+
`,Is=k(Cs)`
|
|
251
198
|
position: absolute;
|
|
252
199
|
right: var(--space-sm-fixed);
|
|
253
200
|
top: var(--space-sm-fixed);
|
|
254
|
-
border: none;
|
|
255
|
-
background-color: transparent;
|
|
256
|
-
color: inherit;
|
|
257
|
-
font-size: var(--text-sm);
|
|
258
201
|
cursor: pointer;
|
|
259
|
-
|
|
202
|
+
|
|
203
|
+
&:hover {
|
|
204
|
+
background-color: var(--color-button-fill-hover) !important;
|
|
205
|
+
}
|
|
260
206
|
|
|
261
207
|
&:focus {
|
|
262
|
-
outline:
|
|
263
|
-
outline-offset:
|
|
208
|
+
outline: var(--size-button-focus-outline) solid var(--color-button-focus-outline);
|
|
209
|
+
outline-offset: var(--size-button-focus-outline-offset);
|
|
264
210
|
}
|
|
265
|
-
`,
|
|
211
|
+
`,Rs=k(di)`
|
|
266
212
|
grid-area: header;
|
|
267
|
-
font-size: var(--text-md);
|
|
268
|
-
font-weight: 500;
|
|
269
|
-
font-family: var(--font-heading);
|
|
270
213
|
margin-bottom: var(--space-xs);
|
|
271
214
|
overflow: hidden;
|
|
272
215
|
display: flex;
|
|
273
216
|
white-space: nowrap;
|
|
274
217
|
text-overflow: ellipsis;
|
|
275
218
|
margin-right: var(--space-md);
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
--
|
|
280
|
-
--
|
|
281
|
-
--
|
|
282
|
-
--
|
|
283
|
-
--color-explain-header-value-color: ${e=>e.headerValueColor};
|
|
284
|
-
--color-explain-dialog-fill: ${e=>e.fill};
|
|
285
|
-
--color-explain-dialog-color: ${e=>e.color};
|
|
286
|
-
--color-explain-dialog-close-button-outline: ${e=>e.closeButtonOutline};
|
|
287
|
-
--color-explain-dialog-apply-solution-button-fill: ${e=>e.applySolutionButtonFill};
|
|
288
|
-
--color-explain-dialog-apply-solution-button-color: ${e=>e.applySolutionButtonColor};
|
|
289
|
-
--color-explain-dialog-apply-solution-button-outline: ${e=>e.applySolutionButtonOutline};
|
|
290
|
-
--color-explain-dialog-explanation-card: ${e=>e.explanationCard};
|
|
219
|
+
padding-left: var(--size-explain-dialog-box-padding-left);
|
|
220
|
+
padding-right: var(--size-explain-dialog-box-padding-right);
|
|
221
|
+
`,Ps={initial:{opacity:0,scale:.5},open:{opacity:1,scale:1,transition:{type:"spring",stiffness:600,damping:40}},close:{opacity:0,scale:.7,transition:{duration:.1,ease:"cubicInOut"}}};function Os(e){const{dialogBox:t,closeButton:n}=Tt(),o={...t,padding:0,isMixedPadding:!1};return f.jsxs(Ts,{style:Be(o),variants:Ps,initial:"initial",animate:"open",exit:"close",children:[f.jsx(Rs,{}),f.jsxs(Es,{children:[f.jsx(As,{}),e.children]}),f.jsx(Is,{style:vt(n),children:f.jsx(lt.FontAwesomeIcon,{icon:rt.faXmark})})]})}const Ds=k(bs)`
|
|
222
|
+
--size-explain-dialog-box-padding-top: ${e=>e.dialogBox.isMixedPadding?e.dialogBox.paddingTop:e.dialogBox.padding}px;
|
|
223
|
+
--size-explain-dialog-box-padding-right: ${e=>e.dialogBox.isMixedPadding?e.dialogBox.paddingRight:e.dialogBox.padding}px;
|
|
224
|
+
--size-explain-dialog-box-padding-bottom: ${e=>e.dialogBox.isMixedPadding?e.dialogBox.paddingBottom:e.dialogBox.padding}px;
|
|
225
|
+
--size-explain-dialog-box-padding-left: ${e=>e.dialogBox.isMixedPadding?e.dialogBox.paddingLeft:e.dialogBox.padding}px;
|
|
291
226
|
--color-explain-dialog-scroll-shadow-border: ${e=>e.scrollShadowBorder};
|
|
292
|
-
--backdrop-filter-explain-dialog: ${e=>e.backdropFilter};
|
|
293
227
|
|
|
294
228
|
display: grid;
|
|
295
229
|
|
|
296
230
|
&:focus {
|
|
297
231
|
outline: none;
|
|
298
232
|
}
|
|
299
|
-
`;function
|
|
300
|
-
${
|
|
301
|
-
`;function
|
|
302
|
-
`+
|
|
303
|
-
- `})),p.E.mapLeft(
|
|
304
|
-
`+i.toString()))),p.E.map(n),p.E.mapLeft(r=>d.jsx(ro,{type:"warning",title:e+" definition is invalid and was ignored",message:r}))))),[o])}const li=J.z.object({attributeId:dt,name:J.z.array(J.z.object({localeCode:J.z.string(),translation:J.z.string()}))}),ns=li.extend({choiceValueId:J.z.string()}),os=J.z.object({attributes:li.array().optional().nullish(),choiceValues:ns.array().optional().nullish()});function Ln(e){return{...ri(e.attributeId),name:p.pipe(e.name,p.RA.map(t=>t),p.RA.toArray)}}function is(e){const t=p.pipe(e.attributes??[],p.RA.map(Ln),p.RA.toArray),n=p.pipe(e.choiceValues??[],p.RA.map(o=>({...Ln(o),choiceValueId:o.choiceValueId})),p.RA.toArray);return{attributes:t,choiceValues:n}}const rs=nn("Localization",os,is),ls=rs,Mn=J.z.object({regex:J.z.string(),direction:J.z.enum(["asc","desc"]),mode:J.z.enum(["isMatch","string","numeric"]),description:J.z.string().optional()}),as=J.z.object({defaultRules:Mn.array().optional().nullish(),attributes:J.z.object({attributeId:dt,choiceValues:J.z.string().array(),rules:Mn.array()}).array().optional().nullish()});function ss(e){const t=p.pipe(e.defaultRules??[],p.RA.map(o=>o),p.RA.toArray);return{attributes:p.pipe(e.attributes??[],p.RA.map(o=>({...ri(o.attributeId),choiceValues:p.RA.toArray(o.choiceValues),rules:p.pipe(o.rules,p.RA.map(r=>r),p.RA.toArray)})),p.RA.toArray),defaultRules:t}}const cs=nn("ChoiceValueSorting",as,ss),us=cs,ds=J.z.object({attributeId:dt,decisions:dt.array()}),fs=ds.array(),ps=nn("AttributeRelations",fs,e=>e),hs=ps,ms={wizardAttributeRelations:{title:"Wizard Attribute Relations",type:f.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{wizardSteps:{title:"Wizard Steps",type:f.ControlType.Array,control:{type:f.ControlType.Object,controls:{name:{title:"Name",type:f.ControlType.String},attributes:{title:"Attributes",type:f.ControlType.Array,control:{type:f.ControlType.Object,controls:oe}}}}}}}},ai=se(e=>{var D,P,k,E;const{hcaBaseUrl:t,sessionCreation:n,accessToken:o,sessionCreateUrl:r,sessionDeleteUrl:i,deploymentName:l,channel:a,children:s,explainDialogProps:c,explainPopoverProps:C,explainConstraints:m}=e,{activeLocale:b}=f.useLocaleInfo(),u=b.code;if(T.useEffect(()=>{console.info("Current locale code:",u)},[u]),X())return d.jsxs(d.Fragment,{children:[s,d.jsx(ct,{singletonId:"Configuration",children:d.jsx(sn,{})})]});const w=hs((D=e.attributeRelations)==null?void 0:D.jsonDefinition),g=T.useMemo(()=>p.pipe(w,p.O.fromEither,p.O.toNullable),[w]),y=us((P=e.choiceValueSorting)==null?void 0:P.jsonDefinition),v=T.useMemo(()=>p.pipe(y,p.E.orElse(()=>p.pipe(e.choiceValueSorting,p.E.fromNullable(null))),p.E.getOrElse(()=>({attributes:[],defaultRules:[]}))),[y,e.choiceValueSorting]),V=ls((k=e.localization)==null?void 0:k.jsonDefinition),S=T.useMemo(()=>p.pipe(V,p.E.getOrElse(()=>({attributes:[],choiceValues:[]}))),[V]),R=p.pipe((E=e.wizardAttributeRelations)==null?void 0:E.wizardSteps,p.O.fromNullable,p.O.filter(p.RA.isNonEmpty),p.O.map(p.RA.map(N=>({attributes:p.pipe(N.attributes,p.RA.map(Z))}))),p.O.toNullable),I=T.useMemo(()=>({apiBaseUrl:Li(t,"api","engine"),sessionInitialisationOptions:M.match(n).with("client-side",()=>({accessToken:o})).with("server-side",()=>({sessionCreateUrl:r})).exhaustive(),configurationModelSource:{type:h.ConfigurationModelSourceType.Channel,channel:a,deploymentName:l},attributeRelations:g,wizardAttributeRelations:R,allowedInExplain:{rules:{type:h.AllowedRulesInExplainType.all}}}),[t,n,o,r,i,a,l,g]);return d.jsxs(d.Fragment,{children:[d.jsxs(U.Configuration,{sessionContext:I,children:[p.pipe(V,p.E.swap,p.O.fromEither,p.O.toNullable),p.pipe(y,p.E.swap,p.O.fromEither,p.O.toNullable),p.pipe(w,p.E.swap,p.O.fromEither,p.O.toNullable),d.jsx(Zi,{...e}),d.jsx(T.Suspense,{children:d.jsx(ft.Provider,{value:S,children:d.jsxs(Ea,{explainConstraints:m,children:[d.jsx($t.Provider,{value:C,children:d.jsx(ii.Provider,{value:v,children:s})}),d.jsx(wa,{...c})]})})})]}),d.jsx(ct,{singletonId:"Configuration",children:d.jsx(sn,{})})]})}),ys=ai;f.addPropertyControls(ai,{children:{title:"Content",type:f.ControlType.ComponentInstance},channel:{type:f.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:f.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:f.ControlType.String,defaultValue:"https://spc.cloud.ceventis.de/hca"},sessionCreation:{title:"Session Creation",type:f.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:f.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:f.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:f.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:f.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:f.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:f.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:f.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:f.ControlType.Object,optional:!1,controls:cr,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:f.ControlType.Object,optional:!1,controls:sr,buttonTitle:"Props…"},explainConstraints:{title:"Explain Constraints",type:f.ControlType.Boolean,defaultValue:!1},attributeRelations:{title:"Attribute Relations",type:f.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:f.ControlType.String,displayTextArea:!0}}},...ms,...Oa,...Qa});const si={padding:{type:f.ControlType.FusedNumber,title:"Padding",toggleKey:"isMixedPadding",toggleTitles:["Padding","Padding per Side"],valueKeys:["paddingTop","paddingRight","paddingBottom","paddingLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:0}},gs=e=>({paddingTop:e.isMixedPadding?e.paddingTop:e.padding,paddingRight:e.isMixedPadding?e.paddingRight:e.padding,paddingBottom:e.isMixedPadding?e.paddingBottom:e.padding,paddingLeft:e.isMixedPadding?e.paddingLeft:e.padding}),bs={radius:{title:"Radius",type:f.ControlType.Number,defaultValue:6},...si,border:{title:"Border",type:f.ControlType.Object,controls:{color:{type:f.ControlType.Color,title:"Color"},width:{type:f.ControlType.FusedNumber,title:"Width",toggleKey:"isMixedWidth",toggleTitles:["Width","Width per Side"],valueKeys:["widthTop","widthRight","widthBottom","widthLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:0}}}},xs=e=>{var t,n,o,r,i,l,a,s,c,C,m,b,u;return{borderRadius:e.radius,borderColor:(t=e.border)==null?void 0:t.color,borderTopWidth:(n=e.border)!=null&&n.isMixedWidth?(o=e.border)==null?void 0:o.widthTop:(r=e.border)==null?void 0:r.width,borderRightWidth:(i=e.border)!=null&&i.isMixedWidth?(l=e.border)==null?void 0:l.widthRight:(a=e.border)==null?void 0:a.width,borderBottomWidth:(s=e.border)!=null&&s.isMixedWidth?(c=e.border)==null?void 0:c.widthBottom:(C=e.border)==null?void 0:C.width,borderLeftWidth:(m=e.border)!=null&&m.isMixedWidth?(b=e.border)==null?void 0:b.widthLeft:(u=e.border)==null?void 0:u.width}},Cs={fill:{title:"Fill",type:f.ControlType.Color,defaultValue:"#EBEBEB"},...si,...bs},vs=e=>({...gs(e),...xs(e),backgroundColor:e.fill}),ws={color:{title:"Color",type:f.ControlType.Color,defaultValue:"black"},text:{title:"Text",type:f.ControlType.Font,controls:"basic",displayTextAlignment:!0,displayFontSize:!0}},Ss=e=>({...e.text,color:e.color}),Le={explain:{title:"Explain",type:f.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},Mt={type:f.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:f.ControlType.Color,optional:!0},color:{title:"Color",type:f.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:f.ControlType.Color,optional:!0}}},ci={...oe,...ws,...Cs,implicitLabelPrefix:{title:"Implicit Label Prefix",type:f.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...Mt,title:"Unsatisfied Colors"},implicitSelectedColors:{...Mt,title:"Implicit Selected Colors"},...Le},Bt=(e,t,n)=>{var i,l,a,s,c,C;const o=vs(e),r=Ss(e);return{...o,...r,backgroundColor:M.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedFill:(i=e.unsatisfiedColors)==null?void 0:i.fill,implicitSelectedFill:(l=e.implicitSelectedColors)==null?void 0:l.fill}).with({isSatisfied:!1,unsatisfiedFill:M.P.string.minLength(1)},m=>m.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:M.P.string.minLength(1)},m=>m.implicitSelectedFill).otherwise(()=>o.backgroundColor),borderColor:M.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedBorderColor:(a=e.unsatisfiedColors)==null?void 0:a.borderColor,implicitSelectedBorderColor:(s=e.implicitSelectedColors)==null?void 0:s.borderColor}).with({isSatisfied:!1,unsatisfiedBorderColor:M.P.string.minLength(1)},m=>m.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:M.P.string.minLength(1)},m=>m.implicitSelectedBorderColor).otherwise(()=>o.borderColor),color:M.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedColor:(c=e.unsatisfiedColors)==null?void 0:c.color,implicitSelectedColor:(C=e.implicitSelectedColors)==null?void 0:C.color}).with({isSatisfied:!1,unsatisfiedColor:M.P.string.minLength(1)},m=>m.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:M.P.string.minLength(1)},m=>m.implicitSelectedColor).otherwise(()=>r.color),...e.style}},on={...ci,resetLabel:{title:"Reset Label",type:f.ControlType.String,defaultValue:"Reset"},blockedLabel:{title:"Blocked Label",type:f.ControlType.String,defaultValue:"Blocked"},appearance:{title:"Appearance",type:f.ControlType.Enum,defaultValue:"auto",displaySegmentedControl:!0,segmentedControlDirection:"horizontal",options:["auto","none"]}},Ne=(e,t,n)=>({...Bt(e,t,n),appearance:e.appearance});function fe(){const{explain:e,handleExplainAnswer:t}=T.useContext(Ke);return{explain:e,handleExplainAnswer:t}}function Ts(e={}){const{initialOpen:t=!1,placement:n="top",modal:o=!1,open:r,onOpenChange:i,arrow:l}=e,[a,s]=T.useState(t),c=r??a,C=i??s,m=Uo({placement:n,open:c,onOpenChange:C,whileElementsMounted:pl,middleware:[Yr(((l==null?void 0:l.height)??0)+5),ml({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),hl({padding:5}),...l?[gl(l)]:[]]}),b=m.context,u=_o(b,{enabled:r==null}),x=Ho(b),w=Qo([u,x]);return T.useMemo(()=>({open:c,setOpen:C,...w,...m,modal:o,arrow:l}),[c,C,w,m,o,l])}const ui=T.createContext(null),Ge=()=>{const e=T.useContext(ui);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function As({children:e,...t}){const n=Ts(t);return d.jsx(ui.Provider,{value:n,children:e})}const Es=T.forwardRef(function(t,n){const o=T.Children.toArray(t.children)[0],r=Ge(),i=t.children.ref,l=Xt([r.refs.setReference,n,i]);return T.isValidElement(o)?T.cloneElement(o,r.getReferenceProps({ref:l,...t,...o.props,"data-state":r.open?"open":"closed"})):d.jsx("span",{children:"Not valid children for PopoverTrigger"})}),Rs=Es,Is=O.div`
|
|
305
|
-
display: flex;
|
|
306
|
-
justify-content: center;
|
|
307
|
-
|
|
308
|
-
// The Webstorm formatter doesn't support container queries and would be break it.
|
|
309
|
-
// @formatter:off
|
|
310
|
-
@container explain-actions (min-width: 300px) {
|
|
311
|
-
justify-content: start;
|
|
312
|
-
}
|
|
313
|
-
`,Ps=O.button`
|
|
314
|
-
color: inherit;
|
|
315
|
-
font-size: 0.9em;
|
|
316
|
-
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
317
|
-
font-weight: 500;
|
|
233
|
+
`;function Vs(e){const t=xe(),n=(t==null?void 0:t.displayMode)==="dialog";return f.jsx(gs,{open:n,onOpenChange:o=>!o&&n&&(t==null?void 0:t.dismiss()),children:f.jsx(js,{...e,isOpen:n,children:T.Children.toArray(e.content)[0]??f.jsx(Os,{children:f.jsx(Br,{})})})})}function js(e){return f.jsx(d.AnimatePresence,{initial:!1,children:e.isOpen&&f.jsx(tn.Provider,{value:e,children:f.jsx(Ds,{...e,components:{Overlay:Ms},children:f.jsx(ui,{children:e.children})})})})}const ks=k(d.motion(ni))`
|
|
234
|
+
${ci}
|
|
235
|
+
`;function Ms(e){return f.jsx(ks,{...e,initial:{backgroundColor:"rgba(0,0,0,0)"},animate:{backgroundColor:"rgba(0,0,0,0.1)"},exit:{backgroundColor:"rgba(0,0,0,0)"}})}function Fs(e){const[t,n]=T.useState(null),{explain:o,applySolution:i}=U.useExplain(),r=T.useRef(null),l=T.useCallback(async(u,b,w,y)=>{const m=Ji.guid();r.current=m,n(null);try{const v=await u(),P=v,S=v,I=(P==null?void 0:P.decisionExplanations)??[],R=(S==null?void 0:S.constraintExplanations)??[];m==r.current&&n({controlId:y,displayMode:I.length===0&&R.length>0?"dialog":w,explainQuestion:b,hasError:!1,decisionExplanations:Ls(I),constraintExplanations:R})}catch{m==r.current&&n({controlId:y,displayMode:w,explainQuestion:b,hasError:!0,decisionExplanations:null,constraintExplanations:null})}},[]),s=T.useCallback((u,b,w)=>{const y=typeof u=="function"?u(h.explainQuestionBuilder):u;return l(()=>e.explainConstraints?o(y,"full"):o(y,"decisions"),y,b,w)},[e.explainConstraints,o,l]),a=T.useCallback((u,b,w)=>l(()=>Promise.resolve(u),null,b,w),[l]),c=T.useCallback(()=>{n(null)},[]),x=T.useCallback(u=>(c(),i(u)),[i,c]),g=T.useCallback(u=>{n(b=>b!=null?{...b,displayMode:u}:b)},[]),C=T.useMemo(()=>({process:t,applySolution:x,explain:s,handleExplainAnswer:a,dismiss:c,switchMode:g}),[t,x,s,a,c,g]);return f.jsx(He.Provider,{value:C,children:e.children})}function Ls(e){const t=p.pipe(p.Bool.Ord,p.Ord.contramap(o=>o.solution==null)),n=p.pipe(p.Num.Ord,p.Ord.contramap(o=>o.causedByDecisions.length));return p.pipe(e,p.RA.sortBy([t,n]))}const Le=new Map;function bt(e){const{singletonId:t,children:n}=e,[o,i]=T.useState(!1),r=T.useRef({chose:()=>i(!0)});return T.useEffect(()=>(Ns(t,r.current),()=>Bs(t,r.current)),[]),o?f.jsx(f.Fragment,{children:n}):null}function Ns(e,t){zs(e).candidates.add(t),fi(e)}function Bs(e,t){let n=Le.get(e);n!=null&&(n.candidates.delete(t),n.chosen===t&&(n.chosen=null),$s(e),fi(e))}function fi(e){let t=Le.get(e);if(t==null||t.chosen!=null)return;const n=t.candidates.values().next().value;n!=null&&(t.chosen=n,n.chose())}function $s(e){let t=Le.get(e);t==null||t.candidates.size>0||Le.delete(e)}function zs(e){let t=Le.get(e);return t==null&&(t={chosen:null,candidates:new Set},Le.set(e,t)),t}const oe={attributeId:{title:"Attribute Id",type:d.ControlType.String},componentPath:{title:"Component Path",type:d.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:d.ControlType.String}},_n={description:{title:"Description",type:d.ControlType.String},regex:{title:"Regex",type:d.ControlType.String},direction:{title:"Direction",type:d.ControlType.Enum,defaultValue:"asc",options:["asc","desc"],displaySegmentedControl:!0},mode:{title:"Mode",type:d.ControlType.Enum,defaultValue:"isMatch",options:["isMatch","string","numeric"]}},Ws={choiceValueSorting:{title:"Choice Value Sorting",type:d.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{defaultRules:{title:"Default Rules",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:_n}},attributes:{title:"Attribute",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:{...oe,choiceValues:{title:"Choice Values",type:d.ControlType.Array,control:{type:d.ControlType.String}},rules:{title:"Rules",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:_n}}}}},jsonDefinition:{title:"Definition – JSON",type:d.ControlType.String,displayTextArea:!0}}}};function Ks(e,t){const n=[],o=(r,l)=>{const s=n.find(c=>e.equals(c.first,r)&&e.equals(c.second,l));if(s)return s.ordering;const a=t.compare(r,l);return n.push({first:r,second:l,ordering:a}),a},i=p.Ord.fromCompare(o);return{cachedOrderings:n,...i}}function qs(){const e=[];return{getCache:(t,n)=>{const o=e.find(r=>r.eq===t&&r.ord===n);if(o)return o.ordCache;const i=Ks(t,n);return e.push({eq:t,ord:n,ordCache:i}),i}}}const pi=p.Ord.getMonoid(),Hs=new Intl.Collator("en",{sensitivity:"base"}),_s=new Intl.Collator("en",{sensitivity:"variant"}),Us={regex:".*",direction:"asc",mode:"string"},Qs=p.pipe([Hs,_s],p.RA.map(na),p.MO.concatAll(p.Ord.getMonoid())),Ys=p.pipe(p.Bool.Ord,p.Ord.contramap(e=>p.O.isSome(e))),Gs=p.Num.Ord;function Xs(e,t){return p.pipe((t==null?void 0:t.attributes)??[],p.RA.findFirst(n=>h.globalAttributeIdEq.equals(Z(n),e)),p.O.map(n=>[Js(n.choiceValues??[]),Un(n.rules??[])]),p.O.getOrElse(()=>[Un((t==null?void 0:t.defaultRules)??[])]),p.RA.append(hi(Us)),p.MO.concatAll(pi))}function Js(e){return p.pipe(p.Num.Ord,p.Ord.reverse,p.O.getOrd,p.Ord.reverse,p.Ord.contramap(t=>p.pipe(e,p.RA.findIndex(n=>p.Str.Eq.equals(t,n)))))}function Un(e){return p.pipe(e,p.RA.map(hi),p.MO.concatAll(pi))}function hi(e){const t=p.O.tryCatch(()=>new RegExp(e.regex)),n=N.match(e.mode).returnType().with("string",()=>Zs(e.direction)).with("numeric",()=>ea(e.direction)).with("isMatch",()=>ta(e.direction)).exhaustive();return p.pipe(n,p.Ord.contramap(o=>p.pipe(t,p.O.chainNullableK(i=>(i.lastIndex=0,i[Symbol.match](o))),p.O.chain(i=>p.pipe(i,p.RA.lookup(1),p.O.alt(()=>p.pipe(i,p.RA.lookup(0))))))))}function Zs(e){return p.pipe(Qs,hn(e),gi)}function ea(e){return p.pipe(Gs,hn(e),gi,p.Ord.contramap(p.O.chain(p.Num.parseFloatO)))}function ta(e){return p.pipe(Ys,hn(e))}function gi(e){return p.pipe(e,p.Ord.reverse,p.O.getOrd,p.Ord.reverse)}function hn(e){return t=>N.match(e).returnType().with("asc",()=>t).with("desc",()=>p.Ord.reverse(t)).exhaustive()}function na(e){return p.Ord.fromCompare((t,n)=>N.match(e.compare(t,n)).returnType().with(N.P.number.gt(0),()=>1).with(N.P.number.lt(0),()=>-1).otherwise(()=>0))}const oa=qs(),mi=T.createContext(null);function xt(e,t){const n=T.useContext(mi),o=T.useMemo(()=>p.pipe(Xs(e,n),r=>oa.getCache(p.Str.Eq,r),p.Ord.contramap(r=>r.id)),[]),{attribute:i}=U.useChoiceAttribute(e);return p.pipe(t??(i==null?void 0:i.values)??[],p.RA.sort(o))}const ia={localization:{title:"Localization",type:d.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:d.ControlType.String,displayTextArea:!0}}}};globalThis&&globalThis.__spreadArray;function ra(e){return e}globalThis&&globalThis.__spreadArray;var la=function(e){return{_tag:"Left",left:e}},sa=function(e){return{_tag:"Right",right:e}},aa=la,ca=sa,ua=function(e,t){try{return ca(e())}catch(n){return aa(t(n))}},da=function(e){return ua(function(){return JSON.parse(e)},ra)};const Ct=J.z.object({localId:J.z.string(),componentPath:J.z.string().array().optional().nullish(),sharedConfigurationModelId:J.z.string().optional().nullish()});function yi(e){var t;return{sharedConfigurationModel:e.sharedConfigurationModelId??"",componentPath:((t=e.componentPath)==null?void 0:t.join(" -> "))??"",attributeId:e.localId}}function gn(e,t,n){return o=>T.useMemo(()=>p.pipe(o,p.O.fromNullable,p.O.filter(p.P.not(p.Str.isEmpty)),p.E.fromOption(()=>null),p.E.chain(p.flow(da,p.E.mapLeft(i=>`The JSON content could not be parsed. Please check for syntax errors.
|
|
236
|
+
`+i.toString()),p.E.chain(i=>p.pipe(t.safeParse(i),r=>r.success?p.E.right(r.data):p.E.left(r.error),p.E.mapLeft(r=>Zi.fromError(r,{maxIssuesInMessage:5,issueSeparator:`
|
|
237
|
+
- `})),p.E.mapLeft(r=>`The JSON schema is invalid. Ensure all required fields and types are correctly defined.
|
|
238
|
+
`+r.toString()))),p.E.map(n),p.E.mapLeft(i=>f.jsx(yo,{type:"warning",title:e+" definition is invalid and was ignored",message:i}))))),[o])}const bi=J.z.object({attributeId:Ct,name:J.z.array(J.z.object({localeCode:J.z.string(),translation:J.z.string()}))}),fa=bi.extend({choiceValueId:J.z.string()}),pa=J.z.object({attributes:bi.array().optional().nullish(),choiceValues:fa.array().optional().nullish()});function Qn(e){return{...yi(e.attributeId),name:p.pipe(e.name,p.RA.map(t=>t),p.RA.toArray)}}function ha(e){const t=p.pipe(e.attributes??[],p.RA.map(Qn),p.RA.toArray),n=p.pipe(e.choiceValues??[],p.RA.map(o=>({...Qn(o),choiceValueId:o.choiceValueId})),p.RA.toArray);return{attributes:t,choiceValues:n}}const ga=gn("Localization",pa,ha),ma=ga,Yn=J.z.object({regex:J.z.string(),direction:J.z.enum(["asc","desc"]),mode:J.z.enum(["isMatch","string","numeric"]),description:J.z.string().optional()}),ya=J.z.object({defaultRules:Yn.array().optional().nullish(),attributes:J.z.object({attributeId:Ct,choiceValues:J.z.string().array(),rules:Yn.array()}).array().optional().nullish()});function ba(e){const t=p.pipe(e.defaultRules??[],p.RA.map(o=>o),p.RA.toArray);return{attributes:p.pipe(e.attributes??[],p.RA.map(o=>({...yi(o.attributeId),choiceValues:p.RA.toArray(o.choiceValues),rules:p.pipe(o.rules,p.RA.map(i=>i),p.RA.toArray)})),p.RA.toArray),defaultRules:t}}const xa=gn("ChoiceValueSorting",ya,ba),Ca=xa,va=J.z.object({attributeId:Ct,decisions:Ct.array()}),wa=va.array(),Sa=gn("AttributeRelations",wa,e=>e),Ta=Sa,Ea={wizardAttributeRelations:{title:"Wizard Attribute Relations",type:d.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{wizardSteps:{title:"Wizard Steps",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:{name:{title:"Name",type:d.ControlType.String},attributes:{title:"Attributes",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:oe}}}}}}}},xi=ae(e=>{var D,O,j,A;const{hcaBaseUrl:t,sessionCreation:n,accessToken:o,sessionCreateUrl:i,sessionDeleteUrl:r,deploymentName:l,channel:s,children:a,explainDialogProps:c,explainPopoverProps:x,explainConstraints:g}=e,{activeLocale:C}=d.useLocaleInfo(),u=C.code;if(T.useEffect(()=>{console.info("Current locale code:",u)},[u]),G())return f.jsxs(f.Fragment,{children:[a,f.jsx(bt,{singletonId:"Configuration",children:f.jsx(Cn,{})})]});const w=Ta((D=e.attributeRelations)==null?void 0:D.jsonDefinition),y=T.useMemo(()=>p.pipe(w,p.O.fromEither,p.O.toNullable),[w]),m=Ca((O=e.choiceValueSorting)==null?void 0:O.jsonDefinition),v=T.useMemo(()=>p.pipe(m,p.E.orElse(()=>p.pipe(e.choiceValueSorting,p.E.fromNullable(null))),p.E.getOrElse(()=>({attributes:[],defaultRules:[]}))),[m,e.choiceValueSorting]),P=ma((j=e.localization)==null?void 0:j.jsonDefinition),S=T.useMemo(()=>p.pipe(P,p.E.getOrElse(()=>({attributes:[],choiceValues:[]}))),[P]),I=p.pipe((A=e.wizardAttributeRelations)==null?void 0:A.wizardSteps,p.O.fromNullable,p.O.filter(p.RA.isNonEmpty),p.O.map(p.RA.map(F=>({attributes:p.pipe(F.attributes,p.RA.map(Z))}))),p.O.toNullable),R=T.useMemo(()=>({apiBaseUrl:Yi(t,"api","engine"),sessionInitialisationOptions:N.match(n).with("client-side",()=>({accessToken:o})).with("server-side",()=>({sessionCreateUrl:i})).exhaustive(),configurationModelSource:{type:h.ConfigurationModelSourceType.Channel,channel:s,deploymentName:l},attributeRelations:y,wizardAttributeRelations:I,allowedInExplain:{rules:{type:h.AllowedRulesInExplainType.all}}}),[t,n,o,i,r,s,l,y]);return f.jsxs(f.Fragment,{children:[f.jsxs(U.Configuration,{sessionContext:R,children:[p.pipe(P,p.E.swap,p.O.fromEither,p.O.toNullable),p.pipe(m,p.E.swap,p.O.fromEither,p.O.toNullable),p.pipe(w,p.E.swap,p.O.fromEither,p.O.toNullable),f.jsx(dr,{...e}),f.jsx(T.Suspense,{children:f.jsx(Et.Provider,{value:S,children:f.jsxs(Fs,{explainConstraints:g,children:[f.jsx(en.Provider,{value:x,children:f.jsx(mi.Provider,{value:v,children:a})}),f.jsx(Vs,{...c})]})})})]}),f.jsx(bt,{singletonId:"Configuration",children:f.jsx(Cn,{})})]})}),Aa=xi;d.addPropertyControls(xi,{children:{title:"Content",type:d.ControlType.ComponentInstance},channel:{type:d.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:d.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:d.ControlType.String,defaultValue:"https://spc.viamedici.io/hca"},sessionCreation:{title:"Session Creation",type:d.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:d.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:d.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:d.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:d.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:d.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:d.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:d.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:d.ControlType.Object,optional:!1,controls:Cr,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:d.ControlType.Object,optional:!1,controls:xr,buttonTitle:"Props…"},explainConstraints:{title:"Explain Constraints",type:d.ControlType.Boolean,defaultValue:!1},attributeRelations:{title:"Attribute Relations",type:d.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:d.ControlType.String,displayTextArea:!0}}},...Ea,...Ws,...ia});const $e={explain:{title:"Explain",type:d.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},Jt={type:d.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:d.ControlType.Color,optional:!0},color:{title:"Color",type:d.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:d.ControlType.Color,optional:!0}}},Ci={...oe,...de({color:"black",text:{fontSize:16,textAlign:"left"}}),..._e({fill:"#EBEBEB",radius:6}),implicitLabelPrefix:{title:"Implicit Label Prefix",type:d.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...Jt,title:"Unsatisfied Colors"},implicitSelectedColors:{...Jt,title:"Implicit Selected Colors"},...$e},Zt=(e,t,n)=>{var r,l,s,a,c,x;const o=Be(e),i=fe(e);return{...o,...i,backgroundColor:N.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedFill:(r=e.unsatisfiedColors)==null?void 0:r.fill,implicitSelectedFill:(l=e.implicitSelectedColors)==null?void 0:l.fill}).with({isSatisfied:!1,unsatisfiedFill:N.P.string.minLength(1)},g=>g.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:N.P.string.minLength(1)},g=>g.implicitSelectedFill).otherwise(()=>o.backgroundColor),borderColor:N.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedBorderColor:(s=e.unsatisfiedColors)==null?void 0:s.borderColor,implicitSelectedBorderColor:(a=e.implicitSelectedColors)==null?void 0:a.borderColor}).with({isSatisfied:!1,unsatisfiedBorderColor:N.P.string.minLength(1)},g=>g.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:N.P.string.minLength(1)},g=>g.implicitSelectedBorderColor).otherwise(()=>o.borderColor),color:N.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedColor:(c=e.unsatisfiedColors)==null?void 0:c.color,implicitSelectedColor:(x=e.implicitSelectedColors)==null?void 0:x.color}).with({isSatisfied:!1,unsatisfiedColor:N.P.string.minLength(1)},g=>g.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:N.P.string.minLength(1)},g=>g.implicitSelectedColor).otherwise(()=>i.color),...e.style}},mn={...Ci,resetLabel:{title:"Reset Label",type:d.ControlType.String,defaultValue:"Reset"},blockedLabel:{title:"Blocked Label",type:d.ControlType.String,defaultValue:"Blocked"},appearance:{title:"Appearance",type:d.ControlType.Enum,defaultValue:"auto",displaySegmentedControl:!0,segmentedControlDirection:"horizontal",options:["auto","none"]}},Ne=(e,t,n)=>({...Zt(e,t,n),appearance:e.appearance});function he(){const{explain:e,handleExplainAnswer:t}=T.useContext(He);return{explain:e,handleExplainAnswer:t}}function Ia(e={}){const{initialOpen:t=!1,placement:n="top",modal:o=!1,open:i,onOpenChange:r,arrow:l}=e,[s,a]=T.useState(t),c=i??s,x=r??a,g=ri({placement:n,open:c,onOpenChange:x,whileElementsMounted:Sl,middleware:[ll(((l==null?void 0:l.height)??0)+5),El({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),Tl({padding:5}),...l?[Il(l)]:[]]}),C=g.context,u=oi(C,{enabled:i==null}),b=ii(C),w=li([u,b]);return T.useMemo(()=>({open:c,setOpen:x,...w,...g,modal:o,arrow:l}),[c,x,w,g,o,l])}const vi=T.createContext(null),et=()=>{const e=T.useContext(vi);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function Ra({children:e,...t}){const n=Ia(t);return f.jsx(vi.Provider,{value:n,children:e})}const Pa=T.forwardRef(function(t,n){const o=T.Children.toArray(t.children)[0],i=et(),r=t.children.ref,l=un([i.refs.setReference,n,r]);return T.isValidElement(o)?T.cloneElement(o,i.getReferenceProps({ref:l,...t,...o.props,"data-state":i.open?"open":"closed"})):f.jsx("span",{children:"Not valid children for PopoverTrigger"})}),Oa=Pa,Da=k.button`
|
|
318
239
|
appearance: none;
|
|
319
240
|
border: none;
|
|
320
|
-
border-radius: var(--shape-border-radius-xs);
|
|
321
|
-
margin-top: 0.9em;
|
|
322
241
|
text-decoration: underline;
|
|
323
242
|
cursor: pointer;
|
|
324
|
-
|
|
243
|
+
align-self: center;
|
|
244
|
+
|
|
245
|
+
&:hover {
|
|
246
|
+
background-color: var(--color-button-fill-hover) !important;
|
|
247
|
+
}
|
|
325
248
|
|
|
326
249
|
&:focus {
|
|
327
|
-
outline:
|
|
328
|
-
outline-offset:
|
|
250
|
+
outline: var(--size-button-focus-outline) solid var(--color-button-focus-outline);
|
|
251
|
+
outline-offset: var(--size-button-focus-outline-offset);
|
|
329
252
|
}
|
|
330
|
-
`;function
|
|
331
|
-
font-weight: 500;
|
|
332
|
-
font-family: var(--font-heading);
|
|
253
|
+
`;function Va(){const{decisionExplanations:e,switchMode:t}=xe(),{showMoreButton:n,showConstraintsButton:o}=St(),i=e.length-1,r=T.useMemo(()=>i>0&&er.render(n.staticText,{amount:i}),[n.text,i]),l=i>0?n:o;return f.jsx(Da,{onClick:()=>t("dialog"),style:{...vt(l),...wt(l)},children:r||l.staticText})}const ja=k.div`
|
|
333
254
|
margin-bottom: var(--space-xs);
|
|
334
|
-
`,
|
|
255
|
+
`,Gn=k.div`
|
|
335
256
|
height: 1px;
|
|
336
257
|
background-color: var(--color-explain-popover-list-separator);
|
|
337
|
-
margin-left: -1
|
|
338
|
-
margin-right: -1
|
|
258
|
+
margin-left: calc(var(--size-explain-popover-box-padding-left) * -1);
|
|
259
|
+
margin-right: calc(var(--size-explain-popover-box-padding-right) * -1);
|
|
339
260
|
|
|
340
261
|
@media only screen and (min-resolution: 2dppx) {
|
|
341
262
|
height: 0.5px;
|
|
342
263
|
}
|
|
343
|
-
`,
|
|
264
|
+
`,ka=k.div`
|
|
265
|
+
display: flex;
|
|
266
|
+
flex-direction: column;
|
|
344
267
|
container: explain-actions / inline-size;
|
|
345
|
-
`,
|
|
268
|
+
`,Ma=k(Eo)`
|
|
346
269
|
display: grid;
|
|
347
270
|
grid-template-columns: [name] minmax(100px, auto) [values] minmax(100px, 1fr);
|
|
348
271
|
gap: var(--space-sm);
|
|
349
272
|
padding-top: var(--space-xs);
|
|
350
273
|
padding-bottom: var(--space-xs);
|
|
351
|
-
padding-right:
|
|
352
|
-
margin-right: -1
|
|
274
|
+
padding-right: var(--size-explain-popover-box-padding-right);
|
|
275
|
+
margin-right: calc(var(--size-explain-popover-box-padding-right) * -1);
|
|
353
276
|
overflow: auto;
|
|
354
277
|
max-height: 200px;
|
|
355
|
-
`,
|
|
356
|
-
|
|
357
|
-
background-color: var(--color-explain-popover-apply-solution-button-fill);
|
|
358
|
-
color: var(--color-explain-popover-apply-solution-button-color);
|
|
359
|
-
font-size: 0.9em;
|
|
360
|
-
font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
361
|
-
font-weight: 600;
|
|
362
|
-
appearance: none;
|
|
363
|
-
padding: 0.6em 2em;
|
|
364
|
-
border: none;
|
|
365
|
-
width: 100%;
|
|
366
|
-
margin-top: 1.1em;
|
|
278
|
+
`,Fa=k(wo)`
|
|
279
|
+
align-self: stretch;
|
|
367
280
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
outline-offset: 1px;
|
|
281
|
+
@container explain-actions (min-width: 300px) {
|
|
282
|
+
align-self: center;
|
|
371
283
|
}
|
|
372
|
-
|
|
373
|
-
// The Webstorm formatter doesn't support container queries and would be break it.
|
|
374
|
-
// @formatter:off
|
|
375
|
-
@container explain-actions (min-width: 300px) {
|
|
376
|
-
width: auto;
|
|
377
|
-
}
|
|
378
|
-
`,Et=O(ho)`
|
|
284
|
+
`,Bt=k(Ao)`
|
|
379
285
|
width: min-content;
|
|
380
286
|
min-width: 300px;
|
|
381
|
-
`;function
|
|
287
|
+
`;function La(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=xe(),{subline:o}=St();if(n)return f.jsx(Bt,{variant:"failedToExplain"});const i=e[0];if(!i)return f.jsx(Bt,{variant:"noExplanationFound"});if(!i.solution)return f.jsx(Bt,{variant:"noSolutionFound"});const r=i.solution.decisions.filter(l=>l.state!=null);return f.jsxs(f.Fragment,{children:[f.jsx(ja,{style:at(o),children:o.staticText}),f.jsx(Gn,{}),f.jsx(Ma,{blockingDecisions:i.causedByDecisions,desiredDecisions:r}),f.jsx(Gn,{}),f.jsxs(ka,{children:[f.jsx(Fa,{explanation:i}),(e.length>1||t.length>0)&&f.jsx(Va,{})]})]})}const wi=T.createContext(null),ce=()=>T.useContext(wi);function yn(e){return T.forwardRef((t,n)=>{const o=T.useId();return f.jsx(wi.Provider,{value:o,children:f.jsx(e,{...t,ref:n})})})}const Na=T.forwardRef((e,t)=>{const{style:n,children:o,...i}=e,r=et(),l=un([r.refs.setFloating,t]);return f.jsx(Zo,{children:f.jsx(ti,{context:r.context,modal:r.modal,children:f.jsx("div",{ref:l,style:{...r.floatingStyles,...n},...r.getFloatingProps(i),children:o})})})}),Ba=Na,$a=T.forwardRef((e,t)=>{const{setOpen:n}=et();return f.jsx("button",{type:"button",ref:t,...e,onClick:o=>{var i;(i=e.onClick)==null||i.call(e,o),n(!1)}})}),za=$a,Wa=k.div`
|
|
382
288
|
position: relative;
|
|
383
|
-
background-color: var(--color-explain-popover-fill);
|
|
384
|
-
color: var(--color-explain-popover-color);
|
|
385
289
|
outline-offset: -1px;
|
|
386
|
-
|
|
387
|
-
border-radius: var(--shape-border-radius-md);
|
|
388
|
-
font-size: var(--text-base-size);
|
|
389
|
-
font-family: var(--font-primary);
|
|
290
|
+
border-style: solid;
|
|
390
291
|
min-width: 300px;
|
|
391
292
|
max-width: 500px;
|
|
392
|
-
`,
|
|
293
|
+
`,Ka=k(za)`
|
|
393
294
|
position: absolute;
|
|
394
295
|
right: var(--space-sm-fixed);
|
|
395
296
|
top: var(--space-sm-fixed);
|
|
396
|
-
border: none;
|
|
397
|
-
background-color: transparent;
|
|
398
|
-
color: inherit;
|
|
399
|
-
font-size: var(--text-sm);
|
|
400
297
|
cursor: pointer;
|
|
401
|
-
|
|
298
|
+
|
|
299
|
+
&:hover {
|
|
300
|
+
background-color: var(--color-button-fill-hover) !important;
|
|
301
|
+
}
|
|
402
302
|
|
|
403
303
|
&:focus {
|
|
404
|
-
outline:
|
|
405
|
-
outline-offset:
|
|
304
|
+
outline: var(--size-button-focus-outline) solid var(--color-button-focus-outline);
|
|
305
|
+
outline-offset: var(--size-button-focus-outline-offset);
|
|
406
306
|
}
|
|
407
|
-
`,
|
|
408
|
-
font-size: var(--text-md);
|
|
409
|
-
font-weight: 500;
|
|
410
|
-
font-family: var(--font-heading);
|
|
307
|
+
`,qa=k(di)`
|
|
411
308
|
margin-bottom: var(--space-xs);
|
|
412
309
|
overflow: hidden;
|
|
413
310
|
display: flex;
|
|
414
311
|
white-space: nowrap;
|
|
415
312
|
text-overflow: ellipsis;
|
|
416
313
|
margin-right: var(--space-md);
|
|
417
|
-
`;function
|
|
418
|
-
--color-explain-
|
|
419
|
-
--
|
|
420
|
-
--
|
|
421
|
-
--
|
|
422
|
-
--
|
|
423
|
-
--color-explain-header-value-color: ${e=>e.headerValueColor};
|
|
424
|
-
--color-explain-popover-fill: ${e=>e.fill};
|
|
425
|
-
--color-explain-popover-color: ${e=>e.color};
|
|
426
|
-
--color-explain-popover-close-button-outline: ${e=>e.closeButtonOutline};
|
|
314
|
+
`;function Ha(e){const{popoverBox:t,closeButton:n}=St();return f.jsxs(Wa,{style:Be(t),children:[f.jsx(qa,{}),e.children,f.jsx(Ka,{style:vt(n),children:f.jsx(lt.FontAwesomeIcon,{icon:rt.faXmark})})]})}const _a=k(Ba)`
|
|
315
|
+
--color-explain-popover-box-fill: ${e=>e.popoverBox.fill};
|
|
316
|
+
--size-explain-popover-box-padding-top: ${e=>e.popoverBox.isMixedPadding?e.popoverBox.paddingTop:e.popoverBox.padding}px;
|
|
317
|
+
--size-explain-popover-box-padding-right: ${e=>e.popoverBox.isMixedPadding?e.popoverBox.paddingRight:e.popoverBox.padding}px;
|
|
318
|
+
--size-explain-popover-box-padding-bottom: ${e=>e.popoverBox.isMixedPadding?e.popoverBox.paddingBottom:e.popoverBox.padding}px;
|
|
319
|
+
--size-explain-popover-box-padding-left: ${e=>e.popoverBox.isMixedPadding?e.popoverBox.paddingLeft:e.popoverBox.padding}px;
|
|
427
320
|
--color-explain-popover-list-separator: ${e=>e.listSeparator};
|
|
428
|
-
--color-explain-popover-apply-solution-button-fill: ${e=>e.applySolutionButtonFill};
|
|
429
|
-
--color-explain-popover-apply-solution-button-color: ${e=>e.applySolutionButtonColor};
|
|
430
|
-
--color-explain-popover-apply-solution-button-outline: ${e=>e.applySolutionButtonOutline};
|
|
431
|
-
--color-explain-popover-show-more-button-outline: ${e=>e.showMoreButtonOutline};
|
|
432
321
|
|
|
433
322
|
z-index: 10;
|
|
434
|
-
filter: var(--shadows-popover);
|
|
435
323
|
|
|
436
324
|
&:focus {
|
|
437
325
|
outline: none;
|
|
438
326
|
}
|
|
439
|
-
`,
|
|
440
|
-
fill: var(--color-explain-popover-fill);
|
|
441
|
-
`,
|
|
442
|
-
Please check your internet connection and try again.`)}function
|
|
443
|
-
Please check your internet connection and try again.`)}const
|
|
327
|
+
`,Ua=k(Jl)`
|
|
328
|
+
fill: var(--color-explain-popover-box-fill);
|
|
329
|
+
`,Qa={initial:{opacity:0,scale:0},open:{opacity:1,scale:1,transition:{type:"spring",stiffness:600,damping:40}},close:{opacity:0,scale:0,transition:{duration:.2,ease:"cubicInOut"}}};function Ya(e){const t=xe(),n=ce(),o=(t==null?void 0:t.displayMode)==="popover"&&(t==null?void 0:t.controlId)===n,i=T.useRef(null);return f.jsxs(Ra,{open:o,onOpenChange:r=>!r&&o&&(t==null?void 0:t.dismiss()),arrow:{width:20,height:10,padding:10,element:i},children:[f.jsx(Oa,{children:e.children}),f.jsxs(Ga,{isOpen:o,children:[T.Children.toArray(e.content)[0]??f.jsx(Ha,{children:f.jsx(La,{})}),f.jsx(Xa,{})]})]})}function Ga(e){var C,u;const t=St(),{middlewareData:n,arrow:o,placement:i}=et(),r=((C=n.arrow)==null?void 0:C.x)??0,l=((u=n.arrow)==null?void 0:u.y)??0,s=(o==null?void 0:o.height)??0,a=(o==null?void 0:o.width)??0,c=r+a/2,x=l+s,g=N.match(i).with("top",()=>`${c}px calc(100% + ${s+5}px)`).with("bottom",()=>`${c}px ${-s-5}px`).with("left",()=>`calc(100% + ${s}px) ${x}px`).with("right",()=>`${-s}px ${x}px`).otherwise(()=>"");return f.jsx(d.AnimatePresence,{initial:!1,children:e.isOpen&&f.jsx(_a,{...t,children:f.jsx(d.motion.div,{variants:Qa,initial:"initial",animate:"open",exit:"close",style:{transformOrigin:g},children:f.jsx(ui,{children:e.children})})})})}function Xa(){const{context:e,arrow:t}=et();return f.jsx(Ua,{ref:t.element,context:e,width:t.width,height:t.height})}function Ja(e){return T.forwardRef((t,n)=>{const o=G();return t.explain!=="popover"||o?f.jsx(e,{...t}):f.jsx(Ya,{children:f.jsx(e,{...t,ref:n})})})}function ge(e){return ae(yn(Ja(T.forwardRef(e))))}function pe(){alert(`Failed to apply your selection.
|
|
330
|
+
Please check your internet connection and try again.`)}function Za(){alert(`Failed to reset your configuration.
|
|
331
|
+
Please check your internet connection and try again.`)}const Xn=k.select`
|
|
444
332
|
color: inherit;
|
|
445
333
|
cursor: inherit;
|
|
446
|
-
`,
|
|
334
|
+
`,Jn="<reset>",Zn="<nothing>",Si=ge((e,t)=>{if(G()){const A=Ne(e,!0,!1);return f.jsx(Xn,{style:A})}const o=ce(),i=Z(e),r=U.useChoiceAttribute(i);if(!r)return f.jsx("span",{children:"Choice Attribute not found"});const{explain:l}=he(),s=Ge(i),{attribute:a,makeDecision:c,clearDecisions:x,isMultiSelect:g,getIncludedChoiceValues:C,getBlockedChoiceValues:u,getAllowedChoiceValues:b}=r,w=xt(i,b()),y=xt(i,u()),m=C(),v=m.map(A=>A.id),P=v[0]??Zn,S=m.some(A=>{var F;return((F=A.decision)==null?void 0:F.kind)===h.DecisionKind.Explicit}),I=v.length>=1,R=m.some(A=>{var F;return((F=A.decision)==null?void 0:F.kind)===h.DecisionKind.Implicit}),D=w.length===0,O=async A=>{const F=e.explain,B=F!=="disabled"&&(()=>l(W=>W.whyIsStateNotPossible.choice(a.id).choiceValue(A).state(h.ChoiceValueDecisionState.Included),F,o));if(A===Jn)try{await x()}catch{pe()}else if(w.some(W=>W.id===A)){const W=v.some(H=>H===A)?void 0:h.ChoiceValueDecisionState.Included;try{await c(A,W)}catch(H){if(H.type===h.ConfiguratorErrorType.ConflictWithConsequence&&B){await B();return}pe()}}else y.some(W=>W.id===A)&&B&&await B()},j=nc(e,a.isSatisfied,R,D);return f.jsxs(Xn,{ref:t,value:g()?v:P,multiple:g(),onChange:A=>O(A.currentTarget.value),style:j,children:[!I&&!g()&&f.jsx("option",{value:Zn}),S&&f.jsx("option",{value:Jn,children:e.resetLabel}),w.map(A=>{var F;return f.jsxs("option",{value:A.id,children:[((F=A.decision)==null?void 0:F.kind)===h.DecisionKind.Implicit?e.implicitLabelPrefix:"",s.get(A.id)??A.id]},A.id)}),y.length>0&&f.jsx("optgroup",{label:e.blockedLabel,children:y.map(A=>f.jsx("option",{value:A.id,children:s.get(A.id)??A.id},A.id))})]})}),ec=Si,tc={...mn,noOptionsAvailableColors:{...Jt,title:"No Options Available Colors"}};d.addPropertyControls(Si,tc);const nc=(e,t,n,o)=>{var r,l,s;const i=Ne(e,t,n);return{...i,backgroundColor:N.match({noOptionsAvailable:o,noOptionsAvailableFill:(r=e.noOptionsAvailableColors)==null?void 0:r.fill}).with({noOptionsAvailable:!0,noOptionsAvailableFill:N.P.string.minLength(1)},a=>a.noOptionsAvailableFill).otherwise(()=>i.backgroundColor),borderColor:N.match({noOptionsAvailable:o,noOptionsAvailableBorderColor:(l=e.noOptionsAvailableColors)==null?void 0:l.borderColor}).with({noOptionsAvailable:!0,noOptionsAvailableBorderColor:N.P.string.minLength(1)},a=>a.noOptionsAvailableBorderColor).otherwise(()=>i.borderColor),color:N.match({noOptionsAvailable:o,noOptionsAvailableColor:(s=e.noOptionsAvailableColors)==null?void 0:s.color}).with({noOptionsAvailable:!0,noOptionsAvailableColor:N.P.string.minLength(1)},a=>a.noOptionsAvailableColor).otherwise(()=>i.color)}},eo=k.select`
|
|
447
335
|
color: inherit;
|
|
448
336
|
cursor: inherit;
|
|
449
|
-
`,
|
|
337
|
+
`,to="<reset>",$t="<nothing>",zt="yes",no="no",Ti=ge((e,t)=>{var v,P,S;if(G()){const I=Ne(e,!0,!1);return f.jsx(eo,{style:I})}const o=ce(),i=Z(e),r=U.useBooleanAttribute(i),{explain:l}=he();if(!r)return f.jsx("span",{children:"Boolean Attribute not found"});const{attribute:s,makeDecision:a}=r,c=async I=>{var D;const R=((D=s.decision)==null?void 0:D.kind)===h.DecisionKind.Explicit;if(I===to&&R)try{await a(void 0)}catch{pe()}else{const O=I===zt,j=s.possibleDecisionStates.includes(O),A=e.explain,F=A!=="disabled"&&(()=>l(B=>B.whyIsStateNotPossible.boolean(s.id).state(O),A,o));if(j)try{await a(O)}catch(B){if(B.type===h.ConfiguratorErrorType.ConflictWithConsequence&&F){await F();return}pe()}else F&&await F()}},x=N.match((v=s.decision)==null?void 0:v.state).with(!0,()=>zt).with(!1,()=>no).otherwise(()=>$t),g=((P=s.decision)==null?void 0:P.kind)===h.DecisionKind.Explicit,C=((S=s.decision)==null?void 0:S.kind)===h.DecisionKind.Implicit,u=Ne(e,s.isSatisfied,C),b=s.possibleDecisionStates.includes(!0),w=s.possibleDecisionStates.includes(!1),y=f.jsxs("option",{value:zt,children:[oo(s,!0,e.implicitLabelPrefix),e.trueLabel]}),m=f.jsxs("option",{value:no,children:[oo(s,!1,e.implicitLabelPrefix),e.falseLabel]});return f.jsxs(eo,{ref:t,value:x,onChange:I=>c(I.currentTarget.value),style:u,children:[x===$t&&f.jsx("option",{value:$t}),g&&f.jsx("option",{value:to,children:e.resetLabel}),b&&y,w&&m,(!b||!w)&&f.jsxs("optgroup",{label:e.blockedLabel,children:[!b&&y,!w&&m]})]})}),oc=Ti,oo=(e,t,n)=>{var o,i;return((o=e.decision)==null?void 0:o.kind)===h.DecisionKind.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},ic={...mn,trueLabel:{title:"True Label",type:d.ControlType.String,defaultValue:"Yes"},falseLabel:{title:"False Label",type:d.ControlType.String,defaultValue:"No"}};d.addPropertyControls(Ti,ic);const io=k.select`
|
|
450
338
|
color: inherit;
|
|
451
339
|
cursor: inherit;
|
|
452
|
-
`,
|
|
340
|
+
`,ro="<reset>",Wt="<nothing>",Kt="included",qt="excluded",Ei=ge((e,t)=>{var P,S,I;if(G()){const R=Ne(e,!0,!1);return f.jsx(io,{style:R})}const o=ce(),i=Z(e),r=U.useComponentAttribute(i),{explain:l}=he();if(!r)return f.jsx("span",{children:"Component Attribute not found"});const{attribute:s,makeDecision:a}=r,c=async R=>{const D=s.possibleDecisionStates.includes(R),O=e.explain,j=O!=="disabled"&&(()=>l(A=>A.whyIsStateNotPossible.component(s.id).state(R),O,o));if(D)try{await a(R)}catch(A){if(A.type===h.ConfiguratorErrorType.ConflictWithConsequence&&j){await j();return}pe()}else j&&await j()},x=async R=>{var O;const D=((O=s.decision)==null?void 0:O.kind)===h.DecisionKind.Explicit;R===ro&&D?await a(void 0):R===Kt?await c(h.ComponentDecisionState.Included):R===qt&&await c(h.ComponentDecisionState.Excluded)},g=N.match((P=s.decision)==null?void 0:P.state).with(h.ComponentDecisionState.Included,()=>Kt).with(h.ComponentDecisionState.Excluded,()=>qt).otherwise(()=>Wt),C=((S=s.decision)==null?void 0:S.kind)===h.DecisionKind.Explicit,u=((I=s.decision)==null?void 0:I.kind)===h.DecisionKind.Implicit,b=Ne(e,s.isSatisfied,u),w=s.possibleDecisionStates.includes(h.ComponentDecisionState.Included),y=s.possibleDecisionStates.includes(h.ComponentDecisionState.Excluded),m=f.jsxs("option",{value:Kt,children:[lo(s,h.ComponentDecisionState.Included,e.implicitLabelPrefix),e.includedLabel]}),v=f.jsxs("option",{value:qt,children:[lo(s,h.ComponentDecisionState.Excluded,e.implicitLabelPrefix),e.excludedLabel]});return f.jsxs(io,{ref:t,value:g,onChange:R=>x(R.currentTarget.value),style:b,children:[g===Wt&&f.jsx("option",{value:Wt}),C&&f.jsx("option",{value:ro,children:e.resetLabel}),w&&m,y&&v,(!w||!y)&&f.jsxs("optgroup",{label:e.blockedLabel,children:[!w&&m,!y&&v]})]})}),rc=Ei,lo=(e,t,n)=>{var o,i;return((o=e.decision)==null?void 0:o.kind)===h.DecisionKind.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},lc={...mn,includedLabel:{title:"Included Label",type:d.ControlType.String,defaultValue:"Included"},excludedLabel:{title:"Excluded Label",type:d.ControlType.String,defaultValue:"Excluded"}};d.addPropertyControls(Ei,lc);function Ai(e,t,n,o,i=1e3){const[r]=or.useForceUpdate(),l=nr.useDebouncedCallback(C=>{t(C),r()},i),s=T.useRef(n),a=T.useRef(e),c=l.isPending(),x=T.useRef(c);T.useEffect(()=>{e!==a.current&&(a.current=e,c&&(l.cancel(),r()),e!==n&&o(e)),n!==s.current&&(s.current=n,n!==e?(l(n),r()):c&&(l.cancel(),r())),c!==x.current&&(x.current=c,!c&&e!==n&&o(e))},[e,n,l,c]);const g=T.useCallback(()=>{l.isPending()&&l.flush()},[l]);return T.useEffect(()=>()=>g(),[g]),{flush:g}}const so=k(tr)`
|
|
453
341
|
color: inherit;
|
|
454
|
-
`,yi=pe((e,t)=>{var v,V;if(X()){const S=Bt(e,!0,!1);return d.jsx(Yn,{style:S})}const o=ce(),r=Z(e),i=U.useNumericAttribute(r),{explain:l}=fe();if(!i)return d.jsx("span",{children:"Numeric Attribute not found"});const{attribute:a,makeDecision:s}=i,c=((v=a.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit,C=Bt(e,a.isSatisfied,c),m=(V=a.decision)==null?void 0:V.state,[b,u]=T.useState(m),{min:x,max:w}=a.range,y=mi(m,async S=>{if(S<x){alert(`The value must be smaller than or equal to ${x}.`);return}if(S>w){alert(`The value must be greater than or equal to ${w}.`);return}try{await s(S)}catch(R){R.type===h.ConfiguratorErrorType.SetDecisionConflict?e.explain!=="disabled"&&await l(P=>P.whyIsStateNotPossible.numeric(a.id).state(S),e.explain,o):de()}},b,S=>u(S),e.wait);return d.jsx(Yn,{getInputRef:t,thousandsGroupStyle:"thousand",decimalSeparator:e.decimalSeparator,thousandSeparator:e.thousandSeparator,allowNegative:!0,fixedDecimalScale:!0,decimalScale:a.decimalPlaces,allowEmptyFormatting:!1,displayType:"input",placeholder:e.placeholder,prefix:lc(a,e.implicitLabelPrefix),onBlur:()=>{y.flush()},onKeyPress:S=>{S.key==="Enter"&&y.flush()},onValueChange:S=>u(S.floatValue),value:b??"",style:C})}),rc=yi,lc=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===h.DecisionKind.Implicit?t:""},ac={...ci,wait:{title:"Debounce Delay",type:f.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:f.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:f.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:f.ControlType.String,defaultValue:""}};f.addPropertyControls(yi,ac);const Me={choiceValueId:{title:"Choice Value Id",type:f.ControlType.String}};function he(e,t){return T.Children.map(e,n=>{if(T.isValidElement(n)){const o=oo(n.props,t);return T.cloneElement(n,o)}return n})}const gi=pe((e,t)=>{if(X())return e.children;const o=ce(),{makeDecision:r}=U.useMakeDecision(),i=Z(e),l=e.choiceValueId??"",a=l.length>0,s=U.useAttributes([i],!1)[0],{explain:c}=fe();if(!s)return d.jsx("span",{children:"Attribute not found"});const C=s.type===h.AttributeType.Choice,m=s.type===h.AttributeType.Numeric,b=s.type===h.AttributeType.Boolean,u=s.type===h.AttributeType.Component;if(!C&&a)return d.jsx("span",{children:"Attribute is not a Choice Attribute"});if(m)return d.jsx("span",{children:"Numeric Attribute is not supported"});let x=C?s.values.get(l):null;if(a&&x==null)return d.jsx("span",{children:"Choice Value not found"});const w=V=>M.match({state:V,attribute:s}).with({attribute:{type:h.AttributeType.Choice},state:"undefined"},()=>x.decision==null).with({attribute:{type:h.AttributeType.Choice},state:"included"},()=>{var S,R;return((S=x.decision)==null?void 0:S.state)===h.ChoiceValueDecisionState.Included&&((R=x.decision)==null?void 0:R.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Choice},state:"excluded"},()=>{var S,R;return((S=x.decision)==null?void 0:S.state)===h.ChoiceValueDecisionState.Excluded&&((R=x.decision)==null?void 0:R.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Boolean},state:"undefined"},{attribute:{type:h.AttributeType.Component},state:"undefined"},({attribute:S})=>S.decision==null).with({attribute:{type:h.AttributeType.Boolean},state:"true"},({attribute:S})=>{var R,I;return((R=S.decision)==null?void 0:R.state)===!0&&((I=S.decision)==null?void 0:I.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Boolean},state:"false"},({attribute:S})=>{var R,I;return((R=S.decision)==null?void 0:R.state)===!1&&((I=S.decision)==null?void 0:I.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Component},state:"included"},({attribute:S})=>{var R,I;return((R=S.decision)==null?void 0:R.state)===h.ComponentDecisionState.Included&&((I=S.decision)==null?void 0:I.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Component},state:"excluded"},({attribute:S})=>{var R,I;return((R=S.decision)==null?void 0:R.state)===h.ComponentDecisionState.Excluded&&((I=S.decision)==null?void 0:I.kind)===h.DecisionKind.Explicit}).otherwise(()=>!1),g=V=>M.match({isChoiceAttribute:C,isBooleanAttribute:b,isComponentAttribute:u,state:V}).with({isChoiceAttribute:!0,state:"included"},()=>h.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>h.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>h.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>h.ComponentDecisionState.Excluded).otherwise(()=>null);w(e.toggleFrom);const y=w(e.toggleTo),v=async()=>{const V=y?e.toggleFrom:e.toggleTo,S=g(V),R=u?s.possibleDecisionStates.includes(S):!1,I=b?s.possibleDecisionStates.includes(S):!1,P=(C?x.possibleDecisionStates.includes(S):!1)||I||R,k=e.explain,E=k!=="disabled"&&(async()=>{const N=M.match({isComponentAttribute:u,isBooleanAttribute:b,isChoiceAttribute:C}).returnType().with({isChoiceAttribute:!0},()=>h.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>h.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>h.ExplainQuestionSubject.component).otherwise(()=>null);N&&await c({question:h.ExplainQuestionType.whyIsStateNotPossible,subject:N,attributeId:i,choiceValueId:l,state:S},k,o)});if(P||S==null)try{await r({type:s.type,attributeId:i,choiceValueId:l,state:S})}catch(N){if(N.type===h.ConfiguratorErrorType.ConflictWithConsequence&&E){await E();return}de()}else E&&await E()};return he(e.children,{onClick:v,ref:t})}),sc=gi,cc={...oe,...Me,children:{title:"Content",type:f.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:f.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:f.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...Le};f.addPropertyControls(gi,cc);const bi=pe((e,t)=>{if(X())return e.children;const o=ce(),{makeDecision:r}=U.useMakeDecision(),i=Z(e),l=e.choiceValueId??"",a=l.length>0,s=U.useAttributes([i],!1)[0],c=U.useChoiceAttribute(i),{explain:C}=fe();if(!s)return d.jsx("span",{children:"Attribute not found"});const m=s.type===h.AttributeType.Choice,b=s.type===h.AttributeType.Numeric,u=s.type===h.AttributeType.Boolean,x=s.type===h.AttributeType.Component;if(!m&&a)return d.jsx("span",{children:"Attribute is not a Choice Attribute"});let w=m?s.values.get(l):null;if(a&&w==null)return d.jsx("span",{children:"Choice Value not found"});const g=()=>M.match({isChoiceAttribute:m,isBooleanAttribute:u,isComponentAttribute:x,isNumericAttribute:b,hasChoiceValueId:a,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>h.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>h.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>h.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>h.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),y=async()=>{if(m&&!a&&e.setSelection==="undefined")try{await c.clearDecisions()}catch{de()}else{const v=g(),V=x?s.possibleDecisionStates.includes(v):!1,S=u?s.possibleDecisionStates.includes(v):!1,I=(m?w.possibleDecisionStates.includes(v):!1)||S||V,D=e.explain,P=D!=="disabled"&&(async()=>{const k=M.match({isComponentAttribute:x,isBooleanAttribute:u,isChoiceAttribute:m,isNumericAttribute:b}).returnType().with({isChoiceAttribute:!0},()=>h.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>h.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>h.ExplainQuestionSubject.component).with({isNumericAttribute:!0},()=>h.ExplainQuestionSubject.numeric).otherwise(()=>null);k&&await C({question:h.ExplainQuestionType.whyIsStateNotPossible,subject:k,attributeId:i,choiceValueId:l,state:v},D,o)});if(b||I||v==null)try{await r({type:s.type,attributeId:i,choiceValueId:l,state:v})}catch(k){const E=k;if((E.type===h.ConfiguratorErrorType.ConflictWithConsequence||E.type===h.ConfiguratorErrorType.SetDecisionConflict)&&P){await P();return}de()}else P&&await P()}};return he(e.children,{onClick:y,ref:t})}),uc=bi,dc={...oe,...Me,children:{title:"Content",type:f.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:f.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:f.ControlType.Number,defaultValue:0},...Le};f.addPropertyControls(bi,dc);const xi=pe((e,t)=>{var m;if(X())return e.children;const o=ce(),{makeManyDecisions:r}=U.useMakeDecision(),{handleExplainAnswer:i}=fe(),l=e.attributes.map(Z),a=U.useAttributes(l,!1).map((b,u)=>{if(!b)return{error:d.jsx("span",{children:"Attribute not found"})};const x=e.attributes[u],w=x.choiceValueId??"",g=w.length>0,y=b.type===h.AttributeType.Choice,v=b.type===h.AttributeType.Numeric,V=b.type===h.AttributeType.Boolean,S=b.type===h.AttributeType.Component;if(!y&&g)return{error:d.jsx("span",{children:"Attribute is not a Choice Attribute"})};let R=y?b.values.get(w):null;if(g&&R==null)return{error:d.jsx("span",{children:"Choice Value not found"})};const I=()=>M.match({isChoiceAttribute:y,isBooleanAttribute:V,isComponentAttribute:S,isNumericAttribute:v,hasChoiceValueId:g,state:x.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>h.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>h.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>h.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>h.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>x.numericValue).otherwise(()=>null);return{getDecisions:()=>y&&!g&&x.setSelection==="undefined"?[...b.values.values()].filter(D=>{var P;return((P=D.decision)==null?void 0:P.kind)===h.DecisionKind.Explicit}).map(D=>({type:b.type,attributeId:b.id,choiceValueId:D.id,state:null})):[{type:b.type,attributeId:b.id,choiceValueId:w,state:I()}]}}),s=(m=a.find(b=>b.error))==null?void 0:m.error;if(s)return s;const c=async()=>{const b=a.reduce((x,w)=>[...x,...w.getDecisions()],new Array),u=M.match(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:M.match(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();try{await r(b,u)}catch(x){const w=x;if(console.debug("SetMany failed",w),(w==null?void 0:w.type)===h.ConfiguratorErrorType.MakeManyDecisionsConflict&&w.decisionExplanations){e.explain!=="disabled"&&await i(w,e.explain,o);return}de();return}},C=()=>{e.trigger==="click"&&c()};return T.useEffect(()=>{e.trigger==="auto"&&c()},[]),he(e.children,{onClick:C,ref:t})}),fc=xi,pc={children:{title:"Content",type:f.ControlType.ComponentInstance},attributes:{title:"Attributes",type:f.ControlType.Array,control:{type:f.ControlType.Object,controls:{...oe,...Me,setSelection:{title:"Set Selection To",type:f.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:f.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:f.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:f.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:f.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...Le};f.addPropertyControls(xi,pc);const Ci=se(e=>{if(X())return e.enabledChildren;const{canResetConfiguration:n,resetConfiguration:o}=U.useConfigurationReset(),r=async()=>{if(n)try{await o()}catch{Xs()}},i=n?e.enabledChildren:e.disabledChildren;return he(i,{onClick:r})}),hc=Ci,mc={enabledChildren:{title:"Content – Enabled",type:f.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:f.ControlType.ComponentInstance}};f.addPropertyControls(Ci,mc);const vi=pe((e,t)=>{if(X())return e.unsatisfiedChildren;const o=ce(),{isSatisfied:r}=U.useConfigurationSatisfaction(),{explain:i}=fe(),a=[...e.attributeId.length>0?[Z(e)]:[],...e.attributes.map(Z)],s=()=>{var u;const m=U.useAttributes(a,!1).map(x=>x?{isSatisfied:x.isSatisfied}:{error:d.jsx("span",{children:"Attribute not found"})}),b=(u=m.find(x=>x.error))==null?void 0:u.error;return b||m.every(x=>x.isSatisfied)},c=async()=>{e.explain!=="disabled"&&(a.length===0?await i(m=>m.whyIsNotSatisfied.configuration,e.explain,o):a.length===1&&await i(m=>m.whyIsNotSatisfied.attribute(a[0]),e.explain,o))};return(a.length>0?s():r)?e.satisfiedChildren:he(e.unsatisfiedChildren,{onClick:c,ref:t})}),yc=vi,gc={satisfiedChildren:{title:"Content – Satisfied",type:f.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:f.ControlType.ComponentInstance},...oe,attributes:{title:"Attributes",type:f.ControlType.Array,control:{type:f.ControlType.Object,controls:{...oe}}},...Le};f.addPropertyControls(vi,gc);const wi=se(T.forwardRef(function(t,n){const o=x=>M.match(x).with(1,()=>t.content1).with(2,()=>t.content2).with(3,()=>t.content3).with(4,()=>t.content4).with(5,()=>t.content5).with(6,()=>t.content6).with(7,()=>t.content7).with(8,()=>t.content8).with(9,()=>t.content9).with(10,()=>t.content10).otherwise(()=>null),r=t.variants.find(x=>x.useInDesignTime)||t.variants[0];if(X())return r&&o(r.content);const l=Z(t),a=t.choiceValueId??"",s=a.length>0,c=U.useAttributes([l],!1)[0];if(!c)return d.jsx("span",{children:"Attribute not found"});const C=c.type===h.AttributeType.Choice;if(!C&&s)return d.jsx("span",{children:"Attribute is not a Choice Attribute"});const m=C&&s?c.values.get(a):null;if(s&&m==null)return d.jsx("span",{children:"Choice Value not found"});const b=x=>()=>m?x(m):[...c.values.values()].some(x),u=[...t.variants].find(({selection:x,condition:w})=>M.match({selection:x,condition:w,attribute:c}).with({attribute:{type:h.AttributeType.Choice},selection:"included",condition:"blocked"},b(g=>!g.possibleDecisionStates.includes(h.ChoiceValueDecisionState.Included))).with({attribute:{type:h.AttributeType.Choice},selection:"included",condition:"implicit"},b(g=>{var y,v;return((y=g.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Included&&((v=g.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit})).with({attribute:{type:h.AttributeType.Choice},selection:"included",condition:"explicit"},b(g=>{var y,v;return((y=g.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Included&&((v=g.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit})).with({attribute:{type:h.AttributeType.Choice},selection:"included",condition:"none"},b(g=>{var y;return((y=g.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Included})).with({attribute:{type:h.AttributeType.Choice},selection:"excluded",condition:"blocked"},b(g=>!g.possibleDecisionStates.includes(h.ChoiceValueDecisionState.Excluded))).with({attribute:{type:h.AttributeType.Choice},selection:"excluded",condition:"implicit"},b(g=>{var y,v;return((y=g.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Excluded&&((v=g.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit})).with({attribute:{type:h.AttributeType.Choice},selection:"excluded",condition:"explicit"},b(g=>{var y,v;return((y=g.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Excluded&&((v=g.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit})).with({attribute:{type:h.AttributeType.Choice},selection:"excluded",condition:"none"},b(g=>{var y;return((y=g.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Excluded})).with({attribute:{type:h.AttributeType.Boolean},selection:"true",condition:"blocked"},({attribute:g})=>!g.possibleDecisionStates.includes(!0)).with({attribute:{type:h.AttributeType.Boolean},selection:"true",condition:"implicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===!0&&((v=g.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit}).with({attribute:{type:h.AttributeType.Boolean},selection:"true",condition:"explicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===!0&&((v=g.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Boolean},selection:"true",condition:"none"},({attribute:g})=>{var y;return((y=g.decision)==null?void 0:y.state)===!0}).with({attribute:{type:h.AttributeType.Boolean},selection:"false",condition:"blocked"},({attribute:g})=>!g.possibleDecisionStates.includes(!1)).with({attribute:{type:h.AttributeType.Boolean},selection:"false",condition:"implicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===!1&&((v=g.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit}).with({attribute:{type:h.AttributeType.Boolean},selection:"false",condition:"explicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===!1&&((v=g.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Boolean},selection:"false",condition:"none"},({attribute:g})=>{var y;return((y=g.decision)==null?void 0:y.state)===!1}).with({attribute:{type:h.AttributeType.Component},selection:"included",condition:"blocked"},({attribute:g})=>!g.possibleDecisionStates.includes(h.ComponentDecisionState.Included)).with({attribute:{type:h.AttributeType.Component},selection:"included",condition:"implicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===h.ComponentDecisionState.Included&&((v=g.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit}).with({attribute:{type:h.AttributeType.Component},selection:"included",condition:"explicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===h.ComponentDecisionState.Included&&((v=g.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Component},selection:"included",condition:"none"},({attribute:g})=>{var y;return((y=g.decision)==null?void 0:y.state)===h.ComponentDecisionState.Included}).with({attribute:{type:h.AttributeType.Component},selection:"excluded",condition:"blocked"},({attribute:g})=>!g.possibleDecisionStates.includes(h.ComponentDecisionState.Excluded)).with({attribute:{type:h.AttributeType.Component},selection:"excluded",condition:"implicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===h.ComponentDecisionState.Excluded&&((v=g.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit}).with({attribute:{type:h.AttributeType.Component},selection:"excluded",condition:"explicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===h.ComponentDecisionState.Excluded&&((v=g.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Component},selection:"excluded",condition:"none"},({attribute:g})=>{var y;return((y=g.decision)==null?void 0:y.state)===h.ComponentDecisionState.Excluded}).with({attribute:{type:h.AttributeType.Numeric},selection:"numeric",condition:"implicit"},({attribute:g})=>{var y;return((y=g.decision)==null?void 0:y.kind)===h.DecisionKind.Implicit}).with({attribute:{type:h.AttributeType.Numeric},selection:"numeric",condition:"explicit"},({attribute:g})=>{var y;return((y=g.decision)==null?void 0:y.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Numeric},selection:"numeric",condition:"none"},({attribute:g})=>g.decision!=null).with({attribute:{type:h.AttributeType.Choice},selection:"undefined"},()=>m.decision==null).with({attribute:{type:h.AttributeType.Boolean},selection:"undefined"},{attribute:{type:h.AttributeType.Component},selection:"undefined"},{attribute:{type:h.AttributeType.Numeric},selection:"undefined"},({attribute:g})=>g.decision==null).otherwise(()=>!1));return u&&he(o(u.content),{ref:n})})),bc=wi,xc={...oe,...Me,variants:{title:"Variants",type:f.ControlType.Array,maxCount:10,control:{type:f.ControlType.Object,controls:{selection:{title:"Selection",type:f.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:f.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:f.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:f.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:f.ControlType.ComponentInstance},content2:{title:"Content 2",type:f.ControlType.ComponentInstance},content3:{title:"Content 3",type:f.ControlType.ComponentInstance},content4:{title:"Content 4",type:f.ControlType.ComponentInstance},content5:{title:"Content 5",type:f.ControlType.ComponentInstance},content6:{title:"Content 6",type:f.ControlType.ComponentInstance},content7:{title:"Content 7",type:f.ControlType.ComponentInstance},content8:{title:"Content 8",type:f.ControlType.ComponentInstance},content9:{title:"Content 9",type:f.ControlType.ComponentInstance},content10:{title:"Content 10",type:f.ControlType.ComponentInstance}};f.addPropertyControls(wi,xc);const Si=se(e=>{const t=T.useRef(),[n,o]=T.useState(null),r=T.useRef(n),i=T.useMemo(()=>e.color.startsWith("var"),[e.color]),l=i?n:e.color,a=T.useMemo(()=>{if(!l)return;const s=Ui(l);return Hi.hexToCSSFilter(`#${s}`,{acceptanceLossPercentage:1,maxChecks:30}).filter.replace(";","")},[l]);return T.useLayoutEffect(()=>{if(i){const s=t.current&&getComputedStyle(t.current).color;s!=r.current&&(r.current=s,o(s))}}),d.jsx("div",{ref:t,style:{...e.style,color:e.color,filter:a},children:e.children})}),Cc=Si,vc={children:{title:"Content",type:f.ControlType.ComponentInstance},color:{title:"Color",type:f.ControlType.Color,defaultValue:"#0000ff"}};f.addPropertyControls(Si,vc);const Ti=se(e=>{if(X())return e.children;const{error:n}=U.useConfigurationInitialization();return n?he(e.children,{onClick:n.retry}):null}),wc=Ti,Sc={children:{title:"Content",type:f.ControlType.ComponentInstance}};f.addPropertyControls(Ti,Sc);function Tc(e){return T.forwardRef((t,n)=>{const o={...t.style,width:"100%",height:"100%"};return d.jsx(e,{...t,ref:n,style:o})})}const Ac=O.div`
|
|
342
|
+
`,Ii=ge((e,t)=>{var v,P;if(G()){const S=Zt(e,!0,!1);return f.jsx(so,{style:S})}const o=ce(),i=Z(e),r=U.useNumericAttribute(i),{explain:l}=he();if(!r)return f.jsx("span",{children:"Numeric Attribute not found"});const{attribute:s,makeDecision:a}=r,c=((v=s.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit,x=Zt(e,s.isSatisfied,c),g=(P=s.decision)==null?void 0:P.state,[C,u]=T.useState(g),{min:b,max:w}=s.range,m=Ai(g,async S=>{if(S<b){alert(`The value must be smaller than or equal to ${b}.`);return}if(S>w){alert(`The value must be greater than or equal to ${w}.`);return}try{await a(S)}catch(I){I.type===h.ConfiguratorErrorType.SetDecisionConflict?e.explain!=="disabled"&&await l(O=>O.whyIsStateNotPossible.numeric(s.id).state(S),e.explain,o):pe()}},C,S=>u(S),e.wait);return f.jsx(so,{getInputRef:t,thousandsGroupStyle:"thousand",decimalSeparator:e.decimalSeparator,thousandSeparator:e.thousandSeparator,allowNegative:!0,fixedDecimalScale:!0,decimalScale:s.decimalPlaces,allowEmptyFormatting:!1,displayType:"input",placeholder:e.placeholder,prefix:ac(s,e.implicitLabelPrefix),onBlur:()=>{m.flush()},onKeyPress:S=>{S.key==="Enter"&&m.flush()},onValueChange:S=>u(S.floatValue),value:C??"",style:x})}),sc=Ii,ac=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===h.DecisionKind.Implicit?t:""},cc={...Ci,wait:{title:"Debounce Delay",type:d.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:d.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:d.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:d.ControlType.String,defaultValue:""}};d.addPropertyControls(Ii,cc);const ze={choiceValueId:{title:"Choice Value Id",type:d.ControlType.String}};function me(e,t){return T.Children.map(e,n=>{if(T.isValidElement(n)){const o=go(n.props,t);return T.cloneElement(n,o)}return n})}const Ri=ge((e,t)=>{if(G())return e.children;const o=ce(),{makeDecision:i}=U.useMakeDecision(),r=Z(e),l=e.choiceValueId??"",s=l.length>0,a=U.useAttributes([r],!1)[0],{explain:c}=he();if(!a)return f.jsx("span",{children:"Attribute not found"});const x=a.type===h.AttributeType.Choice,g=a.type===h.AttributeType.Numeric,C=a.type===h.AttributeType.Boolean,u=a.type===h.AttributeType.Component;if(!x&&s)return f.jsx("span",{children:"Attribute is not a Choice Attribute"});if(g)return f.jsx("span",{children:"Numeric Attribute is not supported"});let b=x?a.values.get(l):null;if(s&&b==null)return f.jsx("span",{children:"Choice Value not found"});const w=P=>N.match({state:P,attribute:a}).with({attribute:{type:h.AttributeType.Choice},state:"undefined"},()=>b.decision==null).with({attribute:{type:h.AttributeType.Choice},state:"included"},()=>{var S,I;return((S=b.decision)==null?void 0:S.state)===h.ChoiceValueDecisionState.Included&&((I=b.decision)==null?void 0:I.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Choice},state:"excluded"},()=>{var S,I;return((S=b.decision)==null?void 0:S.state)===h.ChoiceValueDecisionState.Excluded&&((I=b.decision)==null?void 0:I.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Boolean},state:"undefined"},{attribute:{type:h.AttributeType.Component},state:"undefined"},({attribute:S})=>S.decision==null).with({attribute:{type:h.AttributeType.Boolean},state:"true"},({attribute:S})=>{var I,R;return((I=S.decision)==null?void 0:I.state)===!0&&((R=S.decision)==null?void 0:R.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Boolean},state:"false"},({attribute:S})=>{var I,R;return((I=S.decision)==null?void 0:I.state)===!1&&((R=S.decision)==null?void 0:R.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Component},state:"included"},({attribute:S})=>{var I,R;return((I=S.decision)==null?void 0:I.state)===h.ComponentDecisionState.Included&&((R=S.decision)==null?void 0:R.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Component},state:"excluded"},({attribute:S})=>{var I,R;return((I=S.decision)==null?void 0:I.state)===h.ComponentDecisionState.Excluded&&((R=S.decision)==null?void 0:R.kind)===h.DecisionKind.Explicit}).otherwise(()=>!1),y=P=>N.match({isChoiceAttribute:x,isBooleanAttribute:C,isComponentAttribute:u,state:P}).with({isChoiceAttribute:!0,state:"included"},()=>h.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>h.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>h.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>h.ComponentDecisionState.Excluded).otherwise(()=>null);w(e.toggleFrom);const m=w(e.toggleTo),v=async()=>{const P=m?e.toggleFrom:e.toggleTo,S=y(P),I=u?a.possibleDecisionStates.includes(S):!1,R=C?a.possibleDecisionStates.includes(S):!1,O=(x?b.possibleDecisionStates.includes(S):!1)||R||I,j=e.explain,A=j!=="disabled"&&(async()=>{const F=N.match({isComponentAttribute:u,isBooleanAttribute:C,isChoiceAttribute:x}).returnType().with({isChoiceAttribute:!0},()=>h.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>h.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>h.ExplainQuestionSubject.component).otherwise(()=>null);F&&await c({question:h.ExplainQuestionType.whyIsStateNotPossible,subject:F,attributeId:r,choiceValueId:l,state:S},j,o)});if(O||S==null)try{await i({type:a.type,attributeId:r,choiceValueId:l,state:S})}catch(F){if(F.type===h.ConfiguratorErrorType.ConflictWithConsequence&&A){await A();return}pe()}else A&&await A()};return me(e.children,{onClick:v,ref:t})}),uc=Ri,dc={...oe,...ze,children:{title:"Content",type:d.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:d.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:d.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...$e};d.addPropertyControls(Ri,dc);const Pi=ge((e,t)=>{if(G())return e.children;const o=ce(),{makeDecision:i}=U.useMakeDecision(),r=Z(e),l=e.choiceValueId??"",s=l.length>0,a=U.useAttributes([r],!1)[0],c=U.useChoiceAttribute(r),{explain:x}=he();if(!a)return f.jsx("span",{children:"Attribute not found"});const g=a.type===h.AttributeType.Choice,C=a.type===h.AttributeType.Numeric,u=a.type===h.AttributeType.Boolean,b=a.type===h.AttributeType.Component;if(!g&&s)return f.jsx("span",{children:"Attribute is not a Choice Attribute"});let w=g?a.values.get(l):null;if(s&&w==null)return f.jsx("span",{children:"Choice Value not found"});const y=()=>N.match({isChoiceAttribute:g,isBooleanAttribute:u,isComponentAttribute:b,isNumericAttribute:C,hasChoiceValueId:s,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>h.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>h.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>h.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>h.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),m=async()=>{if(g&&!s&&e.setSelection==="undefined")try{await c.clearDecisions()}catch{pe()}else{const v=y(),P=b?a.possibleDecisionStates.includes(v):!1,S=u?a.possibleDecisionStates.includes(v):!1,R=(g?w.possibleDecisionStates.includes(v):!1)||S||P,D=e.explain,O=D!=="disabled"&&(async()=>{const j=N.match({isComponentAttribute:b,isBooleanAttribute:u,isChoiceAttribute:g,isNumericAttribute:C}).returnType().with({isChoiceAttribute:!0},()=>h.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>h.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>h.ExplainQuestionSubject.component).with({isNumericAttribute:!0},()=>h.ExplainQuestionSubject.numeric).otherwise(()=>null);j&&await x({question:h.ExplainQuestionType.whyIsStateNotPossible,subject:j,attributeId:r,choiceValueId:l,state:v},D,o)});if(C||R||v==null)try{await i({type:a.type,attributeId:r,choiceValueId:l,state:v})}catch(j){const A=j;if((A.type===h.ConfiguratorErrorType.ConflictWithConsequence||A.type===h.ConfiguratorErrorType.SetDecisionConflict)&&O){await O();return}pe()}else O&&await O()}};return me(e.children,{onClick:m,ref:t})}),fc=Pi,pc={...oe,...ze,children:{title:"Content",type:d.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:d.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:d.ControlType.Number,defaultValue:0},...$e};d.addPropertyControls(Pi,pc);const Oi=ge((e,t)=>{var g;if(G())return e.children;const o=ce(),{makeManyDecisions:i}=U.useMakeDecision(),{handleExplainAnswer:r}=he(),l=e.attributes.map(Z),s=U.useAttributes(l,!1).map((C,u)=>{if(!C)return{error:f.jsx("span",{children:"Attribute not found"})};const b=e.attributes[u],w=b.choiceValueId??"",y=w.length>0,m=C.type===h.AttributeType.Choice,v=C.type===h.AttributeType.Numeric,P=C.type===h.AttributeType.Boolean,S=C.type===h.AttributeType.Component;if(!m&&y)return{error:f.jsx("span",{children:"Attribute is not a Choice Attribute"})};let I=m?C.values.get(w):null;if(y&&I==null)return{error:f.jsx("span",{children:"Choice Value not found"})};const R=()=>N.match({isChoiceAttribute:m,isBooleanAttribute:P,isComponentAttribute:S,isNumericAttribute:v,hasChoiceValueId:y,state:b.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>h.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>h.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>h.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>h.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>b.numericValue).otherwise(()=>null);return{getDecisions:()=>m&&!y&&b.setSelection==="undefined"?[...C.values.values()].filter(D=>{var O;return((O=D.decision)==null?void 0:O.kind)===h.DecisionKind.Explicit}).map(D=>({type:C.type,attributeId:C.id,choiceValueId:D.id,state:null})):[{type:C.type,attributeId:C.id,choiceValueId:w,state:R()}]}}),a=(g=s.find(C=>C.error))==null?void 0:g.error;if(a)return a;const c=async()=>{const C=s.reduce((b,w)=>[...b,...w.getDecisions()],new Array),u=N.match(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:N.match(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();try{await i(C,u)}catch(b){const w=b;if(console.debug("SetMany failed",w),(w==null?void 0:w.type)===h.ConfiguratorErrorType.MakeManyDecisionsConflict&&w.decisionExplanations){e.explain!=="disabled"&&await r(w,e.explain,o);return}pe();return}},x=()=>{e.trigger==="click"&&c()};return T.useEffect(()=>{e.trigger==="auto"&&c()},[]),me(e.children,{onClick:x,ref:t})}),hc=Oi,gc={children:{title:"Content",type:d.ControlType.ComponentInstance},attributes:{title:"Attributes",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:{...oe,...ze,setSelection:{title:"Set Selection To",type:d.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:d.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:d.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:d.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:d.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...$e};d.addPropertyControls(Oi,gc);const Di=ae(e=>{if(G())return e.enabledChildren;const{canResetConfiguration:n,resetConfiguration:o}=U.useConfigurationReset(),i=async()=>{if(n)try{await o()}catch{Za()}},r=n?e.enabledChildren:e.disabledChildren;return me(r,{onClick:i})}),mc=Di,yc={enabledChildren:{title:"Content – Enabled",type:d.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:d.ControlType.ComponentInstance}};d.addPropertyControls(Di,yc);const Vi=ge((e,t)=>{if(G())return e.unsatisfiedChildren;const o=ce(),{isSatisfied:i}=U.useConfigurationSatisfaction(),{explain:r}=he(),s=[...e.attributeId.length>0?[Z(e)]:[],...e.attributes.map(Z)],a=()=>{var u;const g=U.useAttributes(s,!1).map(b=>b?{isSatisfied:b.isSatisfied}:{error:f.jsx("span",{children:"Attribute not found"})}),C=(u=g.find(b=>b.error))==null?void 0:u.error;return C||g.every(b=>b.isSatisfied)},c=async()=>{e.explain!=="disabled"&&(s.length===0?await r(g=>g.whyIsNotSatisfied.configuration,e.explain,o):s.length===1&&await r(g=>g.whyIsNotSatisfied.attribute(s[0]),e.explain,o))};return(s.length>0?a():i)?e.satisfiedChildren:me(e.unsatisfiedChildren,{onClick:c,ref:t})}),bc=Vi,xc={satisfiedChildren:{title:"Content – Satisfied",type:d.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:d.ControlType.ComponentInstance},...oe,attributes:{title:"Attributes",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:{...oe}}},...$e};d.addPropertyControls(Vi,xc);const ji=ae(T.forwardRef(function(t,n){const o=b=>N.match(b).with(1,()=>t.content1).with(2,()=>t.content2).with(3,()=>t.content3).with(4,()=>t.content4).with(5,()=>t.content5).with(6,()=>t.content6).with(7,()=>t.content7).with(8,()=>t.content8).with(9,()=>t.content9).with(10,()=>t.content10).otherwise(()=>null),i=t.variants.find(b=>b.useInDesignTime)||t.variants[0];if(G())return i&&o(i.content);const l=Z(t),s=t.choiceValueId??"",a=s.length>0,c=U.useAttributes([l],!1)[0];if(!c)return f.jsx("span",{children:"Attribute not found"});const x=c.type===h.AttributeType.Choice;if(!x&&a)return f.jsx("span",{children:"Attribute is not a Choice Attribute"});const g=x&&a?c.values.get(s):null;if(a&&g==null)return f.jsx("span",{children:"Choice Value not found"});const C=b=>()=>g?b(g):[...c.values.values()].some(b),u=[...t.variants].find(({selection:b,condition:w})=>N.match({selection:b,condition:w,attribute:c}).with({attribute:{type:h.AttributeType.Choice},selection:"included",condition:"blocked"},C(y=>!y.possibleDecisionStates.includes(h.ChoiceValueDecisionState.Included))).with({attribute:{type:h.AttributeType.Choice},selection:"included",condition:"implicit"},C(y=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ChoiceValueDecisionState.Included&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit})).with({attribute:{type:h.AttributeType.Choice},selection:"included",condition:"explicit"},C(y=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ChoiceValueDecisionState.Included&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit})).with({attribute:{type:h.AttributeType.Choice},selection:"included",condition:"none"},C(y=>{var m;return((m=y.decision)==null?void 0:m.state)===h.ChoiceValueDecisionState.Included})).with({attribute:{type:h.AttributeType.Choice},selection:"excluded",condition:"blocked"},C(y=>!y.possibleDecisionStates.includes(h.ChoiceValueDecisionState.Excluded))).with({attribute:{type:h.AttributeType.Choice},selection:"excluded",condition:"implicit"},C(y=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ChoiceValueDecisionState.Excluded&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit})).with({attribute:{type:h.AttributeType.Choice},selection:"excluded",condition:"explicit"},C(y=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ChoiceValueDecisionState.Excluded&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit})).with({attribute:{type:h.AttributeType.Choice},selection:"excluded",condition:"none"},C(y=>{var m;return((m=y.decision)==null?void 0:m.state)===h.ChoiceValueDecisionState.Excluded})).with({attribute:{type:h.AttributeType.Boolean},selection:"true",condition:"blocked"},({attribute:y})=>!y.possibleDecisionStates.includes(!0)).with({attribute:{type:h.AttributeType.Boolean},selection:"true",condition:"implicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===!0&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit}).with({attribute:{type:h.AttributeType.Boolean},selection:"true",condition:"explicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===!0&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Boolean},selection:"true",condition:"none"},({attribute:y})=>{var m;return((m=y.decision)==null?void 0:m.state)===!0}).with({attribute:{type:h.AttributeType.Boolean},selection:"false",condition:"blocked"},({attribute:y})=>!y.possibleDecisionStates.includes(!1)).with({attribute:{type:h.AttributeType.Boolean},selection:"false",condition:"implicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===!1&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit}).with({attribute:{type:h.AttributeType.Boolean},selection:"false",condition:"explicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===!1&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Boolean},selection:"false",condition:"none"},({attribute:y})=>{var m;return((m=y.decision)==null?void 0:m.state)===!1}).with({attribute:{type:h.AttributeType.Component},selection:"included",condition:"blocked"},({attribute:y})=>!y.possibleDecisionStates.includes(h.ComponentDecisionState.Included)).with({attribute:{type:h.AttributeType.Component},selection:"included",condition:"implicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ComponentDecisionState.Included&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit}).with({attribute:{type:h.AttributeType.Component},selection:"included",condition:"explicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ComponentDecisionState.Included&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Component},selection:"included",condition:"none"},({attribute:y})=>{var m;return((m=y.decision)==null?void 0:m.state)===h.ComponentDecisionState.Included}).with({attribute:{type:h.AttributeType.Component},selection:"excluded",condition:"blocked"},({attribute:y})=>!y.possibleDecisionStates.includes(h.ComponentDecisionState.Excluded)).with({attribute:{type:h.AttributeType.Component},selection:"excluded",condition:"implicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ComponentDecisionState.Excluded&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit}).with({attribute:{type:h.AttributeType.Component},selection:"excluded",condition:"explicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ComponentDecisionState.Excluded&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Component},selection:"excluded",condition:"none"},({attribute:y})=>{var m;return((m=y.decision)==null?void 0:m.state)===h.ComponentDecisionState.Excluded}).with({attribute:{type:h.AttributeType.Numeric},selection:"numeric",condition:"implicit"},({attribute:y})=>{var m;return((m=y.decision)==null?void 0:m.kind)===h.DecisionKind.Implicit}).with({attribute:{type:h.AttributeType.Numeric},selection:"numeric",condition:"explicit"},({attribute:y})=>{var m;return((m=y.decision)==null?void 0:m.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Numeric},selection:"numeric",condition:"none"},({attribute:y})=>y.decision!=null).with({attribute:{type:h.AttributeType.Choice},selection:"undefined"},()=>g.decision==null).with({attribute:{type:h.AttributeType.Boolean},selection:"undefined"},{attribute:{type:h.AttributeType.Component},selection:"undefined"},{attribute:{type:h.AttributeType.Numeric},selection:"undefined"},({attribute:y})=>y.decision==null).otherwise(()=>!1));return u&&me(o(u.content),{ref:n})})),Cc=ji,vc={...oe,...ze,variants:{title:"Variants",type:d.ControlType.Array,maxCount:10,control:{type:d.ControlType.Object,controls:{selection:{title:"Selection",type:d.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:d.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:d.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:d.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:d.ControlType.ComponentInstance},content2:{title:"Content 2",type:d.ControlType.ComponentInstance},content3:{title:"Content 3",type:d.ControlType.ComponentInstance},content4:{title:"Content 4",type:d.ControlType.ComponentInstance},content5:{title:"Content 5",type:d.ControlType.ComponentInstance},content6:{title:"Content 6",type:d.ControlType.ComponentInstance},content7:{title:"Content 7",type:d.ControlType.ComponentInstance},content8:{title:"Content 8",type:d.ControlType.ComponentInstance},content9:{title:"Content 9",type:d.ControlType.ComponentInstance},content10:{title:"Content 10",type:d.ControlType.ComponentInstance}};d.addPropertyControls(ji,vc);const ki=ae(e=>{const t=T.useRef(),[n,o]=T.useState(null),i=T.useRef(n),r=T.useMemo(()=>e.color.startsWith("var"),[e.color]),l=r?n:e.color,s=T.useMemo(()=>{if(!l)return;const a=rr(l);return ir.hexToCSSFilter(`#${a}`,{acceptanceLossPercentage:1,maxChecks:30}).filter.replace(";","")},[l]);return T.useLayoutEffect(()=>{if(r){const a=t.current&&getComputedStyle(t.current).color;a!=i.current&&(i.current=a,o(a))}}),f.jsx("div",{ref:t,style:{...e.style,color:e.color,filter:s},children:e.children})}),wc=ki,Sc={children:{title:"Content",type:d.ControlType.ComponentInstance},color:{title:"Color",type:d.ControlType.Color,defaultValue:"#0000ff"}};d.addPropertyControls(ki,Sc);const Mi=ae(e=>{if(G())return e.children;const{error:n}=U.useConfigurationInitialization();return n?me(e.children,{onClick:n.retry}):null}),Tc=Mi,Ec={children:{title:"Content",type:d.ControlType.ComponentInstance}};d.addPropertyControls(Mi,Ec);function Ac(e){return T.forwardRef((t,n)=>{const o={...t.style,width:"100%",height:"100%"};return f.jsx(e,{...t,ref:n,style:o})})}const Ic=k.div`
|
|
455
343
|
width: 10px;
|
|
456
344
|
height: 10px;
|
|
457
345
|
background-color: greenyellow;
|
|
458
|
-
`;function
|
|
346
|
+
`;function Fi(e){const t=T.useRef(null);return T.useEffect(()=>{if(!t.current)return;const n=setTimeout(()=>{t.current.scrollIntoView()},e.delay);return()=>clearTimeout(n)},[t.current]),f.jsx(Ic,{ref:t})}const Rc={delay:{title:"Delay",type:d.ControlType.Number,min:0,unit:"ms",defaultValue:0,step:1}};d.addPropertyControls(Fi,Rc);const Li=k.div`
|
|
459
347
|
display: contents;
|
|
460
|
-
`,
|
|
348
|
+
`,Pc=k.createGlobalStyle`
|
|
461
349
|
:root {
|
|
462
|
-
*:has(> ${
|
|
350
|
+
*:has(> ${Li}) {
|
|
463
351
|
display: contents !important;
|
|
464
352
|
}
|
|
465
353
|
}
|
|
466
|
-
`,Ri=se(rn(e=>{const t=ce(),n=X(),r=(()=>{const u=x=>{var y;const w=T.Children.toArray(x)[0],g=(y=w.props)==null?void 0:y.children;return g?u(g):w};return u(e.itemTemplate)})();if(!r)return d.jsx("span",{children:"Choice Value Template not defined"});const i=(u,x)=>u.map(w=>T.cloneElement(r,{key:w,layoutId:`${t}_${w}`,attributeId:e.attributeId,componentPath:e.componentPath,sharedConfigurationModel:e.sharedConfigurationModel,choiceValueId:w,choiceValueName:x.get(w)??w}));if(n)return d.jsx(Xn,{...e,children:i(["Choice Value 1","Choice Value 2","Choice Value 3"],p.RM.empty)});const l=Z(e),a=U.useChoiceAttribute(l);if(!a)return d.jsx("span",{children:"Choice Attribute not found"});const s=_e(l),c=e.filter??new Array,C=[...a.attribute.values.values()].filter(u=>c.length===0||c.some(({selection:x,condition:w})=>M.match({selection:x,condition:w}).with({selection:"included",condition:"blocked"},()=>!u.possibleDecisionStates.includes(h.ChoiceValueDecisionState.Included)).with({selection:"included",condition:"implicit"},()=>{var g,y;return((g=u.decision)==null?void 0:g.state)===h.ChoiceValueDecisionState.Included&&((y=u.decision)==null?void 0:y.kind)===h.DecisionKind.Implicit}).with({selection:"included",condition:"explicit"},()=>{var g,y;return((g=u.decision)==null?void 0:g.state)===h.ChoiceValueDecisionState.Included&&((y=u.decision)==null?void 0:y.kind)===h.DecisionKind.Explicit}).with({selection:"included",condition:"none"},()=>{var g;return((g=u.decision)==null?void 0:g.state)===h.ChoiceValueDecisionState.Included}).with({selection:"excluded",condition:"blocked"},()=>!u.possibleDecisionStates.includes(h.ChoiceValueDecisionState.Excluded)).with({selection:"excluded",condition:"implicit"},()=>{var g,y;return((g=u.decision)==null?void 0:g.state)===h.ChoiceValueDecisionState.Excluded&&((y=u.decision)==null?void 0:y.kind)===h.DecisionKind.Implicit}).with({selection:"excluded",condition:"explicit"},()=>{var g,y;return((g=u.decision)==null?void 0:g.state)===h.ChoiceValueDecisionState.Excluded&&((y=u.decision)==null?void 0:y.kind)===h.DecisionKind.Explicit}).with({selection:"excluded",condition:"none"},()=>{var g;return((g=u.decision)==null?void 0:g.state)===h.ChoiceValueDecisionState.Excluded}).with({selection:"undefined"},()=>u.decision==null).otherwise(()=>!1))),b=ut(l,C).map(u=>u.id);return d.jsx(Xn,{...e,children:i(b,s)})}));function Xn(e){return d.jsxs(d.Fragment,{children:[d.jsx(ct,{singletonId:"ChoiceValueListRenderer",children:d.jsx(Rc,{})}),d.jsx(Ei,{style:e.style,children:e.children})]})}const Ic=Ri,Pc={...oe,itemTemplate:{title:"Choice Value Template",type:f.ControlType.ComponentInstance},filter:{title:"Filter",type:f.ControlType.Array,control:{type:f.ControlType.Object,controls:{selection:{title:"Selection",type:f.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded"]},condition:{title:"Condition",type:f.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]}}}}};f.addPropertyControls(Ri,Pc);const{isValidElement:Jn,cloneElement:Zn}=A;function Vc(e,t){return t?(Array.isArray(t)&&(t=t.map((n,o)=>Jn(n)&&typeof n.props=="object"?Zn(n,{...n.props,key:o}):n)),!e||Array.isArray(e)?t:Jn(e)?Zn(e,{...e.props,children:t}):e):e}const{isValidElement:Dc}=A;function Ii(e,t,n){function o(i,l){return t.visit(i,n,l)}function r(i,l){return Ii(i,t,l||n)}if(Dc(e)){if(typeof e.type=="function")return"prototype"in e.type&&e.type.prototype.isReactComponent?e=new e.type(e.props).render():e=e.type(e.props),r(e);if(e.props&&"children"in e.props){const i=e.props.children;return o(e,a=>Array.isArray(i)?i.map(s=>r(s,a)):r(i,a))}}else if(Array.isArray(e)){const i=e;return o(e,a=>i.map(s=>r(s,a)))}return o(e)}const{isValidElement:eo}=A;function Oc(e,t){let n;const{replace:o,updateState:r}=t;return"matchElement"in t?n=i=>eo(i)&&i.type===t.matchElement:"matchLiteral"in t?n=i=>!Array.isArray(i)&&!eo(i)&&t.matchLiteral(i):n=t.match,Ii(e,{visit(i,l,a){const s=r?r(l):l,c=a?a(s):void 0,C=Vc(i,c);return n(C,s)?o(C,s):C}},t.initialState)}function to(e){return d.jsx(d.Fragment,{children:Oc(e.children,e)})}function jc(e){return p.pipe(e,p.Str.replace(/[\s\u2013]/g,"-"),Qi)}const kc=se(e=>{const{children:t,mode:n,replaceString:o,propName:r,elementName:i,text:l}=e;return n==="replace"?d.jsx(to,{match:a=>typeof a=="string",replace:a=>a===o?l:a,children:t}):n==="set-prop"?d.jsx(to,{match:a=>{var s;return((s=a.type)==null?void 0:s.displayName)===i},replace:a=>T.cloneElement(a,{[jc(r)]:l}),children:t}):t}),gt=kc,ln=e=>({children:{title:"Content",type:f.ControlType.ComponentInstance},mode:{title:"Mode",type:f.ControlType.Enum,defaultValue:"replace",options:["replace","set-prop"],displaySegmentedControl:!0},replaceString:{title:"Replace Text",type:f.ControlType.String,defaultValue:e,hidden:t=>t.mode!=="replace"},elementName:{title:"Element Name",type:f.ControlType.String,hidden:t=>t.mode!=="set-prop"},propName:{title:"Property Name",type:f.ControlType.String,hidden:t=>t.mode!=="set-prop"}}),Pi=se(e=>{const{attributeId:t,children:n,customName:o}=e,r=Z(e),i=(o==null?void 0:o.length)>0,l=X(),s=i?o:l?t:(()=>U.useAttributes([r],!1)[0]?pt(r)??t:"Attribute not found")();return d.jsx(gt,{...e,text:s})}),Fc=Pi,Nc={...oe,customName:{title:"Custom Name",type:f.ControlType.String},...ln("<AttributeName>")};f.addPropertyControls(Pi,Nc);const Vi=se(e=>{const{choiceValueId:t,children:n,customName:o,mode:r,replaceString:i,propName:l,elementName:a}=e,s=Z(e),c=o.length>0,C=t.length>0,m=X(),u=c?o:m?t.length>0?t:"Choice Value":(()=>{const x=U.useChoiceAttribute(s);return x?C?x.attribute.values.get(t)==null?"Choice Value not found":uo(s,t)??t:"Choice Value Id missing":"Choice Attribute not found"})();return d.jsx(gt,{...e,text:u})}),Lc=Vi,Mc={...oe,...Me,customName:{title:"Custom Name",type:f.ControlType.String},...ln("<ChoiceValueName>")};f.addPropertyControls(Vi,Mc);function Di(e){return e.children}const Bc={children:{title:"Content",type:f.ControlType.ComponentInstance}};f.addPropertyControls(Di,Bc);function Oi(e){const{children:t,fileExtension:n,fileName:o,target:r}=e;if(X())return t;const{storeConfiguration:l}=U.useConfigurationStoring();return he(t,{onClick:async()=>{const c={type:"spc-stored-configuration",storedConfiguration:await l()};r==="file"?zc(c,`${o}.${n}`):r==="clipboard"&&Kc(c)}})}const $c={children:{title:"Content",type:f.ControlType.ComponentInstance},target:{title:"Target",type:f.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileName:{title:"File Name",type:f.ControlType.String,defaultValue:"configuration",hidden:e=>e.target!=="file"},fileExtension:{title:"File Extension",type:f.ControlType.String,defaultValue:"json",hidden:e=>e.target!=="file"}};f.addPropertyControls(Oi,$c);function zc(e,t){const n=JSON.stringify(e),o=new Blob([n],{type:"application/json"}),r=window.URL.createObjectURL(o),i=document.createElement("a");i.href=r,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(r)}function Kc(e){const t=JSON.stringify(e);navigator.clipboard.writeText(t).catch(n=>{alert("Failed to copy the configuration to clipboard: "+n)})}var ji=(e=>(e[e.parseError=0]="parseError",e[e.noConfiguration=1]="noConfiguration",e[e.noFileSelected=2]="noFileSelected",e[e.fileReadError=3]="fileReadError",e[e.noClipboardData=4]="noClipboardData",e[e.clipboardReadError=5]="clipboardReadError",e))(ji||{});const ki=pe((e,t)=>{const{children:n,fileExtension:o,source:r}=e;if(X())return n;const l=ce(),{restoreConfiguration:a}=U.useConfigurationStoring(),{handleExplainAnswer:s}=fe();return he(n,{onClick:async()=>{const C=p.pipe(await Uc(r,o),p.O.toNullable);if(!C)return;const m={type:"DropExistingDecisions",conflictHandling:M.match(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()};try{await a(C,m)}catch(b){const u=b;if(console.debug("Failed to restore stored configuration",u),u.type===h.ConfiguratorErrorType.StoredConfigurationInvalid){alert("The specific configuration is not supported. Maybe the configuration was created with new application version than the current one.");return}if((u==null?void 0:u.type)===h.ConfiguratorErrorType.MakeManyDecisionsConflict&&u.decisionExplanations){e.explain!=="disabled"&&await s(u,e.explain,l);return}alert("Failed to restore your configuration.");return}},ref:t})}),Wc=ki,qc={children:{title:"Content",type:f.ControlType.ComponentInstance},source:{title:"Source",type:f.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileExtension:{title:"File Extension",type:f.ControlType.String,defaultValue:"json",hidden:e=>e.source!=="file"},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:f.ControlType.Boolean,defaultValue:!0},...Le};f.addPropertyControls(ki,qc);function _c(e){return()=>new Promise(t=>{const n=document.createElement("input");n.type="file",n.accept=`.${e}`,n.onchange=o=>{const r=o.target;if(!r.files||r.files.length===0){t(p.left(2));return}const i=r.files[0],l=new FileReader;l.onload=()=>{t(p.right(l.result))},l.onerror=()=>{t(p.left(3))},l.readAsText(i)},n.oncancel=()=>{t(p.left(2))},n.click()})}function Hc(){return()=>navigator.clipboard.readText().then(e=>e?p.right(e):p.left(4)).catch(()=>p.left(5))}function Uc(e,t){return p.pipe(e==="file"?_c(t):Hc(),p.TE.chainEitherK(n=>p.E.tryCatch(()=>JSON.parse(n),()=>0)),p.TE.filterOrElse(n=>n.type==="spc-stored-configuration",()=>1),p.TE.map(n=>n.storedConfiguration),p.TE.doIfLeft(n=>()=>{console.debug(`Failed to load stored configuration: ${ji[n]}`),n==3?alert("Failed to read the selected file. Maybe it is damaged."):n==1||n==0?e==="file"?alert("The selected file doesn't contain a valid configuration."):e==="clipboard"&&alert("The clipboard doesn't contain a valid configuration."):n==5?alert("Can't read the clipboard. Make to give a permission for reading the clipboard."):n==4&&alert("The clipboard doesn't contain a configuration.")}),p.TO.fromTaskEither)()}const Fi=se(e=>{const{fallback:t}=e,n=Z(e),i=X()?"0.0":(()=>{var s;const l=U.useNumericAttribute(n);if(!l)return"Numeric Attribute not found";const a=(s=l.attribute.decision)==null?void 0:s.state;return a!=null?a.toLocaleString():t})();return d.jsx(gt,{...e,text:i})}),Qc=Fi,Gc={...oe,fallback:{title:"Unselected Text",type:f.ControlType.String,defaultValue:""},...ln("<NumericValue>")};f.addPropertyControls(Fi,Gc);exports.AttributeName=Fc;exports.BooleanSelect=tc;exports.ChoiceSelect=Js;exports.ChoiceValueListRenderer=Ic;exports.ChoiceValueName=Lc;exports.Colorize=Cc;exports.ComponentSelect=oc;exports.Configuration=ys;exports.InitializationRetry=wc;exports.NumericInput=rc;exports.ReplaceText=gt;exports.ResetConfiguration=hc;exports.RestoreConfiguration=Wc;exports.SatisfactionIndicator=yc;exports.ScrollIntoView=Ai;exports.SelectedNumericValue=Qc;exports.SelectionIndicator=bc;exports.SelectionToggle=sc;exports.SetSelection=uc;exports.SetSelections=fc;exports.Singleton=ct;exports.Slot=Di;exports.StoreConfiguration=Oi;exports.attributeIdPropertyControls=oe;exports.choiceValueIdPropertyControls=Me;exports.cloneChildrenWithProps=he;exports.explainableComponent=pe;exports.parseGlobalAttributeId=Z;exports.useAttributeName=pt;exports.useChoiceValueName=uo;exports.useChoiceValueNames=_e;exports.useControlId=ce;exports.useDebounceValue=mi;exports.useExplain=fe;exports.useExplainProcess=ge;exports.useRenderPlaceholder=X;exports.useSortedChoiceValues=ut;exports.withControlId=rn;exports.withErrorBoundary=se;exports.withFullSize=Tc;
|
|
354
|
+
`,Ni=ae(yn(e=>{const t=ce(),n=G(),i=(()=>{const u=b=>{var m;const w=T.Children.toArray(b)[0],y=(m=w.props)==null?void 0:m.children;return y?u(y):w};return u(e.itemTemplate)})();if(!i)return f.jsx("span",{children:"Choice Value Template not defined"});const r=(u,b)=>u.map(w=>T.cloneElement(i,{key:w,layoutId:`${t}_${w}`,attributeId:e.attributeId,componentPath:e.componentPath,sharedConfigurationModel:e.sharedConfigurationModel,choiceValueId:w,choiceValueName:b.get(w)??w}));if(n)return f.jsx(ao,{...e,children:r(["Choice Value 1","Choice Value 2","Choice Value 3"],p.RM.empty)});const l=Z(e),s=U.useChoiceAttribute(l);if(!s)return f.jsx("span",{children:"Choice Attribute not found"});const a=Ge(l),c=e.filter??new Array,x=[...s.attribute.values.values()].filter(u=>c.length===0||c.some(({selection:b,condition:w})=>N.match({selection:b,condition:w}).with({selection:"included",condition:"blocked"},()=>!u.possibleDecisionStates.includes(h.ChoiceValueDecisionState.Included)).with({selection:"included",condition:"implicit"},()=>{var y,m;return((y=u.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Included&&((m=u.decision)==null?void 0:m.kind)===h.DecisionKind.Implicit}).with({selection:"included",condition:"explicit"},()=>{var y,m;return((y=u.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Included&&((m=u.decision)==null?void 0:m.kind)===h.DecisionKind.Explicit}).with({selection:"included",condition:"none"},()=>{var y;return((y=u.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Included}).with({selection:"excluded",condition:"blocked"},()=>!u.possibleDecisionStates.includes(h.ChoiceValueDecisionState.Excluded)).with({selection:"excluded",condition:"implicit"},()=>{var y,m;return((y=u.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Excluded&&((m=u.decision)==null?void 0:m.kind)===h.DecisionKind.Implicit}).with({selection:"excluded",condition:"explicit"},()=>{var y,m;return((y=u.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Excluded&&((m=u.decision)==null?void 0:m.kind)===h.DecisionKind.Explicit}).with({selection:"excluded",condition:"none"},()=>{var y;return((y=u.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Excluded}).with({selection:"undefined"},()=>u.decision==null).otherwise(()=>!1))),C=xt(l,x).map(u=>u.id);return f.jsx(ao,{...e,children:r(C,a)})}));function ao(e){return f.jsxs(f.Fragment,{children:[f.jsx(bt,{singletonId:"ChoiceValueListRenderer",children:f.jsx(Pc,{})}),f.jsx(Li,{style:e.style,children:e.children})]})}const Oc=Ni,Dc={...oe,itemTemplate:{title:"Choice Value Template",type:d.ControlType.ComponentInstance},filter:{title:"Filter",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:{selection:{title:"Selection",type:d.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded"]},condition:{title:"Condition",type:d.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]}}}}};d.addPropertyControls(Ni,Dc);const{isValidElement:co,cloneElement:uo}=E;function Vc(e,t){return t?(Array.isArray(t)&&(t=t.map((n,o)=>co(n)&&typeof n.props=="object"?uo(n,{...n.props,key:o}):n)),!e||Array.isArray(e)?t:co(e)?uo(e,{...e.props,children:t}):e):e}const{isValidElement:jc}=E;function Bi(e,t,n){function o(r,l){return t.visit(r,n,l)}function i(r,l){return Bi(r,t,l||n)}if(jc(e)){if(typeof e.type=="function")return"prototype"in e.type&&e.type.prototype.isReactComponent?e=new e.type(e.props).render():e=e.type(e.props),i(e);if(e.props&&"children"in e.props){const r=e.props.children;return o(e,s=>Array.isArray(r)?r.map(a=>i(a,s)):i(r,s))}}else if(Array.isArray(e)){const r=e;return o(e,s=>r.map(a=>i(a,s)))}return o(e)}const{isValidElement:fo}=E;function kc(e,t){let n;const{replace:o,updateState:i}=t;return"matchElement"in t?n=r=>fo(r)&&r.type===t.matchElement:"matchLiteral"in t?n=r=>!Array.isArray(r)&&!fo(r)&&t.matchLiteral(r):n=t.match,Bi(e,{visit(r,l,s){const a=i?i(l):l,c=s?s(a):void 0,x=Vc(r,c);return n(x,a)?o(x,a):x}},t.initialState)}function po(e){return f.jsx(f.Fragment,{children:kc(e.children,e)})}function Mc(e){return p.pipe(e,p.Str.replace(/[\s\u2013]/g,"-"),lr)}const Fc=ae(e=>{const{children:t,mode:n,replaceString:o,propName:i,elementName:r,text:l}=e;return n==="replace"?f.jsx(po,{match:s=>typeof s=="string",replace:s=>s===o?l:s,children:t}):n==="set-prop"?f.jsx(po,{match:s=>{var a;return((a=s.type)==null?void 0:a.displayName)===r},replace:s=>T.cloneElement(s,{[Mc(i)]:l}),children:t}):t}),Ot=Fc,bn=e=>({children:{title:"Content",type:d.ControlType.ComponentInstance},mode:{title:"Mode",type:d.ControlType.Enum,defaultValue:"replace",options:["replace","set-prop"],displaySegmentedControl:!0},replaceString:{title:"Replace Text",type:d.ControlType.String,defaultValue:e,hidden:t=>t.mode!=="replace"},elementName:{title:"Element Name",type:d.ControlType.String,hidden:t=>t.mode!=="set-prop"},propName:{title:"Property Name",type:d.ControlType.String,hidden:t=>t.mode!=="set-prop"}}),$i=ae(e=>{const{attributeId:t,children:n,customName:o}=e,i=Z(e),r=(o==null?void 0:o.length)>0,l=G(),a=r?o:l?t:(()=>U.useAttributes([i],!1)[0]?At(i)??t:"Attribute not found")();return f.jsx(Ot,{...e,text:a})}),Lc=$i,Nc={...oe,customName:{title:"Custom Name",type:d.ControlType.String},...bn("<AttributeName>")};d.addPropertyControls($i,Nc);const zi=ae(e=>{const{choiceValueId:t,children:n,customName:o,mode:i,replaceString:r,propName:l,elementName:s}=e,a=Z(e),c=o.length>0,x=t.length>0,g=G(),u=c?o:g?t.length>0?t:"Choice Value":(()=>{const b=U.useChoiceAttribute(a);return b?x?b.attribute.values.get(t)==null?"Choice Value not found":To(a,t)??t:"Choice Value Id missing":"Choice Attribute not found"})();return f.jsx(Ot,{...e,text:u})}),Bc=zi,$c={...oe,...ze,customName:{title:"Custom Name",type:d.ControlType.String},...bn("<ChoiceValueName>")};d.addPropertyControls(zi,$c);function Wi(e){return e.children}const zc={children:{title:"Content",type:d.ControlType.ComponentInstance}};d.addPropertyControls(Wi,zc);function Ki(e){const{children:t,fileExtension:n,fileName:o,target:i}=e;if(G())return t;const{storeConfiguration:l}=U.useConfigurationStoring();return me(t,{onClick:async()=>{const c={type:"spc-stored-configuration",storedConfiguration:await l()};i==="file"?Kc(c,`${o}.${n}`):i==="clipboard"&&qc(c)}})}const Wc={children:{title:"Content",type:d.ControlType.ComponentInstance},target:{title:"Target",type:d.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileName:{title:"File Name",type:d.ControlType.String,defaultValue:"configuration",hidden:e=>e.target!=="file"},fileExtension:{title:"File Extension",type:d.ControlType.String,defaultValue:"json",hidden:e=>e.target!=="file"}};d.addPropertyControls(Ki,Wc);function Kc(e,t){const n=JSON.stringify(e),o=new Blob([n],{type:"application/json"}),i=window.URL.createObjectURL(o),r=document.createElement("a");r.href=i,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(i)}function qc(e){const t=JSON.stringify(e);navigator.clipboard.writeText(t).catch(n=>{alert("Failed to copy the configuration to clipboard: "+n)})}var qi=(e=>(e[e.parseError=0]="parseError",e[e.noConfiguration=1]="noConfiguration",e[e.noFileSelected=2]="noFileSelected",e[e.fileReadError=3]="fileReadError",e[e.noClipboardData=4]="noClipboardData",e[e.clipboardReadError=5]="clipboardReadError",e))(qi||{});const Hi=ge((e,t)=>{const{children:n,fileExtension:o,source:i}=e;if(G())return n;const l=ce(),{restoreConfiguration:s}=U.useConfigurationStoring(),{handleExplainAnswer:a}=he();return me(n,{onClick:async()=>{const x=p.pipe(await Yc(i,o),p.O.toNullable);if(!x)return;const g={type:"DropExistingDecisions",conflictHandling:N.match(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()};try{await s(x,g)}catch(C){const u=C;if(console.debug("Failed to restore stored configuration",u),u.type===h.ConfiguratorErrorType.StoredConfigurationInvalid){alert("The specific configuration is not supported. Maybe the configuration was created with new application version than the current one.");return}if((u==null?void 0:u.type)===h.ConfiguratorErrorType.MakeManyDecisionsConflict&&u.decisionExplanations){e.explain!=="disabled"&&await a(u,e.explain,l);return}alert("Failed to restore your configuration.");return}},ref:t})}),Hc=Hi,_c={children:{title:"Content",type:d.ControlType.ComponentInstance},source:{title:"Source",type:d.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileExtension:{title:"File Extension",type:d.ControlType.String,defaultValue:"json",hidden:e=>e.source!=="file"},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:d.ControlType.Boolean,defaultValue:!0},...$e};d.addPropertyControls(Hi,_c);function Uc(e){return()=>new Promise(t=>{const n=document.createElement("input");n.type="file",n.accept=`.${e}`,n.onchange=o=>{const i=o.target;if(!i.files||i.files.length===0){t(p.left(2));return}const r=i.files[0],l=new FileReader;l.onload=()=>{t(p.right(l.result))},l.onerror=()=>{t(p.left(3))},l.readAsText(r)},n.oncancel=()=>{t(p.left(2))},n.click()})}function Qc(){return()=>navigator.clipboard.readText().then(e=>e?p.right(e):p.left(4)).catch(()=>p.left(5))}function Yc(e,t){return p.pipe(e==="file"?Uc(t):Qc(),p.TE.chainEitherK(n=>p.E.tryCatch(()=>JSON.parse(n),()=>0)),p.TE.filterOrElse(n=>n.type==="spc-stored-configuration",()=>1),p.TE.map(n=>n.storedConfiguration),p.TE.doIfLeft(n=>()=>{console.debug(`Failed to load stored configuration: ${qi[n]}`),n==3?alert("Failed to read the selected file. Maybe it is damaged."):n==1||n==0?e==="file"?alert("The selected file doesn't contain a valid configuration."):e==="clipboard"&&alert("The clipboard doesn't contain a valid configuration."):n==5?alert("Can't read the clipboard. Make to give a permission for reading the clipboard."):n==4&&alert("The clipboard doesn't contain a configuration.")}),p.TO.fromTaskEither)()}const _i=ae(e=>{const{fallback:t}=e,n=Z(e),r=G()?"0.0":(()=>{var a;const l=U.useNumericAttribute(n);if(!l)return"Numeric Attribute not found";const s=(a=l.attribute.decision)==null?void 0:a.state;return s!=null?s.toLocaleString():t})();return f.jsx(Ot,{...e,text:r})}),Gc=_i,Xc={...oe,fallback:{title:"Unselected Text",type:d.ControlType.String,defaultValue:""},...bn("<NumericValue>")};d.addPropertyControls(_i,Xc);function Ui(e){if(G())return f.jsx("div",{style:{width:"100%"},children:e.children});const n=T.useRef(0),[o,i]=T.useState(null),r=s=>{window.parent.postMessage({type:"spc.configurator.height",height:s},"*")};function l(s=o){if(!s)return;const a=s.offsetHeight;a!==n.current&&(n.current=a,r(a))}return T.useEffect(()=>{const s=o;if(!s)return;l(s);const a=new ResizeObserver(()=>{l(s)});return a.observe(s),()=>{a.disconnect()}},[o]),f.jsx("div",{ref:i,style:{width:"100%"},children:e.children})}d.addPropertyControls(Ui,{children:{title:"Content",type:d.ControlType.ComponentInstance}});exports.AttributeName=Lc;exports.BooleanSelect=oc;exports.ChoiceSelect=ec;exports.ChoiceValueListRenderer=Oc;exports.ChoiceValueName=Bc;exports.Colorize=wc;exports.ComponentSelect=rc;exports.Configuration=Aa;exports.InitializationRetry=Tc;exports.NumericInput=sc;exports.PropagateHeight=Ui;exports.ReplaceText=Ot;exports.ResetConfiguration=mc;exports.RestoreConfiguration=Hc;exports.SatisfactionIndicator=bc;exports.ScrollIntoView=Fi;exports.SelectedNumericValue=Gc;exports.SelectionIndicator=Cc;exports.SelectionToggle=uc;exports.SetSelection=fc;exports.SetSelections=hc;exports.Singleton=bt;exports.Slot=Wi;exports.StoreConfiguration=Ki;exports.attributeIdPropertyControls=oe;exports.choiceValueIdPropertyControls=ze;exports.cloneChildrenWithProps=me;exports.explainableComponent=ge;exports.parseGlobalAttributeId=Z;exports.useAttributeName=At;exports.useChoiceValueName=To;exports.useChoiceValueNames=Ge;exports.useControlId=ce;exports.useDebounceValue=Ai;exports.useExplain=he;exports.useExplainProcess=xe;exports.useRenderPlaceholder=G;exports.useSortedChoiceValues=xt;exports.withControlId=yn;exports.withErrorBoundary=ae;exports.withFullSize=Ac;
|