forked from sindresorhus/awesome
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
6230-109d586c267c3a02.js.download
2 lines (2 loc) · 29.4 KB
/
6230-109d586c267c3a02.js.download
1
2
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6230],{29282:function(e,n,t){var r=t(98788),o=t(70865),i=t(96670),a=t(66383),c=t(92228),d=t(5163),u=t(52903),l=t(2784),s=t(28316),f=t(28165),m=t(59712),v=t(28952),p=t(66266),h=t(55414),_=t(17688),I=t(42126),g=t(90818),Z=t(20110),y=t(38716),F=t(87744),S=t(52008),C=t(83766),w=t(1639),N=t(25120),b=t(78581),T=t(80327),k=t(69237),A=t(76635);function M(){var e=(0,c.Z)(["\n display: grid;\n grid-gap: 10px;\n grid-template-columns: 1fr;\n "]);return M=function(){return e},e}function x(){var e=(0,c.Z)(["\n display: flex;\n margin: auto;\n gap: 20px;\n "]);return x=function(){return e},e}var E=(0,f.iv)("display:grid;grid-gap:20px;min-width:min(50vw,688px);max-width:688px;","CreateFolderModal.tsx--rootStyles"),z=(0,F.uq)({mobile:(0,f.iv)(M()),tablet:(0,f.iv)(x())}),P=(0,f.iv)('div[data-type="append"]{background-color:inherit !important;font-size:10px !important;font-weight:normal !important;justify-content:flex-end !important;line-height:0 !important;}',"CreateFolderModal.tsx--folderTitleInputStyle"),$=(0,f.iv)("margin:-10px 0 20px;","CreateFolderModal.tsx--checkboxStyle");function R(e){var n=e.isShared,t=e.isSharedSelectable,c=e.onClose,s=e.targetParentFolderName,f=e.parentId,v=e.onAccept;(0,m.jj)("open CreateFolderModal");var p=(0,y.X8)(),F=(0,l.useState)(!1),w=F[0],M=F[1],x=(0,l.useState)(n||!1),R=x[0],D=x[1],G=(0,l.useState)(""),q=G[0],O=G[1],B=(0,a.Z)((0,T.Z)(),1)[0],L=(0,k.Z)({accountId:p,folderId:f?(0,S.Z)(f):void 0}),X=L.createFolder,K=L.createFolderChild,Q=(0,l.useCallback)(function(){var e=(0,r.Z)((function(e){return(0,d.__generator)(this,(function(t){switch(t.label){case 0:return M(!0),e.preventDefault(),e.stopPropagation(),f?[4,K({isShared:n||!1,title:q,parentId:(0,S.Z)(f),accountId:Number(p)})]:[3,2];case 1:return t.sent(),null===v||void 0===v||v(),[3,4];case 2:return(0,b.Ch)("create_folder_".concat(encodeURIComponent(q))),[4,X({isShared:R||!1,title:q})];case 3:t.sent(),t.label=4;case 4:return c(),(0,N.dl)({accountId:p,isNested:!!s}),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),[c,v,p,q,n,f,X,K,s,R]);return(0,u.BX)("form",{css:E,"data-testid":"create-folder-form",onClick:function(e){null===e||void 0===e||e.stopPropagation()},onKeyDown:function(e){return"Enter"===e.key&&Q(e)},onSubmit:Q,children:[(0,u.BX)(h.x,{tag:"h1",textAlign:"center",type:"paragraph1Bold",children:["Add new ",R?"shared":"personal"," folder",s?" in ".concat(s):null]}),(0,u.tZ)(_.g,{isRequired:!0,label:"Title",isDisabled:w,renderInput:function(e){return(0,u.tZ)("div",{css:P,children:(0,u.tZ)(I.o,(0,i.Z)((0,o.Z)({},e),{appendContent:(0,u.tZ)(C.Z,{count:q.length,limit:255}),layout:"block",maxLength:255,placeholder:"My folder",ref:B,onChange:function(e){return O(e.target.value)}}))})}}),((0,A.isUndefined)(n)||t)&&(0,u.tZ)("div",{css:$,"data-testid":"sharing-checkbox",children:(0,u.tZ)(g.f,{checked:R,name:"isShared",onChange:function(e){D(e.target.checked)},value:"isShared",children:"Share this folder with your teammates"})}),(0,u.BX)("div",{css:z,children:[(0,u.tZ)(Z.z,{color:"secondary",onClick:function(){c(),(0,N.ly)({accountId:p,isNested:!!s})},type:"button",children:"Cancel"}),(0,u.tZ)(Z.z,{disabled:!q.length||w,type:"submit",children:"Done"})]})]})}n.Z=function(e){var n=e.isShared,t=e.isSharedSelectable,r=e.onClose,o=e.targetParentFolderName,i=e.parentId,a=e.onAccept,c=(0,w.Z)("create-folder-modal");return(0,s.createPortal)((0,u.tZ)(v.u,{ariaLabel:"Add folder",onClosed:r,children:(0,u.tZ)(p.hz,{children:(0,u.tZ)(R,{isShared:n,isSharedSelectable:t,onClose:r,targetParentFolderName:o,parentId:i,onAccept:a})})}),c)}},85150:function(e,n,t){t.d(n,{P:function(){return d},n:function(){return u}});var r=t(66383),o=t(52903),i=t(38716),a=t(2784),c=(0,a.createContext)({}),d=function(e){var n=e.children,t=e.id,d=(0,a.useState)({}),u=d[0],l=d[1],s=(0,i.X8)(),f=(0,a.useCallback)((function(e){l((function(n){var o=!0,i=!1,a=void 0;try{for(var c,d=Object.entries(e)[Symbol.iterator]();!(o=(c=d.next()).done);o=!0){var u=(0,r.Z)(c.value,2),l=u[0],f=u[1];n["".concat(s,"-").concat(t,"-").concat(l)]=f}}catch(m){i=!0,a=m}finally{try{o||null==d.return||d.return()}finally{if(i)throw a}}return n}))}),[s,t]),m={isOpen:(0,a.useCallback)((function(e){return u["".concat(s,"-").concat(t,"-").concat(e)]||!1}),[s,t,u]),setIsOpen:f};return(0,o.tZ)(c.Provider,{value:m,children:n})},u=function(){return(0,a.useContext)(c)}},9882:function(e,n,t){t.d(n,{B:function(){return c},D:function(){return d}});var r=t(52903),o=t(2784),i=t(87263),a=(0,o.createContext)({}),c=function(e){var n=e.children,t=(0,o.useState)(0),c=t[0],d=t[1],u=(0,i.ZP)(),l={activeTab:u.activeTab,setSidebarTabActiveFolderId:d,setTab:u.setTab,sidebarTabActiveFolderId:c};return(0,r.tZ)(a.Provider,{value:l,children:n})},d=function(){return(0,o.useContext)(a)}},27459:function(e,n,t){var r=t(2784),o=t(38716),i=t(68217),a=t(9466);n.Z=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).includeDefaultFolder,n=(0,o.X8)(),t=(0,i.Z)({accountId:n,includeDefaultFolder:e}),c=t.foldersTree,d=t.rootFoldersLoading,u=(0,r.useMemo)((function(){for(var e=[],n=[],t=0;t<c.length;t++)c[t].isShared||(0,a.Z)(c[t].id)?c[t].isShared&&n.push(c[t]):e.push(c[t]);return[e,n]}),[c]),l=u[0],s=u[1];return{rootFoldersLoading:d,personalFolders:l,sharedFolders:s,hasSharedFolders:!!s.length,hasPersonalFolders:!!l.length}}},87263:function(e,n,t){t.d(n,{wo:function(){return r}});var r,o=t(2784),i="activeFolderTab";!function(e){e.Personal="personal",e.Shared="shared"}(r||(r={}));n.ZP=function(){var e=(0,o.useState)(r.Personal),n=e[0],t=e[1];(0,o.useEffect)((function(){localStorage.getItem(i)===r.Shared?t(r.Shared):t(r.Personal)}),[]),(0,o.useEffect)((function(){localStorage.setItem(i,n)}),[n]);var a=(0,o.useCallback)((function(e){t(e)}),[]);return{activeTab:n,setTab:a}}},14033:function(e,n,t){var r=t(16181);n.Z=function(){var e=(0,r.gn)(),n=e.accountId,t=e.isTeam,o=e.isCompanyAccount,i=e.isTrialingCompanies,a=e.isTrialingTeams,c=e.roles,d=null===c||void 0===c?void 0:c.find((function(e){return e.accountId===(null===n||void 0===n?void 0:n.toString())}));return{canShareFolders:a||i||t||o,canCreateSharedFolders:a||i||t||o,canSearchPersonalFoldersAndZaps:!!d&&("owner"===d.role||"super_admin"===d.role)}}},70882:function(e,n,t){t.d(n,{Z:function(){return c}});var r=t(38716),o=t(73223),i=t(39386),a=t(42051);function c(){var e=(0,r.X8)(),n=(0,i.Z)({folderId:o.tW}),t=(0,i.Z)({folderId:o.Mz}),c=(0,i.Z)({folderId:o.K0})||(0,a.K)(String(e||""))[1];return{heldFolder:(null===n||void 0===n?void 0:n.zapCount)?n:void 0,pendingFolder:(null===t||void 0===t?void 0:t.zapCount)?t:void 0,trashFolder:c}}},80327:function(e,n,t){var r=t(2784);n.Z=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).id,n=(0,r.useRef)(null),t=function(){var e;null===n||void 0===n||null===(e=n.current)||void 0===e||e.focus()};return(0,r.useEffect)((function(){setTimeout((function(){var t,r;e?null===(t=document.getElementById(e))||void 0===t||t.focus():null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus()}))}),[e]),[n,t]}},61945:function(e,n,t){t.d(n,{l:function(){return i}});var r=t(92228);function o(){var e=(0,r.Z)(["\n query FolderAncestors($accountId: Int!, $folderId: ID!) {\n folderAncestors(folderId: $folderId, accountId: $accountId) {\n accountId\n id\n isShared\n name\n ownerId\n parentId\n rootId\n zapCount\n }\n }\n"]);return o=function(){return e},e}var i=(0,t(60138).Ps)(o())},49182:function(e,n,t){t.d(n,{FJ:function(){return g},xN:function(){return v},K:function(){return F},it:function(){return f},sm:function(){return S},j6:function(){return Z},LS:function(){return y}});var r=t(47842),o=t(70865),i=t(96670),a=t(50930),c=t(47462),d=t(61945);var u=function(e){var n=e.cache,t=e.query,r=e.updater,o=e.variables;try{var i=r(n.readQuery({query:t,variables:o}));n.writeQuery({data:i,query:t,variables:o})}catch(a){console.warn(a)}return n},l=t(21815),s=function(e){return e.sort((function(e,n){return new Intl.Collator("en").compare(e.name,n.name)}))},f=function(e,n){return[{query:d.l,variables:{accountId:Number(n),folderId:Number(e)}}]},m=function(e,n){var t=!0,r=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var c=i.value;if(n(c)||(null===c||void 0===c?void 0:c.children)&&m(c.children,n))return!0}}catch(d){r=!0,o=d}finally{try{t||null==a.return||a.return()}finally{if(r)throw o}}return!1},v=function(e,n){var t=null;return m(e,(function(e){return String(e.id)===String(n)&&(t=e,!0)})),t},p=function(e,n){return Array.isArray(e)?n.parentId?e.map((function(e){return p(e,n)})):s((0,a.Z)(e).concat([n])):String(e.id)===String(n.parentId)?(0,i.Z)((0,o.Z)({},e),{children:(0,a.Z)(e.children||[]).concat([n]).sort((function(e,n){return e.name.localeCompare(n.name)}))}):(0,o.Z)({},e,"children"in e?{children:p(e.children,n)}:{})},h=function(e,n){return e.reduce((function(e,t){var r,a=(null===(r=t.children)||void 0===r?void 0:r.length)?h(t.children,n):[];return t.id!==n&&e.push((0,i.Z)((0,o.Z)({},t),{children:a})),e}),[])},_=function(e,n,t,a){return Array.isArray(e)?e.map((function(e){return _(e,n,t,a)})):String(e.id)===String(n.id)?(0,i.Z)((0,o.Z)({},e),(0,r.Z)({},t,a)):(0,o.Z)({},e,e.children?{children:_(e.children,n,t,a)}:{})},I=function(e,n,t){var a,c;return Array.isArray(e.children)?(0,i.Z)((0,o.Z)({},e),(a={},(0,r.Z)(a,n,t),(0,r.Z)(a,"children",e.children.map((function(e){return I(e,n,t)}))),a)):(0,i.Z)((0,o.Z)({},e),(c={},(0,r.Z)(c,n,t),(0,r.Z)(c,"children",I(e.children,n,t)),c))},g=function(e,n,t){var r=n===String(e.ownerId)?void 0:String(e.ownerId);return u({cache:t,query:c.O,updater:function(n){var t=p(n.account.foldersTree,e);return(0,i.Z)((0,o.Z)({},n),{account:(0,i.Z)((0,o.Z)({},n.account),{foldersTree:t})})},variables:(0,o.Z)({},r?{ownerId:r}:{})})},Z=function(e){var n=e.folder,t=e.userId,r=e.cache,a=e.key,d=e.value,l=t===String(n.ownerId)?void 0:String(n.ownerId);u({cache:r,query:c.O,updater:function(e){var t=v(e.account.foldersTree,n.id),r=h(e.account.foldersTree,n.id),c=I(t,a,d),u=p(r,c);return(0,i.Z)((0,o.Z)({},e),{account:(0,i.Z)((0,o.Z)({},e.account),{foldersTree:u})})},variables:(0,o.Z)({},l?{ownerId:l}:{})})},y=function(e){var n=e.folder,t=e.userId,r=e.cache,a=e.attributeKey,d=e.attributeValue,u=n.isShared||t===String(n.ownerId)?void 0:String(n.ownerId),l=r.readQuery({query:c.O,variables:(0,o.Z)({},u?{ownerId:u}:{})}),s=_(l.account.foldersTree,n,a,d),f=(0,i.Z)((0,o.Z)({},l),{account:(0,i.Z)((0,o.Z)({},l.account),{foldersTree:s})});r.writeQuery({data:f,query:c.O,variables:(0,o.Z)({},u?{ownerId:u}:{})})},F=function(e,n,t){var r=c.O,a=t===String(e.ownerId)?void 0:String(e.ownerId),d=(0,o.Z)({},a?{ownerId:a}:{}),u=n.readQuery({query:r,variables:d});if(u){var l=v(u.account.foldersTree,e.id),s=(0,i.Z)((0,o.Z)({},l),{rootId:e.rootId,parentId:e.parentId}),f=h(u.account.foldersTree,e.id),m=p(f,s),_=(0,i.Z)((0,o.Z)({},u),{account:(0,i.Z)((0,o.Z)({},u.account),{foldersTree:m})});n.writeQuery({data:_,query:r,variables:d})}},S=function(e,n,t){var r=n.identify({id:e,__typename:"FolderTreeItem"}),d=n.readFragment({fragment:l.ZB,id:r,fragmentName:"FullLightBranchFolder"}),f=t===String(null===d||void 0===d?void 0:d.ownerId)?void 0:String(null===d||void 0===d?void 0:d.ownerId),m=(0,i.Z)((0,o.Z)({},d),{children:I(d,"rootId",Number(null===d||void 0===d?void 0:d.id)).children,rootId:null,parentId:null});u({cache:n,query:c.O,updater:function(e){var n=h(e.account.foldersTree,(null===d||void 0===d?void 0:d.id)||""),t=s([m].concat((0,a.Z)(n)));return(0,i.Z)((0,o.Z)({},e),{account:(0,i.Z)((0,o.Z)({},e.account),{foldersTree:t})})},variables:(0,o.Z)({},f?{ownerId:f}:{})})}},69237:function(e,n,t){t.d(n,{Z:function(){return z}});var r=t(70865),o=t(96670),i=t(66383),a=t(33379),c=t(5632),d=t(6804),u=t(96459),l=t(53736),s=t(92228),f=t(60138),m=t(37490),v=t(21815);function p(){var e=(0,s.Z)(["\n ","\n\n mutation CreateFolder($input: CreateFolderInput!) {\n createFolder(input: $input) {\n ...LightFolder\n parentId\n }\n }\n"]);return p=function(){return e},e}function h(){var e=(0,s.Z)(["\n mutation DeleteFolder($accountId: Int!, $id: Int!) {\n deleteFolder(accountId: $accountId, id: $id)\n }\n"]);return h=function(){return e},e}function _(){var e=(0,s.Z)(["\n mutation UpdateFolderTitle(\n $accountId: Int!\n $id: Int!\n $input: FolderInput!\n ) {\n updateFolder(accountId: $accountId, id: $id, input: $input) {\n id\n title\n }\n }\n"]);return _=function(){return e},e}function I(){var e=(0,s.Z)(["\n mutation UpdateFolderShared(\n $accountId: Int!\n $id: Int!\n $input: FolderInput!\n ) {\n updateFolder(accountId: $accountId, id: $id, input: $input) {\n id\n isShared\n }\n }\n"]);return I=function(){return e},e}function g(){var e=(0,s.Z)(["\n ","\n\n mutation CreateFolderChild($input: CreateFolderInput!) {\n createFolderChild(input: $input) {\n ...LightBranchFolder\n children {\n id\n }\n }\n }\n"]);return g=function(){return e},e}function Z(){var e=(0,s.Z)(["\n mutation MoveFolder($folderId: Int!, $folderIds: [Int!]!) {\n adoptFolderChild(folderId: $folderId, folderIds: $folderIds) {\n id\n name\n accountId\n rootId\n parentId\n ownerId\n }\n }\n"]);return Z=function(){return e},e}function y(){var e=(0,s.Z)(["\n mutation DeleteFolderAncestors($folderId: Int!) {\n deleteFolderAncestors(folderId: $folderId)\n }\n"]);return y=function(){return e},e}var F=(0,f.Ps)(p(),m.FD),S=(0,f.Ps)(h()),C=(0,f.Ps)(_()),w=(0,f.Ps)(I()),N=(0,f.Ps)(g(),v.ET),b=(0,f.Ps)(Z()),T=(0,f.Ps)(y()),k=t(49182),A=t(16181),M=t(52008),x=t(39386),E=t(35591),z=function(e){var n=e.accountId,t=e.folderId,s=(0,l.l)().createNotification,f=(0,c.useRouter)(),m=(0,A.gn)().userId,p=(0,x.Z)({folderId:t}),h=(0,i.Z)((0,a.D)(F,{onCompleted:function(e){var n,t,i=null===e||void 0===e||null===(n=e.createFolder)||void 0===n?void 0:n.id,a=null===e||void 0===e||null===(t=e.createFolder)||void 0===t?void 0:t.title;i&&f.replace((0,u.Sr)(f.pathname,(0,o.Z)((0,r.Z)({},f.query),{hl:i}))),a&&s({message:'Successfully created folder "'.concat(a,'"'),type:"success",timeout:1e4})},onError:function(e){(0,E.Z)("CreateFolderMutation",e),s({message:"Couldn't create folder.",type:"error"})},update:function(e,n){var t,r=n.data,o=null===r||void 0===r||null===(t=r.createFolder)||void 0===t?void 0:t.parentId,i=null===r||void 0===r?void 0:r.createFolder;if(!o){var a={accountId:i.accountId,children:[],id:i.id,isShared:i.isShared,name:i.title,ownerId:Number(i.owner.id),parentId:null,rootId:null,zapCount:i.zapCount,__typename:"FolderTreeItem"};(0,k.FJ)(a,m,e)}}}),1),_=h[0],I=(0,i.Z)((0,a.D)(N,{onCompleted:function(e){var n,t,i=null===e||void 0===e||null===(n=e.createFolderChild)||void 0===n?void 0:n.id,a=null===e||void 0===e||null===(t=e.createFolderChild)||void 0===t?void 0:t.name;i&&f.replace((0,u.Sr)(f.pathname,(0,o.Z)((0,r.Z)({},f.query),{hl:i}))),a&&s({message:'Successfully created subfolder "'.concat(a,'"'),type:"success",timeout:1e4})},onError:function(e){(0,E.Z)("CreateFolderChildMutation",e),s({message:"Couldn't create subfolder.",type:"error",timeout:1e4})},update:function(e,n){var t=n.data,r=null===t||void 0===t?void 0:t.createFolderChild;(0,k.FJ)(r,m,e)}}),1),g=I[0],Z=(0,i.Z)((0,a.D)(b,{onCompleted:function(e){var n=e.adoptFolderChild[0].name;s({message:'Successfully moved "'.concat(n,'".'),type:"success"})},onError:function(e){(0,E.Z)("MoveFolderMutation",e),s({message:"Couldn't move folder.",type:"error"})},refetchQueries:function(e){var n=e.data,t=null===n||void 0===n?void 0:n.adoptFolderChild[0];return t?(0,k.it)(t.id,t.accountId):[]},fetchPolicy:"no-cache",update:function(e,n){var t=n.data,r=null===t||void 0===t?void 0:t.adoptFolderChild[0];(0,k.K)(r,e,m)}}),1),y=Z[0],z=(0,i.Z)((0,a.D)(S,{onCompleted:function(){s({message:"Successfully deleted folder.",type:"success"})},onError:function(e){(0,E.Z)("DeleteFolderMutation",e),s({message:"Couldn't delete folder.",type:"error"})},update:function(e,n){var t,r=String(null===(t=n.data)||void 0===t?void 0:t.deleteFolder),o=e.identify({id:r,__typename:"Folder"});e.evict({id:o});var i=e.identify({id:r,__typename:"FolderTreeItem"});e.evict({id:i}),e.modify({id:i,fields:function(e,n){return n.DELETE},optimistic:!0}),e.gc()}}),1),P=z[0],$=(0,i.Z)((0,a.D)(T,{onCompleted:function(){s({message:"Successfully moved folder.",type:"success"})},onError:function(e){(0,E.Z)("DeleteFolderAncestorsMutation",e),s({message:"Couldn't delete folder ancestors.",type:"error"})},fetchPolicy:"no-cache",refetchQueries:function(e){var t=e.data,r=null===t||void 0===t?void 0:t.deleteFolderAncestors;return r&&n?(0,k.it)(r,n):[]},update:function(e,n){var t=n.data;(null===t||void 0===t?void 0:t.deleteFolderAncestors)&&(0,k.sm)(String(null===t||void 0===t?void 0:t.deleteFolderAncestors),e,m)}}),1),R=$[0],D=(0,i.Z)((0,a.D)(C,{onError:function(e){(0,E.Z)("UpdateFolderTitleMutation",e),s({message:"Couldn't update folder.",type:"error"})},update:function(e,n){var t=n.data,r=null===t||void 0===t?void 0:t.updateFolder,o=e.readFragment({fragment:v.ET,id:"FolderTreeItem:".concat(r.id)});o&&(0,k.LS)({folder:o,userId:m,cache:e,attributeKey:"name",attributeValue:r.title})}}),1),G=D[0],q=(0,i.Z)((0,a.D)(w,{onError:function(e){(0,E.Z)("UpdateFolderSharedMutation",e),s({message:"Couldn't update folder.",type:"error"})},update:function(e,n){var t=n.data,r=null===t||void 0===t?void 0:t.updateFolder,o=e.readFragment({fragment:v.ET,id:"FolderTreeItem:".concat(r.id)});o&&(0,k.j6)({folder:o,userId:m,cache:e,key:"isShared",value:!0})}}),1),O=q[0];return{createFolder:function(e){var t=e.isShared,o=e.title,i=e.parentId,a={createFolder:{accountId:String(n),id:"TEMP-".concat((0,d.Z)()),title:o,isShared:t,isVirtual:!1,ownerId:m||"",owner:{id:m||"",__typename:"ShareMember"},parentId:i||null,zapCount:0,counts:{workflow:0,transfer:0,__typename:"ZapCounts"},__typename:"Folder"}};return _((0,r.Z)({variables:{input:(0,r.Z)({accountId:n},e,e.isShared?{shareWithAll:!0}:{})}},i?{}:{optimisticResponse:a}))},createFolderChild:function(e){var n=e.parentId,t=e.title,r=e.isShared,o=e.accountId;return g({variables:{input:{parentId:n,isShared:r,title:t,accountId:o}},optimisticResponse:{createFolderChild:{accountId:String(o),children:[],id:"TEMP-".concat((0,d.Z)()),isShared:r,name:t,ownerId:null===p||void 0===p?void 0:p.ownerId,parentId:Number(n),rootId:Number(n),zapCount:0,__typename:"FolderTreeItem"}}})},deleteFolder:function(e){var t=(0,M.Z)(e);return P({variables:{accountId:n,id:t},optimisticResponse:{deleteFolder:t}})},deleteFolderAncestors:function(e){return R({variables:{folderId:e},optimisticResponse:{deleteFolderAncestors:Number(e)}})},shareFolder:function(e,t){var o=t.isShared;return O({variables:{accountId:n,id:e,input:(0,r.Z)({accountId:n},t)},optimisticResponse:{updateFolder:{id:String(e),__typename:"Folder",isShared:o}}})},updateFolder:function(e,t){var o=t.title;return G({variables:{accountId:n,id:e,input:(0,r.Z)({accountId:n},t)},optimisticResponse:{updateFolder:{id:String(e),__typename:"Folder",title:o}}})},moveFolder:function(e){var t=e.folderId,o=e.folderIds,i=(null===p||void 0===p?void 0:p.title)||(null===p||void 0===p?void 0:p.name);return y({variables:(0,r.Z)({},e),optimisticResponse:{adoptFolderChild:[{accountId:String(n),id:String(o[0]),name:i,ownerId:null===p||void 0===p?void 0:p.ownerId,parentId:t,rootId:t,__typename:"FolderTreeItem"}]}})}}}},1639:function(e,n,t){var r=t(2784);n.Z=function(e){var n=(0,r.useRef)(null);return(0,r.useEffect)((function(){var t,r=document.querySelector("#".concat(e)),o=r||function(e){var n=document.createElement("div");return n.setAttribute("id",e),n}(e);return r||(t=o,document.body.insertBefore(t,document.body.lastElementChild.nextElementSibling)),n.current&&o.appendChild(n.current),function(){n.current&&n.current.remove(),o.childElementCount||o.remove()}}),[e]),n.current||(n.current=document.createElement("div")),n.current}},78581:function(e,n,t){t.d(n,{pL:function(){return m},Nf:function(){return f},fr:function(){return l},FS:function(){return u},Ch:function(){return s}});var r=t(98788),o=t(66383),i=t(5163),a=t(76635),c=function(){return"function"===typeof window.performance.mark},d=function(e){return["".concat(e,"_start"),"".concat(e,"_end")]},u=function(e){if(c()){var n=window.performance.getEntries().reduce((function(n,t){return t.name.startsWith(e)&&(t.name.endsWith("_start")?n.starts.unshift(t):t.name.endsWith("_end")&&(n.ends[t.name]=!0)),n}),{starts:[],ends:{}}),t=n.starts,r=n.ends;return t.find((function(e){return!r[e.name.replace("_start","_end")]}))}},l=function(e){if(c()){var n=(0,o.Z)(d(e),2),t=n[0],r=n[1],i=window.performance.getEntriesByName(t),a=window.performance.getEntriesByName(r);if(!(i.length<=a.length))return i[i.length-1]}},s=function(e,n){if(c()){var t=(0,o.Z)(d(e),1)[0];return console.log("\u23f3 Start timing for: ".concat(e)),window.performance.mark(t,n),t}},f=function(e,n){if(c()){var t=(0,o.Z)(d(e),2),r=t[0],i=t[1];try{var a,u=window.performance.getEntriesByName(r),l=window.performance.getEntriesByName(i);if(u.length<=l.length)return;window.performance.mark(i,n);var s=null===(a=window.performance.measure(e,r,i))||void 0===a?void 0:a.duration;return console.log("\u231b End timing for: ".concat(e,", ").concat(s," ")),s}catch(f){return}}},m=(0,a.debounce)(f,2e3,{leading:!0,trailing:!1});!function(){var e=(0,r.Z)((function(e,n){var t,r,a,u,l;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return c()?(r=(0,o.Z)(d(e),1),a=r[0],window.performance.mark(a),console.log("\u23f0 Starting Clock for: ".concat(e)),[4,n()]):[3,2];case 1:return u=i.sent(),l=null===(t=window.performance.measure(e,a))||void 0===t?void 0:t.duration,console.log("\u23f0 Ending Clock for: ".concat(e,", ").concat(l," ")),[2,u];case 2:return[2,n()]}}))}))}()},7118:function(e,n,t){t.d(n,{S:function(){return r}});var r=function(e){return!!e.current&&e.current.scrollWidth>e.current.clientWidth}},14725:function(e,n,t){var r=t(73223),o=t(90446);n.Z=function(e){var n=e.accountId,t=e.customTrackingFields,i=void 0===t?{}:t,a=e.eventAction,c=e.interactionGoal,d=void 0===c?"":c,u=e.interactionName,l=e.interactionRawText,s=void 0===l?"":l,f=e.optionSelected,m=void 0===f?"":f,v=e.systemName;return(0,o.Z)({account_id:n,custom_tracking_fields:i,event_action:a,interaction_goal:d,interaction_name:u,interaction_raw_text:s,option_selected:m,system_name:v},r.rw)}},25120:function(e,n,t){t.d(n,{dl:function(){return _},ly:function(){return h},ad:function(){return l},Of:function(){return p},Ut:function(){return v},qj:function(){return S},PZ:function(){return c},yM:function(){return I},Cb:function(){return C},ZC:function(){return m},LZ:function(){return Z},P3:function(){return y},y6:function(){return d},pm:function(){return s},Yn:function(){return g},f7:function(){return T},ST:function(){return b},HZ:function(){return N},iJ:function(){return F},G3:function(){return f},gX:function(){return u},aX:function(){return k},B6:function(){return w}});var r=t(73223),o=t(90446),i=function(e){var n=e.accountId,t=e.eventAction,i=e.interactionGoal,a=void 0===i?"":i,c=e.interactionName,d=e.systemName;return(0,o.Z)({account_id:n,event_action:t,interaction_goal:a,interaction_name:c,option_selected:"not_applicable",system_name:d},r.rw)},a=t(14725),c=function(e){var n=e.accountId,t=e.isShared,r=!0===t?"Shared":!1===t?"Private":"Undefined";return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"Create a ".concat(r," Folder from My Zaps Folder Sidebar"),interactionName:"call_to_action",systemName:"my_zaps"})},d=function(e){var n=e.accountId,t=e.isNested,r=e.isOpen;return(0,a.Z)({accountId:n,eventAction:r?"open":"close",interactionGoal:"Move Folder Modal ".concat(r?"Open":"Close"),interactionName:"move_folder_modal_interaction",systemName:"my_zaps",customTrackingFields:{is_nested_folder:String(t)}})},u=function(e){var n=e.accountId,t=e.isNested,r=e.searchString;return(0,a.Z)({accountId:n,eventAction:"search",interactionGoal:"Searched for Destination Folder in the Move Folder Modal",interactionName:"move_folder_modal_interaction",systemName:"my_zaps",customTrackingFields:{is_nested_folder:String(t),search_string:r}})},l=function(e){var n=e.accountId,t=e.isNested;return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"Move Folder Modal Closed",interactionName:"move_folder_modal_interaction",systemName:"my_zaps",customTrackingFields:{is_nested_folder:String(t)},interactionRawText:"Cancel"})},s=function(e){var n=e.accountId,t=e.isDestinationNested,r=e.isNested;return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"Move Folder Modal Click Move CTA",interactionName:"move_folder_modal_interaction",systemName:"my_zaps",customTrackingFields:{is_nested_folder:String(r),destination_is_nested_folder:String(t)},interactionRawText:"Move"})},f=function(e){var n=e.accountId,t=e.isNested;return(0,a.Z)({accountId:n,eventAction:"scroll",interactionGoal:"Scroll the List of Folders in the Move Folder Modal",interactionName:"move_folder_modal_interaction",systemName:"my_zaps",customTrackingFields:{is_nested_folder:String(t)}})},m=function(e){var n=e.accountId,t=e.isNested,r=e.isOpen;return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"".concat(r?"Collapse":"Expand"," Nested Folder in Move Folder Modal"),interactionName:"move_folder_modal_interaction",systemName:"my_zaps",customTrackingFields:{is_nested_folder:String(t)}})},v=function(e){var n=e.accountId,t=e.destinationFolderName,r=e.isDestinationNested,o=e.isNested;return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"Clicked on a Destination Folder in the Move Folder Modal",interactionName:"move_folder_modal_interaction",systemName:"my_zaps",customTrackingFields:{destination_folder_name:t,destination_is_nested_folder:String(r),is_nested_folder:String(o)}})},p=function(e){var n=e.accountId,t=e.isNested;return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"Create a New Folder from My Zaps +Create Menu",interactionName:"call_to_action",systemName:"my_zaps",customTrackingFields:{is_nested_folder:String(t)}})},h=function(e){var n=e.accountId,t=e.isNested;return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"Clicked Cancel in Add New Folder Modal",interactionName:"add_new_folder_modal_interaction",systemName:"my_zaps",customTrackingFields:{is_nested_folder:String(t)},interactionRawText:"Cancel"})},_=function(e){var n=e.accountId,t=e.isNested;return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"Add Folder Modal Click Create CTA",interactionName:"add_new_folder_modal_interaction",systemName:"my_zaps",customTrackingFields:{is_nested_folder:String(t)},interactionRawText:"Create"})},I=function(e){var n=e.accountId,t=e.isNested;return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"Create a new Zap from an Empty Folder",interactionName:"call_to_action",interactionRawText:"Create a New Zap",systemName:"my_zaps",customTrackingFields:{is_nested_folder:String(t)}})},g=function(e){var n=e.accountId;return(0,a.Z)({accountId:n,eventAction:"in_view",interactionGoal:"Viewed the Toast Message",interactionName:"toast_message_nesting_limit_reached",systemName:"my_zaps",customTrackingFields:{is_nested_folder:"true"}})},Z=function(e){var n=e.accountId,t=e.isNested,r=e.isOpen;return(0,a.Z)({accountId:n,eventAction:r?"close":"open",interactionGoal:"".concat(r?"Close":"Open"," the Folder Kebab Menu"),interactionName:"folder_kebab_interaction",systemName:"my_zaps",customTrackingFields:{is_nested_folder:String(t)}})},y=function(e){var n=e.accountId,t=e.isNested;return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"Move this folder to a different Folder",interactionName:"folder_kebab_interaction",interactionRawText:"Move",systemName:"my_zaps",customTrackingFields:{is_nested_folder:String(t)}})},F=function(e){var n=e.accountId,t=e.isNested;return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"Rename this Folder",interactionName:"folder_kebab_interaction",interactionRawText:"Rename",systemName:"my_zaps",customTrackingFields:{is_nested_folder:String(t)}})},S=function(e){var n=e.accountId,t=e.isNested;return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"Create a New Folder within this Folder",interactionName:"folder_kebab_interaction",interactionRawText:"New Folder",systemName:"my_zaps",customTrackingFields:{is_nested_folder:String(t)}})},C=function(e){var n=e.accountId,t=e.isNested;return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"Delete this Folder",interactionName:"folder_kebab_interaction",interactionRawText:"Delete",systemName:"my_zaps",customTrackingFields:{is_nested_folder:String(t)}})},w=function(e){var n=e.templateId,t=e.templateSlug;return(0,a.Z)({eventAction:"click",interactionGoal:"create_zap",interactionName:"try_it_call_to_action",interactionRawText:"Try it",systemName:"zap-management",customTrackingFields:{template_id:n,template_slug:t}})},N=function(e){var n=e.accountId;return i({accountId:n,eventAction:"in_view",interactionGoal:"onboarding_teams_upsell",interactionName:"onboarding_teams_upsell_in_view",systemName:"zap-management"})},b=function(e){var n=e.accountId;return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"Open Zapier for teams free trial modal",interactionName:"try_teams_free_trial_call_to_action",interactionRawText:"Try free",systemName:"zap-management"})},T=function(e){var n=e.accountId;return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"Learn details regarding Zapier for teams",interactionName:"learn_more_teams_free_trial_call_to_action",interactionRawText:"Learn more",systemName:"zap-management"})},k=function(e){var n=e.accountId;return(0,a.Z)({accountId:n,eventAction:"click",interactionGoal:"Click Zapier for teams free trial modal",interactionName:"confirm_teams_free_trial",interactionRawText:"Confirm and create folder",systemName:"zap-management"})}}}]);
//# sourceMappingURL=6230-109d586c267c3a02.js.map