芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/www/wp-content/plugins/elementor-pro/assets/js/notes/notes-app.min.js
"use strict";(self.webpackChunkelementor_pro_notes=self.webpackChunkelementor_pro_notes||[]).push([[969],{5551:(e,t,n)=>{n.d(t,{default:()=>ja});var r=n(7363),o=n.n(r),a=n(2671);const i=a.ZP.button` all: revert; --color: #000; --padding: 0; --background: transparent; --font-weight: 500; --font-size: 16px; --font-family: Roboto, sans-serif; --text-transform: none; --letter-spacing: 0; --font-style: normal; --text-decoration: none; --line-height: normal; --word-spacing: normal; --text-shadow: none; --box-shadow: none; --border: none; --border-radius: 0; // Override themes selectors. &, &&, &[type="button"], &[type="submit"], &[type="reset"], &:hover, &:focus, &:active, &:not( :hover ):not( :active ):not( .has-background ), &:not( :hover ):not( :active ):not( .has-text-color ) { font-family: var( --font-family ) !important; font-size: var( --font-size ) !important; font-weight: var( --font-weight ) !important; text-transform: var( --text-transform ) !important; letter-spacing: var( --letter-spacing ) !important; font-style: normal !important; text-decoration: none !important; line-height: normal !important; word-spacing: normal !important; color: var( --color ) !important; background: var( --background ) !important; border: var( --border ) !important; text-shadow: var( --text-shadow ) !important; box-shadow: var( --box-shadow ) !important; border-radius: var( --border-radius ) !important; padding: var( --padding ) !important; outline: none !important; width: var( --width, auto ) !important; height: var( --height, auto ) !important; display: var( --display, inline-block ) !important; min-height: revert !important; } &:before, &:after { display: none !important; } `;var l=n(216);const s={contained:{background:"--color-editor-info",border:"--color-editor-info",text:"--color-white",backgroundHover:"--color-editor-info-dark"},outlined:{background:"--color-ghost",border:"--color-gray-400",text:"--color-gray-600",backgroundHover:"--color-darken"},transparent:{background:"--color-ghost",border:"--color-ghost",text:"--color-default"}},c={md:{padding:"--padding-md",fontSize:"--font-size-md"}},p=(0,a.ZP)(i)` --color-editor-info: #58d0f5; --color-editor-info-dark: #10bcf2; --color-default: inherit; --color-ghost: transparent; --color-white: #fff; --color-gray-400: #c2cbd2; --color-gray-600: #6d7882; --color-darken: rgba( 0, 0, 0, .05 ); --font-size-md: 13px; --padding-md: 8px 12px; --padding: var( ${({size:e})=>c[e].padding} ); --color: var( ${({variant:e})=>s[e].text} ); --background: var( ${({variant:e})=>s[e].background} ); --border-color: var( ${({variant:e})=>s[e].border} ); --border: 1px solid var( --border-color ); --cursor: pointer; --font-weight: 400; --font-family: Roboto, sans-serif; --font-size: var( ${({size:e})=>c[e].fontSize} ); --border-radius: 3px; font-style: normal !important; text-align: center !important; line-height: 1 !important; cursor: var( --cursor ) !important; transition: .3s all !important; &, & * { cursor: var( --cursor ) !important; } ${({disabled:e})=>e&&a.iv` opacity: .5; pointer-events: none; --cursor: not-allowed; `} ${({variant:e})=>"transparent"===e&&a.iv` --padding: 0; `} &:hover, &:focus { --background: var( ${({variant:e})=>s[e].backgroundHover||s[e].background} ); } `;p.propTypes={variant:l.oneOf(["contained","outlined","transparent"]).isRequired,size:l.oneOf(["md"]).isRequired,disabled:l.bool},p.defaultProps={variant:"contained",size:"md"};const m=p;var d=n(216);const u={xs:20,sm:25,md:34,lg:80,xl:160},f={active:{background:"--color-editor-info",text:"--color-white"},solid:{background:"--color-editor-info",text:"--color-white"},ghost:{background:"--color-ghost",text:"--color-gray"}},g=a.F4` 0% { opacity: 0; transform: scale(.8); transform-origin: 50% 100%; } 50% { opacity: 1; transform: scale(1.2); transform-origin: 50% 100%; } 100% { opacity: 1; transform: scale(1); transform-origin: 50% 100%; } `,h=a.ZP.span.withConfig({shouldForwardProp:e=>"children"===e})` all: revert; --color-editor-info: #58d0f5; --color-ghost: #fff; --color-white: #fff; --color-gray: #a4afb6; --color-shadow: rgba(0, 0, 0, 0.2); --size: ${({size:e})=>u[e]}; --position: relative; display: grid; place-items: center; position: relative; height: calc(var(--size) * 1px); width: calc(var(--size) * 1px); line-height: 2.8; font-family: Roboto, sans-serif !important; font-size: calc(var(--size) * .38px); font-weight: 500; color: var(${({variant:e})=>f[e].text}); isolation: isolate; animation: .3s ${g} both; transition: .3s all; ${({muted:e})=>e&&a.iv` --color-shadow: transparent; opacity: .5 !important; `} &::before { --background-color: var(${({variant:e})=>f[e].background}); --border-color: var( --background-color ); content: ''; display: block; position: absolute; z-index: -1; inset: 0; background-color: var( --background-color ); border: calc(var(--size) / 20 * 1px) solid var(--border-color); border-radius: 100% 100% 25% 100%; transform: rotate(45deg); ${({variant:e})=>"active"===e&&a.iv` mask-image: radial-gradient(transparent 30%, #000 32%); `} ${({variant:e})=>"ghost"===e&&a.iv` --border-color: var(--color-gray); `} } `;h.propTypes={variant:d.oneOf(["active","solid","ghost"]).isRequired,size:d.oneOf(["xs","sm","md","lg","xl"]).isRequired,muted:d.bool,children:d.oneOfType([d.node,d.arrayOf(d.node)])},h.defaultProps={variant:"solid",size:"md",muted:!1};const v=h;var b=n(9819);const y=(0,a.ZP)(b.Eh)` fill: #fff; margin: 0 10px; `;var x=n(11);const w=a.ZP.i` margin: 0 !important; padding: 0 !important; `;var E=n(216);const k={sm:"15px",md:"18px"},C=(0,a.ZP)(i)` --color: #a4afb7; --background: transparent; --padding: 4px; --font-size: ${({size:e})=>k[e]}; --border: none; --border-radius: 100%; --display: grid; transition: 0.2s all; place-items: center; border-radius: 100%; cursor: pointer; &:hover, &:focus { --background: transparent; --color: #6d7882; outline: none; } &:focus { --background: #f1f3f5; } ${({disabled:e})=>e&&a.iv` opacity: .5; pointer-events: none; cursor: not-allowed; `} `,R=o().forwardRef((({name:e,...t},n)=>o().createElement(C,(0,x.Z)({},t,{ref:n}),o().createElement(w,{className:e}))));R.displayName="IconButton",R.propTypes={size:E.oneOf(["sm","md"]),name:E.string.isRequired,onClick:E.func,disabled:E.bool},R.defaultProps={size:"md"};const P=R,T=(0,a.ZP)(P)` --position-spacing: 4px; position: absolute; top: var(--position-spacing); inset-inline-end: var(--position-spacing); `;function _(e){return o().createElement(b.x8,{asChild:!0},o().createElement(T,(0,x.Z)({},e,{name:"eicon-editor-close",size:"sm"})))}_.propTypes={...b.x8.propTypes};const z=a.F4` 0% { opacity: 0; transform: translateY(3px); } 100% { opacity: 1; transform: translateY(0); } `,$=a.F4` 0% { opacity: 0; transform: translateX(-3px); } 100% { opacity: 1; transform: translateX(0); } `,Z=a.F4` 0% { opacity: 0; transform: translateY(-3px); } 100% { opacity: 1; transform: translateY(0); } `,I=a.F4` 0% { opacity: 0; transform: translateX(3px); } 100% { opacity: 1; transform: translateX(0); } `,A=a.F4` 0% { opacity: 1; } 100% { opacity: 0; } `,O=a.F4` 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } `,S=(0,a.ZP)(b.VY)` all: revert; font-family: Roboto, sans-serif !important; font-size: 1em !important; font-weight: normal !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: normal !important; letter-spacing: normal !important; word-spacing: normal !important; background: #fff !important; border-radius: 3px !important; min-width: 120px !important; box-shadow: 0 1px 20px rgba(0, 0, 0, 0.15) !important; animation-duration: 400ms !important; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1) !important; &[data-state="open"] { &[data-side="top"] { animation-name: ${z}; } &[data-side="right"] { animation-name: ${$}; } &[data-side="bottom"] { animation-name: ${Z}; } &[data-side="left"] { animation-name: ${I}; } *:focus { outline: none; } } `,F=b.fC;F.Trigger=b.xz,F.Content=S,F.Arrow=y,F.CloseButton=_,F.propTypes=b.fC.propTypes;const L=F;var q=n(216);const M={sm:{width:16},md:{width:32},lg:{width:64}},D=a.ZP.img` all: revert; aspect-ratio: 1 / 1; border-radius: 100%; height: auto; width: ${({size:e})=>M[e].width}px; `;D.propTypes={size:q.oneOf(["sm","md","lg"]).isRequired,src:q.string.isRequired},D.defaultProps={size:"md"};const N=D;var V=n(1656);const U=(0,a.ZP)(V.VY)` all: revert; background: #fff !important; border-radius: 3px !important; min-width: 120px !important; box-shadow: 0 1px 20px rgba(0, 0, 0, 0.15) !important; animation-duration: 400ms !important; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1) !important; padding: 4px !important; &[data-state="open"] { &[data-side="top"] { animation-name: ${z}; } &[data-side="right"] { animation-name: ${$}; } &[data-side="bottom"] { animation-name: ${Z}; } &[data-side="left"] { animation-name: ${I}; } } `;var j=n(5532);const W=(0,a.ZP)(j.Eh)` fill: #26292c; `,H=(0,a.ZP)(j.VY)` all: revert; font-family: Roboto, sans-serif !important; font-size: 12px !important; font-weight: normal !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: normal !important; letter-spacing: normal !important; word-spacing: normal !important; background: #26292c !important; color: #fff !important; border-radius: 3px !important; box-shadow: 0 1px 20px rgba(0, 0, 0, 0.15) !important; padding: 5px 12px !important; animation-duration: 400ms !important; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1) !important; will-change: transform, opacity !important; max-width: 150px !important; &[data-state="delayed-open"] { &[data-side="top"] { animation-name: ${z} } &[data-side="right"] { animation-name: ${$} } &[data-side="bottom"] { animation-name: ${Z} } &[data-side="left"] { animation-name: ${I} } } `;H.propTypes=j.VY.propTypes,H.defaultProps={side:"top"};const K=H,Q=j.fC;Q.Trigger=j.xz,Q.Arrow=W,Q.Content=K;const B=Q;var Y=n(216);const X={default:{hoverTextColor:"#6d7882",hoverIconColor:"#a4afb6"},danger:{hoverTextColor:"#b01b1b",hoverIconColor:"#d9534f"}},G=(0,a.ZP)(w)` color: #a4afb6 !important; transition: 0.2s all; `,J=a.ZP.span` display: flex !important; align-items: center !important; gap: 8px !important; `,ee=(0,a.ZP)(V.ck)` all: revert; font-family: Roboto, sans-serif !important; font-size: 11px !important; font-weight: 500 !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: 1.2 !important; letter-spacing: normal !important; word-spacing: normal !important; cursor: pointer !important; border-radius: 4px !important; padding: 7px 12px !important; color: #6d7882 !important; transition: 0.2s all !important; &[data-disabled] { opacity: 0.5 !important; cursor: default !important; } &:focus { background: #f1f3f5 !important; outline: none !important; color: ${({variant:e})=>X[e].hoverTextColor} !important; ${G} { color: ${({variant:e})=>X[e].hoverIconColor} !important; } } `;function te({children:e,icon:t,tooltip:n,...r}){const a=o().createElement(J,null,t&&o().createElement(G,{className:t}),e);return o().createElement(ee,r,n?o().createElement(B,null,o().createElement(B.Trigger,{asChild:!0},a),o().createElement(B.Content,null,n,o().createElement(B.Arrow,null))):a)}te.propTypes={...te.propTypes,icon:Y.string,tooltip:Y.node,variant:Y.oneOf(["default","danger"])},te.defaultProps={variant:"default"};const ne=(0,a.ZP)(V.Eh)` fill: #fff; margin: 0 10px; `,re=(0,a.ZP)(V.Z0)` height: 1px !important; background: #f1f3f5 !important; margin: 7px 10px !important; `,oe=V.fC;oe.Trigger=V.xz,oe.Content=U,oe.Item=te,oe.Arrow=ne,oe.Separator=re;const ae=oe;var ie=n(8328);class le{tokenClasses;fallbackTokenClass;parsePipeFunctions;constructor({tokenClasses:e,fallbackTokenClass:t,parsePipeFunctions:n}={}){this.tokenClasses=e,this.fallbackTokenClass=t,this.parsePipeFunctions=n}parse(e){var t;const n=this.extractLexemes(e),r=this.tokenize(n);return function(...e){return(t,...n)=>e.reduce(((e,t)=>t(e,...n)),t)}(...null!==(t=this.parsePipeFunctions)&&void 0!==t?t:[])(r)}extractLexemes(e){return e.trim().split(this.getLexerRegex()).reduce(((e,t)=>(t&&e.push(t),e)),[])}tokenize(e){return e.map((e=>{const t=this.tokenClasses.find((t=>t.isToken(e)));return t?t.create(e):this.fallbackTokenClass?this.fallbackTokenClass.create(e):null})).filter((e=>!!e))}getLexerRegex(){const e=this.tokenClasses.map((e=>e.getPattern()?.source)).filter((e=>!!e));return new RegExp(`(${e.join("|")})`,"igm")}}class se{static type="";type;value;constructor(e){this.value=e,this.type=this.constructor.type}static getPattern(){return null}static isToken(e){return!!e.match(new RegExp(this.getPattern(),"igm"))}static create(e=null){return new this(e)}is(e){return this.type===e.type}}class ce extends se{static type="LineBreak";constructor(e){super(e||"\n")}static getPattern(){return/(?:\r?\n)/}}class pe extends se{static type="Paragraph"}function me(e){return e.push(ce.create()),e.reduce(((e,t)=>{let n=t;if(t.is(ce)){const t=function(e,t){for(let n=e.length-1;n>=0;n--)if(t(e[n],n))return n;return-1}(e,(e=>e.is(pe)));n=pe.create(e.slice(t+1,e.length)),e=e.slice(0,t+1)}return e.push(n),e}),[])}class de extends se{static type="Content"}function ue(e){return de.create(e)}class fe extends se{static type="Email";static getPattern(){return/[\w\-.]+@(?:[\w-]+\.)+[\w-]{2,4}/}}class ge extends se{static type="Handle"}class he extends se{static type="Username"}class ve extends se{static type="Mention";static handleChar="@";handle;username;constructor(e){super(e),this.handle=ge.create(this.constructor.handleChar),this.username=he.create(e.replace(this.constructor.handleChar,""))}static getPattern(){return new RegExp(`\\B${this.handleChar}[\\w\\-]+`)}}class be extends se{static type="Url";static getPattern(){return/https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)/}}class ye extends se{static type="Wow";static getPattern(){return/(?:(?:\b(?:yay|wow)\b)|🎉)/}}class xe extends se{static type="Text"}function we({tokenClasses:e,fallbackTokenClass:t,parsePipeFunctions:n}={}){return new le({tokenClasses:null!=e?e:[fe,ce,ve,be,ye],fallbackTokenClass:null!=t?t:xe,parsePipeFunctions:null!=n?n:[me,ue]})}const Ee=2147483647;function ke(e){const t=we({tokenClasses:[ve],fallbackTokenClass:!1,parsePipeFunctions:[]}).parse(e).map((e=>e.username.value));return[...new Set(t)]}function Ce(e){return Object.entries(e).reduce(((e,[t,n])=>null===n?e:("boolean"==typeof n&&(n=n?1:0),{...e,[t]:n})),{})}function Re(e,{onlyIfNeeded:t=!0,...n}={}){return t&&function(e){const{top:t,left:n,bottom:r,right:o}=e.getBoundingClientRect(),{top:a,right:i,bottom:l,left:s}=e.parentElement.getBoundingClientRect(),c=t>=0&&n>=0&&t<=window.innerHeight&&n<=window.innerWidth,p=t>=a&&o<=i&&r<=l&&n>=s;return c&&p}(e)?Promise.resolve():new Promise((t=>{!function(e,t){new IntersectionObserver(((e,n)=>{e?.[0]?.isIntersecting&&(n.disconnect(),t())})).observe(e)}(e,(()=>{t()})),e.scrollIntoView({behavior:"smooth",block:"center",inline:"center",...n})}))}function Pe(e){e.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))}const Te=a.F4` 0% { opacity: 0; } 100% { opacity: 1; } `,_e=a.F4` 0% { opacity: 0; transform: translate(-50%, -48%) scale(.96); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } `,ze=(0,a.ZP)(ie.VY)` all: revert; font-family: Roboto, sans-serif !important; font-size: 1em !important; font-weight: normal !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: normal !important; letter-spacing: normal !important; word-spacing: normal !important; background-color: #fff !important; box-shadow: 2px 8px 23px rgba(0, 0, 0, 0.2) !important; border-radius: 3px !important; width: 375px !important; text-align: center !important; position: fixed !important; top: 50% !important; left: 50% !important; transform: translate(-50%, -50%) !important; max-height: 85vh !important; animation-duration: 150ms !important; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1) !important; animation-name: ${_e} !important; z-index: ${Ee} !important; &:focus { outline: none !important; } `,$e=(0,a.ZP)(ie.aV)` background-color: rgba(0, 0, 0, 0.5) !important; position: fixed !important; inset: 0 !important; animation-duration: 150ms !important; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1) !important; animation-name: ${Te} !important; z-index: ${Ee} !important; `;function Ze(e){return o().createElement(ie.h_,null,o().createElement($e,null),o().createElement(ze,e))}Ze.propTypes={...ie.VY.propTypes};const Ie=(0,a.ZP)(ie.Dx)` all: revert; font-family: Roboto, sans-serif !important; font-size: 17px !important; font-weight: 500 !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: normal !important; letter-spacing: normal !important; word-spacing: normal !important; margin: 0 !important; color: #495157 !important; &::before, &::after { display: none; } `;Ie.propTypes={...ie.Dx.propTypes};const Ae=Ie,Oe=a.ZP.div` all: revert; box-sizing: border-box; &:before, &:after { display: none !important; } `,Se=(0,a.ZP)(Oe)` padding: 30px !important; display: flex !important; flex-direction: column !important; gap: 12px !important; `,Fe=(0,a.ZP)(Oe)` display: flex; align-items: center; border-top: 1px solid #d5dadf; & > button:not(:first-child) { /** * will create a divider between the buttons, * not matter how much buttons exists in the container. */ border-inline-start: 1px solid #d5dadf; } `,Le=(0,a.ZP)(ie.dk)` all: revert; font-family: Roboto, sans-serif !important; font-size: 13px !important; font-weight: 500 !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: normal !important; letter-spacing: normal !important; word-spacing: normal !important; margin: 0 !important; color: #495157 !important; `;Le.propTypes={...ie.dk.propTypes};const qe=Le,Me=(0,a.ZP)(i).attrs((()=>({as:ie.$j})))` --color: #6d7882; --padding: 13px; --font-size: 16px; --border: none; margin: 0; flex-grow: 1; transition: 0.2s all; border-radius: 0; &:focus, &:hover { --background: #f1f3f5; --color: #6d7882; } `;Me.propTypes={...ie.$j.propTypes};const De=Me,Ne=(0,a.ZP)(i).attrs((()=>({as:ie.aU})))` --font-size: 16px; --color: #b01b1b; --padding: 13px; margin: 0; flex-grow: 1; transition: 0.2s all; border: none; border-radius: 0; &:focus, &:hover { --background: #f1f3f5; --color: #b01b1b; } `;Ne.propTypes={...ie.aU.propTypes};const Ve=Ne,Ue=ie.fC;Ue.Trigger=ie.xz,Ue.Content=Ze,Ue.Description=qe,Ue.DescriptionContainer=Se,Ue.ActionsContainer=Fe,Ue.Title=Ae,Ue.Cancel=De,Ue.Action=Ve,Ue.propTypes=ie.fC.propTypes;const je=Ue;class We{init(e={}){return Object.entries(e).forEach((([e,t])=>{this[e]=t})),this}}var He=n(8003).__;class Ke extends We{id=null;name="";slug="";avatarUrls={24:null,48:null,96:null};capabilities={};static createFromResponse(e){return(new Ke).init({id:e.id,name:e.name,slug:e.slug,avatarUrls:e.avatar_urls,capabilities:{notes:{read:e.capabilities?.notes?.can_read},post:{edit:e.capabilities?.post?.can_edit}}})}static createDeleted(e=""){const{avatar_defaults:t}=window.top.$e.components.get("notes").config.urls;return(new Ke).init({name:[e,He("(deleted user)","elementor-pro")].join(" "),avatarUrls:t})}}class Qe extends We{id;type;typeTitle;static createFromResponse(e){return(new Qe).init({id:e.id,type:e.type,typeTitle:e.type_title})}}class Be extends We{id=null;parentId=0;elementId=null;content="";position={x:0,y:0};repliesCount=0;unreadRepliesCount=0;replies=[];author=null;readers=[];isRead=!1;isResolved=!1;routeUrl="";routeTitle="";userCan={};createdAt=null;updatedAt=null;lastActivityAt=null;_formattedLastActivityAt="";_formattedCreatedAt="";static createFromResponse(e){return(new Be).init({id:e.id,parentId:e.parent_id,elementId:e.element_id,content:e.content,position:e.position,repliesCount:e.replies_count,unreadRepliesCount:e.unread_replies_count,replies:e.replies.map((e=>Be.createFromResponse(e))),author:e.author?Ke.createFromResponse(e.author):Ke.createDeleted(e.author_display_name),document:e.document?Qe.createFromResponse(e.document):null,readers:e.readers?e.readers.map((e=>Ke.createFromResponse(e))):[],isRead:e.is_read,isResolved:e.is_resolved,routeUrl:e.route_url,routeTitle:e.route_title,userCan:e.user_can,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),lastActivityAt:new Date(e.last_activity_at)})}getFormattedLastActivityAt(){return this._formattedLastActivityAt||(this._formattedLastActivityAt=this.lastActivityAt.toLocaleString()),this._formattedLastActivityAt}getFormattedCreatedAt(){return this._formattedCreatedAt||(this._formattedCreatedAt=this.createdAt.toLocaleString()),this._formattedCreatedAt}getURL(){const e=this.isReply()?this.parentId:this.id;return this.constructor.getURL(e)}static getURL(e){const{route:t}=window.top.$e.components.get("notes").config;return t.note_url_pattern.replace("{{NOTE_ID}}",e)}isUnreadThread(){return this.isThread()&&(!this.isRead||this.unreadRepliesCount>0)}isThread(){return 0===this.parentId}isReply(){return!this.isThread()}}const{useEffect:Ye,useRef:Xe}=React;function Ge(e,t){const n=Xe(!0);Ye((()=>{n.current?n.current=!1:e()}),t)}function Je(){return(0,r.useMemo)((()=>window.top.$e.components.get("notes").config),[])}var et=n(108);const tt=(0,r.createContext)(null),nt=()=>(0,r.useContext)(tt),rt=e=>{const[t,n]=(0,r.useState)((()=>new Map));(0,r.useEffect)((()=>{const e=new Map;document.querySelectorAll(".elementor-element[data-id]").forEach((t=>{const{id:n}=t.dataset;e.has(n)||e.set(n,t)})),n(e)}),[]);const a=(0,r.useCallback)(((e,n=window.top.$e.components.get("notes").config.route.post_id)=>{if(!t.has(e))return n;const r=t.get(e).closest("[data-elementor-id]");return r?r.dataset.elementorId:n}),[t]),i={elements:t,getDocumentIdByElement:a};return o().createElement(tt.Provider,(0,x.Z)({value:i},e))};var ot=n(2237);const at="thread",it="new-thread";function lt(){const e=(0,ot.v9)((e=>e.notes.active)),t=(0,r.useCallback)((({type:e,data:t})=>{const n=[at,it];if(!n.includes(e))throw new Error("`setActive()` type must be one of: "+n.join(", "));return window.top.$e.run("notes/set-active",{type:e,data:t})}),[]),n=(0,r.useCallback)(((e=null)=>window.top.$e.run("notes/clear-active",{id:e})),[]),o=(0,r.useCallback)((t=>at===e?.type&&e?.data.noteId===t),[e]);return{activeThread:e,setActive:t,clearActive:n,isThreadActive:o}}function st(){const e=pt(),t=mt(),n=dt(),{getDocumentIdByElement:r}=nt(),o=Je();return(0,et.useMutation)((async({postId:e,elementId:t,content:n,position:a={x:0,y:0},routeUrl:i=o.route.url,routeTitle:l=o.route.title,routePostId:s=o.route.post_id,status:c="publish",parentId:p,isPublic:m=null})=>{e||(e=r(t));const{data:d}=await window.top.$e.data.create("notes/index",{post_id:e,element_id:t,content:n,position:a,route_post_id:s,route_url:i,route_title:l,status:c,parent_id:p,mentioned_usernames:ke(n),...null!==m?{is_public:m}:{}});return Be.createFromResponse(d.data)}),{onSuccess:r=>Promise.all(r.isThread()?[n({exact:!1}),t({exact:!1})]:[e({id:r.parentId})])})}function ct(){const e=mt(),t=pt(),n=dt();return(0,et.useMutation)((async({ids:e,isRead:t})=>(e=e.filter((e=>!!e&&e>0)),await window.top.$e.data[t?"create":"delete"]("notes/read-status",{ids:e}),e)),{onSuccess:r=>{const o=({queryKey:e})=>Object.prototype.hasOwnProperty.call(e[1]||{},"only_unread");return Promise.all([t({predicate:({queryKey:e})=>r.includes(e[1])}),n({predicate:o}),e({predicate:o,refetchActive:!1})])}})}function pt(){const e=(0,et.useQueryClient)();return(0,r.useCallback)((({id:t,...n})=>{const r=["note"];return t&&r.push(t),e.invalidateQueries(r,n)}),[e])}function mt(){const e=(0,et.useQueryClient)();return(0,r.useCallback)(((t={})=>e.invalidateQueries(["notes"],t)),[e])}function dt(){const e=(0,et.useQueryClient)();return(0,r.useCallback)(((t={})=>e.invalidateQueries(["notes/summary"],t)),[e])}var ut=n(8003).__,ft=n(216);function gt(e){const t=function(){const e=mt(),t=pt(),n=dt(),{clearActive:r}=lt();return(0,et.useMutation)((async({id:e,parentId:t,force:n=!1})=>(await window.top.$e.data.delete("notes/index",Ce({id:e,force:n})),{id:e,parentId:t})),{onSuccess:({id:o,parentId:a})=>{r(o);const i=!a;return Promise.all(i?[n({exact:!1}),e({exact:!1})]:[t({id:a})])}})}();return Ge((()=>{e.onLoadingChange&&e.onLoadingChange(t.isLoading)}),[t.isLoading]),o().createElement(je,{open:e.isOpen,onOpenChange:e.onOpenChange},o().createElement(je.Content,null,o().createElement(je.DescriptionContainer,null,o().createElement(je.Title,null,e.note.isReply()?ut("Delete this reply?","elementor-pro"):ut("Delete this note?","elementor-pro")),o().createElement(je.Description,null,e.note.isReply()?ut("Deleted replies can't be recovered.","elementor-pro"):ut("Deleted notes can't be recovered.","elementor-pro"))),o().createElement(je.ActionsContainer,null,o().createElement(je.Cancel,null,ut("Cancel","elementor-pro")),o().createElement(je.Action,{onClick:()=>{window.top.$e.run("notes/delete",{noteId:e.note.id}),t.mutateAsync({id:e.note.id,parentId:e.note.parentId,force:!0})}},ut("Delete","elementor-pro")))))}gt.propTypes={isOpen:ft.bool.isRequired,onOpenChange:ft.func.isRequired,note:ft.instanceOf(Be),onLoadingChange:ft.func};var ht=n(8003).__,vt=n(216);function bt(e){const t=e.note.isRead,n=ct();return o().createElement(ae.Item,{icon:"eicon-envelope",disabled:n.isLoading,onSelect:()=>n.mutateAsync({ids:[e.note.id,e.note.parentId],isRead:!t})},ht(t?"Mark as unread":"Mark as read","elementor-pro"))}bt.propTypes={note:vt.shape({id:vt.number,parentId:vt.number,isRead:vt.bool}).isRequired};var yt=n(8003).__,xt=n(216);function wt(e){const t=e.note.isResolved,n=function(){const e=mt(),t=pt(),n=dt();return(0,et.useMutation)((async({id:e,isResolved:t})=>{const{data:n}=await window.top.$e.data.update("notes/index",{is_resolved:t},{id:e});return Be.createFromResponse(n.data)}),{onSuccess:r=>{const o=({queryKey:e})=>Object.prototype.hasOwnProperty.call(e[1]||{},"is_resolved");return Promise.all([t({id:r.id}),e({predicate:o}),n({predicate:o})])}})}(),{clearActive:r}=lt();return Ge((()=>{e.onLoadingChange&&e.onLoadingChange(n.isLoading)}),[n.isLoading]),o().createElement(B,null,o().createElement(B.Trigger,{asChild:!0},o().createElement(P,{name:t?"eicon-check-circle-o":"eicon-check",disabled:n.isLoading,onClick:async()=>{const o=!t;o?window.top.$e.run("notes/resolve",{noteId:e.note.id}):window.top.$e.run("notes/re-open",{noteId:e.note.id}),await n.mutateAsync({id:e.note.id,isResolved:o}),o&&r(e.note.id)}})),o().createElement(B.Content,null,yt(t?"Re-open":"Resolve","elementor-pro"),o().createElement(B.Arrow,null)))}wt.propTypes={note:xt.instanceOf(Be).isRequired,onLoadingChange:xt.func};var Et=n(8003).__,kt=n(216);const Ct=(0,a.ZP)(B.Content)` max-width: 200px; `,Rt=(0,a.ZP)(w)` padding: 4px !important; color: #a4afb7 !important; transition: 0.2s all !important; display: grid !important; place-items: center !important; font-size: 18px !important; border-radius: 100% !important; &:hover, &:focus { color: #6d7882; outline: none; background: #f1f3f5; } `;function Pt(e){return 0===e.readers.length?null:o().createElement(B,{delayDuration:400},o().createElement(B.Trigger,{asChild:!0},o().createElement(Rt,{className:"eicon-preview-medium",tabIndex:0})),o().createElement(Ct,null,o().createElement("strong",null,Et("Seen by","elementor-pro")+": "),e.readers.map((e=>e.name)).join(", "),o().createElement(B.Arrow,null)))}Pt.propTypes={readers:kt.arrayOf(kt.shape({name:kt.string})).isRequired};const Tt="create",_t="edit",zt="delete",$t="create_users",Zt="edit_users",It=(e,t=null)=>{const n=Je();return(0,r.useMemo)((()=>t?!!t.userCan[e]:!!n.current_user_can[e]),[e,t,n])};function At(){return!!navigator?.clipboard}var Ot=n(8003).__,St=n(216);function Ft(e){const{direction:t}=Je(),{setIsDisabled:n}=(0,r.useContext)(Or),[a,i]=(0,r.useState)(!1),l=It(zt,e.note),s=It(_t,e.note),c=e.note.isThread()&&s,p=s||l||e.note.isThread();return(0,r.useEffect)((()=>()=>n(!1)),[]),o().createElement(o().Fragment,null,c&&o().createElement(wt,{note:e.note,onLoadingChange:e=>n(e)}),o().createElement(Pt,{readers:e.note.readers}),p&&o().createElement(ae,{modal:!1,dir:t,onOpenChange:e=>{e?window.top.$e.run("notes/open-note-actions"):window.top.$e.run("notes/close-note-actions")}},o().createElement(ae.Trigger,{asChild:!0},o().createElement(P,{name:"eicon-ellipsis-h"})),o().createElement(ae.Content,{align:"end"},e.note.isThread()&&o().createElement(bt,{note:e.note}),s&&o().createElement(ae.Item,{onSelect:()=>e.setIsEditMode(!0),icon:"eicon-edit"},Ot("Edit","elementor-pro")),e.note.isThread()&&o().createElement(ae.Item,{onSelect:()=>{window.top.$e.run("notes/copy-link",{id:e.note.id})},icon:"eicon-copy",disabled:!At(),tooltip:!At()&&Ot('Supported in "https" sites only',"elementor-pro")},Ot("Copy Link","elementor-pro")),l&&o().createElement(o().Fragment,null,o().createElement(ae.Separator,null),o().createElement(ae.Item,{onSelect:()=>i(!0),icon:"eicon-trash",variant:"danger"},Ot("Delete","elementor-pro"))),o().createElement(ae.Arrow,null))),l&&o().createElement(gt,{note:e.note,isOpen:a,onOpenChange:i,onLoadingChange:e=>n(e)}))}Ft.propTypes={note:St.instanceOf(Be).isRequired,setIsEditMode:St.func.isRequired};var Lt=n(216);const qt=(0,a.ZP)(Oe)` --font: 300 12px Roboto, sans-serif; --line-height: 1.5; --padding-block: 8px; font-size: 12px !important; border-radius: 4px !important; border: 1px solid #c2cbd2 !important; transition: .3s border-color, .3s opacity !important; padding: var(--padding-block) 12px !important; overflow: auto !important; width: 100% !important; box-sizing: border-box !important; ${({maxRows:e})=>e&&a.iv` --max-rows: ${e}; max-height: calc((1em * var(--line-height) * var(--max-rows)) + (var(--padding-block) * 2)) !important; `}; textarea { all: revert; border: none !important; font: var( --font ) !important; line-height: var(--line-height) !important; padding: 0 !important; margin: 0 !important; color: #6d7882 !important; display: block !important; height: 100% !important; &::placeholder { color: #c2cbd2 !important; } } &:focus-within { border-color: #a4afb6 !important; // Accessibility-friendly, since the Container itself has a border on focus. textarea:focus { outline: none !important; border: none !important; } } ${({disabled:e})=>e&&a.iv` opacity: .5 !important; pointer-events: none !important; `} ${({autoSize:e})=>e&&a.iv` display: inline-grid !important; vertical-align: top !important; align-items: center !important; textarea { grid-area: 2 / 1 !important; resize: none !important; background: none !important; appearance: none !important; box-shadow: none !important; overflow: hidden !important; &::placeholder { all: revert; } } &::after { content: attr(data-value) ' ' !important; display: block !important; font: var( --font ) !important; white-space: pre-wrap !important; grid-area: 2 / 1 !important; visibility: hidden !important; line-height: var(--line-height) !important; }`}`,Mt=o().forwardRef((({maxRows:e,autoSize:t,...n},a)=>{const i=(0,r.useRef)();return o().createElement(qt,{maxRows:e,"data-value":n.value||n.defaultValue,autoSize:t,ref:i,disabled:n.disabled},o().createElement("textarea",(0,x.Z)({},n,{ref:a,onInput:e=>{n.onInput&&n.onInput(e),i.current.dataset.value=e.target.value}})))}));Mt.displayName="Textarea",Mt.propTypes={disabled:Lt.bool,autoSize:Lt.bool,maxRows:Lt.number,onInput:Lt.func,value:Lt.string,defaultValue:Lt.string};const Dt=Mt;const Nt={enabled:!0,params:{}};function Vt(e,t){const n=(0,r.useRef)();return(0,r.useCallback)(((...r)=>{clearTimeout(n.current),n.current=setTimeout((()=>{clearTimeout(n.current),e(...r)}),t)}),[e,t])}const Ut=a.ZP.ul` all: revert; padding: 0 !important; margin: 0 !important; list-style: none !important; width: 272px !important; z-index: 1 !important; // Just needs any 'z-index' value in order to appear above other things. background: #ffffff !important; border-radius: 3px !important; box-shadow: 0 1px 20px rgba(0, 0, 0, 0.15) !important; `;var jt=n(216);const Wt=a.ZP.li` all: revert; font-family: Roboto, sans-serif !important; font-size: 12px !important; color: #6d7882 !important; background: #ffffff !important; padding: 8px !important; cursor: pointer !important; &:first-child { border-top-right-radius: inherit; border-top-left-radius: inherit; } &:last-child { border-bottom-right-radius: inherit; border-bottom-left-radius: inherit; } &[role="option"]:hover, &[aria-selected="true"] { background: #58d0f5 !important; &, & * { color: #ffffff !important; } } &[aria-disabled="true"] { cursor: not-allowed !important; opacity: .5 !important; } `;function Ht({children:e,value:t,disabled:n,...r}){return o().createElement(Wt,(0,x.Z)({role:n?"listitem":"option","data-value":t},n?{"aria-disabled":!0}:{},r),e)}Ht.propTypes={value:jt.string.isRequired,disabled:jt.bool,children:jt.oneOfType([jt.node,jt.arrayOf(jt.node)]).isRequired},Ht.defaultProps={value:""};const Kt=(0,a.ZP)(Ht).attrs((()=>({role:"contentinfo"})))` font-family: Roboto, sans-serif !important; background: #f1f3f5 !important; text-align: center !important; font-size: 12px !important; line-height: 1.5 !important; `;n(4406);var Qt=n(216);const Bt=e=>{const t=(0,r.useRef)(null),n=(0,r.useRef)(null),a=Vt((({resolve:t,text:r})=>{n.current||(n.current=document.createElement("div"));const o=e.fragment({search:r});ReactDOM.render(o,n.current),t({matched:!0,fragment:n.current})}),e.debounce),i=e=>{const{provide:t,text:n}=e.detail;t(new Promise((e=>a({resolve:e,text:n}))))},l=t=>{const{item:n}=t.detail;t.detail.value=`${e.handle}${n.dataset.value}`,e.onSelect(n,t)};return(0,r.useEffect)((()=>(t.current.addEventListener("text-expander-change",i),t.current.addEventListener("text-expander-value",l),()=>{t.current&&(t.current.removeEventListener("text-expander-change",i),t.current.removeEventListener("text-expander-value",l))})),[]),o().createElement("text-expander",{keys:e.handle,ref:t,multiword:e.multiword?e.handle:null},e.children)};Bt.List=Ut,Bt.ListItem=Ht,Bt.ListFooter=Kt,Bt.propTypes={fragment:Qt.func.isRequired,debounce:Qt.number.isRequired,handle:Qt.string.isRequired,multiword:Qt.bool.isRequired,children:Qt.node.isRequired,onSelect:Qt.func.isRequired},Bt.defaultProps={debounce:0,handle:"@",multiword:!1,onSelect:()=>{}};const Yt=Bt;var Xt=n(8003).__,Gt=n(216);const Jt=a.ZP.div` display: flex !important; position: absolute !important; width: 100% !important; height: 100% !important; inset-inline-start: 0 !important; margin: 0 !important; padding: 0 !important; font-size: 11px !important; // Fixes bug with the position of Popover with portalled=false inside another Popover // @see https://github.com/radix-ui/primitives/issues/370 [data-radix-popper-content-wrapper] { transform: translateY(-100%) !important; top: 10px !important; inset-inline-start: auto !important; inset-inline-end: -10px !important; } `,en=a.ZP.div` overflow: hidden !important; position: relative !important; flex: 1 !important; height: 100% !important; &::before { content: '' !important; position: absolute !important; width: 100vw !important; height: 100vh !important; top: 50% !important; transform: translateY(-50%) !important; inset-inline-end: 0 !important; box-shadow: inset 0 0 60px 40px #f1f3f5 !important; } `,tn=a.ZP.div` display: inline-flex !important; align-items: center !important; white-space: pre-wrap !important; padding: 10px !important; background: #f1f3f5 !important; `,nn=a.ZP.a.attrs((()=>({target:"_blank",rel:"noreferrer"})))` color: #6d7882 !important; background: #f1f3f5 !important; padding: 10px !important; display: inline-flex !important; align-items: center !important; &:hover, &:focus { color: #58d0f5 !important; text-decoration: none !important; } `,rn=(0,a.ZP)(B.Content)` background: #ffffff !important; color: #6d7882 !important; line-height: 1.3 !important; font-style: italic !important; padding: 12px !important; box-shadow: 0 1px 20px rgba(0, 0, 0, 0.15) !important; max-width: 262px !important; box-sizing: border-box !important; &::after { content: '' !important; position: absolute !important; width: 10px !important; height: 10px !important; border: 5px solid transparent !important; border-top-color: #ffffff !important; bottom: -9px !important; inset-inline-end: 20px !important; } `,on=a.ZP.a.attrs((()=>({target:"_blank"})))` all: revert; display: block !important; text-decoration: none !important; color: #58d0f5 !important; &:hover, &:focus { text-decoration: underline !important; } `;function an(e){const{urls:t}=Je(),n=e.user.capabilities.post.edit,r=It(Zt),a=r&&n,i=r?t.help_notes_features:"",l=Xt(a?"Give access to Notes":"Can't mention them","elementor-pro"),s=function(e){const t=e.notes.read,n=e.post.edit,r=It(Zt);if(!r)return Xt("Contact the site admin to give this person the right permissions.","elementor-pro");if(!n)return Xt(t?"They need permission to view this post.":"This person needs: (1) permission to view this post, as well as (2) access to use Notes.","elementor-pro");return""}(e.user.capabilities);return o().createElement(Jt,{role:"tooltip","aria-label":l},o().createElement(en,null),a?o().createElement(nn,{href:`${t.admin_url_edit_user}?user_id=${e.user.id}#e-notes`,className:"elementor-clickable"},l+" ",o().createElement(w,{className:"eicon-editor-external-link"})):o().createElement(B,{delayDuration:0},o().createElement(B.Trigger,{onMouseDown:e=>e.preventDefault(),asChild:!0},o().createElement(tn,{"aria-label":s},l+" ",o().createElement(w,{className:"eicon-help-o"}),o().createElement(rn,{portalled:!1},s,i&&o().createElement(on,{href:i,className:"elementor-clickable"},Xt("Learn more","elementor-pro")))))))}an.propTypes={user:Gt.instanceOf(Ke).isRequired};var ln=n(8003).__,sn=n(216);const cn={limit:5,order_by:"user_registered",order:"desc"},pn=(0,a.ZP)(Yt.List)` position: absolute !important; top: 100% !important; `,mn=(0,a.ZP)(Oe)` display: flex !important; flex-direction: column !important; justify-content: space-between !important; gap: 2px !important; &::before, &::after { display: none !important; } `,dn=(0,a.ZP)(Yt.ListItem)` display: flex !important; flex-direction: row !important; align-items: center !important; gap: 10px !important; position: relative !important; &[aria-disabled='true'] { opacity: 1 !important; &:hover { background-color: #f1f3f5 !important; } ${mn} { opacity: .5 !important; } &:not(:hover) { > [role='tooltip'] { display: none !important; } } } `,un=a.ZP.span` all: revert; padding: 0 !important; margin: 0 !important; font-size: 12px !important; font-weight: 500 !important; color: inherit !important; `,fn=a.ZP.span` font-size: 10px !important; color: #a4afb6 !important; `,gn=a.ZP.a.attrs((()=>({target:"_blank",rel:"noreferrer"})))` all: revert; color: #58d0f5 !important; font-family: Roboto, sans-serif !important; font-size: 1em !important; font-weight: normal !important; text-transform: none !important; font-style: normal !important; text-decoration: underline !important; line-height: normal !important; letter-spacing: normal !important; word-spacing: normal !important; &:hover, &:focus { color: #6d7882 !important; text-decoration: underline; // Repeat in order to override theme styles. } `,hn=a.ZP.strong` font-weight: 500 !important; `;function vn(e){var t;const{route:n,urls:a}=Je(),i=It($t),{data:l=[],isSuccess:s}=function(e={}){const t=(0,r.useMemo)((()=>({...Nt,...e})),[e]),n=(0,r.useMemo)((()=>Ce(t.params||{})),[t.params]);return(0,et.useQuery)(["users",n],(async({queryKey:[,e],signal:t})=>{const{data:n}=await window.top.$e.data.get("notes/users",e,{refresh:!0,signal:t});return n.data.map((e=>Ke.createFromResponse(e)))}),{keepPreviousData:!0,enabled:t.enabled})}({params:{...cn,search:e.search,post_id:null!==(t=n.post_id)&&void 0!==t?t:null}});return o().createElement(pn,null,l.map((e=>{const t=!e.capabilities.notes.read||!e.capabilities.post.edit;return o().createElement(dn,{key:e.id,value:e.slug,disabled:t},o().createElement(N,{size:"md",src:e.avatarUrls[48]}),o().createElement(mn,null,o().createElement(un,null,e.name),o().createElement(fn,null,e.slug)),t&&o().createElement(an,{user:e}))})),s&&o().createElement(Yt.ListFooter,null,o().createElement(hn,null,ln("Can't find someone?","elementor-pro")),o().createElement("br",null),o().createElement("span",null,i?o().createElement(o().Fragment,null,ln("Add them from the","elementor-pro")," ",o().createElement(gn,{href:a.admin_url_create_user,className:"elementor-clickable"},ln("WP Dashboard","elementor-pro"))):ln("Ask the site admin to add them","elementor-pro"))))}vn.propTypes={search:sn.string};const bn=new et.QueryClient({defaultOptions:{queries:{retry:2,refetchOnWindowFocus:!0},mutations:{retry:2}}});var yn=n(8003).__,xn=n(216);const wn=(0,a.ZP)(Oe)` position: relative; `;function En(e){const t=function(e){const t=(0,r.useRef)();return(0,r.useEffect)((()=>{if(t.current){const n=e?e.length:0;t.current.focus(),t.current.setSelectionRange(n,n)}}),[]),t}(e.defaultValue),n=e.isReply?yn("Type your reply. Use @ to mention...","elementor-pro"):yn("Type a note. Use @ to mention...","elementor-pro");return o().createElement(wn,null,o().createElement(Yt,{debounce:250,fragment:({search:e})=>o().createElement(et.QueryClientProvider,{client:bn},o().createElement(vn,{search:e})),onSelect:()=>window.top.$e.run("notes/choose-mention")},o().createElement(Dt,{name:"content",placeholder:n,onKeyDown:t=>{e.onMetaAndEnterKeyDown&&(t.metaKey||t.ctrlKey)&&"enter"===t.key.toLowerCase()&&e.onMetaAndEnterKeyDown(t)},disabled:e.disabled,ref:t,defaultValue:e.defaultValue,onChange:e.onChange,rows:1,maxRows:6,autoSize:!0})))}function kn(){const e=(0,ot.I0)(),{actions:t}=window.top.$e.store.get("notes"),n=(0,ot.v9)((e=>e.notes.formsInWritingMode)),o=(0,r.useCallback)((e=>n.includes(e)),[n]),a=(0,r.useCallback)((n=>e(t.addFormToWritingMode(n))),[e]),i=(0,r.useCallback)((n=>e(t.removeFormFromWritingMode(n))),[e]);return{formsInWritingMode:n,isInWritingMode:o,addToWritingMode:a,removeFromWritingMode:i}}En.propTypes={name:xn.string,disabled:xn.bool,onMetaAndEnterKeyDown:xn.func,defaultValue:xn.string,onChange:xn.func,isReply:xn.bool.isRequired},En.defaultProps={isReply:!1};var Cn=n(216);const Rn=a.ZP.form` all: revert; display: flex !important; flex-direction: column !important; gap: 16px !important; `;function Pn({onReset:e,onChange:t,onSubmit:n,...r}){const{isInWritingMode:a,addToWritingMode:i,removeFromWritingMode:l}=kn();return o().createElement(Rn,(0,x.Z)({},r,{onReset:t=>{l(r.id);const n=t.currentTarget.content;if(void 0!==n){const e=new Event("input",{bubbles:!0});n.value="",n.dispatchEvent(e)}e?.(t)},onChange:e=>{const n=e.target.value.trim()!==e.target.defaultValue,o=a(r.id);n&&!o&&i(r.id),!n&&o&&l(r.id),t?.(e)},onSubmit:async e=>{if(e.preventDefault(),!a(r.id))return;const t=e.currentTarget,o=t.content.value.trim();await(n?.(e,{form:t,content:o}))}}))}function Tn(e){return(0,r.useMemo)((()=>{const t=document.createElement("textarea");t.innerHTML=e;const{value:n}=t;return t.remove(),n}),[e])}Pn.ButtonsContainer=(0,a.ZP)(Oe)` display: flex !important; flex-direction: row-reverse !important; justify-content: end !important; gap: 8px !important; `,Pn.propTypes={id:Cn.string.isRequired,onChange:Cn.func,onReset:Cn.func,onSubmit:Cn.func};var _n=n(8003).__,zn=n(216);function $n(e){const t=`e-notes-edit-${e.note.id}`,n=Tn(e.note.content),r=function(){const e=pt();return(0,et.useMutation)((async({id:e,values:{content:t}})=>{const{data:n}=await window.top.$e.data.update("notes/index",{content:t,mentioned_usernames:ke(t)},{id:e});return Be.createFromResponse(n.data)}),{onSuccess:t=>e({id:t.isThread()?t.id:t.parentId})})}(),{isInWritingMode:a}=kn();return o().createElement(Pn,{onSubmit:async(t,{content:n,form:o})=>{window.top.$e.run("notes/edit",{noteId:e.note.id}),await r.mutateAsync({id:e.note.id,values:{content:n}}),o.reset(),e.onClose()},id:t},o().createElement(En,{disabled:r.isLoading,defaultValue:n,onMetaAndEnterKeyDown:e=>Pe(e.currentTarget.form),isReply:e.note.isReply()}),o().createElement(Pn.ButtonsContainer,null,o().createElement(m,{disabled:r.isLoading||!a(t),type:"submit"},_n("Save","elementor-pro")),o().createElement(m,{disabled:r.isLoading,variant:"outlined",type:"reset",onClick:t=>{window.top.$e.run("notes/cancel-edit",{noteId:e.note.id}),t.target.form.reset(),e.onClose(t)}},_n("Cancel","elementor-pro"))))}$n.propTypes={note:zn.instanceOf(Be).isRequired,onClose:zn.func.isRequired};const Zn=a.ZP.p` --color-gray-600: #6d7882; font-family: Roboto, sans-serif !important; font-size: 12px !important; font-weight: 400 !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: 1.5 !important; letter-spacing: normal !important; word-spacing: normal !important; color: var(--color-gray-600); margin: 0 0 .5em 0 !important; `,In=a.ZP.span` color: #58d0f5; `,An=a.ZP.a` all: revert; --color-editor-info: #58d0f5; --color-editor-info-dark: #10bcf2; font-family: Roboto, sans-serif !important; font-size: 1em !important; font-weight: normal !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: normal !important; letter-spacing: normal !important; word-spacing: normal !important; cursor: pointer; &, &:visited { color: var( --color-editor-info ) !important; } &:hover, &:focus { color: var( --color-editor-info-dark ) !important; } `;An.defaultProps={target:"_blank",rel:"noopener noreferrer",className:"elementor-clickable"};const On=An;var Sn=n(216);function Fn(e){return o().createElement(On,{href:e.token.value},e.children)}Fn.propTypes={children:Sn.node.isRequired,token:Sn.shape({value:Sn.string}).isRequired};var Ln=n(216);function qn(e){return o().createElement(On,{href:`mailto:${e.token.value}`},e.children)}qn.propTypes={children:Ln.node.isRequired,token:Ln.shape({value:Ln.string}).isRequired};var Mn=n(216);const Dn=a.F4` 0% { opacity: 1; background-position: 40% 66%, 54% 40%, 32% 36%, 46% 38%, 38% 55%, 60% 32%, 43% 34%, 31% 35%, 53% 63%, 58% 42%, 56% 37%, 40% 50%, 46% 46%, 36% 59%, 43% 50%, 63% 70%, 44% 40%, 51% 30%, 38% 45%, 37% 62%, 46% 34%, 45% 45%, 43% 44%, 43% 53%, 64% 42%, 31% 36%, 38% 54%, 40% 34%, 64% 48%, 43% 47%, 43% 50%, 56% 40%, 35% 68%, 68% 69%, 63% 35%, 32% 61%, 67% 57%, 51% 43%, 53% 45%, 47% 40%, 33% 42%, 35% 65%, 67% 47%, 30% 44%, 67% 52%, 41% 46%, 44% 55%, 38% 40%, 39% 37%, 37% 35%; } 45% { opacity: 1; background-size: var(--radius) var(--radius); } 100% { opacity: 0; background-size: 0 0; background-position: 8% 105%, 83% 50%, 53% 74%, 44% 9%, 6% 67%, 13% 62%, 88% 47%, 60% 18%, 78% 50%, 105% 11%, 59% 22%, 47% 98%, 77% 84%, 51% 60%, 70% 10%, 91% 103%, 8% 16%, 61% 1%, -5% 52%, 75% 74%, 58% 52%, 74% 30%, 51% 55%, 13% 78%, 28% 86%, 40% 1%, 24% 38%, 58% 6%, 70% 42%, 11% 22%, 73% 59%, 10% 57%, 72% 22%, 48% 26%, 44% -7%, 72% 29%, 50% 74%, 99% 87%, 17% 36%, 4% -8%, -11% 22%, 79% 95%, 19% 60%, 30% 4%, 110% 5%, 0% 71%, 82% 56%, 9% 68%, 69% 41%, 19% 61%; } `,Nn=a.ZP.span` display: inline-block !important; position: relative !important; isolation: isolate !important; box-sizing: border-box !important; &::before { --radius: 2px; --color-1: #d50000; --color-2: #c51162; --color-3: #aa00ff; --color-4: #2962ff; --color-5: #00c853; --color-6: #ffd600; content: '' !important; position: absolute !important; inset: -25px !important; pointer-events: none !important; opacity: 0; z-index: -1 !important; transform: scale(1.5) !important; background-repeat: no-repeat !important; background-size: calc(2 * var(--radius)) calc(2 * var(--radius)); background-image: radial-gradient( circle at center, var( --color-6 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-6 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-3 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-4 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-2 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-5 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-1 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-2 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-1 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-1 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-5 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-6 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-5 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-1 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-4 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-1 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-2 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-1 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-3 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-6 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-6 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-4 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-4 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-2 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-3 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-2 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-5 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-5 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-4 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-1 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-6 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-6 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-4 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-3 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-6 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-6 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-4 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-5 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-3 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-3 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-2 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-4 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-2 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-4 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-6 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-4 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-2 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-1 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-6 ) 49%,transparent 50% ), radial-gradient( circle at center, var( --color-5 ) 49%,transparent 50% ) !important; ${({isAnimated:e})=>e&&a.iv` animation: ${Dn} ease 1s forwards !important; `} } `;function Vn(e){const[t,n]=(0,r.useState)(!1);return o().createElement(Nn,{isAnimated:t,onMouseEnter:()=>n(!0),onAnimationEnd:()=>n(!1)},e.children)}Vn.propTypes={children:Mn.node.isRequired,token:Mn.shape({value:Mn.string}).isRequired};var Un=n(216);const jn={Paragraph:Zn,Mention:In,Url:Fn,Email:qn,Wow:Vn,default:({children:e})=>e};function Wn(e){const t=(0,r.useMemo)((()=>jn[e.token.type]||jn.default),[e.token.type]);return o().createElement(t,{token:e.token},Array.isArray(e.token.value)?e.token.value.map(((e,t)=>o().createElement(Wn,{token:e,key:t}))):e.token.value)}const Hn={};Hn.value=Un.oneOfType([Un.string,Un.arrayOf(Un.shape(Hn))]),Wn.propTypes={token:Un.shape(Hn)};var Kn=n(216);const Qn=we(),Bn=(0,a.ZP)(Oe)` white-space: normal; word-break: break-word; word-wrap: break-word; ${({disableInteractions:e})=>e&&a.iv` pointer-events: none; `}; `;function Yn(e){const t=(0,r.useMemo)((()=>Qn.parse(e.children)),[e.children]);return o().createElement(Bn,{disableInteractions:e.disableInteractions,className:e.className},t&&o().createElement(Wn,{token:t}))}Yn.propTypes={children:Kn.string.isRequired,disableInteractions:Kn.bool,className:Kn.string},Yn.defaultProps={disableInteractions:!1};const Xn=Yn;var Gn=n(8003).__,Jn=n(216);const er=a.ZP.p` all: revert; color: #a4afb6 !important; margin: 0 !important; padding: 0 !important; font-family: Roboto, sans-serif !important; font-size: 10px !important; font-weight: normal !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: 1.5 !important; letter-spacing: normal !important; word-spacing: normal !important; `,tr=a.ZP.strong` font-weight: 500; `;function nr(e){const{route:t}=Je(),n=e.note.document?.id===t.post_id,r=e.note.routeUrl===t.url;return!e.note.document||n&&r?null:o().createElement(er,null,Gn("Noted on:","elementor-pro")," ",o().createElement(tr,null,n?e.note.routeTitle:e.note.document.typeTitle))}nr.propTypes={note:Jn.instanceOf(Be).isRequired};var rr=n(216);const or={sm:{text:9},md:{text:12}},ar=(0,a.ZP)(Oe)` --color-gray-500: #a4afb6; --color-gray-600: #6d7882; display: flex !important; align-items: start !important; gap: 12px !important; &, & *:not( [class*="eicon"] ) { font-family: Roboto, sans-serif !important; } `,ir=(0,a.ZP)(Oe)` display: flex !important; flex-direction: column !important; gap: 12px !important; flex-grow: 1 !important; line-height: 1 !important; `,lr=(0,a.ZP)(Oe)` display: flex !important; gap: 10px !important; padding-top: 4px !important; line-height: 1 !important; `,sr=(0,a.ZP)(Oe)` display: flex !important; flex-direction: column !important; gap: 5px !important; flex-grow: 1 !important; line-height: 1 !important; `,cr=(0,a.ZP)(Oe)` display: flex !important; gap: 5px !important; flex-shrink: 0 !important; align-items: center !important; line-height: 1 !important; `,pr=a.ZP.span` color: var(${({muted:e})=>e?"--color-gray-500":"--color-gray-600"}) !important; margin: 0 !important; padding: 0 !important; ${({size:e})=>e&&a.iv` font-size: ${or[e].text}px !important; `}; ${({weight:e})=>e&&a.iv` font-weight: ${e} !important; `}; ${({lineHeight:e})=>a.iv` line-height: ${e||1} !important; `}; `;function mr(e){const[t,n]=(0,r.useState)(!1),a=Tn(e.note.content);return o().createElement(ar,null,o().createElement(N,{size:"md",src:e.note.author.avatarUrls[48]}),o().createElement(ir,null,o().createElement(lr,null,o().createElement(sr,null,o().createElement(pr,{size:"md",weight:500},e.note.author.name),o().createElement(pr,{size:"sm",lineHeight:1.5,muted:!0},e.note.getFormattedCreatedAt())),o().createElement(cr,null,!t&&o().createElement(Ft,{note:e.note,setIsEditMode:n}))),!t&&o().createElement(Xn,null,a),t&&o().createElement($n,{note:e.note,onClose:()=>n(!1)}),o().createElement(nr,{note:e.note})))}function dr(e){const t=(0,et.useQueryClient)(),n=function(e){return(0,r.useCallback)((t=>{t.isReply()||e.setQueriesData({queryKey:["notes"],exact:!1,active:!0},(e=>e?e.map((e=>e.id===t.id?t:e)):e))}),[e])}(t),o=function(e,t){return(0,r.useCallback)((()=>e.getQueryData("notes",{active:!0,exact:!1})?.find((e=>e.id===t))),[e,t])}(t,e);return(0,et.useQuery)(["note",e],(async({queryKey:[,e],signal:t})=>{const{data:n}=await window.top.$e.data.get("notes/index",{id:e},{refresh:!0,signal:t});return Be.createFromResponse(n.data)}),{onSuccess:n,placeholderData:o})}mr.propTypes={note:rr.instanceOf(Be).isRequired};var ur=n(8003).__,fr=n(216);function gr(e){const t=`e-notes-new-reply-for-${e.thread.id}`,n=st(),{clearActive:r}=lt(),{isInWritingMode:a}=kn();return o().createElement(Pn,{id:t,onSubmit:async(t,{content:r,form:o})=>{window.top.$e.run("notes/reply",{parentId:e.thread.id}),await n.mutateAsync({elementId:e.thread.elementId,parentId:e.thread.id,content:r}),o.reset()}},o().createElement(En,{disabled:n.isLoading,onMetaAndEnterKeyDown:e=>Pe(e.currentTarget.form),isReply:!0}),a(t)&&o().createElement(Pn.ButtonsContainer,null,o().createElement(m,{disabled:n.isLoading,type:"submit"},ur("Reply","elementor-pro")),o().createElement(m,{disabled:n.isLoading,variant:"outlined",type:"reset",onClick:t=>{window.top.$e.run("notes/cancel-reply",{parentId:e.thread.id}),t.target.form.reset(),r()}},ur("Cancel","elementor-pro"))))}gr.propTypes={thread:fr.instanceOf(Be)};var hr=n(8003).__,vr=n(216);const br=(0,a.ZP)(w).attrs({className:"eicon-loading eicon-animation-spin"})` align-self: center !important; color: #a4afb6 !important; `,yr=a.ZP.p` all: revert; font-family: Roboto, sans-serif !important; font-size: 12px !important; font-weight: normal !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: normal !important; letter-spacing: normal !important; word-spacing: normal !important; color: #6d7882 !important; margin: 0 !important; padding: 0 !important; `;function xr(e){const{isLoading:t,isPlaceholderData:n,isFetching:a,data:i,isSuccess:l,isError:s}=dr(e.threadId),c=0!==i.repliesCount;return function({thread:e,shouldTrigger:t}){const n=(0,r.useRef)(!1),o=ct();(0,r.useEffect)((()=>{if(n.current||!t)return;const r=[e,...e.replies||[]].filter((e=>!e.isRead)).map((e=>e.id));0!==r.length&&o.mutate({ids:r,isRead:!0}),n.current=!0}),[e,t])}({thread:i,shouldTrigger:l&&!n&&!a}),t?o().createElement(br,null):s?o().createElement(yr,null,hr("Something went wrong.","elementor-pro")):o().createElement(o().Fragment,null,o().createElement(mr,{note:i,key:i.id}),c&&n&&o().createElement(br,null),i.replies.map((e=>o().createElement(mr,{key:e.id,note:e}))),o().createElement(gr,{thread:i}))}xr.propTypes={threadId:vr.number.isRequired};const wr="e-notes--disable-new-thread",Er="e-route-notes--notable";function kr(){const e=function(){const e=It(Tt),{activeThread:t}=lt();return(0,r.useMemo)((()=>e&&!t),[e,t])}(),{elements:t}=nt(),{setActive:n}=lt(),o=e=>{const t=e.ctrlKey||e.metaKey||e.altKey,n=e.target.closest(`.${wr}`);return t||n};(0,r.useEffect)((()=>{const e=e=>{o(e)||(e.preventDefault(),e.stopPropagation())};return t.forEach((t=>{t.addEventListener("click",e)})),()=>{t.forEach((t=>{t.removeEventListener("click",e)}))}}),[t]),(0,r.useEffect)((()=>{const r=e=>{1===e.buttons&&!o(e)&&(e.preventDefault(),e.stopPropagation(),n({type:it,data:{elementId:e.currentTarget.dataset.id,position:Cr(e)}}))};return t.size&&e&&(t.forEach((e=>{e.addEventListener("pointerdown",r)})),document.body.classList.add(Er)),()=>{t.forEach((e=>{e.removeEventListener("pointerdown",r)})),document.body.classList.remove(Er)}}),[t,e])}function Cr(e){const t=e.currentTarget.getBoundingClientRect();return{x:(e.clientX-t.left)/t.width*100,y:(e.clientY-t.top)/t.height*100}}function Rr(e=!0,{onlyIfNeeded:t=!0,...n}={}){const o=(0,r.useRef)(null);return(0,r.useEffect)((()=>{e&&setTimeout((()=>{Re(o.current,{onlyIfNeeded:t,...n})}))}),[e]),o}const Pr={keyframes:[{transform:"scale(1)",opacity:"1"},{transform:"scale(1.05)",opacity:"0.85"},{transform:"scale(1)",opacity:"1"}],options:{easing:"ease-in-out",duration:500}};function Tr(e){const{direction:t}=Je(),{formsInWritingMode:n}=kn(),a=(0,r.useRef)();return o().createElement(L.Content,(0,x.Z)({},e,{align:"rtl"===t?"end":"start",alignOffset:18,sideOffset:15,ref:a,onInteractOutside:async e=>{0!==n.length&&(e.preventDefault(),0===a.current.getAnimations().length&&(await Re(a.current),a.current.animate(Pr.keyframes,Pr.options)))}}))}var _r=n(4292),zr=n(216);const $r=(0,a.ZP)(_r.h_).withConfig({shouldForwardProp:e=>"position"!==e})` all: revert; position: absolute; z-index: 98; // One under sticky elements & wp-admin-bar. top: ${({position:e})=>e?.y||0}%; left: ${({position:e})=>e?.x||0}%; transform: translate( -25%, -100% ); `;function Zr(e){const{elements:t}=nt(),n={current:t.get(e.elementId)};return n.current?o().createElement($r,{containerRef:n,"data-e-notes-portal":!0,position:e.position},e.children):null}Zr.propTypes={elementId:zr.string.isRequired,position:zr.shape({x:zr.number.isRequired,y:zr.number.isRequired}),children:zr.oneOfType([zr.node,zr.arrayOf(zr.node)])};var Ir=n(216);const Ar=(0,a.ZP)(Oe)` display: flex !important; flex-direction: column !important; gap: 28px !important; padding: 20px 16px !important; width: 360px !important; border-radius: 4px !important; transition: 0.3s all !important; ${({disabled:e})=>e&&a.iv` opacity: 0.5; pointer-events: none; `} `,Or=(0,r.createContext)();function Sr(e){const[t,n]=(0,r.useState)(!1),a=Rr(e.isActive);return o().createElement(Zr,{elementId:e.note.elementId,position:e.note.position},o().createElement(L,{open:e.isActive,onOpenChange:e.onOpenChange},o().createElement(L.Trigger,{asChild:!0},o().createElement(m,{variant:"transparent",className:wr},o().createElement(v,{ref:a,variant:e.isActive||e.note.isUnreadThread()?"solid":"ghost",size:"md",muted:e.note.isResolved},e.note.id))),o().createElement(Tr,null,o().createElement(Ar,{disabled:t},o().createElement(Or.Provider,{value:{isDisabled:t,setIsDisabled:n}},o().createElement(xr,{threadId:e.note.id}))))))}Sr.propTypes={note:Ir.instanceOf(Be).isRequired,onOpenChange:Ir.func.isRequired,isActive:Ir.bool.isRequired};var Fr=n(8003).__,Lr=n(216);const qr="e-notes-new-thread";function Mr(e){const{clearActive:t,setActive:n}=lt(),r=st(),{isInWritingMode:a}=kn();return o().createElement(Pn,{onSubmit:async(t,{content:o,form:a})=>{window.top.$e.run("notes/create");const i=await r.mutateAsync({elementId:e.elementId,parentId:0,content:o,position:e.position});a.reset(),n({type:at,data:{noteId:i.id}})},id:qr},o().createElement(En,{disabled:r.isLoading,onMetaAndEnterKeyDown:e=>Pe(e.currentTarget.form)}),o().createElement(Pn.ButtonsContainer,null,o().createElement(m,{disabled:r.isLoading||!a(qr),type:"submit"},Fr("Leave a Note","elementor-pro")),o().createElement(m,{disabled:r.isLoading,variant:"outlined",type:"reset",onClick:e=>{window.top.$e.run("notes/cancel-create"),e.target.form.reset(),t()}},Fr("Cancel","elementor-pro"))))}Mr.propTypes={elementId:Lr.string.isRequired,position:Lr.shape({x:Lr.number.isRequired,y:Lr.number.isRequired})};var Dr=n(216);const Nr=(0,a.ZP)(Oe)` display: flex !important; flex-direction: column !important; gap: 28px !important; padding: 20px 16px !important; width: 360px !important; border-radius: 4px !important; `;function Vr(e){const t=Rr();return o().createElement(Zr,{elementId:e.elementId,position:e.position},o().createElement(L,{defaultOpen:!0,onOpenChange:e.onOpenChange},o().createElement(L.Trigger,{asChild:!0},o().createElement(m,{variant:"transparent",ref:t},o().createElement(v,{variant:"active",size:"md"}))),o().createElement(Tr,null,o().createElement(Nr,null,o().createElement(Mr,{elementId:e.elementId,position:e.position})))))}function Ur(){return[(0,ot.v9)((e=>e.notes.filters)),(0,r.useCallback)(((e,t=!1)=>window.top.$e.run("notes/filter",{filters:e,overwrite:t})),[])]}Vr.propTypes={elementId:Dr.string.isRequired,position:Dr.shape({x:Dr.number.isRequired,y:Dr.number.isRequired}),onOpenChange:Dr.func.isRequired};const jr={enabled:!0,params:{}};function Wr(e={}){const{route:t}=Je(),[n]=Ur(),o=(0,r.useMemo)((()=>({...jr,...e})),[e]),a=(0,r.useMemo)((()=>Ce({parent_id:0,order_by:"last_activity_at",order:"desc",...t.is_elementor_library?{post_id:t.post_id}:{route_url:encodeURIComponent(t.url)},...n,...o.params||{}})),[t,n,o.params]);return(0,et.useQuery)(["notes",a],(async({queryKey:[,e],signal:t})=>{const{data:n}=await window.top.$e.data.get("notes/index",e,{refresh:!0,signal:t});return n.data.map((e=>Be.createFromResponse(e)))}),{keepPreviousData:!0,enabled:o.enabled})}function Hr(){const{data:e=[]}=Wr(),{activeThread:t,clearActive:n,setActive:r,isThreadActive:a}=lt();return kr(),o().createElement(o().Fragment,null,e.map((e=>o().createElement(Sr,{key:e.id,note:e,isActive:a(e.id),onOpenChange:t=>{t?r({type:at,data:{noteId:e.id}}):n(e.id)}}))),it===t?.type&&o().createElement(Vr,{elementId:t.data.elementId,position:t.data.position,onOpenChange:e=>{e||n()}}))}var Kr=n(8003).__,Qr=n(216);const Br=(0,a.ZP)(i)` --spacing: 12px; --background: #fafbfb; --color: #6d7882; --padding: var( --spacing ); --font-family: Roboto, sans-serif; --font-size: 12px; --font-weight: 400; --width: 100%; --display: flex; gap: var( --spacing ); margin: 1px 0 0 0 !important; border: none; text-align: inherit; border-radius: 0; transition: 0.2s all; line-height: 1.5; cursor: pointer; white-space: normal; &:hover, &:focus { --background: #f1f1f1; --color: #6d7882; } ${({isActive:e})=>e&&a.iv` --background: #e8f4fb; &:hover, &:focus { --background: #e0f2fc; } `} `,Yr=(0,a.ZP)(Oe)` flex-shrink: 0; &::before, &::after { display: none !important; } `,Xr=(0,a.ZP)(Oe)` flex-grow: 1; &::before, &::after { display: none !important; } `,Gr=a.ZP.p` all: revert; margin: 0 0 8px 0 !important; font-family: Roboto, sans-serif !important; font-size: 10px !important; font-weight: 500 !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: normal !important; letter-spacing: normal !important; word-spacing: normal !important; `,Jr=a.ZP.span` color: #a4afb6; `,eo=a.ZP.p` all: revert; margin: 4px 0 0 0 !important; color: #a4afb6 !important; font-family: Roboto, sans-serif !important; font-size: 10px !important; font-weight: normal !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: normal !important; letter-spacing: normal !important; word-spacing: normal !important; `,to=(0,a.ZP)(Xn)` --line-height: 1.5; --max-rows: 6; display: -webkit-box !important; -webkit-box-orient: vertical !important; -webkit-line-clamp: var( --max-rows ) !important; max-height: calc( ( 1em * var( --line-height ) * var( --max-rows ) ) ) !important; overflow: hidden !important; & > p { margin: 0 !important; // To make the ellipsis look better on multi-paragraph content. } `;function no(e){const t=Rr(e.isActive,{block:"nearest",inline:"nearest"}),n=Tn(e.note.content);return o().createElement(Br,{isActive:e.isActive,onClick:e.onClick,ref:t},o().createElement(Yr,null,o().createElement(v,{variant:e.isActive||e.note.isUnreadThread()?"solid":"ghost",size:"sm",muted:e.note.isResolved},e.note.id)),o().createElement(Xr,null,o().createElement(Gr,null,e.note.author.name," ",o().createElement(Jr,null,e.note.getFormattedCreatedAt())),o().createElement(to,{disableInteractions:!0},n),e.note.repliesCount>0&&o().createElement(eo,null,Kr("%s replies","elementor-pro").replace("%s",e.note.repliesCount))))}no.propTypes={note:Qr.instanceOf(Be).isRequired,onClick:Qr.func,isActive:Qr.bool};var ro=n(216);const oo=a.ZP.h4` all: revert; padding: 10px 12px !important; background: #fff !important; font-family: Roboto, sans-serif !important; font-size: 12px !important; font-weight: 600 !important; color: #6d7882 !important; margin: 1px 0 0 0 !important; line-height: 1.2 !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; letter-spacing: normal !important; word-spacing: normal !important; position: relative !important; &::before, &::after { display: none !important; } `,ao=a.ZP.span` color: #a4afb6; font-size: 11px; `;function io(e){return o().createElement(oo,null,e.children," ",e.count&&o().createElement(ao,null,"(",e.count,")"))}io.propTypes={children:ro.oneOfType([ro.node,ro.arrayOf(ro.node)]),count:ro.number};var lo=n(8003).__;const so=(0,a.ZP)(Oe)` display: flex !important; align-items: center !important; justify-content: center !important; height: 100% !important; width: 100% !important; text-align: center !important; padding: 13px 20px 43px 20px !important; `,co=(0,a.ZP)(Oe)` font-size: 30px !important; color: #a4afb6 !important; margin: 0 0 20px 0 !important; `,po=a.ZP.h4` all: revert; font-family: Roboto, sans-serif !important; font-size: 16px !important; font-weight: 700 !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: 1.4 !important; letter-spacing: normal !important; word-spacing: normal !important; color: #6d7882 !important; margin: 0 0 12px 0 !important; padding: 0 15px !important; &::before, &::after { display: none; } `,mo=a.ZP.p` all: revert; font-family: Roboto, sans-serif !important; font-size: 11px !important; font-weight: normal !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: 1.5 !important; letter-spacing: normal !important; word-spacing: normal !important; margin: 0 !important; color: #6d7882 !important; `,uo=a.ZP.a` all: revert; display: inline-flex !important; justify-content: center !important; align-item: center !important; font-family: Roboto, sans-serif !important; font-size: 12px !important; font-weight: 500 !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: 1.4 !important; letter-spacing: normal !important; word-spacing: normal !important; margin: 42px 0 0 0 !important; color: #6d7882 !important; > i { color: #a4afb7 !important; font-size: 18px !important; margin-inline-start: 4px !important; } &:hover { i::before { color: #58d0f5; content: '\\e926'; // eicon-info-circle } } `;function fo(){return o().createElement(so,null,o().createElement("div",null,o().createElement(co,null,o().createElement(w,{className:"eicon-commenting-o"})),o().createElement(po,null,lo("Share your thoughts with a Note","elementor-pro")),o().createElement(mo,null,lo("Select an element on the page to leave a comment, ask a question, etc.","elementor-pro")),o().createElement(uo,{href:"https://go.elementor.com/app-notes/",target:"_blank",className:"elementor-clickable"},lo("Learn More","elementor-pro"),o().createElement(w,{className:"eicon-info"}))))}var go=n(8862);const ho=(0,a.ZP)(i).attrs((()=>({as:go.gD})))` --font-weight: 600 !important; --font-size: inherit !important; --font-family: inherit !important; `,vo=(0,a.ZP)(w)` color: var( --color ) !important; // Inherited from the
component. `;var bo=n(216);const yo={default:{background:"#f1f2f3",icon:"#69727d",action:"#69727d"},success:{background:"#e9fbee",icon:"#1d6d38",action:"#1d6d38"},warning:{background:"#fff5e6",icon:"#976402",action:"#976402"},info:{background:"#e6f6ff",icon:"#006bb8",action:"#006bb8"},danger:{background:"#fde8ec",icon:"#b92136",action:"#b92136"}},xo=(0,a.ZP)(go.FN)` display: flex !important; gap: 8px !important; align-items: center !important; width: 100% !important; box-sizing: border-box !important; padding: 12px 16px !important; font-size: 14px !important; line-height: normal !important; color: #3a3f45 !important; text-align: start !important; border-radius: 6px !important; box-shadow: 0 0 15px 0 rgba( 0,0,0,.2 ) !important; animation-duration: 400ms !important; animation-timing-function: cubic-bezier( 0.16, 1, 0.3, 1 ) !important; background-color: ${({variant:e})=>yo[e].background} !important; &[data-state="open"] { animation-name: ${z} !important; } &[data-state="closed"] { animation-name: ${A} !important; } ${vo} { --color: ${({variant:e})=>yo[e].icon} !important; } ${ho} { --color: ${({variant:e})=>yo[e].icon} !important; } `;xo.propTypes={variant:bo.oneOf(["default","success","warning","info","danger"]).isRequired},xo.defaultProps={variant:"default"};const wo=xo,Eo=(0,a.ZP)(go.Mi)` font-weight: bold !important; `,ko=(0,a.ZP)(go.lj)` font-weight: normal !important; `,Co=(0,a.ZP)(i).attrs((()=>({as:go.sA})))` --height: 1em !important; --width: 1em !important; --display: block !important; margin-inline-start: auto !important; position: relative !important; &::before, &::after { content: '' !important; display: block !important; position: absolute !important; left: 50% !important; top: 50% !important; margin-left: -1px !important; margin-top: -.5em !important; height: 1em !important; width: 2px; border-radius: 9999px !important; background-color: #69727d !important; transform-origin: center center !important; transition: .3s all; } &::before { transform: rotate( 45deg ) !important; } &::after { transform: rotate( -45deg ) !important; } &:hover::before, &:hover::after { background-color: #232629 !important } `;var Ro=n(8003).__,Po=n(216);function To(e){const{route:t}=Je(),{activeThread:n,isThreadActive:a,setActive:i,clearActive:l}=lt(),[s,c]=(0,r.useState)(!1),[p,m]=function(e){const{elements:t}=nt();return(0,r.useMemo)((()=>{if(!e?.length||!t?.size)return[[],[]];const n=e.reduce(((e,n)=>(e[t.has(n.elementId)?"viewable":"nonViewable"].push(n),e)),{viewable:[],nonViewable:[]});return Object.values(n)}),[e,t])}(e.notes);return(0,r.useEffect)((()=>{const{noteId:e}=n?.data||{};if(e){!!p.find((t=>t.id===e&&t.isThread()))||l(e)}}),[p,n]),function(e,t){const n=(0,r.useRef)(!0),o=(0,r.useCallback)((()=>{n.current=!1}),[]);(0,r.useEffect)((()=>{n.current&&e(o)}),t)}((e=>{m.length>0&&(c(!0),e())}),[m]),o().createElement(o().Fragment,null,p.length?o().createElement(o().Fragment,null,o().createElement(io,{count:p.length},t.title),p.map((e=>o().createElement(no,{key:e.id,note:e,isActive:a(e.id),onClick:()=>i({type:at,data:{noteId:e.id}})})))):o().createElement(fo,null),o().createElement(wo,{open:s,onOpenChange:c,variant:"info"},o().createElement(vo,{className:"eicon-info-circle"}),o().createElement(Eo,null,Ro("Some notes are not shown.","elementor-pro")),o().createElement(ko,null,Ro("This page contains notes on elements that are still in draft mode.","elementor-pro")),o().createElement(Co,null)))}To.propTypes={notes:Po.arrayOf(Po.instanceOf(Be)).isRequired};class _o extends We{url="";fullURL="";title="";notesCount=0;static createFromResponse(e){return(new _o).init({url:e.url,fullURL:e.full_url,title:e.title,notesCount:e.notes_count})}}var zo=n(8003).__,$o=n(216);const Zo=a.ZP.a` position: absolute !important; font-size: 14px !important; inset-inline-end: 14px !important; top: 50% !important; margin-top: -.5em !important; color: #a4afb7 !important; `;function Io(e){const{route:{url:t}}=Je();return e.notesSummary.length?e.notesSummary.map((e=>o().createElement(io,{count:e.notesCount,key:e.url},e.title,e.url!==t&&o().createElement(B,null,o().createElement(B.Trigger,{asChild:!0},o().createElement(Zo,{href:`${e.fullURL}#e:run:notes/open`,rel:"noopener noreferrer",target:"_blank",className:"elementor-clickable"},o().createElement(w,{className:"eicon-editor-external-link"}))),o().createElement(B.Content,null,zo("Open page in a new tab","elementor-pro"),o().createElement(B.Arrow,null)))))):o().createElement(fo,null)}Io.propTypes={notesSummary:$o.arrayOf($o.instanceOf(_o)).isRequired};var Ao=n(8003).__;function Oo(){return o().createElement(B,null,o().createElement(B.Trigger,{asChild:!0},o().createElement(P,{name:"eicon-editor-close",onClick:()=>window.top.$e.run("notes/close")})),o().createElement(B.Content,null,Ao("Close notes mode","elementor-pro"),o().createElement(B.Arrow,null)))}var So=n(8003).__;const Fo=(0,a.ZP)(Oe)` display: flex !important; align-items: center !important; justify-content: center !important; height: 100% !important; width: 100% !important; text-align: center !important; padding: 13px 13px 43px 13px !important; `,Lo=a.ZP.p` all: revert; font-family: Roboto, sans-serif !important; font-size: 12px !important; font-weight: ${({weight:e})=>e||400} !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: normal !important; letter-spacing: normal !important; word-spacing: normal !important; margin: 0 !important; color: #6d7882 !important; `;function qo(){return o().createElement(Fo,null,o().createElement("div",null,o().createElement(Lo,{weight:700},So("Could not load the panel.","elementor-pro")),o().createElement(Lo,null,So("Please refresh the page and try again.","elementor-pro"))))}var Mo=n(5862);const Do=(0,a.ZP)(i).attrs((()=>({as:Mo.fC})))` --border-color: #a4afb6; --background: #fff; --border: 1px solid var( --border-color ); --border-radius: 3px; --width: 12px; --height: 12px; --display: inline-flex; align-items: center; justify-content: center; position: relative; margin: 0; outline: none; transition: 0.2s all; overflow: hidden; &[data-state="checked"] { --border-color: #39b54a; } &:hover, &:focus { outline: none; --background: #eee; & > * { --background: rgba(57, 181, 74, 0.8); } } `,No=(0,a.ZP)(Mo.z$)` all: revert; position: absolute !important; inset: 0 !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; background: #39b54a !important; color: #fff !important; outline: none !important; font-size: 8px !important; `;function Vo(e){return o().createElement(Do,e,o().createElement(No,null,o().createElement(w,{className:"eicon-check"})))}Vo.propTypes={...Mo.fC.propTypes};var Uo=n(4053);const jo=(0,a.ZP)(Uo.__)` all: revert; font-size: 11px !important; color: #a4afb6 !important; font-weight: 500 !important; font-family: Roboto, sans-serif !important; user-select: none !important; display: inline-flex !important; align-items: center !important; gap: 8px !important; line-height: 2 !important; `;var Wo=n(6301);const Ho=(0,a.ZP)(i).attrs((()=>({as:Wo.ck})))` --border-color: #a4afb6; --background: #fff; --border: 1px solid var( --border-color ); --border-radius: 100%; --width: 12px; --height: 12px; --display: inline-flex; align-items: center; justify-content: center; position: relative; margin: 0; outline: none; transition: 0.2s all; overflow: hidden; &[data-state="checked"] { --border-color: #39b54a; } &:hover, &:focus { outline: none; --background: #eee; & > * { --background: rgba(57, 181, 74, 0.8); } } `,Ko=(0,a.ZP)(Wo.z$)` all: revert; position: absolute !important; top: 0 !important; right: 0 !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; background: #39b54a !important; color: #fff !important; outline: none !important; font-size: 8px !important; margin: 2px !important; border-radius: 100% !important; width: 6px !important; height: 6px !important; `;function Qo(e){return o().createElement(Ho,e,o().createElement(Ko,null))}Qo.propTypes={...Wo.ck.propTypes},Qo.Group=Wo.Ee;var Bo=n(7869);const Yo=(0,a.ZP)(Bo.f)` background: #f1f3f5; &[data-orientation=horizontal] { height: 1px; width: 100%; margin: 10px 0; } &[data-orientation=vertical] { height: 100%; width: 1px; margin: 0 10px; } `;function Xo(){return o().createElement(Yo,null)}Xo.propTypes={...Bo.f.propTypes};const Go={enabled:!0,params:{}};const Jo="notes",ea="notes-summary";function ta(){const[e,t]=(0,r.useState)(Jo),n=(0,r.useMemo)((()=>Jo===e),[e]),o=(0,r.useMemo)((()=>ea===e),[e]),a=Wr({enabled:n}),i=function(e={}){const[t]=Ur(),n=(0,r.useMemo)((()=>({...Go,...e})),[e]),o=(0,r.useMemo)((()=>Ce({...t,...n.params||{}})),[n.params,t]);return(0,et.useQuery)(["notes/summary",o],(async({queryKey:[,e],signal:t})=>{const{data:n}=await window.top.$e.data.get("notes/summary",{parent_id:0,...e},{refresh:!0,signal:t});return n.data.map((e=>_o.createFromResponse(e)))}),{keepPreviousData:!0,enabled:n.enabled})}({enabled:o});return(0,r.useMemo)((()=>({...Jo===e?a:i,setView:t,view:e,isNotesView:n,isNotesSummaryView:o})),[a,i])}var na=n(8003).__,ra=n(216);const oa=(0,a.ZP)(L.Content)` padding: 16px 16px 10px !important; `;function aa(e){const[t,n]=Ur(),{direction:r}=Je();return o().createElement(L,{onOpenChange:e=>{e?window.top.$e.run("notes/open-panel-filters"):window.top.$e.run("notes/close-panel-filters")}},o().createElement(L.Trigger,{asChild:!0},o().createElement(P,{name:"eicon-ellipsis-h",size:"sm"})),o().createElement(oa,{align:"rtl"===r?"end":"start",sideOffset:5},o().createElement(Qo.Group,{value:e.view,onValueChange:e.setView,dir:r},o().createElement("div",null,o().createElement(jo,null,o().createElement(Qo,{value:Jo}),na("Current page","elementor-pro"))),o().createElement("div",null,o().createElement(jo,null,o().createElement(Qo,{value:ea}),na("All site","elementor-pro")))),o().createElement(Xo,null),o().createElement(Qo.Group,{value:t.only_relevant?"1":"0",onValueChange:e=>n({only_relevant:"1"===e||null}),dir:r},o().createElement("div",null,o().createElement(jo,null,o().createElement(Qo,{value:"0"}),na("All notes","elementor-pro"))),o().createElement("div",null,o().createElement(jo,null,o().createElement(Qo,{value:"1"}),na("Only yours","elementor-pro")))),o().createElement(Xo,null),o().createElement("div",null,o().createElement(jo,{htmlFor:"notes-filter-show-resolved"},o().createElement(Vo,{id:"notes-filter-show-resolved",checked:null===t.is_resolved,onCheckedChange:e=>n({is_resolved:!!e&&null})}),na("Show resolved","elementor-pro"))),o().createElement("div",null,o().createElement(jo,{htmlFor:"notes-filter-only-unread"},o().createElement(Vo,{id:"notes-filter-only-unread",checked:t.only_unread,onCheckedChange:e=>n({only_unread:!!e||null})}),na("Show unread only","elementor-pro"))),o().createElement(L.Arrow,null),o().createElement(L.CloseButton,null)))}aa.propTypes={view:ra.string.isRequired,setView:ra.func.isRequired};var ia=n(9294),la=n.n(ia),sa=n(216);function ca(e){const{size:{defaultWidth:t}}=Oa(),[n,a]=(0,r.useState)({}),[i,l]=(0,r.useState)(e.defaultPosition),s=(0,r.useRef)({});s.current=i;const c=Vt((()=>{const{innerWidth:n,innerHeight:r}=window;a({top:0,left:0-.85*t,right:n-.15*t,bottom:r-(e.nodeRef.current?.querySelector(e.handleClass)?.offsetHeight||0)})}),100);return(0,r.useEffect)((()=>{(()=>{const{x:t,y:r}=s.current,{x:o,y:a}=e.defaultPosition;if(t===o&&r===a)return;const i=t
n.right?o:t,c=r
n.bottom?a:r;i===t&&c===r||l({x:i,y:c})})()}),[n]),(0,r.useEffect)((()=>(c(),window.addEventListener("resize",c),()=>{window.removeEventListener("resize",c)})),[]),o().createElement(la(),{handle:e.handleClass,defaultPosition:e.defaultPosition,nodeRef:e.nodeRef,bounds:n,position:s.current,onStop:(e,t)=>{const{x:n,y:r}=t;l({x:n,y:r})}},e.children)}ca.propTypes={children:sa.oneOfType([sa.node,sa.arrayOf(sa.node)]),handleClass:sa.string,defaultPosition:sa.shape({x:sa.number,y:sa.number}),nodeRef:sa.shape({current:sa.object}),isFloating:sa.bool};var pa=n(216);const ma=(0,a.ZP)(Oe)` flex: 1 1 auto !important; inset: 0 !important; display: inline-flex !important; flex-direction: column !important; overflow: hidden !important; &.resizing { user-select: none; } `,da=(0,a.ZP)(Oe)` overflow-y: auto !important; flex-grow: 1 !important; flex-shrink: 1 !important; `,ua={height:20},fa=(0,a.ZP)(Oe)` flex: 0 0 ${ua.height}px !important; display: inline-flex !important; justify-content: center !important; align-items: center !important; background-color: #fff !important; margin-top: 1px !important; cursor: row-resize !important; `;function ga(e){const{size:{defaultHeight:t}}=Oa(),n=(0,r.useRef)(null),a=(0,r.useRef)(null),i=(0,r.useRef)(null);let l,s,c=0,p=0;const m=e=>{n.current.classList.add("resizing");const t=e.clientY-p;s+=t,s
l&&(s=l),p=e.clientY,f()},d=()=>{document.removeEventListener("mousemove",m),n.current.classList.remove("resizing")},u=e=>{p=e.clientY,document.addEventListener("mousemove",m),document.addEventListener("mouseup",d)},f=()=>{n.current.style.height=`${s}px`};return(0,r.useEffect)((()=>(s=t,f(),c+=ua.height,l=window.innerHeight,i.current.addEventListener("mousedown",u),()=>{i.current&&i.current.removeEventListener("mousedown",u)})),[e.children]),o().createElement(ma,{ref:n},o().createElement(da,{ref:a},e.children),o().createElement(fa,{ref:i},o().createElement("i",{className:"eicon-ellipsis-h"})))}ga.propTypes={children:pa.oneOfType([pa.node,pa.arrayOf(pa.node)])};var ha=n(216);const va=(0,a.ZP)(Oe)` position: relative !important; display: flex !important; flex-direction: column !important; overflow: hidden !important; `;function ba(e){return o().createElement(va,e,o().createElement(ga,null,e.children))}ba.propTypes={children:ha.oneOfType([ha.node,ha.arrayOf(ha.node)])};const ya=(0,a.ZP)(Oe)` background: #fff !important; `;var xa=n(216);const wa=(0,a.ZP)(Oe)` display: grid !important; grid-template-columns: 1fr 2fr 1fr !important; grid-column-gap: 10px !important; align-items: center !important; background: #ffffff !important; padding: 6px 8px !important; flex-shrink: 0 !important; ${({isFloating:e})=>e&&a.iv` cursor: move; `} `;function Ea(e){const{floating:{active:t,handleClassName:n}}=Oa();return o().createElement(wa,{className:n,isFloating:t},e.children)}Ea.propTypes={children:xa.oneOfType([xa.node,xa.arrayOf(xa.node)])};var ka=n(216);const Ca=(0,a.ZP)(Oe)` display: flex !important; justify-self: ${({align:e})=>e} !important; `;Ca.propTypes={children:ka.oneOfType([ka.node,ka.arrayOf(ka.node)]),align:ka.oneOf(["start","end"]).isRequired};const Ra=Ca,Pa=a.ZP.h3` all: revert; font-family: Roboto, sans-serif !important; font-size: 13px !important; font-weight: 400 !important; text-transform: none !important; font-style: normal !important; text-decoration: none !important; line-height: 24px !important; letter-spacing: normal !important; word-spacing: normal !important; color: #6d7882 !important; text-align: center !important; flex-grow: 1 !important; margin: 0 !important; user-select: none !important; &::before, &::after { display: none !important; } `;var Ta=n(216);const _a=(0,a.ZP)(Oe)` position: absolute !important; inset: 0 !important; background: #e6e9ec !important; transition: 0.3s all !important; font-size: 30px !important; display: grid !important; place-items: center !important; color: #a4afb6 !important; ${({show:e})=>!e&&a.iv` opacity: 0 !important; pointer-events: none !important; `} `;function za(e){return o().createElement(_a,e,o().createElement(w,{className:"eicon-loading eicon-animation-spin"}))}za.propTypes={show:Ta.bool};var $a=n(216);const Za=(0,a.ZP)(Oe)` display: flex !important; flex-direction: column !important; background: #e6e9ec !important; overflow: hidden !important; border-radius: 3px !important; box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1) !important; ${({defaultSize:e})=>e&&a.iv` width: ${e.width}px !important; max-height: 100vh !important; `} ${({isFloating:e})=>e&&a.iv` position: fixed !important; top: 0 !important; inset-inline-start: 0 !important; z-index: ${Ee} !important; `} // The class comes from the react-draggable component. &:not(.react-draggable-dragging) { transition: transform 0.3s ease-out !important; } *:focus { outline: none; } `,Ia=(0,r.createContext)({});function Aa(e){const t=(0,r.useRef)(),n=(0,r.useMemo)((()=>({floating:{active:!!e.isFloating,handleClassName:"floating-handle"},size:{defaultWidth:e.defaultSize.width,defaultHeight:e.defaultSize.height}})),[e.isFloating]);return o().createElement(Ia.Provider,{value:n},e.isFloating?o().createElement(ca,{handleClass:`.${n.floating.handleClassName}`,defaultPosition:e.defaultPosition,nodeRef:t},o().createElement(Za,(0,x.Z)({},e,{ref:t,defaultSize:e.defaultSize}))):o().createElement(Za,(0,x.Z)({},e,{defaultSize:e.defaultSize})))}function Oa(){const e=(0,r.useContext)(Ia);if(!e)throw new Error("`usePanelContext` must be used inside Panel's components.");return e}Aa.propTypes={children:$a.oneOfType([$a.node,$a.arrayOf($a.node)]),defaultPosition:$a.shape({x:$a.number,y:$a.number}),defaultSize:$a.shape({width:$a.number,height:$a.number}),isFloating:$a.bool},Aa.Header=Ea,Aa.HeaderTitle=Pa,Aa.HeaderSideCol=Ra,Aa.Body=ba,Aa.Loading=za,Aa.Footer=ya;var Sa=n(8003).__,Fa=n(216);const La=(0,a.ZP)(P)` animation-duration: 1.3s; animation-iteration-count: infinite; animation-timing-function: linear; &[data-state="loading"] { animation-name: ${O}; } &[data-state="none"] { animation-name: none; } `;function qa(e){const[t,n]=(0,r.useState)(e.isFetching);return Ge((()=>{e.isFetching&&n(!0)}),[e.isFetching]),o().createElement(B,null,o().createElement(B.Trigger,{asChild:!0},o().createElement(La,{name:"eicon-sync","data-state":t?"loading":"none",onClick:()=>{window.top.$e.run("notes/refresh-panel"),e.refetch()},onAnimationIteration:()=>{e.isFetching||n(!1)}})),o().createElement(B.Content,null,Sa("Refresh","elementor-pro"),o().createElement(B.Arrow,null)))}qa.propTypes={isFetching:Fa.bool.isRequired,refetch:Fa.func.isRequired};var Ma=n(8003).__;function Da(){const{direction:e}=Je(),{view:t,setView:n,data:r=[],refetch:a,isSuccess:i,isLoading:l,isFetching:s,isError:c,isNotesView:p,isNotesSummaryView:m}=ta();return o().createElement(Aa,{isFloating:!0,defaultPosition:{x:"rtl"===e?-50:50,y:50},defaultSize:{width:240,height:400}},o().createElement(Aa.Header,null,o().createElement(Aa.HeaderSideCol,{align:"start"},o().createElement(aa,{view:t,setView:n})),o().createElement(Aa.HeaderTitle,null,Ma("Notes Panel","elementor-pro")),o().createElement(Aa.HeaderSideCol,{align:"end"},o().createElement(qa,{isFetching:s,refetch:a}),o().createElement(Oo,null))),o().createElement(Aa.Body,null,o().createElement(Aa.Loading,{show:l}),c&&o().createElement(qo,null),i&&p&&o().createElement(To,{notes:r}),i&&m&&o().createElement(Io,{notesSummary:r})),o().createElement(Aa.Footer,null))}var Na=n(4166);const Va=(0,a.ZP)(go._i)` display: flex !important; flex-direction: column !important; gap: 12px !important; position: fixed !important; max-width: 960px !important; width: 100% !important; left: 50% !important; bottom: 10px !important; padding-inline: 0 10px !important; transform: translateX( -50% ) !important; z-index: ${Ee} !important; `,Ua=window.top.$e.store.getReduxStore();function ja(){const{is_debug:e}=Je(),t=e?o().StrictMode:o().Fragment;return o().createElement(t,null,o().createElement("link",{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"}),o().createElement(ot.zt,{store:Ua},o().createElement(rt,null,o().createElement(go.VW,{duration:1/0},o().createElement(Va,null),o().createElement(et.QueryClientProvider,{client:bn},o().createElement(Hr,null),o().createElement(Da,null),e&&o().createElement(Na.ReactQueryDevtools,{initialIsOpen:!1}))))))}}}]);