mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
1 line
No EOL
5 KiB
JavaScript
1 line
No EOL
5 KiB
JavaScript
(self.webpackChunkvalidator_frontend=self.webpackChunkvalidator_frontend||[]).push([[484],{10:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r=n(6540),i=n(884),o=n(1900),a=n(4803),c=n(4848);var s=function({endpoint:e,fileName:t}){const{request:n,data:s,error:l,status:d}=(0,a.A)();return(0,r.useEffect)(()=>{n(e,{headers:{"Content-Type":"application/xml"}})},[e,n]),(0,c.jsxs)(c.Fragment,{children:[d===a.I.Failure&&l&&(0,c.jsx)(o.A,{title:"An error occurred while fetching",children:(0,c.jsx)(i.A,{children:l.message})}),d===a.I.Success&&s&&(0,c.jsx)(i.A,{download:{fileName:t,mime:"application/xml"},enableCopy:!0,children:s})]})}},884:function(e,t,n){"use strict";n.d(t,{A:function(){return p}});var r=n(6540),i=n(1765),o=n(4586),a=n(4164),c=n(5419),s=n.n(c),l="codeblock_Yfbc",d="wrapper_DZPG",u="buttonWrapper_BACP",f="button_HbCM",h=n(4848);const m=()=>document.documentElement.dataset.theme||"light";var p=function({children:e,language:t="markup",enableCopy:n=!1,download:c}){const{siteConfig:p}=(0,o.A)(),v=function(){const[e,t]=(0,r.useState)(m);return(0,r.useEffect)(()=>{const e=new MutationObserver(()=>{t(m())});return e.observe(document.documentElement,{subtree:!1,attributeFilter:["data-theme"]}),()=>e.disconnect()}),e}(),g=p.themeConfig.prism.theme,b=p.themeConfig.prism.darkTheme,w="light"===v?g:b;return(0,h.jsxs)("div",{className:d,children:[(0,h.jsx)(i.f4,{code:e,language:t,theme:w,children:({className:e,style:t,tokens:n,getLineProps:r,getTokenProps:i})=>(0,h.jsx)("pre",{className:(0,a.A)(e,l),style:t,children:n.map((e,t)=>(0,h.jsx)("div",{...r({line:e,key:t}),children:e.map((e,t)=>(0,h.jsx)("span",{...i({token:e,key:t})}))}))})}),(n||c)&&(0,h.jsxs)("div",{className:u,children:[n&&(0,h.jsx)("button",{className:f,type:"button","aria-label":"Copy content",title:"Copy content",onClick:async()=>{try{navigator.clipboard.writeText(e)}catch{}},children:(0,h.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",children:(0,h.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})})}),c&&(0,h.jsx)("button",{className:f,type:"button","aria-label":"Download content as file",title:"Download content as file",onClick:()=>{c&&c.fileName&&c.mime&&s()(e,c.fileName,c.mime)},children:(0,h.jsx)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"currentColor",children:(0,h.jsx)("path",{d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"})})})]})]})}},1900:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});n(6540);var r="errorDisplay_QTmW",i="title_GCFt",o=n(4848);var a=function({title:e,children:t}){return(0,o.jsxs)("div",{role:"alert",className:r,children:[(0,o.jsx)("strong",{className:i,children:e}),t]})}},3756:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});n(6540);var r=n(1656),i="headline_fEIe",o=n(4848);var a=function({children:e,layoutDescription:t,description:n,title:a,headline:c}){return(0,o.jsx)(r.A,{description:t,title:a,children:(0,o.jsxs)("main",{className:"container padding-top--md padding-bottom--lg",children:[(0,o.jsx)("h1",{className:i,children:c}),(0,o.jsx)("p",{children:n}),e]})})}},4803:function(e,t,n){"use strict";n.d(t,{I:function(){return o}});var r=n(6540),i=n(4586);let o=function(e){return e.Idle="idle",e.Loading="loading",e.Success="success",e.Failure="failure",e}({});const a={status:o.Idle,data:null,error:null};t.A=function(){const[e,t]=(0,r.useState)(a),{siteConfig:n}=(0,i.A)(),c=n.customFields?.apiBase,s=(0,r.useRef)(!0);(0,r.useEffect)(()=>()=>{s.current=!1},[]);const l=(0,r.useCallback)((e,n)=>{t(e=>({...e,status:o.Loading})),fetch(function(e,t){return`/${t.split("/").concat(e.split("/")).filter(Boolean).join("/")}`}(e,c),n).then(e=>e.text().then(t=>({data:t,ok:e.ok,code:e.status}))).then(({data:e,ok:n,code:r})=>{s.current&&t(n?{status:o.Success,data:e,error:null}:t=>({...t,status:o.Failure,error:{code:r,message:e}}))}).catch(e=>{s.current&&t(t=>({...t,status:o.Failure,error:{code:0,message:e?.toString?.()||"An unknown error occurred"}}))})},[c]);return(0,r.useMemo)(()=>({...e,request:l}),[l,e])}},5419:function(e){e.exports=function(e,t,n,r){var i=new Blob(void 0!==r?[r,e]:[e],{type:n||"application/octet-stream"});if(void 0!==window.navigator.msSaveBlob)window.navigator.msSaveBlob(i,t);else{var o=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(i):window.webkitURL.createObjectURL(i),a=document.createElement("a");a.style.display="none",a.href=o,a.setAttribute("download",t),void 0===a.download&&a.setAttribute("target","_blank"),document.body.appendChild(a),a.click(),setTimeout(function(){document.body.removeChild(a),window.URL.revokeObjectURL(o)},200)}}},9096:function(e,t,n){"use strict";n.r(t);n(6540);var r=n(3756),i=n(10),o=n(4848);t.default=function(){return(0,o.jsx)(r.A,{title:"Validator configuration",layoutDescription:"The currently loaded validator configuration",headline:"Validator configuration",description:"View the currently loaded validator configuration.",children:(0,o.jsx)(i.A,{endpoint:"/server/config",fileName:"config.xml"})})}}}]); |