File: //opt/netdata/usr/local/local/share/netdata/web/v3/2041.2d6578176bf7209b6fcf.chunk.js
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"24dad2414db89a9e2209703b6e48226fc420eca1"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ff38641f-e252-4dca-a724-44aa6b1415ea",e._sentryDebugIdIdentifier="sentry-dbid-ff38641f-e252-4dca-a724-44aa6b1415ea")}catch(e){}}(),(self.webpackChunkcloud_frontend=self.webpackChunkcloud_frontend||[]).push([[2041],{29022(e,t,r){r.d(t,{A:()=>y});r(98992),r(54520),r(3949);var n=r(64467),o=r(80045),i=r(42358),l=r(60908),c=r(12897),s=r.n(c),a=r(55042),d=r.n(a),p=new(s())({id:"partialFailureSvg",use:"partialFailureSvg-usage",viewBox:"0 0 348 348",content:'<symbol xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 348 348" id="partialFailureSvg"><path fill="#CCDDE8" d="M174 348c96.098 0 174-77.902 174-174C348 77.903 270.098 0 174 0 77.903 0 0 77.903 0 174c0 96.098 77.903 174 174 174" opacity=".3" /><path fill="#89B0C9" d="M174 290c73.178 0 132.5-1.119 132.5-2.5S247.178 285 174 285s-132.5 1.119-132.5 2.5S100.822 290 174 290" opacity=".3" /><path fill="#485D6B" d="M267 53H81v142h186z" /><path fill="#849FB2" d="M263 57H85v134h178z" /><path fill="#0A2437" d="M267 53h-96v142h96z" opacity=".1" /><path fill="#E6E7E8" d="M307.6 115h-267v67h267z" /><path fill="#485D6B" d="M169.619 173.99v-51h-83v51z" /><path fill="#33424D" d="M167.619 171.99v-47h-79v47z" /><path fill="#0A2437" d="M169.611 173.997v-51h-41.6v51z" opacity=".1" /><path fill="#D3D5D6" d="M307.6 182h-267v13h267z" /><path fill="#697784" d="M288.6 195h-229v48h229z" /><path fill="#0A2437" d="M288.6 195h-229v22h229z" opacity=".15" /><path fill="#E6E7E8" d="M59.6 195h-10v92h10z" /><path fill="#0A2437" d="M59.6 195h-10v10h10z" opacity=".15" /><path fill="#0A2437" d="M59.6 195h-5v92h5z" opacity=".05" /><path fill="#E6E7E8" d="M298.6 195h-10v92h10z" /><path fill="#0A2437" d="M298.6 195h-10v10h10z" opacity=".15" /><path fill="#0A2437" d="M298.6 195h-5v92h5z" opacity=".05" /><path fill="#485D6B" d="M261.619 173.99v-51h-83v51z" /><path fill="#33424D" d="M259.619 171.99v-47h-79v47z" /><path fill="#0A2437" d="M261.611 173.997v-51h-41.6v51z" opacity=".1" /><path fill="#93A6B9" d="M55.6 127v20c0 .5-.4 1-1 1h-5c-.5 0-1-.4-1-1v-20c0-.5.4-1 1-1h5c.6 0 1 .4 1 1" /><path fill="#677F8E" d="M50.6 143.5v-13c0-.8.7-1.5 1.5-1.5s1.5.7 1.5 1.5v13c0 .8-.7 1.5-1.5 1.5s-1.5-.7-1.5-1.5" /><path fill="#00AB44" d="M56.6 132.4v1.2c0 .6-.4 1.2-1 1.3-.1 0-.3.1-.4.1H49c-.1 0-.3 0-.4-.1-.6-.2-1-.7-1-1.3v-1.2c0-.6.4-1.2 1-1.3.1 0 .3-.1.4-.1h6.2c.1 0 .3 0 .4.1.6.1 1 .7 1 1.3" /><path fill="#0A2437" d="M56.6 136.4v1.2c0 .6-.4 1.2-1 1.3-.1 0-.3.1-.4.1H49c-.1 0-.3 0-.4-.1-.6-.2-1-.7-1-1.3v-1.2c0-.6.4-1.2 1-1.3.1 0 .3-.1.4-.1h6.2c.1 0 .3 0 .4.1.6.1 1 .7 1 1.3" opacity=".1" /><path fill="#0A2437" d="M56.6 132.6v1c0 .6-.4 1.2-1 1.3-.1 0-.3.1-.4.1H49c-.1 0-.3 0-.4-.1-.6-.2-1-.7-1-1.3v-1c0 .1 0 .3.1.4.1.5.5.8.9.9.1 0 .3.1.4.1h6.2c.1 0 .3 0 .4-.1.5-.1.8-.5.9-.9.1-.1.1-.3.1-.4" opacity=".05" /><path fill="#24B75E" d="M56.6 132.4v1c0-.1 0-.3-.1-.4-.1-.5-.5-.8-.9-.9-.1 0-.3-.1-.4-.1H49c-.1 0-.3 0-.4.1-.5.1-.8.5-.9.9 0 .1-.1.3-.1.4v-1c0-.6.4-1.2 1-1.3.1 0 .3-.1.4-.1h6.2c.1 0 .3 0 .4.1.6.1 1 .7 1 1.3" /><path fill="#0A2437" d="M56.6 132.4v1.2c0 .6-.4 1.2-1 1.3V147c0 .5-.4 1-1 1h-2v-22h2c.5 0 1 .4 1 1v4.1c.6.1 1 .7 1 1.3" opacity=".1" /><path fill="#93A6B9" d="M66.6 134v13c0 .5-.4 1-1 1h-5c-.5 0-1-.4-1-1v-20c0-.5.4-1 1-1h5.1c.6.1.9 1.2.9 8" /><path fill="#677F8E" d="M61.6 143.5v-13c0-.8.7-1.5 1.5-1.5s1.5.7 1.5 1.5v13c0 .8-.7 1.5-1.5 1.5s-1.5-.7-1.5-1.5" /><path fill="#00AB44" d="M67.6 139.4v1.2c0 .6-.4 1.2-1 1.3-.1 0-.3.1-.4.1H60c-.1 0-.3 0-.4-.1-.6-.2-1-.7-1-1.3v-1.2c0-.6.4-1.2 1-1.3.1 0 .3-.1.4-.1h6.2c.1 0 .3 0 .4.1.6.1 1 .7 1 1.3" /><path fill="#0A2437" d="M67.6 143.4v1.2c0 .6-.4 1.2-1 1.3-.1 0-.3.1-.4.1H60c-.1 0-.3 0-.4-.1-.6-.2-1-.7-1-1.3v-1.2c0-.6.4-1.2 1-1.3.1 0 .3-.1.4-.1h6.2c.1 0 .3 0 .4.1.6.1 1 .7 1 1.3" opacity=".1" /><path fill="#0A2437" d="M67.6 139.6v1c0 .6-.4 1.2-1 1.3-.1 0-.3.1-.4.1H60c-.1 0-.3 0-.4-.1-.6-.2-1-.7-1-1.3v-1c0 .1 0 .3.1.4.1.5.5.8.9.9.1 0 .3.1.4.1h6.2c.1 0 .3 0 .4-.1.5-.1.8-.5.9-.9.1-.1.1-.3.1-.4" opacity=".05" /><path fill="#24B75E" d="M67.6 139.4v1c0-.1 0-.3-.1-.4-.1-.5-.5-.8-.9-.9-.1 0-.3-.1-.4-.1H60c-.1 0-.3 0-.4.1-.5.1-.8.5-.9.9 0 .1-.1.3-.1.4v-1c0-.6.4-1.2 1-1.3.1 0 .3-.1.4-.1h6.2c.1 0 .3 0 .4.1.6.1 1 .7 1 1.3" /><path fill="#0A2437" d="M67.6 139.4v1.2c0 .6-.4 1.2-1 1.3v5.1c0 .5-.4 1-1 1h-2v-22h2.1c.5.1.8.5.8 1v11.1c.7.1 1.1.7 1.1 1.3" opacity=".1" /><path fill="#677F8E" d="M78.6 139.9v7.2c0 .5-.4.9-.9.9h-7.2c-.5 0-.9-.4-.9-.9v-7.2c0-.5.4-.9.9-.9h7.2c.5 0 .9.4.9.9" /><path fill="#485D6B" d="M74.1 147a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7" /><path fill="#FF4136" d="M74.1 146a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5" /><path fill="#0A2437" d="M78.6 139.9v7.2c0 .5-.4.9-.9.9h-3.1v-9h3.1c.5 0 .9.4.9.9" opacity=".1" /><path fill="#677F8E" d="M78.6 126.9v6.1c0 .5-.4.9-.9.9h-7.1c-.5 0-.9-.4-.9-.9v-6.1c0-.5.4-.9.9-.9h7.1c.5 0 .9.4.9.9" /><path fill="#00AB44" d="M71.6 131a1 1 0 1 0 0-2 1 1 0 0 0 0 2" /><path fill="#FF4136" d="M74.1 131a1 1 0 1 0 0-2 1 1 0 0 0 0 2" /><path fill="#00AB44" d="M76.6 131a1 1 0 1 0 0-2 1 1 0 0 0 0 2" /><path fill="#0A2437" d="M78.6 126.9v6.1c0 .5-.4.9-.9.9h-3.1v-8h3.1c.5.1.9.5.9 1" opacity=".1" /><path fill="#485D6B" d="M78.6 156.6v11.8c0 .9-.7 1.6-1.6 1.6H50.2c-.9 0-1.6-.7-1.6-1.6v-11.8c0-.9.7-1.6 1.6-1.6H77c.9 0 1.6.7 1.6 1.6" /><path fill="#80A4BF" d="M54.6 166h-4v2h4zM57.6 166h-2v2h2zM68.6 166h-10v2h10zM71.6 166h-2v2h2zM76.6 166h-4v2h4zM52.6 163h-2v2h2zM55.6 163h-2v2h2zM58.6 163h-2v2h2zM61.6 163h-2v2h2zM64.6 163h-2v2h2zM67.6 163h-2v2h2zM70.6 163h-2v2h2zM73.6 163h-2v2h2zM76.6 163h-2v2h2zM53.6 160h-3v2h3zM56.6 160h-2v2h2zM59.6 160h-2v2h2zM62.6 160h-2v2h2zM65.6 160h-2v2h2zM68.6 160h-2v2h2zM71.6 160h-2v2h2zM76.6 160h-4v2h4zM52.6 157h-2v2h2zM55.6 157h-2v2h2zM58.6 157h-2v2h2zM61.6 157h-2v2h2zM64.6 157h-2v2h2zM67.6 157h-2v2h2zM70.6 157h-2v2h2zM73.6 157h-2v2h2zM76.6 157h-2v2h2z" /><path fill="#0A2437" d="M78.6 156.6v11.8c0 .9-.7 1.6-1.6 1.6H63.6v-15H77c.9 0 1.6.7 1.6 1.6" opacity=".1" /><path fill="#485D6B" d="M269.6 142.1v-16.2c0-1.6 1.3-2.9 2.9-2.9h24.2c1.6 0 2.9 1.3 2.9 2.9v16.2c0 1.6-1.3 2.9-2.9 2.9h-24.2c-1.6 0-2.9-1.3-2.9-2.9" /><path fill="#485D6B" d="M286.6 136h-17v6.1c0 1.6 1.3 2.9 2.9 2.9h14.1z" /><path fill="#93A6B9" d="M277.6 139a5 5 0 1 0-.001-10.001A5 5 0 0 0 277.6 139" /><path fill="#E6E7E8" d="m273.7 138.7-1.1-1.2c-.4-.5-.4-1.2.1-1.6l7.8-6c.4-.3 1.1-.3 1.5.1s.4 1.1 0 1.5l-6.7 7.2c-.4.4-1.1.4-1.6 0" /><path fill="#485D6B" d="M299.6 136h-16v9h13.1c1.6 0 2.9-1.3 2.9-2.9z" /><path fill="#93A6B9" d="M291.6 139a5 5 0 1 0-.001-10.001A5 5 0 0 0 291.6 139" /><path fill="#E6E7E8" d="m287.7 138.7-1.1-1.2c-.4-.5-.4-1.2.1-1.6l7.8-6c.4-.3 1.1-.3 1.5.1s.4 1.1 0 1.5l-6.7 7.2c-.4.4-1.1.4-1.6 0" /><path fill="#5AB948" d="M272.6 127a1 1 0 1 0 0-2 1 1 0 0 0 0 2M287.6 127a1 1 0 1 0 0-2 1 1 0 0 0 0 2" /><path fill="#0A2437" d="M284.6 145v-22h12.1c1.6 0 2.9 1.3 2.9 2.9v16.2c0 1.6-1.3 2.9-2.9 2.9z" opacity=".1" /><path fill="#485D6B" d="M299.619 173.99v-22h-30v22z" /><path fill="#385062" d="M275.6 157h-2v15h2z" /><path fill="#E6E7E8" d="M276.6 163h-4v3h4z" /><path fill="#0A2437" d="M276.6 166h-4v3h4zM276.6 165h-4v1h4z" opacity=".1" /><path fill="#5B788C" d="M278.6 171h-2v1h2zM278.6 169h-2v1h2zM278.6 167h-2v1h2zM278.6 165h-2v1h2zM278.6 163h-2v1h2zM278.6 161h-2v1h2zM278.6 159h-2v1h2zM278.6 157h-2v1h2z" /><path fill="#385062" d="M284.6 157h-2v15h2z" /><path fill="#E6E7E8" d="M285.6 159h-4v3h4z" /><path fill="#0A2437" d="M285.6 162h-4v3h4zM285.6 161h-4v1h4z" opacity=".1" /><path fill="#5B788C" d="M287.6 171h-2v1h2zM287.6 169h-2v1h2zM287.6 167h-2v1h2zM287.6 165h-2v1h2zM287.6 163h-2v1h2zM287.6 161h-2v1h2zM287.6 159h-2v1h2zM287.6 157h-2v1h2z" /><path fill="#385062" d="M293.6 157h-2v15h2z" /><path fill="#E6E7E8" d="M294.6 167h-4v3h4z" /><path fill="#0A2437" d="M294.6 170h-4v3h4zM294.6 169h-4v1h4z" opacity=".1" /><path fill="#5B788C" d="M296.6 171h-2v1h2zM296.6 169h-2v1h2zM296.6 167h-2v1h2zM296.6 165h-2v1h2zM296.6 163h-2v1h2zM296.6 161h-2v1h2zM296.6 159h-2v1h2zM296.6 157h-2v1h2z" /><path fill="#5AB948" d="M274.6 156a1 1 0 1 0 0-2 1 1 0 0 0 0 2M283.6 156a1 1 0 1 0 0-2 1 1 0 0 0 0 2" /><path fill="#FF4136" d="M292.6 156a1 1 0 1 0 0-2 1 1 0 0 0 0 2" /><path fill="#0A2437" d="M299.619 173.99v-22h-16v22z" opacity=".1" /><path fill="#D3D5D6" d="M64.6 73h-2v42h2z" /><path fill="#D3D5D6" d="M74.6 74h-22v2h22z" /><path fill="#0A2437" d="M64.6 79v23.5l-1-.5-1 .5V79z" opacity=".15" /><path fill="#C7C8C9" d="M74.6 75h-22v1h22z" /><path fill="#00AB44" d="M73.6 76v28l-10-5-7.5 3.7-.9.5-1.6.8V76z" /><path fill="#fff" d="M64.6 92h-2l-4-8h6c2.2 0 4 1.8 4 4s-1.8 4-4 4" /><path fill="#D3D5D6" d="M71.6 112h-16v3h16z" /><path fill="#C7C8C9" d="M71.6 114h-16v1h16z" /><path fill="#0A2437" d="M63.6 115V73h1v1h10v2h-1v28l-9-4.5V112h7v3z" opacity=".15" /><path fill="#DADCDD" d="m136.7 206.6-12.6-10.1c-6-4.8-9.4-11.9-9.4-19.6V168h4v8.9c0 6.5 2.9 12.5 7.9 16.5l12.6 10.1z" /><path fill="#0A2437" d="m137.7 202.3-1 1.3-12.6-10.1c-6-4.8-9.4-11.9-9.4-19.6v3c0 7.7 3.4 14.8 9.4 19.6l12.6 10.1 2.5-3.1z" opacity=".05" /><path fill="#00AB44" d="M123.1 171h-13c-1.4 0-2.5-1.1-2.5-2.5v-1c0-1.4 1.1-2.5 2.5-2.5h13c1.4 0 2.5 1.1 2.5 2.5v1c0 1.4-1.1 2.5-2.5 2.5" /><path fill="#0A2437" d="M125.1 169h-17.4c.2 1.2 1.2 2 2.4 2h13c1.2 0 2.2-.9 2.4-2z" opacity=".2" /><path fill="#36BD6B" d="M123.1 165h-13c-1.4 0-2.5 1.1-2.5 2.5v1c0-1.4 1.1-2.5 2.5-2.5h13c1.4 0 2.5 1.1 2.5 2.5v-1c0-1.4-1.1-2.5-2.5-2.5" /><path fill="#DADCDD" d="M226.6 168v8.9c0 7.7-3.4 14.8-9.5 19.6l-9.7 7.7-1 .8-1.9 1.6-2.5-3.1 1.5-1.2 4.1-3.2 7.1-5.6c5-4 7.9-10 7.9-16.5v-9z" /><path fill="#0A2437" d="M226.6 173.9v3c0 7.7-3.4 14.8-9.5 19.6l-9.7 7.7-1 .8-1.9 1.6-2.5-3.1 1.5-1.2 1 1.3 3-2.4 9.5-7.6c6.2-4.9 9.6-12 9.6-19.7" opacity=".05" /><path fill="#00AB44" d="M233.6 167.5v1.5c0 .1-.1.2-.1.4v.1c0 .1-.1.2-.1.3-.1.3-.4.5-.6.7-.1 0-.1.1-.2.1-.4.3-.9.4-1.4.4h-13c-.5 0-1-.2-1.4-.4-.1 0-.1-.1-.2-.1-.2-.2-.4-.4-.6-.7 0-.1-.1-.2-.1-.3v-.1c-.1-.1-.1-.2-.1-.4v-1.5c0-1.4 1.1-2.5 2.5-2.5h13c1.2 0 2.3 1.1 2.3 2.5" /><path fill="#0A2437" d="M233.6 169c0 .2-.1.3-.1.4v.1c0 .1-.1.2-.1.3-.1.3-.4.5-.6.7-.1 0-.1.1-.2.1-.4.3-.9.4-1.4.4h-13c-.5 0-1-.2-1.4-.4-.1 0-.1-.1-.2-.1-.2-.2-.4-.4-.6-.7 0-.1-.1-.2-.1-.3v-.1c-.1-.1-.1-.2-.1-.4h17.8" opacity=".2" /><path fill="#36BD6B" d="M233.6 167.5v1c0-1.4-1.1-2.5-2.5-2.5h-13c-1.4 0-2.5 1.1-2.5 2.5v-1c0-1.4 1.1-2.5 2.5-2.5h13c1.4 0 2.5 1.1 2.5 2.5" /><path fill="#485D6B" d="M174.6 218h-8v15h8zM176.6 235.6V250h-12v-14.4c0-1.4 1.2-2.6 2.6-2.6h6.7c1.5 0 2.7 1.2 2.7 2.6" /><path fill="#506C80" d="M183.6 211v1.6c0 .5 0 .9-.2 1.4 0 .1-.1.3-.1.4s-.1.3-.1.4-.1.2-.1.4c-.1.3-.3.5-.4.8-.1.1-.1.2-.2.4-.2.2-.3.4-.5.6-1.2 1.2-2.8 2-4.6 2H164c-1.8 0-3.5-.8-4.6-2-.2-.2-.4-.4-.5-.6-.1-.1-.2-.2-.2-.4-.2-.2-.3-.5-.4-.8-.1-.1-.1-.2-.1-.4-.1-.1-.1-.3-.1-.4s-.1-.3-.1-.4c-.1-.5-.2-.9-.2-1.4V211z" /><path fill="#0A2437" d="M183.5 214c0 .1-.1.3-.1.4s-.1.3-.1.4-.1.2-.1.4c-.1.3-.3.5-.4.8-.1.1-.1.2-.2.4-.2.2-.3.4-.5.6h-22.5c-.2-.2-.4-.4-.5-.6-.1-.1-.2-.2-.2-.4-.2-.2-.3-.5-.4-.8-.1-.1-.1-.2-.1-.4-.1-.1-.1-.3-.1-.4s-.1-.3-.1-.4z" opacity=".2" /><path fill="#384A57" d="M187.6 204v6c0 .7-.2 1.3-.5 1.9-.7 1.2-2 2.1-3.5 2.1h-26.1c-1.5 0-2.8-.8-3.5-2.1-.3-.6-.5-1.2-.5-1.9v-6z" /><path fill="#00AB44" d="M207.6 199.3v3.6c0 .5 0 .9-.1 1.4 0 .3-.1.5-.2.8-.2.7-.6 1.4-1 2q-1.35 1.8-3.6 2.4c-5.1 1.4-10.3 2.3-15.6 2.5-1 0-2 .1-2.9.1H157c-1 0-2 0-2.9-.1-2.1-.1-4.3-.3-6.4-.6-3.1-.4-6.1-1.1-9.2-1.9-2.2-.6-3.9-2.3-4.6-4.4-.1-.2-.1-.5-.2-.8-.1-.4-.1-.9-.1-1.4V199c.1-1.8 1.5-3.2 3.2-3.4l4.2-.5 2.4-.3 17.7-1.9c.8-.1 1.6-.2 2.3-.2a82 82 0 0 1 14 0c.8.1 1.6.1 2.3.2l16.8 1.8 2.4.3 5.2.6c1.8.2 3.1 1.6 3.2 3.4.3.1.3.2.3.3" /><path fill="#B4BBC4" d="M207.3 205c-.2.7-.6 1.4-1 2q-1.35 1.8-3.6 2.4c-5.1 1.4-10.3 2.3-15.6 2.5-1 0-2 .1-2.9.1H157c-1 0-2 0-2.9-.1-2.1-.1-4.3-.3-6.4-.6-3.1-.4-6.1-1.1-9.2-1.9-2.2-.6-3.9-2.3-4.6-4.4z" /><path fill="#0A2437" d="M199.1 195.1c-1.5 4-4 7.4-7.2 9.9-1.3 1.1-2.8 2-4.4 2.8-3 1.5-6.4 2.2-9.9 2.2h-15.3c-3.1 0-6.1-.6-8.9-1.8-1.9-.8-3.8-1.9-5.4-3.2-3.1-2.5-5.6-5.9-7.1-9.8l2.4-.3L161 193c.8-.1 1.6-.2 2.3-.2a82 82 0 0 1 14 0c.8.1 1.6.1 2.3.2l16.8 1.8z" opacity=".2" /><path fill="#DADCDD" d="m170.6 255.5-3.6-.1h-3.5c-2.3 0-4.6.1-6.9.4q-6.9.75-13.5 3c-2.2.7-4.4 1.6-6.5 2.6s-4.1 2.1-6.3 3.3l-12.6 7.1-2.1-3.4 12.3-7.8c2-1.3 4.2-2.6 6.4-3.8s4.5-2.2 6.9-3.2c4.7-1.9 9.6-3.2 14.6-4 2.5-.4 5-.7 7.6-.8l1.9-.1h1.8l3.6-.1v6.9z" /><path fill="#C6C7C8" d="m170.6 255.5-3.6-.1h-3.5c-2.3 0-4.6.1-6.9.4q-6.9.75-13.5 3c-2.2.7-4.4 1.6-6.5 2.6s-4.1 2.1-6.3 3.3l-12.6 7.1-1-1.7 12.5-7.5c4.1-2.5 8.4-4.8 13-6.4 4.5-1.7 9.3-2.8 14.1-3.5q3.6-.45 7.2-.6c2.4-.1 4.8 0 7.3 0v3.4z" /><path fill="#485D6B" d="M117.6 273v11.5c0 1.4-1.1 2.5-2.5 2.5h-1.9c-1.4 0-2.5-1.1-2.5-2.5V273z" /><path fill="#0A2437" d="M119.6 270.9v6.9c0 1.1-.9 2.1-2 2.2v4.5c0 1.4-1.1 2.5-2.5 2.5h-1.5v-20h2.1c2.2 0 3.9 1.8 3.9 3.9" opacity=".2" /><path fill="#DADCDD" d="M119.6 270.9v6.9c0 1.1-.9 2.1-2 2.2h-7c-1.1-.1-2-1.1-2-2.2v-6.9c0-2.2 1.8-3.9 3.9-3.9h3.1c2.3 0 4 1.8 4 3.9" /><path fill="#0A2437" d="M115.7 267h-2.1v13h4c1.1-.1 2-1.1 2-2.2v-6.9c0-2.1-1.7-3.9-3.9-3.9" opacity=".05" /><path fill="#DADCDD" d="m225.6 268.3-1 1.7-1 1.7-2-1.1-10.7-6c-2.1-1.2-4.1-2.3-6.2-3.3s-4.3-1.9-6.5-2.6c-4.4-1.5-9-2.5-13.5-3q-3.45-.3-6.9-.3h-3.5l-3.6.1v-7.1l3.6.1 1.8.1h2c2.5.1 5.1.4 7.6.8 5 .8 9.9 2.1 14.6 4 2.3.9 4.6 2 6.9 3.2 2.2 1.2 4.4 2.5 6.4 3.8l10.7 6.8z" /><path fill="#C6C7C8" d="m224.6 270-1 1.7-2-1.1-10.7-6c-2.1-1.2-4.1-2.3-6.2-3.3s-4.3-1.9-6.5-2.6c-4.4-1.5-9-2.5-13.5-3q-3.45-.3-6.9-.3h-3.5l-3.6.1V252h7.3q3.6.15 7.2.6c4.8.7 9.5 1.8 14.1 3.5 4.6 1.6 8.9 3.9 13 6.4l10.2 6.1z" /><path fill="#485D6B" d="M230.6 273v11.5c0 1.4-1.1 2.5-2.5 2.5h-1.9c-1.4 0-2.5-1.1-2.5-2.5V273z" /><path fill="#0A2437" d="M232.6 270.9v6.9c0 1.1-.9 2.1-2 2.2v4.5c0 1.4-1.1 2.5-2.5 2.5h-1.5v-20h2.1c2.2 0 3.9 1.8 3.9 3.9" opacity=".2" /><path fill="#DADCDD" d="M232.6 270.9v6.9c0 1.1-.9 2.1-2 2.2h-7c-1.1-.1-2-1.1-2-2.2v-7.2c0-.7.3-1.4.7-2s1-1.1 1.7-1.4q.75-.3 1.5-.3h3.1c2.3.1 4 1.9 4 4" /><path fill="#0A2437" d="M232.6 270.9v6.9c0 1.1-.9 2.1-2 2.2h-4v-13h2.1c2.2 0 3.9 1.8 3.9 3.9" opacity=".05" /><path fill="#E2E3E4" d="M175.3 252v.2l-.5 3.2L173 267l-.3 2h-4l-.3-1.8-1.9-11.8-.5-3.2v-.2c-.1-1.1.8-2 1.9-2h5.5c1.1 0 1.9.9 1.9 2" /><path fill="#C6C7C8" d="M175.3 252v.2l-.5 3.2L173 267l-.3 2h-2v-19h2.8c1 0 1.8.9 1.8 2" /><path fill="#485D6B" d="M174.6 273v11.5c0 1.4-1.1 2.5-2.5 2.5h-1.9c-1.4 0-2.5-1.1-2.5-2.5V273z" /><path fill="#0A2437" d="M176.6 270.9v6.9c0 1.1-.9 2.1-2 2.2v4.5c0 1.4-1.1 2.5-2.5 2.5h-1.5v-20h2.3c2.1.1 3.7 1.9 3.7 3.9" opacity=".2" /><path fill="#DADCDD" d="M176.6 270.9v6.9c0 1.1-.9 2.1-2 2.2h-7c-1.1-.1-2-1.1-2-2.2v-6.9c0-1.8 1.1-3.2 2.7-3.7.4-.1.8-.2 1.2-.2h3.3c2.2.1 3.8 1.9 3.8 3.9" /><path fill="#0A2437" d="M176.6 270.9v6.9c0 1.1-.9 2.1-2 2.2h-4v-13h2.3c2.1.1 3.7 1.9 3.7 3.9" opacity=".05" /><path fill="#435969" d="M210.6 125.7v5.8c-.1 16.1-2.8 32-7.8 47.3l-3.4 10.4c-.6 2-1.6 3.9-2.7 5.6-2.9 4.4-7.3 7.6-12.3 9.2-2.1.6-4.4 1-6.7 1h-15.3c-2.3 0-4.5-.4-6.7-1-5-1.5-9.3-4.7-12.2-9.1-1.2-1.7-2.1-3.6-2.8-5.7l-3.4-10.4c-5-15.3-7.6-31.2-7.8-47.3v-5.8c0-3.3 2.4-6 5.6-6.5l11-1.6c8.1-1.2 16.2-1.8 24.4-1.8q11.7 0 23.4 1.8l11 1.6c3.3.5 5.7 3.2 5.7 6.5" /><path fill="#00AB44" d="M210.6 125.7v5.8c-.1-3.2-2.4-5.9-5.6-6.3l-11-1.6c-7.8-1.2-15.6-1.7-23.4-1.8-8.1 0-16.3.5-24.4 1.8l-11 1.6c-3.2.5-5.5 3.1-5.6 6.3v-5.8c0-3.3 2.4-6 5.6-6.5l11-1.6c8.1-1.2 16.2-1.8 24.4-1.8q11.7 0 23.4 1.8l11 1.6c3.2.5 5.6 3.2 5.6 6.5" /><path fill="#384A57" d="M177.6 167h-14c-1.7 0-3-1.3-3-3s1.3-3 3-3h14c1.7 0 3 1.3 3 3s-1.3 3-3 3" /><path fill="#DADCDD" d="M175.2 164H166c-1.3 0-2.4 1.1-2.4 2.4v47.2c0 1.3 1.1 2.4 2.4 2.4h9.2c1.3 0 2.4-1.1 2.4-2.4v-47.2c0-1.3-1.1-2.4-2.4-2.4" /><path fill="#D0D1D3" d="M175.2 213H166c-1.3 0-2.4-1.1-2.4-2.4v3c0 1.3 1.1 2.4 2.4 2.4h9.2c1.3 0 2.4-1.1 2.4-2.4v-3c0 1.3-1.1 2.4-2.4 2.4" /><path fill="#E6E7E8" d="M175.2 164H166c-1.3 0-2.4 1.1-2.4 2.4v3c0-1.3 1.1-2.4 2.4-2.4h9.2c1.3 0 2.4 1.1 2.4 2.4v-3c0-1.3-1.1-2.4-2.4-2.4" /><path fill="#0A2437" d="M233.6 167.5v1.5c0 .1-.1.2-.1.4v.1c0 .1-.1.2-.1.3-.1.3-.4.5-.6.7-.1 0-.1.1-.2.1-.4.3-.9.4-1.4.4h-4.5v5.9c0 7.7-3.4 14.8-9.5 19.6l-9.7 7.7c0 .3-.1.5-.2.8-.2.7-.6 1.4-1 2q-1.35 1.8-3.6 2.4c-5.1 1.4-10.3 2.3-15.6 2.5-.7 1.2-2 2.1-3.5 2.1h-.2c0 .1-.1.3-.1.4s-.1.3-.1.4-.1.2-.1.4c-.1.3-.3.5-.4.8-.1.1-.1.2-.2.4-.2.2-.3.4-.5.6-1.2 1.2-2.8 2-4.6 2h-2.6v14h-.8c1.4 0 2.6 1.2 2.6 2.6v13h1.4c2.5.1 5.1.4 7.6.8 5 .8 9.9 2.1 14.6 4 2.3.9 4.6 2 6.9 3.2 2.2 1.2 4.4 2.5 6.4 3.8l10.7 6.8q.75-.3 1.5-.3h3.1c2.2 0 3.9 1.8 3.9 3.9v6.9c0 1.1-.9 2.1-2 2.2v4.5c0 1.4-1.1 2.5-2.5 2.5h-1.9c-1.4 0-2.5-1.1-2.5-2.5V280c-1.1-.1-2-1.1-2-2.2v-7.2l-10.7-6c-2.1-1.2-4.1-2.3-6.2-3.3s-4.3-1.9-6.5-2.6c-4.4-1.5-9-2.5-13.5-3q-3.45-.3-6.9-.3h-3l-1.8 11.6c2.1.1 3.7 1.8 3.7 3.9v6.9c0 1.1-.9 2.1-2 2.2v4.5c0 1.4-1.1 2.5-2.5 2.5h-1.5V115.8q11.7 0 23.4 1.8l11 1.6c3.2.5 5.6 3.2 5.6 6.5v5.8c-.1 16.1-2.8 32-7.8 47.3l-3.4 10.4c-.6 2-1.6 3.9-2.7 5.6l2.4.3 5.2.6c1.8.2 3.1 1.6 3.2 3.4l7.1-5.6c5-4 7.9-10 7.9-16.5v-6h-4.5c-.5 0-1-.2-1.4-.4-.1 0-.1-.1-.2-.1-.2-.2-.4-.4-.6-.7 0-.1-.1-.2-.1-.3v-.1c-.1-.1-.1-.2-.1-.4v-1.5c0-1.4 1.1-2.5 2.5-2.5h13c1.1 0 2.2 1.1 2.2 2.5" opacity=".15" /></symbol>'});d().add(p);const u=p;var h=r(74848);const f=["testId","title","children"];function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const y=e=>{let{testId:t="",title:r,children:n}=e,c=(0,o.A)(e,f);return(0,h.jsx)(l.DL,{children:(0,h.jsxs)(i.Flex,{"data-testid":"error-base-container-".concat(t),alignItems:"center",justifyContent:"center",flex:!0,gap:8,overflow:"hidden",children:[(0,h.jsx)("svg",{id:"partial_failure",width:"288px",height:"234px",children:(0,h.jsx)("use",{xlinkHref:"#".concat(u.id)})}),(0,h.jsxs)(i.Flex,g(g({column:!0,width:{max:125},gap:2,alignItems:"center",justifyContent:"center",overflow:"hidden",height:"80vh"},c),{},{children:[(0,h.jsx)(i.H3,{children:r}),n]}))]})})}},88772(e,t,r){r.d(t,{A:()=>yn});r(98992),r(54520),r(3949);var n=r(64467),o=r(80045),i=r(73937),l=r(91421),c=r(96540),s=(r(62953),r(4575)),a=(r(33110),r(42358)),d=r(12215),p=r(60908),u=r(74848);const h=function(){let{id:e,error:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r="string"===typeof t?{error_message:t}:"object"===typeof t?t:{};return(0,u.jsx)(p.DL,{feature:"DyncfgForm",id:e,error:JSON.stringify(t),children:(0,u.jsxs)(a.Flex,{column:!0,gap:2,children:[(0,u.jsxs)(a.Flex,{alignItems:"center",gap:2,children:[(0,u.jsx)(a.Icon,{name:"warning_triangle",color:"text"}),(0,u.jsx)(a.H3,{children:"Error"})]}),(0,u.jsx)(a.TextBig,{children:(0,d.x)(r)})]})})};var f=r(51510),b=r(63950),g=r.n(b),y=r(85660),m=r(21885),O=r(564),j=r(44030);r(81454);const v=["title","children"];function x(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?x(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const P=e=>{let{title:t="Error",children:r}=e,n=(0,o.A)(e,v);return(0,u.jsxs)(a.Flex,w(w({column:!0,gap:2},n),{},{children:[(0,u.jsxs)(a.Flex,{alignItems:"center",gap:2,children:[(0,u.jsx)(a.Icon,{name:"warning_triangle",color:"errorText"}),(0,u.jsx)(a.TextBigger,{color:"errorText",children:t})]}),r]}))};var D=r(6304);const A=e=>"string"===typeof e?e:e.stack||e.message||JSON.stringify(e),C=function(){let{remainingErrors:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,r]=(0,D.A)();return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(a.Collapsible,{open:t,duration:0,children:e.map((e=>{const t=A(e);return(0,u.jsx)(a.Text,{color:"errorText",children:t},t)}))}),(0,u.jsx)(a.Flex,{padding:[2,0,0,0],children:(0,u.jsx)(a.Button,{flavour:"hollow",neutral:!0,small:!0,label:t?"Hide":"Show ".concat(e.length," more"),onClick:r})})]})},E=function(){let{id:e,errors:t=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.length?(0,u.jsx)(p.Ay,{feature:"DyncfgForm",id:e,validationErrors:!0,children:(0,u.jsx)(P,{children:(0,u.jsxs)(a.Flex,{"data-testid":"dyncfg-form-errors",alignItems:"start",column:!0,children:[(0,u.jsx)(a.Text,{color:"errorText",children:A(t[0])}),t.length>1?(0,u.jsx)(C,{remainingErrors:t.slice(1)}):null]})})}):null};var S=r(67200),M=r(75684),k=r(46587),I=r(99728),T=r(4797),F=r(87680),z=r(2652),B=r(93598),L=r(87083),_=r(44913),N=r(94404);function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const H=(0,S.A)((0,N.A)(a.Button)),U=e=>{var t;let{id:r,formRef:n,loading:o,refreshData:a}=e;const[d,,p,h]=(0,D.A)(),{state:f}=(0,l.$h)(),{isAlert:b}=f||{},g=(0,L.a7)({extraKey:m.q4,merge:!1}),{node:y}=(0,i.Z)(),{isNewItem:O,entityProps:j={}}=(0,s.SU)(),{cmds:v=[]}=j,x=O||v.includes("update"),{user_disabled:w}=(0,T.A)(),P=(0,F.A)(),[A]=(0,_.useStaticCoupon)(),C=(0,z.A)(A),E=(0,k.uW)("isAnonymous"),S=(0,I.JT)("billing:Manage"),N=(0,c.useCallback)((e=>P?x?e||null:"You don't have permissions to save your changes":"Please provide a name first"),[P,x]),R=(0,c.useMemo)((()=>({submit:{label:"Submit",tooltip:N("Submit your changes to ".concat(y.label," node")),textTransform:"",feature:"DyncfgSubmitButton",payload:{nodeId:y.id,isDyncfg:!0}},multiple_submit:{type:"button",flavour:"hollow",label:"Multi-Node Submit",tooltip:N("Submit your changes to another node or to multiple nodes"),onClick:p,textTransform:"",feature:"DyncfgSubmitButton",payload:{nodeId:y.id,isDyncfg:!0}},multiple_submit_alert:{type:"button",flavour:"hollow",label:"Submit to nodes",tooltip:N("Verify the selected nodes"),onClick:p,textTransform:"",feature:"DyncfgSubmitButton",payload:{nodeId:y.id,isDyncfg:!0}},nonPaid:{type:"button",label:"Upgrade",tooltip:"Upgrade your plan to use this feature.",disabled:!S||E,onClick:C,textTransform:""}})),[P,p,x,S,E,C,y,N]),U=!x||o||w||!P,{hidden:q,isDisabled:$,tooltipText:V,showUpgradeButton:G}=(0,B.j)({edit:!0,tooltip:R.submit.tooltip,disabled:U}),{isDisabled:K,tooltipText:Z}=(0,B.j)({edit:!0,tooltip:null===(t=R[b?"multiple_submit_alert":"multiple_submit"])||void 0===t?void 0:t.tooltip,disabled:U});return q?null:G?(0,u.jsx)(H,W({small:!0,disabled:U,isLoading:o},R.nonPaid)):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(H,W(W({small:!0,disabled:K,isLoading:o},R[b?"multiple_submit_alert":"multiple_submit"]),{},{tooltip:Z})),b?null:(0,u.jsx)(H,W(W({small:!0,disabled:$,isLoading:o},R.submit),{},{tooltip:V})),d?(0,u.jsx)(M.A,{id:r,formRef:n,onClose:h,refreshData:a,extraKey:m.ld},JSON.stringify({id:r,selectedNodeIds:g,modalOpen:d})):null]})},q=(0,N.A)(B.A),$=e=>{let{loading:t}=e;const{node:r}=(0,i.Z)(),{id:n,formData:o,entityProps:a={}}=(0,s.SU)(),{cmds:p=[]}=a,{user_disabled:h}=(0,T.A)(),f=p.includes("test"),b=(0,l.EZ)({id:n,node:r}),g=(0,F.A)({defaultName:"test"}),y=t||h,[m,O]=(0,d.A)(),j=m({successMessage:"Successfully tested configuration"}),v=O(),x=(0,c.useCallback)((()=>{b({name:g,payload:o}).then(j).catch(v)}),[g,b,o]);return f?(0,u.jsx)(q,{edit:!0,feature:"DyncfgItem",payload:{id:n,node:null===r||void 0===r?void 0:r.value},label:"Test",small:!0,tooltip:"Test your configuration",flavour:"hollow",onClick:x,disabled:y,type:"button"}):null},V=e=>{let{id:t,formRef:r,loading:n,errors:o=[],refreshData:i}=e;return(0,u.jsxs)(a.Flex,{"data-testid":"dyncfg-form-footer",background:"modalBackground",position:"sticky",bottom:0,gap:2,padding:[4,0,0,0],alignItems:"baseline",justifyContent:"between",zIndex:10,children:[o.length?(0,u.jsx)(E,{id:t,errors:o}):(0,u.jsx)(a.Flex,{}),(0,u.jsxs)(a.Flex,{gap:2,children:[(0,u.jsx)($,{loading:n}),(0,u.jsx)(U,{id:t,formRef:r,loading:n,refreshData:i})]})]})};var G=r(9050),K=r(40531),Z=r(49165),Y=r(71219);r(27495),r(25440),r(23215),r(37550);const Q=(e,t)=>{if(!e||!t)return e;const r=(e=>{const t=[],r=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(e&&"object"===typeof e)for(const[o,i]of Object.entries(e))o.startsWith("ui:")||("password"===(null===i||void 0===i?void 0:i["ui:widget"])&&t.push([...n,o]),"object"===typeof i&&null!==i&&r(i,[...n,o]))};return r(e),t})(t);if(!r.length)return e;const n=e.split("\n"),o=[],i=[];for(const l of n){const e=l.match(/^(\s*)(-\s*)?(\w+):/);if(e){const[,t,n,c]=e,s=t.length+((null===n||void 0===n?void 0:n.length)||0);for(;i.length>0&&i[i.length-1].indent>=s;)i.pop();const a=[...i.map((e=>e.name)),c];if(r.some((e=>e.length<=a.length&&e.every(((t,r)=>a[a.length-e.length+r]===t))))){const e=l.replace(/^(\s*(?:-\s*)?\w+:\s*)[^\n]*$/,"$1****");o.push(e)}else o.push(l);i.push({name:c,indent:s})}else o.push(l)}return o.join("\n")};function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function X(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ee=e=>{let{error:t}=e;return(0,u.jsx)(a.Flex,{padding:[4],children:(0,u.jsx)(a.Text,{color:"error",children:t})})},te=e=>(0,u.jsxs)(a.Flex,X(X({column:!0,gap:2},e),{},{children:[(0,u.jsxs)(a.Flex,{gap:2,alignItems:"center",children:[(0,u.jsx)(a.Icon,{color:"warning",name:"warning_triangle"}),(0,u.jsx)(a.Text,{children:"This feature is only available to paid plans"})]}),(0,u.jsx)(K.A,{small:!0})]})),re=e=>{let{id:t,node:r,canGetUserConfig:n,formData:o}=e;const{value:i,error:s}=(0,l.MQ)(),{value:d}=(0,l.t8)({id:t,node:r}),p=(0,Z.A)({id:t,node:r}),h=(0,c.useMemo)((()=>(e=>{var t;if(!e)return e;const r=e.split(/\r?\n/),n=null===(t=r[0].match(/^\s*/)[0])||void 0===t?void 0:t.length;return n?r.map((e=>{var t;const r=null===(t=e.match(/^\s*/)[0])||void 0===t?void 0:t.length;return e.slice(Math.min(r,n))})).join("\n"):e})(Q(i,null===d||void 0===d?void 0:d.uiSchema))),[i]),{hasPermission:f}=(0,B.j)({edit:!0});return(0,c.useEffect)((()=>{n&&o&&f&&p(o)}),[o,n,f,p]),n?s?(0,u.jsx)(ee,{error:s}):f?(0,u.jsx)(Y.A,{configuration:i,renderedConfiguration:h,isExplanationDisabled:!0,width:70}):(0,u.jsx)(te,{}):(0,u.jsx)(a.Flex,{padding:[4],children:(0,u.jsx)(a.Text,{children:"Configuration text export is not supported by this node."})})},ne=["id","node","canGetUserConfig","formData","isOpen","toggle"];function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const le=e=>{let{id:t,node:r,canGetUserConfig:n,formData:i,isOpen:l,toggle:c}=e,s=(0,o.A)(e,ne);return(0,u.jsx)(G.A,ie(ie({testId:"dyncfg-job-configuration",label:"Configuration",isOpen:l,onToggle:c,padding:[0,4,4,4],headerContainerProps:{background:"modalBackground"}},s),{},{children:(0,u.jsx)(re,{id:t,node:r,padding:[0,3,30],canGetUserConfig:n,formData:i})}))};var ce=r(12989),se=r(81391);const ae=e=>{var t;let{isOpen:r,toggle:n,formData:o}=e;const i=(0,se.n)("id"),c=null===(t=o||{})||void 0===t||null===(t=t.rules)||void 0===t||null===(t=t[0])||void 0===t||null===(t=t.config)||void 0===t||null===(t=t.match)||void 0===t?void 0:t.on,{value:s,error:a}=(0,l.MQ)();return c&&s&&!a?(0,u.jsx)(ce.A,{roomId:i,context:c,configuration:s,isOpen:r,onToggle:n,padding:[4,4,0,4],border:{side:"top",color:"border"},headerContainerProps:{background:"modalBackground"}}):null};r(89463);var de=r(45087),pe=r(54852),ue=r(79748),he=r(30005),fe=r(92318);const be=["level"],ge=["children"],ye=["children","href"],me=["content"],Oe=["content"],je=["ordered","children"];function ve(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ve(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ve(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const we=f.default.span.withConfig({displayName:"markdocSchema__Strong",componentId:"sc-1se2vza-0"})(["font-weight:bold;"]),Pe=f.default.ol.withConfig({displayName:"markdocSchema__OrderedList",componentId:"sc-1se2vza-1"})(["list-style:roman;padding-left:14px;"]),De=f.default.ul.withConfig({displayName:"markdocSchema__UnorderedList",componentId:"sc-1se2vza-2"})(['list-style-image:url("','/img/list-style-image.svg");padding-left:14px;'],fe.A.assetsBaseURL),Ae={heading:{render:e=>{let{level:t=1}=e,r=(0,o.A)(e,be),n=a.H1;switch(t){case 2:n=a.H2;break;case 3:n=a.H3;break;case 4:n=a.H4;break;case 5:n=a.H5;break;case 6:n=a.H6}return(0,u.jsx)(n,xe({margin:[2,0]},r))},attributes:{id:{type:String},level:{type:Number}}},paragraph:{render:e=>{let{children:t}=e,r=(0,o.A)(e,ge);return(0,u.jsx)(a.Flex,xe(xe({},r),{},{children:(0,u.jsx)(a.Text,{children:t})}))}},strong:{render:we},link:{render:e=>{let{children:t,href:r}=e,n=(0,o.A)(e,ye);return(0,u.jsx)(ue.A,xe(xe({href:r,rel:"noopener noreferrer",target:"_blank"},n),{},{children:t}))},attributes:{href:{type:String}}},code:{render:e=>{let{content:t}=e,r=(0,o.A)(e,me);return(0,u.jsx)(he.R0,xe(xe({},r),{},{children:t}))},attributes:{content:{type:String}}},fence:{render:e=>{let{content:t}=e,r=(0,o.A)(e,Oe);return(0,u.jsx)(he.Ay,xe(xe({},r),{},{children:t}))},attributes:{content:{type:String}}},list:{render:e=>{let{ordered:t,children:r}=e,n=(0,o.A)(e,je);const i=t?Pe:De;return(0,u.jsx)(i,xe(xe({},n),{},{children:r}))},attributes:{ordered:{type:Boolean}}}},Ce=e=>{let{children:t}=e;return(0,u.jsx)(pe.A,{transformConfiguration:{nodes:Ae},children:t})},Ee=e=>{var t;let{description:r}=e;return("string"===typeof r&&r?r:"object"===typeof r?null===r||void 0===r||null===(t=r.props)||void 0===t?void 0:t.description:null)?(0,u.jsx)(de.A,{isBasic:!0,plain:!0,allowHoverOnTooltip:!0,content:(0,u.jsx)(a.Flex,{height:{max:70},width:{max:120},overflow:{vertical:"auto"},children:(0,u.jsx)(Ce,{children:r})}),contentProps:{width:{max:120}},children:(0,u.jsx)(a.Icon,{name:"information",color:"text",size:"small"})}):null};function Se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Me(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Se(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Se(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ke=e=>{var t;let{description:r}=e;if(!r)return null;const n="string"===typeof r?r:null===(t=r.props)||void 0===t?void 0:t.description;return(0,u.jsx)(Ce,{children:n})},Ie=e=>{let{title:t,required:r,description:n,help:o,isCollapsible:i,isExpanded:l,toggleExpanded:c}=e;return t?(0,u.jsxs)(a.Flex,{column:!0,gap:.5,children:[(0,u.jsxs)(a.Flex,{alignItems:"center",gap:1,children:[i?(0,u.jsx)(a.Icon,{name:"chevron_down",color:"text",onClick:c,cursor:"pointer",rotate:l?2:0}):null,(0,u.jsxs)(a.TextBig,{strong:!0,cursor:i?"pointer":"default",onClick:i?c:void 0,children:[t,r?"*":null]}),o?(0,u.jsx)(Ee,{description:o}):null]}),(0,u.jsx)(a.Flex,Me(Me({},i?{padding:[0,0,0,5]}:{}),{},{children:(0,u.jsx)(ke,{description:n})}))]}):null};function Te(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ze=(0,f.keyframes)(["from{opacity:0;transform:scale(0.8);}to{opacity:1;transform:scale(1);}"]),Be=(0,f.keyframes)(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]),Le=(0,f.default)(a.Flex).withConfig({displayName:"validationIcon__IconWrapper",componentId:"sc-5mqx0z-0"})(["animation:"," 0.2s ease-in-out;",""],ze,(e=>e.isLoading&&(0,f.css)(["animation:"," 1s linear infinite;"],Be))),_e=e=>{let{status:t,size:r="small"}=e;if(!t)return null;const n={small:{name:"",color:"text",width:"14px",height:"14px"},medium:{name:"",color:"text",width:"16px",height:"16px"},large:{name:"",color:"text",width:"20px",height:"20px"}}[r]||n.small;switch(t){case"error":return(0,u.jsx)(Le,{alignItems:"center",justifyContent:"center",children:(0,u.jsx)(a.Icon,Fe(Fe({},n),{},{name:"x",color:"error"}))});case"warning":default:return null;case"loading":return(0,u.jsx)(Le,{alignItems:"center",justifyContent:"center",isLoading:!0,children:(0,u.jsx)(a.Icon,Fe(Fe({},n),{},{name:"loading",color:"textLite"}))})}},Ne=(0,f.default)(a.Flex).withConfig({displayName:"fieldTemplate__ValidationIconWrapper",componentId:"sc-u7gsvl-0"})(["position:absolute;right:8px;top:8px;pointer-events:auto;z-index:2;cursor:help;"]),Re=(0,f.default)(a.Flex).withConfig({displayName:"fieldTemplate__FieldContentWrapper",componentId:"sc-u7gsvl-1"})(['position:relative;input:not([type="checkbox"]):not([type="radio"]),select,textarea{padding-right:32px !important;}']),We=e=>{let{id:t,displayLabel:r,label:n,description:o,required:i,uiSchema:l={}}=e;const c=l["ui:title"]||n,s=l["ui:help"];return c&&r?(0,u.jsx)("label",{htmlFor:t,children:(0,u.jsx)(Ie,{title:c,description:o,required:i,help:s})}):null},He=e=>{var t;let{id:r,label:n,required:o,description:i,errors:l,children:s,displayLabel:d,schema:p,classNames:h,hidden:f,uiSchema:b,formData:g,rawErrors:y}=e;const[m,O]=(0,c.useState)(!1),[j,v]=(0,c.useState)(!1),[x,w]=(0,c.useState)(null),[P,D]=(0,c.useState)("");(0,c.useEffect)((()=>{void 0!==g&&null!==g&&""!==g&&O(!0)}),[g]);(0,c.useEffect)((()=>{if(l&&l.length>0||y&&y.length>0)return w("error"),void D("");if(m&&void 0!==g&&null!==g&&""!==g){const e=null===b||void 0===b?void 0:b["ui:validation"];if(null!==e&&void 0!==e&&e.warning){const t=e.warning.condition;if(t&&((e,t)=>{try{return new Function("value","return ".concat(e))(t)}catch(r){return!1}})(t,g))return w("warning"),void D(e.warning.message||"This value may not be optimal")}}w(null),D("")}),[l,y,m,g,b,r]);const A="object"!==p.type&&"array"!==p.type&&!(null!==b&&void 0!==b&&null!==(t=b["ui:widget"])&&void 0!==t&&t.includes("hidden")),C="object"===p.type,E="boolean"===p.type,S=o&&"boolean"!==p.type&&"radio"!==(null===b||void 0===b?void 0:b["ui:widget"]);return f?null:(0,u.jsxs)(a.Flex,{width:"100%",className:"".concat(h," dyncfg-field-container"),column:!0,gap:.5,children:[E?null:(0,u.jsx)(We,{id:r,displayLabel:d,label:n,required:S,description:C?i:null,uiSchema:b}),(0,u.jsxs)(Re,{className:"dyncfg-field-content",column:!0,gap:.5,onBlur:()=>{v(!0)},onFocus:()=>{v(!1)},children:[E?(0,u.jsxs)(a.Flex,{gap:2,children:[s,(0,u.jsx)(We,{id:r,displayLabel:d,label:n,required:S,description:C?i:null,uiSchema:b})]}):s,!C&&i?(0,u.jsx)(a.Flex,{children:(0,u.jsx)(ke,{description:i})}):null,A&&x&&(0,u.jsx)(Ne,{children:(0,u.jsx)(_e,{status:x,size:"small"})}),l?(0,u.jsx)(a.TextMicro,{color:"errorText",children:l}):null,P&&"warning"===x?(0,u.jsx)(a.TextMicro,{color:j?"warning":"textLite",children:P}):null]})]})};r(72577);const Ue=e=>{let{title:t,children:r,initiallyExpanded:n=!1,help:o=null}=e;const[i,l]=(0,D.A)(n);return(0,u.jsxs)(a.Flex,{className:"dyncfg-collapsible-group dyncfg-grid-col-span-1-6",width:"100%",column:!0,gap:2,children:[(0,u.jsx)(Ie,{title:t,required:!1,description:null,help:o,isCollapsible:!0,isExpanded:i,toggleExpanded:l}),(0,u.jsx)(a.Collapsible,{className:"dyncfg-group-collapsible",open:i,duration:200,children:(0,u.jsx)(a.Flex,{column:!0,gap:3,padding:[0,0,0,3],border:{side:"left",color:"border"},children:r})})]})},qe=["className"],$e=["onAddProperty","schema","registry","properties","uiSchema"];function Ve(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ge(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ve(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Ke=(Ze=e=>{let{onAddProperty:t,schema:r,registry:n,properties:i,uiSchema:l={}}=e,c=(0,o.A)(e,$e);const{WrapIfAdditionalTemplate:s,ButtonTemplates:d}=n.templates,{AddButton:p}=d,h=null===l||void 0===l?void 0:l["ui:groups"],f=h?(e=>{let{properties:t,groups:r,WrapIfAdditionalTemplate:n}=e;return Array.isArray(r)?r.map(((e,r)=>{if("string"===typeof e){const r=t.find((t=>t.name===e));return r?(0,u.jsx)(n,Ge(Ge({elemKey:r.content.key},r.content.props),{},{children:r.content}),r.content.key):null}if("object"===typeof e){const o=Object.keys(e).find((e=>!e.startsWith("ui:")));if(o){const i=e[o],l=e["ui:collapsible"],c=e["ui:initiallyExpanded"];if(Array.isArray(i)){const e=i.map((e=>t.find((t=>t.name===e)))).filter(Boolean).map((e=>(0,u.jsx)(n,Ge(Ge({elemKey:e.content.key},e.content.props),{},{children:e.content}),e.content.key)));return l?(0,u.jsx)(Ue,{title:o,initiallyExpanded:c,children:e},"group-".concat(r)):(0,u.jsxs)("div",{className:"dyncfg-field-group",children:[o&&(0,u.jsx)("div",{className:"dyncfg-group-title",children:o}),e]},"group-".concat(r))}}return null}return null})).filter(Boolean):t.map((e=>(0,u.jsx)(n,Ge(Ge({elemKey:e.content.key},e.content.props),{},{children:e.content}),e.content.key)))})({properties:i,groups:h,registry:n,WrapIfAdditionalTemplate:s}):i.map((e=>(0,u.jsx)(s,Ge(Ge({elemKey:e.content.key},e.content.props),{},{children:e.content}),e.content.key)));return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(a.Flex,Ge(Ge({className:"dyncfg-object-field-content",column:!0,gap:3},c),{},{children:f})),r.additionalProperties&&t?(0,u.jsx)(a.Flex,{padding:[2],children:(0,u.jsx)(p,{onClick:t})}):null]})},e=>{let{className:t}=e,r=(0,o.A)(e,qe);return null!==t&&void 0!==t&&t.includes("dyncfg-grid")?(0,u.jsx)("div",{className:t,children:(0,u.jsx)(Ze,Ge({},r))}):(0,u.jsx)(Ze,Ge({},r))});var Ze;function Ye(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ye(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ye(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Je=(0,c.createContext)(),Xe=e=>{let{children:t}=e;const[r,n]=(0,c.useState)({});return(0,u.jsx)(Je.Provider,{value:{collapsibleItemsState:r,setCollapsibleItemsState:n},children:t})},et=["title"];function tt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function rt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tt(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const nt=e=>{const{properties:t,uiSchema:r}=e,{tabs:n,rest:i}=r["ui:options"]||{},[l,s]=(0,c.useState)(0),d=(0,c.useMemo)((()=>(e=>{let{properties:t=[],tabs:r=[]}=e;return r.map((e=>rt(rt({},e),{},{properties:t.filter((t=>e.fields.includes(t.name)))})))})({properties:t,tabs:n})),[t,n]);return(0,u.jsxs)(Xe,{children:[(i||[]).length?(0,u.jsx)(Ke,rt(rt({},e),{},{properties:t.filter((e=>i.includes(e.name)))})):null,(0,u.jsx)(a.Tabs,{selected:l,onChange:s,height:"100%",children:d.map((t=>{let{title:r}=t,n=(0,o.A)(t,et);return(0,u.jsx)(a.Tab,{label:r,children:(0,u.jsx)(Ke,rt(rt(rt({},e),n),{},{border:{side:"top",color:"border"},padding:[2,0,0,3]}))},r)}))})]})},ot=["title"];function it(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?it(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ct={tabs:{Component:nt},default:{Component:Ke}},st=e=>{var t;let{title:r}=e,n=(0,o.A)(e,ot);const{description:i,uiSchema:l={},fieldPathId:s,formData:d}=n,p=null===s||void 0===s?void 0:s.$id,h=l["ui:flavour"],f=l["ui:help"],{Component:b}=ct[h]||ct.default,y=!(null===l||void 0===l||!l["ui:collapsible"])||!(null===l||void 0===l||null===(t=l["ui:options"])||void 0===t||!t.collapsible),{inContext:m,isItemDirty:O,isItemExpanded:j,setItemState:v}=(()=>{const e=(0,c.useContext)(Je),{collapsibleItemsState:t,setCollapsibleItemsState:r}=e||{},n=(0,c.useCallback)((e=>void 0!==t[e]),[t]),o=(0,c.useCallback)((e=>t[e]),[t]),i=(0,c.useCallback)(((e,t)=>{r((r=>Qe(Qe({},r),{},{[e]:t})))}),[r]);return{inContext:!!e,isItemDirty:e?n:g(),isItemExpanded:e?o:g(),setItemState:e?i:g()}})(),x=l["ui:initiallyExpanded"]||!!d,w=(0,c.useMemo)((()=>O(p)?j(p):x),[O,j]),[P,A]=(0,D.A)(w);return(0,c.useEffect)((()=>{m&&v(p,P)}),[m,P,v]),(0,u.jsxs)(a.Flex,{className:"dyncfg-object-field-container",width:"100%",column:!0,gap:2,children:[r?(0,u.jsx)(Ie,{title:r,description:i,help:f,isCollapsible:y,isExpanded:P,toggleExpanded:A}):null,(0,u.jsx)(a.Collapsible,{className:"dyncfg-object-field-collapsible",open:P||!y,duration:0,children:(0,u.jsx)(b,lt({},n))})]})};function at(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const dt=(0,f.default)(a.IconButton).attrs((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?at(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({small:!0,padding:[0,1]},e))).withConfig({displayName:"styled__StyledIconButton",componentId:"sc-xc1c2v-0"})(["height:",";"],(e=>{let{inTabs:t}=e;return t?"auto":"24px"})),pt=["icon","iconType"];function ut(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const ht=e=>{let{icon:t,iconType:r}=e,i=(0,o.A)(e,pt);return(0,u.jsx)(dt,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ut(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({flavour:"default",icon:"plus",tooltip:"Add item",type:"button",neutral:!1},i))},ft=e=>{let{canAdd:t,onAddClick:r,openEmptyItem:n}=e;return(0,c.useEffect)((()=>{n&&r()}),[n,r]),(0,u.jsxs)(a.Flex,{gap:2,alignItems:"center",children:[(0,u.jsx)(a.TextBig,{children:"No items"}),t?(0,u.jsx)(ht,{onClick:r}):null]})};var bt=r(74891);const gt=(0,bt.A)(a.Toggle),yt=(0,c.createContext)({}),mt=e=>{let{items:t,canAdd:r,onAddClick:n,uiSchema:o}=e;const[i,l]=(0,c.useState)(0),s="list"===(null===o||void 0===o?void 0:o["ui:listFlavour"]),d=!(null===o||void 0===o||!o["ui:openEmptyItem"]),[p,h]=(0,D.A)(s);return(0,c.useEffect)((()=>{i>=t.length&&l(0)}),[i,t.length,l]),(0,u.jsx)(a.Flex,{"data-testid":"dyncfg-array-field-template",width:"100%",column:!0,gap:2,padding:[1,0,0,0],children:t.length?(0,u.jsxs)(yt,{value:{items:t,isList:p,activeTab:i,setActiveTab:l},children:[(0,u.jsx)(a.Flex,{"data-testid":"dyncfg-array-field-template-list-toggler",children:(0,u.jsx)(gt,{labelRight:"List",labelLeft:"Tabs",onChange:h,checked:p,tooltip:"Switch between list and tabs layout"})}),t]}):(0,u.jsx)(ft,{canAdd:r,onAddClick:n,openEmptyItem:d})})},Ot=["title","isCollapsible","isOpen","onChange","children"];function jt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jt(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const xt=(0,f.default)(a.Flex).attrs((e=>vt({open:!0},e))).withConfig({displayName:"collapsible__ContentWrapper",componentId:"sc-6ate9-0"})(["display:",";"],(e=>{let{open:t}=e;return t?"flex":"none"})),wt=(0,bt.A)(a.Icon),Pt=e=>{let{title:t="",isCollapsible:r,isOpen:n,onChange:i,children:l}=e,s=(0,o.A)(e,Ot);const[d,p]=(0,D.A)(n);return(0,c.useEffect)((()=>{i(d)}),[d]),r?(0,u.jsxs)(a.Flex,{width:"100%",column:!0,padding:[3,0],children:[(0,u.jsxs)(a.Flex,{gap:2,children:[(0,u.jsx)(wt,{noWrapper:!0,name:"chevron_left",size:"small",color:"textLite",rotate:d?1:3,onClick:p,cursor:"pointer",tooltip:d?"Hide contents":"Show contents"}),t?(0,u.jsx)(a.Text,{strong:!0,children:t}):null]}),(0,u.jsx)(xt,vt(vt({open:d},s),{},{children:l}))]}):l},Dt=["icon","iconType"];function At(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const Ct=e=>{let{icon:t,iconType:r}=e,i=(0,o.A)(e,Dt);return(0,u.jsx)(dt,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?At(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):At(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({flavour:"hollow",icon:"copy",tooltip:"Copy current item into a new one",type:"button",neutral:!1},i))},Et=["icon","iconType"];function St(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const Mt=e=>{let{icon:t,iconType:r}=e,i=(0,o.A)(e,Et);return(0,u.jsx)(dt,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?St(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({flavour:"hollow",icon:"sort_descending",tooltip:"Move down",type:"button"},i))},kt=["icon","iconType"];function It(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const Tt=e=>{let{icon:t,iconType:r}=e,i=(0,o.A)(e,kt);return(0,u.jsx)(dt,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?It(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):It(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({flavour:"hollow",icon:"sort_ascending",tooltip:"Move up",type:"button"},i))};function Ft(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const zt=e=>(0,u.jsx)(dt,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ft(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ft(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({flavour:"hollow",icon:"checkmark_partial_s",danger:!0,tooltip:"Remove item",type:"button"},e)),Bt=e=>{var t,r;let{index:n,totalItems:o,buttonsProps:i={},uiSchema:l={},children:s}=e;const{canAdd:d,onAddItem:p,onCopyItem:h,onMoveDownItem:f,onMoveUpItem:b,onRemoveItem:g,hasMoveDown:y,hasMoveUp:m,hasRemove:O}=i,[j,v]=(0,c.useState)(!0),x=m||y||O||d,w=!(null===l||void 0===l||!l["ui:collapsible"])||!(null===l||void 0===l||null===(t=l["ui:options"])||void 0===t||!t.collapsible),P=(0,c.useCallback)((e=>{v(e)}),[v]);return(0,u.jsxs)(a.Flex,{width:"100%",gap:2,alignItems:j?"start":"center",justifyContent:"between",border:{side:"all",color:"border"},padding:[2,4],children:[(0,u.jsx)(Pt,{isCollapsible:w,title:null===(r=s.props)||void 0===r?void 0:r.title,isOpen:j,onChange:P,children:s}),x?(0,u.jsxs)(a.Flex,{gap:2,padding:[2,0],children:[m?(0,u.jsx)(Tt,{onClick:b}):null,y?(0,u.jsx)(Mt,{onClick:f}):null,O?(0,u.jsx)(zt,{onClick:g}):null,d?(0,u.jsx)(Ct,{onClick:h}):null,d&&n===o-1?(0,u.jsx)(ht,{onClick:p}):null]}):null]})},Lt=["title","active","index","setActiveTab","reordering","setReordering","buttonsProps","ref"];function _t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_t(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Rt=e=>{let{title:t,active:r,index:n,setActiveTab:i,reordering:l,setReordering:s,buttonsProps:d={},ref:p}=e,h=(0,o.A)(e,Lt);const{onRemoveItem:f,onReorderClick:b,hasMoveDown:g,hasMoveUp:y,hasRemove:m}=d,O=(0,c.useCallback)((()=>{m&&f()}),[m,f]);return(0,c.useEffect)((()=>{if(2===(null===l||void 0===l?void 0:l.length)&&l[0]===n){const e=l[1];b(n,e)(),i(e),s()}}),[l]),(0,u.jsx)(a.NavigationTab,Nt(Nt({ref:p},h),{},{index:n,draggable:!(!g&&!y),active:r,icon:m?(0,u.jsx)(a.Icon,{name:"x",size:"small"}):null,onClick:()=>{i(n)},onRemove:O,fixed:!m,children:(0,u.jsx)(a.TextBig,{whiteSpace:"nowrap",children:t})}))},Wt=["activeTab","setActiveTab","buttonsProps","children"];function Ht(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const Ut=e=>{let{activeTab:t,setActiveTab:r,buttonsProps:i={},children:l}=e,s=(0,o.A)(e,Wt);const[d,{width:p}]=(0,y.A)(),[h,f]=(0,c.useState)(),{items:b=[]}=(0,c.use)(yt),{canAdd:g,onAddItem:m,onCopyItem:O}=i,j=g?"calc(".concat(p,"px - 80px)"):"".concat(p,"px");return(0,u.jsxs)(a.Flex,{"data-testid":"dyncfg-array-field-item-template-tabs",ref:d,width:"100%",column:!0,children:[(0,u.jsxs)(a.Flex,{width:"".concat(p,"px"),margin:[0,0,2,0],children:[(0,u.jsx)(a.NavigationTabs,{width:j,overflow:{horizontal:"auto"},children:(0,u.jsx)(a.DraggableTabs,{items:b.map(((e,o)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ht(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ht(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({id:e.key,title:"Rule ".concat(o+1),active:t===o,setActiveTab:r,reordering:h,setReordering:f,buttonsProps:i},s))),Item:Rt,onDragEnd:(e,t)=>{f([e,t])}})}),g?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Ct,{onClick:O,padding:[1,3],inTabs:!0,groupFirst:!0}),(0,u.jsx)(ht,{onClick:m,padding:[1,3],inTabs:!0,groupLast:!0})]}):null]}),l]})},qt=(0,c.memo)(Ut),$t=["index"];function Vt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Vt(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Vt(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Kt=e=>{let{index:t}=e,r=(0,o.A)(e,$t);const{isList:n,activeTab:i,setActiveTab:l}=(0,c.use)(yt);return n||t===i?(0,u.jsx)(a.Flex,{"data-testid":"dyncfg-array-field-item-template",width:"100%",padding:[1,0,0,0],children:n?(0,u.jsx)(Bt,Gt({},r)):(0,u.jsx)(qt,Gt({activeTab:i,setActiveTab:l},r))}):null};var Zt=r(55780);const Yt=e=>{let{elemKey:t,handleKeyRename:r,handleRemoveProperty:n,schema:o,registry:i,children:l}=e;const[s,d]=(0,c.useState)(t||""),{RemoveButton:p}=i.templates.ButtonTemplates,h=Zt.Rr in o,f=(0,c.useCallback)((e=>d(e.target.value)),[d]),b=(0,c.useCallback)((()=>{t!==s&&r(t,s)}),[t,s,r]),g=(0,c.useCallback)((()=>{n(t)}),[t,n]);return h?(0,u.jsxs)(a.Flex,{width:"100%",gap:2,alignItems:"center",children:[(0,u.jsxs)(a.Flex,{column:!0,gap:1,flex:{grow:1,shrink:1},children:[(0,u.jsx)(a.TextBig,{strong:!0,children:"Key"}),(0,u.jsx)(a.TextInput,{value:s,onInput:f,onBlur:b,border:"inputBorder",size:"small"})]}),(0,u.jsx)(a.Flex,{flex:{grow:2,shrink:1},children:l}),(0,u.jsxs)(a.Flex,{column:!0,gap:.5,children:[(0,u.jsx)(a.TextBig,{opacity:"0",children:"x"}),(0,u.jsx)(p,{onClick:g})]})]}):l},Qt={FieldTemplate:He,ArrayFieldTemplate:mt,ArrayFieldItemTemplate:Kt,ObjectFieldTemplate:st,WrapIfAdditionalTemplate:Yt,ErrorListTemplate:()=>null,ButtonTemplates:{SubmitButton:()=>(0,u.jsx)(a.Button,{label:"Save"}),AddButton:ht,RemoveButton:zt,MoveUpButton:Tt,MoveDownButton:Mt}};r(53921),r(9391),r(8872),r(25509),r(65223),r(60321),r(41927),r(11632),r(64377),r(66771),r(12516),r(68931),r(52514),r(35694),r(52774),r(49536),r(21926),r(94483),r(16215);var Jt=r(3319),Xt=r(63872);const er=()=>{const[e,t]=(0,c.useState)([]),r=(0,c.useCallback)((e=>t(e)),[t]);return{errors:e,onError:r,resetErrors:(0,c.useCallback)((()=>t([])),[t])}};function tr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function rr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tr(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const nr=e=>{let{id:t,node:r,formState:n,submitMethod:o,setIsDirty:i,setError:a,stripUnknownFields:p}=e;const{isNewItem:u,isDirty:h,formData:f,setFormData:b,isLoading:g,startLoading:y,stopLoading:m}=(0,s.SU)(),{refresh:O}=(0,l.$h)(),{sendLog:j}=(0,Jt.A)(),[v,x]=(0,Xt.A)(),{loaded:w,value:P,error:D,refresh:A}=(0,l.t8)({id:t,node:r}),{loaded:C,value:E,hasError:S,refresh:M}=n,k=h||!E?f:Object.keys(E).length?E:f,I=(0,c.useMemo)((()=>{const e=p?((e,t)=>{var r;if(!e||null===t||void 0===t||null===(r=t.jsonSchema)||void 0===r||!r.properties)return e;const n=new Set(["name",...Object.keys(t.jsonSchema.properties||{})]),o=Object.fromEntries(Object.entries(e||{}).filter((e=>{let[t]=e;return n.has(t)}))),i=Object.keys(e).filter((e=>!n.has(e)));return i.length&&(console.warn("[dyncfg] The following fields are not defined in the schema properties"),console.warn(i)),o})(k,P):k;return((e,t)=>{if(!e||null===t||void 0===t||!t.dependencies)return e;const r=Object.entries(t.dependencies).reduce(((r,n)=>{let[o,i]=n;return Object.keys(i).includes("oneOf")&&Array.isArray(t.dependencies[o].oneOf)&&t.dependencies[o].oneOf.forEach((t=>{var n;let{properties:i}=t;(null===(n=i[o])||void 0===n?void 0:n.const)!==e[o]&&Object.keys(i).filter((e=>e!==o)).forEach((e=>r.push(e)))})),r}),[]);return r.length?Object.entries(e).reduce(((e,t)=>{let[n,o]=t;return rr(rr({},e),r.includes(n)?{}:{[n]:o})}),{}):e})(e,null===P||void 0===P?void 0:P.jsonSchema)}),[k,P,p]),T=w&&C,F=D||S,z=(0,l.Hj)(),B=(0,l.O_)({node:r,id:t}),{errors:L,onError:_,resetErrors:N}=er();(0,c.useEffect)((()=>{a(F)}),[F,a]);const R=(0,c.useCallback)(((e,t)=>{const r=rr({name:E.name},e.formData);b(r),i(!t)}),[null===E||void 0===E?void 0:E.name,b,i]),W=(0,c.useCallback)((e=>{R({formData:e})}),[R]),H=(0,c.useCallback)((e=>{N(),O();const r=rr(rr({},e.formData),u&&null!==f&&void 0!==f&&f.name?{name:f.name}:{});y(),o(r).then((()=>{i(!1),u?z():(B(),A(),M()),v({header:"Success",text:"Successfully submitted configuration"}),j({feature:"DyncfgForm",description:"Submit success",id:t})})).catch((e=>{var r;const n=(0,d.x)(e);x({header:"Error",text:n}),j({feature:"DyncfgForm",description:"Submit error",id:t,error:JSON.stringify((null===(r=e.response)||void 0===r?void 0:r.data)||{})})})).finally((()=>{m()}))}),[u,null===f||void 0===f?void 0:f.name,o,y,m,i,z,B,A,M,d.x,_,N,O,v,x,j]);return{isLoading:g,loaded:T,defaultFormData:E,formData:I,setFormData:W,refreshData:M,schema:P,resourcesError:F,errors:L,onChange:R,onSubmit:H,onError:_}};var or=r(21996);const ir=e=>{let{value:t,disabled:r,onChange:n}=e;const o=(0,c.useCallback)((e=>{n(e)}),[n]);return(0,u.jsx)(a.Flex,{children:(0,u.jsx)(a.Checkbox,{checked:t,onChange:o,disabled:r})})};r(26910);var lr=r(24582);r(42762);const cr=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e)return null;if(Array.isArray(e)){return[...t.filter((t=>e.map((e=>"string"===typeof e?e:e.value)).includes(t.value))),...e.filter((e=>"object"===typeof e&&e.__isNew__))]}const r=t.find((t=>t.value===e));return r||("string"===typeof e&&""!==e.trim()?{value:e,label:e,__isNew__:!0}:null)},sr=e=>{var t;let{value:r,options:n,disabled:o,multiple:i,isCreatable:l,onChange:s,uiSchema:d}=e;const{enumOptions:p}=n||{},h=null===d||void 0===d||null===(t=d["ui:options"])||void 0===t?void 0:t.enumOptions,f=p||h,b=null===d||void 0===d?void 0:d["ui:creatable"],g=(0,c.useCallback)((e=>{var t;s((t=e)?Array.isArray(t)?t.map((e=>e.value)):t.value||"":"")}),[]);return f?(0,u.jsx)(a.Select,{value:cr(r,f),isMulti:i,options:f,onChange:g,isDisabled:o,isCreatable:l||b,placeholder:"Select or type to create...",noOptionsMessage:e=>{let{inputValue:t}=e;return t?'Create "'.concat(t,'"'):"Type to create new option"},formatCreateLabel:e=>'Create "'.concat(e,'"'),createOptionPosition:"first",allowCreateWhileLoading:!1,isValidNewOption:e=>e&&e.trim().length>0}):null};function ar(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function dr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ar(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ar(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const pr=e=>({value:e,label:e}),ur=e=>{const t=(0,se.n)("id"),r=(0,lr.R7)(t),n=(0,c.useMemo)((()=>Object.keys(r).sort(((e,t)=>e.localeCompare(t,void 0,{sensitivity:"accent",ignorePunctuation:!0}))).map(pr)),[r]);return(0,u.jsx)(sr,dr(dr({},e),{},{isCreatable:!0,options:{enumOptions:n}}))},hr=(e,t)=>{const r=parseFloat(e),{multiplier:n}=t||{};return{num:r,multiplier:parseFloat(n)}},fr=e=>{let{value:t=0,onChange:r=g(),scale:n=[],defaultScale:o,min:i=0,step:l=1}=e;const s=n.find((e=>{let{value:t}=e;return t===o}))||n[0],[d,p]=(0,c.useState)(s),h=((e,t)=>{const{num:r,multiplier:n}=hr(e,t);return n&&!isNaN(r)?Math.round(r/n*100)/100:0})(t,d),f=(0,c.useCallback)((e=>{const t=((e,t)=>{const{num:r,multiplier:n}=hr(e,t);return n&&!isNaN(r)?r*n:0})(e.target.value,d);r(t)}),[d,r]);return(0,u.jsxs)(a.Flex,{gap:2,alignItems:"center",children:[(0,u.jsx)(a.TextInput,{value:h,onChange:f,type:"number",min:i,step:l,size:"small"}),(0,u.jsx)(a.Select,{value:d,options:n,onChange:p,styles:{minWidth:"80px"}})]})};function br(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const gr=[{value:"sec",label:"Seconds",multiplier:1},{value:"min",label:"Minutes",multiplier:60},{value:"hour",label:"Hours",multiplier:3600},{value:"day",label:"Days",multiplier:86400},{value:"week",label:"Weeks",multiplier:604800},{value:"month",label:"Months",multiplier:2592e3},{value:"year",label:"Years",multiplier:31536e3}],yr=e=>{const{schema:t={}}=e,{type:r}=t,o="number"==r?.1:1,{scales:i}=e.options||{},l=i?gr.filter((e=>{let{value:t}=e;return i.includes(t)})):gr;return(0,u.jsx)(fr,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?br(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):br(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({scale:l,step:o},e))};function mr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Or(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mr(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const jr=e=>{var t;return(0,u.jsx)(yr,Or(Or({},e),{},{defaultScale:null===(t=e.options)||void 0===t?void 0:t.scale}))};function vr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vr(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const wr=(0,f.default)(a.Box).attrs({fontWeight:"bold",width:{min:"40px"}}).withConfig({displayName:"expressionBuilderWidget__Symbol",componentId:"sc-tuh4eq-0"})(["font-family:monospace !important;"]),Pr={current:{symbol:"$this",description:"Current value of the chart"},timestamp:{symbol:"$now",description:"Current timestamp"},after:{symbol:"$after",description:"Start time of the evaluation window"},before:{symbol:"$before",description:"End time of the evaluation window"},status:{symbol:"$status",description:"Current alert status"},CLEAR:{symbol:"$CLEAR",description:"Alert status: Clear (0)"},WARNING:{symbol:"$WARNING",description:"Alert status: Warning (1)"},CRITICAL:{symbol:"$CRITICAL",description:"Alert status: Critical (2)"},operators:{comparison:[{symbol:"<",description:"Less than"},{symbol:">",description:"Greater than"},{symbol:"<=",description:"Less than or equal to"},{symbol:">=",description:"Greater than or equal to"},{symbol:"==",description:"Equal to"},{symbol:"!=",description:"Not equal to"}],logical:[{symbol:"&&",description:"Logical AND"},{symbol:"||",description:"Logical OR"},{symbol:"!",description:"Logical NOT"}],arithmetic:[{symbol:"+",description:"Addition"},{symbol:"-",description:"Subtraction"},{symbol:"*",description:"Multiplication"},{symbol:"/",description:"Division"},{symbol:"%",description:"Modulo"}],conditional:[{symbol:"?",description:"Ternary conditional (if)"},{symbol:":",description:"Ternary conditional (else)"}],grouping:[{symbol:"(",description:"Opening parenthesis"},{symbol:")",description:"Closing parenthesis"}]}},Dr=["status","CLEAR","WARNING","CRITICAL"],Ar={warning:[{symbol:"$this > threshold",description:"Basic threshold comparison",insertText:"$this > "}],critical:[{symbol:"$this > ($status >= $WARNING ? low : high)",description:"Dynamic threshold based on status",insertText:"$this > (($status >= $WARNING) ? () : ())"}]},Cr={variables:{title:"Variables",color:"primary"},comparison:{title:"Comparison",color:"warning"},logical:{title:"Logical",color:"accent"},arithmetic:{title:"Math",color:"success"},grouping:{title:"Grouping",color:"text"},templates:{title:"Templates",color:"info"},default:{color:"text"}},Er=e=>{let{value:t="",onChange:r,disabled:n=!1,placeholder:o="Enter an expression",uiSchema:i={},isAlert:l=!1}=e;const[s,d,,p]=(0,D.A)(),[h,f]=(0,c.useState)([]),[b,g]=(0,c.useState)(0),[y,m]=(0,c.useState)(0),O=(0,c.useRef)(null),j=i["ui:alertStatus"]||"critical",v=(0,c.useCallback)((e=>{const t={variables:[],comparison:[],logical:[],arithmetic:[],grouping:[],templates:[]};if(Object.entries(Pr).forEach((r=>{let[n,o]=r;"operators"!==n&&(!l&&Dr.includes(n)||o.symbol.toLowerCase().includes(e.toLowerCase())&&t.variables.push({symbol:o.symbol,description:o.description,insertText:" ".concat(o.symbol," ")}))})),Object.entries(Pr.operators).forEach((r=>{let[n,o]=r;o.forEach((r=>{(0===e.length||r.symbol.includes(e))&&(t[n]||(t[n]=[]),t[n].push({symbol:r.symbol,description:r.description,insertText:" ".concat(r.symbol," ")}))}))})),l&&(0===e.length||"$this".includes(e.toLowerCase()))){(Ar[j]||Ar.critical).forEach((e=>{t.templates.push({symbol:e.symbol,description:e.description,insertText:" ".concat(e.insertText," ")})}))}return t}),[j,l]);return(0,u.jsxs)(a.Box,{position:"relative",width:"100%",children:[(0,u.jsx)(a.TextInput,{ref:O,value:t,onChange:e=>{var t,n;const o=(null===(t=e.target)||void 0===t?void 0:t.value)||"";r(o);const i=(null===(n=e.target)||void 0===n?void 0:n.selectionStart)||0;g(i);const l=o.slice(0,i).split(/\s+/),c=l[l.length-1]||"",s=v(c);f(s);const a=Object.values(s).some((e=>e.length>0));d(a)},onKeyDown:e=>{"Escape"===e.key&&p(!1)},onFocus:()=>{const e=v("");f(e);const t=Object.values(e).some((e=>e.length>0));d(t),m(0)},disabled:n,placeholder:o,autoComplete:"off",spellCheck:!1,sx:{fontFamily:'Monaco, Menlo, "Ubuntu Mono", monospace',fontSize:"14px"},size:"small",border:"inputBorder"}),s&&Object.values(h).some((e=>e.length>0))&&O.current&&(0,u.jsx)(a.Drop,{target:O.current,align:{top:"bottom",left:"left"},background:"mainBackgroundSecondary",border:"borderSecondary",round:1,overflow:"auto",height:{min:50,max:160},onClickOutside:p,onEsc:p,stretch:"width",children:(0,u.jsx)(a.Tabs,{background:"dropdown",selected:y,onChange:m,padding:[2,0],children:Object.entries(h).filter((e=>{let[,t]=e;return t.length>0})).map((e=>{let[n,o]=e;const{title:i=n,color:l="text"}=Cr[n]||Cr.default;return(0,u.jsx)(a.Tab,{label:i,children:(0,u.jsx)(a.Box,{height:{min:50,max:160},overflow:"auto",padding:[2,0,0],children:(0,u.jsx)(a.Flex,{column:!0,gap:1,children:o.map(((e,o)=>(0,u.jsxs)(a.Flex,{alignItems:"center",gap:3,padding:[1,2],cursor:"pointer",onClick:()=>(e=>{const n=t.slice(0,b),o=t.slice(b),i=n.split(/\s+/);i[i.length-1]=e.insertText;const l=i.join(" "),c=(l+o).replace(/\s+/g," ").replace(/^\s+/,"");r(c),p(),setTimeout((()=>{if(O.current){O.current.focus();const e=l.length;O.current.setSelectionRange(e,e),g(O.current.selectionStart||0)}}),10)})(e),_hover:{background:"selected"},children:[(0,u.jsx)(wr,{color:l,children:e.symbol}),(0,u.jsx)(a.TextSmall,{as:a.Box,color:"textDescription",children:e.description})]},"".concat(n,"-").concat(e.symbol,"-").concat(o))))})})},n)}))})})]})};Er.Alert=e=>(0,u.jsx)(Er,xr(xr({},e),{},{isAlert:!0}));const Sr=Er;function Mr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const kr=[{value:"B",label:"Bytes",multiplier:1},{value:"KiB",label:"KiB",multiplier:1024},{value:"MiB",label:"MiB",multiplier:Math.pow(1024,2)},{value:"GiB",label:"GiB",multiplier:Math.pow(1024,3)},{value:"TiB",label:"TiB",multiplier:Math.pow(1024,4)}],Ir=e=>{const{scales:t}=e.options||{},r=t?kr.filter((e=>{let{value:r}=e;return t.includes(r)})):kr;return(0,u.jsx)(fr,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Mr(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({scale:r},e))};function Tr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Fr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Tr(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const zr=e=>{var t;return(0,u.jsx)(Ir,Fr(Fr({},e),{},{defaultScale:null===(t=e.options)||void 0===t?void 0:t.scale}))};var Br=r(22337);function Lr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Lr(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Nr=["integer","number"],Rr=e=>{let{value:t,type:r,disabled:n,onChange:o,onBlur:i,placeholder:l,schema:c,rawErrors:s,containerStyles:d}=e;const p=r?{type:r}:(e=>{let t="text";const{minimum:r,maximum:n,multipleOf:o}=e;return(Nr.includes(e.type)||Array.isArray(e.type)&&e.type.some((e=>Nr.includes(e))))&&(t="number"),_r(_r(_r({type:t},null===r||isNaN(r)?{}:{min:r}),null===n||isNaN(n)?{}:{max:n}),null===o||isNaN(o)?"number"===e.type?{step:"0.01"}:{}:{step:o})})(c),h=((e,t)=>"number"===t?null!==e&&void 0!==e?e:"":e||"")(t,p.type);return(0,u.jsx)(a.TextInput,_r({value:h,placeholder:l,onChange:e=>{var t;return o(null===(t=e.target)||void 0===t?void 0:t.value)},onBlur:i,disabled:n,error:!(null===s||void 0===s||!s.length),hideErrorMessage:!0,border:"inputBorder",size:"small",containerStyles:d},p))};var Wr=r(66188);function Hr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ur(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hr(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const qr=(0,f.default)(Br.gc).withConfig({displayName:"passwordWidget__StyledIcon",componentId:"sc-6o8r4r-0"})(["position:absolute;right:8px;top:50%;transform:translateY(-50%);cursor:pointer;"]),$r=(0,bt.A)(qr),Vr=e=>{const[t,r]=(0,D.A)(),n=(0,c.useMemo)((()=>({type:t?"text":"password"})),[t]),o=(0,c.useMemo)((()=>({icon:t?Wr.k6j:Wr.pS3,tooltip:t?"Hide password":"Show password"})),[t]);return(0,u.jsxs)(a.Flex,{position:"relative",children:[(0,u.jsx)(Rr,Ur(Ur({containerStyles:{width:"100%"}},n),e)),(0,u.jsx)($r,Ur({color:"text",onClick:r},o))]})};function Gr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gr(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Zr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const Yr=e=>(0,u.jsx)(Rr,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zr(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zr(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({type:"url"},e)),Qr=e=>{var t;let{id:r,value:n,registry:o}=e;const i=(0,se.n)("id"),l=(0,lr.R7)(i),s=(e=>{if(!e)return 0;const t=e.match(/(?:^|_)rules_(\d+)(?=_|$)/);return t?parseInt(t[1],10):0})(r),d=null===(t=o.formContext.formData)||void 0===t||null===(t=t.rules[s])||void 0===t||null===(t=t.config)||void 0===t?void 0:t.match;d||console.warn("[dyncfg] UnitsPlaceholderWidget could not find context field. Check for schema changes.");const p=null===d||void 0===d?void 0:d.on,h=(0,c.useMemo)((()=>{var e;return p&&(null===(e=l[p])||void 0===e?void 0:e.units)||n}),[l,p,n]);return(0,u.jsx)(a.Flex,{height:6,alignItems:"center",padding:[0,2],border:{side:"all",color:"border"},round:.5,children:(0,u.jsx)(a.Text,{"data-id":"dyncfg-punits-placeholder",children:h})})},Jr={TextWidget:Rr,CheckboxWidget:ir,SelectWidget:sr,RadioWidget:e=>{let{value:t,disabled:r,onChange:n,uiSchema:o,options:i}=e;const l=o[Zt.ce],s=(null===l||void 0===l?void 0:l.enumOptions)||(null===i||void 0===i?void 0:i.enumOptions),d=null===l||void 0===l?void 0:l.inline,p="buttonGroup"===(null===l||void 0===l?void 0:l.flavour),h=(0,c.useMemo)((()=>Kr({gap:2},d?{alignItems:"center"}:{column:!0})),[d]);if(p){const e=s.map((e=>{var t;return Kr(Kr({},e),{},{title:null===(t=e.schema)||void 0===t?void 0:t.description})}));return(0,u.jsx)(a.ButtonGroup,{items:e,value:t,onChange:n,buttonProps:{type:"button",small:!0}})}return s?(0,u.jsx)(a.Flex,Kr(Kr({},h),{},{children:s.map((e=>{var o;return(0,u.jsx)(a.RadioButton,{checked:t===e.value,onChange:()=>n(e.value),disabled:r,children:(0,u.jsx)("label",{title:null===e||void 0===e||null===(o=e.schema)||void 0===o?void 0:o.description,children:e.label})},e.value)}))})):null},TextareaWidget:or.A,PasswordWidget:Vr,URLWidget:Yr,ContextWidget:ur,alertExpressionWidget:Sr.Alert,expressionBuilderWidget:Sr,durationWidget:jr,memorySizeWidget:zr,unitsPlaceholder:Qr};var Xr=r(62718),en=r(9381);const tn=["children"];function rn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function nn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rn(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const on=(0,f.default)(a.Box).withConfig({displayName:"formItem__Grid",componentId:"sc-2g4dwa-0"})(["display:grid;grid-template-columns:repeat(2,1fr);"]),ln=(0,f.default)(O.Ay).withConfig({displayName:"formItem__Form",componentId:"sc-2g4dwa-1"})(["display:flex;flex-direction:column;justify-content:space-between;height:100%;overflow-y:auto;scrollbar-gutter:stable;padding-bottom:16px;"]),cn=e=>{let{children:t}=e,r=(0,o.A)(e,tn);const n=(()=>{const e=document.getElementById(m.QY);return e?"".concat(e.getBoundingClientRect().height-75,"px"):"100%"})();return(0,u.jsx)(a.Flex,nn(nn({height:n,column:!0},r),{},{children:t}))},sn=function(){let{id:e,node:t,isNewItem:r,formState:n=m.bP,submitMethod:o,setIsDirty:i=g(),setError:l=g()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const a=(0,c.useRef)(0),d=(0,c.useRef)(),{entityProps:f={}}=(0,s.SU)(),{cmds:b=[]}=f,O=b.includes("userconfig"),v=(e||"").startsWith(m.Sd),[x,{height:w}]=(0,y.A)(),{terminalSectionOpen:P,evaluationSectionOpen:D,toggleTerminal:A,toggleEvaluation:C}=(()=>{const[e,t]=(0,c.useState)({terminalSectionOpen:!0,evaluationSectionOpen:!0}),r=(0,c.useCallback)((()=>{t((e=>nn(nn({},e),{},{terminalSectionOpen:!e.terminalSectionOpen})))}),[t]),n=(0,c.useCallback)((()=>{t((e=>nn(nn({},e),{},{evaluationSectionOpen:!e.evaluationSectionOpen})))}),[t]);return nn(nn({},e),{},{toggleTerminal:r,toggleEvaluation:n})})(),E=(0,c.useMemo)((()=>v?{max:"".concat(D?w/2:w-100,"px")}:"auto"),[v,w,D]),{isLoading:S,loaded:M,formData:k,setFormData:I,refreshData:T,schema:F,resourcesError:z,errors:B,onChange:L,onSubmit:_,onError:N}=nr({id:e,node:t,formState:n,submitMethod:o,setIsDirty:i,setError:l,stripUnknownFields:!1});(0,c.useEffect)((()=>(a.current=Date.now(),()=>{a.current=0})),[]);const R=(0,c.useCallback)((e=>{const t=Date.now()-a.current,r=0===a.current||t<500;L(e,r)}),[L]);return M?z?(0,u.jsx)(h,{id:e,error:z}):(0,u.jsx)(p.Ay,{feature:"DyncfgForm",id:e,isNewItem:r,children:(0,u.jsx)(en.A,{children:(0,u.jsxs)(on,{children:[(0,u.jsx)(cn,{"data-testid":"dyncfg-form-item-form-section",padding:[4,4,0,4],border:{side:"right",color:"border"},children:(0,u.jsx)(ln,{ref:d,className:"dyncfg-form",liveValidate:!0,disabled:S,schema:(null===F||void 0===F?void 0:F.jsonSchema)||{},uiSchema:(null===F||void 0===F?void 0:F.uiSchema)||{},formData:k,formContext:{setFormData:I,formData:k},templates:Qt,widgets:Jr,validator:j.Ay,onError:N,onChange:R,onSubmit:_,children:(0,u.jsx)(V,{id:e,formRef:d,loading:S,errors:B,refreshData:T})})}),(0,u.jsxs)(cn,{ref:x,"data-testid":"dyncfg-form-item-terminal-section",padding:[4,0,0,0],overflow:{vertical:"auto"},children:[(0,u.jsx)(le,{isOpen:P,toggle:A,id:e,node:t,canGetUserConfig:O,formData:k,height:E}),v?(0,u.jsx)(ae,{isOpen:D,toggle:C,formData:k}):null]})]})})}):(0,u.jsx)(Xr.qE,{})},an=["id","node"];function dn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?dn(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const un=e=>{let{id:t,node:r}=e,n=(0,o.A)(e,an);const{setFormData:i}=(0,s.SU)(),a=(0,l.SW)({id:t,node:r}),{loaded:d,value:p,hasError:f,error:b,refresh:g}=a,[y,m]=(0,l.Jb)({id:t,node:r});return(0,c.useEffect)((()=>{y&&(g(),m(!1))}),[y,g,m]),(0,c.useEffect)((()=>{d&&!f&&i(p)}),[d,f,i,p]),d?f?(0,u.jsx)(h,{id:t,error:b}):(0,u.jsx)(sn,pn(pn({},n),{},{id:t,node:r,formState:a})):null},hn=["id","formData","isNewItem"];function fn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fn(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const gn=e=>{let{id:t,formData:r,isNewItem:n}=e,c=(0,o.A)(e,hn);const{node:s}=(0,i.Z)(),a=(0,l.Nj)({id:t,node:s}),d=(0,l.xS)({id:t,node:s});return n?(0,u.jsx)(sn,bn(bn({},c),{},{formData:r,id:t,node:s,isNewItem:n,submitMethod:a})):(0,u.jsx)(un,bn(bn({},c),{},{id:t,node:s,submitMethod:d}))},yn=(0,c.memo)(gn)},73980(e,t,r){r.d(t,{A:()=>Ae});var n=r(80045),o=r(64467),i=(r(98992),r(54520),r(3949),r(62953),r(96540)),l=r(40961),c=r(73937),s=r(91421),a=r(63872),d=r(23226),p=r(6304),u=r(67012),h=r(63950),f=r.n(h),b=r(4575),g=r(62718),y=r(42358),m=(r(27495),r(25440),r(81454),r(25509),r(65223),r(60321),r(41927),r(11632),r(64377),r(66771),r(12516),r(68931),r(52514),r(35694),r(52774),r(49536),r(21926),r(94483),r(16215),r(45087)),O=r(74891),j=r(49165),v=r(21885),x=r(65637),w=r(98289),P=r(87083),D=r(19148),A=r(74848);const C=["source","sourceType"];function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const M=(0,O.A)(y.Flex),k=(0,O.A)(y.Checkbox),I=(0,O.A)(D.RK),T=(0,i.memo)((e=>{let{source:t="",sourceType:r}=e;const n=t.split(",");return(0,A.jsxs)(y.Flex,{column:!0,gap:2,children:[(0,A.jsxs)(y.Flex,{alignItems:"center",gap:1,children:[(0,A.jsx)(y.Text,{strong:!0,children:"Source type"}),(0,A.jsx)(y.Pill,{children:r})]}),(0,A.jsx)(y.Flex,{column:!0,gap:1,children:n.length?n.map((e=>(0,A.jsx)(y.TextSmall,{children:e},e))):null})]})})),F=(0,i.memo)((e=>{let{source:t,sourceType:r}=e,o=(0,n.A)(e,C);const l=(0,i.useMemo)((()=>v.V6[r]),[r]);if(!l)return null;const{icon:c}=l;return(0,A.jsx)(m.A,{isBasic:!0,content:(0,A.jsx)(T,{source:t,sourceType:r}),children:(0,A.jsx)(y.Flex,{children:(0,A.jsx)(y.Icon,S({name:c},o))})})})),z=(0,i.memo)((e=>{let{type:t,status:r}=e;const n=(0,i.useMemo)((()=>v.bM[r]),[r]);if(!n)return null;const{label:o,color:l,icon:c}=n;return"template"!==t?(0,A.jsx)(M,{width:{min:6},gap:1,padding:[1],round:!0,alignItems:"center",justifyContent:"center",tooltip:o,children:(0,A.jsx)(y.Icon,{name:c,height:"16px",color:l})}):null})),B=(0,i.memo)((()=>(0,A.jsx)(y.Flex,{width:{max:100},children:(0,A.jsxs)(y.Text,{children:["You can submit your changes to another node, or to multiple nodes by selecting"," ",(0,A.jsx)(y.Text,{strong:!0,children:"Submit to multiple nodes"})," button."]})}))),L=()=>{const{options:e}=(0,c.Z)(),[t]=(0,P.Oj)({extraKey:v.q4,merge:!1}),r=t.length?e.filter((e=>{let{value:r}=e;return t.includes(r)})):e,n=r.length?r[0].label:"0",o=r.length>1?"and ".concat(r.length-1," more"):"",i=r.length>1?"nodes":"node";return(0,A.jsxs)(y.Flex,{"data-testid":"dyncfg-on-node",gap:1,alignItems:"center",children:[(0,A.jsx)(y.TextBig,{children:"on"}),(0,A.jsxs)(M,{padding:[1],background:"mainBackground",tooltip:1===r.length?(0,A.jsx)(B,{}):null,tooltipProps:{isBasic:!0,plain:!1},children:[(0,A.jsx)(D.l4,{strong:!0,children:n})," "]}),(0,A.jsxs)(y.TextBig,{children:[(0,A.jsx)(y.TextBig,{strong:!0,children:"".concat(o," ")}),i]})]})},_=e=>{let{title:t,containerIsOpen:r,type:n,source:o,sourceType:l,status:a,templateChildren:d={},onCollapseExpand:p,userDisabled:u}=e;const h=(0,i.useRef)(),{color:f}=v.g7[n]||v.g7.default,g=(0,i.useMemo)((()=>u||"disabled"===a?"disabled":f),[u,a,f]),{node:m}=(0,c.Z)(),{path:O}=(0,x.A)(m),{open:P,isNewItem:C,formData:E,setFormData:M,entityProps:T={}}=(0,b.SU)(),{cmds:B=[]}=T,_=B.includes("userconfig"),{name:N}=E||{},R=(0,j.A)({id:t,node:m}),{items:W,toggle:H,isSelected:U,setItems:q}=(0,s.H2)({node:m,path:O}),$="template"===n,V=Object.keys(d||{}),G=!!Object.keys(d||{}).length,K=(0,i.useMemo)((()=>V.filter((e=>W.includes(e)))),[V,W]),Z=(0,i.useMemo)((()=>K.length===V.length),[K.length,V.length]),Y=(0,i.useMemo)((()=>K.length>0&&K.length<V.length),[K.length,V.length]),Q=(0,i.useCallback)((e=>{const t=(e.target.value||"").replace(/ /g,"_");M((e=>S(S({},e),{},{name:t}))),_&&R(E,t||"test")}),[E,M,_,R]),J=(0,i.useCallback)((()=>{$?q((e=>Z?e.filter((e=>!V.includes(e))):Array.from(new Set([...e,...V])))):H(t)}),[t,$,V,H,q]);return(0,i.useEffect)((()=>{h.current&&h.current.focus()}),[h.current]),(0,A.jsxs)(y.Flex,{gap:2,alignItems:"center",padding:[0,0,0,$?0:2],children:[!!$&&(0,A.jsx)(I,{noWrapper:!0,name:"chevron_right",color:"textLite",rotate:r?3:1,onClick:p,tooltip:r?"Hide children":"Show children",hasTemplateChildren:G}),P||C?null:(0,A.jsx)(y.Flex,{padding:[0,1,0,0],children:(0,A.jsx)(k,{checked:$?G&&Z:U(t),indeterminate:$&&!!Y,onChange:J,tooltip:$?G?"Select all":null:"Select",disabled:$&&!G})}),(0,A.jsx)(z,{type:n,status:a}),(0,A.jsx)(F,{source:o,sourceType:l,color:g}),C?null:(0,A.jsx)(D.QP,{color:g,children:(0,w.J3)(t)}),C&&P?(0,A.jsx)(y.TextInput,{inputRef:h,"data-testid":"dyncfg-config-item-name",width:65,value:N,onChange:Q,placeholder:"Add configuration name",error:C&&!(null!==E&&void 0!==E&&E.name),hideErrorMessage:!0}):null,"template"!==n&&P?(0,A.jsx)(L,{}):null]})},N=(0,i.memo)(_);var R=r(76661),W=r(93598),H=r(94404);function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const q=(0,H.A)(W.A),$=function(){let{title:e,buttonProps:t={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[,r]=(0,s.QH)(),n=(0,R.A)(),{isLoading:l,entityProps:c}=(0,b.SU)(),{cmds:a=[]}=c||{},d=l,p=(0,i.useCallback)((()=>{r(n({template:e,entityProps:c}))}),[e,c,n,r]);return a.includes("add")?(0,A.jsx)(q,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({edit:!0,feature:"DyncfgTemplate",payload:{id:e,label:"Add job"},tooltip:"Add a new configuration item",icon:"plus",iconWidth:18,iconHeight:18,onClick:p,disabled:d},t)):null};r(9391);var V=r(12215),G=r(41395);function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?K(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):K(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Y=(0,H.A)(W.A),Q=e=>{let{id:t,enable:r,open:n,onDecline:o,onConfirm:i}=e;const l=r?"enable":"disable";return n?(0,A.jsx)(y.ConfirmationDialog,{title:"".concat((0,G.Zr)(l)," item?"),handleConfirm:i,handleDecline:o,confirmLabel:"Yes ".concat(l),declineLabel:"No",isConfirmPositive:!!r,message:(0,A.jsxs)(y.Flex,{column:!0,gap:2,children:[(0,A.jsxs)(y.TextBig,{children:["You are about to ",l," ",(0,A.jsx)(D.QP,{strong:!0,children:t})," module and all its configurations."]}),(0,A.jsx)(y.TextBig,{children:"Are you sure?"})]})}):null},J=e=>{let{id:t,userDisabled:r,buttonProps:n={},cmds:o=[]}=e;const{isLoading:l,startLoading:a,stopLoading:d}=(0,b.SU)(),{node:u}=(0,c.Z)(),h=(0,s.DP)({id:t,node:u}),f=(0,s.O_)({node:u,id:t}),[g,y]=(0,V.A)(),[m,O]=(0,i.useState)(!r),[j,,v,x]=(0,p.A)(),w=(0,i.useCallback)((()=>{x(),a(),h(m).then((e=>{f(),g({successMessage:"Successfully ".concat(m?"enabled":"disabled"," module")})(e)})).catch((e=>{y({header:"Couldn't ".concat(m?"enabled":"disabled"," module")})(e)})).finally((()=>{d()}))}),[m,x,a,h,f,d]),P=(0,i.useMemo)((()=>r?!o.includes("enable"):!o.includes("disable")),[r,o]),D=(0,i.useCallback)((e=>{l||P||(O(e),v())}),[l,P,v]),C=(0,i.useMemo)((()=>Z(Z({edit:!0,feature:"DyncfgTemplate",payload:{id:t,label:r?"Enable":"Disable"},isLoading:l,disabled:l||P},n),r?{tooltip:P?"You cannot enable this module":"Enable this module",icon:"switch_off",iconColor:P?"textLite":"disabled",onClick:()=>D(!0)}:{tooltip:P?"You cannot disable this module":"Disable this module",icon:"switch_off",iconColor:P?"textLite":"success",onClick:()=>D(!1),danger:!0})),[t,r,l,n,P,D]);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Y,Z({},C)),(0,A.jsx)(Q,{id:t,enable:m,open:j,onDecline:x,onConfirm:w})]})},X="success",ee={iconColor:X,flavour:"borderless",color:X},te=e=>{let{title:t,userDisabled:r,cmds:n}=e;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)($,{title:t,buttonProps:ee}),(0,A.jsx)(J,{id:t,userDisabled:r,buttonProps:ee,cmds:n})]})};var re=r(10094);const ne=e=>{let{title:t,open:r,onEdit:n,onCollapseExpand:o,type:i,userDisabled:l,isOpenEntity:c,isEditFromState:s,cmds:a}=e;return(0,A.jsx)(y.Flex,{gap:2,alignItems:"center",children:"template"===i?(0,A.jsx)(te,{title:t,userDisabled:l,cmds:a}):(0,A.jsx)(re.A,{title:t,open:r,onEdit:n,onCollapseExpand:o,isOpenEntity:c,isEditFromState:s})})};var oe=r(3941);const ie=["path","containerIsOpen","onClick"];function le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ce(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?le(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const se=(0,O.A)(y.Icon),ae={vertical:2,horizontal:4},de=e=>{let{path:t,containerIsOpen:r,onClick:o}=e,i=(0,n.A)(e,ie);return(0,A.jsxs)(y.Flex,ce(ce({gap:2,alignItems:"center",onClick:o,cursor:"pointer"},i),{},{children:[(0,A.jsx)(se,{noWrapper:!0,name:"chevron_right",color:"textLite",rotate:r?3:1,tooltip:r?"Hide children":"Show children"}),(0,A.jsx)(D.QP,{strong:!0,children:t})]}))},pe=e=>{let{frequency:t=20}=e;const[r,n]=(0,i.useState)(t),[o,l]=(0,i.useState)(0),c=(0,i.useCallback)((()=>{100!==o?l((e=>e+5)):n(void 0)}),[l,n]);return(0,oe.A)(c,r),(0,A.jsxs)(D.gX,{"data-testid":"dyncfg-header-loader-container",children:[(0,A.jsx)(y.Text,{children:"Loading schema..."}),(0,A.jsx)(y.ProgressBar,{background:"border",border:"none",color:["green","netdata"],containerWidth:"100%","data-testid":"dyncfg-schema-loading-progress-bar",height:1,width:"".concat(o,"%")})]})},ue=e=>{let{flavour:t,title:r,open:n,toggleOpen:o,onEdit:l,level:c,fullPage:a,entityProps:d={},isOpenEntity:p,isEditFromState:u,schemaLoaded:h}=e;const{vertical:f,horizontal:b}=ae,g=(0,i.useMemo)((()=>[f,b,f,n&&a?b:b*c]),[c,n,a]),m="path"===t,{ids:O,toggle:j}=(0,s.$K)(),x=(0,i.useMemo)((()=>!O.includes(r)),[O,r]),w=(0,i.useCallback)((()=>{j(r),"template"!==(null===d||void 0===d?void 0:d.type)&&o()}),[r,j,o,null===d||void 0===d?void 0:d.type]);return(0,A.jsx)(y.Flex,{height:"".concat(v.FL,"px"),position:"relative",alignItems:"center",justifyContent:"between",padding:g,isOpenEntity:p,border:{side:"bottom",color:"border"},children:m?(0,A.jsx)(de,{path:r,containerIsOpen:x,onClick:w}):(0,A.jsx)(A.Fragment,{children:n&&!h?(0,A.jsx)(pe,{}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(N,ce({title:r,containerIsOpen:x,onCollapseExpand:w},d)),(0,A.jsx)(ne,ce({title:r,open:n,onEdit:l,onCollapseExpand:w,isOpenEntity:p,isEditFromState:u},d))]})})})},he=["title","isLoading","fullPage","entityProps","setIsDirty","flavour","handleEditClick","open","toggleOpen","level","isEditFromState","setError","schema","schemaLoaded","renderChildren"];function fe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function be(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const ge=e=>{let{collapsibleProps:t,loaderProps:r,level:n,setIsDirty:o,setError:i,showLoader:l,renderChildren:c}=e;const{open:s}=t||{};return(0,A.jsxs)(A.Fragment,{children:[s?c({level:n+1,setIsDirty:o,setError:i}):null,l?(0,A.jsx)(y.Flex,be(be({},r),{},{children:(0,A.jsx)(g.tW,{})})):null]})},ye=e=>{let{title:t,isLoading:r,fullPage:o,entityProps:l,setIsDirty:c,flavour:s,handleEditClick:a,open:d,toggleOpen:p,level:u,isEditFromState:h,setError:b,schema:g,schemaLoaded:m,renderChildren:O=f()}=e,j=(0,n.A)(e,he);const v="path"===s,x=["single","job"].includes(null===l||void 0===l?void 0:l.type),w="job"===(null===l||void 0===l?void 0:l.type),P="path"!==s&&d&&r,{containerProps:D,collapsibleProps:C,loaderProps:E}=(0,i.useMemo)((()=>({containerProps:be(be(be(be({},d&&o?{position:"fixed",zIndex:"45",top:"5vh",left:"5vw",width:"90vw",height:"90vh"}:{position:"relative"}),d&&x?{border:{side:"all",color:"border"}}:{}),o?{}:{height:"100%"}),{},{background:x&&d?"modalBackground":"mainBackground",round:!0}),collapsibleProps:{level:u,open:d,duration:0,flavour:s,fullPage:o,isJob:w},loaderProps:{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:".9",zIndex:"100"}})),[d,o,x,u,s,w]),S={collapsibleProps:C,loaderProps:E,level:u,setIsDirty:c,setError:b,showLoader:P,renderChildren:O};return(0,A.jsxs)(y.Flex,be(be(be({"data-testid":"dyncfg-config-item-container-".concat(t),column:!0},D),j),{},{children:[(0,A.jsx)(ue,{flavour:s,open:d,toggleOpen:p,title:t,onEdit:a,level:u,fullPage:o,entityProps:l,isOpenEntity:d&&!!x,isEditFromState:h,schemaLoaded:m},d),!v&&m&&g?(0,A.jsx)(ge,be({},S)):null]}))},me=e=>{let{open:t,onDecline:r,onConfirm:n}=e;return t?(0,A.jsx)(y.ConfirmationDialog,{title:"Discard changes?",handleConfirm:n,handleDecline:r,confirmLabel:"Yes, discard",declineLabel:"No, keep editing",backdropContainerProps:{zIndex:"120"},message:(0,A.jsxs)(y.Flex,{column:!0,gap:2,children:[(0,A.jsx)(y.TextBig,{children:"If you exit Edit mode before submit, your changes will be lost."}),(0,A.jsx)(y.TextBig,{children:"Are you sure?"})]})}):null},Oe=e=>(0,i.useEffect)((()=>{if(!e)return;const t=t=>{"Escape"===t.code&&e(t)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)}),[e]),je=e=>{let{title:t,open:r,isLoading:n,isDirty:o,setIsDirty:l,toggle:c,refresh:a,refreshUserConfig:d,entityProps:u,error:h}=e;const f=null===u||void 0===u?void 0:u[v.D9],b=["single","job"].includes(null===u||void 0===u?void 0:u.type),[,g]=(0,s.QH)(),[y,,m,O]=(0,p.A)(),j=(0,i.useCallback)((()=>{o&&(l(!1),c(),O()),a(),d(),g(null)}),[t,g,o,l,c,a,d,O]),x=(0,i.useCallback)((e=>{n||(o?h||e?j():m():(c(),f&&g(null)))}),[n,f,o,h,j,m,c]);return Oe((e=>{"Escape"===e.code&&r&&b&&(e.preventDefault(),x())})),{confirmationOpen:y,closeConfirmation:O,onConfirm:j,onClick:x}},ve=["flavour","title","level","entityProps","isNewItem","isOpen","isEditFromState","renderChildren","formData"];function xe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function we(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(r),!0).forEach((function(t){(0,o.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const Pe=(e,t)=>{const r=["schema_update"].includes(e.lastAction);switch(t.type){case"expand":return we(we({},e),{},{expanded:!0,lastAction:"expand"});case"minimize":return we(we({},e),{},{expanded:!1,lastAction:"minimize"});case"schema_update":return we(we({},e),{},{expanded:r?t.schemaFullPage:e.expanded},r?{lastAction:"schema_update"}:{})}},De=e=>{let{id:t,node:r}=e;const n=(0,s.K_)({id:t,node:r});return(0,i.useEffect)((()=>{n()}),[t,r]),null},Ae=(0,i.memo)((e=>{let{flavour:t="path",title:r="",level:o=1,entityProps:h={},isNewItem:g,isOpen:y,isEditFromState:m,renderChildren:O=f(),formData:j}=e,x=(0,n.A)(e,ve);const w=g?x.id:r,[P,D]=(0,p.A)(g||y),{node:C}=(0,c.Z)(),E=(0,s._O)({node:C,id:r})||h,[S,,M,k]=(0,p.A)(),[I,T]=(0,i.useReducer)(Pe,{expanded:!!g||!!m,lastAction:"schema_update"}),[F,z]=(0,i.useState)(),[B,L]=(0,i.useState)(),{refresh:_}=(0,s.$h)(),{refresh:N}=(0,s.MQ)(),R=["single","job"].includes(null===E||void 0===E?void 0:E.type),W=(0,i.useMemo)((()=>I.expanded),[I.expanded]),[,H]=(0,d.A)(),[,U]=(0,a.A)(),{loaded:q,value:$,error:V}=(0,s.t8)({id:w,node:C}),G=(0,i.useCallback)((e=>{T({type:e?"expand":"minimize"})}),[T]),K=(0,i.useCallback)((e=>{T({type:"schema_update",schemaFullPage:e})}),[T]),{confirmationOpen:Z,closeConfirmation:Y,onConfirm:Q,onClick:J}=je({title:r,open:P,isLoading:S,isDirty:B,setIsDirty:L,refresh:_,refreshUserConfig:N,toggle:D,entityProps:E,error:F}),X=(0,i.useCallback)((e=>{P&&_(),J(e)}),[P,_,J]);(0,i.useEffect)((()=>{P||N()}),[P,N]),(0,i.useEffect)((()=>{q&&$&&!V&&K(!0)}),[q,$,V,K]),(0,i.useEffect)((()=>{V&&(P?X(!0):U({header:"Schema error",message:V}))}),[P,V,X,U]),(0,u.A)((()=>{H(!!P)}),[P]);const ee=we({title:r,isLoading:S,fullPage:W,entityProps:E,setIsDirty:L,flavour:t,handleEditClick:X,open:P,toggleOpen:D,level:o,setError:z,isEditFromState:m,schema:$,schemaLoaded:q,renderChildren:O},x);return(0,A.jsxs)(b.Ay,{id:r,open:P,isNewItem:g,isLoading:S,startLoading:M,stopLoading:k,fullPage:W,setFullPage:G,entityProps:E,isDirty:B,setIsDirty:L,error:F,formData:j,children:[P&&R&&w&&C?(0,A.jsx)(De,{id:w,node:C}):null,P&&q&&!V?(0,l.createPortal)((0,A.jsx)(ye,we(we({},ee),{},{id:v.QY,"data-testid":"in-portal"})),document.body):(0,A.jsx)(ye,we({},ee)),(0,A.jsx)(me,{open:Z,onDecline:Y,onConfirm:Q})]})}))},19148(e,t,r){r.d(t,{QP:()=>s,RK:()=>a,gX:()=>p,l4:()=>d});r(98992),r(54520),r(3949);var n=r(64467),o=r(51510),i=r(42358);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?l(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const s=(0,o.default)(i.TextBig).withConfig({displayName:"styled__StyledTitle",componentId:"sc-16w9sl7-0"})(["font-family:monospace;"]),a=(0,o.default)(i.Icon).attrs((e=>c({opacity:"1",cursor:"pointer"},e))).withConfig({displayName:"styled__StyledTemplateArrow",componentId:"sc-16w9sl7-1"})(["pointer-events:",";opacity:",";cursor:",";"],(e=>{let{hasTemplateChildren:t}=e;return t?"auto":"none"}),(e=>{let{hasTemplateChildren:t}=e;return t?"1":"0"}),(e=>{let{hasTemplateChildren:t}=e;return t?"pointer":"default"})),d=(0,o.default)(i.TextBig).withConfig({displayName:"styled__StyledNodeName",componentId:"sc-16w9sl7-2"})(["font-family:monospace;"]),p=(0,o.default)(i.Flex).attrs((e=>c({position:"absolute",column:!0,gap:1,top:"50%",left:"50%"},e))).withConfig({displayName:"styled__StyledLoaderContainer",componentId:"sc-16w9sl7-3"})(["transform:translate(-50%,-50%);"])},10094(e,t,r){r.d(t,{r:()=>te,A:()=>oe});r(98992),r(54520),r(3949);var n=r(64467),o=r(80045),i=r(51510),l=r(63950),c=r.n(l),s=r(42358),a=r(96540),d=r(4575),p=r(93598),u=r(94404),h=r(74848);function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const b=(0,u.A)(p.A),g=function(){let{id:e,onClick:t,closeMenu:r=c(),buttonProps:o={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{open:i,isLoading:l,entityProps:s}=(0,d.SU)(),{cmds:p=[]}=s||{},u=l,g=p.includes("update")?"Edit configuration":"You have no permissions to edit the configuration",y=(0,a.useCallback)((()=>{t(),r()}),[t,r]);return(0,h.jsx)(b,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({view:!0,forceAccess:i,feature:"DyncfgItem",payload:{id:e,label:i?"Close":"Edit"},tooltip:i?"Close":g,icon:i?"x":"pencilOutline",onClick:y,disabled:u},o))};r(62953);var y=r(91421),m=r(76661),O=r(67200),j=r(98289);function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?v(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const w=(0,O.A)(s.Button),P=function(){let{title:e,template:t={},onCollapseExpand:r=c(),buttonProps:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=(0,j.UE)(e),[,i]=(0,y.QH)(),{cmds:l,user_disabled:s}=t,{isLoading:p,open:u,formData:f,entityProps:b,isNewItem:g}=(0,d.SU)(),O=(0,m.A)(),v=(0,a.useCallback)((()=>{p||(i(O({template:o,formData:f,entityProps:b})),r())}),[p,o,f,b,i,O,r]);return u&&!g&&null!==l&&void 0!==l&&l.includes("add")?(0,h.jsx)(w,x(x({icon:"copy",onClick:v,disabled:p||s},s?{}:{tooltip:"Copy this item and create a new one"}),n)):null};r(9391);var D=r(73937),A=r(19148),C=r(6304),E=r(12215),S=r(3319);function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function k(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?M(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const I=(0,u.A)(p.A),T=e=>{let{id:t,open:r,onDecline:n,onConfirm:o}=e;return r?(0,h.jsx)(s.ConfirmationDialog,{title:"Delete item?",handleConfirm:o,handleDecline:n,confirmLabel:"Yes, delete",declineLabel:"No",backdropContainerProps:{zIndex:"120"},message:(0,h.jsxs)(s.Flex,{column:!0,gap:2,children:[(0,h.jsxs)(s.TextBig,{children:["You are going to completely remove ",(0,h.jsx)(A.QP,{strong:!0,children:t})," and this action cannot be reverted."]}),(0,h.jsx)(s.TextBig,{children:"Are you sure that you want to delete this item?"})]})}):null},F=function(){let{id:e,onOpenConfirmation:t=c(),onCloseConfirmation:r=c(),buttonProps:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{isLoading:o,entityProps:i,startLoading:l,stopLoading:s}=(0,d.SU)(),{type:p,cmds:u=[]}=i||{},{node:f}=(0,D.Z)(),b=(0,y.OU)({id:e,node:f}),[g,m]=(0,E.A)(),O=(0,y.Hj)(),[j,,v,x]=(0,C.A)(),{sendButtonClickedLog:w}=(0,S.A)(),P=o,A=(0,a.useCallback)((()=>{x(),r(),l(),b().then((t=>{g({successMessage:"Successfully deleted configuration"})(t),w({feature:"DyncfgItem",description:"Confirm deletion",id:e}),O()})).catch((e=>{m({header:"Couldn't delete configuration"})(e)})).finally((()=>{s()}))}),[b,x,r,l,s,O,w]),M=(0,a.useCallback)((()=>{o||(v(),t())}),[o,v,t]),F=(0,a.useCallback)((()=>{x(),r()}),[x,r]);return"job"===p&&u.includes("remove")?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(I,k({edit:!0,feature:"DyncfgItem",payload:{id:e,label:"Delete"},icon:"trashcan",onClick:M,disabled:P,tooltip:"Delete"},n)),(0,h.jsx)(T,{id:e,open:j,onDecline:F,onConfirm:A})]}):null};function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}const B=(0,u.A)(p.A),L=function(){let{id:e,template:t={},closeMenu:r=c(),buttonProps:o={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{node:i}=(0,D.Z)(),l=(0,y.ZN)({id:e,node:i}),[s,p]=(0,E.A)(),{isLoading:u,entityProps:f,startLoading:b,stopLoading:g}=(0,d.SU)(),{user_disabled:m}=t,{cmds:O=[]}=f||{},j=(0,y.O_)({node:i,id:e}),v=u||m,x=(0,a.useCallback)((()=>{r(),u||m||(b(),l().then((e=>{s({successMessage:"Successfully restarted configuration"})(e),j()})).catch((e=>{p({header:"Couldn't restart configuration"})(e)})).finally((()=>{g()})))}),[u,m,l,b,j,g,r]);return O.includes("restart")?(0,h.jsx)(B,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({edit:!0,feature:"DyncfgItem",payload:{id:e,label:"Restart"},icon:"refresh",onClick:x,disabled:v,tooltip:"Restart"},o)):null};function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const R=(0,u.A)(p.A),W=e=>{let{id:t,template:r={},closeMenu:n=c(),buttonProps:o}=e;const{isLoading:i,entityProps:l,startLoading:s,stopLoading:u}=(0,d.SU)(),{cmds:f=[],userDisabled:b}=l||{},[g,m]=(0,a.useState)(!b),{node:O}=(0,D.Z)(),{user_disabled:j}=r,v=(0,y.DP)({id:t,node:O}),x=(0,y.O_)({node:O,id:t}),[w,P]=(0,E.A)(),{sendButtonClickedLog:A}=(0,S.A)(),{hidden:C,isDisabled:M,tooltipText:k}=(0,p.j)({edit:!0,tooltip:g?"Disable":"Enable",disabled:i||j}),I=(0,a.useMemo)((()=>N(N({},o),{},{label:g?"Disable":"Enable",payload:{id:t,label:g?"Disable":"Enable"}})),[o,g]),T=(0,a.useCallback)((()=>{m((e=>!e)),n(),s(),v(!g).then((e=>{A({feature:"DyncfgItem",description:g?"Disable item":"Enable item",id:t}),w({successMessage:"Successfully ".concat(g?"disabled":"enabled"," configuration")})(e),x()})).catch((e=>{A({feature:"DyncfgItem",description:"Failed to ".concat(g?"disable":"enable"," item"),id:t}),m((e=>!e)),P({header:"Couldn't ".concat(g?"disable":"enable"," configuration")})(e)})).finally((()=>{u()}))}),[j,g,v,s,m,x,A,n]),F=(0,a.useMemo)((()=>f.includes("enable")),[f]),z=(0,a.useMemo)((()=>f.includes("disable")),[f]);return!C&&F&&z?(0,h.jsx)(R,N({edit:!0,feature:"DyncfgItem",icon:"switch_off",onClick:T,disabled:M,tooltip:k},I)):null};r(37550);function H(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?H(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):H(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const q=(0,r(74891).A)(s.Button),$={small:!0,neutral:!0,tooltip:null,iconHeight:"12px"},V=["restart","remove"],G=["enable","disable"],K=e=>{let{title:t,template:r,isOpenEntity:n,buttonProps:o={}}=e;const i=(0,a.useRef)(),[l,c,,p]=(0,C.A)(!1),[u,,f]=(0,C.A)(!1),{entityProps:b}=(0,d.SU)(),{cmds:g=[]}=b||{},y=(0,a.useMemo)((()=>!!g.some((e=>V.includes(e)))||!(n||!G.every((e=>g.includes(e))))),[g,n]),m=(0,a.useCallback)((()=>{u||p()}),[p,u]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s.Flex,{ref:i,children:(0,h.jsx)(q,U({icon:"nav_dots",onClick:c,tooltip:y?"Item actions":null,disabled:!y},o))}),l&&y&&i.current?(0,h.jsx)(s.Drop,{width:25,target:i.current,align:{top:"bottom",right:"right"},background:"modalTabsBackground",margin:[2,0,0],round:.5,close:p,onClickOutside:m,onEsc:p,children:(0,h.jsxs)(s.Flex,{column:!0,gap:1,padding:[2],children:[(0,h.jsx)(L,{id:t,template:r,closeMenu:p,buttonProps:U(U(U({},o),$),{},{label:"Restart"})}),n?null:(0,h.jsx)(W,{id:t,template:r,closeMenu:p,buttonProps:U(U({},o),$)}),(0,h.jsx)(F,{id:t,onOpenConfirmation:f,onCloseConfirmation:p,buttonProps:U(U(U({},o),$),{},{neutral:!1,danger:!0,iconColor:"error",label:"Delete"})})]})}):null]})};var Z=r(4797);const Y=["open"];function Q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(r),!0).forEach((function(t){(0,n.A)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}const X="text",ee={iconColor:X,flavour:"borderless",color:X,type:"button"},te=(0,i.default)(s.Flex).attrs({alignItems:"center",border:{side:"all",color:"border"},round:!0}).withConfig({displayName:"itemActions__StyledContainer",componentId:"sc-1kpuq1a-0"})([""]),re=(ne=g,e=>{let{open:t}=e,r=(0,o.A)(e,Y);return t?(0,h.jsx)(te,{gap:1,children:(0,h.jsx)(ne,J({},r))}):(0,h.jsx)(ne,J({},r))});var ne;const oe=function(){let{title:e,open:t,isOpenEntity:r,isEditFromState:n,onEdit:o,onCollapseExpand:i=c()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=(0,Z.A)();return(0,h.jsxs)(h.Fragment,{children:[t?n?null:(0,h.jsxs)(te,{gap:1,children:[(0,h.jsx)(P,{title:e,template:l,onCollapseExpand:i,buttonProps:ee}),(0,h.jsx)(L,{id:e,template:l,buttonProps:ee}),(0,h.jsx)(F,{id:e,buttonProps:ee}),r?null:(0,h.jsx)(W,{id:e,template:l})]}):(0,h.jsx)(K,{title:e,template:l,isOpenEntity:r,buttonProps:ee}),(0,h.jsx)(re,{id:e,onClick:o,open:t,buttonProps:ee})]})}},45026(e,t,r){r.d(t,{A:()=>l});var n=r(91421),o=r(21885),i=r(87083);const l=()=>{const{state:e,refresh:t}=(0,n.$h)(),{alertName:r}=e||{},l=(0,i.a7)({extraKey:o.q4}),c=r?"".concat(o.DR).concat(r):null,s=(0,n.hG)({nodeIds:l,id:c}),{nodeId:a,error:d}=s||{};return{alertName:r,nodeIds:l,title:c,nodeId:a,error:d,refresh:t}}},9381(e,t,r){r.d(t,{A:()=>d});var n=r(64467),o=r(96540),i=r(41514),l=r(42358),c=r(74848);class s extends o.Component{constructor(e){super(e),(0,n.A)(this,"handleRetry",(()=>{this.setState({hasError:!1,error:null}),this.props.onRetry&&this.props.onRetry()})),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){(0,i.H)("configuration-error",{error:e.message,stack:t.componentStack,configId:this.props.configId})}render(){return this.state.hasError?this.props.fallback||(0,c.jsx)(a,{onRetry:this.handleRetry,canRetry:!1!==this.props.canRetry,error:this.state.error}):this.props.children}}const a=e=>{let{onRetry:t,canRetry:r=!0,error:n}=e;return(0,c.jsxs)(l.Flex,{column:!0,alignItems:"center",justifyContent:"center",padding:[8],gap:4,children:[(0,c.jsx)(l.Icon,{name:"alert_triangle",size:"large",color:"error"}),(0,c.jsx)(l.Text,{size:"large",strong:!0,children:"Something went wrong"}),(0,c.jsx)(l.Text,{color:"textLite",children:"We're having trouble loading this configuration"}),(0,c.jsxs)(l.Flex,{gap:2,children:[(0,c.jsx)(l.Button,{onClick:t,disabled:!r,children:r?"Try Again":"Max Retries Reached"}),(0,c.jsx)(l.Button,{flavour:"borderless",onClick:()=>window.location.reload(),children:"Reload Page"})]})]})},d=s},87680(e,t,r){r.d(t,{A:()=>l});var n=r(4575),o=r(98289),i=r(96540);const l=function(){let{defaultName:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:t,formData:r,isNewItem:l}=(0,n.SU)();return(0,i.useMemo)((()=>(l?null===r||void 0===r?void 0:r.name:(0,o.J3)(t))||e),[l,null===r||void 0===r?void 0:r.name,t,e])}},4797(e,t,r){r.d(t,{A:()=>s});var n=r(4575),o=r(73937),i=r(91421),l=r(65637),c=r(15505);const s=()=>{const{id:e,isNewItem:t,entityProps:r}=(0,n.SU)(),{node:s}=(0,o.Z)(),{path:a}=(0,l.A)(s),{template:d}=r,p=(0,i.SD)({node:s,path:a,isNewItem:t})(t?d:e),u=(0,i._O)({node:s,id:d});return u?(0,c.Jz)(u):p||{}}},65637(e,t,r){r.d(t,{A:()=>l});r(27495),r(25440),r(98992),r(72577),r(81454),r(8872),r(62953);var n=r(96540),o=r(91421),i=r(41395);const l=e=>{var t;const r=(0,n.useRef)(),{state:l}=(0,o.$h)(),{isAlert:c}=l||{},{loaded:s,value:a,hasError:d}=(0,o.wd)({node:e}),p=(0,n.useMemo)((()=>!s||d?[]:Object.keys((null===a||void 0===a?void 0:a.tree)||{}).reduce(((e,t)=>{t.startsWith("/")||(t="/".concat(t));const r=t.match(/\/[^/]+/g);if(r.length){const t=r[0],n=(0,i.Zr)(t.replace(/^\/?/,""));e.find((e=>e.value===t))||e.push({value:t,label:n})}return e}),[])),[s,a,d]),[u,h]=(0,o.te)();(0,n.useEffect)((()=>{if(!r.current&&c&&p.length&&!u){const e=p.map((e=>{let{value:t}=e;return t})).indexOf("/health");h(e),r.current=!0}}),[c,p,h,r.current]);return{loaded:s&&(!!p||d),tabs:p,selectedTab:u,setSelectedTab:h,path:null===(t=p[u])||void 0===t?void 0:t.value,tree:null===a||void 0===a?void 0:a.tree}}},12215(e,t,r){r.d(t,{A:()=>c,x:()=>l});r(62953);var n=r(63872),o=r(41395),i=r(21885);const l=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.Fn,n=(null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.data)||e||{};try{n=JSON.parse(n)}catch(a){}const{message:l,errorMessage:c,error_message:s}=n;return(0,o.Zr)(l||c||s||r)},c=()=>{const[e,t,,r]=(0,n.A)();return[function(){let{successMessage:t="Successfully saved"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n=>{let{data:{message:o}}=n;(o?r:e)({header:o?"Warning":"Success",text:o||t})}},function(){let{header:e="Error",text:r=i.Fn}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n=>{const o=l(n,r);t({header:e,text:o})}}]}},49165(e,t,r){r.d(t,{A:()=>c});var n=r(87680),o=r(12215),i=r(91421),l=r(96540);const c=function(){let{id:e,node:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,i.y8)({id:e,node:t}),c=(0,n.A)(),{setValue:s,setError:a}=(0,i.MQ)(),d=(0,l.useRef)();return(0,l.useCallback)(((e,t)=>{d.current&&(clearTimeout(d.current),d.current=null);const n=null===t?t:t||c;d.current=setTimeout((()=>{r({name:n,payload:e}).then((e=>s(e.data||""))).catch((e=>{a((0,o.x)(e))}))}),500)}),[r,c,s,a])}}}]);