@decafhub/decaf-react-webapp 0.0.7 → 0.0.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.8](https://github.com/teloscube/decaf-react-webapp/compare/v0.0.7...v0.0.8) (2022-12-14)
4
+
5
+
6
+ ### Features
7
+
8
+ * integrate plausible script ([1163ef9](https://github.com/teloscube/decaf-react-webapp/commit/1163ef919a426f77b9337a5981c1026cd1aad9bf))
9
+
3
10
  ## [0.0.7](https://github.com/teloscube/decaf-react-webapp/compare/v0.0.6...v0.0.7) (2022-12-11)
4
11
 
5
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,cAAc,EAAE,kBAAkB,EAAyB,MAAM,uBAAuB,CAAC;AAC5G,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA+B,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAG5F,OAAoB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC;AAErC,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;;OAIG;IACH,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB;;;OAGG;IACH,SAAS,EAA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E,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACpC;AAoCD,iBAAS,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAgE3C;AAED,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var e=require("@ant-design/icons"),t=require("@decafhub/decaf-react"),n=require("@emotion/react"),o=require("@emotion/styled"),l=require("antd");require("antd/dist/reset.css");var r=require("react"),a=require("react-router-dom"),i=require("html2canvas");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=/*#__PURE__*/c(o),u=/*#__PURE__*/c(r),s=/*#__PURE__*/c(i);function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},f.apply(this,arguments)}function m(e){var n=t.useDecaf().client,o=r.useState(void 0),a=o[0],i=o[1];return r.useEffect(function(){n.barista.get("/version/").then(function(e){return i(e.data.version)})},[n]),u.default.createElement(l.Space,{direction:"vertical",size:"middle",style:{width:"100%"}},u.default.createElement(l.Descriptions,{title:"About",column:1,bordered:!0},u.default.createElement(l.Descriptions.Item,{label:"Web Application Name"},e.appName),u.default.createElement(l.Descriptions.Item,{label:"Web Application Description"},e.appDescription),u.default.createElement(l.Descriptions.Item,{label:"Web Application Version"},"v"+e.appVersion),u.default.createElement(l.Descriptions.Item,{label:"DECAF Barista Version"},"v"+a)),e.content)}function p(){return u.default.createElement(l.Result,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function g(){return u.default.createElement("div",null,u.default.createElement(l.Button,{title:"Scroll to top",type:"text",size:"small",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})},icon:u.default.createElement(e.UpOutlined,null)}),u.default.createElement(l.Button,{title:"Scroll to bottom",type:"text",size:"small",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},icon:u.default.createElement(e.DownOutlined,null)}))}function b(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function h(){var t,n,o=-1===(n=(t=window.location.href.split("/")).indexOf("webapps"))?"":t[n+1],r=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),a=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+o+"/development/"+b(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+o+"/testing/"+b(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+o+"/staging/"+b(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+o+"/production/"+b(window.location.href),show:!0}],i=a.find(function(e){return e.code===r});return i?u.default.createElement(l.Dropdown,{placement:"top",arrow:!0,menu:{items:a.map(function(e){return{key:e.name,label:u.default.createElement("span",null,u.default.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){window.location.href=e.url}}})}},u.default.createElement(l.Button,{type:"text",size:"small"},u.default.createElement("div",{style:{display:"flex",alignItems:"center"}},u.default.createElement("i",{className:"dot "+(null==i?void 0:i.color),style:{marginRight:5}}),u.default.createElement(e.CaretUpOutlined,null)))):null}function y(t){var n=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(s.default(document.body)).then(function(t){var n=t.toDataURL("image/png");null==e||e.style.setProperty("display","block");var o=document.createElement("a");o.download="screenshot.png",o.href=n,o.click(),o.remove()})}catch(e){return Promise.reject(e)}};return t.triggerNode?u.default.cloneElement(t.triggerNode,{onClick:n}):u.default.createElement(l.Button,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:u.default.createElement(e.CameraOutlined,null),onClick:n})}function E(){var n=t.useDecaf(),o=n.me,a=n.publicConfig,i=r.useState(!1),c=i[0],d=i[1];return r.useEffect(function(){if(a.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src="https://static.zdassets.com/ekr/snippet.js?key="+a.zendesk,e.async=!0,e.id="ze-snippet",e.onload=function(){window.zE("webWidget","hide"),window.zE("webWidget:on","open",function(){window.zE("webWidget","show"),d(!0)}),window.zE("webWidget:on","close",function(){window.zE("webWidget","hide"),d(!1)})},document.body.appendChild(e),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":o.fullname}},{id:"email",prefill:{"*":o.email}}]}},function(){document.body.removeChild(e)}}},[a,o]),a.zendesk?u.default.createElement(l.Button,{size:"small",icon:u.default.createElement(e.QuestionCircleOutlined,null),onClick:function(){c?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),d(!c)}},"Support"):null}function w(e){var t=[];return e.forEach(function(e){var n={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?n.label=u.default.createElement(a.NavLink,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=u.default.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=w(e.children||[])),t.push(n)}),t}function v(n){var o=w(n.menu),r=a.useMatches().map(function(e){return e.pathname}),i=t.useDecaf().me,c=l.theme.useToken().token;return u.default.createElement(l.Layout,{style:{height:"100%"}},u.default.createElement(l.Layout.Header,{id:"decaf-header"},u.default.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},u.default.createElement(a.Link,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},n.appIcon,u.default.createElement(l.Typography.Title,{level:4,style:{margin:0}},n.appName)),u.default.createElement(l.Menu,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:o,selectedKeys:r}))),u.default.createElement(l.Layout.Content,{id:"decaf-content"},n.children),u.default.createElement(l.Layout.Footer,{id:"decaf-footer"},u.default.createElement(l.Row,{justify:"space-between",align:"middle"},u.default.createElement(l.Col,{span:10},u.default.createElement(E,null)),u.default.createElement(l.Col,{span:4},u.default.createElement(l.Typography.Text,{type:"secondary"},"Powered by"," ",u.default.createElement("b",null,u.default.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer",style:{color:c.colorText}},"Teloscube")))),u.default.createElement(l.Col,{span:10,style:{justifyContent:"flex-end",display:"flex"}},u.default.createElement(l.Button,{size:"small",icon:u.default.createElement(e.UserOutlined,null)},i.username),u.default.createElement(h,null),u.default.createElement(y,null),u.default.createElement(g,null)))))}var k={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},C={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:"#2c3d50"},Input:f({},k,{colorBgContainer:"#2c3d50"}),Select:f({},k,{colorBgContainer:"#2c3d50"}),Dropdown:f({},k,{colorBgElevated:"#2c3d50",controlItemBgActive:"#2c3d50"}),DatePicker:f({},k,{colorBgContainer:"#2c3d50",colorBgElevated:"#2c3d50"}),InputNumber:f({},k,{colorBgContainer:"#2c3d50"}),Checkbox:f({},k,{colorBgContainer:"#2c3d50"})},token:{fontFamily:"Lato, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:"#10161d",colorBgElevated:"#1a242f",colorBorderSecondary:"#1a242f",colorBorder:"#1a242f",colorBgLayout:"#1a242f",borderRadius:0,green:"#48734d",red:"#b03a38",blue:"#0d6efd",yellow:"#ffc107",orange:"#fd7e14",colorWhite:"#fff"},algorithm:[l.theme.darkAlgorithm]};function B(e,t){var n=[];return t.forEach(function(t){var o,l=f({},t);t.children?(l.element=null!=(o=t.element)?o:u.default.createElement(a.Outlet,null),l.children=B(e,t.children)):l.element=u.default.createElement(v,{menu:e.menuItems,appName:e.appName,appIcon:e.appIcon},t.element),n.push(l)}),n}function x(e,t,n){var o=[].concat(e);return t.forEach(function(e){var t=o.findIndex(function(t){return t[n]===e[n]});t>=0?o[t]=e:o.push(e)}),o}Object.defineProperty(exports,"GlobalStyle",{enumerable:!0,get:function(){return n.Global}}),Object.defineProperty(exports,"css",{enumerable:!0,get:function(){return n.css}}),Object.defineProperty(exports,"styled",{enumerable:!0,get:function(){return d.default}}),exports.DecafWebapp=function(o){var r,i,c,d=x(o.routes,[{path:"/about",element:u.default.createElement(m,{appName:o.appName,appVersion:null==(r=o.config)?void 0:r.currentVersion,appDescription:o.appDescription,content:o.aboutPageContent})},{path:"*",element:u.default.createElement(p,null)}],"path");d=B(f({},o,{menuItems:x(o.menuItems,[{label:"About",to:"/about",icon:u.default.createElement(e.InfoCircleOutlined,null)}],"to")}),d);var s=a.createBrowserRouter(d,{basename:null==(i=o.config)?void 0:i.basePath}),g=null!=(c=o.theme)?c:C,b=o.controller||t.DecafWebappController;b.disableZendeskWidget=!0;var h=function(e){var t,n,o,l,r;return{"@font-face":{fontFamily:"Lato, sans-serif",src:"url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)"},body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:null==(n=e.token)?void 0:n.fontFamily,margin:0},button:{boxShadow:"none !important"},".ant-page-header-back-button, .ant-page-header-heading-title":{color:(null==(o=e.token)?void 0:o.colorWhite)+" !important"},".ant-badge-count":{color:(null==(l=e.token)?void 0:l.colorWhite)+" !important"},"#decaf-header":{position:"fixed",zIndex:1030,right:0,left:0,paddingInline:0},"#decaf-content":{paddingInline:20,paddingTop:"5rem",paddingBottom:"5rem"},"#decaf-footer":{position:"fixed",bottom:0,right:0,left:0,background:null==(r=e.token)?void 0:r.colorBgContainer,paddingBlock:0,paddingInline:0},".dot":{borderRadius:"50%",width:10,height:10,display:"inline-block","&.green":{backgroundColor:"#80ff00 !important"},"&.yellow":{backgroundColor:"#ff0 !important"},"&.orange":{backgroundColor:"#ff7000 !important"},"&.red":{backgroundColor:"#ff0000 !important"}}}}(g);return u.default.createElement(l.ConfigProvider,{theme:g},u.default.createElement(n.Global,{styles:h}),u.default.createElement(t.DecafApp,{config:o.config,controller:b},u.default.createElement(a.RouterProvider,{router:s})))},exports.decafTheme=C;
1
+ var e=require("@ant-design/icons"),t=require("@decafhub/decaf-react"),n=require("@emotion/react"),o=require("@emotion/styled"),l=require("antd");require("antd/dist/reset.css");var r=require("react"),a=require("react-router-dom"),i=require("html2canvas");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=/*#__PURE__*/c(o),u=/*#__PURE__*/c(r),s=/*#__PURE__*/c(i);function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},f.apply(this,arguments)}function m(){return u.default.createElement(l.Result,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function p(e){var n=t.useDecaf().client,o=r.useState(void 0),a=o[0],i=o[1];return r.useEffect(function(){n.barista.get("/version/").then(function(e){return i(e.data.version)})},[n]),u.default.createElement(l.Space,{direction:"vertical",size:"middle",style:{width:"100%"}},u.default.createElement(l.Descriptions,{title:"About",column:1,bordered:!0},u.default.createElement(l.Descriptions.Item,{label:"Web Application Name"},e.appName),u.default.createElement(l.Descriptions.Item,{label:"Web Application Description"},e.appDescription),u.default.createElement(l.Descriptions.Item,{label:"Web Application Version"},"v"+e.appVersion),u.default.createElement(l.Descriptions.Item,{label:"DECAF Barista Version"},"v"+a)),e.content)}function b(){return u.default.createElement("div",null,u.default.createElement(l.Button,{title:"Scroll to top",type:"text",size:"small",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})},icon:u.default.createElement(e.UpOutlined,null)}),u.default.createElement(l.Button,{title:"Scroll to bottom",type:"text",size:"small",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},icon:u.default.createElement(e.DownOutlined,null)}))}function g(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function h(){var t,n,o=-1===(n=(t=window.location.href.split("/")).indexOf("webapps"))?"":t[n+1],r=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),a=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+o+"/development/"+g(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+o+"/testing/"+g(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+o+"/staging/"+g(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+o+"/production/"+g(window.location.href),show:!0}],i=a.find(function(e){return e.code===r});return i?u.default.createElement(l.Dropdown,{placement:"top",arrow:!0,menu:{items:a.map(function(e){return{key:e.name,label:u.default.createElement("span",null,u.default.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){window.location.href=e.url}}})}},u.default.createElement(l.Button,{type:"text",size:"small"},u.default.createElement("div",{style:{display:"flex",alignItems:"center"}},u.default.createElement("i",{className:"dot "+(null==i?void 0:i.color),style:{marginRight:5}}),u.default.createElement(e.CaretUpOutlined,null)))):null}function y(t){var n=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(s.default(document.body)).then(function(t){var n=t.toDataURL("image/png");null==e||e.style.setProperty("display","block");var o=document.createElement("a");o.download="screenshot.png",o.href=n,o.click(),o.remove()})}catch(e){return Promise.reject(e)}};return t.triggerNode?u.default.cloneElement(t.triggerNode,{onClick:n}):u.default.createElement(l.Button,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:u.default.createElement(e.CameraOutlined,null),onClick:n})}function E(){var n=t.useDecaf(),o=n.me,a=n.publicConfig,i=r.useState(!1),c=i[0],d=i[1];return r.useEffect(function(){if(a.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src="https://static.zdassets.com/ekr/snippet.js?key="+a.zendesk,e.async=!0,e.id="ze-snippet",e.onload=function(){window.zE("webWidget","hide"),window.zE("webWidget:on","open",function(){window.zE("webWidget","show"),d(!0)}),window.zE("webWidget:on","close",function(){window.zE("webWidget","hide"),d(!1)})},document.body.appendChild(e),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":o.fullname}},{id:"email",prefill:{"*":o.email}}]}},function(){document.body.removeChild(e)}}},[a,o]),a.zendesk?u.default.createElement(l.Button,{size:"small",icon:u.default.createElement(e.QuestionCircleOutlined,null),onClick:function(){c?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),d(!c)}},"Support"):null}function w(e){var t=[];return e.forEach(function(e){var n={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?n.label=u.default.createElement(a.NavLink,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=u.default.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=w(e.children||[])),t.push(n)}),t}function v(n){var o=w(n.menu),r=a.useMatches().map(function(e){return e.pathname}),i=t.useDecaf().me,c=l.theme.useToken().token;return u.default.createElement(l.Layout,{style:{height:"100%"}},u.default.createElement(l.Layout.Header,{id:"decaf-header"},u.default.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},u.default.createElement(a.Link,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},n.appIcon,u.default.createElement(l.Typography.Title,{level:4,style:{margin:0}},n.appName)),u.default.createElement(l.Menu,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:o,selectedKeys:r}))),u.default.createElement(l.Layout.Content,{id:"decaf-content"},n.children),u.default.createElement(l.Layout.Footer,{id:"decaf-footer"},u.default.createElement(l.Row,{justify:"space-between",align:"middle"},u.default.createElement(l.Col,{span:10},u.default.createElement(E,null)),u.default.createElement(l.Col,{span:4},u.default.createElement(l.Typography.Text,{type:"secondary"},"Powered by"," ",u.default.createElement("b",null,u.default.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer",style:{color:c.colorText}},"Teloscube")))),u.default.createElement(l.Col,{span:10,style:{justifyContent:"flex-end",display:"flex"}},u.default.createElement(l.Button,{size:"small",icon:u.default.createElement(e.UserOutlined,null)},i.username),u.default.createElement(h,null),u.default.createElement(y,null),u.default.createElement(b,null)))))}var k={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},C={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:"#2c3d50"},Input:f({},k,{colorBgContainer:"#2c3d50"}),Select:f({},k,{colorBgContainer:"#2c3d50"}),Dropdown:f({},k,{colorBgElevated:"#2c3d50",controlItemBgActive:"#2c3d50"}),DatePicker:f({},k,{colorBgContainer:"#2c3d50",colorBgElevated:"#2c3d50"}),InputNumber:f({},k,{colorBgContainer:"#2c3d50"}),Checkbox:f({},k,{colorBgContainer:"#2c3d50"})},token:{fontFamily:"Lato, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:"#10161d",colorBgElevated:"#1a242f",colorBorderSecondary:"#1a242f",colorBorder:"#1a242f",colorBgLayout:"#1a242f",borderRadius:0,green:"#48734d",red:"#b03a38",blue:"#0d6efd",yellow:"#ffc107",orange:"#fd7e14",colorWhite:"#fff"},algorithm:[l.theme.darkAlgorithm]};function B(e,t){var n=[];return t.forEach(function(t){var o,l=f({},t);t.children?(l.element=null!=(o=t.element)?o:u.default.createElement(a.Outlet,null),l.children=B(e,t.children)):l.element=u.default.createElement(v,{menu:e.menuItems,appName:e.appName,appIcon:e.appIcon},t.element),n.push(l)}),n}function x(e,t,n){var o=[].concat(e);return t.forEach(function(e){var t=o.findIndex(function(t){return t[n]===e[n]});t>=0?o[t]=e:o.push(e)}),o}Object.defineProperty(exports,"GlobalStyle",{enumerable:!0,get:function(){return n.Global}}),Object.defineProperty(exports,"css",{enumerable:!0,get:function(){return n.css}}),Object.defineProperty(exports,"styled",{enumerable:!0,get:function(){return d.default}}),exports.DecafWebapp=function(o){var i,c,d;r.useEffect(function(){var e=document.createElement("script");return e.defer=!0,e.setAttribute("data-domain",location.hostname),e.src="https://webax.svc.sys.decafhub.com/js/plausible.js",document.body.appendChild(e),function(){document.body.removeChild(e)}},[]);var s=x(o.routes,[{path:"/about",element:u.default.createElement(p,{appName:o.appName,appVersion:null==(i=o.config)?void 0:i.currentVersion,appDescription:o.appDescription,content:o.aboutPageContent})},{path:"*",element:u.default.createElement(m,null)}],"path");s=B(f({},o,{menuItems:x(o.menuItems,[{label:"About",to:"/about",icon:u.default.createElement(e.InfoCircleOutlined,null)}],"to")}),s);var b=a.createBrowserRouter(s,{basename:null==(c=o.config)?void 0:c.basePath}),g=null!=(d=o.theme)?d:C,h=o.controller||t.DecafWebappController;h.disableZendeskWidget=!0;var y=function(e){var t,n,o,l,r;return{"@font-face":{fontFamily:"Lato, sans-serif",src:"url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)"},body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:null==(n=e.token)?void 0:n.fontFamily,margin:0},button:{boxShadow:"none !important"},".ant-page-header-back-button, .ant-page-header-heading-title":{color:(null==(o=e.token)?void 0:o.colorWhite)+" !important"},".ant-badge-count":{color:(null==(l=e.token)?void 0:l.colorWhite)+" !important"},"#decaf-header":{position:"fixed",zIndex:1030,right:0,left:0,paddingInline:0},"#decaf-content":{paddingInline:20,paddingTop:"5rem",paddingBottom:"5rem"},"#decaf-footer":{position:"fixed",bottom:0,right:0,left:0,background:null==(r=e.token)?void 0:r.colorBgContainer,paddingBlock:0,paddingInline:0},".dot":{borderRadius:"50%",width:10,height:10,display:"inline-block","&.green":{backgroundColor:"#80ff00 !important"},"&.yellow":{backgroundColor:"#ff0 !important"},"&.orange":{backgroundColor:"#ff7000 !important"},"&.red":{backgroundColor:"#ff0000 !important"}}}}(g);return u.default.createElement(l.ConfigProvider,{theme:g},u.default.createElement(n.Global,{styles:y}),u.default.createElement(t.DecafApp,{config:o.config,controller:h},u.default.createElement(a.RouterProvider,{router:b})))},exports.decafTheme=C;
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/components/PageAbout.tsx","../src/components/Page404.tsx","../src/components/PageScroller.tsx","../src/components/VersionSelector.tsx","../src/components/Screenshotter.tsx","../src/components/ZendeskWidget.tsx","../src/Layout.tsx","../src/theme.ts","../src/index.tsx","../src/style.ts"],"sourcesContent":["import { useDecaf } from '@decafhub/decaf-react';\nimport { Descriptions, Space } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nexport interface AboutPageProps {\n appName?: string;\n appVersion?: string;\n appDescription?: string;\n content?: React.ReactNode;\n}\nexport default function PageAbout(props: AboutPageProps) {\n const { client } = useDecaf();\n const [versionBarista, setVersionBarista] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n client.barista.get<{ version: string }>('/version/').then(({ data }) => setVersionBarista(data.version));\n }, [client]);\n\n return (\n <Space direction=\"vertical\" size=\"middle\" style={{ width: '100%' }}>\n <Descriptions title=\"About\" column={1} bordered>\n <Descriptions.Item label=\"Web Application Name\">{props.appName}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Description\">{props.appDescription}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Version\">{`v${props.appVersion}`}</Descriptions.Item>\n <Descriptions.Item label=\"DECAF Barista Version\">{`v${versionBarista}`}</Descriptions.Item>\n </Descriptions>\n {props.content}\n </Space>\n );\n}\n","import { Result } from 'antd';\nimport React from 'react';\n\nexport default function Page404() {\n return <Result status=\"404\" title={'404'} subTitle={'Sorry, the page you visited does not exist.'} />;\n}\n","import { DownOutlined, UpOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\nexport default function PageScroller() {\n return (\n <div>\n <Button\n title=\"Scroll to top\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}\n icon={<UpOutlined />}\n />\n <Button\n title=\"Scroll to bottom\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })}\n icon={<DownOutlined />}\n />\n </div>\n );\n}\n","import { CaretUpOutlined } from '@ant-design/icons';\nimport { Button, Dropdown } from 'antd';\nimport React from 'react';\n\nexport type Version = {\n code: string;\n name: string;\n color: string;\n url: string;\n show: boolean;\n};\n\nfunction getAppNameFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 1];\n }\n}\n\nfunction getAppVersionFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 2];\n }\n}\n\nfunction getCurrentAppPath(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts.slice(indexOfWebapps + 3).join('/');\n }\n}\n\nexport default function VersionSelector() {\n const appName = getAppNameFromUrl(window.location.href);\n const appVersion = getAppVersionFromUrl(window.location.href);\n\n const versions: Version[] = [\n {\n code: 'development',\n name: 'Development Version',\n color: 'red',\n url: `/webapps/${appName}/development/${getCurrentAppPath(window.location.href)}`,\n show: process.env.NODE_ENV === 'development',\n },\n {\n code: 'testing',\n name: 'Testing Version',\n color: 'orange',\n url: `/webapps/${appName}/testing/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'staging',\n name: 'Staging Version',\n color: 'yellow',\n url: `/webapps/${appName}/staging/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'production',\n name: 'Production Version',\n color: 'green',\n url: `/webapps/${appName}/production/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n ];\n const currentVersion = versions.find((v) => v.code === appVersion);\n\n if (!currentVersion) {\n return null;\n }\n\n return (\n <Dropdown\n placement=\"top\"\n arrow\n menu={{\n items: versions.map((version) => ({\n key: version.name,\n label: (\n <span>\n <i className={`dot ${version.color}`} /> {version.name}\n </span>\n ),\n onClick: () => {\n window.location.href = version.url;\n },\n })),\n }}\n >\n <Button type=\"text\" size=\"small\">\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <i className={`dot ${currentVersion?.color}`} style={{ marginRight: 5 }} />\n <CaretUpOutlined />\n </div>\n </Button>\n </Dropdown>\n );\n}\n","import { CameraOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport html2canvas from 'html2canvas';\nimport React from 'react';\n\nexport interface ScreenShotterProps {\n triggerNode?: React.ReactNode;\n}\nexport default function ScreenShotter(props: ScreenShotterProps) {\n async function handleScreenshot() {\n // hide footer before taking screenshot\n const footer = document.getElementById('decaf-footer');\n footer?.style.setProperty('display', 'none');\n\n const canvas = await html2canvas(document.body);\n const dataUrl = canvas.toDataURL('image/png');\n\n // show footer after taking screenshot\n footer?.style.setProperty('display', 'block');\n\n const link = document.createElement('a');\n link.download = 'screenshot.png';\n link.href = dataUrl;\n link.click();\n link.remove();\n }\n\n if (props.triggerNode) {\n return React.cloneElement(props.triggerNode as React.ReactElement, {\n onClick: handleScreenshot,\n });\n } else {\n return (\n <Button\n title=\"Take a screenshot of the current page\"\n type=\"text\"\n size=\"small\"\n icon={<CameraOutlined />}\n onClick={handleScreenshot}\n />\n );\n }\n}\n","import { QuestionCircleOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nconst ZENDESK_WIDGET_SCRIPT = 'https://static.zdassets.com/ekr/snippet.js';\n\ndeclare global {\n // eslint-disable-next-line no-unused-vars\n interface Window {\n zE: any;\n zESettings: any;\n }\n}\n\nexport default function ZendeskWidget() {\n const { me, publicConfig } = useDecaf();\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (!publicConfig.zendesk || typeof document === 'undefined') return;\n const script = document.createElement('script');\n script.src = ZENDESK_WIDGET_SCRIPT + '?key=' + publicConfig.zendesk;\n script.async = true;\n script.id = 'ze-snippet'; // do not change this. zendesk expects this to be ze-snippet\n script.onload = () => {\n window.zE('webWidget', 'hide');\n window.zE('webWidget:on', 'open', () => {\n window.zE('webWidget', 'show');\n setOpen(true);\n });\n window.zE('webWidget:on', 'close', () => {\n window.zE('webWidget', 'hide');\n setOpen(false);\n });\n };\n\n document.body.appendChild(script);\n window.zESettings = {\n webWidget: {\n offset: {\n horizontal: -7,\n vertical: 20,\n },\n },\n contactForm: {\n subject: true,\n fields: [\n {\n id: 'name',\n prefill: { '*': me.fullname },\n },\n {\n id: 'email',\n prefill: { '*': me.email },\n },\n ],\n },\n };\n\n return () => {\n document.body.removeChild(script);\n };\n }, [publicConfig, me]);\n\n function toggle() {\n if (open) {\n window.zE?.('webWidget', 'close');\n } else {\n window.zE?.('webWidget', 'open');\n }\n setOpen(!open);\n }\n\n if (!publicConfig.zendesk) return null;\n\n return (\n <Button size=\"small\" icon={<QuestionCircleOutlined />} onClick={toggle}>\n Support\n </Button>\n );\n}\n","import { UserOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button, Col, Layout, Menu, Row, theme, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport PageScroller from './components/PageScroller';\nimport VersionSelector from './components/VersionSelector';\nimport React from 'react';\nimport { Link, NavLink, useMatches } from 'react-router-dom';\nimport ScreenShotter from './components/Screenshotter';\nimport ZendeskWidget from './components/ZendeskWidget';\n\ninterface BaseDecafMenuItem {\n label: any;\n icon?: React.ReactNode;\n children?: DecafMenuItem[];\n}\n\nexport type DecafMenuItem = BaseDecafMenuItem & ({ to?: string } | { href?: string });\n\nexport interface DecafLayoutProps {\n menu: DecafMenuItem[];\n appName: string;\n appIcon?: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport function routesToAntMenu(routes: DecafMenuItem[]): ItemType[] {\n const result: ItemType[] = [];\n routes.forEach((route) => {\n const item: ItemType = {\n key: 'to' in route ? route.to : route.label,\n label: route.label,\n icon: route.icon,\n };\n if ('to' in route && route.to) {\n item.label = (\n <NavLink to={route.to} end={route.to === '/'}>\n {route.label}\n </NavLink>\n );\n } else if ('href' in route && route.href) {\n item.label = <a href={route.href}>{route.label}</a>;\n } else if (route.children) {\n item.label = route.label;\n (item as SubMenuType).children = routesToAntMenu(route.children || []);\n }\n result.push(item);\n });\n\n return result;\n}\n\nexport default function DecafLayout(props: DecafLayoutProps) {\n const menuItems = routesToAntMenu(props.menu);\n const matches = useMatches();\n const matchedMenuItems = matches.map((match) => match.pathname);\n const { me } = useDecaf();\n const { token } = theme.useToken();\n\n return (\n <Layout style={{ height: '100%' }}>\n <Layout.Header id=\"decaf-header\">\n <div style={{ paddingInline: 20, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>\n <Link to=\"/\" style={{ display: 'flex', alignItems: 'center', gap: 10 }}>\n {props.appIcon}\n <Typography.Title level={4} style={{ margin: 0 }}>\n {props.appName}\n </Typography.Title>\n </Link>\n <Menu\n style={{ justifyContent: 'flex-end', backgroundColor: 'transparent', border: 'none', flex: 1 }}\n mode=\"horizontal\"\n items={menuItems}\n selectedKeys={matchedMenuItems}\n />\n </div>\n </Layout.Header>\n <Layout.Content id=\"decaf-content\">{props.children}</Layout.Content>\n <Layout.Footer id=\"decaf-footer\">\n <Row justify=\"space-between\" align={'middle'}>\n <Col span={10}>\n <ZendeskWidget />\n </Col>\n <Col span={4}>\n <Typography.Text type=\"secondary\">\n Powered by{' '}\n <b>\n <a href=\"https://teloscube.com\" target=\"_blank\" rel=\"noreferrer\" style={{ color: token.colorText }}>\n Teloscube\n </a>\n </b>\n </Typography.Text>\n </Col>\n <Col span={10} style={{ justifyContent: 'flex-end', display: 'flex' }}>\n <Button size=\"small\" icon={<UserOutlined />}>\n {me.username}\n </Button>\n <VersionSelector />\n <ScreenShotter />\n <PageScroller />\n </Col>\n </Row>\n </Layout.Footer>\n </Layout>\n );\n}\n","import { theme } from 'antd';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nconst BORDER_COLORS_TRANSPARENT = {\n colorBorder: '#10161d',\n colorBorderSecondary: '#10161d',\n};\n\nconst INPUT_BG_COLOR = '#2c3d50';\n\nexport const decafTheme: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: '#10161d',\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n colorBgContainer: INPUT_BG_COLOR,\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgElevated: INPUT_BG_COLOR,\n controlItemBgActive: INPUT_BG_COLOR,\n },\n DatePicker: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n colorBgElevated: INPUT_BG_COLOR,\n },\n InputNumber: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Checkbox: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n },\n token: {\n fontFamily: 'Lato, sans-serif',\n colorPrimary: '#344961',\n colorBgBase: '#1a242f',\n colorBgContainer: '#10161d',\n colorBgElevated: '#1a242f',\n colorBorderSecondary: '#1a242f',\n colorBorder: '#1a242f',\n colorBgLayout: '#1a242f',\n borderRadius: 0,\n green: '#48734d',\n red: '#b03a38',\n blue: '#0d6efd',\n yellow: '#ffc107',\n orange: '#fd7e14',\n colorWhite: '#fff',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n","import { InfoCircleOutlined } from '@ant-design/icons';\nimport { DecafApp, DecafAppConfig, DecafAppController, DecafWebappController } from '@decafhub/decaf-react';\nimport { css, Global } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { ConfigProvider } from 'antd';\nimport 'antd/dist/reset.css';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport PageAbout from './components/PageAbout';\nimport React from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport { getStyles } from './style';\nimport Page404 from './components/Page404';\nimport DecafLayout, { DecafMenuItem } from './Layout';\nimport { decafTheme } from './theme';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n theme?: ThemeConfig;\n /**\n * App routes.<br />\n * About page and 404 page will be added automatically.<br />\n * See https://reactrouter.com/en/main/routers/create-browser-router#routes\n */\n routes: DecafRoute[];\n /**\n * App menu.<br />\n * About page will be added automatically.\n */\n menuItems: DecafMenuItem[];\n appName: string;\n appDescription?: string;\n appIcon?: React.ReactNode;\n /**\n * The extra content to show on the about page.\n */\n aboutPageContent?: React.ReactNode;\n}\n\nfunction buildRoutes(props: DecafWebappProps, routes: DecafRoute[]): RouteObject[] {\n const result: RouteObject[] = [];\n\n routes.forEach((route) => {\n const item: RouteObject = { ...route };\n if (route.children) {\n item.element = route.element ?? <Outlet />;\n item.children = buildRoutes(props, route.children);\n } else {\n item.element = (\n <DecafLayout menu={props.menuItems} appName={props.appName} appIcon={props.appIcon}>\n {route.element}\n </DecafLayout>\n );\n }\n result.push(item);\n });\n\n return result;\n}\n\nfunction addTo<T>(array: T[], items: T[], key: keyof T): T[] {\n const result: T[] = [...array];\n items.forEach((item) => {\n const index = result.findIndex((r) => r[key] === item[key]);\n if (index >= 0) {\n result[index] = item;\n } else {\n result.push(item);\n }\n });\n return result;\n}\n\nfunction DecafWebapp(props: DecafWebappProps) {\n let routes = addTo<RouteObject>(\n props.routes,\n [\n {\n path: '/about',\n element: (\n <PageAbout\n appName={props.appName}\n appVersion={props.config?.currentVersion}\n appDescription={props.appDescription}\n content={props.aboutPageContent}\n />\n ),\n },\n { path: '*', element: <Page404 /> },\n ],\n 'path'\n );\n const menuWithAboutPage = addTo(\n props.menuItems,\n [\n {\n label: 'About',\n to: '/about',\n icon: <InfoCircleOutlined />,\n },\n ],\n 'to' as any\n );\n routes = buildRoutes({ ...props, menuItems: menuWithAboutPage }, routes);\n\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const theme = props.theme ?? decafTheme;\n\n const controller = props.controller || DecafWebappController;\n controller.disableZendeskWidget = true;\n\n const globalStyles = getStyles(theme);\n\n return (\n <ConfigProvider theme={theme}>\n <Global styles={globalStyles} />\n <DecafApp config={props.config} controller={controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ConfigProvider>\n );\n}\n\nexport { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme };\n","import { Interpolation, Theme } from '@emotion/react';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nexport function getStyles(theme: ThemeConfig): Interpolation<Theme> {\n return {\n '@font-face': {\n fontFamily: 'Lato, sans-serif',\n src: 'url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)',\n },\n body: {\n background: theme.token?.colorBgBase,\n fontFamily: theme.token?.fontFamily,\n margin: 0,\n },\n // antd overrides\n button: {\n boxShadow: 'none !important',\n },\n '.ant-page-header-back-button, .ant-page-header-heading-title': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-badge-count': {\n color: `${theme.token?.colorWhite} !important`,\n },\n // end antd overrides\n '#decaf-header': {\n position: 'fixed',\n zIndex: 1030,\n right: 0,\n left: 0,\n paddingInline: 0,\n },\n '#decaf-content': {\n paddingInline: 20,\n paddingTop: '5rem',\n paddingBottom: '5rem',\n },\n '#decaf-footer': {\n position: 'fixed',\n bottom: 0,\n right: 0,\n left: 0,\n background: theme.token?.colorBgContainer,\n paddingBlock: 0,\n paddingInline: 0,\n },\n '.dot': {\n borderRadius: '50%',\n width: 10,\n height: 10,\n display: 'inline-block',\n '&.green': {\n backgroundColor: `#80ff00 !important`,\n },\n '&.yellow': {\n backgroundColor: `#ff0 !important`,\n },\n '&.orange': {\n backgroundColor: `#ff7000 !important`,\n },\n '&.red': {\n backgroundColor: `#ff0000 !important`,\n },\n },\n };\n}\n"],"names":["PageAbout","props","client","useDecaf","_useState","useState","undefined","versionBarista","setVersionBarista","useEffect","barista","get","then","data","version","React","createElement","Space","direction","size","style","width","Descriptions","title","column","bordered","Item","label","appName","appDescription","appVersion","content","Page404","Result","status","subTitle","PageScroller","Button","type","onClick","window","scrollTo","top","behavior","icon","UpOutlined","document","body","scrollHeight","DownOutlined","getCurrentAppPath","url","parts","split","indexOfWebapps","indexOf","slice","join","VersionSelector","location","href","getAppVersionFromUrl","versions","code","name","color","show","process","env","NODE_ENV","currentVersion","find","v","Dropdown","placement","arrow","menu","items","map","key","className","display","alignItems","marginRight","CaretUpOutlined","ScreenShotter","handleScreenshot","getElementById","footer","setProperty","Promise","resolve","html2canvas","canvas","dataUrl","toDataURL","link","download","click","remove","e","reject","triggerNode","cloneElement","CameraOutlined","ZendeskWidget","me","_useDecaf","publicConfig","open","setOpen","zendesk","script","src","ZENDESK_WIDGET_SCRIPT","async","id","onload","zE","appendChild","zESettings","webWidget","offset","horizontal","vertical","contactForm","subject","fields","prefill","fullname","email","removeChild","QuestionCircleOutlined","routesToAntMenu","routes","forEach","route","item","to","NavLink","end","children","result","push","DecafLayout","menuItems","matchedMenuItems","useMatches","match","pathname","token","theme","useToken","Layout","height","Header","paddingInline","justifyContent","Link","gap","appIcon","Typography","Title","level","margin","Menu","backgroundColor","border","flex","mode","selectedKeys","Content","Footer","Row","justify","align","Col","span","Text","target","rel","colorText","UserOutlined","username","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","decafTheme","hashed","components","colorBgHeader","boxShadow","boxShadowSecondary","colorBgContainer","Input","Select","colorBgElevated","controlItemBgActive","DatePicker","InputNumber","Checkbox","fontFamily","colorPrimary","colorBgBase","colorBgLayout","borderRadius","green","red","blue","yellow","orange","colorWhite","algorithm","darkAlgorithm","buildRoutes","_route$element","element","Outlet","addTo","array","index","findIndex","r","_props$config","_props$config2","_props$theme","path","config","aboutPageContent","_extends","InfoCircleOutlined","router","createBrowserRouter","basename","basePath","controller","DecafWebappController","disableZendeskWidget","globalStyles","_theme$token","_theme$token2","_theme$token3","_theme$token4","_theme$token5","background","button","position","zIndex","right","left","paddingTop","paddingBottom","bottom","paddingBlock","getStyles","ConfigProvider","Global","styles","DecafApp","RouterProvider"],"mappings":"0mBAUwBA,SAAAA,EAAUC,GAChC,IAAQC,EAAWC,EAAAA,WAAXD,OACRE,EAA4CC,EAAQA,cAAqBC,GAAlEC,OAAgBC,EAAiBJ,EAAA,GAMxC,OAJAK,EAAAA,UAAU,WACRP,EAAOQ,QAAQC,IAAyB,aAAaC,KAAK,SAAGC,GAAI,WAAJA,KAAkCC,QAAQ,EACzG,EAAG,CAACZ,IAGFa,EAAAA,QAACC,cAAAC,EAAKA,OAACC,UAAU,WAAWC,KAAK,SAASC,MAAO,CAAEC,MAAO,SACxDN,EAAAA,QAACC,cAAAM,eAAa,CAAAC,MAAM,QAAQC,OAAQ,EAAGC,UAAQ,GAC7CV,EAAC,QAAAC,cAAAM,eAAaI,KAAK,CAAAC,MAAM,wBAAwB1B,EAAM2B,SACvDb,EAAAA,QAACC,cAAAM,EAAAA,aAAaI,KAAK,CAAAC,MAAM,+BAA+B1B,EAAM4B,gBAC9Dd,EAAA,QAAAC,cAACM,EAAYA,aAACI,KAAI,CAACC,MAAM,2BAAyB,IAAM1B,EAAM6B,YAC9Df,EAAAA,QAAAC,cAACM,eAAaI,KAAI,CAACC,MAAM,6BAA6BpB,IAEvDN,EAAM8B,QAGb,CC1BwBC,SAAAA,IACtB,OAAQjB,UAAAC,cAAAiB,EAAAA,OAAO,CAAAC,OAAO,MAAMX,MAAO,MAAOY,SAAU,+CACtD,CCDwBC,SAAAA,IACtB,OACErB,EAAA,QAAAC,cAAA,MAAA,KACED,EAAA,QAAAC,cAACqB,EAAMA,OACL,CAAAd,MAAM,gBACNe,KA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M,WAAY,SAAA7F,EAAMD,YAAN,EAAAyF,EAAapC,YACzBF,kBAAYlD,EAAAA,EAAMD,cAAN0F,EAAavC,WACzBrC,OAAQ,GAGViF,OAAQ,CACNtD,UAAW,mBAEb,+DAAgE,CAC9D9H,OAAqB,OAAhBgL,EAAK1F,EAAMD,YAAK,EAAX2F,EAAa9B,YAAU,eAEnC,mBAAoB,CAClBlJ,cAAUsF,EAAAA,EAAMD,cAAN4F,EAAa/B,2BAGzB,gBAAiB,CACfmC,SAAU,QACVC,OAAQ,KACRC,MAAO,EACPC,KAAM,EACN7F,cAAe,GAEjB,iBAAkB,CAChBA,cAAe,GACf8F,WAAY,OACZC,cAAe,QAEjB,gBAAiB,CACfL,SAAU,QACVM,OAAQ,EACRJ,MAAO,EACPC,KAAM,EACNL,WAAY,SAAA7F,EAAMD,YAAN,EAAA6F,EAAalD,iBACzB4D,aAAc,EACdjG,cAAe,GAEjB,OAAQ,CACNiD,aAAc,MACdxL,MAAO,GACPqI,OAAQ,GACRzE,QAAS,eACT,UAAW,CACTqF,gBACD,sBACD,WAAY,CACVA,gBAAe,mBAEjB,WAAY,CACVA,gBAAe,sBAEjB,QAAS,CACPA,gBAAe,uBAIvB,CDmDuBwF,CAAUvG,GAE/B,OACExI,EAAC,QAAAC,cAAA+O,EAAcA,eAAC,CAAAxG,MAAOA,GACrBxI,UAAAC,cAACgP,EAAAA,OAAM,CAACC,OAAQnB,IAChB/N,EAAC,QAAAC,cAAAkP,EAAAA,SAAS,CAAA/B,OAAQlO,EAAMkO,OAAQQ,WAAYA,GAC1C5N,EAAAA,QAACC,cAAAmP,EAAAA,gBAAe5B,OAAQA,KAIhC"}
1
+ {"version":3,"file":"index.js","sources":["../src/components/Page404.tsx","../src/components/PageAbout.tsx","../src/components/PageScroller.tsx","../src/components/VersionSelector.tsx","../src/components/Screenshotter.tsx","../src/components/ZendeskWidget.tsx","../src/Layout.tsx","../src/theme.ts","../src/index.tsx","../src/style.ts"],"sourcesContent":["import { Result } from 'antd';\nimport React from 'react';\n\nexport default function Page404() {\n return <Result status=\"404\" title={'404'} subTitle={'Sorry, the page you visited does not exist.'} />;\n}\n","import { useDecaf } from '@decafhub/decaf-react';\nimport { Descriptions, Space } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nexport interface AboutPageProps {\n appName?: string;\n appVersion?: string;\n appDescription?: string;\n content?: React.ReactNode;\n}\nexport default function PageAbout(props: AboutPageProps) {\n const { client } = useDecaf();\n const [versionBarista, setVersionBarista] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n client.barista.get<{ version: string }>('/version/').then(({ data }) => setVersionBarista(data.version));\n }, [client]);\n\n return (\n <Space direction=\"vertical\" size=\"middle\" style={{ width: '100%' }}>\n <Descriptions title=\"About\" column={1} bordered>\n <Descriptions.Item label=\"Web Application Name\">{props.appName}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Description\">{props.appDescription}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Version\">{`v${props.appVersion}`}</Descriptions.Item>\n <Descriptions.Item label=\"DECAF Barista Version\">{`v${versionBarista}`}</Descriptions.Item>\n </Descriptions>\n {props.content}\n </Space>\n );\n}\n","import { DownOutlined, UpOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\nexport default function PageScroller() {\n return (\n <div>\n <Button\n title=\"Scroll to top\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}\n icon={<UpOutlined />}\n />\n <Button\n title=\"Scroll to bottom\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })}\n icon={<DownOutlined />}\n />\n </div>\n );\n}\n","import { CaretUpOutlined } from '@ant-design/icons';\nimport { Button, Dropdown } from 'antd';\nimport React from 'react';\n\nexport type Version = {\n code: string;\n name: string;\n color: string;\n url: string;\n show: boolean;\n};\n\nfunction getAppNameFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 1];\n }\n}\n\nfunction getAppVersionFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 2];\n }\n}\n\nfunction getCurrentAppPath(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts.slice(indexOfWebapps + 3).join('/');\n }\n}\n\nexport default function VersionSelector() {\n const appName = getAppNameFromUrl(window.location.href);\n const appVersion = getAppVersionFromUrl(window.location.href);\n\n const versions: Version[] = [\n {\n code: 'development',\n name: 'Development Version',\n color: 'red',\n url: `/webapps/${appName}/development/${getCurrentAppPath(window.location.href)}`,\n show: process.env.NODE_ENV === 'development',\n },\n {\n code: 'testing',\n name: 'Testing Version',\n color: 'orange',\n url: `/webapps/${appName}/testing/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'staging',\n name: 'Staging Version',\n color: 'yellow',\n url: `/webapps/${appName}/staging/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'production',\n name: 'Production Version',\n color: 'green',\n url: `/webapps/${appName}/production/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n ];\n const currentVersion = versions.find((v) => v.code === appVersion);\n\n if (!currentVersion) {\n return null;\n }\n\n return (\n <Dropdown\n placement=\"top\"\n arrow\n menu={{\n items: versions.map((version) => ({\n key: version.name,\n label: (\n <span>\n <i className={`dot ${version.color}`} /> {version.name}\n </span>\n ),\n onClick: () => {\n window.location.href = version.url;\n },\n })),\n }}\n >\n <Button type=\"text\" size=\"small\">\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <i className={`dot ${currentVersion?.color}`} style={{ marginRight: 5 }} />\n <CaretUpOutlined />\n </div>\n </Button>\n </Dropdown>\n );\n}\n","import { CameraOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport html2canvas from 'html2canvas';\nimport React from 'react';\n\nexport interface ScreenShotterProps {\n triggerNode?: React.ReactNode;\n}\nexport default function ScreenShotter(props: ScreenShotterProps) {\n async function handleScreenshot() {\n // hide footer before taking screenshot\n const footer = document.getElementById('decaf-footer');\n footer?.style.setProperty('display', 'none');\n\n const canvas = await html2canvas(document.body);\n const dataUrl = canvas.toDataURL('image/png');\n\n // show footer after taking screenshot\n footer?.style.setProperty('display', 'block');\n\n const link = document.createElement('a');\n link.download = 'screenshot.png';\n link.href = dataUrl;\n link.click();\n link.remove();\n }\n\n if (props.triggerNode) {\n return React.cloneElement(props.triggerNode as React.ReactElement, {\n onClick: handleScreenshot,\n });\n } else {\n return (\n <Button\n title=\"Take a screenshot of the current page\"\n type=\"text\"\n size=\"small\"\n icon={<CameraOutlined />}\n onClick={handleScreenshot}\n />\n );\n }\n}\n","import { QuestionCircleOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nconst ZENDESK_WIDGET_SCRIPT = 'https://static.zdassets.com/ekr/snippet.js';\n\ndeclare global {\n // eslint-disable-next-line no-unused-vars\n interface Window {\n zE: any;\n zESettings: any;\n }\n}\n\nexport default function ZendeskWidget() {\n const { me, publicConfig } = useDecaf();\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (!publicConfig.zendesk || typeof document === 'undefined') return;\n const script = document.createElement('script');\n script.src = ZENDESK_WIDGET_SCRIPT + '?key=' + publicConfig.zendesk;\n script.async = true;\n script.id = 'ze-snippet'; // do not change this. zendesk expects this to be ze-snippet\n script.onload = () => {\n window.zE('webWidget', 'hide');\n window.zE('webWidget:on', 'open', () => {\n window.zE('webWidget', 'show');\n setOpen(true);\n });\n window.zE('webWidget:on', 'close', () => {\n window.zE('webWidget', 'hide');\n setOpen(false);\n });\n };\n\n document.body.appendChild(script);\n window.zESettings = {\n webWidget: {\n offset: {\n horizontal: -7,\n vertical: 20,\n },\n },\n contactForm: {\n subject: true,\n fields: [\n {\n id: 'name',\n prefill: { '*': me.fullname },\n },\n {\n id: 'email',\n prefill: { '*': me.email },\n },\n ],\n },\n };\n\n return () => {\n document.body.removeChild(script);\n };\n }, [publicConfig, me]);\n\n function toggle() {\n if (open) {\n window.zE?.('webWidget', 'close');\n } else {\n window.zE?.('webWidget', 'open');\n }\n setOpen(!open);\n }\n\n if (!publicConfig.zendesk) return null;\n\n return (\n <Button size=\"small\" icon={<QuestionCircleOutlined />} onClick={toggle}>\n Support\n </Button>\n );\n}\n","import { UserOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button, Col, Layout, Menu, Row, theme, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport PageScroller from './components/PageScroller';\nimport VersionSelector from './components/VersionSelector';\nimport React from 'react';\nimport { Link, NavLink, useMatches } from 'react-router-dom';\nimport ScreenShotter from './components/Screenshotter';\nimport ZendeskWidget from './components/ZendeskWidget';\n\ninterface BaseDecafMenuItem {\n label: any;\n icon?: React.ReactNode;\n children?: DecafMenuItem[];\n}\n\nexport type DecafMenuItem = BaseDecafMenuItem & ({ to?: string } | { href?: string });\n\nexport interface DecafLayoutProps {\n menu: DecafMenuItem[];\n appName: string;\n appIcon?: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport function routesToAntMenu(routes: DecafMenuItem[]): ItemType[] {\n const result: ItemType[] = [];\n routes.forEach((route) => {\n const item: ItemType = {\n key: 'to' in route ? route.to : route.label,\n label: route.label,\n icon: route.icon,\n };\n if ('to' in route && route.to) {\n item.label = (\n <NavLink to={route.to} end={route.to === '/'}>\n {route.label}\n </NavLink>\n );\n } else if ('href' in route && route.href) {\n item.label = <a href={route.href}>{route.label}</a>;\n } else if (route.children) {\n item.label = route.label;\n (item as SubMenuType).children = routesToAntMenu(route.children || []);\n }\n result.push(item);\n });\n\n return result;\n}\n\nexport default function DecafLayout(props: DecafLayoutProps) {\n const menuItems = routesToAntMenu(props.menu);\n const matches = useMatches();\n const matchedMenuItems = matches.map((match) => match.pathname);\n const { me } = useDecaf();\n const { token } = theme.useToken();\n\n return (\n <Layout style={{ height: '100%' }}>\n <Layout.Header id=\"decaf-header\">\n <div style={{ paddingInline: 20, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>\n <Link to=\"/\" style={{ display: 'flex', alignItems: 'center', gap: 10 }}>\n {props.appIcon}\n <Typography.Title level={4} style={{ margin: 0 }}>\n {props.appName}\n </Typography.Title>\n </Link>\n <Menu\n style={{ justifyContent: 'flex-end', backgroundColor: 'transparent', border: 'none', flex: 1 }}\n mode=\"horizontal\"\n items={menuItems}\n selectedKeys={matchedMenuItems}\n />\n </div>\n </Layout.Header>\n <Layout.Content id=\"decaf-content\">{props.children}</Layout.Content>\n <Layout.Footer id=\"decaf-footer\">\n <Row justify=\"space-between\" align={'middle'}>\n <Col span={10}>\n <ZendeskWidget />\n </Col>\n <Col span={4}>\n <Typography.Text type=\"secondary\">\n Powered by{' '}\n <b>\n <a href=\"https://teloscube.com\" target=\"_blank\" rel=\"noreferrer\" style={{ color: token.colorText }}>\n Teloscube\n </a>\n </b>\n </Typography.Text>\n </Col>\n <Col span={10} style={{ justifyContent: 'flex-end', display: 'flex' }}>\n <Button size=\"small\" icon={<UserOutlined />}>\n {me.username}\n </Button>\n <VersionSelector />\n <ScreenShotter />\n <PageScroller />\n </Col>\n </Row>\n </Layout.Footer>\n </Layout>\n );\n}\n","import { theme } from 'antd';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nconst BORDER_COLORS_TRANSPARENT = {\n colorBorder: '#10161d',\n colorBorderSecondary: '#10161d',\n};\n\nconst INPUT_BG_COLOR = '#2c3d50';\n\nexport const decafTheme: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: '#10161d',\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n colorBgContainer: INPUT_BG_COLOR,\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgElevated: INPUT_BG_COLOR,\n controlItemBgActive: INPUT_BG_COLOR,\n },\n DatePicker: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n colorBgElevated: INPUT_BG_COLOR,\n },\n InputNumber: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Checkbox: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n },\n token: {\n fontFamily: 'Lato, sans-serif',\n colorPrimary: '#344961',\n colorBgBase: '#1a242f',\n colorBgContainer: '#10161d',\n colorBgElevated: '#1a242f',\n colorBorderSecondary: '#1a242f',\n colorBorder: '#1a242f',\n colorBgLayout: '#1a242f',\n borderRadius: 0,\n green: '#48734d',\n red: '#b03a38',\n blue: '#0d6efd',\n yellow: '#ffc107',\n orange: '#fd7e14',\n colorWhite: '#fff',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n","import { InfoCircleOutlined } from '@ant-design/icons';\nimport { DecafApp, DecafAppConfig, DecafAppController, DecafWebappController } from '@decafhub/decaf-react';\nimport { css, Global } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { ConfigProvider } from 'antd';\nimport 'antd/dist/reset.css';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport React, { useEffect } from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport Page404 from './components/Page404';\nimport PageAbout from './components/PageAbout';\nimport DecafLayout, { DecafMenuItem } from './Layout';\nimport { getStyles } from './style';\nimport { decafTheme } from './theme';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n theme?: ThemeConfig;\n /**\n * App routes.<br />\n * About page and 404 page will be added automatically.<br />\n * See https://reactrouter.com/en/main/routers/create-browser-router#routes\n */\n routes: DecafRoute[];\n /**\n * App menu.<br />\n * About page will be added automatically.\n */\n menuItems: DecafMenuItem[];\n appName: string;\n appDescription?: string;\n appIcon?: React.ReactNode;\n /**\n * The extra content to show on the about page.\n */\n aboutPageContent?: React.ReactNode;\n}\n\nfunction buildRoutes(props: DecafWebappProps, routes: DecafRoute[]): RouteObject[] {\n const result: RouteObject[] = [];\n\n routes.forEach((route) => {\n const item: RouteObject = { ...route };\n if (route.children) {\n item.element = route.element ?? <Outlet />;\n item.children = buildRoutes(props, route.children);\n } else {\n item.element = (\n <DecafLayout menu={props.menuItems} appName={props.appName} appIcon={props.appIcon}>\n {route.element}\n </DecafLayout>\n );\n }\n result.push(item);\n });\n\n return result;\n}\n\nfunction addTo<T>(array: T[], items: T[], key: keyof T): T[] {\n const result: T[] = [...array];\n items.forEach((item) => {\n const index = result.findIndex((r) => r[key] === item[key]);\n if (index >= 0) {\n result[index] = item;\n } else {\n result.push(item);\n }\n });\n return result;\n}\n\nfunction DecafWebapp(props: DecafWebappProps) {\n useEffect(() => {\n // add plausible analytics\n const script = document.createElement('script');\n script.defer = true;\n script.setAttribute('data-domain', location.hostname);\n script.src = 'https://webax.svc.sys.decafhub.com/js/plausible.js';\n document.body.appendChild(script);\n\n return () => {\n document.body.removeChild(script);\n };\n }, []);\n\n let routes = addTo<RouteObject>(\n props.routes,\n [\n {\n path: '/about',\n element: (\n <PageAbout\n appName={props.appName}\n appVersion={props.config?.currentVersion}\n appDescription={props.appDescription}\n content={props.aboutPageContent}\n />\n ),\n },\n { path: '*', element: <Page404 /> },\n ],\n 'path'\n );\n const menuWithAboutPage = addTo(\n props.menuItems,\n [\n {\n label: 'About',\n to: '/about',\n icon: <InfoCircleOutlined />,\n },\n ],\n 'to' as any\n );\n routes = buildRoutes({ ...props, menuItems: menuWithAboutPage }, routes);\n\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const theme = props.theme ?? decafTheme;\n\n const controller = props.controller || DecafWebappController;\n controller.disableZendeskWidget = true;\n\n const globalStyles = getStyles(theme);\n\n return (\n <ConfigProvider theme={theme}>\n <Global styles={globalStyles} />\n <DecafApp config={props.config} controller={controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ConfigProvider>\n );\n}\n\nexport { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme };\n","import { Interpolation, Theme } from '@emotion/react';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nexport function getStyles(theme: ThemeConfig): Interpolation<Theme> {\n return {\n '@font-face': {\n fontFamily: 'Lato, sans-serif',\n src: 'url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)',\n },\n body: {\n background: theme.token?.colorBgBase,\n fontFamily: theme.token?.fontFamily,\n margin: 0,\n },\n // antd overrides\n button: {\n boxShadow: 'none !important',\n },\n '.ant-page-header-back-button, .ant-page-header-heading-title': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-badge-count': {\n color: `${theme.token?.colorWhite} !important`,\n },\n // end antd overrides\n '#decaf-header': {\n position: 'fixed',\n zIndex: 1030,\n right: 0,\n left: 0,\n paddingInline: 0,\n },\n '#decaf-content': {\n paddingInline: 20,\n paddingTop: '5rem',\n paddingBottom: '5rem',\n },\n '#decaf-footer': {\n position: 'fixed',\n bottom: 0,\n right: 0,\n left: 0,\n background: theme.token?.colorBgContainer,\n paddingBlock: 0,\n paddingInline: 0,\n },\n '.dot': {\n borderRadius: '50%',\n width: 10,\n height: 10,\n display: 'inline-block',\n '&.green': {\n backgroundColor: `#80ff00 !important`,\n },\n '&.yellow': {\n backgroundColor: `#ff0 !important`,\n },\n '&.orange': {\n backgroundColor: `#ff7000 !important`,\n },\n '&.red': {\n backgroundColor: `#ff0000 !important`,\n },\n },\n };\n}\n"],"names":["Page404","React","createElement","Result","status","title","subTitle","PageAbout","props","client","useDecaf","_useState","useState","undefined","versionBarista","setVersionBarista","useEffect","barista","get","then","data","version","Space","direction","size","style","width","Descriptions","column","bordered","Item","label","appName","appDescription","appVersion","content","PageScroller","Button","type","onClick","window","scrollTo","top","behavior","icon","UpOutlined","document","body","scrollHeight","DownOutlined","getCurrentAppPath","url","parts","split","indexOfWebapps","indexOf","slice","join","VersionSelector","location","href","getAppVersionFromUrl","versions","code","name","color","show","process","env","NODE_ENV","currentVersion","find","v","Dropdown","placement","arrow","menu","items","map","key","className","display","alignItems","marginRight","CaretUpOutlined","ScreenShotter","handleScreenshot","getElementById","footer","setProperty","Promise","resolve","html2canvas","canvas","dataUrl","toDataURL","link","download","click","remove","e","reject","triggerNode","cloneElement","CameraOutlined","ZendeskWidget","me","_useDecaf","publicConfig","open","setOpen","zendesk","script","src","ZENDESK_WIDGET_SCRIPT","async","id","onload","zE","appendChild","zESettings","webWidget","offset","horizontal","vertical","contactForm","subject","fields","prefill","fullname","email","removeChild","QuestionCircleOutlined","routesToAntMenu","routes","forEach","route","item","to","NavLink","end","children","result","push","DecafLayout","menuItems","matchedMenuItems","useMatches","match","pathname","token","theme","useToken","Layout","height","Header","paddingInline","justifyContent","Link","gap","appIcon","Typography","Title","level","margin","Menu","backgroundColor","border","flex","mode","selectedKeys","Content","Footer","Row","justify","align","Col","span","Text","target","rel","colorText","UserOutlined","username","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","decafTheme","hashed","components","colorBgHeader","boxShadow","boxShadowSecondary","colorBgContainer","Input","Select","colorBgElevated","controlItemBgActive","DatePicker","InputNumber","Checkbox","fontFamily","colorPrimary","colorBgBase","colorBgLayout","borderRadius","green","red","blue","yellow","orange","colorWhite","algorithm","darkAlgorithm","buildRoutes","_route$element","_extends","element","Outlet","addTo","array","concat","index","findIndex","r","defer","setAttribute","hostname","path","_props$config","config","aboutPageContent","InfoCircleOutlined","router","createBrowserRouter","basename","_props$config2","basePath","_props$theme","controller","DecafWebappController","disableZendeskWidget","globalStyles","_theme$token","_theme$token2","_theme$token3","_theme$token4","_theme$token5","background","button","position","zIndex","right","left","paddingTop","paddingBottom","bottom","paddingBlock","getStyles","ConfigProvider","Global","styles","DecafApp","RouterProvider"],"mappings":"0mBAGwBA,SAAAA,IACtB,OAAQC,UAAAC,cAAAC,EAAAA,OAAO,CAAAC,OAAO,MAAMC,MAAO,MAAOC,SAAU,+CACtD,CCKwBC,SAAAA,EAAUC,GAChC,IAAQC,EAAWC,EAAAA,WAAXD,OACRE,EAA4CC,EAAQA,cAAqBC,GAAlEC,OAAgBC,EAAiBJ,EAAA,GAMxC,OAJAK,EAAAA,UAAU,WACRP,EAAOQ,QAAQC,IAAyB,aAAaC,KAAK,SAAGC,GAAI,WAAJA,KAAkCC,QAAQ,EACzG,EAAG,CAACZ,IAGFR,EAAAA,QAACC,cAAAoB,EAAKA,OAACC,UAAU,WAAWC,KAAK,SAASC,MAAO,CAAEC,MAAO,SACxDzB,EAAAA,QAACC,cAAAyB,eAAa,CAAAtB,MAAM,QAAQuB,OAAQ,EAAGC,UAAQ,GAC7C5B,EAAC,QAAAC,cAAAyB,eAAaG,KAAK,CAAAC,MAAM,wBAAwBvB,EAAMwB,SACvD/B,EAAAA,QAACC,cAAAyB,EAAAA,aAAaG,KAAK,CAAAC,MAAM,+BAA+BvB,EAAMyB,gBAC9DhC,EAAA,QAAAC,cAACyB,EAAYA,aAACG,KAAI,CAACC,MAAM,2BAAyB,IAAMvB,EAAM0B,YAC9DjC,EAAAA,QAAAC,cAACyB,eAAaG,KAAI,CAACC,MAAM,6BAA6BjB,IAEvDN,EAAM2B,QAGb,CCzBwBC,SAAAA,IACtB,OACEnC,EAAA,QAAAC,cAAA,MAAA,KACED,EAAA,QAAAC,cAACmC,EAAMA,OACL,CAAAhC,MAAM,gBACNiC,KAAK,OACLd,KAAK,QACLe,QAAS,WAAMC,OAAAA,OAAOC,SAAS,CAAEC,IAAK,EAAGC,SAAU,UAAW,EAC9DC,KAAM3C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ameraOutlined as o,QuestionCircleOutlined as l,UserOutlined as r,InfoCircleOutlined as a}from"@ant-design/icons";import{useDecaf as i,DecafApp as c,DecafWebappController as d}from"@decafhub/decaf-react";import{Global as s}from"@emotion/react";export{Global as GlobalStyle,css}from"@emotion/react";export{default as styled}from"@emotion/styled";import{Space as m,Descriptions as p,Result as u,Button as f,Dropdown as g,theme as b,Layout as h,Typography as E,Menu as w,Row as y,Col as v,ConfigProvider as k}from"antd";import"antd/dist/reset.css";import C,{useState as x,useEffect as B}from"react";import{useMatches as z,Link as I,NavLink as W,createBrowserRouter as N,RouterProvider as S,Outlet as $}from"react-router-dom";import T from"html2canvas";function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},j.apply(this,arguments)}function D(e){const{client:t}=i(),[n,o]=x(void 0);return B(()=>{t.barista.get("/version/").then(({data:e})=>o(e.version))},[t]),C.createElement(m,{direction:"vertical",size:"middle",style:{width:"100%"}},C.createElement(p,{title:"About",column:1,bordered:!0},C.createElement(p.Item,{label:"Web Application Name"},e.appName),C.createElement(p.Item,{label:"Web Application Description"},e.appDescription),C.createElement(p.Item,{label:"Web Application Version"},`v${e.appVersion}`),C.createElement(p.Item,{label:"DECAF Barista Version"},`v${n}`)),e.content)}function V(){return C.createElement(u,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function P(){return C.createElement("div",null,C.createElement(f,{title:"Scroll to top",type:"text",size:"small",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),icon:C.createElement(e,null)}),C.createElement(f,{title:"Scroll to bottom",type:"text",size:"small",onClick:()=>window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"}),icon:C.createElement(t,null)}))}function A(e){const t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function O(){const e=function(e){const t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+1]}(),t=function(e){const t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),o=[{code:"development",name:"Development Version",color:"red",url:`/webapps/${e}/development/${A(window.location.href)}`,show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:`/webapps/${e}/testing/${A(window.location.href)}`,show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:`/webapps/${e}/staging/${A(window.location.href)}`,show:!0},{code:"production",name:"Production Version",color:"green",url:`/webapps/${e}/production/${A(window.location.href)}`,show:!0}],l=o.find(e=>e.code===t);return l?C.createElement(g,{placement:"top",arrow:!0,menu:{items:o.map(e=>({key:e.name,label:C.createElement("span",null,C.createElement("i",{className:`dot ${e.color}`})," ",e.name),onClick:()=>{window.location.href=e.url}}))}},C.createElement(f,{type:"text",size:"small"},C.createElement("div",{style:{display:"flex",alignItems:"center"}},C.createElement("i",{className:`dot ${null==l?void 0:l.color}`,style:{marginRight:5}}),C.createElement(n,null)))):null}function F(e){async function t(){const e=document.getElementById("decaf-footer");null==e||e.style.setProperty("display","none");const t=(await T(document.body)).toDataURL("image/png");null==e||e.style.setProperty("display","block");const n=document.createElement("a");n.download="screenshot.png",n.href=t,n.click(),n.remove()}return e.triggerNode?C.cloneElement(e.triggerNode,{onClick:t}):C.createElement(f,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:C.createElement(o,null),onClick:t})}function L(){const{me:e,publicConfig:t}=i(),[n,o]=x(!1);return B(()=>{if(!t.zendesk||"undefined"==typeof document)return;const n=document.createElement("script");return n.src="https://static.zdassets.com/ekr/snippet.js?key="+t.zendesk,n.async=!0,n.id="ze-snippet",n.onload=()=>{window.zE("webWidget","hide"),window.zE("webWidget:on","open",()=>{window.zE("webWidget","show"),o(!0)}),window.zE("webWidget:on","close",()=>{window.zE("webWidget","hide"),o(!1)})},document.body.appendChild(n),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":e.fullname}},{id:"email",prefill:{"*":e.email}}]}},()=>{document.body.removeChild(n)}},[t,e]),t.zendesk?C.createElement(f,{size:"small",icon:C.createElement(l,null),onClick:function(){n?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),o(!n)}},"Support"):null}function R(e){const t=[];return e.forEach(e=>{const n={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?n.label=C.createElement(W,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=C.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=R(e.children||[])),t.push(n)}),t}function H(e){const t=R(e.menu),n=z().map(e=>e.pathname),{me:o}=i(),{token:l}=b.useToken();return C.createElement(h,{style:{height:"100%"}},C.createElement(h.Header,{id:"decaf-header"},C.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},C.createElement(I,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},e.appIcon,C.createElement(E.Title,{level:4,style:{margin:0}},e.appName)),C.createElement(w,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:t,selectedKeys:n}))),C.createElement(h.Content,{id:"decaf-content"},e.children),C.createElement(h.Footer,{id:"decaf-footer"},C.createElement(y,{justify:"space-between",align:"middle"},C.createElement(v,{span:10},C.createElement(L,null)),C.createElement(v,{span:4},C.createElement(E.Text,{type:"secondary"},"Powered by"," ",C.createElement("b",null,C.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer",style:{color:l.colorText}},"Teloscube")))),C.createElement(v,{span:10,style:{justifyContent:"flex-end",display:"flex"}},C.createElement(f,{size:"small",icon:C.createElement(r,null)},o.username),C.createElement(O,null),C.createElement(F,null),C.createElement(P,null)))))}const G={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},_={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:"#2c3d50"},Input:j({},G,{colorBgContainer:"#2c3d50"}),Select:j({},G,{colorBgContainer:"#2c3d50"}),Dropdown:j({},G,{colorBgElevated:"#2c3d50",controlItemBgActive:"#2c3d50"}),DatePicker:j({},G,{colorBgContainer:"#2c3d50",colorBgElevated:"#2c3d50"}),InputNumber:j({},G,{colorBgContainer:"#2c3d50"}),Checkbox:j({},G,{colorBgContainer:"#2c3d50"})},token:{fontFamily:"Lato, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:"#10161d",colorBgElevated:"#1a242f",colorBorderSecondary:"#1a242f",colorBorder:"#1a242f",colorBgLayout:"#1a242f",borderRadius:0,green:"#48734d",red:"#b03a38",blue:"#0d6efd",yellow:"#ffc107",orange:"#fd7e14",colorWhite:"#fff"},algorithm:[b.darkAlgorithm]};function K(e,t){const n=[];return t.forEach(t=>{const o=j({},t);var l;t.children?(o.element=null!=(l=t.element)?l:C.createElement($,null),o.children=K(e,t.children)):o.element=C.createElement(H,{menu:e.menuItems,appName:e.appName,appIcon:e.appIcon},t.element),n.push(o)}),n}function U(e,t,n){const o=[...e];return t.forEach(e=>{const t=o.findIndex(t=>t[n]===e[n]);t>=0?o[t]=e:o.push(e)}),o}function Z(e){var t,n,o;let l=U(e.routes,[{path:"/about",element:C.createElement(D,{appName:e.appName,appVersion:null==(t=e.config)?void 0:t.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:C.createElement(V,null)}],"path");l=K(j({},e,{menuItems:U(e.menuItems,[{label:"About",to:"/about",icon:C.createElement(a,null)}],"to")}),l);const r=N(l,{basename:null==(n=e.config)?void 0:n.basePath}),i=null!=(o=e.theme)?o:_,m=e.controller||d;m.disableZendeskWidget=!0;const p=function(e){var t,n,o,l,r;return{"@font-face":{fontFamily:"Lato, sans-serif",src:"url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)"},body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:null==(n=e.token)?void 0:n.fontFamily,margin:0},button:{boxShadow:"none !important"},".ant-page-header-back-button, .ant-page-header-heading-title":{color:`${null==(o=e.token)?void 0:o.colorWhite} !important`},".ant-badge-count":{color:`${null==(l=e.token)?void 0:l.colorWhite} !important`},"#decaf-header":{position:"fixed",zIndex:1030,right:0,left:0,paddingInline:0},"#decaf-content":{paddingInline:20,paddingTop:"5rem",paddingBottom:"5rem"},"#decaf-footer":{position:"fixed",bottom:0,right:0,left:0,background:null==(r=e.token)?void 0:r.colorBgContainer,paddingBlock:0,paddingInline:0},".dot":{borderRadius:"50%",width:10,height:10,display:"inline-block","&.green":{backgroundColor:"#80ff00 !important"},"&.yellow":{backgroundColor:"#ff0 !important"},"&.orange":{backgroundColor:"#ff7000 !important"},"&.red":{backgroundColor:"#ff0000 !important"}}}}(i);return C.createElement(k,{theme:i},C.createElement(s,{styles:p}),C.createElement(c,{config:e.config,controller:m},C.createElement(S,{router:r})))}export{Z as DecafWebapp,_ as decafTheme};
1
+ import{UpOutlined as e,DownOutlined as t,CaretUpOutlined as n,CameraOutlined as o,QuestionCircleOutlined as l,UserOutlined as r,InfoCircleOutlined as a}from"@ant-design/icons";import{useDecaf as i,DecafApp as c,DecafWebappController as d}from"@decafhub/decaf-react";import{Global as s}from"@emotion/react";export{Global as GlobalStyle,css}from"@emotion/react";export{default as styled}from"@emotion/styled";import{Result as m,Space as p,Descriptions as u,Button as f,Dropdown as g,theme as b,Layout as h,Typography as E,Menu as w,Row as y,Col as v,ConfigProvider as k}from"antd";import"antd/dist/reset.css";import C,{useState as x,useEffect as B}from"react";import{useMatches as z,Link as I,NavLink as W,createBrowserRouter as N,RouterProvider as S,Outlet as $}from"react-router-dom";import j from"html2canvas";function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},T.apply(this,arguments)}function D(){return C.createElement(m,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function V(e){const{client:t}=i(),[n,o]=x(void 0);return B(()=>{t.barista.get("/version/").then(({data:e})=>o(e.version))},[t]),C.createElement(p,{direction:"vertical",size:"middle",style:{width:"100%"}},C.createElement(u,{title:"About",column:1,bordered:!0},C.createElement(u.Item,{label:"Web Application Name"},e.appName),C.createElement(u.Item,{label:"Web Application Description"},e.appDescription),C.createElement(u.Item,{label:"Web Application Version"},`v${e.appVersion}`),C.createElement(u.Item,{label:"DECAF Barista Version"},`v${n}`)),e.content)}function A(){return C.createElement("div",null,C.createElement(f,{title:"Scroll to top",type:"text",size:"small",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),icon:C.createElement(e,null)}),C.createElement(f,{title:"Scroll to bottom",type:"text",size:"small",onClick:()=>window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"}),icon:C.createElement(t,null)}))}function P(e){const t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function O(){const e=function(e){const t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+1]}(),t=function(e){const t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),o=[{code:"development",name:"Development Version",color:"red",url:`/webapps/${e}/development/${P(window.location.href)}`,show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:`/webapps/${e}/testing/${P(window.location.href)}`,show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:`/webapps/${e}/staging/${P(window.location.href)}`,show:!0},{code:"production",name:"Production Version",color:"green",url:`/webapps/${e}/production/${P(window.location.href)}`,show:!0}],l=o.find(e=>e.code===t);return l?C.createElement(g,{placement:"top",arrow:!0,menu:{items:o.map(e=>({key:e.name,label:C.createElement("span",null,C.createElement("i",{className:`dot ${e.color}`})," ",e.name),onClick:()=>{window.location.href=e.url}}))}},C.createElement(f,{type:"text",size:"small"},C.createElement("div",{style:{display:"flex",alignItems:"center"}},C.createElement("i",{className:`dot ${null==l?void 0:l.color}`,style:{marginRight:5}}),C.createElement(n,null)))):null}function F(e){async function t(){const e=document.getElementById("decaf-footer");null==e||e.style.setProperty("display","none");const t=(await j(document.body)).toDataURL("image/png");null==e||e.style.setProperty("display","block");const n=document.createElement("a");n.download="screenshot.png",n.href=t,n.click(),n.remove()}return e.triggerNode?C.cloneElement(e.triggerNode,{onClick:t}):C.createElement(f,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:C.createElement(o,null),onClick:t})}function L(){const{me:e,publicConfig:t}=i(),[n,o]=x(!1);return B(()=>{if(!t.zendesk||"undefined"==typeof document)return;const n=document.createElement("script");return n.src="https://static.zdassets.com/ekr/snippet.js?key="+t.zendesk,n.async=!0,n.id="ze-snippet",n.onload=()=>{window.zE("webWidget","hide"),window.zE("webWidget:on","open",()=>{window.zE("webWidget","show"),o(!0)}),window.zE("webWidget:on","close",()=>{window.zE("webWidget","hide"),o(!1)})},document.body.appendChild(n),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":e.fullname}},{id:"email",prefill:{"*":e.email}}]}},()=>{document.body.removeChild(n)}},[t,e]),t.zendesk?C.createElement(f,{size:"small",icon:C.createElement(l,null),onClick:function(){n?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),o(!n)}},"Support"):null}function R(e){const t=[];return e.forEach(e=>{const n={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?n.label=C.createElement(W,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=C.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=R(e.children||[])),t.push(n)}),t}function H(e){const t=R(e.menu),n=z().map(e=>e.pathname),{me:o}=i(),{token:l}=b.useToken();return C.createElement(h,{style:{height:"100%"}},C.createElement(h.Header,{id:"decaf-header"},C.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},C.createElement(I,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},e.appIcon,C.createElement(E.Title,{level:4,style:{margin:0}},e.appName)),C.createElement(w,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:t,selectedKeys:n}))),C.createElement(h.Content,{id:"decaf-content"},e.children),C.createElement(h.Footer,{id:"decaf-footer"},C.createElement(y,{justify:"space-between",align:"middle"},C.createElement(v,{span:10},C.createElement(L,null)),C.createElement(v,{span:4},C.createElement(E.Text,{type:"secondary"},"Powered by"," ",C.createElement("b",null,C.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer",style:{color:l.colorText}},"Teloscube")))),C.createElement(v,{span:10,style:{justifyContent:"flex-end",display:"flex"}},C.createElement(f,{size:"small",icon:C.createElement(r,null)},o.username),C.createElement(O,null),C.createElement(F,null),C.createElement(A,null)))))}const G={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},_={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:"#2c3d50"},Input:T({},G,{colorBgContainer:"#2c3d50"}),Select:T({},G,{colorBgContainer:"#2c3d50"}),Dropdown:T({},G,{colorBgElevated:"#2c3d50",controlItemBgActive:"#2c3d50"}),DatePicker:T({},G,{colorBgContainer:"#2c3d50",colorBgElevated:"#2c3d50"}),InputNumber:T({},G,{colorBgContainer:"#2c3d50"}),Checkbox:T({},G,{colorBgContainer:"#2c3d50"})},token:{fontFamily:"Lato, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:"#10161d",colorBgElevated:"#1a242f",colorBorderSecondary:"#1a242f",colorBorder:"#1a242f",colorBgLayout:"#1a242f",borderRadius:0,green:"#48734d",red:"#b03a38",blue:"#0d6efd",yellow:"#ffc107",orange:"#fd7e14",colorWhite:"#fff"},algorithm:[b.darkAlgorithm]};function K(e,t){const n=[];return t.forEach(t=>{const o=T({},t);var l;t.children?(o.element=null!=(l=t.element)?l:C.createElement($,null),o.children=K(e,t.children)):o.element=C.createElement(H,{menu:e.menuItems,appName:e.appName,appIcon:e.appIcon},t.element),n.push(o)}),n}function U(e,t,n){const o=[...e];return t.forEach(e=>{const t=o.findIndex(t=>t[n]===e[n]);t>=0?o[t]=e:o.push(e)}),o}function Z(e){var t,n,o;B(()=>{const e=document.createElement("script");return e.defer=!0,e.setAttribute("data-domain",location.hostname),e.src="https://webax.svc.sys.decafhub.com/js/plausible.js",document.body.appendChild(e),()=>{document.body.removeChild(e)}},[]);let l=U(e.routes,[{path:"/about",element:C.createElement(V,{appName:e.appName,appVersion:null==(t=e.config)?void 0:t.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:C.createElement(D,null)}],"path");l=K(T({},e,{menuItems:U(e.menuItems,[{label:"About",to:"/about",icon:C.createElement(a,null)}],"to")}),l);const r=N(l,{basename:null==(n=e.config)?void 0:n.basePath}),i=null!=(o=e.theme)?o:_,m=e.controller||d;m.disableZendeskWidget=!0;const p=function(e){var t,n,o,l,r;return{"@font-face":{fontFamily:"Lato, sans-serif",src:"url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)"},body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:null==(n=e.token)?void 0:n.fontFamily,margin:0},button:{boxShadow:"none !important"},".ant-page-header-back-button, .ant-page-header-heading-title":{color:`${null==(o=e.token)?void 0:o.colorWhite} !important`},".ant-badge-count":{color:`${null==(l=e.token)?void 0:l.colorWhite} !important`},"#decaf-header":{position:"fixed",zIndex:1030,right:0,left:0,paddingInline:0},"#decaf-content":{paddingInline:20,paddingTop:"5rem",paddingBottom:"5rem"},"#decaf-footer":{position:"fixed",bottom:0,right:0,left:0,background:null==(r=e.token)?void 0:r.colorBgContainer,paddingBlock:0,paddingInline:0},".dot":{borderRadius:"50%",width:10,height:10,display:"inline-block","&.green":{backgroundColor:"#80ff00 !important"},"&.yellow":{backgroundColor:"#ff0 !important"},"&.orange":{backgroundColor:"#ff7000 !important"},"&.red":{backgroundColor:"#ff0000 !important"}}}}(i);return C.createElement(k,{theme:i},C.createElement(s,{styles:p}),C.createElement(c,{config:e.config,controller:m},C.createElement(S,{router:r})))}export{Z as DecafWebapp,_ as decafTheme};
2
2
  //# sourceMappingURL=index.modern.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.modern.mjs","sources":["../src/components/PageAbout.tsx","../src/components/Page404.tsx","../src/components/PageScroller.tsx","../src/components/VersionSelector.tsx","../src/components/Screenshotter.tsx","../src/components/ZendeskWidget.tsx","../src/Layout.tsx","../src/theme.ts","../src/index.tsx","../src/style.ts"],"sourcesContent":["import { useDecaf } from '@decafhub/decaf-react';\nimport { Descriptions, Space } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nexport interface AboutPageProps {\n appName?: string;\n appVersion?: string;\n appDescription?: string;\n content?: React.ReactNode;\n}\nexport default function PageAbout(props: AboutPageProps) {\n const { client } = useDecaf();\n const [versionBarista, setVersionBarista] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n client.barista.get<{ version: string }>('/version/').then(({ data }) => setVersionBarista(data.version));\n }, [client]);\n\n return (\n <Space direction=\"vertical\" size=\"middle\" style={{ width: '100%' }}>\n <Descriptions title=\"About\" column={1} bordered>\n <Descriptions.Item label=\"Web Application Name\">{props.appName}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Description\">{props.appDescription}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Version\">{`v${props.appVersion}`}</Descriptions.Item>\n <Descriptions.Item label=\"DECAF Barista Version\">{`v${versionBarista}`}</Descriptions.Item>\n </Descriptions>\n {props.content}\n </Space>\n );\n}\n","import { Result } from 'antd';\nimport React from 'react';\n\nexport default function Page404() {\n return <Result status=\"404\" title={'404'} subTitle={'Sorry, the page you visited does not exist.'} />;\n}\n","import { DownOutlined, UpOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\nexport default function PageScroller() {\n return (\n <div>\n <Button\n title=\"Scroll to top\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}\n icon={<UpOutlined />}\n />\n <Button\n title=\"Scroll to bottom\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })}\n icon={<DownOutlined />}\n />\n </div>\n );\n}\n","import { CaretUpOutlined } from '@ant-design/icons';\nimport { Button, Dropdown } from 'antd';\nimport React from 'react';\n\nexport type Version = {\n code: string;\n name: string;\n color: string;\n url: string;\n show: boolean;\n};\n\nfunction getAppNameFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 1];\n }\n}\n\nfunction getAppVersionFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 2];\n }\n}\n\nfunction getCurrentAppPath(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts.slice(indexOfWebapps + 3).join('/');\n }\n}\n\nexport default function VersionSelector() {\n const appName = getAppNameFromUrl(window.location.href);\n const appVersion = getAppVersionFromUrl(window.location.href);\n\n const versions: Version[] = [\n {\n code: 'development',\n name: 'Development Version',\n color: 'red',\n url: `/webapps/${appName}/development/${getCurrentAppPath(window.location.href)}`,\n show: process.env.NODE_ENV === 'development',\n },\n {\n code: 'testing',\n name: 'Testing Version',\n color: 'orange',\n url: `/webapps/${appName}/testing/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'staging',\n name: 'Staging Version',\n color: 'yellow',\n url: `/webapps/${appName}/staging/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'production',\n name: 'Production Version',\n color: 'green',\n url: `/webapps/${appName}/production/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n ];\n const currentVersion = versions.find((v) => v.code === appVersion);\n\n if (!currentVersion) {\n return null;\n }\n\n return (\n <Dropdown\n placement=\"top\"\n arrow\n menu={{\n items: versions.map((version) => ({\n key: version.name,\n label: (\n <span>\n <i className={`dot ${version.color}`} /> {version.name}\n </span>\n ),\n onClick: () => {\n window.location.href = version.url;\n },\n })),\n }}\n >\n <Button type=\"text\" size=\"small\">\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <i className={`dot ${currentVersion?.color}`} style={{ marginRight: 5 }} />\n <CaretUpOutlined />\n </div>\n </Button>\n </Dropdown>\n );\n}\n","import { CameraOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport html2canvas from 'html2canvas';\nimport React from 'react';\n\nexport interface ScreenShotterProps {\n triggerNode?: React.ReactNode;\n}\nexport default function ScreenShotter(props: ScreenShotterProps) {\n async function handleScreenshot() {\n // hide footer before taking screenshot\n const footer = document.getElementById('decaf-footer');\n footer?.style.setProperty('display', 'none');\n\n const canvas = await html2canvas(document.body);\n const dataUrl = canvas.toDataURL('image/png');\n\n // show footer after taking screenshot\n footer?.style.setProperty('display', 'block');\n\n const link = document.createElement('a');\n link.download = 'screenshot.png';\n link.href = dataUrl;\n link.click();\n link.remove();\n }\n\n if (props.triggerNode) {\n return React.cloneElement(props.triggerNode as React.ReactElement, {\n onClick: handleScreenshot,\n });\n } else {\n return (\n <Button\n title=\"Take a screenshot of the current page\"\n type=\"text\"\n size=\"small\"\n icon={<CameraOutlined />}\n onClick={handleScreenshot}\n />\n );\n }\n}\n","import { QuestionCircleOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nconst ZENDESK_WIDGET_SCRIPT = 'https://static.zdassets.com/ekr/snippet.js';\n\ndeclare global {\n // eslint-disable-next-line no-unused-vars\n interface Window {\n zE: any;\n zESettings: any;\n }\n}\n\nexport default function ZendeskWidget() {\n const { me, publicConfig } = useDecaf();\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (!publicConfig.zendesk || typeof document === 'undefined') return;\n const script = document.createElement('script');\n script.src = ZENDESK_WIDGET_SCRIPT + '?key=' + publicConfig.zendesk;\n script.async = true;\n script.id = 'ze-snippet'; // do not change this. zendesk expects this to be ze-snippet\n script.onload = () => {\n window.zE('webWidget', 'hide');\n window.zE('webWidget:on', 'open', () => {\n window.zE('webWidget', 'show');\n setOpen(true);\n });\n window.zE('webWidget:on', 'close', () => {\n window.zE('webWidget', 'hide');\n setOpen(false);\n });\n };\n\n document.body.appendChild(script);\n window.zESettings = {\n webWidget: {\n offset: {\n horizontal: -7,\n vertical: 20,\n },\n },\n contactForm: {\n subject: true,\n fields: [\n {\n id: 'name',\n prefill: { '*': me.fullname },\n },\n {\n id: 'email',\n prefill: { '*': me.email },\n },\n ],\n },\n };\n\n return () => {\n document.body.removeChild(script);\n };\n }, [publicConfig, me]);\n\n function toggle() {\n if (open) {\n window.zE?.('webWidget', 'close');\n } else {\n window.zE?.('webWidget', 'open');\n }\n setOpen(!open);\n }\n\n if (!publicConfig.zendesk) return null;\n\n return (\n <Button size=\"small\" icon={<QuestionCircleOutlined />} onClick={toggle}>\n Support\n </Button>\n );\n}\n","import { UserOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button, Col, Layout, Menu, Row, theme, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport PageScroller from './components/PageScroller';\nimport VersionSelector from './components/VersionSelector';\nimport React from 'react';\nimport { Link, NavLink, useMatches } from 'react-router-dom';\nimport ScreenShotter from './components/Screenshotter';\nimport ZendeskWidget from './components/ZendeskWidget';\n\ninterface BaseDecafMenuItem {\n label: any;\n icon?: React.ReactNode;\n children?: DecafMenuItem[];\n}\n\nexport type DecafMenuItem = BaseDecafMenuItem & ({ to?: string } | { href?: string });\n\nexport interface DecafLayoutProps {\n menu: DecafMenuItem[];\n appName: string;\n appIcon?: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport function routesToAntMenu(routes: DecafMenuItem[]): ItemType[] {\n const result: ItemType[] = [];\n routes.forEach((route) => {\n const item: ItemType = {\n key: 'to' in route ? route.to : route.label,\n label: route.label,\n icon: route.icon,\n };\n if ('to' in route && route.to) {\n item.label = (\n <NavLink to={route.to} end={route.to === '/'}>\n {route.label}\n </NavLink>\n );\n } else if ('href' in route && route.href) {\n item.label = <a href={route.href}>{route.label}</a>;\n } else if (route.children) {\n item.label = route.label;\n (item as SubMenuType).children = routesToAntMenu(route.children || []);\n }\n result.push(item);\n });\n\n return result;\n}\n\nexport default function DecafLayout(props: DecafLayoutProps) {\n const menuItems = routesToAntMenu(props.menu);\n const matches = useMatches();\n const matchedMenuItems = matches.map((match) => match.pathname);\n const { me } = useDecaf();\n const { token } = theme.useToken();\n\n return (\n <Layout style={{ height: '100%' }}>\n <Layout.Header id=\"decaf-header\">\n <div style={{ paddingInline: 20, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>\n <Link to=\"/\" style={{ display: 'flex', alignItems: 'center', gap: 10 }}>\n {props.appIcon}\n <Typography.Title level={4} style={{ margin: 0 }}>\n {props.appName}\n </Typography.Title>\n </Link>\n <Menu\n style={{ justifyContent: 'flex-end', backgroundColor: 'transparent', border: 'none', flex: 1 }}\n mode=\"horizontal\"\n items={menuItems}\n selectedKeys={matchedMenuItems}\n />\n </div>\n </Layout.Header>\n <Layout.Content id=\"decaf-content\">{props.children}</Layout.Content>\n <Layout.Footer id=\"decaf-footer\">\n <Row justify=\"space-between\" align={'middle'}>\n <Col span={10}>\n <ZendeskWidget />\n </Col>\n <Col span={4}>\n <Typography.Text type=\"secondary\">\n Powered by{' '}\n <b>\n <a href=\"https://teloscube.com\" target=\"_blank\" rel=\"noreferrer\" style={{ color: token.colorText }}>\n Teloscube\n </a>\n </b>\n </Typography.Text>\n </Col>\n <Col span={10} style={{ justifyContent: 'flex-end', display: 'flex' }}>\n <Button size=\"small\" icon={<UserOutlined />}>\n {me.username}\n </Button>\n <VersionSelector />\n <ScreenShotter />\n <PageScroller />\n </Col>\n </Row>\n </Layout.Footer>\n </Layout>\n );\n}\n","import { theme } from 'antd';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nconst BORDER_COLORS_TRANSPARENT = {\n colorBorder: '#10161d',\n colorBorderSecondary: '#10161d',\n};\n\nconst INPUT_BG_COLOR = '#2c3d50';\n\nexport const decafTheme: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: '#10161d',\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n colorBgContainer: INPUT_BG_COLOR,\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgElevated: INPUT_BG_COLOR,\n controlItemBgActive: INPUT_BG_COLOR,\n },\n DatePicker: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n colorBgElevated: INPUT_BG_COLOR,\n },\n InputNumber: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Checkbox: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n },\n token: {\n fontFamily: 'Lato, sans-serif',\n colorPrimary: '#344961',\n colorBgBase: '#1a242f',\n colorBgContainer: '#10161d',\n colorBgElevated: '#1a242f',\n colorBorderSecondary: '#1a242f',\n colorBorder: '#1a242f',\n colorBgLayout: '#1a242f',\n borderRadius: 0,\n green: '#48734d',\n red: '#b03a38',\n blue: '#0d6efd',\n yellow: '#ffc107',\n orange: '#fd7e14',\n colorWhite: '#fff',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n","import { InfoCircleOutlined } from '@ant-design/icons';\nimport { DecafApp, DecafAppConfig, DecafAppController, DecafWebappController } from '@decafhub/decaf-react';\nimport { css, Global } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { ConfigProvider } from 'antd';\nimport 'antd/dist/reset.css';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport PageAbout from './components/PageAbout';\nimport React from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport { getStyles } from './style';\nimport Page404 from './components/Page404';\nimport DecafLayout, { DecafMenuItem } from './Layout';\nimport { decafTheme } from './theme';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n theme?: ThemeConfig;\n /**\n * App routes.<br />\n * About page and 404 page will be added automatically.<br />\n * See https://reactrouter.com/en/main/routers/create-browser-router#routes\n */\n routes: DecafRoute[];\n /**\n * App menu.<br />\n * About page will be added automatically.\n */\n menuItems: DecafMenuItem[];\n appName: string;\n appDescription?: string;\n appIcon?: React.ReactNode;\n /**\n * The extra content to show on the about page.\n */\n aboutPageContent?: React.ReactNode;\n}\n\nfunction buildRoutes(props: DecafWebappProps, routes: DecafRoute[]): RouteObject[] {\n const result: RouteObject[] = [];\n\n routes.forEach((route) => {\n const item: RouteObject = { ...route };\n if (route.children) {\n item.element = route.element ?? <Outlet />;\n item.children = buildRoutes(props, route.children);\n } else {\n item.element = (\n <DecafLayout menu={props.menuItems} appName={props.appName} appIcon={props.appIcon}>\n {route.element}\n </DecafLayout>\n );\n }\n result.push(item);\n });\n\n return result;\n}\n\nfunction addTo<T>(array: T[], items: T[], key: keyof T): T[] {\n const result: T[] = [...array];\n items.forEach((item) => {\n const index = result.findIndex((r) => r[key] === item[key]);\n if (index >= 0) {\n result[index] = item;\n } else {\n result.push(item);\n }\n });\n return result;\n}\n\nfunction DecafWebapp(props: DecafWebappProps) {\n let routes = addTo<RouteObject>(\n props.routes,\n [\n {\n path: '/about',\n element: (\n <PageAbout\n appName={props.appName}\n appVersion={props.config?.currentVersion}\n appDescription={props.appDescription}\n content={props.aboutPageContent}\n />\n ),\n },\n { path: '*', element: <Page404 /> },\n ],\n 'path'\n );\n const menuWithAboutPage = addTo(\n props.menuItems,\n [\n {\n label: 'About',\n to: '/about',\n icon: <InfoCircleOutlined />,\n },\n ],\n 'to' as any\n );\n routes = buildRoutes({ ...props, menuItems: menuWithAboutPage }, routes);\n\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const theme = props.theme ?? decafTheme;\n\n const controller = props.controller || DecafWebappController;\n controller.disableZendeskWidget = true;\n\n const globalStyles = getStyles(theme);\n\n return (\n <ConfigProvider theme={theme}>\n <Global styles={globalStyles} />\n <DecafApp config={props.config} controller={controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ConfigProvider>\n );\n}\n\nexport { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme };\n","import { Interpolation, Theme } from '@emotion/react';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nexport function getStyles(theme: ThemeConfig): Interpolation<Theme> {\n return {\n '@font-face': {\n fontFamily: 'Lato, sans-serif',\n src: 'url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)',\n },\n body: {\n background: theme.token?.colorBgBase,\n fontFamily: theme.token?.fontFamily,\n margin: 0,\n },\n // antd overrides\n button: {\n boxShadow: 'none !important',\n },\n '.ant-page-header-back-button, .ant-page-header-heading-title': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-badge-count': {\n color: `${theme.token?.colorWhite} !important`,\n },\n // end antd overrides\n '#decaf-header': {\n position: 'fixed',\n zIndex: 1030,\n right: 0,\n left: 0,\n paddingInline: 0,\n },\n '#decaf-content': {\n paddingInline: 20,\n paddingTop: '5rem',\n paddingBottom: '5rem',\n },\n '#decaf-footer': {\n position: 'fixed',\n bottom: 0,\n right: 0,\n left: 0,\n background: theme.token?.colorBgContainer,\n paddingBlock: 0,\n paddingInline: 0,\n },\n '.dot': {\n borderRadius: '50%',\n width: 10,\n height: 10,\n display: 'inline-block',\n '&.green': {\n backgroundColor: `#80ff00 !important`,\n },\n '&.yellow': {\n backgroundColor: `#ff0 !important`,\n },\n '&.orange': {\n backgroundColor: `#ff7000 !important`,\n },\n '&.red': {\n backgroundColor: `#ff0000 !important`,\n },\n },\n };\n}\n"],"names":["PageAbout","props","client","useDecaf","versionBarista","setVersionBarista","useState","undefined","useEffect","barista","get","then","data","version","React","createElement","Space","direction","size","style","width","Descriptions","title","column","bordered","Item","label","appName","appDescription","appVersion","content","Page404","Result","status","subTitle","PageScroller","Button","type","onClick","window","scrollTo","top","behavior","icon","UpOutlined","document","body","scrollHeight","DownOutlined","getCurrentAppPath","url","parts","split","indexOfWebapps","indexOf","slice","join","VersionSelector","location","href","getAppNameFromUrl","getAppVersionFromUrl","versions","code","name","color","show","process","env","NODE_ENV","currentVersion","find","v","Dropdown","placement","arrow","menu","items","map","key","className","display","alignItems","marginRight","CaretUpOutlined","ScreenShotter","async","handleScreenshot","getElementById","footer","setProperty","dataUrl","toDataURL","link","download","click","remove","triggerNode","cloneElement","CameraOutlined","ZendeskWidget","me","publicConfig","open","setOpen","zendesk","script","src","ZENDESK_WIDGET_SCRIPT","id","onload","zE","appendChild","zESettings","webWidget","offset","horizontal","vertical","contactForm","subject","fields","prefill","fullname","email","removeChild","QuestionCircleOutlined","routesToAntMenu","routes","forEach","route","item","to","NavLink","end","children","result","push","DecafLayout","menuItems","matchedMenuItems","useMatches","match","pathname","token","theme","useToken","Layout","height","Header","paddingInline","justifyContent","Link","gap","appIcon","Typography","Title","level","margin","Menu","backgroundColor","border","flex","mode","selectedKeys","Content","Footer","Row","justify","align","Col","span","Text","target","rel","colorText","UserOutlined","username","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","decafTheme","hashed","components","colorBgHeader","boxShadow","boxShadowSecondary","colorBgContainer","Input","Select","colorBgElevated","controlItemBgActive","DatePicker","InputNumber","Checkbox","fontFamily","colorPrimary","colorBgBase","colorBgLayout","borderRadius","green","red","blue","yellow","orange","colorWhite","algorithm","darkAlgorithm","buildRoutes","_extends","element","Outlet","addTo","array","index","findIndex","r","DecafWebapp","_props$config","_props$config2","_props$theme","path","config","aboutPageContent","InfoCircleOutlined","router","createBrowserRouter","basename","basePath","controller","DecafWebappController","disableZendeskWidget","globalStyles","_theme$token","_theme$token2","_theme$token3","_theme$token4","_theme$token5","background","button","position","zIndex","right","left","paddingTop","paddingBottom","bottom","paddingBlock","getStyles","ConfigProvider","Global","styles","DecafApp","RouterProvider"],"mappings":"+gCAUwB,SAASA,EAACC,GAChC,MAAMC,OAAEA,GAAWC,KACZC,EAAgBC,GAAqBC,OAA6BC,GAMzE,OAJAC,EAAU,KACRN,EAAOO,QAAQC,IAAyB,aAAaC,KAAK,EAAGC,UAAWP,EAAkBO,EAAKC,SACjG,EAAG,CAACX,IAGFY,EAACC,cAAAC,GAAMC,UAAU,WAAWC,KAAK,SAASC,MAAO,CAAEC,MAAO,SACxDN,EAACC,cAAAM,EAAa,CAAAC,MAAM,QAAQC,OAAQ,EAAGC,UAAQ,GAC7CV,EAACC,cAAAM,EAAaI,KAAK,CAAAC,MAAM,wBAAwBzB,EAAM0B,SACvDb,EAACC,cAAAM,EAAaI,KAAK,CAAAC,MAAM,+BAA+BzB,EAAM2B,gBAC9Dd,EAAAC,cAACM,EAAaI,KAAI,CAACC,MAAM,2BAA+B,IAAAzB,EAAM4B,cAC9Df,EAAAC,cAACM,EAAaI,KAAI,CAACC,MAAM,yBAA6B,IAAAtB,MAEvDH,EAAM6B,QAGb,CC1BwBC,SAAAA,IACtB,OAAQjB,EAAAC,cAAAiB,EAAO,CAAAC,OAAO,MAAMX,MAAO,MAAOY,SAAU,+CACtD,CCDwBC,SAAAA,IACtB,OACErB,EAAAC,cAAA,MAAA,KACED,EAAAC,cAACqB,EACC,CAAAd,MAAM,gBACNe,KAAK,OACLnB,KAAK,QACLoB,QAAS,IAAMC,OAAOC,SAAS,CAAEC,IAAK,EAAGC,SAAU,WACnDC,KAAM7B,EAACC,cAAA6B,UAET9B,EAACC,cAAAqB,GAC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C,cAAC0O,EAAM,CAACC,OAAQnB,IAChBzN,EAACC,cAAA4O,EAAS,CAAA9B,OAAQ5N,EAAM4N,OAAQO,WAAYA,GAC1CtN,EAACC,cAAA6O,GAAe5B,OAAQA,KAIhC"}
1
+ {"version":3,"file":"index.modern.mjs","sources":["../src/components/Page404.tsx","../src/components/PageAbout.tsx","../src/components/PageScroller.tsx","../src/components/VersionSelector.tsx","../src/components/Screenshotter.tsx","../src/components/ZendeskWidget.tsx","../src/Layout.tsx","../src/theme.ts","../src/index.tsx","../src/style.ts"],"sourcesContent":["import { Result } from 'antd';\nimport React from 'react';\n\nexport default function Page404() {\n return <Result status=\"404\" title={'404'} subTitle={'Sorry, the page you visited does not exist.'} />;\n}\n","import { useDecaf } from '@decafhub/decaf-react';\nimport { Descriptions, Space } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nexport interface AboutPageProps {\n appName?: string;\n appVersion?: string;\n appDescription?: string;\n content?: React.ReactNode;\n}\nexport default function PageAbout(props: AboutPageProps) {\n const { client } = useDecaf();\n const [versionBarista, setVersionBarista] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n client.barista.get<{ version: string }>('/version/').then(({ data }) => setVersionBarista(data.version));\n }, [client]);\n\n return (\n <Space direction=\"vertical\" size=\"middle\" style={{ width: '100%' }}>\n <Descriptions title=\"About\" column={1} bordered>\n <Descriptions.Item label=\"Web Application Name\">{props.appName}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Description\">{props.appDescription}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Version\">{`v${props.appVersion}`}</Descriptions.Item>\n <Descriptions.Item label=\"DECAF Barista Version\">{`v${versionBarista}`}</Descriptions.Item>\n </Descriptions>\n {props.content}\n </Space>\n );\n}\n","import { DownOutlined, UpOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\nexport default function PageScroller() {\n return (\n <div>\n <Button\n title=\"Scroll to top\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}\n icon={<UpOutlined />}\n />\n <Button\n title=\"Scroll to bottom\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })}\n icon={<DownOutlined />}\n />\n </div>\n );\n}\n","import { CaretUpOutlined } from '@ant-design/icons';\nimport { Button, Dropdown } from 'antd';\nimport React from 'react';\n\nexport type Version = {\n code: string;\n name: string;\n color: string;\n url: string;\n show: boolean;\n};\n\nfunction getAppNameFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 1];\n }\n}\n\nfunction getAppVersionFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 2];\n }\n}\n\nfunction getCurrentAppPath(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts.slice(indexOfWebapps + 3).join('/');\n }\n}\n\nexport default function VersionSelector() {\n const appName = getAppNameFromUrl(window.location.href);\n const appVersion = getAppVersionFromUrl(window.location.href);\n\n const versions: Version[] = [\n {\n code: 'development',\n name: 'Development Version',\n color: 'red',\n url: `/webapps/${appName}/development/${getCurrentAppPath(window.location.href)}`,\n show: process.env.NODE_ENV === 'development',\n },\n {\n code: 'testing',\n name: 'Testing Version',\n color: 'orange',\n url: `/webapps/${appName}/testing/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'staging',\n name: 'Staging Version',\n color: 'yellow',\n url: `/webapps/${appName}/staging/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'production',\n name: 'Production Version',\n color: 'green',\n url: `/webapps/${appName}/production/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n ];\n const currentVersion = versions.find((v) => v.code === appVersion);\n\n if (!currentVersion) {\n return null;\n }\n\n return (\n <Dropdown\n placement=\"top\"\n arrow\n menu={{\n items: versions.map((version) => ({\n key: version.name,\n label: (\n <span>\n <i className={`dot ${version.color}`} /> {version.name}\n </span>\n ),\n onClick: () => {\n window.location.href = version.url;\n },\n })),\n }}\n >\n <Button type=\"text\" size=\"small\">\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <i className={`dot ${currentVersion?.color}`} style={{ marginRight: 5 }} />\n <CaretUpOutlined />\n </div>\n </Button>\n </Dropdown>\n );\n}\n","import { CameraOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport html2canvas from 'html2canvas';\nimport React from 'react';\n\nexport interface ScreenShotterProps {\n triggerNode?: React.ReactNode;\n}\nexport default function ScreenShotter(props: ScreenShotterProps) {\n async function handleScreenshot() {\n // hide footer before taking screenshot\n const footer = document.getElementById('decaf-footer');\n footer?.style.setProperty('display', 'none');\n\n const canvas = await html2canvas(document.body);\n const dataUrl = canvas.toDataURL('image/png');\n\n // show footer after taking screenshot\n footer?.style.setProperty('display', 'block');\n\n const link = document.createElement('a');\n link.download = 'screenshot.png';\n link.href = dataUrl;\n link.click();\n link.remove();\n }\n\n if (props.triggerNode) {\n return React.cloneElement(props.triggerNode as React.ReactElement, {\n onClick: handleScreenshot,\n });\n } else {\n return (\n <Button\n title=\"Take a screenshot of the current page\"\n type=\"text\"\n size=\"small\"\n icon={<CameraOutlined />}\n onClick={handleScreenshot}\n />\n );\n }\n}\n","import { QuestionCircleOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nconst ZENDESK_WIDGET_SCRIPT = 'https://static.zdassets.com/ekr/snippet.js';\n\ndeclare global {\n // eslint-disable-next-line no-unused-vars\n interface Window {\n zE: any;\n zESettings: any;\n }\n}\n\nexport default function ZendeskWidget() {\n const { me, publicConfig } = useDecaf();\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (!publicConfig.zendesk || typeof document === 'undefined') return;\n const script = document.createElement('script');\n script.src = ZENDESK_WIDGET_SCRIPT + '?key=' + publicConfig.zendesk;\n script.async = true;\n script.id = 'ze-snippet'; // do not change this. zendesk expects this to be ze-snippet\n script.onload = () => {\n window.zE('webWidget', 'hide');\n window.zE('webWidget:on', 'open', () => {\n window.zE('webWidget', 'show');\n setOpen(true);\n });\n window.zE('webWidget:on', 'close', () => {\n window.zE('webWidget', 'hide');\n setOpen(false);\n });\n };\n\n document.body.appendChild(script);\n window.zESettings = {\n webWidget: {\n offset: {\n horizontal: -7,\n vertical: 20,\n },\n },\n contactForm: {\n subject: true,\n fields: [\n {\n id: 'name',\n prefill: { '*': me.fullname },\n },\n {\n id: 'email',\n prefill: { '*': me.email },\n },\n ],\n },\n };\n\n return () => {\n document.body.removeChild(script);\n };\n }, [publicConfig, me]);\n\n function toggle() {\n if (open) {\n window.zE?.('webWidget', 'close');\n } else {\n window.zE?.('webWidget', 'open');\n }\n setOpen(!open);\n }\n\n if (!publicConfig.zendesk) return null;\n\n return (\n <Button size=\"small\" icon={<QuestionCircleOutlined />} onClick={toggle}>\n Support\n </Button>\n );\n}\n","import { UserOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button, Col, Layout, Menu, Row, theme, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport PageScroller from './components/PageScroller';\nimport VersionSelector from './components/VersionSelector';\nimport React from 'react';\nimport { Link, NavLink, useMatches } from 'react-router-dom';\nimport ScreenShotter from './components/Screenshotter';\nimport ZendeskWidget from './components/ZendeskWidget';\n\ninterface BaseDecafMenuItem {\n label: any;\n icon?: React.ReactNode;\n children?: DecafMenuItem[];\n}\n\nexport type DecafMenuItem = BaseDecafMenuItem & ({ to?: string } | { href?: string });\n\nexport interface DecafLayoutProps {\n menu: DecafMenuItem[];\n appName: string;\n appIcon?: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport function routesToAntMenu(routes: DecafMenuItem[]): ItemType[] {\n const result: ItemType[] = [];\n routes.forEach((route) => {\n const item: ItemType = {\n key: 'to' in route ? route.to : route.label,\n label: route.label,\n icon: route.icon,\n };\n if ('to' in route && route.to) {\n item.label = (\n <NavLink to={route.to} end={route.to === '/'}>\n {route.label}\n </NavLink>\n );\n } else if ('href' in route && route.href) {\n item.label = <a href={route.href}>{route.label}</a>;\n } else if (route.children) {\n item.label = route.label;\n (item as SubMenuType).children = routesToAntMenu(route.children || []);\n }\n result.push(item);\n });\n\n return result;\n}\n\nexport default function DecafLayout(props: DecafLayoutProps) {\n const menuItems = routesToAntMenu(props.menu);\n const matches = useMatches();\n const matchedMenuItems = matches.map((match) => match.pathname);\n const { me } = useDecaf();\n const { token } = theme.useToken();\n\n return (\n <Layout style={{ height: '100%' }}>\n <Layout.Header id=\"decaf-header\">\n <div style={{ paddingInline: 20, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>\n <Link to=\"/\" style={{ display: 'flex', alignItems: 'center', gap: 10 }}>\n {props.appIcon}\n <Typography.Title level={4} style={{ margin: 0 }}>\n {props.appName}\n </Typography.Title>\n </Link>\n <Menu\n style={{ justifyContent: 'flex-end', backgroundColor: 'transparent', border: 'none', flex: 1 }}\n mode=\"horizontal\"\n items={menuItems}\n selectedKeys={matchedMenuItems}\n />\n </div>\n </Layout.Header>\n <Layout.Content id=\"decaf-content\">{props.children}</Layout.Content>\n <Layout.Footer id=\"decaf-footer\">\n <Row justify=\"space-between\" align={'middle'}>\n <Col span={10}>\n <ZendeskWidget />\n </Col>\n <Col span={4}>\n <Typography.Text type=\"secondary\">\n Powered by{' '}\n <b>\n <a href=\"https://teloscube.com\" target=\"_blank\" rel=\"noreferrer\" style={{ color: token.colorText }}>\n Teloscube\n </a>\n </b>\n </Typography.Text>\n </Col>\n <Col span={10} style={{ justifyContent: 'flex-end', display: 'flex' }}>\n <Button size=\"small\" icon={<UserOutlined />}>\n {me.username}\n </Button>\n <VersionSelector />\n <ScreenShotter />\n <PageScroller />\n </Col>\n </Row>\n </Layout.Footer>\n </Layout>\n );\n}\n","import { theme } from 'antd';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nconst BORDER_COLORS_TRANSPARENT = {\n colorBorder: '#10161d',\n colorBorderSecondary: '#10161d',\n};\n\nconst INPUT_BG_COLOR = '#2c3d50';\n\nexport const decafTheme: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: '#10161d',\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n colorBgContainer: INPUT_BG_COLOR,\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgElevated: INPUT_BG_COLOR,\n controlItemBgActive: INPUT_BG_COLOR,\n },\n DatePicker: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n colorBgElevated: INPUT_BG_COLOR,\n },\n InputNumber: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Checkbox: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n },\n token: {\n fontFamily: 'Lato, sans-serif',\n colorPrimary: '#344961',\n colorBgBase: '#1a242f',\n colorBgContainer: '#10161d',\n colorBgElevated: '#1a242f',\n colorBorderSecondary: '#1a242f',\n colorBorder: '#1a242f',\n colorBgLayout: '#1a242f',\n borderRadius: 0,\n green: '#48734d',\n red: '#b03a38',\n blue: '#0d6efd',\n yellow: '#ffc107',\n orange: '#fd7e14',\n colorWhite: '#fff',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n","import { InfoCircleOutlined } from '@ant-design/icons';\nimport { DecafApp, DecafAppConfig, DecafAppController, DecafWebappController } from '@decafhub/decaf-react';\nimport { css, Global } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { ConfigProvider } from 'antd';\nimport 'antd/dist/reset.css';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport React, { useEffect } from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport Page404 from './components/Page404';\nimport PageAbout from './components/PageAbout';\nimport DecafLayout, { DecafMenuItem } from './Layout';\nimport { getStyles } from './style';\nimport { decafTheme } from './theme';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n theme?: ThemeConfig;\n /**\n * App routes.<br />\n * About page and 404 page will be added automatically.<br />\n * See https://reactrouter.com/en/main/routers/create-browser-router#routes\n */\n routes: DecafRoute[];\n /**\n * App menu.<br />\n * About page will be added automatically.\n */\n menuItems: DecafMenuItem[];\n appName: string;\n appDescription?: string;\n appIcon?: React.ReactNode;\n /**\n * The extra content to show on the about page.\n */\n aboutPageContent?: React.ReactNode;\n}\n\nfunction buildRoutes(props: DecafWebappProps, routes: DecafRoute[]): RouteObject[] {\n const result: RouteObject[] = [];\n\n routes.forEach((route) => {\n const item: RouteObject = { ...route };\n if (route.children) {\n item.element = route.element ?? <Outlet />;\n item.children = buildRoutes(props, route.children);\n } else {\n item.element = (\n <DecafLayout menu={props.menuItems} appName={props.appName} appIcon={props.appIcon}>\n {route.element}\n </DecafLayout>\n );\n }\n result.push(item);\n });\n\n return result;\n}\n\nfunction addTo<T>(array: T[], items: T[], key: keyof T): T[] {\n const result: T[] = [...array];\n items.forEach((item) => {\n const index = result.findIndex((r) => r[key] === item[key]);\n if (index >= 0) {\n result[index] = item;\n } else {\n result.push(item);\n }\n });\n return result;\n}\n\nfunction DecafWebapp(props: DecafWebappProps) {\n useEffect(() => {\n // add plausible analytics\n const script = document.createElement('script');\n script.defer = true;\n script.setAttribute('data-domain', location.hostname);\n script.src = 'https://webax.svc.sys.decafhub.com/js/plausible.js';\n document.body.appendChild(script);\n\n return () => {\n document.body.removeChild(script);\n };\n }, []);\n\n let routes = addTo<RouteObject>(\n props.routes,\n [\n {\n path: '/about',\n element: (\n <PageAbout\n appName={props.appName}\n appVersion={props.config?.currentVersion}\n appDescription={props.appDescription}\n content={props.aboutPageContent}\n />\n ),\n },\n { path: '*', element: <Page404 /> },\n ],\n 'path'\n );\n const menuWithAboutPage = addTo(\n props.menuItems,\n [\n {\n label: 'About',\n to: '/about',\n icon: <InfoCircleOutlined />,\n },\n ],\n 'to' as any\n );\n routes = buildRoutes({ ...props, menuItems: menuWithAboutPage }, routes);\n\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const theme = props.theme ?? decafTheme;\n\n const controller = props.controller || DecafWebappController;\n controller.disableZendeskWidget = true;\n\n const globalStyles = getStyles(theme);\n\n return (\n <ConfigProvider theme={theme}>\n <Global styles={globalStyles} />\n <DecafApp config={props.config} controller={controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ConfigProvider>\n );\n}\n\nexport { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme };\n","import { Interpolation, Theme } from '@emotion/react';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nexport function getStyles(theme: ThemeConfig): Interpolation<Theme> {\n return {\n '@font-face': {\n fontFamily: 'Lato, sans-serif',\n src: 'url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)',\n },\n body: {\n background: theme.token?.colorBgBase,\n fontFamily: theme.token?.fontFamily,\n margin: 0,\n },\n // antd overrides\n button: {\n boxShadow: 'none !important',\n },\n '.ant-page-header-back-button, .ant-page-header-heading-title': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-badge-count': {\n color: `${theme.token?.colorWhite} !important`,\n },\n // end antd overrides\n '#decaf-header': {\n position: 'fixed',\n zIndex: 1030,\n right: 0,\n left: 0,\n paddingInline: 0,\n },\n '#decaf-content': {\n paddingInline: 20,\n paddingTop: '5rem',\n paddingBottom: '5rem',\n },\n '#decaf-footer': {\n position: 'fixed',\n bottom: 0,\n right: 0,\n left: 0,\n background: theme.token?.colorBgContainer,\n paddingBlock: 0,\n paddingInline: 0,\n },\n '.dot': {\n borderRadius: '50%',\n width: 10,\n height: 10,\n display: 'inline-block',\n '&.green': {\n backgroundColor: `#80ff00 !important`,\n },\n '&.yellow': {\n backgroundColor: `#ff0 !important`,\n },\n '&.orange': {\n backgroundColor: `#ff7000 !important`,\n },\n '&.red': {\n backgroundColor: `#ff0000 !important`,\n },\n },\n };\n}\n"],"names":["Page404","React","createElement","Result","status","title","subTitle","PageAbout","props","client","useDecaf","versionBarista","setVersionBarista","useState","undefined","useEffect","barista","get","then","data","version","Space","direction","size","style","width","Descriptions","column","bordered","Item","label","appName","appDescription","appVersion","content","PageScroller","Button","type","onClick","window","scrollTo","top","behavior","icon","UpOutlined","document","body","scrollHeight","DownOutlined","getCurrentAppPath","url","parts","split","indexOfWebapps","indexOf","slice","join","VersionSelector","location","href","getAppNameFromUrl","getAppVersionFromUrl","versions","code","name","color","show","process","env","NODE_ENV","currentVersion","find","v","Dropdown","placement","arrow","menu","items","map","key","className","display","alignItems","marginRight","CaretUpOutlined","ScreenShotter","async","handleScreenshot","getElementById","footer","setProperty","dataUrl","toDataURL","link","download","click","remove","triggerNode","cloneElement","CameraOutlined","ZendeskWidget","me","publicConfig","open","setOpen","zendesk","script","src","ZENDESK_WIDGET_SCRIPT","id","onload","zE","appendChild","zESettings","webWidget","offset","horizontal","vertical","contactForm","subject","fields","prefill","fullname","email","removeChild","QuestionCircleOutlined","routesToAntMenu","routes","forEach","route","item","to","NavLink","end","children","result","push","DecafLayout","menuItems","matchedMenuItems","useMatches","match","pathname","token","theme","useToken","Layout","height","Header","paddingInline","justifyContent","Link","gap","appIcon","Typography","Title","level","margin","Menu","backgroundColor","border","flex","mode","selectedKeys","Content","Footer","Row","justify","align","Col","span","Text","target","rel","colorText","UserOutlined","username","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","decafTheme","hashed","components","colorBgHeader","boxShadow","boxShadowSecondary","colorBgContainer","Input","Select","colorBgElevated","controlItemBgActive","DatePicker","InputNumber","Checkbox","fontFamily","colorPrimary","colorBgBase","colorBgLayout","borderRadius","green","red","blue","yellow","orange","colorWhite","algorithm","darkAlgorithm","buildRoutes","element","Outlet","addTo","array","findIndex","r","index","DecafWebapp","defer","setAttribute","hostname","path","_props$config","config","aboutPageContent","InfoCircleOutlined","router","createBrowserRouter","basename","_props$config2","basePath","_props$theme","controller","DecafWebappController","disableZendeskWidget","globalStyles","_theme$token","_theme$token2","_theme$token3","_theme$token4","_theme$token5","background","button","position","zIndex","right","left","paddingTop","paddingBottom","bottom","paddingBlock","getStyles","ConfigProvider","Global","styles","DecafApp","RouterProvider"],"mappings":"+gCAGwBA,SAAAA,IACtB,OAAQC,EAAAC,cAAAC,EAAO,CAAAC,OAAO,MAAMC,MAAO,MAAOC,SAAU,+CACtD,CCKwB,SAASC,EAACC,GAChC,MAAMC,OAAEA,GAAWC,KACZC,EAAgBC,GAAqBC,OAA6BC,GAMzE,OAJAC,EAAU,KACRN,EAAOO,QAAQC,IAAyB,aAAaC,KAAK,EAAGC,UAAWP,EAAkBO,EAAKC,SACjG,EAAG,CAACX,IAGFR,EAACC,cAAAmB,GAAMC,UAAU,WAAWC,KAAK,SAASC,MAAO,CAAEC,MAAO,SACxDxB,EAACC,cAAAwB,EAAa,CAAArB,MAAM,QAAQsB,OAAQ,EAAGC,UAAQ,GAC7C3B,EAACC,cAAAwB,EAAaG,KAAK,CAAAC,MAAM,wBAAwBtB,EAAMuB,SACvD9B,EAACC,cAAAwB,EAAaG,KAAK,CAAAC,MAAM,+BAA+BtB,EAAMwB,gBAC9D/B,EAAAC,cAACwB,EAAaG,KAAI,CAACC,MAAM,2BAA+B,IAAAtB,EAAMyB,cAC9DhC,EAAAC,cAACwB,EAAaG,KAAI,CAACC,MAAM,yBAA6B,IAAAnB,MAEvDH,EAAM0B,QAGb,CCzBwBC,SAAAA,I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iB,CACfL,SAAU,QACVM,OAAQ,EACRJ,MAAO,EACPC,KAAM,EACNL,WAAuB,OAAX/F,EAAAA,EAAMD,YAAK,EAAX+F,EAAapD,iBACzB8D,aAAc,EACdnG,cAAe,GAEjB,OAAQ,CACNiD,aAAc,MACd7K,MAAO,GACP0H,OAAQ,GACRlE,QAAS,eACT,UAAW,CACT8E,gBAAqC,sBAEvC,WAAY,CACVA,gBAAkC,mBAEpC,WAAY,CACVA,gBAAqC,sBAEvC,QAAS,CACPA,gBAAqC,uBAI7C,CDgEuB0F,CAAUzG,GAE/B,OACE/I,EAACC,cAAAwP,EAAe,CAAA1G,MAAOA,GACrB/I,EAAAC,cAACyP,EAAM,CAACC,OAAQnB,IAChBxO,EAACC,cAAA2P,EAAS,CAAAhC,OAAQrN,EAAMqN,OAAQS,WAAYA,GAC1CrO,EAACC,cAAA4P,GAAe9B,OAAQA,KAIhC"}
@@ -1,2 +1,2 @@
1
- import{UpOutlined as e,DownOutlined as t,CaretUpOutlined as n,CameraOutlined as o,QuestionCircleOutlined as r,UserOutlined as l,InfoCircleOutlined as a}from"@ant-design/icons";import{useDecaf as i,DecafApp as c,DecafWebappController as d}from"@decafhub/decaf-react";import{Global as s}from"@emotion/react";export{Global as GlobalStyle,css}from"@emotion/react";export{default as styled}from"@emotion/styled";import{Space as m,Descriptions as u,Result as p,Button as f,Dropdown as g,theme as b,Layout as h,Typography as E,Menu as w,Row as y,Col as v,ConfigProvider as k}from"antd";import"antd/dist/reset.css";import C,{useState as x,useEffect as B}from"react";import{useMatches as z,Link as I,NavLink as W,createBrowserRouter as N,RouterProvider as S,Outlet as j}from"react-router-dom";import P from"html2canvas";function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},T.apply(this,arguments)}function D(e){var t=i().client,n=x(void 0),o=n[0],r=n[1];return B(function(){t.barista.get("/version/").then(function(e){return r(e.data.version)})},[t]),C.createElement(m,{direction:"vertical",size:"middle",style:{width:"100%"}},C.createElement(u,{title:"About",column:1,bordered:!0},C.createElement(u.Item,{label:"Web Application Name"},e.appName),C.createElement(u.Item,{label:"Web Application Description"},e.appDescription),C.createElement(u.Item,{label:"Web Application Version"},"v"+e.appVersion),C.createElement(u.Item,{label:"DECAF Barista Version"},"v"+o)),e.content)}function V(){return C.createElement(p,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function A(){return C.createElement("div",null,C.createElement(f,{title:"Scroll to top",type:"text",size:"small",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})},icon:C.createElement(e,null)}),C.createElement(f,{title:"Scroll to bottom",type:"text",size:"small",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},icon:C.createElement(t,null)}))}function O(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function F(){var e,t,o=-1===(t=(e=window.location.href.split("/")).indexOf("webapps"))?"":e[t+1],r=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),l=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+o+"/development/"+O(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+o+"/testing/"+O(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+o+"/staging/"+O(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+o+"/production/"+O(window.location.href),show:!0}],a=l.find(function(e){return e.code===r});return a?C.createElement(g,{placement:"top",arrow:!0,menu:{items:l.map(function(e){return{key:e.name,label:C.createElement("span",null,C.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){window.location.href=e.url}}})}},C.createElement(f,{type:"text",size:"small"},C.createElement("div",{style:{display:"flex",alignItems:"center"}},C.createElement("i",{className:"dot "+(null==a?void 0:a.color),style:{marginRight:5}}),C.createElement(n,null)))):null}function L(e){var t=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(P(document.body)).then(function(t){var n=t.toDataURL("image/png");null==e||e.style.setProperty("display","block");var o=document.createElement("a");o.download="screenshot.png",o.href=n,o.click(),o.remove()})}catch(e){return Promise.reject(e)}};return e.triggerNode?C.cloneElement(e.triggerNode,{onClick:t}):C.createElement(f,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:C.createElement(o,null),onClick:t})}function R(){var e=i(),t=e.me,n=e.publicConfig,o=x(!1),l=o[0],a=o[1];return B(function(){if(n.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src="https://static.zdassets.com/ekr/snippet.js?key="+n.zendesk,e.async=!0,e.id="ze-snippet",e.onload=function(){window.zE("webWidget","hide"),window.zE("webWidget:on","open",function(){window.zE("webWidget","show"),a(!0)}),window.zE("webWidget:on","close",function(){window.zE("webWidget","hide"),a(!1)})},document.body.appendChild(e),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":t.fullname}},{id:"email",prefill:{"*":t.email}}]}},function(){document.body.removeChild(e)}}},[n,t]),n.zendesk?C.createElement(f,{size:"small",icon:C.createElement(r,null),onClick:function(){l?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),a(!l)}},"Support"):null}function H(e){var t=[];return e.forEach(function(e){var n={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?n.label=C.createElement(W,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=C.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=H(e.children||[])),t.push(n)}),t}function G(e){var t=H(e.menu),n=z().map(function(e){return e.pathname}),o=i().me,r=b.useToken().token;return C.createElement(h,{style:{height:"100%"}},C.createElement(h.Header,{id:"decaf-header"},C.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},C.createElement(I,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},e.appIcon,C.createElement(E.Title,{level:4,style:{margin:0}},e.appName)),C.createElement(w,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:t,selectedKeys:n}))),C.createElement(h.Content,{id:"decaf-content"},e.children),C.createElement(h.Footer,{id:"decaf-footer"},C.createElement(y,{justify:"space-between",align:"middle"},C.createElement(v,{span:10},C.createElement(R,null)),C.createElement(v,{span:4},C.createElement(E.Text,{type:"secondary"},"Powered by"," ",C.createElement("b",null,C.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer",style:{color:r.colorText}},"Teloscube")))),C.createElement(v,{span:10,style:{justifyContent:"flex-end",display:"flex"}},C.createElement(f,{size:"small",icon:C.createElement(l,null)},o.username),C.createElement(F,null),C.createElement(L,null),C.createElement(A,null)))))}var _={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},K={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:"#2c3d50"},Input:T({},_,{colorBgContainer:"#2c3d50"}),Select:T({},_,{colorBgContainer:"#2c3d50"}),Dropdown:T({},_,{colorBgElevated:"#2c3d50",controlItemBgActive:"#2c3d50"}),DatePicker:T({},_,{colorBgContainer:"#2c3d50",colorBgElevated:"#2c3d50"}),InputNumber:T({},_,{colorBgContainer:"#2c3d50"}),Checkbox:T({},_,{colorBgContainer:"#2c3d50"})},token:{fontFamily:"Lato, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:"#10161d",colorBgElevated:"#1a242f",colorBorderSecondary:"#1a242f",colorBorder:"#1a242f",colorBgLayout:"#1a242f",borderRadius:0,green:"#48734d",red:"#b03a38",blue:"#0d6efd",yellow:"#ffc107",orange:"#fd7e14",colorWhite:"#fff"},algorithm:[b.darkAlgorithm]};function U(e,t){var n=[];return t.forEach(function(t){var o,r=T({},t);t.children?(r.element=null!=(o=t.element)?o:C.createElement(j,null),r.children=U(e,t.children)):r.element=C.createElement(G,{menu:e.menuItems,appName:e.appName,appIcon:e.appIcon},t.element),n.push(r)}),n}function Z(e,t,n){var o=[].concat(e);return t.forEach(function(e){var t=o.findIndex(function(t){return t[n]===e[n]});t>=0?o[t]=e:o.push(e)}),o}function q(e){var t,n,o,r=Z(e.routes,[{path:"/about",element:C.createElement(D,{appName:e.appName,appVersion:null==(t=e.config)?void 0:t.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:C.createElement(V,null)}],"path");r=U(T({},e,{menuItems:Z(e.menuItems,[{label:"About",to:"/about",icon:C.createElement(a,null)}],"to")}),r);var l=N(r,{basename:null==(n=e.config)?void 0:n.basePath}),i=null!=(o=e.theme)?o:K,m=e.controller||d;m.disableZendeskWidget=!0;var u=function(e){var t,n,o,r,l;return{"@font-face":{fontFamily:"Lato, sans-serif",src:"url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)"},body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:null==(n=e.token)?void 0:n.fontFamily,margin:0},button:{boxShadow:"none !important"},".ant-page-header-back-button, .ant-page-header-heading-title":{color:(null==(o=e.token)?void 0:o.colorWhite)+" !important"},".ant-badge-count":{color:(null==(r=e.token)?void 0:r.colorWhite)+" !important"},"#decaf-header":{position:"fixed",zIndex:1030,right:0,left:0,paddingInline:0},"#decaf-content":{paddingInline:20,paddingTop:"5rem",paddingBottom:"5rem"},"#decaf-footer":{position:"fixed",bottom:0,right:0,left:0,background:null==(l=e.token)?void 0:l.colorBgContainer,paddingBlock:0,paddingInline:0},".dot":{borderRadius:"50%",width:10,height:10,display:"inline-block","&.green":{backgroundColor:"#80ff00 !important"},"&.yellow":{backgroundColor:"#ff0 !important"},"&.orange":{backgroundColor:"#ff7000 !important"},"&.red":{backgroundColor:"#ff0000 !important"}}}}(i);return C.createElement(k,{theme:i},C.createElement(s,{styles:u}),C.createElement(c,{config:e.config,controller:m},C.createElement(S,{router:l})))}export{q as DecafWebapp,K as decafTheme};
1
+ import{UpOutlined as e,DownOutlined as t,CaretUpOutlined as n,CameraOutlined as o,QuestionCircleOutlined as r,UserOutlined as l,InfoCircleOutlined as a}from"@ant-design/icons";import{useDecaf as i,DecafApp as c,DecafWebappController as d}from"@decafhub/decaf-react";import{Global as s}from"@emotion/react";export{Global as GlobalStyle,css}from"@emotion/react";export{default as styled}from"@emotion/styled";import{Result as m,Space as u,Descriptions as p,Button as f,Dropdown as g,theme as b,Layout as h,Typography as E,Menu as w,Row as y,Col as v,ConfigProvider as k}from"antd";import"antd/dist/reset.css";import C,{useState as x,useEffect as B}from"react";import{useMatches as z,Link as I,NavLink as W,createBrowserRouter as N,RouterProvider as S,Outlet as j}from"react-router-dom";import P from"html2canvas";function T(){return T=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},T.apply(this,arguments)}function D(){return C.createElement(m,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function V(e){var t=i().client,n=x(void 0),o=n[0],r=n[1];return B(function(){t.barista.get("/version/").then(function(e){return r(e.data.version)})},[t]),C.createElement(u,{direction:"vertical",size:"middle",style:{width:"100%"}},C.createElement(p,{title:"About",column:1,bordered:!0},C.createElement(p.Item,{label:"Web Application Name"},e.appName),C.createElement(p.Item,{label:"Web Application Description"},e.appDescription),C.createElement(p.Item,{label:"Web Application Version"},"v"+e.appVersion),C.createElement(p.Item,{label:"DECAF Barista Version"},"v"+o)),e.content)}function A(){return C.createElement("div",null,C.createElement(f,{title:"Scroll to top",type:"text",size:"small",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})},icon:C.createElement(e,null)}),C.createElement(f,{title:"Scroll to bottom",type:"text",size:"small",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},icon:C.createElement(t,null)}))}function O(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function F(){var e,t,o=-1===(t=(e=window.location.href.split("/")).indexOf("webapps"))?"":e[t+1],r=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),l=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+o+"/development/"+O(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+o+"/testing/"+O(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+o+"/staging/"+O(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+o+"/production/"+O(window.location.href),show:!0}],a=l.find(function(e){return e.code===r});return a?C.createElement(g,{placement:"top",arrow:!0,menu:{items:l.map(function(e){return{key:e.name,label:C.createElement("span",null,C.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){window.location.href=e.url}}})}},C.createElement(f,{type:"text",size:"small"},C.createElement("div",{style:{display:"flex",alignItems:"center"}},C.createElement("i",{className:"dot "+(null==a?void 0:a.color),style:{marginRight:5}}),C.createElement(n,null)))):null}function L(e){var t=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(P(document.body)).then(function(t){var n=t.toDataURL("image/png");null==e||e.style.setProperty("display","block");var o=document.createElement("a");o.download="screenshot.png",o.href=n,o.click(),o.remove()})}catch(e){return Promise.reject(e)}};return e.triggerNode?C.cloneElement(e.triggerNode,{onClick:t}):C.createElement(f,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:C.createElement(o,null),onClick:t})}function R(){var e=i(),t=e.me,n=e.publicConfig,o=x(!1),l=o[0],a=o[1];return B(function(){if(n.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src="https://static.zdassets.com/ekr/snippet.js?key="+n.zendesk,e.async=!0,e.id="ze-snippet",e.onload=function(){window.zE("webWidget","hide"),window.zE("webWidget:on","open",function(){window.zE("webWidget","show"),a(!0)}),window.zE("webWidget:on","close",function(){window.zE("webWidget","hide"),a(!1)})},document.body.appendChild(e),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":t.fullname}},{id:"email",prefill:{"*":t.email}}]}},function(){document.body.removeChild(e)}}},[n,t]),n.zendesk?C.createElement(f,{size:"small",icon:C.createElement(r,null),onClick:function(){l?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),a(!l)}},"Support"):null}function H(e){var t=[];return e.forEach(function(e){var n={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?n.label=C.createElement(W,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=C.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=H(e.children||[])),t.push(n)}),t}function G(e){var t=H(e.menu),n=z().map(function(e){return e.pathname}),o=i().me,r=b.useToken().token;return C.createElement(h,{style:{height:"100%"}},C.createElement(h.Header,{id:"decaf-header"},C.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},C.createElement(I,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},e.appIcon,C.createElement(E.Title,{level:4,style:{margin:0}},e.appName)),C.createElement(w,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:t,selectedKeys:n}))),C.createElement(h.Content,{id:"decaf-content"},e.children),C.createElement(h.Footer,{id:"decaf-footer"},C.createElement(y,{justify:"space-between",align:"middle"},C.createElement(v,{span:10},C.createElement(R,null)),C.createElement(v,{span:4},C.createElement(E.Text,{type:"secondary"},"Powered by"," ",C.createElement("b",null,C.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer",style:{color:r.colorText}},"Teloscube")))),C.createElement(v,{span:10,style:{justifyContent:"flex-end",display:"flex"}},C.createElement(f,{size:"small",icon:C.createElement(l,null)},o.username),C.createElement(F,null),C.createElement(L,null),C.createElement(A,null)))))}var _={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},K={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:"#2c3d50"},Input:T({},_,{colorBgContainer:"#2c3d50"}),Select:T({},_,{colorBgContainer:"#2c3d50"}),Dropdown:T({},_,{colorBgElevated:"#2c3d50",controlItemBgActive:"#2c3d50"}),DatePicker:T({},_,{colorBgContainer:"#2c3d50",colorBgElevated:"#2c3d50"}),InputNumber:T({},_,{colorBgContainer:"#2c3d50"}),Checkbox:T({},_,{colorBgContainer:"#2c3d50"})},token:{fontFamily:"Lato, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:"#10161d",colorBgElevated:"#1a242f",colorBorderSecondary:"#1a242f",colorBorder:"#1a242f",colorBgLayout:"#1a242f",borderRadius:0,green:"#48734d",red:"#b03a38",blue:"#0d6efd",yellow:"#ffc107",orange:"#fd7e14",colorWhite:"#fff"},algorithm:[b.darkAlgorithm]};function U(e,t){var n=[];return t.forEach(function(t){var o,r=T({},t);t.children?(r.element=null!=(o=t.element)?o:C.createElement(j,null),r.children=U(e,t.children)):r.element=C.createElement(G,{menu:e.menuItems,appName:e.appName,appIcon:e.appIcon},t.element),n.push(r)}),n}function Z(e,t,n){var o=[].concat(e);return t.forEach(function(e){var t=o.findIndex(function(t){return t[n]===e[n]});t>=0?o[t]=e:o.push(e)}),o}function q(e){var t,n,o;B(function(){var e=document.createElement("script");return e.defer=!0,e.setAttribute("data-domain",location.hostname),e.src="https://webax.svc.sys.decafhub.com/js/plausible.js",document.body.appendChild(e),function(){document.body.removeChild(e)}},[]);var r=Z(e.routes,[{path:"/about",element:C.createElement(V,{appName:e.appName,appVersion:null==(t=e.config)?void 0:t.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:C.createElement(D,null)}],"path");r=U(T({},e,{menuItems:Z(e.menuItems,[{label:"About",to:"/about",icon:C.createElement(a,null)}],"to")}),r);var l=N(r,{basename:null==(n=e.config)?void 0:n.basePath}),i=null!=(o=e.theme)?o:K,m=e.controller||d;m.disableZendeskWidget=!0;var u=function(e){var t,n,o,r,l;return{"@font-face":{fontFamily:"Lato, sans-serif",src:"url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)"},body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:null==(n=e.token)?void 0:n.fontFamily,margin:0},button:{boxShadow:"none !important"},".ant-page-header-back-button, .ant-page-header-heading-title":{color:(null==(o=e.token)?void 0:o.colorWhite)+" !important"},".ant-badge-count":{color:(null==(r=e.token)?void 0:r.colorWhite)+" !important"},"#decaf-header":{position:"fixed",zIndex:1030,right:0,left:0,paddingInline:0},"#decaf-content":{paddingInline:20,paddingTop:"5rem",paddingBottom:"5rem"},"#decaf-footer":{position:"fixed",bottom:0,right:0,left:0,background:null==(l=e.token)?void 0:l.colorBgContainer,paddingBlock:0,paddingInline:0},".dot":{borderRadius:"50%",width:10,height:10,display:"inline-block","&.green":{backgroundColor:"#80ff00 !important"},"&.yellow":{backgroundColor:"#ff0 !important"},"&.orange":{backgroundColor:"#ff7000 !important"},"&.red":{backgroundColor:"#ff0000 !important"}}}}(i);return C.createElement(k,{theme:i},C.createElement(s,{styles:u}),C.createElement(c,{config:e.config,controller:m},C.createElement(S,{router:l})))}export{q as DecafWebapp,K as decafTheme};
2
2
  //# sourceMappingURL=index.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.module.js","sources":["../src/components/PageAbout.tsx","../src/components/Page404.tsx","../src/components/PageScroller.tsx","../src/components/VersionSelector.tsx","../src/components/Screenshotter.tsx","../src/components/ZendeskWidget.tsx","../src/Layout.tsx","../src/theme.ts","../src/index.tsx","../src/style.ts"],"sourcesContent":["import { useDecaf } from '@decafhub/decaf-react';\nimport { Descriptions, Space } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nexport interface AboutPageProps {\n appName?: string;\n appVersion?: string;\n appDescription?: string;\n content?: React.ReactNode;\n}\nexport default function PageAbout(props: AboutPageProps) {\n const { client } = useDecaf();\n const [versionBarista, setVersionBarista] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n client.barista.get<{ version: string }>('/version/').then(({ data }) => setVersionBarista(data.version));\n }, [client]);\n\n return (\n <Space direction=\"vertical\" size=\"middle\" style={{ width: '100%' }}>\n <Descriptions title=\"About\" column={1} bordered>\n <Descriptions.Item label=\"Web Application Name\">{props.appName}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Description\">{props.appDescription}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Version\">{`v${props.appVersion}`}</Descriptions.Item>\n <Descriptions.Item label=\"DECAF Barista Version\">{`v${versionBarista}`}</Descriptions.Item>\n </Descriptions>\n {props.content}\n </Space>\n );\n}\n","import { Result } from 'antd';\nimport React from 'react';\n\nexport default function Page404() {\n return <Result status=\"404\" title={'404'} subTitle={'Sorry, the page you visited does not exist.'} />;\n}\n","import { DownOutlined, UpOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\nexport default function PageScroller() {\n return (\n <div>\n <Button\n title=\"Scroll to top\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}\n icon={<UpOutlined />}\n />\n <Button\n title=\"Scroll to bottom\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })}\n icon={<DownOutlined />}\n />\n </div>\n );\n}\n","import { CaretUpOutlined } from '@ant-design/icons';\nimport { Button, Dropdown } from 'antd';\nimport React from 'react';\n\nexport type Version = {\n code: string;\n name: string;\n color: string;\n url: string;\n show: boolean;\n};\n\nfunction getAppNameFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 1];\n }\n}\n\nfunction getAppVersionFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 2];\n }\n}\n\nfunction getCurrentAppPath(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts.slice(indexOfWebapps + 3).join('/');\n }\n}\n\nexport default function VersionSelector() {\n const appName = getAppNameFromUrl(window.location.href);\n const appVersion = getAppVersionFromUrl(window.location.href);\n\n const versions: Version[] = [\n {\n code: 'development',\n name: 'Development Version',\n color: 'red',\n url: `/webapps/${appName}/development/${getCurrentAppPath(window.location.href)}`,\n show: process.env.NODE_ENV === 'development',\n },\n {\n code: 'testing',\n name: 'Testing Version',\n color: 'orange',\n url: `/webapps/${appName}/testing/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'staging',\n name: 'Staging Version',\n color: 'yellow',\n url: `/webapps/${appName}/staging/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'production',\n name: 'Production Version',\n color: 'green',\n url: `/webapps/${appName}/production/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n ];\n const currentVersion = versions.find((v) => v.code === appVersion);\n\n if (!currentVersion) {\n return null;\n }\n\n return (\n <Dropdown\n placement=\"top\"\n arrow\n menu={{\n items: versions.map((version) => ({\n key: version.name,\n label: (\n <span>\n <i className={`dot ${version.color}`} /> {version.name}\n </span>\n ),\n onClick: () => {\n window.location.href = version.url;\n },\n })),\n }}\n >\n <Button type=\"text\" size=\"small\">\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <i className={`dot ${currentVersion?.color}`} style={{ marginRight: 5 }} />\n <CaretUpOutlined />\n </div>\n </Button>\n </Dropdown>\n );\n}\n","import { CameraOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport html2canvas from 'html2canvas';\nimport React from 'react';\n\nexport interface ScreenShotterProps {\n triggerNode?: React.ReactNode;\n}\nexport default function ScreenShotter(props: ScreenShotterProps) {\n async function handleScreenshot() {\n // hide footer before taking screenshot\n const footer = document.getElementById('decaf-footer');\n footer?.style.setProperty('display', 'none');\n\n const canvas = await html2canvas(document.body);\n const dataUrl = canvas.toDataURL('image/png');\n\n // show footer after taking screenshot\n footer?.style.setProperty('display', 'block');\n\n const link = document.createElement('a');\n link.download = 'screenshot.png';\n link.href = dataUrl;\n link.click();\n link.remove();\n }\n\n if (props.triggerNode) {\n return React.cloneElement(props.triggerNode as React.ReactElement, {\n onClick: handleScreenshot,\n });\n } else {\n return (\n <Button\n title=\"Take a screenshot of the current page\"\n type=\"text\"\n size=\"small\"\n icon={<CameraOutlined />}\n onClick={handleScreenshot}\n />\n );\n }\n}\n","import { QuestionCircleOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nconst ZENDESK_WIDGET_SCRIPT = 'https://static.zdassets.com/ekr/snippet.js';\n\ndeclare global {\n // eslint-disable-next-line no-unused-vars\n interface Window {\n zE: any;\n zESettings: any;\n }\n}\n\nexport default function ZendeskWidget() {\n const { me, publicConfig } = useDecaf();\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (!publicConfig.zendesk || typeof document === 'undefined') return;\n const script = document.createElement('script');\n script.src = ZENDESK_WIDGET_SCRIPT + '?key=' + publicConfig.zendesk;\n script.async = true;\n script.id = 'ze-snippet'; // do not change this. zendesk expects this to be ze-snippet\n script.onload = () => {\n window.zE('webWidget', 'hide');\n window.zE('webWidget:on', 'open', () => {\n window.zE('webWidget', 'show');\n setOpen(true);\n });\n window.zE('webWidget:on', 'close', () => {\n window.zE('webWidget', 'hide');\n setOpen(false);\n });\n };\n\n document.body.appendChild(script);\n window.zESettings = {\n webWidget: {\n offset: {\n horizontal: -7,\n vertical: 20,\n },\n },\n contactForm: {\n subject: true,\n fields: [\n {\n id: 'name',\n prefill: { '*': me.fullname },\n },\n {\n id: 'email',\n prefill: { '*': me.email },\n },\n ],\n },\n };\n\n return () => {\n document.body.removeChild(script);\n };\n }, [publicConfig, me]);\n\n function toggle() {\n if (open) {\n window.zE?.('webWidget', 'close');\n } else {\n window.zE?.('webWidget', 'open');\n }\n setOpen(!open);\n }\n\n if (!publicConfig.zendesk) return null;\n\n return (\n <Button size=\"small\" icon={<QuestionCircleOutlined />} onClick={toggle}>\n Support\n </Button>\n );\n}\n","import { UserOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button, Col, Layout, Menu, Row, theme, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport PageScroller from './components/PageScroller';\nimport VersionSelector from './components/VersionSelector';\nimport React from 'react';\nimport { Link, NavLink, useMatches } from 'react-router-dom';\nimport ScreenShotter from './components/Screenshotter';\nimport ZendeskWidget from './components/ZendeskWidget';\n\ninterface BaseDecafMenuItem {\n label: any;\n icon?: React.ReactNode;\n children?: DecafMenuItem[];\n}\n\nexport type DecafMenuItem = BaseDecafMenuItem & ({ to?: string } | { href?: string });\n\nexport interface DecafLayoutProps {\n menu: DecafMenuItem[];\n appName: string;\n appIcon?: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport function routesToAntMenu(routes: DecafMenuItem[]): ItemType[] {\n const result: ItemType[] = [];\n routes.forEach((route) => {\n const item: ItemType = {\n key: 'to' in route ? route.to : route.label,\n label: route.label,\n icon: route.icon,\n };\n if ('to' in route && route.to) {\n item.label = (\n <NavLink to={route.to} end={route.to === '/'}>\n {route.label}\n </NavLink>\n );\n } else if ('href' in route && route.href) {\n item.label = <a href={route.href}>{route.label}</a>;\n } else if (route.children) {\n item.label = route.label;\n (item as SubMenuType).children = routesToAntMenu(route.children || []);\n }\n result.push(item);\n });\n\n return result;\n}\n\nexport default function DecafLayout(props: DecafLayoutProps) {\n const menuItems = routesToAntMenu(props.menu);\n const matches = useMatches();\n const matchedMenuItems = matches.map((match) => match.pathname);\n const { me } = useDecaf();\n const { token } = theme.useToken();\n\n return (\n <Layout style={{ height: '100%' }}>\n <Layout.Header id=\"decaf-header\">\n <div style={{ paddingInline: 20, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>\n <Link to=\"/\" style={{ display: 'flex', alignItems: 'center', gap: 10 }}>\n {props.appIcon}\n <Typography.Title level={4} style={{ margin: 0 }}>\n {props.appName}\n </Typography.Title>\n </Link>\n <Menu\n style={{ justifyContent: 'flex-end', backgroundColor: 'transparent', border: 'none', flex: 1 }}\n mode=\"horizontal\"\n items={menuItems}\n selectedKeys={matchedMenuItems}\n />\n </div>\n </Layout.Header>\n <Layout.Content id=\"decaf-content\">{props.children}</Layout.Content>\n <Layout.Footer id=\"decaf-footer\">\n <Row justify=\"space-between\" align={'middle'}>\n <Col span={10}>\n <ZendeskWidget />\n </Col>\n <Col span={4}>\n <Typography.Text type=\"secondary\">\n Powered by{' '}\n <b>\n <a href=\"https://teloscube.com\" target=\"_blank\" rel=\"noreferrer\" style={{ color: token.colorText }}>\n Teloscube\n </a>\n </b>\n </Typography.Text>\n </Col>\n <Col span={10} style={{ justifyContent: 'flex-end', display: 'flex' }}>\n <Button size=\"small\" icon={<UserOutlined />}>\n {me.username}\n </Button>\n <VersionSelector />\n <ScreenShotter />\n <PageScroller />\n </Col>\n </Row>\n </Layout.Footer>\n </Layout>\n );\n}\n","import { theme } from 'antd';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nconst BORDER_COLORS_TRANSPARENT = {\n colorBorder: '#10161d',\n colorBorderSecondary: '#10161d',\n};\n\nconst INPUT_BG_COLOR = '#2c3d50';\n\nexport const decafTheme: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: '#10161d',\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n colorBgContainer: INPUT_BG_COLOR,\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgElevated: INPUT_BG_COLOR,\n controlItemBgActive: INPUT_BG_COLOR,\n },\n DatePicker: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n colorBgElevated: INPUT_BG_COLOR,\n },\n InputNumber: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Checkbox: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n },\n token: {\n fontFamily: 'Lato, sans-serif',\n colorPrimary: '#344961',\n colorBgBase: '#1a242f',\n colorBgContainer: '#10161d',\n colorBgElevated: '#1a242f',\n colorBorderSecondary: '#1a242f',\n colorBorder: '#1a242f',\n colorBgLayout: '#1a242f',\n borderRadius: 0,\n green: '#48734d',\n red: '#b03a38',\n blue: '#0d6efd',\n yellow: '#ffc107',\n orange: '#fd7e14',\n colorWhite: '#fff',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n","import { InfoCircleOutlined } from '@ant-design/icons';\nimport { DecafApp, DecafAppConfig, DecafAppController, DecafWebappController } from '@decafhub/decaf-react';\nimport { css, Global } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { ConfigProvider } from 'antd';\nimport 'antd/dist/reset.css';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport PageAbout from './components/PageAbout';\nimport React from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport { getStyles } from './style';\nimport Page404 from './components/Page404';\nimport DecafLayout, { DecafMenuItem } from './Layout';\nimport { decafTheme } from './theme';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n theme?: ThemeConfig;\n /**\n * App routes.<br />\n * About page and 404 page will be added automatically.<br />\n * See https://reactrouter.com/en/main/routers/create-browser-router#routes\n */\n routes: DecafRoute[];\n /**\n * App menu.<br />\n * About page will be added automatically.\n */\n menuItems: DecafMenuItem[];\n appName: string;\n appDescription?: string;\n appIcon?: React.ReactNode;\n /**\n * The extra content to show on the about page.\n */\n aboutPageContent?: React.ReactNode;\n}\n\nfunction buildRoutes(props: DecafWebappProps, routes: DecafRoute[]): RouteObject[] {\n const result: RouteObject[] = [];\n\n routes.forEach((route) => {\n const item: RouteObject = { ...route };\n if (route.children) {\n item.element = route.element ?? <Outlet />;\n item.children = buildRoutes(props, route.children);\n } else {\n item.element = (\n <DecafLayout menu={props.menuItems} appName={props.appName} appIcon={props.appIcon}>\n {route.element}\n </DecafLayout>\n );\n }\n result.push(item);\n });\n\n return result;\n}\n\nfunction addTo<T>(array: T[], items: T[], key: keyof T): T[] {\n const result: T[] = [...array];\n items.forEach((item) => {\n const index = result.findIndex((r) => r[key] === item[key]);\n if (index >= 0) {\n result[index] = item;\n } else {\n result.push(item);\n }\n });\n return result;\n}\n\nfunction DecafWebapp(props: DecafWebappProps) {\n let routes = addTo<RouteObject>(\n props.routes,\n [\n {\n path: '/about',\n element: (\n <PageAbout\n appName={props.appName}\n appVersion={props.config?.currentVersion}\n appDescription={props.appDescription}\n content={props.aboutPageContent}\n />\n ),\n },\n { path: '*', element: <Page404 /> },\n ],\n 'path'\n );\n const menuWithAboutPage = addTo(\n props.menuItems,\n [\n {\n label: 'About',\n to: '/about',\n icon: <InfoCircleOutlined />,\n },\n ],\n 'to' as any\n );\n routes = buildRoutes({ ...props, menuItems: menuWithAboutPage }, routes);\n\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const theme = props.theme ?? decafTheme;\n\n const controller = props.controller || DecafWebappController;\n controller.disableZendeskWidget = true;\n\n const globalStyles = getStyles(theme);\n\n return (\n <ConfigProvider theme={theme}>\n <Global styles={globalStyles} />\n <DecafApp config={props.config} controller={controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ConfigProvider>\n );\n}\n\nexport { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme };\n","import { Interpolation, Theme } from '@emotion/react';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nexport function getStyles(theme: ThemeConfig): Interpolation<Theme> {\n return {\n '@font-face': {\n fontFamily: 'Lato, sans-serif',\n src: 'url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)',\n },\n body: {\n background: theme.token?.colorBgBase,\n fontFamily: theme.token?.fontFamily,\n margin: 0,\n },\n // antd overrides\n button: {\n boxShadow: 'none !important',\n },\n '.ant-page-header-back-button, .ant-page-header-heading-title': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-badge-count': {\n color: `${theme.token?.colorWhite} !important`,\n },\n // end antd overrides\n '#decaf-header': {\n position: 'fixed',\n zIndex: 1030,\n right: 0,\n left: 0,\n paddingInline: 0,\n },\n '#decaf-content': {\n paddingInline: 20,\n paddingTop: '5rem',\n paddingBottom: '5rem',\n },\n '#decaf-footer': {\n position: 'fixed',\n bottom: 0,\n right: 0,\n left: 0,\n background: theme.token?.colorBgContainer,\n paddingBlock: 0,\n paddingInline: 0,\n },\n '.dot': {\n borderRadius: '50%',\n width: 10,\n height: 10,\n display: 'inline-block',\n '&.green': {\n backgroundColor: `#80ff00 !important`,\n },\n '&.yellow': {\n backgroundColor: `#ff0 !important`,\n },\n '&.orange': {\n backgroundColor: `#ff7000 !important`,\n },\n '&.red': {\n backgroundColor: `#ff0000 !important`,\n },\n },\n };\n}\n"],"names":["PageAbout","props","client","useDecaf","_useState","useState","undefined","versionBarista","setVersionBarista","useEffect","barista","get","then","data","version","React","createElement","Space","direction","size","style","width","Descriptions","title","column","bordered","Item","label","appName","appDescription","appVersion","content","Page404","Result","status","subTitle","PageScroller","Button","type","onClick","window","scrollTo","top","behavior","icon","UpOutlined","document","body","scrollHeight","DownOutlined","getCurrentAppPath","url","parts","split","indexOfWebapps","indexOf","slice","join","VersionSelector","location","href","getAppVersionFromUrl","versions","code","name","color","show","process","env","NODE_ENV","currentVersion","find","v","Dropdown","placement","arrow","menu","items","map","key","className","display","alignItems","marginRight","CaretUpOutlined","ScreenShotter","handleScreenshot","getElementById","footer","setProperty","Promise","resolve","html2canvas","canvas","dataUrl","toDataURL","link","download","click","remove","e","reject","triggerNode","cloneElement","CameraOutlined","ZendeskWidget","me","_useDecaf","publicConfig","open","setOpen","zendesk","script","src","ZENDESK_WIDGET_SCRIPT","async","id","onload","zE","appendChild","zESettings","webWidget","offset","horizontal","vertical","contactForm","subject","fields","prefill","fullname","email","removeChild","QuestionCircleOutlined","routesToAntMenu","routes","forEach","route","item","to","NavLink","end","children","result","push","DecafLayout","menuItems","matchedMenuItems","useMatches","match","pathname","token","theme","useToken","Layout","height","Header","paddingInline","justifyContent","Link","gap","appIcon","Typography","Title","level","margin","Menu","backgroundColor","border","flex","mode","selectedKeys","Content","Footer","Row","justify","align","Col","span","Text","target","rel","colorText","UserOutlined","username","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","decafTheme","hashed","components","colorBgHeader","boxShadow","boxShadowSecondary","colorBgContainer","Input","Select","colorBgElevated","controlItemBgActive","DatePicker","InputNumber","Checkbox","fontFamily","colorPrimary","colorBgBase","colorBgLayout","borderRadius","green","red","blue","yellow","orange","colorWhite","algorithm","darkAlgorithm","buildRoutes","_route$element","element","Outlet","addTo","array","index","findIndex","r","DecafWebapp","_props$config","_props$config2","_props$theme","path","config","aboutPageContent","_extends","InfoCircleOutlined","router","createBrowserRouter","basename","basePath","controller","DecafWebappController","disableZendeskWidget","globalStyles","_theme$token","_theme$token2","_theme$token3","_theme$token4","_theme$token5","background","button","position","zIndex","right","left","paddingTop","paddingBottom","bottom","paddingBlock","getStyles","ConfigProvider","Global","styles","DecafApp","RouterProvider"],"mappings":"+gCAUwBA,SAAAA,EAAUC,GAChC,IAAQC,EAAWC,IAAXD,OACRE,EAA4CC,OAA6BC,GAAlEC,OAAgBC,EAAiBJ,EAAA,GAMxC,OAJAK,EAAU,WACRP,EAAOQ,QAAQC,IAAyB,aAAaC,KAAK,SAAGC,GAAI,W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src/components/PageAbout.tsx","../src/components/PageScroller.tsx","../src/components/VersionSelector.tsx","../src/components/Screenshotter.tsx","../src/components/ZendeskWidget.tsx","../src/Layout.tsx","../src/theme.ts","../src/index.tsx","../src/style.ts"],"sourcesContent":["import { Result } from 'antd';\nimport React from 'react';\n\nexport default function Page404() {\n return <Result status=\"404\" title={'404'} subTitle={'Sorry, the page you visited does not exist.'} />;\n}\n","import { useDecaf } from '@decafhub/decaf-react';\nimport { Descriptions, Space } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nexport interface AboutPageProps {\n appName?: string;\n appVersion?: string;\n appDescription?: string;\n content?: React.ReactNode;\n}\nexport default function PageAbout(props: AboutPageProps) {\n const { client } = useDecaf();\n const [versionBarista, setVersionBarista] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n client.barista.get<{ version: string }>('/version/').then(({ data }) => setVersionBarista(data.version));\n }, [client]);\n\n return (\n <Space direction=\"vertical\" size=\"middle\" style={{ width: '100%' }}>\n <Descriptions title=\"About\" column={1} bordered>\n <Descriptions.Item label=\"Web Application Name\">{props.appName}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Description\">{props.appDescription}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Version\">{`v${props.appVersion}`}</Descriptions.Item>\n <Descriptions.Item label=\"DECAF Barista Version\">{`v${versionBarista}`}</Descriptions.Item>\n </Descriptions>\n {props.content}\n </Space>\n );\n}\n","import { DownOutlined, UpOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\nexport default function PageScroller() {\n return (\n <div>\n <Button\n title=\"Scroll to top\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}\n icon={<UpOutlined />}\n />\n <Button\n title=\"Scroll to bottom\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })}\n icon={<DownOutlined />}\n />\n </div>\n );\n}\n","import { CaretUpOutlined } from '@ant-design/icons';\nimport { Button, Dropdown } from 'antd';\nimport React from 'react';\n\nexport type Version = {\n code: string;\n name: string;\n color: string;\n url: string;\n show: boolean;\n};\n\nfunction getAppNameFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 1];\n }\n}\n\nfunction getAppVersionFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 2];\n }\n}\n\nfunction getCurrentAppPath(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts.slice(indexOfWebapps + 3).join('/');\n }\n}\n\nexport default function VersionSelector() {\n const appName = getAppNameFromUrl(window.location.href);\n const appVersion = getAppVersionFromUrl(window.location.href);\n\n const versions: Version[] = [\n {\n code: 'development',\n name: 'Development Version',\n color: 'red',\n url: `/webapps/${appName}/development/${getCurrentAppPath(window.location.href)}`,\n show: process.env.NODE_ENV === 'development',\n },\n {\n code: 'testing',\n name: 'Testing Version',\n color: 'orange',\n url: `/webapps/${appName}/testing/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'staging',\n name: 'Staging Version',\n color: 'yellow',\n url: `/webapps/${appName}/staging/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'production',\n name: 'Production Version',\n color: 'green',\n url: `/webapps/${appName}/production/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n ];\n const currentVersion = versions.find((v) => v.code === appVersion);\n\n if (!currentVersion) {\n return null;\n }\n\n return (\n <Dropdown\n placement=\"top\"\n arrow\n menu={{\n items: versions.map((version) => ({\n key: version.name,\n label: (\n <span>\n <i className={`dot ${version.color}`} /> {version.name}\n </span>\n ),\n onClick: () => {\n window.location.href = version.url;\n },\n })),\n }}\n >\n <Button type=\"text\" size=\"small\">\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <i className={`dot ${currentVersion?.color}`} style={{ marginRight: 5 }} />\n <CaretUpOutlined />\n </div>\n </Button>\n </Dropdown>\n );\n}\n","import { CameraOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport html2canvas from 'html2canvas';\nimport React from 'react';\n\nexport interface ScreenShotterProps {\n triggerNode?: React.ReactNode;\n}\nexport default function ScreenShotter(props: ScreenShotterProps) {\n async function handleScreenshot() {\n // hide footer before taking screenshot\n const footer = document.getElementById('decaf-footer');\n footer?.style.setProperty('display', 'none');\n\n const canvas = await html2canvas(document.body);\n const dataUrl = canvas.toDataURL('image/png');\n\n // show footer after taking screenshot\n footer?.style.setProperty('display', 'block');\n\n const link = document.createElement('a');\n link.download = 'screenshot.png';\n link.href = dataUrl;\n link.click();\n link.remove();\n }\n\n if (props.triggerNode) {\n return React.cloneElement(props.triggerNode as React.ReactElement, {\n onClick: handleScreenshot,\n });\n } else {\n return (\n <Button\n title=\"Take a screenshot of the current page\"\n type=\"text\"\n size=\"small\"\n icon={<CameraOutlined />}\n onClick={handleScreenshot}\n />\n );\n }\n}\n","import { QuestionCircleOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nconst ZENDESK_WIDGET_SCRIPT = 'https://static.zdassets.com/ekr/snippet.js';\n\ndeclare global {\n // eslint-disable-next-line no-unused-vars\n interface Window {\n zE: any;\n zESettings: any;\n }\n}\n\nexport default function ZendeskWidget() {\n const { me, publicConfig } = useDecaf();\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (!publicConfig.zendesk || typeof document === 'undefined') return;\n const script = document.createElement('script');\n script.src = ZENDESK_WIDGET_SCRIPT + '?key=' + publicConfig.zendesk;\n script.async = true;\n script.id = 'ze-snippet'; // do not change this. zendesk expects this to be ze-snippet\n script.onload = () => {\n window.zE('webWidget', 'hide');\n window.zE('webWidget:on', 'open', () => {\n window.zE('webWidget', 'show');\n setOpen(true);\n });\n window.zE('webWidget:on', 'close', () => {\n window.zE('webWidget', 'hide');\n setOpen(false);\n });\n };\n\n document.body.appendChild(script);\n window.zESettings = {\n webWidget: {\n offset: {\n horizontal: -7,\n vertical: 20,\n },\n },\n contactForm: {\n subject: true,\n fields: [\n {\n id: 'name',\n prefill: { '*': me.fullname },\n },\n {\n id: 'email',\n prefill: { '*': me.email },\n },\n ],\n },\n };\n\n return () => {\n document.body.removeChild(script);\n };\n }, [publicConfig, me]);\n\n function toggle() {\n if (open) {\n window.zE?.('webWidget', 'close');\n } else {\n window.zE?.('webWidget', 'open');\n }\n setOpen(!open);\n }\n\n if (!publicConfig.zendesk) return null;\n\n return (\n <Button size=\"small\" icon={<QuestionCircleOutlined />} onClick={toggle}>\n Support\n </Button>\n );\n}\n","import { UserOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button, Col, Layout, Menu, Row, theme, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport PageScroller from './components/PageScroller';\nimport VersionSelector from './components/VersionSelector';\nimport React from 'react';\nimport { Link, NavLink, useMatches } from 'react-router-dom';\nimport ScreenShotter from './components/Screenshotter';\nimport ZendeskWidget from './components/ZendeskWidget';\n\ninterface BaseDecafMenuItem {\n label: any;\n icon?: React.ReactNode;\n children?: DecafMenuItem[];\n}\n\nexport type DecafMenuItem = BaseDecafMenuItem & ({ to?: string } | { href?: string });\n\nexport interface DecafLayoutProps {\n menu: DecafMenuItem[];\n appName: string;\n appIcon?: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport function routesToAntMenu(routes: DecafMenuItem[]): ItemType[] {\n const result: ItemType[] = [];\n routes.forEach((route) => {\n const item: ItemType = {\n key: 'to' in route ? route.to : route.label,\n label: route.label,\n icon: route.icon,\n };\n if ('to' in route && route.to) {\n item.label = (\n <NavLink to={route.to} end={route.to === '/'}>\n {route.label}\n </NavLink>\n );\n } else if ('href' in route && route.href) {\n item.label = <a href={route.href}>{route.label}</a>;\n } else if (route.children) {\n item.label = route.label;\n (item as SubMenuType).children = routesToAntMenu(route.children || []);\n }\n result.push(item);\n });\n\n return result;\n}\n\nexport default function DecafLayout(props: DecafLayoutProps) {\n const menuItems = routesToAntMenu(props.menu);\n const matches = useMatches();\n const matchedMenuItems = matches.map((match) => match.pathname);\n const { me } = useDecaf();\n const { token } = theme.useToken();\n\n return (\n <Layout style={{ height: '100%' }}>\n <Layout.Header id=\"decaf-header\">\n <div style={{ paddingInline: 20, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>\n <Link to=\"/\" style={{ display: 'flex', alignItems: 'center', gap: 10 }}>\n {props.appIcon}\n <Typography.Title level={4} style={{ margin: 0 }}>\n {props.appName}\n </Typography.Title>\n </Link>\n <Menu\n style={{ justifyContent: 'flex-end', backgroundColor: 'transparent', border: 'none', flex: 1 }}\n mode=\"horizontal\"\n items={menuItems}\n selectedKeys={matchedMenuItems}\n />\n </div>\n </Layout.Header>\n <Layout.Content id=\"decaf-content\">{props.children}</Layout.Content>\n <Layout.Footer id=\"decaf-footer\">\n <Row justify=\"space-between\" align={'middle'}>\n <Col span={10}>\n <ZendeskWidget />\n </Col>\n <Col span={4}>\n <Typography.Text type=\"secondary\">\n Powered by{' '}\n <b>\n <a href=\"https://teloscube.com\" target=\"_blank\" rel=\"noreferrer\" style={{ color: token.colorText }}>\n Teloscube\n </a>\n </b>\n </Typography.Text>\n </Col>\n <Col span={10} style={{ justifyContent: 'flex-end', display: 'flex' }}>\n <Button size=\"small\" icon={<UserOutlined />}>\n {me.username}\n </Button>\n <VersionSelector />\n <ScreenShotter />\n <PageScroller />\n </Col>\n </Row>\n </Layout.Footer>\n </Layout>\n );\n}\n","import { theme } from 'antd';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nconst BORDER_COLORS_TRANSPARENT = {\n colorBorder: '#10161d',\n colorBorderSecondary: '#10161d',\n};\n\nconst INPUT_BG_COLOR = '#2c3d50';\n\nexport const decafTheme: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: '#10161d',\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n colorBgContainer: INPUT_BG_COLOR,\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgElevated: INPUT_BG_COLOR,\n controlItemBgActive: INPUT_BG_COLOR,\n },\n DatePicker: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n colorBgElevated: INPUT_BG_COLOR,\n },\n InputNumber: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Checkbox: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n },\n token: {\n fontFamily: 'Lato, sans-serif',\n colorPrimary: '#344961',\n colorBgBase: '#1a242f',\n colorBgContainer: '#10161d',\n colorBgElevated: '#1a242f',\n colorBorderSecondary: '#1a242f',\n colorBorder: '#1a242f',\n colorBgLayout: '#1a242f',\n borderRadius: 0,\n green: '#48734d',\n red: '#b03a38',\n blue: '#0d6efd',\n yellow: '#ffc107',\n orange: '#fd7e14',\n colorWhite: '#fff',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n","import { InfoCircleOutlined } from '@ant-design/icons';\nimport { DecafApp, DecafAppConfig, DecafAppController, DecafWebappController } from '@decafhub/decaf-react';\nimport { css, Global } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { ConfigProvider } from 'antd';\nimport 'antd/dist/reset.css';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport React, { useEffect } from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport Page404 from './components/Page404';\nimport PageAbout from './components/PageAbout';\nimport DecafLayout, { DecafMenuItem } from './Layout';\nimport { getStyles } from './style';\nimport { decafTheme } from './theme';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n theme?: ThemeConfig;\n /**\n * App routes.<br />\n * About page and 404 page will be added automatically.<br />\n * See https://reactrouter.com/en/main/routers/create-browser-router#routes\n */\n routes: DecafRoute[];\n /**\n * App menu.<br />\n * About page will be added automatically.\n */\n menuItems: DecafMenuItem[];\n appName: string;\n appDescription?: string;\n appIcon?: React.ReactNode;\n /**\n * The extra content to show on the about page.\n */\n aboutPageContent?: React.ReactNode;\n}\n\nfunction buildRoutes(props: DecafWebappProps, routes: DecafRoute[]): RouteObject[] {\n const result: RouteObject[] = [];\n\n routes.forEach((route) => {\n const item: RouteObject = { ...route };\n if (route.children) {\n item.element = route.element ?? <Outlet />;\n item.children = buildRoutes(props, route.children);\n } else {\n item.element = (\n <DecafLayout menu={props.menuItems} appName={props.appName} appIcon={props.appIcon}>\n {route.element}\n </DecafLayout>\n );\n }\n result.push(item);\n });\n\n return result;\n}\n\nfunction addTo<T>(array: T[], items: T[], key: keyof T): T[] {\n const result: T[] = [...array];\n items.forEach((item) => {\n const index = result.findIndex((r) => r[key] === item[key]);\n if (index >= 0) {\n result[index] = item;\n } else {\n result.push(item);\n }\n });\n return result;\n}\n\nfunction DecafWebapp(props: DecafWebappProps) {\n useEffect(() => {\n // add plausible analytics\n const script = document.createElement('script');\n script.defer = true;\n script.setAttribute('data-domain', location.hostname);\n script.src = 'https://webax.svc.sys.decafhub.com/js/plausible.js';\n document.body.appendChild(script);\n\n return () => {\n document.body.removeChild(script);\n };\n }, []);\n\n let routes = addTo<RouteObject>(\n props.routes,\n [\n {\n path: '/about',\n element: (\n <PageAbout\n appName={props.appName}\n appVersion={props.config?.currentVersion}\n appDescription={props.appDescription}\n content={props.aboutPageContent}\n />\n ),\n },\n { path: '*', element: <Page404 /> },\n ],\n 'path'\n );\n const menuWithAboutPage = addTo(\n props.menuItems,\n [\n {\n label: 'About',\n to: '/about',\n icon: <InfoCircleOutlined />,\n },\n ],\n 'to' as any\n );\n routes = buildRoutes({ ...props, menuItems: menuWithAboutPage }, routes);\n\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const theme = props.theme ?? decafTheme;\n\n const controller = props.controller || DecafWebappController;\n controller.disableZendeskWidget = true;\n\n const globalStyles = getStyles(theme);\n\n return (\n <ConfigProvider theme={theme}>\n <Global styles={globalStyles} />\n <DecafApp config={props.config} controller={controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ConfigProvider>\n );\n}\n\nexport { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme };\n","import { Interpolation, Theme } from '@emotion/react';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nexport function getStyles(theme: ThemeConfig): Interpolation<Theme> {\n return {\n '@font-face': {\n fontFamily: 'Lato, sans-serif',\n src: 'url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)',\n },\n body: {\n background: theme.token?.colorBgBase,\n fontFamily: theme.token?.fontFamily,\n margin: 0,\n },\n // antd overrides\n button: {\n boxShadow: 'none !important',\n },\n '.ant-page-header-back-button, .ant-page-header-heading-title': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-badge-count': {\n color: `${theme.token?.colorWhite} !important`,\n },\n // end antd overrides\n '#decaf-header': {\n position: 'fixed',\n zIndex: 1030,\n right: 0,\n left: 0,\n paddingInline: 0,\n },\n '#decaf-content': {\n paddingInline: 20,\n paddingTop: '5rem',\n paddingBottom: '5rem',\n },\n '#decaf-footer': {\n position: 'fixed',\n bottom: 0,\n right: 0,\n left: 0,\n background: theme.token?.colorBgContainer,\n paddingBlock: 0,\n paddingInline: 0,\n },\n '.dot': {\n borderRadius: '50%',\n width: 10,\n height: 10,\n display: 'inline-block',\n '&.green': {\n backgroundColor: `#80ff00 !important`,\n },\n '&.yellow': {\n backgroundColor: `#ff0 !important`,\n },\n '&.orange': {\n backgroundColor: `#ff7000 !important`,\n },\n '&.red': {\n backgroundColor: `#ff0000 !important`,\n },\n },\n };\n}\n"],"names":["Page404","React","createElement","Result","status","title","subTitle","PageAbout","props","client","useDecaf","_useState","useState","undefined","versionBarista","setVersionBarista","useEffect","barista","get","then","data","version","Space","direction","size","style","width","Descriptions","column","bordered","Item","label","appName","appDescription","appVersion","content","PageScroller","Button","type","onClick","window","scrollTo","top","behavior","icon","UpOutlined","document","body","scrollHeight","DownOutlined","getCurrentAppPath","url","parts","split","indexOfWebapps","indexOf","slice","join","VersionSelector","location","href","getAppVersionFromUrl","versions","code","name","color","show","process","env","NODE_ENV","currentVersion","find","v","Dropdown","placement","arrow","menu","items","map","key","className","display","alignItems","marginRight","CaretUpOutlined","ScreenShotter","handleScreenshot","getElementById","footer","setProperty","Promise","resolve","html2canvas","canvas","dataUrl","toDataURL","link","download","click","remove","e","reject","triggerNode","cloneElement","CameraOutlined","ZendeskWidget","me","_useDecaf","publicConfig","open","setOpen","zendesk","script","src","ZENDESK_WIDGET_SCRIPT","async","id","onload","zE","appendChild","zESettings","webWidget","offset","horizontal","vertical","contactForm","subject","fields","prefill","fullname","email","removeChild","QuestionCircleOutlined","routesToAntMenu","routes","forEach","route","item","to","NavLink","end","children","result","push","DecafLayout","menuItems","matchedMenuItems","useMatches","match","pathname","token","theme","useToken","Layout","height","Header","paddingInline","justifyContent","Link","gap","appIcon","Typography","Title","level","margin","Menu","backgroundColor","border","flex","mode","selectedKeys","Content","Footer","Row","justify","align","Col","span","Text","target","rel","colorText","UserOutlined","username","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","decafTheme","hashed","components","colorBgHeader","boxShadow","boxShadowSecondary","colorBgContainer","Input","Select","colorBgElevated","controlItemBgActive","DatePicker","InputNumber","Checkbox","fontFamily","colorPrimary","colorBgBase","colorBgLayout","borderRadius","green","red","blue","yellow","orange","colorWhite","algorithm","darkAlgorithm","buildRoutes","_route$element","_extends","element","Outlet","addTo","array","concat","index","findIndex","r","DecafWebapp","defer","setAttribute","hostname","path","_props$config","config","aboutPageContent","InfoCircleOutlined","router","createBrowserRouter","basename","_props$config2","basePath","_props$theme","controller","DecafWebappController","disableZendeskWidget","globalStyles","_theme$token","_theme$token2","_theme$token3","_theme$token4","_theme$token5","background","button","position","zIndex","right","left","paddingTop","paddingBottom","bottom","paddingBlock","getStyles","ConfigProvider","Global","styles","DecafApp","RouterProvider"],"mappings":"+gCAGwBA,SAAAA,IACtB,OAAQC,EAAAC,cAAAC,EAAO,CAAAC,OAAO,MAAMC,MAAO,MAAOC,SAAU,+CACtD,CCKwBC,SAAAA,EAAUC,GAChC,IAAQC,EAAWC,IAAXD,OACRE,EAA4CC,OAA6BC,GAAlEC,OAAgBC,EAAiBJ,EAAA,GAMxC,OAJAK,EAAU,WACRP,EAAOQ,QAAQC,IAAyB,aAAaC,KAAK,SAAGC,GAAI,WAAJA,KAAkCC,QAAQ,EACzG,EAAG,CAACZ,IAGFR,EAACC,cAAAoB,GAAMC,UAAU,WAAWC,KAAK,SAASC,MAAO,CAAEC,MAAO,SACxDzB,EAACC,cAAAyB,EAAa,CAAAtB,MAAM,QAAQuB,OAAQ,EAAGC,UAAQ,GAC7C5B,EAACC,cAAAyB,EAAaG,KAAK,CAAAC,MAAM,wBAAwBvB,EAAMwB,SACvD/B,EAACC,cAAAyB,EAAaG,KAAK,CAAAC,MAAM,+BAA+BvB,EAAMyB,gBAC9DhC,EAAAC,cAACyB,EAAaG,KAAI,CAACC,MAAM,2BAAyB,IAAMvB,EAAM0B,YAC9DjC,EAAAC,cAACyB,EAAaG,KAAI,CAACC,MAAM,6BAA6BjB,IAEvDN,EAAM2B,QAGb,CCzBwBC,SAAAA,IACtB,OACEnC,EAAAC,cAAA,MAAA,KACED,EAAAC,cAACmC,EACC,CAAAhC,MAAM,gBACNiC,KAAK,OACLd,KAAK,QACLe,QAAS,WAAMC,OAAAA,OAA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,EAAapC,2BAGzB,gBAAiB,CACfwC,SAAU,QACVC,OAAQ,KACRC,MAAO,EACPC,KAAM,EACNlG,cAAe,GAEjB,iBAAkB,CAChBA,cAAe,GACfmG,WAAY,OACZC,cAAe,QAEjB,gBAAiB,CACfL,SAAU,QACVM,OAAQ,EACRJ,MAAO,EACPC,KAAM,EACNL,WAAY,SAAAlG,EAAMD,YAAN,EAAAkG,EAAavD,iBACzBiE,aAAc,EACdtG,cAAe,GAEjB,OAAQ,CACNiD,aAAc,MACdnL,MAAO,GACPgI,OAAQ,GACRzE,QAAS,eACT,UAAW,CACTqF,gBACD,sBACD,WAAY,CACVA,gBAAe,mBAEjB,WAAY,CACVA,gBAAe,sBAEjB,QAAS,CACPA,gBAAe,uBAIvB,CDgEuB6F,CAAU5G,GAE/B,OACEtJ,EAACC,cAAAkQ,EAAe,CAAA7G,MAAOA,GACrBtJ,EAAAC,cAACmQ,EAAM,CAACC,OAAQnB,IAChBlP,EAACC,cAAAqQ,EAAS,CAAAhC,OAAQ/N,EAAM+N,OAAQS,WAAYA,GAC1C/O,EAACC,cAAAsQ,GAAe9B,OAAQA,KAIhC"}
package/dist/index.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@ant-design/icons"),require("@decafhub/decaf-react"),require("@emotion/react"),require("@emotion/styled"),require("antd"),require("antd/dist/reset.css"),require("react"),require("react-router-dom"),require("html2canvas")):"function"==typeof define&&define.amd?define(["exports","@ant-design/icons","@decafhub/decaf-react","@emotion/react","@emotion/styled","antd","antd/dist/reset.css","react","react-router-dom","html2canvas"],t):t((e||self).decafReactWebapp={},e.icons,e.decafReact,e.react,e.styled,e.antd,0,e.react,e.reactRouterDom,e.html2Canvas)}(this,function(e,t,n,o,l,a,r,i,c,d){function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=/*#__PURE__*/u(l),f=/*#__PURE__*/u(i),m=/*#__PURE__*/u(d);function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},p.apply(this,arguments)}function g(e){var t=n.useDecaf().client,o=i.useState(void 0),l=o[0],r=o[1];return i.useEffect(function(){t.barista.get("/version/").then(function(e){return r(e.data.version)})},[t]),f.default.createElement(a.Space,{direction:"vertical",size:"middle",style:{width:"100%"}},f.default.createElement(a.Descriptions,{title:"About",column:1,bordered:!0},f.default.createElement(a.Descriptions.Item,{label:"Web Application Name"},e.appName),f.default.createElement(a.Descriptions.Item,{label:"Web Application Description"},e.appDescription),f.default.createElement(a.Descriptions.Item,{label:"Web Application Version"},"v"+e.appVersion),f.default.createElement(a.Descriptions.Item,{label:"DECAF Barista Version"},"v"+l)),e.content)}function b(){return f.default.createElement(a.Result,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function h(){return f.default.createElement("div",null,f.default.createElement(a.Button,{title:"Scroll to top",type:"text",size:"small",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})},icon:f.default.createElement(t.UpOutlined,null)}),f.default.createElement(a.Button,{title:"Scroll to bottom",type:"text",size:"small",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},icon:f.default.createElement(t.DownOutlined,null)}))}function y(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function E(){var e,n,o=-1===(n=(e=window.location.href.split("/")).indexOf("webapps"))?"":e[n+1],l=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),r=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+o+"/development/"+y(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+o+"/testing/"+y(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+o+"/staging/"+y(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+o+"/production/"+y(window.location.href),show:!0}],i=r.find(function(e){return e.code===l});return i?f.default.createElement(a.Dropdown,{placement:"top",arrow:!0,menu:{items:r.map(function(e){return{key:e.name,label:f.default.createElement("span",null,f.default.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){window.location.href=e.url}}})}},f.default.createElement(a.Button,{type:"text",size:"small"},f.default.createElement("div",{style:{display:"flex",alignItems:"center"}},f.default.createElement("i",{className:"dot "+(null==i?void 0:i.color),style:{marginRight:5}}),f.default.createElement(t.CaretUpOutlined,null)))):null}function w(e){var n=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(m.default(document.body)).then(function(t){var n=t.toDataURL("image/png");null==e||e.style.setProperty("display","block");var o=document.createElement("a");o.download="screenshot.png",o.href=n,o.click(),o.remove()})}catch(e){return Promise.reject(e)}};return e.triggerNode?f.default.cloneElement(e.triggerNode,{onClick:n}):f.default.createElement(a.Button,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:f.default.createElement(t.CameraOutlined,null),onClick:n})}function v(){var e=n.useDecaf(),o=e.me,l=e.publicConfig,r=i.useState(!1),c=r[0],d=r[1];return i.useEffect(function(){if(l.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src="https://static.zdassets.com/ekr/snippet.js?key="+l.zendesk,e.async=!0,e.id="ze-snippet",e.onload=function(){window.zE("webWidget","hide"),window.zE("webWidget:on","open",function(){window.zE("webWidget","show"),d(!0)}),window.zE("webWidget:on","close",function(){window.zE("webWidget","hide"),d(!1)})},document.body.appendChild(e),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":o.fullname}},{id:"email",prefill:{"*":o.email}}]}},function(){document.body.removeChild(e)}}},[l,o]),l.zendesk?f.default.createElement(a.Button,{size:"small",icon:f.default.createElement(t.QuestionCircleOutlined,null),onClick:function(){c?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),d(!c)}},"Support"):null}function k(e){var t=[];return e.forEach(function(e){var n={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?n.label=f.default.createElement(c.NavLink,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=f.default.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=k(e.children||[])),t.push(n)}),t}function C(e){var o=k(e.menu),l=c.useMatches().map(function(e){return e.pathname}),r=n.useDecaf().me,i=a.theme.useToken().token;return f.default.createElement(a.Layout,{style:{height:"100%"}},f.default.createElement(a.Layout.Header,{id:"decaf-header"},f.default.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},f.default.createElement(c.Link,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},e.appIcon,f.default.createElement(a.Typography.Title,{level:4,style:{margin:0}},e.appName)),f.default.createElement(a.Menu,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:o,selectedKeys:l}))),f.default.createElement(a.Layout.Content,{id:"decaf-content"},e.children),f.default.createElement(a.Layout.Footer,{id:"decaf-footer"},f.default.createElement(a.Row,{justify:"space-between",align:"middle"},f.default.createElement(a.Col,{span:10},f.default.createElement(v,null)),f.default.createElement(a.Col,{span:4},f.default.createElement(a.Typography.Text,{type:"secondary"},"Powered by"," ",f.default.createElement("b",null,f.default.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer",style:{color:i.colorText}},"Teloscube")))),f.default.createElement(a.Col,{span:10,style:{justifyContent:"flex-end",display:"flex"}},f.default.createElement(a.Button,{size:"small",icon:f.default.createElement(t.UserOutlined,null)},r.username),f.default.createElement(E,null),f.default.createElement(w,null),f.default.createElement(h,null)))))}var B={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},x="#2c3d50",z={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:x},Input:p({},B,{colorBgContainer:x}),Select:p({},B,{colorBgContainer:x}),Dropdown:p({},B,{colorBgElevated:x,controlItemBgActive:x}),DatePicker:p({},B,{colorBgContainer:x,colorBgElevated:x}),InputNumber:p({},B,{colorBgContainer:x}),Checkbox:p({},B,{colorBgContainer:x})},token:{fontFamily:"Lato, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:"#10161d",colorBgElevated:"#1a242f",colorBorderSecondary:"#1a242f",colorBorder:"#1a242f",colorBgLayout:"#1a242f",borderRadius:0,green:"#48734d",red:"#b03a38",blue:"#0d6efd",yellow:"#ffc107",orange:"#fd7e14",colorWhite:"#fff"},algorithm:[a.theme.darkAlgorithm]};function D(e,t){var n=[];return t.forEach(function(t){var o,l=p({},t);t.children?(l.element=null!=(o=t.element)?o:f.default.createElement(c.Outlet,null),l.children=D(e,t.children)):l.element=f.default.createElement(C,{menu:e.menuItems,appName:e.appName,appIcon:e.appIcon},t.element),n.push(l)}),n}function I(e,t,n){var o=[].concat(e);return t.forEach(function(e){var t=o.findIndex(function(t){return t[n]===e[n]});t>=0?o[t]=e:o.push(e)}),o}Object.defineProperty(e,"GlobalStyle",{enumerable:!0,get:function(){return o.Global}}),Object.defineProperty(e,"css",{enumerable:!0,get:function(){return o.css}}),Object.defineProperty(e,"styled",{enumerable:!0,get:function(){return s.default}}),e.DecafWebapp=function(e){var l,r,i,d=I(e.routes,[{path:"/about",element:f.default.createElement(g,{appName:e.appName,appVersion:null==(l=e.config)?void 0:l.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:f.default.createElement(b,null)}],"path");d=D(p({},e,{menuItems:I(e.menuItems,[{label:"About",to:"/about",icon:f.default.createElement(t.InfoCircleOutlined,null)}],"to")}),d);var u=c.createBrowserRouter(d,{basename:null==(r=e.config)?void 0:r.basePath}),s=null!=(i=e.theme)?i:z,m=e.controller||n.DecafWebappController;m.disableZendeskWidget=!0;var h=function(e){var t,n,o,l,a;return{"@font-face":{fontFamily:"Lato, sans-serif",src:"url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)"},body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:null==(n=e.token)?void 0:n.fontFamily,margin:0},button:{boxShadow:"none !important"},".ant-page-header-back-button, .ant-page-header-heading-title":{color:(null==(o=e.token)?void 0:o.colorWhite)+" !important"},".ant-badge-count":{color:(null==(l=e.token)?void 0:l.colorWhite)+" !important"},"#decaf-header":{position:"fixed",zIndex:1030,right:0,left:0,paddingInline:0},"#decaf-content":{paddingInline:20,paddingTop:"5rem",paddingBottom:"5rem"},"#decaf-footer":{position:"fixed",bottom:0,right:0,left:0,background:null==(a=e.token)?void 0:a.colorBgContainer,paddingBlock:0,paddingInline:0},".dot":{borderRadius:"50%",width:10,height:10,display:"inline-block","&.green":{backgroundColor:"#80ff00 !important"},"&.yellow":{backgroundColor:"#ff0 !important"},"&.orange":{backgroundColor:"#ff7000 !important"},"&.red":{backgroundColor:"#ff0000 !important"}}}}(s);return f.default.createElement(a.ConfigProvider,{theme:s},f.default.createElement(o.Global,{styles:h}),f.default.createElement(n.DecafApp,{config:e.config,controller:m},f.default.createElement(c.RouterProvider,{router:u})))},e.decafTheme=z});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@ant-design/icons"),require("@decafhub/decaf-react"),require("@emotion/react"),require("@emotion/styled"),require("antd"),require("antd/dist/reset.css"),require("react"),require("react-router-dom"),require("html2canvas")):"function"==typeof define&&define.amd?define(["exports","@ant-design/icons","@decafhub/decaf-react","@emotion/react","@emotion/styled","antd","antd/dist/reset.css","react","react-router-dom","html2canvas"],t):t((e||self).decafReactWebapp={},e.icons,e.decafReact,e.react,e.styled,e.antd,0,e.react,e.reactRouterDom,e.html2Canvas)}(this,function(e,t,n,o,l,a,r,i,c,d){function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=/*#__PURE__*/u(l),f=/*#__PURE__*/u(i),m=/*#__PURE__*/u(d);function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},p.apply(this,arguments)}function b(){return f.default.createElement(a.Result,{status:"404",title:"404",subTitle:"Sorry, the page you visited does not exist."})}function g(e){var t=n.useDecaf().client,o=i.useState(void 0),l=o[0],r=o[1];return i.useEffect(function(){t.barista.get("/version/").then(function(e){return r(e.data.version)})},[t]),f.default.createElement(a.Space,{direction:"vertical",size:"middle",style:{width:"100%"}},f.default.createElement(a.Descriptions,{title:"About",column:1,bordered:!0},f.default.createElement(a.Descriptions.Item,{label:"Web Application Name"},e.appName),f.default.createElement(a.Descriptions.Item,{label:"Web Application Description"},e.appDescription),f.default.createElement(a.Descriptions.Item,{label:"Web Application Version"},"v"+e.appVersion),f.default.createElement(a.Descriptions.Item,{label:"DECAF Barista Version"},"v"+l)),e.content)}function h(){return f.default.createElement("div",null,f.default.createElement(a.Button,{title:"Scroll to top",type:"text",size:"small",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})},icon:f.default.createElement(t.UpOutlined,null)}),f.default.createElement(a.Button,{title:"Scroll to bottom",type:"text",size:"small",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},icon:f.default.createElement(t.DownOutlined,null)}))}function y(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function E(){var e,n,o=-1===(n=(e=window.location.href.split("/")).indexOf("webapps"))?"":e[n+1],l=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),r=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+o+"/development/"+y(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+o+"/testing/"+y(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+o+"/staging/"+y(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+o+"/production/"+y(window.location.href),show:!0}],i=r.find(function(e){return e.code===l});return i?f.default.createElement(a.Dropdown,{placement:"top",arrow:!0,menu:{items:r.map(function(e){return{key:e.name,label:f.default.createElement("span",null,f.default.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){window.location.href=e.url}}})}},f.default.createElement(a.Button,{type:"text",size:"small"},f.default.createElement("div",{style:{display:"flex",alignItems:"center"}},f.default.createElement("i",{className:"dot "+(null==i?void 0:i.color),style:{marginRight:5}}),f.default.createElement(t.CaretUpOutlined,null)))):null}function w(e){var n=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(m.default(document.body)).then(function(t){var n=t.toDataURL("image/png");null==e||e.style.setProperty("display","block");var o=document.createElement("a");o.download="screenshot.png",o.href=n,o.click(),o.remove()})}catch(e){return Promise.reject(e)}};return e.triggerNode?f.default.cloneElement(e.triggerNode,{onClick:n}):f.default.createElement(a.Button,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:f.default.createElement(t.CameraOutlined,null),onClick:n})}function v(){var e=n.useDecaf(),o=e.me,l=e.publicConfig,r=i.useState(!1),c=r[0],d=r[1];return i.useEffect(function(){if(l.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src="https://static.zdassets.com/ekr/snippet.js?key="+l.zendesk,e.async=!0,e.id="ze-snippet",e.onload=function(){window.zE("webWidget","hide"),window.zE("webWidget:on","open",function(){window.zE("webWidget","show"),d(!0)}),window.zE("webWidget:on","close",function(){window.zE("webWidget","hide"),d(!1)})},document.body.appendChild(e),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":o.fullname}},{id:"email",prefill:{"*":o.email}}]}},function(){document.body.removeChild(e)}}},[l,o]),l.zendesk?f.default.createElement(a.Button,{size:"small",icon:f.default.createElement(t.QuestionCircleOutlined,null),onClick:function(){c?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),d(!c)}},"Support"):null}function k(e){var t=[];return e.forEach(function(e){var n={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?n.label=f.default.createElement(c.NavLink,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=f.default.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=k(e.children||[])),t.push(n)}),t}function C(e){var o=k(e.menu),l=c.useMatches().map(function(e){return e.pathname}),r=n.useDecaf().me,i=a.theme.useToken().token;return f.default.createElement(a.Layout,{style:{height:"100%"}},f.default.createElement(a.Layout.Header,{id:"decaf-header"},f.default.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},f.default.createElement(c.Link,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},e.appIcon,f.default.createElement(a.Typography.Title,{level:4,style:{margin:0}},e.appName)),f.default.createElement(a.Menu,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:o,selectedKeys:l}))),f.default.createElement(a.Layout.Content,{id:"decaf-content"},e.children),f.default.createElement(a.Layout.Footer,{id:"decaf-footer"},f.default.createElement(a.Row,{justify:"space-between",align:"middle"},f.default.createElement(a.Col,{span:10},f.default.createElement(v,null)),f.default.createElement(a.Col,{span:4},f.default.createElement(a.Typography.Text,{type:"secondary"},"Powered by"," ",f.default.createElement("b",null,f.default.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer",style:{color:i.colorText}},"Teloscube")))),f.default.createElement(a.Col,{span:10,style:{justifyContent:"flex-end",display:"flex"}},f.default.createElement(a.Button,{size:"small",icon:f.default.createElement(t.UserOutlined,null)},r.username),f.default.createElement(E,null),f.default.createElement(w,null),f.default.createElement(h,null)))))}var B={colorBorder:"#10161d",colorBorderSecondary:"#10161d"},x="#2c3d50",z={hashed:!0,components:{Layout:{colorBgHeader:"#10161d"},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:x},Input:p({},B,{colorBgContainer:x}),Select:p({},B,{colorBgContainer:x}),Dropdown:p({},B,{colorBgElevated:x,controlItemBgActive:x}),DatePicker:p({},B,{colorBgContainer:x,colorBgElevated:x}),InputNumber:p({},B,{colorBgContainer:x}),Checkbox:p({},B,{colorBgContainer:x})},token:{fontFamily:"Lato, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:"#10161d",colorBgElevated:"#1a242f",colorBorderSecondary:"#1a242f",colorBorder:"#1a242f",colorBgLayout:"#1a242f",borderRadius:0,green:"#48734d",red:"#b03a38",blue:"#0d6efd",yellow:"#ffc107",orange:"#fd7e14",colorWhite:"#fff"},algorithm:[a.theme.darkAlgorithm]};function D(e,t){var n=[];return t.forEach(function(t){var o,l=p({},t);t.children?(l.element=null!=(o=t.element)?o:f.default.createElement(c.Outlet,null),l.children=D(e,t.children)):l.element=f.default.createElement(C,{menu:e.menuItems,appName:e.appName,appIcon:e.appIcon},t.element),n.push(l)}),n}function I(e,t,n){var o=[].concat(e);return t.forEach(function(e){var t=o.findIndex(function(t){return t[n]===e[n]});t>=0?o[t]=e:o.push(e)}),o}Object.defineProperty(e,"GlobalStyle",{enumerable:!0,get:function(){return o.Global}}),Object.defineProperty(e,"css",{enumerable:!0,get:function(){return o.css}}),Object.defineProperty(e,"styled",{enumerable:!0,get:function(){return s.default}}),e.DecafWebapp=function(e){var l,r,d;i.useEffect(function(){var e=document.createElement("script");return e.defer=!0,e.setAttribute("data-domain",location.hostname),e.src="https://webax.svc.sys.decafhub.com/js/plausible.js",document.body.appendChild(e),function(){document.body.removeChild(e)}},[]);var u=I(e.routes,[{path:"/about",element:f.default.createElement(g,{appName:e.appName,appVersion:null==(l=e.config)?void 0:l.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:f.default.createElement(b,null)}],"path");u=D(p({},e,{menuItems:I(e.menuItems,[{label:"About",to:"/about",icon:f.default.createElement(t.InfoCircleOutlined,null)}],"to")}),u);var s=c.createBrowserRouter(u,{basename:null==(r=e.config)?void 0:r.basePath}),m=null!=(d=e.theme)?d:z,h=e.controller||n.DecafWebappController;h.disableZendeskWidget=!0;var y=function(e){var t,n,o,l,a;return{"@font-face":{fontFamily:"Lato, sans-serif",src:"url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)"},body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:null==(n=e.token)?void 0:n.fontFamily,margin:0},button:{boxShadow:"none !important"},".ant-page-header-back-button, .ant-page-header-heading-title":{color:(null==(o=e.token)?void 0:o.colorWhite)+" !important"},".ant-badge-count":{color:(null==(l=e.token)?void 0:l.colorWhite)+" !important"},"#decaf-header":{position:"fixed",zIndex:1030,right:0,left:0,paddingInline:0},"#decaf-content":{paddingInline:20,paddingTop:"5rem",paddingBottom:"5rem"},"#decaf-footer":{position:"fixed",bottom:0,right:0,left:0,background:null==(a=e.token)?void 0:a.colorBgContainer,paddingBlock:0,paddingInline:0},".dot":{borderRadius:"50%",width:10,height:10,display:"inline-block","&.green":{backgroundColor:"#80ff00 !important"},"&.yellow":{backgroundColor:"#ff0 !important"},"&.orange":{backgroundColor:"#ff7000 !important"},"&.red":{backgroundColor:"#ff0000 !important"}}}}(m);return f.default.createElement(a.ConfigProvider,{theme:m},f.default.createElement(o.Global,{styles:y}),f.default.createElement(n.DecafApp,{config:e.config,controller:h},f.default.createElement(c.RouterProvider,{router:s})))},e.decafTheme=z});
2
2
  //# sourceMappingURL=index.umd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../src/components/PageAbout.tsx","../src/components/Page404.tsx","../src/components/PageScroller.tsx","../src/components/VersionSelector.tsx","../src/components/Screenshotter.tsx","../src/components/ZendeskWidget.tsx","../src/Layout.tsx","../src/theme.ts","../src/index.tsx","../src/style.ts"],"sourcesContent":["import { useDecaf } from '@decafhub/decaf-react';\nimport { Descriptions, Space } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nexport interface AboutPageProps {\n appName?: string;\n appVersion?: string;\n appDescription?: string;\n content?: React.ReactNode;\n}\nexport default function PageAbout(props: AboutPageProps) {\n const { client } = useDecaf();\n const [versionBarista, setVersionBarista] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n client.barista.get<{ version: string }>('/version/').then(({ data }) => setVersionBarista(data.version));\n }, [client]);\n\n return (\n <Space direction=\"vertical\" size=\"middle\" style={{ width: '100%' }}>\n <Descriptions title=\"About\" column={1} bordered>\n <Descriptions.Item label=\"Web Application Name\">{props.appName}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Description\">{props.appDescription}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Version\">{`v${props.appVersion}`}</Descriptions.Item>\n <Descriptions.Item label=\"DECAF Barista Version\">{`v${versionBarista}`}</Descriptions.Item>\n </Descriptions>\n {props.content}\n </Space>\n );\n}\n","import { Result } from 'antd';\nimport React from 'react';\n\nexport default function Page404() {\n return <Result status=\"404\" title={'404'} subTitle={'Sorry, the page you visited does not exist.'} />;\n}\n","import { DownOutlined, UpOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\nexport default function PageScroller() {\n return (\n <div>\n <Button\n title=\"Scroll to top\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}\n icon={<UpOutlined />}\n />\n <Button\n title=\"Scroll to bottom\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })}\n icon={<DownOutlined />}\n />\n </div>\n );\n}\n","import { CaretUpOutlined } from '@ant-design/icons';\nimport { Button, Dropdown } from 'antd';\nimport React from 'react';\n\nexport type Version = {\n code: string;\n name: string;\n color: string;\n url: string;\n show: boolean;\n};\n\nfunction getAppNameFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 1];\n }\n}\n\nfunction getAppVersionFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 2];\n }\n}\n\nfunction getCurrentAppPath(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts.slice(indexOfWebapps + 3).join('/');\n }\n}\n\nexport default function VersionSelector() {\n const appName = getAppNameFromUrl(window.location.href);\n const appVersion = getAppVersionFromUrl(window.location.href);\n\n const versions: Version[] = [\n {\n code: 'development',\n name: 'Development Version',\n color: 'red',\n url: `/webapps/${appName}/development/${getCurrentAppPath(window.location.href)}`,\n show: process.env.NODE_ENV === 'development',\n },\n {\n code: 'testing',\n name: 'Testing Version',\n color: 'orange',\n url: `/webapps/${appName}/testing/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'staging',\n name: 'Staging Version',\n color: 'yellow',\n url: `/webapps/${appName}/staging/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'production',\n name: 'Production Version',\n color: 'green',\n url: `/webapps/${appName}/production/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n ];\n const currentVersion = versions.find((v) => v.code === appVersion);\n\n if (!currentVersion) {\n return null;\n }\n\n return (\n <Dropdown\n placement=\"top\"\n arrow\n menu={{\n items: versions.map((version) => ({\n key: version.name,\n label: (\n <span>\n <i className={`dot ${version.color}`} /> {version.name}\n </span>\n ),\n onClick: () => {\n window.location.href = version.url;\n },\n })),\n }}\n >\n <Button type=\"text\" size=\"small\">\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <i className={`dot ${currentVersion?.color}`} style={{ marginRight: 5 }} />\n <CaretUpOutlined />\n </div>\n </Button>\n </Dropdown>\n );\n}\n","import { CameraOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport html2canvas from 'html2canvas';\nimport React from 'react';\n\nexport interface ScreenShotterProps {\n triggerNode?: React.ReactNode;\n}\nexport default function ScreenShotter(props: ScreenShotterProps) {\n async function handleScreenshot() {\n // hide footer before taking screenshot\n const footer = document.getElementById('decaf-footer');\n footer?.style.setProperty('display', 'none');\n\n const canvas = await html2canvas(document.body);\n const dataUrl = canvas.toDataURL('image/png');\n\n // show footer after taking screenshot\n footer?.style.setProperty('display', 'block');\n\n const link = document.createElement('a');\n link.download = 'screenshot.png';\n link.href = dataUrl;\n link.click();\n link.remove();\n }\n\n if (props.triggerNode) {\n return React.cloneElement(props.triggerNode as React.ReactElement, {\n onClick: handleScreenshot,\n });\n } else {\n return (\n <Button\n title=\"Take a screenshot of the current page\"\n type=\"text\"\n size=\"small\"\n icon={<CameraOutlined />}\n onClick={handleScreenshot}\n />\n );\n }\n}\n","import { QuestionCircleOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nconst ZENDESK_WIDGET_SCRIPT = 'https://static.zdassets.com/ekr/snippet.js';\n\ndeclare global {\n // eslint-disable-next-line no-unused-vars\n interface Window {\n zE: any;\n zESettings: any;\n }\n}\n\nexport default function ZendeskWidget() {\n const { me, publicConfig } = useDecaf();\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (!publicConfig.zendesk || typeof document === 'undefined') return;\n const script = document.createElement('script');\n script.src = ZENDESK_WIDGET_SCRIPT + '?key=' + publicConfig.zendesk;\n script.async = true;\n script.id = 'ze-snippet'; // do not change this. zendesk expects this to be ze-snippet\n script.onload = () => {\n window.zE('webWidget', 'hide');\n window.zE('webWidget:on', 'open', () => {\n window.zE('webWidget', 'show');\n setOpen(true);\n });\n window.zE('webWidget:on', 'close', () => {\n window.zE('webWidget', 'hide');\n setOpen(false);\n });\n };\n\n document.body.appendChild(script);\n window.zESettings = {\n webWidget: {\n offset: {\n horizontal: -7,\n vertical: 20,\n },\n },\n contactForm: {\n subject: true,\n fields: [\n {\n id: 'name',\n prefill: { '*': me.fullname },\n },\n {\n id: 'email',\n prefill: { '*': me.email },\n },\n ],\n },\n };\n\n return () => {\n document.body.removeChild(script);\n };\n }, [publicConfig, me]);\n\n function toggle() {\n if (open) {\n window.zE?.('webWidget', 'close');\n } else {\n window.zE?.('webWidget', 'open');\n }\n setOpen(!open);\n }\n\n if (!publicConfig.zendesk) return null;\n\n return (\n <Button size=\"small\" icon={<QuestionCircleOutlined />} onClick={toggle}>\n Support\n </Button>\n );\n}\n","import { UserOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button, Col, Layout, Menu, Row, theme, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport PageScroller from './components/PageScroller';\nimport VersionSelector from './components/VersionSelector';\nimport React from 'react';\nimport { Link, NavLink, useMatches } from 'react-router-dom';\nimport ScreenShotter from './components/Screenshotter';\nimport ZendeskWidget from './components/ZendeskWidget';\n\ninterface BaseDecafMenuItem {\n label: any;\n icon?: React.ReactNode;\n children?: DecafMenuItem[];\n}\n\nexport type DecafMenuItem = BaseDecafMenuItem & ({ to?: string } | { href?: string });\n\nexport interface DecafLayoutProps {\n menu: DecafMenuItem[];\n appName: string;\n appIcon?: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport function routesToAntMenu(routes: DecafMenuItem[]): ItemType[] {\n const result: ItemType[] = [];\n routes.forEach((route) => {\n const item: ItemType = {\n key: 'to' in route ? route.to : route.label,\n label: route.label,\n icon: route.icon,\n };\n if ('to' in route && route.to) {\n item.label = (\n <NavLink to={route.to} end={route.to === '/'}>\n {route.label}\n </NavLink>\n );\n } else if ('href' in route && route.href) {\n item.label = <a href={route.href}>{route.label}</a>;\n } else if (route.children) {\n item.label = route.label;\n (item as SubMenuType).children = routesToAntMenu(route.children || []);\n }\n result.push(item);\n });\n\n return result;\n}\n\nexport default function DecafLayout(props: DecafLayoutProps) {\n const menuItems = routesToAntMenu(props.menu);\n const matches = useMatches();\n const matchedMenuItems = matches.map((match) => match.pathname);\n const { me } = useDecaf();\n const { token } = theme.useToken();\n\n return (\n <Layout style={{ height: '100%' }}>\n <Layout.Header id=\"decaf-header\">\n <div style={{ paddingInline: 20, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>\n <Link to=\"/\" style={{ display: 'flex', alignItems: 'center', gap: 10 }}>\n {props.appIcon}\n <Typography.Title level={4} style={{ margin: 0 }}>\n {props.appName}\n </Typography.Title>\n </Link>\n <Menu\n style={{ justifyContent: 'flex-end', backgroundColor: 'transparent', border: 'none', flex: 1 }}\n mode=\"horizontal\"\n items={menuItems}\n selectedKeys={matchedMenuItems}\n />\n </div>\n </Layout.Header>\n <Layout.Content id=\"decaf-content\">{props.children}</Layout.Content>\n <Layout.Footer id=\"decaf-footer\">\n <Row justify=\"space-between\" align={'middle'}>\n <Col span={10}>\n <ZendeskWidget />\n </Col>\n <Col span={4}>\n <Typography.Text type=\"secondary\">\n Powered by{' '}\n <b>\n <a href=\"https://teloscube.com\" target=\"_blank\" rel=\"noreferrer\" style={{ color: token.colorText }}>\n Teloscube\n </a>\n </b>\n </Typography.Text>\n </Col>\n <Col span={10} style={{ justifyContent: 'flex-end', display: 'flex' }}>\n <Button size=\"small\" icon={<UserOutlined />}>\n {me.username}\n </Button>\n <VersionSelector />\n <ScreenShotter />\n <PageScroller />\n </Col>\n </Row>\n </Layout.Footer>\n </Layout>\n );\n}\n","import { theme } from 'antd';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nconst BORDER_COLORS_TRANSPARENT = {\n colorBorder: '#10161d',\n colorBorderSecondary: '#10161d',\n};\n\nconst INPUT_BG_COLOR = '#2c3d50';\n\nexport const decafTheme: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: '#10161d',\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n colorBgContainer: INPUT_BG_COLOR,\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgElevated: INPUT_BG_COLOR,\n controlItemBgActive: INPUT_BG_COLOR,\n },\n DatePicker: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n colorBgElevated: INPUT_BG_COLOR,\n },\n InputNumber: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Checkbox: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n },\n token: {\n fontFamily: 'Lato, sans-serif',\n colorPrimary: '#344961',\n colorBgBase: '#1a242f',\n colorBgContainer: '#10161d',\n colorBgElevated: '#1a242f',\n colorBorderSecondary: '#1a242f',\n colorBorder: '#1a242f',\n colorBgLayout: '#1a242f',\n borderRadius: 0,\n green: '#48734d',\n red: '#b03a38',\n blue: '#0d6efd',\n yellow: '#ffc107',\n orange: '#fd7e14',\n colorWhite: '#fff',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n","import { InfoCircleOutlined } from '@ant-design/icons';\nimport { DecafApp, DecafAppConfig, DecafAppController, DecafWebappController } from '@decafhub/decaf-react';\nimport { css, Global } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { ConfigProvider } from 'antd';\nimport 'antd/dist/reset.css';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport PageAbout from './components/PageAbout';\nimport React from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport { getStyles } from './style';\nimport Page404 from './components/Page404';\nimport DecafLayout, { DecafMenuItem } from './Layout';\nimport { decafTheme } from './theme';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n theme?: ThemeConfig;\n /**\n * App routes.<br />\n * About page and 404 page will be added automatically.<br />\n * See https://reactrouter.com/en/main/routers/create-browser-router#routes\n */\n routes: DecafRoute[];\n /**\n * App menu.<br />\n * About page will be added automatically.\n */\n menuItems: DecafMenuItem[];\n appName: string;\n appDescription?: string;\n appIcon?: React.ReactNode;\n /**\n * The extra content to show on the about page.\n */\n aboutPageContent?: React.ReactNode;\n}\n\nfunction buildRoutes(props: DecafWebappProps, routes: DecafRoute[]): RouteObject[] {\n const result: RouteObject[] = [];\n\n routes.forEach((route) => {\n const item: RouteObject = { ...route };\n if (route.children) {\n item.element = route.element ?? <Outlet />;\n item.children = buildRoutes(props, route.children);\n } else {\n item.element = (\n <DecafLayout menu={props.menuItems} appName={props.appName} appIcon={props.appIcon}>\n {route.element}\n </DecafLayout>\n );\n }\n result.push(item);\n });\n\n return result;\n}\n\nfunction addTo<T>(array: T[], items: T[], key: keyof T): T[] {\n const result: T[] = [...array];\n items.forEach((item) => {\n const index = result.findIndex((r) => r[key] === item[key]);\n if (index >= 0) {\n result[index] = item;\n } else {\n result.push(item);\n }\n });\n return result;\n}\n\nfunction DecafWebapp(props: DecafWebappProps) {\n let routes = addTo<RouteObject>(\n props.routes,\n [\n {\n path: '/about',\n element: (\n <PageAbout\n appName={props.appName}\n appVersion={props.config?.currentVersion}\n appDescription={props.appDescription}\n content={props.aboutPageContent}\n />\n ),\n },\n { path: '*', element: <Page404 /> },\n ],\n 'path'\n );\n const menuWithAboutPage = addTo(\n props.menuItems,\n [\n {\n label: 'About',\n to: '/about',\n icon: <InfoCircleOutlined />,\n },\n ],\n 'to' as any\n );\n routes = buildRoutes({ ...props, menuItems: menuWithAboutPage }, routes);\n\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const theme = props.theme ?? decafTheme;\n\n const controller = props.controller || DecafWebappController;\n controller.disableZendeskWidget = true;\n\n const globalStyles = getStyles(theme);\n\n return (\n <ConfigProvider theme={theme}>\n <Global styles={globalStyles} />\n <DecafApp config={props.config} controller={controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ConfigProvider>\n );\n}\n\nexport { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme };\n","import { Interpolation, Theme } from '@emotion/react';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nexport function getStyles(theme: ThemeConfig): Interpolation<Theme> {\n return {\n '@font-face': {\n fontFamily: 'Lato, sans-serif',\n src: 'url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)',\n },\n body: {\n background: theme.token?.colorBgBase,\n fontFamily: theme.token?.fontFamily,\n margin: 0,\n },\n // antd overrides\n button: {\n boxShadow: 'none !important',\n },\n '.ant-page-header-back-button, .ant-page-header-heading-title': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-badge-count': {\n color: `${theme.token?.colorWhite} !important`,\n },\n // end antd overrides\n '#decaf-header': {\n position: 'fixed',\n zIndex: 1030,\n right: 0,\n left: 0,\n paddingInline: 0,\n },\n '#decaf-content': {\n paddingInline: 20,\n paddingTop: '5rem',\n paddingBottom: '5rem',\n },\n '#decaf-footer': {\n position: 'fixed',\n bottom: 0,\n right: 0,\n left: 0,\n background: theme.token?.colorBgContainer,\n paddingBlock: 0,\n paddingInline: 0,\n },\n '.dot': {\n borderRadius: '50%',\n width: 10,\n height: 10,\n display: 'inline-block',\n '&.green': {\n backgroundColor: `#80ff00 !important`,\n },\n '&.yellow': {\n backgroundColor: `#ff0 !important`,\n },\n '&.orange': {\n backgroundColor: `#ff7000 !important`,\n },\n '&.red': {\n backgroundColor: `#ff0000 !important`,\n },\n },\n };\n}\n"],"names":["PageAbout","props","client","useDecaf","_useState","useState","undefined","versionBarista","setVersionBarista","useEffect","barista","get","then","data","version","React","createElement","Space","direction","size","style","width","Descriptions","title","column","bordered","Item","label","appName","appDescription","appVersion","content","Page404","Result","status","subTitle","PageScroller","Button","type","onClick","window","scrollTo","top","behavior","icon","UpOutlined","document","body","scrollHeight","DownOutlined","getCurrentAppPath","url","parts","split","indexOfWebapps","indexOf","slice","join","VersionSelector","location","href","getAppVersionFromUrl","versions","code","name","color","show","process","env","NODE_ENV","currentVersion","find","v","Dropdown","placement","arrow","menu","items","map","key","className","display","alignItems","marginRight","CaretUpOutlined","ScreenShotter","handleScreenshot","getElementById","footer","setProperty","Promise","resolve","html2canvas","canvas","dataUrl","toDataURL","link","download","click","remove","e","reject","triggerNode","cloneElement","CameraOutlined","ZendeskWidget","me","_useDecaf","publicConfig","open","setOpen","zendesk","script","src","ZENDESK_WIDGET_SCRIPT","async","id","onload","zE","appendChild","zESettings","webWidget","offset","horizontal","vertical","contactForm","subject","fields","prefill","fullname","email","removeChild","QuestionCircleOutlined","routesToAntMenu","routes","forEach","route","item","to","NavLink","end","children","result","push","DecafLayout","menuItems","matchedMenuItems","useMatches","match","pathname","token","theme","useToken","Layout","height","Header","paddingInline","justifyContent","Link","gap","appIcon","Typography","Title","level","margin","Menu","backgroundColor","border","flex","mode","selectedKeys","Content","Footer","Row","justify","align","Col","span","Text","target","rel","colorText","UserOutlined","username","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","INPUT_BG_COLOR","decafTheme","hashed","components","colorBgHeader","boxShadow","boxShadowSecondary","colorBgContainer","Input","Select","colorBgElevated","controlItemBgActive","DatePicker","InputNumber","Checkbox","fontFamily","colorPrimary","colorBgBase","colorBgLayout","borderRadius","green","red","blue","yellow","orange","colorWhite","algorithm","darkAlgorithm","buildRoutes","_route$element","element","Outlet","addTo","array","index","findIndex","r","_props$config","_props$config2","_props$theme","path","config","aboutPageContent","_extends","InfoCircleOutlined","router","createBrowserRouter","basename","basePath","controller","DecafWebappController","disableZendeskWidget","globalStyles","_theme$token","_theme$token2","_theme$token3","_theme$token4","_theme$token5","background","button","position","zIndex","right","left","paddingTop","paddingBottom","bottom","paddingBlock","getStyles","ConfigProvider","Global","styles","DecafApp","RouterProvider"],"mappings":"yjCAUwBA,SAAAA,EAAUC,GAChC,IAAQC,EAAWC,EAAAA,WAAXD,OACRE,EAA4CC,EAAQA,cAAqBC,GAAlEC,OAAgBC,EAAiBJ,EAAA,GAMxC,OAJAK,EAAAA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+F,WAAY,OACZC,cAAe,QAEjB,gBAAiB,CACfL,SAAU,QACVM,OAAQ,EACRJ,MAAO,EACPC,KAAM,EACNL,WAAY,SAAA9F,EAAMD,YAAN,EAAA8F,EAAalD,iBACzB4D,aAAc,EACdlG,cAAe,GAEjB,OAAQ,CACNkD,aAAc,MACdzL,MAAO,GACPqI,OAAQ,GACRzE,QAAS,eACT,UAAW,CACTqF,gBACD,sBACD,WAAY,CACVA,gBAAe,mBAEjB,WAAY,CACVA,gBAAe,sBAEjB,QAAS,CACPA,gBAAe,uBAIvB,CDmDuByF,CAAUxG,GAE/B,OACExI,EAAC,QAAAC,cAAAgP,EAAcA,eAAC,CAAAzG,MAAOA,GACrBxI,UAAAC,cAACiP,EAAAA,OAAM,CAACC,OAAQnB,IAChBhO,EAAC,QAAAC,cAAAmP,EAAAA,SAAS,CAAA/B,OAAQnO,EAAMmO,OAAQQ,WAAYA,GAC1C7N,EAAAA,QAACC,cAAAoP,EAAAA,gBAAe5B,OAAQA,KAIhC"}
1
+ {"version":3,"file":"index.umd.js","sources":["../src/components/Page404.tsx","../src/components/PageAbout.tsx","../src/components/PageScroller.tsx","../src/components/VersionSelector.tsx","../src/components/Screenshotter.tsx","../src/components/ZendeskWidget.tsx","../src/Layout.tsx","../src/theme.ts","../src/index.tsx","../src/style.ts"],"sourcesContent":["import { Result } from 'antd';\nimport React from 'react';\n\nexport default function Page404() {\n return <Result status=\"404\" title={'404'} subTitle={'Sorry, the page you visited does not exist.'} />;\n}\n","import { useDecaf } from '@decafhub/decaf-react';\nimport { Descriptions, Space } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nexport interface AboutPageProps {\n appName?: string;\n appVersion?: string;\n appDescription?: string;\n content?: React.ReactNode;\n}\nexport default function PageAbout(props: AboutPageProps) {\n const { client } = useDecaf();\n const [versionBarista, setVersionBarista] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n client.barista.get<{ version: string }>('/version/').then(({ data }) => setVersionBarista(data.version));\n }, [client]);\n\n return (\n <Space direction=\"vertical\" size=\"middle\" style={{ width: '100%' }}>\n <Descriptions title=\"About\" column={1} bordered>\n <Descriptions.Item label=\"Web Application Name\">{props.appName}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Description\">{props.appDescription}</Descriptions.Item>\n <Descriptions.Item label=\"Web Application Version\">{`v${props.appVersion}`}</Descriptions.Item>\n <Descriptions.Item label=\"DECAF Barista Version\">{`v${versionBarista}`}</Descriptions.Item>\n </Descriptions>\n {props.content}\n </Space>\n );\n}\n","import { DownOutlined, UpOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\nexport default function PageScroller() {\n return (\n <div>\n <Button\n title=\"Scroll to top\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}\n icon={<UpOutlined />}\n />\n <Button\n title=\"Scroll to bottom\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })}\n icon={<DownOutlined />}\n />\n </div>\n );\n}\n","import { CaretUpOutlined } from '@ant-design/icons';\nimport { Button, Dropdown } from 'antd';\nimport React from 'react';\n\nexport type Version = {\n code: string;\n name: string;\n color: string;\n url: string;\n show: boolean;\n};\n\nfunction getAppNameFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 1];\n }\n}\n\nfunction getAppVersionFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 2];\n }\n}\n\nfunction getCurrentAppPath(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts.slice(indexOfWebapps + 3).join('/');\n }\n}\n\nexport default function VersionSelector() {\n const appName = getAppNameFromUrl(window.location.href);\n const appVersion = getAppVersionFromUrl(window.location.href);\n\n const versions: Version[] = [\n {\n code: 'development',\n name: 'Development Version',\n color: 'red',\n url: `/webapps/${appName}/development/${getCurrentAppPath(window.location.href)}`,\n show: process.env.NODE_ENV === 'development',\n },\n {\n code: 'testing',\n name: 'Testing Version',\n color: 'orange',\n url: `/webapps/${appName}/testing/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'staging',\n name: 'Staging Version',\n color: 'yellow',\n url: `/webapps/${appName}/staging/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'production',\n name: 'Production Version',\n color: 'green',\n url: `/webapps/${appName}/production/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n ];\n const currentVersion = versions.find((v) => v.code === appVersion);\n\n if (!currentVersion) {\n return null;\n }\n\n return (\n <Dropdown\n placement=\"top\"\n arrow\n menu={{\n items: versions.map((version) => ({\n key: version.name,\n label: (\n <span>\n <i className={`dot ${version.color}`} /> {version.name}\n </span>\n ),\n onClick: () => {\n window.location.href = version.url;\n },\n })),\n }}\n >\n <Button type=\"text\" size=\"small\">\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <i className={`dot ${currentVersion?.color}`} style={{ marginRight: 5 }} />\n <CaretUpOutlined />\n </div>\n </Button>\n </Dropdown>\n );\n}\n","import { CameraOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport html2canvas from 'html2canvas';\nimport React from 'react';\n\nexport interface ScreenShotterProps {\n triggerNode?: React.ReactNode;\n}\nexport default function ScreenShotter(props: ScreenShotterProps) {\n async function handleScreenshot() {\n // hide footer before taking screenshot\n const footer = document.getElementById('decaf-footer');\n footer?.style.setProperty('display', 'none');\n\n const canvas = await html2canvas(document.body);\n const dataUrl = canvas.toDataURL('image/png');\n\n // show footer after taking screenshot\n footer?.style.setProperty('display', 'block');\n\n const link = document.createElement('a');\n link.download = 'screenshot.png';\n link.href = dataUrl;\n link.click();\n link.remove();\n }\n\n if (props.triggerNode) {\n return React.cloneElement(props.triggerNode as React.ReactElement, {\n onClick: handleScreenshot,\n });\n } else {\n return (\n <Button\n title=\"Take a screenshot of the current page\"\n type=\"text\"\n size=\"small\"\n icon={<CameraOutlined />}\n onClick={handleScreenshot}\n />\n );\n }\n}\n","import { QuestionCircleOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nconst ZENDESK_WIDGET_SCRIPT = 'https://static.zdassets.com/ekr/snippet.js';\n\ndeclare global {\n // eslint-disable-next-line no-unused-vars\n interface Window {\n zE: any;\n zESettings: any;\n }\n}\n\nexport default function ZendeskWidget() {\n const { me, publicConfig } = useDecaf();\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (!publicConfig.zendesk || typeof document === 'undefined') return;\n const script = document.createElement('script');\n script.src = ZENDESK_WIDGET_SCRIPT + '?key=' + publicConfig.zendesk;\n script.async = true;\n script.id = 'ze-snippet'; // do not change this. zendesk expects this to be ze-snippet\n script.onload = () => {\n window.zE('webWidget', 'hide');\n window.zE('webWidget:on', 'open', () => {\n window.zE('webWidget', 'show');\n setOpen(true);\n });\n window.zE('webWidget:on', 'close', () => {\n window.zE('webWidget', 'hide');\n setOpen(false);\n });\n };\n\n document.body.appendChild(script);\n window.zESettings = {\n webWidget: {\n offset: {\n horizontal: -7,\n vertical: 20,\n },\n },\n contactForm: {\n subject: true,\n fields: [\n {\n id: 'name',\n prefill: { '*': me.fullname },\n },\n {\n id: 'email',\n prefill: { '*': me.email },\n },\n ],\n },\n };\n\n return () => {\n document.body.removeChild(script);\n };\n }, [publicConfig, me]);\n\n function toggle() {\n if (open) {\n window.zE?.('webWidget', 'close');\n } else {\n window.zE?.('webWidget', 'open');\n }\n setOpen(!open);\n }\n\n if (!publicConfig.zendesk) return null;\n\n return (\n <Button size=\"small\" icon={<QuestionCircleOutlined />} onClick={toggle}>\n Support\n </Button>\n );\n}\n","import { UserOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button, Col, Layout, Menu, Row, theme, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport PageScroller from './components/PageScroller';\nimport VersionSelector from './components/VersionSelector';\nimport React from 'react';\nimport { Link, NavLink, useMatches } from 'react-router-dom';\nimport ScreenShotter from './components/Screenshotter';\nimport ZendeskWidget from './components/ZendeskWidget';\n\ninterface BaseDecafMenuItem {\n label: any;\n icon?: React.ReactNode;\n children?: DecafMenuItem[];\n}\n\nexport type DecafMenuItem = BaseDecafMenuItem & ({ to?: string } | { href?: string });\n\nexport interface DecafLayoutProps {\n menu: DecafMenuItem[];\n appName: string;\n appIcon?: React.ReactNode;\n children: React.ReactNode;\n}\n\nexport function routesToAntMenu(routes: DecafMenuItem[]): ItemType[] {\n const result: ItemType[] = [];\n routes.forEach((route) => {\n const item: ItemType = {\n key: 'to' in route ? route.to : route.label,\n label: route.label,\n icon: route.icon,\n };\n if ('to' in route && route.to) {\n item.label = (\n <NavLink to={route.to} end={route.to === '/'}>\n {route.label}\n </NavLink>\n );\n } else if ('href' in route && route.href) {\n item.label = <a href={route.href}>{route.label}</a>;\n } else if (route.children) {\n item.label = route.label;\n (item as SubMenuType).children = routesToAntMenu(route.children || []);\n }\n result.push(item);\n });\n\n return result;\n}\n\nexport default function DecafLayout(props: DecafLayoutProps) {\n const menuItems = routesToAntMenu(props.menu);\n const matches = useMatches();\n const matchedMenuItems = matches.map((match) => match.pathname);\n const { me } = useDecaf();\n const { token } = theme.useToken();\n\n return (\n <Layout style={{ height: '100%' }}>\n <Layout.Header id=\"decaf-header\">\n <div style={{ paddingInline: 20, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>\n <Link to=\"/\" style={{ display: 'flex', alignItems: 'center', gap: 10 }}>\n {props.appIcon}\n <Typography.Title level={4} style={{ margin: 0 }}>\n {props.appName}\n </Typography.Title>\n </Link>\n <Menu\n style={{ justifyContent: 'flex-end', backgroundColor: 'transparent', border: 'none', flex: 1 }}\n mode=\"horizontal\"\n items={menuItems}\n selectedKeys={matchedMenuItems}\n />\n </div>\n </Layout.Header>\n <Layout.Content id=\"decaf-content\">{props.children}</Layout.Content>\n <Layout.Footer id=\"decaf-footer\">\n <Row justify=\"space-between\" align={'middle'}>\n <Col span={10}>\n <ZendeskWidget />\n </Col>\n <Col span={4}>\n <Typography.Text type=\"secondary\">\n Powered by{' '}\n <b>\n <a href=\"https://teloscube.com\" target=\"_blank\" rel=\"noreferrer\" style={{ color: token.colorText }}>\n Teloscube\n </a>\n </b>\n </Typography.Text>\n </Col>\n <Col span={10} style={{ justifyContent: 'flex-end', display: 'flex' }}>\n <Button size=\"small\" icon={<UserOutlined />}>\n {me.username}\n </Button>\n <VersionSelector />\n <ScreenShotter />\n <PageScroller />\n </Col>\n </Row>\n </Layout.Footer>\n </Layout>\n );\n}\n","import { theme } from 'antd';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nconst BORDER_COLORS_TRANSPARENT = {\n colorBorder: '#10161d',\n colorBorderSecondary: '#10161d',\n};\n\nconst INPUT_BG_COLOR = '#2c3d50';\n\nexport const decafTheme: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: '#10161d',\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n colorBgContainer: INPUT_BG_COLOR,\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgElevated: INPUT_BG_COLOR,\n controlItemBgActive: INPUT_BG_COLOR,\n },\n DatePicker: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n colorBgElevated: INPUT_BG_COLOR,\n },\n InputNumber: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Checkbox: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n },\n token: {\n fontFamily: 'Lato, sans-serif',\n colorPrimary: '#344961',\n colorBgBase: '#1a242f',\n colorBgContainer: '#10161d',\n colorBgElevated: '#1a242f',\n colorBorderSecondary: '#1a242f',\n colorBorder: '#1a242f',\n colorBgLayout: '#1a242f',\n borderRadius: 0,\n green: '#48734d',\n red: '#b03a38',\n blue: '#0d6efd',\n yellow: '#ffc107',\n orange: '#fd7e14',\n colorWhite: '#fff',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n","import { InfoCircleOutlined } from '@ant-design/icons';\nimport { DecafApp, DecafAppConfig, DecafAppController, DecafWebappController } from '@decafhub/decaf-react';\nimport { css, Global } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport { ConfigProvider } from 'antd';\nimport 'antd/dist/reset.css';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport React, { useEffect } from 'react';\nimport { createBrowserRouter, Outlet, RouteObject, RouterProvider } from 'react-router-dom';\nimport Page404 from './components/Page404';\nimport PageAbout from './components/PageAbout';\nimport DecafLayout, { DecafMenuItem } from './Layout';\nimport { getStyles } from './style';\nimport { decafTheme } from './theme';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n theme?: ThemeConfig;\n /**\n * App routes.<br />\n * About page and 404 page will be added automatically.<br />\n * See https://reactrouter.com/en/main/routers/create-browser-router#routes\n */\n routes: DecafRoute[];\n /**\n * App menu.<br />\n * About page will be added automatically.\n */\n menuItems: DecafMenuItem[];\n appName: string;\n appDescription?: string;\n appIcon?: React.ReactNode;\n /**\n * The extra content to show on the about page.\n */\n aboutPageContent?: React.ReactNode;\n}\n\nfunction buildRoutes(props: DecafWebappProps, routes: DecafRoute[]): RouteObject[] {\n const result: RouteObject[] = [];\n\n routes.forEach((route) => {\n const item: RouteObject = { ...route };\n if (route.children) {\n item.element = route.element ?? <Outlet />;\n item.children = buildRoutes(props, route.children);\n } else {\n item.element = (\n <DecafLayout menu={props.menuItems} appName={props.appName} appIcon={props.appIcon}>\n {route.element}\n </DecafLayout>\n );\n }\n result.push(item);\n });\n\n return result;\n}\n\nfunction addTo<T>(array: T[], items: T[], key: keyof T): T[] {\n const result: T[] = [...array];\n items.forEach((item) => {\n const index = result.findIndex((r) => r[key] === item[key]);\n if (index >= 0) {\n result[index] = item;\n } else {\n result.push(item);\n }\n });\n return result;\n}\n\nfunction DecafWebapp(props: DecafWebappProps) {\n useEffect(() => {\n // add plausible analytics\n const script = document.createElement('script');\n script.defer = true;\n script.setAttribute('data-domain', location.hostname);\n script.src = 'https://webax.svc.sys.decafhub.com/js/plausible.js';\n document.body.appendChild(script);\n\n return () => {\n document.body.removeChild(script);\n };\n }, []);\n\n let routes = addTo<RouteObject>(\n props.routes,\n [\n {\n path: '/about',\n element: (\n <PageAbout\n appName={props.appName}\n appVersion={props.config?.currentVersion}\n appDescription={props.appDescription}\n content={props.aboutPageContent}\n />\n ),\n },\n { path: '*', element: <Page404 /> },\n ],\n 'path'\n );\n const menuWithAboutPage = addTo(\n props.menuItems,\n [\n {\n label: 'About',\n to: '/about',\n icon: <InfoCircleOutlined />,\n },\n ],\n 'to' as any\n );\n routes = buildRoutes({ ...props, menuItems: menuWithAboutPage }, routes);\n\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const theme = props.theme ?? decafTheme;\n\n const controller = props.controller || DecafWebappController;\n controller.disableZendeskWidget = true;\n\n const globalStyles = getStyles(theme);\n\n return (\n <ConfigProvider theme={theme}>\n <Global styles={globalStyles} />\n <DecafApp config={props.config} controller={controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ConfigProvider>\n );\n}\n\nexport { DecafWebapp, Global as GlobalStyle, css, styled, decafTheme };\n","import { Interpolation, Theme } from '@emotion/react';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\n\nexport function getStyles(theme: ThemeConfig): Interpolation<Theme> {\n return {\n '@font-face': {\n fontFamily: 'Lato, sans-serif',\n src: 'url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap)',\n },\n body: {\n background: theme.token?.colorBgBase,\n fontFamily: theme.token?.fontFamily,\n margin: 0,\n },\n // antd overrides\n button: {\n boxShadow: 'none !important',\n },\n '.ant-page-header-back-button, .ant-page-header-heading-title': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-badge-count': {\n color: `${theme.token?.colorWhite} !important`,\n },\n // end antd overrides\n '#decaf-header': {\n position: 'fixed',\n zIndex: 1030,\n right: 0,\n left: 0,\n paddingInline: 0,\n },\n '#decaf-content': {\n paddingInline: 20,\n paddingTop: '5rem',\n paddingBottom: '5rem',\n },\n '#decaf-footer': {\n position: 'fixed',\n bottom: 0,\n right: 0,\n left: 0,\n background: theme.token?.colorBgContainer,\n paddingBlock: 0,\n paddingInline: 0,\n },\n '.dot': {\n borderRadius: '50%',\n width: 10,\n height: 10,\n display: 'inline-block',\n '&.green': {\n backgroundColor: `#80ff00 !important`,\n },\n '&.yellow': {\n backgroundColor: `#ff0 !important`,\n },\n '&.orange': {\n backgroundColor: `#ff7000 !important`,\n },\n '&.red': {\n backgroundColor: `#ff0000 !important`,\n },\n },\n };\n}\n"],"names":["Page404","React","createElement","Result","status","title","subTitle","PageAbout","props","client","useDecaf","_useState","useState","undefined","versionBarista","setVersionBarista","useEffect","barista","get","then","data","version","Space","direction","size","style","width","Descriptions","column","bordered","Item","label","appName","appDescription","appVersion","content","PageScroller","Button","type","onClick","window","scrollTo","top","behavior","icon","UpOutlined","document","body","scrollHeight","DownOutlined","getCurrentAppPath","url","parts","split","indexOfWebapps","indexOf","slice","join","VersionSelector","location","href","getAppVersionFromUrl","versions","code","name","color","show","process","env","NODE_ENV","currentVersion","find","v","Dropdown","placement","arrow","menu","items","map","key","className","display","alignItems","marginRight","CaretUpOutlined","ScreenShotter","handleScreenshot","getElementById","footer","setProperty","Promise","resolve","html2canvas","canvas","dataUrl","toDataURL","link","download","click","remove","e","reject","triggerNode","cloneElement","CameraOutlined","ZendeskWidget","me","_useDecaf","publicConfig","open","setOpen","zendesk","script","src","ZENDESK_WIDGET_SCRIPT","async","id","onload","zE","appendChild","zESettings","webWidget","offset","horizontal","vertical","contactForm","subject","fields","prefill","fullname","email","removeChild","QuestionCircleOutlined","routesToAntMenu","routes","forEach","route","item","to","NavLink","end","children","result","push","DecafLayout","menuItems","matchedMenuItems","useMatches","match","pathname","token","theme","useToken","Layout","height","Header","paddingInline","justifyContent","Link","gap","appIcon","Typography","Title","level","margin","Menu","backgroundColor","border","flex","mode","selectedKeys","Content","Footer","Row","justify","align","Col","span","Text","target","rel","colorText","UserOutlined","username","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","INPUT_BG_COLOR","decafTheme","hashed","components","colorBgHeader","boxShadow","boxShadowSecondary","colorBgContainer","Input","Select","colorBgElevated","controlItemBgActive","DatePicker","InputNumber","Checkbox","fontFamily","colorPrimary","colorBgBase","colorBgLayout","borderRadius","green","red","blue","yellow","orange","colorWhite","algorithm","darkAlgorithm","buildRoutes","_route$element","_extends","element","Outlet","addTo","array","concat","index","findIndex","r","defer","setAttribute","hostname","path","_props$config","config","aboutPageContent","InfoCircleOutlined","router","createBrowserRouter","basename","_props$config2","basePath","_props$theme","controller","DecafWebappController","disableZendeskWidget","globalStyles","_theme$token","_theme$token2","_theme$token3","_theme$token4","_theme$token5","background","button","position","zIndex","right","left","paddingTop","paddingBottom","bottom","paddingBlock","getStyles","ConfigProvider","Global","styles","DecafApp","RouterProvider"],"mappings":"yjCAGwBA,SAAAA,IACtB,OAAQC,UAAAC,cAAAC,EAAAA,OAAO,CAAAC,OAAO,MAAMC,MAAO,MAAOC,SAAU,+CACtD,CCKwBC,SAAAA,EAAUC,GAChC,IAAQC,EAAWC,EAAAA,WAAXD,OACRE,EAA4CC,EAAQA,cAAqBC,GAAlEC,OAAgBC,EAAiBJ,EAAA,GA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J,cAAUsF,EAAAA,EAAMD,cAANiG,EAAanC,2BAGzB,gBAAiB,CACfuC,SAAU,QACVC,OAAQ,KACRC,MAAO,EACPC,KAAM,EACNlG,cAAe,GAEjB,iBAAkB,CAChBA,cAAe,GACfmG,WAAY,OACZC,cAAe,QAEjB,gBAAiB,CACfL,SAAU,QACVM,OAAQ,EACRJ,MAAO,EACPC,KAAM,EACNL,WAAY,SAAAlG,EAAMD,YAAN,EAAAkG,EAAatD,iBACzBgE,aAAc,EACdtG,cAAe,GAEjB,OAAQ,CACNkD,aAAc,MACdpL,MAAO,GACPgI,OAAQ,GACRzE,QAAS,eACT,UAAW,CACTqF,gBACD,sBACD,WAAY,CACVA,gBAAe,mBAEjB,WAAY,CACVA,gBAAe,sBAEjB,QAAS,CACPA,gBAAe,uBAIvB,CDgEuB6F,CAAU5G,GAE/B,OACEtJ,EAAAA,QAACC,cAAAkQ,EAAcA,eAAC,CAAA7G,MAAOA,GACrBtJ,EAAA,QAAAC,cAACmQ,EAAMA,OAAA,CAACC,OAAQnB,IAChBlP,EAAC,QAAAC,cAAAqQ,EAAQA,SAAC,CAAAhC,OAAQ/N,EAAM+N,OAAQS,WAAYA,GAC1C/O,EAAAA,QAACC,cAAAsQ,EAAcA,gBAAC9B,OAAQA,KAIhC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decafhub/decaf-react-webapp",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "keywords": [
5
5
  "decafhub",
6
6
  "react"