@usesuperflow/toolbar-staging 1.0.559 → 1.0.561

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usesuperflow/toolbar-staging",
3
- "version": "1.0.559",
3
+ "version": "1.0.561",
4
4
  "description": "",
5
5
  "main": "superflow.js",
6
6
  "scripts": {
package/superflow.js CHANGED
@@ -2646,7 +2646,7 @@ class ha extends qn{}ha.Encryptor=class extends ha{processBlock(t,e){const i=t,o
2646
2646
  display: none;
2647
2647
  }
2648
2648
  }
2649
- `;var Ka=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class Ja extends Q{constructor(){super(),this._loadPlugin=!1,this.comments=[],this.addCommentMode=!1,this.showTourCommentTooltip=!1,this.allFeatureDisabled=!1,this.allFeatureRestricted=!1,this.guestMode=!1,this._expanded=!0,this.loading=!0,this._isPlanExpired=null,this.showOnboardingModal=!0,this.showLiveDemoModal=!1,this.showFigmaDemoModal=!1,this.showGuestModeSignInModal=!1,this.defaultGuestModeSignInModalConfig={title:"Sign in to notify your team",description:"Notify your team about your latest comments.",closeOnClickOutside:!1,showLeaveCommentButton:!0},this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig)),this.showGuestModeNameModal=!1,this.guestModeSignInBannerVisible=!1,this.guestUserNameInput="",this.guestUserModelOpened=!1,this.guestUserNameUpdated=!1,this.guestUserNameUpdateLoading=!1,this.staging=Qt,this._autoLocation=!0,this.copyLinkTooltip="Copy Link",this.invalidApiKey=!1,this._isUserGlobalContact=!1,this.showQrCode=!1,this.customLoginEnabledLocally=null,this.customLoginEnabled=null,this.exitReviewModeCalled=!1,this.addCommentCount=0,this._privateCommentModeEnabled=!1,this.superflowToolbarMoved=!1,this._darkMode=!1,this.allowGuestModeSignIn=!0,this._queryParamsComments=!1,this._usePageTitleAsLocationName=!1,this.toolbarEnabled=!1,this.toolbarEnabledApiCalled=!1,this.passwordProtected=!1,this.isPasswordValid=!1,this.password="",this.validatingPasswordLoading=!1,this.showPasswordProtectedModal=!1,this.showInvalidPassword=!1,this.skipGuestNameModal=!1,this._totalViews={},this.totalViewsCount=0,this.inviteUrl="",this.showModalOnceCommentIsModeIsOff=!1,this.subscriptions=[],this.onApiKeyChange=()=>{try{this.apiKey&&(null===window||void 0===window?void 0:window.onSuperflowLoad)&&"function"==typeof window.onSuperflowLoad&&window.onSuperflowLoad()}catch(t){console.warn("Error in onApiKeyChange: ",t),Va("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await(t=>{const e={apiKey:t};return Co(Fa,le,{timeout:12e5})(e)})(this.apiKey);this.customLoginEnabled=!!(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),Va("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(_a(Et),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),Va("Error in loginWithCustomUser: ",t)}},this.addWindowClickEventListener=()=>{try{this.windowClickEventListener||(this.windowClickEventListener=()=>{this.menuOpenedId&&(this.menuOpenedId=void 0)},window.addEventListener("click",this.windowClickEventListener))}catch(t){console.warn("Error in addWindowClickEventListener: ",t),Va("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),Va("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),Va("Error in setWindowEventListner: ",t)}},this.urlChangeListener=()=>{try{const t=history.pushState;history.pushState=function(){const e=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),e};const e=history.replaceState;history.replaceState=function(){const t=e.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))}))}catch(t){console.warn("Error in urlChangeListener: ",t),Va("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if(e.has(bt)&&ka(ft,"true",!1),(null==e?void 0:e.has(Tt))&&!Ma(Tt)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(Nt))if(Ma(Nt,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Nt),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showLiveDemoModal=!0;else this.showLiveDemoModal=!1;if(null==e?void 0:e.has(It))if(Ma(It,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(It),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showFigmaDemoModal=!0;else this.showFigmaDemoModal=!1;if(e.has(xt)||e.has("snippyly_google_token")){if(e.has(xt)){const t=decodeURIComponent(e.get(xt)),i=Ia(t,te,ee),o=i&&JSON.parse(i);if(o){const t={};t.userId=o.uid,t.name=o.displayName,t.email=o.email,t.photoUrl=null==o?void 0:o.photoURL;const e=JSON.stringify(t),i=Na(e,te,ee);ka(Et,i,!0),_a(Ot)}}else if(e.has("snippyly_google_token")){const t=JSON.parse(atob(e.get("snippyly_google_token"))),i={};i.userId=t.uid,i.name=t.displayName,i.email=t.email,i.photoUrl=null==t?void 0:t.photoURL,ka(Ct,JSON.stringify(i),!0)}e.delete(xt),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(ft)?(ka(ft,"true",!1),_a(wt),e.delete(ft),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(wt)||Ma(ft,!1)&&this.loadPluginUI(),e.has(wt)?(ka(wt,"true",!1),_a(ft),e.delete(wt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(ft)||Ma(wt,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),Va("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(ft)||t.searchParams.set(ft,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),Va("Error in setInviteUrl: ",t)}},this.detectVersion=()=>{try{if(this.projectVersionKey){const t=new URL(document.location).searchParams;if(t.get(this.projectVersionKey))this.projectVersion=t.get(this.projectVersionKey);else if(window.snippylyInitialLoadUrl){const t=new URL(window.snippylyInitialLoadUrl).searchParams;t.get(this.projectVersionKey)&&(this.projectVersion=t.get(this.projectVersionKey))}this.projectVersion&&ka(Mt,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(ft)||t.has(wt))&&t.has(_t)&&(ka(kt,_t,!1,"sessionStorage"),this.projectVersion=t.get(_t),this.projectVersion&&ka(Mt,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),Va("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||Ma(kt,!1,"sessionStorage"),e=this.projectVersion||Ma(Mt,!1,"sessionStorage");if(t&&e){const i=new URL(document.location),o=i.searchParams;o.get(t)||(o.set(t,e),window.history.replaceState({},document.title,i.href))}}catch(t){console.warn("Error in setVersionInUrl: ",t),Va("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,r,s,a,l;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),this.setLocation(),void setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3);if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;gt.includes(this.apiKey)&&this.listenToDocumentTitleChange();const c=Aa();if(c&&!(null==c?void 0:c.isAnonymous)&&(this.loading=!0),null===(t=this.getCustomerMetadata())||void 0===t||t.then((t=>{this.customerMetadata=t})).catch((t=>{console.warn("Error in getCustomerMetadata: ",t),Va("Error in getCustomerMetadata: ",t)})),Sa(jt)&&(this.isPasswordValid=Sa(jt)),Ma(Lt,!0)&&Ma(Rt,!0)&&Ma(Dt,!0)&&Ma(Ft,!0)&&Ma($t,!0)?(this.guestMode="true"===Ma(Lt,!0),this.allowGuestModeSignIn="true"===Ma(Rt,!0),this.passwordProtected="true"===Ma(Dt,!0),this.queryParamsComments="true"===Ma(Ft,!0),this.usePageTitleAsLocationName="true"===Ma($t,!0)):(this.projectConfig=await(async(t,e)=>{var i;try{const o=Co(Fa,ce,{timeout:12e5}),n=await o({apiKey:t,projectId:e});return null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data}catch(t){return console.warn("Error in getProjectConfig: ",t),null}})(this.apiKey,this.projectId),this.guestMode=!!(null===(e=this.projectConfig)||void 0===e?void 0:e.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(o=null===(i=this.projectConfig)||void 0===i?void 0:i.guestModeConfig)||void 0===o?void 0:o.allowSignIn),this.queryParamsComments=!!(null===(n=this.projectConfig)||void 0===n?void 0:n.queryParamsComments),this.usePageTitleAsLocationName=!!(null===(r=this.projectConfig)||void 0===r?void 0:r.usePageTitleAsLocationName),(null===(s=this.projectConfig)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=this.projectConfig)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),ka(Lt,this.guestMode+"",!0),ka(Rt,this.allowGuestModeSignIn+"",!0),ka(Dt,this.passwordProtected+"",!0),ka(Ft,this.queryParamsComments+"",!0),ka($t,this.usePageTitleAsLocationName+"",!0)),this.loadPlugin=!0,!document.querySelector(Zt.VELT_COMMENTS)){const t=document.createElement(Zt.VELT_COMMENTS);null==t||t.addEventListener("onSignIn",(()=>{this.loginWithGoogle()})),null==t||t.addEventListener("onUpgrade",(()=>{this.onUpgradePlanClick()})),t.addEventListener("onCommentAdd",(()=>{this.addCommentCount++})),t.addEventListener("onCommentUpdate",(t=>{var e,i;(null===(e=this.snippylyUser)||void 0===e?void 0:e.isGuest)&&"newlyAdded"===(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.type)&&(this.addCommentCount>=2&&(this.showModalOnceCommentIsModeIsOff=!0),this.addCommentCount>=5&&!this.showModalOnceCommentIsModeIsOff&&(this.showModalOnceCommentIsModeIsOff=!0))})),window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_CURSOR)){const t=document.createElement(Zt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_HUDDLE)){const t=document.createElement(Zt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_RECORDER_NOTES)){const t=document.createElement(Zt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Zt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_ARROWS)){const t=document.createElement(Zt.VELT_ARROWS);window.document.body.appendChild(t)}try{const t=new URL(document.location),e=t.searchParams;let i=!1;e.has("wireframe")&&"true"===e.get("wireframe")&&(sessionStorage.setItem("velt-wireframe","true"),e.delete("wireframe"),i=!0),e.get("velt-version")&&(sessionStorage.setItem("velt-version",e.get("velt-version")),e.delete("velt-version"),i=!0),e.get("velt-env")&&(sessionStorage.setItem("velt-env",e.get("velt-env")),e.delete("velt-env"),i=!0),i&&window.history.replaceState({},document.title,t.href)}catch(t){}if(this.staging&&"true"===sessionStorage.getItem("velt-wireframe")){const t=document.createElement("velt-wireframe");t.innerHTML='\n <style>\n .dialog-header-container {\n padding: 12px;\n background: lightcyan;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .dialog-all-comment-container app-comment-dialog-all-comment > div {\n padding: 12px;\n background: lightpink;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-container {\n padding: 12px;\n background: lightgreen;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-block {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n </style>\n\t\t\t\t\t\t<velt-comment-pin-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-pin-container">\n\t\t\t\t\t\t\t\t\t<div style="width: 35px; height: 35px; background-color: blue; border-radius: 12px; border-width: 3px; border-style: solid; border-color: #f00;"></div>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div class="custom-indicator"></div>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>P</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>G</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-index-wireframe></velt-comment-pin-index-wireframe>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-pin-wireframe>\n\n\t\t\t\t\t\t<velt-comment-bubble-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-bubble">\n\t\t\t\t\t\t\t\t<velt-comment-bubble-avatar-wireframe></velt-comment-bubble-avatar-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-bubble-comments-count-wireframe></velt-comment-bubble-comments-count-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-bubble-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-tool-wireframe>\n\t\t\t\t\t\t\t<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t\t\t\t<circle cx="50" cy="50" r="40" fill="red" />\n\t\t\t\t\t\t\t\t<rect x="5" y="5" width="90" height="90" fill="blue" fill-opacity="0.5" />\n\t\t\t\t\t\t\t\t<polygon points="50,5 95,95 5,95" fill="yellow" fill-opacity="0.7" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</velt-text-comment-tool-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:violet; display: flex; gap: 8px; border-radius: 12px; padding: 8px; align-items: center;">\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-generic-wireframe><p>GPT</p></velt-text-comment-toolbar-generic-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-seperator-wireframe><p>Seperator</p></velt-text-comment-toolbar-seperator-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-comment-annotation-wireframe><p>Comment</p></velt-text-comment-toolbar-comment-annotation-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-copywriter-wireframe><p>Copywriter</p></velt-text-comment-toolbar-copywriter-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t<velt-comment-sidebar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:lightblue; width: 100%; height: 100%;">\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Header</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Close Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-search-wireframe></velt-comment-sidebar-search-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-status-wireframe></velt-comment-sidebar-status-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Filter Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Filter</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-title-wireframe></velt-comment-sidebar-filter-title-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom CLose filter</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-close-button-wireframe>\n\n\t\t\t\t\t\t\t\t\t<div style="background-color: yellow">\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-location-wireframe></velt-comment-sidebar-filter-location-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-people-wireframe></velt-comment-sidebar-filter-people-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-category-wireframe></velt-comment-sidebar-filter-category-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-priority-wireframe></velt-comment-sidebar-filter-priority-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-comment-type-wireframe></velt-comment-sidebar-filter-comment-type-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-versions-wireframe></velt-comment-sidebar-filter-versions-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-group-by-wireframe></velt-comment-sidebar-filter-group-by-wireframe>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom Done Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-list-wireframe></velt-comment-sidebar-list-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Empty Placeholder</div>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-page-mode-wireframe></velt-comment-sidebar-page-mode-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-sidebar-wireframe>\n <velt-comment-dialog-wireframe variant="dialog">\n <div class="dialog-all-comment-container">\n <velt-comment-dialog-all-comment-wireframe></velt-comment-dialog-all-comment-wireframe>\n </div>\n <div class="dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n <div class="dialog-header-container">\n <velt-comment-dialog-header-wireframe></velt-comment-dialog-header-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n <velt-comment-dialog-wireframe variant="sidebar">\n <div class="sidebar-dialog-header-container">\n <velt-comment-dialog-header-wireframe>\n <div class="sidebar-dialog-header-block">\n <velt-comment-dialog-comment-count-wireframe></velt-comment-dialog-comment-count-wireframe>\n <velt-comment-dialog-status-wireframe></velt-comment-dialog-status-wireframe>\n <div style="flex-grow: 1"></div>\n <velt-comment-dialog-comment-category-wireframe></velt-comment-dialog-comment-category-wireframe>\n <velt-comment-dialog-priority-wireframe></velt-comment-dialog-priority-wireframe>\n </div>\n </velt-comment-dialog-header-wireframe>\n </div>\n <div class="sidebar-dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="sidebar-dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n ',window.document.body.appendChild(t)}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),Va("Error in loadPluginUI: ",t)}},this.listenToDocumentTitleChange=()=>{try{this.documentTitleChangeInterval||(this.documentTitleChangeInterval=setInterval((()=>{var t,e,i;const o="true"===sessionStorage.getItem("debugDocumentTitleChange");if(o&&(console.log("*** listenToDocumentTitleChange ***"),console.log("usePageTitleAsLocationName: ",this.usePageTitleAsLocationName)),this.usePageTitleAsLocationName){const n=document.title;o&&(console.log("location name: ",null===(t=this.location)||void 0===t?void 0:t.locationName),console.log("title: ",n),console.log("changed: ",(null===(e=this.location)||void 0===e?void 0:e.locationName)!==n)),(null===(i=this.location)||void 0===i?void 0:i.locationName)!==n&&(o&&console.log("%c triggering location update!","color: green; font-weight: bold;"),this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),2e3))}catch(t){Va("Error in listenToDocumentTitleChange: ",t)}},this.initializeSnippyly=async()=>{var t,i,o,n,r,s,a,l,c,d,h,u,p,v,m,g,f,w,y,b,C,x,E;try{let S=this.staging?pt:vt;this.staging||mt.includes(this.apiKey)||(S="latest"),this.veltVersion&&(S=this.veltVersion);let k=this.staging,M=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(S=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(k=!1,M=!0)}if(console.log("Velt SDK version:",S),await e(this.apiKey,{options:{develop:k,staging:M,version:S,velt:!0,proxyDomain:"https://cdn.velt.dev"}}),!window.Snippyly)return;if(this.autoTranslation&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.enableAutoTranslation)&&(null===Snippyly||void 0===Snippyly||Snippyly.enableAutoTranslation()),!document.querySelector(Zt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(Zt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Kt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Kt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Snippyly){null===Snippyly||void 0===Snippyly||Snippyly.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt:Snippyly}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Snippyly))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),(()=>{try{if(!document.getElementById("superflowFontLink3")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/fonts%2Fpoppins%2Fpoppins.css?alt=media&token=5f31a0f2-5f67-4974-bf56-78ae655f2b68",t.id="superflowFontLink3",document.head.appendChild(t)}}catch(t){console.warn("Error in loadPoppinsFont: ",t),Va("Error in loadPoppinsFont: ",t)}})()}if(Snippyly&&Pa({sdkVersion:null===Snippyly||void 0===Snippyly?void 0:Snippyly.version,sdkType:"client"}),this.generateDocumentId(),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.on)&&"function"==typeof(null===Snippyly||void 0===Snippyly?void 0:Snippyly.on)?Snippyly.on("userUpdate").subscribe((async t=>{t&&await this.setDocumentAndLocation()})):await this.setDocumentAndLocation(),setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3),this.commentElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),this.contactElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getContactElement(),this.rewriterElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getRewriterElement(),this.presenceElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getPresenceElement(),this.commentElement){this.commentElement.enableTextComments(!0),this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(t=this.commentElement)||void 0===t?void 0:t.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(i=this.commentElement)||void 0===i?void 0:i.enableDeviceInfo)&&this.commentElement.enableDeviceInfo(!0),this.commentElement.enableCommentIndex(!0),this.commentElement.onCommentModeChange&&this.commentElement.onCommentModeChange().subscribe((t=>{this.addCommentMode=t,this.addCommentMode||this.showModalOnceCommentIsModeIsOff&&(this.addCommentCount>=2&&!Ma(Vt)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),ka(Vt,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!Ma(zt,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),ka(zt,"true",!1,"sessionStorage"),this.showModalOnceCommentIsModeIsOff=!1))})),(null===(o=this.commentElement)||void 0===o?void 0:o.enableOrphanComments)&&this.commentElement.enableOrphanComments(),(null===(n=this.commentElement)||void 0===n?void 0:n.enableAutoCategorize)&&this.commentElement.enableAutoCategorize(),(null===(r=this.commentElement)||void 0===r?void 0:r.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),(null===(s=this.commentElement)||void 0===s?void 0:s.enableGhostComments)&&this.commentElement.enableGhostComments();const e=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;e&&"object"==typeof e&&(null===(a=this.commentElement)||void 0===a?void 0:a.setCustomStatus)&&this.commentElement.setCustomStatus(e),(null===(l=this.commentElement)||void 0===l?void 0:l.enableMinimap)&&this.commentElement.enableMinimap(),(null===(c=this.commentElement)||void 0===c?void 0:c.setDStrategy)&&(null===(d=this.commentElement)||void 0===d||d.setDStrategy("dynamicId")),(null===(h=this.commentElement)||void 0===h?void 0:h.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableHotkey)&&this.commentElement.enableHotkey(),(null===(p=this.commentElement)||void 0===p?void 0:p.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins()}this.selectionElement=Snippyly.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(v=this.rewriterElement)||void 0===v||v.enableRewriter()),this.presenceElement&&(null===(m=this.presenceElement)||void 0===m?void 0:m.enableFlockMode)&&(null===(g=this.presenceElement)||void 0===g||g.enableFlockMode(!0)),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocElement)&&(this.docElement=Snippyly.getDocElement()),null===(b=(null===(f=this.docElement)||void 0===f?void 0:f.getDocumentMetadata)?null===(w=this.docElement)||void 0===w?void 0:w.getDocumentMetadata():null===(y=null===Snippyly||void 0===Snippyly?void 0:Snippyly.docService)||void 0===y?void 0:y.getDocumentMetadata$())||void 0===b||b.subscribe((t=>{const e=(null==t?void 0:t.versions)?Object.values(null==t?void 0:t.versions):[],i=new URL(document.location).searchParams.get("version");if(i){const t=e.find((t=>t.versionId===i));t&&(this.version={id:t.versionId,name:t.versionName||t.versionId},this.setLocation())}})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getViewsElement)&&(this.viewsElement=Snippyly.getViewsElement()),(null===(C=this.viewsElement)||void 0===C?void 0:C.getUniqueViewsByUser)&&(null===(E=null===(x=this.viewsElement)||void 0===x?void 0:x.getUniqueViewsByUser())||void 0===E||E.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),Va("Error in initializeSnippyly: ",t)}},this.generateDocumentId=()=>{try{this.documentId=Ca(Ea(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),this.serverDocumentId=(t=this.documentId+"")?`${Ca(t)}`:void 0}catch(t){console.warn("Error in generateDocumentId: ",t),Va("Error in generateDocumentId: ",t)}var t},this.setDocumentAndLocation=async()=>{try{this.generateDocumentId(),this.previousLocation=null,await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setDocumentId(this.documentId+"")),Pa({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation()}catch(t){console.warn("Error in setDocumentAndLocation: ",t),Va("Error in setDocumentAndLocation: ",t)}},this.checkToEnableUpgradeButton=()=>{var t,e;try{this.isPlanExpired&&this.isUserGlobalContact?(null===(t=this.commentElement)||void 0===t?void 0:t.enableUpgradeButton)&&this.commentElement.enableUpgradeButton():(null===(e=this.commentElement)||void 0===e?void 0:e.disableUpgradeButton)&&this.commentElement.disableUpgradeButton()}catch(t){console.warn("Error in checkToEnableUpgradeButton: ",t),Va("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{let t=(()=>{try{const t=Ma(Bt);return t?"false"===t?JSON.parse(JSON.stringify(Jt)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),Va("Error in getCustomerMetadataFromStorage: ",t),null}})();return t||(t=await(async t=>{try{const e=Co(Fa,re,{timeout:12e5}),i=await e({apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey),Da(t)),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),Va("Error in getCustomerMetadata: ",t)}},this.getSamlConfig=async()=>{try{let t=(()=>{try{const t=Ma(Ht,!0);return t?JSON.parse(t):null}catch(t){return console.warn("Error in getSamlConfigFromStorage: ",t),Va("Error in getSamlConfigFromStorage: ",t),null}})();return t||(t=await(async t=>{var e;try{const i=Co(Fa,ue,{timeout:12e5}),o=await i({eventType:"getPublicConfig",apiKey:t});return null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.publicConfig}catch(t){return console.warn("Error in getSamlPublicConfig: ",t),null}})(this.apiKey),t&&(t=>{try{if(t){const e=JSON.stringify(t);ka(Ht,e,!0)}}catch(t){console.warn("Error in setSamlConfigToStorage: ",t),Va("Error in setSamlConfigToStorage: ",t)}})(t)),t}catch(t){console.warn("Error in getSamlConfig: ",t),Va("Error in getSamlConfig: ",t)}},this.setLogos=()=>{var t,e,i,o,n,r,s,a,l,c,d,h;try{let u="light";this.privateCommentModeEnabled&&(u="dark");const p=null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.customBranding)||void 0===e?void 0:e.logo)||void 0===i?void 0:i.logoMark,v=null===(r=null===(n=null===(o=null==qt?void 0:Jt)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===r?void 0:r.logoMark,m=null===(l=null===(a=null===(s=this.customerMetadata)||void 0===s?void 0:s.customBranding)||void 0===a?void 0:a.logo)||void 0===l?void 0:l.wordMark,g=null===(h=null===(d=null===(c=null==qt?void 0:Jt)||void 0===c?void 0:c.customBranding)||void 0===d?void 0:d.logo)||void 0===h?void 0:h.wordMark;switch(u){case"light":this.logoMark=(null==p?void 0:p.lightUrl)||(null==p?void 0:p.darkUrl)||(null==v?void 0:v.lightUrl),this.wordMark=(null==m?void 0:m.lightUrl)||(null==m?void 0:m.darkUrl)||(null==g?void 0:g.lightUrl);break;case"dark":this.logoMark=(null==p?void 0:p.darkUrl)||(null==p?void 0:p.lightUrl)||(null==v?void 0:v.darkUrl),this.wordMark=(null==m?void 0:m.darkUrl)||(null==m?void 0:m.lightUrl)||(null==g?void 0:g.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),Va("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?L`
2649
+ `;var Ka=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class Ja extends Q{constructor(){super(),this._loadPlugin=!1,this.comments=[],this.addCommentMode=!1,this.showTourCommentTooltip=!1,this.allFeatureDisabled=!1,this.allFeatureRestricted=!1,this.guestMode=!1,this._expanded=!0,this.loading=!0,this._isPlanExpired=null,this.showOnboardingModal=!0,this.showLiveDemoModal=!1,this.showFigmaDemoModal=!1,this.showGuestModeSignInModal=!1,this.defaultGuestModeSignInModalConfig={title:"Sign in to notify your team",description:"Notify your team about your latest comments.",closeOnClickOutside:!1,showLeaveCommentButton:!0},this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig)),this.showGuestModeNameModal=!1,this.guestModeSignInBannerVisible=!1,this.guestUserNameInput="",this.guestUserModelOpened=!1,this.guestUserNameUpdated=!1,this.guestUserNameUpdateLoading=!1,this.staging=Qt,this._autoLocation=!0,this.copyLinkTooltip="Copy Link",this.invalidApiKey=!1,this._isUserGlobalContact=!1,this.showQrCode=!1,this.customLoginEnabledLocally=null,this.customLoginEnabled=null,this.exitReviewModeCalled=!1,this.addCommentCount=0,this._privateCommentModeEnabled=!1,this.superflowToolbarMoved=!1,this._darkMode=!1,this.allowGuestModeSignIn=!0,this._queryParamsComments=!1,this._usePageTitleAsLocationName=!1,this.toolbarEnabled=!1,this.toolbarEnabledApiCalled=!1,this.passwordProtected=!1,this.isPasswordValid=!1,this.password="",this.validatingPasswordLoading=!1,this.showPasswordProtectedModal=!1,this.showInvalidPassword=!1,this.skipGuestNameModal=!1,this._totalViews={},this.totalViewsCount=0,this.inviteUrl="",this.showModalOnceCommentIsModeIsOff=!1,this.subscriptions=[],this.onApiKeyChange=()=>{try{this.apiKey&&(null===window||void 0===window?void 0:window.onSuperflowLoad)&&"function"==typeof window.onSuperflowLoad&&window.onSuperflowLoad()}catch(t){console.warn("Error in onApiKeyChange: ",t),Va("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await(t=>{const e={apiKey:t};return Co(Fa,le,{timeout:12e5})(e)})(this.apiKey);this.customLoginEnabled=!!(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),Va("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(_a(Et),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),Va("Error in loginWithCustomUser: ",t)}},this.addWindowClickEventListener=()=>{try{this.windowClickEventListener||(this.windowClickEventListener=()=>{this.menuOpenedId&&(this.menuOpenedId=void 0)},window.addEventListener("click",this.windowClickEventListener))}catch(t){console.warn("Error in addWindowClickEventListener: ",t),Va("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),Va("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),Va("Error in setWindowEventListner: ",t)}},this.urlChangeListener=()=>{try{const t=history.pushState;history.pushState=function(){const e=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),e};const e=history.replaceState;history.replaceState=function(){const t=e.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))}))}catch(t){console.warn("Error in urlChangeListener: ",t),Va("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if(e.has(bt)&&ka(ft,"true",!1),(null==e?void 0:e.has(Tt))&&!Ma(Tt)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(Nt))if(Ma(Nt,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(Nt),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showLiveDemoModal=!0;else this.showLiveDemoModal=!1;if(null==e?void 0:e.has(It))if(Ma(It,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(It),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showFigmaDemoModal=!0;else this.showFigmaDemoModal=!1;if(e.has(xt)||e.has("snippyly_google_token")){if(e.has(xt)){const t=decodeURIComponent(e.get(xt)),i=Ia(t,te,ee),o=i&&JSON.parse(i);if(o){const t={};t.userId=o.uid,t.name=o.displayName,t.email=o.email,t.photoUrl=null==o?void 0:o.photoURL;const e=JSON.stringify(t),i=Na(e,te,ee);ka(Et,i,!0),_a(Ot)}}else if(e.has("snippyly_google_token")){const t=JSON.parse(atob(e.get("snippyly_google_token"))),i={};i.userId=t.uid,i.name=t.displayName,i.email=t.email,i.photoUrl=null==t?void 0:t.photoURL,ka(Ct,JSON.stringify(i),!0)}e.delete(xt),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(ft)?(ka(ft,"true",!1),_a(wt),e.delete(ft),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(wt)||Ma(ft,!1)&&this.loadPluginUI(),e.has(wt)?(ka(wt,"true",!1),_a(ft),e.delete(wt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(ft)||Ma(wt,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),Va("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(ft)||t.searchParams.set(ft,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),Va("Error in setInviteUrl: ",t)}},this.detectVersion=()=>{try{if(this.projectVersionKey){const t=new URL(document.location).searchParams;if(t.get(this.projectVersionKey))this.projectVersion=t.get(this.projectVersionKey);else if(window.snippylyInitialLoadUrl){const t=new URL(window.snippylyInitialLoadUrl).searchParams;t.get(this.projectVersionKey)&&(this.projectVersion=t.get(this.projectVersionKey))}this.projectVersion&&ka(Mt,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(ft)||t.has(wt))&&t.has(_t)&&(ka(kt,_t,!1,"sessionStorage"),this.projectVersion=t.get(_t),this.projectVersion&&ka(Mt,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),Va("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||Ma(kt,!1,"sessionStorage"),e=this.projectVersion||Ma(Mt,!1,"sessionStorage");if(t&&e){const i=new URL(document.location),o=i.searchParams;o.get(t)||(o.set(t,e),window.history.replaceState({},document.title,i.href))}}catch(t){console.warn("Error in setVersionInUrl: ",t),Va("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,r,s,a,l;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),this.setLocation(),void setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3);if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;gt.includes(this.apiKey)&&this.listenToDocumentTitleChange();const c=Aa();if(c&&!(null==c?void 0:c.isAnonymous)&&(this.loading=!0),null===(t=this.getCustomerMetadata())||void 0===t||t.then((t=>{this.customerMetadata=t})).catch((t=>{console.warn("Error in getCustomerMetadata: ",t),Va("Error in getCustomerMetadata: ",t)})),Sa(jt)&&(this.isPasswordValid=Sa(jt)),Ma(Lt,!0)&&Ma(Rt,!0)&&Ma(Dt,!0)&&Ma(Ft,!0)&&Ma($t,!0)?(this.guestMode="true"===Ma(Lt,!0),this.allowGuestModeSignIn="true"===Ma(Rt,!0),this.passwordProtected="true"===Ma(Dt,!0),this.queryParamsComments="true"===Ma(Ft,!0),this.usePageTitleAsLocationName="true"===Ma($t,!0)):(this.projectConfig=await(async(t,e)=>{var i;try{const o=Co(Fa,ce,{timeout:12e5}),n=await o({apiKey:t,projectId:e});return null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data}catch(t){return console.warn("Error in getProjectConfig: ",t),null}})(this.apiKey,this.projectId),this.guestMode=!!(null===(e=this.projectConfig)||void 0===e?void 0:e.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(o=null===(i=this.projectConfig)||void 0===i?void 0:i.guestModeConfig)||void 0===o?void 0:o.allowSignIn),this.queryParamsComments=!!(null===(n=this.projectConfig)||void 0===n?void 0:n.queryParamsComments),this.usePageTitleAsLocationName=!!(null===(r=this.projectConfig)||void 0===r?void 0:r.usePageTitleAsLocationName),(null===(s=this.projectConfig)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=this.projectConfig)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),ka(Lt,this.guestMode+"",!0),ka(Rt,this.allowGuestModeSignIn+"",!0),ka(Dt,this.passwordProtected+"",!0),ka(Ft,this.queryParamsComments+"",!0),ka($t,this.usePageTitleAsLocationName+"",!0)),this.loadPlugin=!0,!document.querySelector(Zt.VELT_COMMENTS)){const t=document.createElement(Zt.VELT_COMMENTS);null==t||t.addEventListener("onSignIn",(()=>{this.loginWithGoogle()})),null==t||t.addEventListener("onUpgrade",(()=>{this.onUpgradePlanClick()})),t.addEventListener("onCommentAdd",(()=>{this.addCommentCount++})),t.addEventListener("onCommentUpdate",(t=>{var e,i;(null===(e=this.snippylyUser)||void 0===e?void 0:e.isGuest)&&"newlyAdded"===(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.type)&&(this.addCommentCount>=2&&(this.showModalOnceCommentIsModeIsOff=!0),this.addCommentCount>=5&&!this.showModalOnceCommentIsModeIsOff&&(this.showModalOnceCommentIsModeIsOff=!0))})),window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_CURSOR)){const t=document.createElement(Zt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_HUDDLE)){const t=document.createElement(Zt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_RECORDER_NOTES)){const t=document.createElement(Zt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Zt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Zt.VELT_ARROWS)){const t=document.createElement(Zt.VELT_ARROWS);window.document.body.appendChild(t)}try{const t=new URL(document.location),e=t.searchParams;let i=!1;e.has("wireframe")&&"true"===e.get("wireframe")&&(sessionStorage.setItem("velt-wireframe","true"),e.delete("wireframe"),i=!0),e.get("velt-version")&&(sessionStorage.setItem("velt-version",e.get("velt-version")),e.delete("velt-version"),i=!0),e.get("velt-env")&&(sessionStorage.setItem("velt-env",e.get("velt-env")),e.delete("velt-env"),i=!0),i&&window.history.replaceState({},document.title,t.href)}catch(t){}if(this.staging&&"true"===sessionStorage.getItem("velt-wireframe")){const t=document.createElement("velt-wireframe");t.innerHTML='\n <style>\n .dialog-header-container {\n padding: 12px;\n background: lightcyan;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .dialog-all-comment-container app-comment-dialog-all-comment > div {\n padding: 12px;\n background: lightpink;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-container {\n padding: 12px;\n background: lightgreen;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-block {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n </style>\n\t\t\t\t\t\t<velt-comment-pin-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-pin-container">\n\t\t\t\t\t\t\t\t\t<div style="width: 35px; height: 35px; background-color: blue; border-radius: 12px; border-width: 3px; border-style: solid; border-color: #f00;"></div>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div class="custom-indicator"></div>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>P</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>G</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-index-wireframe></velt-comment-pin-index-wireframe>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-pin-wireframe>\n\n\t\t\t\t\t\t<velt-comment-bubble-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-bubble">\n\t\t\t\t\t\t\t\t<velt-comment-bubble-avatar-wireframe></velt-comment-bubble-avatar-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-bubble-comments-count-wireframe></velt-comment-bubble-comments-count-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-bubble-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-tool-wireframe>\n\t\t\t\t\t\t\t<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t\t\t\t<circle cx="50" cy="50" r="40" fill="red" />\n\t\t\t\t\t\t\t\t<rect x="5" y="5" width="90" height="90" fill="blue" fill-opacity="0.5" />\n\t\t\t\t\t\t\t\t<polygon points="50,5 95,95 5,95" fill="yellow" fill-opacity="0.7" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</velt-text-comment-tool-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:violet; display: flex; gap: 8px; border-radius: 12px; padding: 8px; align-items: center;">\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-generic-wireframe><p>GPT</p></velt-text-comment-toolbar-generic-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-seperator-wireframe><p>Seperator</p></velt-text-comment-toolbar-seperator-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-comment-annotation-wireframe><p>Comment</p></velt-text-comment-toolbar-comment-annotation-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-copywriter-wireframe><p>Copywriter</p></velt-text-comment-toolbar-copywriter-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t<velt-comment-sidebar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:lightblue; width: 100%; height: 100%;">\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Header</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Close Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-search-wireframe></velt-comment-sidebar-search-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-status-wireframe></velt-comment-sidebar-status-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Filter Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Filter</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-title-wireframe></velt-comment-sidebar-filter-title-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom CLose filter</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-close-button-wireframe>\n\n\t\t\t\t\t\t\t\t\t<div style="background-color: yellow">\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-location-wireframe></velt-comment-sidebar-filter-location-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-people-wireframe></velt-comment-sidebar-filter-people-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-category-wireframe></velt-comment-sidebar-filter-category-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-priority-wireframe></velt-comment-sidebar-filter-priority-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-comment-type-wireframe></velt-comment-sidebar-filter-comment-type-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-versions-wireframe></velt-comment-sidebar-filter-versions-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-group-by-wireframe></velt-comment-sidebar-filter-group-by-wireframe>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom Done Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-list-wireframe></velt-comment-sidebar-list-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Empty Placeholder</div>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-page-mode-wireframe></velt-comment-sidebar-page-mode-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-sidebar-wireframe>\n <velt-comment-dialog-wireframe variant="dialog">\n <div class="dialog-all-comment-container">\n <velt-comment-dialog-all-comment-wireframe></velt-comment-dialog-all-comment-wireframe>\n </div>\n <div class="dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n <div class="dialog-header-container">\n <velt-comment-dialog-header-wireframe></velt-comment-dialog-header-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n <velt-comment-dialog-wireframe variant="sidebar">\n <div class="sidebar-dialog-header-container">\n <velt-comment-dialog-header-wireframe>\n <div class="sidebar-dialog-header-block">\n <velt-comment-dialog-comment-count-wireframe></velt-comment-dialog-comment-count-wireframe>\n <velt-comment-dialog-status-wireframe></velt-comment-dialog-status-wireframe>\n <div style="flex-grow: 1"></div>\n <velt-comment-dialog-comment-category-wireframe></velt-comment-dialog-comment-category-wireframe>\n <velt-comment-dialog-priority-wireframe></velt-comment-dialog-priority-wireframe>\n </div>\n </velt-comment-dialog-header-wireframe>\n </div>\n <div class="sidebar-dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="sidebar-dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n ',window.document.body.appendChild(t)}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),Va("Error in loadPluginUI: ",t)}},this.listenToDocumentTitleChange=()=>{try{this.documentTitleChangeInterval||(this.documentTitleChangeInterval=setInterval((()=>{var t,e,i;const o="true"===sessionStorage.getItem("debugDocumentTitleChange");if(o&&(console.log("*** listenToDocumentTitleChange ***"),console.log("usePageTitleAsLocationName: ",this.usePageTitleAsLocationName)),this.usePageTitleAsLocationName){const n=document.title;o&&(console.log("location name: ",null===(t=this.location)||void 0===t?void 0:t.locationName),console.log("title: ",n),console.log("changed: ",(null===(e=this.location)||void 0===e?void 0:e.locationName)!==n)),(null===(i=this.location)||void 0===i?void 0:i.locationName)!==n&&(o&&console.log("%c triggering location update!","color: green; font-weight: bold;"),this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),2e3))}catch(t){Va("Error in listenToDocumentTitleChange: ",t)}},this.initializeSnippyly=async()=>{var t,i,o,n,r,s,a,l,c,d,h,u,p,v,m,g,f,w,y,b,C,x;try{let E=this.staging?pt:vt;this.staging||mt.includes(this.apiKey)||(E="latest"),this.veltVersion&&(E=this.veltVersion);let S=this.staging,k=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(E=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(S=!1,k=!0)}if(console.log("Velt SDK version:",E),await e(this.apiKey,{options:{develop:S,staging:k,version:E,velt:!0,proxyDomain:"https://cdn.velt.dev"}}),!window.Snippyly)return;if(this.autoTranslation&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.enableAutoTranslation)&&(null===Snippyly||void 0===Snippyly||Snippyly.enableAutoTranslation()),!document.querySelector(Zt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(Zt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Kt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Kt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Snippyly){null===Snippyly||void 0===Snippyly||Snippyly.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt:Snippyly}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Snippyly))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),(()=>{try{if(!document.getElementById("superflowFontLink3")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/fonts%2Fpoppins%2Fpoppins.css?alt=media&token=5f31a0f2-5f67-4974-bf56-78ae655f2b68",t.id="superflowFontLink3",document.head.appendChild(t)}}catch(t){console.warn("Error in loadPoppinsFont: ",t),Va("Error in loadPoppinsFont: ",t)}})()}if(Snippyly&&Pa({sdkVersion:null===Snippyly||void 0===Snippyly?void 0:Snippyly.version,sdkType:"client"}),this.generateDocumentId(),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.on)&&"function"==typeof(null===Snippyly||void 0===Snippyly?void 0:Snippyly.on)?Snippyly.on("userUpdate").subscribe((async t=>{t&&await this.setDocumentAndLocation()})):await this.setDocumentAndLocation(),setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3),this.commentElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),this.contactElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getContactElement(),this.rewriterElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getRewriterElement(),this.presenceElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getPresenceElement(),this.commentElement){this.commentElement.enableTextComments(!0),this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(t=this.commentElement)||void 0===t?void 0:t.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(i=this.commentElement)||void 0===i?void 0:i.enableDeviceInfo)&&this.commentElement.enableDeviceInfo(!0),this.commentElement.enableCommentIndex(!0),this.commentElement.onCommentModeChange&&this.commentElement.onCommentModeChange().subscribe((t=>{this.addCommentMode=t,this.addCommentMode||this.showModalOnceCommentIsModeIsOff&&(this.addCommentCount>=2&&!Ma(Vt)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),ka(Vt,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!Ma(zt,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),ka(zt,"true",!1,"sessionStorage"),this.showModalOnceCommentIsModeIsOff=!1))})),(null===(o=this.commentElement)||void 0===o?void 0:o.enableOrphanComments)&&this.commentElement.enableOrphanComments(),(null===(n=this.commentElement)||void 0===n?void 0:n.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),(null===(r=this.commentElement)||void 0===r?void 0:r.enableGhostComments)&&this.commentElement.enableGhostComments();const e=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;e&&"object"==typeof e&&(null===(s=this.commentElement)||void 0===s?void 0:s.setCustomStatus)&&this.commentElement.setCustomStatus(e),(null===(a=this.commentElement)||void 0===a?void 0:a.enableMinimap)&&this.commentElement.enableMinimap(),(null===(l=this.commentElement)||void 0===l?void 0:l.setDStrategy)&&(null===(c=this.commentElement)||void 0===c||c.setDStrategy("dynamicId")),(null===(d=this.commentElement)||void 0===d?void 0:d.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(h=this.commentElement)||void 0===h?void 0:h.enableHotkey)&&this.commentElement.enableHotkey(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins()}this.selectionElement=Snippyly.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(p=this.rewriterElement)||void 0===p||p.enableRewriter()),this.presenceElement&&(null===(v=this.presenceElement)||void 0===v?void 0:v.enableFlockMode)&&(null===(m=this.presenceElement)||void 0===m||m.enableFlockMode(!0)),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocElement)&&(this.docElement=Snippyly.getDocElement()),null===(y=(null===(g=this.docElement)||void 0===g?void 0:g.getDocumentMetadata)?null===(f=this.docElement)||void 0===f?void 0:f.getDocumentMetadata():null===(w=null===Snippyly||void 0===Snippyly?void 0:Snippyly.docService)||void 0===w?void 0:w.getDocumentMetadata$())||void 0===y||y.subscribe((t=>{const e=(null==t?void 0:t.versions)?Object.values(null==t?void 0:t.versions):[],i=new URL(document.location).searchParams.get("version");if(i){const t=e.find((t=>t.versionId===i));t&&(this.version={id:t.versionId,name:t.versionName||t.versionId},this.setLocation())}})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getViewsElement)&&(this.viewsElement=Snippyly.getViewsElement()),(null===(b=this.viewsElement)||void 0===b?void 0:b.getUniqueViewsByUser)&&(null===(x=null===(C=this.viewsElement)||void 0===C?void 0:C.getUniqueViewsByUser())||void 0===x||x.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),Va("Error in initializeSnippyly: ",t)}},this.generateDocumentId=()=>{try{this.documentId=Ca(Ea(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),this.serverDocumentId=(t=this.documentId+"")?`${Ca(t)}`:void 0}catch(t){console.warn("Error in generateDocumentId: ",t),Va("Error in generateDocumentId: ",t)}var t},this.setDocumentAndLocation=async()=>{try{this.generateDocumentId(),this.previousLocation=null,await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setDocumentId(this.documentId+"")),Pa({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation()}catch(t){console.warn("Error in setDocumentAndLocation: ",t),Va("Error in setDocumentAndLocation: ",t)}},this.checkToEnableUpgradeButton=()=>{var t,e;try{this.isPlanExpired&&this.isUserGlobalContact?(null===(t=this.commentElement)||void 0===t?void 0:t.enableUpgradeButton)&&this.commentElement.enableUpgradeButton():(null===(e=this.commentElement)||void 0===e?void 0:e.disableUpgradeButton)&&this.commentElement.disableUpgradeButton()}catch(t){console.warn("Error in checkToEnableUpgradeButton: ",t),Va("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{let t=(()=>{try{const t=Ma(Bt);return t?"false"===t?JSON.parse(JSON.stringify(Jt)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),Va("Error in getCustomerMetadataFromStorage: ",t),null}})();return t||(t=await(async t=>{try{const e=Co(Fa,re,{timeout:12e5}),i=await e({apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey),Da(t)),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),Va("Error in getCustomerMetadata: ",t)}},this.getSamlConfig=async()=>{try{let t=(()=>{try{const t=Ma(Ht,!0);return t?JSON.parse(t):null}catch(t){return console.warn("Error in getSamlConfigFromStorage: ",t),Va("Error in getSamlConfigFromStorage: ",t),null}})();return t||(t=await(async t=>{var e;try{const i=Co(Fa,ue,{timeout:12e5}),o=await i({eventType:"getPublicConfig",apiKey:t});return null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.publicConfig}catch(t){return console.warn("Error in getSamlPublicConfig: ",t),null}})(this.apiKey),t&&(t=>{try{if(t){const e=JSON.stringify(t);ka(Ht,e,!0)}}catch(t){console.warn("Error in setSamlConfigToStorage: ",t),Va("Error in setSamlConfigToStorage: ",t)}})(t)),t}catch(t){console.warn("Error in getSamlConfig: ",t),Va("Error in getSamlConfig: ",t)}},this.setLogos=()=>{var t,e,i,o,n,r,s,a,l,c,d,h;try{let u="light";this.privateCommentModeEnabled&&(u="dark");const p=null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.customBranding)||void 0===e?void 0:e.logo)||void 0===i?void 0:i.logoMark,v=null===(r=null===(n=null===(o=null==qt?void 0:Jt)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===r?void 0:r.logoMark,m=null===(l=null===(a=null===(s=this.customerMetadata)||void 0===s?void 0:s.customBranding)||void 0===a?void 0:a.logo)||void 0===l?void 0:l.wordMark,g=null===(h=null===(d=null===(c=null==qt?void 0:Jt)||void 0===c?void 0:c.customBranding)||void 0===d?void 0:d.logo)||void 0===h?void 0:h.wordMark;switch(u){case"light":this.logoMark=(null==p?void 0:p.lightUrl)||(null==p?void 0:p.darkUrl)||(null==v?void 0:v.lightUrl),this.wordMark=(null==m?void 0:m.lightUrl)||(null==m?void 0:m.darkUrl)||(null==g?void 0:g.lightUrl);break;case"dark":this.logoMark=(null==p?void 0:p.darkUrl)||(null==p?void 0:p.lightUrl)||(null==v?void 0:v.darkUrl),this.wordMark=(null==m?void 0:m.darkUrl)||(null==m?void 0:m.lightUrl)||(null==g?void 0:g.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),Va("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?L`
2650
2650
  ${dt(this.logoMark)}
2651
2651
  `:L`
2652
2652
  <img src=${this.logoMark} />
package/superflow.min.js CHANGED
@@ -2646,7 +2646,7 @@ class ua extends Qn{}ua.Encryptor=class extends ua{processBlock(t,e){const i=t,o
2646
2646
  display: none;
2647
2647
  }
2648
2648
  }
2649
- `;var Ja=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class Ya extends X{constructor(){super(),this._loadPlugin=!1,this.comments=[],this.addCommentMode=!1,this.showTourCommentTooltip=!1,this.allFeatureDisabled=!1,this.allFeatureRestricted=!1,this.guestMode=!1,this._expanded=!0,this.loading=!0,this._isPlanExpired=null,this.showOnboardingModal=!0,this.showLiveDemoModal=!1,this.showFigmaDemoModal=!1,this.showGuestModeSignInModal=!1,this.defaultGuestModeSignInModalConfig={title:"Sign in to notify your team",description:"Notify your team about your latest comments.",closeOnClickOutside:!1,showLeaveCommentButton:!0},this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig)),this.showGuestModeNameModal=!1,this.guestModeSignInBannerVisible=!1,this.guestUserNameInput="",this.guestUserModelOpened=!1,this.guestUserNameUpdated=!1,this.guestUserNameUpdateLoading=!1,this.staging=Xt,this._autoLocation=!0,this.copyLinkTooltip="Copy Link",this.invalidApiKey=!1,this._isUserGlobalContact=!1,this.showQrCode=!1,this.customLoginEnabledLocally=null,this.customLoginEnabled=null,this.exitReviewModeCalled=!1,this.addCommentCount=0,this._privateCommentModeEnabled=!1,this.superflowToolbarMoved=!1,this._darkMode=!1,this.allowGuestModeSignIn=!0,this._queryParamsComments=!1,this._usePageTitleAsLocationName=!1,this.toolbarEnabled=!1,this.toolbarEnabledApiCalled=!1,this.passwordProtected=!1,this.isPasswordValid=!1,this.password="",this.validatingPasswordLoading=!1,this.showPasswordProtectedModal=!1,this.showInvalidPassword=!1,this.skipGuestNameModal=!1,this._totalViews={},this.totalViewsCount=0,this.inviteUrl="",this.showModalOnceCommentIsModeIsOff=!1,this.subscriptions=[],this.onApiKeyChange=()=>{try{this.apiKey&&(null===window||void 0===window?void 0:window.onSuperflowLoad)&&"function"==typeof window.onSuperflowLoad&&window.onSuperflowLoad()}catch(t){console.warn("Error in onApiKeyChange: ",t),Ua("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await(t=>{const e={apiKey:t};return xo($a,ce,{timeout:12e5})(e)})(this.apiKey);this.customLoginEnabled=!!(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),Ua("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(Ta(St),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),Ua("Error in loginWithCustomUser: ",t)}},this.addWindowClickEventListener=()=>{try{this.windowClickEventListener||(this.windowClickEventListener=()=>{this.menuOpenedId&&(this.menuOpenedId=void 0)},window.addEventListener("click",this.windowClickEventListener))}catch(t){console.warn("Error in addWindowClickEventListener: ",t),Ua("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),Ua("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),Ua("Error in setWindowEventListner: ",t)}},this.urlChangeListener=()=>{try{const t=history.pushState;history.pushState=function(){const e=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),e};const e=history.replaceState;history.replaceState=function(){const t=e.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))}))}catch(t){console.warn("Error in urlChangeListener: ",t),Ua("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if(e.has(Ct)&&Ma(wt,"true",!1),(null==e?void 0:e.has(Nt))&&!_a(Nt)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(It))if(_a(It,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(It),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showLiveDemoModal=!0;else this.showLiveDemoModal=!1;if(null==e?void 0:e.has(At))if(_a(At,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(At),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showFigmaDemoModal=!0;else this.showFigmaDemoModal=!1;if(e.has(Et)||e.has("snippyly_google_token")){if(e.has(Et)){const t=decodeURIComponent(e.get(Et)),i=Aa(t,ee,ie),o=i&&JSON.parse(i);if(o){const t={};t.userId=o.uid,t.name=o.displayName,t.email=o.email,t.photoUrl=null==o?void 0:o.photoURL;const e=JSON.stringify(t),i=Ia(e,ee,ie);Ma(St,i,!0),Ta(Lt)}}else if(e.has("snippyly_google_token")){const t=JSON.parse(atob(e.get("snippyly_google_token"))),i={};i.userId=t.uid,i.name=t.displayName,i.email=t.email,i.photoUrl=null==t?void 0:t.photoURL,Ma(xt,JSON.stringify(i),!0)}e.delete(Et),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(wt)?(Ma(wt,"true",!1),Ta(yt),e.delete(wt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(yt)||_a(wt,!1)&&this.loadPluginUI(),e.has(yt)?(Ma(yt,"true",!1),Ta(wt),e.delete(yt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(wt)||_a(yt,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),Ua("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(wt)||t.searchParams.set(wt,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),Ua("Error in setInviteUrl: ",t)}},this.detectVersion=()=>{try{if(this.projectVersionKey){const t=new URL(document.location).searchParams;if(t.get(this.projectVersionKey))this.projectVersion=t.get(this.projectVersionKey);else if(window.snippylyInitialLoadUrl){const t=new URL(window.snippylyInitialLoadUrl).searchParams;t.get(this.projectVersionKey)&&(this.projectVersion=t.get(this.projectVersionKey))}this.projectVersion&&Ma(_t,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(wt)||t.has(yt))&&t.has(Tt)&&(Ma(Mt,Tt,!1,"sessionStorage"),this.projectVersion=t.get(Tt),this.projectVersion&&Ma(_t,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),Ua("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||_a(Mt,!1,"sessionStorage"),e=this.projectVersion||_a(_t,!1,"sessionStorage");if(t&&e){const i=new URL(document.location),o=i.searchParams;o.get(t)||(o.set(t,e),window.history.replaceState({},document.title,i.href))}}catch(t){console.warn("Error in setVersionInUrl: ",t),Ua("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,r,s,a,l;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),this.setLocation(),void setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3);if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;ft.includes(this.apiKey)&&this.listenToDocumentTitleChange();const c=Oa();if(c&&!(null==c?void 0:c.isAnonymous)&&(this.loading=!0),null===(t=this.getCustomerMetadata())||void 0===t||t.then((t=>{this.customerMetadata=t})).catch((t=>{console.warn("Error in getCustomerMetadata: ",t),Ua("Error in getCustomerMetadata: ",t)})),ka(Pt)&&(this.isPasswordValid=ka(Pt)),_a(Dt,!0)&&_a(Vt,!0)&&_a(Ft,!0)&&_a($t,!0)&&_a(jt,!0)?(this.guestMode="true"===_a(Dt,!0),this.allowGuestModeSignIn="true"===_a(Vt,!0),this.passwordProtected="true"===_a(Ft,!0),this.queryParamsComments="true"===_a($t,!0),this.usePageTitleAsLocationName="true"===_a(jt,!0)):(this.projectConfig=await(async(t,e)=>{var i;try{const o=xo($a,de,{timeout:12e5}),n=await o({apiKey:t,projectId:e});return null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data}catch(t){return console.warn("Error in getProjectConfig: ",t),null}})(this.apiKey,this.projectId),this.guestMode=!!(null===(e=this.projectConfig)||void 0===e?void 0:e.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(o=null===(i=this.projectConfig)||void 0===i?void 0:i.guestModeConfig)||void 0===o?void 0:o.allowSignIn),this.queryParamsComments=!!(null===(n=this.projectConfig)||void 0===n?void 0:n.queryParamsComments),this.usePageTitleAsLocationName=!!(null===(r=this.projectConfig)||void 0===r?void 0:r.usePageTitleAsLocationName),(null===(s=this.projectConfig)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=this.projectConfig)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),Ma(Dt,this.guestMode+"",!0),Ma(Vt,this.allowGuestModeSignIn+"",!0),Ma(Ft,this.passwordProtected+"",!0),Ma($t,this.queryParamsComments+"",!0),Ma(jt,this.usePageTitleAsLocationName+"",!0)),this.loadPlugin=!0,!document.querySelector(Kt.VELT_COMMENTS)){const t=document.createElement(Kt.VELT_COMMENTS);null==t||t.addEventListener("onSignIn",(()=>{this.loginWithGoogle()})),null==t||t.addEventListener("onUpgrade",(()=>{this.onUpgradePlanClick()})),t.addEventListener("onCommentAdd",(()=>{this.addCommentCount++})),t.addEventListener("onCommentUpdate",(t=>{var e,i;(null===(e=this.snippylyUser)||void 0===e?void 0:e.isGuest)&&"newlyAdded"===(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.type)&&(this.addCommentCount>=2&&(this.showModalOnceCommentIsModeIsOff=!0),this.addCommentCount>=5&&!this.showModalOnceCommentIsModeIsOff&&(this.showModalOnceCommentIsModeIsOff=!0))})),window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_CURSOR)){const t=document.createElement(Kt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_HUDDLE)){const t=document.createElement(Kt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_RECORDER_NOTES)){const t=document.createElement(Kt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Kt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_ARROWS)){const t=document.createElement(Kt.VELT_ARROWS);window.document.body.appendChild(t)}try{const t=new URL(document.location),e=t.searchParams;let i=!1;e.has("wireframe")&&"true"===e.get("wireframe")&&(sessionStorage.setItem("velt-wireframe","true"),e.delete("wireframe"),i=!0),e.get("velt-version")&&(sessionStorage.setItem("velt-version",e.get("velt-version")),e.delete("velt-version"),i=!0),e.get("velt-env")&&(sessionStorage.setItem("velt-env",e.get("velt-env")),e.delete("velt-env"),i=!0),i&&window.history.replaceState({},document.title,t.href)}catch(t){}if(this.staging&&"true"===sessionStorage.getItem("velt-wireframe")){const t=document.createElement("velt-wireframe");t.innerHTML='\n <style>\n .dialog-header-container {\n padding: 12px;\n background: lightcyan;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .dialog-all-comment-container app-comment-dialog-all-comment > div {\n padding: 12px;\n background: lightpink;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-container {\n padding: 12px;\n background: lightgreen;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-block {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n </style>\n\t\t\t\t\t\t<velt-comment-pin-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-pin-container">\n\t\t\t\t\t\t\t\t\t<div style="width: 35px; height: 35px; background-color: blue; border-radius: 12px; border-width: 3px; border-style: solid; border-color: #f00;"></div>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div class="custom-indicator"></div>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>P</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>G</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-index-wireframe></velt-comment-pin-index-wireframe>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-pin-wireframe>\n\n\t\t\t\t\t\t<velt-comment-bubble-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-bubble">\n\t\t\t\t\t\t\t\t<velt-comment-bubble-avatar-wireframe></velt-comment-bubble-avatar-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-bubble-comments-count-wireframe></velt-comment-bubble-comments-count-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-bubble-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-tool-wireframe>\n\t\t\t\t\t\t\t<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t\t\t\t<circle cx="50" cy="50" r="40" fill="red" />\n\t\t\t\t\t\t\t\t<rect x="5" y="5" width="90" height="90" fill="blue" fill-opacity="0.5" />\n\t\t\t\t\t\t\t\t<polygon points="50,5 95,95 5,95" fill="yellow" fill-opacity="0.7" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</velt-text-comment-tool-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:violet; display: flex; gap: 8px; border-radius: 12px; padding: 8px; align-items: center;">\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-generic-wireframe><p>GPT</p></velt-text-comment-toolbar-generic-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-seperator-wireframe><p>Seperator</p></velt-text-comment-toolbar-seperator-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-comment-annotation-wireframe><p>Comment</p></velt-text-comment-toolbar-comment-annotation-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-copywriter-wireframe><p>Copywriter</p></velt-text-comment-toolbar-copywriter-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t<velt-comment-sidebar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:lightblue; width: 100%; height: 100%;">\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Header</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Close Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-search-wireframe></velt-comment-sidebar-search-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-status-wireframe></velt-comment-sidebar-status-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Filter Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Filter</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-title-wireframe></velt-comment-sidebar-filter-title-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom CLose filter</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-close-button-wireframe>\n\n\t\t\t\t\t\t\t\t\t<div style="background-color: yellow">\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-location-wireframe></velt-comment-sidebar-filter-location-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-people-wireframe></velt-comment-sidebar-filter-people-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-category-wireframe></velt-comment-sidebar-filter-category-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-priority-wireframe></velt-comment-sidebar-filter-priority-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-comment-type-wireframe></velt-comment-sidebar-filter-comment-type-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-versions-wireframe></velt-comment-sidebar-filter-versions-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-group-by-wireframe></velt-comment-sidebar-filter-group-by-wireframe>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom Done Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-list-wireframe></velt-comment-sidebar-list-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Empty Placeholder</div>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-page-mode-wireframe></velt-comment-sidebar-page-mode-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-sidebar-wireframe>\n <velt-comment-dialog-wireframe variant="dialog">\n <div class="dialog-all-comment-container">\n <velt-comment-dialog-all-comment-wireframe></velt-comment-dialog-all-comment-wireframe>\n </div>\n <div class="dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n <div class="dialog-header-container">\n <velt-comment-dialog-header-wireframe></velt-comment-dialog-header-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n <velt-comment-dialog-wireframe variant="sidebar">\n <div class="sidebar-dialog-header-container">\n <velt-comment-dialog-header-wireframe>\n <div class="sidebar-dialog-header-block">\n <velt-comment-dialog-comment-count-wireframe></velt-comment-dialog-comment-count-wireframe>\n <velt-comment-dialog-status-wireframe></velt-comment-dialog-status-wireframe>\n <div style="flex-grow: 1"></div>\n <velt-comment-dialog-comment-category-wireframe></velt-comment-dialog-comment-category-wireframe>\n <velt-comment-dialog-priority-wireframe></velt-comment-dialog-priority-wireframe>\n </div>\n </velt-comment-dialog-header-wireframe>\n </div>\n <div class="sidebar-dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="sidebar-dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n ',window.document.body.appendChild(t)}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),Ua("Error in loadPluginUI: ",t)}},this.listenToDocumentTitleChange=()=>{try{this.documentTitleChangeInterval||(this.documentTitleChangeInterval=setInterval((()=>{var t,e,i;const o="true"===sessionStorage.getItem("debugDocumentTitleChange");if(o&&(console.log("*** listenToDocumentTitleChange ***"),console.log("usePageTitleAsLocationName: ",this.usePageTitleAsLocationName)),this.usePageTitleAsLocationName){const n=document.title;o&&(console.log("location name: ",null===(t=this.location)||void 0===t?void 0:t.locationName),console.log("title: ",n),console.log("changed: ",(null===(e=this.location)||void 0===e?void 0:e.locationName)!==n)),(null===(i=this.location)||void 0===i?void 0:i.locationName)!==n&&(o&&console.log("%c triggering location update!","color: green; font-weight: bold;"),this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),2e3))}catch(t){Ua("Error in listenToDocumentTitleChange: ",t)}},this.initializeSnippyly=async()=>{var t,e,o,n,r,s,a,l,c,d,h,u,p,v,m,g,f,w,y,b,C,x,E;try{let S=this.staging?vt:mt;this.staging||gt.includes(this.apiKey)||(S="latest"),this.veltVersion&&(S=this.veltVersion);let k=this.staging,M=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(S=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(k=!1,M=!0)}if(console.log("Velt SDK version:",S),await i(this.apiKey,{options:{develop:k,staging:M,version:S,velt:!0,proxyDomain:"https://cdn.velt.dev"}}),!window.Snippyly)return;if(this.autoTranslation&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.enableAutoTranslation)&&(null===Snippyly||void 0===Snippyly||Snippyly.enableAutoTranslation()),!document.querySelector(Kt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(Kt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Jt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Jt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Snippyly){null===Snippyly||void 0===Snippyly||Snippyly.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt:Snippyly}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Snippyly))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),(()=>{try{if(!document.getElementById("superflowFontLink3")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/fonts%2Fpoppins%2Fpoppins.css?alt=media&token=5f31a0f2-5f67-4974-bf56-78ae655f2b68",t.id="superflowFontLink3",document.head.appendChild(t)}}catch(t){console.warn("Error in loadPoppinsFont: ",t),Ua("Error in loadPoppinsFont: ",t)}})()}if(Snippyly&&Ra({sdkVersion:null===Snippyly||void 0===Snippyly?void 0:Snippyly.version,sdkType:"client"}),this.generateDocumentId(),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.on)&&"function"==typeof(null===Snippyly||void 0===Snippyly?void 0:Snippyly.on)?Snippyly.on("userUpdate").subscribe((async t=>{t&&await this.setDocumentAndLocation()})):await this.setDocumentAndLocation(),setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3),this.commentElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),this.contactElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getContactElement(),this.rewriterElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getRewriterElement(),this.presenceElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getPresenceElement(),this.commentElement){this.commentElement.enableTextComments(!0),this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(t=this.commentElement)||void 0===t?void 0:t.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(e=this.commentElement)||void 0===e?void 0:e.enableDeviceInfo)&&this.commentElement.enableDeviceInfo(!0),this.commentElement.enableCommentIndex(!0),this.commentElement.onCommentModeChange&&this.commentElement.onCommentModeChange().subscribe((t=>{this.addCommentMode=t,this.addCommentMode||this.showModalOnceCommentIsModeIsOff&&(this.addCommentCount>=2&&!_a(Ut)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),Ma(Ut,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!_a(Bt,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),Ma(Bt,"true",!1,"sessionStorage"),this.showModalOnceCommentIsModeIsOff=!1))})),(null===(o=this.commentElement)||void 0===o?void 0:o.enableOrphanComments)&&this.commentElement.enableOrphanComments(),(null===(n=this.commentElement)||void 0===n?void 0:n.enableAutoCategorize)&&this.commentElement.enableAutoCategorize(),(null===(r=this.commentElement)||void 0===r?void 0:r.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),(null===(s=this.commentElement)||void 0===s?void 0:s.enableGhostComments)&&this.commentElement.enableGhostComments();const i=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;i&&"object"==typeof i&&(null===(a=this.commentElement)||void 0===a?void 0:a.setCustomStatus)&&this.commentElement.setCustomStatus(i),(null===(l=this.commentElement)||void 0===l?void 0:l.enableMinimap)&&this.commentElement.enableMinimap(),(null===(c=this.commentElement)||void 0===c?void 0:c.setDStrategy)&&(null===(d=this.commentElement)||void 0===d||d.setDStrategy("dynamicId")),(null===(h=this.commentElement)||void 0===h?void 0:h.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableHotkey)&&this.commentElement.enableHotkey(),(null===(p=this.commentElement)||void 0===p?void 0:p.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins()}this.selectionElement=Snippyly.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(v=this.rewriterElement)||void 0===v||v.enableRewriter()),this.presenceElement&&(null===(m=this.presenceElement)||void 0===m?void 0:m.enableFlockMode)&&(null===(g=this.presenceElement)||void 0===g||g.enableFlockMode(!0)),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocElement)&&(this.docElement=Snippyly.getDocElement()),null===(b=(null===(f=this.docElement)||void 0===f?void 0:f.getDocumentMetadata)?null===(w=this.docElement)||void 0===w?void 0:w.getDocumentMetadata():null===(y=null===Snippyly||void 0===Snippyly?void 0:Snippyly.docService)||void 0===y?void 0:y.getDocumentMetadata$())||void 0===b||b.subscribe((t=>{const e=(null==t?void 0:t.versions)?Object.values(null==t?void 0:t.versions):[],i=new URL(document.location).searchParams.get("version");if(i){const t=e.find((t=>t.versionId===i));t&&(this.version={id:t.versionId,name:t.versionName||t.versionId},this.setLocation())}})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getViewsElement)&&(this.viewsElement=Snippyly.getViewsElement()),(null===(C=this.viewsElement)||void 0===C?void 0:C.getUniqueViewsByUser)&&(null===(E=null===(x=this.viewsElement)||void 0===x?void 0:x.getUniqueViewsByUser())||void 0===E||E.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),Ua("Error in initializeSnippyly: ",t)}},this.generateDocumentId=()=>{try{this.documentId=xa(Sa(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),this.serverDocumentId=(t=this.documentId+"")?`${xa(t)}`:void 0}catch(t){console.warn("Error in generateDocumentId: ",t),Ua("Error in generateDocumentId: ",t)}var t},this.setDocumentAndLocation=async()=>{try{this.generateDocumentId(),this.previousLocation=null,await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setDocumentId(this.documentId+"")),Ra({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation()}catch(t){console.warn("Error in setDocumentAndLocation: ",t),Ua("Error in setDocumentAndLocation: ",t)}},this.checkToEnableUpgradeButton=()=>{var t,e;try{this.isPlanExpired&&this.isUserGlobalContact?(null===(t=this.commentElement)||void 0===t?void 0:t.enableUpgradeButton)&&this.commentElement.enableUpgradeButton():(null===(e=this.commentElement)||void 0===e?void 0:e.disableUpgradeButton)&&this.commentElement.disableUpgradeButton()}catch(t){console.warn("Error in checkToEnableUpgradeButton: ",t),Ua("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{let t=(()=>{try{const t=_a(Ht);return t?"false"===t?JSON.parse(JSON.stringify(Yt)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),Ua("Error in getCustomerMetadataFromStorage: ",t),null}})();return t||(t=await(async t=>{try{const e=xo($a,se,{timeout:12e5}),i=await e({apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey),Fa(t)),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),Ua("Error in getCustomerMetadata: ",t)}},this.getSamlConfig=async()=>{try{let t=(()=>{try{const t=_a(Gt,!0);return t?JSON.parse(t):null}catch(t){return console.warn("Error in getSamlConfigFromStorage: ",t),Ua("Error in getSamlConfigFromStorage: ",t),null}})();return t||(t=await(async t=>{var e;try{const i=xo($a,pe,{timeout:12e5}),o=await i({eventType:"getPublicConfig",apiKey:t});return null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.publicConfig}catch(t){return console.warn("Error in getSamlPublicConfig: ",t),null}})(this.apiKey),t&&(t=>{try{if(t){const e=JSON.stringify(t);Ma(Gt,e,!0)}}catch(t){console.warn("Error in setSamlConfigToStorage: ",t),Ua("Error in setSamlConfigToStorage: ",t)}})(t)),t}catch(t){console.warn("Error in getSamlConfig: ",t),Ua("Error in getSamlConfig: ",t)}},this.setLogos=()=>{var t,e,i,o,n,r,s,a,l,c,d,h;try{let u="light";this.privateCommentModeEnabled&&(u="dark");const p=null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.customBranding)||void 0===e?void 0:e.logo)||void 0===i?void 0:i.logoMark,v=null===(r=null===(n=null===(o=null==Qt?void 0:Yt)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===r?void 0:r.logoMark,m=null===(l=null===(a=null===(s=this.customerMetadata)||void 0===s?void 0:s.customBranding)||void 0===a?void 0:a.logo)||void 0===l?void 0:l.wordMark,g=null===(h=null===(d=null===(c=null==Qt?void 0:Yt)||void 0===c?void 0:c.customBranding)||void 0===d?void 0:d.logo)||void 0===h?void 0:h.wordMark;switch(u){case"light":this.logoMark=(null==p?void 0:p.lightUrl)||(null==p?void 0:p.darkUrl)||(null==v?void 0:v.lightUrl),this.wordMark=(null==m?void 0:m.lightUrl)||(null==m?void 0:m.darkUrl)||(null==g?void 0:g.lightUrl);break;case"dark":this.logoMark=(null==p?void 0:p.darkUrl)||(null==p?void 0:p.lightUrl)||(null==v?void 0:v.darkUrl),this.wordMark=(null==m?void 0:m.darkUrl)||(null==m?void 0:m.lightUrl)||(null==g?void 0:g.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),Ua("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?D`
2649
+ `;var Ja=function(t,e,i,o){for(var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class Ya extends X{constructor(){super(),this._loadPlugin=!1,this.comments=[],this.addCommentMode=!1,this.showTourCommentTooltip=!1,this.allFeatureDisabled=!1,this.allFeatureRestricted=!1,this.guestMode=!1,this._expanded=!0,this.loading=!0,this._isPlanExpired=null,this.showOnboardingModal=!0,this.showLiveDemoModal=!1,this.showFigmaDemoModal=!1,this.showGuestModeSignInModal=!1,this.defaultGuestModeSignInModalConfig={title:"Sign in to notify your team",description:"Notify your team about your latest comments.",closeOnClickOutside:!1,showLeaveCommentButton:!0},this.guestModeSignInModalConfig=JSON.parse(JSON.stringify(this.defaultGuestModeSignInModalConfig)),this.showGuestModeNameModal=!1,this.guestModeSignInBannerVisible=!1,this.guestUserNameInput="",this.guestUserModelOpened=!1,this.guestUserNameUpdated=!1,this.guestUserNameUpdateLoading=!1,this.staging=Xt,this._autoLocation=!0,this.copyLinkTooltip="Copy Link",this.invalidApiKey=!1,this._isUserGlobalContact=!1,this.showQrCode=!1,this.customLoginEnabledLocally=null,this.customLoginEnabled=null,this.exitReviewModeCalled=!1,this.addCommentCount=0,this._privateCommentModeEnabled=!1,this.superflowToolbarMoved=!1,this._darkMode=!1,this.allowGuestModeSignIn=!0,this._queryParamsComments=!1,this._usePageTitleAsLocationName=!1,this.toolbarEnabled=!1,this.toolbarEnabledApiCalled=!1,this.passwordProtected=!1,this.isPasswordValid=!1,this.password="",this.validatingPasswordLoading=!1,this.showPasswordProtectedModal=!1,this.showInvalidPassword=!1,this.skipGuestNameModal=!1,this._totalViews={},this.totalViewsCount=0,this.inviteUrl="",this.showModalOnceCommentIsModeIsOff=!1,this.subscriptions=[],this.onApiKeyChange=()=>{try{this.apiKey&&(null===window||void 0===window?void 0:window.onSuperflowLoad)&&"function"==typeof window.onSuperflowLoad&&window.onSuperflowLoad()}catch(t){console.warn("Error in onApiKeyChange: ",t),Ua("Error in onApiKeyChange: ",t)}},this.checkCustomLoginEnabled=async()=>{var t;try{const e=await(t=>{const e={apiKey:t};return xo($a,ce,{timeout:12e5})(e)})(this.apiKey);this.customLoginEnabled=!!(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.customLoginEnabled),this.customLoginEnabled&&this.loginWithCustomUser()}catch(t){this.customLoginEnabled=!1,console.warn("Error in checkCustomLoginEnabled: ",t),Ua("Error in checkCustomLoginEnabled: ",t)}},this.loginWithCustomUser=()=>{try{this.customLoginEnabled?(Ta(St),this.loadPlugin&&this.documentId&&this.identifySnippyly()):console.warn("Identify call not allowed.")}catch(t){console.warn("Error in loginWithCustomUser: ",t),Ua("Error in loginWithCustomUser: ",t)}},this.addWindowClickEventListener=()=>{try{this.windowClickEventListener||(this.windowClickEventListener=()=>{this.menuOpenedId&&(this.menuOpenedId=void 0)},window.addEventListener("click",this.windowClickEventListener))}catch(t){console.warn("Error in addWindowClickEventListener: ",t),Ua("Error in addWindowClickEventListener: ",t)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t),Ua("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t),Ua("Error in setWindowEventListner: ",t)}},this.urlChangeListener=()=>{try{const t=history.pushState;history.pushState=function(){const e=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),e};const e=history.replaceState;history.replaceState=function(){const t=e.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),t},window.addEventListener("popstate",(()=>{window.dispatchEvent(new Event("locationchange"))}))}catch(t){console.warn("Error in urlChangeListener: ",t),Ua("Error in urlChangeListener: ",t)}},this.checkUrl=()=>{try{this.setInviteUrl();const t=new URL(document.location),e=t.searchParams;if(e.has(Ct)&&Ma(wt,"true",!1),(null==e?void 0:e.has(Nt))&&!_a(Nt)?this.showOnboardingModal=!0:this.showOnboardingModal=!1,null==e?void 0:e.has(It))if(_a(It,!1,"sessionStorage")){this.showLiveDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(It),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showLiveDemoModal=!0;else this.showLiveDemoModal=!1;if(null==e?void 0:e.has(At))if(_a(At,!1)){this.showFigmaDemoModal=!1;const t=new URL(document.location);t.searchParams.delete(At),window.history.replaceState({},null===document||void 0===document?void 0:document.title,t.toString())}else this.showFigmaDemoModal=!0;else this.showFigmaDemoModal=!1;if(e.has(Et)||e.has("snippyly_google_token")){if(e.has(Et)){const t=decodeURIComponent(e.get(Et)),i=Aa(t,ee,ie),o=i&&JSON.parse(i);if(o){const t={};t.userId=o.uid,t.name=o.displayName,t.email=o.email,t.photoUrl=null==o?void 0:o.photoURL;const e=JSON.stringify(t),i=Ia(e,ee,ie);Ma(St,i,!0),Ta(Lt)}}else if(e.has("snippyly_google_token")){const t=JSON.parse(atob(e.get("snippyly_google_token"))),i={};i.userId=t.uid,i.name=t.displayName,i.email=t.email,i.photoUrl=null==t?void 0:t.photoURL,Ma(xt,JSON.stringify(i),!0)}e.delete(Et),e.delete("snippyly_google_token"),window.history.replaceState({},document.title,t.href)}e.has(wt)?(Ma(wt,"true",!1),Ta(yt),e.delete(wt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(yt)||_a(wt,!1)&&this.loadPluginUI(),e.has(yt)?(Ma(yt,"true",!1),Ta(wt),e.delete(yt),window.history.replaceState({},document.title,t.href),this.loadPluginUI()):e.has(wt)||_a(yt,!1)&&this.loadPluginUI(),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",t),Ua("Error in checkUrl: ",t)}},this.setInviteUrl=()=>{try{const t=new URL(document.location);t.searchParams.has(wt)||t.searchParams.set(wt,"true"),this.inviteUrl=t.toString()}catch(t){console.warn("Error in setInviteUrl: ",t),Ua("Error in setInviteUrl: ",t)}},this.detectVersion=()=>{try{if(this.projectVersionKey){const t=new URL(document.location).searchParams;if(t.get(this.projectVersionKey))this.projectVersion=t.get(this.projectVersionKey);else if(window.snippylyInitialLoadUrl){const t=new URL(window.snippylyInitialLoadUrl).searchParams;t.get(this.projectVersionKey)&&(this.projectVersion=t.get(this.projectVersionKey))}this.projectVersion&&Ma(_t,this.projectVersion,!1,"sessionStorage")}else{const t=new URL(document.location).searchParams;(t.has(wt)||t.has(yt))&&t.has(Tt)&&(Ma(Mt,Tt,!1,"sessionStorage"),this.projectVersion=t.get(Tt),this.projectVersion&&Ma(_t,this.projectVersion,!1,"sessionStorage"))}}catch(t){console.warn("Error in detectVersion: ",t),Ua("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||_a(Mt,!1,"sessionStorage"),e=this.projectVersion||_a(_t,!1,"sessionStorage");if(t&&e){const i=new URL(document.location),o=i.searchParams;o.get(t)||(o.set(t,e),window.history.replaceState({},document.title,i.href))}}catch(t){console.warn("Error in setVersionInUrl: ",t),Ua("Error in setVersionInUrl: ",t)}},this.loadPluginUI=async()=>{var t,e,i,o,n,r,s,a,l;try{if(!this.apiKey)return;if(!this.projectId)return;if(this.loadPlugin)return this.generateLocation(),this.setLocation(),void setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3);if(this.toolbarEnabledApiCalled||await this.detectToolbarEnabled(),!this.toolbarEnabled)return;ft.includes(this.apiKey)&&this.listenToDocumentTitleChange();const c=Oa();if(c&&!(null==c?void 0:c.isAnonymous)&&(this.loading=!0),null===(t=this.getCustomerMetadata())||void 0===t||t.then((t=>{this.customerMetadata=t})).catch((t=>{console.warn("Error in getCustomerMetadata: ",t),Ua("Error in getCustomerMetadata: ",t)})),ka(Pt)&&(this.isPasswordValid=ka(Pt)),_a(Dt,!0)&&_a(Vt,!0)&&_a(Ft,!0)&&_a($t,!0)&&_a(jt,!0)?(this.guestMode="true"===_a(Dt,!0),this.allowGuestModeSignIn="true"===_a(Vt,!0),this.passwordProtected="true"===_a(Ft,!0),this.queryParamsComments="true"===_a($t,!0),this.usePageTitleAsLocationName="true"===_a(jt,!0)):(this.projectConfig=await(async(t,e)=>{var i;try{const o=xo($a,de,{timeout:12e5}),n=await o({apiKey:t,projectId:e});return null===(i=null==n?void 0:n.data)||void 0===i?void 0:i.data}catch(t){return console.warn("Error in getProjectConfig: ",t),null}})(this.apiKey,this.projectId),this.guestMode=!!(null===(e=this.projectConfig)||void 0===e?void 0:e.guestMode)||this.guestMode,this.allowGuestModeSignIn=!!(null===(o=null===(i=this.projectConfig)||void 0===i?void 0:i.guestModeConfig)||void 0===o?void 0:o.allowSignIn),this.queryParamsComments=!!(null===(n=this.projectConfig)||void 0===n?void 0:n.queryParamsComments),this.usePageTitleAsLocationName=!!(null===(r=this.projectConfig)||void 0===r?void 0:r.usePageTitleAsLocationName),(null===(s=this.projectConfig)||void 0===s?void 0:s.guestModeConfig)||(this.allowGuestModeSignIn=!0),this.passwordProtected=!!(null===(l=null===(a=this.projectConfig)||void 0===a?void 0:a.passwordProtected)||void 0===l?void 0:l.enabled),Ma(Dt,this.guestMode+"",!0),Ma(Vt,this.allowGuestModeSignIn+"",!0),Ma(Ft,this.passwordProtected+"",!0),Ma($t,this.queryParamsComments+"",!0),Ma(jt,this.usePageTitleAsLocationName+"",!0)),this.loadPlugin=!0,!document.querySelector(Kt.VELT_COMMENTS)){const t=document.createElement(Kt.VELT_COMMENTS);null==t||t.addEventListener("onSignIn",(()=>{this.loginWithGoogle()})),null==t||t.addEventListener("onUpgrade",(()=>{this.onUpgradePlanClick()})),t.addEventListener("onCommentAdd",(()=>{this.addCommentCount++})),t.addEventListener("onCommentUpdate",(t=>{var e,i;(null===(e=this.snippylyUser)||void 0===e?void 0:e.isGuest)&&"newlyAdded"===(null===(i=null==t?void 0:t.detail)||void 0===i?void 0:i.type)&&(this.addCommentCount>=2&&(this.showModalOnceCommentIsModeIsOff=!0),this.addCommentCount>=5&&!this.showModalOnceCommentIsModeIsOff&&(this.showModalOnceCommentIsModeIsOff=!0))})),window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_CURSOR)){const t=document.createElement(Kt.VELT_CURSOR);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_HUDDLE)){const t=document.createElement(Kt.VELT_HUDDLE);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_RECORDER_NOTES)){const t=document.createElement(Kt.VELT_RECORDER_NOTES);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_RECORDER_CONTROL_PANEL)){const t=document.createElement(Kt.VELT_RECORDER_CONTROL_PANEL);window.document.body.appendChild(t)}if(!document.querySelector(Kt.VELT_ARROWS)){const t=document.createElement(Kt.VELT_ARROWS);window.document.body.appendChild(t)}try{const t=new URL(document.location),e=t.searchParams;let i=!1;e.has("wireframe")&&"true"===e.get("wireframe")&&(sessionStorage.setItem("velt-wireframe","true"),e.delete("wireframe"),i=!0),e.get("velt-version")&&(sessionStorage.setItem("velt-version",e.get("velt-version")),e.delete("velt-version"),i=!0),e.get("velt-env")&&(sessionStorage.setItem("velt-env",e.get("velt-env")),e.delete("velt-env"),i=!0),i&&window.history.replaceState({},document.title,t.href)}catch(t){}if(this.staging&&"true"===sessionStorage.getItem("velt-wireframe")){const t=document.createElement("velt-wireframe");t.innerHTML='\n <style>\n .dialog-header-container {\n padding: 12px;\n background: lightcyan;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .dialog-all-comment-container app-comment-dialog-all-comment > div {\n padding: 12px;\n background: lightpink;\n margin-top: 8px;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-container {\n padding: 12px;\n background: lightgreen;\n margin-bottom: 8px;\n border-radius: 8px;\n }\n\n .sidebar-dialog-header-block {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n </style>\n\t\t\t\t\t\t<velt-comment-pin-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-pin-container">\n\t\t\t\t\t\t\t\t\t<div style="width: 35px; height: 35px; background-color: blue; border-radius: 12px; border-width: 3px; border-style: solid; border-color: #f00;"></div>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div class="custom-indicator"></div>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-unread-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>P</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-private-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t\t<span>G</span>\n\t\t\t\t\t\t\t\t\t</velt-comment-pin-ghost-comment-indicator-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-pin-index-wireframe></velt-comment-pin-index-wireframe>\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-pin-wireframe>\n\n\t\t\t\t\t\t<velt-comment-bubble-wireframe>\n\t\t\t\t\t\t\t<div class="custom-comment-bubble">\n\t\t\t\t\t\t\t\t<velt-comment-bubble-avatar-wireframe></velt-comment-bubble-avatar-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-bubble-comments-count-wireframe></velt-comment-bubble-comments-count-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-bubble-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-tool-wireframe>\n\t\t\t\t\t\t\t<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t\t\t\t<circle cx="50" cy="50" r="40" fill="red" />\n\t\t\t\t\t\t\t\t<rect x="5" y="5" width="90" height="90" fill="blue" fill-opacity="0.5" />\n\t\t\t\t\t\t\t\t<polygon points="50,5 95,95 5,95" fill="yellow" fill-opacity="0.7" />\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</velt-text-comment-tool-wireframe>\n\n\t\t\t\t\t\t<velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:violet; display: flex; gap: 8px; border-radius: 12px; padding: 8px; align-items: center;">\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-generic-wireframe><p>GPT</p></velt-text-comment-toolbar-generic-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-seperator-wireframe><p>Seperator</p></velt-text-comment-toolbar-seperator-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-comment-annotation-wireframe><p>Comment</p></velt-text-comment-toolbar-comment-annotation-wireframe>\n\t\t\t\t\t\t\t\t<velt-text-comment-toolbar-copywriter-wireframe><p>Copywriter</p></velt-text-comment-toolbar-copywriter-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-text-comment-toolbar-wireframe>\n\t\t\t\t\t\t<velt-comment-sidebar-wireframe>\n\t\t\t\t\t\t\t<div style="background-color:lightblue; width: 100%; height: 100%;">\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Header</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Close Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-search-wireframe></velt-comment-sidebar-search-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-status-wireframe></velt-comment-sidebar-status-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div style="color:#0d6efd;">Custom Filter Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-header-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Custom Filter</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-title-wireframe></velt-comment-sidebar-filter-title-wireframe>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-close-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom CLose filter</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-close-button-wireframe>\n\n\t\t\t\t\t\t\t\t\t<div style="background-color: yellow">\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-location-wireframe></velt-comment-sidebar-filter-location-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-people-wireframe></velt-comment-sidebar-filter-people-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-category-wireframe></velt-comment-sidebar-filter-category-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-priority-wireframe></velt-comment-sidebar-filter-priority-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-comment-type-wireframe></velt-comment-sidebar-filter-comment-type-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-versions-wireframe></velt-comment-sidebar-filter-versions-wireframe>\n\t\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-group-by-wireframe></velt-comment-sidebar-filter-group-by-wireframe>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t\t\t<div>Custom Done Button</div>\n\t\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-done-button-wireframe>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-filter-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-list-wireframe></velt-comment-sidebar-list-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t\t<div>Empty Placeholder</div>\n\t\t\t\t\t\t\t\t</velt-comment-sidebar-empty-placeholder-wireframe>\n\t\t\t\t\t\t\t\t<velt-comment-sidebar-page-mode-wireframe></velt-comment-sidebar-page-mode-wireframe>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</velt-comment-sidebar-wireframe>\n <velt-comment-dialog-wireframe variant="dialog">\n <div class="dialog-all-comment-container">\n <velt-comment-dialog-all-comment-wireframe></velt-comment-dialog-all-comment-wireframe>\n </div>\n <div class="dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n <div class="dialog-header-container">\n <velt-comment-dialog-header-wireframe></velt-comment-dialog-header-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n <velt-comment-dialog-wireframe variant="sidebar">\n <div class="sidebar-dialog-header-container">\n <velt-comment-dialog-header-wireframe>\n <div class="sidebar-dialog-header-block">\n <velt-comment-dialog-comment-count-wireframe></velt-comment-dialog-comment-count-wireframe>\n <velt-comment-dialog-status-wireframe></velt-comment-dialog-status-wireframe>\n <div style="flex-grow: 1"></div>\n <velt-comment-dialog-comment-category-wireframe></velt-comment-dialog-comment-category-wireframe>\n <velt-comment-dialog-priority-wireframe></velt-comment-dialog-priority-wireframe>\n </div>\n </velt-comment-dialog-header-wireframe>\n </div>\n <div class="sidebar-dialog-body-container">\n <velt-comment-dialog-body-wireframe></velt-comment-dialog-body-wireframe>\n </div>\n <div class="sidebar-dialog-composer-container">\n <velt-comment-dialog-composer-wireframe></velt-comment-dialog-composer-wireframe>\n </div>\n </velt-comment-dialog-wireframe>\n ',window.document.body.appendChild(t)}this.initializeSnippyly()}catch(t){this.loading=!1,console.warn("Error in loadPluginUI: ",t),Ua("Error in loadPluginUI: ",t)}},this.listenToDocumentTitleChange=()=>{try{this.documentTitleChangeInterval||(this.documentTitleChangeInterval=setInterval((()=>{var t,e,i;const o="true"===sessionStorage.getItem("debugDocumentTitleChange");if(o&&(console.log("*** listenToDocumentTitleChange ***"),console.log("usePageTitleAsLocationName: ",this.usePageTitleAsLocationName)),this.usePageTitleAsLocationName){const n=document.title;o&&(console.log("location name: ",null===(t=this.location)||void 0===t?void 0:t.locationName),console.log("title: ",n),console.log("changed: ",(null===(e=this.location)||void 0===e?void 0:e.locationName)!==n)),(null===(i=this.location)||void 0===i?void 0:i.locationName)!==n&&(o&&console.log("%c triggering location update!","color: green; font-weight: bold;"),this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),2e3))}catch(t){Ua("Error in listenToDocumentTitleChange: ",t)}},this.initializeSnippyly=async()=>{var t,e,o,n,r,s,a,l,c,d,h,u,p,v,m,g,f,w,y,b,C,x;try{let E=this.staging?vt:mt;this.staging||gt.includes(this.apiKey)||(E="latest"),this.veltVersion&&(E=this.veltVersion);let S=this.staging,k=!1;if((null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-version"))&&(E=sessionStorage.getItem("velt-version")),null===sessionStorage||void 0===sessionStorage?void 0:sessionStorage.getItem("velt-env")){"staging"===sessionStorage.getItem("velt-env")&&(S=!1,k=!0)}if(console.log("Velt SDK version:",E),await i(this.apiKey,{options:{develop:S,staging:k,version:E,velt:!0,proxyDomain:"https://cdn.velt.dev"}}),!window.Snippyly)return;if(this.autoTranslation&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.enableAutoTranslation)&&(null===Snippyly||void 0===Snippyly||Snippyly.enableAutoTranslation()),!document.querySelector(Kt.VELT_COMMENTS_SIDEBAR)){const t=document.createElement(Kt.VELT_COMMENTS_SIDEBAR);t.setAttribute(Jt.ENABLE_URL_NAVIGATION,"true"),t.setAttribute(Jt.CURRENT_LOCATION_SUFFIX,"true"),window.document.body.appendChild(t)}if(Snippyly){null===Snippyly||void 0===Snippyly||Snippyly.sf(!0);try{window.dispatchEvent(new CustomEvent("onVeltLoad",{detail:{Velt:Snippyly}})),(null===window||void 0===window?void 0:window.onSnippylyLoad)&&(null===window||void 0===window||window.onSnippylyLoad(Snippyly))}catch(t){}document.body.style.setProperty("--velt-default-font-family","'Poppins', sans-serif"),(()=>{try{if(!document.getElementById("superflowFontLink3")){const t=document.createElement("link");t.rel="stylesheet",t.href="https://firebasestorage.googleapis.com/v0/b/snippyly-sdk-external/o/fonts%2Fpoppins%2Fpoppins.css?alt=media&token=5f31a0f2-5f67-4974-bf56-78ae655f2b68",t.id="superflowFontLink3",document.head.appendChild(t)}}catch(t){console.warn("Error in loadPoppinsFont: ",t),Ua("Error in loadPoppinsFont: ",t)}})()}if(Snippyly&&Ra({sdkVersion:null===Snippyly||void 0===Snippyly?void 0:Snippyly.version,sdkType:"client"}),this.generateDocumentId(),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.on)&&"function"==typeof(null===Snippyly||void 0===Snippyly?void 0:Snippyly.on)?Snippyly.on("userUpdate").subscribe((async t=>{t&&await this.setDocumentAndLocation()})):await this.setDocumentAndLocation(),setTimeout((()=>{var t;if(this.usePageTitleAsLocationName){const e=document.title;(null===(t=this.location)||void 0===t?void 0:t.locationName)!==e&&(this.generateLocation(),this.setLocation({forceSetLocation:!0}))}}),4e3),this.commentElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),this.contactElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getContactElement(),this.rewriterElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getRewriterElement(),this.presenceElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getPresenceElement(),this.commentElement){this.commentElement.enableTextComments(!0),this.customLoginEnabledLocally||this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachments(!0),(null===(t=this.commentElement)||void 0===t?void 0:t.showScreenSizeInfo)&&this.commentElement.showScreenSizeInfo(!0),(null===(e=this.commentElement)||void 0===e?void 0:e.enableDeviceInfo)&&this.commentElement.enableDeviceInfo(!0),this.commentElement.enableCommentIndex(!0),this.commentElement.onCommentModeChange&&this.commentElement.onCommentModeChange().subscribe((t=>{this.addCommentMode=t,this.addCommentMode||this.showModalOnceCommentIsModeIsOff&&(this.addCommentCount>=2&&!_a(Ut)&&(this.allowGuestModeSignIn?this.openGuestModeSignInModal():this.openGuestModeNameModel(),Ma(Ut,"true"),this.showModalOnceCommentIsModeIsOff=!1),this.addCommentCount>=5&&!this.showGuestModeSignInModal&&!_a(Bt,!1,"sessionStorage")&&(this.showGuestModeSignInBanner(),Ma(Bt,"true",!1,"sessionStorage"),this.showModalOnceCommentIsModeIsOff=!1))})),(null===(o=this.commentElement)||void 0===o?void 0:o.enableOrphanComments)&&this.commentElement.enableOrphanComments(),(null===(n=this.commentElement)||void 0===n?void 0:n.enablePersistentCommentMode)&&this.commentElement.enablePersistentCommentMode(),(null===(r=this.commentElement)||void 0===r?void 0:r.enableGhostComments)&&this.commentElement.enableGhostComments();const i=null===window||void 0===window?void 0:window.SUPERFLOW_CUSTOM_STATUSES;i&&"object"==typeof i&&(null===(s=this.commentElement)||void 0===s?void 0:s.setCustomStatus)&&this.commentElement.setCustomStatus(i),(null===(a=this.commentElement)||void 0===a?void 0:a.enableMinimap)&&this.commentElement.enableMinimap(),(null===(l=this.commentElement)||void 0===l?void 0:l.setDStrategy)&&(null===(c=this.commentElement)||void 0===c||c.setDStrategy("dynamicId")),(null===(d=this.commentElement)||void 0===d?void 0:d.enableSidebarButtonOnCommentDialog)&&this.commentElement.enableSidebarButtonOnCommentDialog(),(null===(h=this.commentElement)||void 0===h?void 0:h.enableHotkey)&&this.commentElement.enableHotkey(),(null===(u=this.commentElement)||void 0===u?void 0:u.enableDeviceIndicatorOnCommentPins)&&this.commentElement.enableDeviceIndicatorOnCommentPins()}this.selectionElement=Snippyly.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.rewriterElement&&(null===(p=this.rewriterElement)||void 0===p||p.enableRewriter()),this.presenceElement&&(null===(v=this.presenceElement)||void 0===v?void 0:v.enableFlockMode)&&(null===(m=this.presenceElement)||void 0===m||m.enableFlockMode(!0)),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getDocElement)&&(this.docElement=Snippyly.getDocElement()),null===(y=(null===(g=this.docElement)||void 0===g?void 0:g.getDocumentMetadata)?null===(f=this.docElement)||void 0===f?void 0:f.getDocumentMetadata():null===(w=null===Snippyly||void 0===Snippyly?void 0:Snippyly.docService)||void 0===w?void 0:w.getDocumentMetadata$())||void 0===y||y.subscribe((t=>{const e=(null==t?void 0:t.versions)?Object.values(null==t?void 0:t.versions):[],i=new URL(document.location).searchParams.get("version");if(i){const t=e.find((t=>t.versionId===i));t&&(this.version={id:t.versionId,name:t.versionName||t.versionId},this.setLocation())}})),(null===Snippyly||void 0===Snippyly?void 0:Snippyly.getViewsElement)&&(this.viewsElement=Snippyly.getViewsElement()),(null===(b=this.viewsElement)||void 0===b?void 0:b.getUniqueViewsByUser)&&(null===(x=null===(C=this.viewsElement)||void 0===C?void 0:C.getUniqueViewsByUser())||void 0===x||x.subscribe((t=>{this.totalViews=t}))),this.identifySnippyly()}catch(t){this.loading=!1,console.warn("Error in initializeSnippyly: ",t),Ua("Error in initializeSnippyly: ",t)}},this.generateDocumentId=()=>{try{this.documentId=xa(Sa(window.location.origin))+"",this.projectId&&(this.documentId=this.projectId+""),this.serverDocumentId=(t=this.documentId+"")?`${xa(t)}`:void 0}catch(t){console.warn("Error in generateDocumentId: ",t),Ua("Error in generateDocumentId: ",t)}var t},this.setDocumentAndLocation=async()=>{try{this.generateDocumentId(),this.previousLocation=null,await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setDocumentId(this.documentId+"")),Ra({documentId:this.serverDocumentId,clientDocumentId:this.documentId}),this.generateLocation(),this.setLocation()}catch(t){console.warn("Error in setDocumentAndLocation: ",t),Ua("Error in setDocumentAndLocation: ",t)}},this.checkToEnableUpgradeButton=()=>{var t,e;try{this.isPlanExpired&&this.isUserGlobalContact?(null===(t=this.commentElement)||void 0===t?void 0:t.enableUpgradeButton)&&this.commentElement.enableUpgradeButton():(null===(e=this.commentElement)||void 0===e?void 0:e.disableUpgradeButton)&&this.commentElement.disableUpgradeButton()}catch(t){console.warn("Error in checkToEnableUpgradeButton: ",t),Ua("Error in checkToEnableUpgradeButton: ",t)}},this.getCustomerMetadata=async()=>{try{let t=(()=>{try{const t=_a(Ht);return t?"false"===t?JSON.parse(JSON.stringify(Yt)):JSON.parse(t):null}catch(t){return console.warn("Error in getCustomerMetadataFromStorage: ",t),Ua("Error in getCustomerMetadataFromStorage: ",t),null}})();return t||(t=await(async t=>{try{const e=xo($a,se,{timeout:12e5}),i=await e({apiKey:t});return null==i?void 0:i.data}catch(t){return console.warn("Error in getCustomerMetadata: ",t),null}})(this.apiKey),Fa(t)),t}catch(t){console.warn("Error in getCustomerMetadata: ",t),Ua("Error in getCustomerMetadata: ",t)}},this.getSamlConfig=async()=>{try{let t=(()=>{try{const t=_a(Gt,!0);return t?JSON.parse(t):null}catch(t){return console.warn("Error in getSamlConfigFromStorage: ",t),Ua("Error in getSamlConfigFromStorage: ",t),null}})();return t||(t=await(async t=>{var e;try{const i=xo($a,pe,{timeout:12e5}),o=await i({eventType:"getPublicConfig",apiKey:t});return null===(e=null==o?void 0:o.data)||void 0===e?void 0:e.publicConfig}catch(t){return console.warn("Error in getSamlPublicConfig: ",t),null}})(this.apiKey),t&&(t=>{try{if(t){const e=JSON.stringify(t);Ma(Gt,e,!0)}}catch(t){console.warn("Error in setSamlConfigToStorage: ",t),Ua("Error in setSamlConfigToStorage: ",t)}})(t)),t}catch(t){console.warn("Error in getSamlConfig: ",t),Ua("Error in getSamlConfig: ",t)}},this.setLogos=()=>{var t,e,i,o,n,r,s,a,l,c,d,h;try{let u="light";this.privateCommentModeEnabled&&(u="dark");const p=null===(i=null===(e=null===(t=this.customerMetadata)||void 0===t?void 0:t.customBranding)||void 0===e?void 0:e.logo)||void 0===i?void 0:i.logoMark,v=null===(r=null===(n=null===(o=null==Qt?void 0:Yt)||void 0===o?void 0:o.customBranding)||void 0===n?void 0:n.logo)||void 0===r?void 0:r.logoMark,m=null===(l=null===(a=null===(s=this.customerMetadata)||void 0===s?void 0:s.customBranding)||void 0===a?void 0:a.logo)||void 0===l?void 0:l.wordMark,g=null===(h=null===(d=null===(c=null==Qt?void 0:Yt)||void 0===c?void 0:c.customBranding)||void 0===d?void 0:d.logo)||void 0===h?void 0:h.wordMark;switch(u){case"light":this.logoMark=(null==p?void 0:p.lightUrl)||(null==p?void 0:p.darkUrl)||(null==v?void 0:v.lightUrl),this.wordMark=(null==m?void 0:m.lightUrl)||(null==m?void 0:m.darkUrl)||(null==g?void 0:g.lightUrl);break;case"dark":this.logoMark=(null==p?void 0:p.darkUrl)||(null==p?void 0:p.lightUrl)||(null==v?void 0:v.darkUrl),this.wordMark=(null==m?void 0:m.darkUrl)||(null==m?void 0:m.lightUrl)||(null==g?void 0:g.darkUrl)}}catch(t){console.warn("Error in setLogos: ",t),Ua("Error in setLogos: ",t)}},this.getLogoMark=()=>{var t;try{return(null===(t=this.logoMark)||void 0===t?void 0:t.includes("<svg"))?D`
2650
2650
  ${ht(this.logoMark)}
2651
2651
  `:D`
2652
2652
  <img src=${this.logoMark} />