Skip to content

Commit

Permalink
page-d09adb5b1e499a60.js.download
Browse files Browse the repository at this point in the history
Stock control supervisors

Signed-off-by: Romeo Rosete <110788242+bombastictranz@users.noreply.github.com>
  • Loading branch information
bombastictranz authored Apr 5, 2024
1 parent 09fdf7f commit 97f30fb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions page-d09adb5b1e499a60.js.download
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1169],{15675:function(e,a,t){Promise.resolve().then(t.bind(t,65055))},83738:function(e,a,t){"use strict";t.d(a,{T:function(){return Notifications}});var n=t(93973),s=t(844),r=t(46056),i=t(83251),Notification_useTimer=function(e,a){let t=r.useRef(a),n=r.useRef(a),s=r.useRef();function onClear(){s.current&&clearTimeout(s.current)}function onPause(){onClear(),n.current-=Date.now()-t.current}function onResume(){onClear(),t.current=Date.now(),s.current=setTimeout(e,n.current)}return r.useEffect(()=>(onResume(),()=>{onPause()}),[e]),{onClear,onPause,onResume}},o=t(18015),l=t.n(o);function Notification(e){let{notification:a,onDismiss:t,timeout:s}=e;function handleDismiss(){a.onDismiss&&a.onDismiss(a),t(a.id)}let{onPause:r,onResume:o}=Notification_useTimer(handleDismiss,s);return(0,n.jsx)("div",{className:l().root,onMouseEnter:r,onMouseLeave:o,children:(0,n.jsx)(i.b,{onDismiss:handleDismiss,type:a.type,children:a.message})})}var c=t(42923),u=t.n(c),d=t(29591);function Notifications(e){let[a,t]=(0,s.KO)(d.G),i=(0,r.useCallback)(e=>{t(a=>a.filter(a=>a.id!==e))},[t]),o=e.timeout||5e3;return a.length?(0,n.jsx)("section",{className:u().root,"data-test":"notifications",children:a.map((e,a)=>(0,n.jsx)(Notification,{index:a,notification:e,onDismiss:i,timeout:o},e.id))}):null}},21092:function(e,a,t){"use strict";function useNewLogoNames(){return{canvasLogoName:"navCanvasV2",tablesLogoName:"navTables",interfacesLogoName:"navInterfacesV2"}}t.d(a,{H:function(){return useNewLogoNames}})},96685:function(e,a,t){"use strict";t.d(a,{Y:function(){return useDate}});var n=t(46056);let s=n.createContext({}),useDate=()=>n.useContext(s)},41004:function(e,a,t){"use strict";var n=t(93973),s=t(96685),r=t(80366),i=t(81021);function DateTime(e){let{date:a,format:t}=e,{timezone:o}=(0,s.Y)(),l=(e.ignoreProfileTimezone?null:o)||(0,r.Z)()||"UTC",c=(0,i.Z)(a,t||"default",l),u=(0,i.Z)(a,"iso",l);return(0,n.jsx)("time",{dateTime:u,title:c,children:c})}a.Z=DateTime},81021:function(e,a,t){"use strict";t.d(a,{Z:function(){return r}});var n=t(98625),utils_ensureDate=e=>("number"==typeof e&&e<1e10&&(e*=1e3),new Date(e));let s={default:"MMMM DD, YYYY",short:"MMM DD, YYYY",exhaustive:"YYYY-MM-DD HH:mm:ss",iso:"YYYY-MM-DD:mm:ssZ"},formatDateTime=(e,a,t)=>{let r=utils_ensureDate(e);if("iso"===a)return r.toISOString();try{return(0,n.default)(r,s[a]||a,t?{timezone:t}:void 0)}catch(n){try{return r.toLocaleDateString("en-US",t?{timeZone:t}:void 0)}catch(t){return formatDateTime(e,a)}}};var r=formatDateTime},80366:function(e,a){"use strict";a.Z=()=>{try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return null}}},65055:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return PageWrapper}});var n,s,r=t(93973),i=t(92625),o=t(77628),l=t(50655),c=t(57627),u=t(57208),d=t(46056),p=t(24040),m=t(41004),_=t(30087),h=t(24531);t(59357);var f=t(82644),v=t(33016),x=t(67334),g=t(43609),j=t.n(g),N=t(33292),C=t.n(N),y=t(21092);let w="Create your first Canvas";function NoCanvasSurface(){let{emitEventOnNewCanvasCreation:e}=(0,x.ar)(),{canvasLogoName:a}=(0,y.H)();return(0,r.jsx)("div",{className:C().wrapper,children:(0,r.jsx)("span",{className:C().surfaceWrapper,children:(0,r.jsx)(f.T,{backgroundColor:"neutral200",children:(0,r.jsxs)("div",{className:C().colWrapper,children:[(0,r.jsx)("div",{className:C().col,children:(0,r.jsx)(j(),{loader:e=>{let{src:a}=e;return a},src:"https://res.cloudinary.com/zapier-media/image/upload/v1705939171/canvas_example_o6ndtj.png",width:515,height:308,alt:"Canvas example"})}),(0,r.jsx)("div",{className:C().col,children:(0,r.jsxs)("div",{className:C().surfaceContent,children:[(0,r.jsxs)("span",{className:C().logoWrapper,children:[(0,r.jsx)(v.J,{name:a,size:24,color:"brand"}),(0,r.jsx)(o.x,{type:"pageHeader7",children:"Canvas"}),(0,r.jsx)("div",{className:C().betaTag,children:(0,r.jsx)(o.x,{type:"smallPrint1Bold",children:"Beta"})})]}),(0,r.jsxs)("span",{className:C().textWrapper,children:[(0,r.jsx)(o.x,{type:"pageHeader9",children:"Plan and collaborate at every step"}),(0,r.jsx)(o.x,{type:"paragraph3",children:"Visualize mission-critical business processes that show how your apps, team, and customers work together."}),(0,r.jsx)("span",{className:C().buttonWrapper,children:(0,r.jsx)(l.z,{href:"/app/canvas/new",onClick:()=>e(w),isFullWidth:!0,iconBefore:"formAdd",children:w})})]})]})})]})})})})}var b=t(29591),D=t(83738),k=t(37724),M=t(93860),T=t(45724),W=t(93581),Y=t(62298),S=t(60647),E=t(54593),H=t.n(E);(n=s||(s={}))[n.deleteCanvas=0]="deleteCanvas";let getDropdownItems=()=>[{label:"Delete",value:0}];var ActionMenu_ActionMenu=function(e){let{deleteCanvas:a}=e,[t,n]=(0,d.useState)(!1),s=(0,d.useMemo)(()=>getDropdownItems(),[]),i=(0,d.useCallback)(()=>{n(e=>!e)},[]),o=(0,d.useCallback)(()=>{n(!1)},[]),l=(0,d.useCallback)(e=>()=>{0===e&&a(),i()},[a,i]);return 0===s.length?null:(0,r.jsx)("div",{className:H().root,children:(0,r.jsxs)(d.Fragment,{children:[(0,r.jsx)(T.h,{ariaLabel:"Edit Canvas",icon:"navMoreHoriz",size:"xsmall",color:"icon-secondary",onClick:i}),t&&(0,r.jsx)(W.f,{align:"right",onClickOutside:o,children:(0,r.jsx)("div",{className:H().menu,children:(0,r.jsx)(Y.v,{ariaLabel:"Member Action Options",children:s.map(e=>(0,r.jsx)(S.s,{onClick:l(e.value),children:e.label},e.value))})})})]})})},P=t(82144),z=t(844);function useWootric(e){let{canvasCount:a}=e,t=(0,z.Dv)(P.yW),n=(0,_.X8)(),s=(0,z.Dv)(P.xr);(0,d.useEffect)(()=>{if(t?.email&&t?.signup&&!t?.is_staff&&"number"==typeof a&&a>0&&"number"==typeof n&&s?.id){let e=document.createElement("script");e.type="text/javascript",e.id="wootric-settings",e.async=!0,e.innerHTML=`
window.wootricSettings = {
email: '${t?.email}',
// This needs to be an integer value representing a datetime, and it needs the
// _date suffix. It's not a typo.
created_at: ${new Date(t?.signup).getTime()/1e3},
account_token: 'NPS-edfb676e',
properties: {
email: '${t?.email}',
// It's possible timezone is null. It's not required to set
timezone: '${t?.timezone}',
plan_tier: "${s.plan_info.name}",
customuser_id: "${t?.id}",
account_id: "${n}",
// You need to add the _amount suffix to raw numbers because wootric is picky
canvas_amount: ${a},
created_at_date: ${new Date(t?.signup).getTime()/1e3},
}
};
`,null==document.getElementById("wootric-settings")&&document.body.appendChild(e);let r=document.createElement("script");r.type="text/javascript",r.id="wootric-beacon",r.async=!0,r.src="https://cdn.wootric.com/wootric-sdk.js",r.onload=function(){window.wootric("run")},null==document.getElementById("wootric-beacon")&&document.body.appendChild(r)}},[t,a,n,s])}async function deleteCanvas(e){try{let a=await fetch(`/api/canvas/v1/canvases/${e}/`,{method:"DELETE",headers:{"trailing-slash-hack":"true"}});if(!a.ok){let e=Error(a.statusText);throw e.status=a.status,e}return{status:a.status,statusText:a.statusText}}catch(a){let e={message:a.message||"An error occurred"};return a.status&&(e.status=a.status),{error:JSON.stringify(e)}}}var I=t(11960),B=t.n(I);function CanvasListPage(){let e=(0,h.Dv)(P.yW),a=(0,_.X8)(),{emitEventOnNewCanvasCreation:t}=(0,x.ar)(),[n,s]=(0,d.useState)(!0),[f,v]=(0,d.useState)([]),{createNotification:g}=(0,b.l)();useWootric({canvasCount:f.length});let j=(0,d.useCallback)(async function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];e&&s(!0);let t=await fetch("/api/canvas/v1/canvases/",{headers:{"trailing-slash-hack":"true"}}),n=await t.json();v(n),window.EventToolkit?.emit&&a&&window.EventToolkit?.emit({system_name:"canvas",account_id:a},k.Qz),e&&s(!1)},[a]);(0,d.useEffect)(()=>{j()},[j]);let N=(0,d.useCallback)(async e=>{let a=await deleteCanvas(e.id),t=e.name;return a.error?g({type:"error",message:e.name?`We ran into an issue trying to delete your "${t}" canvas. Please try again.`:"We ran into an issue trying to delete your canvas."}):(await j(!1),g({type:"success",message:t?`Your "${t}" canvas has been deleted.`:"Your canvas has been deleted."}))},[g,j]),C=!n&&f.length>0;return e?.is_logged_in===!1?(0,M.redirect)("/app/login"):(0,r.jsx)(p.p,{currentUrl:"/app/canvas",mainContentId:"canvas-main",trackEvent:()=>null,children:(0,r.jsxs)("div",{className:B().wrapper,children:[n&&(0,r.jsx)("div",{className:B().spinner,children:(0,r.jsx)(i.$,{})}),C&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("span",{className:B().header,children:[(0,r.jsxs)("span",{className:B().title,children:[(0,r.jsx)(o.x,{type:"pageHeader7",children:"Canvas"}),(0,r.jsx)("div",{className:B().betaTag,children:(0,r.jsx)(o.x,{type:"smallPrint1Bold",children:"Beta"})})]}),(0,r.jsx)("span",{children:(0,r.jsx)(l.z,{size:"small",iconBefore:"formAdd",href:"/app/canvas/new",onClick:()=>t(),children:"Create"})})]}),(0,r.jsx)(Header,{}),(0,r.jsx)("ul",{className:B().list,children:f.map(a=>(0,r.jsxs)("li",{className:B().listItem,children:[(0,r.jsx)("div",{className:B().linkWrapper,children:(0,r.jsx)("a",{href:`/app/canvas/${a.id}`,children:(0,r.jsxs)("div",{className:B().linkRow,children:[(0,r.jsx)("div",{className:B().nameCol,children:(0,r.jsx)(o.x,{type:"paragraph3",children:a.name||"untitled"})}),(0,r.jsx)(o.x,{type:"paragraph3",children:a.nodes?.length||1}),(0,r.jsx)(o.x,{type:"paragraph3",children:a.lastchanged&&(0,r.jsx)(m.Z,{date:new Date(a.lastchanged),format:"MMM DD, YYYY"})}),(0,r.jsxs)(o.x,{type:"paragraph3",children:[(0,r.jsx)(c.L,{height:5}),a.full_name&&(0,r.jsx)(u.O,{name:a.full_name,size:25,isInteractive:!0,url:a.photo_url})]})]})})}),e?.id===a.customuser_id?(0,r.jsx)("div",{className:B().actionMenu,children:(0,r.jsx)(ActionMenu_ActionMenu,{deleteCanvas:()=>N(a)})}):(0,r.jsx)("div",{className:B().actionMenuBlank,children:(0,r.jsx)("a",{href:`/app/canvas/${a.id}`,children:(0,r.jsx)("span",{className:B().visuallyHidden,children:"Open Canvas"})})})]},a.id))})]}),!n&&0===f.length&&(0,r.jsx)(NoCanvasSurface,{})]})})}function Header(){return(0,r.jsxs)("div",{className:B().tableHeader,children:[(0,r.jsx)(o.x,{type:"smallPrint1Bold",children:"Name"}),(0,r.jsx)(o.x,{type:"smallPrint1Bold",children:"Steps"}),(0,r.jsx)(o.x,{type:"smallPrint1Bold",children:"Updated"}),(0,r.jsx)(o.x,{type:"smallPrint1Bold",children:"Owner"})]})}function PageWrapper(){return(0,r.jsxs)(_.No,{children:[(0,r.jsx)(D.T,{}),(0,r.jsx)(CanvasListPage,{})]})}},59357:function(){},54593:function(e){e.exports={root:"ActionMenu_root__6UJ_i",menu:"ActionMenu_menu___e_zb"}},33292:function(e){e.exports={title:"NoCanvasSurface_title__RZ9m_",wrapper:"NoCanvasSurface_wrapper__DR5_1",textWrapper:"NoCanvasSurface_textWrapper__Ljkly",surfaceWrapper:"NoCanvasSurface_surfaceWrapper__KxwQa",colWrapper:"NoCanvasSurface_colWrapper__6pvMU",col:"NoCanvasSurface_col__j_1rO",surfaceContent:"NoCanvasSurface_surfaceContent__gm23b",logoWrapper:"NoCanvasSurface_logoWrapper__Hr3SA",betaTag:"NoCanvasSurface_betaTag__2XVhB",buttonWrapper:"NoCanvasSurface_buttonWrapper__A6FYe"}},18015:function(e){e.exports={root:"Notification_root__Py9iC",openAnimation:"Notification_openAnimation__QbiuI"}},42923:function(e){e.exports={root:"Notifications_root__C2zS3"}},11960:function(e){e.exports={wrapper:"page_wrapper__SoIjq",header:"page_header__lFFJM",title:"page_title__5w8ce",tableHeader:"page_tableHeader__DnN8Q",betaTag:"page_betaTag__5mFmv",list:"page_list__6mmAv",listItem:"page_listItem__lEk2f",linkWrapper:"page_linkWrapper__6BzRH",linkRow:"page_linkRow__tXdQ0",nameCol:"page_nameCol__VNXtF",actionMenu:"page_actionMenu__X2Uls",actionMenuBlank:"page_actionMenuBlank__PMT1Y",visuallyHidden:"page_visuallyHidden__cK_p9",spinner:"page_spinner__lr4nI",iframe:"page_iframe__jNH8Q"}}},function(e){e.O(0,[465,6299,7808,6379,252,5741,6506,7315,844,7307,1649,581,2144,4074,9306,2033,1744],function(){return e(e.s=15675)}),_N_E=e.O()}]);
//# sourceMappingURL=page-d09adb5b1e499a60.js.map

0 comments on commit 97f30fb

Please sign in to comment.