1import{dc as l,db as o,F as M,bg as wt,cg as ho,bf as uo,c8 as fo,a8 as re,e0 as ce,E as po,bD as Ve,h as F,j as go,c as Re,a7 as Ot,ec as Lt,aM as xo,ck as kt,el as Ee,dQ as Mt,b5 as Ht,e as bo,dt as yo,ek as vo,e5 as Co,eo as wo,ej as ko,e4 as So,e7 as _o,dT as Do,P as Je}from"./index-CmSfgMPc.js";import{b1 as x,e as u,g as ee,N as ie,M as Po,a4 as Ft,n as Io,a0 as Q,Y as et,Z as tt,v as Qe,a1 as To,a6 as Eo,A as st,aj as de,a5 as No,O as Ke,b0 as Wt,bf as mt,o as ot,aH as $t,bb as qt,aE as jo,ax as Ro,ao as St,aD as zo,l as Ao,p as Gt,u as Bo,s as Oo,r as Lo,D as Mo,b as Ho,aC as _t,$ as Fo,L as Dt,m as Wo,aO as $o}from"./ui-u4xJzAJX.js";import{K as qo,g as Pt,x as It,r as Tt}from"./index-CJRF5krZ.js";import{a as Go,S as Uo}from"./SavePlaybookDialog-DVNH3Mi6.js";import{C as Ut,u as Qt,m as ht,k as Qo,q as Yo,p as Yt,A as je,f as Vo,l as Ko,e as Vt,c as Kt,t as Zt,a as Xt,d as Jt,b as ct,v as Te,o as Zo,h as Et,y as Nt,n as Xo,z as $e,x as Jo,s as en,r as jt,i as qe,j as tn,g as on,B as nn}from"./playbook-BVxrzo_f.js";import{f as Rt}from"./fetchPlaybook-B2bzhy7L.js";import{C as eo}from"./ConfirmationDialog-R5z214uq.js";import{L as rn}from"./LibraryItemLoadError-B4xPrtRz.js";import{u as an}from"./useIsOnline-CkuxZdxb.js";import{h as ln}from"./object_hash-D1Py5DIz.js";import{M as dt}from"./MenuPopover-BhhsVT9r.js";import{u as sn}from"./usePlay-BykHhVGn.js";import{P as cn,u as dn}from"./PhaseThumbnail-YFQbd3pN.js";import{P as mn}from"./PlayDisplaySettings-MazWtmsK.js";import{P as ut}from"./plate-editor-BaakbyIW.js";import{i as hn,A as un}from"./is-empty-content-CaH9SNmP.js";import{q as fn,d as ue,w as ft}from"./FolderTableRow-DBEc7N-3.js";import{P as pn,u as gn,a as xn}from"./useFilteredPlays-DA6m05K6.js";import{b as bn,a as yn}from"./element-CD5Mjtx4.js";import{u as vn}from"./ScrollRootContext-D4rEBX8N.js";import{P as Cn}from"./PlaysToolbar-wK8avhXH.js";import{u as wn}from"./useSafeAreaInset-BvbIwqWm.js";import{u as kn}from"./usePickerFolderNav-BH6jrFUl.js";import{F as Sn}from"./FolderBreadcrumbs-B1nSx_1h.js";import{a as _n,c as Dn}from"./PlaysFilter-1QZZ_4Mn.js";import{S as nt}from"./Scrollbar-Cgp18_Bb.js";import{u as Pn}from"./CollectionToolbar-BY9SuvjE.js";import{u as In}from"./useTabs-BLoPfCsz.js";import{A as Tn,C as En,P as Nn}from"./PlaybookPrintPreview-C3_GatSs.js";import{D as jn}from"./index-D71MChHd.js";import{C as Rn}from"./chevron-up-CfhrERCT.js";import{C as zn}from"./index-DxV-gQ9F.js";import"./media-UejkmJrh.js";import"./editor-WYCba1gG.js";import"./auth-CAQqEDmo.js";import"./useTags-C9AI7So1.js";import"./StatusLabel-DQu7jmAq.js";import"./Label-CRbSig1w.js";import"./FormProvider-DnDUJPhm.js";import"./index-CN7p4I9l.js";import"./index-DTVaLiQt.js";import"./FolderPickerDialog-DK4NpHzb.js";import"./MyAvatar-cR1nsHSO.js";import"./createAvatar-CgGTnP9k.js";import"./Avatar-DXzv_PDd.js";import"./TeamAvatar-B26t3vgX.js";import"./redux-toolkit.modern-C_3cW4ZS.js";import"./v4-Bg-q7VAD.js";import"./PlatejsContextProvider-CZfjqL4u.js";import"./PlaySkeleton-XHVeGGQV.js";import"./Phase-CKzTdf-G.js";import"./useDimensions-DmCYnqMc.js";import"./ResizeObserver.es-BS4_j6we.js";import"./phases-D5vuSKXE.js";import"./_baseIteratee-DLZas4sG.js";import"./ImageTable-DG1yZaYr.js";import"./uppy_dashboard-DBRda8Tb.js";import"./debounce-EtspMjWp.js";import"./style.min-2_hb6s1z.js";import"./MediaDragPreview-ByvUhh25.js";import"./TableRowActionCheckbox-bF_IpQeh.js";import"./useDeleteFileUpload-BP-mgE7c.js";import"./NestedMenuItem-D35wE-fw.js";import"./useTable-D_wBxHhD.js";import"./VirtualizedTable-CdxK8FqE.js";import"./formatTime-C4LvR0l9.js";import"./utils-C_81NVtf.js";import"./Thumbnail-B511Goxn.js";import"./ClipsFilter-Dl1w7VrN.js";import"./TagsFilterList-oE9g_N-H.js";import"./use-debounce-callback-Dpe5-Ycc.js";import"./index-Dz8B5I4m.js";import"./utils-F2tmHSVX.js";import"./SpaceOutOfBoundsSelector-B1AgDSM0.js";import"./ScalePlayersSelector-B1714IcB.js";import"./virtualization-D318ETKb.js";import"./DisplayOptionsSelector-LzaToS3J.js";import"./checkbox-DZtq1v24.js";import"./FilterChips-k03CiDlL.js";import"./MobileItemDate-CJzO65ws.js";import"./MobileItemTitle-B977gVqN.js";import"./PlayActionsDropdown-Bpq906fO.js";import"./SavingTeamPicker-BKfijbSp.js";import"./PlaygroundSelect-C4Zms5eu.js";import"./createFullPlayAnimation-B4_7WyRe.js";import"./fetch-DBwU5uzv.js";import"./useIsPayingUserV2-1ea6Mwe4.js";import"./PlaysTableSelectedActions-DDgI0u9V.js";import"./tslib.es6-DNoqNiN7.js";import"./index-3IwWtNql.js";import"./simplebar-react.esm-BEXqbx-c.js";import"./ScrollEdgeFade-5BpNif8Z.js";import"./LibraryPlaySort-GtTBHuDR.js";import"./StyledSimpleBar-BBJMU75N.js";import"./useCollapseDrawer-DFJmlba0.js";import"./ScaleAdvancedPDFSelector-6tk1v5DR.js";import"./PDFGenerationContext-CG-RqGcd.js";import"./PlayOutput-AZFLiRVd.js";import"./settings-Ss96qd0q.js";import"./toolbar-Bjy5DQnh.js";import"./FontSizeSelectorV2-DLWtQ50d.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="482e969e-037e-48f9-8150-cfc33eba03cc",t._sentryDebugIdIdentifier="sentry-dbid-482e969e-037e-48f9-8150-cfc33eba03cc")}catch{}})();const An=({expanded:t,anchorRef:e,setExpanded:a,onMenuItemClick:r})=>o(Eo,{placement:"bottom-end",sx:{zIndex:3},open:t,anchorEl:e.current,transition:!0,disablePortal:!0,children:({TransitionProps:n})=>o(Po,{...n,style:{transformOrigin:"right top"},children:o(Ft,{sx:{top:10,mt:"2px"},elevation:8,children:o(Io,{onClickAway:()=>{a(!1)},children:l(To,{id:"split-button-menu",autoFocusItem:!0,children:[l(Q,{onClick:()=>{r("link"),a(!1)},children:[o(et,{sx:{mr:0},children:o(M,{icon:ho})}),o(tt,{children:"Share as Link"})]},3),o(Qe,{}),l(Q,{onClick:()=>{a(!1),r("download")},sx:{py:1},selected:!1,children:[o(et,{sx:{mr:0},children:o(M,{icon:uo})}),o(tt,{children:"Download"})]},4),l(Q,{onClick:()=>{a(!1),r("print")},sx:{py:1},selected:!1,children:[o(et,{sx:{mr:0},children:o(M,{icon:fo})}),o(tt,{children:"Print"})]},5)]})})})})});function Bn(t){const e=x.useRef(),a=x.useRef(),[r,n]=x.useState(!1),[d,h]=x.useState(a),[b,f]=x.use
1State(!1),p=m=>{switch(console.log("onMenuItemClick",m),m){case"link":t.showShareDialog();break;case"print":t.showPrintPreview();break;case"download":t.showPrintPreview();break}},i=m=>{h(m),n(!0)};return l(u,{sx:{display:"flex"},children:[o(eo,{open:b,close:()=>f(!1),title:"Clone First Half?",description:"This will delete any playing times from the second half.",actions:o(ee,{onClick:()=>{t.cloneHalf(),f(!1)},variant:"contained",children:"Clone"})}),o(ie,{ref:e,onClick:()=>{t.isTrial?t.setShowSaveModal("save"):i(e)},color:"light",sx:{display:{xs:"inline-flex",sm:"none"}},children:o(M,{icon:wt,style:{fontSize:20,aspectRatio:1}})}),o(ee,{sx:{display:{xs:"none",sm:"flex"}},onClick:()=>{t.isTrial?t.setShowSaveModal("save"):i(a)},size:"small",color:"light",variant:"outlined",ref:a,children:o(M,{icon:wt,style:{fontSize:24,aspectRatio:1}})}),o(An,{expanded:r,anchorRef:d,setExpanded:n,onMenuItemClick:p})]})}function On(t){var pt,gt,xt,bt,yt,vt,Ct;const e=re.c(125);let a;e[0]!==t.item.play_id?(a={id:t.item.play_id},e[0]=t.item.play_id,e[1]=a):a=e[1];const r=sn(a),n=r.data,d=ce(),[h,b]=x.useState(null),[f,p]=x.useState(null),i=t.objectIndex===0,m=t.objectIndex===(t.objectCount??1)-1,g=(n==null?void 0:n.type)==="drill"?"Drill":"Play";let v;e[2]!==d||e[3]!==t.chapterIndex||e[4]!==t.objectIndex?(v=xe=>{d(Qt({sourceChapter:t.chapterIndex,sourceIndex:t.objectIndex,destinationChapter:t.chapterIndex,destinationIndex:xe})),p(null)},e[2]=d,e[3]=t.chapterIndex,e[4]=t.objectIndex,e[5]=v):v=e[5];const s=v;let _;e[6]!==((pt=n==null?void 0:n.data)==null?void 0:pt.settings)?(_=((gt=n==null?void 0:n.data)==null?void 0:gt.settings)||{},e[6]=(xt=n==null?void 0:n.data)==null?void 0:xt.settings,e[7]=_):_=e[7];let C;e[8]!==t.item.settings?(C=((bt=t.item)==null?void 0:bt.settings)||{},e[8]=t.item.settings,e[9]=C):C=e[9];let j;e[10]!==_||e[11]!==C?(j={..._,...C},e[10]=_,e[11]=C,e[12]=j):j=e[12];const S=j;let T;e[13]===Symbol.for("react.memo_cache_sentinel")?(T=()=>{b(null)},e[13]=T):T=e[13];const D=T,y=!!h,c=r.isError?"error.lighter":"white";let w;e[14]!==c?(w={width:"100%",py:.5,px:1,pr:1,backgroundColor:c,boxShadow:"0 0 0 calc(1px / var(--scale-x, 1)) rgba(63, 63, 68, 0.05), 0 1px calc(3px / var(--scale-x, 1)) 0 rgba(34, 33, 81, 0.15)",borderRadius:.5},e[14]=c,e[15]=w):w=e[15];let R;e[16]===Symbol.for("react.memo_cache_sentinel")?(R={alignItems:"center"},e[16]=R):R=e[16];let L;e[17]===Symbol.for("react.memo_cache_sentinel")?(L={color:"grey.700",py:.5,px:2,display:"flex",alignItems:"center",justifyContent:"center",touchAction:"none"},e[17]=L):L=e[17];let E;e[18]===Symbol.for("react.memo_cache_sentinel")?(E={touchAction:"none"},e[18]=E):E=e[18];let z;e[19]===Symbol.for("react.memo_cache_sentinel")?(z=o(M,{style:{fontSize:20,lineHeight:"24px",cursor:"move",verticalAlign:"middle"},icon:Ve}),e[19]=z):z=e[19];let A;e[20]!==t.dragHandleProps?(A=o(u,{sx:L,...t.dragHandleProps,style:E,children:z}),e[20]=t.dragHandleProps,e[21]=A):A=e[21];let B;e[22]!==n||e[23]!==r.isError?(B=!r.isError&&o(u,{sx:{width:75,height:60,mr:1},children:o(cn,{outline:!1,boxShadow:!1,play:n,width:75,height:60,sidelines:5,onlyShowWhenOnScreen:!0})}),e[22]=n,e[23]=r.isError,e[24]=B):B=e[24];let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($={fontSize:13},e[25]=$):$=e[25];let W;e[26]!==r.error||e[27]!==r.isError?(W=r.isError&&o(st,{severity:"error",children:((vt=(yt=r.error.response)==null?void 0:yt.data)==null?void 0:vt.error)??r.error.message}),e[26]=r.error,e[27]=r.isError,e[28]=W):W=e[28];const U=n==null?void 0:n.title;let O;e[29]!==W||e[30]!==U?(O=l(u,{"data-drag-title":!0,sx:$,children:[W,U]}),e[29]=W,e[30]=U,e[31]=O):O=e[31];let te;e[32]===Symbol.for("react.memo_cache_sentinel")?(te={flex:1,display:"flex",justifyContent:"flex-end",color:"grey.200"},e[32]=te):te=e[32];const X=`${g} actions`;let Y;e[33]===Symbol.for("react.memo_cache_sentinel")?(Y=xe=>p(xe.currentTarget),e[33]=Y):Y=e[33];let J;e[34]===Symbol.for("react.memo_cache_sentinel")?(J=o(F,{sx:{fontSize:20,color:"grey.700"},icon:"eva:more-vertical-fill"}),e[34]=J):J=e[34];let V;e[35]!==X?(V=o(ie,{"aria-label":X,onClick:Y,children:J}),e[35]=X,e[36]=V):V=e[36];let P;e[37]!==d||e[38]!==t.item.uuid?(P=()=>{d(ht(t.item.uuid))},e[37]=d,e[38]=t.item.uuid,e[39]=P):P=e[39];let q;e[40]===Symbol.for("react.memo_cache_sentinel")?(q=o(F,{sx:{fontSize:20,color:"grey.700"}
1,icon:"eva:trash-2-outline"}),e[40]=q):q=e[40];let G;e[41]!==P?(G=o(ie,{onClick:P,children:q}),e[41]=P,e[42]=G):G=e[42];let ae;e[43]!==V||e[44]!==G?(ae=l(u,{sx:te,children:[V,G]}),e[43]=V,e[44]=G,e[45]=ae):ae=e[45];let se;e[46]!==A||e[47]!==B||e[48]!==O||e[49]!==ae?(se=l(de,{sx:R,direction:"row",children:[A,B,O,ae]}),e[46]=A,e[47]=B,e[48]=O,e[49]=ae,e[50]=se):se=e[50];const me=!!f;let fe,pe,ge;e[51]===Symbol.for("react.memo_cache_sentinel")?(fe=()=>p(null),pe={vertical:"bottom",horizontal:"right"},ge={vertical:"top",horizontal:"right"},e[51]=fe,e[52]=pe,e[53]=ge):(fe=e[51],pe=e[52],ge=e[53]);let k;e[54]===Symbol.for("react.memo_cache_sentinel")?(k={width:190,"& .MuiMenuItem-root":{px:1,py:1,fontSize:14,borderRadius:.75,"& svg":{mr:1,width:18,height:18}}},e[54]=k):k=e[54];let N;e[55]!==s?(N=()=>s(0),e[55]=s,e[56]=N):N=e[56];let I;e[57]===Symbol.for("react.memo_cache_sentinel")?(I=o(F,{icon:"eva:arrowhead-up-outline"}),e[57]=I):I=e[57];let H;e[58]!==i||e[59]!==N?(H=l(Q,{disabled:i,onClick:N,children:[I,"Move to Top"]}),e[58]=i,e[59]=N,e[60]=H):H=e[60];let K;e[61]!==s||e[62]!==t.objectIndex?(K=()=>s(t.objectIndex-1),e[61]=s,e[62]=t.objectIndex,e[63]=K):K=e[63];let le;e[64]===Symbol.for("react.memo_cache_sentinel")?(le=o(F,{icon:"eva:arrow-upward-outline"}),e[64]=le):le=e[64];let oe;e[65]!==i||e[66]!==K?(oe=l(Q,{disabled:i,onClick:K,children:[le,"Move Up"]}),e[65]=i,e[66]=K,e[67]=oe):oe=e[67];let ne;e[68]!==s||e[69]!==t.objectIndex?(ne=()=>
1s(t.objectIndex+1),e[68]=s,e[69]=t.objectIndex,e[70]=ne):ne=e[70];let be;e[71]===Symbol.for("react.memo_cache_sentinel")?(be=o(F,{icon:"eva:arrow-downward-outline"}),e[71]=be):be=e[71];let he;e[72]!==m||e[73]!==ne?(he=l(Q,{disabled:m,onClick:ne,children:[be,"Move Down"]}),e[72]=m,e[73]=ne,e[74]=he):he=e[74];let ye;e[75]!==s||e[76]!==t.objectCount||e[77]!==t.objectIndex?(ye=()=>s(t.objectCount??t.objectIndex+1),e[75]=s,e[76]=t.objectCount,e[77]=t.objectIndex,e[78]=ye):ye=e[78];let ze;e[79]===Symbol.for("react.memo_cache_sentinel")?(ze=o(F,{icon:"eva:arrowhead-down-outline"}),e[79]=ze):ze=e[79];let ve;e[80]!==m||e[81]!==ye?(ve=l(Q,{disabled:m,onClick:ye,children:[ze,"Move to Bottom"]}),e[80]=m,e[81]=ye,e[82]=ve):ve=e[82];let Ae;e[83]===Symbol.for("react.memo_cache_sentinel")?(Ae=o(Qe,{sx:{my:.5}}),e[83]=Ae):Ae=e[83];let Ce;e[84]!==f?(Ce=()=>{const xe=f;p(null),b(xe)},e[84]=f,e[85]=Ce):Ce=e[85];let Be;e[86]===Symbol.for("react.memo_cache_sentinel")?(Be=o(F,{icon:"eva:settings-2-outline"}),e[86]=Be):Be=e[86];let we;e[87]!==g||e[88]!==Ce?(we=l(Q,{onClick:Ce,children:[Be,g," Settings"]}),e[87]=g,e[88]=Ce,e[89]=we):we=e[89];let Oe;e[90]===Symbol.for("react.memo_cache_sentinel")?(Oe={textDecoration:"none",color:"inherit"},e[90]=Oe):Oe=e[90];const Xe=po+"?id="+t.item.play_id;let Le,Me;e[91]===Symbol.for("react.memo_cache_sentinel")?(Le=()=>p(null),Me=o(F,{icon:"eva:edit-2-outline"}),e[91]=Le,e[92]=Me):(Le=e[91],Me=e[92]);let ke;e[93]!==g?(ke=l(Q,{onClick:Le,children:[Me,"Edit ",g]}),e[93]=g,e[94]=ke):ke=e[94];let Se;e[95]!==Xe||e[96]!==ke?(Se=o(go,{style:Oe,target:"_blank",rel:"noopener noreferrer",to:Xe,children:ke}),e[95]=Xe,e[96]=ke,e[97]=Se):Se=e[97];let _e;e[98]!==f||e[99]!==me||e[100]!==H||e[101]!==oe||e[102]!==he||e[103]!==ve||e[104]!==we||e[105]!==Se?(_e=l(dt,{open:me,anchorEl:f,onClose:fe,anchorOrigin:pe,transformOrigin:ge,arrow:"top-right",sx:k,children:[H,oe,he,ve,Ae,we,Se]}),e[98]=f,e[99]=me,e[100]=H,e[101]=oe,e[102]=he,e[103]=ve,e[104]=we,e[105]=Se,e[106]=_e):_e=e[106];let He,Fe;e[107]===Symbol.for("react.memo_cache_sentinel")?(He={vertical:"bottom",horizontal:"left"},Fe={vertical:"top",horizontal:"left"},e[107]=He,e[108]=Fe):(He=e[107],Fe=e[108]);let De;e[109]!==d||e[110]!==n||e[111]!==t.item.uuid||e[112]!==S?(De=n&&o(mn,{updateSettings:xe=>{d(Ut({uuid:t.item.uuid,updates:xe}))},play:{...n,data:{...n==null?void 0:n.data,settings:{...(Ct=n==null?void 0:n.data)==null?void 0:Ct.settings,...S}}},onClose:D}),e[109]=d,e[110]=n,e[111]=t.item.uuid,e[112]=S,e[113]=De):De=e[113];let Pe;e[114]!==De?(Pe=o(Ft,{className:"max-h-[80vh] overflow-y-auto",children:De}),e[114]=De,e[115]=Pe):Pe=e[115];let Ie;e[116]!==h||e[117]!==y||e[118]!==Pe?(Ie=o(No,{open:y,anchorEl:h,onClose:D,anchorOrigin:He,transformOrigin:Fe,children:Pe}),e[116]=h,e[117]=y,e[118]=Pe,e[119]=Ie):Ie=e[119];let We;return e[120]!==se||e[121]!==_e||e[122]!==Ie||e[123]!==w?(We=l(u,{sx:w,children:[se,_e,Ie]}),e[120]=se,e[121]=_e,e[122]=Ie,e[123]=w,e[124]=We):We=e[124],We}const Ln=x.memo(On);function Mn(t){const e=re.c(62),a=ce();let r;e[0]!==t?(r=()=>{var O;return(O=t.onOpenFullScreenTextEditor)==null?void 0:O.call(t,t.chapterIndex,t.objectIndex)},e[0]=t,e[1]=r):r=e[1];const n=r;let d;e[2]!==t.item.data||e[3]!==t.item.platejsData?(d=t.item.platejsData??t.item.data??[],e[2]=t.item.data,e[3]=t.item.platejsData,e[4]=d):d=e[4];const h=d;let b;e[5]!==h?(b=Array.isArray(h)?hn(h):!1,e[5]=h,e[6]=b):b=e[6];const f=b;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={width:"100%",py:2,px:1,pr:1,backgroundColor:"white",boxShadow:"0 0 0 calc(1px / var(--scale-x, 1)) rgba(63, 63, 68, 0.05), 0 1px calc(3px / var(--scale-x, 1)) 0 rgba(34, 33, 81, 0.15)",borderRadius:.5,"@media (hover: hover)":{"& .PlaybookPreviewText-editTextBtn":{opacity:0,pointerEvents:"none"},"&:hover .PlaybookPreviewText-editTextBtn, &:focus-within .PlaybookPreviewText-editTextBtn":{opacity:1,pointerEvents:"auto"}}},e[7]=p):p=e[7];let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i={alignItems:"center"},e[8]=i):i=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m={color:"grey.700",py:.5,px:2,display:"flex",alignItems:"center",justifyContent:"center",touchAction:"none"},e[9]=m):m=e[9];let g;
1e[10]===Symbol.for("react.memo_cache_sentinel")?(g={touchAction:"none"},e[10]=g):g=e[10];let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=o(M,{style:{fontSize:20,lineHeight:"24px",cursor:"move",verticalAlign:"middle"},icon:Ve}),e[11]=v):v=e[11];let s;e[12]!==t.dragHandleProps?(s=o(u,{sx:m,...t.dragHandleProps,style:g,children:v}),e[12]=t.dragHandleProps,e[13]=s):s=e[13];let _;e[14]===Symbol.for("react.memo_cache_sentinel")?(_={fontSize:13,flex:1,display:"flex",alignItems:"center"},e[14]=_):_=e[14];let C;e[15]===Symbol.for("react.memo_cache_sentinel")?(C={flex:1},e[15]=C):C=e[15];let j;e[16]===Symbol.for("react.memo_cache_sentinel")?(j={"data-drag-title":"true"},e[16]=j):j=e[16];let S;e[17]!==a||e[18]!==t.chapterIndex||e[19]!==t.objectIndex?(S=O=>{a(Yt({chapterIndex:t.chapterIndex,objectIndex:t.objectIndex,title:O.target.value}))},e[17]=a,e[18]=t.chapterIndex,e[19]=t.objectIndex,e[20]=S):S=e[20];let T;e[21]===Symbol.for("react.memo_cache_sentinel")?(T={flex:1,"& input":{fontSize:14},"&:focus-within":{backgroundColor:"#fff",border:"1px solid",borderColor:"primary.light",px:1}},e[21]=T):T=e[21];let D;e[22]!==t.item.title||e[23]!==S?(D=o(u,{sx:_,children:o(u,{sx:C,children:o(Ke,{fullWidth:!0,disableUnderline:!0,inputProps:j,onChange:S,value:t.item.title,sx:T})})}),e[22]=t.item.title,e[23]=S,e[24]=D):D=e[24];let y;e[25]===Symbol.for("react.memo_cache_sentinel")?(y={display:"flex",alignItems:"center",justifyContent:"flex-end",color:"grey.200"},e[25]=y):y=e[25];let c;e[26]!==a||e[27]!==t.chapterIndex||e[28]!==t.item.expanded||e[29]!==t.objectIndex?(c=t.item.expanded&&o(ie,{onClick:()=>{a(Qo({chapterIndex:t.chapterIndex,objectIndex:t.objectIndex}))},children:o(F,{sx:{fontSize:20,color:"grey.700"},icon:"eva:minus-square-outline"})}),e[26]=a,e[27]=t.chapterIndex,e[28]=t.item.expanded,e[29]=t.objectIndex,e[30]=c):c=e[30];let w;e[31]!==a||e[32]!==t.chapterIndex||e[33]!==t.item.expanded||e[34]!==t.objectIndex?(w=!t.item.expanded&&o(ie,{onClick:()=>{a(Yo({chapterIndex:t.chapterIndex,objectIndex:t.objectIndex}))},children:o(F,{sx:{fontSize:20,color:"grey.700"},icon:"eva:plus-square-outline"})}),e[31]=a,e[32]=t.chapterIndex,e[33]=t.item.expanded,e[34]=t.objectIndex,e[35]=w):w=e[35];let R;e[36]===Symbol.for("react.memo_cache_sentinel")?(R=o(F,{sx:{fontSize:20,color:"grey.700"},icon:"eva:edit-2-outline"}),e[36]=R):R=e[36];let L;e[37]!==n?(L=o(ie,{"aria-label":"Edit text",onClick:n,children:R}),e[37]=n,e[38]=L):L=e[38];let E;e[39]!==a||e[40]!==t.item.uuid?(E=()=>{a(ht(t.item.uuid))},e[39]=a,e[40]=t.item.uuid,e[41]=E):E=e[41];let z;e[42]===Symbol.for("react.memo_cache_sentinel")?(z=o(F,{sx:{fontSize:20,color:"grey.700"},icon:"eva:trash-2-outline"}),e[42]=z):z=e[42];let A;e[43]!==E?(A=o(ie,{onClick:E,children:z}),e[43]=E,e[44]=A):A=e[44];let B;e[45]!==c||e[46]!==w||e[47]!==L||e[48]!==A?(B=l(u,{sx:y,children:[c,w,L,A]}),e[45]=c,e[46]=w,e[47]=L,e[48]=A,e[49]=B):B=e[49];let $;e[50]!==D||e[51]!==B||e[52]!==s?($=l(de,{sx:i,direction:"row",children:[s,D,B]}),e[50]=D,e[51]=B,e[52]=s,e[53]=$):$=e[53];let W;e[54]!==h||e[55]!==n||e[56]!==f||e[57]!==t.item.expanded?(W=t.item.expanded&&o(u,{sx:{mx:-1,mt:1,mb:-.5,borderTop:"1px solid #e0e0e0",position:"relative"},children:f?l(u,{sx:{minHeight:120,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1.5,px:2,py:2},children:[o(u,{sx:{fontSize:13,color:"grey.600",textAlign:"center"},children:"This text paragraph is empty."}),o(ee,{size:"small",variant:"contained",color:"primary",startIcon:o(F,{icon:"eva:edit-2-outline"}),onClick:n,sx:{boxShadow:"none"},children:"Edit Text"})]}):l(Re,{children:[o(u,{sx:{maxHeight:"500px",overflow:"auto",px:typeof h=="string"?"20px":0,py:typeof h=="string"?1.5:0},children:o(ut,{readOnly:!0,variant:"playbookPreviewText",className:"px-[20px]",initialContent:h,playNode:{enabled:!0,showCurrentPlay:!1,showLibrary:!0},phaseNode:{enabled:!0,showCurrentPlay:!1,showLibrary:!0}})}),o(ee,{className:"PlaybookPreviewText-editTextBtn",size:"small",variant:"contained",color:"primary",startIcon:o(F,{icon:"eva:edit-2-outline"}),onClick:n,sx:{position:"absolute",right:"30px",bottom:"10px",zIndex:1},children:"Edit Text"})]})}),e[54]=h,e[55]=n,e[56]=f,e[57]=t.item.expanded,e[58]=W):W=e[58];let U;return e[59]!==$||e[60]!==W?(U=l(u,{sx:p,children:[$,W]}),e[59]=$,e[60]=W,e[61]=U):U=e[61],U}const Hn=x.memo(Mn);function Fn(t){const e=re.c(20),a=ce();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={margin:"0px auto 50px auto ",width:"90%",py:.5,px:1,pr:1,backgroundColor:"white",boxShadow:"0 0 0 calc(1px / var(--scale-x, 1)) rgba(63, 63, 68, 0.05), 0 1px calc(3px / var(--scale-x, 1)) 0 rgba(34, 33, 81, 0.15)",borderRadius:.5},e[0]=r):r=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n={alignItems:"center"},e[1]=n):n=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d={color:"grey.700",py:.5,px:2,display:"flex",alignItems:"center",justifyContent:"center",touchAction:"none"},e[2]=d):d=e[2];let h;e[3]===Symbol.for("react.memo_cache_sentinel")?(h={touchAction:"none"},e[3]=h):h=e[3];let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=o(M,{style:{fontSize:20,lineHeight:"24px",cursor:"move",verticalAlign:"middle"},icon:Ve}),e[4]=b):b=e[4];let f;e[5]!==t.dragHandleProps?(f=o(u,{sx:d,...t.dragHandleProps,style:h,children:b}),e[5]=t.dragHandleProps,e[6]=f):f=e[6];let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p={fontSize:13,flex:1,display:"flex",alignItems:"center",justifyContent:"center",position:"relative",color:"grey.700"},e[7]=p):p=e[7];let i;e[8]===Symbol.for("react.memo_cache_sentinel")?(i=o(u,{sx:{position:"absolute",width:"80%",height:"2px",backgroundColor:"grey.700",top:"50%",transform:"translateY(-50%)"}}),e[8]=i):i=e[8];let m;e[9]===Symbol.for("react.memo_cache_sentinel")?(m=l(u,{sx:p,children:[i,o(u,{"data-drag-title":!0,sx:{position:"relative",backgroundColor:"white",padding:"0 10px",zIndex:1},children:"Page Break"})]}),e[9]=m):m=e[9];let g;
1e[10]===Symbol.for("react.memo_cache_sentinel")?(g={display:"flex",justifyContent:"flex-end",color:"grey.200"},e[10]=g):g=e[10];let v;e[11]!==a||e[12]!==t.item.uuid?(v=()=>{a(ht(t.item.uuid))},e[11]=a,e[12]=t.item.uuid,e[13]=v):v=e[13];let s;e[14]===Symbol.for("react.memo_cache_sentinel")?(s=o(F,{sx:{fontSize:20,color:"grey.700"},icon:"eva:trash-2-outline"}),e[14]=s):s=e[14];let _;e[15]!==v?(_=o(u,{sx:g,children:o(ie,{onClick:v,children:s})}),e[15]=v,e[16]=_):_=e[16];let C;return e[17]!==_||e[18]!==f?(C=o(u,{sx:r,children:l(de,{sx:n,direction:"row",children:[f,m,_]})}),e[17]=_,e[18]=f,e[19]=C):C=e[19],C}const Wn=x.memo(Fn);var to={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"combine",{enumerable:!0,get:function(){return e.combine}});var e=fn()})(to);function oo(t){const e=re.c(8),{label:a,minHeight:r}=t,n=r===void 0?null:r;let d;e[0]!==n?(d={padding:"8px 12px",background:"white",borderRadius:8,boxShadow:"0 6px 16px rgba(0,0,0,0.25)",display:"inline-flex",alignItems:"center",width:"fit-content",...n?{minHeight:n,boxSizing:"border-box"}:{},fontFamily:'"Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},e[0]=n,e[1]=d):d=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h={fontSize:14,fontWeight:600,color:"#212B36",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:220},e[2]=h):h=e[2];let b;e[3]!==a?(b=o("div",{style:h,children:a}),e[3]=a,e[4]=b):b=e[4];let f;return e[5]!==d||e[6]!==b?(f=o("div",{style:d,children:b}),e[5]=d,e[6]=b,e[7]=f):f=e[7],f}function no({container:t,label:e,minHeight:a}){const r=Ot.createRoot(t);return Wt.flushSync(()=>{r.render(o(oo,{label:e,minHeight:a}))}),()=>r.unmount()}const Z={play:"play",chapterObject:"chapterObject",chapter:"chapter",newBlock:"newBlock"},Ze=t=>{const e=(t==null?void 0:t.data)??{};return e.kind===Z.play||e.kind===Z.chapterObject||e.kind===Z.newBlock&&e.blockType!=="chapter"},Ye=t=>{const e=(t==null?void 0:t.data)??{};return e.kind===Z.chapter||e.kind===Z.newBlock&&e.blockType==="chapter"},$n=t=>Ze(t)||Ye(t);let ro=0;const rt=()=>{ro=Date.now()},qn=()=>Date.now()-ro<400,Gn={[Z.play]:72,[Z.newBlock]:52,[Z.chapterObject]:72},Un=t=>{var n;const e=(t==null?void 0:t.data)??{};if(typeof((n=e.rect)==null?void 0:n.height)=="number"&&e.rect.height>0)return e.rect.height;const a=Gn[e.kind]??60,r=Array.isArray(e.ids)?e.ids.length:1;return a*Math.max(1,Math.min(r,4))},Qn={play:"Play",text:"Text paragraph",pageBreak:"Page break"};function it(t){const e=re.c(5),{height:a,edge:r}=t;let n;e[0]!==r?(n=r==="top"?{mb:2}:r==="bottom"?{mt:2}:{},e[0]=r,e[1]=n):n=e[1];let d;return e[2]!==a||e[3]!==n?(d=o(u,{sx:{height:a,flexShrink:0,...n}}),e[2]=a,e[3]=n,e[4]=d):d=e[4],d}const Ge={type:"idle"},Yn=(t,e)=>t.type===e.type&&t.edge===e.edge&&t.shadowHeight===e.shadowHeight;function Vn({uuid:t,chapterIndex:e,objectIndex:a,objectType:r,item:n,registerFlipNode:d,children:h}){const b=x.useRef(null),f=x.useRef(null),p=x.useRef({ref:f}).current,[i,m]=x.useState(Ge),g=Lt(),v=x.useRef(n);v.current=n;const s=x.useRef(g);s.current=g;const _=r!=="text";return x.useEffect(()=>{const C=b.current,j=f.current;if(!C||!j)return;const S=y=>{const c=C.getBoundingClientRect();return y.clientY<c.top+c.height/2?"top":"bottom"},T=(y,c)=>({type:"is-over",edge:S(c),shadowHeight:Un(y)}),D=y=>{var c,w;return((c=y.data)==null?void 0:c.kind)===Z.chapterObject&&((w=y.data)==null?void 0:w.uuid)===t};return to.combine(ue.draggable({element:C,..._?{}:{dragHandle:j},getInitialData:()=>({kind:Z.chapterObject,uuid:t,sourceChapter:e,sourceIndex:a,rect:C.getBoundingClientRect()}),onGenerateDragPreview:({nativeSetDragImage:y})=>{var z;const c=C.getBoundingClientRect().height,w=C.querySelector("[data-drag-title]"),L=(w&&("value"in w?w.value:w.textContent)||Qn[r]||"Item").trim().slice(0,60)||"Item",E=r==="play"&&((z=v.current)!=null&&z.play_id)?s.current.getQueryData(["play",v.current.play_id]):null;ft.setCustomNativeDragPreview({nativeSetDragImage:y,getOffset:()=>({x:12,y:12}),render:({container:A})=>{const B=Ot.createRoot(A);return Wt.flushSync(()=>{B.render(E?o(pn,{play:E,thumbnailWidth:75,thumbnailHeight:60,minHeight:c}):o(oo,{label:L,minHeight:68}))}),()=>B.unmount()}})},onDragStart:()=>m({type:"is-dragging",height:C.getBoundingClientRect().height}),onDrop:()=>m(Ge)}),ue.dropTargetForElements({element:C,getIsSticky:()=>!0,canDrop:({source:y})=>Ze(y),getData:({input:y})=>({type:"chapterObjectDrop",chapterIndex:e,objectIndex:a,edge:S(y)}),onDragEnter:({source:y,location:c})=>{D(y)||m(T(y,c.current.input))},onDrag:({source:y,location:c})=>{if(D(y))return;const w=T(y,c.current.input);m(R=>Yn(R,w)?R:w)},onDragLeave:({source:y})=>{if(D(y)){m({type:"is-dragging-and-left-self"});return}m(Ge)},onDrop:()=>m(Ge)}))},[t,e,a,r,_]),l(u,{ref:C=>{b.current=C,d==null||d(t,C)},sx:{my:1,display:i.type==="is-dragging-and-left-self"?"none":"block"},children:[i.type==="is-over"&&i.edge==="top"&&o(it,{height:i.shadowHeight,edge:"top"}),i.type==="is-dragging"&&o(it,{height:i.height}),o(u,{sx:{display:i.type==="is-dragging"?"none":"block"},children:h(p)}),i.type==="is-over"&&i.edge==="bottom"&&o(it,{height:i.shadowHeight,edge:"bottom"})]})}function Kn(){const t=re.c(5);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=new Map,t[0]=e):e=t[0];const a=x.useRef(e);let r;t[1]===Symbol.for("react.memo_cache_sentinel")?(r=new Map,t[1]=r):r=t[1];const n=x.useRef(r),d=x.useRef(null);let h;t[2]===Symbol.for("react.memo_cache_sentinel")?(h=(i,m)=>{m?a.current.set(i,m):a.current.delete(i)},t[2]=h):h=t[2];const b=h;let f;t[3]===Symbol.for("react.memo_cache_sentinel")?(f=()=>
1{const i=d.current,m=i?i.getBoundingClientRect().top:0,g=n.current,v=new Map,_=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches||qn();a.current.forEach((C,j)=>{if(!C.isConnected)return;const S=C.getBoundingClientRect();if(S.height===0)return;const T=S.top-m;v.set(j,T);const D=g.get(j);if(D===void 0||_)return;const y=D-T;Math.abs(y)<2||typeof C.animate=="function"&&C.animate([{transform:`translateY(${y}px)`},{transform:"translateY(0)"}],{duration:220,easing:"cubic-bezier(0.2, 0, 0, 1)"})}),n.current=v},t[3]=f):f=t[3],x.useLayoutEffect(f);let p;return t[4]===Symbol.for("react.memo_cache_sentinel")?(p={registerFlipNode:b,flipContainerRef:d},t[4]=p):p=t[4],p}function io(t=[]){const e={play:0,text:0,pageBreak:0};t.forEach(r=>{e[r.type]!==void 0&&(e[r.type]+=1)});const a=[];return e.play&&a.push(e.play===1?"1 play":`${e.play} plays`),e.text&&a.push(e.text===1?"1 text paragraph":`${e.text} text paragraphs`),e.pageBreak&&a.push(e.pageBreak===1?"1 page break":`${e.pageBreak} page breaks`),a.length>0?a.join(", "):"Empty chapter"}/*! 2 * Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com 3 * License - https://fontawesome.com/license (Commercial License) 4 * Copyright 2024 Fonticons, Inc. 5 */const ao={prefix:"fal",iconName:"file-dashed-line",icon:[640,512,["page-break"],"f877","M480 448c0 17.7-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32l0-96-32 0 0 96c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-96-32 0 0 96zm0-256l0 64 32 0 0-92.1c0-12.7-5.1-24.9-14.1-33.9L382.1 14.1c-9-9-21.2-14.1-33.9-14.1L192 0c-35.3 0-64 28.7-64 64l0 192 32 0 0-192c0-17.7 14.3-32 32-32l128 0 0 112c0 26.5 21.5 48 48 48l112 0zm-.5-32L368 160c-8.8 0-16-7.2-16-16l0-111.5c2.8 .7 5.4 2.1 7.4 4.2L475.3 152.6c2.1 2.1 3.5 4.6 4.2 7.4zM48 288c-8.8 0-16 7.2-16 16s7.2 16 16 16l128 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L48 288zm224 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l96 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-96 0zm192 0c-8.8 0-16 7.2-16 16s7.2 16 16 16l128 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-128 0z"]},zt={prefix:"fal",iconName:"memo",icon:[384,512,[],"e1d8","M64 32C46.3 32 32 46.3 32 64l0 384c0 17.7 14.3 32 32 32l256 0c17.7 0 32-14.3 32-32l0-384c0-17.7-14.3-32-32-32L64 32zM0 64C0 28.7 28.7 0 64 0L320 0c35.3 0 64 28.7 64 64l0 384c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 64zm80 64l224 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 160c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 96l224 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 256c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 96l128 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L80 352c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]},lo={prefix:"fal",iconName:"align-left",icon:[448,512,[],"f036","M16 48C7.2 48 0 55.2 0 64s7.2 16 16 16l256 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L16 48zm0 128c-8.8 0-16 7.2-16 16s7.2 16 16 16l416 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L16 176zM0 320c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L16 304c-8.8 0-16 7.2-16 16zM16 432c-8.8 0-16 7.2-16 16s7.2 16 16 16l416 0c8.8 0 16-7.2 16-16s-7.2-16-16-16L16 432z"]};function Zn(t){const e=re.c(11),{chapterIndex:a,children:r,sx:n}=t,d=x.useRef(null),[h,b]=x.useState(!1);let f,p;e[0]!==a?(f=()=>{const v=d.current;if(v)return ue.dropTargetForElements({element:v,canDrop:Xn,getData:()=>({type:"chapterEmptyDrop",chapterIndex:a}),onDragEnter:()=>b(!0),onDragLeave:()=>b(!1),onDrop:()=>b(!1)})},p=[a],e[0]=a,e[1]=f,e[2]=p):(f=e[1],p=e[2]),x.useEffect(f,p);let i;e[3]!==h?(i=h?{backgroundColor:"rgb(204, 247, 224)"}:{},e[3]=h,e[4]=i):i=e[4];let m;e[5]!==n||e[6]!==i?(m={position:"relative",...i,...n},e[5]=n,e[6]=i,e[7]=m):m=e[7];let g;return e[8]!==r||e[9]!==m?(g=o(u,{ref:d,sx:m,children:r}),e[8]=r,e[9]=m,e[10]=g):g=e[10],g}function Xn(t){const{source:e}=t;return Ze(e)}function Jn(t){const e=re.c(6),{chapterIndex:a,expandChapter:r,children:n}=t,d=x.useRef(null),h=x.useRef(null);let b,f;e[0]!==a||e[1]!==r?(b=()=>{const i=d.current;if(!i)return;const m=()=>{h.current&&(clearTimeout(h.current),h.current=null)},g=ue.dropTargetForElements({element:i,canDrop:er,getData:()=>({type:"chapterCollapsedDrop",chapterIndex:a}),onDragEnter:()=>{m(),h.current=setTimeout(r,400)},onDragLeave:m,onDrop:m});return()=>{m(),g()}},f=[a,r],e[0]=a,e[1]=r,e[2]=b,e[3]=f):(b=e[2],f=e[3]),x.useEffect(b,f);let p;return e[4]!==n?(p=o(u,{ref:d,children:n}),e[4]=n,e[5]=p):p=e[5],p}function er(t){const{source:e}=t;return Ze(e)}function tr({smallScreen:t=!1,showAddPlayDialog:e=()=>{},onOpenFullScreenTextEditor:a=()=>{},...r}){const n=ce(),[d,h]=x.useState(null),b=c=>{h(c.currentTarget)},f=()=>{h(null)}
5,p=mt(),i=!!r.item.collapsed,m=x.useCallback(()=>{n(je(r.index))},[n,r.index]),[g,v]=x.useState(null),s=r.index===0,_=r.index===(r.chapterCount??1)-1,C=c=>{n(Zt({sourceChapter:r.index,destinationChapter:c})),v(null)},{registerFlipNode:j,flipContainerRef:S}=Kn(),[T,D]=x.useState(i);x.useEffect(()=>{i||D(!1)},[i]);const y=io(r.item.objects);return l(u,{sx:{width:"100%",pl:{xs:2,sm:4},pr:{xs:0,sm:2},pt:3,pb:i?2.5:4,transition:"padding-bottom 225ms cubic-bezier(0.4, 0, 0.2, 1)",backgroundColor:"grey.100",borderColor:"divider",borderWidth:{xs:"1px 0",sm:"1px"},borderStyle:"solid",borderRadius:{xs:0,sm:.5}},children:[l(de,{direction:"row",sx:{alignItems:"center"},children:[l(u,{sx:{pr:.5,lineHeight:"32px",fontWeight:600,fontSize:16,pt:"4px",pb:"5px"},children:[r.index+1,"."]}),o(u,{sx:{flex:1,pr:2,pl:.5},children:o(Ke,{fullWidth:!0,disableUnderline:!0,onChange:c=>n(Vo({chapterIndex:r.index,title:c.target.value})),sx:{"& input":{fontWeight:600,fontSize:16},"&:focus-within":{backgroundColor:"#fff",border:"1px solid",borderColor:"primary.light",px:2}},value:r.item.title})}),l(u,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end"},children:[o(ie,{"aria-label":"Chapter actions",onClick:c=>v(c.currentTarget),children:o(F,{sx:{color:"text.primary",fontSize:22},icon:"eva:more-vertical-fill"})}),l(dt,{open:!!g,anchorEl:g,onClose:()=>v(null),anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},arrow:"top-right",sx:{width:200,"& .MuiMenuItem-root":{px:1,py:1,fontSize:14,borderRadius:.75,"& svg":{mr:1,width:18,height:18}}},children:[l(Q,{disabled:s,onClick:()=>C(0),children:[o(F,{icon:"eva:arrowhead-up-outline"}),"Move to Top"]}),l(Q,{disabled:s,onClick:()=>C(r.index-1),children:[o(F,{icon:"eva:arrow-upward-outline"}),"Move Up"]}),l(Q,{disabled:_,onClick:()=>C(r.index+1),children:[o(F,{icon:"eva:arrow-downward-outline"}),"Move Down"]}),l(Q,{disabled:_,onClick:()=>C(r.chapterCount??r.index+1),children:[o(F,{icon:"eva:arrowhead-down-outline"}),"Move to Bottom"]}),o(Qe,{sx:{my:.5}}),l(Q,{onClick:()=>{n(je(r.index)),v(null)},children:[o(F,{icon:i?"eva:plus-square-outline":"eva:minus-square-outline"}),i?"Expand Chapter":"Collapse Chapter"]}),o(Qe,{sx:{my:.5}}),l(Q,{sx:{color:"error.main"},onClick:()=>{v(null),n(Ko(r.index))},children:[o(F,{icon:"eva:trash-2-outline"}),"Delete Chapter"]})]}),o(u,{sx:{my:-2,p:2,color:"text.primary",touchAction:"none"},...r.dragHandleProps,style:{touchAction:"none"},children:o(M,{style:{fontSize:22,lineHeight:"22px",cursor:"move",verticalAlign:"middle"},icon:Ve})})]})]}),l(u,{children:[l(u,{sx:{mr:2},children:[o(ot,{in:i,timeout:"auto",mountOnEnter:!0,unmountOnExit:!0,children:o(Jn,{chapterIndex:r.index,expandChapter:m,children:l(u,{onClick:m,sx:{mt:1,py:.5,display:"flex",alignItems:"center",gap:.75,fontSize:13,color:"grey.600",cursor:"pointer","&:hover":{color:"grey.800"},opacity:T?1:0,transition:"opacity 160ms ease"},children:[o(F,{sx:{fontSize:16},icon:"eva:plus-square-outline"}),y]})})}),o(ot,{in:!i,timeout:"auto",mountOnEnter:!0,unmountOnExit:!0,onExited:()=>D(!0),children:l(u,{sx:{mt:2,display:"flex",flexDirection:"column"},ref:S,children:[r.item.objects.length===0&&o(Zn,{chapterIndex:r.index,sx:{border:t?"1px solid #ccc":"1px dashed grey",height:100,backgroundColor:$t(p.palette.primary.main,.2),display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,px:3,fontWeight:600,color:p.palette.primary.darker},children:t?"This chapter is empty, add first object below.":"Drag & Drop Objects Here"}),r.item.objects.map((c,w)=>o(Vn,{uuid:c.uuid,chapterIndex:r.index,objectIndex:w,objectType:c.type,item:c,registerFlipNode:j,children:R=>l(Re,{children:[c.type==="play"&&o(Ln,{chapterIndex:r.index,objectIndex:w,objectCount:r.item.objects.length,dragHandleProps:R,item:c}),c.type==="text"&&o(Hn,{chapterIndex:r.index,objectIndex:w,dragHandleProps:R,item:c,onOpenFullScreenTextEditor:a}),c.type==="pageBreak"&&o(Wn,{chapterIndex:r.index,objectIndex:w,dragHandleProps:R,item:c})]})},c.uuid))]})})]}),o(ot,{in:!i,timeout:"auto",mountOnEnter:!0,unmountOnExit:!0,children:l(de,{sx:{mt:{xs:4,md:2}},direction:"row",children:[o(ee,{color:"dark",size:t?"medium":"small",sx:{boxShadow:"none",background:"#fff",color:"grey.700"},onClick:b,startIcon:o(M,{style:{fontSize:14},icon:xo}),variant:"outlined",children:"Add Block"}),l(dt,{open:!!d,anchorEl:d,onClose:f,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},arrow:"top-left",sx:{width:180,"& .MuiMenuItem-root":{px:1,py:1,fontSize:14,borderRadius:.75,"& svg":{mr:1,width:16,height:16}}},children:[l(Q,{onClick:()=>{e(r.index,"play"),f()},children:[o(M,{icon:kt}),"Add Play"]}),l(Q,{onClick:()=>{e(r.index,"drill"),f()},children:[o(M,{icon:kt}),"Add Drill"]}),l(Q,{onClick:()=>
5{n(Vt({destinationChapter:r.index,index:r.item.objects.length})),f()},children:[o(M,{icon:lo}),"Add Text"]}),l(Q,{onClick:()=>{n(Kt({destinationChapter:r.index,index:r.item.objects.length})),f()},children:[o(M,{icon:ao}),"Add Page Break"]})]})]})})]})]})}const or=x.memo(tr);function nr({scrollElementRef:t,onDragActivityChange:e,onChapterDragActivityChange:a}={}){const r=ce(),n=x.useRef(r);n.current=r;const d=x.useRef(e);d.current=e;const h=x.useRef(a);h.current=a,x.useEffect(()=>ue.monitorForElements({canMonitor:({source:b})=>$n(b),onDragStart:({source:b})=>{var f,p;(f=d.current)==null||f.call(d,!0),Ye(b)&&((p=h.current)==null||p.call(h,!0))},onDrop:({source:b,location:f})=>{var s,_,C,j,S,T,D;(s=d.current)==null||s.call(d,!1),Ye(b)&&((_=h.current)==null||_.call(h,!1));const p=f.current.dropTargets[0];if(!p)return;const i=p.data;if((i==null?void 0:i.type)==="chapterReorderDrop"){const y=i.edge==="bottom"?i.chapterIndex+1:i.chapterIndex;if(((C=b.data)==null?void 0:C.kind)===Z.chapter){const c=b.data.sourceIndex;let w=y;if(y>c&&(w=y-1),w===c)return;rt(),n.current(Zt({sourceChapter:c,destinationChapter:w}))}else((j=b.data)==null?void 0:j.kind)===Z.newBlock&&(rt(),n.current(Xt({destinationChapter:y})));return}if((i==null?void 0:i.type)!=="chapterEmptyDrop"&&(i==null?void 0:i.type)!=="chapterObjectDrop"&&(i==null?void 0:i.type)!=="chapterCollapsedDrop")return;const m=i.chapterIndex,g=i.type==="chapterCollapsedDrop"?Number.MAX_SAFE_INTEGER:i.type==="chapterEmptyDrop"?0:i.edge==="bottom"?i.objectIndex+1:i.objectIndex,v=(S=b.data)==null?void 0:S.kind;if(rt(),v===Z.play){const y=(T=b.data)==null?void 0:T.ids;if(!Array.isArray(y)||y.length===0)return;y.length===1?n.current(Jt({play_id:y[0],destinationChapter:m,index:g})):n.current(ct({plays:y,destinationChapter:m,index:g}))}else if(v===Z.chapterObject){const{sourceChapter:y,sourceIndex:c}=b.data;let w=g;if(y===m&&g>c&&(w=g-1),y===m&&w===c)return;n.current(Qt({sourceChapter:y,sourceIndex:c,destinationChapter:m,destinationIndex:w}))}else if(v===Z.newBlock){const y=(D=b.data)==null?void 0:D.blockType;if(y==="text")n.current(Vt({destinationChapter:m,index:g}));else if(y==="pageBreak")n.current(Kt({destinationChapter:m,index:g}));else return}else return;i.type==="chapterCollapsedDrop"&&n.current(je(m))}}),[]),x.useEffect(()=>bn(),[]),x.useEffect(()=>{var p;const b=t==null?void 0:t.current,f=(p=b==null?void 0:b.closest)==null?void 0:p.call(b,".simplebar-content-wrapper");if(f)return yn({element:f})},[t])}const so=x.createContext(!1),rr=so.Provider,ir=()=>x.useContext(so),co=x.createContext(!1),ar=co.Provider,lr=()=>x.useContext(co);function at(t){const e=re.c(9),{blockType:a,previewLabel:r,children:n}=t,d=x.useRef(null),[h,b]=x.useState(!1);let f,p;e[0]!==a||e[1]!==r?(f=()=>{const v=d.current;if(v)return ue.draggable({element:v,getInitialData:()=>({kind:Z.newBlock,blockType:a}),onGenerateDragPreview:s=>{const{nativeSetDragImage:_}=s;ft.setCustomNativeDragPreview({nativeSetDragImage:_,getOffset:sr,render:C=>{const{container:j}=C;return no({container:j,label:r??a})}})},onDragStart:()=>b(!0),onDrop:()=>b(!1)})},p=[a,r],e[0]=a,e[1]=r,e[2]=f,e[3]=p):(f=e[2],p=e[3]),x.useEffect(f,p);const i=h?.5:1;let m;e[4]!==i?(m={opacity:i,cursor:"grab"},e[4]=i,e[5]=m):m=e[5];let g;return e[6]!==n||e[7]!==m?(g=o(u,{ref:d,sx:m,children:n}),e[6]=n,e[7]=m,e[8]=g):g=e[8],g}function sr(){return{x:12,y:12}}const cr=80,dr=16,At=new Map,Ne={type:"idle"},mr=(t,e)=>t.type===e.type&&t.edge===e.edge;function hr({uuid:t,chapterIndex:e,title:a,summary:r,estimatedHeight:n=400,children:d}){const h=x.useRef(null),b=x.useRef(null),f=x.useRef({ref:b}).current,[p,i]=x.useState(Ne),m=x.useRef(a);m.current=a;const g=vn(),{elementRef:v,isIntersecting:s}=dn({root:g,rootMargin:"1600px",threshold:0,freezeOnceVisible:!1}),_=typeof window<"u"&&window.__playbookForceMountChapters===!0,C=ir(),[j,S]=x.useState(!1);x.useEffect(()=>{if(!C||!s){S(s);return}const c=setTimeout(()=>S(!0),250);return()=>clearTimeout(c)},[s,C]);const T=j||_,D=lr(),y=x.useRef(!1);return x.useLayoutEffect(()=>{var c,w;if(D&&p.type==="is-dragging"&&!y.current){y.current=!0,(c=h.current)==null||c.scrollIntoView({block:"center"});return}!D&&y.current&&(y.current=!1,(w=h.current)==null||w.scrollIntoView({block:"center"}))},[D,p.type]),x.useEffect(()=>{D||i(c=>c.type==="idle"?c:Ne)},[D]),x.useLayoutEffect(()=>{if(!T)return;const c=h.current;c&&c.offsetHeight>0&&At.set(t,c.offsetHeight)}),x.useEffect(()=>{const c=h.current;if(!c)return;const w=E=>{const z=c.getBoundingClientRect();return E.clientY<z.top+z.height/2?"top":"bottom"},R=E=>{var z,A;return((z=E.data)==null?void 0:z.kind)===Z.chapter&&((A=E.data)==null?void 0:A.uuid)===t},L=E=>({type:"is-over",edge:w(E)});return ue.dropTargetForElements({element:c,getIsSticky:()=>!0,canDrop:({source:E})=>Ye(E),getData:({input:E})=>({type:"chapterReorderDrop",chapterIndex:e,edge:w(E)}),onDragEnter:({source:E,location:z})=>{R(E)||i(L(z.current.input))},onDrag:({source:E,location:z})=>{if(R(E))return;const A=L(z.current.input);i(B=>mr(B,A)?B:A)},onDragLeave:({source:E})=>{R(E)||i(Ne)},onDrop:()=>i(Ne)})},[t,e]),x.useEffect(()=>{const c=h.current,w=b.current;if(!(!c||!w))return ue.draggable({element:c,dragHandle:w,getInitialData:()=>({kind:Z.chapter,uuid:t,sourceIndex:e}),onGenerateDragPreview:({nativeSetDragImage:R})=>{ft.setCustomNativeDragPreview({nativeSetDragImage:R,getOffset:()=>({x:12,y:12}),render:({container:L})=>no({container:L,label:m.current||"Untitled chapter"})})},onDragStart:()=>i({type:"is-dragging"}),onDrop:()=>i(Ne)})},[t,e,T,D]),D?l(u,{ref:c=>{h.current=c,v.current=c},sx:{position:"relative"},children:[p.type==="is-over"&&o(u,{sx:{position:"absolute",left:0,right:0,height:3,borderRadius:1,backgroundColor:"primary.main",zIndex:2,pointerEvents:"none",...p.edge==="top"?{top:"-9.5px"}:{bottom:"-9.5px"}}}),l(u,{sx:{height:cr,mb:`${dr}px`,boxSizing:"border-box",px:{xs:2,sm:4},py:1.5,backgroundColor:"grey.100",border:"1px solid",borderColor:"divider",borderRadius:.5,overflow:"hidden",opacity:p.type==="is-dragging"?.4:1},children:[l(u,{sx:{fontWeight:600,fontSize:16,color:"text.primary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}
5,children:[e+1,". ",a]}),o(u,{sx:{mt:.5,fontSize:13,color:"grey.600",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:r})]})]}):o(u,{ref:c=>{h.current=c,v.current=c},sx:{position:"relative"},children:T?o(u,{sx:{opacity:p.type==="is-dragging"?.4:1},children:d(f)}):o(u,{sx:{height:At.get(t)??n,boxSizing:"border-box",pt:e===0?0:2.5,pb:2.5},children:l(u,{sx:{height:"100%",boxSizing:"border-box",backgroundColor:"grey.100",border:"1px solid",borderColor:"divider",borderRadius:.5,overflow:"hidden",pt:3,pl:{xs:2,sm:4},pr:2,display:"flex",flexDirection:"column"},children:[l(u,{sx:{fontWeight:600,fontSize:16,color:"text.primary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[e+1,". ",a]}),o(u,{sx:{flex:1,mt:3,mr:2,backgroundImage:"repeating-linear-gradient(to bottom, #fff 0px, #fff 68px, transparent 68px, transparent 84px)"}})]})})})}const lt=t=>{const e=re.c(10);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={xs:160,lg:180},e[0]=a):a=e[0];let r;e[1]===Symbol.for("react.memo_cache_sentinel")?(r={boxShadow:"0px 1px 4px rgba(31, 33, 41, 0.5)"},e[1]=r):r=e[1];let n;e[2]!==t.sx?(n={fontSize:14,mr:2,my:1,width:a,p:1.5,px:2,backgroundColor:"white",boxShadow:"0px 1px 4px rgba(31, 33, 41, 0.3)",borderRadius:.5,...t.sx,"&:hover":r},e[2]=t.sx,e[3]=n):n=e[3];let d;e[4]!==t.icon?(d=t.icon&&o(u,{sx:{display:"inline",fontSize:18,mr:.5},children:t.icon}),e[4]=t.icon,e[5]=d):d=e[5];let h;return e[6]!==t.title||e[7]!==n||e[8]!==d?(h=l(u,{className:"draggable",sx:n,children:[d,t.title]}),e[6]=t.title,e[7]=n,e[8]=d,e[9]=h):h=e[9],h};function ur(t){var me,fe,pe,ge;const[e,a]=x.useState(!1),[r,n]=x.useState(null),[d,h]=x.useState(!1),[b,f]=x.useState(!1),p=Ee(k=>k.playbook.chapters),i=Ee(k=>k.playbook.filterObject),{user:m}=Mt(),g=ce(),{currentTab:v,onChangeTab:s}=In("play"),_=qt(k=>k.breakpoints.down("lg"),{noSsr:!0}),{items:C,filter:j,stats:S,page:T,showLoadingIndicator:D,rowsPerPage:y,searchParamsObject:c,updateFiltersWithoutNavigation:w,filterCount:R,error:L,showOfflineIndicator:E,isError:z,resetFiltersWithoutNavigation:A}=gn({selectedTeamId:(me=t.selectedTeam)==null?void 0:me.team_id,db_user_id:m.db_user_id,searchParams:i,rowsPerPage:24,type:v,enabled:!_}),{allFolders:B,currentFolderId:$,folderScope:W,navigateToFolder:U}=kn({folderIdParam:i.folder_id,selectedTeamId:((fe=t.selectedTeam)==null?void 0:fe.team_id)??null,type:v,commitFilters:k=>g(Te(w(k)))}),O=Pn({items:C,resetKey:v,shortcuts:!1}),te=wn(),X=()=>{n(null)},Y=x.useRef(p);Y.current=p;const J=x.useCallback((k,N)=>{a({chapterIndex:k,type:N})},[]),V=x.useMemo(()=>({getChapters:()=>Y.current,onAdd:(k,N)=>{var H;const I=Y.current[N];g(Jt({play_id:k,destinationChapter:N,index:((H=I==null?void 0:I.objects)==null?void 0:H.length)??0})),I!=null&&I.collapsed&&g(je(N))},onAddMany:(k,N)=>{var H;const I=Y.current[N];g(ct({plays:k,destinationChapter:N,index:((H=I==null?void 0:I.objects)==null?void 0:H.length)??0})),I!=null&&I.collapsed&&g(je(N))}}),[g]),P=x.useRef(null),q=x.useCallback(()=>{var k,N;return((N=(k=P.current)==null?void 0:k.closest)==null?void 0:N.call(k,".simplebar-content-wrapper"))??null},[]),G=x.useRef(null);x.useLayoutEffect(()=>{if(r)return;const k=G.current;if(k==null)return;G.current=null;const N=()=>{const H=q();H&&(H.scrollTop=k)};N();const I=setTimeout(N,60);return()=>clearTimeout(I)},[r,q]);const ae=x.useCallback((k,N)=>{var H,K;const I=(H=Y.current[k])==null?void 0:H.objects[N];G.current=((K=q())==null?void 0:K.scrollTop)??null,n({chapterIndex:k,objectIndex:N,title:(I==null?void 0:I.title)??"",platejsData:(I==null?void 0:I.platejsData)??(I==null?void 0:I.data)??[]})},[q]);nr({scrollElementRef:P,onDragActivityChange:h,onChapterDragActivityChange:f});const se=(k,N)=>{g(Te(w({page:N+1})))};if(r){const{chapterIndex:k,objectIndex:N}=r,I=(pe=p[k])==null?void 0:pe.objects[N];if(!I)return n(null),null;const H=X,K=()=>{g(Yt({chapterIndex:k,objectIndex:N,title:r.title??I.title??""})),g(Zo({chapterIndex:k,objectIndex:N,data:r.platejsData??I.platejsData??I.data??[]})),X()};return o(u,{sx:{height:["calc(100svh - 64px - var(--thg-safe-top, 0px))","calc(100vh - 92px - var(--thg-safe-top, 0px))"],display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",marginTop:{xs:0,sm:2},pt:{xs:0,sm:2},pb:{xs:0,sm:2},boxSizing:"border-box"},children:l(u,{sx:{width:"100%",maxWidth:{xs:"100%",md:"800px"},height:"100%",backgroundColor:"white",borderRadius:.5,boxShadow:"none",border:{xs:"none",sm:"1px solid #e0e0e0"},overflow:"hidden",mx:{xs:-2,md:0},display:"flex",flexDirection:"column","& .simplebar-content-wrapper":{scrollPaddingBottom:{xs:"84px",sm:0}}},children:[l(u,{sx:{pl:"62px",pr:"20px",py:{xs:1.5,sm:2.5},borderBottom:"1px solid #e0e0e0",display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[o(u,{sx:{display:"flex",alignItems:"center",width:"100%",minWidth:0},children:o(Ke,{fullWidth:!0,disableUnderline:!0,value:r.title??I.title??"",onChange:le=>{n(oe=>({...oe,title:le.target.value}))},sx:{"& input":{fontSize:16,fontWeight:600,textAlign:"left"},"&:focus-within":{backgroundColor:"#fff",border:"1px solid",borderColor:"primary.light",px:1}}})}),l(u,{sx:{display:{xs:"none",sm:"flex"},alignItems:"center",gap:1.5,flexShrink:0},children:[o(ee,{variant:"outlined",onClick:H,children:"Cancel"}),o(ee,{variant:"contained",onClick:K,children:"Save"})]})]}),o(nt,{children:o(u,{sx:{flex:1,position:"relative",overflow:"hidden"},children:o(ut,{variant:"playbookPreviewText",className:"pt-6 pb-28 sm:pb-10",debounceMs:0,initialContent:r.platejsData??I.platejsData??I.data??[],onChange:({value:le})=>{n(oe=>oe&&{...oe,platejsData:le})},playNode:{enabled:!0,showCurrentPlay:!1,showLibrary:!0},phaseNode:{enabled:!0,showCurrentPlay:!1,showLibrary:!0}})})}
5),l(u,{className:"thg-collapse-pb-on-keyboard",sx:{display:{xs:"flex",sm:"none"},position:"fixed",left:0,right:0,bottom:0,zIndex:le=>le.zIndex.appBar,backgroundColor:"white",justifyContent:"flex-end",gap:1.5,px:2,pt:1.5,pb:`calc(12px + ${te.bottom})`,"--thg-collapsed-pb":"12px",borderTop:"1px solid #e0e0e0"},children:[o(ee,{variant:"outlined",onClick:H,children:"Cancel"}),o(ee,{variant:"contained",onClick:K,children:"Save"})]})]})})}return l(Re,{children:[o(un,{tab:e==null?void 0:e.type,open:!!e,close:()=>{a(!1)},showLoadingIndicator:D,addNewPlay:k=>{var N,I;g(ct({destinationChapter:e==null?void 0:e.chapterIndex,plays:k,index:(I=(N=p[e==null?void 0:e.chapterIndex])==null?void 0:N.objects)==null?void 0:I.length}))}}),o(rr,{value:d,children:o(ar,{value:b,children:m.db_user_id&&l(u,{sx:{display:{lg:"grid"},gridTemplateColumns:{lg:"minmax(280px, 800px) minmax(640px, 700px)"},justifyContent:{lg:"center"},gridTemplateRows:{lg:"minmax(0, 1fr)"},gap:{lg:6},height:["calc(100svh - 96px - var(--thg-safe-top, 0px))","calc(100vh - 96px - var(--thg-safe-top, 0px))"],mt:4,minWidth:0},children:[o(u,{sx:{"& > div":{height:"100%"},minWidth:0,height:"100%"},children:o(nt,{children:l(u,{sx:{p:0,paddingBottom:5,flex:1},ref:P,children:[p.map((k,N)=>{var I;return o(hr,{uuid:k.uuid??String(N),chapterIndex:N,title:k.title,summary:io(k.objects),estimatedHeight:k.collapsed?190:260+(((I=k.objects)==null?void 0:I.length)??0)*88,children:H=>o(u,{sx:{py:2.5,pt:N===0?0:2.5},children:o(or,{showAddPlayDialog:J,onOpenFullScreenTextEditor:ae,smallScreen:_,item:k,index:N,chapterCount:p.length,dragHandleProps:H})})},k.uuid??"chapter"+N)}),p.length===0&&o(u,{sx:{border:_?"1px solid #ccc":"1px dashed grey",height:_?100:200,background:"rgb(227, 252, 239)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14},children:_?"Empty playbook, add first chapter.":"Drag Chapters Here"}),o(de,{sx:{ml:3,mt:3},direction:"row",children:o(ee,{size:"medium",onClick:()=>{g(Xt({destinationChapter:p.length}))},startIcon:o(M,{style:{fontSize:18,marginRight:5},icon:zt}),variant:"contained",children:"Add Chapter"})})]})})}),!_&&o(u,{sx:{minWidth:0,width:"100%"},children:o(u,{sx:k=>({display:"none",[k.breakpoints.up("lg")]:{position:"sticky",display:"block",pb:2,top:30,height:"100%"}}),children:l(nt,{children:[l(u,{sx:{flex:1,px:4,pt:3,pb:1,mb:2,backgroundColor:"grey.100",borderColor:"divider",borderWidth:1,borderStyle:"solid",borderRadius:.5},children:[o(jo,{variant:"h6",children:"Building Blocks"}),l(de,{direction:"row",sx:{flexWrap:"wrap",my:2},children:[o(u,{sx:{mt:0},children:o(at,{blockType:"chapter",previewLabel:"New Chapter",children:o(lt,{icon:o(M,{style:{fontSize:18,marginRight:5},icon:zt}),title:"Chapter"})})}),o(u,{sx:{mt:0},children:o(at,{blockType:"text",previewLabel:"Text Paragraph",children:o(lt,{icon:o(M,{style:{fontSize:18,marginRight:5},icon:lo}),title:"Text Paragraph"})})}),o(u,{sx:{mt:0},children:o(at,{blockType:"pageBreak",previewLabel:"Page Break",children:o(lt,{icon:o(M,{style:{fontSize:18,marginRight:5},icon:ao}),title:"Page Break (PDF)"})})})]})]}),l(u,{sx:{flex:1,p:3,px:4,backgroundColor:"grey.100",borderColor:"divider",borderWidth:1,borderStyle:"solid",borderRadius:.5},children:[l(de,{direction:"row",sx:{alignItems:"center",justifyContent:"space-between",mb:2},children:[l(Ro,{value:v,onChange:s,children:[o(St,{label:"Plays",value:"play"}),o(St,{label:"Drills",value:"drill"})]}),o(zo,{placement:"left",arrow:!0,title:o(u,{sx:{p:.5,fontSize:13,lineHeight:1.6},children:"Drag plays and drills from this list into a chapter on the left. Select multiple plays to drag them together. You can also add plays from a chapter's Add Block button."}),children:o(M,{icon:Ht,style:{fontSize:18,cursor:"help",color:"#637381"}})})]}),o(u,{sx:{py:1},children:o(Cn,{showViewToggle:!1,mobileVariant:"inline",updateFilters:k=>g(Te(w(k))),filter:j,stats:S,filterCount:R,showLoadingIndicator:D,resetFilters:()=>g(Te(A())),searchParamsObject:c,type:v})}),R>0&&o(de,{sx:{mb:2},flexWrap:"wrap",direction:"row",gap:1,children:j==null?void 0:j.map(k=>{var H;const N=((H=c==null?void 0:c[k==null?void 0:k.data])==null?void 0:H.split(","))??[],I=_n(k,N);return I.filter(K=>K.isChecked).map(K=>o(Ao,{label:Dn(k.data,K.option),color:"primary",onDelete:()=>{let oe=yo(I,ne=>{let be=ne.findIndex(he=>he.option===K.option);ne[be].isChecked=!1}
5).filter(ne=>ne.isChecked===!0).map(ne=>ne.tag_id??ne.option).join(",");g(Te(w({[k.data]:oe})))},onClick:()=>{}},K.option))})}),z&&o(st,{severity:"error",children:bo.printError(L)}),E&&o(u,{sx:{textAlign:"center",mt:2},children:o(st,{severity:"error",children:"You are offline. This data is not available."})}),$!=null&&o(u,{sx:{mb:2},children:o(Sn,{rootLabel:v==="play"?"Plays":"Drills",currentFolderId:$,allFolders:B,scope:W,onNavigate:U})}),o(u,{sx:{mx:{xs:-3,sm:-2}},children:o(xn,{displayType:"drag",alwaysEnableDnd:!0,addToChapter:V,virtualizerType:"none",selectableFolders:!1,showSelectedActionsBar:!0,showLoadingIndicator:D,items:C,allFolders:B,folderScope:W,onNavigateFolder:U,currentFolderId:$,selectedTeamId:(ge=t.selectedTeam)==null?void 0:ge.team_id,editPermission:!0,type:v,selected:O.selected,setSelected:O.setSelected,onSelectRow:O.onSelectItem,onSelectAllRows:k=>k?O.selectAll():O.clear(),stats:S,rowsPerPageOptions:[y],rowsPerPage:y,page:T-1,handlePageChange:se,handleRowsPerPageChange:()=>{},orderChanged:k=>g(Te(w({sortBy:k.orderBy,order:k.order})))},v)})]})]})})})]})})})]})}function fr(){const t=re.c(28),e=ce();let a;t[0]!==e?(a=_=>{e(Ut(_))},t[0]=e,t[1]=a):a=t[1];const r=a,n=Ee(gr);let d;t[2]!==n.coverSettings||t[3]!==n.printSettings?(d={cover:n.coverSettings,print:n.printSettings},t[2]=n.coverSettings,t[3]=n.printSettings,t[4]=d):d=t[4];let h;t[5]!==n.advancedEditor||t[6]!==n.chapters||t[7]!==n.type||t[8]!==d?(h={type:n.type,chapters:n.chapters,advancedEditor:n.advancedEditor,settings:d},t[5]=n.advancedEditor,t[6]=n.chapters,t[7]=n.type,t[8]=d,t[9]=h):h=t[9];let b;t[10]!==n.dbData||t[11]!==h?(b={title:n.dbData.title,data:h,...n.dbData},t[10]=n.dbData,t[11]=h,t[12]=b):b=t[12];const f=b;let p;t[13]!==f?(p={data:f,isPending:!1,isError:!1,error:null,refetch:pr},t[13]=f,t[14]=p):p=t[14];const i=p;let m;t[15]===Symbol.for("react.memo_cache_sentinel")?(m={maxWidth:800,"@media (min-width: 1200px)":{maxWidth:1200}},t[15]=m):m=t[15];let g;t[16]!==i||t[17]!==n.type||t[18]!==f?(g=n.type==="advanced"&&o(Tn,{toc:{enabled:!0,mobileClassName:"max-[1200px]:block hidden",desktopClassName:"max-[1200px]:hidden",top:80},showToolbar:!1,playbook:f,playbookQuery:i}),t[16]=i,t[17]=n.type,t[18]=f,t[19]=g):g=t[19];let v;t[20]!==i||t[21]!==n.type||t[22]!==f||t[23]!==r?(v=n.type==="classic"&&o(En,{toc:{top:60},previewMode:!0,playbook:f,playbookQuery:i,updateSettings:r}),t[20]=i,t[21]=n.type,t[22]=f,t[23]=r,t[24]=v):v=t[24];let s;return t[25]!==g||t[26]!==v?(s=o("div",{className:"mt-10",children:l(Gt,{maxWidth:!1,sx:m,children:[g,v]})}),t[25]=g,t[26]=v,t[27]=s):s=t[27],s}function pr(){}function gr(t){return t.playbook}function xr(t){const e=re.c(51),{open:a,onClose:r,onCreatePlaybook:n}=t,d=ce(),h=Ee(vr);let b;e[0]!==r||e[1]!==n||e[2]!==h?(b=()=>{n&&n(h),r()},e[0]=r,e[1]=n,e[2]=h,e[3]=b):b=e[3];const f=b;let p;e[4]!==r?(p=()=>{r()},e[4]=r,e[5]=p):p=e[5];const i=p;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m={zIndex:1e4},e[6]=m):m=e[6];let g;e[7]!==i?(g=o(jn,{onClick:i,sx:m}),e[7]=i,e[8]=g):g=e[8];let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=o(Bo,{children:"Choose Your Interface"}),e[9]=v):v=e[9];let s;e[10]===Symbol.for("react.memo_cache_sentinel")?(s=o("div",{className:"mb-4",children:o("p",{className:"text-sm text-gray-600",children:"Select the editing experience that works best for you"})}),e[10]=s):s=e[10];const _=`flex flex-1 p-4 rounded-lg border-2 cursor-pointer transition-colors ${h==="classic"?"border-teal-600 bg-teal-50":"border-gray-200 hover:border-gray-300"}`;let C;e[11]!==d?(C=()=>d(Et("classic")),e[11]=d,e[12]=C):C=e[12];let j;e[13]===Symbol.for("react.memo_cache_sentinel")?(j=l("div",{className:"text-center",children:[o("div",{className:"text-base font-bold text-gray-800 mb-1",children:"Classic Drag & Drop"}),o("div",{className:"text-sm text-gray-600",children:"Easy, visual and intuitive interface"})]}),e[13]=j):j=e[13];let S;e[14]===Symbol.for("react.memo_cache_sentinel")?(S=o("div",{className:"h-2 w-2/5 bg-gray-200 rounded-sm sm:rounded mb-2"}),e[14]=S):S=e[14];let T;e[15]===Symbol.for("react.memo_cache_sentinel")?(T=l("div",{className:" rounded-sm sm:rounded px-3 py-2",children:[S,l("div",{className:"space-y-1",children:[o("div",{className:"bg-gray-200 rounded-sm sm:rounded h-3 w-full"}),o("div",{className:"bg-gray-200 rounded-sm sm:rounded h-3 w-full"}),o("div",{className:"bg-gray-200 rounded-sm sm:rounded h-3 w-full"})]})]}),e[15]=T):T=e[15];let D;e[16]===Symbol.for("react.memo_cache_sentinel")?(D=o("div",{className:"h-2 w-2/5 bg-gray-200 rounded-sm sm:rounded mb-2"}),e[16]=D):D=e[16];let y;e[17]===Symbol.for("react.memo_cache_sentinel")?(y=l("div",{className:"w-1/2 border-r border-gray-200 p-2 space-y-2",children:[T,l("div",{className:"rounded-sm sm:rounded p-3",children:[D,l("div",{className:"space-y-1",children:[o("div",{className:"bg-gray-200 rounded-sm sm:rounded h-3 w-full"}),o("div",{className:"bg-gray-200 rounded-sm sm:rounded h-3 w-full"}),o("div",{className:"bg-gray-200 rounded-sm sm:rounded h-3 w-full"})]})]})]}),e[17]=y):y=e[17];let c;e[18]===Symbol.for("react.memo_cache_sentinel")?(c=l("div",{className:"grid grid-cols-3 gap-0.5 sm:gap-2",children:[o("div",{className:"bg-gray-200 rounded-sm sm:rounded h-6"}),o("div",{className:"bg-gray-200 rounded-sm sm:rounded h-6"}),o("div",{className:"bg-gray-200 rounded-sm sm:rounded h-6"})]}),e[18]=c):c=e[18];let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=l("div",{className:"space-y-4 flex-1",children:[j,o("div",{className:"border border-gray-200 rounded-sm sm:rounded-lg bg-white",children:l("div",{className:"flex",children:[y,l("div",{className:"w-1/2 p-4 ",children:[c,o("div",{className:"mt-4 space-y-2",children:[...Array(4)].map(br)})]})]})})]}),e[19]=w):w=e[19];let R;e[20]!==_||e[21]!==C?(R=o("button",{className:_,onClick:C,children:w}),e[20]=_,e[21]=C,e[22]=R):R=e[22];const L=`flex flex-1 p-4 rounded-lg border-2 cursor-pointer transition-colors ${h==="advanced"?"border-teal-600 bg-teal-50":"border-gray-200 hover:border-gray-300"}`;let E;e[23]!==d?(E=()=>d(Et("advanced")),e[23]=d,e[24]=E):E=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z=l("div",{className:"text-center",children:[o("div",{className:"text-base font-bold text-gray-800 mb
5-1",children:"Advanced Editor"}),o("div",{className:"text-sm text-gray-600",children:"Powerful Notion-like block editor"})]}),e[25]=z):z=e[25];let A;e[26]===Symbol.for("react.memo_cache_sentinel")?(A=o("div",{className:"h-4 bg-gray-200 rounded-sm sm:rounded w-2/3"}),e[26]=A):A=e[26];let B;e[27]===Symbol.for("react.memo_cache_sentinel")?(B=l("div",{className:"space-y-1",children:[o("div",{className:"h-2 bg-gray-200 rounded-sm sm:rounded w-full"}),o("div",{className:"h-2 bg-gray-200 rounded-sm sm:rounded w-4/5"}),o("div",{className:"h-2 bg-gray-200 rounded-sm sm:rounded w-3/4"})]}),e[27]=B):B=e[27];let $;e[28]===Symbol.for("react.memo_cache_sentinel")?($=o("div",{className:"border-2 border-dashed border-gray-300 rounded-sm sm:rounded p-2 sm:p-3 bg-gray-50",children:l("div",{className:"grid grid-cols-3 gap-1 sm:gap-2 md:gap-3",children:[o("div",{className:"bg-gray-200 rounded-sm sm:rounded aspect-square"}),o("div",{className:"bg-gray-200 rounded-sm sm:rounded aspect-square"}),o("div",{className:"bg-gray-200 rounded-sm sm:rounded aspect-square"})]})}),e[28]=$):$=e[28];let W;e[29]===Symbol.for("react.memo_cache_sentinel")?(W=l("div",{className:"space-y-4 flex-1",children:[z,o("div",{className:"flex justify-center",children:o("div",{className:"w-3/5 border border-gray-200 rounded-sm sm:rounded-lg bg-white p-3 sm:p-4",children:l("div",{className:"space-y-3",children:[A,B,$,l("div",{className:"space-y-1",children:[o("div",{className:"h-2 bg-gray-200 rounded-sm sm:rounded w-full"}),o("div",{className:"h-2 bg-gray-200 rounded-sm sm:rounded w-2/3"})]})]})})})]}),e[29]=W):W=e[29];let U;e[30]!==L||e[31]!==E?(U=o("button",{className:L,onClick:E,children:W}),e[30]=L,e[31]=E,e[32]=U):U=e[32];let O;e[33]!==R||e[34]!==U?(O=o(Oo,{children:l("div",{className:"py-4",children:[s,l("div",{className:"flex flex-col sm:flex-row space-y-6 sm:space-y-0 sm:space-x-6",children:[R,U]})]})}),e[33]=R,e[34]=U,e[35]=O):O=e[35];let te;e[36]===Symbol.for("react.memo_cache_sentinel")?(te={p:3,pt:0},e[36]=te):te=e[36];let X;e[37]!==i?(X=o(ee,{onClick:i,color:"inherit",children:"Cancel"}),e[37]=i,e[38]=X):X=e[38];const Y=!h;let J;e[39]!==f||e[40]!==Y?(J=o(ee,{onClick:f,variant:"contained",color:"primary",disabled:Y,children:"Create Playbook"}),e[39]=f,e[40]=Y,e[41]=J):J=e[41];let V;e[42]!==X||e[43]!==J?(V=l(Lo,{sx:te,children:[X,J]}),e[42]=X,e[43]=J,e[44]=V):V=e[44];let P;return e[45]!==i||e[46]!==a||e[47]!==O||e[48]!==V||e[49]!==g?(P=l(Mo,{fullWidth:!0,maxWidth:"md",open:a,onClose:i,children:[g,v,O,V]}),e[45]=i,e[46]=a,e[47]=O,e[48]=V,e[49]=g,e[50]=P):P=e[50],P}function br(t,e){return o("div",{className:"grid grid-cols-6 gap-0.5 sm:gap-1",children:[...Array(6)].map(yr)},e)}function yr(t,e){return o("div",{className:"bg-gray-200 rounded-xs sm:rounded-sm rounded border border-gray-200 aspect-square"},e)}function vr(t){return t.playbook.type}function Cr(){const t=re.c(30),e=ce(),a=Ee(_r),[r,n]=x.useState(0);let d;t[0]!==e?(d=()=>{e(Nt(!0)),n(Sr)},t[0]=e,t[1]=d):d=t[1];const h=d;let b;t[2]!==e?(b=()=>{e(Nt(!1)),n(kr)},t[2]=e,t[3]=b):b=t[3];const f=b;let p;t[4]===Symbol.for("react.memo_cache_sentinel")?(p={mx:"auto",display:"flex",maxWidth:922,justifyContent:"space-between","@media (min-width: 1250px)":{maxWidth:1250}},t[4]=p):p=t[4];let i;t[5]===Symbol.for("react.memo_cache_sentinel")?(i={enabled:!0,mobileClassName:"max-[1250px]:block hidden",desktopClassName:"max-[1250px]:hidden"},t[5]=i):i=t[5];let m;t[6]!==e?(m=R=>{e(Xo(R.value))},t[6]=e,t[7]=m):m=t[7];let g,v;t[8]===Symbol.for("react.memo_cache_sentinel")?(g={enabled:!0,showCurrentPlay:!1,showLibrary:!0},v={enabled:!0,showCurrentPlay:!1,showLibrary:!0},t[8]=g,t[9]=v):(g=t[8],v=t[9]);let s;t[10]!==r||t[11]!==a||t[12]!==m?(s=o("div",{className:"min-[922px]:border border-divider mt-10 mb-5",children:o(ut,{toc:i,variant:"playbookAdvancedEditor",readOnly:!1,initialContent:a,onChange:m,playNode:g,phaseNode:v},r)}),t[10]=r,t[11]=a,t[12]=m,t[13]=s):s=t[13];let _;t[14]===Symbol.for("react.memo_cache_sentinel")?(_=o(Rn,{className:"h-3.5 w-3.5"}),t[14]=_):_=t[14];let C;t[15]!==h?(C=l("button",{onClick:h,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs text-slate-500 hover:text-slate-700 hover:bg-slate-100 rounded transition-colors",children:[_,"Collapse All"]}
5),t[15]=h,t[16]=C):C=t[16];let j;t[17]===Symbol.for("react.memo_cache_sentinel")?(j=o(zn,{className:"h-3.5 w-3.5"}),t[17]=j):j=t[17];let S;t[18]!==f?(S=l("button",{onClick:f,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs text-slate-500 hover:text-slate-700 hover:bg-slate-100 rounded transition-colors",children:[j,"Expand All"]}),t[18]=f,t[19]=S):S=t[19];let T;t[20]!==S||t[21]!==C?(T=l("div",{className:"flex justify-end gap-2 px-4 py-2",children:[C,S]}),t[20]=S,t[21]=C,t[22]=T):T=t[22];let D;t[23]!==T||t[24]!==s?(D=l("div",{className:"w-full max-w-[922px]",children:[s,T]}),t[23]=T,t[24]=s,t[25]=D):D=t[25];let y;t[26]===Symbol.for("react.memo_cache_sentinel")?(y={width:250,"@media (max-width: 1250px)":{display:"none"}},t[26]=y):y=t[26];let c;t[27]===Symbol.for("react.memo_cache_sentinel")?(c=o(u,{sx:y,children:o(u,{sx:wr,children:o(u,{id:"playbook-toc-desktop"})})}),t[27]=c):c=t[27];let w;return t[28]!==D?(w=o(Re,{children:l(u,{maxWidth:!1,sx:p,children:[D,c]})}),t[28]=D,t[29]=w):w=t[29],w}function wr(t){return{position:"sticky",overflowY:"auto",py:2,top:"calc(80px + var(--thg-safe-top, 0px))",bottom:20,height:"100vh"}}function kr(t){return t+1}function Sr(t){return t+1}function _r(t){return t.playbook.advancedEditor}const mo=t=>ln.sha1(t),Ue=t=>mo(t.chapters),Bt=$o("div",{target:"etx7tea0"})(t=>{const e=mt();return{"&:hover":{backgroundColor:t.active?void 0:$t(e.palette.info.lighter,.1)},position:"relative",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:t.active?3:"inherit",marginLeft:-1,cursor:"pointer",textAlign:"center",fontWeight:600,width:80,borderColor:e.palette.info.lighter,backgroundColor:t.active?e.palette.info.lighter:"transparent",color:t.active?e.palette.info.darker:e.palette.grey[100],[e.breakpoints.down("md")]:{display:t.active?"flex":"none",width:100},[e.breakpoints.only("xs")]:{display:t.active?"flex":"none",width:100},"@media (max-width:400px) ":{display:t.active?"flex":"none",width:90}}},"");function Dr(t){var V;const e=vo(),{user:a}=Mt(),{mixpanel:r}=Co(),[n,d]=x.useState(!1),[h,b]=x.useState(!1),[f,p]=x.useState(!1),[i,m]=x.useState("FETCHING"),[g,v]=x.useState(null),s=Ee(P=>P.playbook),[_,C]=x.useState(null),j=!!_,S=ce(),T=wo(),D=mt(),[y]=ko(),c=y.get("id"),[w,R]=x.useState(!1),L=P=>{C(P.currentTarget)},E=()=>{C(null)},z=So(),A=_o(),{isOnline:B}=an(),$=Lt();x.useCallback(()=>{const P=T.getState().playbook;S($e(Ue(P)))},[S,T]);const W=()=>{var P,q,G;if((P=z.state)!=null&&P.returnTo){A(z.state.returnTo,{replace:!0,state:{fromEditor:!0}});return}z.key!=="default"?A(-1):(q=s==null?void 0:s.dbData)!=null&&q.playbook_id?A(Je.plays.playbook((G=s==null?void 0:s.dbData)==null?void 0:G.playbook_id),{replace:!0}):A(Je.plays.playbooks,{replace:!0})};x.useEffect(()=>(r.track("Open Playbook Editor"),r.time_event("Close Playbook Editor"),(async()=>{let P=y.get("copy");if(c==="new"){const G=y.get("folder_id"),ae=G?Number(G):null,se=Number.isFinite(ae)?ae:null;S(Jo({folder_id:se}));{const me=T.getState().playbook;S($e(Ue(me)))}R(!0)}else if(c){m("FETCHING");var q;B?q=await Rt(c):q=$.getQueryData(["playbook",Number(c)]),S(P?en(q):jt(q));{const G=T.getState().playbook;S($e(Ue(G)))}}A({pathname:window.location.pathname},{replace:!0,state:z.state}),m("FINISHED")})().catch(P=>{v(P),m("ERROR")}),()=>{r.track("Close Playbook Editor")}),[]);const U=async P=>{var q;if(B)try{q=await Rt(P.playbook_id??s.dbData.playbook_id)}catch(G){console.error("[PlaybookEditor] refresh failed:",G);return}else q=P;S(jt(q)),S(nn(q));{const G=T.getState().playbook;S($e(Ue(G)))}},O=qt("(max-width:900px)"),te=x.useMemo(()=>mo(s.chapters),[s.chapters]),X=x.useMemo(()=>{if(i!=="FINISHED")return!1;const P=s.hash;return P==null||P===!1?!1:P!==te},[i,s.hash,te]),Y=Do(X),J=x.useMemo(()=>{var P;return{...s.dbData,data:{...s.dbData.data,advancedEditor:s.advancedEditor,type:s.type,settings:{...(P=s.dbData.data)==null?void 0:P.settings,cover:s.coverSettings},chapters:s.chapters}}},[s]);return l(Re,{children:[o(xr,{open:w,onClose:()=>R(!1),onCreatePlaybook:()=>{R(!1)}}),o(eo,{open:Y.state==="blocked",close:()=>
5Y.state==="blocked"&&Y.reset(),title:"Unsaved Changes!",description:"The changes you made are not saved and will be lost if you leave without saving.",actions:o(ee,{onClick:()=>Y.state==="blocked"&&Y.proceed(),color:"error",variant:"contained",children:"Ok"})}),h&&o(Go,{type:"editor",chapters:s.chapters,dbData:s.dbData,open:h,refreshDBData:U,onClose:()=>{b(!1)}}),o(Uo,{selectedTeam:e,data:s,dbData:{...s.dbData,data:{...s.dbData.data,settings:{...(V=s.dbData.data)==null?void 0:V.settings,cover:s.coverSettings}}},createNewHash:U,isOpen:n,close:()=>d(!1)}),o(Ho,{position:"fixed",sx:{px:{xs:1,md:2},pt:"var(--thg-safe-top, 0px)",pb:0,my:0,boxShadow:0},children:o(u,{children:l(_t,{sx:{height:"64px"},disableGutters:!0,children:[l(u,{sx:{my:0,display:"flex",alignItems:"center",height:"100%"},children:[O?o(ie,{onClick:W,sx:{p:{xs:.5,sm:1},mr:{xs:1,md:2}},variant:"outlined",color:"light",children:o(F,{sx:{fontSize:30},icon:"eva:close-outline"})}):o(ee,{onClick:W,sx:{mr:3,ml:1},startIcon:o(M,{icon:qo}),variant:"outlined",color:"light",children:"Close"}),l("div",{style:{height:"100%",display:"flex",alignItems:"center",marginBottom:0,color:"var(--grey-700)"},children:[o(Bt,{id:"tab_draw",active:s.tabIndex===0,onClick:P=>{O&&L(P),S(qe(0))},children:l(u,{sx:{display:"flex",justifyContent:"flex-start ",alignItems:"center",gap:1,ml:{xs:-2,md:0}},children:[l(u,{children:[o(u,{children:o(M,{icon:Pt})}),o(u,{sx:{fontSize:13},children:"Editor"})]}),o(F,{sx:{position:"absolute",bottom:"calc(50% - 10px)",right:5,backgroundColor:"white",[D.breakpoints.up("md")]:{display:"none"},padding:0,color:D.palette.info.darker},icon:"eva:arrow-ios-downward-outline",width:20,height:20})]})}),o(Bt,{id:"tab_animate",active:s.tabIndex===1,onClick:P=>{O&&L(P),S(qe(1))},children:l(u,{sx:{display:"flex",justifyContent:"flex-start ",alignItems:"center",gap:1,ml:{xs:-2,md:0}},children:[l(u,{children:[o(u,{children:o(M,{icon:It})}),o(u,{sx:{fontSize:13},children:"Preview"})]}),o(F,{sx:{position:"absolute",bottom:"calc(50% - 10px)",right:5,backgroundColor:"white",[D.breakpoints.up("md")]:{display:"none"},padding:0,color:D.palette.info.darker},icon:"eva:arrow-ios-downward-outline",width:20,height:20})]})}),l(Fo,{anchorEl:_,open:j,onClose:E,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:[l(Q,{selected:s.tabIndex===0,onClick:()=>{S(qe(0)),E()},children:[o(M,{icon:Pt,style:{width:30,marginRight:10}}),"Editor"]}),l(Q,{selected:s.tabIndex===1,onClick:()=>{S(qe(1)),E()},children:[o(M,{icon:It,style:{width:30,marginRight:10}}),"Preview"]})]})]})]}),o(u,{sx:{flex:1,px:2,textAlign:"center",alignItems:"center",display:{xs:"none",lg:"block"}},children:o(u,{sx:{margin:"auto",maxWidth:800},children:o(Ke,{inputProps:{placeholder:"Untitled Playbook",sx:{textAlign:"center","&::placeholder":{color:"#fff",opacity:.6},"&::selection":{backgroundColor:"rgba(0, 0, 0, 0.2)",color:"white"},"&::-moz-selection":{backgroundColor:"rgba(0, 0, 0, 0.2)",color:"white"}}},fullWidth:!0,disableUnderline:!0,onChange:P=>S(tn(P.target.value)),sx:{backgroundColor:"rgba(255,255,255,0.1)",fontWeight:700,fontSize:"1.2rem",color:"white",width:"100%",paddingLeft:1},value:s.dbData.title})})}),o(u,{sx:{display:{lg:"none"},flexGrow:1}}),l(u,{sx:{display:"flex",justifyContent:"flex-end",gap:{xs:1,sm:2}},children:[o(Bn,{showShareDialog:()=>b(!0),showPrintPreview:()=>p(!0)}),o(ie,{onClick:()=>{d(!0)},color:"light",sx:{mr:1,display:{xs:"inline-flex",sm:"none"}},children:o(M,{style:{fontSize:20},icon:Tt})}),o(ee,{onClick:()=>{d(!0)},color:"light",variant:"contained",startIcon:o(M,{icon:Tt}),sx:{mr:2,display:{xs:"none",sm:"inline-flex"}},children:"Save Playbook"}),o(ie,{color:"light",onClick:()=>{try{window.HelpWidget("open")}catch{console.log("HelpWidget not found")}},children:o(M,{icon:Ht})})]})]})})}),o(_t,{sx:{height:"64px",mt:"var(--thg-safe-top, 0px)"}}),o(Gt,{maxWidth:!1,sx:{flex:1,px:{xs:0,sm:2}},children:o(Dt,{sx:{height:"100%"},container:!0,spacing:3,children:o(Dt,{style:{height:"100%",display:"flex",flexDirection:"column"},size:12,children:i==="FINISHED"?l("div",{style:{flex:1},children:[(s.tabIndex??0)===0&&((s==null?void 0:s.type)??"classic")==="classic"&&o(ur,{selectedTeam:e}),(s.tabIndex??0)===0&&((s==null?void 0:s.type)??"classic")==="advanced"&&o(Cr,{}),(s.tabIndex??0)===1&&o(fr,{selectedTeam:e})]}):i==="ERROR"?o(rn,{error:g,itemLabel:"playbook",backHref:Je.plays.playbooks,backLabel:"Back to Playbooks"}):l("div",{style:{flex:1,display:"flex",flexDirection:"column",paddingTop:"20vh",alignItems:"center"},children:[o("div",{style:{display:"block"},children:o(Wo,{})}),"Loading Playbook"]})})})}),o(Nn,{mode:"editor",teamId:s.dbData.team_id,userId:a.db_user_id,playbookData:J,button:"print",open:f,onClose:()=>{p(!1)},changeCoverSettings:P=>{S(on(P))}})]})}function va(){const t=re.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=o(Dr,{}),t[0]=e):e=t[0],e}export{va as default}; 6//# sourceMappingURL=_auth.dashboard_.playbook-editor-BWF8nShn.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.