@viamedici-spc/configurator-framer 0.1.0-alpha0021 → 0.1.0-alpha0022

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 CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),x=require("framer"),f=require("@viamedici-spc/configurator-ts"),X=require("@viamedici-spc/configurator-react"),A=require("react"),N=require("ts-pattern"),Yo=require("react-error-boundary"),k=require("styled-components"),_=require("@viamedici-spc/fp-ts-extensions"),Ge=require("@fortawesome/free-solid-svg-icons"),Je=require("@fortawesome/react-fontawesome"),Go=require("@viamedici-spc/fp-ts-extensions/Ord"),jn=require("react-dom"),Jo=require("clsx"),Vn=require("merge-props"),Zo=require("dyna-guid"),ei=require("react-number-format"),ti=require("use-debounce"),ni=require("framer-motion"),oi=require("hex-to-css-filter"),ii=require("rgb-hex");function On(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 T=On(A),ri=On(jn);function li(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var o=0;o<e.length;o++){var i=e[o];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(o>0&&(i=i.replace(/^[\/]+/,"")),o<e.length-1?i=i.replace(/[\/]+$/,""):i=i.replace(/[\/]+$/,"/"),t.push(i))}var r=t.join("/");r=r.replace(/\/(\?|&|#[^!])/g,"$1");var l=r.split("?");return r=l.shift()+(l.length>0?"?":"")+l.join("&"),r}function si(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),li(e)}function Z(){return x.RenderTarget.current()!==x.RenderTarget.preview}function ai(e){if(Z())return null;const{error:n}=X.useConfigurationInitialization();if(!n)return null;switch(n.type){case f.FailureType.ConfigurationModelNotFound:return A.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:u.jsx("span",{children:"Configuration Model not found for the specified deployment name."});case f.FailureType.ConfigurationUnauthenticated:return A.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:u.jsx("span",{children:"The HCA access token is invalid."});case f.FailureType.SpecifiedDeploymentForbidden:return A.Children.toArray(e.accessTokenRestrictionContent).length>0?e.accessTokenRestrictionContent:u.jsx("span",{children:"The HCA access token does not permit using the specified Configuration Model."});case f.FailureType.DecisionsToRespectInvalid:return u.jsx("span",{children:"The definition of Attribute Relations is invalid."});default:return A.Children.toArray(e.errorContent).length>0?e.errorContent:u.jsx("span",{children:"An error occurred while initializing the configuration."})}}function Te(e){return A.forwardRef((t,n)=>u.jsx(Yo.ErrorBoundary,{fallbackRender:()=>u.jsx("span",{children:"Component crashed"}),children:u.jsx(e,{...t,ref:n})}))}const ci=k.createGlobalStyle`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),x=require("framer"),p=require("@viamedici-spc/configurator-ts"),X=require("@viamedici-spc/configurator-react"),A=require("react"),N=require("ts-pattern"),Yo=require("react-error-boundary"),k=require("styled-components"),_=require("@viamedici-spc/fp-ts-extensions"),Ge=require("@fortawesome/free-solid-svg-icons"),Je=require("@fortawesome/react-fontawesome"),Go=require("@viamedici-spc/fp-ts-extensions/Ord"),jn=require("react-dom"),Jo=require("clsx"),Vn=require("merge-props"),Zo=require("dyna-guid"),ei=require("react-number-format"),ti=require("use-debounce"),ni=require("framer-motion"),oi=require("hex-to-css-filter"),ii=require("rgb-hex");function On(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 T=On(A),ri=On(jn);function li(e){var t=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var o=0;o<e.length;o++){var i=e[o];if(typeof i!="string")throw new TypeError("Url must be a string. Received "+i);i!==""&&(o>0&&(i=i.replace(/^[\/]+/,"")),o<e.length-1?i=i.replace(/[\/]+$/,""):i=i.replace(/[\/]+$/,"/"),t.push(i))}var r=t.join("/");r=r.replace(/\/(\?|&|#[^!])/g,"$1");var l=r.split("?");return r=l.shift()+(l.length>0?"?":"")+l.join("&"),r}function si(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),li(e)}function Z(){return x.RenderTarget.current()!==x.RenderTarget.preview}function ai(e){if(Z())return null;const{error:n}=X.useConfigurationInitialization();if(!n)return null;switch(n.type){case p.FailureType.ConfigurationModelNotFound:return A.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:u.jsx("span",{children:"Configuration Model not found for the specified deployment name."});case p.FailureType.ConfigurationUnauthenticated:return A.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:u.jsx("span",{children:"The HCA access token is invalid."});case p.FailureType.SpecifiedDeploymentForbidden:return A.Children.toArray(e.accessTokenRestrictionContent).length>0?e.accessTokenRestrictionContent:u.jsx("span",{children:"The HCA access token does not permit using the specified Configuration Model."});case p.FailureType.DecisionsToRespectInvalid:return u.jsx("span",{children:"The definition of Attribute Relations is invalid."});default:return A.Children.toArray(e.errorContent).length>0?e.errorContent:u.jsx("span",{children:"An error occurred while initializing the configuration."})}}function Te(e){return A.forwardRef((t,n)=>u.jsx(Yo.ErrorBoundary,{fallbackRender:()=>u.jsx("span",{children:"Component crashed"}),children:u.jsx(e,{...t,ref:n})}))}const ci=k.createGlobalStyle`
2
2
  :root {
3
3
  --font-primary: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
4
4
  --font-heading: "Inter-Medium", "Inter", "Inter Placeholder", sans-serif;
@@ -89,7 +89,7 @@
89
89
  white-space: nowrap;
90
90
  overflow: hidden;
91
91
  text-overflow: ellipsis;
92
- `;function Ci(e){const{decision:t}=e,n=t.intention,o=vi(t);return u.jsxs(bi,{children:[u.jsxs(xi,{className:`mode-${n}`,children:[n==="remove"&&u.jsx(Je.FontAwesomeIcon,{icon:Ge.faMinus}),n==="add"&&u.jsx(Je.FontAwesomeIcon,{icon:Ge.faPlus})]}),u.jsx(yi,{children:o})]})}function vi(e){return N.match(e).returnType().with({type:f.AttributeType.Choice},t=>t.choiceValueId).with({type:f.AttributeType.Boolean},t=>t.state.toString()).with({type:f.AttributeType.Component},t=>t.state).with({type:f.AttributeType.Numeric},t=>t.state.toString()).exhaustive()}const wi=k.div`
92
+ `;function Ci(e){const{decision:t}=e,n=t.intention,o=vi(t);return u.jsxs(bi,{children:[u.jsxs(xi,{className:`mode-${n}`,children:[n==="remove"&&u.jsx(Je.FontAwesomeIcon,{icon:Ge.faMinus}),n==="add"&&u.jsx(Je.FontAwesomeIcon,{icon:Ge.faPlus})]}),u.jsx(yi,{children:o})]})}function vi(e){return N.match(e).returnType().with({type:p.AttributeType.Choice},t=>t.choiceValueId).with({type:p.AttributeType.Boolean},t=>t.state.toString()).with({type:p.AttributeType.Component},t=>t.state).with({type:p.AttributeType.Numeric},t=>t.state.toString()).exhaustive()}const wi=k.div`
93
93
  display: grid;
94
94
  grid-template-columns: subgrid;
95
95
  grid-column: span 2;
@@ -149,7 +149,7 @@
149
149
  font-size: 0.9em;
150
150
  font-family: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
151
151
  font-weight: 500;
152
- `;function Vi(e){const{explanation:t}=e,n=t.causedByCardinalities,o=_.pipe(t.causedByRules,_.RNEA.groupBy(i=>i.configurationModelId),_.RR.collect(_.Str.Ord)((i,r)=>({configurationModelId:i,rules:_.pipe(r,_.RA.map(l=>l.localId),_.RA.sort(_.Str.Ord))})));return u.jsx(ki,{children:u.jsxs(ji,{children:[o.map(i=>u.jsxs("li",{children:[u.jsx("span",{children:i.configurationModelId}),u.jsx(_t,{children:i.rules.map(r=>u.jsx(Ut,{children:r}))})]})),n.length>0&&u.jsxs("li",{children:[u.jsx("span",{children:"Cardinality"}),u.jsx(_t,{children:n.map(i=>u.jsx(Ut,{children:i.localId}))})]})]})})}function Nn(e){const{variant:t,...n}=e,{explainQuestion:o}=me(),i=N.match(o).returnType().with({question:f.ExplainQuestionType.whyIsStateNotPossible},()=>"why your selection is not possible").with({question:f.ExplainQuestionType.whyIsNotSatisfied,subject:f.ExplainQuestionSubject.configuration},()=>"why your configuration is not satisfied").with({question:f.ExplainQuestionType.whyIsNotSatisfied,subject:f.ExplainQuestionSubject.attribute},()=>"why your attribute is not satisfied").exhaustive(),r=N.match(t).returnType().with("failedToExplain",()=>u.jsxs(u.Fragment,{children:["Failed to explain ",i,".",u.jsx("br",{}),"Please check your internet connection and try again."]})).with("noExplanationFound",()=>u.jsxs(u.Fragment,{children:["There was no explanation found for ",i,"."]})).with("noSolutionFound",()=>u.jsxs(u.Fragment,{children:["There was no solution found for ",i,"."]})).exhaustive();return u.jsx("div",{...n,children:r})}const Qt=k.div`
152
+ `;function Vi(e){const{explanation:t}=e,n=t.causedByCardinalities,o=_.pipe(t.causedByRules,_.RNEA.groupBy(i=>i.configurationModelId),_.RR.collect(_.Str.Ord)((i,r)=>({configurationModelId:i,rules:_.pipe(r,_.RA.map(l=>l.localId),_.RA.sort(_.Str.Ord))})));return u.jsx(ki,{children:u.jsxs(ji,{children:[o.map(i=>u.jsxs("li",{children:[u.jsx("span",{children:i.configurationModelId}),u.jsx(_t,{children:i.rules.map(r=>u.jsx(Ut,{children:r}))})]})),n.length>0&&u.jsxs("li",{children:[u.jsx("span",{children:"Cardinality"}),u.jsx(_t,{children:n.map(i=>u.jsx(Ut,{children:i.localId}))})]})]})})}function Nn(e){const{variant:t,...n}=e,{explainQuestion:o}=me(),i=N.match(o).returnType().with({question:p.ExplainQuestionType.whyIsStateNotPossible},()=>"why your selection is not possible").with({question:p.ExplainQuestionType.whyIsNotSatisfied,subject:p.ExplainQuestionSubject.configuration},()=>"why your configuration is not satisfied").with({question:p.ExplainQuestionType.whyIsNotSatisfied,subject:p.ExplainQuestionSubject.attribute},()=>"why your attribute is not satisfied").exhaustive(),r=N.match(t).returnType().with("failedToExplain",()=>u.jsxs(u.Fragment,{children:["Failed to explain ",i,".",u.jsx("br",{}),"Please check your internet connection and try again."]})).with("noExplanationFound",()=>u.jsxs(u.Fragment,{children:["There was no explanation found for ",i,"."]})).with("noSolutionFound",()=>u.jsxs(u.Fragment,{children:["There was no solution found for ",i,"."]})).exhaustive();return u.jsx("div",{...n,children:r})}const Qt=k.div`
153
153
  font-weight: 500;
154
154
  font-family: var(--font-heading);
155
155
  margin-bottom: var(--space-xs);
@@ -166,10 +166,10 @@
166
166
  width: min-content;
167
167
  min-width: 400px;
168
168
  margin: var(--space-sm-fixed) var(--space-md-fixed) var(--space-sm-fixed) var(--space-sm-fixed);
169
- `;function Fi(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=me();return n?u.jsx(Yt,{variant:"failedToExplain"}):e.length===0&&t.length===0?u.jsx(Yt,{variant:"noExplanationFound"}):u.jsxs(Oi,{children:[e.length>0&&u.jsxs("div",{children:[u.jsx(Qt,{children:"Solutions"}),u.jsx(Xt,{children:e.map(o=>u.jsx(Di,{explanation:o},e.indexOf(o)))})]}),t.length>0&&u.jsxs("div",{children:[u.jsx(Qt,{children:"Constraint Explanations"}),u.jsx(Xt,{children:t.map(o=>u.jsx(Vi,{explanation:o},t.indexOf(o)))})]})]})}function ue(e){return Mn(e)?(e.nodeName||"").toLowerCase():"#document"}function ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function de(e){var t;return(t=(Mn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Mn(e){return e instanceof Node||e instanceof ne(e).Node}function Y(e){return e instanceof Element||e instanceof ne(e).Element}function ee(e){return e instanceof HTMLElement||e instanceof ne(e).HTMLElement}function Et(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ne(e).ShadowRoot}function We(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Bi(e){return["table","td","th"].includes(ue(e))}function Vt(e){const t=Ot(),n=oe(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 $n(e){let t=ve(e);for(;ee(t)&&!ke(t);){if(Vt(t))return t;t=ve(t)}return null}function Ot(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ke(e){return["html","body","#document"].includes(ue(e))}function oe(e){return ne(e).getComputedStyle(e)}function st(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ve(e){if(ue(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Et(e)&&e.host||de(e);return Et(t)?t.host:t}function Kn(e){const t=ve(e);return ke(t)?e.ownerDocument?e.ownerDocument.body:e.body:ee(t)&&We(t)?t:Kn(t)}function fe(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Kn(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=ne(i);return r?t.concat(l,l.visualViewport||[],We(i)?i:[],l.frameElement&&n?fe(l.frameElement):[]):t.concat(i,fe(i,[],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 te(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Et(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Wn(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function zn(){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 Li(e){return e.mozInputSource===0&&e.isTrusted?!0:At()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ni(e){return $i()?!1:!At()&&e.width===0&&e.height===0||At()&&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 Mi(){return/apple/i.test(navigator.vendor)}function At(){const e=/android/i;return e.test(Wn())||e.test(zn())}function $i(){return zn().includes("jsdom/")}function Gt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Ki(e){return"nativeEvent"in e}function Wi(e){return e.matches("html,body")}function ce(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 Re(e){return"composedPath"in e?e.composedPath()[0]:e.target}const zi="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function qn(e){return ee(e)&&e.matches(zi)}function ft(e){e.preventDefault(),e.stopPropagation()}function qi(e){return e?e.getAttribute("role")==="combobox"&&qn(e):!1}const je=Math.min,Ce=Math.max,Ze=Math.round,Ue=Math.floor,pe=e=>({x:e,y:e}),Hi={left:"right",right:"left",bottom:"top",top:"bottom"},_i={start:"end",end:"start"};function It(e,t,n){return Ce(e,je(t,n))}function ze(e,t){return typeof e=="function"?e(t):e}function we(e){return e.split("-")[0]}function qe(e){return e.split("-")[1]}function Hn(e){return e==="x"?"y":"x"}function Ft(e){return e==="y"?"height":"width"}function at(e){return["top","bottom"].includes(we(e))?"y":"x"}function Bt(e){return Hn(at(e))}function Ui(e,t,n){n===void 0&&(n=!1);const o=qe(e),i=Bt(e),r=Ft(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=et(l)),[l,et(l)]}function Qi(e){const t=et(e);return[Rt(e),t,Rt(t)]}function Rt(e){return e.replace(/start|end/g,t=>_i[t])}function Xi(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 Yi(e,t,n,o){const i=qe(e);let r=Xi(we(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(Rt)))),r}function et(e){return e.replace(/left|right|bottom|top/g,t=>Hi[t])}function Gi(e){return{top:0,right:0,bottom:0,left:0,...e}}function _n(e){return typeof e!="number"?Gi(e):{top:e,right:e,bottom:e,left:e}}function tt(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Jt(e,t,n){let{reference:o,floating:i}=e;const r=at(t),l=Bt(t),s=Ft(l),a=we(t),c=r==="y",m=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,g=o[s]/2-i[s]/2;let p;switch(a){case"top":p={x:m,y:o.y-i.height};break;case"bottom":p={x:m,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-i.width,y:d};break;default:p={x:o.x,y:o.y}}switch(qe(t)){case"start":p[l]-=g*(n&&c?-1:1);break;case"end":p[l]+=g*(n&&c?-1:1);break}return p}const Ji=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:m,y:d}=Jt(c,o,a),g=o,p={},b=0;for(let h=0;h<s.length;h++){const{name:y,fn:C}=s[h],{x:v,y:R,data:S,reset:E}=await C({x:m,y:d,initialPlacement:o,placement:g,strategy:i,middlewareData:p,rects:c,platform:l,elements:{reference:e,floating:t}});m=v??m,d=R??d,p={...p,[y]:{...p[y],...S}},E&&b<=50&&(b++,typeof E=="object"&&(E.placement&&(g=E.placement),E.rects&&(c=E.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):E.rects),{x:m,y:d}=Jt(c,g,a)),h=-1)}return{x:m,y:d,placement:g,strategy:i,middlewareData:p}};async function Un(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:m="viewport",elementContext:d="floating",altBoundary:g=!1,padding:p=0}=ze(t,e),b=_n(p),y=s[g?d==="floating"?"reference":"floating":d],C=tt(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:m,strategy:a})),v=d==="floating"?{...l.floating,x:o,y:i}:l.reference,R=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),S=await(r.isElement==null?void 0:r.isElement(R))?await(r.getScale==null?void 0:r.getScale(R))||{x:1,y:1}:{x:1,y:1},E=tt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:R,strategy:a}):v);return{top:(C.top-E.top+b.top)/S.y,bottom:(E.bottom-C.bottom+b.bottom)/S.y,left:(C.left-E.left+b.left)/S.x,right:(E.right-C.right+b.right)/S.x}}const Zi=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:m=0}=ze(e,t)||{};if(c==null)return{};const d=_n(m),g={x:n,y:o},p=Bt(i),b=Ft(p),h=await l.getDimensions(c),y=p==="y",C=y?"top":"left",v=y?"bottom":"right",R=y?"clientHeight":"clientWidth",S=r.reference[b]+r.reference[p]-g[p]-r.floating[b],E=g[p]-r.reference[p],w=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let I=w?w[R]:0;(!I||!await(l.isElement==null?void 0:l.isElement(w)))&&(I=s.floating[R]||r.floating[b]);const P=S/2-E/2,F=I/2-h[b]/2-1,j=je(d[C],F),Q=je(d[v],F),W=j,q=I-h[b]-Q,z=I/2-h[b]/2+P,V=It(W,z,q),B=!a.arrow&&qe(i)!=null&&z!==V&&r.reference[b]/2-(z<W?j:Q)-h[b]/2<0,D=B?z<W?z-W:z-q:0;return{[p]:g[p]+D,data:{[p]:V,centerOffset:z-V-D,...B&&{alignmentOffset:D}},reset:B}}}),er=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:m=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:h=!0,...y}=ze(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const C=we(i),v=we(s)===s,R=await(a.isRTL==null?void 0:a.isRTL(c.floating)),S=g||(v||!h?[et(s)]:Qi(s));!g&&b!=="none"&&S.push(...Yi(s,h,b,R));const E=[s,...S],w=await Un(t,y),I=[];let P=((o=r.flip)==null?void 0:o.overflows)||[];if(m&&I.push(w[C]),d){const W=Ui(i,l,R);I.push(w[W[0]],w[W[1]])}if(P=[...P,{placement:i,overflows:I}],!I.every(W=>W<=0)){var F,j;const W=(((F=r.flip)==null?void 0:F.index)||0)+1,q=E[W];if(q)return{data:{index:W,overflows:P},reset:{placement:q}};let z=(j=P.filter(V=>V.overflows[0]<=0).sort((V,B)=>V.overflows[1]-B.overflows[1])[0])==null?void 0:j.placement;if(!z)switch(p){case"bestFit":{var Q;const V=(Q=P.map(B=>[B.placement,B.overflows.filter(D=>D>0).reduce((D,O)=>D+O,0)]).sort((B,D)=>B[1]-D[1])[0])==null?void 0:Q[0];V&&(z=V);break}case"initialPlacement":z=s;break}if(i!==z)return{reset:{placement:z}}}return{}}}};async function tr(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=we(n),s=qe(n),a=at(n)==="y",c=["left","top"].includes(l)?-1:1,m=r&&a?-1:1,d=ze(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof b=="number"&&(p=s==="end"?b*-1:b),a?{x:p*m,y:g*c}:{x:g*c,y:p*m}}const nr=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 tr(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}}}}},or=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:C,y:v}=y;return{x:C,y:v}}},...a}=ze(e,t),c={x:n,y:o},m=await Un(t,a),d=at(we(i)),g=Hn(d);let p=c[g],b=c[d];if(r){const y=g==="y"?"top":"left",C=g==="y"?"bottom":"right",v=p+m[y],R=p-m[C];p=It(v,p,R)}if(l){const y=d==="y"?"top":"left",C=d==="y"?"bottom":"right",v=b+m[y],R=b-m[C];b=It(v,b,R)}const h=s.fn({...t,[g]:p,[d]:b});return{...h,data:{x:h.x-n,y:h.y-o}}}}};function Qn(e){const t=oe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=ee(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,s=Ze(n)!==r||Ze(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function Lt(e){return Y(e)?e:e.contextElement}function De(e){const t=Lt(e);if(!ee(t))return pe(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Qn(t);let l=(r?Ze(n.width):n.width)/o,s=(r?Ze(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const ir=pe(0);function Xn(e){const t=ne(e);return!Ot()||!t.visualViewport?ir:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rr(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ne(e)?!1:t}function Se(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=Lt(e);let l=pe(1);t&&(o?Y(o)&&(l=De(o)):l=De(e));const s=rr(r,n,o)?Xn(r):pe(0);let a=(i.left+s.x)/l.x,c=(i.top+s.y)/l.y,m=i.width/l.x,d=i.height/l.y;if(r){const g=ne(r),p=o&&Y(o)?ne(o):o;let b=g.frameElement;for(;b&&o&&p!==g;){const h=De(b),y=b.getBoundingClientRect(),C=oe(b),v=y.left+(b.clientLeft+parseFloat(C.paddingLeft))*h.x,R=y.top+(b.clientTop+parseFloat(C.paddingTop))*h.y;a*=h.x,c*=h.y,m*=h.x,d*=h.y,a+=v,c+=R,b=ne(b).frameElement}}return tt({width:m,height:d,x:a,y:c})}const lr=[":popover-open",":modal"];function Yn(e){let t=!1,n=0,o=0;function i(r){try{t=t||e.matches(r)}catch{}}if(lr.forEach(r=>{i(r)}),t){const r=$n(e);if(r){const l=r.getBoundingClientRect();n=l.x,o=l.y}}return[t,n,o]}function sr(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=de(o),[l]=t?Yn(t.floating):[!1];if(o===r||l)return n;let s={scrollLeft:0,scrollTop:0},a=pe(1);const c=pe(0),m=ee(o);if((m||!m&&i!=="fixed")&&((ue(o)!=="body"||We(r))&&(s=st(o)),ee(o))){const d=Se(o);a=De(o),c.x=d.x+o.clientLeft,c.y=d.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 ar(e){return Array.from(e.getClientRects())}function Gn(e){return Se(de(e)).left+st(e).scrollLeft}function cr(e){const t=de(e),n=st(e),o=e.ownerDocument.body,i=Ce(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Ce(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Gn(e);const s=-n.scrollTop;return oe(o).direction==="rtl"&&(l+=Ce(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:s}}function ur(e,t){const n=ne(e),o=de(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=Ot();(!c||c&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}return{width:r,height:l,x:s,y:a}}function dr(e,t){const n=Se(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=ee(e)?De(e):pe(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 Zt(e,t,n){let o;if(t==="viewport")o=ur(e,n);else if(t==="document")o=cr(de(e));else if(Y(t))o=dr(t,n);else{const i=Xn(e);o={...t,x:t.x-i.x,y:t.y-i.y}}return tt(o)}function Jn(e,t){const n=ve(e);return n===t||!Y(n)||ke(n)?!1:oe(n).position==="fixed"||Jn(n,t)}function fr(e,t){const n=t.get(e);if(n)return n;let o=fe(e,[],!1).filter(s=>Y(s)&&ue(s)!=="body"),i=null;const r=oe(e).position==="fixed";let l=r?ve(e):e;for(;Y(l)&&!ke(l);){const s=oe(l),a=Vt(l);!a&&s.position==="fixed"&&(i=null),(r?!a&&!i:!a&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||We(l)&&!a&&Jn(e,l))?o=o.filter(m=>m!==l):i=s,l=ve(l)}return t.set(e,o),o}function pr(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?fr(t,this._c):[].concat(n),o],s=l[0],a=l.reduce((c,m)=>{const d=Zt(t,m,i);return c.top=Ce(d.top,c.top),c.right=je(d.right,c.right),c.bottom=je(d.bottom,c.bottom),c.left=Ce(d.left,c.left),c},Zt(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function hr(e){const{width:t,height:n}=Qn(e);return{width:t,height:n}}function mr(e,t,n,o){const i=ee(t),r=de(t),l=n==="fixed",s=Se(e,!0,l,t);let a={scrollLeft:0,scrollTop:0};const c=pe(0);if(i||!i&&!l)if((ue(t)!=="body"||We(r))&&(a=st(t)),i){const h=Se(t,!0,l,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else r&&(c.x=Gn(r));let m=s.left+a.scrollLeft-c.x,d=s.top+a.scrollTop-c.y;const[g,p,b]=Yn(o);return g&&(m+=p,d+=b,i&&(m+=t.clientLeft,d+=t.clientTop)),{x:m,y:d,width:s.width,height:s.height}}function en(e,t){return!ee(e)||oe(e).position==="fixed"?null:t?t(e):e.offsetParent}function Zn(e,t){const n=ne(e);if(!ee(e))return n;let o=en(e,t);for(;o&&Bi(o)&&oe(o).position==="static";)o=en(o,t);return o&&(ue(o)==="html"||ue(o)==="body"&&oe(o).position==="static"&&!Vt(o))?n:o||$n(e)||n}const gr=async function(e){const t=this.getOffsetParent||Zn,n=this.getDimensions;return{reference:mr(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function br(e){return oe(e).direction==="rtl"}const eo={convertOffsetParentRelativeRectToViewportRelativeRect:sr,getDocumentElement:de,getClippingRect:pr,getOffsetParent:Zn,getElementRects:gr,getClientRects:ar,getDimensions:hr,getScale:De,isElement:Y,isRTL:br};function xr(e,t){let n=null,o;const i=de(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:m,width:d,height:g}=e.getBoundingClientRect();if(s||t(),!d||!g)return;const p=Ue(m),b=Ue(i.clientWidth-(c+d)),h=Ue(i.clientHeight-(m+g)),y=Ue(c),v={rootMargin:-p+"px "+-b+"px "+-h+"px "+-y+"px",threshold:Ce(0,je(1,a))||1};let R=!0;function S(E){const w=E[0].intersectionRatio;if(w!==a){if(!R)return l();w?l(!1,w):o=setTimeout(()=>{l(!1,1e-7)},100)}R=!1}try{n=new IntersectionObserver(S,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,v)}n.observe(e)}return l(!0),r}function yr(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=Lt(e),m=i||r?[...c?fe(c):[],...fe(t)]:[];m.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),r&&C.addEventListener("resize",n)});const d=c&&s?xr(c,n):null;let g=-1,p=null;l&&(p=new ResizeObserver(C=>{let[v]=C;v&&v.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var R;(R=p)==null||R.observe(t)})),n()}),c&&!a&&p.observe(c),p.observe(t));let b,h=a?Se(e):null;a&&y();function y(){const C=Se(e);h&&(C.x!==h.x||C.y!==h.y||C.width!==h.width||C.height!==h.height)&&n(),h=C,b=requestAnimationFrame(y)}return n(),()=>{var C;m.forEach(v=>{i&&v.removeEventListener("scroll",n),r&&v.removeEventListener("resize",n)}),d==null||d(),(C=p)==null||C.disconnect(),p=null,a&&cancelAnimationFrame(b)}}const Cr=or,vr=er,tn=Zi,wr=(e,t,n)=>{const o=new Map,i={platform:eo,...n},r={...i.platform,_c:o};return Ji(e,t,{...i,platform:r})},Sr=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?tn({element:o.current,padding:i}).fn(n):{}:o?tn({element:o,padding:i}).fn(n):{}}}};var Ye=typeof document<"u"?A.useLayoutEffect:A.useEffect;function nt(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(!nt(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)&&!nt(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function to(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nn(e,t){const n=to(e);return Math.round(t*n)/n}function on(e){const t=T.useRef(e);return Ye(()=>{t.current=e}),t}function Tr(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,[m,d]=T.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=T.useState(o);nt(g,o)||p(o);const[b,h]=T.useState(null),[y,C]=T.useState(null),v=T.useCallback(D=>{D!==w.current&&(w.current=D,h(D))},[]),R=T.useCallback(D=>{D!==I.current&&(I.current=D,C(D))},[]),S=r||b,E=l||y,w=T.useRef(null),I=T.useRef(null),P=T.useRef(m),F=a!=null,j=on(a),Q=on(i),W=T.useCallback(()=>{if(!w.current||!I.current)return;const D={placement:t,strategy:n,middleware:g};Q.current&&(D.platform=Q.current),wr(w.current,I.current,D).then(O=>{const J={...O,isPositioned:!0};q.current&&!nt(P.current,J)&&(P.current=J,ri.flushSync(()=>{d(J)}))})},[g,t,n,Q]);Ye(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(D=>({...D,isPositioned:!1})))},[c]);const q=T.useRef(!1);Ye(()=>(q.current=!0,()=>{q.current=!1}),[]),Ye(()=>{if(S&&(w.current=S),E&&(I.current=E),S&&E){if(j.current)return j.current(S,E,W);W()}},[S,E,W,j,F]);const z=T.useMemo(()=>({reference:w,floating:I,setReference:v,setFloating:R}),[v,R]),V=T.useMemo(()=>({reference:S,floating:E}),[S,E]),B=T.useMemo(()=>{const D={position:n,left:0,top:0};if(!V.floating)return D;const O=nn(V.floating,m.x),J=nn(V.floating,m.y);return s?{...D,transform:"translate("+O+"px, "+J+"px)",...to(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:J}},[n,s,V.floating,m.x,m.y]);return T.useMemo(()=>({...m,update:W,refs:z,elements:V,floatingStyles:B}),[m,W,z,V,B])}/*!
169
+ `;function Fi(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=me();return n?u.jsx(Yt,{variant:"failedToExplain"}):e.length===0&&t.length===0?u.jsx(Yt,{variant:"noExplanationFound"}):u.jsxs(Oi,{children:[e.length>0&&u.jsxs("div",{children:[u.jsx(Qt,{children:"Solutions"}),u.jsx(Xt,{children:e.map(o=>u.jsx(Di,{explanation:o},e.indexOf(o)))})]}),t.length>0&&u.jsxs("div",{children:[u.jsx(Qt,{children:"Constraint Explanations"}),u.jsx(Xt,{children:t.map(o=>u.jsx(Vi,{explanation:o},t.indexOf(o)))})]})]})}function ue(e){return Mn(e)?(e.nodeName||"").toLowerCase():"#document"}function ne(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function de(e){var t;return(t=(Mn(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Mn(e){return e instanceof Node||e instanceof ne(e).Node}function Y(e){return e instanceof Element||e instanceof ne(e).Element}function ee(e){return e instanceof HTMLElement||e instanceof ne(e).HTMLElement}function Et(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ne(e).ShadowRoot}function We(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=oe(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Bi(e){return["table","td","th"].includes(ue(e))}function Vt(e){const t=Ot(),n=oe(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 $n(e){let t=ve(e);for(;ee(t)&&!ke(t);){if(Vt(t))return t;t=ve(t)}return null}function Ot(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ke(e){return["html","body","#document"].includes(ue(e))}function oe(e){return ne(e).getComputedStyle(e)}function st(e){return Y(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ve(e){if(ue(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Et(e)&&e.host||de(e);return Et(t)?t.host:t}function Kn(e){const t=ve(e);return ke(t)?e.ownerDocument?e.ownerDocument.body:e.body:ee(t)&&We(t)?t:Kn(t)}function fe(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Kn(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=ne(i);return r?t.concat(l,l.visualViewport||[],We(i)?i:[],l.frameElement&&n?fe(l.frameElement):[]):t.concat(i,fe(i,[],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 te(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Et(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Wn(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function zn(){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 Li(e){return e.mozInputSource===0&&e.isTrusted?!0:At()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ni(e){return $i()?!1:!At()&&e.width===0&&e.height===0||At()&&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 Mi(){return/apple/i.test(navigator.vendor)}function At(){const e=/android/i;return e.test(Wn())||e.test(zn())}function $i(){return zn().includes("jsdom/")}function Gt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Ki(e){return"nativeEvent"in e}function Wi(e){return e.matches("html,body")}function ce(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 Re(e){return"composedPath"in e?e.composedPath()[0]:e.target}const zi="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function qn(e){return ee(e)&&e.matches(zi)}function ft(e){e.preventDefault(),e.stopPropagation()}function qi(e){return e?e.getAttribute("role")==="combobox"&&qn(e):!1}const je=Math.min,Ce=Math.max,Ze=Math.round,Ue=Math.floor,pe=e=>({x:e,y:e}),Hi={left:"right",right:"left",bottom:"top",top:"bottom"},_i={start:"end",end:"start"};function It(e,t,n){return Ce(e,je(t,n))}function ze(e,t){return typeof e=="function"?e(t):e}function we(e){return e.split("-")[0]}function qe(e){return e.split("-")[1]}function Hn(e){return e==="x"?"y":"x"}function Ft(e){return e==="y"?"height":"width"}function at(e){return["top","bottom"].includes(we(e))?"y":"x"}function Bt(e){return Hn(at(e))}function Ui(e,t,n){n===void 0&&(n=!1);const o=qe(e),i=Bt(e),r=Ft(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=et(l)),[l,et(l)]}function Qi(e){const t=et(e);return[Rt(e),t,Rt(t)]}function Rt(e){return e.replace(/start|end/g,t=>_i[t])}function Xi(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 Yi(e,t,n,o){const i=qe(e);let r=Xi(we(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(Rt)))),r}function et(e){return e.replace(/left|right|bottom|top/g,t=>Hi[t])}function Gi(e){return{top:0,right:0,bottom:0,left:0,...e}}function _n(e){return typeof e!="number"?Gi(e):{top:e,right:e,bottom:e,left:e}}function tt(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Jt(e,t,n){let{reference:o,floating:i}=e;const r=at(t),l=Bt(t),s=Ft(l),a=we(t),c=r==="y",m=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,g=o[s]/2-i[s]/2;let f;switch(a){case"top":f={x:m,y:o.y-i.height};break;case"bottom":f={x:m,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(qe(t)){case"start":f[l]-=g*(n&&c?-1:1);break;case"end":f[l]+=g*(n&&c?-1:1);break}return f}const Ji=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:m,y:d}=Jt(c,o,a),g=o,f={},b=0;for(let h=0;h<s.length;h++){const{name:y,fn:C}=s[h],{x:v,y:R,data:S,reset:E}=await C({x:m,y:d,initialPlacement:o,placement:g,strategy:i,middlewareData:f,rects:c,platform:l,elements:{reference:e,floating:t}});m=v??m,d=R??d,f={...f,[y]:{...f[y],...S}},E&&b<=50&&(b++,typeof E=="object"&&(E.placement&&(g=E.placement),E.rects&&(c=E.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):E.rects),{x:m,y:d}=Jt(c,g,a)),h=-1)}return{x:m,y:d,placement:g,strategy:i,middlewareData:f}};async function Un(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:m="viewport",elementContext:d="floating",altBoundary:g=!1,padding:f=0}=ze(t,e),b=_n(f),y=s[g?d==="floating"?"reference":"floating":d],C=tt(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:m,strategy:a})),v=d==="floating"?{...l.floating,x:o,y:i}:l.reference,R=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),S=await(r.isElement==null?void 0:r.isElement(R))?await(r.getScale==null?void 0:r.getScale(R))||{x:1,y:1}:{x:1,y:1},E=tt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:R,strategy:a}):v);return{top:(C.top-E.top+b.top)/S.y,bottom:(E.bottom-C.bottom+b.bottom)/S.y,left:(C.left-E.left+b.left)/S.x,right:(E.right-C.right+b.right)/S.x}}const Zi=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:m=0}=ze(e,t)||{};if(c==null)return{};const d=_n(m),g={x:n,y:o},f=Bt(i),b=Ft(f),h=await l.getDimensions(c),y=f==="y",C=y?"top":"left",v=y?"bottom":"right",R=y?"clientHeight":"clientWidth",S=r.reference[b]+r.reference[f]-g[f]-r.floating[b],E=g[f]-r.reference[f],w=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let I=w?w[R]:0;(!I||!await(l.isElement==null?void 0:l.isElement(w)))&&(I=s.floating[R]||r.floating[b]);const P=S/2-E/2,F=I/2-h[b]/2-1,j=je(d[C],F),Q=je(d[v],F),W=j,q=I-h[b]-Q,z=I/2-h[b]/2+P,V=It(W,z,q),B=!a.arrow&&qe(i)!=null&&z!==V&&r.reference[b]/2-(z<W?j:Q)-h[b]/2<0,D=B?z<W?z-W:z-q:0;return{[f]:g[f]+D,data:{[f]:V,centerOffset:z-V-D,...B&&{alignmentOffset:D}},reset:B}}}),er=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:m=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:h=!0,...y}=ze(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const C=we(i),v=we(s)===s,R=await(a.isRTL==null?void 0:a.isRTL(c.floating)),S=g||(v||!h?[et(s)]:Qi(s));!g&&b!=="none"&&S.push(...Yi(s,h,b,R));const E=[s,...S],w=await Un(t,y),I=[];let P=((o=r.flip)==null?void 0:o.overflows)||[];if(m&&I.push(w[C]),d){const W=Ui(i,l,R);I.push(w[W[0]],w[W[1]])}if(P=[...P,{placement:i,overflows:I}],!I.every(W=>W<=0)){var F,j;const W=(((F=r.flip)==null?void 0:F.index)||0)+1,q=E[W];if(q)return{data:{index:W,overflows:P},reset:{placement:q}};let z=(j=P.filter(V=>V.overflows[0]<=0).sort((V,B)=>V.overflows[1]-B.overflows[1])[0])==null?void 0:j.placement;if(!z)switch(f){case"bestFit":{var Q;const V=(Q=P.map(B=>[B.placement,B.overflows.filter(D=>D>0).reduce((D,O)=>D+O,0)]).sort((B,D)=>B[1]-D[1])[0])==null?void 0:Q[0];V&&(z=V);break}case"initialPlacement":z=s;break}if(i!==z)return{reset:{placement:z}}}return{}}}};async function tr(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=we(n),s=qe(n),a=at(n)==="y",c=["left","top"].includes(l)?-1:1,m=r&&a?-1:1,d=ze(t,e);let{mainAxis:g,crossAxis:f,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof b=="number"&&(f=s==="end"?b*-1:b),a?{x:f*m,y:g*c}:{x:g*c,y:f*m}}const nr=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 tr(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}}}}},or=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:C,y:v}=y;return{x:C,y:v}}},...a}=ze(e,t),c={x:n,y:o},m=await Un(t,a),d=at(we(i)),g=Hn(d);let f=c[g],b=c[d];if(r){const y=g==="y"?"top":"left",C=g==="y"?"bottom":"right",v=f+m[y],R=f-m[C];f=It(v,f,R)}if(l){const y=d==="y"?"top":"left",C=d==="y"?"bottom":"right",v=b+m[y],R=b-m[C];b=It(v,b,R)}const h=s.fn({...t,[g]:f,[d]:b});return{...h,data:{x:h.x-n,y:h.y-o}}}}};function Qn(e){const t=oe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=ee(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,s=Ze(n)!==r||Ze(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function Lt(e){return Y(e)?e:e.contextElement}function De(e){const t=Lt(e);if(!ee(t))return pe(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Qn(t);let l=(r?Ze(n.width):n.width)/o,s=(r?Ze(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const ir=pe(0);function Xn(e){const t=ne(e);return!Ot()||!t.visualViewport?ir:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rr(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ne(e)?!1:t}function Se(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=Lt(e);let l=pe(1);t&&(o?Y(o)&&(l=De(o)):l=De(e));const s=rr(r,n,o)?Xn(r):pe(0);let a=(i.left+s.x)/l.x,c=(i.top+s.y)/l.y,m=i.width/l.x,d=i.height/l.y;if(r){const g=ne(r),f=o&&Y(o)?ne(o):o;let b=g.frameElement;for(;b&&o&&f!==g;){const h=De(b),y=b.getBoundingClientRect(),C=oe(b),v=y.left+(b.clientLeft+parseFloat(C.paddingLeft))*h.x,R=y.top+(b.clientTop+parseFloat(C.paddingTop))*h.y;a*=h.x,c*=h.y,m*=h.x,d*=h.y,a+=v,c+=R,b=ne(b).frameElement}}return tt({width:m,height:d,x:a,y:c})}const lr=[":popover-open",":modal"];function Yn(e){let t=!1,n=0,o=0;function i(r){try{t=t||e.matches(r)}catch{}}if(lr.forEach(r=>{i(r)}),t){const r=$n(e);if(r){const l=r.getBoundingClientRect();n=l.x,o=l.y}}return[t,n,o]}function sr(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=de(o),[l]=t?Yn(t.floating):[!1];if(o===r||l)return n;let s={scrollLeft:0,scrollTop:0},a=pe(1);const c=pe(0),m=ee(o);if((m||!m&&i!=="fixed")&&((ue(o)!=="body"||We(r))&&(s=st(o)),ee(o))){const d=Se(o);a=De(o),c.x=d.x+o.clientLeft,c.y=d.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 ar(e){return Array.from(e.getClientRects())}function Gn(e){return Se(de(e)).left+st(e).scrollLeft}function cr(e){const t=de(e),n=st(e),o=e.ownerDocument.body,i=Ce(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Ce(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Gn(e);const s=-n.scrollTop;return oe(o).direction==="rtl"&&(l+=Ce(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:s}}function ur(e,t){const n=ne(e),o=de(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=Ot();(!c||c&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}return{width:r,height:l,x:s,y:a}}function dr(e,t){const n=Se(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=ee(e)?De(e):pe(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 Zt(e,t,n){let o;if(t==="viewport")o=ur(e,n);else if(t==="document")o=cr(de(e));else if(Y(t))o=dr(t,n);else{const i=Xn(e);o={...t,x:t.x-i.x,y:t.y-i.y}}return tt(o)}function Jn(e,t){const n=ve(e);return n===t||!Y(n)||ke(n)?!1:oe(n).position==="fixed"||Jn(n,t)}function fr(e,t){const n=t.get(e);if(n)return n;let o=fe(e,[],!1).filter(s=>Y(s)&&ue(s)!=="body"),i=null;const r=oe(e).position==="fixed";let l=r?ve(e):e;for(;Y(l)&&!ke(l);){const s=oe(l),a=Vt(l);!a&&s.position==="fixed"&&(i=null),(r?!a&&!i:!a&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||We(l)&&!a&&Jn(e,l))?o=o.filter(m=>m!==l):i=s,l=ve(l)}return t.set(e,o),o}function pr(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?fr(t,this._c):[].concat(n),o],s=l[0],a=l.reduce((c,m)=>{const d=Zt(t,m,i);return c.top=Ce(d.top,c.top),c.right=je(d.right,c.right),c.bottom=je(d.bottom,c.bottom),c.left=Ce(d.left,c.left),c},Zt(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function hr(e){const{width:t,height:n}=Qn(e);return{width:t,height:n}}function mr(e,t,n,o){const i=ee(t),r=de(t),l=n==="fixed",s=Se(e,!0,l,t);let a={scrollLeft:0,scrollTop:0};const c=pe(0);if(i||!i&&!l)if((ue(t)!=="body"||We(r))&&(a=st(t)),i){const h=Se(t,!0,l,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else r&&(c.x=Gn(r));let m=s.left+a.scrollLeft-c.x,d=s.top+a.scrollTop-c.y;const[g,f,b]=Yn(o);return g&&(m+=f,d+=b,i&&(m+=t.clientLeft,d+=t.clientTop)),{x:m,y:d,width:s.width,height:s.height}}function en(e,t){return!ee(e)||oe(e).position==="fixed"?null:t?t(e):e.offsetParent}function Zn(e,t){const n=ne(e);if(!ee(e))return n;let o=en(e,t);for(;o&&Bi(o)&&oe(o).position==="static";)o=en(o,t);return o&&(ue(o)==="html"||ue(o)==="body"&&oe(o).position==="static"&&!Vt(o))?n:o||$n(e)||n}const gr=async function(e){const t=this.getOffsetParent||Zn,n=this.getDimensions;return{reference:mr(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function br(e){return oe(e).direction==="rtl"}const eo={convertOffsetParentRelativeRectToViewportRelativeRect:sr,getDocumentElement:de,getClippingRect:pr,getOffsetParent:Zn,getElementRects:gr,getClientRects:ar,getDimensions:hr,getScale:De,isElement:Y,isRTL:br};function xr(e,t){let n=null,o;const i=de(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:m,width:d,height:g}=e.getBoundingClientRect();if(s||t(),!d||!g)return;const f=Ue(m),b=Ue(i.clientWidth-(c+d)),h=Ue(i.clientHeight-(m+g)),y=Ue(c),v={rootMargin:-f+"px "+-b+"px "+-h+"px "+-y+"px",threshold:Ce(0,je(1,a))||1};let R=!0;function S(E){const w=E[0].intersectionRatio;if(w!==a){if(!R)return l();w?l(!1,w):o=setTimeout(()=>{l(!1,1e-7)},100)}R=!1}try{n=new IntersectionObserver(S,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,v)}n.observe(e)}return l(!0),r}function yr(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=Lt(e),m=i||r?[...c?fe(c):[],...fe(t)]:[];m.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),r&&C.addEventListener("resize",n)});const d=c&&s?xr(c,n):null;let g=-1,f=null;l&&(f=new ResizeObserver(C=>{let[v]=C;v&&v.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var R;(R=f)==null||R.observe(t)})),n()}),c&&!a&&f.observe(c),f.observe(t));let b,h=a?Se(e):null;a&&y();function y(){const C=Se(e);h&&(C.x!==h.x||C.y!==h.y||C.width!==h.width||C.height!==h.height)&&n(),h=C,b=requestAnimationFrame(y)}return n(),()=>{var C;m.forEach(v=>{i&&v.removeEventListener("scroll",n),r&&v.removeEventListener("resize",n)}),d==null||d(),(C=f)==null||C.disconnect(),f=null,a&&cancelAnimationFrame(b)}}const Cr=or,vr=er,tn=Zi,wr=(e,t,n)=>{const o=new Map,i={platform:eo,...n},r={...i.platform,_c:o};return Ji(e,t,{...i,platform:r})},Sr=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?tn({element:o.current,padding:i}).fn(n):{}:o?tn({element:o,padding:i}).fn(n):{}}}};var Ye=typeof document<"u"?A.useLayoutEffect:A.useEffect;function nt(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(!nt(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)&&!nt(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function to(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nn(e,t){const n=to(e);return Math.round(t*n)/n}function on(e){const t=T.useRef(e);return Ye(()=>{t.current=e}),t}function Tr(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,[m,d]=T.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,f]=T.useState(o);nt(g,o)||f(o);const[b,h]=T.useState(null),[y,C]=T.useState(null),v=T.useCallback(D=>{D!==w.current&&(w.current=D,h(D))},[]),R=T.useCallback(D=>{D!==I.current&&(I.current=D,C(D))},[]),S=r||b,E=l||y,w=T.useRef(null),I=T.useRef(null),P=T.useRef(m),F=a!=null,j=on(a),Q=on(i),W=T.useCallback(()=>{if(!w.current||!I.current)return;const D={placement:t,strategy:n,middleware:g};Q.current&&(D.platform=Q.current),wr(w.current,I.current,D).then(O=>{const J={...O,isPositioned:!0};q.current&&!nt(P.current,J)&&(P.current=J,ri.flushSync(()=>{d(J)}))})},[g,t,n,Q]);Ye(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(D=>({...D,isPositioned:!1})))},[c]);const q=T.useRef(!1);Ye(()=>(q.current=!0,()=>{q.current=!1}),[]),Ye(()=>{if(S&&(w.current=S),E&&(I.current=E),S&&E){if(j.current)return j.current(S,E,W);W()}},[S,E,W,j,F]);const z=T.useMemo(()=>({reference:w,floating:I,setReference:v,setFloating:R}),[v,R]),V=T.useMemo(()=>({reference:S,floating:E}),[S,E]),B=T.useMemo(()=>{const D={position:n,left:0,top:0};if(!V.floating)return D;const O=nn(V.floating,m.x),J=nn(V.floating,m.y);return s?{...D,transform:"translate("+O+"px, "+J+"px)",...to(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:J}},[n,s,V.floating,m.x,m.y]);return T.useMemo(()=>({...m,update:W,refs:z,elements:V,floatingStyles:B}),[m,W,z,V,B])}/*!
170
170
  * tabbable 6.2.0
171
171
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
172
- */var Er=["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])"],Pt=Er.join(","),no=typeof Element>"u",$e=no?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ot=!no&&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},it=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},Ar=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},Ir=function(t,n,o){if(it(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Pt));return n&&$e.call(t,Pt)&&i.unshift(t),i=i.filter(o),i},Rr=function e(t,n,o){for(var i=[],r=Array.from(t);r.length;){var l=r.shift();if(!it(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 m=$e.call(l,Pt);m&&o.filter(l)&&(n||!t.includes(l))&&i.push(l);var d=l.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(l),g=!it(d,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(l));if(d&&g){var p=e(d===!0?l.children:d.children,!0,o);o.flatten?i.push.apply(i,p):i.push({scopeParent:l,candidates:p})}else r.unshift.apply(r,l.children)}}return i},oo=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},io=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Ar(t))&&!oo(t)?0:t.tabIndex},Pr=function(t,n){var o=io(t);return o<0&&n&&!oo(t)?0:o},Dr=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ro=function(t){return t.tagName==="INPUT"},kr=function(t){return ro(t)&&t.type==="hidden"},jr=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Vr=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Or=function(t){if(!t.name)return!0;var n=t.form||ot(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=Vr(i,t.form);return!r||r===t},Fr=function(t){return ro(t)&&t.type==="radio"},Br=function(t){return Fr(t)&&!Or(t)},Lr=function(t){var n,o=t&&ot(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,m,d;o=ot(i),i=(c=o)===null||c===void 0?void 0:c.host,r=!!((m=i)!==null&&m!==void 0&&(d=m.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return r},rn=function(t){var n=t.getBoundingClientRect(),o=n.width,i=n.height;return o===0&&i===0},Nr=function(t,n){var o=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var r=$e.call(t,"details>summary:first-of-type"),l=r?t.parentElement:t;if($e.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=ot(t);if(a&&!a.shadowRoot&&i(a)===!0)return rn(t);t.assignedSlot?t=t.assignedSlot:!a&&c!==t.ownerDocument?t=c.host:t=a}t=s}if(Lr(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return rn(t);return!1},Mr=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 $e.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},$r=function(t,n){return!(n.disabled||it(n)||kr(n)||Nr(n,t)||jr(n)||Mr(n))},ln=function(t,n){return!(Br(n)||io(n)<0||!$r(t,n))},Kr=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Wr=function e(t){var n=[],o=[];return t.forEach(function(i,r){var l=!!i.scopeParent,s=l?i.scopeParent:i,a=Pr(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(Dr).reduce(function(i,r){return r.isScope?i.push.apply(i,r.content):i.push(r.content),i},[]).concat(n)},Nt=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Rr([t],n.includeContainer,{filter:ln.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Kr}):o=Ir(t,n.includeContainer,ln.bind(null,n)),Wr(o)};function Mt(e){return T.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const zr=T["useInsertionEffect".toString()],qr=zr||(e=>e());function Pe(e){const t=T.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return qr(()=>{t.current=e}),T.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 sn=0;function xe(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:i=!1}=t;o&&cancelAnimationFrame(sn);const r=()=>e==null?void 0:e.focus({preventScroll:n});i?r():sn=requestAnimationFrame(r)}var ie=typeof document<"u"?A.useLayoutEffect:A.useEffect;function Ve(){return Ve=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},Ve.apply(this,arguments)}let pt=!1,Hr=0;const an=()=>"floating-ui-"+Hr++;function _r(){const[e,t]=T.useState(()=>pt?an():void 0);return ie(()=>{e==null&&t(an())},[]),T.useEffect(()=>{pt||(pt=!0)},[]),e}const Ur=T["useId".toString()],ct=Ur||_r,Qr=T.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:m,stroke:d,d:g,style:{transform:p,...b}={},...h}=t;process.env.NODE_ENV!=="production"&&(n||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const y=ct();if(!i)return null;c*=2;const C=c/2,v=l/2*(a/-8+1),R=s/2*a/4,[S,E]=o.split("-"),w=eo.isRTL(i),I=!!g,P=S==="top"||S==="bottom",F=m&&E==="end"?"bottom":"top";let j=m&&E==="end"?"right":"left";m&&w&&(j=E==="end"?"left":"right");const Q=(r==null?void 0:r.x)!=null?m||r.x:"",W=(r==null?void 0:r.y)!=null?m||r.y:"",q=g||"M0,0"+(" H"+l)+(" L"+(l-v)+","+(s-R))+(" Q"+l/2+","+s+" "+v+","+(s-R))+" Z",z={top:I?"rotate(180deg)":"",left:I?"rotate(90deg)":"rotate(-90deg)",bottom:I?"":"rotate(180deg)",right:I?"rotate(-90deg)":"rotate(90deg)"}[S];return T.createElement("svg",Ve({},h,{"aria-hidden":!0,ref:n,width:I?l:l+c,height:l,viewBox:"0 0 "+l+" "+(s>l?s:l),style:{position:"absolute",pointerEvents:"none",[j]:Q,[F]:W,[S]:P||I?"100%":"calc(100% - "+c/2+"px)",transform:""+z+(p??""),...b}}),c>0&&T.createElement("path",{clipPath:"url(#"+y+")",fill:"none",stroke:d,strokeWidth:c+(g?0:1),d:q}),T.createElement("path",{stroke:c&&!g?h.fill:"none",d:q}),T.createElement("clipPath",{id:y},T.createElement("rect",{x:-C,y:C*(I?-1:1),width:l+c,height:l})))});function Xr(){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 Yr=T.createContext(null),Gr=T.createContext(null),Jr=()=>{var e;return((e=T.useContext(Yr))==null?void 0:e.id)||null},$t=()=>T.useContext(Gr);function Ke(e){return"data-floating-ui-"+e}function ht(e){const t=A.useRef(e);return ie(()=>{t.current=e}),t}function Zr(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 Le(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 Ae=new WeakMap,Qe=new WeakSet,Xe={},mt=0;const el=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,lo=e=>e&&(e.host||lo(e.parentNode)),tl=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=lo(n);return e.contains(o)?o:null}).filter(n=>n!=null);function nl(e,t,n,o){const i="data-floating-ui-inert",r=o?"inert":n?"aria-hidden":null,l=tl(t,e),s=new Set,a=new Set(l),c=[];Xe[i]||(Xe[i]=new WeakMap);const m=Xe[i];l.forEach(d),g(t),s.clear();function d(p){!p||s.has(p)||(s.add(p),p.parentNode&&d(p.parentNode))}function g(p){!p||a.has(p)||Array.prototype.forEach.call(p.children,b=>{if(s.has(b))g(b);else{const h=r?b.getAttribute(r):null,y=h!==null&&h!=="false",C=(Ae.get(b)||0)+1,v=(m.get(b)||0)+1;Ae.set(b,C),m.set(b,v),c.push(b),C===1&&y&&Qe.add(b),v===1&&b.setAttribute(i,""),!y&&r&&b.setAttribute(r,"true")}})}return mt++,()=>{c.forEach(p=>{const b=(Ae.get(p)||0)-1,h=(m.get(p)||0)-1;Ae.set(p,b),m.set(p,h),b||(!Qe.has(p)&&r&&p.removeAttribute(r),Qe.delete(p)),h||p.removeAttribute(i)}),mt--,mt||(Ae=new WeakMap,Ae=new WeakMap,Qe=new WeakSet,Xe={})}}function cn(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=ce(e[0]).body;return nl(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const Kt=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function so(e,t){const n=Nt(e,Kt());t==="prev"&&n.reverse();const o=n.indexOf(Ie(ce(e)));return n.slice(o+1)[0]}function ao(){return so(document.body,"next")}function co(){return so(document.body,"prev")}function Ne(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!te(n,o)}function ol(e){Nt(e,Kt()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function il(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 Wt={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 rl;function un(e){e.key==="Tab"&&(e.target,clearTimeout(rl))}const rt=T.forwardRef(function(t,n){const[o,i]=T.useState();ie(()=>(Mi()&&i("button"),document.addEventListener("keydown",un),()=>{document.removeEventListener("keydown",un)}),[]);const r={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[Ke("focus-guard")]:"",style:Wt};return T.createElement("span",Ve({},t,r))}),uo=T.createContext(null),dn=Ke("portal");function ll(e){let{id:t,root:n}=e===void 0?{}:e;const[o,i]=T.useState(null),r=ct(),l=po(),s=T.useRef(null);return ie(()=>()=>{o==null||o.remove(),queueMicrotask(()=>{s.current=null})},[o]),ie(()=>{if(s.current)return;const a=t?document.getElementById(t):null;if(!a)return;const c=document.createElement("div");c.id=r,c.setAttribute(dn,""),a.appendChild(c),s.current=c,i(c)},[t,r]),ie(()=>{if(s.current)return;let a=n||(l==null?void 0:l.portalNode);a&&!Y(a)&&(a=a.current),a=a||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,a.appendChild(c));const m=document.createElement("div");m.id=r,m.setAttribute(dn,""),a=c||a,a.appendChild(m),s.current=m,i(m)},[t,n,r,l]),o}function fo(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const r=ll({id:n,root:o}),[l,s]=T.useState(null),a=T.useRef(null),c=T.useRef(null),m=T.useRef(null),d=T.useRef(null),g=!!l&&!l.modal&&l.open&&i&&!!(o||r);return T.useEffect(()=>{if(!r||!i||l!=null&&l.modal)return;function p(b){r&&Ne(b)&&(b.type==="focusin"?il:ol)(r)}return r.addEventListener("focusin",p,!0),r.addEventListener("focusout",p,!0),()=>{r.removeEventListener("focusin",p,!0),r.removeEventListener("focusout",p,!0)}},[r,i,l==null?void 0:l.modal]),T.createElement(uo.Provider,{value:T.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:c,beforeInsideRef:m,afterInsideRef:d,portalNode:r,setFocusManagerState:s}),[i,r])},g&&r&&T.createElement(rt,{"data-type":"outside",ref:a,onFocus:p=>{if(Ne(p,r)){var b;(b=m.current)==null||b.focus()}else{const h=co()||(l==null?void 0:l.refs.domReference.current);h==null||h.focus()}}}),g&&r&&T.createElement("span",{"aria-owns":r.id,style:Wt}),r&&jn.createPortal(t,r),g&&r&&T.createElement(rt,{"data-type":"outside",ref:c,onFocus:p=>{if(Ne(p,r)){var b;(b=d.current)==null||b.focus()}else{const h=ao()||(l==null?void 0:l.refs.domReference.current);h==null||h.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,p.nativeEvent))}}}))}const po=()=>T.useContext(uo),fn=20;let ye=[];function gt(e){ye=ye.filter(t=>t.isConnected),e&&ue(e)!=="body"&&(ye.push(e),ye.length>fn&&(ye=ye.slice(-fn)))}function pn(){return ye.slice().reverse().find(e=>e.isConnected)}const sl=T.forwardRef(function(t,n){return T.createElement("button",Ve({},t,{type:"button",ref:n,tabIndex:-1,style:Wt}))});function ho(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:m=!0}=e,{open:d,refs:g,nodeId:p,onOpenChange:b,events:h,dataRef:y,elements:{domReference:C,floating:v}}=t,R=typeof l=="number"&&l<0,S=qi(C)&&R,E=el()?r:!0,w=ht(i),I=ht(l),P=ht(s),F=$t(),j=po(),Q=T.useRef(null),W=T.useRef(null),q=T.useRef(!1),z=T.useRef(!1),V=j!=null,B=T.useCallback(function($){return $===void 0&&($=v),$?Nt($,Kt()):[]},[v]),D=T.useCallback($=>{const M=B($);return w.current.map(L=>C&&L==="reference"?C:v&&L==="floating"?v:M).filter(Boolean).flat()},[C,v,w,B]);T.useEffect(()=>{if(o||!a)return;function $(L){if(L.key==="Tab"){te(v,Ie(ce(v)))&&B().length===0&&!S&&ft(L);const K=D(),H=Re(L);w.current[0]==="reference"&&H===C&&(ft(L),L.shiftKey?xe(K[K.length-1]):xe(K[1])),w.current[1]==="floating"&&H===v&&L.shiftKey&&(ft(L),xe(K[0]))}}const M=ce(v);return M.addEventListener("keydown",$),()=>{M.removeEventListener("keydown",$)}},[o,C,v,a,w,S,B,D]),T.useEffect(()=>{if(o||!m)return;function $(){z.current=!0,setTimeout(()=>{z.current=!1})}function M(L){const K=L.relatedTarget;queueMicrotask(()=>{const H=!(te(C,K)||te(v,K)||te(K,v)||te(j==null?void 0:j.portalNode,K)||K!=null&&K.hasAttribute(Ke("focus-guard"))||F&&(Le(F.nodesRef.current,p).find(U=>{var G,re;return te((G=U.context)==null?void 0:G.elements.floating,K)||te((re=U.context)==null?void 0:re.elements.domReference,K)})||Zr(F.nodesRef.current,p).find(U=>{var G,re;return((G=U.context)==null?void 0:G.elements.floating)===K||((re=U.context)==null?void 0:re.elements.domReference)===K})));K&&H&&!z.current&&K!==pn()&&(q.current=!0,b(!1,L))})}if(v&&ee(C))return C.addEventListener("focusout",M),C.addEventListener("pointerdown",$),!a&&v.addEventListener("focusout",M),()=>{C.removeEventListener("focusout",M),C.removeEventListener("pointerdown",$),!a&&v.removeEventListener("focusout",M)}},[o,C,v,a,p,F,j,b,m]),T.useEffect(()=>{var $;if(o)return;const M=Array.from((j==null||($=j.portalNode)==null?void 0:$.querySelectorAll("["+Ke("portal")+"]"))||[]);if(v){const L=[v,...M,Q.current,W.current,w.current.includes("reference")||S?C:null].filter(H=>H!=null),K=a||S?cn(L,E,!E):cn(L);return()=>{K()}}},[o,C,v,a,w,j,S,E]),ie(()=>{if(o||!v)return;const $=ce(v),M=Ie($);queueMicrotask(()=>{const L=D(v),K=I.current,H=(typeof K=="number"?L[K]:K.current)||v,U=te(v,M);!R&&!U&&d&&xe(H,{preventScroll:H===v})})},[o,d,v,R,D,I]),ie(()=>{if(o||!v)return;let $=!1;const M=ce(v),L=Ie(M),K=y.current;gt(L);function H(U){let{reason:G,event:re,nested:Be}=U;G==="escape-key"&&g.domReference.current&&gt(g.domReference.current),G==="hover"&&re.type==="mouseleave"&&(q.current=!0),G==="outside-press"&&(Be?(q.current=!1,$=!0):q.current=!(Li(re)||Ni(re)))}return h.on("openchange",H),()=>{h.off("openchange",H);const U=Ie(M),G=te(v,U)||F&&Le(F.nodesRef.current,p).some(Xo=>{var qt;return te((qt=Xo.context)==null?void 0:qt.elements.floating,U)});(G||K.openEvent&&["click","mousedown"].includes(K.openEvent.type))&&g.domReference.current&&gt(g.domReference.current);const Be=pn();P.current&&!q.current&&ee(Be)&&(!(Be!==U&&U!==M.body)||G)&&xe(Be,{cancelPrevious:!1,preventScroll:$})}},[o,v,P,y,g,h,F,p]),ie(()=>{if(!(o||!j))return j.setFocusManagerState({modal:a,closeOnFocusOut:m,open:d,onOpenChange:b,refs:g}),()=>{j.setFocusManagerState(null)}},[o,j,a,d,b,g,m]),ie(()=>{if(o||!v||typeof MutationObserver!="function"||R)return;const $=()=>{const L=v.getAttribute("tabindex");w.current.includes("floating")||Ie(ce(v))!==g.domReference.current&&B().length===0?L!=="0"&&v.setAttribute("tabindex","0"):L!=="-1"&&v.setAttribute("tabindex","-1")};$();const M=new MutationObserver($);return M.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{M.disconnect()}},[o,v,g,w,B,R]);function O($){return o||!c||!a?null:T.createElement(sl,{ref:$==="start"?Q:W,onClick:M=>b(!1,M.nativeEvent)},typeof c=="string"?c:"Dismiss")}const J=!o&&E&&(V||a);return T.createElement(T.Fragment,null,J&&T.createElement(rt,{"data-type":"inside",ref:j==null?void 0:j.beforeInsideRef,onFocus:$=>{if(a){const L=D();xe(i[0]==="reference"?L[0]:L[L.length-1])}else if(j!=null&&j.preserveTabOrder&&j.portalNode)if(q.current=!1,Ne($,j.portalNode)){const L=ao()||C;L==null||L.focus()}else{var M;(M=j.beforeOutsideRef.current)==null||M.focus()}}}),!S&&O("start"),n,O("end"),J&&T.createElement(rt,{"data-type":"inside",ref:j==null?void 0:j.afterInsideRef,onFocus:$=>{if(a)xe(D()[0]);else if(j!=null&&j.preserveTabOrder&&j.portalNode)if(m&&(q.current=!0),Ne($,j.portalNode)){const L=co()||C;L==null||L.focus()}else{var M;(M=j.afterOutsideRef.current)==null||M.focus()}}}))}const bt=new Set,mo=T.forwardRef(function(t,n){let{lockScroll:o=!1,...i}=t;const r=ct();return ie(()=>{if(!o)return;bt.add(r);const l=/iP(hone|ad|od)|iOS/.test(Wn()),s=document.body.style,c=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",m=window.innerWidth-document.documentElement.clientWidth,d=s.left?parseFloat(s.left):window.pageXOffset,g=s.top?parseFloat(s.top):window.pageYOffset;if(s.overflow="hidden",m&&(s[c]=m+"px"),l){var p,b;const h=((p=window.visualViewport)==null?void 0:p.offsetLeft)||0,y=((b=window.visualViewport)==null?void 0:b.offsetTop)||0;Object.assign(s,{position:"fixed",top:-(g-Math.floor(y))+"px",left:-(d-Math.floor(h))+"px",right:"0"})}return()=>{bt.delete(r),bt.size===0&&(Object.assign(s,{overflow:"",[c]:""}),l&&(Object.assign(s,{position:"",top:"",left:"",right:""}),window.scrollTo(d,g)))}},[r,o]),T.createElement("div",Ve({ref:n},i,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}}))});function hn(e){return ee(e.target)&&e.target.tagName==="BUTTON"}function mn(e){return qn(e)}function go(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:m=!0}=t,d=T.useRef(),g=T.useRef(!1);return T.useMemo(()=>l?{reference:{onPointerDown(p){d.current=p.pointerType},onMouseDown(p){p.button===0&&(Gt(d.current,!0)&&c||s!=="click"&&(n&&a&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?o(!1,p.nativeEvent,"click"):(p.preventDefault(),o(!0,p.nativeEvent,"click"))))},onClick(p){if(s==="mousedown"&&d.current){d.current=void 0;return}Gt(d.current,!0)&&c||(n&&a&&(!i.current.openEvent||i.current.openEvent.type==="click")?o(!1,p.nativeEvent,"click"):o(!0,p.nativeEvent,"click"))},onKeyDown(p){d.current=void 0,!(p.defaultPrevented||!m||hn(p))&&(p.key===" "&&!mn(r)&&(p.preventDefault(),g.current=!0),p.key==="Enter"&&o(!(n&&a),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!m||hn(p)||mn(r)||p.key===" "&&g.current&&(g.current=!1,o(!(n&&a),p.nativeEvent,"click"))}}}:{},[l,i,s,c,m,r,a,n,o])}const al={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},cl={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},gn=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 bo(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:m=!0,outsidePress:d=!0,outsidePressEvent:g="pointerdown",referencePress:p=!1,referencePressEvent:b="pointerdown",ancestorScroll:h=!1,bubbles:y,capture:C}=t,v=$t(),R=Pe(typeof d=="function"?d:()=>!1),S=typeof d=="function"?R:d,E=T.useRef(!1),w=T.useRef(!1),{escapeKey:I,outsidePress:P}=gn(y),{escapeKey:F,outsidePress:j}=gn(C),Q=Pe(V=>{if(!n||!c||!m||V.key!=="Escape")return;const B=v?Le(v.nodesRef.current,i):[];if(!I&&(V.stopPropagation(),B.length>0)){let D=!0;if(B.forEach(O=>{var J;if((J=O.context)!=null&&J.open&&!O.context.dataRef.current.__escapeKeyBubbles){D=!1;return}}),!D)return}o(!1,Ki(V)?V.nativeEvent:V,"escape-key")}),W=Pe(V=>{var B;const D=()=>{var O;Q(V),(O=Re(V))==null||O.removeEventListener("keydown",D)};(B=Re(V))==null||B.addEventListener("keydown",D)}),q=Pe(V=>{const B=E.current;E.current=!1;const D=w.current;if(w.current=!1,g==="click"&&D||B||typeof S=="function"&&!S(V))return;const O=Re(V),J="["+Ke("inert")+"]",$=ce(s).querySelectorAll(J);let M=Y(O)?O:null;for(;M&&!ke(M);){const H=ve(M);if(ke(H)||!Y(H))break;M=H}if($.length&&Y(O)&&!Wi(O)&&!te(O,s)&&Array.from($).every(H=>!te(M,H)))return;if(ee(O)&&s){const H=O.clientWidth>0&&O.scrollWidth>O.clientWidth,U=O.clientHeight>0&&O.scrollHeight>O.clientHeight;let G=U&&V.offsetX>O.clientWidth;if(U&&oe(O).direction==="rtl"&&(G=V.offsetX<=O.offsetWidth-O.clientWidth),G||H&&V.offsetY>O.clientHeight)return}const L=v&&Le(v.nodesRef.current,i).some(H=>{var U;return dt(V,(U=H.context)==null?void 0:U.elements.floating)});if(dt(V,s)||dt(V,l)||L)return;const K=v?Le(v.nodesRef.current,i):[];if(K.length>0){let H=!0;if(K.forEach(U=>{var G;if((G=U.context)!=null&&G.open&&!U.context.dataRef.current.__outsidePressBubbles){H=!1;return}}),!H)return}o(!1,V,"outside-press")}),z=Pe(V=>{var B;const D=()=>{var O;q(V),(O=Re(V))==null||O.removeEventListener(g,D)};(B=Re(V))==null||B.addEventListener(g,D)});return T.useEffect(()=>{if(!n||!c)return;a.current.__escapeKeyBubbles=I,a.current.__outsidePressBubbles=P;function V(O){o(!1,O,"ancestor-scroll")}const B=ce(s);m&&B.addEventListener("keydown",F?W:Q,F),S&&B.addEventListener(g,j?z:q,j);let D=[];return h&&(Y(l)&&(D=fe(l)),Y(s)&&(D=D.concat(fe(s))),!Y(r)&&r&&r.contextElement&&(D=D.concat(fe(r.contextElement)))),D=D.filter(O=>{var J;return O!==((J=B.defaultView)==null?void 0:J.visualViewport)}),D.forEach(O=>{O.addEventListener("scroll",V,{passive:!0})}),()=>{m&&B.removeEventListener("keydown",F?W:Q,F),S&&B.removeEventListener(g,j?z:q,j),D.forEach(O=>{O.removeEventListener("scroll",V)})}},[a,s,l,r,m,S,g,n,o,h,c,I,P,Q,F,W,q,j,z]),T.useEffect(()=>{E.current=!1},[S,g]),T.useMemo(()=>c?{reference:{onKeyDown:Q,[al[b]]:V=>{p&&o(!1,V.nativeEvent,"reference-press")}},floating:{onKeyDown:Q,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[cl[g]]:()=>{E.current=!0}}}:{},[c,p,g,b,o,Q])}let Dt;process.env.NODE_ENV!=="production"&&(Dt=new Set);function xo(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 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((r=e.elements)!=null&&r.reference&&!Y(e.elements.reference)){var l;if(!((l=Dt)!=null&&l.has(P))){var s;(s=Dt)==null||s.add(P),console.error(P)}}}const[a,c]=T.useState(null),m=((t=e.elements)==null?void 0:t.reference)||a,d=Tr(e),g=$t(),p=Jr()!=null,b=Pe((P,F,j)=>{P&&(y.current.openEvent=F),C.emit("openchange",{open:P,event:F,reason:j,nested:p}),o==null||o(P,F,j)}),h=T.useRef(null),y=T.useRef({}),C=T.useState(()=>Xr())[0],v=ct(),R=T.useCallback(P=>{const F=Y(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),contextElement:P}:P;d.refs.setReference(F)},[d.refs]),S=T.useCallback(P=>{(Y(P)||P===null)&&(h.current=P,c(P)),(Y(d.refs.reference.current)||d.refs.reference.current===null||P!==null&&!Y(P))&&d.refs.setReference(P)},[d.refs]),E=T.useMemo(()=>({...d.refs,setReference:S,setPositionReference:R,domReference:h}),[d.refs,S,R]),w=T.useMemo(()=>({...d.elements,domReference:m}),[d.elements,m]),I=T.useMemo(()=>({...d,refs:E,elements:w,dataRef:y,nodeId:i,floatingId:v,events:C,open:n,onOpenChange:b}),[d,i,v,C,n,b,E,w]);return ie(()=>{const P=g==null?void 0:g.nodesRef.current.find(F=>F.id===i);P&&(P.context=I)}),T.useMemo(()=>({...d,context:I,refs:E,elements:w}),[d,E,w,I])}const bn="active",xn="selected";function xt(e,t,n){const o=new Map,i=n==="item";let r=e;if(i&&e){const{[bn]:l,[xn]: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,m]=a;if(!(i&&[bn,xn].includes(c)))if(c.indexOf("on")===0){if(o.has(c)||o.set(c,[]),typeof m=="function"){var d;(d=o.get(c))==null||d.push(m),l[c]=function(){for(var g,p=arguments.length,b=new Array(p),h=0;h<p;h++)b[h]=arguments[h];return(g=o.get(c))==null?void 0:g.map(y=>y(...b)).find(y=>y!==void 0)}}}else l[c]=m}),l),{})}}function yo(e){e===void 0&&(e=[]);const t=e,n=T.useCallback(r=>xt(r,e,"reference"),t),o=T.useCallback(r=>xt(r,e,"floating"),t),i=T.useCallback(r=>xt(r,e,"item"),e.map(r=>r==null?void 0:r.item));return T.useMemo(()=>({getReferenceProps:n,getFloatingProps:o,getItemProps:i}),[n,o,i])}function ul(e={}){const{initialOpen:t=!1,open:n,onOpenChange:o}=e,[i,r]=T.useState(t),l=n??i,s=o??r,a=xo({open:l,onOpenChange:s}),c=a.context,m=go(c,{enabled:n==null}),d=bo(c,{outsidePressEvent:"mousedown"}),g=yo([m,d]);return T.useMemo(()=>({open:l,setOpen:s,...g,...a}),[l,s,g,a])}const Co=T.createContext(null),vo=()=>{const e=T.useContext(Co);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function dl({children:e,...t}){const n=ul(t);return u.jsx(Co.Provider,{value:n,children:e})}const wo=k.css`
172
+ */var Er=["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])"],Pt=Er.join(","),no=typeof Element>"u",$e=no?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ot=!no&&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},it=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},Ar=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},Ir=function(t,n,o){if(it(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Pt));return n&&$e.call(t,Pt)&&i.unshift(t),i=i.filter(o),i},Rr=function e(t,n,o){for(var i=[],r=Array.from(t);r.length;){var l=r.shift();if(!it(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 m=$e.call(l,Pt);m&&o.filter(l)&&(n||!t.includes(l))&&i.push(l);var d=l.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(l),g=!it(d,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(l));if(d&&g){var f=e(d===!0?l.children:d.children,!0,o);o.flatten?i.push.apply(i,f):i.push({scopeParent:l,candidates:f})}else r.unshift.apply(r,l.children)}}return i},oo=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},io=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Ar(t))&&!oo(t)?0:t.tabIndex},Pr=function(t,n){var o=io(t);return o<0&&n&&!oo(t)?0:o},Dr=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ro=function(t){return t.tagName==="INPUT"},kr=function(t){return ro(t)&&t.type==="hidden"},jr=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Vr=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Or=function(t){if(!t.name)return!0;var n=t.form||ot(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=Vr(i,t.form);return!r||r===t},Fr=function(t){return ro(t)&&t.type==="radio"},Br=function(t){return Fr(t)&&!Or(t)},Lr=function(t){var n,o=t&&ot(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,m,d;o=ot(i),i=(c=o)===null||c===void 0?void 0:c.host,r=!!((m=i)!==null&&m!==void 0&&(d=m.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return r},rn=function(t){var n=t.getBoundingClientRect(),o=n.width,i=n.height;return o===0&&i===0},Nr=function(t,n){var o=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var r=$e.call(t,"details>summary:first-of-type"),l=r?t.parentElement:t;if($e.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=ot(t);if(a&&!a.shadowRoot&&i(a)===!0)return rn(t);t.assignedSlot?t=t.assignedSlot:!a&&c!==t.ownerDocument?t=c.host:t=a}t=s}if(Lr(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return rn(t);return!1},Mr=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 $e.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},$r=function(t,n){return!(n.disabled||it(n)||kr(n)||Nr(n,t)||jr(n)||Mr(n))},ln=function(t,n){return!(Br(n)||io(n)<0||!$r(t,n))},Kr=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Wr=function e(t){var n=[],o=[];return t.forEach(function(i,r){var l=!!i.scopeParent,s=l?i.scopeParent:i,a=Pr(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(Dr).reduce(function(i,r){return r.isScope?i.push.apply(i,r.content):i.push(r.content),i},[]).concat(n)},Nt=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Rr([t],n.includeContainer,{filter:ln.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Kr}):o=Ir(t,n.includeContainer,ln.bind(null,n)),Wr(o)};function Mt(e){return T.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const zr=T["useInsertionEffect".toString()],qr=zr||(e=>e());function Pe(e){const t=T.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return qr(()=>{t.current=e}),T.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 sn=0;function xe(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:i=!1}=t;o&&cancelAnimationFrame(sn);const r=()=>e==null?void 0:e.focus({preventScroll:n});i?r():sn=requestAnimationFrame(r)}var ie=typeof document<"u"?A.useLayoutEffect:A.useEffect;function Ve(){return Ve=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},Ve.apply(this,arguments)}let pt=!1,Hr=0;const an=()=>"floating-ui-"+Hr++;function _r(){const[e,t]=T.useState(()=>pt?an():void 0);return ie(()=>{e==null&&t(an())},[]),T.useEffect(()=>{pt||(pt=!0)},[]),e}const Ur=T["useId".toString()],ct=Ur||_r,Qr=T.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:m,stroke:d,d:g,style:{transform:f,...b}={},...h}=t;process.env.NODE_ENV!=="production"&&(n||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const y=ct();if(!i)return null;c*=2;const C=c/2,v=l/2*(a/-8+1),R=s/2*a/4,[S,E]=o.split("-"),w=eo.isRTL(i),I=!!g,P=S==="top"||S==="bottom",F=m&&E==="end"?"bottom":"top";let j=m&&E==="end"?"right":"left";m&&w&&(j=E==="end"?"left":"right");const Q=(r==null?void 0:r.x)!=null?m||r.x:"",W=(r==null?void 0:r.y)!=null?m||r.y:"",q=g||"M0,0"+(" H"+l)+(" L"+(l-v)+","+(s-R))+(" Q"+l/2+","+s+" "+v+","+(s-R))+" Z",z={top:I?"rotate(180deg)":"",left:I?"rotate(90deg)":"rotate(-90deg)",bottom:I?"":"rotate(180deg)",right:I?"rotate(-90deg)":"rotate(90deg)"}[S];return T.createElement("svg",Ve({},h,{"aria-hidden":!0,ref:n,width:I?l:l+c,height:l,viewBox:"0 0 "+l+" "+(s>l?s:l),style:{position:"absolute",pointerEvents:"none",[j]:Q,[F]:W,[S]:P||I?"100%":"calc(100% - "+c/2+"px)",transform:""+z+(f??""),...b}}),c>0&&T.createElement("path",{clipPath:"url(#"+y+")",fill:"none",stroke:d,strokeWidth:c+(g?0:1),d:q}),T.createElement("path",{stroke:c&&!g?h.fill:"none",d:q}),T.createElement("clipPath",{id:y},T.createElement("rect",{x:-C,y:C*(I?-1:1),width:l+c,height:l})))});function Xr(){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 Yr=T.createContext(null),Gr=T.createContext(null),Jr=()=>{var e;return((e=T.useContext(Yr))==null?void 0:e.id)||null},$t=()=>T.useContext(Gr);function Ke(e){return"data-floating-ui-"+e}function ht(e){const t=A.useRef(e);return ie(()=>{t.current=e}),t}function Zr(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 Le(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 Ae=new WeakMap,Qe=new WeakSet,Xe={},mt=0;const el=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,lo=e=>e&&(e.host||lo(e.parentNode)),tl=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=lo(n);return e.contains(o)?o:null}).filter(n=>n!=null);function nl(e,t,n,o){const i="data-floating-ui-inert",r=o?"inert":n?"aria-hidden":null,l=tl(t,e),s=new Set,a=new Set(l),c=[];Xe[i]||(Xe[i]=new WeakMap);const m=Xe[i];l.forEach(d),g(t),s.clear();function d(f){!f||s.has(f)||(s.add(f),f.parentNode&&d(f.parentNode))}function g(f){!f||a.has(f)||Array.prototype.forEach.call(f.children,b=>{if(s.has(b))g(b);else{const h=r?b.getAttribute(r):null,y=h!==null&&h!=="false",C=(Ae.get(b)||0)+1,v=(m.get(b)||0)+1;Ae.set(b,C),m.set(b,v),c.push(b),C===1&&y&&Qe.add(b),v===1&&b.setAttribute(i,""),!y&&r&&b.setAttribute(r,"true")}})}return mt++,()=>{c.forEach(f=>{const b=(Ae.get(f)||0)-1,h=(m.get(f)||0)-1;Ae.set(f,b),m.set(f,h),b||(!Qe.has(f)&&r&&f.removeAttribute(r),Qe.delete(f)),h||f.removeAttribute(i)}),mt--,mt||(Ae=new WeakMap,Ae=new WeakMap,Qe=new WeakSet,Xe={})}}function cn(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=ce(e[0]).body;return nl(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const Kt=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function so(e,t){const n=Nt(e,Kt());t==="prev"&&n.reverse();const o=n.indexOf(Ie(ce(e)));return n.slice(o+1)[0]}function ao(){return so(document.body,"next")}function co(){return so(document.body,"prev")}function Ne(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!te(n,o)}function ol(e){Nt(e,Kt()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function il(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 Wt={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 rl;function un(e){e.key==="Tab"&&(e.target,clearTimeout(rl))}const rt=T.forwardRef(function(t,n){const[o,i]=T.useState();ie(()=>(Mi()&&i("button"),document.addEventListener("keydown",un),()=>{document.removeEventListener("keydown",un)}),[]);const r={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[Ke("focus-guard")]:"",style:Wt};return T.createElement("span",Ve({},t,r))}),uo=T.createContext(null),dn=Ke("portal");function ll(e){let{id:t,root:n}=e===void 0?{}:e;const[o,i]=T.useState(null),r=ct(),l=po(),s=T.useRef(null);return ie(()=>()=>{o==null||o.remove(),queueMicrotask(()=>{s.current=null})},[o]),ie(()=>{if(s.current)return;const a=t?document.getElementById(t):null;if(!a)return;const c=document.createElement("div");c.id=r,c.setAttribute(dn,""),a.appendChild(c),s.current=c,i(c)},[t,r]),ie(()=>{if(s.current)return;let a=n||(l==null?void 0:l.portalNode);a&&!Y(a)&&(a=a.current),a=a||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,a.appendChild(c));const m=document.createElement("div");m.id=r,m.setAttribute(dn,""),a=c||a,a.appendChild(m),s.current=m,i(m)},[t,n,r,l]),o}function fo(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const r=ll({id:n,root:o}),[l,s]=T.useState(null),a=T.useRef(null),c=T.useRef(null),m=T.useRef(null),d=T.useRef(null),g=!!l&&!l.modal&&l.open&&i&&!!(o||r);return T.useEffect(()=>{if(!r||!i||l!=null&&l.modal)return;function f(b){r&&Ne(b)&&(b.type==="focusin"?il:ol)(r)}return r.addEventListener("focusin",f,!0),r.addEventListener("focusout",f,!0),()=>{r.removeEventListener("focusin",f,!0),r.removeEventListener("focusout",f,!0)}},[r,i,l==null?void 0:l.modal]),T.createElement(uo.Provider,{value:T.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:c,beforeInsideRef:m,afterInsideRef:d,portalNode:r,setFocusManagerState:s}),[i,r])},g&&r&&T.createElement(rt,{"data-type":"outside",ref:a,onFocus:f=>{if(Ne(f,r)){var b;(b=m.current)==null||b.focus()}else{const h=co()||(l==null?void 0:l.refs.domReference.current);h==null||h.focus()}}}),g&&r&&T.createElement("span",{"aria-owns":r.id,style:Wt}),r&&jn.createPortal(t,r),g&&r&&T.createElement(rt,{"data-type":"outside",ref:c,onFocus:f=>{if(Ne(f,r)){var b;(b=d.current)==null||b.focus()}else{const h=ao()||(l==null?void 0:l.refs.domReference.current);h==null||h.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,f.nativeEvent))}}}))}const po=()=>T.useContext(uo),fn=20;let ye=[];function gt(e){ye=ye.filter(t=>t.isConnected),e&&ue(e)!=="body"&&(ye.push(e),ye.length>fn&&(ye=ye.slice(-fn)))}function pn(){return ye.slice().reverse().find(e=>e.isConnected)}const sl=T.forwardRef(function(t,n){return T.createElement("button",Ve({},t,{type:"button",ref:n,tabIndex:-1,style:Wt}))});function ho(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:m=!0}=e,{open:d,refs:g,nodeId:f,onOpenChange:b,events:h,dataRef:y,elements:{domReference:C,floating:v}}=t,R=typeof l=="number"&&l<0,S=qi(C)&&R,E=el()?r:!0,w=ht(i),I=ht(l),P=ht(s),F=$t(),j=po(),Q=T.useRef(null),W=T.useRef(null),q=T.useRef(!1),z=T.useRef(!1),V=j!=null,B=T.useCallback(function($){return $===void 0&&($=v),$?Nt($,Kt()):[]},[v]),D=T.useCallback($=>{const M=B($);return w.current.map(L=>C&&L==="reference"?C:v&&L==="floating"?v:M).filter(Boolean).flat()},[C,v,w,B]);T.useEffect(()=>{if(o||!a)return;function $(L){if(L.key==="Tab"){te(v,Ie(ce(v)))&&B().length===0&&!S&&ft(L);const K=D(),H=Re(L);w.current[0]==="reference"&&H===C&&(ft(L),L.shiftKey?xe(K[K.length-1]):xe(K[1])),w.current[1]==="floating"&&H===v&&L.shiftKey&&(ft(L),xe(K[0]))}}const M=ce(v);return M.addEventListener("keydown",$),()=>{M.removeEventListener("keydown",$)}},[o,C,v,a,w,S,B,D]),T.useEffect(()=>{if(o||!m)return;function $(){z.current=!0,setTimeout(()=>{z.current=!1})}function M(L){const K=L.relatedTarget;queueMicrotask(()=>{const H=!(te(C,K)||te(v,K)||te(K,v)||te(j==null?void 0:j.portalNode,K)||K!=null&&K.hasAttribute(Ke("focus-guard"))||F&&(Le(F.nodesRef.current,f).find(U=>{var G,re;return te((G=U.context)==null?void 0:G.elements.floating,K)||te((re=U.context)==null?void 0:re.elements.domReference,K)})||Zr(F.nodesRef.current,f).find(U=>{var G,re;return((G=U.context)==null?void 0:G.elements.floating)===K||((re=U.context)==null?void 0:re.elements.domReference)===K})));K&&H&&!z.current&&K!==pn()&&(q.current=!0,b(!1,L))})}if(v&&ee(C))return C.addEventListener("focusout",M),C.addEventListener("pointerdown",$),!a&&v.addEventListener("focusout",M),()=>{C.removeEventListener("focusout",M),C.removeEventListener("pointerdown",$),!a&&v.removeEventListener("focusout",M)}},[o,C,v,a,f,F,j,b,m]),T.useEffect(()=>{var $;if(o)return;const M=Array.from((j==null||($=j.portalNode)==null?void 0:$.querySelectorAll("["+Ke("portal")+"]"))||[]);if(v){const L=[v,...M,Q.current,W.current,w.current.includes("reference")||S?C:null].filter(H=>H!=null),K=a||S?cn(L,E,!E):cn(L);return()=>{K()}}},[o,C,v,a,w,j,S,E]),ie(()=>{if(o||!v)return;const $=ce(v),M=Ie($);queueMicrotask(()=>{const L=D(v),K=I.current,H=(typeof K=="number"?L[K]:K.current)||v,U=te(v,M);!R&&!U&&d&&xe(H,{preventScroll:H===v})})},[o,d,v,R,D,I]),ie(()=>{if(o||!v)return;let $=!1;const M=ce(v),L=Ie(M),K=y.current;gt(L);function H(U){let{reason:G,event:re,nested:Be}=U;G==="escape-key"&&g.domReference.current&&gt(g.domReference.current),G==="hover"&&re.type==="mouseleave"&&(q.current=!0),G==="outside-press"&&(Be?(q.current=!1,$=!0):q.current=!(Li(re)||Ni(re)))}return h.on("openchange",H),()=>{h.off("openchange",H);const U=Ie(M),G=te(v,U)||F&&Le(F.nodesRef.current,f).some(Xo=>{var qt;return te((qt=Xo.context)==null?void 0:qt.elements.floating,U)});(G||K.openEvent&&["click","mousedown"].includes(K.openEvent.type))&&g.domReference.current&&gt(g.domReference.current);const Be=pn();P.current&&!q.current&&ee(Be)&&(!(Be!==U&&U!==M.body)||G)&&xe(Be,{cancelPrevious:!1,preventScroll:$})}},[o,v,P,y,g,h,F,f]),ie(()=>{if(!(o||!j))return j.setFocusManagerState({modal:a,closeOnFocusOut:m,open:d,onOpenChange:b,refs:g}),()=>{j.setFocusManagerState(null)}},[o,j,a,d,b,g,m]),ie(()=>{if(o||!v||typeof MutationObserver!="function"||R)return;const $=()=>{const L=v.getAttribute("tabindex");w.current.includes("floating")||Ie(ce(v))!==g.domReference.current&&B().length===0?L!=="0"&&v.setAttribute("tabindex","0"):L!=="-1"&&v.setAttribute("tabindex","-1")};$();const M=new MutationObserver($);return M.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{M.disconnect()}},[o,v,g,w,B,R]);function O($){return o||!c||!a?null:T.createElement(sl,{ref:$==="start"?Q:W,onClick:M=>b(!1,M.nativeEvent)},typeof c=="string"?c:"Dismiss")}const J=!o&&E&&(V||a);return T.createElement(T.Fragment,null,J&&T.createElement(rt,{"data-type":"inside",ref:j==null?void 0:j.beforeInsideRef,onFocus:$=>{if(a){const L=D();xe(i[0]==="reference"?L[0]:L[L.length-1])}else if(j!=null&&j.preserveTabOrder&&j.portalNode)if(q.current=!1,Ne($,j.portalNode)){const L=ao()||C;L==null||L.focus()}else{var M;(M=j.beforeOutsideRef.current)==null||M.focus()}}}),!S&&O("start"),n,O("end"),J&&T.createElement(rt,{"data-type":"inside",ref:j==null?void 0:j.afterInsideRef,onFocus:$=>{if(a)xe(D()[0]);else if(j!=null&&j.preserveTabOrder&&j.portalNode)if(m&&(q.current=!0),Ne($,j.portalNode)){const L=co()||C;L==null||L.focus()}else{var M;(M=j.afterOutsideRef.current)==null||M.focus()}}}))}const bt=new Set,mo=T.forwardRef(function(t,n){let{lockScroll:o=!1,...i}=t;const r=ct();return ie(()=>{if(!o)return;bt.add(r);const l=/iP(hone|ad|od)|iOS/.test(Wn()),s=document.body.style,c=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",m=window.innerWidth-document.documentElement.clientWidth,d=s.left?parseFloat(s.left):window.pageXOffset,g=s.top?parseFloat(s.top):window.pageYOffset;if(s.overflow="hidden",m&&(s[c]=m+"px"),l){var f,b;const h=((f=window.visualViewport)==null?void 0:f.offsetLeft)||0,y=((b=window.visualViewport)==null?void 0:b.offsetTop)||0;Object.assign(s,{position:"fixed",top:-(g-Math.floor(y))+"px",left:-(d-Math.floor(h))+"px",right:"0"})}return()=>{bt.delete(r),bt.size===0&&(Object.assign(s,{overflow:"",[c]:""}),l&&(Object.assign(s,{position:"",top:"",left:"",right:""}),window.scrollTo(d,g)))}},[r,o]),T.createElement("div",Ve({ref:n},i,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}}))});function hn(e){return ee(e.target)&&e.target.tagName==="BUTTON"}function mn(e){return qn(e)}function go(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:m=!0}=t,d=T.useRef(),g=T.useRef(!1);return T.useMemo(()=>l?{reference:{onPointerDown(f){d.current=f.pointerType},onMouseDown(f){f.button===0&&(Gt(d.current,!0)&&c||s!=="click"&&(n&&a&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?o(!1,f.nativeEvent,"click"):(f.preventDefault(),o(!0,f.nativeEvent,"click"))))},onClick(f){if(s==="mousedown"&&d.current){d.current=void 0;return}Gt(d.current,!0)&&c||(n&&a&&(!i.current.openEvent||i.current.openEvent.type==="click")?o(!1,f.nativeEvent,"click"):o(!0,f.nativeEvent,"click"))},onKeyDown(f){d.current=void 0,!(f.defaultPrevented||!m||hn(f))&&(f.key===" "&&!mn(r)&&(f.preventDefault(),g.current=!0),f.key==="Enter"&&o(!(n&&a),f.nativeEvent,"click"))},onKeyUp(f){f.defaultPrevented||!m||hn(f)||mn(r)||f.key===" "&&g.current&&(g.current=!1,o(!(n&&a),f.nativeEvent,"click"))}}}:{},[l,i,s,c,m,r,a,n,o])}const al={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},cl={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},gn=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 bo(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:m=!0,outsidePress:d=!0,outsidePressEvent:g="pointerdown",referencePress:f=!1,referencePressEvent:b="pointerdown",ancestorScroll:h=!1,bubbles:y,capture:C}=t,v=$t(),R=Pe(typeof d=="function"?d:()=>!1),S=typeof d=="function"?R:d,E=T.useRef(!1),w=T.useRef(!1),{escapeKey:I,outsidePress:P}=gn(y),{escapeKey:F,outsidePress:j}=gn(C),Q=Pe(V=>{if(!n||!c||!m||V.key!=="Escape")return;const B=v?Le(v.nodesRef.current,i):[];if(!I&&(V.stopPropagation(),B.length>0)){let D=!0;if(B.forEach(O=>{var J;if((J=O.context)!=null&&J.open&&!O.context.dataRef.current.__escapeKeyBubbles){D=!1;return}}),!D)return}o(!1,Ki(V)?V.nativeEvent:V,"escape-key")}),W=Pe(V=>{var B;const D=()=>{var O;Q(V),(O=Re(V))==null||O.removeEventListener("keydown",D)};(B=Re(V))==null||B.addEventListener("keydown",D)}),q=Pe(V=>{const B=E.current;E.current=!1;const D=w.current;if(w.current=!1,g==="click"&&D||B||typeof S=="function"&&!S(V))return;const O=Re(V),J="["+Ke("inert")+"]",$=ce(s).querySelectorAll(J);let M=Y(O)?O:null;for(;M&&!ke(M);){const H=ve(M);if(ke(H)||!Y(H))break;M=H}if($.length&&Y(O)&&!Wi(O)&&!te(O,s)&&Array.from($).every(H=>!te(M,H)))return;if(ee(O)&&s){const H=O.clientWidth>0&&O.scrollWidth>O.clientWidth,U=O.clientHeight>0&&O.scrollHeight>O.clientHeight;let G=U&&V.offsetX>O.clientWidth;if(U&&oe(O).direction==="rtl"&&(G=V.offsetX<=O.offsetWidth-O.clientWidth),G||H&&V.offsetY>O.clientHeight)return}const L=v&&Le(v.nodesRef.current,i).some(H=>{var U;return dt(V,(U=H.context)==null?void 0:U.elements.floating)});if(dt(V,s)||dt(V,l)||L)return;const K=v?Le(v.nodesRef.current,i):[];if(K.length>0){let H=!0;if(K.forEach(U=>{var G;if((G=U.context)!=null&&G.open&&!U.context.dataRef.current.__outsidePressBubbles){H=!1;return}}),!H)return}o(!1,V,"outside-press")}),z=Pe(V=>{var B;const D=()=>{var O;q(V),(O=Re(V))==null||O.removeEventListener(g,D)};(B=Re(V))==null||B.addEventListener(g,D)});return T.useEffect(()=>{if(!n||!c)return;a.current.__escapeKeyBubbles=I,a.current.__outsidePressBubbles=P;function V(O){o(!1,O,"ancestor-scroll")}const B=ce(s);m&&B.addEventListener("keydown",F?W:Q,F),S&&B.addEventListener(g,j?z:q,j);let D=[];return h&&(Y(l)&&(D=fe(l)),Y(s)&&(D=D.concat(fe(s))),!Y(r)&&r&&r.contextElement&&(D=D.concat(fe(r.contextElement)))),D=D.filter(O=>{var J;return O!==((J=B.defaultView)==null?void 0:J.visualViewport)}),D.forEach(O=>{O.addEventListener("scroll",V,{passive:!0})}),()=>{m&&B.removeEventListener("keydown",F?W:Q,F),S&&B.removeEventListener(g,j?z:q,j),D.forEach(O=>{O.removeEventListener("scroll",V)})}},[a,s,l,r,m,S,g,n,o,h,c,I,P,Q,F,W,q,j,z]),T.useEffect(()=>{E.current=!1},[S,g]),T.useMemo(()=>c?{reference:{onKeyDown:Q,[al[b]]:V=>{f&&o(!1,V.nativeEvent,"reference-press")}},floating:{onKeyDown:Q,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[cl[g]]:()=>{E.current=!0}}}:{},[c,f,g,b,o,Q])}let Dt;process.env.NODE_ENV!=="production"&&(Dt=new Set);function xo(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 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((r=e.elements)!=null&&r.reference&&!Y(e.elements.reference)){var l;if(!((l=Dt)!=null&&l.has(P))){var s;(s=Dt)==null||s.add(P),console.error(P)}}}const[a,c]=T.useState(null),m=((t=e.elements)==null?void 0:t.reference)||a,d=Tr(e),g=$t(),f=Jr()!=null,b=Pe((P,F,j)=>{P&&(y.current.openEvent=F),C.emit("openchange",{open:P,event:F,reason:j,nested:f}),o==null||o(P,F,j)}),h=T.useRef(null),y=T.useRef({}),C=T.useState(()=>Xr())[0],v=ct(),R=T.useCallback(P=>{const F=Y(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),contextElement:P}:P;d.refs.setReference(F)},[d.refs]),S=T.useCallback(P=>{(Y(P)||P===null)&&(h.current=P,c(P)),(Y(d.refs.reference.current)||d.refs.reference.current===null||P!==null&&!Y(P))&&d.refs.setReference(P)},[d.refs]),E=T.useMemo(()=>({...d.refs,setReference:S,setPositionReference:R,domReference:h}),[d.refs,S,R]),w=T.useMemo(()=>({...d.elements,domReference:m}),[d.elements,m]),I=T.useMemo(()=>({...d,refs:E,elements:w,dataRef:y,nodeId:i,floatingId:v,events:C,open:n,onOpenChange:b}),[d,i,v,C,n,b,E,w]);return ie(()=>{const P=g==null?void 0:g.nodesRef.current.find(F=>F.id===i);P&&(P.context=I)}),T.useMemo(()=>({...d,context:I,refs:E,elements:w}),[d,E,w,I])}const bn="active",xn="selected";function xt(e,t,n){const o=new Map,i=n==="item";let r=e;if(i&&e){const{[bn]:l,[xn]: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,m]=a;if(!(i&&[bn,xn].includes(c)))if(c.indexOf("on")===0){if(o.has(c)||o.set(c,[]),typeof m=="function"){var d;(d=o.get(c))==null||d.push(m),l[c]=function(){for(var g,f=arguments.length,b=new Array(f),h=0;h<f;h++)b[h]=arguments[h];return(g=o.get(c))==null?void 0:g.map(y=>y(...b)).find(y=>y!==void 0)}}}else l[c]=m}),l),{})}}function yo(e){e===void 0&&(e=[]);const t=e,n=T.useCallback(r=>xt(r,e,"reference"),t),o=T.useCallback(r=>xt(r,e,"floating"),t),i=T.useCallback(r=>xt(r,e,"item"),e.map(r=>r==null?void 0:r.item));return T.useMemo(()=>({getReferenceProps:n,getFloatingProps:o,getItemProps:i}),[n,o,i])}function ul(e={}){const{initialOpen:t=!1,open:n,onOpenChange:o}=e,[i,r]=T.useState(t),l=n??i,s=o??r,a=xo({open:l,onOpenChange:s}),c=a.context,m=go(c,{enabled:n==null}),d=bo(c,{outsidePressEvent:"mousedown"}),g=yo([m,d]);return T.useMemo(()=>({open:l,setOpen:s,...g,...a}),[l,s,g,a])}const Co=T.createContext(null),vo=()=>{const e=T.useContext(Co);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function dl({children:e,...t}){const n=ul(t);return u.jsx(Co.Provider,{value:n,children:e})}const wo=k.css`
173
173
  display: flex;
174
174
  justify-content: center;
175
175
  align-items: center;
@@ -182,7 +182,7 @@
182
182
  overflow: hidden;
183
183
  white-space: nowrap;
184
184
  text-overflow: ellipsis;
185
- `;function To(e){const{explainQuestion:t}=me();if(!t)return u.jsx("div",{...e,children:"Conflict"});const n=N.match(t).returnType().with({subject:f.ExplainQuestionSubject.configuration},()=>"Configuration").with({subject:f.ExplainQuestionSubject.attribute},i=>i.attributeId.localId).with({subject:f.ExplainQuestionSubject.choiceValue},i=>i.choiceValueId).with({subject:f.ExplainQuestionSubject.component},i=>i.state.toString()).with({subject:f.ExplainQuestionSubject.boolean},i=>i.state.toString()).with({subject:f.ExplainQuestionSubject.numeric},i=>i.state.toString()).exhaustive(),o=N.match(t).returnType().with({question:f.ExplainQuestionType.whyIsStateNotPossible},()=>"is blocked").with({question:f.ExplainQuestionType.whyIsNotSatisfied},()=>"is not satisfied").exhaustive();return u.jsxs("div",{...e,children:[u.jsx(bl,{children:n})," ",o]})}const xl=k.div`
185
+ `;function To(e){const{explainQuestion:t}=me();if(!t)return u.jsx("div",{...e,children:"Conflict"});const n=N.match(t).returnType().with({subject:p.ExplainQuestionSubject.configuration},()=>"Configuration").with({subject:p.ExplainQuestionSubject.attribute},i=>i.attributeId.localId).with({subject:p.ExplainQuestionSubject.choiceValue},i=>i.choiceValueId).with({subject:p.ExplainQuestionSubject.component},i=>i.state.toString()).with({subject:p.ExplainQuestionSubject.boolean},i=>i.state.toString()).with({subject:p.ExplainQuestionSubject.numeric},i=>i.state.toString()).exhaustive(),o=N.match(t).returnType().with({question:p.ExplainQuestionType.whyIsStateNotPossible},()=>"is blocked").with({question:p.ExplainQuestionType.whyIsNotSatisfied},()=>"is not satisfied").exhaustive();return u.jsxs("div",{...e,children:[u.jsx(bl,{children:n})," ",o]})}const xl=k.div`
186
186
  position: sticky;
187
187
  top: 0;
188
188
  transition: all 0.1s;
@@ -275,7 +275,7 @@
275
275
  }
276
276
  `;function Rl(e){const t=me(),n=(t==null?void 0:t.displayMode)==="dialog";return u.jsx(dl,{open:n,onOpenChange:o=>!o&&n&&(t==null?void 0:t.dismiss()),children:u.jsx(Pl,{...e,isOpen:n,children:A.Children.toArray(e.content)[0]??u.jsx(Al,{children:u.jsx(Fi,{})})})})}function Pl(e){return u.jsx(x.AnimatePresence,{initial:!1,children:e.isOpen&&u.jsx(Il,{...e,components:{Overlay:kl},children:u.jsx(So,{children:e.children})})})}const Dl=k(x.motion(mo))`
277
277
  ${wo}
278
- `;function kl(e){return u.jsx(Dl,{...e,initial:{backgroundColor:"rgba(0,0,0,0)"},animate:{backgroundColor:"rgba(0,0,0,0.1)"},exit:{backgroundColor:"rgba(0,0,0,0)"}})}const jl={fill:{title:"Fill",type:x.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.7)"},color:{title:"Color",type:x.ControlType.Color,defaultValue:"#171717"},attributeValueFill:{title:"Attribute Value Fill",type:x.ControlType.Color,defaultValue:"#efefef"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:x.ControlType.Color,defaultValue:"#cfefc7"},attributeValueAddColor:{title:"Attribute Value Add Color",type:x.ControlType.Color,defaultValue:"#48c52b"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:x.ControlType.Color,defaultValue:"#ffdada"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:x.ControlType.Color,defaultValue:"#c52b2b"},headerValueColor:{title:"Header Value Color",type:x.ControlType.Color,defaultValue:"#00a1e6"},closeButtonOutline:{title:"Close Button Outline",type:x.ControlType.Color,defaultValue:"#00a1e6"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:x.ControlType.Color,defaultValue:"#F2F2F2"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:x.ControlType.Color,defaultValue:"#171717"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:x.ControlType.Color,defaultValue:"#00a1e6"},explanationCard:{title:"Explanation Card",type:x.ControlType.Color,defaultValue:"white"},scrollShadowBorder:{title:"Scroll Shadow Border",type:x.ControlType.Color,defaultValue:"rgba(0, 0, 0, 0.3)"},backdropFilter:{title:"Backdrop Filter",type:x.ControlType.String,defaultValue:"blur(10px) saturate(200%)"}},Vl={fill:{title:"Fill",type:x.ControlType.Color,defaultValue:"#002134"},color:{title:"Color",type:x.ControlType.Color,defaultValue:"white"},attributeValueFill:{title:"Attribute Value Fill",type:x.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.2)"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:x.ControlType.Color,defaultValue:"rgba(47, 255, 0, 0.2)"},attributeValueAddColor:{title:"Attribute Value Add Color",type:x.ControlType.Color,defaultValue:"#63e446"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:x.ControlType.Color,defaultValue:"#ff00004a"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:x.ControlType.Color,defaultValue:"#ff6060"},headerValueColor:{title:"Header Value Color",type:x.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},closeButtonOutline:{title:"Close Button Outline",type:x.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},listSeparator:{title:"List Separator",type:x.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.3)"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:x.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:x.ControlType.Color,defaultValue:"white"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:x.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},showMoreButtonOutline:{title:"Show More Button Outline",type:x.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"}},Eo=A.createContext(null);function Ol(e){const[t,n]=A.useState(null),{explain:o,applySolution:i}=X.useExplain(),r=A.useRef(null),l=A.useCallback(async(p,b,h,y)=>{const C=Zo.guid();r.current=C,n(null);try{const v=await p(),R=v,S=v,E=(R==null?void 0:R.decisionExplanations)??[],w=(S==null?void 0:S.constraintExplanations)??[];C==r.current&&n({controlId:y,displayMode:E.length===0&&w.length>0?"dialog":h,explainQuestion:b,hasError:!1,decisionExplanations:Fl(E),constraintExplanations:w})}catch{C==r.current&&n({controlId:y,displayMode:h,explainQuestion:b,hasError:!0,decisionExplanations:null,constraintExplanations:null})}},[]),s=A.useCallback((p,b,h)=>{const y=typeof p=="function"?p(f.explainQuestionBuilder):p;return l(()=>e.explainConstraints?o(y,"full"):o(y,"decisions"),y,b,h)},[e.explainConstraints,o,l]),a=A.useCallback((p,b,h)=>l(()=>Promise.resolve(p),null,b,h),[l]),c=A.useCallback(()=>{n(null)},[]),m=A.useCallback(async p=>{await i(p),c()},[i,c]),d=A.useCallback(p=>{n(b=>b!=null?{...b,displayMode:p}:b)},[]),g=A.useMemo(()=>({process:t,applySolution:m,explain:s,handleExplainAnswer:a,dismiss:c,switchMode:d}),[t,m,s,a,c,d]);return u.jsx(Me.Provider,{value:g,children:e.children})}function Fl(e){const t=_.pipe(_.Bool.Ord,_.Ord.contramap(o=>o.solution==null)),n=_.pipe(_.Num.Ord,_.Ord.contramap(o=>o.causedByDecisions.length));return _.pipe(e,_.RA.sortBy([t,n]))}const Oe=new Map;function lt(e){const{singletonId:t,children:n}=e,[o,i]=A.useState(!1),r=A.useRef({chose:()=>i(!0)});return A.useEffect(()=>(Bl(t,r.current),()=>Ll(t,r.current)),[]),o?u.jsx(u.Fragment,{children:n}):null}function Bl(e,t){Ml(e).candidates.add(t),Ao(e)}function Ll(e,t){let n=Oe.get(e);n!=null&&(n.candidates.delete(t),n.chosen===t&&(n.chosen=null),Nl(e),Ao(e))}function Ao(e){let t=Oe.get(e);if(t==null||t.chosen!=null)return;const n=t.candidates.values().next().value;n!=null&&(t.chosen=n,n.chose())}function Nl(e){let t=Oe.get(e);t==null||t.candidates.size>0||Oe.delete(e)}function Ml(e){let t=Oe.get(e);return t==null&&(t={chosen:null,candidates:new Set},Oe.set(e,t)),t}const Io=Te(e=>{const{hcaBaseUrl:t,sessionCreation:n,accessToken:o,sessionCreateUrl:i,sessionDeleteUrl:r,deploymentName:l,channel:s,children:a,explainDialogProps:c,explainPopoverProps:m,explainConstraints:d,attributeRelations:g}=e;if(Z())return u.jsxs(u.Fragment,{children:[a,u.jsx(lt,{singletonId:"Configuration",children:u.jsx(Ht,{})})]});const b=A.useMemo(()=>f.createClient({hcaEngineBaseUrl:si(t,"api","engine"),sessionHandler:N.match(n).with("client-side",()=>({accessToken:o})).with("server-side",()=>({sessionCreateUrl:i,sessionDeleteUrl:r})).exhaustive()}),[t,n,o,i,r]),h=_.pipe(_.O.fromNullable(g==null?void 0:g.jsonDefinition),_.O.filter(y=>y.length>0),_.O.map(y=>JSON.parse(y)),_.O.toNullable);return u.jsxs(u.Fragment,{children:[u.jsxs(X.Configuration,{configuratorClient:b,configurationModelSource:{type:f.ConfigurationModelSourceType.Channel,channel:s,deploymentName:l},attributeRelations:h,allowedInExplain:{rules:{type:f.AllowedRulesInExplainType.all}},children:[u.jsx(ai,{...e}),u.jsx(A.Suspense,{children:u.jsx(X.ConfigurationSuspender,{children:u.jsxs(Ol,{explainConstraints:d,children:[u.jsx(Eo.Provider,{value:m,children:a}),u.jsx(Rl,{...c})]})})})]}),u.jsx(lt,{singletonId:"Configuration",children:u.jsx(Ht,{})})]})}),$l=Io;x.addPropertyControls(Io,{children:{title:"Content",type:x.ControlType.ComponentInstance},channel:{type:x.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:x.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:x.ControlType.String,defaultValue:"https://spc.cloud.ceventis.de/hca"},sessionCreation:{title:"Session Creation",type:x.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:x.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:x.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:x.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:x.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:x.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:x.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:x.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:x.ControlType.Object,optional:!1,controls:jl,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:x.ControlType.Object,optional:!1,controls:Vl,buttonTitle:"Props…"},explainConstraints:{title:"Explain Constraints",type:x.ControlType.Boolean,defaultValue:!1},attributeRelations:{title:"Attribute Relations",type:x.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:x.ControlType.String,displayTextArea:!0}}}});const he={attributeId:{title:"Attribute Id",type:x.ControlType.String},componentPath:{title:"Component Path",type:x.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:x.ControlType.String}},Ro={padding:{type:x.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}},Kl=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}),Wl={radius:{title:"Radius",type:x.ControlType.Number,defaultValue:6},...Ro,border:{title:"Border",type:x.ControlType.Object,controls:{color:{type:x.ControlType.Color,title:"Color"},width:{type:x.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}}}},zl=e=>{var t,n,o,i,r,l,s,a,c,m,d,g,p;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:(m=e.border)==null?void 0:m.width,borderLeftWidth:(d=e.border)!=null&&d.isMixedWidth?(g=e.border)==null?void 0:g.widthLeft:(p=e.border)==null?void 0:p.width}},ql={fill:{title:"Fill",type:x.ControlType.Color,defaultValue:"#EBEBEB"},...Ro,...Wl},Hl=e=>({...Kl(e),...zl(e),backgroundColor:e.fill}),_l={color:{title:"Color",type:x.ControlType.Color,defaultValue:"black"},fontSize:{title:"Font size",type:x.ControlType.Number,defaultValue:16}},Ul=e=>({color:e.color,fontSize:e.fontSize}),He={explain:{title:"Explain",type:x.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},kt={type:x.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:x.ControlType.Color,optional:!0},color:{title:"Color",type:x.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:x.ControlType.Color,optional:!0}}},Po={...he,..._l,...ql,implicitLabelPrefix:{title:"Implicit Label Prefix",type:x.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...kt,title:"Unsatisfied Colors"},implicitSelectedColors:{...kt,title:"Implicit Selected Colors"},...He},jt=(e,t,n)=>{var r,l,s,a,c,m;const o=Hl(e),i=Ul(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)},d=>d.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:N.P.string.minLength(1)},d=>d.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)},d=>d.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:N.P.string.minLength(1)},d=>d.implicitSelectedBorderColor).otherwise(()=>o.borderColor),color:N.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedColor:(c=e.unsatisfiedColors)==null?void 0:c.color,implicitSelectedColor:(m=e.implicitSelectedColors)==null?void 0:m.color}).with({isSatisfied:!1,unsatisfiedColor:N.P.string.minLength(1)},d=>d.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:N.P.string.minLength(1)},d=>d.implicitSelectedColor).otherwise(()=>i.color),...e.style}},zt={...Po,resetLabel:{title:"Reset Label",type:x.ControlType.String,defaultValue:"Reset"}},Fe=(e,t,n)=>jt(e,t,n);function le(e){var t;return{localId:e.attributeId,componentPath:e.componentPath===""?[]:((t=e.componentPath)==null?void 0:t.split(" -> "))??[],sharedConfigurationModelId:e.sharedConfigurationModel===""?null:e.sharedConfigurationModel}}function ge(){const{explain:e,handleExplainAnswer:t}=A.useContext(Me);return{explain:e,handleExplainAnswer:t}}function Ql(e={}){const{initialOpen:t=!1,placement:n="top",modal:o=!1,open:i,onOpenChange:r,arrow:l}=e,[s,a]=A.useState(t),c=i??s,m=r??a,d=xo({placement:n,open:c,onOpenChange:m,whileElementsMounted:yr,middleware:[nr(((l==null?void 0:l.height)??0)+5),vr({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),Cr({padding:5}),...l?[Sr(l)]:[]]}),g=d.context,p=go(g,{enabled:i==null}),b=bo(g),h=yo([p,b]);return A.useMemo(()=>({open:c,setOpen:m,...h,...d,modal:o,arrow:l}),[c,m,h,d,o,l])}const Do=A.createContext(null),_e=()=>{const e=A.useContext(Do);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function Xl({children:e,...t}){const n=Ql(t);return u.jsx(Do.Provider,{value:n,children:e})}const Yl=A.forwardRef(function(t,n){const o=A.Children.toArray(t.children)[0],i=_e(),r=t.children.ref,l=Mt([i.refs.setReference,n,r]);return A.isValidElement(o)?A.cloneElement(o,i.getReferenceProps({ref:l,...t,...o.props,"data-state":i.open?"open":"closed"})):u.jsx("span",{children:"Not valid children for PopoverTrigger"})}),Gl=Yl,Jl=k.div`
278
+ `;function kl(e){return u.jsx(Dl,{...e,initial:{backgroundColor:"rgba(0,0,0,0)"},animate:{backgroundColor:"rgba(0,0,0,0.1)"},exit:{backgroundColor:"rgba(0,0,0,0)"}})}const jl={fill:{title:"Fill",type:x.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.7)"},color:{title:"Color",type:x.ControlType.Color,defaultValue:"#171717"},attributeValueFill:{title:"Attribute Value Fill",type:x.ControlType.Color,defaultValue:"#efefef"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:x.ControlType.Color,defaultValue:"#cfefc7"},attributeValueAddColor:{title:"Attribute Value Add Color",type:x.ControlType.Color,defaultValue:"#48c52b"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:x.ControlType.Color,defaultValue:"#ffdada"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:x.ControlType.Color,defaultValue:"#c52b2b"},headerValueColor:{title:"Header Value Color",type:x.ControlType.Color,defaultValue:"#00a1e6"},closeButtonOutline:{title:"Close Button Outline",type:x.ControlType.Color,defaultValue:"#00a1e6"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:x.ControlType.Color,defaultValue:"#F2F2F2"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:x.ControlType.Color,defaultValue:"#171717"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:x.ControlType.Color,defaultValue:"#00a1e6"},explanationCard:{title:"Explanation Card",type:x.ControlType.Color,defaultValue:"white"},scrollShadowBorder:{title:"Scroll Shadow Border",type:x.ControlType.Color,defaultValue:"rgba(0, 0, 0, 0.3)"},backdropFilter:{title:"Backdrop Filter",type:x.ControlType.String,defaultValue:"blur(10px) saturate(200%)"}},Vl={fill:{title:"Fill",type:x.ControlType.Color,defaultValue:"#002134"},color:{title:"Color",type:x.ControlType.Color,defaultValue:"white"},attributeValueFill:{title:"Attribute Value Fill",type:x.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.2)"},attributeValueAddFill:{title:"Attribute Value Add Fill",type:x.ControlType.Color,defaultValue:"rgba(47, 255, 0, 0.2)"},attributeValueAddColor:{title:"Attribute Value Add Color",type:x.ControlType.Color,defaultValue:"#63e446"},attributeValueRemoveFill:{title:"Attribute Value Remove Fill",type:x.ControlType.Color,defaultValue:"#ff00004a"},attributeValueRemoveColor:{title:"Attribute Value Remove Color",type:x.ControlType.Color,defaultValue:"#ff6060"},headerValueColor:{title:"Header Value Color",type:x.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},closeButtonOutline:{title:"Close Button Outline",type:x.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},listSeparator:{title:"List Separator",type:x.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.3)"},applySolutionButtonFill:{title:"Apply Solution Button Fill",type:x.ControlType.Color,defaultValue:"rgb(0, 161, 230)"},applySolutionButtonColor:{title:"Apply Solution Button Color",type:x.ControlType.Color,defaultValue:"white"},applySolutionButtonOutline:{title:"Apply Solution Button Outline",type:x.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"},showMoreButtonOutline:{title:"Show More Button Outline",type:x.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.8)"}},Eo=A.createContext(null);function Ol(e){const[t,n]=A.useState(null),{explain:o,applySolution:i}=X.useExplain(),r=A.useRef(null),l=A.useCallback(async(f,b,h,y)=>{const C=Zo.guid();r.current=C,n(null);try{const v=await f(),R=v,S=v,E=(R==null?void 0:R.decisionExplanations)??[],w=(S==null?void 0:S.constraintExplanations)??[];C==r.current&&n({controlId:y,displayMode:E.length===0&&w.length>0?"dialog":h,explainQuestion:b,hasError:!1,decisionExplanations:Fl(E),constraintExplanations:w})}catch{C==r.current&&n({controlId:y,displayMode:h,explainQuestion:b,hasError:!0,decisionExplanations:null,constraintExplanations:null})}},[]),s=A.useCallback((f,b,h)=>{const y=typeof f=="function"?f(p.explainQuestionBuilder):f;return l(()=>e.explainConstraints?o(y,"full"):o(y,"decisions"),y,b,h)},[e.explainConstraints,o,l]),a=A.useCallback((f,b,h)=>l(()=>Promise.resolve(f),null,b,h),[l]),c=A.useCallback(()=>{n(null)},[]),m=A.useCallback(async f=>{await i(f),c()},[i,c]),d=A.useCallback(f=>{n(b=>b!=null?{...b,displayMode:f}:b)},[]),g=A.useMemo(()=>({process:t,applySolution:m,explain:s,handleExplainAnswer:a,dismiss:c,switchMode:d}),[t,m,s,a,c,d]);return u.jsx(Me.Provider,{value:g,children:e.children})}function Fl(e){const t=_.pipe(_.Bool.Ord,_.Ord.contramap(o=>o.solution==null)),n=_.pipe(_.Num.Ord,_.Ord.contramap(o=>o.causedByDecisions.length));return _.pipe(e,_.RA.sortBy([t,n]))}const Oe=new Map;function lt(e){const{singletonId:t,children:n}=e,[o,i]=A.useState(!1),r=A.useRef({chose:()=>i(!0)});return A.useEffect(()=>(Bl(t,r.current),()=>Ll(t,r.current)),[]),o?u.jsx(u.Fragment,{children:n}):null}function Bl(e,t){Ml(e).candidates.add(t),Ao(e)}function Ll(e,t){let n=Oe.get(e);n!=null&&(n.candidates.delete(t),n.chosen===t&&(n.chosen=null),Nl(e),Ao(e))}function Ao(e){let t=Oe.get(e);if(t==null||t.chosen!=null)return;const n=t.candidates.values().next().value;n!=null&&(t.chosen=n,n.chose())}function Nl(e){let t=Oe.get(e);t==null||t.candidates.size>0||Oe.delete(e)}function Ml(e){let t=Oe.get(e);return t==null&&(t={chosen:null,candidates:new Set},Oe.set(e,t)),t}const Io=Te(e=>{const{hcaBaseUrl:t,sessionCreation:n,accessToken:o,sessionCreateUrl:i,sessionDeleteUrl:r,deploymentName:l,channel:s,children:a,explainDialogProps:c,explainPopoverProps:m,explainConstraints:d,attributeRelations:g}=e;if(Z())return u.jsxs(u.Fragment,{children:[a,u.jsx(lt,{singletonId:"Configuration",children:u.jsx(Ht,{})})]});const b=A.useMemo(()=>p.createClient({hcaEngineBaseUrl:si(t,"api","engine"),sessionHandler:N.match(n).with("client-side",()=>({accessToken:o})).with("server-side",()=>({sessionCreateUrl:i,sessionDeleteUrl:r})).exhaustive()}),[t,n,o,i,r]),h=_.pipe(_.O.fromNullable(g==null?void 0:g.jsonDefinition),_.O.filter(y=>y.length>0),_.O.map(y=>JSON.parse(y)),_.O.toNullable);return u.jsxs(u.Fragment,{children:[u.jsxs(X.Configuration,{configuratorClient:b,configurationModelSource:{type:p.ConfigurationModelSourceType.Channel,channel:s,deploymentName:l},attributeRelations:h,allowedInExplain:{rules:{type:p.AllowedRulesInExplainType.all}},children:[u.jsx(ai,{...e}),u.jsx(A.Suspense,{children:u.jsx(X.ConfigurationSuspender,{children:u.jsxs(Ol,{explainConstraints:d,children:[u.jsx(Eo.Provider,{value:m,children:a}),u.jsx(Rl,{...c})]})})})]}),u.jsx(lt,{singletonId:"Configuration",children:u.jsx(Ht,{})})]})}),$l=Io;x.addPropertyControls(Io,{children:{title:"Content",type:x.ControlType.ComponentInstance},channel:{type:x.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:x.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:x.ControlType.String,defaultValue:"https://spc.cloud.ceventis.de/hca"},sessionCreation:{title:"Session Creation",type:x.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:x.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:x.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:x.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:x.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:x.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:x.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:x.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:x.ControlType.Object,optional:!1,controls:jl,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:x.ControlType.Object,optional:!1,controls:Vl,buttonTitle:"Props…"},explainConstraints:{title:"Explain Constraints",type:x.ControlType.Boolean,defaultValue:!1},attributeRelations:{title:"Attribute Relations",type:x.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:x.ControlType.String,displayTextArea:!0}}}});const he={attributeId:{title:"Attribute Id",type:x.ControlType.String},componentPath:{title:"Component Path",type:x.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:x.ControlType.String}},Ro={padding:{type:x.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}},Kl=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}),Wl={radius:{title:"Radius",type:x.ControlType.Number,defaultValue:6},...Ro,border:{title:"Border",type:x.ControlType.Object,controls:{color:{type:x.ControlType.Color,title:"Color"},width:{type:x.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}}}},zl=e=>{var t,n,o,i,r,l,s,a,c,m,d,g,f;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:(m=e.border)==null?void 0:m.width,borderLeftWidth:(d=e.border)!=null&&d.isMixedWidth?(g=e.border)==null?void 0:g.widthLeft:(f=e.border)==null?void 0:f.width}},ql={fill:{title:"Fill",type:x.ControlType.Color,defaultValue:"#EBEBEB"},...Ro,...Wl},Hl=e=>({...Kl(e),...zl(e),backgroundColor:e.fill}),_l={color:{title:"Color",type:x.ControlType.Color,defaultValue:"black"},fontSize:{title:"Font size",type:x.ControlType.Number,defaultValue:16}},Ul=e=>({color:e.color,fontSize:e.fontSize}),He={explain:{title:"Explain",type:x.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},kt={type:x.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:x.ControlType.Color,optional:!0},color:{title:"Color",type:x.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:x.ControlType.Color,optional:!0}}},Po={...he,..._l,...ql,implicitLabelPrefix:{title:"Implicit Label Prefix",type:x.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...kt,title:"Unsatisfied Colors"},implicitSelectedColors:{...kt,title:"Implicit Selected Colors"},...He},jt=(e,t,n)=>{var r,l,s,a,c,m;const o=Hl(e),i=Ul(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)},d=>d.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:N.P.string.minLength(1)},d=>d.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)},d=>d.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:N.P.string.minLength(1)},d=>d.implicitSelectedBorderColor).otherwise(()=>o.borderColor),color:N.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedColor:(c=e.unsatisfiedColors)==null?void 0:c.color,implicitSelectedColor:(m=e.implicitSelectedColors)==null?void 0:m.color}).with({isSatisfied:!1,unsatisfiedColor:N.P.string.minLength(1)},d=>d.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:N.P.string.minLength(1)},d=>d.implicitSelectedColor).otherwise(()=>i.color),...e.style}},zt={...Po,resetLabel:{title:"Reset Label",type:x.ControlType.String,defaultValue:"Reset"}},Fe=(e,t,n)=>jt(e,t,n);function le(e){var t;return{localId:e.attributeId,componentPath:e.componentPath===""?[]:((t=e.componentPath)==null?void 0:t.split(" -> "))??[],sharedConfigurationModelId:e.sharedConfigurationModel===""?null:e.sharedConfigurationModel}}function ge(){const{explain:e,handleExplainAnswer:t}=A.useContext(Me);return{explain:e,handleExplainAnswer:t}}function Ql(e={}){const{initialOpen:t=!1,placement:n="top",modal:o=!1,open:i,onOpenChange:r,arrow:l}=e,[s,a]=A.useState(t),c=i??s,m=r??a,d=xo({placement:n,open:c,onOpenChange:m,whileElementsMounted:yr,middleware:[nr(((l==null?void 0:l.height)??0)+5),vr({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),Cr({padding:5}),...l?[Sr(l)]:[]]}),g=d.context,f=go(g,{enabled:i==null}),b=bo(g),h=yo([f,b]);return A.useMemo(()=>({open:c,setOpen:m,...h,...d,modal:o,arrow:l}),[c,m,h,d,o,l])}const Do=A.createContext(null),_e=()=>{const e=A.useContext(Do);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function Xl({children:e,...t}){const n=Ql(t);return u.jsx(Do.Provider,{value:n,children:e})}const Yl=A.forwardRef(function(t,n){const o=A.Children.toArray(t.children)[0],i=_e(),r=t.children.ref,l=Mt([i.refs.setReference,n,r]);return A.isValidElement(o)?A.cloneElement(o,i.getReferenceProps({ref:l,...t,...o.props,"data-state":i.open?"open":"closed"})):u.jsx("span",{children:"Not valid children for PopoverTrigger"})}),Gl=Yl,Jl=k.div`
279
279
  display: flex;
280
280
  justify-content: center;
281
281
 
@@ -412,17 +412,17 @@
412
412
  }
413
413
  `,ms=k(Qr)`
414
414
  fill: var(--color-explain-popover-fill);
415
- `,gs={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 bs(e){const t=me(),n=ae(),o=(t==null?void 0:t.displayMode)==="popover"&&(t==null?void 0:t.controlId)===n,i=A.useRef(null);return u.jsxs(Xl,{open:o,onOpenChange:r=>!r&&o&&(t==null?void 0:t.dismiss()),arrow:{width:20,height:10,padding:10,element:i},children:[u.jsx(Gl,{children:e.children}),u.jsxs(xs,{isOpen:o,children:[A.Children.toArray(e.content)[0]??u.jsx(ps,{children:u.jsx(rs,{})}),u.jsx(ys,{})]})]})}function xs(e){var g,p;const t=A.useContext(Eo),{middlewareData:n,arrow:o,placement:i}=_e(),r=((g=n.arrow)==null?void 0:g.x)??0,l=((p=n.arrow)==null?void 0:p.y)??0,s=(o==null?void 0:o.height)??0,a=(o==null?void 0:o.width)??0,c=r+a/2,m=l+s,d=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) ${m}px`).with("right",()=>`${-s}px ${m}px`).otherwise(()=>"");return u.jsx(x.AnimatePresence,{initial:!1,children:e.isOpen&&u.jsx(hs,{...t,children:u.jsx(x.motion.div,{variants:gs,initial:"initial",animate:"open",exit:"close",style:{transformOrigin:d},children:u.jsx(So,{children:e.children})})})})}function ys(){const{context:e,arrow:t}=_e();return u.jsx(ms,{ref:t.element,context:e,width:t.width,height:t.height})}function Cs(e){return A.forwardRef((t,n)=>{const o=Z();return t.explain!=="popover"||o?u.jsx(e,{...t}):u.jsx(bs,{children:u.jsx(e,{...t,ref:n})})})}function be(e){return Te(jo(Cs(A.forwardRef(e))))}function se(){alert(`Failed to apply your selection.
415
+ `,gs={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 bs(e){const t=me(),n=ae(),o=(t==null?void 0:t.displayMode)==="popover"&&(t==null?void 0:t.controlId)===n,i=A.useRef(null);return u.jsxs(Xl,{open:o,onOpenChange:r=>!r&&o&&(t==null?void 0:t.dismiss()),arrow:{width:20,height:10,padding:10,element:i},children:[u.jsx(Gl,{children:e.children}),u.jsxs(xs,{isOpen:o,children:[A.Children.toArray(e.content)[0]??u.jsx(ps,{children:u.jsx(rs,{})}),u.jsx(ys,{})]})]})}function xs(e){var g,f;const t=A.useContext(Eo),{middlewareData:n,arrow:o,placement:i}=_e(),r=((g=n.arrow)==null?void 0:g.x)??0,l=((f=n.arrow)==null?void 0:f.y)??0,s=(o==null?void 0:o.height)??0,a=(o==null?void 0:o.width)??0,c=r+a/2,m=l+s,d=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) ${m}px`).with("right",()=>`${-s}px ${m}px`).otherwise(()=>"");return u.jsx(x.AnimatePresence,{initial:!1,children:e.isOpen&&u.jsx(hs,{...t,children:u.jsx(x.motion.div,{variants:gs,initial:"initial",animate:"open",exit:"close",style:{transformOrigin:d},children:u.jsx(So,{children:e.children})})})})}function ys(){const{context:e,arrow:t}=_e();return u.jsx(ms,{ref:t.element,context:e,width:t.width,height:t.height})}function Cs(e){return A.forwardRef((t,n)=>{const o=Z();return t.explain!=="popover"||o?u.jsx(e,{...t}):u.jsx(bs,{children:u.jsx(e,{...t,ref:n})})})}function be(e){return Te(jo(Cs(A.forwardRef(e))))}function se(){alert(`Failed to apply your selection.
416
416
  Please check your internet connection and try again.`)}function vs(){alert(`Failed to reset your configuration.
417
417
  Please check your internet connection and try again.`)}const Cn=k.select`
418
418
  color: inherit;
419
- `,vn="<reset>",wn="<nothing>",Vo=be((e,t)=>{if(Z()){const w=Fe(e,!0,!1);return u.jsx(Cn,{style:w})}const o=ae(),i=le(e),r=X.useChoiceAttribute(i),{explain:l}=ge();if(!r)return u.jsx("span",{children:"Choice Attribute not found"});const{attribute:s,makeDecision:a,clearDecisions:c}=r,m=f.AttributeInterpreter.getAllowedChoiceValues(s),d=f.AttributeInterpreter.getBlockedChoiceValues(s),g=f.AttributeInterpreter.isMultiSelect(s),p=f.AttributeInterpreter.getSelectedChoiceValues(s),b=p.map(w=>w.id),h=b[0]??wn,y=p.some(w=>{var I;return((I=w.decision)==null?void 0:I.kind)===f.DecisionKind.Explicit}),C=b.length>=1,v=p.some(w=>{var I;return((I=w.decision)==null?void 0:I.kind)===f.DecisionKind.Implicit}),R=m.length===0,S=async w=>{if(w===vn)try{await c()}catch{se()}else if(m.some(I=>I.id===w)){const I=b.some(P=>P===w)?void 0:f.ChoiceValueDecisionState.Included;try{await a(w,I)}catch{se()}}else d.some(I=>I.id===w)&&e.explain!=="disabled"&&await l(I=>I.whyIsStateNotPossible.choice(s.id).choiceValue(w).state(f.ChoiceValueDecisionState.Included),e.explain,o)},E=Ts(e,s.isSatisfied,v,R);return u.jsxs(Cn,{ref:t,value:g?b:h,multiple:g,onChange:w=>S(w.currentTarget.value),style:E,children:[!C&&!g&&u.jsx("option",{value:wn}),y&&u.jsx("option",{value:vn,children:e.resetLabel}),m.map(w=>{var I;return u.jsxs("option",{value:w.id,children:[((I=w.decision)==null?void 0:I.kind)===f.DecisionKind.Implicit?e.implicitLabelPrefix:"",w.id]},w.id)}),d.length>0&&u.jsx("optgroup",{label:"Blocked",children:d.map(w=>u.jsx("option",{value:w.id,children:w.id},w.id))})]})}),ws=Vo,Ss={...zt,noOptionsAvailableColors:{...kt,title:"No Options Available Colors"}};x.addPropertyControls(Vo,Ss);const Ts=(e,t,n,o)=>{var r,l,s;const i=Fe(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)}},Sn=k.select`
419
+ `,vn="<reset>",wn="<nothing>",Vo=be((e,t)=>{if(Z()){const w=Fe(e,!0,!1);return u.jsx(Cn,{style:w})}const o=ae(),i=le(e),r=X.useChoiceAttribute(i),{explain:l}=ge();if(!r)return u.jsx("span",{children:"Choice Attribute not found"});const{attribute:s,makeDecision:a,clearDecisions:c}=r,m=p.AttributeInterpreter.getAllowedChoiceValues(s),d=p.AttributeInterpreter.getBlockedChoiceValues(s),g=p.AttributeInterpreter.isMultiSelect(s),f=p.AttributeInterpreter.getSelectedChoiceValues(s),b=f.map(w=>w.id),h=b[0]??wn,y=f.some(w=>{var I;return((I=w.decision)==null?void 0:I.kind)===p.DecisionKind.Explicit}),C=b.length>=1,v=f.some(w=>{var I;return((I=w.decision)==null?void 0:I.kind)===p.DecisionKind.Implicit}),R=m.length===0,S=async w=>{if(w===vn)try{await c()}catch{se()}else if(m.some(I=>I.id===w)){const I=b.some(P=>P===w)?void 0:p.ChoiceValueDecisionState.Included;try{await a(w,I)}catch{se()}}else d.some(I=>I.id===w)&&e.explain!=="disabled"&&await l(I=>I.whyIsStateNotPossible.choice(s.id).choiceValue(w).state(p.ChoiceValueDecisionState.Included),e.explain,o)},E=Ts(e,s.isSatisfied,v,R);return u.jsxs(Cn,{ref:t,value:g?b:h,multiple:g,onChange:w=>S(w.currentTarget.value),style:E,children:[!C&&!g&&u.jsx("option",{value:wn}),y&&u.jsx("option",{value:vn,children:e.resetLabel}),m.map(w=>{var I;return u.jsxs("option",{value:w.id,children:[((I=w.decision)==null?void 0:I.kind)===p.DecisionKind.Implicit?e.implicitLabelPrefix:"",w.id]},w.id)}),d.length>0&&u.jsx("optgroup",{label:"Blocked",children:d.map(w=>u.jsx("option",{value:w.id,children:w.id},w.id))})]})}),ws=Vo,Ss={...zt,noOptionsAvailableColors:{...kt,title:"No Options Available Colors"}};x.addPropertyControls(Vo,Ss);const Ts=(e,t,n,o)=>{var r,l,s;const i=Fe(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)}},Sn=k.select`
420
420
  color: inherit;
421
- `,Tn="<reset>",Ct="<nothing>",vt="yes",En="no",Oo=be((e,t)=>{var v,R,S;if(Z()){const E=Fe(e,!0,!1);return u.jsx(Sn,{style:E})}const o=ae(),i=le(e),r=X.useBooleanAttribute(i),{explain:l}=ge();if(!r)return u.jsx("span",{children:"Boolean Attribute not found"});const{attribute:s,makeDecision:a}=r,c=async E=>{const w=f.AttributeInterpreter.getBooleanDecision(s)!=null;if(E===Tn&&w)try{await a(void 0)}catch{se()}else{const I=E===vt;if(f.AttributeInterpreter.isBooleanValuePossible(s,I))try{await a(I)}catch{se()}else e.explain!=="disabled"&&await l(F=>F.whyIsStateNotPossible.boolean(s.id).state(I),e.explain,o)}},m=N.match((v=s.decision)==null?void 0:v.state).with(!0,()=>vt).with(!1,()=>En).otherwise(()=>Ct),d=((R=s.decision)==null?void 0:R.kind)===f.DecisionKind.Explicit,g=((S=s.decision)==null?void 0:S.kind)===f.DecisionKind.Implicit,p=Fe(e,s.isSatisfied,g),b=f.AttributeInterpreter.isBooleanValuePossible(s,!0),h=f.AttributeInterpreter.isBooleanValuePossible(s,!1),y=u.jsxs("option",{value:vt,children:[An(s,!0,e.implicitLabelPrefix),e.trueLabel]}),C=u.jsxs("option",{value:En,children:[An(s,!1,e.implicitLabelPrefix),e.falseLabel]});return u.jsxs(Sn,{ref:t,value:m,onChange:E=>c(E.currentTarget.value),style:p,children:[m===Ct&&u.jsx("option",{value:Ct}),d&&u.jsx("option",{value:Tn,children:e.resetLabel}),b&&y,h&&C,(!b||!h)&&u.jsxs("optgroup",{label:"Blocked",children:[!b&&y,!h&&C]})]})}),Es=Oo,An=(e,t,n)=>{var o,i;return((o=e.decision)==null?void 0:o.kind)===f.DecisionKind.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},As={...zt,trueLabel:{title:"True Label",type:x.ControlType.String,defaultValue:"Yes"},falseLabel:{title:"False Label",type:x.ControlType.String,defaultValue:"No"}};x.addPropertyControls(Oo,As);const In=k.select`
421
+ `,Tn="<reset>",Ct="<nothing>",vt="yes",En="no",Oo=be((e,t)=>{var v,R,S;if(Z()){const E=Fe(e,!0,!1);return u.jsx(Sn,{style:E})}const o=ae(),i=le(e),r=X.useBooleanAttribute(i),{explain:l}=ge();if(!r)return u.jsx("span",{children:"Boolean Attribute not found"});const{attribute:s,makeDecision:a}=r,c=async E=>{const w=p.AttributeInterpreter.getBooleanDecision(s)!=null;if(E===Tn&&w)try{await a(void 0)}catch{se()}else{const I=E===vt;if(p.AttributeInterpreter.isBooleanValuePossible(s,I))try{await a(I)}catch{se()}else e.explain!=="disabled"&&await l(F=>F.whyIsStateNotPossible.boolean(s.id).state(I),e.explain,o)}},m=N.match((v=s.decision)==null?void 0:v.state).with(!0,()=>vt).with(!1,()=>En).otherwise(()=>Ct),d=((R=s.decision)==null?void 0:R.kind)===p.DecisionKind.Explicit,g=((S=s.decision)==null?void 0:S.kind)===p.DecisionKind.Implicit,f=Fe(e,s.isSatisfied,g),b=p.AttributeInterpreter.isBooleanValuePossible(s,!0),h=p.AttributeInterpreter.isBooleanValuePossible(s,!1),y=u.jsxs("option",{value:vt,children:[An(s,!0,e.implicitLabelPrefix),e.trueLabel]}),C=u.jsxs("option",{value:En,children:[An(s,!1,e.implicitLabelPrefix),e.falseLabel]});return u.jsxs(Sn,{ref:t,value:m,onChange:E=>c(E.currentTarget.value),style:f,children:[m===Ct&&u.jsx("option",{value:Ct}),d&&u.jsx("option",{value:Tn,children:e.resetLabel}),b&&y,h&&C,(!b||!h)&&u.jsxs("optgroup",{label:"Blocked",children:[!b&&y,!h&&C]})]})}),Es=Oo,An=(e,t,n)=>{var o,i;return((o=e.decision)==null?void 0:o.kind)===p.DecisionKind.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},As={...zt,trueLabel:{title:"True Label",type:x.ControlType.String,defaultValue:"Yes"},falseLabel:{title:"False Label",type:x.ControlType.String,defaultValue:"No"}};x.addPropertyControls(Oo,As);const In=k.select`
422
422
  color: inherit;
423
- `,Rn="<reset>",wt="<nothing>",St="included",Tt="excluded",Fo=be((e,t)=>{var R,S,E;if(Z()){const w=Fe(e,!0,!1);return u.jsx(In,{style:w})}const o=ae(),i=le(e),r=X.useComponentAttribute(i),{explain:l}=ge();if(!r)return u.jsx("span",{children:"Component Attribute not found"});const{attribute:s,makeDecision:a}=r,c=async w=>{if(f.AttributeInterpreter.isComponentStatePossible(s,w))try{await a(w)}catch{se()}else e.explain!=="disabled"&&await l(P=>P.whyIsStateNotPossible.component(s.id).state(w),e.explain,o)},m=async w=>{var P;const I=((P=s.decision)==null?void 0:P.kind)===f.DecisionKind.Explicit;w===Rn&&I?await a(void 0):w===St?await c(f.ComponentDecisionState.Included):w===Tt&&await c(f.ComponentDecisionState.Excluded)},d=N.match((R=s.decision)==null?void 0:R.state).with(f.ComponentDecisionState.Included,()=>St).with(f.ComponentDecisionState.Excluded,()=>Tt).otherwise(()=>wt),g=((S=s.decision)==null?void 0:S.kind)===f.DecisionKind.Explicit,p=((E=s.decision)==null?void 0:E.kind)===f.DecisionKind.Implicit,b=Fe(e,s.isSatisfied,p),h=f.AttributeInterpreter.isComponentStatePossible(s,f.ComponentDecisionState.Included),y=f.AttributeInterpreter.isComponentStatePossible(s,f.ComponentDecisionState.Excluded),C=u.jsxs("option",{value:St,children:[Pn(s,f.ComponentDecisionState.Included,e.implicitLabelPrefix),e.includedLabel]}),v=u.jsxs("option",{value:Tt,children:[Pn(s,f.ComponentDecisionState.Excluded,e.implicitLabelPrefix),e.excludedLabel]});return u.jsxs(In,{ref:t,value:d,onChange:w=>m(w.currentTarget.value),style:b,children:[d===wt&&u.jsx("option",{value:wt}),g&&u.jsx("option",{value:Rn,children:e.resetLabel}),h&&C,y&&v,(!h||!y)&&u.jsxs("optgroup",{label:"Blocked",children:[!h&&C,!y&&v]})]})}),Is=Fo,Pn=(e,t,n)=>{var o,i;return((o=e.decision)==null?void 0:o.kind)===f.DecisionKind.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},Rs={...zt,includedLabel:{title:"Included Label",type:x.ControlType.String,defaultValue:"Included"},excludedLabel:{title:"Excluded Label",type:x.ControlType.String,defaultValue:"Excluded"}};x.addPropertyControls(Fo,Rs);function Bo(e,t,n,o,i=1e3){const[r]=ni.useForceUpdate(),l=ti.useDebouncedCallback(g=>{t(g),r()},i),s=A.useRef(n),a=A.useRef(e),c=l.isPending(),m=A.useRef(c);A.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!==m.current&&(m.current=c,!c&&e!==n&&o(e))},[e,n,l,c]);const d=A.useCallback(()=>{l.isPending()&&l.flush()},[l]);return A.useEffect(()=>()=>d(),[d]),{flush:d}}const Dn=k(ei)`
423
+ `,Rn="<reset>",wt="<nothing>",St="included",Tt="excluded",Fo=be((e,t)=>{var R,S,E;if(Z()){const w=Fe(e,!0,!1);return u.jsx(In,{style:w})}const o=ae(),i=le(e),r=X.useComponentAttribute(i),{explain:l}=ge();if(!r)return u.jsx("span",{children:"Component Attribute not found"});const{attribute:s,makeDecision:a}=r,c=async w=>{if(p.AttributeInterpreter.isComponentStatePossible(s,w))try{await a(w)}catch{se()}else e.explain!=="disabled"&&await l(P=>P.whyIsStateNotPossible.component(s.id).state(w),e.explain,o)},m=async w=>{var P;const I=((P=s.decision)==null?void 0:P.kind)===p.DecisionKind.Explicit;w===Rn&&I?await a(void 0):w===St?await c(p.ComponentDecisionState.Included):w===Tt&&await c(p.ComponentDecisionState.Excluded)},d=N.match((R=s.decision)==null?void 0:R.state).with(p.ComponentDecisionState.Included,()=>St).with(p.ComponentDecisionState.Excluded,()=>Tt).otherwise(()=>wt),g=((S=s.decision)==null?void 0:S.kind)===p.DecisionKind.Explicit,f=((E=s.decision)==null?void 0:E.kind)===p.DecisionKind.Implicit,b=Fe(e,s.isSatisfied,f),h=p.AttributeInterpreter.isComponentStatePossible(s,p.ComponentDecisionState.Included),y=p.AttributeInterpreter.isComponentStatePossible(s,p.ComponentDecisionState.Excluded),C=u.jsxs("option",{value:St,children:[Pn(s,p.ComponentDecisionState.Included,e.implicitLabelPrefix),e.includedLabel]}),v=u.jsxs("option",{value:Tt,children:[Pn(s,p.ComponentDecisionState.Excluded,e.implicitLabelPrefix),e.excludedLabel]});return u.jsxs(In,{ref:t,value:d,onChange:w=>m(w.currentTarget.value),style:b,children:[d===wt&&u.jsx("option",{value:wt}),g&&u.jsx("option",{value:Rn,children:e.resetLabel}),h&&C,y&&v,(!h||!y)&&u.jsxs("optgroup",{label:"Blocked",children:[!h&&C,!y&&v]})]})}),Is=Fo,Pn=(e,t,n)=>{var o,i;return((o=e.decision)==null?void 0:o.kind)===p.DecisionKind.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},Rs={...zt,includedLabel:{title:"Included Label",type:x.ControlType.String,defaultValue:"Included"},excludedLabel:{title:"Excluded Label",type:x.ControlType.String,defaultValue:"Excluded"}};x.addPropertyControls(Fo,Rs);function Bo(e,t,n,o,i=1e3){const[r]=ni.useForceUpdate(),l=ti.useDebouncedCallback(g=>{t(g),r()},i),s=A.useRef(n),a=A.useRef(e),c=l.isPending(),m=A.useRef(c);A.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!==m.current&&(m.current=c,!c&&e!==n&&o(e))},[e,n,l,c]);const d=A.useCallback(()=>{l.isPending()&&l.flush()},[l]);return A.useEffect(()=>()=>d(),[d]),{flush:d}}const Dn=k(ei)`
424
424
  color: inherit;
425
- `,Lo=be((e,t)=>{var v,R;if(Z()){const S=jt(e,!0,!1);return u.jsx(Dn,{style:S})}const o=ae(),i=le(e),r=X.useNumericAttribute(i),{explain:l}=ge();if(!r)return u.jsx("span",{children:"Numeric Attribute not found"});const{attribute:s,makeDecision:a}=r,c=((v=s.decision)==null?void 0:v.kind)===f.DecisionKind.Implicit,m=jt(e,s.isSatisfied,c),d=(R=s.decision)==null?void 0:R.state,[g,p]=A.useState(d),{min:b,max:h}=s.range,C=Bo(d,async S=>{if(S<b){alert(`The value must be smaller than or equal to ${b}.`);return}if(S>h){alert(`The value must be greater than or equal to ${h}.`);return}try{await a(S)}catch(E){const w=E;w.type===f.FailureType.ConfigurationModelNotFeasible||w.type===f.FailureType.ConfigurationConflict?e.explain!=="disabled"&&await l(P=>P.whyIsStateNotPossible.numeric(s.id).state(S),e.explain,o):se()}},g,S=>p(S),e.wait);return u.jsx(Dn,{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:Ds(s,e.implicitLabelPrefix),onBlur:()=>{C.flush()},onKeyPress:S=>{S.key==="Enter"&&C.flush()},onValueChange:S=>p(S.floatValue),value:g??"",style:m})}),Ps=Lo,Ds=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===f.DecisionKind.Implicit?t:""},ks={...Po,wait:{title:"Debounce Delay",type:x.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:x.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:x.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:x.ControlType.String,defaultValue:""}};x.addPropertyControls(Lo,ks);const ut={choiceValueId:{title:"Choice Value Id",type:x.ControlType.String}};function Ee(e,t){return A.Children.map(e,n=>{if(A.isValidElement(n)){const o=Vn(n.props,t);return A.cloneElement(n,o)}return n})}const No=be((e,t)=>{if(Z())return e.children;const o=ae(),{makeDecision:i}=X.useDecision(),r=le(e),l=e.choiceValueId??"",s=l.length>0,a=X.useAttributes([r])[0],{explain:c}=ge();if(!a)return u.jsx("span",{children:"Attribute not found"});const m=a.type===f.AttributeType.Choice,d=a.type===f.AttributeType.Numeric,g=a.type===f.AttributeType.Boolean,p=a.type===f.AttributeType.Component;if(!m&&s)return u.jsx("span",{children:"Attribute is not a Choice Attribute"});if(d)return u.jsx("span",{children:"Numeric Attribute is not supported"});let b=m?a.values.find(R=>R.id===l):null;if(s&&b==null)return u.jsx("span",{children:"Choice Value not found"});const h=R=>N.match({state:R,attribute:a}).with({attribute:{type:f.AttributeType.Choice},state:"undefined"},()=>b.decision==null).with({attribute:{type:f.AttributeType.Choice},state:"included"},()=>{var S,E;return((S=b.decision)==null?void 0:S.state)===f.ChoiceValueDecisionState.Included&&((E=b.decision)==null?void 0:E.kind)===f.DecisionKind.Explicit}).with({attribute:{type:f.AttributeType.Choice},state:"excluded"},()=>{var S,E;return((S=b.decision)==null?void 0:S.state)===f.ChoiceValueDecisionState.Excluded&&((E=b.decision)==null?void 0:E.kind)===f.DecisionKind.Explicit}).with({attribute:{type:f.AttributeType.Boolean},state:"undefined"},{attribute:{type:f.AttributeType.Component},state:"undefined"},({attribute:S})=>S.decision==null).with({attribute:{type:f.AttributeType.Boolean},state:"true"},({attribute:S})=>{var E,w;return((E=S.decision)==null?void 0:E.state)===!0&&((w=S.decision)==null?void 0:w.kind)===f.DecisionKind.Explicit}).with({attribute:{type:f.AttributeType.Boolean},state:"false"},({attribute:S})=>{var E,w;return((E=S.decision)==null?void 0:E.state)===!1&&((w=S.decision)==null?void 0:w.kind)===f.DecisionKind.Explicit}).with({attribute:{type:f.AttributeType.Component},state:"included"},({attribute:S})=>{var E,w;return((E=S.decision)==null?void 0:E.state)===f.ComponentDecisionState.Included&&((w=S.decision)==null?void 0:w.kind)===f.DecisionKind.Explicit}).with({attribute:{type:f.AttributeType.Component},state:"excluded"},({attribute:S})=>{var E,w;return((E=S.decision)==null?void 0:E.state)===f.ComponentDecisionState.Excluded&&((w=S.decision)==null?void 0:w.kind)===f.DecisionKind.Explicit}).otherwise(()=>!1),y=R=>N.match({isChoiceAttribute:m,isBooleanAttribute:g,isComponentAttribute:p,state:R}).with({isChoiceAttribute:!0,state:"included"},()=>f.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>f.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>f.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>f.ComponentDecisionState.Excluded).otherwise(()=>null);h(e.toggleFrom);const C=h(e.toggleTo),v=async()=>{const R=C?e.toggleFrom:e.toggleTo,S=y(R),E=p?f.AttributeInterpreter.isComponentStatePossible(a,S):!1,w=g?f.AttributeInterpreter.isBooleanValuePossible(a,S):!1;if((m?b.possibleDecisionStates.some(F=>F===S):!1)||w||E||S==null)try{await i({type:a.type,attributeId:r,choiceValueId:l,state:S})}catch{se()}else if(e.explain!=="disabled"){const F=N.match({isComponentAttribute:p,isBooleanAttribute:g,isChoiceAttribute:m}).returnType().with({isChoiceAttribute:!0},()=>f.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>f.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>f.ExplainQuestionSubject.component).otherwise(()=>null);F&&await c({question:f.ExplainQuestionType.whyIsStateNotPossible,subject:F,attributeId:r,choiceValueId:l,state:S},e.explain,o)}};return Ee(e.children,{onClick:v,ref:t})}),js=No,Vs={...he,...ut,children:{title:"Content",type:x.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:x.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:x.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...He};x.addPropertyControls(No,Vs);const Mo=be((e,t)=>{if(Z())return e.children;const o=ae(),{makeDecision:i}=X.useDecision(),r=le(e),l=e.choiceValueId??"",s=l.length>0,a=X.useAttributes([r])[0],c=X.useChoiceAttribute(r),{explain:m}=ge();if(!a)return u.jsx("span",{children:"Attribute not found"});const d=a.type===f.AttributeType.Choice,g=a.type===f.AttributeType.Numeric,p=a.type===f.AttributeType.Boolean,b=a.type===f.AttributeType.Component;if(!d&&s)return u.jsx("span",{children:"Attribute is not a Choice Attribute"});let h=d?a.values.find(v=>v.id===l):null;if(s&&h==null)return u.jsx("span",{children:"Choice Value not found"});const y=()=>N.match({isChoiceAttribute:d,isBooleanAttribute:p,isComponentAttribute:b,isNumericAttribute:g,hasChoiceValueId:s,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>f.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>f.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>f.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>f.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),C=async()=>{if(d&&!s&&e.setSelection==="undefined")try{await c.clearDecisions()}catch{se()}else{const v=y(),R=b?f.AttributeInterpreter.isComponentStatePossible(a,v):!1,S=p?f.AttributeInterpreter.isBooleanValuePossible(a,v):!1,w=(d?h.possibleDecisionStates.some(I=>I===v):!1)||S||R;if(g||w||v==null)try{await i({type:a.type,attributeId:r,choiceValueId:l,state:v})}catch(I){const P=I;g&&(P.type===f.FailureType.ConfigurationModelNotFeasible||P.type===f.FailureType.ConfigurationConflict)?e.explain!=="disabled"&&await m(j=>j.whyIsStateNotPossible.numeric(a.id).state(v),e.explain,o):se()}else if(e.explain!=="disabled"){const I=N.match({isComponentAttribute:b,isBooleanAttribute:p,isChoiceAttribute:d}).returnType().with({isChoiceAttribute:!0},()=>f.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>f.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>f.ExplainQuestionSubject.component).otherwise(()=>null);I&&await m({question:f.ExplainQuestionType.whyIsStateNotPossible,subject:I,attributeId:r,choiceValueId:l,state:v},e.explain,o)}}};return Ee(e.children,{onClick:C,ref:t})}),Os=Mo,Fs={...he,...ut,children:{title:"Content",type:x.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:x.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:x.ControlType.Number,defaultValue:0},...He};x.addPropertyControls(Mo,Fs);const $o=be((e,t)=>{var d;if(Z())return e.children;const o=ae(),{setManyDecision:i}=X.useDecision(),{handleExplainAnswer:r}=ge(),l=e.attributes.map(le),s=X.useAttributes(l).map((g,p)=>{if(!g)return{error:u.jsx("span",{children:"Attribute not found"})};const b=e.attributes[p],h=b.choiceValueId??"",y=h.length>0,C=g.type===f.AttributeType.Choice,v=g.type===f.AttributeType.Numeric,R=g.type===f.AttributeType.Boolean,S=g.type===f.AttributeType.Component;if(!C&&y)return{error:u.jsx("span",{children:"Attribute is not a Choice Attribute"})};let E=C?g.values.find(I=>I.id===h):null;if(y&&E==null)return{error:u.jsx("span",{children:"Choice Value not found"})};const w=()=>N.match({isChoiceAttribute:C,isBooleanAttribute:R,isComponentAttribute:S,isNumericAttribute:v,hasChoiceValueId:y,state:b.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>f.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>f.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>f.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>f.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>b.numericValue).otherwise(()=>null);return{getDecisions:()=>C&&!y&&b.setSelection==="undefined"?g.values.filter(I=>{var P;return((P=I.decision)==null?void 0:P.kind)===f.DecisionKind.Explicit}).map(I=>({type:g.type,attributeId:g.id,choiceValueId:I.id,state:null})):[{type:g.type,attributeId:g.id,choiceValueId:h,state:w()}]}}),a=(d=s.find(g=>g.error))==null?void 0:d.error;if(a)return a;const c=async()=>{const g=s.reduce((b,h)=>[...b,...h.getDecisions()],new Array),p=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(g,p)}catch(b){const h=b;(h==null?void 0:h.type)===f.FailureType.ConfigurationSetManyConflict&&h.decisionExplanations?e.explain!=="disabled"&&await r(h,e.explain,o):se()}},m=()=>{e.trigger==="click"&&c()};return A.useEffect(()=>{e.trigger==="auto"&&c()},[]),Ee(e.children,{onClick:m,ref:t})}),Bs=$o,Ls={children:{title:"Content",type:x.ControlType.ComponentInstance},attributes:{title:"Attributes",type:x.ControlType.Array,control:{type:x.ControlType.Object,controls:{...he,...ut,setSelection:{title:"Set Selection To",type:x.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:x.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:x.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:x.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:x.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...He};x.addPropertyControls($o,Ls);const Ko=Te(e=>{if(Z())return e.enabledChildren;const{configuration:n}=X.useConfiguration(),{setManyDecision:o}=X.useDecision(),i=n.attributes.some(s=>N.match(s).with({type:f.AttributeType.Choice},a=>a.values.some(c=>{var m;return((m=c.decision)==null?void 0:m.kind)===f.DecisionKind.Explicit})).with({type:f.AttributeType.Boolean},a=>{var c;return((c=a.decision)==null?void 0:c.kind)===f.DecisionKind.Explicit}).with({type:f.AttributeType.Numeric},a=>{var c;return((c=a.decision)==null?void 0:c.kind)===f.DecisionKind.Explicit}).with({type:f.AttributeType.Component},a=>{var c;return((c=a.decision)==null?void 0:c.kind)===f.DecisionKind.Explicit}).exhaustive()),r=()=>{if(i)try{o([],{type:"DropExistingDecisions",conflictHandling:{type:"Manual",includeConstraintsInConflictExplanation:!1}})}catch{vs()}},l=i?e.enabledChildren:e.disabledChildren;return Ee(l,{onClick:r})}),Ns=Ko,Ms={enabledChildren:{title:"Content – Enabled",type:x.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:x.ControlType.ComponentInstance}};x.addPropertyControls(Ko,Ms);const Wo=be((e,t)=>{if(Z())return e.satisfiedChildren;const o=ae(),{configuration:i}=X.useConfiguration(),{explain:r}=ge(),s=[...e.attributeId.length>0?[le(e)]:[],...e.attributes.map(le)],a=()=>{var p;const d=X.useAttributes(s).map(b=>b?{isSatisfied:b.isSatisfied}:{error:u.jsx("span",{children:"Attribute not found"})}),g=(p=d.find(b=>b.error))==null?void 0:p.error;return g||d.every(b=>b.isSatisfied)},c=async()=>{e.explain!=="disabled"&&(s.length===0?await r(d=>d.whyIsNotSatisfied.configuration,e.explain,o):s.length===1&&await r(d=>d.whyIsNotSatisfied.attribute(s[0]),e.explain,o))};return(s.length>0?a():i.isSatisfied)?e.satisfiedChildren:Ee(e.unsatisfiedChildren,{onClick:c,ref:t})}),$s=Wo,Ks={satisfiedChildren:{title:"Content – Satisfied",type:x.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:x.ControlType.ComponentInstance},...he,attributes:{title:"Attributes",type:x.ControlType.Array,control:{type:x.ControlType.Object,controls:{...he}}},...He};x.addPropertyControls(Wo,Ks);const zo=Te(A.forwardRef(function(t,n){const o=p=>N.match(p).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(p=>p.useInDesignTime)||t.variants[0];if(Z())return i&&o(i.content);const l=le(t),s=t.choiceValueId??"",a=s.length>0,c=X.useAttributes([l])[0];if(!c)return u.jsx("span",{children:"Attribute not found"});const m=c.type===f.AttributeType.Choice;if(!m&&a)return u.jsx("span",{children:"Attribute is not a Choice Attribute"});if(m&&!a)return u.jsx("span",{children:"Choice Value Id missing"});let d=m?c.values.find(p=>p.id===s):null;if(a&&d==null)return u.jsx("span",{children:"Choice Value not found"});const g=[...t.variants].find(({selection:p,condition:b})=>N.match({selection:p,condition:b,attribute:c}).with({attribute:{type:f.AttributeType.Choice},selection:"included",condition:"blocked"},()=>!d.possibleDecisionStates.includes(f.ChoiceValueDecisionState.Included)).with({attribute:{type:f.AttributeType.Choice},selection:"included",condition:"implicit"},()=>{var h,y;return((h=d.decision)==null?void 0:h.state)===f.ChoiceValueDecisionState.Included&&((y=d.decision)==null?void 0:y.kind)===f.DecisionKind.Implicit}).with({attribute:{type:f.AttributeType.Choice},selection:"included",condition:"explicit"},()=>{var h,y;return((h=d.decision)==null?void 0:h.state)===f.ChoiceValueDecisionState.Included&&((y=d.decision)==null?void 0:y.kind)===f.DecisionKind.Explicit}).with({attribute:{type:f.AttributeType.Choice},selection:"included",condition:"none"},()=>{var h;return((h=d.decision)==null?void 0:h.state)===f.ChoiceValueDecisionState.Included}).with({attribute:{type:f.AttributeType.Choice},selection:"excluded",condition:"blocked"},()=>!d.possibleDecisionStates.includes(f.ChoiceValueDecisionState.Excluded)).with({attribute:{type:f.AttributeType.Choice},selection:"excluded",condition:"implicit"},()=>{var h,y;return((h=d.decision)==null?void 0:h.state)===f.ChoiceValueDecisionState.Excluded&&((y=d.decision)==null?void 0:y.kind)===f.DecisionKind.Implicit}).with({attribute:{type:f.AttributeType.Choice},selection:"excluded",condition:"explicit"},()=>{var h,y;return((h=d.decision)==null?void 0:h.state)===f.ChoiceValueDecisionState.Excluded&&((y=d.decision)==null?void 0:y.kind)===f.DecisionKind.Explicit}).with({attribute:{type:f.AttributeType.Choice},selection:"excluded",condition:"none"},()=>{var h;return((h=d.decision)==null?void 0:h.state)===f.ChoiceValueDecisionState.Excluded}).with({attribute:{type:f.AttributeType.Boolean},selection:"true",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(!0)).with({attribute:{type:f.AttributeType.Boolean},selection:"true",condition:"implicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===!0&&((C=h.decision)==null?void 0:C.kind)===f.DecisionKind.Implicit}).with({attribute:{type:f.AttributeType.Boolean},selection:"true",condition:"explicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===!0&&((C=h.decision)==null?void 0:C.kind)===f.DecisionKind.Explicit}).with({attribute:{type:f.AttributeType.Boolean},selection:"true",condition:"none"},({attribute:h})=>{var y;return((y=h.decision)==null?void 0:y.state)===!0}).with({attribute:{type:f.AttributeType.Boolean},selection:"false",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(!1)).with({attribute:{type:f.AttributeType.Boolean},selection:"false",condition:"implicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===!1&&((C=h.decision)==null?void 0:C.kind)===f.DecisionKind.Implicit}).with({attribute:{type:f.AttributeType.Boolean},selection:"false",condition:"explicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===!1&&((C=h.decision)==null?void 0:C.kind)===f.DecisionKind.Explicit}).with({attribute:{type:f.AttributeType.Boolean},selection:"false",condition:"none"},({attribute:h})=>{var y;return((y=h.decision)==null?void 0:y.state)===!1}).with({attribute:{type:f.AttributeType.Component},selection:"included",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(f.ComponentDecisionState.Included)).with({attribute:{type:f.AttributeType.Component},selection:"included",condition:"implicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===f.ComponentDecisionState.Included&&((C=h.decision)==null?void 0:C.kind)===f.DecisionKind.Implicit}).with({attribute:{type:f.AttributeType.Component},selection:"included",condition:"explicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===f.ComponentDecisionState.Included&&((C=h.decision)==null?void 0:C.kind)===f.DecisionKind.Explicit}).with({attribute:{type:f.AttributeType.Component},selection:"included",condition:"none"},({attribute:h})=>{var y;return((y=h.decision)==null?void 0:y.state)===f.ComponentDecisionState.Included}).with({attribute:{type:f.AttributeType.Component},selection:"excluded",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(f.ComponentDecisionState.Excluded)).with({attribute:{type:f.AttributeType.Component},selection:"excluded",condition:"implicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===f.ComponentDecisionState.Excluded&&((C=h.decision)==null?void 0:C.kind)===f.DecisionKind.Implicit}).with({attribute:{type:f.AttributeType.Component},selection:"excluded",condition:"explicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===f.ComponentDecisionState.Excluded&&((C=h.decision)==null?void 0:C.kind)===f.DecisionKind.Explicit}).with({attribute:{type:f.AttributeType.Component},selection:"excluded",condition:"none"},({attribute:h})=>{var y;return((y=h.decision)==null?void 0:y.state)===f.ComponentDecisionState.Excluded}).with({attribute:{type:f.AttributeType.Numeric},selection:"numeric",condition:"implicit"},({attribute:h})=>{var y;return((y=h.decision)==null?void 0:y.kind)===f.DecisionKind.Implicit}).with({attribute:{type:f.AttributeType.Numeric},selection:"numeric",condition:"explicit"},({attribute:h})=>{var y;return((y=h.decision)==null?void 0:y.kind)===f.DecisionKind.Explicit}).with({attribute:{type:f.AttributeType.Numeric},selection:"numeric",condition:"none"},({attribute:h})=>h.decision!=null).with({attribute:{type:f.AttributeType.Choice},selection:"undefined"},()=>d.decision==null).with({attribute:{type:f.AttributeType.Boolean},selection:"undefined"},{attribute:{type:f.AttributeType.Component},selection:"undefined"},{attribute:{type:f.AttributeType.Numeric},selection:"undefined"},({attribute:h})=>h.decision==null).otherwise(()=>!1));return g&&Ee(o(g.content),{ref:n})})),Ws=zo,zs={...he,...ut,variants:{title:"Variants",type:x.ControlType.Array,maxCount:10,control:{type:x.ControlType.Object,controls:{selection:{title:"Selection",type:x.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:x.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:x.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:x.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:x.ControlType.ComponentInstance},content2:{title:"Content 2",type:x.ControlType.ComponentInstance},content3:{title:"Content 3",type:x.ControlType.ComponentInstance},content4:{title:"Content 4",type:x.ControlType.ComponentInstance},content5:{title:"Content 5",type:x.ControlType.ComponentInstance},content6:{title:"Content 6",type:x.ControlType.ComponentInstance},content7:{title:"Content 7",type:x.ControlType.ComponentInstance},content8:{title:"Content 8",type:x.ControlType.ComponentInstance},content9:{title:"Content 9",type:x.ControlType.ComponentInstance},content10:{title:"Content 10",type:x.ControlType.ComponentInstance}};x.addPropertyControls(zo,zs);const qo=Te(e=>{const t=A.useRef(),[n,o]=A.useState(null),i=A.useRef(n),r=A.useMemo(()=>e.color.startsWith("var"),[e.color]),l=r?n:e.color,s=A.useMemo(()=>{if(!l)return;const a=ii(l);return oi.hexToCSSFilter(`#${a}`,{acceptanceLossPercentage:1,maxChecks:30}).filter.replace(";","")},[l]);return A.useLayoutEffect(()=>{if(r){const a=t.current&&getComputedStyle(t.current).color;a!=i.current&&(i.current=a,o(a))}}),u.jsx("div",{ref:t,style:{...e.style,color:e.color,filter:s},children:e.children})}),qs=qo,Hs={children:{title:"Content",type:x.ControlType.ComponentInstance},color:{title:"Color",type:x.ControlType.Color,defaultValue:"#0000ff"}};x.addPropertyControls(qo,Hs);const Ho=Te(e=>{if(Z())return e.children;const{error:n}=X.useConfigurationInitialization();return n?Ee(e.children,{onClick:n.retry}):null}),_s=Ho,Us={children:{title:"Content",type:x.ControlType.ComponentInstance}};x.addPropertyControls(Ho,Us);function Qs(e){return A.forwardRef((t,n)=>{const o={...t.style,width:"100%",height:"100%"};return u.jsx(e,{...t,ref:n,style:o})})}const Xs=k.div`
425
+ `,Lo=be((e,t)=>{var v,R;if(Z()){const S=jt(e,!0,!1);return u.jsx(Dn,{style:S})}const o=ae(),i=le(e),r=X.useNumericAttribute(i),{explain:l}=ge();if(!r)return u.jsx("span",{children:"Numeric Attribute not found"});const{attribute:s,makeDecision:a}=r,c=((v=s.decision)==null?void 0:v.kind)===p.DecisionKind.Implicit,m=jt(e,s.isSatisfied,c),d=(R=s.decision)==null?void 0:R.state,[g,f]=A.useState(d),{min:b,max:h}=s.range,C=Bo(d,async S=>{if(S<b){alert(`The value must be smaller than or equal to ${b}.`);return}if(S>h){alert(`The value must be greater than or equal to ${h}.`);return}try{await a(S)}catch(E){const w=E;w.type===p.FailureType.ConfigurationModelNotFeasible||w.type===p.FailureType.ConfigurationConflict?e.explain!=="disabled"&&await l(P=>P.whyIsStateNotPossible.numeric(s.id).state(S),e.explain,o):se()}},g,S=>f(S),e.wait);return u.jsx(Dn,{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:Ds(s,e.implicitLabelPrefix),onBlur:()=>{C.flush()},onKeyPress:S=>{S.key==="Enter"&&C.flush()},onValueChange:S=>f(S.floatValue),value:g??"",style:m})}),Ps=Lo,Ds=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===p.DecisionKind.Implicit?t:""},ks={...Po,wait:{title:"Debounce Delay",type:x.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:x.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:x.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:x.ControlType.String,defaultValue:""}};x.addPropertyControls(Lo,ks);const ut={choiceValueId:{title:"Choice Value Id",type:x.ControlType.String}};function Ee(e,t){return A.Children.map(e,n=>{if(A.isValidElement(n)){const o=Vn(n.props,t);return A.cloneElement(n,o)}return n})}const No=be((e,t)=>{if(Z())return e.children;const o=ae(),{makeDecision:i}=X.useDecision(),r=le(e),l=e.choiceValueId??"",s=l.length>0,a=X.useAttributes([r])[0],{explain:c}=ge();if(!a)return u.jsx("span",{children:"Attribute not found"});const m=a.type===p.AttributeType.Choice,d=a.type===p.AttributeType.Numeric,g=a.type===p.AttributeType.Boolean,f=a.type===p.AttributeType.Component;if(!m&&s)return u.jsx("span",{children:"Attribute is not a Choice Attribute"});if(d)return u.jsx("span",{children:"Numeric Attribute is not supported"});let b=m?a.values.find(R=>R.id===l):null;if(s&&b==null)return u.jsx("span",{children:"Choice Value not found"});const h=R=>N.match({state:R,attribute:a}).with({attribute:{type:p.AttributeType.Choice},state:"undefined"},()=>b.decision==null).with({attribute:{type:p.AttributeType.Choice},state:"included"},()=>{var S,E;return((S=b.decision)==null?void 0:S.state)===p.ChoiceValueDecisionState.Included&&((E=b.decision)==null?void 0:E.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Choice},state:"excluded"},()=>{var S,E;return((S=b.decision)==null?void 0:S.state)===p.ChoiceValueDecisionState.Excluded&&((E=b.decision)==null?void 0:E.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Boolean},state:"undefined"},{attribute:{type:p.AttributeType.Component},state:"undefined"},({attribute:S})=>S.decision==null).with({attribute:{type:p.AttributeType.Boolean},state:"true"},({attribute:S})=>{var E,w;return((E=S.decision)==null?void 0:E.state)===!0&&((w=S.decision)==null?void 0:w.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Boolean},state:"false"},({attribute:S})=>{var E,w;return((E=S.decision)==null?void 0:E.state)===!1&&((w=S.decision)==null?void 0:w.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Component},state:"included"},({attribute:S})=>{var E,w;return((E=S.decision)==null?void 0:E.state)===p.ComponentDecisionState.Included&&((w=S.decision)==null?void 0:w.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Component},state:"excluded"},({attribute:S})=>{var E,w;return((E=S.decision)==null?void 0:E.state)===p.ComponentDecisionState.Excluded&&((w=S.decision)==null?void 0:w.kind)===p.DecisionKind.Explicit}).otherwise(()=>!1),y=R=>N.match({isChoiceAttribute:m,isBooleanAttribute:g,isComponentAttribute:f,state:R}).with({isChoiceAttribute:!0,state:"included"},()=>p.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>p.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>p.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>p.ComponentDecisionState.Excluded).otherwise(()=>null);h(e.toggleFrom);const C=h(e.toggleTo),v=async()=>{const R=C?e.toggleFrom:e.toggleTo,S=y(R),E=f?p.AttributeInterpreter.isComponentStatePossible(a,S):!1,w=g?p.AttributeInterpreter.isBooleanValuePossible(a,S):!1;if((m?b.possibleDecisionStates.some(F=>F===S):!1)||w||E||S==null)try{await i({type:a.type,attributeId:r,choiceValueId:l,state:S})}catch{se()}else if(e.explain!=="disabled"){const F=N.match({isComponentAttribute:f,isBooleanAttribute:g,isChoiceAttribute:m}).returnType().with({isChoiceAttribute:!0},()=>p.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>p.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>p.ExplainQuestionSubject.component).otherwise(()=>null);F&&await c({question:p.ExplainQuestionType.whyIsStateNotPossible,subject:F,attributeId:r,choiceValueId:l,state:S},e.explain,o)}};return Ee(e.children,{onClick:v,ref:t})}),js=No,Vs={...he,...ut,children:{title:"Content",type:x.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:x.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:x.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...He};x.addPropertyControls(No,Vs);const Mo=be((e,t)=>{if(Z())return e.children;const o=ae(),{makeDecision:i}=X.useDecision(),r=le(e),l=e.choiceValueId??"",s=l.length>0,a=X.useAttributes([r])[0],c=X.useChoiceAttribute(r),{explain:m}=ge();if(!a)return u.jsx("span",{children:"Attribute not found"});const d=a.type===p.AttributeType.Choice,g=a.type===p.AttributeType.Numeric,f=a.type===p.AttributeType.Boolean,b=a.type===p.AttributeType.Component;if(!d&&s)return u.jsx("span",{children:"Attribute is not a Choice Attribute"});let h=d?a.values.find(v=>v.id===l):null;if(s&&h==null)return u.jsx("span",{children:"Choice Value not found"});const y=()=>N.match({isChoiceAttribute:d,isBooleanAttribute:f,isComponentAttribute:b,isNumericAttribute:g,hasChoiceValueId:s,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>p.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>p.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>p.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>p.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),C=async()=>{if(d&&!s&&e.setSelection==="undefined")try{await c.clearDecisions()}catch{se()}else{const v=y(),R=b?p.AttributeInterpreter.isComponentStatePossible(a,v):!1,S=f?p.AttributeInterpreter.isBooleanValuePossible(a,v):!1,w=(d?h.possibleDecisionStates.some(I=>I===v):!1)||S||R;if(g||w||v==null)try{await i({type:a.type,attributeId:r,choiceValueId:l,state:v})}catch(I){const P=I;g&&(P.type===p.FailureType.ConfigurationModelNotFeasible||P.type===p.FailureType.ConfigurationConflict)?e.explain!=="disabled"&&await m(j=>j.whyIsStateNotPossible.numeric(a.id).state(v),e.explain,o):se()}else if(e.explain!=="disabled"){const I=N.match({isComponentAttribute:b,isBooleanAttribute:f,isChoiceAttribute:d}).returnType().with({isChoiceAttribute:!0},()=>p.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>p.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>p.ExplainQuestionSubject.component).otherwise(()=>null);I&&await m({question:p.ExplainQuestionType.whyIsStateNotPossible,subject:I,attributeId:r,choiceValueId:l,state:v},e.explain,o)}}};return Ee(e.children,{onClick:C,ref:t})}),Os=Mo,Fs={...he,...ut,children:{title:"Content",type:x.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:x.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:x.ControlType.Number,defaultValue:0},...He};x.addPropertyControls(Mo,Fs);const $o=be((e,t)=>{var d;if(Z())return e.children;const o=ae(),{setManyDecision:i}=X.useDecision(),{handleExplainAnswer:r}=ge(),l=e.attributes.map(le),s=X.useAttributes(l).map((g,f)=>{if(!g)return{error:u.jsx("span",{children:"Attribute not found"})};const b=e.attributes[f],h=b.choiceValueId??"",y=h.length>0,C=g.type===p.AttributeType.Choice,v=g.type===p.AttributeType.Numeric,R=g.type===p.AttributeType.Boolean,S=g.type===p.AttributeType.Component;if(!C&&y)return{error:u.jsx("span",{children:"Attribute is not a Choice Attribute"})};let E=C?g.values.find(I=>I.id===h):null;if(y&&E==null)return{error:u.jsx("span",{children:"Choice Value not found"})};const w=()=>N.match({isChoiceAttribute:C,isBooleanAttribute:R,isComponentAttribute:S,isNumericAttribute:v,hasChoiceValueId:y,state:b.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>p.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>p.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>p.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>p.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>b.numericValue).otherwise(()=>null);return{getDecisions:()=>C&&!y&&b.setSelection==="undefined"?g.values.filter(I=>{var P;return((P=I.decision)==null?void 0:P.kind)===p.DecisionKind.Explicit}).map(I=>({type:g.type,attributeId:g.id,choiceValueId:I.id,state:null})):[{type:g.type,attributeId:g.id,choiceValueId:h,state:w()}]}}),a=(d=s.find(g=>g.error))==null?void 0:d.error;if(a)return a;const c=async()=>{const g=s.reduce((b,h)=>[...b,...h.getDecisions()],new Array),f=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(g,f)}catch(b){const h=b;(h==null?void 0:h.type)===p.FailureType.ConfigurationSetManyConflict&&h.decisionExplanations?e.explain!=="disabled"&&await r(h,e.explain,o):se()}},m=()=>{e.trigger==="click"&&c()};return A.useEffect(()=>{e.trigger==="auto"&&c()},[]),Ee(e.children,{onClick:m,ref:t})}),Bs=$o,Ls={children:{title:"Content",type:x.ControlType.ComponentInstance},attributes:{title:"Attributes",type:x.ControlType.Array,control:{type:x.ControlType.Object,controls:{...he,...ut,setSelection:{title:"Set Selection To",type:x.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:x.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:x.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:x.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:x.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...He};x.addPropertyControls($o,Ls);const Ko=Te(e=>{if(Z())return e.enabledChildren;const{configuration:n}=X.useConfiguration(),{setManyDecision:o}=X.useDecision(),i=n.attributes.some(s=>N.match(s).with({type:p.AttributeType.Choice},a=>a.values.some(c=>{var m;return((m=c.decision)==null?void 0:m.kind)===p.DecisionKind.Explicit})).with({type:p.AttributeType.Boolean},a=>{var c;return((c=a.decision)==null?void 0:c.kind)===p.DecisionKind.Explicit}).with({type:p.AttributeType.Numeric},a=>{var c;return((c=a.decision)==null?void 0:c.kind)===p.DecisionKind.Explicit}).with({type:p.AttributeType.Component},a=>{var c;return((c=a.decision)==null?void 0:c.kind)===p.DecisionKind.Explicit}).exhaustive()),r=()=>{if(i)try{o([],{type:"DropExistingDecisions",conflictHandling:{type:"Manual",includeConstraintsInConflictExplanation:!1}})}catch{vs()}},l=i?e.enabledChildren:e.disabledChildren;return Ee(l,{onClick:r})}),Ns=Ko,Ms={enabledChildren:{title:"Content – Enabled",type:x.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:x.ControlType.ComponentInstance}};x.addPropertyControls(Ko,Ms);const Wo=be((e,t)=>{if(Z())return e.satisfiedChildren;const o=ae(),{configuration:i}=X.useConfiguration(),{explain:r}=ge(),s=[...e.attributeId.length>0?[le(e)]:[],...e.attributes.map(le)],a=()=>{var f;const d=X.useAttributes(s).map(b=>b?{isSatisfied:b.isSatisfied}:{error:u.jsx("span",{children:"Attribute not found"})}),g=(f=d.find(b=>b.error))==null?void 0:f.error;return g||d.every(b=>b.isSatisfied)},c=async()=>{e.explain!=="disabled"&&(s.length===0?await r(d=>d.whyIsNotSatisfied.configuration,e.explain,o):s.length===1&&await r(d=>d.whyIsNotSatisfied.attribute(s[0]),e.explain,o))};return(s.length>0?a():i.isSatisfied)?e.satisfiedChildren:Ee(e.unsatisfiedChildren,{onClick:c,ref:t})}),$s=Wo,Ks={satisfiedChildren:{title:"Content – Satisfied",type:x.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:x.ControlType.ComponentInstance},...he,attributes:{title:"Attributes",type:x.ControlType.Array,control:{type:x.ControlType.Object,controls:{...he}}},...He};x.addPropertyControls(Wo,Ks);const zo=Te(A.forwardRef(function(t,n){const o=f=>N.match(f).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(f=>f.useInDesignTime)||t.variants[0];if(Z())return i&&o(i.content);const l=le(t),s=t.choiceValueId??"",a=s.length>0,c=X.useAttributes([l])[0];if(!c)return u.jsx("span",{children:"Attribute not found"});const m=c.type===p.AttributeType.Choice;if(!m&&a)return u.jsx("span",{children:"Attribute is not a Choice Attribute"});if(m&&!a)return u.jsx("span",{children:"Choice Value Id missing"});let d=m?c.values.find(f=>f.id===s):null;if(a&&d==null)return u.jsx("span",{children:"Choice Value not found"});const g=[...t.variants].find(({selection:f,condition:b})=>N.match({selection:f,condition:b,attribute:c}).with({attribute:{type:p.AttributeType.Choice},selection:"included",condition:"blocked"},()=>!d.possibleDecisionStates.includes(p.ChoiceValueDecisionState.Included)).with({attribute:{type:p.AttributeType.Choice},selection:"included",condition:"implicit"},()=>{var h,y;return((h=d.decision)==null?void 0:h.state)===p.ChoiceValueDecisionState.Included&&((y=d.decision)==null?void 0:y.kind)===p.DecisionKind.Implicit}).with({attribute:{type:p.AttributeType.Choice},selection:"included",condition:"explicit"},()=>{var h,y;return((h=d.decision)==null?void 0:h.state)===p.ChoiceValueDecisionState.Included&&((y=d.decision)==null?void 0:y.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Choice},selection:"included",condition:"none"},()=>{var h;return((h=d.decision)==null?void 0:h.state)===p.ChoiceValueDecisionState.Included}).with({attribute:{type:p.AttributeType.Choice},selection:"excluded",condition:"blocked"},()=>!d.possibleDecisionStates.includes(p.ChoiceValueDecisionState.Excluded)).with({attribute:{type:p.AttributeType.Choice},selection:"excluded",condition:"implicit"},()=>{var h,y;return((h=d.decision)==null?void 0:h.state)===p.ChoiceValueDecisionState.Excluded&&((y=d.decision)==null?void 0:y.kind)===p.DecisionKind.Implicit}).with({attribute:{type:p.AttributeType.Choice},selection:"excluded",condition:"explicit"},()=>{var h,y;return((h=d.decision)==null?void 0:h.state)===p.ChoiceValueDecisionState.Excluded&&((y=d.decision)==null?void 0:y.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Choice},selection:"excluded",condition:"none"},()=>{var h;return((h=d.decision)==null?void 0:h.state)===p.ChoiceValueDecisionState.Excluded}).with({attribute:{type:p.AttributeType.Boolean},selection:"true",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(!0)).with({attribute:{type:p.AttributeType.Boolean},selection:"true",condition:"implicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===!0&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Implicit}).with({attribute:{type:p.AttributeType.Boolean},selection:"true",condition:"explicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===!0&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Boolean},selection:"true",condition:"none"},({attribute:h})=>{var y;return((y=h.decision)==null?void 0:y.state)===!0}).with({attribute:{type:p.AttributeType.Boolean},selection:"false",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(!1)).with({attribute:{type:p.AttributeType.Boolean},selection:"false",condition:"implicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===!1&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Implicit}).with({attribute:{type:p.AttributeType.Boolean},selection:"false",condition:"explicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===!1&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Boolean},selection:"false",condition:"none"},({attribute:h})=>{var y;return((y=h.decision)==null?void 0:y.state)===!1}).with({attribute:{type:p.AttributeType.Component},selection:"included",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(p.ComponentDecisionState.Included)).with({attribute:{type:p.AttributeType.Component},selection:"included",condition:"implicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===p.ComponentDecisionState.Included&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Implicit}).with({attribute:{type:p.AttributeType.Component},selection:"included",condition:"explicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===p.ComponentDecisionState.Included&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Component},selection:"included",condition:"none"},({attribute:h})=>{var y;return((y=h.decision)==null?void 0:y.state)===p.ComponentDecisionState.Included}).with({attribute:{type:p.AttributeType.Component},selection:"excluded",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(p.ComponentDecisionState.Excluded)).with({attribute:{type:p.AttributeType.Component},selection:"excluded",condition:"implicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===p.ComponentDecisionState.Excluded&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Implicit}).with({attribute:{type:p.AttributeType.Component},selection:"excluded",condition:"explicit"},({attribute:h})=>{var y,C;return((y=h.decision)==null?void 0:y.state)===p.ComponentDecisionState.Excluded&&((C=h.decision)==null?void 0:C.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Component},selection:"excluded",condition:"none"},({attribute:h})=>{var y;return((y=h.decision)==null?void 0:y.state)===p.ComponentDecisionState.Excluded}).with({attribute:{type:p.AttributeType.Numeric},selection:"numeric",condition:"implicit"},({attribute:h})=>{var y;return((y=h.decision)==null?void 0:y.kind)===p.DecisionKind.Implicit}).with({attribute:{type:p.AttributeType.Numeric},selection:"numeric",condition:"explicit"},({attribute:h})=>{var y;return((y=h.decision)==null?void 0:y.kind)===p.DecisionKind.Explicit}).with({attribute:{type:p.AttributeType.Numeric},selection:"numeric",condition:"none"},({attribute:h})=>h.decision!=null).with({attribute:{type:p.AttributeType.Choice},selection:"undefined"},()=>d.decision==null).with({attribute:{type:p.AttributeType.Boolean},selection:"undefined"},{attribute:{type:p.AttributeType.Component},selection:"undefined"},{attribute:{type:p.AttributeType.Numeric},selection:"undefined"},({attribute:h})=>h.decision==null).otherwise(()=>!1));return g&&Ee(o(g.content),{ref:n})})),Ws=zo,zs={...he,...ut,variants:{title:"Variants",type:x.ControlType.Array,maxCount:10,control:{type:x.ControlType.Object,controls:{selection:{title:"Selection",type:x.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:x.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:x.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:x.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:x.ControlType.ComponentInstance},content2:{title:"Content 2",type:x.ControlType.ComponentInstance},content3:{title:"Content 3",type:x.ControlType.ComponentInstance},content4:{title:"Content 4",type:x.ControlType.ComponentInstance},content5:{title:"Content 5",type:x.ControlType.ComponentInstance},content6:{title:"Content 6",type:x.ControlType.ComponentInstance},content7:{title:"Content 7",type:x.ControlType.ComponentInstance},content8:{title:"Content 8",type:x.ControlType.ComponentInstance},content9:{title:"Content 9",type:x.ControlType.ComponentInstance},content10:{title:"Content 10",type:x.ControlType.ComponentInstance}};x.addPropertyControls(zo,zs);const qo=Te(e=>{const t=A.useRef(),[n,o]=A.useState(null),i=A.useRef(n),r=A.useMemo(()=>e.color.startsWith("var"),[e.color]),l=r?n:e.color,s=A.useMemo(()=>{if(!l)return;const a=ii(l);return oi.hexToCSSFilter(`#${a}`,{acceptanceLossPercentage:1,maxChecks:30}).filter.replace(";","")},[l]);return A.useLayoutEffect(()=>{if(r){const a=t.current&&getComputedStyle(t.current).color;a!=i.current&&(i.current=a,o(a))}}),u.jsx("div",{ref:t,style:{...e.style,color:e.color,filter:s},children:e.children})}),qs=qo,Hs={children:{title:"Content",type:x.ControlType.ComponentInstance},color:{title:"Color",type:x.ControlType.Color,defaultValue:"#0000ff"}};x.addPropertyControls(qo,Hs);const Ho=Te(e=>{if(Z())return e.children;const{error:n}=X.useConfigurationInitialization();return n?Ee(e.children,{onClick:n.retry}):null}),_s=Ho,Us={children:{title:"Content",type:x.ControlType.ComponentInstance}};x.addPropertyControls(Ho,Us);function Qs(e){return A.forwardRef((t,n)=>{const o={...t.style,width:"100%",height:"100%"};return u.jsx(e,{...t,ref:n,style:o})})}const Xs=k.div`
426
426
  width: 10px;
427
427
  height: 10px;
428
428
  background-color: greenyellow;
@@ -434,4 +434,4 @@ Please check your internet connection and try again.`)}const Cn=k.select`
434
434
  display: contents !important;
435
435
  }
436
436
  }
437
- `,Qo=Te(jo(e=>{const t=ae(),n=Z(),r=n?(()=>A.Children.toArray(e.itemTemplate)[0])():(()=>{var g;const d=A.Children.toArray(e.itemTemplate)[0];return(g=d==null?void 0:d.props)==null?void 0:g.children})();if(!r)return u.jsx("span",{children:"Choice Value Template not defined"});const l=d=>d.map(g=>A.cloneElement(r,{key:g,layoutId:`${t}_${g}`,attributeId:e.attributeId,componentPath:e.componentPath,sharedConfigurationModel:e.sharedConfigurationModel,choiceValueId:g}));if(n)return u.jsx(kn,{...e,children:l(["Choice Value 1","Choice Value 2","Choice Value 3"])});const s=le(e),a=X.useChoiceAttribute(s);if(!a)return u.jsx("span",{children:"Choice Attribute not found"});const{attribute:c}=a,m=c.values.map(d=>d.id);return u.jsx(kn,{...e,children:l(m)})}));function kn(e){return u.jsxs(u.Fragment,{children:[u.jsx(lt,{singletonId:"ChoiceValueListRenderer",children:u.jsx(Gs,{})}),u.jsx(Uo,{style:e.style,children:e.children})]})}const Js=Qo,Zs={...he,itemTemplate:{title:"Choice Value Template",type:x.ControlType.ComponentInstance}};x.addPropertyControls(Qo,Zs);exports.BooleanSelect=Es;exports.ChoiceSelect=ws;exports.ChoiceValueListRenderer=Js;exports.Colorize=qs;exports.ComponentSelect=Is;exports.Configuration=$l;exports.InitializationRetry=_s;exports.NumericInput=Ps;exports.ResetConfiguration=Ns;exports.SatisfactionIndicator=$s;exports.ScrollIntoView=_o;exports.SelectionIndicator=Ws;exports.SelectionToggle=js;exports.SetSelection=Os;exports.SetSelections=Bs;exports.Singleton=lt;exports.useDebounceValue=Bo;exports.useRenderPlaceholder=Z;exports.withFullSize=Qs;
437
+ `,Qo=Te(jo(e=>{const t=ae(),n=Z(),r=n?(()=>A.Children.toArray(e.itemTemplate)[0])():(()=>{const d=g=>{var h;const f=A.Children.toArray(g)[0],b=(h=f.props)==null?void 0:h.children;return b?d(b):f};return d(e.itemTemplate)})();if(!r)return u.jsx("span",{children:"Choice Value Template not defined"});const l=d=>d.map(g=>A.cloneElement(r,{key:g,layoutId:`${t}_${g}`,attributeId:e.attributeId,componentPath:e.componentPath,sharedConfigurationModel:e.sharedConfigurationModel,choiceValueId:g}));if(n)return u.jsx(kn,{...e,children:l(["Choice Value 1","Choice Value 2","Choice Value 3"])});const s=le(e),a=X.useChoiceAttribute(s);if(!a)return u.jsx("span",{children:"Choice Attribute not found"});const{attribute:c}=a,m=c.values.map(d=>d.id);return u.jsx(kn,{...e,children:l(m)})}));function kn(e){return u.jsxs(u.Fragment,{children:[u.jsx(lt,{singletonId:"ChoiceValueListRenderer",children:u.jsx(Gs,{})}),u.jsx(Uo,{style:e.style,children:e.children})]})}const Js=Qo,Zs={...he,itemTemplate:{title:"Choice Value Template",type:x.ControlType.ComponentInstance}};x.addPropertyControls(Qo,Zs);exports.BooleanSelect=Es;exports.ChoiceSelect=ws;exports.ChoiceValueListRenderer=Js;exports.Colorize=qs;exports.ComponentSelect=Is;exports.Configuration=$l;exports.InitializationRetry=_s;exports.NumericInput=Ps;exports.ResetConfiguration=Ns;exports.SatisfactionIndicator=$s;exports.ScrollIntoView=_o;exports.SelectionIndicator=Ws;exports.SelectionToggle=js;exports.SetSelection=Os;exports.SetSelections=Bs;exports.Singleton=lt;exports.useDebounceValue=Bo;exports.useRenderPlaceholder=Z;exports.withFullSize=Qs;
package/dist/index.js CHANGED
@@ -4780,9 +4780,12 @@ const Ii = O.div`
4780
4780
  }
4781
4781
  `, Ai = Me(fi((e) => {
4782
4782
  const t = ge(), n = oe(), r = n ? (() => pe.toArray(e.itemTemplate)[0])() : (() => {
4783
- var h;
4784
- const u = pe.toArray(e.itemTemplate)[0];
4785
- return (h = u == null ? void 0 : u.props) == null ? void 0 : h.children;
4783
+ const u = (h) => {
4784
+ var f;
4785
+ const d = pe.toArray(h)[0], m = (f = d.props) == null ? void 0 : f.children;
4786
+ return m ? u(m) : d;
4787
+ };
4788
+ return u(e.itemTemplate);
4786
4789
  })();
4787
4790
  if (!r)
4788
4791
  return /* @__PURE__ */ g("span", { children: "Choice Value Template not defined" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viamedici-spc/configurator-framer",
3
- "version": "0.1.0-alpha0021",
3
+ "version": "0.1.0-alpha0022",
4
4
  "description": "Component library to build configurator apps with Framer based on Viamedici SPC.",
5
5
  "repository": {
6
6
  "type": "git",