@react-form-builder/viewer-bundle 2.3.0 → 2.4.0

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.
@@ -49,7 +49,7 @@ Error generating stack: `+l.message+`
49
49
  `+l.stack}return{value:t,source:e,stack:a,digest:null}}function YX(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function JX(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var FB=typeof WeakMap=="function"?WeakMap:Map;function DR(t,e,n){n=dr(-1,n),n.tag=3,n.payload={element:null};var c=e.value;return n.callback=function(){lm||(lm=!0,SX=c),JX(t,e)},n}function BR(t,e,n){n=dr(-1,n),n.tag=3;var c=t.type.getDerivedStateFromError;if(typeof c=="function"){var a=e.value;n.payload=function(){return c(a)},n.callback=function(){JX(t,e)}}var l=t.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){JX(t,e),typeof c!="function"&&(ei===null?ei=new Set([this]):ei.add(this));var r=e.stack;this.componentDidCatch(e.value,{componentStack:r!==null?r:""})}),n}function QR(t,e,n){var c=t.pingCache;if(c===null){c=t.pingCache=new FB;var a=new Set;c.set(e,a)}else a=c.get(e),a===void 0&&(a=new Set,c.set(e,a));a.has(n)||(a.add(n),t=e6.bind(null,t,e,n),e.then(t,t))}function UR(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function ER(t,e,n,c,a){return t.mode&1?(t.flags|=65536,t.lanes=a,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=dr(-1,1),e.tag=2,qr(n,e,1))),n.lanes|=1),t)}var HB=nr.ReactCurrentOwner,Fc=!1;function Gc(t,e,n,c){e.child=t===null?GR(e,null,n,c):wo(e,t.child,n,c)}function PR(t,e,n,c,a){n=n.render;var l=e.ref;return Ro(e,a),c=LX(t,e,n,c,l,a),n=hX(),t!==null&&!Fc?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a,or(t,e,a)):(on&&n&&$h(e),e.flags|=1,Gc(t,e,c,a),e.child)}function KR(t,e,n,c,a){if(t===null){var l=n.type;return typeof l=="function"&&!QX(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=l,_R(t,e,l,c,a)):(t=sm(n.type,null,c,e,e.mode,a),t.ref=e.ref,t.return=e,e.child=t)}if(l=t.child,!(t.lanes&a)){var r=l.memoizedProps;if(n=n.compare,n=n!==null?n:tb,n(r,c)&&t.ref===e.ref)return or(t,e,a)}return e.flags|=1,t=li(l,c),t.ref=e.ref,t.return=e,e.child=t}function _R(t,e,n,c,a){if(t!==null){var l=t.memoizedProps;if(tb(l,c)&&t.ref===e.ref)if(Fc=!1,e.pendingProps=c=l,(t.lanes&a)!==0)t.flags&131072&&(Fc=!0);else return e.lanes=t.lanes,or(t,e,a)}return fX(t,e,n,c,a)}function $R(t,e,n){var c=e.pendingProps,a=c.children,l=t!==null?t.memoizedState:null;if(c.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ue(jo,ra),ra|=n;else{if(!(n&1073741824))return t=l!==null?l.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,Ue(jo,ra),ra|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},c=l!==null?l.baseLanes:n,Ue(jo,ra),ra|=c}else l!==null?(c=l.baseLanes|n,e.memoizedState=null):c=n,Ue(jo,ra),ra|=c;return Gc(t,e,a,n),e.child}function qR(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function fX(t,e,n,c,a){var l=Ic(n)?Ki:rc.current;return l=Jo(e,l),Ro(e,a),n=LX(t,e,n,c,l,a),c=hX(),t!==null&&!Fc?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a,or(t,e,a)):(on&&c&&$h(e),e.flags|=1,Gc(t,e,n,a),e.child)}function t3(t,e,n,c,a){if(Ic(n)){var l=!0;OW(e)}else l=!1;if(Ro(e,a),e.stateNode===null)tm(t,e),LR(e,n,c),uX(e,n,c,a),c=!0;else if(t===null){var r=e.stateNode,d=e.memoizedProps;r.props=d;var o=r.context,i=n.contextType;typeof i=="object"&&i!==null?i=Ma(i):(i=Ic(n)?Ki:rc.current,i=Jo(e,i));var u=n.getDerivedStateFromProps,s=typeof u=="function"||typeof r.getSnapshotBeforeUpdate=="function";s||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(d!==c||o!==i)&&hR(e,r,c,i),$r=!1;var b=e.memoizedState;r.state=b,DW(e,c,r,a),o=e.memoizedState,d!==c||b!==o||Sc.current||$r?(typeof u=="function"&&(oX(e,n,u,c),o=e.memoizedState),(d=$r||mR(e,n,d,c,b,o,i))?(s||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(e.flags|=4194308)):(typeof r.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=c,e.memoizedState=o),r.props=c,r.state=o,r.context=i,c=d):(typeof r.componentDidMount=="function"&&(e.flags|=4194308),c=!1)}else{r=e.stateNode,bR(t,e),d=e.memoizedProps,i=e.type===e.elementType?d:tl(e.type,d),r.props=i,s=e.pendingProps,b=r.context,o=n.contextType,typeof o=="object"&&o!==null?o=Ma(o):(o=Ic(n)?Ki:rc.current,o=Jo(e,o));var Z=n.getDerivedStateFromProps;(u=typeof Z=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(d!==s||b!==o)&&hR(e,r,c,o),$r=!1,b=e.memoizedState,r.state=b,DW(e,c,r,a);var W=e.memoizedState;d!==s||b!==W||Sc.current||$r?(typeof Z=="function"&&(oX(e,n,Z,c),W=e.memoizedState),(i=$r||mR(e,n,i,c,b,W,o)||!1)?(u||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(c,W,o),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(c,W,o)),typeof r.componentDidUpdate=="function"&&(e.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof r.componentDidUpdate!="function"||d===t.memoizedProps&&b===t.memoizedState||(e.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===t.memoizedProps&&b===t.memoizedState||(e.flags|=1024),e.memoizedProps=c,e.memoizedState=W),r.props=c,r.state=W,r.context=o,c=i):(typeof r.componentDidUpdate!="function"||d===t.memoizedProps&&b===t.memoizedState||(e.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||d===t.memoizedProps&&b===t.memoizedState||(e.flags|=1024),c=!1)}return MX(t,e,n,c,l,a)}function MX(t,e,n,c,a,l){qR(t,e);var r=(e.flags&128)!==0;if(!c&&!r)return a&&aR(e,n,!1),or(t,e,l);c=e.stateNode,HB.current=e;var d=r&&typeof n.getDerivedStateFromError!="function"?null:c.render();return e.flags|=1,t!==null&&r?(e.child=wo(e,t.child,null,l),e.child=wo(e,null,d,l)):Gc(t,e,d,l),e.memoizedState=c.state,a&&aR(e,n,!0),e.child}function e3(t){var e=t.stateNode;e.pendingContext?nR(t,e.pendingContext,e.pendingContext!==e.context):e.context&&nR(t,e.context,!1),sX(t,e.containerInfo)}function n3(t,e,n,c,a){return No(),nX(a),e.flags|=256,Gc(t,e,n,c),e.child}var NX={dehydrated:null,treeContext:null,retryLane:0};function zX(t){return{baseLanes:t,cachePool:null,transitions:null}}function c3(t,e,n){var c=e.pendingProps,a=Wn.current,l=!1,r=(e.flags&128)!==0,d;if((d=r)||(d=t!==null&&t.memoizedState===null?!1:(a&2)!==0),d?(l=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(a|=1),Ue(Wn,a&1),t===null)return eX(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(r=c.children,t=c.fallback,l?(c=e.mode,l=e.child,r={mode:"hidden",children:r},!(c&1)&&l!==null?(l.childLanes=0,l.pendingProps=r):l=bm(r,c,0,null),t=rd(t,c,n,null),l.return=e,t.return=e,l.sibling=t,e.child=l,e.child.memoizedState=zX(n),e.memoizedState=NX,t):RX(e,r));if(a=t.memoizedState,a!==null&&(d=a.dehydrated,d!==null))return TB(t,e,r,c,d,a,n);if(l){l=c.fallback,r=e.mode,a=t.child,d=a.sibling;var o={mode:"hidden",children:c.children};return!(r&1)&&e.child!==a?(c=e.child,c.childLanes=0,c.pendingProps=o,e.deletions=null):(c=li(a,o),c.subtreeFlags=a.subtreeFlags&14680064),d!==null?l=li(d,l):(l=rd(l,r,n,null),l.flags|=2),l.return=e,c.return=e,c.sibling=l,e.child=c,c=l,l=e.child,r=t.child.memoizedState,r=r===null?zX(n):{baseLanes:r.baseLanes|n,cachePool:null,transitions:r.transitions},l.memoizedState=r,l.childLanes=t.childLanes&~n,e.memoizedState=NX,c}return l=t.child,t=l.sibling,c=li(l,{mode:"visible",children:c.children}),!(e.mode&1)&&(c.lanes=n),c.return=e,c.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=c,e.memoizedState=null,c}function RX(t,e){return e=bm({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function qW(t,e,n,c){return c!==null&&nX(c),wo(e,t.child,null,n),t=RX(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function TB(t,e,n,c,a,l,r){if(n)return e.flags&256?(e.flags&=-257,c=YX(Error(Wt(422))),qW(t,e,r,c)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(l=c.fallback,a=e.mode,c=bm({mode:"visible",children:c.children},a,0,null),l=rd(l,a,r,null),l.flags|=2,c.return=e,l.return=e,c.sibling=l,e.child=c,e.mode&1&&wo(e,t.child,null,r),e.child.memoizedState=zX(r),e.memoizedState=NX,l);if(!(e.mode&1))return qW(t,e,r,null);if(a.data==="$!"){if(c=a.nextSibling&&a.nextSibling.dataset,c)var d=c.dgst;return c=d,l=Error(Wt(419)),c=YX(l,c,void 0),qW(t,e,r,c)}if(d=(r&t.childLanes)!==0,Fc||d){if(c=Fn,c!==null){switch(r&-r){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(c.suspendedLanes|r)?0:a,a!==0&&a!==l.retryLane&&(l.retryLane=a,ir(t,a),cl(c,t,a,-1))}return BX(),c=YX(Error(Wt(421))),qW(t,e,r,c)}return a.data==="$?"?(e.flags|=128,e.child=t.child,e=n6.bind(null,t),a._reactRetry=e,null):(t=l.treeContext,la=Er(a.nextSibling),aa=e,on=!0,qa=null,t!==null&&(Ja[fa++]=lr,Ja[fa++]=rr,Ja[fa++]=_i,lr=t.id,rr=t.overflow,_i=e),e=RX(e,c.children),e.flags|=4096,e)}function a3(t,e,n){t.lanes|=e;var c=t.alternate;c!==null&&(c.lanes|=e),rX(t.return,e,n)}function wX(t,e,n,c,a){var l=t.memoizedState;l===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:c,tail:n,tailMode:a}:(l.isBackwards=e,l.rendering=null,l.renderingStartTime=0,l.last=c,l.tail=n,l.tailMode=a)}function l3(t,e,n){var c=e.pendingProps,a=c.revealOrder,l=c.tail;if(Gc(t,e,c.children,n),c=Wn.current,c&2)c=c&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)t:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&a3(t,n,e);else if(t.tag===19)a3(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;t.sibling===null;){if(t.return===null||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}c&=1}if(Ue(Wn,c),!(e.mode&1))e.memoizedState=null;else switch(a){case"forwards":for(n=e.child,a=null;n!==null;)t=n.alternate,t!==null&&UW(t)===null&&(a=n),n=n.sibling;n=a,n===null?(a=e.child,e.child=null):(a=n.sibling,n.sibling=null),wX(e,!1,a,n,l);break;case"backwards":for(n=null,a=e.child,e.child=null;a!==null;){if(t=a.alternate,t!==null&&UW(t)===null){e.child=a;break}t=a.sibling,a.sibling=n,n=a,a=t}wX(e,!0,n,null,l);break;case"together":wX(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function tm(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function or(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),nd|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Wt(153));if(e.child!==null){for(t=e.child,n=li(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=li(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function DB(t,e,n){switch(e.tag){case 3:e3(e),No();break;case 5:pR(e);break;case 1:Ic(e.type)&&OW(e);break;case 4:sX(e,e.stateNode.containerInfo);break;case 10:var c=e.type._context,a=e.memoizedProps.value;Ue(FW,c._currentValue),c._currentValue=a;break;case 13:if(c=e.memoizedState,c!==null)return c.dehydrated!==null?(Ue(Wn,Wn.current&1),e.flags|=128,null):n&e.child.childLanes?c3(t,e,n):(Ue(Wn,Wn.current&1),t=or(t,e,n),t!==null?t.sibling:null);Ue(Wn,Wn.current&1);break;case 19:if(c=(n&e.childLanes)!==0,t.flags&128){if(c)return l3(t,e,n);e.flags|=128}if(a=e.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Ue(Wn,Wn.current),c)break;return null;case 22:case 23:return e.lanes=0,$R(t,e,n)}return or(t,e,n)}var r3,VX,i3,d3;r3=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},VX=function(){},i3=function(t,e,n,c){var a=t.memoizedProps;if(a!==c){t=e.stateNode,td(Nl.current);var l=null;switch(n){case"input":a=rh(t,a),c=rh(t,c),l=[];break;case"select":a=Zn({},a,{value:void 0}),c=Zn({},c,{value:void 0}),l=[];break;case"textarea":a=oh(t,a),c=oh(t,c),l=[];break;default:typeof a.onClick!="function"&&typeof c.onClick=="function"&&(t.onclick=CW)}sh(n,c);var r;n=null;for(i in a)if(!c.hasOwnProperty(i)&&a.hasOwnProperty(i)&&a[i]!=null)if(i==="style"){var d=a[i];for(r in d)d.hasOwnProperty(r)&&(n||(n={}),n[r]="")}else i!=="dangerouslySetInnerHTML"&&i!=="children"&&i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Cs.hasOwnProperty(i)?l||(l=[]):(l=l||[]).push(i,null));for(i in c){var o=c[i];if(d=a!=null?a[i]:void 0,c.hasOwnProperty(i)&&o!==d&&(o!=null||d!=null))if(i==="style")if(d){for(r in d)!d.hasOwnProperty(r)||o&&o.hasOwnProperty(r)||(n||(n={}),n[r]="");for(r in o)o.hasOwnProperty(r)&&d[r]!==o[r]&&(n||(n={}),n[r]=o[r])}else n||(l||(l=[]),l.push(i,n)),n=o;else i==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,d=d?d.__html:void 0,o!=null&&d!==o&&(l=l||[]).push(i,o)):i==="children"?typeof o!="string"&&typeof o!="number"||(l=l||[]).push(i,""+o):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&(Cs.hasOwnProperty(i)?(o!=null&&i==="onScroll"&&$e("scroll",t),l||d===o||(l=[])):(l=l||[]).push(i,o))}n&&(l=l||[]).push("style",n);var i=l;(e.updateQueue=i)&&(e.flags|=4)}},d3=function(t,e,n,c){n!==c&&(e.flags|=4)};function Wb(t,e){if(!on)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var c=null;n!==null;)n.alternate!==null&&(c=n),n=n.sibling;c===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function dc(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,c=0;if(e)for(var a=t.child;a!==null;)n|=a.lanes|a.childLanes,c|=a.subtreeFlags&14680064,c|=a.flags&14680064,a.return=t,a=a.sibling;else for(a=t.child;a!==null;)n|=a.lanes|a.childLanes,c|=a.subtreeFlags,c|=a.flags,a.return=t,a=a.sibling;return t.subtreeFlags|=c,t.childLanes=n,e}function BB(t,e,n){var c=e.pendingProps;switch(qh(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dc(e),null;case 1:return Ic(e.type)&&AW(),dc(e),null;case 3:return c=e.stateNode,Vo(),qe(Sc),qe(rc),ZX(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(t===null||t.child===null)&&(IW(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,qa!==null&&(HX(qa),qa=null))),VX(t,e),dc(e),null;case 5:bX(e);var a=td(ub.current);if(n=e.type,t!==null&&e.stateNode!=null)i3(t,e,n,c,a),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!c){if(e.stateNode===null)throw Error(Wt(166));return dc(e),null}if(t=td(Nl.current),IW(e)){c=e.stateNode,n=e.type;var l=e.memoizedProps;switch(c[Ml]=e,c[lb]=l,t=(e.mode&1)!==0,n){case"dialog":$e("cancel",c),$e("close",c);break;case"iframe":case"object":case"embed":$e("load",c);break;case"video":case"audio":for(a=0;a<nb.length;a++)$e(nb[a],c);break;case"source":$e("error",c);break;case"img":case"image":case"link":$e("error",c),$e("load",c);break;case"details":$e("toggle",c);break;case"input":FN(c,l),$e("invalid",c);break;case"select":c._wrapperState={wasMultiple:!!l.multiple},$e("invalid",c);break;case"textarea":DN(c,l),$e("invalid",c)}sh(n,l),a=null;for(var r in l)if(l.hasOwnProperty(r)){var d=l[r];r==="children"?typeof d=="string"?c.textContent!==d&&(l.suppressHydrationWarning!==!0&&gW(c.textContent,d,t),a=["children",d]):typeof d=="number"&&c.textContent!==""+d&&(l.suppressHydrationWarning!==!0&&gW(c.textContent,d,t),a=["children",""+d]):Cs.hasOwnProperty(r)&&d!=null&&r==="onScroll"&&$e("scroll",c)}switch(n){case"input":oW(c),TN(c,l,!0);break;case"textarea":oW(c),QN(c);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(c.onclick=CW)}c=a,e.updateQueue=c,c!==null&&(e.flags|=4)}else{r=a.nodeType===9?a:a.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=UN(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=r.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof c.is=="string"?t=r.createElement(n,{is:c.is}):(t=r.createElement(n),n==="select"&&(r=t,c.multiple?r.multiple=!0:c.size&&(r.size=c.size))):t=r.createElementNS(t,n),t[Ml]=e,t[lb]=c,r3(t,e,!1,!1),e.stateNode=t;t:{switch(r=bh(n,c),n){case"dialog":$e("cancel",t),$e("close",t),a=c;break;case"iframe":case"object":case"embed":$e("load",t),a=c;break;case"video":case"audio":for(a=0;a<nb.length;a++)$e(nb[a],t);a=c;break;case"source":$e("error",t),a=c;break;case"img":case"image":case"link":$e("error",t),$e("load",t),a=c;break;case"details":$e("toggle",t),a=c;break;case"input":FN(t,c),a=rh(t,c),$e("invalid",t);break;case"option":a=c;break;case"select":t._wrapperState={wasMultiple:!!c.multiple},a=Zn({},c,{value:void 0}),$e("invalid",t);break;case"textarea":DN(t,c),a=oh(t,c),$e("invalid",t);break;default:a=c}sh(n,a),d=a;for(l in d)if(d.hasOwnProperty(l)){var o=d[l];l==="style"?KN(t,o):l==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,o!=null&&EN(t,o)):l==="children"?typeof o=="string"?(n!=="textarea"||o!=="")&&xs(t,o):typeof o=="number"&&xs(t,""+o):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Cs.hasOwnProperty(l)?o!=null&&l==="onScroll"&&$e("scroll",t):o!=null&&P2(t,l,o,r))}switch(n){case"input":oW(t),TN(t,c,!1);break;case"textarea":oW(t),QN(t);break;case"option":c.value!=null&&t.setAttribute("value",""+Fr(c.value));break;case"select":t.multiple=!!c.multiple,l=c.value,l!=null?bo(t,!!c.multiple,l,!1):c.defaultValue!=null&&bo(t,!!c.multiple,c.defaultValue,!0);break;default:typeof a.onClick=="function"&&(t.onclick=CW)}switch(n){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break t;case"img":c=!0;break t;default:c=!1}}c&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return dc(e),null;case 6:if(t&&e.stateNode!=null)d3(t,e,t.memoizedProps,c);else{if(typeof c!="string"&&e.stateNode===null)throw Error(Wt(166));if(n=td(ub.current),td(Nl.current),IW(e)){if(c=e.stateNode,n=e.memoizedProps,c[Ml]=e,(l=c.nodeValue!==n)&&(t=aa,t!==null))switch(t.tag){case 3:gW(c.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&gW(c.nodeValue,n,(t.mode&1)!==0)}l&&(e.flags|=4)}else c=(n.nodeType===9?n:n.ownerDocument).createTextNode(c),c[Ml]=e,e.stateNode=c}return dc(e),null;case 13:if(qe(Wn),c=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(on&&la!==null&&e.mode&1&&!(e.flags&128))uR(),No(),e.flags|=98560,l=!1;else if(l=IW(e),c!==null&&c.dehydrated!==null){if(t===null){if(!l)throw Error(Wt(318));if(l=e.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(Wt(317));l[Ml]=e}else No(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;dc(e),l=!1}else qa!==null&&(HX(qa),qa=null),l=!0;if(!l)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(c=c!==null,c!==(t!==null&&t.memoizedState!==null)&&c&&(e.child.flags|=8192,e.mode&1&&(t===null||Wn.current&1?xn===0&&(xn=3):BX())),e.updateQueue!==null&&(e.flags|=4),dc(e),null);case 4:return Vo(),VX(t,e),t===null&&cb(e.stateNode.containerInfo),dc(e),null;case 10:return lX(e.type._context),dc(e),null;case 17:return Ic(e.type)&&AW(),dc(e),null;case 19:if(qe(Wn),l=e.memoizedState,l===null)return dc(e),null;if(c=(e.flags&128)!==0,r=l.rendering,r===null)if(c)Wb(l,!1);else{if(xn!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(r=UW(t),r!==null){for(e.flags|=128,Wb(l,!1),c=r.updateQueue,c!==null&&(e.updateQueue=c,e.flags|=4),e.subtreeFlags=0,c=n,n=e.child;n!==null;)l=n,t=c,l.flags&=14680066,r=l.alternate,r===null?(l.childLanes=0,l.lanes=t,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,l.type=r.type,t=r.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return Ue(Wn,Wn.current&1|2),e.child}t=t.sibling}l.tail!==null&&pn()>Ao&&(e.flags|=128,c=!0,Wb(l,!1),e.lanes=4194304)}else{if(!c)if(t=UW(r),t!==null){if(e.flags|=128,c=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Wb(l,!0),l.tail===null&&l.tailMode==="hidden"&&!r.alternate&&!on)return dc(e),null}else 2*pn()-l.renderingStartTime>Ao&&n!==1073741824&&(e.flags|=128,c=!0,Wb(l,!1),e.lanes=4194304);l.isBackwards?(r.sibling=e.child,e.child=r):(n=l.last,n!==null?n.sibling=r:e.child=r,l.last=r)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=pn(),e.sibling=null,n=Wn.current,Ue(Wn,c?n&1|2:n&1),e):(dc(e),null);case 22:case 23:return DX(),c=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==c&&(e.flags|=8192),c&&e.mode&1?ra&1073741824&&(dc(e),e.subtreeFlags&6&&(e.flags|=8192)):dc(e),null;case 24:return null;case 25:return null}throw Error(Wt(156,e.tag))}function QB(t,e){switch(qh(e),e.tag){case 1:return Ic(e.type)&&AW(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Vo(),qe(Sc),qe(rc),ZX(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return bX(e),null;case 13:if(qe(Wn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Wt(340));No()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return qe(Wn),null;case 4:return Vo(),null;case 10:return lX(e.type._context),null;case 22:case 23:return DX(),null;case 24:return null;default:return null}}var em=!1,oc=!1,UB=typeof WeakSet=="function"?WeakSet:Set,Ft=null;function Co(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(c){vn(t,e,c)}else n.current=null}function gX(t,e,n){try{n()}catch(c){vn(t,e,c)}}var o3=!1;function EB(t,e){if(Dh=GW,t=Iz(),Oh(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else t:{n=(n=t.ownerDocument)&&n.defaultView||window;var c=n.getSelection&&n.getSelection();if(c&&c.rangeCount!==0){n=c.anchorNode;var a=c.anchorOffset,l=c.focusNode;c=c.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break t}var r=0,d=-1,o=-1,i=0,u=0,s=t,b=null;e:for(;;){for(var Z;s!==n||a!==0&&s.nodeType!==3||(d=r+a),s!==l||c!==0&&s.nodeType!==3||(o=r+c),s.nodeType===3&&(r+=s.nodeValue.length),(Z=s.firstChild)!==null;)b=s,s=Z;for(;;){if(s===t)break e;if(b===n&&++i===a&&(d=r),b===l&&++u===c&&(o=r),(Z=s.nextSibling)!==null)break;s=b,b=s.parentNode}s=Z}n=d===-1||o===-1?null:{start:d,end:o}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bh={focusedElem:t,selectionRange:n},GW=!1,Ft=e;Ft!==null;)if(e=Ft,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ft=t;else for(;Ft!==null;){e=Ft;try{var W=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(W!==null){var m=W.memoizedProps,G=W.memoizedState,L=e.stateNode,h=L.getSnapshotBeforeUpdate(e.elementType===e.type?m:tl(e.type,m),G);L.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var p=e.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Wt(163))}}catch(Y){vn(e,e.return,Y)}if(t=e.sibling,t!==null){t.return=e.return,Ft=t;break}Ft=e.return}return W=o3,o3=!1,W}function mb(t,e,n){var c=e.updateQueue;if(c=c!==null?c.lastEffect:null,c!==null){var a=c=c.next;do{if((a.tag&t)===t){var l=a.destroy;a.destroy=void 0,l!==void 0&&gX(e,n,l)}a=a.next}while(a!==c)}}function nm(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var c=n.create;n.destroy=c()}n=n.next}while(n!==e)}}function CX(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function u3(t){var e=t.alternate;e!==null&&(t.alternate=null,u3(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Ml],delete e[lb],delete e[Ph],delete e[wB],delete e[VB])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function s3(t){return t.tag===5||t.tag===3||t.tag===4}function b3(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||s3(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function jX(t,e,n){var c=t.tag;if(c===5||c===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=CW));else if(c!==4&&(t=t.child,t!==null))for(jX(t,e,n),t=t.sibling;t!==null;)jX(t,e,n),t=t.sibling}function AX(t,e,n){var c=t.tag;if(c===5||c===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(c!==4&&(t=t.child,t!==null))for(AX(t,e,n),t=t.sibling;t!==null;)AX(t,e,n),t=t.sibling}var Pn=null,el=!1;function ti(t,e,n){for(n=n.child;n!==null;)y3(t,e,n),n=n.sibling}function y3(t,e,n){if(fl&&typeof fl.onCommitFiberUnmount=="function")try{fl.onCommitFiberUnmount(WW,n)}catch{}switch(n.tag){case 5:oc||Co(n,e);case 6:var c=Pn,a=el;Pn=null,ti(t,e,n),Pn=c,el=a,Pn!==null&&(el?(t=Pn,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Pn.removeChild(n.stateNode));break;case 18:Pn!==null&&(el?(t=Pn,n=n.stateNode,t.nodeType===8?Eh(t.parentNode,n):t.nodeType===1&&Eh(t,n),Es(t)):Eh(Pn,n.stateNode));break;case 4:c=Pn,a=el,Pn=n.stateNode.containerInfo,el=!0,ti(t,e,n),Pn=c,el=a;break;case 0:case 11:case 14:case 15:if(!oc&&(c=n.updateQueue,c!==null&&(c=c.lastEffect,c!==null))){a=c=c.next;do{var l=a,r=l.destroy;l=l.tag,r!==void 0&&(l&2||l&4)&&gX(n,e,r),a=a.next}while(a!==c)}ti(t,e,n);break;case 1:if(!oc&&(Co(n,e),c=n.stateNode,typeof c.componentWillUnmount=="function"))try{c.props=n.memoizedProps,c.state=n.memoizedState,c.componentWillUnmount()}catch(d){vn(n,e,d)}ti(t,e,n);break;case 21:ti(t,e,n);break;case 22:n.mode&1?(oc=(c=oc)||n.memoizedState!==null,ti(t,e,n),oc=c):ti(t,e,n);break;default:ti(t,e,n)}}function Z3(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new UB),e.forEach(function(c){var a=c6.bind(null,t,c);n.has(c)||(n.add(c),c.then(a,a))})}}function nl(t,e){var n=e.deletions;if(n!==null)for(var c=0;c<n.length;c++){var a=n[c];try{var l=t,r=e,d=r;t:for(;d!==null;){switch(d.tag){case 5:Pn=d.stateNode,el=!1;break t;case 3:Pn=d.stateNode.containerInfo,el=!0;break t;case 4:Pn=d.stateNode.containerInfo,el=!0;break t}d=d.return}if(Pn===null)throw Error(Wt(160));y3(l,r,a),Pn=null,el=!1;var o=a.alternate;o!==null&&(o.return=null),a.return=null}catch(i){vn(a,e,i)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)W3(e,t),e=e.sibling}function W3(t,e){var n=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(nl(e,t),Rl(t),c&4){try{mb(3,t,t.return),nm(3,t)}catch(m){vn(t,t.return,m)}try{mb(5,t,t.return)}catch(m){vn(t,t.return,m)}}break;case 1:nl(e,t),Rl(t),c&512&&n!==null&&Co(n,n.return);break;case 5:if(nl(e,t),Rl(t),c&512&&n!==null&&Co(n,n.return),t.flags&32){var a=t.stateNode;try{xs(a,"")}catch(m){vn(t,t.return,m)}}if(c&4&&(a=t.stateNode,a!=null)){var l=t.memoizedProps,r=n!==null?n.memoizedProps:l,d=t.type,o=t.updateQueue;if(t.updateQueue=null,o!==null)try{d==="input"&&l.type==="radio"&&l.name!=null&&HN(a,l),bh(d,r);var i=bh(d,l);for(r=0;r<o.length;r+=2){var u=o[r],s=o[r+1];u==="style"?KN(a,s):u==="dangerouslySetInnerHTML"?EN(a,s):u==="children"?xs(a,s):P2(a,u,s,i)}switch(d){case"input":ih(a,l);break;case"textarea":BN(a,l);break;case"select":var b=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!l.multiple;var Z=l.value;Z!=null?bo(a,!!l.multiple,Z,!1):b!==!!l.multiple&&(l.defaultValue!=null?bo(a,!!l.multiple,l.defaultValue,!0):bo(a,!!l.multiple,l.multiple?[]:"",!1))}a[lb]=l}catch(m){vn(t,t.return,m)}}break;case 6:if(nl(e,t),Rl(t),c&4){if(t.stateNode===null)throw Error(Wt(162));a=t.stateNode,l=t.memoizedProps;try{a.nodeValue=l}catch(m){vn(t,t.return,m)}}break;case 3:if(nl(e,t),Rl(t),c&4&&n!==null&&n.memoizedState.isDehydrated)try{Es(e.containerInfo)}catch(m){vn(t,t.return,m)}break;case 4:nl(e,t),Rl(t);break;case 13:nl(e,t),Rl(t),a=t.child,a.flags&8192&&(l=a.memoizedState!==null,a.stateNode.isHidden=l,!l||a.alternate!==null&&a.alternate.memoizedState!==null||(kX=pn())),c&4&&Z3(t);break;case 22:if(u=n!==null&&n.memoizedState!==null,t.mode&1?(oc=(i=oc)||u,nl(e,t),oc=i):nl(e,t),Rl(t),c&8192){if(i=t.memoizedState!==null,(t.stateNode.isHidden=i)&&!u&&t.mode&1)for(Ft=t,u=t.child;u!==null;){for(s=Ft=u;Ft!==null;){switch(b=Ft,Z=b.child,b.tag){case 0:case 11:case 14:case 15:mb(4,b,b.return);break;case 1:Co(b,b.return);var W=b.stateNode;if(typeof W.componentWillUnmount=="function"){c=b,n=b.return;try{e=c,W.props=e.memoizedProps,W.state=e.memoizedState,W.componentWillUnmount()}catch(m){vn(c,n,m)}}break;case 5:Co(b,b.return);break;case 22:if(b.memoizedState!==null){h3(s);continue}}Z!==null?(Z.return=b,Ft=Z):h3(s)}u=u.sibling}t:for(u=null,s=t;;){if(s.tag===5){if(u===null){u=s;try{a=s.stateNode,i?(l=a.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(d=s.stateNode,o=s.memoizedProps.style,r=o!=null&&o.hasOwnProperty("display")?o.display:null,d.style.display=PN("display",r))}catch(m){vn(t,t.return,m)}}}else if(s.tag===6){if(u===null)try{s.stateNode.nodeValue=i?"":s.memoizedProps}catch(m){vn(t,t.return,m)}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===t)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break t;for(;s.sibling===null;){if(s.return===null||s.return===t)break t;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}}break;case 19:nl(e,t),Rl(t),c&4&&Z3(t);break;case 21:break;default:nl(e,t),Rl(t)}}function Rl(t){var e=t.flags;if(e&2){try{t:{for(var n=t.return;n!==null;){if(s3(n)){var c=n;break t}n=n.return}throw Error(Wt(160))}switch(c.tag){case 5:var a=c.stateNode;c.flags&32&&(xs(a,""),c.flags&=-33);var l=b3(t);AX(t,l,a);break;case 3:case 4:var r=c.stateNode.containerInfo,d=b3(t);jX(t,d,r);break;default:throw Error(Wt(161))}}catch(o){vn(t,t.return,o)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function PB(t,e,n){Ft=t,m3(t)}function m3(t,e,n){for(var c=(t.mode&1)!==0;Ft!==null;){var a=Ft,l=a.child;if(a.tag===22&&c){var r=a.memoizedState!==null||em;if(!r){var d=a.alternate,o=d!==null&&d.memoizedState!==null||oc;d=em;var i=oc;if(em=r,(oc=o)&&!i)for(Ft=a;Ft!==null;)r=Ft,o=r.child,r.tag===22&&r.memoizedState!==null?X3(a):o!==null?(o.return=r,Ft=o):X3(a);for(;l!==null;)Ft=l,m3(l),l=l.sibling;Ft=a,em=d,oc=i}L3(t)}else a.subtreeFlags&8772&&l!==null?(l.return=a,Ft=l):L3(t)}}function L3(t){for(;Ft!==null;){var e=Ft;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:oc||nm(5,e);break;case 1:var c=e.stateNode;if(e.flags&4&&!oc)if(n===null)c.componentDidMount();else{var a=e.elementType===e.type?n.memoizedProps:tl(e.type,n.memoizedProps);c.componentDidUpdate(a,n.memoizedState,c.__reactInternalSnapshotBeforeUpdate)}var l=e.updateQueue;l!==null&&ZR(e,l,c);break;case 3:var r=e.updateQueue;if(r!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}ZR(e,r,n)}break;case 5:var d=e.stateNode;if(n===null&&e.flags&4){n=d;var o=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":o.autoFocus&&n.focus();break;case"img":o.src&&(n.src=o.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var i=e.alternate;if(i!==null){var u=i.memoizedState;if(u!==null){var s=u.dehydrated;s!==null&&Es(s)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Wt(163))}oc||e.flags&512&&CX(e)}catch(b){vn(e,e.return,b)}}if(e===t){Ft=null;break}if(n=e.sibling,n!==null){n.return=e.return,Ft=n;break}Ft=e.return}}function h3(t){for(;Ft!==null;){var e=Ft;if(e===t){Ft=null;break}var n=e.sibling;if(n!==null){n.return=e.return,Ft=n;break}Ft=e.return}}function X3(t){for(;Ft!==null;){var e=Ft;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{nm(4,e)}catch(o){vn(e,n,o)}break;case 1:var c=e.stateNode;if(typeof c.componentDidMount=="function"){var a=e.return;try{c.componentDidMount()}catch(o){vn(e,a,o)}}var l=e.return;try{CX(e)}catch(o){vn(e,l,o)}break;case 5:var r=e.return;try{CX(e)}catch(o){vn(e,r,o)}}}catch(o){vn(e,e.return,o)}if(e===t){Ft=null;break}var d=e.sibling;if(d!==null){d.return=e.return,Ft=d;break}Ft=e.return}}var KB=Math.ceil,cm=nr.ReactCurrentDispatcher,OX=nr.ReactCurrentOwner,za=nr.ReactCurrentBatchConfig,fe=0,Fn=null,gn=null,Kn=0,ra=0,jo=Pr(0),xn=0,Lb=null,nd=0,am=0,xX=0,hb=null,Hc=null,kX=0,Ao=1/0,ur=null,lm=!1,SX=null,ei=null,rm=!1,ni=null,im=0,Xb=0,IX=null,dm=-1,om=0;function pc(){return fe&6?pn():dm!==-1?dm:dm=pn()}function ci(t){return t.mode&1?fe&2&&Kn!==0?Kn&-Kn:CB.transition!==null?(om===0&&(om=sz()),om):(t=Ie,t!==0||(t=window.event,t=t===void 0?16:vz(t.type)),t):1}function cl(t,e,n,c){if(50<Xb)throw Xb=0,IX=null,Error(Wt(185));Ts(t,n,c),(!(fe&2)||t!==Fn)&&(t===Fn&&(!(fe&2)&&(am|=n),xn===4&&ai(t,Kn)),Tc(t,c),n===1&&fe===0&&!(e.mode&1)&&(Ao=pn()+500,xW&&_r()))}function Tc(t,e){var n=t.callbackNode;CD(t,e);var c=hW(t,t===Fn?Kn:0);if(c===0)n!==null&&dz(n),t.callbackNode=null,t.callbackPriority=0;else if(e=c&-c,t.callbackPriority!==e){if(n!=null&&dz(n),e===1)t.tag===0?gB(G3.bind(null,t)):lR(G3.bind(null,t)),zB(function(){!(fe&6)&&_r()}),n=null;else{switch(bz(c)){case 1:n=Xh;break;case 4:n=oz;break;case 16:n=ZW;break;case 536870912:n=uz;break;default:n=ZW}n=R3(n,v3.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function v3(t,e){if(dm=-1,om=0,fe&6)throw Error(Wt(327));var n=t.callbackNode;if(Oo()&&t.callbackNode!==n)return null;var c=hW(t,t===Fn?Kn:0);if(c===0)return null;if(c&30||c&t.expiredLanes||e)e=um(t,c);else{e=c;var a=fe;fe|=2;var l=Y3();(Fn!==t||Kn!==e)&&(ur=null,Ao=pn()+500,ad(t,e));do try{qB();break}catch(d){p3(t,d)}while(1);aX(),cm.current=l,fe=a,gn!==null?e=0:(Fn=null,Kn=0,e=xn)}if(e!==0){if(e===2&&(a=vh(t),a!==0&&(c=a,e=FX(t,a))),e===1)throw n=Lb,ad(t,0),ai(t,c),Tc(t,pn()),n;if(e===6)ai(t,c);else{if(a=t.current.alternate,!(c&30)&&!_B(a)&&(e=um(t,c),e===2&&(l=vh(t),l!==0&&(c=l,e=FX(t,l))),e===1))throw n=Lb,ad(t,0),ai(t,c),Tc(t,pn()),n;switch(t.finishedWork=a,t.finishedLanes=c,e){case 0:case 1:throw Error(Wt(345));case 2:ld(t,Hc,ur);break;case 3:if(ai(t,c),(c&130023424)===c&&(e=kX+500-pn(),10<e)){if(hW(t,0)!==0)break;if(a=t.suspendedLanes,(a&c)!==c){pc(),t.pingedLanes|=t.suspendedLanes&a;break}t.timeoutHandle=Uh(ld.bind(null,t,Hc,ur),e);break}ld(t,Hc,ur);break;case 4:if(ai(t,c),(c&4194240)===c)break;for(e=t.eventTimes,a=-1;0<c;){var r=31-_a(c);l=1<<r,r=e[r],r>a&&(a=r),c&=~l}if(c=a,c=pn()-c,c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3e3>c?3e3:4320>c?4320:1960*KB(c/1960))-c,10<c){t.timeoutHandle=Uh(ld.bind(null,t,Hc,ur),c);break}ld(t,Hc,ur);break;case 5:ld(t,Hc,ur);break;default:throw Error(Wt(329))}}}return Tc(t,pn()),t.callbackNode===n?v3.bind(null,t):null}function FX(t,e){var n=hb;return t.current.memoizedState.isDehydrated&&(ad(t,e).flags|=256),t=um(t,e),t!==2&&(e=Hc,Hc=n,e!==null&&HX(e)),t}function HX(t){Hc===null?Hc=t:Hc.push.apply(Hc,t)}function _B(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var c=0;c<n.length;c++){var a=n[c],l=a.getSnapshot;a=a.value;try{if(!$a(l(),a))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ai(t,e){for(e&=~xX,e&=~am,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-_a(e),c=1<<n;t[n]=-1,e&=~c}}function G3(t){if(fe&6)throw Error(Wt(327));Oo();var e=hW(t,0);if(!(e&1))return Tc(t,pn()),null;var n=um(t,e);if(t.tag!==0&&n===2){var c=vh(t);c!==0&&(e=c,n=FX(t,c))}if(n===1)throw n=Lb,ad(t,0),ai(t,e),Tc(t,pn()),n;if(n===6)throw Error(Wt(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,ld(t,Hc,ur),Tc(t,pn()),null}function TX(t,e){var n=fe;fe|=1;try{return t(e)}finally{fe=n,fe===0&&(Ao=pn()+500,xW&&_r())}}function cd(t){ni!==null&&ni.tag===0&&!(fe&6)&&Oo();var e=fe;fe|=1;var n=za.transition,c=Ie;try{if(za.transition=null,Ie=1,t)return t()}finally{Ie=c,za.transition=n,fe=e,!(fe&6)&&_r()}}function DX(){ra=jo.current,qe(jo)}function ad(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,NB(n)),gn!==null)for(n=gn.return;n!==null;){var c=n;switch(qh(c),c.tag){case 1:c=c.type.childContextTypes,c!=null&&AW();break;case 3:Vo(),qe(Sc),qe(rc),ZX();break;case 5:bX(c);break;case 4:Vo();break;case 13:qe(Wn);break;case 19:qe(Wn);break;case 10:lX(c.type._context);break;case 22:case 23:DX()}n=n.return}if(Fn=t,gn=t=li(t.current,null),Kn=ra=e,xn=0,Lb=null,xX=am=nd=0,Hc=hb=null,qi!==null){for(e=0;e<qi.length;e++)if(n=qi[e],c=n.interleaved,c!==null){n.interleaved=null;var a=c.next,l=n.pending;if(l!==null){var r=l.next;l.next=a,c.next=r}n.pending=c}qi=null}return t}function p3(t,e){do{var n=gn;try{if(aX(),EW.current=$W,PW){for(var c=mn.memoizedState;c!==null;){var a=c.queue;a!==null&&(a.pending=null),c=c.next}PW=!1}if(ed=0,In=On=mn=null,sb=!1,bb=0,OX.current=null,n===null||n.return===null){xn=1,Lb=e,gn=null;break}t:{var l=t,r=n.return,d=n,o=e;if(e=Kn,d.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){var i=o,u=d,s=u.tag;if(!(u.mode&1)&&(s===0||s===11||s===15)){var b=u.alternate;b?(u.updateQueue=b.updateQueue,u.memoizedState=b.memoizedState,u.lanes=b.lanes):(u.updateQueue=null,u.memoizedState=null)}var Z=UR(r);if(Z!==null){Z.flags&=-257,ER(Z,r,d,l,e),Z.mode&1&&QR(l,i,e),e=Z,o=i;var W=e.updateQueue;if(W===null){var m=new Set;m.add(o),e.updateQueue=m}else W.add(o);break t}else{if(!(e&1)){QR(l,i,e),BX();break t}o=Error(Wt(426))}}else if(on&&d.mode&1){var G=UR(r);if(G!==null){!(G.flags&65536)&&(G.flags|=256),ER(G,r,d,l,e),nX(go(o,d));break t}}l=o=go(o,d),xn!==4&&(xn=2),hb===null?hb=[l]:hb.push(l),l=r;do{switch(l.tag){case 3:l.flags|=65536,e&=-e,l.lanes|=e;var L=DR(l,o,e);yR(l,L);break t;case 1:d=o;var h=l.type,p=l.stateNode;if(!(l.flags&128)&&(typeof h.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(ei===null||!ei.has(p)))){l.flags|=65536,e&=-e,l.lanes|=e;var Y=BR(l,d,e);yR(l,Y);break t}}l=l.return}while(l!==null)}f3(n)}catch(J){e=J,gn===n&&n!==null&&(gn=n=n.return);continue}break}while(1)}function Y3(){var t=cm.current;return cm.current=$W,t===null?$W:t}function BX(){(xn===0||xn===3||xn===2)&&(xn=4),Fn===null||!(nd&268435455)&&!(am&268435455)||ai(Fn,Kn)}function um(t,e){var n=fe;fe|=2;var c=Y3();(Fn!==t||Kn!==e)&&(ur=null,ad(t,e));do try{$B();break}catch(a){p3(t,a)}while(1);if(aX(),fe=n,cm.current=c,gn!==null)throw Error(Wt(261));return Fn=null,Kn=0,xn}function $B(){for(;gn!==null;)J3(gn)}function qB(){for(;gn!==null&&!JD();)J3(gn)}function J3(t){var e=z3(t.alternate,t,ra);t.memoizedProps=t.pendingProps,e===null?f3(t):gn=e,OX.current=null}function f3(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=QB(n,e),n!==null){n.flags&=32767,gn=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{xn=6,gn=null;return}}else if(n=BB(n,e,ra),n!==null){gn=n;return}if(e=e.sibling,e!==null){gn=e;return}gn=e=t}while(e!==null);xn===0&&(xn=5)}function ld(t,e,n){var c=Ie,a=za.transition;try{za.transition=null,Ie=1,t6(t,e,n,c)}finally{za.transition=a,Ie=c}return null}function t6(t,e,n,c){do Oo();while(ni!==null);if(fe&6)throw Error(Wt(327));n=t.finishedWork;var a=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(Wt(177));t.callbackNode=null,t.callbackPriority=0;var l=n.lanes|n.childLanes;if(jD(t,l),t===Fn&&(gn=Fn=null,Kn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||rm||(rm=!0,R3(ZW,function(){return Oo(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=za.transition,za.transition=null;var r=Ie;Ie=1;var d=fe;fe|=4,OX.current=null,EB(t,n),W3(n,t),vB(Bh),GW=!!Dh,Bh=Dh=null,t.current=n,PB(n),fD(),fe=d,Ie=r,za.transition=l}else t.current=n;if(rm&&(rm=!1,ni=t,im=a),l=t.pendingLanes,l===0&&(ei=null),zD(n.stateNode),Tc(t,pn()),e!==null)for(c=t.onRecoverableError,n=0;n<e.length;n++)a=e[n],c(a.value,{componentStack:a.stack,digest:a.digest});if(lm)throw lm=!1,t=SX,SX=null,t;return im&1&&t.tag!==0&&Oo(),l=t.pendingLanes,l&1?t===IX?Xb++:(Xb=0,IX=t):Xb=0,_r(),null}function Oo(){if(ni!==null){var t=bz(im),e=za.transition,n=Ie;try{if(za.transition=null,Ie=16>t?16:t,ni===null)var c=!1;else{if(t=ni,ni=null,im=0,fe&6)throw Error(Wt(331));var a=fe;for(fe|=4,Ft=t.current;Ft!==null;){var l=Ft,r=l.child;if(Ft.flags&16){var d=l.deletions;if(d!==null){for(var o=0;o<d.length;o++){var i=d[o];for(Ft=i;Ft!==null;){var u=Ft;switch(u.tag){case 0:case 11:case 15:mb(8,u,l)}var s=u.child;if(s!==null)s.return=u,Ft=s;else for(;Ft!==null;){u=Ft;var b=u.sibling,Z=u.return;if(u3(u),u===i){Ft=null;break}if(b!==null){b.return=Z,Ft=b;break}Ft=Z}}}var W=l.alternate;if(W!==null){var m=W.child;if(m!==null){W.child=null;do{var G=m.sibling;m.sibling=null,m=G}while(m!==null)}}Ft=l}}if(l.subtreeFlags&2064&&r!==null)r.return=l,Ft=r;else t:for(;Ft!==null;){if(l=Ft,l.flags&2048)switch(l.tag){case 0:case 11:case 15:mb(9,l,l.return)}var L=l.sibling;if(L!==null){L.return=l.return,Ft=L;break t}Ft=l.return}}var h=t.current;for(Ft=h;Ft!==null;){r=Ft;var p=r.child;if(r.subtreeFlags&2064&&p!==null)p.return=r,Ft=p;else t:for(r=h;Ft!==null;){if(d=Ft,d.flags&2048)try{switch(d.tag){case 0:case 11:case 15:nm(9,d)}}catch(J){vn(d,d.return,J)}if(d===r){Ft=null;break t}var Y=d.sibling;if(Y!==null){Y.return=d.return,Ft=Y;break t}Ft=d.return}}if(fe=a,_r(),fl&&typeof fl.onPostCommitFiberRoot=="function")try{fl.onPostCommitFiberRoot(WW,t)}catch{}c=!0}return c}finally{Ie=n,za.transition=e}}return!1}function M3(t,e,n){e=go(n,e),e=DR(t,e,1),t=qr(t,e,1),e=pc(),t!==null&&(Ts(t,1,e),Tc(t,e))}function vn(t,e,n){if(t.tag===3)M3(t,t,n);else for(;e!==null;){if(e.tag===3){M3(e,t,n);break}else if(e.tag===1){var c=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(ei===null||!ei.has(c))){t=go(n,t),t=BR(e,t,1),e=qr(e,t,1),t=pc(),e!==null&&(Ts(e,1,t),Tc(e,t));break}}e=e.return}}function e6(t,e,n){var c=t.pingCache;c!==null&&c.delete(e),e=pc(),t.pingedLanes|=t.suspendedLanes&n,Fn===t&&(Kn&n)===n&&(xn===4||xn===3&&(Kn&130023424)===Kn&&500>pn()-kX?ad(t,0):xX|=n),Tc(t,e)}function N3(t,e){e===0&&(t.mode&1?(e=LW,LW<<=1,!(LW&130023424)&&(LW=4194304)):e=1);var n=pc();t=ir(t,e),t!==null&&(Ts(t,e,n),Tc(t,n))}function n6(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),N3(t,n)}function c6(t,e){var n=0;switch(t.tag){case 13:var c=t.stateNode,a=t.memoizedState;a!==null&&(n=a.retryLane);break;case 19:c=t.stateNode;break;default:throw Error(Wt(314))}c!==null&&c.delete(e),N3(t,n)}var z3;z3=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Sc.current)Fc=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Fc=!1,DB(t,e,n);Fc=!!(t.flags&131072)}else Fc=!1,on&&e.flags&1048576&&rR(e,SW,e.index);switch(e.lanes=0,e.tag){case 2:var c=e.type;tm(t,e),t=e.pendingProps;var a=Jo(e,rc.current);Ro(e,n),a=LX(null,e,c,t,a,n);var l=hX();return e.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ic(c)?(l=!0,OW(e)):l=!1,e.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,dX(e),a.updater=BW,e.stateNode=a,a._reactInternals=e,uX(e,c,t,n),e=MX(null,e,c,!0,l,n)):(e.tag=0,on&&l&&$h(e),Gc(null,e,a,n),e=e.child),e;case 16:c=e.elementType;t:{switch(tm(t,e),t=e.pendingProps,a=c._init,c=a(c._payload),e.type=c,a=e.tag=l6(c),t=tl(c,t),a){case 0:e=fX(null,e,c,t,n);break t;case 1:e=t3(null,e,c,t,n);break t;case 11:e=PR(null,e,c,t,n);break t;case 14:e=KR(null,e,c,tl(c.type,t),n);break t}throw Error(Wt(306,c,""))}return e;case 0:return c=e.type,a=e.pendingProps,a=e.elementType===c?a:tl(c,a),fX(t,e,c,a,n);case 1:return c=e.type,a=e.pendingProps,a=e.elementType===c?a:tl(c,a),t3(t,e,c,a,n);case 3:t:{if(e3(e),t===null)throw Error(Wt(387));c=e.pendingProps,l=e.memoizedState,a=l.element,bR(t,e),DW(e,c,null,n);var r=e.memoizedState;if(c=r.element,l.isDehydrated)if(l={element:c,isDehydrated:!1,cache:r.cache,pendingSuspenseBoundaries:r.pendingSuspenseBoundaries,transitions:r.transitions},e.updateQueue.baseState=l,e.memoizedState=l,e.flags&256){a=go(Error(Wt(423)),e),e=n3(t,e,c,n,a);break t}else if(c!==a){a=go(Error(Wt(424)),e),e=n3(t,e,c,n,a);break t}else for(la=Er(e.stateNode.containerInfo.firstChild),aa=e,on=!0,qa=null,n=GR(e,null,c,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(No(),c===a){e=or(t,e,n);break t}Gc(t,e,c,n)}e=e.child}return e;case 5:return pR(e),t===null&&eX(e),c=e.type,a=e.pendingProps,l=t!==null?t.memoizedProps:null,r=a.children,Qh(c,a)?r=null:l!==null&&Qh(c,l)&&(e.flags|=32),qR(t,e),Gc(t,e,r,n),e.child;case 6:return t===null&&eX(e),null;case 13:return c3(t,e,n);case 4:return sX(e,e.stateNode.containerInfo),c=e.pendingProps,t===null?e.child=wo(e,null,c,n):Gc(t,e,c,n),e.child;case 11:return c=e.type,a=e.pendingProps,a=e.elementType===c?a:tl(c,a),PR(t,e,c,a,n);case 7:return Gc(t,e,e.pendingProps,n),e.child;case 8:return Gc(t,e,e.pendingProps.children,n),e.child;case 12:return Gc(t,e,e.pendingProps.children,n),e.child;case 10:t:{if(c=e.type._context,a=e.pendingProps,l=e.memoizedProps,r=a.value,Ue(FW,c._currentValue),c._currentValue=r,l!==null)if($a(l.value,r)){if(l.children===a.children&&!Sc.current){e=or(t,e,n);break t}}else for(l=e.child,l!==null&&(l.return=e);l!==null;){var d=l.dependencies;if(d!==null){r=l.child;for(var o=d.firstContext;o!==null;){if(o.context===c){if(l.tag===1){o=dr(-1,n&-n),o.tag=2;var i=l.updateQueue;if(i!==null){i=i.shared;var u=i.pending;u===null?o.next=o:(o.next=u.next,u.next=o),i.pending=o}}l.lanes|=n,o=l.alternate,o!==null&&(o.lanes|=n),rX(l.return,n,e),d.lanes|=n;break}o=o.next}}else if(l.tag===10)r=l.type===e.type?null:l.child;else if(l.tag===18){if(r=l.return,r===null)throw Error(Wt(341));r.lanes|=n,d=r.alternate,d!==null&&(d.lanes|=n),rX(r,n,e),r=l.sibling}else r=l.child;if(r!==null)r.return=l;else for(r=l;r!==null;){if(r===e){r=null;break}if(l=r.sibling,l!==null){l.return=r.return,r=l;break}r=r.return}l=r}Gc(t,e,a.children,n),e=e.child}return e;case 9:return a=e.type,c=e.pendingProps.children,Ro(e,n),a=Ma(a),c=c(a),e.flags|=1,Gc(t,e,c,n),e.child;case 14:return c=e.type,a=tl(c,e.pendingProps),a=tl(c.type,a),KR(t,e,c,a,n);case 15:return _R(t,e,e.type,e.pendingProps,n);case 17:return c=e.type,a=e.pendingProps,a=e.elementType===c?a:tl(c,a),tm(t,e),e.tag=1,Ic(c)?(t=!0,OW(e)):t=!1,Ro(e,n),LR(e,c,a),uX(e,c,a,n),MX(null,e,c,!0,t,n);case 19:return l3(t,e,n);case 22:return $R(t,e,n)}throw Error(Wt(156,e.tag))};function R3(t,e){return iz(t,e)}function a6(t,e,n,c){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ra(t,e,n,c){return new a6(t,e,n,c)}function QX(t){return t=t.prototype,!(!t||!t.isReactComponent)}function l6(t){if(typeof t=="function")return QX(t)?1:0;if(t!=null){if(t=t.$$typeof,t===$2)return 11;if(t===eh)return 14}return 2}function li(t,e){var n=t.alternate;return n===null?(n=Ra(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function sm(t,e,n,c,a,l){var r=2;if(c=t,typeof t=="function")QX(t)&&(r=1);else if(typeof t=="string")r=5;else t:switch(t){case so:return rd(n.children,a,l,e);case K2:r=8,a|=8;break;case _2:return t=Ra(12,n,e,a|2),t.elementType=_2,t.lanes=l,t;case q2:return t=Ra(13,n,e,a),t.elementType=q2,t.lanes=l,t;case th:return t=Ra(19,n,e,a),t.elementType=th,t.lanes=l,t;case xN:return bm(n,a,l,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case AN:r=10;break t;case ON:r=9;break t;case $2:r=11;break t;case eh:r=14;break t;case Ir:r=16,c=null;break t}throw Error(Wt(130,t==null?t:typeof t,""))}return e=Ra(r,n,e,a),e.elementType=t,e.type=c,e.lanes=l,e}function rd(t,e,n,c){return t=Ra(7,t,c,e),t.lanes=n,t}function bm(t,e,n,c){return t=Ra(22,t,c,e),t.elementType=xN,t.lanes=n,t.stateNode={isHidden:!1},t}function UX(t,e,n){return t=Ra(6,t,null,e),t.lanes=n,t}function EX(t,e,n){return e=Ra(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function r6(t,e,n,c,a){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Gh(0),this.expirationTimes=Gh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gh(0),this.identifierPrefix=c,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function PX(t,e,n,c,a,l,r,d,o){return t=new r6(t,e,n,d,o),e===1?(e=1,l===!0&&(e|=8)):e=0,l=Ra(3,null,null,e),t.current=l,l.stateNode=t,l.memoizedState={element:c,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},dX(l),t}function i6(t,e,n){var c=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:uo,key:c==null?null:""+c,children:t,containerInfo:e,implementation:n}}function w3(t){if(!t)return Kr;t=t._reactInternals;t:{if(Ei(t)!==t||t.tag!==1)throw Error(Wt(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break t;case 1:if(Ic(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break t}}e=e.return}while(e!==null);throw Error(Wt(171))}if(t.tag===1){var n=t.type;if(Ic(n))return cR(t,n,e)}return e}function V3(t,e,n,c,a,l,r,d,o){return t=PX(n,c,!0,t,a,l,r,d,o),t.context=w3(null),n=t.current,c=pc(),a=ci(n),l=dr(c,a),l.callback=e??null,qr(n,l,a),t.current.lanes=a,Ts(t,a,c),Tc(t,c),t}function ym(t,e,n,c){var a=e.current,l=pc(),r=ci(a);return n=w3(n),e.context===null?e.context=n:e.pendingContext=n,e=dr(l,r),e.payload={element:t},c=c===void 0?null:c,c!==null&&(e.callback=c),t=qr(a,e,r),t!==null&&(cl(t,a,r,l),TW(t,a,r)),r}function Zm(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function g3(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function KX(t,e){g3(t,e),(t=t.alternate)&&g3(t,e)}function d6(){return null}var C3=typeof reportError=="function"?reportError:function(t){console.error(t)};function _X(t){this._internalRoot=t}Wm.prototype.render=_X.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(Wt(409));ym(t,e,null,null)},Wm.prototype.unmount=_X.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;cd(function(){ym(null,t,null,null)}),e[cr]=null}};function Wm(t){this._internalRoot=t}Wm.prototype.unstable_scheduleHydration=function(t){if(t){var e=Wz();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Br.length&&e!==0&&e<Br[n].priority;n++);Br.splice(n,0,t),n===0&&hz(t)}};function $X(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function mm(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function j3(){}function o6(t,e,n,c,a){if(a){if(typeof c=="function"){var l=c;c=function(){var i=Zm(r);l.call(i)}}var r=V3(e,c,t,0,null,!1,!1,"",j3);return t._reactRootContainer=r,t[cr]=r.current,cb(t.nodeType===8?t.parentNode:t),cd(),r}for(;a=t.lastChild;)t.removeChild(a);if(typeof c=="function"){var d=c;c=function(){var i=Zm(o);d.call(i)}}var o=PX(t,0,!1,null,null,!1,!1,"",j3);return t._reactRootContainer=o,t[cr]=o.current,cb(t.nodeType===8?t.parentNode:t),cd(function(){ym(e,o,n,c)}),o}function Lm(t,e,n,c,a){var l=n._reactRootContainer;if(l){var r=l;if(typeof a=="function"){var d=a;a=function(){var o=Zm(r);d.call(o)}}ym(e,r,t,a)}else r=o6(n,e,t,a,c);return Zm(r)}yz=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Hs(e.pendingLanes);n!==0&&(ph(e,n|1),Tc(e,pn()),!(fe&6)&&(Ao=pn()+500,_r()))}break;case 13:cd(function(){var c=ir(t,1);if(c!==null){var a=pc();cl(c,t,1,a)}}),KX(t,1)}},Yh=function(t){if(t.tag===13){var e=ir(t,134217728);if(e!==null){var n=pc();cl(e,t,134217728,n)}KX(t,134217728)}},Zz=function(t){if(t.tag===13){var e=ci(t),n=ir(t,e);if(n!==null){var c=pc();cl(n,t,e,c)}KX(t,e)}},Wz=function(){return Ie},mz=function(t,e){var n=Ie;try{return Ie=t,e()}finally{Ie=n}},Wh=function(t,e,n){switch(e){case"input":if(ih(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var c=n[e];if(c!==t&&c.form===t.form){var a=jW(c);if(!a)throw Error(Wt(90));IN(c),ih(c,a)}}}break;case"textarea":BN(t,n);break;case"select":e=n.value,e!=null&&bo(t,!!n.multiple,e,!1)}},tz=TX,ez=cd;var u6={usingClientEntryPoint:!1,Events:[rb,po,jW,$N,qN,TX]},vb={findFiberByHostInstance:Pi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},s6={bundleType:vb.bundleType,version:vb.version,rendererPackageName:vb.rendererPackageName,rendererConfig:vb.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:nr.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=lz(t),t===null?null:t.stateNode},findFiberByHostInstance:vb.findFiberByHostInstance||d6,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hm.isDisabled&&hm.supportsFiber)try{WW=hm.inject(s6),fl=hm}catch{}}ea.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=u6,ea.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!$X(e))throw Error(Wt(200));return i6(t,e,null,n)},ea.createRoot=function(t,e){if(!$X(t))throw Error(Wt(299));var n=!1,c="",a=C3;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(c=e.identifierPrefix),e.onRecoverableError!==void 0&&(a=e.onRecoverableError)),e=PX(t,1,!1,null,null,n,!1,c,a),t[cr]=e.current,cb(t.nodeType===8?t.parentNode:t),new _X(e)},ea.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(Wt(188)):(t=Object.keys(t).join(","),Error(Wt(268,t)));return t=lz(e),t=t===null?null:t.stateNode,t},ea.flushSync=function(t){return cd(t)},ea.hydrate=function(t,e,n){if(!mm(e))throw Error(Wt(200));return Lm(null,t,e,!0,n)},ea.hydrateRoot=function(t,e,n){if(!$X(t))throw Error(Wt(405));var c=n!=null&&n.hydratedSources||null,a=!1,l="",r=C3;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(r=n.onRecoverableError)),e=V3(e,null,t,1,n??null,a,!1,l,r),t[cr]=e.current,cb(t),c)for(t=0;t<c.length;t++)n=c[t],a=n._getVersion,a=a(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,a]:e.mutableSourceEagerHydrationData.push(n,a);return new Wm(e)},ea.render=function(t,e,n){if(!mm(e))throw Error(Wt(200));return Lm(null,t,e,!1,n)},ea.unmountComponentAtNode=function(t){if(!mm(t))throw Error(Wt(40));return t._reactRootContainer?(cd(function(){Lm(null,null,t,!1,function(){t._reactRootContainer=null,t[cr]=null})}),!0):!1},ea.unstable_batchedUpdates=TX,ea.unstable_renderSubtreeIntoContainer=function(t,e,n,c){if(!mm(n))throw Error(Wt(200));if(t==null||t._reactInternals===void 0)throw Error(Wt(38));return Lm(t,e,n,!1,c)},ea.version="18.2.0-next-9e3b772b8-20220608";function A3(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(A3)}catch(t){console.error(t)}}A3(),zN.exports=ea;var id=zN.exports;const Gb=Rt(id),b6=_e({__proto__:null,default:Gb},[id]);function y6(t){t()}function Z6(t){t||(t=y6),nN({reactionScheduler:t})}function W6(t){return FT(t)}var m6=1e4,L6=1e4,h6=function(){function t(e){var n=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(c){c===void 0&&(c=m6),clearTimeout(n.sweepTimeout),n.sweepTimeout=void 0;var a=Date.now();n.registrations.forEach(function(l,r){a-l.registeredAt>=c&&(n.finalize(l.value),n.registrations.delete(r))}),n.registrations.size>0&&n.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){n.sweep(0)}})}return Object.defineProperty(t.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,n,c){this.registrations.set(c,{value:n,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(t.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.registrations.delete(e)}}),Object.defineProperty(t.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,L6))}}),t}(),X6=typeof FinalizationRegistry<"u"?FinalizationRegistry:h6,qX=new X6(function(t){var e;(e=t.reaction)===null||e===void 0||e.dispose(),t.reaction=null}),O3=globalThis&&globalThis.__read||function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var c=n.call(t),a,l=[],r;try{for(;(e===void 0||e-- >0)&&!(a=c.next()).done;)l.push(a.value)}catch(d){r={error:d}}finally{try{a&&!a.done&&(n=c.return)&&n.call(c)}finally{if(r)throw r.error}}return l};function x3(t){return"observer".concat(t)}var v6=function(){function t(){}return t}();function G6(){return new v6}function p6(t,e){e===void 0&&(e="observed");var n=O3(X.useState(G6),1),c=n[0],a=O3(X.useState(),2),l=a[1],r=function(){return l([])},d=X.useRef(null);d.current||(d.current={reaction:null,mounted:!1,changedBeforeMount:!1});var o=d.current;o.reaction||(o.reaction=new Di(x3(e),function(){o.mounted?r():o.changedBeforeMount=!0}),qX.register(c,o,o)),X.useDebugValue(o.reaction,W6),X.useEffect(function(){return qX.unregister(o),o.mounted=!0,o.reaction?o.changedBeforeMount&&(o.changedBeforeMount=!1,r()):(o.reaction=new Di(x3(e),function(){r()}),r()),function(){o.reaction.dispose(),o.reaction=null,o.mounted=!1,o.changedBeforeMount=!1}},[]);var i,u;if(o.reaction.track(function(){try{i=t()}catch(s){u=s}}),u)throw u;return i}var k3=typeof Symbol=="function"&&Symbol.for,S3=k3?Symbol.for("react.forward_ref"):typeof v.forwardRef=="function"&&v.forwardRef(function(t){return null}).$$typeof,I3=k3?Symbol.for("react.memo"):typeof v.memo=="function"&&v.memo(function(t){return null}).$$typeof;function Y6(t,e){var n;if(I3&&t.$$typeof===I3)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");var c=(n=e==null?void 0:e.forwardRef)!==null&&n!==void 0?n:!1,a=t,l=t.displayName||t.name;if(S3&&t.$$typeof===S3&&(c=!0,a=t.render,typeof a!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var r=function(d,o){return p6(function(){return a(d,o)},l)};return l!==""&&(r.displayName=l),t.contextTypes&&(r.contextTypes=t.contextTypes),c&&(r=v.forwardRef(r)),r=v.memo(r),f6(t,r),r}var J6={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function f6(t,e){Object.keys(t).forEach(function(n){J6[n]||Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}globalThis&&globalThis.__read;var tv;Z6(id.unstable_batchedUpdates),tv=qX.finalizeAllImmediately;var F3=0;function M6(t){if(typeof Symbol=="function")return Symbol(t);var e="__$mobx-react "+t+" ("+F3+")";return F3++,e}var ev={};function ri(t){return ev[t]||(ev[t]=M6(t)),ev[t]}function H3(t,e){if(T3(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),c=Object.keys(e);if(n.length!==c.length)return!1;for(var a=0;a<n.length;a++)if(!Object.hasOwnProperty.call(e,n[a])||!T3(t[n[a]],e[n[a]]))return!1;return!0}function T3(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}function sr(t,e,n){Object.hasOwnProperty.call(t,e)?t[e]=n:Object.defineProperty(t,e,{enumerable:!1,configurable:!0,writable:!0,value:n})}var D3=ri("patchMixins"),B3=ri("patchedDefinition");function N6(t,e){var n=t[D3]=t[D3]||{},c=n[e]=n[e]||{};return c.locks=c.locks||0,c.methods=c.methods||[],c}function Q3(t,e){for(var n=this,c=arguments.length,a=new Array(c>2?c-2:0),l=2;l<c;l++)a[l-2]=arguments[l];e.locks++;try{var r;return t!=null&&(r=t.apply(this,a)),r}finally{e.locks--,e.locks===0&&e.methods.forEach(function(d){d.apply(n,a)})}}function U3(t,e){var n=function(){for(var a=arguments.length,l=new Array(a),r=0;r<a;r++)l[r]=arguments[r];Q3.call.apply(Q3,[this,t,e].concat(l))};return n}function E3(t,e,n){var c=N6(t,e);c.methods.indexOf(n)<0&&c.methods.push(n);var a=Object.getOwnPropertyDescriptor(t,e);if(!(a&&a[B3])){var l=t[e],r=P3(t,e,a?a.enumerable:void 0,c,l);Object.defineProperty(t,e,r)}}function P3(t,e,n,c,a){var l,r=U3(a,c);return l={},l[B3]=!0,l.get=function(){return r},l.set=function(o){if(this===t)r=U3(o,c);else{var i=P3(this,e,n,c,o);Object.defineProperty(this,e,i)}},l.configurable=!0,l.enumerable=n,l}var xo=ee||"$mobx",K3=ri("isMobXReactObserver"),nv=ri("isUnmounted"),Xm=ri("skipRender"),vm=ri("isForcingUpdate");function z6(t){var e=t.prototype;if(t[K3]){var n=Gm(e);console.warn("The provided component class ("+n+`)
50
50
  has already been declared as an observer component.`)}else t[K3]=!0;if(e.componentWillReact)throw new Error("The componentWillReact life-cycle event is no longer supported");if(t.__proto__!==v.PureComponent){if(!e.shouldComponentUpdate)e.shouldComponentUpdate=_3;else if(e.shouldComponentUpdate!==_3)throw new Error("It is not allowed to use shouldComponentUpdate in observer based components.")}cv(e,"props"),cv(e,"state"),t.contextType&&cv(e,"context");var c=e.render;if(typeof c!="function"){var a=Gm(e);throw new Error("[mobx-react] class component ("+a+") is missing `render` method.\n`observer` requires `render` being a function defined on prototype.\n`render = () => {}` or `render = function() {}` is not supported.")}return e.render=function(){return this.render=R6.call(this,c),this.render()},E3(e,"componentDidMount",function(){this[nv]=!1,this.render[xo]||v.Component.prototype.forceUpdate.call(this)}),E3(e,"componentWillUnmount",function(){var l=this.render[xo];if(l)l.dispose(),this.render[xo]=null;else{var r=Gm(this);console.warn("The reactive render of an observer class component ("+r+`)
51
51
  was overridden after MobX attached. This may result in a memory leak if the
52
- overridden reactive render was not properly disposed.`)}this[nv]=!0}),t}function Gm(t){return t.displayName||t.name||t.constructor&&(t.constructor.displayName||t.constructor.name)||"<component>"}function R6(t){var e=this;sr(this,Xm,!1),sr(this,vm,!1);var n=Gm(this),c=t.bind(this),a=!1,l=function(){var o=new Di(n+".render()",function(){if(!a&&(a=!0,e[nv]!==!0)){var i=!0;try{sr(e,vm,!0),e[Xm]||v.Component.prototype.forceUpdate.call(e),i=!1}finally{sr(e,vm,!1),i&&(o.dispose(),e.render[xo]=null)}}});return o.reactComponent=e,o};function r(){var d;a=!1;var o=(d=r[xo])!=null?d:r[xo]=l(),i=void 0,u=void 0;if(o.track(function(){try{u=C2(!1,c)}catch(s){i=s}}),i)throw i;return u}return r}function _3(t,e){return this.state!==e?!0:!H3(this.props,t)}function cv(t,e){var n=ri("reactProp_"+e+"_valueHolder"),c=ri("reactProp_"+e+"_atomHolder");function a(){return this[c]||sr(this,c,V2("reactive "+e)),this[c]}Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){var r=!1;return lo&&Or&&(r=lo(!0)),a.call(this).reportObserved(),lo&&Or&&Or(r),this[n]},set:function(r){!this[vm]&&!H3(this[n],r)?(sr(this,n,r),sr(this,Xm,!0),a.call(this).reportChanged(),sr(this,Xm,!1)):sr(this,n,r)}})}function $3(t){return t.isMobxInjector===!0&&console.warn("Mobx observer: You are trying to use `observer` on a component that already has `inject`. Please apply `observer` before applying `inject`"),Object.prototype.isPrototypeOf.call(v.Component,t)||Object.prototype.isPrototypeOf.call(v.PureComponent,t)?z6(t):Y6(t)}if(!v.Component)throw new Error("mobx-react requires React to be available");if(!Ge)throw new Error("mobx-react requires mobx to be available");class al{constructor(e,n,c,a,l,r,d,o,i,u,s="component",b,Z={}){Ke(this,Ky,void 0);rt(this,"component");this.actionsInitializer=c,this.valued=a,this.valueType=l,this.defaultProps=r,this.css=d,this.wrapperCss=o,this.typeName=i,this.icon=u,this.kind=s,this.readOnly=b,this.propsBindingTypes=Z,this.component=$3(e),this.component.displayName=e.displayName||e.name,Ac(this,Ky,n)}get name(){return de(this,Ky)??this.type}get type(){return this.typeName||this.component.displayName||this.component.name}}Ky=new WeakMap;var Yc=(t=>(t.LTR="ltr",t.RTL="rtl",t))(Yc||{});function dd(t,e=null){const n=v.createContext(e);n.displayName=t;const c=w6(n),a=V6(n);return[c,a,n]}function w6(t){return()=>{const e=v.useContext(t);if(!e)throw new Error(`The context ${t.displayName} didn't found!`);return e}}function V6(t){return t.Provider}const[g6,C6]=dd("RepeaterPropsContext"),av=t=>{const{className:e}=g6();return _("div",{className:e,children:t.children})};av.displayName="RepeaterItem";const j6=new al(av,"RepeaterItem"),[lv,gDt,CDt]=dd("BuilderContext",{builderMode:"viewer"}),[ia,rv,A6]=dd("StoreContext");class pb{constructor(e,n){rt(this,"key");rt(this,"name");rt(this,"editor");rt(this,"hint");rt(this,"localizable",!1);rt(this,"valued",!1);rt(this,"readOnly",!1);rt(this,"editorProps");rt(this,"default");rt(this,"type");rt(this,"required",!1);rt(this,"validator");rt(this,"errorMap");rt(this,"calculable",!0);rt(this,"slotConditionBuilder");rt(this,"bindingType");this.key=e,this.name=n}clone(){return Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this))}}class O6 extends pb{}var x6=typeof global=="object"&&global&&global.Object===Object&&global;const q3=x6;var k6=typeof self=="object"&&self&&self.Object===Object&&self,S6=q3||k6||Function("return this")();const wl=S6;var I6=wl.Symbol;const Vl=I6;var tw=Object.prototype,F6=tw.hasOwnProperty,H6=tw.toString,Yb=Vl?Vl.toStringTag:void 0;function T6(t){var e=F6.call(t,Yb),n=t[Yb];try{t[Yb]=void 0;var c=!0}catch{}var a=H6.call(t);return c&&(e?t[Yb]=n:delete t[Yb]),a}var D6=Object.prototype,B6=D6.toString;function Q6(t){return B6.call(t)}var U6="[object Null]",E6="[object Undefined]",ew=Vl?Vl.toStringTag:void 0;function od(t){return t==null?t===void 0?E6:U6:ew&&ew in Object(t)?T6(t):Q6(t)}function gl(t){return t!=null&&typeof t=="object"}var P6="[object Symbol]";function iv(t){return typeof t=="symbol"||gl(t)&&od(t)==P6}function K6(t,e){for(var n=-1,c=t==null?0:t.length,a=Array(c);++n<c;)a[n]=e(t[n],n,t);return a}var _6=Array.isArray;const Jc=_6;var $6=1/0,nw=Vl?Vl.prototype:void 0,cw=nw?nw.toString:void 0;function aw(t){if(typeof t=="string")return t;if(Jc(t))return K6(t,aw)+"";if(iv(t))return cw?cw.call(t):"";var e=t+"";return e=="0"&&1/t==-$6?"-0":e}function wa(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function pm(t){return t}var q6="[object AsyncFunction]",t7="[object Function]",e7="[object GeneratorFunction]",n7="[object Proxy]";function dv(t){if(!wa(t))return!1;var e=od(t);return e==t7||e==e7||e==q6||e==n7}var c7=wl["__core-js_shared__"];const ov=c7;var lw=function(){var t=/[^.]+$/.exec(ov&&ov.keys&&ov.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function a7(t){return!!lw&&lw in t}var l7=Function.prototype,r7=l7.toString;function ud(t){if(t!=null){try{return r7.call(t)}catch{}try{return t+""}catch{}}return""}var i7=/[\\^$.*+?()[\]{}|]/g,d7=/^\[object .+?Constructor\]$/,o7=Function.prototype,u7=Object.prototype,s7=o7.toString,b7=u7.hasOwnProperty,y7=RegExp("^"+s7.call(b7).replace(i7,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Z7(t){if(!wa(t)||a7(t))return!1;var e=dv(t)?y7:d7;return e.test(ud(t))}function W7(t,e){return t==null?void 0:t[e]}function sd(t,e){var n=W7(t,e);return Z7(n)?n:void 0}var m7=sd(wl,"WeakMap");const uv=m7;var rw=Object.create,L7=function(){function t(){}return function(e){if(!wa(e))return{};if(rw)return rw(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();const h7=L7;function X7(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function iw(t,e){var n=-1,c=t.length;for(e||(e=Array(c));++n<c;)e[n]=t[n];return e}var v7=800,G7=16,p7=Date.now;function Y7(t){var e=0,n=0;return function(){var c=p7(),a=G7-(c-n);if(n=c,a>0){if(++e>=v7)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function J7(t){return function(){return t}}var f7=function(){try{var t=sd(Object,"defineProperty");return t({},"",{}),t}catch{}}();const Ym=f7;var M7=Ym?function(t,e){return Ym(t,"toString",{configurable:!0,enumerable:!1,value:J7(e),writable:!0})}:pm,N7=Y7(M7);const z7=N7;function R7(t,e){for(var n=-1,c=t==null?0:t.length;++n<c&&e(t[n],n,t)!==!1;);return t}var w7=9007199254740991,V7=/^(?:0|[1-9]\d*)$/;function sv(t,e){var n=typeof t;return e=e??w7,!!e&&(n=="number"||n!="symbol"&&V7.test(t))&&t>-1&&t%1==0&&t<e}function bv(t,e,n){e=="__proto__"&&Ym?Ym(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Jb(t,e){return t===e||t!==t&&e!==e}var g7=Object.prototype,C7=g7.hasOwnProperty;function yv(t,e,n){var c=t[e];(!(C7.call(t,e)&&Jb(c,n))||n===void 0&&!(e in t))&&bv(t,e,n)}function ko(t,e,n,c){var a=!n;n||(n={});for(var l=-1,r=e.length;++l<r;){var d=e[l],o=c?c(n[d],t[d],d,n,t):void 0;o===void 0&&(o=t[d]),a?bv(n,d,o):yv(n,d,o)}return n}var dw=Math.max;function j7(t,e,n){return e=dw(e===void 0?t.length-1:e,0),function(){for(var c=arguments,a=-1,l=dw(c.length-e,0),r=Array(l);++a<l;)r[a]=c[e+a];a=-1;for(var d=Array(e+1);++a<e;)d[a]=c[a];return d[e]=n(r),X7(t,this,d)}}function A7(t,e){return z7(j7(t,e,pm),t+"")}var O7=9007199254740991;function Zv(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=O7}function bd(t){return t!=null&&Zv(t.length)&&!dv(t)}function x7(t,e,n){if(!wa(n))return!1;var c=typeof e;return(c=="number"?bd(n)&&sv(e,n.length):c=="string"&&e in n)?Jb(n[e],t):!1}function ow(t){return A7(function(e,n){var c=-1,a=n.length,l=a>1?n[a-1]:void 0,r=a>2?n[2]:void 0;for(l=t.length>3&&typeof l=="function"?(a--,l):void 0,r&&x7(n[0],n[1],r)&&(l=a<3?void 0:l,a=1),e=Object(e);++c<a;){var d=n[c];d&&t(e,d,c,l)}return e})}var k7=Object.prototype;function fb(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||k7;return t===n}function S7(t,e){for(var n=-1,c=Array(t);++n<t;)c[n]=e(n);return c}var I7="[object Arguments]";function uw(t){return gl(t)&&od(t)==I7}var sw=Object.prototype,F7=sw.hasOwnProperty,H7=sw.propertyIsEnumerable,T7=uw(function(){return arguments}())?uw:function(t){return gl(t)&&F7.call(t,"callee")&&!H7.call(t,"callee")};const Mb=T7;function D7(){return!1}var bw=typeof ie=="object"&&ie&&!ie.nodeType&&ie,yw=bw&&typeof module=="object"&&module&&!module.nodeType&&module,B7=yw&&yw.exports===bw,Zw=B7?wl.Buffer:void 0,Q7=Zw?Zw.isBuffer:void 0,U7=Q7||D7;const So=U7;var E7="[object Arguments]",P7="[object Array]",K7="[object Boolean]",_7="[object Date]",$7="[object Error]",q7="[object Function]",tQ="[object Map]",eQ="[object Number]",nQ="[object Object]",cQ="[object RegExp]",aQ="[object Set]",lQ="[object String]",rQ="[object WeakMap]",iQ="[object ArrayBuffer]",dQ="[object DataView]",oQ="[object Float32Array]",uQ="[object Float64Array]",sQ="[object Int8Array]",bQ="[object Int16Array]",yQ="[object Int32Array]",ZQ="[object Uint8Array]",WQ="[object Uint8ClampedArray]",mQ="[object Uint16Array]",LQ="[object Uint32Array]",tn={};tn[oQ]=tn[uQ]=tn[sQ]=tn[bQ]=tn[yQ]=tn[ZQ]=tn[WQ]=tn[mQ]=tn[LQ]=!0,tn[E7]=tn[P7]=tn[iQ]=tn[K7]=tn[dQ]=tn[_7]=tn[$7]=tn[q7]=tn[tQ]=tn[eQ]=tn[nQ]=tn[cQ]=tn[aQ]=tn[lQ]=tn[rQ]=!1;function hQ(t){return gl(t)&&Zv(t.length)&&!!tn[od(t)]}function Wv(t){return function(e){return t(e)}}var Ww=typeof ie=="object"&&ie&&!ie.nodeType&&ie,Nb=Ww&&typeof module=="object"&&module&&!module.nodeType&&module,XQ=Nb&&Nb.exports===Ww,mv=XQ&&q3.process,vQ=function(){try{var t=Nb&&Nb.require&&Nb.require("util").types;return t||mv&&mv.binding&&mv.binding("util")}catch{}}();const Io=vQ;var mw=Io&&Io.isTypedArray,GQ=mw?Wv(mw):hQ;const Jm=GQ;var pQ=Object.prototype,YQ=pQ.hasOwnProperty;function Lw(t,e){var n=Jc(t),c=!n&&Mb(t),a=!n&&!c&&So(t),l=!n&&!c&&!a&&Jm(t),r=n||c||a||l,d=r?S7(t.length,String):[],o=d.length;for(var i in t)(e||YQ.call(t,i))&&!(r&&(i=="length"||a&&(i=="offset"||i=="parent")||l&&(i=="buffer"||i=="byteLength"||i=="byteOffset")||sv(i,o)))&&d.push(i);return d}function hw(t,e){return function(n){return t(e(n))}}var JQ=hw(Object.keys,Object);const fQ=JQ;var MQ=Object.prototype,NQ=MQ.hasOwnProperty;function Xw(t){if(!fb(t))return fQ(t);var e=[];for(var n in Object(t))NQ.call(t,n)&&n!="constructor"&&e.push(n);return e}function Fo(t){return bd(t)?Lw(t):Xw(t)}var zQ=Object.prototype,RQ=zQ.hasOwnProperty,wQ=ow(function(t,e){if(fb(e)||bd(e)){ko(e,Fo(e),t);return}for(var n in e)RQ.call(e,n)&&yv(t,n,e[n])});const ii=wQ;function VQ(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var gQ=Object.prototype,CQ=gQ.hasOwnProperty;function jQ(t){if(!wa(t))return VQ(t);var e=fb(t),n=[];for(var c in t)c=="constructor"&&(e||!CQ.call(t,c))||n.push(c);return n}function yd(t){return bd(t)?Lw(t,!0):jQ(t)}var AQ=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,OQ=/^\w*$/;function Lv(t,e){if(Jc(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||iv(t)?!0:OQ.test(t)||!AQ.test(t)||e!=null&&t in Object(e)}var xQ=sd(Object,"create");const zb=xQ;function kQ(){this.__data__=zb?zb(null):{},this.size=0}function SQ(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var IQ="__lodash_hash_undefined__",FQ=Object.prototype,HQ=FQ.hasOwnProperty;function TQ(t){var e=this.__data__;if(zb){var n=e[t];return n===IQ?void 0:n}return HQ.call(e,t)?e[t]:void 0}var DQ=Object.prototype,BQ=DQ.hasOwnProperty;function QQ(t){var e=this.__data__;return zb?e[t]!==void 0:BQ.call(e,t)}var UQ="__lodash_hash_undefined__";function EQ(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=zb&&e===void 0?UQ:e,this}function Zd(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var c=t[e];this.set(c[0],c[1])}}Zd.prototype.clear=kQ,Zd.prototype.delete=SQ,Zd.prototype.get=TQ,Zd.prototype.has=QQ,Zd.prototype.set=EQ;function PQ(){this.__data__=[],this.size=0}function fm(t,e){for(var n=t.length;n--;)if(Jb(t[n][0],e))return n;return-1}var KQ=Array.prototype,_Q=KQ.splice;function $Q(t){var e=this.__data__,n=fm(e,t);if(n<0)return!1;var c=e.length-1;return n==c?e.pop():_Q.call(e,n,1),--this.size,!0}function qQ(t){var e=this.__data__,n=fm(e,t);return n<0?void 0:e[n][1]}function tU(t){return fm(this.__data__,t)>-1}function eU(t,e){var n=this.__data__,c=fm(n,t);return c<0?(++this.size,n.push([t,e])):n[c][1]=e,this}function br(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var c=t[e];this.set(c[0],c[1])}}br.prototype.clear=PQ,br.prototype.delete=$Q,br.prototype.get=qQ,br.prototype.has=tU,br.prototype.set=eU;var nU=sd(wl,"Map");const Rb=nU;function cU(){this.size=0,this.__data__={hash:new Zd,map:new(Rb||br),string:new Zd}}function aU(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Mm(t,e){var n=t.__data__;return aU(e)?n[typeof e=="string"?"string":"hash"]:n.map}function lU(t){var e=Mm(this,t).delete(t);return this.size-=e?1:0,e}function rU(t){return Mm(this,t).get(t)}function iU(t){return Mm(this,t).has(t)}function dU(t,e){var n=Mm(this,t),c=n.size;return n.set(t,e),this.size+=n.size==c?0:1,this}function yr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var c=t[e];this.set(c[0],c[1])}}yr.prototype.clear=cU,yr.prototype.delete=lU,yr.prototype.get=rU,yr.prototype.has=iU,yr.prototype.set=dU;var oU="Expected a function";function hv(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(oU);var n=function(){var c=arguments,a=e?e.apply(this,c):c[0],l=n.cache;if(l.has(a))return l.get(a);var r=t.apply(this,c);return n.cache=l.set(a,r)||l,r};return n.cache=new(hv.Cache||yr),n}hv.Cache=yr;var uU=500;function sU(t){var e=hv(t,function(c){return n.size===uU&&n.clear(),c}),n=e.cache;return e}var bU=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yU=/\\(\\)?/g,ZU=sU(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(bU,function(n,c,a,l){e.push(a?l.replace(yU,"$1"):c||n)}),e});const WU=ZU;function wb(t){return t==null?"":aw(t)}function vw(t,e){return Jc(t)?t:Lv(t,e)?[t]:WU(wb(t))}var mU=1/0;function Nm(t){if(typeof t=="string"||iv(t))return t;var e=t+"";return e=="0"&&1/t==-mU?"-0":e}function Gw(t,e){e=vw(e,t);for(var n=0,c=e.length;t!=null&&n<c;)t=t[Nm(e[n++])];return n&&n==c?t:void 0}function LU(t,e,n){var c=t==null?void 0:Gw(t,e);return c===void 0?n:c}function pw(t,e){for(var n=-1,c=e.length,a=t.length;++n<c;)t[a+n]=e[n];return t}var hU=hw(Object.getPrototypeOf,Object);const Xv=hU;var XU="[object Object]",vU=Function.prototype,GU=Object.prototype,Yw=vU.toString,pU=GU.hasOwnProperty,YU=Yw.call(Object);function JU(t){if(!gl(t)||od(t)!=XU)return!1;var e=Xv(t);if(e===null)return!0;var n=pU.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Yw.call(n)==YU}function fU(t,e,n){var c=-1,a=t.length;e<0&&(e=-e>a?0:a+e),n=n>a?a:n,n<0&&(n+=a),a=e>n?0:n-e>>>0,e>>>=0;for(var l=Array(a);++c<a;)l[c]=t[c+e];return l}function MU(t,e,n){var c=t.length;return n=n===void 0?c:n,!e&&n>=c?t:fU(t,e,n)}var NU="\\ud800-\\udfff",zU="\\u0300-\\u036f",RU="\\ufe20-\\ufe2f",wU="\\u20d0-\\u20ff",VU=zU+RU+wU,gU="\\ufe0e\\ufe0f",CU="\\u200d",jU=RegExp("["+CU+NU+VU+gU+"]");function Jw(t){return jU.test(t)}function AU(t){return t.split("")}var fw="\\ud800-\\udfff",OU="\\u0300-\\u036f",xU="\\ufe20-\\ufe2f",kU="\\u20d0-\\u20ff",SU=OU+xU+kU,IU="\\ufe0e\\ufe0f",FU="["+fw+"]",vv="["+SU+"]",Gv="\\ud83c[\\udffb-\\udfff]",HU="(?:"+vv+"|"+Gv+")",Mw="[^"+fw+"]",Nw="(?:\\ud83c[\\udde6-\\uddff]){2}",zw="[\\ud800-\\udbff][\\udc00-\\udfff]",TU="\\u200d",Rw=HU+"?",ww="["+IU+"]?",DU="(?:"+TU+"(?:"+[Mw,Nw,zw].join("|")+")"+ww+Rw+")*",BU=ww+Rw+DU,QU="(?:"+[Mw+vv+"?",vv,Nw,zw,FU].join("|")+")",UU=RegExp(Gv+"(?="+Gv+")|"+QU+BU,"g");function EU(t){return t.match(UU)||[]}function PU(t){return Jw(t)?EU(t):AU(t)}function KU(t){return function(e){e=wb(e);var n=Jw(e)?PU(e):void 0,c=n?n[0]:e.charAt(0),a=n?MU(n,1).join(""):e.slice(1);return c[t]()+a}}var _U=KU("toUpperCase");const pv=_U;function $U(t){return pv(wb(t).toLowerCase())}function Vw(t,e,n,c){var a=-1,l=t==null?0:t.length;for(c&&l&&(n=t[++a]);++a<l;)n=e(n,t[a],a,t);return n}function qU(t){return function(e){return t==null?void 0:t[e]}}var tE={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},eE=qU(tE);const nE=eE;var cE=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,aE="\\u0300-\\u036f",lE="\\ufe20-\\ufe2f",rE="\\u20d0-\\u20ff",iE=aE+lE+rE,dE="["+iE+"]",oE=RegExp(dE,"g");function uE(t){return t=wb(t),t&&t.replace(cE,nE).replace(oE,"")}var sE=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function bE(t){return t.match(sE)||[]}var yE=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ZE(t){return yE.test(t)}var gw="\\ud800-\\udfff",WE="\\u0300-\\u036f",mE="\\ufe20-\\ufe2f",LE="\\u20d0-\\u20ff",hE=WE+mE+LE,Cw="\\u2700-\\u27bf",jw="a-z\\xdf-\\xf6\\xf8-\\xff",XE="\\xac\\xb1\\xd7\\xf7",vE="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",GE="\\u2000-\\u206f",pE=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Aw="A-Z\\xc0-\\xd6\\xd8-\\xde",YE="\\ufe0e\\ufe0f",Ow=XE+vE+GE+pE,xw="['’]",kw="["+Ow+"]",JE="["+hE+"]",Sw="\\d+",fE="["+Cw+"]",Iw="["+jw+"]",Fw="[^"+gw+Ow+Sw+Cw+jw+Aw+"]",ME="\\ud83c[\\udffb-\\udfff]",NE="(?:"+JE+"|"+ME+")",zE="[^"+gw+"]",Hw="(?:\\ud83c[\\udde6-\\uddff]){2}",Tw="[\\ud800-\\udbff][\\udc00-\\udfff]",Ho="["+Aw+"]",RE="\\u200d",Dw="(?:"+Iw+"|"+Fw+")",wE="(?:"+Ho+"|"+Fw+")",Bw="(?:"+xw+"(?:d|ll|m|re|s|t|ve))?",Qw="(?:"+xw+"(?:D|LL|M|RE|S|T|VE))?",Uw=NE+"?",Ew="["+YE+"]?",VE="(?:"+RE+"(?:"+[zE,Hw,Tw].join("|")+")"+Ew+Uw+")*",gE="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",CE="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",jE=Ew+Uw+VE,AE="(?:"+[fE,Hw,Tw].join("|")+")"+jE,OE=RegExp([Ho+"?"+Iw+"+"+Bw+"(?="+[kw,Ho,"$"].join("|")+")",wE+"+"+Qw+"(?="+[kw,Ho+Dw,"$"].join("|")+")",Ho+"?"+Dw+"+"+Bw,Ho+"+"+Qw,CE,gE,Sw,AE].join("|"),"g");function xE(t){return t.match(OE)||[]}function kE(t,e,n){return t=wb(t),e=n?void 0:e,e===void 0?ZE(t)?xE(t):bE(t):t.match(e)||[]}var SE="['’]",IE=RegExp(SE,"g");function Pw(t){return function(e){return Vw(kE(uE(e).replace(IE,"")),t,"")}}var FE=Pw(function(t,e,n){return e=e.toLowerCase(),t+(n?$U(e):e)});const HE=FE;function TE(){this.__data__=new br,this.size=0}function DE(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function BE(t){return this.__data__.get(t)}function QE(t){return this.__data__.has(t)}var UE=200;function EE(t,e){var n=this.__data__;if(n instanceof br){var c=n.__data__;if(!Rb||c.length<UE-1)return c.push([t,e]),this.size=++n.size,this;n=this.__data__=new yr(c)}return n.set(t,e),this.size=n.size,this}function ll(t){var e=this.__data__=new br(t);this.size=e.size}ll.prototype.clear=TE,ll.prototype.delete=DE,ll.prototype.get=BE,ll.prototype.has=QE,ll.prototype.set=EE;function PE(t,e){return t&&ko(e,Fo(e),t)}function KE(t,e){return t&&ko(e,yd(e),t)}var Kw=typeof ie=="object"&&ie&&!ie.nodeType&&ie,_w=Kw&&typeof module=="object"&&module&&!module.nodeType&&module,_E=_w&&_w.exports===Kw,$w=_E?wl.Buffer:void 0,qw=$w?$w.allocUnsafe:void 0;function tV(t,e){if(e)return t.slice();var n=t.length,c=qw?qw(n):new t.constructor(n);return t.copy(c),c}function $E(t,e){for(var n=-1,c=t==null?0:t.length,a=0,l=[];++n<c;){var r=t[n];e(r,n,t)&&(l[a++]=r)}return l}function eV(){return[]}var qE=Object.prototype,tP=qE.propertyIsEnumerable,nV=Object.getOwnPropertySymbols,eP=nV?function(t){return t==null?[]:(t=Object(t),$E(nV(t),function(e){return tP.call(t,e)}))}:eV;const Yv=eP;function nP(t,e){return ko(t,Yv(t),e)}var cP=Object.getOwnPropertySymbols,aP=cP?function(t){for(var e=[];t;)pw(e,Yv(t)),t=Xv(t);return e}:eV;const cV=aP;function lP(t,e){return ko(t,cV(t),e)}function aV(t,e,n){var c=e(t);return Jc(t)?c:pw(c,n(t))}function Jv(t){return aV(t,Fo,Yv)}function rP(t){return aV(t,yd,cV)}var iP=sd(wl,"DataView");const fv=iP;var dP=sd(wl,"Promise");const Mv=dP;var oP=sd(wl,"Set");const Nv=oP;var lV="[object Map]",uP="[object Object]",rV="[object Promise]",iV="[object Set]",dV="[object WeakMap]",oV="[object DataView]",sP=ud(fv),bP=ud(Rb),yP=ud(Mv),ZP=ud(Nv),WP=ud(uv),Wd=od;(fv&&Wd(new fv(new ArrayBuffer(1)))!=oV||Rb&&Wd(new Rb)!=lV||Mv&&Wd(Mv.resolve())!=rV||Nv&&Wd(new Nv)!=iV||uv&&Wd(new uv)!=dV)&&(Wd=function(t){var e=od(t),n=e==uP?t.constructor:void 0,c=n?ud(n):"";if(c)switch(c){case sP:return oV;case bP:return lV;case yP:return rV;case ZP:return iV;case WP:return dV}return e});const To=Wd;var mP=Object.prototype,LP=mP.hasOwnProperty;function hP(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&LP.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var XP=wl.Uint8Array;const zm=XP;function zv(t){var e=new t.constructor(t.byteLength);return new zm(e).set(new zm(t)),e}function vP(t,e){var n=e?zv(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var GP=/\w*$/;function pP(t){var e=new t.constructor(t.source,GP.exec(t));return e.lastIndex=t.lastIndex,e}var uV=Vl?Vl.prototype:void 0,sV=uV?uV.valueOf:void 0;function YP(t){return sV?Object(sV.call(t)):{}}function bV(t,e){var n=e?zv(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var JP="[object Boolean]",fP="[object Date]",MP="[object Map]",NP="[object Number]",zP="[object RegExp]",RP="[object Set]",wP="[object String]",VP="[object Symbol]",gP="[object ArrayBuffer]",CP="[object DataView]",jP="[object Float32Array]",AP="[object Float64Array]",OP="[object Int8Array]",xP="[object Int16Array]",kP="[object Int32Array]",SP="[object Uint8Array]",IP="[object Uint8ClampedArray]",FP="[object Uint16Array]",HP="[object Uint32Array]";function TP(t,e,n){var c=t.constructor;switch(e){case gP:return zv(t);case JP:case fP:return new c(+t);case CP:return vP(t,n);case jP:case AP:case OP:case xP:case kP:case SP:case IP:case FP:case HP:return bV(t,n);case MP:return new c;case NP:case wP:return new c(t);case zP:return pP(t);case RP:return new c;case VP:return YP(t)}}function yV(t){return typeof t.constructor=="function"&&!fb(t)?h7(Xv(t)):{}}var DP="[object Map]";function BP(t){return gl(t)&&To(t)==DP}var ZV=Io&&Io.isMap,QP=ZV?Wv(ZV):BP;const UP=QP;var EP="[object Set]";function PP(t){return gl(t)&&To(t)==EP}var WV=Io&&Io.isSet,KP=WV?Wv(WV):PP;const _P=KP;var $P=1,qP=2,tK=4,mV="[object Arguments]",eK="[object Array]",nK="[object Boolean]",cK="[object Date]",aK="[object Error]",LV="[object Function]",lK="[object GeneratorFunction]",rK="[object Map]",iK="[object Number]",hV="[object Object]",dK="[object RegExp]",oK="[object Set]",uK="[object String]",sK="[object Symbol]",bK="[object WeakMap]",yK="[object ArrayBuffer]",ZK="[object DataView]",WK="[object Float32Array]",mK="[object Float64Array]",LK="[object Int8Array]",hK="[object Int16Array]",XK="[object Int32Array]",vK="[object Uint8Array]",GK="[object Uint8ClampedArray]",pK="[object Uint16Array]",YK="[object Uint32Array]",Ee={};Ee[mV]=Ee[eK]=Ee[yK]=Ee[ZK]=Ee[nK]=Ee[cK]=Ee[WK]=Ee[mK]=Ee[LK]=Ee[hK]=Ee[XK]=Ee[rK]=Ee[iK]=Ee[hV]=Ee[dK]=Ee[oK]=Ee[uK]=Ee[sK]=Ee[vK]=Ee[GK]=Ee[pK]=Ee[YK]=!0,Ee[aK]=Ee[LV]=Ee[bK]=!1;function Rm(t,e,n,c,a,l){var r,d=e&$P,o=e&qP,i=e&tK;if(n&&(r=a?n(t,c,a,l):n(t)),r!==void 0)return r;if(!wa(t))return t;var u=Jc(t);if(u){if(r=hP(t),!d)return iw(t,r)}else{var s=To(t),b=s==LV||s==lK;if(So(t))return tV(t,d);if(s==hV||s==mV||b&&!a){if(r=o||b?{}:yV(t),!d)return o?lP(t,KE(r,t)):nP(t,PE(r,t))}else{if(!Ee[s])return a?t:{};r=TP(t,s,d)}}l||(l=new ll);var Z=l.get(t);if(Z)return Z;l.set(t,r),_P(t)?t.forEach(function(G){r.add(Rm(G,e,n,G,t,l))}):UP(t)&&t.forEach(function(G,L){r.set(L,Rm(G,e,n,L,t,l))});var W=i?o?rP:Jv:o?yd:Fo,m=u?void 0:W(t);return R7(m||t,function(G,L){m&&(L=G,G=t[L]),yv(r,L,Rm(G,e,n,L,t,l))}),r}var JK=4;function Rv(t){return Rm(t,JK)}var fK="__lodash_hash_undefined__";function MK(t){return this.__data__.set(t,fK),this}function NK(t){return this.__data__.has(t)}function wm(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new yr;++e<n;)this.add(t[e])}wm.prototype.add=wm.prototype.push=MK,wm.prototype.has=NK;function zK(t,e){for(var n=-1,c=t==null?0:t.length;++n<c;)if(e(t[n],n,t))return!0;return!1}function RK(t,e){return t.has(e)}var wK=1,VK=2;function XV(t,e,n,c,a,l){var r=n&wK,d=t.length,o=e.length;if(d!=o&&!(r&&o>d))return!1;var i=l.get(t),u=l.get(e);if(i&&u)return i==e&&u==t;var s=-1,b=!0,Z=n&VK?new wm:void 0;for(l.set(t,e),l.set(e,t);++s<d;){var W=t[s],m=e[s];if(c)var G=r?c(m,W,s,e,t,l):c(W,m,s,t,e,l);if(G!==void 0){if(G)continue;b=!1;break}if(Z){if(!zK(e,function(L,h){if(!RK(Z,h)&&(W===L||a(W,L,n,c,l)))return Z.push(h)})){b=!1;break}}else if(!(W===m||a(W,m,n,c,l))){b=!1;break}}return l.delete(t),l.delete(e),b}function gK(t){var e=-1,n=Array(t.size);return t.forEach(function(c,a){n[++e]=[a,c]}),n}function CK(t){var e=-1,n=Array(t.size);return t.forEach(function(c){n[++e]=c}),n}var jK=1,AK=2,OK="[object Boolean]",xK="[object Date]",kK="[object Error]",SK="[object Map]",IK="[object Number]",FK="[object RegExp]",HK="[object Set]",TK="[object String]",DK="[object Symbol]",BK="[object ArrayBuffer]",QK="[object DataView]",vV=Vl?Vl.prototype:void 0,wv=vV?vV.valueOf:void 0;function UK(t,e,n,c,a,l,r){switch(n){case QK:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case BK:return!(t.byteLength!=e.byteLength||!l(new zm(t),new zm(e)));case OK:case xK:case IK:return Jb(+t,+e);case kK:return t.name==e.name&&t.message==e.message;case FK:case TK:return t==e+"";case SK:var d=gK;case HK:var o=c&jK;if(d||(d=CK),t.size!=e.size&&!o)return!1;var i=r.get(t);if(i)return i==e;c|=AK,r.set(t,e);var u=XV(d(t),d(e),c,a,l,r);return r.delete(t),u;case DK:if(wv)return wv.call(t)==wv.call(e)}return!1}var EK=1,PK=Object.prototype,KK=PK.hasOwnProperty;function _K(t,e,n,c,a,l){var r=n&EK,d=Jv(t),o=d.length,i=Jv(e),u=i.length;if(o!=u&&!r)return!1;for(var s=o;s--;){var b=d[s];if(!(r?b in e:KK.call(e,b)))return!1}var Z=l.get(t),W=l.get(e);if(Z&&W)return Z==e&&W==t;var m=!0;l.set(t,e),l.set(e,t);for(var G=r;++s<o;){b=d[s];var L=t[b],h=e[b];if(c)var p=r?c(h,L,b,e,t,l):c(L,h,b,t,e,l);if(!(p===void 0?L===h||a(L,h,n,c,l):p)){m=!1;break}G||(G=b=="constructor")}if(m&&!G){var Y=t.constructor,J=e.constructor;Y!=J&&"constructor"in t&&"constructor"in e&&!(typeof Y=="function"&&Y instanceof Y&&typeof J=="function"&&J instanceof J)&&(m=!1)}return l.delete(t),l.delete(e),m}var $K=1,GV="[object Arguments]",pV="[object Array]",Vm="[object Object]",qK=Object.prototype,YV=qK.hasOwnProperty;function t_(t,e,n,c,a,l){var r=Jc(t),d=Jc(e),o=r?pV:To(t),i=d?pV:To(e);o=o==GV?Vm:o,i=i==GV?Vm:i;var u=o==Vm,s=i==Vm,b=o==i;if(b&&So(t)){if(!So(e))return!1;r=!0,u=!1}if(b&&!u)return l||(l=new ll),r||Jm(t)?XV(t,e,n,c,a,l):UK(t,e,o,n,c,a,l);if(!(n&$K)){var Z=u&&YV.call(t,"__wrapped__"),W=s&&YV.call(e,"__wrapped__");if(Z||W){var m=Z?t.value():t,G=W?e.value():e;return l||(l=new ll),a(m,G,n,c,l)}}return b?(l||(l=new ll),_K(t,e,n,c,a,l)):!1}function Vv(t,e,n,c,a){return t===e?!0:t==null||e==null||!gl(t)&&!gl(e)?t!==t&&e!==e:t_(t,e,n,c,Vv,a)}var e_=1,n_=2;function c_(t,e,n,c){var a=n.length,l=a,r=!c;if(t==null)return!l;for(t=Object(t);a--;){var d=n[a];if(r&&d[2]?d[1]!==t[d[0]]:!(d[0]in t))return!1}for(;++a<l;){d=n[a];var o=d[0],i=t[o],u=d[1];if(r&&d[2]){if(i===void 0&&!(o in t))return!1}else{var s=new ll;if(c)var b=c(i,u,o,t,e,s);if(!(b===void 0?Vv(u,i,e_|n_,c,s):b))return!1}}return!0}function JV(t){return t===t&&!wa(t)}function a_(t){for(var e=Fo(t),n=e.length;n--;){var c=e[n],a=t[c];e[n]=[c,a,JV(a)]}return e}function fV(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function l_(t){var e=a_(t);return e.length==1&&e[0][2]?fV(e[0][0],e[0][1]):function(n){return n===t||c_(n,t,e)}}function r_(t,e){return t!=null&&e in Object(t)}function i_(t,e,n){e=vw(e,t);for(var c=-1,a=e.length,l=!1;++c<a;){var r=Nm(e[c]);if(!(l=t!=null&&n(t,r)))break;t=t[r]}return l||++c!=a?l:(a=t==null?0:t.length,!!a&&Zv(a)&&sv(r,a)&&(Jc(t)||Mb(t)))}function d_(t,e){return t!=null&&i_(t,e,r_)}var o_=1,u_=2;function s_(t,e){return Lv(t)&&JV(e)?fV(Nm(t),e):function(n){var c=LU(n,t);return c===void 0&&c===e?d_(n,t):Vv(e,c,o_|u_)}}function b_(t){return function(e){return e==null?void 0:e[t]}}function y_(t){return function(e){return Gw(e,t)}}function Z_(t){return Lv(t)?b_(Nm(t)):y_(t)}function W_(t){return typeof t=="function"?t:t==null?pm:typeof t=="object"?Jc(t)?s_(t[0],t[1]):l_(t):Z_(t)}function m_(t){return function(e,n,c){for(var a=-1,l=Object(e),r=c(e),d=r.length;d--;){var o=r[t?d:++a];if(n(l[o],o,l)===!1)break}return e}}var L_=m_();const gv=L_;function h_(t,e){return t&&gv(t,e,Fo)}function X_(t,e){return function(n,c){if(n==null)return n;if(!bd(n))return t(n,c);for(var a=n.length,l=e?a:-1,r=Object(n);(e?l--:++l<a)&&c(r[l],l,r)!==!1;);return n}}var v_=X_(h_);const G_=v_;function Cv(t,e,n){(n!==void 0&&!Jb(t[e],n)||n===void 0&&!(e in t))&&bv(t,e,n)}function p_(t){return gl(t)&&bd(t)}function jv(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Y_(t){return ko(t,yd(t))}function J_(t,e,n,c,a,l,r){var d=jv(t,n),o=jv(e,n),i=r.get(o);if(i){Cv(t,n,i);return}var u=l?l(d,o,n+"",t,e,r):void 0,s=u===void 0;if(s){var b=Jc(o),Z=!b&&So(o),W=!b&&!Z&&Jm(o);u=o,b||Z||W?Jc(d)?u=d:p_(d)?u=iw(d):Z?(s=!1,u=tV(o,!0)):W?(s=!1,u=bV(o,!0)):u=[]:JU(o)||Mb(o)?(u=d,Mb(d)?u=Y_(d):(!wa(d)||dv(d))&&(u=yV(o))):s=!1}s&&(r.set(o,u),a(u,o,c,l,r),r.delete(o)),Cv(t,n,u)}function MV(t,e,n,c,a){t!==e&&gv(e,function(l,r){if(a||(a=new ll),wa(l))J_(t,e,r,n,MV,c,a);else{var d=c?c(jv(t,r),l,r+"",t,e,a):void 0;d===void 0&&(d=l),Cv(t,r,d)}},yd)}function f_(t){return typeof t=="function"?t:pm}function M_(t,e){return t==null?t:gv(t,f_(e),yd)}var N_="[object Map]",z_="[object Set]",R_=Object.prototype,w_=R_.hasOwnProperty;function NV(t){if(t==null)return!0;if(bd(t)&&(Jc(t)||typeof t=="string"||typeof t.splice=="function"||So(t)||Jm(t)||Mb(t)))return!t.length;var e=To(t);if(e==N_||e==z_)return!t.size;if(fb(t))return!Xw(t).length;for(var n in t)if(w_.call(t,n))return!1;return!0}function V_(t){return t===void 0}var g_=ow(function(t,e,n){MV(t,e,n)});const zV=g_;function C_(t,e,n,c,a){return a(t,function(l,r,d){n=c?(c=!1,l):e(n,l,r,d)}),n}function j_(t,e,n){var c=Jc(t)?Vw:C_,a=arguments.length<3;return c(t,W_(e),n,a,G_)}var A_=Pw(function(t,e,n){return t+(n?" ":"")+pv(e)});const RV=A_;class O_ extends pb{}class x_ extends pb{}class k_ extends pb{constructor(){super(...arguments);rt(this,"data")}}class S_ extends pb{}const gm="HH:mm:ss",I_={Property:k_,Container:O6,Event:O_,Module:x_,Style:S_};class F_{constructor(){rt(this,"annotationType","Module");rt(this,"autoName",!0)}}class wV{constructor(){rt(this,"annotation");rt(this,"options",new F_)}get valued(){return this.setup({valued:!0})}get localize(){return this.setup({localizable:!0})}get notLocalize(){return this.setup({localizable:!1})}named(e){return this.setup({name:e})}hinted(e){return this.setup({hint:e})}calculable(e){return this.setup({calculable:e})}setup(e){const{annotationType:n,autoName:c,...a}=e,l=this.clone();return l.options.annotationType=n??l.options.annotationType,l.options.autoName=c??l.options.autoName,ii(l.annotation,a),l}clone(){const e=Rv(this);return e.options=Rv(this.options),e.annotation=Rv(this.annotation),e.annotation??(e.annotation={}),e}build(e){const n=this.getName(e),c=new I_[this.options.annotationType](e,n);return ii(c,this.annotation),c}withEditorProps(e){const n=this.clone();return ii(n.annotation,{editorProps:e}),n}hideEditor(){const e=this.clone();return ii(e.annotation,{editor:void 0}),e}getName(e){return this.annotation.name??(this.options.autoName?RV(e):e)}}class Av extends wV{get required(){return this.setup({required:!0})}default(e){return this.setup({default:e})}validated(e,n){return this.setup({validator:e,errorMap:n})}}class Cm extends Av{constructor(){super(...arguments);rt(this,"subType")}get ofString(){const n=new Cm().setup({...this.options,...this.annotation,type:"array",editor:"arrayOfString"});return n.subType="string",n}get ofObject(){const n=new Cm().setup({...this.options,...this.annotation,type:"array"});return n.subType="object",n}}class VV extends Av{constructor(){super(...arguments);rt(this,"values");rt(this,"labels")}get required(){return super.required}labeled(...n){const c=this.clone();return c.labels=n,c}build(n){const c=super.build(n);return c.data=this.values.map((a,l)=>{var d;return{label:((d=this.labels)==null?void 0:d[l])??RV(a.toString()),value:a}}),c}default(n){return this.setup({default:n})}}class H_ extends VV{radio(){return this.setup({editor:"radio"})}default(e){return super.default(e)}}class T_ extends VV{default(e){return super.default(e)}}const t2=class t2 extends wV{constructor(e){super(),this.annotation={editor:e}}get array(){return new Cm().setup({...this.options,...this.annotation,type:"array"})}typed(e){return new Av().setup({...this.options,...this.annotation,type:e})}oneOf(...e){const n=new H_().setup({...this.options,...this.annotation,type:"enum"});return n.values=e,n}someOf(...e){const n=new T_().setup({...this.options,...this.annotation,type:"enum"});return n.values=e,n}};rt(t2,"create",e=>new t2(e));let jm=t2;const Cl=jm.create;function Dc(t){return Cl(t).setup({annotationType:"Property"})}function gV(t){return t.reduce((e,n)=>(e[n.key]=n.default,e),{})}function Do(t){return{any:{object:gV(t)}}}class D_ extends jm{constructor(e){super(e)}withSlotConditionBuilder(e){return this.setup({slotConditionBuilder:e})}}function CV(t){return new D_(t)}const B_=(t,e)=>e.reduceScreen((n,c)=>c.key===t?n+1:n,0)===1;Cl("key").typed("string").required.hinted("Unique component key").calculable(!1).validated(B_,{code:"unique_key",message:"The key must be unique!"}).build("key");const Q_=Cl("htmlAttributes"),U_=Cl("validation"),jt=Dc("string").typed("string").localize;Dc("object").typed("object");const wt=Dc("boolean").typed("boolean"),E_=wt.setup({readOnly:!0}),Va=Dc("number").typed("number"),P_=Dc("size").typed("string"),Vb=Dc("date").typed("date"),jV=Dc("time").typed("time"),da=Dc("array").array,Bo=Dc("color").typed("string");Cl("tooltipType").typed("string");const Qo=Cl("size").setup({calculable:!1}),AV=Cl("color").setup({calculable:!1});Dc("string").calculable(!0).build("className");const Ht=Cl("event").setup({annotationType:"Event"}),Hn=CV("node").setup({annotationType:"Container"}),K_=CV("nodeArray").setup({annotationType:"Container",bindingType:"array"}),xe=Dc("oneOf").oneOf.bind(Dc("oneOf")),__=Dc("someOf").someOf.bind(Dc("someOf")),$_=Cl("tooltipProps"),q_=Cl("renderWhen").typed("boolean"),Am={width:Qo.setup({default:"100%"}),height:Qo,marginTop:Qo,marginRight:Qo,marginBottom:Qo,marginLeft:Qo,color:AV,backgroundColor:AV},md={flexDirection:xe("column","row","column-reverse","row-reverse"),gap:P_,alignItems:xe("start","center","baseline","end","stretch"),justifyContent:xe("flex-start","flex-end","center","space-between","space-around","space-evenly","start","end","left","right"),flexWrap:xe("wrap","nowrap","wrap-reverse")};function gb(t,e={}){return j_(t,(n,c,a)=>{var l;return n.push(((l=c==null?void 0:c.setup(e))==null?void 0:l.build(a))??jt.setup(e).build(a)),n},[])}function Uo(t){return gb(t,{annotationType:"Style",calculable:!1})}const t8=t=>{const e=lv().builderMode==="viewer",c=ia().parentStore;return e&&!t.children?null:_("div",{className:t.wrapperClassName,children:e||c?t.children:_(av,{children:t.children})})},OV=t=>_(C6,{value:t,children:_(t8,{wrapperClassName:t.wrapperClassName,children:t.children})});OV.displayName="Repeater";const xV=da.valued.setup({editor:"arrayOfObject"}),kV=gb({itemRenderWhen:jt.notLocalize.hinted("The expression or function to conditionally render a repeater item."),value:xV,children:Hn}),{flexDirection:SV,gap:IV}=md,FV=Uo({display:jt.default("flex").hideEditor(),flexDirection:SV.default("column").named("Item direction").hinted("Item direction"),gap:IV.default("20px").named("Item gap").hinted("Item gap")}),e8=Do(FV),HV=Uo({display:jt.default("flex").hideEditor(),flexDirection:SV.default("column").hinted("Repeater direction"),gap:IV.default("20px").hinted("Repeater gap")}),n8=Do(HV),c8=kV.filter(t=>typeof t.default<"u").reduce((t,e)=>(t[e.key]=e.default,t),{}),Ov=new al(OV,"Repeater",void 0,"value","array",c8,e8,n8,"Repeater",void 0,"repeater"),di=(async function(){}).constructor;class fc{constructor(e,n,c={}){this.func=e,this.body=n,this.params=c}static functionalAction(e,n={}){return new fc(e,void 0,n)}static sourceAction(e,n={}){const c=di("e, args",e);return new fc(c,e,n)}static createFromObject(e){return fc.sourceAction(e.body,e.params)}}const a8=t=>{const e={};return t&&Object.keys(t).forEach(n=>{const c=t[n];e[n]=fc.createFromObject(c)}),e},xv="onDidMount",kv="onWillUnmount";function Sv(t){return new Proxy(t,{get(e,n){return n==="toJSON"?()=>e.data:e.data[n]},set(e,n,c){var a;return(a=e.fields.get(n))==null||a.setValue(c),!0}})}class Iv{constructor(e,n,c,a,l){Ke(this,_y,void 0);Ke(this,$y,void 0);Ke(this,qy,void 0);rt(this,"renderedProps");rt(this,"index");rt(this,"setUserDefinedProps",e=>{this.sender.userDefinedProps=e});Ke(this,tZ,e=>!!(e&&e.target&&e.type&&e.preventDefault));Ke(this,e2,e=>!de(this,tZ).call(this,e));var o;this.type=e,this.sender=n,this.store=c,this.args=a,this.renderedProps=l.get,this.index=n.nearestIndex;const r=typeof this.index!==void 0,d=r?((o=n.dataRootProvider)==null?void 0:o.dataRoot)??this.store.formData:this.store.formData;if(Ac(this,_y,Sv(d)),r){const i=d.parent??this.store.formData;Ac(this,$y,Sv(i))}Ac(this,qy,Sv(this.store.formData))}get event(){return this.args.find(de(this,tZ))}get value(){return this.args.filter(e=>typeof e<"u").find(de(this,e2))}get data(){return de(this,_y)}get parentData(){return de(this,$y)}get rootData(){return de(this,qy)}}_y=new WeakMap,$y=new WeakMap,qy=new WeakMap,tZ=new WeakMap,e2=new WeakMap;const Om=[$_.build("tooltipProps"),q_.build("renderWhen"),Q_.build("htmlAttributes"),U_.build("validation"),Ht.build(xv),Ht.build(kv)];class Eo{constructor(e,n,c,a,l,r,d,o="component",i,u){this.type=e,this.properties=n,this.css=c,this.wrapperCss=a,this.modules=l,this.customPreview=r,this.valuedAn=d,this.kind=o,this.initialJson=i,this.eventListeners=u}}const TV=Symbol("key");function xm(t,e,n={}){return DV("autorun",t,e,n)}function jl(t,e={}){return DV("observable",t,void 0,e)}function DV(t,e,n,c={}){const a=Object.keys(c).map(l=>`${l}=${c[l]}`).join("_");return`${t}_${e}_${n?`${n}_`:""}${a}`}let BV=0;function QV(t){t[TV]||(++BV,t[TV]=`actionData_${BV}`)}function UV(t){var n;const e=t.events;e&&Object.values(e).forEach(c=>c.forEach(QV)),(n=t.children)==null||n.forEach(UV)}function km(t){return(t==null?void 0:t.computeType)==="function"}function EV(t){return(t==null?void 0:t.computeType)==="localization"}class Mc{constructor(e,n){rt(this,"key","");rt(this,"type","");rt(this,"props",{});rt(this,"css");rt(this,"wrapperCss");rt(this,"events");rt(this,"children");rt(this,"schema");rt(this,"htmlAttributes");rt(this,"tooltipProps");rt(this,"slot");rt(this,"slotCondition");rt(this,"renderWhen");this.key=e,this.type=n,ql(this,void 0,{name:jl("ComponentStore",{key:e})})}static createFromObject(e){const n=ii(new Mc(e.key,e.type),e);return UV(n),n}static addEventHandler(e,n,c){var a;QV(c),e.events??(e.events={}),(a=e.events)[n]??(a[n]=[]),e.events[n].push(c)}}function Fv(t){return typeof t=="string"}function PV(t){return typeof t=="number"}function Hv(t){return typeof t=="object"&&typeof t.then=="function"}function Tv(t){return typeof t=="object"}function Nc(t,e){const n=$3(e);return n.displayName=t,n}new Mc("","");const KV=".",Dv="__DOT__";function l8(t){return t.replace(new RegExp(`\\${Dv}`,"g"),KV)}function r8(t){return t.replace(new RegExp(`\\${KV}`,"g"),Dv)}const uc=t=>t.replace(new RegExp(" ","g"),"_"),i8=t=>typeof t=="string"||typeof t=="number"||t instanceof Date?!0:typeof(t==null?void 0:t.value)<"u",_V=(t,e="")=>{const n={};for(const[c,a]of Object.entries(t)){const l=e?`${e}${Dv}${c}`:c;i8(a)?n[uc(l)]=a:typeof a=="boolean"?n[uc(l)]=a?"true":"false":typeof a=="object"&&a!==null&&Object.assign(n,_V(a,l))}return n};class $V{constructor(){rt(this,"handlers",[])}subscribe(e){this.handlers.push(e)}unsubscribe(e){this.handlers=this.handlers.filter(n=>n!==e)}get isSubscribed(){return this.handlers.length>0}invoke(e,n){this.handlers.slice().forEach(c=>c(e,n))}dispose(){this.handlers=[]}}function Bv(t,e){var n;e(t),(n=t.children)==null||n.forEach(c=>Bv(c,e))}let d8=0;function o8(t){return`${t}_${++d8}`}class u8{constructor(e,n){this.oldKey=e,this.newKey=n}}class s8{constructor(){rt(this,"onAfterKeyChanged",new $V);rt(this,"onBeforeDelete",new $V)}dispose(){this.onAfterKeyChanged.dispose(),this.onBeforeDelete.dispose()}}class b8{constructor(e,n,c,a,l){Ke(this,eZ,void 0);Ke(this,yl,void 0);Ke(this,ji,void 0);rt(this,"_state",{});rt(this,"id");rt(this,"store");rt(this,"model");rt(this,"field");rt(this,"parent");rt(this,"children",[]);rt(this,"userDefinedProps");rt(this,"validating",!1);rt(this,"dataRootProvider");rt(this,"index");var d;this.store=e,this.model=n,this.field=c,this.id=o8(this.model.type),Ac(this,ji,l),(d=e.children)==null||d.forEach(o=>{a(o).setParent(this)}),ql(this,void 0,{name:jl("ComponentData",{key:e.key})}),Ac(this,eZ,[(()=>jT(()=>this.key,(o,i)=>{this.invokeOnAfterKeyChanged(this,new u8(i,o))}))()])}setParent(e){var n;(n=this.parent)==null||n.removeChild(this),e.addChild(this),this.parent=e}insertAfterMe(e){this.insert(e,"after")}insertBeforeMe(e){this.insert(e,"before")}get state(){return this._state}get key(){return this.store.key}get events(){return de(this,yl)||Ac(this,yl,new s8),de(this,yl)}findByKey(e){if(this.key===e)return this;for(let n=0;n<this.children.length;n++){const a=this.children[n].findByKey(e);if(a)return a}}unifyKeys(e){const n=new Map,c=[];return Bv(e,({key:a})=>{c.push(a)}),Bv(this,a=>{let l=1;const r=HE(a.store.type),d=()=>`${r}${l}`;for(;c.includes(d());)l++;const o=d();n.set(o,a.key),a.store.key=o,c.push(o)}),n}get fields(){return this.collectAllFields(new Map)}delete(){var n;(n=this.parent)==null||n.removeChild(this);const e=this.collectAllNodesAsArray([]);this.invokeOnBeforeDeleted(e),this.disposeNodes(e)}get data(){const e={};for(const[n,c]of this.fields)if(c.storeDataInParentForm){const a=c.value||{};Object.keys(a).forEach(l=>e[l]=a[l])}else e[n]=c.value;return e}get parentData(){var n;if(typeof this.nearestIndex!==void 0)return((n=this.parent)==null?void 0:n.data)??this.rootData}get rootData(){return this.root.data}get fluentData(){const e=y8(this);return _V(e)}get errors(){const e={};for(const[n,c]of this.fields){c.error&&(e[n]=c.error);const a=c.errors;a&&(Array.isArray(a)?e[n]=a:(c.storeDataInParentForm&&Object.keys(a).forEach(l=>e[l]=a[l]),!c.storeDataInParentForm&&Object.keys(a).length>0&&(e[n]=a)))}return e}get hasErrors(){return Object.keys(this.errors).length>0}setAllErrors(e){this.fields.forEach(n=>n.error=e)}async validate(){this.validating=!0;try{if(await Promise.allSettled([...this.fields.values()].map(a=>a.validate())),!de(this,ji))return;const e=this.fields,n=de(this,ji).map(a=>a(this.data));(await Promise.allSettled(n)).map(a=>{if(a.status==="rejected"){console.error(a.reason);return}return a.value}).forEach(a=>{a&&e.forEach((l,r)=>{if(a[r])return l.setError(a[r]);if(l.storeDataInParentForm)return l.setError(a)})})}finally{this.validating=!1}}async getValidationResult(){let e;const n=async([l,r])=>{const d=await r.getValidationResult();if(NV(d))return;e??(e={});let o=e;if(!r.storeDataInParentForm){const i=Jc(d)?[]:{};e[l]??(e[l]=i),o=e[l]}zV(o,d)},c=[...this.fields.entries()];if(await Promise.allSettled(c.map(n)),!de(this,ji))return e;const a=async l=>{const r=await l(this.data);NV(r)||(e??(e={}),zV(e,r))};return await Promise.allSettled(de(this,ji).map(a)),e}get isValidating(){return this.validating}reset(){this.fields.forEach(e=>e.reset())}clear(){this.fields.forEach(e=>e.clear())}dispose(){const e=this.collectAllNodesAsArray([]);this.disposeNodes(e)}get isRoot(){return!this.parent}get root(){return this.parent?this.parent.root:this}get nearestIndex(){var e;return typeof this.index<"u"?this.index:(e=this.parent)==null?void 0:e.nearestIndex}insert(e,n){var o,i;const c=n==="before"?0:1;if(!this.parent)throw new Error(`Cannot insert without parent. Key = ${this.key}`);(o=e.parent)==null||o.removeChild(e),e.parent=this.parent;const a=this.parent.children,l=a.indexOf(this);if(l<0)throw new Error(`Cannot insert not existing element into ComponentData. Key = ${this.key}`);a.splice(l+c,0,e),(i=this.parent.store).children??(i.children=[]);const r=this.parent.store.children,d=r.indexOf(this.store);if(d<0)throw new Error(`Cannot insert not existing element into ComponentStore. Key = ${this.key}`);r.splice(d+c,0,e.store),e.store.slot=this.store.slot,e.store.slotCondition=this.store.slotCondition}disposeNodes(e){e.forEach(n=>{var c,a;(c=de(n,yl))==null||c.dispose(),de(n,eZ).forEach(l=>l()),(a=n.field)==null||a.dispose(),n.parent=void 0,n.children=[]})}collectAllNodesAsArray(e){e.push(this);for(let n=0;n<this.children.length;n++)this.children[n].collectAllNodesAsArray(e);return e}collectAllFields(e){var n;if(this.field&&e.set(this.key,this.field),((n=this.field)==null?void 0:n.fieldType)==="repeater")return e;for(let c=0;c<this.children.length;c++)this.children[c].collectAllFields(e);return e}addChild(e){var n;this.children.indexOf(e)<0&&this.children.push(e),(n=this.store).children??(n.children=[]),this.store.children.indexOf(e.store)<0&&this.store.children.push(e.store)}removeChild(e){var a;const n=this.children.indexOf(e);n>-1&&this.children.splice(n,1),(a=this.store).children??(a.children=[]);const c=this.store.children.indexOf(e.store);c>-1&&this.store.children.splice(c,1)}invokeOnAfterKeyChanged(e,n){var c,a;(c=de(this,yl))!=null&&c.onAfterKeyChanged.isSubscribed&&de(this,yl).onAfterKeyChanged.invoke(e,n),(a=this.parent)==null||a.invokeOnAfterKeyChanged(e,n)}invokeOnBeforeDeleted(e){var n,c;(n=de(this,yl))!=null&&n.onBeforeDelete.isSubscribed&&e.forEach(a=>{var l;return(l=de(this,yl))==null?void 0:l.onBeforeDelete.invoke(a,void 0)}),(c=this.parent)==null||c.invokeOnBeforeDeleted(e)}}eZ=new WeakMap,yl=new WeakMap,ji=new WeakMap;const y8=t=>{const e={};return t.fields.forEach((n,c)=>{e[c]=t.data[c]??""}),e},[rl,qV]=dd("ComponentDataContext"),[Al,tg]=dd("FormViewerPropsContext");function Z8(t){const e=v.useRef(!1),[n,c]=v.useState(t);v.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]);const a=v.useCallback(l=>{e.current&&c(l)},[]);return v.useMemo(()=>[n,a],[n,a])}const W8=new Date(1734363871158),eg=":",ng="-",m8=`MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEJDKWHzXT9YZw7WDJy4wr/VMXBf+/afNB
52
+ overridden reactive render was not properly disposed.`)}this[nv]=!0}),t}function Gm(t){return t.displayName||t.name||t.constructor&&(t.constructor.displayName||t.constructor.name)||"<component>"}function R6(t){var e=this;sr(this,Xm,!1),sr(this,vm,!1);var n=Gm(this),c=t.bind(this),a=!1,l=function(){var o=new Di(n+".render()",function(){if(!a&&(a=!0,e[nv]!==!0)){var i=!0;try{sr(e,vm,!0),e[Xm]||v.Component.prototype.forceUpdate.call(e),i=!1}finally{sr(e,vm,!1),i&&(o.dispose(),e.render[xo]=null)}}});return o.reactComponent=e,o};function r(){var d;a=!1;var o=(d=r[xo])!=null?d:r[xo]=l(),i=void 0,u=void 0;if(o.track(function(){try{u=C2(!1,c)}catch(s){i=s}}),i)throw i;return u}return r}function _3(t,e){return this.state!==e?!0:!H3(this.props,t)}function cv(t,e){var n=ri("reactProp_"+e+"_valueHolder"),c=ri("reactProp_"+e+"_atomHolder");function a(){return this[c]||sr(this,c,V2("reactive "+e)),this[c]}Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){var r=!1;return lo&&Or&&(r=lo(!0)),a.call(this).reportObserved(),lo&&Or&&Or(r),this[n]},set:function(r){!this[vm]&&!H3(this[n],r)?(sr(this,n,r),sr(this,Xm,!0),a.call(this).reportChanged(),sr(this,Xm,!1)):sr(this,n,r)}})}function $3(t){return t.isMobxInjector===!0&&console.warn("Mobx observer: You are trying to use `observer` on a component that already has `inject`. Please apply `observer` before applying `inject`"),Object.prototype.isPrototypeOf.call(v.Component,t)||Object.prototype.isPrototypeOf.call(v.PureComponent,t)?z6(t):Y6(t)}if(!v.Component)throw new Error("mobx-react requires React to be available");if(!Ge)throw new Error("mobx-react requires mobx to be available");class al{constructor(e,n,c,a,l,r,d,o,i,u,s="component",b,Z={}){Ke(this,Ky,void 0);rt(this,"component");this.actionsInitializer=c,this.valued=a,this.valueType=l,this.defaultProps=r,this.css=d,this.wrapperCss=o,this.typeName=i,this.icon=u,this.kind=s,this.readOnly=b,this.propsBindingTypes=Z,this.component=$3(e),this.component.displayName=e.displayName||e.name,Ac(this,Ky,n)}get name(){return de(this,Ky)??this.type}get type(){return this.typeName||this.component.displayName||this.component.name}}Ky=new WeakMap;var Yc=(t=>(t.LTR="ltr",t.RTL="rtl",t))(Yc||{});function dd(t,e=null){const n=v.createContext(e);n.displayName=t;const c=w6(n),a=V6(n);return[c,a,n]}function w6(t){return()=>{const e=v.useContext(t);if(!e)throw new Error(`The context ${t.displayName} didn't found!`);return e}}function V6(t){return t.Provider}const[g6,C6]=dd("RepeaterPropsContext"),av=t=>{const{className:e}=g6();return _("div",{className:e,children:t.children})};av.displayName="RepeaterItem";const j6=new al(av,"RepeaterItem"),[lv,gDt,CDt]=dd("BuilderContext",{builderMode:"viewer"}),[ia,rv,A6]=dd("StoreContext");class pb{constructor(e,n){rt(this,"key");rt(this,"name");rt(this,"editor");rt(this,"hint");rt(this,"localizable",!1);rt(this,"valued",!1);rt(this,"readOnly",!1);rt(this,"editorProps");rt(this,"default");rt(this,"type");rt(this,"required",!1);rt(this,"validator");rt(this,"errorMap");rt(this,"calculable",!0);rt(this,"slotConditionBuilder");rt(this,"bindingType");this.key=e,this.name=n}clone(){return Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this))}}class O6 extends pb{}var x6=typeof global=="object"&&global&&global.Object===Object&&global;const q3=x6;var k6=typeof self=="object"&&self&&self.Object===Object&&self,S6=q3||k6||Function("return this")();const wl=S6;var I6=wl.Symbol;const Vl=I6;var tw=Object.prototype,F6=tw.hasOwnProperty,H6=tw.toString,Yb=Vl?Vl.toStringTag:void 0;function T6(t){var e=F6.call(t,Yb),n=t[Yb];try{t[Yb]=void 0;var c=!0}catch{}var a=H6.call(t);return c&&(e?t[Yb]=n:delete t[Yb]),a}var D6=Object.prototype,B6=D6.toString;function Q6(t){return B6.call(t)}var U6="[object Null]",E6="[object Undefined]",ew=Vl?Vl.toStringTag:void 0;function od(t){return t==null?t===void 0?E6:U6:ew&&ew in Object(t)?T6(t):Q6(t)}function gl(t){return t!=null&&typeof t=="object"}var P6="[object Symbol]";function iv(t){return typeof t=="symbol"||gl(t)&&od(t)==P6}function K6(t,e){for(var n=-1,c=t==null?0:t.length,a=Array(c);++n<c;)a[n]=e(t[n],n,t);return a}var _6=Array.isArray;const Jc=_6;var $6=1/0,nw=Vl?Vl.prototype:void 0,cw=nw?nw.toString:void 0;function aw(t){if(typeof t=="string")return t;if(Jc(t))return K6(t,aw)+"";if(iv(t))return cw?cw.call(t):"";var e=t+"";return e=="0"&&1/t==-$6?"-0":e}function wa(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function pm(t){return t}var q6="[object AsyncFunction]",t7="[object Function]",e7="[object GeneratorFunction]",n7="[object Proxy]";function dv(t){if(!wa(t))return!1;var e=od(t);return e==t7||e==e7||e==q6||e==n7}var c7=wl["__core-js_shared__"];const ov=c7;var lw=function(){var t=/[^.]+$/.exec(ov&&ov.keys&&ov.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function a7(t){return!!lw&&lw in t}var l7=Function.prototype,r7=l7.toString;function ud(t){if(t!=null){try{return r7.call(t)}catch{}try{return t+""}catch{}}return""}var i7=/[\\^$.*+?()[\]{}|]/g,d7=/^\[object .+?Constructor\]$/,o7=Function.prototype,u7=Object.prototype,s7=o7.toString,b7=u7.hasOwnProperty,y7=RegExp("^"+s7.call(b7).replace(i7,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Z7(t){if(!wa(t)||a7(t))return!1;var e=dv(t)?y7:d7;return e.test(ud(t))}function W7(t,e){return t==null?void 0:t[e]}function sd(t,e){var n=W7(t,e);return Z7(n)?n:void 0}var m7=sd(wl,"WeakMap");const uv=m7;var rw=Object.create,L7=function(){function t(){}return function(e){if(!wa(e))return{};if(rw)return rw(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();const h7=L7;function X7(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function iw(t,e){var n=-1,c=t.length;for(e||(e=Array(c));++n<c;)e[n]=t[n];return e}var v7=800,G7=16,p7=Date.now;function Y7(t){var e=0,n=0;return function(){var c=p7(),a=G7-(c-n);if(n=c,a>0){if(++e>=v7)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function J7(t){return function(){return t}}var f7=function(){try{var t=sd(Object,"defineProperty");return t({},"",{}),t}catch{}}();const Ym=f7;var M7=Ym?function(t,e){return Ym(t,"toString",{configurable:!0,enumerable:!1,value:J7(e),writable:!0})}:pm,N7=Y7(M7);const z7=N7;function R7(t,e){for(var n=-1,c=t==null?0:t.length;++n<c&&e(t[n],n,t)!==!1;);return t}var w7=9007199254740991,V7=/^(?:0|[1-9]\d*)$/;function sv(t,e){var n=typeof t;return e=e??w7,!!e&&(n=="number"||n!="symbol"&&V7.test(t))&&t>-1&&t%1==0&&t<e}function bv(t,e,n){e=="__proto__"&&Ym?Ym(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Jb(t,e){return t===e||t!==t&&e!==e}var g7=Object.prototype,C7=g7.hasOwnProperty;function yv(t,e,n){var c=t[e];(!(C7.call(t,e)&&Jb(c,n))||n===void 0&&!(e in t))&&bv(t,e,n)}function ko(t,e,n,c){var a=!n;n||(n={});for(var l=-1,r=e.length;++l<r;){var d=e[l],o=c?c(n[d],t[d],d,n,t):void 0;o===void 0&&(o=t[d]),a?bv(n,d,o):yv(n,d,o)}return n}var dw=Math.max;function j7(t,e,n){return e=dw(e===void 0?t.length-1:e,0),function(){for(var c=arguments,a=-1,l=dw(c.length-e,0),r=Array(l);++a<l;)r[a]=c[e+a];a=-1;for(var d=Array(e+1);++a<e;)d[a]=c[a];return d[e]=n(r),X7(t,this,d)}}function A7(t,e){return z7(j7(t,e,pm),t+"")}var O7=9007199254740991;function Zv(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=O7}function bd(t){return t!=null&&Zv(t.length)&&!dv(t)}function x7(t,e,n){if(!wa(n))return!1;var c=typeof e;return(c=="number"?bd(n)&&sv(e,n.length):c=="string"&&e in n)?Jb(n[e],t):!1}function ow(t){return A7(function(e,n){var c=-1,a=n.length,l=a>1?n[a-1]:void 0,r=a>2?n[2]:void 0;for(l=t.length>3&&typeof l=="function"?(a--,l):void 0,r&&x7(n[0],n[1],r)&&(l=a<3?void 0:l,a=1),e=Object(e);++c<a;){var d=n[c];d&&t(e,d,c,l)}return e})}var k7=Object.prototype;function fb(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||k7;return t===n}function S7(t,e){for(var n=-1,c=Array(t);++n<t;)c[n]=e(n);return c}var I7="[object Arguments]";function uw(t){return gl(t)&&od(t)==I7}var sw=Object.prototype,F7=sw.hasOwnProperty,H7=sw.propertyIsEnumerable,T7=uw(function(){return arguments}())?uw:function(t){return gl(t)&&F7.call(t,"callee")&&!H7.call(t,"callee")};const Mb=T7;function D7(){return!1}var bw=typeof ie=="object"&&ie&&!ie.nodeType&&ie,yw=bw&&typeof module=="object"&&module&&!module.nodeType&&module,B7=yw&&yw.exports===bw,Zw=B7?wl.Buffer:void 0,Q7=Zw?Zw.isBuffer:void 0,U7=Q7||D7;const So=U7;var E7="[object Arguments]",P7="[object Array]",K7="[object Boolean]",_7="[object Date]",$7="[object Error]",q7="[object Function]",tQ="[object Map]",eQ="[object Number]",nQ="[object Object]",cQ="[object RegExp]",aQ="[object Set]",lQ="[object String]",rQ="[object WeakMap]",iQ="[object ArrayBuffer]",dQ="[object DataView]",oQ="[object Float32Array]",uQ="[object Float64Array]",sQ="[object Int8Array]",bQ="[object Int16Array]",yQ="[object Int32Array]",ZQ="[object Uint8Array]",WQ="[object Uint8ClampedArray]",mQ="[object Uint16Array]",LQ="[object Uint32Array]",tn={};tn[oQ]=tn[uQ]=tn[sQ]=tn[bQ]=tn[yQ]=tn[ZQ]=tn[WQ]=tn[mQ]=tn[LQ]=!0,tn[E7]=tn[P7]=tn[iQ]=tn[K7]=tn[dQ]=tn[_7]=tn[$7]=tn[q7]=tn[tQ]=tn[eQ]=tn[nQ]=tn[cQ]=tn[aQ]=tn[lQ]=tn[rQ]=!1;function hQ(t){return gl(t)&&Zv(t.length)&&!!tn[od(t)]}function Wv(t){return function(e){return t(e)}}var Ww=typeof ie=="object"&&ie&&!ie.nodeType&&ie,Nb=Ww&&typeof module=="object"&&module&&!module.nodeType&&module,XQ=Nb&&Nb.exports===Ww,mv=XQ&&q3.process,vQ=function(){try{var t=Nb&&Nb.require&&Nb.require("util").types;return t||mv&&mv.binding&&mv.binding("util")}catch{}}();const Io=vQ;var mw=Io&&Io.isTypedArray,GQ=mw?Wv(mw):hQ;const Jm=GQ;var pQ=Object.prototype,YQ=pQ.hasOwnProperty;function Lw(t,e){var n=Jc(t),c=!n&&Mb(t),a=!n&&!c&&So(t),l=!n&&!c&&!a&&Jm(t),r=n||c||a||l,d=r?S7(t.length,String):[],o=d.length;for(var i in t)(e||YQ.call(t,i))&&!(r&&(i=="length"||a&&(i=="offset"||i=="parent")||l&&(i=="buffer"||i=="byteLength"||i=="byteOffset")||sv(i,o)))&&d.push(i);return d}function hw(t,e){return function(n){return t(e(n))}}var JQ=hw(Object.keys,Object);const fQ=JQ;var MQ=Object.prototype,NQ=MQ.hasOwnProperty;function Xw(t){if(!fb(t))return fQ(t);var e=[];for(var n in Object(t))NQ.call(t,n)&&n!="constructor"&&e.push(n);return e}function Fo(t){return bd(t)?Lw(t):Xw(t)}var zQ=Object.prototype,RQ=zQ.hasOwnProperty,wQ=ow(function(t,e){if(fb(e)||bd(e)){ko(e,Fo(e),t);return}for(var n in e)RQ.call(e,n)&&yv(t,n,e[n])});const ii=wQ;function VQ(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var gQ=Object.prototype,CQ=gQ.hasOwnProperty;function jQ(t){if(!wa(t))return VQ(t);var e=fb(t),n=[];for(var c in t)c=="constructor"&&(e||!CQ.call(t,c))||n.push(c);return n}function yd(t){return bd(t)?Lw(t,!0):jQ(t)}var AQ=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,OQ=/^\w*$/;function Lv(t,e){if(Jc(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||iv(t)?!0:OQ.test(t)||!AQ.test(t)||e!=null&&t in Object(e)}var xQ=sd(Object,"create");const zb=xQ;function kQ(){this.__data__=zb?zb(null):{},this.size=0}function SQ(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var IQ="__lodash_hash_undefined__",FQ=Object.prototype,HQ=FQ.hasOwnProperty;function TQ(t){var e=this.__data__;if(zb){var n=e[t];return n===IQ?void 0:n}return HQ.call(e,t)?e[t]:void 0}var DQ=Object.prototype,BQ=DQ.hasOwnProperty;function QQ(t){var e=this.__data__;return zb?e[t]!==void 0:BQ.call(e,t)}var UQ="__lodash_hash_undefined__";function EQ(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=zb&&e===void 0?UQ:e,this}function Zd(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var c=t[e];this.set(c[0],c[1])}}Zd.prototype.clear=kQ,Zd.prototype.delete=SQ,Zd.prototype.get=TQ,Zd.prototype.has=QQ,Zd.prototype.set=EQ;function PQ(){this.__data__=[],this.size=0}function fm(t,e){for(var n=t.length;n--;)if(Jb(t[n][0],e))return n;return-1}var KQ=Array.prototype,_Q=KQ.splice;function $Q(t){var e=this.__data__,n=fm(e,t);if(n<0)return!1;var c=e.length-1;return n==c?e.pop():_Q.call(e,n,1),--this.size,!0}function qQ(t){var e=this.__data__,n=fm(e,t);return n<0?void 0:e[n][1]}function tU(t){return fm(this.__data__,t)>-1}function eU(t,e){var n=this.__data__,c=fm(n,t);return c<0?(++this.size,n.push([t,e])):n[c][1]=e,this}function br(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var c=t[e];this.set(c[0],c[1])}}br.prototype.clear=PQ,br.prototype.delete=$Q,br.prototype.get=qQ,br.prototype.has=tU,br.prototype.set=eU;var nU=sd(wl,"Map");const Rb=nU;function cU(){this.size=0,this.__data__={hash:new Zd,map:new(Rb||br),string:new Zd}}function aU(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Mm(t,e){var n=t.__data__;return aU(e)?n[typeof e=="string"?"string":"hash"]:n.map}function lU(t){var e=Mm(this,t).delete(t);return this.size-=e?1:0,e}function rU(t){return Mm(this,t).get(t)}function iU(t){return Mm(this,t).has(t)}function dU(t,e){var n=Mm(this,t),c=n.size;return n.set(t,e),this.size+=n.size==c?0:1,this}function yr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var c=t[e];this.set(c[0],c[1])}}yr.prototype.clear=cU,yr.prototype.delete=lU,yr.prototype.get=rU,yr.prototype.has=iU,yr.prototype.set=dU;var oU="Expected a function";function hv(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(oU);var n=function(){var c=arguments,a=e?e.apply(this,c):c[0],l=n.cache;if(l.has(a))return l.get(a);var r=t.apply(this,c);return n.cache=l.set(a,r)||l,r};return n.cache=new(hv.Cache||yr),n}hv.Cache=yr;var uU=500;function sU(t){var e=hv(t,function(c){return n.size===uU&&n.clear(),c}),n=e.cache;return e}var bU=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,yU=/\\(\\)?/g,ZU=sU(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(bU,function(n,c,a,l){e.push(a?l.replace(yU,"$1"):c||n)}),e});const WU=ZU;function wb(t){return t==null?"":aw(t)}function vw(t,e){return Jc(t)?t:Lv(t,e)?[t]:WU(wb(t))}var mU=1/0;function Nm(t){if(typeof t=="string"||iv(t))return t;var e=t+"";return e=="0"&&1/t==-mU?"-0":e}function Gw(t,e){e=vw(e,t);for(var n=0,c=e.length;t!=null&&n<c;)t=t[Nm(e[n++])];return n&&n==c?t:void 0}function LU(t,e,n){var c=t==null?void 0:Gw(t,e);return c===void 0?n:c}function pw(t,e){for(var n=-1,c=e.length,a=t.length;++n<c;)t[a+n]=e[n];return t}var hU=hw(Object.getPrototypeOf,Object);const Xv=hU;var XU="[object Object]",vU=Function.prototype,GU=Object.prototype,Yw=vU.toString,pU=GU.hasOwnProperty,YU=Yw.call(Object);function JU(t){if(!gl(t)||od(t)!=XU)return!1;var e=Xv(t);if(e===null)return!0;var n=pU.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Yw.call(n)==YU}function fU(t,e,n){var c=-1,a=t.length;e<0&&(e=-e>a?0:a+e),n=n>a?a:n,n<0&&(n+=a),a=e>n?0:n-e>>>0,e>>>=0;for(var l=Array(a);++c<a;)l[c]=t[c+e];return l}function MU(t,e,n){var c=t.length;return n=n===void 0?c:n,!e&&n>=c?t:fU(t,e,n)}var NU="\\ud800-\\udfff",zU="\\u0300-\\u036f",RU="\\ufe20-\\ufe2f",wU="\\u20d0-\\u20ff",VU=zU+RU+wU,gU="\\ufe0e\\ufe0f",CU="\\u200d",jU=RegExp("["+CU+NU+VU+gU+"]");function Jw(t){return jU.test(t)}function AU(t){return t.split("")}var fw="\\ud800-\\udfff",OU="\\u0300-\\u036f",xU="\\ufe20-\\ufe2f",kU="\\u20d0-\\u20ff",SU=OU+xU+kU,IU="\\ufe0e\\ufe0f",FU="["+fw+"]",vv="["+SU+"]",Gv="\\ud83c[\\udffb-\\udfff]",HU="(?:"+vv+"|"+Gv+")",Mw="[^"+fw+"]",Nw="(?:\\ud83c[\\udde6-\\uddff]){2}",zw="[\\ud800-\\udbff][\\udc00-\\udfff]",TU="\\u200d",Rw=HU+"?",ww="["+IU+"]?",DU="(?:"+TU+"(?:"+[Mw,Nw,zw].join("|")+")"+ww+Rw+")*",BU=ww+Rw+DU,QU="(?:"+[Mw+vv+"?",vv,Nw,zw,FU].join("|")+")",UU=RegExp(Gv+"(?="+Gv+")|"+QU+BU,"g");function EU(t){return t.match(UU)||[]}function PU(t){return Jw(t)?EU(t):AU(t)}function KU(t){return function(e){e=wb(e);var n=Jw(e)?PU(e):void 0,c=n?n[0]:e.charAt(0),a=n?MU(n,1).join(""):e.slice(1);return c[t]()+a}}var _U=KU("toUpperCase");const pv=_U;function $U(t){return pv(wb(t).toLowerCase())}function Vw(t,e,n,c){var a=-1,l=t==null?0:t.length;for(c&&l&&(n=t[++a]);++a<l;)n=e(n,t[a],a,t);return n}function qU(t){return function(e){return t==null?void 0:t[e]}}var tE={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},eE=qU(tE);const nE=eE;var cE=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,aE="\\u0300-\\u036f",lE="\\ufe20-\\ufe2f",rE="\\u20d0-\\u20ff",iE=aE+lE+rE,dE="["+iE+"]",oE=RegExp(dE,"g");function uE(t){return t=wb(t),t&&t.replace(cE,nE).replace(oE,"")}var sE=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function bE(t){return t.match(sE)||[]}var yE=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ZE(t){return yE.test(t)}var gw="\\ud800-\\udfff",WE="\\u0300-\\u036f",mE="\\ufe20-\\ufe2f",LE="\\u20d0-\\u20ff",hE=WE+mE+LE,Cw="\\u2700-\\u27bf",jw="a-z\\xdf-\\xf6\\xf8-\\xff",XE="\\xac\\xb1\\xd7\\xf7",vE="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",GE="\\u2000-\\u206f",pE=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Aw="A-Z\\xc0-\\xd6\\xd8-\\xde",YE="\\ufe0e\\ufe0f",Ow=XE+vE+GE+pE,xw="['’]",kw="["+Ow+"]",JE="["+hE+"]",Sw="\\d+",fE="["+Cw+"]",Iw="["+jw+"]",Fw="[^"+gw+Ow+Sw+Cw+jw+Aw+"]",ME="\\ud83c[\\udffb-\\udfff]",NE="(?:"+JE+"|"+ME+")",zE="[^"+gw+"]",Hw="(?:\\ud83c[\\udde6-\\uddff]){2}",Tw="[\\ud800-\\udbff][\\udc00-\\udfff]",Ho="["+Aw+"]",RE="\\u200d",Dw="(?:"+Iw+"|"+Fw+")",wE="(?:"+Ho+"|"+Fw+")",Bw="(?:"+xw+"(?:d|ll|m|re|s|t|ve))?",Qw="(?:"+xw+"(?:D|LL|M|RE|S|T|VE))?",Uw=NE+"?",Ew="["+YE+"]?",VE="(?:"+RE+"(?:"+[zE,Hw,Tw].join("|")+")"+Ew+Uw+")*",gE="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",CE="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",jE=Ew+Uw+VE,AE="(?:"+[fE,Hw,Tw].join("|")+")"+jE,OE=RegExp([Ho+"?"+Iw+"+"+Bw+"(?="+[kw,Ho,"$"].join("|")+")",wE+"+"+Qw+"(?="+[kw,Ho+Dw,"$"].join("|")+")",Ho+"?"+Dw+"+"+Bw,Ho+"+"+Qw,CE,gE,Sw,AE].join("|"),"g");function xE(t){return t.match(OE)||[]}function kE(t,e,n){return t=wb(t),e=n?void 0:e,e===void 0?ZE(t)?xE(t):bE(t):t.match(e)||[]}var SE="['’]",IE=RegExp(SE,"g");function Pw(t){return function(e){return Vw(kE(uE(e).replace(IE,"")),t,"")}}var FE=Pw(function(t,e,n){return e=e.toLowerCase(),t+(n?$U(e):e)});const HE=FE;function TE(){this.__data__=new br,this.size=0}function DE(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function BE(t){return this.__data__.get(t)}function QE(t){return this.__data__.has(t)}var UE=200;function EE(t,e){var n=this.__data__;if(n instanceof br){var c=n.__data__;if(!Rb||c.length<UE-1)return c.push([t,e]),this.size=++n.size,this;n=this.__data__=new yr(c)}return n.set(t,e),this.size=n.size,this}function ll(t){var e=this.__data__=new br(t);this.size=e.size}ll.prototype.clear=TE,ll.prototype.delete=DE,ll.prototype.get=BE,ll.prototype.has=QE,ll.prototype.set=EE;function PE(t,e){return t&&ko(e,Fo(e),t)}function KE(t,e){return t&&ko(e,yd(e),t)}var Kw=typeof ie=="object"&&ie&&!ie.nodeType&&ie,_w=Kw&&typeof module=="object"&&module&&!module.nodeType&&module,_E=_w&&_w.exports===Kw,$w=_E?wl.Buffer:void 0,qw=$w?$w.allocUnsafe:void 0;function tV(t,e){if(e)return t.slice();var n=t.length,c=qw?qw(n):new t.constructor(n);return t.copy(c),c}function $E(t,e){for(var n=-1,c=t==null?0:t.length,a=0,l=[];++n<c;){var r=t[n];e(r,n,t)&&(l[a++]=r)}return l}function eV(){return[]}var qE=Object.prototype,tP=qE.propertyIsEnumerable,nV=Object.getOwnPropertySymbols,eP=nV?function(t){return t==null?[]:(t=Object(t),$E(nV(t),function(e){return tP.call(t,e)}))}:eV;const Yv=eP;function nP(t,e){return ko(t,Yv(t),e)}var cP=Object.getOwnPropertySymbols,aP=cP?function(t){for(var e=[];t;)pw(e,Yv(t)),t=Xv(t);return e}:eV;const cV=aP;function lP(t,e){return ko(t,cV(t),e)}function aV(t,e,n){var c=e(t);return Jc(t)?c:pw(c,n(t))}function Jv(t){return aV(t,Fo,Yv)}function rP(t){return aV(t,yd,cV)}var iP=sd(wl,"DataView");const fv=iP;var dP=sd(wl,"Promise");const Mv=dP;var oP=sd(wl,"Set");const Nv=oP;var lV="[object Map]",uP="[object Object]",rV="[object Promise]",iV="[object Set]",dV="[object WeakMap]",oV="[object DataView]",sP=ud(fv),bP=ud(Rb),yP=ud(Mv),ZP=ud(Nv),WP=ud(uv),Wd=od;(fv&&Wd(new fv(new ArrayBuffer(1)))!=oV||Rb&&Wd(new Rb)!=lV||Mv&&Wd(Mv.resolve())!=rV||Nv&&Wd(new Nv)!=iV||uv&&Wd(new uv)!=dV)&&(Wd=function(t){var e=od(t),n=e==uP?t.constructor:void 0,c=n?ud(n):"";if(c)switch(c){case sP:return oV;case bP:return lV;case yP:return rV;case ZP:return iV;case WP:return dV}return e});const To=Wd;var mP=Object.prototype,LP=mP.hasOwnProperty;function hP(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&LP.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var XP=wl.Uint8Array;const zm=XP;function zv(t){var e=new t.constructor(t.byteLength);return new zm(e).set(new zm(t)),e}function vP(t,e){var n=e?zv(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var GP=/\w*$/;function pP(t){var e=new t.constructor(t.source,GP.exec(t));return e.lastIndex=t.lastIndex,e}var uV=Vl?Vl.prototype:void 0,sV=uV?uV.valueOf:void 0;function YP(t){return sV?Object(sV.call(t)):{}}function bV(t,e){var n=e?zv(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var JP="[object Boolean]",fP="[object Date]",MP="[object Map]",NP="[object Number]",zP="[object RegExp]",RP="[object Set]",wP="[object String]",VP="[object Symbol]",gP="[object ArrayBuffer]",CP="[object DataView]",jP="[object Float32Array]",AP="[object Float64Array]",OP="[object Int8Array]",xP="[object Int16Array]",kP="[object Int32Array]",SP="[object Uint8Array]",IP="[object Uint8ClampedArray]",FP="[object Uint16Array]",HP="[object Uint32Array]";function TP(t,e,n){var c=t.constructor;switch(e){case gP:return zv(t);case JP:case fP:return new c(+t);case CP:return vP(t,n);case jP:case AP:case OP:case xP:case kP:case SP:case IP:case FP:case HP:return bV(t,n);case MP:return new c;case NP:case wP:return new c(t);case zP:return pP(t);case RP:return new c;case VP:return YP(t)}}function yV(t){return typeof t.constructor=="function"&&!fb(t)?h7(Xv(t)):{}}var DP="[object Map]";function BP(t){return gl(t)&&To(t)==DP}var ZV=Io&&Io.isMap,QP=ZV?Wv(ZV):BP;const UP=QP;var EP="[object Set]";function PP(t){return gl(t)&&To(t)==EP}var WV=Io&&Io.isSet,KP=WV?Wv(WV):PP;const _P=KP;var $P=1,qP=2,tK=4,mV="[object Arguments]",eK="[object Array]",nK="[object Boolean]",cK="[object Date]",aK="[object Error]",LV="[object Function]",lK="[object GeneratorFunction]",rK="[object Map]",iK="[object Number]",hV="[object Object]",dK="[object RegExp]",oK="[object Set]",uK="[object String]",sK="[object Symbol]",bK="[object WeakMap]",yK="[object ArrayBuffer]",ZK="[object DataView]",WK="[object Float32Array]",mK="[object Float64Array]",LK="[object Int8Array]",hK="[object Int16Array]",XK="[object Int32Array]",vK="[object Uint8Array]",GK="[object Uint8ClampedArray]",pK="[object Uint16Array]",YK="[object Uint32Array]",Ee={};Ee[mV]=Ee[eK]=Ee[yK]=Ee[ZK]=Ee[nK]=Ee[cK]=Ee[WK]=Ee[mK]=Ee[LK]=Ee[hK]=Ee[XK]=Ee[rK]=Ee[iK]=Ee[hV]=Ee[dK]=Ee[oK]=Ee[uK]=Ee[sK]=Ee[vK]=Ee[GK]=Ee[pK]=Ee[YK]=!0,Ee[aK]=Ee[LV]=Ee[bK]=!1;function Rm(t,e,n,c,a,l){var r,d=e&$P,o=e&qP,i=e&tK;if(n&&(r=a?n(t,c,a,l):n(t)),r!==void 0)return r;if(!wa(t))return t;var u=Jc(t);if(u){if(r=hP(t),!d)return iw(t,r)}else{var s=To(t),b=s==LV||s==lK;if(So(t))return tV(t,d);if(s==hV||s==mV||b&&!a){if(r=o||b?{}:yV(t),!d)return o?lP(t,KE(r,t)):nP(t,PE(r,t))}else{if(!Ee[s])return a?t:{};r=TP(t,s,d)}}l||(l=new ll);var Z=l.get(t);if(Z)return Z;l.set(t,r),_P(t)?t.forEach(function(G){r.add(Rm(G,e,n,G,t,l))}):UP(t)&&t.forEach(function(G,L){r.set(L,Rm(G,e,n,L,t,l))});var W=i?o?rP:Jv:o?yd:Fo,m=u?void 0:W(t);return R7(m||t,function(G,L){m&&(L=G,G=t[L]),yv(r,L,Rm(G,e,n,L,t,l))}),r}var JK=4;function Rv(t){return Rm(t,JK)}var fK="__lodash_hash_undefined__";function MK(t){return this.__data__.set(t,fK),this}function NK(t){return this.__data__.has(t)}function wm(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new yr;++e<n;)this.add(t[e])}wm.prototype.add=wm.prototype.push=MK,wm.prototype.has=NK;function zK(t,e){for(var n=-1,c=t==null?0:t.length;++n<c;)if(e(t[n],n,t))return!0;return!1}function RK(t,e){return t.has(e)}var wK=1,VK=2;function XV(t,e,n,c,a,l){var r=n&wK,d=t.length,o=e.length;if(d!=o&&!(r&&o>d))return!1;var i=l.get(t),u=l.get(e);if(i&&u)return i==e&&u==t;var s=-1,b=!0,Z=n&VK?new wm:void 0;for(l.set(t,e),l.set(e,t);++s<d;){var W=t[s],m=e[s];if(c)var G=r?c(m,W,s,e,t,l):c(W,m,s,t,e,l);if(G!==void 0){if(G)continue;b=!1;break}if(Z){if(!zK(e,function(L,h){if(!RK(Z,h)&&(W===L||a(W,L,n,c,l)))return Z.push(h)})){b=!1;break}}else if(!(W===m||a(W,m,n,c,l))){b=!1;break}}return l.delete(t),l.delete(e),b}function gK(t){var e=-1,n=Array(t.size);return t.forEach(function(c,a){n[++e]=[a,c]}),n}function CK(t){var e=-1,n=Array(t.size);return t.forEach(function(c){n[++e]=c}),n}var jK=1,AK=2,OK="[object Boolean]",xK="[object Date]",kK="[object Error]",SK="[object Map]",IK="[object Number]",FK="[object RegExp]",HK="[object Set]",TK="[object String]",DK="[object Symbol]",BK="[object ArrayBuffer]",QK="[object DataView]",vV=Vl?Vl.prototype:void 0,wv=vV?vV.valueOf:void 0;function UK(t,e,n,c,a,l,r){switch(n){case QK:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case BK:return!(t.byteLength!=e.byteLength||!l(new zm(t),new zm(e)));case OK:case xK:case IK:return Jb(+t,+e);case kK:return t.name==e.name&&t.message==e.message;case FK:case TK:return t==e+"";case SK:var d=gK;case HK:var o=c&jK;if(d||(d=CK),t.size!=e.size&&!o)return!1;var i=r.get(t);if(i)return i==e;c|=AK,r.set(t,e);var u=XV(d(t),d(e),c,a,l,r);return r.delete(t),u;case DK:if(wv)return wv.call(t)==wv.call(e)}return!1}var EK=1,PK=Object.prototype,KK=PK.hasOwnProperty;function _K(t,e,n,c,a,l){var r=n&EK,d=Jv(t),o=d.length,i=Jv(e),u=i.length;if(o!=u&&!r)return!1;for(var s=o;s--;){var b=d[s];if(!(r?b in e:KK.call(e,b)))return!1}var Z=l.get(t),W=l.get(e);if(Z&&W)return Z==e&&W==t;var m=!0;l.set(t,e),l.set(e,t);for(var G=r;++s<o;){b=d[s];var L=t[b],h=e[b];if(c)var p=r?c(h,L,b,e,t,l):c(L,h,b,t,e,l);if(!(p===void 0?L===h||a(L,h,n,c,l):p)){m=!1;break}G||(G=b=="constructor")}if(m&&!G){var Y=t.constructor,J=e.constructor;Y!=J&&"constructor"in t&&"constructor"in e&&!(typeof Y=="function"&&Y instanceof Y&&typeof J=="function"&&J instanceof J)&&(m=!1)}return l.delete(t),l.delete(e),m}var $K=1,GV="[object Arguments]",pV="[object Array]",Vm="[object Object]",qK=Object.prototype,YV=qK.hasOwnProperty;function t_(t,e,n,c,a,l){var r=Jc(t),d=Jc(e),o=r?pV:To(t),i=d?pV:To(e);o=o==GV?Vm:o,i=i==GV?Vm:i;var u=o==Vm,s=i==Vm,b=o==i;if(b&&So(t)){if(!So(e))return!1;r=!0,u=!1}if(b&&!u)return l||(l=new ll),r||Jm(t)?XV(t,e,n,c,a,l):UK(t,e,o,n,c,a,l);if(!(n&$K)){var Z=u&&YV.call(t,"__wrapped__"),W=s&&YV.call(e,"__wrapped__");if(Z||W){var m=Z?t.value():t,G=W?e.value():e;return l||(l=new ll),a(m,G,n,c,l)}}return b?(l||(l=new ll),_K(t,e,n,c,a,l)):!1}function Vv(t,e,n,c,a){return t===e?!0:t==null||e==null||!gl(t)&&!gl(e)?t!==t&&e!==e:t_(t,e,n,c,Vv,a)}var e_=1,n_=2;function c_(t,e,n,c){var a=n.length,l=a,r=!c;if(t==null)return!l;for(t=Object(t);a--;){var d=n[a];if(r&&d[2]?d[1]!==t[d[0]]:!(d[0]in t))return!1}for(;++a<l;){d=n[a];var o=d[0],i=t[o],u=d[1];if(r&&d[2]){if(i===void 0&&!(o in t))return!1}else{var s=new ll;if(c)var b=c(i,u,o,t,e,s);if(!(b===void 0?Vv(u,i,e_|n_,c,s):b))return!1}}return!0}function JV(t){return t===t&&!wa(t)}function a_(t){for(var e=Fo(t),n=e.length;n--;){var c=e[n],a=t[c];e[n]=[c,a,JV(a)]}return e}function fV(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function l_(t){var e=a_(t);return e.length==1&&e[0][2]?fV(e[0][0],e[0][1]):function(n){return n===t||c_(n,t,e)}}function r_(t,e){return t!=null&&e in Object(t)}function i_(t,e,n){e=vw(e,t);for(var c=-1,a=e.length,l=!1;++c<a;){var r=Nm(e[c]);if(!(l=t!=null&&n(t,r)))break;t=t[r]}return l||++c!=a?l:(a=t==null?0:t.length,!!a&&Zv(a)&&sv(r,a)&&(Jc(t)||Mb(t)))}function d_(t,e){return t!=null&&i_(t,e,r_)}var o_=1,u_=2;function s_(t,e){return Lv(t)&&JV(e)?fV(Nm(t),e):function(n){var c=LU(n,t);return c===void 0&&c===e?d_(n,t):Vv(e,c,o_|u_)}}function b_(t){return function(e){return e==null?void 0:e[t]}}function y_(t){return function(e){return Gw(e,t)}}function Z_(t){return Lv(t)?b_(Nm(t)):y_(t)}function W_(t){return typeof t=="function"?t:t==null?pm:typeof t=="object"?Jc(t)?s_(t[0],t[1]):l_(t):Z_(t)}function m_(t){return function(e,n,c){for(var a=-1,l=Object(e),r=c(e),d=r.length;d--;){var o=r[t?d:++a];if(n(l[o],o,l)===!1)break}return e}}var L_=m_();const gv=L_;function h_(t,e){return t&&gv(t,e,Fo)}function X_(t,e){return function(n,c){if(n==null)return n;if(!bd(n))return t(n,c);for(var a=n.length,l=e?a:-1,r=Object(n);(e?l--:++l<a)&&c(r[l],l,r)!==!1;);return n}}var v_=X_(h_);const G_=v_;function Cv(t,e,n){(n!==void 0&&!Jb(t[e],n)||n===void 0&&!(e in t))&&bv(t,e,n)}function p_(t){return gl(t)&&bd(t)}function jv(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Y_(t){return ko(t,yd(t))}function J_(t,e,n,c,a,l,r){var d=jv(t,n),o=jv(e,n),i=r.get(o);if(i){Cv(t,n,i);return}var u=l?l(d,o,n+"",t,e,r):void 0,s=u===void 0;if(s){var b=Jc(o),Z=!b&&So(o),W=!b&&!Z&&Jm(o);u=o,b||Z||W?Jc(d)?u=d:p_(d)?u=iw(d):Z?(s=!1,u=tV(o,!0)):W?(s=!1,u=bV(o,!0)):u=[]:JU(o)||Mb(o)?(u=d,Mb(d)?u=Y_(d):(!wa(d)||dv(d))&&(u=yV(o))):s=!1}s&&(r.set(o,u),a(u,o,c,l,r),r.delete(o)),Cv(t,n,u)}function MV(t,e,n,c,a){t!==e&&gv(e,function(l,r){if(a||(a=new ll),wa(l))J_(t,e,r,n,MV,c,a);else{var d=c?c(jv(t,r),l,r+"",t,e,a):void 0;d===void 0&&(d=l),Cv(t,r,d)}},yd)}function f_(t){return typeof t=="function"?t:pm}function M_(t,e){return t==null?t:gv(t,f_(e),yd)}var N_="[object Map]",z_="[object Set]",R_=Object.prototype,w_=R_.hasOwnProperty;function NV(t){if(t==null)return!0;if(bd(t)&&(Jc(t)||typeof t=="string"||typeof t.splice=="function"||So(t)||Jm(t)||Mb(t)))return!t.length;var e=To(t);if(e==N_||e==z_)return!t.size;if(fb(t))return!Xw(t).length;for(var n in t)if(w_.call(t,n))return!1;return!0}function V_(t){return t===void 0}var g_=ow(function(t,e,n){MV(t,e,n)});const zV=g_;function C_(t,e,n,c,a){return a(t,function(l,r,d){n=c?(c=!1,l):e(n,l,r,d)}),n}function j_(t,e,n){var c=Jc(t)?Vw:C_,a=arguments.length<3;return c(t,W_(e),n,a,G_)}var A_=Pw(function(t,e,n){return t+(n?" ":"")+pv(e)});const RV=A_;class O_ extends pb{}class x_ extends pb{}class k_ extends pb{constructor(){super(...arguments);rt(this,"data")}}class S_ extends pb{}const gm="HH:mm:ss",I_={Property:k_,Container:O6,Event:O_,Module:x_,Style:S_};class F_{constructor(){rt(this,"annotationType","Module");rt(this,"autoName",!0)}}class wV{constructor(){rt(this,"annotation");rt(this,"options",new F_)}get valued(){return this.setup({valued:!0})}get localize(){return this.setup({localizable:!0})}get notLocalize(){return this.setup({localizable:!1})}named(e){return this.setup({name:e})}hinted(e){return this.setup({hint:e})}calculable(e){return this.setup({calculable:e})}setup(e){const{annotationType:n,autoName:c,...a}=e,l=this.clone();return l.options.annotationType=n??l.options.annotationType,l.options.autoName=c??l.options.autoName,ii(l.annotation,a),l}clone(){const e=Rv(this);return e.options=Rv(this.options),e.annotation=Rv(this.annotation),e.annotation??(e.annotation={}),e}build(e){const n=this.getName(e),c=new I_[this.options.annotationType](e,n);return ii(c,this.annotation),c}withEditorProps(e){const n=this.clone();return ii(n.annotation,{editorProps:e}),n}hideEditor(){const e=this.clone();return ii(e.annotation,{editor:void 0}),e}getName(e){return this.annotation.name??(this.options.autoName?RV(e):e)}}class Av extends wV{get required(){return this.setup({required:!0})}default(e){return this.setup({default:e})}validated(e,n){return this.setup({validator:e,errorMap:n})}}class Cm extends Av{constructor(){super(...arguments);rt(this,"subType")}get ofString(){const n=new Cm().setup({...this.options,...this.annotation,type:"array",editor:"arrayOfString"});return n.subType="string",n}get ofObject(){const n=new Cm().setup({...this.options,...this.annotation,type:"array"});return n.subType="object",n}}class VV extends Av{constructor(){super(...arguments);rt(this,"values");rt(this,"labels")}get required(){return super.required}labeled(...n){const c=this.clone();return c.labels=n,c}build(n){const c=super.build(n);return c.data=this.values.map((a,l)=>{var d;return{label:((d=this.labels)==null?void 0:d[l])??RV(a.toString()),value:a}}),c}default(n){return this.setup({default:n})}}class H_ extends VV{radio(){return this.setup({editor:"radio"})}default(e){return super.default(e)}}class T_ extends VV{default(e){return super.default(e)}}const t2=class t2 extends wV{constructor(e){super(),this.annotation={editor:e}}get array(){return new Cm().setup({...this.options,...this.annotation,type:"array"})}typed(e){return new Av().setup({...this.options,...this.annotation,type:e})}oneOf(...e){const n=new H_().setup({...this.options,...this.annotation,type:"enum"});return n.values=e,n}someOf(...e){const n=new T_().setup({...this.options,...this.annotation,type:"enum"});return n.values=e,n}};rt(t2,"create",e=>new t2(e));let jm=t2;const Cl=jm.create;function Dc(t){return Cl(t).setup({annotationType:"Property"})}function gV(t){return t.reduce((e,n)=>(e[n.key]=n.default,e),{})}function Do(t){return{any:{object:gV(t)}}}class D_ extends jm{constructor(e){super(e)}withSlotConditionBuilder(e){return this.setup({slotConditionBuilder:e})}}function CV(t){return new D_(t)}const B_=(t,e)=>e.reduceScreen((n,c)=>c.key===t?n+1:n,0)===1;Cl("key").typed("string").required.hinted("Unique component key").calculable(!1).validated(B_,{code:"unique_key",message:"The key must be unique!"}).build("key");const Q_=Cl("htmlAttributes"),U_=Cl("validation"),jt=Dc("string").typed("string").localize;Dc("object").typed("object");const wt=Dc("boolean").typed("boolean"),E_=wt.setup({readOnly:!0}),Va=Dc("number").typed("number"),P_=Dc("size").typed("string"),Vb=Dc("date").typed("date"),jV=Dc("time").typed("time"),da=Dc("array").array,Bo=Dc("color").typed("string");Cl("tooltipType").typed("string");const Qo=Cl("size").setup({calculable:!1}),AV=Cl("color").setup({calculable:!1});Dc("string").calculable(!0).build("className");const Ht=Cl("event").setup({annotationType:"Event"}),Hn=CV("node").setup({annotationType:"Container"}),K_=CV("nodeArray").setup({annotationType:"Container",bindingType:"array"}),xe=Dc("oneOf").oneOf.bind(Dc("oneOf")),__=Dc("someOf").someOf.bind(Dc("someOf")),$_=Cl("tooltipProps"),q_=Cl("renderWhen").typed("boolean"),Am={width:Qo.setup({default:"100%"}),height:Qo,marginTop:Qo,marginRight:Qo,marginBottom:Qo,marginLeft:Qo,color:AV,backgroundColor:AV},md={flexDirection:xe("column","row","column-reverse","row-reverse"),gap:P_,alignItems:xe("start","center","baseline","end","stretch"),justifyContent:xe("flex-start","flex-end","center","space-between","space-around","space-evenly","start","end","left","right"),flexWrap:xe("wrap","nowrap","wrap-reverse")};function gb(t,e={}){return j_(t,(n,c,a)=>{var l;return n.push(((l=c==null?void 0:c.setup(e))==null?void 0:l.build(a))??jt.setup(e).build(a)),n},[])}function Uo(t){return gb(t,{annotationType:"Style",calculable:!1})}const t8=t=>{const e=lv().builderMode==="viewer",c=ia().parentStore;return e&&!t.children?null:_("div",{className:t.wrapperClassName,children:e||c?t.children:_(av,{children:t.children})})},OV=t=>_(C6,{value:t,children:_(t8,{wrapperClassName:t.wrapperClassName,children:t.children})});OV.displayName="Repeater";const xV=da.valued.setup({editor:"arrayOfObject"}),kV=gb({itemRenderWhen:jt.notLocalize.hinted("The expression or function to conditionally render a repeater item."),value:xV,children:Hn}),{flexDirection:SV,gap:IV}=md,FV=Uo({display:jt.default("flex").hideEditor(),flexDirection:SV.default("column").named("Item direction").hinted("Item direction"),gap:IV.default("20px").named("Item gap").hinted("Item gap")}),e8=Do(FV),HV=Uo({display:jt.default("flex").hideEditor(),flexDirection:SV.default("column").hinted("Repeater direction"),gap:IV.default("20px").hinted("Repeater gap")}),n8=Do(HV),c8=kV.filter(t=>typeof t.default<"u").reduce((t,e)=>(t[e.key]=e.default,t),{}),Ov=new al(OV,"Repeater",void 0,"value","array",c8,e8,n8,"Repeater",void 0,"repeater"),di=(async function(){}).constructor;class fc{constructor(e,n,c={}){this.func=e,this.body=n,this.params=c}static functionalAction(e,n={}){return new fc(e,void 0,n)}static sourceAction(e,n={}){const c=di("e, args",e);return new fc(c,e,n)}static createFromObject(e){return fc.sourceAction(e.body,e.params)}}const a8=t=>{const e={};return t&&Object.keys(t).forEach(n=>{const c=t[n];e[n]=fc.createFromObject(c)}),e},xv="onDidMount",kv="onWillUnmount";function Sv(t){return new Proxy(t,{get(e,n){return n==="toJSON"?()=>e.data:e.data[n]},set(e,n,c){var a;return(a=e.fields.get(n))==null||a.setValue(c),!0}})}class Iv{constructor(e,n,c,a,l){Ke(this,_y,void 0);Ke(this,$y,void 0);Ke(this,qy,void 0);rt(this,"renderedProps");rt(this,"index");rt(this,"setUserDefinedProps",e=>{this.sender.userDefinedProps=e});Ke(this,tZ,e=>!!(e&&e.target&&e.type&&e.preventDefault));Ke(this,e2,e=>!de(this,tZ).call(this,e));var o;this.type=e,this.sender=n,this.store=c,this.args=a,this.renderedProps=l.get,this.index=n.nearestIndex;const r=typeof this.index!==void 0,d=r?((o=n.dataRootProvider)==null?void 0:o.dataRoot)??this.store.formData:this.store.formData;if(Ac(this,_y,Sv(d)),r){const i=d.parent??this.store.formData;Ac(this,$y,Sv(i))}Ac(this,qy,Sv(this.store.formData))}get event(){return this.args.find(de(this,tZ))}get value(){return this.args.filter(e=>typeof e<"u").find(de(this,e2))}get data(){return de(this,_y)}get parentData(){return de(this,$y)}get rootData(){return de(this,qy)}}_y=new WeakMap,$y=new WeakMap,qy=new WeakMap,tZ=new WeakMap,e2=new WeakMap;const Om=[$_.build("tooltipProps"),q_.build("renderWhen"),Q_.build("htmlAttributes"),U_.build("validation"),Ht.build(xv),Ht.build(kv)];class Eo{constructor(e,n,c,a,l,r,d,o="component",i,u){this.type=e,this.properties=n,this.css=c,this.wrapperCss=a,this.modules=l,this.customPreview=r,this.valuedAn=d,this.kind=o,this.initialJson=i,this.eventListeners=u}}const TV=Symbol("key");function xm(t,e,n={}){return DV("autorun",t,e,n)}function jl(t,e={}){return DV("observable",t,void 0,e)}function DV(t,e,n,c={}){const a=Object.keys(c).map(l=>`${l}=${c[l]}`).join("_");return`${t}_${e}_${n?`${n}_`:""}${a}`}let BV=0;function QV(t){t[TV]||(++BV,t[TV]=`actionData_${BV}`)}function UV(t){var n;const e=t.events;e&&Object.values(e).forEach(c=>c.forEach(QV)),(n=t.children)==null||n.forEach(UV)}function km(t){return(t==null?void 0:t.computeType)==="function"}function EV(t){return(t==null?void 0:t.computeType)==="localization"}class Mc{constructor(e,n){rt(this,"key","");rt(this,"type","");rt(this,"props",{});rt(this,"css");rt(this,"wrapperCss");rt(this,"events");rt(this,"children");rt(this,"schema");rt(this,"htmlAttributes");rt(this,"tooltipProps");rt(this,"slot");rt(this,"slotCondition");rt(this,"renderWhen");this.key=e,this.type=n,ql(this,void 0,{name:jl("ComponentStore",{key:e})})}static createFromObject(e){const n=ii(new Mc(e.key,e.type),e);return UV(n),n}static addEventHandler(e,n,c){var a;QV(c),e.events??(e.events={}),(a=e.events)[n]??(a[n]=[]),e.events[n].push(c)}}function Fv(t){return typeof t=="string"}function PV(t){return typeof t=="number"}function Hv(t){return typeof t=="object"&&typeof t.then=="function"}function Tv(t){return typeof t=="object"}function Nc(t,e){const n=$3(e);return n.displayName=t,n}new Mc("","");const KV=".",Dv="__DOT__";function l8(t){return t.replace(new RegExp(`\\${Dv}`,"g"),KV)}function r8(t){return t.replace(new RegExp(`\\${KV}`,"g"),Dv)}const uc=t=>t.replace(new RegExp(" ","g"),"_"),i8=t=>typeof t=="string"||typeof t=="number"||t instanceof Date?!0:typeof(t==null?void 0:t.value)<"u",_V=(t,e="")=>{const n={};for(const[c,a]of Object.entries(t)){const l=e?`${e}${Dv}${c}`:c;i8(a)?n[uc(l)]=a:typeof a=="boolean"?n[uc(l)]=a?"true":"false":typeof a=="object"&&a!==null&&Object.assign(n,_V(a,l))}return n};class $V{constructor(){rt(this,"handlers",[])}subscribe(e){this.handlers.push(e)}unsubscribe(e){this.handlers=this.handlers.filter(n=>n!==e)}get isSubscribed(){return this.handlers.length>0}invoke(e,n){this.handlers.slice().forEach(c=>c(e,n))}dispose(){this.handlers=[]}}function Bv(t,e){var n;e(t),(n=t.children)==null||n.forEach(c=>Bv(c,e))}let d8=0;function o8(t){return`${t}_${++d8}`}class u8{constructor(e,n){this.oldKey=e,this.newKey=n}}class s8{constructor(){rt(this,"onAfterKeyChanged",new $V);rt(this,"onBeforeDelete",new $V)}dispose(){this.onAfterKeyChanged.dispose(),this.onBeforeDelete.dispose()}}class b8{constructor(e,n,c,a,l){Ke(this,eZ,void 0);Ke(this,yl,void 0);Ke(this,ji,void 0);rt(this,"_state",{});rt(this,"id");rt(this,"store");rt(this,"model");rt(this,"field");rt(this,"parent");rt(this,"children",[]);rt(this,"userDefinedProps");rt(this,"validating",!1);rt(this,"dataRootProvider");rt(this,"index");var d;this.store=e,this.model=n,this.field=c,this.id=o8(this.model.type),Ac(this,ji,l),(d=e.children)==null||d.forEach(o=>{a(o).setParent(this)}),ql(this,void 0,{name:jl("ComponentData",{key:e.key})}),Ac(this,eZ,[(()=>jT(()=>this.key,(o,i)=>{this.invokeOnAfterKeyChanged(this,new u8(i,o))}))()])}setParent(e){var n;(n=this.parent)==null||n.removeChild(this),e.addChild(this),this.parent=e}insertAfterMe(e){this.insert(e,"after")}insertBeforeMe(e){this.insert(e,"before")}get state(){return this._state}get key(){return this.store.key}get events(){return de(this,yl)||Ac(this,yl,new s8),de(this,yl)}findByKey(e){if(this.key===e)return this;for(let n=0;n<this.children.length;n++){const a=this.children[n].findByKey(e);if(a)return a}}unifyKeys(e){const n=new Map,c=[];return Bv(e,({key:a})=>{c.push(a)}),Bv(this,a=>{let l=1;const r=HE(a.store.type),d=()=>`${r}${l}`;for(;c.includes(d());)l++;const o=d();n.set(o,a.key),a.store.key=o,c.push(o)}),n}get fields(){return this.collectAllFields(new Map)}delete(){var n;(n=this.parent)==null||n.removeChild(this);const e=this.collectAllNodesAsArray([]);this.invokeOnBeforeDeleted(e),this.disposeNodes(e)}get data(){const e={};for(const[n,c]of this.fields)if(c.storeDataInParentForm){const a=c.value||{};Object.keys(a).forEach(l=>e[l]=a[l])}else e[n]=c.value;return e}get parentData(){var n;if(typeof this.nearestIndex!==void 0)return((n=this.parent)==null?void 0:n.data)??this.rootData}get rootData(){return this.root.data}get fluentData(){const e=y8(this);return _V(e)}get errors(){const e={};for(const[n,c]of this.fields){c.error&&(e[n]=c.error);const a=c.errors;a&&(Array.isArray(a)?e[n]=a:(c.storeDataInParentForm&&Object.keys(a).forEach(l=>e[l]=a[l]),!c.storeDataInParentForm&&Object.keys(a).length>0&&(e[n]=a)))}return e}get hasErrors(){return Object.keys(this.errors).length>0}setAllErrors(e){this.fields.forEach(n=>n.error=e)}async validate(){this.validating=!0;try{if(await Promise.allSettled([...this.fields.values()].map(a=>a.validate())),!de(this,ji))return;const e=this.fields,n=de(this,ji).map(a=>a(this.data));(await Promise.allSettled(n)).map(a=>{if(a.status==="rejected"){console.error(a.reason);return}return a.value}).forEach(a=>{a&&e.forEach((l,r)=>{if(a[r])return l.setError(a[r]);if(l.storeDataInParentForm)return l.setError(a)})})}finally{this.validating=!1}}async getValidationResult(){let e;const n=async([l,r])=>{const d=await r.getValidationResult();if(NV(d))return;e??(e={});let o=e;if(!r.storeDataInParentForm){const i=Jc(d)?[]:{};e[l]??(e[l]=i),o=e[l]}zV(o,d)},c=[...this.fields.entries()];if(await Promise.allSettled(c.map(n)),!de(this,ji))return e;const a=async l=>{const r=await l(this.data);NV(r)||(e??(e={}),zV(e,r))};return await Promise.allSettled(de(this,ji).map(a)),e}get isValidating(){return this.validating}reset(){this.fields.forEach(e=>e.reset())}clear(){this.fields.forEach(e=>e.clear())}dispose(){const e=this.collectAllNodesAsArray([]);this.disposeNodes(e)}get isRoot(){return!this.parent}get root(){return this.parent?this.parent.root:this}get nearestIndex(){var e;return typeof this.index<"u"?this.index:(e=this.parent)==null?void 0:e.nearestIndex}insert(e,n){var o,i;const c=n==="before"?0:1;if(!this.parent)throw new Error(`Cannot insert without parent. Key = ${this.key}`);(o=e.parent)==null||o.removeChild(e),e.parent=this.parent;const a=this.parent.children,l=a.indexOf(this);if(l<0)throw new Error(`Cannot insert not existing element into ComponentData. Key = ${this.key}`);a.splice(l+c,0,e),(i=this.parent.store).children??(i.children=[]);const r=this.parent.store.children,d=r.indexOf(this.store);if(d<0)throw new Error(`Cannot insert not existing element into ComponentStore. Key = ${this.key}`);r.splice(d+c,0,e.store),e.store.slot=this.store.slot,e.store.slotCondition=this.store.slotCondition}disposeNodes(e){e.forEach(n=>{var c,a;(c=de(n,yl))==null||c.dispose(),de(n,eZ).forEach(l=>l()),(a=n.field)==null||a.dispose(),n.parent=void 0,n.children=[]})}collectAllNodesAsArray(e){e.push(this);for(let n=0;n<this.children.length;n++)this.children[n].collectAllNodesAsArray(e);return e}collectAllFields(e){var n;if(this.field&&e.set(this.key,this.field),((n=this.field)==null?void 0:n.fieldType)==="repeater")return e;for(let c=0;c<this.children.length;c++)this.children[c].collectAllFields(e);return e}addChild(e){var n;this.children.indexOf(e)<0&&this.children.push(e),(n=this.store).children??(n.children=[]),this.store.children.indexOf(e.store)<0&&this.store.children.push(e.store)}removeChild(e){var a;const n=this.children.indexOf(e);n>-1&&this.children.splice(n,1),(a=this.store).children??(a.children=[]);const c=this.store.children.indexOf(e.store);c>-1&&this.store.children.splice(c,1)}invokeOnAfterKeyChanged(e,n){var c,a;(c=de(this,yl))!=null&&c.onAfterKeyChanged.isSubscribed&&de(this,yl).onAfterKeyChanged.invoke(e,n),(a=this.parent)==null||a.invokeOnAfterKeyChanged(e,n)}invokeOnBeforeDeleted(e){var n,c;(n=de(this,yl))!=null&&n.onBeforeDelete.isSubscribed&&e.forEach(a=>{var l;return(l=de(this,yl))==null?void 0:l.onBeforeDelete.invoke(a,void 0)}),(c=this.parent)==null||c.invokeOnBeforeDeleted(e)}}eZ=new WeakMap,yl=new WeakMap,ji=new WeakMap;const y8=t=>{const e={};return t.fields.forEach((n,c)=>{e[c]=t.data[c]??""}),e},[rl,qV]=dd("ComponentDataContext"),[Al,tg]=dd("FormViewerPropsContext");function Z8(t){const e=v.useRef(!1),[n,c]=v.useState(t);v.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]);const a=v.useCallback(l=>{e.current&&c(l)},[]);return v.useMemo(()=>[n,a],[n,a])}const W8=new Date(1737024314886),eg=":",ng="-",m8=`MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEJDKWHzXT9YZw7WDJy4wr/VMXBf+/afNB
53
53
  ppCLv1zZFVUQEmDRPhGC5nKux3WQcrtfl18iNFfISjcqN5vplR/kcAvIJd07tacn
54
54
  y1l39NGbMLIoPVzPY6GXTNzQpxRbGn99`;function cg(t){const e=window.atob(t),n=new Uint8Array(e.length);for(let c=0;c<e.length;c++)n[c]=e.charCodeAt(c);return n.buffer}function L8(t){return window.crypto.subtle.importKey("spki",cg(t),{name:"ECDSA",namedCurve:"P-384"},!0,["verify"])}async function h8(t,e,n){if(!window.crypto.subtle)return;const c=await L8(n),a=new TextEncoder().encode(t);return await window.crypto.subtle.verify({name:"ECDSA",hash:{name:"SHA-384"}},c,e,a)}function X8(t,e){const{licenseEndDate:n,restrictions:c,companyName:a}=JSON.parse(e)??{};if(t!==a)return!1;const l=n.split(".");if(l.length!==3)return!1;const r=`${l[2]}-${l[0]}-${l[1]}`,d=new Date(r),o=new Date;return c.StrictCheck===!0&&d<o?!1:d>W8}async function v8(t){if(t)try{let e=t.indexOf(ng);if(e===-1)return!1;const n=t.slice(0,e),c=t.slice(e+ng.length);if(e=c.indexOf(eg),e===-1)return!1;const a=window.atob(c.slice(0,e)),l=cg(c.slice(e+eg.length));return await h8(a,l,m8)?X8(n,a):!1}catch{return!1}}const G8={display:"flex",position:"relative",backgroundColor:"#72c7ff30",borderRadius:6,padding:10,gap:10},p8={flex:1},Y8=()=>{const{licenseKey:t}=Al(),[e,n]=Z8(!0);return v.useEffect(()=>{v8(t).then(c=>{n(!!c)})},[t,n]),_("div",{children:!e&&_("div",{style:G8,children:je("label",{style:p8,children:["This is a trial version of the product. To purchase a license, go to ",_("a",{href:"https://formengine.io/pricing",children:"https://formengine.io/pricing"})]})})})};var J8=function(e,n){var c=arguments;if(n==null||!Zs.call(n,"css"))return v.createElement.apply(void 0,c);var a=c.length,l=new Array(a);l[0]=Y2,l[1]=p2(e,n);for(var r=2;r<a;r++)l[r]=c[r];return v.createElement.apply(null,l)},Qv={exports:{}};/*!
55
55
  * CSSJanus. https://github.com/cssjanus/cssjanus
@@ -84,7 +84,7 @@ Error generating stack: `+l.message+`
84
84
  }
85
85
  `}}function c0(t,e){if(!t.renderWhen)return!0;if(!km(t.renderWhen)){const{value:n}=t.renderWhen;if(typeof n=="string"&&n.trim()==="")return!0}return m$(t.renderWhen,e)===!0}const v$="children";function G$(t,e,n,c){var u;const a=((u=t.field)==null?void 0:u.fieldType)==="repeater"?t.field.componentData:t.children,l=n,r={},d=wn(a,s=>s.store.slot||v$),o=s=>Y$(s.store,c),i=s=>{var b;return c0(s.store,((b=t.dataRootProvider)==null?void 0:b.dataRoot)??e)};for(const[s,b]of Object.entries(d)){const Z=b.filter(o).filter(i);Z.length&&(r[s]=t.model.propsBindingTypes[s]==="array"?Z.map((W,m)=>_(l,{data:[W]},m)):_(l,{data:Z}))}return r}const Mg=new Map;function p$(t){const e=Mg.get(t);if(e)return e;const n=new Function("parentProps",t);return Mg.set(t,n),n}function Y$(t,e){var a;const n=(a=t.slotCondition)==null?void 0:a.trim();if(!n)return!0;const c=p$(n);try{return c(e)}catch(l){return console.warn(l),!1}}const J$=()=>ia().form.tooltipType,Ng=(t,e,n,c)=>{const a=ia(),l=Al();return v.useMemo(()=>f$(a,t,e,n,c,l),[a,t,e,n,c,l])},f$=(t,e,n,c,a,l)=>{const r=new Mc(e.key,n.type);r.props=c;const d=t.createComponentData(r,!1,n);return d.dataRootProvider=e.dataRootProvider,new fg(d,t,a,()=>({}),l)};function M$(){const t=Al(),e=J$();if(e)return t.view.get(e)}const N$=Nc("TooltipWrapper",({children:t})=>{const e=M$();return e?_(z$,{tooltipDefinition:e,children:t}):_(Xc,{children:t})}),z$=Nc("ComponentTooltip",({tooltipDefinition:t,children:e})=>{const n=ia(),c=rl(),a=c.store,l=v.useCallback(d=>{const o=c.dataRootProvider??n.dataContext;return n.localizeComponent("tooltip",o.dataRoot,d)},[n,c]),r=Ng(c,t,a.tooltipProps,l);return v.createElement(t.component,r.get,e)}),R$=()=>{const t=ia(),e=t.form.errorType,n=t.formViewerPropsStore.view,c=Al();return v.useMemo(()=>{const a=c.errorWrapper?new al(c.errorWrapper):N0;return(e?n.find(e):a)??N0},[e,n,c.errorWrapper])},zg=(t,e,n)=>{const{eventSubject:c}=ia(),a=v.useRef(n);a.current=n,v.useEffect(()=>{const l=c.pipe(Ab(r=>r.type===e&&r.sender.id===t)).subscribe(r=>{a.current(r)});return()=>l.unsubscribe()},[c,t,e])},Rg=Nc("Erroneous",({children:t})=>{var o;const e=rl(),n=ia(),c=Al(),a=R$(),l=v.useCallback(()=>({}),[]),r=Ng(e,a,n.form.errorProps,l);if(zg(e.id,"onChange",i=>{var u;return(u=e.field)==null?void 0:u.setValue(i.value)}),zg(e.id,"onBlur",i=>{var u;return(u=e.field)==null?void 0:u.setTouched()}),c.erroneous)return _(Xc,{children:t});const d={...r.get,error:(o=e.field)==null?void 0:o.error};return v.createElement(a.component,d,t)});function a0(t){return t.message??`Validation failed: ${t.settings.key}`}function w$(t){if(t)return t==null?void 0:t.map(a0).join(" ")}const n2=class n2{constructor(e,n,c,a){Ke(this,nZ,new t0);Ke(this,cZ,void 0);Ke(this,Hu,void 0);Ke(this,Tu,void 0);rt(this,"sendValidationEvent",e=>{de(this,nZ).next(e)});rt(this,"validate",e=>{const n=new Promise(c=>{const a=de(this,Hu).subscribe(l=>{c(l),a.unsubscribe()})});return this.sendValidationEvent(e),n});rt(this,"getValidationResult",e=>de(this,Tu).call(this,e));rt(this,"dispose",()=>{de(this,cZ).forEach(e=>e.unsubscribe())});const l=r=>{if(!(!r||r.length===0))return e.showAllValidationErrors?(a??w$)(r):(a==null?void 0:a([r[0]]))??a0(r[0])};Ac(this,Tu,r=>n(r,e)),Ac(this,Hu,de(this,nZ).pipe(s$(200),e0(de(this,Tu)),b$(r=>r),e0(l))),Ac(this,cZ,[de(this,Hu).subscribe(c)])}};nZ=new WeakMap,cZ=new WeakMap,Hu=new WeakMap,Tu=new WeakMap,rt(n2,"create",(e,n,c,a,l)=>new n2(e,n(c),a,l));let Tm=n2;const V$=Ed`
86
86
  display: flex;
87
- `,l0=t=>{const{className:e,children:n,...c}=t,a=v.useMemo(()=>jr(V$,e),[e]);return _("div",{className:a,...c,children:n})};l0.displayName="Screen";function g$(t,e,n){const c=v.useRef(e),a=v.useRef(t);c.current=e,a.current=t,v.useEffect(()=>(a.current(),()=>{c.current()}),n)}const C$=(t,e)=>{const n=ia(),c=rl(),a=v.useRef([]),l=v.useCallback(()=>{a.current.forEach(d=>d.unsubscribe())},[]),r=v.useCallback(()=>{const d=[];M_(c.store.events,(o,i)=>{const u=j$(n,o),s=n.eventSubject.pipe(Ab(b=>b.type===i&&b.sender.id===c.id),e0(u),pg((b,Z)=>(console.error(b),Z))).subscribe();d.push(s)}),a.current=d},[c.store.events,c.id,n]);g$(()=>{r();const d=new Iv(xv,c,n,[],t);n.eventSubject.next(d)},()=>{const d=new Iv(kv,c,n,[],t);n.eventSubject.next(d),l()},e)};function j$(t,e){const n=e.map(c=>({func:t.findAction(c).func,args:c.args?{...c.args}:{}}));return async c=>{for(const{func:a,args:l}of n){const r=a(c,l);Hv(r)&&await r}}}const A$=Nc("ComponentViewer",()=>{const t=rl(),{componentWrapper:e,computeChildren:n}=Al(),c=ia(),a=v.useCallback(h=>{const p=t.dataRootProvider??c.dataContext;return c.localizeComponent("component",p.dataRoot,h)},[c,t]),l=y$(),r=Al(),d=v.useCallback((h,p)=>n?n(h,p):G$(h,c.form.componentTree,l,p),[n,c.form.componentTree,l]),o=v.useMemo(()=>new fg(t,c,a,d,r),[t,c,a,d,r]);C$(o,[r]);const{key:i,...u}=o.get,{kind:s,component:b}=t.model,Z=jr(u.className,o.wrapperClassName),W=e??l0,m=t.store.tooltipProps?N$:v.Fragment,G=e??b,L=_(b,{...u},i);return s==="container"?_(G,{...u,className:Z},i):s==="repeater"?_(W,{children:_(m,{children:_(Rg,{children:_(b,{...u,wrapperClassName:Z},i)})})}):_(W,{className:s==="template"?Z:o.wrapperClassName,children:s==="template"?L:_(m,{children:_(Rg,{children:L})})})}),O$=Nc("ComponentTreeItem",({componentData:t})=>_(qV,{value:t,children:_(A$,{})})),wg=Nc("ComponentTree",({data:t})=>_(Z$,{value:wg,children:t.map(e=>_(O$,{componentData:e},e.id))})),x$=()=>{const t=window.innerWidth;return t<=600?"mobile":t<=900?"tablet":"desktop"};function k$(){const t=ia(),e=Al();v.useEffect(()=>{if(e.viewMode){t.viewMode=e.viewMode;return}const n=()=>t.viewMode=x$();return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e.viewMode,t])}const S$=Nc("Viewer",({event:t})=>{const e=ia(),{formLoadError:n}=e,c=Al(),a=v.useMemo(()=>[e.form.componentTree],[e.form.componentTree]);return v.useEffect(()=>{t==null||t(new Ob(e.eventSubject))},[t,e.eventSubject]),k$(),v.useEffect(()=>e.loadForm(c.getForm,c.formName),[e,c.getForm,c.formName]),n?_("div",{className:"form-error",children:n}):_(wg,{data:a})});function I$(t){if(!t)return;const e={};return Object.entries(t).forEach(([n,c])=>{e[n]=c instanceof fc?c:fc.functionalAction(c)}),e}class r0{constructor(e){rt(this,"view",new d1);rt(this,"initialData",{});rt(this,"validators");rt(this,"formValidators");rt(this,"localizer");rt(this,"actions");rt(this,"propsLanguage");rt(this,"errorWrapper");rt(this,"showAllValidationErrors");e&&this.applyProps(e),k2(this,{view:Ge.ref,initialData:Ge.ref,validators:Ge.ref,formValidators:Ge.ref,localizer:Ge.ref,actions:Ge.ref,propsLanguage:Ge.ref,errorWrapper:Ge.ref,showAllValidationErrors:Ge.ref},{name:jl("FormViewerPropsStore")})}applyProps(e){this.view=e.view,this.initialData=e.initialData??{},this.validators=e.validators,this.formValidators=e.formValidators,this.localizer=e.localize,this.actions=I$(e.actions),this.propsLanguage=e.language,this.errorWrapper=e.errorWrapper,this.showAllValidationErrors=e.showAllValidationErrors}clone(){const e=new r0;return e.view=this.view,e.initialData=this.initialData,e.validators=this.validators,e.formValidators=this.formValidators,e.localizer=this.localizer,e.actions=this.actions,e.propsLanguage=this.propsLanguage,e.errorWrapper=this.errorWrapper,e.showAllValidationErrors=this.showAllValidationErrors,e}}function Vg(t,e,n,c){const a=t.props[e];if(km(a)){const{result:l}=n0(a,n);return[!0,l]}return EV(a)?[!0,c("component",t)[e]]:[!1]}function i0(t,e){if(Array.isArray(t)&&PV(e)||Tv(t)&&Fv(e))return t[e]}function gg(t){return function(e){return F$(t,e)}}function F$(t,e){const n=T$(t,e);return async(c,a)=>{if(!n)return;const l=[];for(const{settings:r,validator:d,params:o}of n){const i={};o==null||o.filter(b=>typeof b.default<"u").map(b=>i[b.key]=b.default),Object.assign(i,r.args);const u=d(c,a,i),s=Hv(u)?await u:u;s!==!0&&l.push({settings:r,message:typeof s=="string"?s:i.message})}return l}}const H$=()=>!0;function T$(t,e){if(!e||!e.validations||!e.validations.length)return;const n=[...e.validations].sort(D$),c=a=>{var l;if(!a.type){const r=t.internal[a.key],d=r.validatorFactory(a.args??{});return{settings:a,validator:d,params:r.params}}if(a.type==="custom"){const r=(l=t.custom)==null?void 0:l[a.key];if(r)return{settings:a,validator:r.validate,params:r.params}}return console.warn(`Cannot find rule, key: '${a.key}', type: '${a.type}'`),{settings:a,validator:H$}};return n.map(c)}function D$(t,e){return e.key==="code"?-1:e.key==="required"?1:0}class B${constructor(e,n,c,a,l,r,d){Ke(this,aZ,void 0);rt(this,"error");rt(this,"touched",!1);rt(this,"valued");rt(this,"valueType");rt(this,"dataValidator");Ke(this,lZ,void 0);rt(this,"initialData");rt(this,"setError",e=>{if(typeof e>"u"||e===null){this.clearError();return}if(!Tv(e))throw new Error(`Expected 'object' type, got '${typeof e}'`);this.error=e[this.errorFieldName];const n=e[this.componentStore.key];this.componentData.forEach((c,a)=>{const l=n==null?void 0:n[a];c.fields.forEach((r,d)=>r.setError(l==null?void 0:l[d]))})});if(this.dataContext=e,this.componentDataFactory=n,this.store=c,this.getValidationRules=a,this.componentStore=l,this.model=r,this.deferFieldCalculation=d,!r.valued)throw new Error("'model.valued' is falsy");if(!r.valueType)throw new Error("'model.typeOfValue' is undefined");this.valued=r.valued,this.valueType=r.valueType;const o="RepeaterField";ql(this,{model:!1,dataValidator:Ge.ref},{name:jl(o,{key:l.key}),autoBind:!0}),Ac(this,lZ,[Ms(()=>{this.dataValidator=this.dataContext.createDataValidator(l,this.valueType,i=>this.error=i),qZ(()=>{var i;(i=de(this,aZ))==null||i.dispose(),Ac(this,aZ,this.dataValidator)})},{name:xm(o,"setValidator",{key:l.key})}),Ms(()=>{const u=i0(this.dataContext.initialData,l.key)??this.initialValue;if(this.deferFieldCalculation){this.initialData=u;return}const[s,b]=this.dataContext.calculateValue(l,this.valued);if(s){this.initialData=b;return}this.initialData=u},{name:xm(o,"setValue",{key:l.key})}),()=>{var i;return(i=this.dataValidator)==null?void 0:i.dispose()}])}get fieldType(){return"repeater"}init(){this.deferFieldCalculation=!1,this.initFields(this.componentData)}get initialValue(){var e;return((e=this.componentStore.props[this.valued])==null?void 0:e.value)??this.defaultValue}get defaultValue(){var e;return(e=this.model.defaultProps)==null?void 0:e[this.valued]}dispose(){de(this,lZ).forEach(e=>e())}get value(){const e=[];return this.componentData.forEach(n=>{e.push(n.data)}),e}setValue(e){if(e===null||typeof e>"u"||Array.isArray(e)){this.initialData=e;return}}setTouched(){this.touched=!0}async validate(){var n,c;if(!this.needValidate){this.clearError();return}const e=this.componentData.map(a=>a.validate());await Promise.allSettled(e),await((c=(n=this.dataValidator)==null?void 0:n.validate)==null?void 0:c.call(n,this.value))}async getValidationResult(){if(!this.needValidate)return;const e=[];for(let n=0;n<this.componentData.length;n++){const a=await this.componentData[n].getValidationResult();e.push(a)}return e}reset(){this.setValue(this.initialValue),this.componentData.forEach(e=>{e.fields.forEach(n=>n.reset())}),this.clearError()}clear(){this.setValue(this.defaultValue),this.touched=!1,this.clearError()}get needValidate(){return c0(this.componentStore,this.dataContext.dataRoot)}clearError(){this.error=void 0,this.componentData.forEach(e=>{e.fields.forEach(n=>n.setError(void 0))})}get errors(){let e=!1;const n=[];if(this.componentData.forEach(c=>{n.push(c.errors),e=e||c.hasErrors}),!(!e&&this.error))return n}get repeaterItemStore(){var c;const e=JSON.parse(JSON.stringify(this.componentStore)),n=new Mc(this.componentStore.key,"RepeaterItem");return n.type="RepeaterItem",n.children=e.children,n.renderWhen=(c=e.props)==null?void 0:c.itemRenderWhen,n}get itemsCount(){return!this.initialData||!Array.isArray(this.initialData)?0:this.initialData.length}get componentData(){const e=this.itemsCount,n=this.repeaterItemStore,c=this.componentStore.key;return gT(()=>{const a=[];for(let l=0;l<e;l++){const r=new Mc(`${c}-context-item-${l}`,"Fragment"),d=this.componentDataFactory.createComponentData(r,!1);d.index=l,d.parent=this.dataContext.dataRoot;const o=new Cg(this,this.store,this.getValidationRules,this.dataContext,d,l),i=new Mc(`${c}-root-item-${l}`,"Fragment"),u=this.componentDataFactory.createComponentData(i,!1,void 0,o);u.setParent(d);const s=Mc.createFromObject(n);s.key=`${c}-item-${l}`,this.componentDataFactory.createComponentData(s,!0,void 0,o).setParent(u),a.push(d)}return this.deferFieldCalculation||this.initFields(a),a})}initFields(e){e.map(n=>{n.fields.forEach(c=>c.init())})}get errorFieldName(){return`${this.componentStore.key}Error`}}aZ=new WeakMap,lZ=new WeakMap;class Cg{constructor(e,n,c,a,l,r){this.repeaterField=e,this.store=n,this.getValidationRules=c,this.parentContext=a,this.root=l,this.index=r}get initialData(){const e=this.repeaterField.initialData;if(Array.isArray(e))return e[this.index]}calculateValue(e,n){return Vg(e,n,this.dataRoot,(c,a)=>this.store.localizeComponent(c,this.dataRoot,a))}get dataRoot(){return this.root}createDataValidator(e,n,c){const a=this.getValidationRules(n);return Tm.create(this.store,gg(a),e.schema,c,this.store.localizeErrorMessages.bind(this.store,this.dataRoot,e))}}const Q$=t=>{if(t)try{return JSON.parse(t)}catch{return}},jg=(t,e,n,c,a)=>{const l=t[e]??[];if(typeof n=="number"&&l.length>=n)return;const r=Q$(c)??{},d=[...l];typeof a=="number"?d.splice(a,0,r):d.push(r),t[e]=d},Ag=(t,e,n,c)=>{const a=t[e];if(!Array.isArray(a)||typeof c=="number"&&a.length<=c)return;const l=[...a];l.splice(n,1),t[e]=l},Og=t=>{const e=t.dataRootProvider;if(e instanceof Cg)return e.repeaterField.componentStore.key},U$=fc.functionalAction((t,e)=>{if(e.dataKey){jg(t.data,e.dataKey,e.max,e.rowData,e.index);return}const n=Og(t.sender);n&&t.parentData&&jg(t.parentData,n,e.max,e.rowData,e.index)},{dataKey:"string",rowData:"string",index:"number",max:"number"}),E$=fc.functionalAction((t,e)=>{const n=e.index??t.index??-1;if(e.dataKey){Ag(t.data,e.dataKey,n,e.min);return}const c=Og(t.sender);c&&t.parentData&&Ag(t.parentData,c,n,e.min)},{dataKey:"string",index:"number",min:"number"}),P$={log:fc.functionalAction(console.log),validate:fc.functionalAction(async t=>await t.store.form.componentTree.validate()),clear:fc.functionalAction(t=>t.store.form.componentTree.clear()),reset:fc.functionalAction(t=>t.store.form.componentTree.reset()),addRow:U$,removeRow:E$};class Dm{constructor(e){this.value=e}valueOf(){return this.value}}class Cn extends Dm{constructor(e="???"){super(e)}toString(e){return`{${this.value}}`}}class Zr extends Dm{constructor(e,n={}){super(e),this.opts=n}toString(e){try{return e.memoizeIntlObject(Intl.NumberFormat,this.opts).format(this.value)}catch(n){return e.reportError(n),this.value.toString(10)}}}class xb extends Dm{constructor(e,n={}){super(e),this.opts=n}toString(e){try{return e.memoizeIntlObject(Intl.DateTimeFormat,this.opts).format(this.value)}catch(n){return e.reportError(n),new Date(this.value).toISOString()}}}const xg=100,K$="⁨",_$="⁩";function $$(t,e,n){if(n===e||n instanceof Zr&&e instanceof Zr&&n.value===e.value)return!0;if(e instanceof Zr&&typeof n=="string"){let c=t.memoizeIntlObject(Intl.PluralRules,e.opts).select(e.value);if(n===c)return!0}return!1}function kg(t,e,n){return e[n]?eu(t,e[n].value):(t.reportError(new RangeError("No default")),new Cn)}function d0(t,e){const n=[],c=Object.create(null);for(const a of e)a.type==="narg"?c[a.name]=kb(t,a.value):n.push(kb(t,a));return{positional:n,named:c}}function kb(t,e){switch(e.type){case"str":return e.value;case"num":return new Zr(e.value,{minimumFractionDigits:e.precision});case"var":return q$(t,e);case"mesg":return tq(t,e);case"term":return eq(t,e);case"func":return nq(t,e);case"select":return cq(t,e);default:return new Cn}}function q$(t,{name:e}){let n;if(t.params)if(Object.prototype.hasOwnProperty.call(t.params,e))n=t.params[e];else return new Cn(`$${e}`);else if(t.args&&Object.prototype.hasOwnProperty.call(t.args,e))n=t.args[e];else return t.reportError(new ReferenceError(`Unknown variable: $${e}`)),new Cn(`$${e}`);if(n instanceof Dm)return n;switch(typeof n){case"string":return n;case"number":return new Zr(n);case"object":if(n instanceof Date)return new xb(n.getTime());default:return t.reportError(new TypeError(`Variable type not supported: $${e}, ${typeof n}`)),new Cn(`$${e}`)}}function tq(t,{name:e,attr:n}){const c=t.bundle._messages.get(e);if(!c)return t.reportError(new ReferenceError(`Unknown message: ${e}`)),new Cn(e);if(n){const a=c.attributes[n];return a?eu(t,a):(t.reportError(new ReferenceError(`Unknown attribute: ${n}`)),new Cn(`${e}.${n}`))}return c.value?eu(t,c.value):(t.reportError(new ReferenceError(`No value: ${e}`)),new Cn(e))}function eq(t,{name:e,attr:n,args:c}){const a=`-${e}`,l=t.bundle._terms.get(a);if(!l)return t.reportError(new ReferenceError(`Unknown term: ${a}`)),new Cn(a);if(n){const d=l.attributes[n];if(d){t.params=d0(t,c).named;const o=eu(t,d);return t.params=null,o}return t.reportError(new ReferenceError(`Unknown attribute: ${n}`)),new Cn(`${a}.${n}`)}t.params=d0(t,c).named;const r=eu(t,l.value);return t.params=null,r}function nq(t,{name:e,args:n}){let c=t.bundle._functions[e];if(!c)return t.reportError(new ReferenceError(`Unknown function: ${e}()`)),new Cn(`${e}()`);if(typeof c!="function")return t.reportError(new TypeError(`Function ${e}() is not callable`)),new Cn(`${e}()`);try{let a=d0(t,n);return c(a.positional,a.named)}catch(a){return t.reportError(a),new Cn(`${e}()`)}}function cq(t,{selector:e,variants:n,star:c}){let a=kb(t,e);if(a instanceof Cn)return kg(t,n,c);for(const l of n){const r=kb(t,l.key);if($$(t,a,r))return eu(t,l.value)}return kg(t,n,c)}function Sg(t,e){if(t.dirty.has(e))return t.reportError(new RangeError("Cyclic reference")),new Cn;t.dirty.add(e);const n=[],c=t.bundle._useIsolating&&e.length>1;for(const a of e){if(typeof a=="string"){n.push(t.bundle._transform(a));continue}if(t.placeables++,t.placeables>xg)throw t.dirty.delete(e),new RangeError(`Too many placeables expanded: ${t.placeables}, max allowed is ${xg}`);c&&n.push(K$),n.push(kb(t,a).toString(t)),c&&n.push(_$)}return t.dirty.delete(e),n.join("")}function eu(t,e){return typeof e=="string"?t.bundle._transform(e):Sg(t,e)}class aq{constructor(e,n,c){this.dirty=new WeakSet,this.params=null,this.placeables=0,this.bundle=e,this.errors=n,this.args=c}reportError(e){if(!this.errors||!(e instanceof Error))throw e;this.errors.push(e)}memoizeIntlObject(e,n){let c=this.bundle._intls.get(e);c||(c={},this.bundle._intls.set(e,c));let a=JSON.stringify(n);return c[a]||(c[a]=new e(this.bundle.locales,n)),c[a]}}function Bm(t,e){const n=Object.create(null);for(const[c,a]of Object.entries(t))e.includes(c)&&(n[c]=a.valueOf());return n}const Ig=["unitDisplay","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function lq(t,e){let n=t[0];if(n instanceof Cn)return new Cn(`NUMBER(${n.valueOf()})`);if(n instanceof Zr)return new Zr(n.valueOf(),{...n.opts,...Bm(e,Ig)});if(n instanceof xb)return new Zr(n.valueOf(),{...Bm(e,Ig)});throw new TypeError("Invalid argument to NUMBER")}const Fg=["dateStyle","timeStyle","fractionalSecondDigits","dayPeriod","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function rq(t,e){let n=t[0];if(n instanceof Cn)return new Cn(`DATETIME(${n.valueOf()})`);if(n instanceof xb)return new xb(n.valueOf(),{...n.opts,...Bm(e,Fg)});if(n instanceof Zr)return new xb(n.valueOf(),{...Bm(e,Fg)});throw new TypeError("Invalid argument to DATETIME")}const Hg=new Map;function iq(t){const e=Array.isArray(t)?t.join(" "):t;let n=Hg.get(e);return n===void 0&&(n=new Map,Hg.set(e,n)),n}class dq{constructor(e,{functions:n,useIsolating:c=!0,transform:a=l=>l}={}){this._terms=new Map,this._messages=new Map,this.locales=Array.isArray(e)?e:[e],this._functions={NUMBER:lq,DATETIME:rq,...n},this._useIsolating=c,this._transform=a,this._intls=iq(e)}hasMessage(e){return this._messages.has(e)}getMessage(e){return this._messages.get(e)}addResource(e,{allowOverrides:n=!1}={}){const c=[];for(let a=0;a<e.body.length;a++){let l=e.body[a];if(l.id.startsWith("-")){if(n===!1&&this._terms.has(l.id)){c.push(new Error(`Attempt to override an existing term: "${l.id}"`));continue}this._terms.set(l.id,l)}else{if(n===!1&&this._messages.has(l.id)){c.push(new Error(`Attempt to override an existing message: "${l.id}"`));continue}this._messages.set(l.id,l)}}return c}formatPattern(e,n=null,c=null){if(typeof e=="string")return this._transform(e);let a=new aq(this,c,n);try{return Sg(a,e).toString(a)}catch(l){if(a.errors&&l instanceof Error)return a.errors.push(l),new Cn().toString(a);throw l}}}const o0=/^(-?[a-zA-Z][\w-]*) *= */gm,Tg=/\.([a-zA-Z][\w-]*) *= */y,oq=/\*?\[/y,u0=/(-?[0-9]+(?:\.([0-9]+))?)/y,uq=/([a-zA-Z][\w-]*)/y,Dg=/([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y,sq=/^[A-Z][A-Z0-9_-]*$/,Qm=/([^{}\n\r]+)/y,bq=/([^\\"\n\r]*)/y,Bg=/\\([\\"])/y,Qg=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y,yq=/^\n+/,Ug=/ +$/,Zq=/ *\r?\n/g,Wq=/( *)$/,mq=/{\s*/y,Eg=/\s*}/y,Lq=/\[\s*/y,hq=/\s*] */y,Xq=/\s*\(\s*/y,vq=/\s*->\s*/y,Gq=/\s*:\s*/y,pq=/\s*,?\s*/y,Yq=/\s+/y;class Jq{constructor(e){this.body=[],o0.lastIndex=0;let n=0;for(;;){let N=o0.exec(e);if(N===null)break;n=o0.lastIndex;try{this.body.push(o(N[1]))}catch(R){if(R instanceof SyntaxError)continue;throw R}}function c(N){return N.lastIndex=n,N.test(e)}function a(N,R){if(e[n]===N)return n++,!0;if(R)throw new R(`Expected ${N}`);return!1}function l(N,R){if(c(N))return n=N.lastIndex,!0;if(R)throw new R(`Expected ${N.toString()}`);return!1}function r(N){N.lastIndex=n;let R=N.exec(e);if(R===null)throw new SyntaxError(`Expected ${N.toString()}`);return n=N.lastIndex,R}function d(N){return r(N)[1]}function o(N){let R=u(),w=i();if(R===null&&Object.keys(w).length===0)throw new SyntaxError("Expected message value or attributes");return{id:N,value:R,attributes:w}}function i(){let N=Object.create(null);for(;c(Tg);){let R=d(Tg),w=u();if(w===null)throw new SyntaxError("Expected attribute value");N[R]=w}return N}function u(){let N;if(c(Qm)&&(N=d(Qm)),e[n]==="{"||e[n]==="}")return s(N?[N]:[],1/0);let R=f();return R?N?s([N,R],R.length):(R.value=M(R.value,yq),s([R],R.length)):N?M(N,Ug):null}function s(N=[],R){for(;;){if(c(Qm)){N.push(d(Qm));continue}if(e[n]==="{"){N.push(b());continue}if(e[n]==="}")throw new SyntaxError("Unbalanced closing brace");let j=f();if(j){N.push(j),R=Math.min(R,j.length);continue}break}let w=N.length-1,g=N[w];typeof g=="string"&&(N[w]=M(g,Ug));let O=[];for(let j of N)j instanceof Pg&&(j=j.value.slice(0,j.value.length-R)),j&&O.push(j);return O}function b(){l(mq,SyntaxError);let N=Z();if(l(Eg))return N;if(l(vq)){let R=G();return l(Eg,SyntaxError),{type:"select",selector:N,...R}}throw new SyntaxError("Unclosed placeable")}function Z(){if(e[n]==="{")return b();if(c(Dg)){let[,N,R,w=null]=r(Dg);if(N==="$")return{type:"var",name:R};if(l(Xq)){let g=W();if(N==="-")return{type:"term",name:R,attr:w,args:g};if(sq.test(R))return{type:"func",name:R,args:g};throw new SyntaxError("Function names must be all upper-case")}return N==="-"?{type:"term",name:R,attr:w,args:[]}:{type:"mesg",name:R,attr:w}}return h()}function W(){let N=[];for(;;){switch(e[n]){case")":return n++,N;case void 0:throw new SyntaxError("Unclosed argument list")}N.push(m()),l(pq)}}function m(){let N=Z();return N.type!=="mesg"?N:l(Gq)?{type:"narg",name:N.name,value:h()}:N}function G(){let N=[],R=0,w;for(;c(oq);){a("*")&&(w=R);let g=L(),O=u();if(O===null)throw new SyntaxError("Expected variant value");N[R++]={key:g,value:O}}if(R===0)return null;if(w===void 0)throw new SyntaxError("Expected default variant");return{variants:N,star:w}}function L(){l(Lq,SyntaxError);let N;return c(u0)?N=p():N={type:"str",value:d(uq)},l(hq,SyntaxError),N}function h(){if(c(u0))return p();if(e[n]==='"')return Y();throw new SyntaxError("Invalid expression")}function p(){let[,N,R=""]=r(u0),w=R.length;return{type:"num",value:parseFloat(N),precision:w}}function Y(){a('"',SyntaxError);let N="";for(;;){if(N+=d(bq),e[n]==="\\"){N+=J();continue}if(a('"'))return{type:"str",value:N};throw new SyntaxError("Unclosed string literal")}}function J(){if(c(Bg))return d(Bg);if(c(Qg)){let[,N,R]=r(Qg),w=parseInt(N||R,16);return w<=55295||57344<=w?String.fromCodePoint(w):"�"}throw new SyntaxError("Unknown escape sequence")}function f(){let N=n;switch(l(Yq),e[n]){case".":case"[":case"*":case"}":case void 0:return!1;case"{":return z(e.slice(N,n))}return e[n-1]===" "?z(e.slice(N,n)):!1}function M(N,R){return N.replace(R,"")}function z(N){let R=N.replace(Zq,`
87
+ `,l0=t=>{const{className:e,children:n,...c}=t,a=v.useMemo(()=>jr(V$,e),[e]);return _("div",{className:a,...c,children:n})};l0.displayName="Screen";function g$(t,e,n){const c=v.useRef(e),a=v.useRef(t);c.current=e,a.current=t,v.useEffect(()=>(a.current(),()=>{c.current()}),n)}const C$=(t,e)=>{const n=ia(),c=rl(),a=v.useRef([]),l=v.useCallback(()=>{a.current.forEach(d=>d.unsubscribe())},[]),r=v.useCallback(()=>{const d=[];M_(c.store.events,(o,i)=>{const u=j$(n,o),s=n.eventSubject.pipe(Ab(b=>b.type===i&&b.sender.id===c.id),e0(u),pg((b,Z)=>(console.error(b),Z))).subscribe();d.push(s)}),a.current=d},[c.store.events,c.id,n]);g$(()=>{r();const d=new Iv(xv,c,n,[],t);n.eventSubject.next(d)},()=>{const d=new Iv(kv,c,n,[],t);n.eventSubject.next(d),l()},e)};function j$(t,e){const n=e.map(c=>({func:t.findAction(c).func,args:c.args?{...c.args}:{}}));return async c=>{for(const{func:a,args:l}of n){const r=a(c,l);Hv(r)&&await r}}}const A$=Nc("ComponentViewer",()=>{const t=rl(),{componentWrapper:e,computeChildren:n}=Al(),c=ia(),a=v.useCallback(h=>{const p=t.dataRootProvider??c.dataContext;return c.localizeComponent("component",p.dataRoot,h)},[c,t]),l=y$(),r=Al(),d=v.useCallback((h,p)=>n?n(h,p):G$(h,c.form.componentTree,l,p),[n,c.form.componentTree,l]),o=v.useMemo(()=>new fg(t,c,a,d,r),[t,c,a,d,r]);C$(o,[r]);const{key:i,...u}=o.get,{kind:s,component:b}=t.model,Z=jr(u.className,o.wrapperClassName),W=e??l0,m=t.store.tooltipProps?N$:v.Fragment,G=e??b,L=_(b,{...u},i);return s==="container"?_(G,{...u,className:Z},i):s==="repeater"?_(W,{children:_(m,{children:_(Rg,{children:_(b,{...u,wrapperClassName:Z},i)})})}):_(W,{className:s==="template"?Z:o.wrapperClassName,children:s==="template"?L:_(m,{children:_(Rg,{children:L})})})}),O$=Nc("ComponentTreeItem",({componentData:t})=>_(qV,{value:t,children:_(A$,{})})),wg=Nc("ComponentTree",({data:t})=>_(Z$,{value:wg,children:t.map(e=>_(O$,{componentData:e},e.id))})),x$=()=>{const t=window.innerWidth;return t<=600?"mobile":t<=900?"tablet":"desktop"};function k$(){const t=ia(),e=Al();v.useEffect(()=>{if(e.viewMode){t.viewMode=e.viewMode;return}const n=()=>t.viewMode=x$();return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e.viewMode,t])}const S$=Nc("Viewer",({event:t})=>{const e=ia(),{formLoadError:n}=e,c=Al(),a=v.useMemo(()=>[e.form.componentTree],[e.form.componentTree]);return v.useEffect(()=>{t==null||t(new Ob(e.eventSubject))},[t,e.eventSubject]),k$(),v.useEffect(()=>e.loadForm(c.getForm,c.formName),[e,c.getForm,c.formName]),n?_("div",{className:"form-error",children:n}):_(wg,{data:a})});function I$(t){if(!t)return;const e={};return Object.entries(t).forEach(([n,c])=>{e[n]=c instanceof fc?c:fc.functionalAction(c)}),e}class r0{constructor(e){rt(this,"view",new d1);rt(this,"initialData",{});rt(this,"validators");rt(this,"formValidators");rt(this,"localizer");rt(this,"actions");rt(this,"propsLanguage");rt(this,"errorWrapper");rt(this,"showAllValidationErrors");e&&this.applyProps(e),k2(this,{view:Ge.ref,initialData:Ge.ref,validators:Ge.ref,formValidators:Ge.ref,localizer:Ge.ref,actions:Ge.ref,propsLanguage:Ge.ref,errorWrapper:Ge.ref,showAllValidationErrors:Ge.ref},{name:jl("FormViewerPropsStore")})}applyProps(e){this.view=e.view,this.initialData=e.initialData??{},this.validators=e.validators,this.formValidators=e.formValidators,this.localizer=e.localize,this.actions=I$(e.actions),this.propsLanguage=e.language,this.errorWrapper=e.errorWrapper,this.showAllValidationErrors=e.showAllValidationErrors}clone(){const e=new r0;return e.view=this.view,e.initialData=this.initialData,e.validators=this.validators,e.formValidators=this.formValidators,e.localizer=this.localizer,e.actions=this.actions,e.propsLanguage=this.propsLanguage,e.errorWrapper=this.errorWrapper,e.showAllValidationErrors=this.showAllValidationErrors,e}}function Vg(t,e,n,c){const a=t.props[e];if(km(a)){const{result:l}=n0(a,n);return[!0,l]}return EV(a)?[!0,c("component",t)[e]]:[!1]}function i0(t,e){if(Array.isArray(t)&&PV(e)||Tv(t)&&Fv(e))return t[e]}function gg(t){return function(e){return F$(t,e)}}function F$(t,e){const n=T$(t,e);return async(c,a)=>{if(!n)return;const l=[];for(const{settings:r,validator:d,params:o}of n){const i={};o==null||o.filter(b=>typeof b.default<"u").map(b=>i[b.key]=b.default),Object.assign(i,r.args);const u=d(c,a,i),s=Hv(u)?await u:u;s!==!0&&l.push({settings:r,message:typeof s=="string"?s:i.message})}return l}}const H$=()=>!0;function T$(t,e){if(!e||!e.validations||!e.validations.length)return;const n=[...e.validations].sort(D$),c=a=>{var l;if(!a.type){const r=t.internal[a.key],d=r.validatorFactory(a.args??{});return{settings:a,validator:d,params:r.params}}if(a.type==="custom"){const r=(l=t.custom)==null?void 0:l[a.key];if(r)return{settings:a,validator:r.validate,params:r.params}}return console.warn(`Cannot find rule, key: '${a.key}', type: '${a.type}'`),{settings:a,validator:H$}};return n.map(c)}function D$(t,e){return e.key==="code"?-1:e.key==="required"?1:0}class B${constructor(e,n,c,a,l,r,d){Ke(this,aZ,void 0);rt(this,"error");rt(this,"touched",!1);rt(this,"valued");rt(this,"valueType");rt(this,"dataValidator");Ke(this,lZ,void 0);rt(this,"initialData");rt(this,"setError",e=>{if(typeof e>"u"||e===null){this.clearError();return}if(!Tv(e))throw new Error(`Expected 'object' type, got '${typeof e}'`);this.error=e[this.errorFieldName];const n=e[this.componentStore.key];this.componentData.forEach((c,a)=>{const l=n==null?void 0:n[a];c.fields.forEach((r,d)=>r.setError(l==null?void 0:l[d]))})});if(this.dataContext=e,this.componentDataFactory=n,this.store=c,this.getValidationRules=a,this.componentStore=l,this.model=r,this.deferFieldCalculation=d,!r.valued)throw new Error("'model.valued' is falsy");if(!r.valueType)throw new Error("'model.typeOfValue' is undefined");this.valued=r.valued,this.valueType=r.valueType;const o="RepeaterField";ql(this,{model:!1,dataValidator:Ge.ref},{name:jl(o,{key:l.key}),autoBind:!0}),Ac(this,lZ,[Ms(()=>{this.dataValidator=this.dataContext.createDataValidator(l,this.valueType,i=>this.error=i),qZ(()=>{var i;(i=de(this,aZ))==null||i.dispose(),Ac(this,aZ,this.dataValidator)})},{name:xm(o,"setValidator",{key:l.key})}),Ms(()=>{const u=i0(this.dataContext.initialData,l.key)??this.initialValue;if(this.deferFieldCalculation){this.initialData=u;return}const[s,b]=this.dataContext.calculateValue(l,this.valued);if(s){this.initialData=b;return}this.initialData=u},{name:xm(o,"setValue",{key:l.key})}),()=>{var i;return(i=this.dataValidator)==null?void 0:i.dispose()}])}get fieldType(){return"repeater"}init(){this.deferFieldCalculation=!1,this.initFields(this.componentData)}get initialValue(){var e;return((e=this.componentStore.props[this.valued])==null?void 0:e.value)??this.defaultValue}get defaultValue(){var e;return(e=this.model.defaultProps)==null?void 0:e[this.valued]}dispose(){de(this,lZ).forEach(e=>e())}get value(){const e=[];return this.componentData.forEach(n=>{e.push(n.data)}),e}setValue(e){if(e===null||typeof e>"u"||Array.isArray(e)){this.initialData=e;return}}setTouched(){this.touched=!0}async validate(){var n,c;if(!this.needValidate){this.clearError();return}const e=this.componentData.map(a=>a.validate());await Promise.allSettled(e),await((c=(n=this.dataValidator)==null?void 0:n.validate)==null?void 0:c.call(n,this.value))}async getValidationResult(){if(!this.needValidate)return;const e=[];for(let n=0;n<this.componentData.length;n++){const a=await this.componentData[n].getValidationResult();e.push(a)}return e}reset(){this.setValue(this.initialValue),this.componentData.forEach(e=>{e.fields.forEach(n=>n.reset())}),this.clearError()}clear(){this.setValue(this.defaultValue),this.touched=!1,this.clearError()}get needValidate(){return c0(this.componentStore,this.dataContext.dataRoot)}clearError(){this.error=void 0,this.componentData.forEach(e=>{e.fields.forEach(n=>n.setError(void 0))})}get errors(){let e=!1;const n=[];if(this.componentData.forEach(c=>{n.push(c.errors),e=e||c.hasErrors}),!!e)return n}get repeaterItemStore(){var c;const e=JSON.parse(JSON.stringify(this.componentStore)),n=new Mc(this.componentStore.key,"RepeaterItem");return n.type="RepeaterItem",n.children=e.children,n.renderWhen=(c=e.props)==null?void 0:c.itemRenderWhen,n}get itemsCount(){return!this.initialData||!Array.isArray(this.initialData)?0:this.initialData.length}get componentData(){const e=this.itemsCount,n=this.repeaterItemStore,c=this.componentStore.key;return gT(()=>{const a=[];for(let l=0;l<e;l++){const r=new Mc(`${c}-context-item-${l}`,"Fragment"),d=this.componentDataFactory.createComponentData(r,!1);d.index=l,d.parent=this.dataContext.dataRoot;const o=new Cg(this,this.store,this.getValidationRules,this.dataContext,d,l),i=new Mc(`${c}-root-item-${l}`,"Fragment"),u=this.componentDataFactory.createComponentData(i,!1,void 0,o);u.setParent(d);const s=Mc.createFromObject(n);s.key=`${c}-item-${l}`,this.componentDataFactory.createComponentData(s,!0,void 0,o).setParent(u),a.push(d)}return this.deferFieldCalculation||this.initFields(a),a})}initFields(e){e.map(n=>{n.fields.forEach(c=>c.init())})}get errorFieldName(){return`${this.componentStore.key}Error`}}aZ=new WeakMap,lZ=new WeakMap;class Cg{constructor(e,n,c,a,l,r){this.repeaterField=e,this.store=n,this.getValidationRules=c,this.parentContext=a,this.root=l,this.index=r}get initialData(){const e=this.repeaterField.initialData;if(Array.isArray(e))return e[this.index]}calculateValue(e,n){return Vg(e,n,this.dataRoot,(c,a)=>this.store.localizeComponent(c,this.dataRoot,a))}get dataRoot(){return this.root}createDataValidator(e,n,c){const a=this.getValidationRules(n);return Tm.create(this.store,gg(a),e.schema,c,this.store.localizeErrorMessages.bind(this.store,this.dataRoot,e))}}const Q$=t=>{if(t)try{return JSON.parse(t)}catch{return}},jg=(t,e,n,c,a)=>{const l=t[e]??[];if(typeof n=="number"&&l.length>=n)return;const r=Q$(c)??{},d=[...l];typeof a=="number"?d.splice(a,0,r):d.push(r),t[e]=d},Ag=(t,e,n,c)=>{const a=t[e];if(!Array.isArray(a)||typeof c=="number"&&a.length<=c)return;const l=[...a];l.splice(n,1),t[e]=l},Og=t=>{const e=t.dataRootProvider;if(e instanceof Cg)return e.repeaterField.componentStore.key},U$=fc.functionalAction((t,e)=>{if(e.dataKey){jg(t.data,e.dataKey,e.max,e.rowData,e.index);return}const n=Og(t.sender);n&&t.parentData&&jg(t.parentData,n,e.max,e.rowData,e.index)},{dataKey:"string",rowData:"string",index:"number",max:"number"}),E$=fc.functionalAction((t,e)=>{const n=e.index??t.index??-1;if(e.dataKey){Ag(t.data,e.dataKey,n,e.min);return}const c=Og(t.sender);c&&t.parentData&&Ag(t.parentData,c,n,e.min)},{dataKey:"string",index:"number",min:"number"}),P$={log:fc.functionalAction(console.log),validate:fc.functionalAction(async t=>await t.store.form.componentTree.validate()),clear:fc.functionalAction(t=>t.store.form.componentTree.clear()),reset:fc.functionalAction(t=>t.store.form.componentTree.reset()),addRow:U$,removeRow:E$};class Dm{constructor(e){this.value=e}valueOf(){return this.value}}class Cn extends Dm{constructor(e="???"){super(e)}toString(e){return`{${this.value}}`}}class Zr extends Dm{constructor(e,n={}){super(e),this.opts=n}toString(e){try{return e.memoizeIntlObject(Intl.NumberFormat,this.opts).format(this.value)}catch(n){return e.reportError(n),this.value.toString(10)}}}class xb extends Dm{constructor(e,n={}){super(e),this.opts=n}toString(e){try{return e.memoizeIntlObject(Intl.DateTimeFormat,this.opts).format(this.value)}catch(n){return e.reportError(n),new Date(this.value).toISOString()}}}const xg=100,K$="⁨",_$="⁩";function $$(t,e,n){if(n===e||n instanceof Zr&&e instanceof Zr&&n.value===e.value)return!0;if(e instanceof Zr&&typeof n=="string"){let c=t.memoizeIntlObject(Intl.PluralRules,e.opts).select(e.value);if(n===c)return!0}return!1}function kg(t,e,n){return e[n]?eu(t,e[n].value):(t.reportError(new RangeError("No default")),new Cn)}function d0(t,e){const n=[],c=Object.create(null);for(const a of e)a.type==="narg"?c[a.name]=kb(t,a.value):n.push(kb(t,a));return{positional:n,named:c}}function kb(t,e){switch(e.type){case"str":return e.value;case"num":return new Zr(e.value,{minimumFractionDigits:e.precision});case"var":return q$(t,e);case"mesg":return tq(t,e);case"term":return eq(t,e);case"func":return nq(t,e);case"select":return cq(t,e);default:return new Cn}}function q$(t,{name:e}){let n;if(t.params)if(Object.prototype.hasOwnProperty.call(t.params,e))n=t.params[e];else return new Cn(`$${e}`);else if(t.args&&Object.prototype.hasOwnProperty.call(t.args,e))n=t.args[e];else return t.reportError(new ReferenceError(`Unknown variable: $${e}`)),new Cn(`$${e}`);if(n instanceof Dm)return n;switch(typeof n){case"string":return n;case"number":return new Zr(n);case"object":if(n instanceof Date)return new xb(n.getTime());default:return t.reportError(new TypeError(`Variable type not supported: $${e}, ${typeof n}`)),new Cn(`$${e}`)}}function tq(t,{name:e,attr:n}){const c=t.bundle._messages.get(e);if(!c)return t.reportError(new ReferenceError(`Unknown message: ${e}`)),new Cn(e);if(n){const a=c.attributes[n];return a?eu(t,a):(t.reportError(new ReferenceError(`Unknown attribute: ${n}`)),new Cn(`${e}.${n}`))}return c.value?eu(t,c.value):(t.reportError(new ReferenceError(`No value: ${e}`)),new Cn(e))}function eq(t,{name:e,attr:n,args:c}){const a=`-${e}`,l=t.bundle._terms.get(a);if(!l)return t.reportError(new ReferenceError(`Unknown term: ${a}`)),new Cn(a);if(n){const d=l.attributes[n];if(d){t.params=d0(t,c).named;const o=eu(t,d);return t.params=null,o}return t.reportError(new ReferenceError(`Unknown attribute: ${n}`)),new Cn(`${a}.${n}`)}t.params=d0(t,c).named;const r=eu(t,l.value);return t.params=null,r}function nq(t,{name:e,args:n}){let c=t.bundle._functions[e];if(!c)return t.reportError(new ReferenceError(`Unknown function: ${e}()`)),new Cn(`${e}()`);if(typeof c!="function")return t.reportError(new TypeError(`Function ${e}() is not callable`)),new Cn(`${e}()`);try{let a=d0(t,n);return c(a.positional,a.named)}catch(a){return t.reportError(a),new Cn(`${e}()`)}}function cq(t,{selector:e,variants:n,star:c}){let a=kb(t,e);if(a instanceof Cn)return kg(t,n,c);for(const l of n){const r=kb(t,l.key);if($$(t,a,r))return eu(t,l.value)}return kg(t,n,c)}function Sg(t,e){if(t.dirty.has(e))return t.reportError(new RangeError("Cyclic reference")),new Cn;t.dirty.add(e);const n=[],c=t.bundle._useIsolating&&e.length>1;for(const a of e){if(typeof a=="string"){n.push(t.bundle._transform(a));continue}if(t.placeables++,t.placeables>xg)throw t.dirty.delete(e),new RangeError(`Too many placeables expanded: ${t.placeables}, max allowed is ${xg}`);c&&n.push(K$),n.push(kb(t,a).toString(t)),c&&n.push(_$)}return t.dirty.delete(e),n.join("")}function eu(t,e){return typeof e=="string"?t.bundle._transform(e):Sg(t,e)}class aq{constructor(e,n,c){this.dirty=new WeakSet,this.params=null,this.placeables=0,this.bundle=e,this.errors=n,this.args=c}reportError(e){if(!this.errors||!(e instanceof Error))throw e;this.errors.push(e)}memoizeIntlObject(e,n){let c=this.bundle._intls.get(e);c||(c={},this.bundle._intls.set(e,c));let a=JSON.stringify(n);return c[a]||(c[a]=new e(this.bundle.locales,n)),c[a]}}function Bm(t,e){const n=Object.create(null);for(const[c,a]of Object.entries(t))e.includes(c)&&(n[c]=a.valueOf());return n}const Ig=["unitDisplay","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function lq(t,e){let n=t[0];if(n instanceof Cn)return new Cn(`NUMBER(${n.valueOf()})`);if(n instanceof Zr)return new Zr(n.valueOf(),{...n.opts,...Bm(e,Ig)});if(n instanceof xb)return new Zr(n.valueOf(),{...Bm(e,Ig)});throw new TypeError("Invalid argument to NUMBER")}const Fg=["dateStyle","timeStyle","fractionalSecondDigits","dayPeriod","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function rq(t,e){let n=t[0];if(n instanceof Cn)return new Cn(`DATETIME(${n.valueOf()})`);if(n instanceof xb)return new xb(n.valueOf(),{...n.opts,...Bm(e,Fg)});if(n instanceof Zr)return new xb(n.valueOf(),{...Bm(e,Fg)});throw new TypeError("Invalid argument to DATETIME")}const Hg=new Map;function iq(t){const e=Array.isArray(t)?t.join(" "):t;let n=Hg.get(e);return n===void 0&&(n=new Map,Hg.set(e,n)),n}class dq{constructor(e,{functions:n,useIsolating:c=!0,transform:a=l=>l}={}){this._terms=new Map,this._messages=new Map,this.locales=Array.isArray(e)?e:[e],this._functions={NUMBER:lq,DATETIME:rq,...n},this._useIsolating=c,this._transform=a,this._intls=iq(e)}hasMessage(e){return this._messages.has(e)}getMessage(e){return this._messages.get(e)}addResource(e,{allowOverrides:n=!1}={}){const c=[];for(let a=0;a<e.body.length;a++){let l=e.body[a];if(l.id.startsWith("-")){if(n===!1&&this._terms.has(l.id)){c.push(new Error(`Attempt to override an existing term: "${l.id}"`));continue}this._terms.set(l.id,l)}else{if(n===!1&&this._messages.has(l.id)){c.push(new Error(`Attempt to override an existing message: "${l.id}"`));continue}this._messages.set(l.id,l)}}return c}formatPattern(e,n=null,c=null){if(typeof e=="string")return this._transform(e);let a=new aq(this,c,n);try{return Sg(a,e).toString(a)}catch(l){if(a.errors&&l instanceof Error)return a.errors.push(l),new Cn().toString(a);throw l}}}const o0=/^(-?[a-zA-Z][\w-]*) *= */gm,Tg=/\.([a-zA-Z][\w-]*) *= */y,oq=/\*?\[/y,u0=/(-?[0-9]+(?:\.([0-9]+))?)/y,uq=/([a-zA-Z][\w-]*)/y,Dg=/([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y,sq=/^[A-Z][A-Z0-9_-]*$/,Qm=/([^{}\n\r]+)/y,bq=/([^\\"\n\r]*)/y,Bg=/\\([\\"])/y,Qg=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y,yq=/^\n+/,Ug=/ +$/,Zq=/ *\r?\n/g,Wq=/( *)$/,mq=/{\s*/y,Eg=/\s*}/y,Lq=/\[\s*/y,hq=/\s*] */y,Xq=/\s*\(\s*/y,vq=/\s*->\s*/y,Gq=/\s*:\s*/y,pq=/\s*,?\s*/y,Yq=/\s+/y;class Jq{constructor(e){this.body=[],o0.lastIndex=0;let n=0;for(;;){let N=o0.exec(e);if(N===null)break;n=o0.lastIndex;try{this.body.push(o(N[1]))}catch(R){if(R instanceof SyntaxError)continue;throw R}}function c(N){return N.lastIndex=n,N.test(e)}function a(N,R){if(e[n]===N)return n++,!0;if(R)throw new R(`Expected ${N}`);return!1}function l(N,R){if(c(N))return n=N.lastIndex,!0;if(R)throw new R(`Expected ${N.toString()}`);return!1}function r(N){N.lastIndex=n;let R=N.exec(e);if(R===null)throw new SyntaxError(`Expected ${N.toString()}`);return n=N.lastIndex,R}function d(N){return r(N)[1]}function o(N){let R=u(),w=i();if(R===null&&Object.keys(w).length===0)throw new SyntaxError("Expected message value or attributes");return{id:N,value:R,attributes:w}}function i(){let N=Object.create(null);for(;c(Tg);){let R=d(Tg),w=u();if(w===null)throw new SyntaxError("Expected attribute value");N[R]=w}return N}function u(){let N;if(c(Qm)&&(N=d(Qm)),e[n]==="{"||e[n]==="}")return s(N?[N]:[],1/0);let R=f();return R?N?s([N,R],R.length):(R.value=M(R.value,yq),s([R],R.length)):N?M(N,Ug):null}function s(N=[],R){for(;;){if(c(Qm)){N.push(d(Qm));continue}if(e[n]==="{"){N.push(b());continue}if(e[n]==="}")throw new SyntaxError("Unbalanced closing brace");let j=f();if(j){N.push(j),R=Math.min(R,j.length);continue}break}let w=N.length-1,g=N[w];typeof g=="string"&&(N[w]=M(g,Ug));let O=[];for(let j of N)j instanceof Pg&&(j=j.value.slice(0,j.value.length-R)),j&&O.push(j);return O}function b(){l(mq,SyntaxError);let N=Z();if(l(Eg))return N;if(l(vq)){let R=G();return l(Eg,SyntaxError),{type:"select",selector:N,...R}}throw new SyntaxError("Unclosed placeable")}function Z(){if(e[n]==="{")return b();if(c(Dg)){let[,N,R,w=null]=r(Dg);if(N==="$")return{type:"var",name:R};if(l(Xq)){let g=W();if(N==="-")return{type:"term",name:R,attr:w,args:g};if(sq.test(R))return{type:"func",name:R,args:g};throw new SyntaxError("Function names must be all upper-case")}return N==="-"?{type:"term",name:R,attr:w,args:[]}:{type:"mesg",name:R,attr:w}}return h()}function W(){let N=[];for(;;){switch(e[n]){case")":return n++,N;case void 0:throw new SyntaxError("Unclosed argument list")}N.push(m()),l(pq)}}function m(){let N=Z();return N.type!=="mesg"?N:l(Gq)?{type:"narg",name:N.name,value:h()}:N}function G(){let N=[],R=0,w;for(;c(oq);){a("*")&&(w=R);let g=L(),O=u();if(O===null)throw new SyntaxError("Expected variant value");N[R++]={key:g,value:O}}if(R===0)return null;if(w===void 0)throw new SyntaxError("Expected default variant");return{variants:N,star:w}}function L(){l(Lq,SyntaxError);let N;return c(u0)?N=p():N={type:"str",value:d(uq)},l(hq,SyntaxError),N}function h(){if(c(u0))return p();if(e[n]==='"')return Y();throw new SyntaxError("Invalid expression")}function p(){let[,N,R=""]=r(u0),w=R.length;return{type:"num",value:parseFloat(N),precision:w}}function Y(){a('"',SyntaxError);let N="";for(;;){if(N+=d(bq),e[n]==="\\"){N+=J();continue}if(a('"'))return{type:"str",value:N};throw new SyntaxError("Unclosed string literal")}}function J(){if(c(Bg))return d(Bg);if(c(Qg)){let[,N,R]=r(Qg),w=parseInt(N||R,16);return w<=55295||57344<=w?String.fromCodePoint(w):"�"}throw new SyntaxError("Unknown escape sequence")}function f(){let N=n;switch(l(Yq),e[n]){case".":case"[":case"*":case"}":case void 0:return!1;case"{":return z(e.slice(N,n))}return e[n-1]===" "?z(e.slice(N,n)):!1}function M(N,R){return N.replace(R,"")}function z(N){let R=N.replace(Zq,`
88
88
  `),w=Wq.exec(N)[1].length;return new Pg(R,w)}}}class Pg{constructor(e,n){this.value=e,this.length=n}}const fq="validator-",Mq=t=>`${fq}${t}`,Nq=(t,e,n,c,a="component")=>{const{defaultBundle:l,fluentBundle:r}=$g(t,n),d={};return Object.keys(c.props).forEach(o=>{const i=c.props[o];if(!EV(i))return;const u=uc(`${c.key}_${a}_${o}`),s=r.getMessage(u)??(l==null?void 0:l.getMessage(u));if(!s){d[o]="[NOT LOCALIZED]";return}const{result:b,fluentErrors:Z}=Kg(r,e.fluentData,s.value);d[o]=b,_g(Z)}),d},zq=(t,e,n,c,a)=>{const l=Mq(a),r="message",d=uc(`${c.key}_${l}_${r}`),{defaultBundle:o,fluentBundle:i}=$g(t,n),u=i.getMessage(d)??(o==null?void 0:o.getMessage(d));if(!u)return;const{result:s,fluentErrors:b}=Kg(i,e.fluentData,u.value);return _g(b),s};function Rq(t,e){return new Proxy(t,{get(n,c){return c in n?n[c]:(e.push(l8(c)),"")},getOwnPropertyDescriptor(n,c){return c in n?Reflect.getOwnPropertyDescriptor(n,c):{value:"",writable:!0,configurable:!0}}})}function Kg(t,e,n){const c=[],a=Rq(e,c),l=[];return{result:t.formatPattern(n,a,l),missingProperties:c,fluentErrors:l}}function _g(t){t.length>0&&console.warn("Localization errors:",t)}const $g=(t,e)=>{const n=t.defaultLanguage!==e?t.localization.getFluentBundle(t.defaultLanguage.fullCode):void 0,c=t.localization.getFluentBundle(e.fullCode);return{defaultBundle:n,fluentBundle:c}};class Sb{constructor(e,n,c,a,l=Yc.LTR){this.code=e,this.dialect=n,this.name=c,this.description=a,this.bidi=l}get fullCode(){return`${this.code}-${this.dialect}`}static clone(e){return new Sb(e.code,e.dialect,e.name,e.description,e.bidi)}}const{height:wq}=Am,{flexDirection:Vq,gap:gq}=md,qg=Uo({...md,...Am,height:wq.setup({default:"100%"}),flexDirection:Vq.default("column"),gap:gq.default("10px")}),Cq=Do(qg),si=new al(l0,void 0,void 0,void 0,void 0,void 0,Cq,void 0,void 0,void 0,"container"),jq={color:"red"},s0=({error:t})=>_("h1",{style:jq,children:(t==null?void 0:t.message)??JSON.stringify(t)});s0.displayName="InternalError";const Um=new al(s0);function Aq(t){const e=new Mc(Um.name,Um.type);e.props.error={value:t};const n=new Mc(si.name,si.type);return n.children=[e],n}function Oq(t){const e={error:t};return new al(s0,void 0,void 0,void 0,void 0,e)}const Em="Template:";function xq(t){return Em+t}function tC(t){if(t.startsWith(Em))return t.slice(Em.length);throw new Error(`Cannot determine template name from '${t}'`)}function eC(t){return t.startsWith(Em)}var Ve;(function(t){t.assertEqual=a=>a;function e(a){}t.assertIs=e;function n(a){throw new Error}t.assertNever=n,t.arrayToEnum=a=>{const l={};for(const r of a)l[r]=r;return l},t.getValidEnumValues=a=>{const l=t.objectKeys(a).filter(d=>typeof a[a[d]]!="number"),r={};for(const d of l)r[d]=a[d];return t.objectValues(r)},t.objectValues=a=>t.objectKeys(a).map(function(l){return a[l]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const l=[];for(const r in a)Object.prototype.hasOwnProperty.call(a,r)&&l.push(r);return l},t.find=(a,l)=>{for(const r of a)if(l(r))return r},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function c(a,l=" | "){return a.map(r=>typeof r=="string"?`'${r}'`:r).join(l)}t.joinValues=c,t.jsonStringifyReplacer=(a,l)=>typeof l=="bigint"?l.toString():l})(Ve||(Ve={}));var b0;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(b0||(b0={}));const xt=Ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),bi=t=>{switch(typeof t){case"undefined":return xt.undefined;case"string":return xt.string;case"number":return isNaN(t)?xt.nan:xt.number;case"boolean":return xt.boolean;case"function":return xt.function;case"bigint":return xt.bigint;case"symbol":return xt.symbol;case"object":return Array.isArray(t)?xt.array:t===null?xt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?xt.promise:typeof Map<"u"&&t instanceof Map?xt.map:typeof Set<"u"&&t instanceof Set?xt.set:typeof Date<"u"&&t instanceof Date?xt.date:xt.object;default:return xt.unknown}},pt=Ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),kq=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class il extends Error{constructor(e){super(),this.issues=[],this.addIssue=c=>{this.issues=[...this.issues,c]},this.addIssues=(c=[])=>{this.issues=[...this.issues,...c]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(l){return l.message},c={_errors:[]},a=l=>{for(const r of l.issues)if(r.code==="invalid_union")r.unionErrors.map(a);else if(r.code==="invalid_return_type")a(r.returnTypeError);else if(r.code==="invalid_arguments")a(r.argumentsError);else if(r.path.length===0)c._errors.push(n(r));else{let d=c,o=0;for(;o<r.path.length;){const i=r.path[o];o===r.path.length-1?(d[i]=d[i]||{_errors:[]},d[i]._errors.push(n(r))):d[i]=d[i]||{_errors:[]},d=d[i],o++}}};return a(this),c}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ve.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},c=[];for(const a of this.issues)a.path.length>0?(n[a.path[0]]=n[a.path[0]]||[],n[a.path[0]].push(e(a))):c.push(e(a));return{formErrors:c,fieldErrors:n}}get formErrors(){return this.flatten()}}il.create=t=>new il(t);const Ib=(t,e)=>{let n;switch(t.code){case pt.invalid_type:t.received===xt.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case pt.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,Ve.jsonStringifyReplacer)}`;break;case pt.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ve.joinValues(t.keys,", ")}`;break;case pt.invalid_union:n="Invalid input";break;case pt.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ve.joinValues(t.options)}`;break;case pt.invalid_enum_value:n=`Invalid enum value. Expected ${Ve.joinValues(t.options)}, received '${t.received}'`;break;case pt.invalid_arguments:n="Invalid function arguments";break;case pt.invalid_return_type:n="Invalid function return type";break;case pt.invalid_date:n="Invalid date";break;case pt.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:Ve.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case pt.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case pt.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case pt.custom:n="Invalid input";break;case pt.invalid_intersection_types:n="Intersection results could not be merged";break;case pt.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case pt.not_finite:n="Number must be finite";break;default:n=e.defaultError,Ve.assertNever(t)}return{message:n}};let nC=Ib;function Sq(t){nC=t}function Pm(){return nC}const Km=t=>{const{data:e,path:n,errorMaps:c,issueData:a}=t,l=[...n,...a.path||[]],r={...a,path:l};let d="";const o=c.filter(i=>!!i).slice().reverse();for(const i of o)d=i(r,{data:e,defaultError:d}).message;return{...a,path:l,message:a.message||d}},Iq=[];function It(t,e){const n=Km({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Pm(),Ib].filter(c=>!!c)});t.common.issues.push(n)}class bc{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const c=[];for(const a of n){if(a.status==="aborted")return ae;a.status==="dirty"&&e.dirty(),c.push(a.value)}return{status:e.value,value:c}}static async mergeObjectAsync(e,n){const c=[];for(const a of n)c.push({key:await a.key,value:await a.value});return bc.mergeObjectSync(e,c)}static mergeObjectSync(e,n){const c={};for(const a of n){const{key:l,value:r}=a;if(l.status==="aborted"||r.status==="aborted")return ae;l.status==="dirty"&&e.dirty(),r.status==="dirty"&&e.dirty(),l.value!=="__proto__"&&(typeof r.value<"u"||a.alwaysSet)&&(c[l.value]=r.value)}return{status:e.value,value:c}}}const ae=Object.freeze({status:"aborted"}),cC=t=>({status:"dirty",value:t}),zc=t=>({status:"valid",value:t}),y0=t=>t.status==="aborted",Z0=t=>t.status==="dirty",Fb=t=>t.status==="valid",_m=t=>typeof Promise<"u"&&t instanceof Promise;var Bt;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Bt||(Bt={}));class Ol{constructor(e,n,c,a){this._cachedPath=[],this.parent=e,this.data=n,this._path=c,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const aC=(t,e)=>{if(Fb(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new il(t.common.issues);return this._error=n,this._error}}};function re(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:c,description:a}=t;if(e&&(n||c))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(r,d)=>r.code!=="invalid_type"?{message:d.defaultError}:typeof d.data>"u"?{message:c??d.defaultError}:{message:n??d.defaultError},description:a}}class oe{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return bi(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:bi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new bc,ctx:{common:e.parent.common,data:e.data,parsedType:bi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(_m(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const c=this.safeParse(e,n);if(c.success)return c.data;throw c.error}safeParse(e,n){var c;const a={common:{issues:[],async:(c=n==null?void 0:n.async)!==null&&c!==void 0?c:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bi(e)},l=this._parseSync({data:e,path:a.path,parent:a});return aC(a,l)}async parseAsync(e,n){const c=await this.safeParseAsync(e,n);if(c.success)return c.data;throw c.error}async safeParseAsync(e,n){const c={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:bi(e)},a=this._parse({data:e,path:c.path,parent:c}),l=await(_m(a)?a:Promise.resolve(a));return aC(c,l)}refine(e,n){const c=a=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(a):n;return this._refinement((a,l)=>{const r=e(a),d=()=>l.addIssue({code:pt.custom,...c(a)});return typeof Promise<"u"&&r instanceof Promise?r.then(o=>o?!0:(d(),!1)):r?!0:(d(),!1)})}refinement(e,n){return this._refinement((c,a)=>e(c)?!0:(a.addIssue(typeof n=="function"?n(c,a):n),!1))}_refinement(e){return new ul({schema:this,typeName:$t.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return mr.create(this,this._def)}nullable(){return vd.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ol.create(this,this._def)}promise(){return lu.create(this,this._def)}or(e){return Bb.create([this,e],this._def)}and(e){return Qb.create(this,e,this._def)}transform(e){return new ul({...re(this._def),schema:this,typeName:$t.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new _b({...re(this._def),innerType:this,defaultValue:n,typeName:$t.ZodDefault})}brand(){return new rC({typeName:$t.ZodBranded,type:this,...re(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new c1({...re(this._def),innerType:this,catchValue:n,typeName:$t.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return $b.create(this,e)}readonly(){return l1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Fq=/^c[^\s-]{8,}$/i,Hq=/^[a-z][a-z0-9]*$/,Tq=/^[0-9A-HJKMNP-TV-Z]{26}$/,Dq=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Bq=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Qq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let W0;const Uq=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Eq=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Pq=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Kq(t,e){return!!((e==="v4"||!e)&&Uq.test(t)||(e==="v6"||!e)&&Eq.test(t))}class dl extends oe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==xt.string){const l=this._getOrReturnCtx(e);return It(l,{code:pt.invalid_type,expected:xt.string,received:l.parsedType}),ae}const c=new bc;let a;for(const l of this._def.checks)if(l.kind==="min")e.data.length<l.value&&(a=this._getOrReturnCtx(e,a),It(a,{code:pt.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),c.dirty());else if(l.kind==="max")e.data.length>l.value&&(a=this._getOrReturnCtx(e,a),It(a,{code:pt.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),c.dirty());else if(l.kind==="length"){const r=e.data.length>l.value,d=e.data.length<l.value;(r||d)&&(a=this._getOrReturnCtx(e,a),r?It(a,{code:pt.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&It(a,{code:pt.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),c.dirty())}else if(l.kind==="email")Bq.test(e.data)||(a=this._getOrReturnCtx(e,a),It(a,{validation:"email",code:pt.invalid_string,message:l.message}),c.dirty());else if(l.kind==="emoji")W0||(W0=new RegExp(Qq,"u")),W0.test(e.data)||(a=this._getOrReturnCtx(e,a),It(a,{validation:"emoji",code:pt.invalid_string,message:l.message}),c.dirty());else if(l.kind==="uuid")Dq.test(e.data)||(a=this._getOrReturnCtx(e,a),It(a,{validation:"uuid",code:pt.invalid_string,message:l.message}),c.dirty());else if(l.kind==="cuid")Fq.test(e.data)||(a=this._getOrReturnCtx(e,a),It(a,{validation:"cuid",code:pt.invalid_string,message:l.message}),c.dirty());else if(l.kind==="cuid2")Hq.test(e.data)||(a=this._getOrReturnCtx(e,a),It(a,{validation:"cuid2",code:pt.invalid_string,message:l.message}),c.dirty());else if(l.kind==="ulid")Tq.test(e.data)||(a=this._getOrReturnCtx(e,a),It(a,{validation:"ulid",code:pt.invalid_string,message:l.message}),c.dirty());else if(l.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),It(a,{validation:"url",code:pt.invalid_string,message:l.message}),c.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),It(a,{validation:"regex",code:pt.invalid_string,message:l.message}),c.dirty())):l.kind==="trim"?e.data=e.data.trim():l.kind==="includes"?e.data.includes(l.value,l.position)||(a=this._getOrReturnCtx(e,a),It(a,{code:pt.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),c.dirty()):l.kind==="toLowerCase"?e.data=e.data.toLowerCase():l.kind==="toUpperCase"?e.data=e.data.toUpperCase():l.kind==="startsWith"?e.data.startsWith(l.value)||(a=this._getOrReturnCtx(e,a),It(a,{code:pt.invalid_string,validation:{startsWith:l.value},message:l.message}),c.dirty()):l.kind==="endsWith"?e.data.endsWith(l.value)||(a=this._getOrReturnCtx(e,a),It(a,{code:pt.invalid_string,validation:{endsWith:l.value},message:l.message}),c.dirty()):l.kind==="datetime"?Pq(l).test(e.data)||(a=this._getOrReturnCtx(e,a),It(a,{code:pt.invalid_string,validation:"datetime",message:l.message}),c.dirty()):l.kind==="ip"?Kq(e.data,l.version)||(a=this._getOrReturnCtx(e,a),It(a,{validation:"ip",code:pt.invalid_string,message:l.message}),c.dirty()):Ve.assertNever(l);return{status:c.value,value:e.data}}_regex(e,n,c){return this.refinement(a=>e.test(a),{validation:n,code:pt.invalid_string,...Bt.errToObj(c)})}_addCheck(e){return new dl({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Bt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Bt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Bt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Bt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Bt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Bt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Bt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Bt.errToObj(e)})}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,...Bt.errToObj(e==null?void 0:e.message)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Bt.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Bt.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Bt.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Bt.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Bt.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Bt.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Bt.errToObj(n)})}nonempty(e){return this.min(1,Bt.errToObj(e))}trim(){return new dl({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new dl({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new dl({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}dl.create=t=>{var e;return new dl({checks:[],typeName:$t.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...re(t)})};function _q(t,e){const n=(t.toString().split(".")[1]||"").length,c=(e.toString().split(".")[1]||"").length,a=n>c?n:c,l=parseInt(t.toFixed(a).replace(".","")),r=parseInt(e.toFixed(a).replace(".",""));return l%r/Math.pow(10,a)}class yi extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==xt.number){const l=this._getOrReturnCtx(e);return It(l,{code:pt.invalid_type,expected:xt.number,received:l.parsedType}),ae}let c;const a=new bc;for(const l of this._def.checks)l.kind==="int"?Ve.isInteger(e.data)||(c=this._getOrReturnCtx(e,c),It(c,{code:pt.invalid_type,expected:"integer",received:"float",message:l.message}),a.dirty()):l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(c=this._getOrReturnCtx(e,c),It(c,{code:pt.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),a.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(c=this._getOrReturnCtx(e,c),It(c,{code:pt.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),a.dirty()):l.kind==="multipleOf"?_q(e.data,l.value)!==0&&(c=this._getOrReturnCtx(e,c),It(c,{code:pt.not_multiple_of,multipleOf:l.value,message:l.message}),a.dirty()):l.kind==="finite"?Number.isFinite(e.data)||(c=this._getOrReturnCtx(e,c),It(c,{code:pt.not_finite,message:l.message}),a.dirty()):Ve.assertNever(l);return{status:a.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Bt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Bt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Bt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Bt.toString(n))}setLimit(e,n,c,a){return new yi({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:c,message:Bt.toString(a)}]})}_addCheck(e){return new yi({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Bt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Bt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Bt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Bt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Bt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Bt.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Bt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Bt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Bt.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ve.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const c of this._def.checks){if(c.kind==="finite"||c.kind==="int"||c.kind==="multipleOf")return!0;c.kind==="min"?(n===null||c.value>n)&&(n=c.value):c.kind==="max"&&(e===null||c.value<e)&&(e=c.value)}return Number.isFinite(n)&&Number.isFinite(e)}}yi.create=t=>new yi({checks:[],typeName:$t.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...re(t)});class Zi extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==xt.bigint){const l=this._getOrReturnCtx(e);return It(l,{code:pt.invalid_type,expected:xt.bigint,received:l.parsedType}),ae}let c;const a=new bc;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?e.data<l.value:e.data<=l.value)&&(c=this._getOrReturnCtx(e,c),It(c,{code:pt.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),a.dirty()):l.kind==="max"?(l.inclusive?e.data>l.value:e.data>=l.value)&&(c=this._getOrReturnCtx(e,c),It(c,{code:pt.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),a.dirty()):l.kind==="multipleOf"?e.data%l.value!==BigInt(0)&&(c=this._getOrReturnCtx(e,c),It(c,{code:pt.not_multiple_of,multipleOf:l.value,message:l.message}),a.dirty()):Ve.assertNever(l);return{status:a.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Bt.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Bt.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Bt.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Bt.toString(n))}setLimit(e,n,c,a){return new Zi({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:c,message:Bt.toString(a)}]})}_addCheck(e){return new Zi({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Bt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Bt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Bt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Bt.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Bt.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Zi.create=t=>{var e;return new Zi({checks:[],typeName:$t.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...re(t)})};class Hb extends oe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==xt.boolean){const c=this._getOrReturnCtx(e);return It(c,{code:pt.invalid_type,expected:xt.boolean,received:c.parsedType}),ae}return zc(e.data)}}Hb.create=t=>new Hb({typeName:$t.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...re(t)});class Ld extends oe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==xt.date){const l=this._getOrReturnCtx(e);return It(l,{code:pt.invalid_type,expected:xt.date,received:l.parsedType}),ae}if(isNaN(e.data.getTime())){const l=this._getOrReturnCtx(e);return It(l,{code:pt.invalid_date}),ae}const c=new bc;let a;for(const l of this._def.checks)l.kind==="min"?e.data.getTime()<l.value&&(a=this._getOrReturnCtx(e,a),It(a,{code:pt.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),c.dirty()):l.kind==="max"?e.data.getTime()>l.value&&(a=this._getOrReturnCtx(e,a),It(a,{code:pt.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),c.dirty()):Ve.assertNever(l);return{status:c.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ld({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Bt.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Bt.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}Ld.create=t=>new Ld({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:$t.ZodDate,...re(t)});class $m extends oe{_parse(e){if(this._getType(e)!==xt.symbol){const c=this._getOrReturnCtx(e);return It(c,{code:pt.invalid_type,expected:xt.symbol,received:c.parsedType}),ae}return zc(e.data)}}$m.create=t=>new $m({typeName:$t.ZodSymbol,...re(t)});class Tb extends oe{_parse(e){if(this._getType(e)!==xt.undefined){const c=this._getOrReturnCtx(e);return It(c,{code:pt.invalid_type,expected:xt.undefined,received:c.parsedType}),ae}return zc(e.data)}}Tb.create=t=>new Tb({typeName:$t.ZodUndefined,...re(t)});class Db extends oe{_parse(e){if(this._getType(e)!==xt.null){const c=this._getOrReturnCtx(e);return It(c,{code:pt.invalid_type,expected:xt.null,received:c.parsedType}),ae}return zc(e.data)}}Db.create=t=>new Db({typeName:$t.ZodNull,...re(t)});class nu extends oe{constructor(){super(...arguments),this._any=!0}_parse(e){return zc(e.data)}}nu.create=t=>new nu({typeName:$t.ZodAny,...re(t)});class hd extends oe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return zc(e.data)}}hd.create=t=>new hd({typeName:$t.ZodUnknown,...re(t)});class Wr extends oe{_parse(e){const n=this._getOrReturnCtx(e);return It(n,{code:pt.invalid_type,expected:xt.never,received:n.parsedType}),ae}}Wr.create=t=>new Wr({typeName:$t.ZodNever,...re(t)});class qm extends oe{_parse(e){if(this._getType(e)!==xt.undefined){const c=this._getOrReturnCtx(e);return It(c,{code:pt.invalid_type,expected:xt.void,received:c.parsedType}),ae}return zc(e.data)}}qm.create=t=>new qm({typeName:$t.ZodVoid,...re(t)});class ol extends oe{_parse(e){const{ctx:n,status:c}=this._processInputParams(e),a=this._def;if(n.parsedType!==xt.array)return It(n,{code:pt.invalid_type,expected:xt.array,received:n.parsedType}),ae;if(a.exactLength!==null){const r=n.data.length>a.exactLength.value,d=n.data.length<a.exactLength.value;(r||d)&&(It(n,{code:r?pt.too_big:pt.too_small,minimum:d?a.exactLength.value:void 0,maximum:r?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),c.dirty())}if(a.minLength!==null&&n.data.length<a.minLength.value&&(It(n,{code:pt.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),c.dirty()),a.maxLength!==null&&n.data.length>a.maxLength.value&&(It(n,{code:pt.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),c.dirty()),n.common.async)return Promise.all([...n.data].map((r,d)=>a.type._parseAsync(new Ol(n,r,n.path,d)))).then(r=>bc.mergeArray(c,r));const l=[...n.data].map((r,d)=>a.type._parseSync(new Ol(n,r,n.path,d)));return bc.mergeArray(c,l)}get element(){return this._def.type}min(e,n){return new ol({...this._def,minLength:{value:e,message:Bt.toString(n)}})}max(e,n){return new ol({...this._def,maxLength:{value:e,message:Bt.toString(n)}})}length(e,n){return new ol({...this._def,exactLength:{value:e,message:Bt.toString(n)}})}nonempty(e){return this.min(1,e)}}ol.create=(t,e)=>new ol({type:t,minLength:null,maxLength:null,exactLength:null,typeName:$t.ZodArray,...re(e)});function cu(t){if(t instanceof Ln){const e={};for(const n in t.shape){const c=t.shape[n];e[n]=mr.create(cu(c))}return new Ln({...t._def,shape:()=>e})}else return t instanceof ol?new ol({...t._def,type:cu(t.element)}):t instanceof mr?mr.create(cu(t.unwrap())):t instanceof vd?vd.create(cu(t.unwrap())):t instanceof xl?xl.create(t.items.map(e=>cu(e))):t}class Ln extends oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=Ve.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==xt.object){const i=this._getOrReturnCtx(e);return It(i,{code:pt.invalid_type,expected:xt.object,received:i.parsedType}),ae}const{status:c,ctx:a}=this._processInputParams(e),{shape:l,keys:r}=this._getCached(),d=[];if(!(this._def.catchall instanceof Wr&&this._def.unknownKeys==="strip"))for(const i in a.data)r.includes(i)||d.push(i);const o=[];for(const i of r){const u=l[i],s=a.data[i];o.push({key:{status:"valid",value:i},value:u._parse(new Ol(a,s,a.path,i)),alwaysSet:i in a.data})}if(this._def.catchall instanceof Wr){const i=this._def.unknownKeys;if(i==="passthrough")for(const u of d)o.push({key:{status:"valid",value:u},value:{status:"valid",value:a.data[u]}});else if(i==="strict")d.length>0&&(It(a,{code:pt.unrecognized_keys,keys:d}),c.dirty());else if(i!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const i=this._def.catchall;for(const u of d){const s=a.data[u];o.push({key:{status:"valid",value:u},value:i._parse(new Ol(a,s,a.path,u)),alwaysSet:u in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const i=[];for(const u of o){const s=await u.key;i.push({key:s,value:await u.value,alwaysSet:u.alwaysSet})}return i}).then(i=>bc.mergeObjectSync(c,i)):bc.mergeObjectSync(c,o)}get shape(){return this._def.shape()}strict(e){return Bt.errToObj,new Ln({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,c)=>{var a,l,r,d;const o=(r=(l=(a=this._def).errorMap)===null||l===void 0?void 0:l.call(a,n,c).message)!==null&&r!==void 0?r:c.defaultError;return n.code==="unrecognized_keys"?{message:(d=Bt.errToObj(e).message)!==null&&d!==void 0?d:o}:{message:o}}}:{}})}strip(){return new Ln({...this._def,unknownKeys:"strip"})}passthrough(){return new Ln({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ln({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ln({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:$t.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Ln({...this._def,catchall:e})}pick(e){const n={};return Ve.objectKeys(e).forEach(c=>{e[c]&&this.shape[c]&&(n[c]=this.shape[c])}),new Ln({...this._def,shape:()=>n})}omit(e){const n={};return Ve.objectKeys(this.shape).forEach(c=>{e[c]||(n[c]=this.shape[c])}),new Ln({...this._def,shape:()=>n})}deepPartial(){return cu(this)}partial(e){const n={};return Ve.objectKeys(this.shape).forEach(c=>{const a=this.shape[c];e&&!e[c]?n[c]=a:n[c]=a.optional()}),new Ln({...this._def,shape:()=>n})}required(e){const n={};return Ve.objectKeys(this.shape).forEach(c=>{if(e&&!e[c])n[c]=this.shape[c];else{let l=this.shape[c];for(;l instanceof mr;)l=l._def.innerType;n[c]=l}}),new Ln({...this._def,shape:()=>n})}keyof(){return lC(Ve.objectKeys(this.shape))}}Ln.create=(t,e)=>new Ln({shape:()=>t,unknownKeys:"strip",catchall:Wr.create(),typeName:$t.ZodObject,...re(e)}),Ln.strictCreate=(t,e)=>new Ln({shape:()=>t,unknownKeys:"strict",catchall:Wr.create(),typeName:$t.ZodObject,...re(e)}),Ln.lazycreate=(t,e)=>new Ln({shape:t,unknownKeys:"strip",catchall:Wr.create(),typeName:$t.ZodObject,...re(e)});class Bb extends oe{_parse(e){const{ctx:n}=this._processInputParams(e),c=this._def.options;function a(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const r=l.map(d=>new il(d.ctx.common.issues));return It(n,{code:pt.invalid_union,unionErrors:r}),ae}if(n.common.async)return Promise.all(c.map(async l=>{const r={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:r}),ctx:r}})).then(a);{let l;const r=[];for(const o of c){const i={...n,common:{...n.common,issues:[]},parent:null},u=o._parseSync({data:n.data,path:n.path,parent:i});if(u.status==="valid")return u;u.status==="dirty"&&!l&&(l={result:u,ctx:i}),i.common.issues.length&&r.push(i.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=r.map(o=>new il(o));return It(n,{code:pt.invalid_union,unionErrors:d}),ae}}get options(){return this._def.options}}Bb.create=(t,e)=>new Bb({options:t,typeName:$t.ZodUnion,...re(e)});const t1=t=>t instanceof Eb?t1(t.schema):t instanceof ul?t1(t.innerType()):t instanceof Pb?[t.value]:t instanceof Wi?t.options:t instanceof Kb?Object.keys(t.enum):t instanceof _b?t1(t._def.innerType):t instanceof Tb?[void 0]:t instanceof Db?[null]:null;class e1 extends oe{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==xt.object)return It(n,{code:pt.invalid_type,expected:xt.object,received:n.parsedType}),ae;const c=this.discriminator,a=n.data[c],l=this.optionsMap.get(a);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(It(n,{code:pt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[c]}),ae)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,c){const a=new Map;for(const l of n){const r=t1(l.shape[e]);if(!r)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const d of r){if(a.has(d))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(d)}`);a.set(d,l)}}return new e1({typeName:$t.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:a,...re(c)})}}function m0(t,e){const n=bi(t),c=bi(e);if(t===e)return{valid:!0,data:t};if(n===xt.object&&c===xt.object){const a=Ve.objectKeys(e),l=Ve.objectKeys(t).filter(d=>a.indexOf(d)!==-1),r={...t,...e};for(const d of l){const o=m0(t[d],e[d]);if(!o.valid)return{valid:!1};r[d]=o.data}return{valid:!0,data:r}}else if(n===xt.array&&c===xt.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let l=0;l<t.length;l++){const r=t[l],d=e[l],o=m0(r,d);if(!o.valid)return{valid:!1};a.push(o.data)}return{valid:!0,data:a}}else return n===xt.date&&c===xt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Qb extends oe{_parse(e){const{status:n,ctx:c}=this._processInputParams(e),a=(l,r)=>{if(y0(l)||y0(r))return ae;const d=m0(l.value,r.value);return d.valid?((Z0(l)||Z0(r))&&n.dirty(),{status:n.value,value:d.data}):(It(c,{code:pt.invalid_intersection_types}),ae)};return c.common.async?Promise.all([this._def.left._parseAsync({data:c.data,path:c.path,parent:c}),this._def.right._parseAsync({data:c.data,path:c.path,parent:c})]).then(([l,r])=>a(l,r)):a(this._def.left._parseSync({data:c.data,path:c.path,parent:c}),this._def.right._parseSync({data:c.data,path:c.path,parent:c}))}}Qb.create=(t,e,n)=>new Qb({left:t,right:e,typeName:$t.ZodIntersection,...re(n)});class xl extends oe{_parse(e){const{status:n,ctx:c}=this._processInputParams(e);if(c.parsedType!==xt.array)return It(c,{code:pt.invalid_type,expected:xt.array,received:c.parsedType}),ae;if(c.data.length<this._def.items.length)return It(c,{code:pt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ae;!this._def.rest&&c.data.length>this._def.items.length&&(It(c,{code:pt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...c.data].map((r,d)=>{const o=this._def.items[d]||this._def.rest;return o?o._parse(new Ol(c,r,c.path,d)):null}).filter(r=>!!r);return c.common.async?Promise.all(l).then(r=>bc.mergeArray(n,r)):bc.mergeArray(n,l)}get items(){return this._def.items}rest(e){return new xl({...this._def,rest:e})}}xl.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xl({items:t,typeName:$t.ZodTuple,rest:null,...re(e)})};class Ub extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:c}=this._processInputParams(e);if(c.parsedType!==xt.object)return It(c,{code:pt.invalid_type,expected:xt.object,received:c.parsedType}),ae;const a=[],l=this._def.keyType,r=this._def.valueType;for(const d in c.data)a.push({key:l._parse(new Ol(c,d,c.path,d)),value:r._parse(new Ol(c,c.data[d],c.path,d))});return c.common.async?bc.mergeObjectAsync(n,a):bc.mergeObjectSync(n,a)}get element(){return this._def.valueType}static create(e,n,c){return n instanceof oe?new Ub({keyType:e,valueType:n,typeName:$t.ZodRecord,...re(c)}):new Ub({keyType:dl.create(),valueType:e,typeName:$t.ZodRecord,...re(n)})}}class n1 extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:c}=this._processInputParams(e);if(c.parsedType!==xt.map)return It(c,{code:pt.invalid_type,expected:xt.map,received:c.parsedType}),ae;const a=this._def.keyType,l=this._def.valueType,r=[...c.data.entries()].map(([d,o],i)=>({key:a._parse(new Ol(c,d,c.path,[i,"key"])),value:l._parse(new Ol(c,o,c.path,[i,"value"]))}));if(c.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const o of r){const i=await o.key,u=await o.value;if(i.status==="aborted"||u.status==="aborted")return ae;(i.status==="dirty"||u.status==="dirty")&&n.dirty(),d.set(i.value,u.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const o of r){const i=o.key,u=o.value;if(i.status==="aborted"||u.status==="aborted")return ae;(i.status==="dirty"||u.status==="dirty")&&n.dirty(),d.set(i.value,u.value)}return{status:n.value,value:d}}}}n1.create=(t,e,n)=>new n1({valueType:e,keyType:t,typeName:$t.ZodMap,...re(n)});class Xd extends oe{_parse(e){const{status:n,ctx:c}=this._processInputParams(e);if(c.parsedType!==xt.set)return It(c,{code:pt.invalid_type,expected:xt.set,received:c.parsedType}),ae;const a=this._def;a.minSize!==null&&c.data.size<a.minSize.value&&(It(c,{code:pt.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),n.dirty()),a.maxSize!==null&&c.data.size>a.maxSize.value&&(It(c,{code:pt.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),n.dirty());const l=this._def.valueType;function r(o){const i=new Set;for(const u of o){if(u.status==="aborted")return ae;u.status==="dirty"&&n.dirty(),i.add(u.value)}return{status:n.value,value:i}}const d=[...c.data.values()].map((o,i)=>l._parse(new Ol(c,o,c.path,i)));return c.common.async?Promise.all(d).then(o=>r(o)):r(d)}min(e,n){return new Xd({...this._def,minSize:{value:e,message:Bt.toString(n)}})}max(e,n){return new Xd({...this._def,maxSize:{value:e,message:Bt.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Xd.create=(t,e)=>new Xd({valueType:t,minSize:null,maxSize:null,typeName:$t.ZodSet,...re(e)});class au extends oe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==xt.function)return It(n,{code:pt.invalid_type,expected:xt.function,received:n.parsedType}),ae;function c(d,o){return Km({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Pm(),Ib].filter(i=>!!i),issueData:{code:pt.invalid_arguments,argumentsError:o}})}function a(d,o){return Km({data:d,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Pm(),Ib].filter(i=>!!i),issueData:{code:pt.invalid_return_type,returnTypeError:o}})}const l={errorMap:n.common.contextualErrorMap},r=n.data;if(this._def.returns instanceof lu){const d=this;return zc(async function(...o){const i=new il([]),u=await d._def.args.parseAsync(o,l).catch(Z=>{throw i.addIssue(c(o,Z)),i}),s=await Reflect.apply(r,this,u);return await d._def.returns._def.type.parseAsync(s,l).catch(Z=>{throw i.addIssue(a(s,Z)),i})})}else{const d=this;return zc(function(...o){const i=d._def.args.safeParse(o,l);if(!i.success)throw new il([c(o,i.error)]);const u=Reflect.apply(r,this,i.data),s=d._def.returns.safeParse(u,l);if(!s.success)throw new il([a(u,s.error)]);return s.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new au({...this._def,args:xl.create(e).rest(hd.create())})}returns(e){return new au({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,c){return new au({args:e||xl.create([]).rest(hd.create()),returns:n||hd.create(),typeName:$t.ZodFunction,...re(c)})}}class Eb extends oe{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Eb.create=(t,e)=>new Eb({getter:t,typeName:$t.ZodLazy,...re(e)});class Pb extends oe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return It(n,{received:n.data,code:pt.invalid_literal,expected:this._def.value}),ae}return{status:"valid",value:e.data}}get value(){return this._def.value}}Pb.create=(t,e)=>new Pb({value:t,typeName:$t.ZodLiteral,...re(e)});function lC(t,e){return new Wi({values:t,typeName:$t.ZodEnum,...re(e)})}class Wi extends oe{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),c=this._def.values;return It(n,{expected:Ve.joinValues(c),received:n.parsedType,code:pt.invalid_type}),ae}if(this._def.values.indexOf(e.data)===-1){const n=this._getOrReturnCtx(e),c=this._def.values;return It(n,{received:n.data,code:pt.invalid_enum_value,options:c}),ae}return zc(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e){return Wi.create(e)}exclude(e){return Wi.create(this.options.filter(n=>!e.includes(n)))}}Wi.create=lC;class Kb extends oe{_parse(e){const n=Ve.getValidEnumValues(this._def.values),c=this._getOrReturnCtx(e);if(c.parsedType!==xt.string&&c.parsedType!==xt.number){const a=Ve.objectValues(n);return It(c,{expected:Ve.joinValues(a),received:c.parsedType,code:pt.invalid_type}),ae}if(n.indexOf(e.data)===-1){const a=Ve.objectValues(n);return It(c,{received:c.data,code:pt.invalid_enum_value,options:a}),ae}return zc(e.data)}get enum(){return this._def.values}}Kb.create=(t,e)=>new Kb({values:t,typeName:$t.ZodNativeEnum,...re(e)});class lu extends oe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==xt.promise&&n.common.async===!1)return It(n,{code:pt.invalid_type,expected:xt.promise,received:n.parsedType}),ae;const c=n.parsedType===xt.promise?n.data:Promise.resolve(n.data);return zc(c.then(a=>this._def.type.parseAsync(a,{path:n.path,errorMap:n.common.contextualErrorMap})))}}lu.create=(t,e)=>new lu({type:t,typeName:$t.ZodPromise,...re(e)});class ul extends oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$t.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:c}=this._processInputParams(e),a=this._def.effect||null,l={addIssue:r=>{It(c,r),r.fatal?n.abort():n.dirty()},get path(){return c.path}};if(l.addIssue=l.addIssue.bind(l),a.type==="preprocess"){const r=a.transform(c.data,l);return c.common.issues.length?{status:"dirty",value:c.data}:c.common.async?Promise.resolve(r).then(d=>this._def.schema._parseAsync({data:d,path:c.path,parent:c})):this._def.schema._parseSync({data:r,path:c.path,parent:c})}if(a.type==="refinement"){const r=d=>{const o=a.refinement(d,l);if(c.common.async)return Promise.resolve(o);if(o instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(c.common.async===!1){const d=this._def.schema._parseSync({data:c.data,path:c.path,parent:c});return d.status==="aborted"?ae:(d.status==="dirty"&&n.dirty(),r(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:c.data,path:c.path,parent:c}).then(d=>d.status==="aborted"?ae:(d.status==="dirty"&&n.dirty(),r(d.value).then(()=>({status:n.value,value:d.value}))))}if(a.type==="transform")if(c.common.async===!1){const r=this._def.schema._parseSync({data:c.data,path:c.path,parent:c});if(!Fb(r))return r;const d=a.transform(r.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:c.data,path:c.path,parent:c}).then(r=>Fb(r)?Promise.resolve(a.transform(r.value,l)).then(d=>({status:n.value,value:d})):r);Ve.assertNever(a)}}ul.create=(t,e,n)=>new ul({schema:t,typeName:$t.ZodEffects,effect:e,...re(n)}),ul.createWithPreprocess=(t,e,n)=>new ul({schema:e,effect:{type:"preprocess",transform:t},typeName:$t.ZodEffects,...re(n)});class mr extends oe{_parse(e){return this._getType(e)===xt.undefined?zc(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}mr.create=(t,e)=>new mr({innerType:t,typeName:$t.ZodOptional,...re(e)});class vd extends oe{_parse(e){return this._getType(e)===xt.null?zc(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}vd.create=(t,e)=>new vd({innerType:t,typeName:$t.ZodNullable,...re(e)});class _b extends oe{_parse(e){const{ctx:n}=this._processInputParams(e);let c=n.data;return n.parsedType===xt.undefined&&(c=this._def.defaultValue()),this._def.innerType._parse({data:c,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}_b.create=(t,e)=>new _b({innerType:t,typeName:$t.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...re(e)});class c1 extends oe{_parse(e){const{ctx:n}=this._processInputParams(e),c={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:c.data,path:c.path,parent:{...c}});return _m(a)?a.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new il(c.common.issues)},input:c.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new il(c.common.issues)},input:c.data})}}removeCatch(){return this._def.innerType}}c1.create=(t,e)=>new c1({innerType:t,typeName:$t.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...re(e)});class a1 extends oe{_parse(e){if(this._getType(e)!==xt.nan){const c=this._getOrReturnCtx(e);return It(c,{code:pt.invalid_type,expected:xt.nan,received:c.parsedType}),ae}return{status:"valid",value:e.data}}}a1.create=t=>new a1({typeName:$t.ZodNaN,...re(t)});const $q=Symbol("zod_brand");class rC extends oe{_parse(e){const{ctx:n}=this._processInputParams(e),c=n.data;return this._def.type._parse({data:c,path:n.path,parent:n})}unwrap(){return this._def.type}}class $b extends oe{_parse(e){const{status:n,ctx:c}=this._processInputParams(e);if(c.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:c.data,path:c.path,parent:c});return l.status==="aborted"?ae:l.status==="dirty"?(n.dirty(),cC(l.value)):this._def.out._parseAsync({data:l.value,path:c.path,parent:c})})();{const a=this._def.in._parseSync({data:c.data,path:c.path,parent:c});return a.status==="aborted"?ae:a.status==="dirty"?(n.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:c.path,parent:c})}}static create(e,n){return new $b({in:e,out:n,typeName:$t.ZodPipeline})}}class l1 extends oe{_parse(e){const n=this._def.innerType._parse(e);return Fb(n)&&(n.value=Object.freeze(n.value)),n}}l1.create=(t,e)=>new l1({innerType:t,typeName:$t.ZodReadonly,...re(e)});const iC=(t,e={},n)=>t?nu.create().superRefine((c,a)=>{var l,r;if(!t(c)){const d=typeof e=="function"?e(c):typeof e=="string"?{message:e}:e,o=(r=(l=d.fatal)!==null&&l!==void 0?l:n)!==null&&r!==void 0?r:!0,i=typeof d=="string"?{message:d}:d;a.addIssue({code:"custom",...i,fatal:o})}}):nu.create(),qq={object:Ln.lazycreate};var $t;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})($t||($t={}));const ttt=(t,e={message:`Input not instance of ${t.name}`})=>iC(n=>n instanceof t,e),dC=dl.create,oC=yi.create,ett=a1.create,ntt=Zi.create,uC=Hb.create,ctt=Ld.create,att=$m.create,ltt=Tb.create,rtt=Db.create,itt=nu.create,dtt=hd.create,ott=Wr.create,utt=qm.create,stt=ol.create,btt=Ln.create,ytt=Ln.strictCreate,Ztt=Bb.create,Wtt=e1.create,mtt=Qb.create,Ltt=xl.create,htt=Ub.create,Xtt=n1.create,vtt=Xd.create,Gtt=au.create,ptt=Eb.create,Ytt=Pb.create,Jtt=Wi.create,ftt=Kb.create,Mtt=lu.create,sC=ul.create,Ntt=mr.create,ztt=vd.create,Rtt=ul.createWithPreprocess,wtt=$b.create;var ga=Object.freeze({__proto__:null,defaultErrorMap:Ib,setErrorMap:Sq,getErrorMap:Pm,makeIssue:Km,EMPTY_PATH:Iq,addIssueToContext:It,ParseStatus:bc,INVALID:ae,DIRTY:cC,OK:zc,isAborted:y0,isDirty:Z0,isValid:Fb,isAsync:_m,get util(){return Ve},get objectUtil(){return b0},ZodParsedType:xt,getParsedType:bi,ZodType:oe,ZodString:dl,ZodNumber:yi,ZodBigInt:Zi,ZodBoolean:Hb,ZodDate:Ld,ZodSymbol:$m,ZodUndefined:Tb,ZodNull:Db,ZodAny:nu,ZodUnknown:hd,ZodNever:Wr,ZodVoid:qm,ZodArray:ol,ZodObject:Ln,ZodUnion:Bb,ZodDiscriminatedUnion:e1,ZodIntersection:Qb,ZodTuple:xl,ZodRecord:Ub,ZodMap:n1,ZodSet:Xd,ZodFunction:au,ZodLazy:Eb,ZodLiteral:Pb,ZodEnum:Wi,ZodNativeEnum:Kb,ZodPromise:lu,ZodEffects:ul,ZodTransformer:ul,ZodOptional:mr,ZodNullable:vd,ZodDefault:_b,ZodCatch:c1,ZodNaN:a1,BRAND:$q,ZodBranded:rC,ZodPipeline:$b,ZodReadonly:l1,custom:iC,Schema:oe,ZodSchema:oe,late:qq,get ZodFirstPartyTypeKind(){return $t},coerce:{string:t=>dl.create({...t,coerce:!0}),number:t=>yi.create({...t,coerce:!0}),boolean:t=>Hb.create({...t,coerce:!0}),bigint:t=>Zi.create({...t,coerce:!0}),date:t=>Ld.create({...t,coerce:!0})},any:itt,array:stt,bigint:ntt,boolean:uC,date:ctt,discriminatedUnion:Wtt,effect:sC,enum:Jtt,function:Gtt,instanceof:ttt,intersection:mtt,lazy:ptt,literal:Ytt,map:Xtt,nan:ett,nativeEnum:ftt,never:ott,null:rtt,nullable:ztt,number:oC,object:btt,oboolean:()=>uC().optional(),onumber:()=>oC().optional(),optional:Ntt,ostring:()=>dC().optional(),pipeline:wtt,preprocess:Rtt,promise:Mtt,record:htt,set:vtt,strictObject:ytt,string:dC,symbol:att,transformer:sC,tuple:Ltt,undefined:ltt,union:Ztt,unknown:dtt,void:utt,NEVER:ae,ZodIssueCode:pt,quotelessJson:kq,ZodError:il});function se(){return{params:[],withParameter(e,n,c=!1,a,l){return this.params.push({key:e,type:n??"string",required:c,default:a,editorType:l}),this},withValidatorFactory(e){return{...this,validatorFactory:e}}}.withParameter("message")}function be(t){return async e=>{var c;const n=await(t==null?void 0:t.safeParseAsync(e));return n!=null&&n.success?!0:((c=n==null?void 0:n.error.issues)==null?void 0:c[0].message)??!1}}const qb=ga.array(ga.any()),Vtt={nonEmpty:se().withValidatorFactory(({message:t})=>be(qb.nonempty(t))),length:se().withParameter("length","number",!0).withValidatorFactory(({length:t,message:e})=>be(qb.length(t,e))),min:se().withParameter("limit","number",!0).withValidatorFactory(({limit:t,message:e})=>be(qb.min(t,e))),max:se().withParameter("limit","number",!0).withValidatorFactory(({limit:t,message:e})=>be(qb.max(t,e))),code:se().withParameter("code","array",!0,void 0,"code").withValidatorFactory(({code:t,message:e})=>{const n=di("value",t);return be(qb.refine(n,e))})},L0=ga.boolean(),gtt={truthy:se().withValidatorFactory(({message:t})=>be(L0.refine(e=>e,t))),falsy:se().withValidatorFactory(({message:t})=>be(L0.refine(e=>!e,t))),code:se().withParameter("code","boolean",!0,void 0,"code").withValidatorFactory(({code:t,message:e})=>{const n=di("value",t);return be(L0.refine(n,e))})},h0=ga.date(),Ctt={min:se().withParameter("value","date",!0).withValidatorFactory(({value:t,message:e})=>be(h0.min(new Date(t),e))),max:se().withParameter("value","date",!0).withValidatorFactory(({value:t,message:e})=>be(h0.max(new Date(t),e))),code:se().withParameter("code","date",!0,void 0,"code").withValidatorFactory(({code:t,message:e})=>{const n=di("value",t);return be(h0.refine(n,e))})},mi=ga.number(),jtt={min:se().withParameter("limit","number",!0).withValidatorFactory(({limit:t,message:e})=>be(mi.min(t,e))),max:se().withParameter("limit","number",!0).withValidatorFactory(({limit:t,message:e})=>be(mi.max(t,e))),lessThan:se().withParameter("value","number",!0).withValidatorFactory(({value:t,message:e})=>be(mi.lt(t,e))),moreThan:se().withParameter("value","number",!0).withValidatorFactory(({message:t,value:e})=>be(mi.gt(e,t))),integer:se().withValidatorFactory(({message:t})=>be(mi.int(t))),multipleOf:se().withParameter("value","number",!0).withValidatorFactory(({message:t,value:e})=>be(mi.multipleOf(e,t))),finite:se().withValidatorFactory(({message:t})=>be(mi.finite(t))),code:se().withParameter("code","number",!0,void 0,"code").withValidatorFactory(({code:t,message:e})=>{const n=di("value",t);return be(mi.refine(n,e))})},bC=ga.union([ga.object({}).passthrough(),ga.string()]),Att={nonEmpty:se().withValidatorFactory(({message:t})=>be(bC.refine(e=>e,t))),code:se().withParameter("code","object",!0,void 0,"code").withValidatorFactory(({code:t,message:e})=>{const n=di("value",t);return be(bC.refine(n,e))})},Bc=ga.string(),Ott={required:se().withValidatorFactory(({message:t})=>be(ga.string({required_error:t}).nonempty(t))),nonEmpty:se().withValidatorFactory(({message:t})=>be(Bc.nonempty(t))),length:se().withParameter("length","number",!0).withValidatorFactory(({length:t,message:e})=>be(Bc.length(t,e))),min:se().withParameter("limit","number",!0).withValidatorFactory(({limit:t,message:e})=>be(Bc.min(t,e))),max:se().withParameter("limit","number",!0).withValidatorFactory(({limit:t,message:e})=>be(Bc.max(t,e))),regex:se().withParameter("regex","string",!0).withValidatorFactory(({message:t,regex:e})=>be(Bc.regex(new RegExp(e),t))),email:se().withValidatorFactory(({message:t})=>be(Bc.email(t))),url:se().withValidatorFactory(({message:t})=>be(Bc.url(t))),uuid:se().withValidatorFactory(({message:t})=>be(Bc.uuid(t))),ip:se().withValidatorFactory(({message:t})=>be(Bc.ip(t))),datetime:se().withParameter("precision","number").withParameter("offset","boolean").withValidatorFactory(({message:t,offset:e,precision:n})=>be(Bc.datetime({message:t,offset:e,precision:n}))),includes:se().withParameter("value","string",!0).withParameter("position","number").withValidatorFactory(({message:t,value:e,position:n})=>be(Bc.includes(e,{message:t,position:n}))),startsWith:se().withParameter("value","string",!0).withValidatorFactory(({message:t,value:e})=>be(Bc.startsWith(e,t))),endsWith:se().withParameter("value","string",!0).withValidatorFactory(({message:t,value:e})=>be(Bc.endsWith(e,t))),code:se().withParameter("code","string",!0,void 0,"code").withValidatorFactory(({code:t,message:e})=>{const n=di("value",t);return be(Bc.refine(n,e))})},xtt=ga.string(),ktt={required:se().withValidatorFactory(({message:t})=>be(ga.string({required_error:t}).nonempty(t))),code:se().withParameter("code","string",!0,void 0,"code").withValidatorFactory(({code:t,message:e})=>{const n=di("value",t);return be(xtt.refine(n,e))})},Stt={string:Ott,number:jtt,boolean:gtt,date:Ctt,time:ktt,object:Att,array:Vtt,enum:{}},_n=t=>t,en=t=>{throw new Error(`Cannot convert from '${t}'`)},Itt=t=>JSON.parse(t),yC=t=>{try{const e=JSON.parse(t);return wa(e)?e:t}catch(e){return console.warn(e),t}},r1=t=>JSON.stringify(t),i1=t=>t.toString(),ty=t=>e=>e instanceof t?e:en(e),Ftt=t=>{const e=Number(t);return isNaN(e)&&en(t),e},ZC=t=>new Date(t),X0=t=>t>9?`${t}`:`0${t}`,Htt=t=>{const e=X0(t.getHours()),n=X0(t.getMinutes()),c=X0(t.getSeconds());return`${e}:${n}:${c}`},Ttt={string:{string:_n,number:Ftt,boolean:t=>t==="true",object:yC,array:Itt,enum:_n,date:ZC,time:_n},number:{string:i1,number:_n,boolean:t=>t===1,object:yC,array:en,enum:_n,date:ZC,time:i1},boolean:{string:i1,number:t=>t?1:0,boolean:_n,object:en,array:en,enum:_n,date:en,time:en},object:{string:r1,number:en,boolean:en,object:_n,array:en,enum:_n,date:en,time:en},array:{string:r1,number:en,boolean:en,object:en,array:_n,enum:_n,date:en,time:en},enum:{string:r1,number:ty(Number),boolean:ty(Boolean),object:ty(Object),array:ty(Array),enum:_n,date:ty(Date),time:r1},date:{string:i1,number:t=>t.getTime(),boolean:en,object:en,array:en,enum:_n,date:_n,time:Htt},time:{string:_n,number:en,boolean:en,object:en,array:en,enum:_n,date:en,time:_n}},Dtt=t=>typeof t=="string"?"string":typeof t=="number"?"number":typeof t=="boolean"?"boolean":t instanceof Date?"date":Array.isArray(t)?"array":typeof t=="object"?"object":"enum",Btt=(t,e)=>{var a;if(t===null||typeof t>"u")return;const n=Dtt(t),c=(a=Ttt[n])==null?void 0:a[e];if(!c)throw new Error(`Cannot convert ${t} from '${n}' to '${e}'`);try{return c(t)}catch(l){throw new Error(`Cannot convert ${t} from '${n}' to '${e}'. ${l}.`)}};class Qtt{constructor(e,n,c,a){Ke(this,rZ,void 0);rt(this,"error");rt(this,"touched",!1);rt(this,"value");rt(this,"valued");rt(this,"valueType");rt(this,"dataValidator");Ke(this,iZ,void 0);rt(this,"setError",e=>{if(typeof e=="string")this.error=e;else if(typeof e>"u"||e===null)this.error=void 0;else throw new Error(`Expected 'string | undefined | null' type, got '${typeof e}'`)});if(this.dataContext=e,this.componentStore=n,this.model=c,this.deferFieldCalculation=a,!c.valued)throw new Error("'model.valued' is falsy");if(!c.valueType)throw new Error("'model.typeOfValue' is undefined");this.valued=c.valued,this.valueType=c.valueType;const l="SimpleField";ql(this,{model:!1,dataValidator:Ge.ref,dataContext:Ge.ref},{name:jl(l,{key:n.key}),autoBind:!0}),Ac(this,iZ,[Ms(()=>{this.dataValidator=this.dataContext.createDataValidator(n,this.valueType,r=>this.error=r),qZ(()=>{var r;(r=de(this,rZ))==null||r.dispose(),Ac(this,rZ,this.dataValidator)})},{name:xm(l,"setValidator",{key:n.key})}),Ms(()=>{const d=i0(this.dataContext.initialData,n.key)??this.initialValue;if(this.deferFieldCalculation){this.value=d;return}const[o,i]=this.dataContext.calculateValue(n,this.valued);if(o){this.value=i;return}this.value=d},{name:xm(l,"setValue",{key:n.key})}),()=>{var r;return(r=this.dataValidator)==null?void 0:r.dispose()}])}get fieldType(){return"simple"}init(){this.deferFieldCalculation=!1}get initialValue(){var e;return((e=this.componentStore.props[this.valued])==null?void 0:e.value)??this.defaultValue}get defaultValue(){var e;return(e=this.model.defaultProps)==null?void 0:e[this.valued]}dispose(){de(this,iZ).forEach(e=>e())}setValue(e){var n,c,a;if(this.value=Btt(e,this.valueType),!this.needValidate){this.clearError();return}((n=this.componentStore.schema)==null?void 0:n.autoValidate)!==!1&&((a=(c=this.dataValidator)==null?void 0:c.sendValidationEvent)==null||a.call(c,this.value))}setTouched(){this.touched=!0}async validate(){var e,n;if(!this.needValidate){this.clearError();return}await((n=(e=this.dataValidator)==null?void 0:e.validate)==null?void 0:n.call(e,this.value))}async getValidationResult(){var n,c;if(!this.needValidate)return;const e=await((c=(n=this.dataValidator)==null?void 0:n.getValidationResult)==null?void 0:c.call(n,this.value));return e==null?void 0:e.map(({message:a})=>a)}reset(){this.value=this.initialValue??this.defaultValue,this.clearError()}clear(){this.value=this.defaultValue,this.touched=!1,this.clearError()}get needValidate(){return c0(this.componentStore,this.dataContext.dataRoot)}clearError(){this.error=void 0}}rZ=new WeakMap,iZ=new WeakMap;function WC(t){var n;const e=(n=t.props.storeDataInParentForm)==null?void 0:n.value;return typeof e>"u"?!0:e}class mC{constructor(e,n){rt(this,"valued","");rt(this,"touched",!1);rt(this,"setError",e=>{if(!e)return;if(typeof e!="object")throw new Error(`Expected 'object' type, got '${typeof e}'`);const n=e;this.form.fields.forEach((c,a)=>{if(n[a])return c.setError(n[a]);if(c.storeDataInParentForm)return c.setError(n)})});this.componentStore=e,this.viewerStore=n,ql(this,void 0,{name:jl("FormField",{key:e.key}),autoBind:!0})}get fieldType(){return"simple"}get storeDataInParentForm(){return WC(this.componentStore)}get value(){return this.form.data}dispose(){this.viewerStore.dispose()}clear(){this.form.clear(),this.touched=!1}reset(){this.form.reset()}setTouched(){this.touched=!0}setValue(e){if(!e){this.form.reset();return}if(typeof e!="object")throw new Error(`Expected 'object' type, got '${typeof e}'`);const n=e;this.form.fields.forEach((c,a)=>{const l=n[a];typeof l>"u"?c.reset():c.setValue(l)})}async validate(){await this.form.validate()}async getValidationResult(){return await this.form.getValidationResult()}init(){this.form.fields.forEach(e=>e.init())}get form(){return this.viewerStore.form.componentTree}get errors(){return this.form.errors}}function Utt(t,e){let n=1;for(;n<1e4;){const a=`${t}${n}`;if(!e.has(a))return a;n++}const c=new Date().getTime();return`${t}_${c}`}let v0=class{constructor(e,n,c,a,l){rt(this,"componentTree");rt(this,"localization");rt(this,"languages",[]);rt(this,"actions");rt(this,"errorProps",{});rt(this,"tooltipType");rt(this,"errorType");rt(this,"defaultLanguage");this.componentTree=e,this.localization=n,this.actions=c,this.languages=a,this.defaultLanguage=l,this.componentTree.events.onBeforeDelete.subscribe(this.onComponentDataBeforeDelete.bind(this)),this.componentTree.events.onAfterKeyChanged.subscribe(this.onComponentDataAfterKeyChanged.bind(this)),ql(this)}get actionNames(){return Object.keys(this.actions)}initFields(){this.componentTree.fields.forEach(e=>e.init())}dispose(){this.componentTree.dispose()}removeAction(e){delete this.actions[e],this.removeCodeActionBinding(e,this.componentTree.store)}updateOrAddAction(e,n){this.actions[n.name]=n.actionDefinition,this.rebindActionHandlers(this.componentTree.store,e,n),e!==n.name&&delete this.actions[e]}cloneAction(e){if(!this.actions)return;const n=new Set(this.actionNames),c=JSON.parse(JSON.stringify(e.actionDefinition)),a=Utt(`${e.name}_`,n);this.actions[a]=fc.createFromObject(c)}rebindActionData(e,n){e.name=n.name;const c=e.args;if(!c)return;const a=new Set(Object.keys(n.actionDefinition.params));Object.keys(c).forEach(l=>{a.has(l)||delete c[l]})}rebindActionHandlers(e,n,c){var l;const a=e.events;a&&Object.keys(a).forEach(r=>{const d=a[r];d==null||d.filter(o=>o.type==="code"&&o.name===n).forEach(o=>this.rebindActionData(o,c))}),(l=e.children)==null||l.forEach(r=>{this.rebindActionHandlers(r,n,c)})}removeCodeActionBinding(e,n){var a;const c=n.events;c&&Object.keys(c).forEach(l=>{const r=c[l];r.length&&(c[l]=r.filter(d=>!(d.type==="code"&&d.name===e)))}),(a=n.children)==null||a.forEach(l=>this.removeCodeActionBinding(e,l))}onComponentDataBeforeDelete(e){this.localization.removeLocalization(e.key)}onComponentDataAfterKeyChanged(e,{oldKey:n,newKey:c}){this.localization.changeComponentKey(n,c)}};const Ett="LocalizationStore";class Ptt{constructor(e,n){Ke(this,c2);this.languageFullCode=e,this.localizationStore=n,ql(this,void 0,{name:jl("FluentBundleHolder")})}get fluentBundle(){const e=this.localizationStore.value[this.languageFullCode],n=new dq(this.languageFullCode);return e&&ac(this,c2,sH).call(this,e).forEach(a=>{const l=n.addResource(new Jq(a));l.length>0&&(console.error(`Unable to add localization resource: ${a}`),l.forEach(console.error))}),n}}c2=new WeakSet,sH=function(e){const n=[];return Object.entries(e).forEach(([c,a])=>{Object.entries(a??{}).forEach(([l,r])=>{Object.entries(r??{}).forEach(([d,o])=>{o&&n.push(`${c}_${l}_${d} = ${r8(o)}`)})})}),n};class G0{constructor(e={}){rt(this,"localizationCache",new Map);rt(this,"value",{});ql(this,void 0,{name:jl(Ett)}),this.value=e}getLocalization(e,n,c,a){var d,o,i;const l=uc(n),r=uc(c);return(i=(o=(d=this.value[e])==null?void 0:d[l])==null?void 0:o[a])==null?void 0:i[r]}setLocalization(e,n,c,a,l){var o,i,u;const r=uc(n),d=uc(c);(o=this.value)[e]??(o[e]={}),(i=this.value[e])[r]??(i[r]={}),(u=this.value[e][r])[a]??(u[a]={}),this.value[e][r][a][d]=l}removeLocalization(e){const n=uc(e);for(const c in this.value)delete this.value[c][n],Object.keys(this.value[c]).length===0&&delete this.value[c]}removeLocalizationForType(e,n){const c=uc(e);for(const a in this.value)this.value[a][c]&&(delete this.value[a][c][n],Object.keys(this.value[a][c]).length===0&&delete this.value[a][c],Object.keys(this.value[a]).length===0&&delete this.value[a])}hasLanguage(e){return!!this.value[e]}hasLocalization(e,n,c){const a=uc(e),l=uc(n);return Object.values(this.value).some(r=>{var d,o;return(o=(d=r==null?void 0:r[a])==null?void 0:d[c])==null?void 0:o[l]})}getFluentBundle(e){const n=this.localizationCache.get(e)??new Ptt(e,this);return this.localizationCache.has(e)||this.localizationCache.set(e,n),n.fluentBundle}changeComponentKey(e,n){const c=uc(e),a=uc(n);for(const l in this.value){const r=this.value[l][c];r&&(this.value[l][a]=r,delete this.value[l][c])}}getLocalizationForComponent(e){const n=uc(e),c={};for(const a in this.value){const l=this.value[a][n];l&&(c[a]={},c[a][e]=l)}return c}addLocalizationWithNewKey(e,n,c){const a=uc(c);for(const l in e){const r=e[l][n];r&&(this.value[l][a]=r)}}}var p0=(t=>(t.version1="1",t))(p0||{});const Ktt={RsDatePicker:["calendarDefaultDate","defaultValue","value"],RsCalendar:["defaultValue","value"]};function LC(t,e,n,c){var l;let a=e(n,t);return(l=t[c])==null||l.forEach(r=>{a=LC(r,e,a,c)}),a}const Y0=new Sb("en","US","English","American English");class _tt{constructor(e){this.store=e}get dataRoot(){return this.store.form.componentTree}get initialData(){return this.store.initialDataSlice}createDataValidator(e,n,c){const a=this.store.getValidationRules(n);return Tm.create(this.store,gg(a),e.schema,c,this.store.localizeErrorMessages.bind(this.store,this.dataRoot,e))}calculateValue(e,n){return Vg(e,n,this.dataRoot,(c,a)=>this.store.localizeComponent(c,this.dataRoot,a))}}const Gf=class Gf{constructor(e,n,c,a){Ke(this,oZ);rt(this,"selectedLanguage");rt(this,"eventSubject",new t0);rt(this,"viewMode","desktop");rt(this,"form");Ke(this,dZ,new Map);rt(this,"dataContext");rt(this,"formLoadError");this.formViewerPropsStore=e,this.parentStore=n,this.parentComponentStore=c,this.parentStoreContext=a;const l=this.createComponentData(new Mc(si.name,si.type)),r=new G0;this.form=new v0(l,r,{},[],Y0),this.dataContext=new _tt(this),k2(this,{form:Ge,viewMode:!0,selectedLanguage:!0,clear:!0,parentStore:Ge.ref,parentComponentStore:Ge.ref,parentStoreContext:Ge.ref,initialDataSlice:!0,formLoadError:!0},{name:jl("ViewerStore")})}get commonActions(){return P$}getAction(e,n){var a;let c;switch(n){case"common":c=this.commonActions[e];break;case"code":c=this.form.actions[e];break;case"custom":c=(a=this.formViewerPropsStore.actions)==null?void 0:a[e];break}if(!c)throw Error(`Action '${e}' with type '${n}' not found!`);return c}get formData(){return this.form.componentTree}clear(){const e=this.form,n=this.createComponentData(new Mc(si.name,si.type)),c=new G0;this.form=new v0(n,c,{},e.languages,e.defaultLanguage),e.dispose()}dispose(){this.form.dispose()}get initialDataSlice(){if(!this.parentStoreContext||!this.parentComponentStore)return this.formViewerPropsStore.initialData;const e=this.parentStoreContext.initialData;if(WC(this.parentComponentStore))return e;const n=i0(e,this.parentComponentStore.key);return Array.isArray(n)||Tv(n)?n:void 0}get showAllValidationErrors(){var e;return(e=this.formViewerPropsStore)==null?void 0:e.showAllValidationErrors}reduceScreen(e,n){return LC(this.form.componentTree,e,n,"children")}findAction(e){return this.getAction(e.name,e.type)}getModel(e){const n=this.formViewerPropsStore.view.find(e);return n||(eC(e)?de(this,dZ).get(e)??this.addTemplateModel(e):Oq(`Type '${e}' is not found!`))}addTemplateModel(e){const n=tC(e),c=bet(n);return de(this,dZ).set(c.type,c),c}loadForm(e,n){if(e)try{const c=e(n);if(Hv(c)){c.then(this.applyStringForm.bind(this)).catch(ac(this,oZ,Mf).bind(this));return}this.applyStringForm(c)}catch(c){ac(this,oZ,Mf).call(this,c)}}createComponentData(e,n=!1,c,a){a??(a=this.dataContext),c??(c=this.getModel(e.type));const l=this.createField(e,c,a,n),r=o=>this.createComponentData(o,n,void 0,a),d=new b8(e,c,l,r,this.formViewerPropsStore.formValidators);return d.dataRootProvider=a,d}getValidationRules(e){var n;return{custom:(n=this.formViewerPropsStore.validators)==null?void 0:n[e],internal:Stt[e]}}createField(e,n,c,a){if(n.kind==="repeater")return new B$(c,this,this,this.getValidationRules.bind(this),e,n,a);if(!n.valued)return;if(!eC(n.type))return new Qtt(c,e,n,a);const l=new Gf(this.formViewerPropsStore.clone(),this,e,c);return new mC(e,l)}applyStringForm(e){try{const n=JSON.parse(e);this.fixPropertyTypes(n.form),this.applyPersistedForm(n),this.formLoadError=void 0}catch(n){this.formLoadError=(n==null?void 0:n.message)??n,console.error(n)}}fixPropertyTypes(e){var c;e.props||(e.props={});const n=Ktt[e.type];n==null||n.forEach(a=>this.fixDateProperty(e,a)),(c=e.children)==null||c.forEach(a=>this.fixPropertyTypes(a))}fixDateProperty(e,n){var a;const c=(a=e.props[n])==null?void 0:a.value;(Fv(c)||PV(c))&&(e.props[n].value=new Date(c))}applyPersistedForm(e){var u;const n=this.form,c=e.version;typeof c<"u"&&c!==p0.version1&&console.warn(`An unsupported version of form '${c}' has been detected. An attempt will be made to upload the form as version '${p0.version1}'.`);const a=Mc.createFromObject(e.form),l=this.createComponentData(a,!0),r=new G0(ii({},e.localization)),d=((u=e.languages)==null?void 0:u.map(Sb.clone))??[],o=d.find(s=>s.fullCode===e.defaultLanguage)??Y0,i=a8(e.actions);this.form=new v0(l,r,i,d,o),this.form.errorProps=e.errorProps??{},this.form.tooltipType=e.tooltipType,this.form.errorType=e.errorType,this.form.initFields(),n.dispose()}get displayedLanguage(){if(this.parentStore)return this.parentStore.displayedLanguage;if(this.formViewerPropsStore.propsLanguage){const e=this.form.languages.find(n=>n===this.formViewerPropsStore.propsLanguage);if(e)return e}return this.selectedLanguage??this.form.defaultLanguage}localizeComponent(e,n,c){return this.formViewerPropsStore.localizer?this.formViewerPropsStore.localizer(c,this.displayedLanguage):Nq(this.form,n,this.displayedLanguage,c,e)}localizeErrorMessages(e,n,c){if(c)return c.map(a=>zq(this.form,e,this.displayedLanguage,n,a.settings.key)??a0(a)).join(" ")}};dZ=new WeakMap,oZ=new WeakSet,Mf=function(e){console.error(e),this.formLoadError=(e==null?void 0:e.message)??e;const n=Aq(e);this.applyPersistedForm({form:n,localization:{},defaultLanguage:Y0.fullCode,languages:[]})};let J0=Gf;function $tt(t){const[e,n]=v.useState();return v.useEffect(()=>{const c=t();return n(c),()=>c.dispose()},[]),e}const qtt=Nc("Notifier",t=>{const{store:e}=t,n=t.props;return v.useEffect(()=>{var c;(c=n.onFormDataChange)==null||c.call(n,e.formData)},[e.formData.data,e.formData.errors]),v.useEffect(()=>{e.formViewerPropsStore.applyProps(n)},[n.initialData,n.view,n.validators,n.formValidators,n.localize,n.language,n.actions,n.errorWrapper]),null}),hC=Nc("ExistingStoreProvider",({children:t,props:{viewerRef:e,...n},store:c})=>(v.useImperativeHandle(e,()=>c,[c]),je(tg,{value:n,children:[_(qtt,{store:c,props:n}),_(rv,{value:c,children:t})]}))),tet=Nc("FactoryStoreProvider",({children:t,props:e})=>{const n=v.useCallback(()=>new J0(new r0(e)),[e]),c=$tt(n);return c?_(hC,{children:t,props:e,store:c}):null}),eet=Nc("ViewerStoreProvider",t=>{const e=v.useContext(A6);return e?_(hC,{children:t.children,props:t.props,store:e}):_(tet,{children:t.children,props:t.props})});nN({enforceActions:"never"});const net=Ed`
89
89
  display: flex;
90
90
  flex-direction: column;