@ansible/ansible-ui-framework 2.4.445 → 2.4.446
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -1
- package/index.umd.cjs +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -41875,7 +41875,7 @@ function qAe(e) {
|
|
|
41875
41875
|
control: y,
|
|
41876
41876
|
formState: { isSubmitting: _, isValidating: b },
|
|
41877
41877
|
resetField: x
|
|
41878
|
-
} = La(), [S, w] = he(!1), O = fe(() => w(
|
|
41878
|
+
} = La(), [S, w] = he(!1), O = fe(() => w(!S), [S]), [C] = Pt();
|
|
41879
41879
|
return /* @__PURE__ */ p.jsx(
|
|
41880
41880
|
Al,
|
|
41881
41881
|
{
|
|
@@ -41913,6 +41913,9 @@ function qAe(e) {
|
|
|
41913
41913
|
onSelect: $,
|
|
41914
41914
|
isOpen: S,
|
|
41915
41915
|
onToggle: O,
|
|
41916
|
+
onClear: d ? void 0 : () => {
|
|
41917
|
+
A(null), w(!1);
|
|
41918
|
+
},
|
|
41916
41919
|
maxHeight: 280,
|
|
41917
41920
|
validated: E ? "error" : void 0,
|
|
41918
41921
|
isDisabled: u || f || _,
|
package/index.umd.cjs
CHANGED
|
@@ -480,7 +480,7 @@ ${e.value}
|
|
|
480
480
|
color: var(--pf-c-form__helper-text--m-error--Color);
|
|
481
481
|
font-size: var(--pf-c-form__helper-text--FontSize);
|
|
482
482
|
`;function exe(e){const{t}=yt(),{handleCopy:n,handleDownload:r,handleUpload:i,allowCopy:a,allowDownload:o,allowUpload:l,toggleLanguages:s,setLanguage:u,selectedLanguage:c,errors:f,name:d}=e,h=[];a&&h.push(v.jsx(C.Tooltip,{content:t("Copy"),children:v.jsx(Rd,{id:"copy-button","aria-label":t("Copy to clipboard"),icon:v.jsx(Ce.CopyIcon,{}),type:"button",onClick:()=>n()},"copy-button")},"copy-file")),l&&h.push(v.jsx(C.Tooltip,{content:t("Upload"),children:v.jsx(Rd,{id:"upload-button","aria-label":t("Upload from file"),icon:v.jsx(Ce.UploadIcon,{}),type:"button",onClick:()=>i()},"upload-button")},"upload-file")),o&&h.push(v.jsx(C.Tooltip,{content:t("Download"),children:v.jsx(Rd,{id:"download-button","aria-label":t("Download file"),icon:v.jsx(Ce.DownloadIcon,{}),type:"button",onClick:()=>r()},"download-button")},"download-file"));const g=(s==null?void 0:s.map(p=>v.jsx(Rd,{id:`toggle-${p}`,"aria-label":t("Toggle to {{language}}",{language:p}),isSelected:c===p,isDisabled:!!f[d],text:p,type:"button",onChange:()=>u(p)},p)))||[];return v.jsxs(C.Flex,{justifyContent:{default:"justifyContentSpaceBetween"},children:[v.jsx(C.FlexItem,{children:v.jsx(C.ToggleGroup,{isCompact:!0,children:h})}),v.jsx(C.FlexItem,{align:{default:"alignRight"},children:v.jsx(C.ToggleGroup,{isCompact:!0,children:g})})]})}function txe(e){const{t}=yt(),{allowCopy:n=!0,allowDownload:r=!0,allowUpload:i=!0,defaultExpanded:a,isExpandable:o,isReadOnly:l,isRequired:s,label:u,name:c,toggleLanguages:f,validate:d,...h}=e,{formState:{isSubmitting:g,isValidating:p,errors:y},setError:_,clearErrors:b,getValues:S,control:O,setValue:w}=hi(),[A,T]=x.useState("yaml"),[k,j]=x.useState(!a),N=x.useRef(null),M=bh(),{writeToClipboard:E}=$b(),I=e.id??c.split(".").join("-");x.useEffect(()=>{y[c]||b(c)},[y,c,b]);const D=x.useCallback(Z=>{const q=S(c);if(!(Z!=="json"&&Z!=="yaml"||!q)){if(h_e(q))return Z==="json"?w(c,q):w(c,VE(q));if(d_e(q))return Z==="json"?w(c,q):w(c,VE(JSON.stringify(q)));Z==="json"?w(c,f_e(q)):w(c,q)}},[S,c,w]),W=x.useCallback(Z=>{try{D(Z),T(Z)}catch(q){q instanceof Error?_(c,{message:q.message}):_(c,{message:t("Invalid syntax")})}},[D,c,_,t]),X=x.useCallback(()=>{E(S(c))},[S,c,E]),re=x.useCallback(()=>{N.current&&N.current.click()},[]),ne=x.useCallback(()=>{J_e(c||"codeEditorData",S(c));const q={variant:"success",title:t("File downloaded")};M.addAlert(q)},[M,S,c,t]),ee=x.useCallback(Z=>{const q=Z[0],Y=new FileReader;Y.onload=()=>{const G=Y.result;if(typeof G=="string"){w(c,G);const ie={variant:"success",title:t("File uploaded")};M.addAlert(ie)}},Y.onerror=()=>{const G={variant:"danger",title:t("Failed to upload file"),children:t("Unable to upload")};M.addAlert(G)},Y.readAsText(q)},[w,c,t,M]),z=N6({onDrop:ee,multiple:!1});return v.jsx(Ho,{name:c,control:O,shouldUnregister:!0,render:({field:{name:Z,onChange:q,value:Y},fieldState:{error:G}})=>{var se;const ie=[...new Set((se=G==null?void 0:G.message)==null?void 0:se.split(`
|
|
483
|
-
`))],B=Y!=null&&Y!=="";return v.jsx(lu,{...h,label:o?v.jsxs("span",{style:{alignItems:"center"},children:[v.jsx(Ce.AngleRightIcon,{style:{transform:k?"rotate(0deg)":"rotate(90deg)",transition:"transform"},onClick:()=>j(K=>!K),"aria-label":t("Expand or collapse extra variables")}),e.label]}):e.label,id:I,helperTextInvalid:!(d&&p)&&(ie==null?void 0:ie.map(K=>v.jsx(Q_e,{children:K},K))),children:(!o||!k)&&v.jsxs(v.Fragment,{children:[v.jsx(exe,{allowCopy:n,allowDownload:r,allowUpload:i,errors:y,handleCopy:()=>X(),handleDownload:ne,handleUpload:re,name:Z,selectedLanguage:A,setLanguage:W,toggleLanguages:f},"actions-row"),v.jsxs("div",{id:"code-editor-dropzone",...z.getRootProps({disabled:B}),style:{width:"100%",height:"100%"},children:[v.jsx("input",{id:"code-editor-dropzone-input",...z.getInputProps(),ref:N}),v.jsx(X_e,{setError:_,clearErrors:b,id:I,name:Z,language:A,value:Y,onChange:q,isReadOnly:l||g,invalid:!(d&&p)&&(G==null?void 0:G.message)!==void 0})]})]})})},rules:{required:typeof u=="string"&&s===!0?{value:!0,message:`${Nr(u.toLocaleLowerCase())} is required.`}:void 0,validate:e.validate}})}function nxe(e){const{name:t,label:n,labelHelpTitle:r,labelHelp:i,additionalControls:a,placeholderText:o,options:l,footer:s,helperText:u,isDisabled:c,isReadOnly:f,isRequired:d,validate:h,fieldNameToResetOnFieldChange:g}=e,p=cl(e),{control:y,formState:{isSubmitting:_,isValidating:b},resetField:S}=hi(),[O,w]=x.useState(!1),A=x.useCallback(()=>w(k=>!k),[]),[T]=gt();return v.jsx(Ho,{name:t,control:y,shouldUnregister:!0,render:({field:{onChange:k,value:j},fieldState:{error:N}})=>{j===""&&l.length===1&&d&&k(l[0].value);const M=(D,W)=>{var X;k((X=l.find(re=>re.label===W.toString()))==null?void 0:X.value),g&&S(g),w(!1)},E=N!=null&&N.message?h&&b?T.validating:N==null?void 0:N.message:void 0,I=l.find(D=>D.value===j);return v.jsx(C.FormGroup,{id:`${p??""}-form-group`,fieldId:p,label:n,labelIcon:i?v.jsx(Ua,{title:r,help:i}):void 0,labelInfo:a,helperText:u,helperTextInvalid:E,validated:E?"error":void 0,isRequired:d,"data-cy":`${p??""}-form-group`,children:v.jsx(C.Select,{id:p,label:void 0,placeholderText:o,variant:"single","aria-describedby":p?`${p}-form-group`:void 0,selections:I==null?void 0:I.label,onSelect:M,isOpen:O,onToggle:A,maxHeight:280,validated:E?"error":void 0,isDisabled:c||f||_,hasPlaceholderStyle:!0,footer:s,ouiaId:p,"data-cy":p,children:l.map(D=>{const W=jn(D);return v.jsx(C.SelectOption,{id:W,value:D.label,label:D.label,description:D.description,"data-cy":W,children:D.label},D.label)})})})},rules:{required:typeof n=="string"&&d===!0?{value:!0,message:`${Nr(n.toLocaleLowerCase())} is required.`}:void 0,validate:h}})}function rxe(e){const{name:t,id:n,helperText:r,validate:i,additionalControls:a,formLabel:o,labelHelp:l,labelHelpTitle:s,...u}=e,{control:c,formState:{isSubmitting:f,isValidating:d}}=hi();return v.jsx(Ho,{name:t,control:c,shouldUnregister:!0,render:({field:{onChange:h,value:g},fieldState:{error:p}})=>v.jsx(C.FormGroup,{helperTextInvalid:!(i&&d)&&(p==null?void 0:p.message),fieldId:n,label:o,helperText:r,validated:p!=null&&p.message?"error":void 0,labelInfo:a,labelIcon:l?v.jsx(Ua,{title:s,help:l}):void 0,children:v.jsx(C.Switch,{...u,isChecked:g,onChange:y=>h(y),isDisabled:f})})})}function ixe(e){const{name:t,label:n,isReadOnly:r,isRequired:i,minLength:a,maxLength:o,pattern:l,validate:s}=e,{control:u,formState:{isSubmitting:c}}=hi();return v.jsx(Ho,{name:t,control:u,shouldUnregister:!0,render:({field:{onChange:f,value:d},fieldState:{error:h}})=>v.jsx(Yk,{...e,id:e.id??t,value:d,onChange:f,helperTextInvalid:h==null?void 0:h.message,isReadOnly:r||c,minLength:void 0,maxLength:void 0,"data-cy":e.id??t}),rules:{required:typeof n=="string"&&i===!0?{value:!0,message:`${Nr(n.toLocaleLowerCase())} is required.`}:void 0,minLength:typeof n=="string"&&typeof a=="number"?{value:a,message:`${Nr(n.toLocaleLowerCase())} must be at least ${a} characters.`}:a,maxLength:typeof n=="string"&&typeof o=="number"?{value:o,message:`${Nr(n.toLocaleLowerCase())} cannot be greater than ${o} characters.`}:o,pattern:l,validate:s}})}function axe(e){const{type:t,name:n,label:r,labelHelpTitle:i,labelHelp:a,additionalControls:o,placeholder:l,button:s,helperText:u,isDisabled:c,isReadOnly:f,isRequired:d,validate:h,minLength:g,maxLength:p,min:y,max:_,pattern:b,selectTitle:S,selectOpen:O,selectValue:w,autoFocus:A}=e,T=cl(e),{control:k,setValue:j,formState:{isSubmitting:N,isValidating:M}}=hi(),[E,I]=x.useState(!1),[D]=gt();return v.jsx(Ho,{name:n,control:k,shouldUnregister:!0,render:({field:{onChange:W,value:X,name:re},fieldState:{error:ne}})=>{const ee=ne!=null&&ne.message?h&&M?D.validating:ne==null?void 0:ne.message:void 0;function z(Z){W(Z.trimStart())}return v.jsx(C.FormGroup,{id:`${T??""}-form-group`,fieldId:T,label:r,helperText:u,helperTextInvalid:ee,validated:ee?"error":void 0,isRequired:d,labelIcon:a?v.jsx(Ua,{title:i,help:a}):void 0,labelInfo:o,"data-cy":`${T??""}-form-group`,children:v.jsxs(C.InputGroup,{children:[v.jsx(C.TextInput,{id:T,placeholder:l,onChange:z,value:X??"","aria-describedby":T?`${T}-form-group`:void 0,validated:ee?"error":void 0,type:t==="password"?E?"text":"password":t,readOnlyVariant:f?"default":void 0,isDisabled:c,autoFocus:A,autoComplete:"off","data-cy":T}),t==="password"&&v.jsx(C.Button,{variant:"control",onClick:()=>I(!E),isDisabled:c||f,children:E?v.jsx(Ce.EyeIcon,{}):v.jsx(Ce.EyeSlashIcon,{})}),S&&v.jsx(C.Button,{ouiaId:`lookup-${re}-button`,variant:"control",onClick:()=>O==null?void 0:O(Z=>{if(w){const q=w(Z);j(re,q,{shouldValidate:!0})}},S),"aria-label":"Options menu",isDisabled:c||N,children:v.jsx(Ce.SearchIcon,{})}),s&&s]})})},rules:{required:typeof r=="string"&&d===!0?{value:!0,message:`${Nr(r.toLocaleLowerCase())} is required.`}:void 0,validate:h,minLength:typeof r=="string"&&typeof g=="number"?{value:g,message:`${Nr(r.toLocaleLowerCase())} must be at least ${g} characters.`}:g,maxLength:typeof r=="string"&&typeof p=="number"?{value:p,message:`${Nr(r.toLocaleLowerCase())} cannot be greater than ${p} characters.`}:p,min:typeof r=="string"&&(typeof y=="number"||typeof y=="string")?{value:y,message:`${Nr(r.toLocaleLowerCase())} must be less than ${y}.`}:g,max:typeof r=="string"&&(typeof _=="number"||typeof _=="string")?{value:_,message:`${Nr(r.toLocaleLowerCase())} cannot be greater than ${_}.`}:g,pattern:b}})}const yy=Symbol.for("yaml.alias"),oxe=Symbol.for("yaml.document"),Da=Symbol.for("yaml.map"),JE=Symbol.for("yaml.pair"),by=Symbol.for("yaml.scalar"),Ys=Symbol.for("yaml.seq"),Br=Symbol.for("yaml.node.type"),Jo=e=>!!e&&typeof e=="object"&&e[Br]===yy,Wd=e=>!!e&&typeof e=="object"&&e[Br]===oxe,QE=e=>!!e&&typeof e=="object"&&e[Br]===Da,Ut=e=>!!e&&typeof e=="object"&&e[Br]===JE,It=e=>!!e&&typeof e=="object"&&e[Br]===by,_y=e=>!!e&&typeof e=="object"&&e[Br]===Ys;function kn(e){if(e&&typeof e=="object")switch(e[Br]){case Da:case Ys:return!0}return!1}function yn(e){if(e&&typeof e=="object")switch(e[Br]){case yy:case Da:case by:case Ys:return!0}return!1}const lxe=e=>(It(e)||kn(e))&&!!e.anchor,Ia=Symbol("break visit"),sxe=Symbol("skip children"),Ks=Symbol("remove node");function Zs(e,t){const n=uxe(t);Wd(e)?Qo(null,e.contents,n,Object.freeze([e]))===Ks&&(e.contents=null):Qo(null,e,n,Object.freeze([]))}Zs.BREAK=Ia,Zs.SKIP=sxe,Zs.REMOVE=Ks;function Qo(e,t,n,r){const i=cxe(e,t,n,r);if(yn(i)||Ut(i))return fxe(e,r,i),Qo(e,i,n,r);if(typeof i!="symbol"){if(kn(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const o=Qo(a,t.items[a],n,r);if(typeof o=="number")a=o-1;else{if(o===Ia)return Ia;o===Ks&&(t.items.splice(a,1),a-=1)}}}else if(Ut(t)){r=Object.freeze(r.concat(t));const a=Qo("key",t.key,n,r);if(a===Ia)return Ia;a===Ks&&(t.key=null);const o=Qo("value",t.value,n,r);if(o===Ia)return Ia;o===Ks&&(t.value=null)}}return i}function uxe(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function cxe(e,t,n,r){var i,a,o,l,s;if(typeof n=="function")return n(e,t,r);if(QE(t))return(i=n.Map)==null?void 0:i.call(n,e,t,r);if(_y(t))return(a=n.Seq)==null?void 0:a.call(n,e,t,r);if(Ut(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,r);if(It(t))return(l=n.Scalar)==null?void 0:l.call(n,e,t,r);if(Jo(t))return(s=n.Alias)==null?void 0:s.call(n,e,t,r)}function fxe(e,t,n){const r=t[t.length-1];if(kn(r))r.items[e]=n;else if(Ut(r))e==="key"?r.key=n:r.value=n;else if(Wd(r))r.contents=n;else{const i=Jo(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}function eP(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function Xs(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;i<a;++i){const o=r[i],l=Xs(e,r,String(i),o);l===void 0?delete r[i]:l!==o&&(r[i]=l)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),o=Xs(e,r,i,a);o===void 0?r.delete(i):o!==a&&r.set(i,o)}else if(r instanceof Set)for(const i of Array.from(r)){const a=Xs(e,r,i,i);a===void 0?r.delete(i):a!==i&&(r.delete(i),r.add(a))}else for(const[i,a]of Object.entries(r)){const o=Xs(e,r,i,a);o===void 0?delete r[i]:o!==a&&(r[i]=o)}return e.call(t,n,r)}function pr(e,t,n){if(Array.isArray(e))return e.map((r,i)=>pr(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!lxe(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=a=>{r.res=a,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class xy{constructor(t){Object.defineProperty(this,Br,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){if(!Wd(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},l=pr(this,"",o);if(typeof i=="function")for(const{count:s,res:u}of o.anchors.values())i(u,s);return typeof a=="function"?Xs(a,{"":l},"",l):l}}class dxe extends xy{constructor(t){super(yy),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let n;return Zs(t,{Node:(r,i)=>{if(i===this)return Zs.BREAK;i.anchor===this.source&&(n=i)}}),n}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:a}=n,o=this.resolve(i);if(!o){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(s)}let l=r.get(o);if(l||(pr(o,null,n),l=r.get(o)),!l||l.res===void 0){const s="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(s)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=zd(i,o,r)),l.count*l.aliasCount>a)){const s="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(s)}return l.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(eP(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${i} `}return i}}function zd(e,t,n){if(Jo(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(kn(t)){let r=0;for(const i of t.items){const a=zd(e,i,n);a>r&&(r=a)}return r}else if(Ut(t)){const r=zd(e,t.key,n),i=zd(e,t.value,n);return Math.max(r,i)}return 1}const tP=e=>!e||typeof e!="function"&&typeof e!="object";class At extends xy{constructor(t){super(by),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:pr(this.value,t,n)}toString(){return String(this.value)}}At.BLOCK_FOLDED="BLOCK_FOLDED",At.BLOCK_LITERAL="BLOCK_LITERAL",At.PLAIN="PLAIN",At.QUOTE_DOUBLE="QUOTE_DOUBLE",At.QUOTE_SINGLE="QUOTE_SINGLE";const hxe="tag:yaml.org,2002:";function mxe(e,t,n){if(t){const r=n.filter(a=>a.tag===t),i=r.find(a=>!a.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>{var i;return((i=r.identify)==null?void 0:i.call(r,e))&&!r.format})}function Vd(e,t,n){var f,d,h;if(Wd(e)&&(e=e.contents),yn(e))return e;if(Ut(e)){const g=(d=(f=n.schema[Da]).createNode)==null?void 0:d.call(f,n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:l}=n;let s;if(r&&e&&typeof e=="object"){if(s=l.get(e),s)return s.anchor||(s.anchor=i(e)),new dxe(s.anchor);s={anchor:null,node:null},l.set(e,s)}t!=null&&t.startsWith("!!")&&(t=hxe+t.slice(2));let u=mxe(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new At(e);return s&&(s.node=g),g}u=e instanceof Map?o[Da]:Symbol.iterator in Object(e)?o[Ys]:o[Da]}a&&(a(u),delete n.onTagObj);const c=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((h=u==null?void 0:u.nodeClass)==null?void 0:h.from)=="function"?u.nodeClass.from(n.schema,e,n):new At(e);return t?c.tag=t:u.default||(c.tag=u.tag),s&&(s.node=c),c}function nP(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const a=t[i];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const o=[];o[a]=r,r=o}else r=new Map([[a,r]])}return Vd(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const gxe=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class Ud extends xy{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>yn(r)||Ut(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(gxe(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(kn(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,nP(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(kn(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,a=this.get(r,!0);return i.length===0?!n&&It(a)?a.value:a:kn(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Ut(n))return!1;const r=n.value;return r==null||t&&It(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const i=this.get(n,!0);return kn(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const a=this.get(r,!0);if(kn(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,nP(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}Ud.maxFlowStringSingleLineLength=60;const pxe=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Js(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const $a=(e,t,n)=>e.endsWith(`
|
|
483
|
+
`))],B=Y!=null&&Y!=="";return v.jsx(lu,{...h,label:o?v.jsxs("span",{style:{alignItems:"center"},children:[v.jsx(Ce.AngleRightIcon,{style:{transform:k?"rotate(0deg)":"rotate(90deg)",transition:"transform"},onClick:()=>j(K=>!K),"aria-label":t("Expand or collapse extra variables")}),e.label]}):e.label,id:I,helperTextInvalid:!(d&&p)&&(ie==null?void 0:ie.map(K=>v.jsx(Q_e,{children:K},K))),children:(!o||!k)&&v.jsxs(v.Fragment,{children:[v.jsx(exe,{allowCopy:n,allowDownload:r,allowUpload:i,errors:y,handleCopy:()=>X(),handleDownload:ne,handleUpload:re,name:Z,selectedLanguage:A,setLanguage:W,toggleLanguages:f},"actions-row"),v.jsxs("div",{id:"code-editor-dropzone",...z.getRootProps({disabled:B}),style:{width:"100%",height:"100%"},children:[v.jsx("input",{id:"code-editor-dropzone-input",...z.getInputProps(),ref:N}),v.jsx(X_e,{setError:_,clearErrors:b,id:I,name:Z,language:A,value:Y,onChange:q,isReadOnly:l||g,invalid:!(d&&p)&&(G==null?void 0:G.message)!==void 0})]})]})})},rules:{required:typeof u=="string"&&s===!0?{value:!0,message:`${Nr(u.toLocaleLowerCase())} is required.`}:void 0,validate:e.validate}})}function nxe(e){const{name:t,label:n,labelHelpTitle:r,labelHelp:i,additionalControls:a,placeholderText:o,options:l,footer:s,helperText:u,isDisabled:c,isReadOnly:f,isRequired:d,validate:h,fieldNameToResetOnFieldChange:g}=e,p=cl(e),{control:y,formState:{isSubmitting:_,isValidating:b},resetField:S}=hi(),[O,w]=x.useState(!1),A=x.useCallback(()=>w(!O),[O]),[T]=gt();return v.jsx(Ho,{name:t,control:y,shouldUnregister:!0,render:({field:{onChange:k,value:j},fieldState:{error:N}})=>{j===""&&l.length===1&&d&&k(l[0].value);const M=(D,W)=>{var X;k((X=l.find(re=>re.label===W.toString()))==null?void 0:X.value),g&&S(g),w(!1)},E=N!=null&&N.message?h&&b?T.validating:N==null?void 0:N.message:void 0,I=l.find(D=>D.value===j);return v.jsx(C.FormGroup,{id:`${p??""}-form-group`,fieldId:p,label:n,labelIcon:i?v.jsx(Ua,{title:r,help:i}):void 0,labelInfo:a,helperText:u,helperTextInvalid:E,validated:E?"error":void 0,isRequired:d,"data-cy":`${p??""}-form-group`,children:v.jsx(C.Select,{id:p,label:void 0,placeholderText:o,variant:"single","aria-describedby":p?`${p}-form-group`:void 0,selections:I==null?void 0:I.label,onSelect:M,isOpen:O,onToggle:A,onClear:d?void 0:()=>{k(null),w(!1)},maxHeight:280,validated:E?"error":void 0,isDisabled:c||f||_,hasPlaceholderStyle:!0,footer:s,ouiaId:p,"data-cy":p,children:l.map(D=>{const W=jn(D);return v.jsx(C.SelectOption,{id:W,value:D.label,label:D.label,description:D.description,"data-cy":W,children:D.label},D.label)})})})},rules:{required:typeof n=="string"&&d===!0?{value:!0,message:`${Nr(n.toLocaleLowerCase())} is required.`}:void 0,validate:h}})}function rxe(e){const{name:t,id:n,helperText:r,validate:i,additionalControls:a,formLabel:o,labelHelp:l,labelHelpTitle:s,...u}=e,{control:c,formState:{isSubmitting:f,isValidating:d}}=hi();return v.jsx(Ho,{name:t,control:c,shouldUnregister:!0,render:({field:{onChange:h,value:g},fieldState:{error:p}})=>v.jsx(C.FormGroup,{helperTextInvalid:!(i&&d)&&(p==null?void 0:p.message),fieldId:n,label:o,helperText:r,validated:p!=null&&p.message?"error":void 0,labelInfo:a,labelIcon:l?v.jsx(Ua,{title:s,help:l}):void 0,children:v.jsx(C.Switch,{...u,isChecked:g,onChange:y=>h(y),isDisabled:f})})})}function ixe(e){const{name:t,label:n,isReadOnly:r,isRequired:i,minLength:a,maxLength:o,pattern:l,validate:s}=e,{control:u,formState:{isSubmitting:c}}=hi();return v.jsx(Ho,{name:t,control:u,shouldUnregister:!0,render:({field:{onChange:f,value:d},fieldState:{error:h}})=>v.jsx(Yk,{...e,id:e.id??t,value:d,onChange:f,helperTextInvalid:h==null?void 0:h.message,isReadOnly:r||c,minLength:void 0,maxLength:void 0,"data-cy":e.id??t}),rules:{required:typeof n=="string"&&i===!0?{value:!0,message:`${Nr(n.toLocaleLowerCase())} is required.`}:void 0,minLength:typeof n=="string"&&typeof a=="number"?{value:a,message:`${Nr(n.toLocaleLowerCase())} must be at least ${a} characters.`}:a,maxLength:typeof n=="string"&&typeof o=="number"?{value:o,message:`${Nr(n.toLocaleLowerCase())} cannot be greater than ${o} characters.`}:o,pattern:l,validate:s}})}function axe(e){const{type:t,name:n,label:r,labelHelpTitle:i,labelHelp:a,additionalControls:o,placeholder:l,button:s,helperText:u,isDisabled:c,isReadOnly:f,isRequired:d,validate:h,minLength:g,maxLength:p,min:y,max:_,pattern:b,selectTitle:S,selectOpen:O,selectValue:w,autoFocus:A}=e,T=cl(e),{control:k,setValue:j,formState:{isSubmitting:N,isValidating:M}}=hi(),[E,I]=x.useState(!1),[D]=gt();return v.jsx(Ho,{name:n,control:k,shouldUnregister:!0,render:({field:{onChange:W,value:X,name:re},fieldState:{error:ne}})=>{const ee=ne!=null&&ne.message?h&&M?D.validating:ne==null?void 0:ne.message:void 0;function z(Z){W(Z.trimStart())}return v.jsx(C.FormGroup,{id:`${T??""}-form-group`,fieldId:T,label:r,helperText:u,helperTextInvalid:ee,validated:ee?"error":void 0,isRequired:d,labelIcon:a?v.jsx(Ua,{title:i,help:a}):void 0,labelInfo:o,"data-cy":`${T??""}-form-group`,children:v.jsxs(C.InputGroup,{children:[v.jsx(C.TextInput,{id:T,placeholder:l,onChange:z,value:X??"","aria-describedby":T?`${T}-form-group`:void 0,validated:ee?"error":void 0,type:t==="password"?E?"text":"password":t,readOnlyVariant:f?"default":void 0,isDisabled:c,autoFocus:A,autoComplete:"off","data-cy":T}),t==="password"&&v.jsx(C.Button,{variant:"control",onClick:()=>I(!E),isDisabled:c||f,children:E?v.jsx(Ce.EyeIcon,{}):v.jsx(Ce.EyeSlashIcon,{})}),S&&v.jsx(C.Button,{ouiaId:`lookup-${re}-button`,variant:"control",onClick:()=>O==null?void 0:O(Z=>{if(w){const q=w(Z);j(re,q,{shouldValidate:!0})}},S),"aria-label":"Options menu",isDisabled:c||N,children:v.jsx(Ce.SearchIcon,{})}),s&&s]})})},rules:{required:typeof r=="string"&&d===!0?{value:!0,message:`${Nr(r.toLocaleLowerCase())} is required.`}:void 0,validate:h,minLength:typeof r=="string"&&typeof g=="number"?{value:g,message:`${Nr(r.toLocaleLowerCase())} must be at least ${g} characters.`}:g,maxLength:typeof r=="string"&&typeof p=="number"?{value:p,message:`${Nr(r.toLocaleLowerCase())} cannot be greater than ${p} characters.`}:p,min:typeof r=="string"&&(typeof y=="number"||typeof y=="string")?{value:y,message:`${Nr(r.toLocaleLowerCase())} must be less than ${y}.`}:g,max:typeof r=="string"&&(typeof _=="number"||typeof _=="string")?{value:_,message:`${Nr(r.toLocaleLowerCase())} cannot be greater than ${_}.`}:g,pattern:b}})}const yy=Symbol.for("yaml.alias"),oxe=Symbol.for("yaml.document"),Da=Symbol.for("yaml.map"),JE=Symbol.for("yaml.pair"),by=Symbol.for("yaml.scalar"),Ys=Symbol.for("yaml.seq"),Br=Symbol.for("yaml.node.type"),Jo=e=>!!e&&typeof e=="object"&&e[Br]===yy,Wd=e=>!!e&&typeof e=="object"&&e[Br]===oxe,QE=e=>!!e&&typeof e=="object"&&e[Br]===Da,Ut=e=>!!e&&typeof e=="object"&&e[Br]===JE,It=e=>!!e&&typeof e=="object"&&e[Br]===by,_y=e=>!!e&&typeof e=="object"&&e[Br]===Ys;function kn(e){if(e&&typeof e=="object")switch(e[Br]){case Da:case Ys:return!0}return!1}function yn(e){if(e&&typeof e=="object")switch(e[Br]){case yy:case Da:case by:case Ys:return!0}return!1}const lxe=e=>(It(e)||kn(e))&&!!e.anchor,Ia=Symbol("break visit"),sxe=Symbol("skip children"),Ks=Symbol("remove node");function Zs(e,t){const n=uxe(t);Wd(e)?Qo(null,e.contents,n,Object.freeze([e]))===Ks&&(e.contents=null):Qo(null,e,n,Object.freeze([]))}Zs.BREAK=Ia,Zs.SKIP=sxe,Zs.REMOVE=Ks;function Qo(e,t,n,r){const i=cxe(e,t,n,r);if(yn(i)||Ut(i))return fxe(e,r,i),Qo(e,i,n,r);if(typeof i!="symbol"){if(kn(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const o=Qo(a,t.items[a],n,r);if(typeof o=="number")a=o-1;else{if(o===Ia)return Ia;o===Ks&&(t.items.splice(a,1),a-=1)}}}else if(Ut(t)){r=Object.freeze(r.concat(t));const a=Qo("key",t.key,n,r);if(a===Ia)return Ia;a===Ks&&(t.key=null);const o=Qo("value",t.value,n,r);if(o===Ia)return Ia;o===Ks&&(t.value=null)}}return i}function uxe(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function cxe(e,t,n,r){var i,a,o,l,s;if(typeof n=="function")return n(e,t,r);if(QE(t))return(i=n.Map)==null?void 0:i.call(n,e,t,r);if(_y(t))return(a=n.Seq)==null?void 0:a.call(n,e,t,r);if(Ut(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,r);if(It(t))return(l=n.Scalar)==null?void 0:l.call(n,e,t,r);if(Jo(t))return(s=n.Alias)==null?void 0:s.call(n,e,t,r)}function fxe(e,t,n){const r=t[t.length-1];if(kn(r))r.items[e]=n;else if(Ut(r))e==="key"?r.key=n:r.value=n;else if(Wd(r))r.contents=n;else{const i=Jo(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}function eP(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function Xs(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;i<a;++i){const o=r[i],l=Xs(e,r,String(i),o);l===void 0?delete r[i]:l!==o&&(r[i]=l)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),o=Xs(e,r,i,a);o===void 0?r.delete(i):o!==a&&r.set(i,o)}else if(r instanceof Set)for(const i of Array.from(r)){const a=Xs(e,r,i,i);a===void 0?r.delete(i):a!==i&&(r.delete(i),r.add(a))}else for(const[i,a]of Object.entries(r)){const o=Xs(e,r,i,a);o===void 0?delete r[i]:o!==a&&(r[i]=o)}return e.call(t,n,r)}function pr(e,t,n){if(Array.isArray(e))return e.map((r,i)=>pr(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!lxe(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=a=>{r.res=a,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class xy{constructor(t){Object.defineProperty(this,Br,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){if(!Wd(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},l=pr(this,"",o);if(typeof i=="function")for(const{count:s,res:u}of o.anchors.values())i(u,s);return typeof a=="function"?Xs(a,{"":l},"",l):l}}class dxe extends xy{constructor(t){super(yy),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t){let n;return Zs(t,{Node:(r,i)=>{if(i===this)return Zs.BREAK;i.anchor===this.source&&(n=i)}}),n}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:a}=n,o=this.resolve(i);if(!o){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(s)}let l=r.get(o);if(l||(pr(o,null,n),l=r.get(o)),!l||l.res===void 0){const s="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(s)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=zd(i,o,r)),l.count*l.aliasCount>a)){const s="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(s)}return l.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(eP(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${i} `}return i}}function zd(e,t,n){if(Jo(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(kn(t)){let r=0;for(const i of t.items){const a=zd(e,i,n);a>r&&(r=a)}return r}else if(Ut(t)){const r=zd(e,t.key,n),i=zd(e,t.value,n);return Math.max(r,i)}return 1}const tP=e=>!e||typeof e!="function"&&typeof e!="object";class At extends xy{constructor(t){super(by),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:pr(this.value,t,n)}toString(){return String(this.value)}}At.BLOCK_FOLDED="BLOCK_FOLDED",At.BLOCK_LITERAL="BLOCK_LITERAL",At.PLAIN="PLAIN",At.QUOTE_DOUBLE="QUOTE_DOUBLE",At.QUOTE_SINGLE="QUOTE_SINGLE";const hxe="tag:yaml.org,2002:";function mxe(e,t,n){if(t){const r=n.filter(a=>a.tag===t),i=r.find(a=>!a.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>{var i;return((i=r.identify)==null?void 0:i.call(r,e))&&!r.format})}function Vd(e,t,n){var f,d,h;if(Wd(e)&&(e=e.contents),yn(e))return e;if(Ut(e)){const g=(d=(f=n.schema[Da]).createNode)==null?void 0:d.call(f,n.schema,null,n);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:l}=n;let s;if(r&&e&&typeof e=="object"){if(s=l.get(e),s)return s.anchor||(s.anchor=i(e)),new dxe(s.anchor);s={anchor:null,node:null},l.set(e,s)}t!=null&&t.startsWith("!!")&&(t=hxe+t.slice(2));let u=mxe(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new At(e);return s&&(s.node=g),g}u=e instanceof Map?o[Da]:Symbol.iterator in Object(e)?o[Ys]:o[Da]}a&&(a(u),delete n.onTagObj);const c=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((h=u==null?void 0:u.nodeClass)==null?void 0:h.from)=="function"?u.nodeClass.from(n.schema,e,n):new At(e);return t?c.tag=t:u.default||(c.tag=u.tag),s&&(s.node=c),c}function nP(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const a=t[i];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const o=[];o[a]=r,r=o}else r=new Map([[a,r]])}return Vd(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const gxe=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class Ud extends xy{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>yn(r)||Ut(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(gxe(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(kn(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,nP(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(kn(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,a=this.get(r,!0);return i.length===0?!n&&It(a)?a.value:a:kn(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Ut(n))return!1;const r=n.value;return r==null||t&&It(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const i=this.get(n,!0);return kn(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const a=this.get(r,!0);if(kn(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,nP(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}Ud.maxFlowStringSingleLineLength=60;const pxe=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Js(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const $a=(e,t,n)=>e.endsWith(`
|
|
484
484
|
`)?Js(n,t):n.includes(`
|
|
485
485
|
`)?`
|
|
486
486
|
`+Js(n,t):(e.endsWith(" ")?"":" ")+n,rP="flow",Sy="block",Hd="quoted";function qd(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:l}={}){if(!i||i<0)return e;const s=Math.max(1+a,1+i-t.length);if(e.length<=s)return e;const u=[],c={};let f=i-t.length;typeof r=="number"&&(r>i-Math.max(2,a)?u.push(0):f=i-r);let d,h,g=!1,p=-1,y=-1,_=-1;n===Sy&&(p=iP(e,p),p!==-1&&(f=p+s));for(let S;S=e[p+=1];){if(n===Hd&&S==="\\"){switch(y=p,e[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}_=p}if(S===`
|