@snippyly/plugin-staging 1.0.40 → 1.0.41
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 +1 -1
- package/snippyly.js +60 -7
package/package.json
CHANGED
package/snippyly.js
CHANGED
|
@@ -8,19 +8,19 @@ const t=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShad
|
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/;var r;const l=window.trustedTypes,a=l?l.emptyScript:"",d=window.reactiveElementPolyfillSupport,c={toAttribute(t,i){switch(i){case Boolean:t=t?a:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let o=t;switch(i){case Boolean:o=null!==t;break;case Number:o=null===t?null:Number(t);break;case Object:case Array:try{o=JSON.parse(t)}catch(t){o=null}}return o}},h=(t,i)=>i!==t&&(i==i||t==t),
|
|
11
|
+
*/;var r;const l=window.trustedTypes,a=l?l.emptyScript:"",d=window.reactiveElementPolyfillSupport,c={toAttribute(t,i){switch(i){case Boolean:t=t?a:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let o=t;switch(i){case Boolean:o=null!==t;break;case Number:o=null===t?null:Number(t);break;case Object:case Array:try{o=JSON.parse(t)}catch(t){o=null}}return o}},h=(t,i)=>i!==t&&(i==i||t==t),p={attribute:!0,type:String,converter:c,reflect:!1,hasChanged:h};class v extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var i;null!==(i=this.l)&&void 0!==i||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,o)=>{const s=this._$Eh(o,i);void 0!==s&&(this._$Eu.set(s,o),t.push(s))})),t}static createProperty(t,i=p){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const o="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,o,i);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,i,o){return{get(){return this[i]},set(s){const e=this[t];this[i]=s,this.requestUpdate(t,e,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||p}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const o of i)this.createProperty(o,t[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const o=new Set(t.flat(1/0).reverse());for(const t of o)i.unshift(n(t))}else void 0!==t&&i.push(n(t));return i}static _$Eh(t,i){const o=i.attribute;return!1===o?void 0:"string"==typeof o?o:"string"==typeof t?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Em(),this.requestUpdate(),null===(t=this.constructor.l)||void 0===t||t.forEach((t=>t(this)))}addController(t){var i,o;(null!==(i=this._$Eg)&&void 0!==i?i:this._$Eg=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(o=t.hostConnected)||void 0===o||o.call(t))}removeController(t){var i;null===(i=this._$Eg)||void 0===i||i.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Et.set(i,this[i]),delete this[i])}))}createRenderRoot(){var i;const o=null!==(i=this.shadowRoot)&&void 0!==i?i:this.attachShadow(this.constructor.shadowRootOptions);return((i,o)=>{t?i.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):o.forEach((t=>{const o=document.createElement("style"),s=window.litNonce;void 0!==s&&o.setAttribute("nonce",s),o.textContent=t.cssText,i.appendChild(o)}))})(o,this.constructor.elementStyles),o}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}))}attributeChangedCallback(t,i,o){this._$AK(t,o)}_$ES(t,i,o=p){var s,e;const n=this.constructor._$Eh(t,o);if(void 0!==n&&!0===o.reflect){const r=(null!==(e=null===(s=o.converter)||void 0===s?void 0:s.toAttribute)&&void 0!==e?e:c.toAttribute)(i,o.type);this._$Ei=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Ei=null}}_$AK(t,i){var o,s,e;const n=this.constructor,r=n._$Eu.get(t);if(void 0!==r&&this._$Ei!==r){const t=n.getPropertyOptions(r),l=t.converter,a=null!==(e=null!==(s=null===(o=l)||void 0===o?void 0:o.fromAttribute)&&void 0!==s?s:"function"==typeof l?l:null)&&void 0!==e?e:c.fromAttribute;this._$Ei=r,this[r]=a(i,t.type),this._$Ei=null}}requestUpdate(t,i,o){let s=!0;void 0!==t&&(((o=o||this.constructor.getPropertyOptions(t)).hasChanged||h)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===o.reflect&&this._$Ei!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,o))):s=!1),!this.isUpdatePending&&s&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach(((t,i)=>this[i]=t)),this._$Et=void 0);let i=!1;const o=this._$AL;try{i=this.shouldUpdate(o),i?(this.willUpdate(o),null===(t=this._$Eg)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(o)):this._$EU()}catch(t){throw i=!1,this._$EU(),t}i&&this._$AE(o)}willUpdate(t){}_$AE(t){var i;null===(i=this._$Eg)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$ES(i,this[i],t))),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}}
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2017 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
var u;
|
|
17
|
+
var u;v.finalized=!0,v.elementProperties=new Map,v.elementStyles=[],v.shadowRootOptions={mode:"open"},null==d||d({ReactiveElement:v}),(null!==(r=globalThis.reactiveElementVersions)&&void 0!==r?r:globalThis.reactiveElementVersions=[]).push("1.3.2");const y=globalThis.trustedTypes,g=y?y.createPolicy("lit-html",{createHTML:t=>t}):void 0,w=`lit$${(Math.random()+"").slice(9)}$`,C="?"+w,b=`<${C}>`,m=document,f=(t="")=>m.createComment(t),x=t=>null===t||"object"!=typeof t&&"function"!=typeof t,S=Array.isArray,F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,$=/-->/g,E=/>/g,L=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,M=/'/g,k=/"/g,_=/^(?:script|style|textarea|title)$/i,A=(t=>(i,...o)=>({_$litType$:t,strings:i,values:o}))(1),U=Symbol.for("lit-noChange"),Z=Symbol.for("lit-nothing"),j=new WeakMap,B=m.createTreeWalker(m,129,null,!1),V=(t,i)=>{const o=t.length-1,s=[];let e,n=2===i?"<svg>":"",r=F;for(let i=0;i<o;i++){const o=t[i];let l,a,d=-1,c=0;for(;c<o.length&&(r.lastIndex=c,a=r.exec(o),null!==a);)c=r.lastIndex,r===F?"!--"===a[1]?r=$:void 0!==a[1]?r=E:void 0!==a[2]?(_.test(a[2])&&(e=RegExp("</"+a[2],"g")),r=L):void 0!==a[3]&&(r=L):r===L?">"===a[0]?(r=null!=e?e:F,d=-1):void 0===a[1]?d=-2:(d=r.lastIndex-a[2].length,l=a[1],r=void 0===a[3]?L:'"'===a[3]?k:M):r===k||r===M?r=L:r===$||r===E?r=F:(r=L,e=void 0);const h=r===L&&t[i+1].startsWith("/>")?" ":"";n+=r===F?o+b:d>=0?(s.push(l),o.slice(0,d)+"$lit$"+o.slice(d)+w+h):o+w+(-2===d?(s.push(void 0),i):h)}const l=n+(t[o]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==g?g.createHTML(l):l,s]};class O{constructor({strings:t,_$litType$:i},o){let s;this.parts=[];let e=0,n=0;const r=t.length-1,l=this.parts,[a,d]=V(t,i);if(this.el=O.createElement(a,o),B.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(s=B.nextNode())&&l.length<r;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const i of s.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(w)){const o=d[n++];if(t.push(i),void 0!==o){const t=s.getAttribute(o.toLowerCase()+"$lit$").split(w),i=/([.?@])?(.*)/.exec(o);l.push({type:1,index:e,name:i[2],strings:t,ctor:"."===i[1]?N:"?"===i[1]?P:"@"===i[1]?H:D})}else l.push({type:6,index:e})}for(const i of t)s.removeAttribute(i)}if(_.test(s.tagName)){const t=s.textContent.split(w),i=t.length-1;if(i>0){s.textContent=y?y.emptyScript:"";for(let o=0;o<i;o++)s.append(t[o],f()),B.nextNode(),l.push({type:2,index:++e});s.append(t[i],f())}}}else if(8===s.nodeType)if(s.data===C)l.push({type:2,index:e});else{let t=-1;for(;-1!==(t=s.data.indexOf(w,t+1));)l.push({type:7,index:e}),t+=w.length-1}e++}}static createElement(t,i){const o=m.createElement("template");return o.innerHTML=t,o}}function I(t,i,o=t,s){var e,n,r,l;if(i===U)return i;let a=void 0!==s?null===(e=o._$Cl)||void 0===e?void 0:e[s]:o._$Cu;const d=x(i)?void 0:i._$litDirective$;return(null==a?void 0:a.constructor)!==d&&(null===(n=null==a?void 0:a._$AO)||void 0===n||n.call(a,!1),void 0===d?a=void 0:(a=new d(t),a._$AT(t,o,s)),void 0!==s?(null!==(r=(l=o)._$Cl)&&void 0!==r?r:l._$Cl=[])[s]=a:o._$Cu=a),void 0!==a&&(i=I(t,a._$AS(t,i.values),a,s)),i}class R{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:o},parts:s}=this._$AD,e=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:m).importNode(o,!0);B.currentNode=e;let n=B.nextNode(),r=0,l=0,a=s[0];for(;void 0!==a;){if(r===a.index){let i;2===a.type?i=new T(n,n.nextSibling,this,t):1===a.type?i=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(i=new K(n,this,t)),this.v.push(i),a=s[++l]}r!==(null==a?void 0:a.index)&&(n=B.nextNode(),r++)}return e}m(t){let i=0;for(const o of this.v)void 0!==o&&(void 0!==o.strings?(o._$AI(t,o,i),i+=o.strings.length-2):o._$AI(t[i])),i++}}class T{constructor(t,i,o,s){var e;this.type=2,this._$AH=Z,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=o,this.options=s,this._$Cg=null===(e=null==s?void 0:s.isConnected)||void 0===e||e}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=I(this,t,i),x(t)?t===Z||null==t||""===t?(this._$AH!==Z&&this._$AR(),this._$AH=Z):t!==this._$AH&&t!==U&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.k(t):(t=>{var i;return S(t)||"function"==typeof(null===(i=t)||void 0===i?void 0:i[Symbol.iterator])})(t)?this.S(t):this.$(t)}M(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==Z&&x(this._$AH)?this._$AA.nextSibling.data=t:this.k(m.createTextNode(t)),this._$AH=t}T(t){var i;const{values:o,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=O.createElement(s.h,this.options)),s);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===e)this._$AH.m(o);else{const t=new R(e,this),i=t.p(this.options);t.m(o),this.k(i),this._$AH=t}}_$AC(t){let i=j.get(t.strings);return void 0===i&&j.set(t.strings,i=new O(t)),i}S(t){S(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let o,s=0;for(const e of t)s===i.length?i.push(o=new T(this.M(f()),this.M(f()),this,this.options)):o=i[s],o._$AI(e),s++;s<i.length&&(this._$AR(o&&o._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){var o;for(null===(o=this._$AP)||void 0===o||o.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cg=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class D{constructor(t,i,o,s,e){this.type=1,this._$AH=Z,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=e,o.length>2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=Z}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,o,s){const e=this.strings;let n=!1;if(void 0===e)t=I(this,t,i,0),n=!x(t)||t!==this._$AH&&t!==U,n&&(this._$AH=t);else{const s=t;let r,l;for(t=e[0],r=0;r<e.length-1;r++)l=I(this,s[o+r],i,r),l===U&&(l=this._$AH[r]),n||(n=!x(l)||l!==this._$AH[r]),l===Z?t=Z:t!==Z&&(t+=(null!=l?l:"")+e[r+1]),this._$AH[r]=l}n&&!s&&this.C(t)}C(t){t===Z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class N extends D{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===Z?void 0:t}}const z=y?y.emptyScript:"";class P extends D{constructor(){super(...arguments),this.type=4}C(t){t&&t!==Z?this.element.setAttribute(this.name,z):this.element.removeAttribute(this.name)}}class H extends D{constructor(t,i,o,s,e){super(t,i,o,s,e),this.type=5}_$AI(t,i=this){var o;if((t=null!==(o=I(this,t,i,0))&&void 0!==o?o:Z)===U)return;const s=this._$AH,e=t===Z&&s!==Z||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==Z&&(s===Z||e);e&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,o;"function"==typeof this._$AH?this._$AH.call(null!==(o=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==o?o:this.element,t):this._$AH.handleEvent(t)}}class K{constructor(t,i,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){I(this,t)}}const J=window.litHtmlPolyfillSupport;
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
22
|
*/
|
|
23
|
-
var W,G;null==J||J(O,T),(null!==(u=globalThis.litHtmlVersions)&&void 0!==u?u:globalThis.litHtmlVersions=[]).push("2.2.6");class X extends
|
|
23
|
+
var W,G;null==J||J(O,T),(null!==(u=globalThis.litHtmlVersions)&&void 0!==u?u:globalThis.litHtmlVersions=[]).push("2.2.6");class X extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,i;const o=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=o.firstChild),o}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,i,o)=>{var s,e;const n=null!==(s=null==o?void 0:o.renderBefore)&&void 0!==s?s:i;let r=n._$litPart$;if(void 0===r){const t=null!==(e=null==o?void 0:o.renderBefore)&&void 0!==e?e:null;n._$litPart$=r=new T(i.insertBefore(f(),t),t,void 0,null!=o?o:{})}return r._$AI(t),r})(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return U}}X.finalized=!0,X._$litElement$=!0,null===(W=globalThis.litElementHydrateSupport)||void 0===W||W.call(globalThis,{LitElement:X});const q=globalThis.litElementPolyfillSupport;null==q||q({LitElement:X}),(null!==(G=globalThis.litElementVersions)&&void 0!==G?G:globalThis.litElementVersions=[]).push("3.2.0");
|
|
24
24
|
/**
|
|
25
25
|
* @license
|
|
26
26
|
* Copyright 2017 Google LLC
|
|
@@ -53,7 +53,7 @@ const ot=1;
|
|
|
53
53
|
* Copyright 2018 Google LLC
|
|
54
54
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
55
55
|
*/
|
|
56
|
-
const st=(t=>(...i)=>({_$litDirective$:t,values:i}))(class extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,o){this._$Ct=t,this._$AM=i,this._$Ci=o}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}{constructor(t){var i;if(super(t),t.type!==ot||"class"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((i=>t[i])).join(" ")+" "}update(t,[i]){var o,s;if(void 0===this.et){this.et=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!(null===(o=this.st)||void 0===o?void 0:o.has(t))&&this.et.add(t);return this.render(i)}const e=t.element.classList;this.et.forEach((t=>{t in i||(e.remove(t),this.et.delete(t))}));for(const t in i){const o=!!i[t];o===this.et.has(t)||(null===(s=this.st)||void 0===s?void 0:s.has(t))||(o?(e.add(t),this.et.add(t)):(e.remove(t),this.et.delete(t)))}return U}}),et="snippyly-cursor",nt="snippyly-comments",rt="snippyly-comments-sidebar",lt="snippyly-huddle",at="snippyly-recorder-notes",dt="enable-url-navigation",ct=(t,i,o=!1,s="localStorage")=>{try{const e=o?btoa(i):i;"localStorage"===s?localStorage.setItem(t,e):sessionStorage.setItem(t,e)}catch(t){console.warn("Error in setLocalStorage: ",t)}},ht=(t,i=!1,o="localStorage")=>{try{let s=null;return s="localStorage"===o?localStorage.getItem(t):sessionStorage.getItem(t),s&&i?atob(s):s}catch(t){return console.warn("Error in getLocalStorage: ",t),null}},
|
|
56
|
+
const st=(t=>(...i)=>({_$litDirective$:t,values:i}))(class extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,o){this._$Ct=t,this._$AM=i,this._$Ci=o}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}{constructor(t){var i;if(super(t),t.type!==ot||"class"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((i=>t[i])).join(" ")+" "}update(t,[i]){var o,s;if(void 0===this.et){this.et=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!(null===(o=this.st)||void 0===o?void 0:o.has(t))&&this.et.add(t);return this.render(i)}const e=t.element.classList;this.et.forEach((t=>{t in i||(e.remove(t),this.et.delete(t))}));for(const t in i){const o=!!i[t];o===this.et.has(t)||(null===(s=this.st)||void 0===s?void 0:s.has(t))||(o?(e.add(t),this.et.add(t)):(e.remove(t),this.et.delete(t)))}return U}}),et="snippyly-cursor",nt="snippyly-comments",rt="snippyly-comments-sidebar",lt="snippyly-huddle",at="snippyly-recorder-notes",dt="enable-url-navigation",ct=(t,i,o=!1,s="localStorage")=>{try{const e=o?btoa(i):i;"localStorage"===s?localStorage.setItem(t,e):sessionStorage.setItem(t,e)}catch(t){console.warn("Error in setLocalStorage: ",t)}},ht=(t,i=!1,o="localStorage")=>{try{let s=null;return s="localStorage"===o?localStorage.getItem(t):sessionStorage.getItem(t),s&&i?atob(s):s}catch(t){return console.warn("Error in getLocalStorage: ",t),null}},pt=(t,i="localStorage")=>{try{"localStorage"===i?localStorage.removeItem(t):sessionStorage.removeItem(t)}catch(t){console.warn("Error in removeLocalStorageData: ",t)}},vt=(...t)=>{if(t)switch(t.length){case 1:return e`calc(${t[0]}rem * var(--snippyly-base-rem-unit, 1))`;case 2:return e`calc(${t[0]}rem * var(--snippyly-base-rem-unit, 1)) calc(${t[1]}rem * var(--snippyly-base-rem-unit, 1))`;case 3:return e`calc(${t[0]}rem * var(--snippyly-base-rem-unit, 1)) calc(${t[1]}rem * var(--snippyly-base-rem-unit, 1))
|
|
57
57
|
calc(${t[2]}rem * var(--snippyly-base-rem-unit, 1))`;case 4:return e`calc(${t[0]}rem * var(--snippyly-base-rem-unit, 1)) calc(${t[1]}rem * var(--snippyly-base-rem-unit, 1))
|
|
58
58
|
calc(${t[2]}rem * var(--snippyly-base-rem-unit, 1)) calc(${t[3]}rem * var(--snippyly-base-rem-unit, 1))`}return e`0`},ut=e`
|
|
59
59
|
|
|
@@ -68,8 +68,8 @@ const st=(t=>(...i)=>({_$litDirective$:t,values:i}))(class extends class{constru
|
|
|
68
68
|
bottom: 0;
|
|
69
69
|
right: 0;
|
|
70
70
|
z-index: 99999999;
|
|
71
|
-
margin: ${
|
|
72
|
-
margin-bottom: ${
|
|
71
|
+
margin: ${vt(1.5)};
|
|
72
|
+
margin-bottom: ${vt(3)}; // Added to prevent overlap between plugin UI and webflow badge
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.wrap {
|
|
@@ -376,7 +376,60 @@ const st=(t=>(...i)=>({_$litDirective$:t,values:i}))(class extends class{constru
|
|
|
376
376
|
.d-none {
|
|
377
377
|
display: none;
|
|
378
378
|
}
|
|
379
|
-
`;var yt=function(t,i,o,s){for(var e,n=arguments.length,r=n<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,o):s,l=t.length-1;l>=0;l--)(e=t[l])&&(r=(n<3?e(r):n>3?e(i,o,r):e(i,o))||r);return n>3&&r&&Object.defineProperty(i,o,r),r};let gt=class extends X{constructor(){super(),this._loadPlugin=!1,this.comments=[],this.addCommentMode=!1,this._expanded=!0,this.staging=true,this.copyLinkTooltip="Copy Link",this.invalidApiKey=!1,this.isUserGlobalContact=!1,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)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t)}},this.urlChangeListener=()=>{try{const t=history.pushState;history.pushState=function(){const i=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),i};const i=history.replaceState;history.replaceState=function(){const t=i.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)}},this.checkUrl=()=>{var t;try{const i=new URL(document.location),o=i.searchParams;if(o.has("snippyly_google_token")){const s=JSON.parse(atob(o.get("snippyly_google_token"))),e={},n=(null===(t=s.providerData)||void 0===t?void 0:t.length)?s.providerData[0]:null;e.userId=s.uid,e.name=s.displayName||(null==n?void 0:n.displayName),e.email=s.email||(null==n?void 0:n.email),e.photoUrl=(null==s?void 0:s.photoURL)||(null==n?void 0:n.photoURL),e.contacts=window.SNIPPYLY_USER_CONTACTS||[],ct("snippyly-user",JSON.stringify(e),!0),o.delete("snippyly_google_token"),window.history.replaceState({},document.title,i.href)}o.has("review")?(ct("review","true",!1,"sessionStorage"),"true"!==o.get("review")&&(o.delete("review"),o.append("review","true"),window.history.replaceState({},document.title,i.href)),this.loadPluginUI()):ht("review",!1,"sessionStorage")&&(o.append("review","true"),window.history.replaceState({},document.title,i.href),this.loadPluginUI()),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",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&&ct("projectVersion",this.projectVersion,!1,"sessionStorage")}}catch(t){console.warn("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||ht("projectVersionKey",!1,"sessionStorage"),i=this.projectVersion||ht("projectVersion",!1,"sessionStorage");if(t&&i){const o=new URL(document.location),s=o.searchParams;s.get(t)||(s.set(t,i),window.history.replaceState({},document.title,o.href))}}catch(t){console.warn("Error in setVersionInUrl: ",t)}},this.loadPluginUI=()=>{try{if(this.loadPlugin)return this.generateLocation(),void this.setViewMode(this.viewMode);if(this.loadPlugin=!0,!document.querySelector(nt)){const t=document.createElement(nt);null==t||t.addEventListener("signIn",(()=>{this.loginWithGoogle()})),window.document.body.appendChild(t)}if(!document.querySelector(rt)){const t=document.createElement(rt);t.setAttribute(dt,"true"),window.document.body.appendChild(t)}if(!document.querySelector(et)){const t=document.createElement(et);window.document.body.appendChild(t)}if(!document.querySelector(lt)){const t=document.createElement(lt);window.document.body.appendChild(t)}if(!document.querySelector(at)){const t=document.createElement(at);window.document.body.appendChild(t)}((t="",i=!1,o)=>{if(console.log("load snippyly called"),document.getElementById("snippylyScript"))o&&o();else{const s=document.createElement("script");s.src=`https://cdn.jsdelivr.net/npm/@snippyly/sdk${i?"-staging":""}${t?"@"+t:""}/snippyly.js`,s.id="snippylyScript",s.type="module",document.body.appendChild(s),s.onload=()=>{o&&o()}}})(void 0,this.staging,(()=>{window.Snippyly&&this.initializeSnippyly()}))}catch(t){console.warn("Error in loadPluginUI: ",t)}},this.initializeSnippyly=async()=>{try{await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.init(this.apiKey)),this.documentId=((t,i=0)=>{try{let o=3735928559^i,s=1103547991^i;for(let i,e=0;e<t.length;e++)i=t.charCodeAt(e),o=Math.imul(o^i,2654435761),s=Math.imul(s^i,1597334677);return o=Math.imul(o^o>>>16,2246822507)^Math.imul(s^s>>>13,3266489909),s=Math.imul(s^s>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),4294967296*(2097151&s)+(o>>>0)}catch(t){return console.warn("Error in cyrb53: ",t),0}})((t=>{let i;return i=t.includes("http")?new URL(t):new URL("http://"+t),i.hostname.replace("www.","")})(window.location.origin))+"",null===Snippyly||void 0===Snippyly||Snippyly.setDocumentId(this.documentId+""),this.generateLocation(),this.setLocation(),this.commentElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),this.commentElement&&(this.commentElement.enableTextComments(!0),this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachment(!0),this.commentElement.showScreenSizeInfo(!0),this.commentElement.addCommentModeChange&&this.commentElement.addCommentModeChange().subscribe((t=>{this.addCommentMode=t}))),this.selectionElement=Snippyly.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.identifySnippyly()}catch(t){console.warn("Error in initializeSnippyly: ",t)}},this.generateLocation=()=>{try{const t=new URL(document.location).searchParams,i=new URL(document.location);i.searchParams.delete("review"),i.searchParams.delete("sreviewId"),i.searchParams.delete("scommentId");const o=t.get("sversion")||this.projectVersion;this.location={url:i.href,version:o}}catch(t){console.warn("Error in generateLocation: ",t)}},this.setLocation=()=>{try{window.Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setLocation)&&(null===Snippyly||void 0===Snippyly||Snippyly.setLocation(JSON.parse(JSON.stringify(this.location))))}catch(t){console.warn("Error in setLocation: ",t)}},this.identifySnippyly=async()=>{var t;try{this.invalidApiKey=!1;let t={name:"Anonymous User",email:"anonymous@snippyly.com",userId:"anonymous",isAnonymous:!0};if(ht("snippyly-user",!0)){const i=JSON.parse(ht("snippyly-user",!0));(null==i?void 0:i.email)&&(t=i)}t.contacts=window.SNIPPYLY_USER_CONTACTS||[],t.isAnonymous?delete t.groupId:t.groupId=Snippyly.getDocumentId()+"",await Snippyly.identify(t),(null==t?void 0:t.isAnonymous)||(this.snippylyUser=JSON.parse(JSON.stringify(t))),this.getComments(),this.checkGlobalUserContact()}catch(i){i&&"string"==typeof i&&(null===(t=null==i?void 0:i.toLowerCase())||void 0===t?void 0:t.includes("invalid"))&&(this.invalidApiKey=!0),console.warn("Error in identifySnippyly: ",i)}},this.getComments=()=>{try{this.commentElement&&(this.commentSubscription&&this.commentSubscription.unsubscribe(),this.commentSubscription=this.commentElement.getAllCommentAnnotations(this.documentId).subscribe((t=>{this.comments=t,"All"!==this.viewMode&&(this.viewMode?this.comments=t.filter((t=>{var i;return(null===(i=null==t?void 0:t.location)||void 0===i?void 0:i.view)===this.viewMode})):this.comments=this.comments.filter((t=>{var i;return!(null===(i=null==t?void 0:t.location)||void 0===i?void 0:i.view)})))})))}catch(t){console.warn("Error in getComments: ",t)}},this.checkGlobalUserContact=()=>{try{this.commentElement&&this.commentElement.isUserGlobalContact().subscribe((t=>{!this.isUserGlobalContact&&t&&this.setViewMode("All"),this.isUserGlobalContact=t,t||this.setViewMode(null)}))}catch(t){console.warn("Error in checkGlobalUserContact: ",t)}},this.toggleCommentSidebar=()=>{try{this.commentElement&&this.commentElement.toggleCommentSidebar()}catch(t){console.warn("Error in toggleCommentSidebar: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t)}},this.loginWithGoogle=()=>{try{window.open(`https://snippyly-login-staging.web.app/?redirect_url=${encodeURIComponent(window.location.href)}`,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t)}},this.removeSnippyly=async()=>{try{vt("review","sessionStorage"),vt("sreviewId","sessionStorage"),vt("projectVersionKey","sessionStorage"),vt("projectVersion","sessionStorage");const t=new URL(document.location),i=t.searchParams;i.delete("sreviewId"),i.delete("review"),this.projectVersionKey&&i.delete(this.projectVersionKey),this.projectVersion=void 0,this.projectVersionKey=void 0,delete window.snippylyInitialLoadUrl,window.history.replaceState({},document.title,t.href),window.location.reload()}catch(t){console.warn("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{await Snippyly.signOutUser(),vt("snippyly-user"),this.snippylyUser=void 0,window.open(`https://snippyly-login-staging.web.app/?signout=true&redirect_url=${encodeURIComponent(window.location.href)}`,"_self")}catch(t){console.warn("Error in signOutUser: ",t)}},this.toggleMenu=(t,i)=>{try{t.stopPropagation(),this.menuOpenedId===i?this.menuOpenedId=void 0:this.menuOpenedId=i}catch(t){console.warn("Error in toggleMenu: ",t)}},this.copyLink=()=>{try{navigator.clipboard.writeText(window.location.href),this.copyLinkTooltip="Link copied!",setTimeout((()=>{this.copyLinkTooltip="Copy Link"}),2e3)}catch(t){console.warn("Error in copyLink: ",t)}},this.setViewMode=t=>{try{this.viewMode=t,t?this.location.view=t:delete this.location.view,this.setLocation(),this.getComments()}catch(t){console.warn("Error in setViewMode: ",t)}},this.setAttribute("snippyly-comment-disabled","true");try{this.expanded=!0,this.detectVersion(),this.setWindowEventListner(),this.urlChangeListener(),this.checkUrl(),console.log("*** Staging Mode ON! ***")}catch(t){console.warn("Error in constructor: ",t)}}get loadPlugin(){return this._loadPlugin}set loadPlugin(t){this._loadPlugin=t,this.loadPlugin?this.classList.add("visible"):this.classList.remove("visible")}get expanded(){return this._expanded}set expanded(t){this._expanded=t,this.expanded?this.classList.add("expanded"):this.classList.remove("expanded")}get projectVersionKey(){return this._projectVersionKey}set projectVersionKey(t){try{this._projectVersionKey=t,this.projectVersionKey&&ct("projectVersionKey",this.projectVersionKey,!1,"sessionStorage"),this.detectVersion()}catch(t){console.warn("Error in set projectVersionKey: ",t)}}get menuOpenedId(){return this._menuOpenedId}set menuOpenedId(t){this._menuOpenedId=t,this.menuOpenedId?this.addWindowClickEventListener():this.removeWindowClickEventListener()}render(){var t,i;return this.loadPlugin?this.snippylyUser?A`
|
|
379
|
+
|
|
380
|
+
snippyly-presence {
|
|
381
|
+
display: flex;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.s-presence-container {
|
|
385
|
+
display: inline-flex;
|
|
386
|
+
flex-direction: row-reverse;
|
|
387
|
+
align-items: center;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.s-presence-avatar {
|
|
391
|
+
position: relative;
|
|
392
|
+
box-shadow: 0px 0px 0px 3px;
|
|
393
|
+
border-radius: 50%;
|
|
394
|
+
overflow: hidden;
|
|
395
|
+
width: 24px;
|
|
396
|
+
height: 24px;
|
|
397
|
+
display: flex;
|
|
398
|
+
align-items: center;
|
|
399
|
+
justify-content: center;
|
|
400
|
+
font-size: 12px;
|
|
401
|
+
// background-color: white;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.s-presence-avatar.more-users {
|
|
405
|
+
background: #4578a7;
|
|
406
|
+
box-shadow: 0px 0px 0px 3px #4578a7;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.s-presence-avatar:not(:last-child):not(.more-users) {
|
|
410
|
+
margin-left: -6px !important;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.s-presence-avatar-image {
|
|
414
|
+
width: 100%;
|
|
415
|
+
height: auto;
|
|
416
|
+
display: block;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.s-presence-avatar-image-small {
|
|
420
|
+
width: ${vt(1.6)};
|
|
421
|
+
height: auto;
|
|
422
|
+
display: block;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.s-presence-avatar-initial {
|
|
426
|
+
color: white;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.away {
|
|
430
|
+
filter: grayscale(1);
|
|
431
|
+
}
|
|
432
|
+
`;var yt=function(t,i,o,s){for(var e,n=arguments.length,r=n<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,o):s,l=t.length-1;l>=0;l--)(e=t[l])&&(r=(n<3?e(r):n>3?e(i,o,r):e(i,o))||r);return n>3&&r&&Object.defineProperty(i,o,r),r};let gt=class extends X{constructor(){super(),this._loadPlugin=!1,this.comments=[],this.addCommentMode=!1,this._expanded=!0,this.staging=true,this.copyLinkTooltip="Copy Link",this.invalidApiKey=!1,this.isUserGlobalContact=!1,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)}},this.removeWindowClickEventListener=()=>{try{window.removeEventListener("click",this.windowClickEventListener),this.windowClickEventListener=void 0}catch(t){console.warn("Error in removeWindowClickEventListener: ",t)}},this.setWindowEventListner=()=>{try{window.addEventListener("locationchange",(()=>{this.checkUrl()}))}catch(t){console.warn("Error in setWindowEventListner: ",t)}},this.urlChangeListener=()=>{try{const t=history.pushState;history.pushState=function(){const i=t.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),i};const i=history.replaceState;history.replaceState=function(){const t=i.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)}},this.checkUrl=()=>{var t;try{const i=new URL(document.location),o=i.searchParams;if(o.has("snippyly_google_token")){const s=JSON.parse(atob(o.get("snippyly_google_token"))),e={},n=(null===(t=s.providerData)||void 0===t?void 0:t.length)?s.providerData[0]:null;e.userId=s.uid,e.name=s.displayName||(null==n?void 0:n.displayName),e.email=s.email||(null==n?void 0:n.email),e.photoUrl=(null==s?void 0:s.photoURL)||(null==n?void 0:n.photoURL),e.contacts=window.SNIPPYLY_USER_CONTACTS||[],ct("snippyly-user",JSON.stringify(e),!0),o.delete("snippyly_google_token"),window.history.replaceState({},document.title,i.href)}o.has("review")?(ct("review","true",!1,"sessionStorage"),"true"!==o.get("review")&&(o.delete("review"),o.append("review","true"),window.history.replaceState({},document.title,i.href)),this.loadPluginUI()):ht("review",!1,"sessionStorage")&&(o.append("review","true"),window.history.replaceState({},document.title,i.href),this.loadPluginUI()),this.setVersionInUrl()}catch(t){console.warn("Error in checkUrl: ",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&&ct("projectVersion",this.projectVersion,!1,"sessionStorage")}}catch(t){console.warn("Error in detectVersion: ",t)}},this.setVersionInUrl=()=>{try{const t=this.projectVersionKey||ht("projectVersionKey",!1,"sessionStorage"),i=this.projectVersion||ht("projectVersion",!1,"sessionStorage");if(t&&i){const o=new URL(document.location),s=o.searchParams;s.get(t)||(s.set(t,i),window.history.replaceState({},document.title,o.href))}}catch(t){console.warn("Error in setVersionInUrl: ",t)}},this.loadPluginUI=()=>{try{if(this.loadPlugin)return this.generateLocation(),void this.setViewMode(this.viewMode);if(this.loadPlugin=!0,!document.querySelector(nt)){const t=document.createElement(nt);null==t||t.addEventListener("signIn",(()=>{this.loginWithGoogle()})),window.document.body.appendChild(t)}if(!document.querySelector(rt)){const t=document.createElement(rt);t.setAttribute(dt,"true"),window.document.body.appendChild(t)}if(!document.querySelector(et)){const t=document.createElement(et);window.document.body.appendChild(t)}if(!document.querySelector(lt)){const t=document.createElement(lt);window.document.body.appendChild(t)}if(!document.querySelector(at)){const t=document.createElement(at);window.document.body.appendChild(t)}((t="",i=!1,o)=>{if(console.log("load snippyly called"),document.getElementById("snippylyScript"))o&&o();else{const s=document.createElement("script");s.src=`https://cdn.jsdelivr.net/npm/@snippyly/sdk${i?"-staging":""}${t?"@"+t:""}/snippyly.js`,s.id="snippylyScript",s.type="module",document.body.appendChild(s),s.onload=()=>{o&&o()}}})(void 0,this.staging,(()=>{window.Snippyly&&this.initializeSnippyly()}))}catch(t){console.warn("Error in loadPluginUI: ",t)}},this.initializeSnippyly=async()=>{try{await(null===Snippyly||void 0===Snippyly?void 0:Snippyly.init(this.apiKey)),this.documentId=((t,i=0)=>{try{let o=3735928559^i,s=1103547991^i;for(let i,e=0;e<t.length;e++)i=t.charCodeAt(e),o=Math.imul(o^i,2654435761),s=Math.imul(s^i,1597334677);return o=Math.imul(o^o>>>16,2246822507)^Math.imul(s^s>>>13,3266489909),s=Math.imul(s^s>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),4294967296*(2097151&s)+(o>>>0)}catch(t){return console.warn("Error in cyrb53: ",t),0}})((t=>{let i;return i=t.includes("http")?new URL(t):new URL("http://"+t),i.hostname.replace("www.","")})(window.location.origin))+"",null===Snippyly||void 0===Snippyly||Snippyly.setDocumentId(this.documentId+""),this.generateLocation(),this.setLocation(),this.commentElement=null===Snippyly||void 0===Snippyly?void 0:Snippyly.getCommentElement(),this.commentElement&&(this.commentElement.enableTextComments(!0),this.commentElement.enableSignInButton(!0),this.commentElement.enableAttachment(!0),this.commentElement.showScreenSizeInfo(!0),this.commentElement.addCommentModeChange&&this.commentElement.addCommentModeChange().subscribe((t=>{this.addCommentMode=t}))),this.selectionElement=Snippyly.getSelectionElement(),this.selectionElement&&this.selectionElement.enableLiveSelection(!0),this.identifySnippyly()}catch(t){console.warn("Error in initializeSnippyly: ",t)}},this.generateLocation=()=>{try{const t=new URL(document.location).searchParams,i=new URL(document.location);i.searchParams.delete("review"),i.searchParams.delete("sreviewId"),i.searchParams.delete("scommentId");const o=t.get("sversion")||this.projectVersion;this.location={url:i.href,version:o}}catch(t){console.warn("Error in generateLocation: ",t)}},this.setLocation=()=>{try{window.Snippyly&&(null===Snippyly||void 0===Snippyly?void 0:Snippyly.setLocation)&&(null===Snippyly||void 0===Snippyly||Snippyly.setLocation(JSON.parse(JSON.stringify(this.location))))}catch(t){console.warn("Error in setLocation: ",t)}},this.identifySnippyly=async()=>{var t;try{this.invalidApiKey=!1;let t={name:"Anonymous User",email:"anonymous@snippyly.com",userId:"anonymous",isAnonymous:!0};if(ht("snippyly-user",!0)){const i=JSON.parse(ht("snippyly-user",!0));(null==i?void 0:i.email)&&(t=i)}t.contacts=window.SNIPPYLY_USER_CONTACTS||[],t.isAnonymous?delete t.groupId:t.groupId=Snippyly.getDocumentId()+"",await Snippyly.identify(t),(null==t?void 0:t.isAnonymous)||(this.snippylyUser=JSON.parse(JSON.stringify(t))),this.getComments(),this.checkGlobalUserContact()}catch(i){i&&"string"==typeof i&&(null===(t=null==i?void 0:i.toLowerCase())||void 0===t?void 0:t.includes("invalid"))&&(this.invalidApiKey=!0),console.warn("Error in identifySnippyly: ",i)}},this.getComments=()=>{try{this.commentElement&&(this.commentSubscription&&this.commentSubscription.unsubscribe(),this.commentSubscription=this.commentElement.getAllCommentAnnotations(this.documentId).subscribe((t=>{this.comments=t,"All"!==this.viewMode&&(this.viewMode?this.comments=t.filter((t=>{var i;return(null===(i=null==t?void 0:t.location)||void 0===i?void 0:i.view)===this.viewMode})):this.comments=this.comments.filter((t=>{var i;return!(null===(i=null==t?void 0:t.location)||void 0===i?void 0:i.view)})))})))}catch(t){console.warn("Error in getComments: ",t)}},this.checkGlobalUserContact=()=>{try{this.commentElement&&this.commentElement.isUserGlobalContact().subscribe((t=>{!this.isUserGlobalContact&&t&&this.setViewMode("All"),this.isUserGlobalContact=t,t||this.setViewMode(null)}))}catch(t){console.warn("Error in checkGlobalUserContact: ",t)}},this.toggleCommentSidebar=()=>{try{this.commentElement&&this.commentElement.toggleCommentSidebar()}catch(t){console.warn("Error in toggleCommentSidebar: ",t)}},this.toggleSnippylyPluginToolbar=()=>{try{this.expanded=!this.expanded}catch(t){console.warn("Error in toggleSnippylyPluginToolbar: ",t)}},this.loginWithGoogle=()=>{try{window.open(`https://snippyly-login-staging.web.app/?redirect_url=${encodeURIComponent(window.location.href)}`,"_self")}catch(t){console.warn("Error in loginWithGoogle: ",t)}},this.removeSnippyly=async()=>{try{pt("review","sessionStorage"),pt("sreviewId","sessionStorage"),pt("projectVersionKey","sessionStorage"),pt("projectVersion","sessionStorage");const t=new URL(document.location),i=t.searchParams;i.delete("sreviewId"),i.delete("review"),this.projectVersionKey&&i.delete(this.projectVersionKey),this.projectVersion=void 0,this.projectVersionKey=void 0,delete window.snippylyInitialLoadUrl,window.history.replaceState({},document.title,t.href),window.location.reload()}catch(t){console.warn("Error in removeSnippyly: ",t)}},this.signOutUser=async()=>{try{await Snippyly.signOutUser(),pt("snippyly-user"),this.snippylyUser=void 0,window.open(`https://snippyly-login-staging.web.app/?signout=true&redirect_url=${encodeURIComponent(window.location.href)}`,"_self")}catch(t){console.warn("Error in signOutUser: ",t)}},this.toggleMenu=(t,i)=>{try{t.stopPropagation(),this.menuOpenedId===i?this.menuOpenedId=void 0:this.menuOpenedId=i}catch(t){console.warn("Error in toggleMenu: ",t)}},this.copyLink=()=>{try{navigator.clipboard.writeText(window.location.href),this.copyLinkTooltip="Link copied!",setTimeout((()=>{this.copyLinkTooltip="Copy Link"}),2e3)}catch(t){console.warn("Error in copyLink: ",t)}},this.setViewMode=t=>{try{this.viewMode=t,t?this.location.view=t:delete this.location.view,this.setLocation(),this.getComments()}catch(t){console.warn("Error in setViewMode: ",t)}},this.setAttribute("snippyly-comment-disabled","true");try{this.expanded=!0,this.detectVersion(),this.setWindowEventListner(),this.urlChangeListener(),this.checkUrl(),console.log("*** Staging Mode ON! ***")}catch(t){console.warn("Error in constructor: ",t)}}get loadPlugin(){return this._loadPlugin}set loadPlugin(t){this._loadPlugin=t,this.loadPlugin?this.classList.add("visible"):this.classList.remove("visible")}get expanded(){return this._expanded}set expanded(t){this._expanded=t,this.expanded?this.classList.add("expanded"):this.classList.remove("expanded")}get projectVersionKey(){return this._projectVersionKey}set projectVersionKey(t){try{this._projectVersionKey=t,this.projectVersionKey&&ct("projectVersionKey",this.projectVersionKey,!1,"sessionStorage"),this.detectVersion()}catch(t){console.warn("Error in set projectVersionKey: ",t)}}get menuOpenedId(){return this._menuOpenedId}set menuOpenedId(t){this._menuOpenedId=t,this.menuOpenedId?this.addWindowClickEventListener():this.removeWindowClickEventListener()}render(){var t,i;return this.loadPlugin?this.snippylyUser?A`
|
|
380
433
|
<div class="snippyly-plugin-container">
|
|
381
434
|
<div class="toolbar ${st({expanded:this.expanded})}">
|
|
382
435
|
|