@ourroadmaps/web-sdk 1.1.0 → 1.3.0

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/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  var chunkKGQKTDB4_cjs = require('./chunk-KGQKTDB4.cjs');
4
4
  var chunkEKWWSLHU_cjs = require('./chunk-EKWWSLHU.cjs');
5
- var chunkWL3SZK6Q_cjs = require('./chunk-WL3SZK6Q.cjs');
5
+ var chunkYBGLMQP5_cjs = require('./chunk-YBGLMQP5.cjs');
6
6
  require('./chunk-4DE2IREA.cjs');
7
7
 
8
8
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
@@ -48,13 +48,38 @@ function destroy() {
48
48
 
49
49
  // src/index.ts
50
50
  if (typeof window !== "undefined") {
51
- window.OurRoadmaps = { init, destroy, createOverlay: chunkEKWWSLHU_cjs.createOverlay, Review: chunkWL3SZK6Q_cjs.Review };
51
+ window.OurRoadmaps = { init, destroy, createOverlay: chunkEKWWSLHU_cjs.createOverlay, Review: chunkYBGLMQP5_cjs.Review };
52
52
  }
53
53
  if (typeof window !== "undefined") {
54
+ let tokenType = null;
55
+ let token = null;
54
56
  const params = new URLSearchParams(window.location.search);
55
- if (params.has("review") || params.has("triage")) {
56
- const review = new chunkWL3SZK6Q_cjs.Review();
57
- review.init();
57
+ const reviewToken = params.get("review");
58
+ const triageToken = params.get("triage");
59
+ if (reviewToken) {
60
+ tokenType = "review";
61
+ token = reviewToken;
62
+ chunkYBGLMQP5_cjs.storeToken("review", reviewToken);
63
+ const clean = new URL(window.location.href);
64
+ clean.searchParams.delete("review");
65
+ history.replaceState(null, "", clean.toString());
66
+ } else if (triageToken) {
67
+ tokenType = "triage";
68
+ token = triageToken;
69
+ chunkYBGLMQP5_cjs.storeToken("triage", triageToken);
70
+ const clean = new URL(window.location.href);
71
+ clean.searchParams.delete("triage");
72
+ history.replaceState(null, "", clean.toString());
73
+ } else {
74
+ const stored = chunkYBGLMQP5_cjs.getStoredToken();
75
+ if (stored) {
76
+ tokenType = stored.type;
77
+ token = stored.token;
78
+ }
79
+ }
80
+ if (tokenType && token) {
81
+ const review = new chunkYBGLMQP5_cjs.Review();
82
+ review.init(tokenType, token);
58
83
  }
59
84
  }
60
85
 
@@ -68,7 +93,7 @@ Object.defineProperty(exports, "createOverlay", {
68
93
  });
69
94
  Object.defineProperty(exports, "Review", {
70
95
  enumerable: true,
71
- get: function () { return chunkWL3SZK6Q_cjs.Review; }
96
+ get: function () { return chunkYBGLMQP5_cjs.Review; }
72
97
  });
73
98
  exports.destroy = destroy;
74
99
  exports.init = init;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/feedback/dev-mode.ts","../src/feedback-init.ts","../src/index.ts"],"names":["Feedback","createOverlay","Review"],"mappings":";;;;;;;;;AAAO,SAAS,SAAA,GAAqB;AAEnC,EAAA,IAAI,OAAO,OAAA,KAAY,WAAA,IAAe,OAAA,CAAQ,KAAK,QAAA,EAAU;AAC3D,IAAA,OAAO,OAAA,CAAQ,IAAI,QAAA,KAAa,YAAA;AAAA,EAClC;AAGA,EAAA,IAAI,OAAO,sQAAA,KAAgB,WAAA,IAAe,WAAiB,IAAA,EAAM;AAC/D,IAAA,OAAO,UAAgB,IAAA,KAAS,YAAA;AAAA,EAClC;AAGA,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,IAAe,MAAA,CAAO,QAAA,EAAU;AACpD,IAAA,MAAM,QAAA,GAAW,OAAO,QAAA,CAAS,QAAA;AACjC,IAAA,OAAO,aAAa,WAAA,IAAe,QAAA,KAAa,WAAA,IAAe,QAAA,CAAS,SAAS,QAAQ,CAAA;AAAA,EAC3F;AAEA,EAAA,OAAO,KAAA;AACT;;;ACbA,IAAI,gBAAA,GAAoC,IAAA;AAEjC,SAAS,KAAK,MAAA,EAA4B;AAC/C,EAAA,IAAI,CAAC,OAAO,MAAA,EAAQ;AAClB,IAAA,OAAA,CAAQ,MAAM,iDAAiD,CAAA;AAC/D,IAAA;AAAA,EACF;AAEA,EAAA,IAAI,CAAC,WAAU,EAAG;AAChB,IAAA,OAAA,CAAQ,KAAK,kDAAkD,CAAA;AAC/D,IAAA;AAAA,EACF;AAEA,EAAA,IAAI,gBAAA,EAAkB;AACpB,IAAA,OAAA,CAAQ,KAAK,0CAA0C,CAAA;AACvD,IAAA;AAAA,EACF;AAEA,EAAA,gBAAA,GAAmB,IAAIA,2BAAS,MAAM,CAAA;AACtC,EAAA,gBAAA,CAAiB,KAAA,EAAM;AACzB;AAEO,SAAS,OAAA,GAAgB;AAC9B,EAAA,IAAI,gBAAA,EAAkB;AACpB,IAAA,gBAAA,CAAiB,OAAA,EAAQ;AACzB,IAAA,gBAAA,GAAmB,IAAA;AAAA,EACrB;AACF;;;ACDA,IAAI,OAAO,WAAW,WAAA,EAAa;AAEhC,EAAC,OAAe,WAAA,GAAc,EAAE,IAAA,EAAM,OAAA,iBAASC,yCAAeC,wBAAA,EAAO;AACxE;AAGA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,EAAA,MAAM,MAAA,GAAS,IAAI,eAAA,CAAgB,MAAA,CAAO,SAAS,MAAM,CAAA;AACzD,EAAA,IAAI,OAAO,GAAA,CAAI,QAAQ,KAAK,MAAA,CAAO,GAAA,CAAI,QAAQ,CAAA,EAAG;AAChD,IAAA,MAAM,MAAA,GAAS,IAAIA,wBAAA,EAAO;AAC1B,IAAA,MAAA,CAAO,IAAA,EAAK;AAAA,EACd;AACF","file":"index.cjs","sourcesContent":["export function isDevMode(): boolean {\n // Check NODE_ENV (works with bundlers)\n if (typeof process !== 'undefined' && process.env?.NODE_ENV) {\n return process.env.NODE_ENV !== 'production'\n }\n\n // Check import.meta.env (Vite)\n if (typeof import.meta !== 'undefined' && import.meta.env?.MODE) {\n return import.meta.env.MODE !== 'production'\n }\n\n // Check hostname (works without bundler)\n if (typeof window !== 'undefined' && window.location) {\n const hostname = window.location.hostname\n return hostname === 'localhost' || hostname === '127.0.0.1' || hostname.endsWith('.local')\n }\n\n return false\n}\n","// Feedback initialization - extracted for lazy loading\nimport { isDevMode } from './feedback/dev-mode'\nimport { Feedback } from './feedback/Feedback'\nimport type { WidgetConfig } from './feedback/types'\n\nlet feedbackInstance: Feedback | null = null\n\nexport function init(config: WidgetConfig): void {\n if (!config.apiKey) {\n console.error('[OurRoadmaps] Missing required apiKey in config')\n return\n }\n\n if (!isDevMode()) {\n console.info('[OurRoadmaps] Widget disabled in production mode')\n return\n }\n\n if (feedbackInstance) {\n console.warn('[OurRoadmaps] Widget already initialized')\n return\n }\n\n feedbackInstance = new Feedback(config)\n feedbackInstance.mount()\n}\n\nexport function destroy(): void {\n if (feedbackInstance) {\n feedbackInstance.unmount()\n feedbackInstance = null\n }\n}\n","// Feedback module\n\nexport type { WidgetConfig } from './feedback/types'\nexport { destroy, init } from './feedback-init'\nexport type {\n Action,\n Anchor,\n Annotation,\n AnnotationsConfig,\n AnnotationsController,\n CursorConfig,\n CursorController,\n OverlayController,\n OverlayError,\n OverlayOptions,\n OverlayScript,\n Target,\n ValidationResult,\n} from './overlay'\n// Overlay module\nexport { createOverlay, Overlay } from './overlay'\n\n// Review module\nexport { Review } from './review'\nexport type { PinData, ReviewOptions } from './review'\n\n// For UMD bundle - expose on window\nimport { destroy, init } from './feedback-init'\nimport { createOverlay } from './overlay'\nimport { Review } from './review'\n\nif (typeof window !== 'undefined') {\n // biome-ignore lint/suspicious/noExplicitAny: Required for UMD global assignment\n ;(window as any).OurRoadmaps = { init, destroy, createOverlay, Review }\n}\n\n// Auto-init review mode if URL params present\nif (typeof window !== 'undefined') {\n const params = new URLSearchParams(window.location.search)\n if (params.has('review') || params.has('triage')) {\n const review = new Review()\n review.init()\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/feedback/dev-mode.ts","../src/feedback-init.ts","../src/index.ts"],"names":["Feedback","createOverlay","Review","storeToken","getStoredToken"],"mappings":";;;;;;;;;AAAO,SAAS,SAAA,GAAqB;AAEn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AAA;AACnB,MAAA,KAAA,GAAQ,MAAA,CAAO,KAAA;AAAA,IACjB;AAAA,EACF;AAGA,EAAA,IAAI,aAAa,KAAA,EAAO;AACtB,IAAA,MAAM,MAAA,GAAS,IAAIF,wBAAA,EAAO;AAC1B,IAAA,MAAA,CAAO,IAAA,CAAK,WAAW,KAAK,CAAA;AAAA,EAC9B;AACF","file":"index.cjs","sourcesContent":["export function isDevMode(): boolean {\n // Check NODE_ENV (works with bundlers)\n if (typeof process !== 'undefined' && process.env?.NODE_ENV) {\n return process.env.NODE_ENV !== 'production'\n }\n\n // Check import.meta.env (Vite)\n if (typeof import.meta !== 'undefined' && import.meta.env?.MODE) {\n return import.meta.env.MODE !== 'production'\n }\n\n // Check hostname (works without bundler)\n if (typeof window !== 'undefined' && window.location) {\n const hostname = window.location.hostname\n return hostname === 'localhost' || hostname === '127.0.0.1' || hostname.endsWith('.local')\n }\n\n return false\n}\n","// Feedback initialization - extracted for lazy loading\nimport { isDevMode } from './feedback/dev-mode'\nimport { Feedback } from './feedback/Feedback'\nimport type { WidgetConfig } from './feedback/types'\n\nlet feedbackInstance: Feedback | null = null\n\nexport function init(config: WidgetConfig): void {\n if (!config.apiKey) {\n console.error('[OurRoadmaps] Missing required apiKey in config')\n return\n }\n\n if (!isDevMode()) {\n console.info('[OurRoadmaps] Widget disabled in production mode')\n return\n }\n\n if (feedbackInstance) {\n console.warn('[OurRoadmaps] Widget already initialized')\n return\n }\n\n feedbackInstance = new Feedback(config)\n feedbackInstance.mount()\n}\n\nexport function destroy(): void {\n if (feedbackInstance) {\n feedbackInstance.unmount()\n feedbackInstance = null\n }\n}\n","// Feedback module\n\nexport type { WidgetConfig } from './feedback/types'\nexport { destroy, init } from './feedback-init'\nexport type {\n Action,\n Anchor,\n Annotation,\n AnnotationsConfig,\n AnnotationsController,\n CursorConfig,\n CursorController,\n OverlayController,\n OverlayError,\n OverlayOptions,\n OverlayScript,\n Target,\n ValidationResult,\n} from './overlay'\n// Overlay module\nexport { createOverlay, Overlay } from './overlay'\n\n// Review module\nexport { Review } from './review'\nexport type { PinData, ReviewOptions } from './review'\n\n// For UMD bundle - expose on window\nimport { destroy, init } from './feedback-init'\nimport { createOverlay } from './overlay'\nimport { Review } from './review'\nimport { storeToken, getStoredToken } from './review/TokenStorage'\n\nif (typeof window !== 'undefined') {\n // biome-ignore lint/suspicious/noExplicitAny: Required for UMD global assignment\n ;(window as any).OurRoadmaps = { init, destroy, createOverlay, Review }\n}\n\n// Auto-init review mode: check URL params first, then sessionStorage\nif (typeof window !== 'undefined') {\n let tokenType: 'review' | 'triage' | null = null\n let token: string | null = null\n\n // 1. Check URL params (first visit via email/slack link)\n const params = new URLSearchParams(window.location.search)\n const reviewToken = params.get('review')\n const triageToken = params.get('triage')\n\n if (reviewToken) {\n tokenType = 'review'\n token = reviewToken\n storeToken('review', reviewToken)\n // Strip token from URL to prevent leaking into history/referrer\n const clean = new URL(window.location.href)\n clean.searchParams.delete('review')\n history.replaceState(null, '', clean.toString())\n } else if (triageToken) {\n tokenType = 'triage'\n token = triageToken\n storeToken('triage', triageToken)\n const clean = new URL(window.location.href)\n clean.searchParams.delete('triage')\n history.replaceState(null, '', clean.toString())\n } else {\n // 2. No URL param — check sessionStorage (subsequent navigation)\n const stored = getStoredToken()\n if (stored) {\n tokenType = stored.type\n token = stored.token\n }\n }\n\n // 3. Initialize if we have a token\n if (tokenType && token) {\n const review = new Review()\n review.init(tokenType, token)\n }\n}\n"]}
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Feedback } from './chunk-MKPDPQXT.js';
2
2
  import { createOverlay } from './chunk-JPUN7P3T.js';
3
3
  export { Overlay, createOverlay } from './chunk-JPUN7P3T.js';
4
- import { Review } from './chunk-2Q3BAT55.js';
5
- export { Review } from './chunk-2Q3BAT55.js';
4
+ import { Review, storeToken, getStoredToken } from './chunk-266CLLX4.js';
5
+ export { Review } from './chunk-266CLLX4.js';
6
6
  import './chunk-V6TY7KAL.js';
7
7
 
8
8
  // src/feedback/dev-mode.ts
@@ -50,10 +50,35 @@ if (typeof window !== "undefined") {
50
50
  window.OurRoadmaps = { init, destroy, createOverlay, Review };
51
51
  }
52
52
  if (typeof window !== "undefined") {
53
+ let tokenType = null;
54
+ let token = null;
53
55
  const params = new URLSearchParams(window.location.search);
54
- if (params.has("review") || params.has("triage")) {
56
+ const reviewToken = params.get("review");
57
+ const triageToken = params.get("triage");
58
+ if (reviewToken) {
59
+ tokenType = "review";
60
+ token = reviewToken;
61
+ storeToken("review", reviewToken);
62
+ const clean = new URL(window.location.href);
63
+ clean.searchParams.delete("review");
64
+ history.replaceState(null, "", clean.toString());
65
+ } else if (triageToken) {
66
+ tokenType = "triage";
67
+ token = triageToken;
68
+ storeToken("triage", triageToken);
69
+ const clean = new URL(window.location.href);
70
+ clean.searchParams.delete("triage");
71
+ history.replaceState(null, "", clean.toString());
72
+ } else {
73
+ const stored = getStoredToken();
74
+ if (stored) {
75
+ tokenType = stored.type;
76
+ token = stored.token;
77
+ }
78
+ }
79
+ if (tokenType && token) {
55
80
  const review = new Review();
56
- review.init();
81
+ review.init(tokenType, token);
57
82
  }
58
83
  }
59
84
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/feedback/dev-mode.ts","../src/feedback-init.ts","../src/index.ts"],"names":[],"mappings":";;;;;;;;AAAO,SAAS,SAAA,GAAqB;AAEnC,EAAA,IAAI,OAAO,OAAA,KAAY,WAAA,IAAe,OAAA,CAAQ,KAAK,QAAA,EAAU;AAC3D,IAAA,OAAO,OAAA,CAAQ,IAAI,QAAA,KAAa,YAAA;AAAA,EAClC;AAGA,EAAA,IAAI,OAAO,MAAA,CAAA,IAAA,KAAgB,WAAA,IAAe,MAAA,CAAA,IAAA,CAAY,KAAK,IAAA,EAAM;AAC/D,IAAA,OAAO,MAAA,CAAA,IAAA,CAAY,IAAI,IAAA,KAAS,YAAA;AAAA,EAClC;AAGA,EAAA,IAAI,OAAO,MAAA,KAAW,WA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;AAC1B,IAAA,MAAA,CAAO,IAAA,EAAK;AAAA,EACd;AACF","file":"index.js","sourcesContent":["export function isDevMode(): boolean {\n // Check NODE_ENV (works with bundlers)\n if (typeof process !== 'undefined' && process.env?.NODE_ENV) {\n return process.env.NODE_ENV !== 'production'\n }\n\n // Check import.meta.env (Vite)\n if (typeof import.meta !== 'undefined' && import.meta.env?.MODE) {\n return import.meta.env.MODE !== 'production'\n }\n\n // Check hostname (works without bundler)\n if (typeof window !== 'undefined' && window.location) {\n const hostname = window.location.hostname\n return hostname === 'localhost' || hostname === '127.0.0.1' || hostname.endsWith('.local')\n }\n\n return false\n}\n","// Feedback initialization - extracted for lazy loading\nimport { isDevMode } from './feedback/dev-mode'\nimport { Feedback } from './feedback/Feedback'\nimport type { WidgetConfig } from './feedback/types'\n\nlet feedbackInstance: Feedback | null = null\n\nexport function init(config: WidgetConfig): void {\n if (!config.apiKey) {\n console.error('[OurRoadmaps] Missing required apiKey in config')\n return\n }\n\n if (!isDevMode()) {\n console.info('[OurRoadmaps] Widget disabled in production mode')\n return\n }\n\n if (feedbackInstance) {\n console.warn('[OurRoadmaps] Widget already initialized')\n return\n }\n\n feedbackInstance = new Feedback(config)\n feedbackInstance.mount()\n}\n\nexport function destroy(): void {\n if (feedbackInstance) {\n feedbackInstance.unmount()\n feedbackInstance = null\n }\n}\n","// Feedback module\n\nexport type { WidgetConfig } from './feedback/types'\nexport { destroy, init } from './feedback-init'\nexport type {\n Action,\n Anchor,\n Annotation,\n AnnotationsConfig,\n AnnotationsController,\n CursorConfig,\n CursorController,\n OverlayController,\n OverlayError,\n OverlayOptions,\n OverlayScript,\n Target,\n ValidationResult,\n} from './overlay'\n// Overlay module\nexport { createOverlay, Overlay } from './overlay'\n\n// Review module\nexport { Review } from './review'\nexport type { PinData, ReviewOptions } from './review'\n\n// For UMD bundle - expose on window\nimport { destroy, init } from './feedback-init'\nimport { createOverlay } from './overlay'\nimport { Review } from './review'\n\nif (typeof window !== 'undefined') {\n // biome-ignore lint/suspicious/noExplicitAny: Required for UMD global assignment\n ;(window as any).OurRoadmaps = { init, destroy, createOverlay, Review }\n}\n\n// Auto-init review mode if URL params present\nif (typeof window !== 'undefined') {\n const params = new URLSearchParams(window.location.search)\n if (params.has('review') || params.has('triage')) {\n const review = new Review()\n review.init()\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/feedback/dev-mode.ts","../src/feedback-init.ts","../src/index.ts"],"names":[],"mappings":";;;;;;;;AAAO,SAAS,SAAA,GAAqB;AAEnC,EAAA,IAAI,OAAO,OAAA,KAAY,WAAA,IAAe,OAAA,CAAQ,KAAK,QAAA,EAAU;AAC3D,IAAA,OAAO,OAAA,CAAQ,IAAI,QAAA,KAAa,YAAA;AAAA,EAClC;AAGA,EAAA,IAAI,OAAO,MAAA,CAAA,IAAA,KAAgB,WAAA,IAAe,MAAA,CAAA,IAAA,CAAY,KAAK,IAAA,EAAM;AAC/D,IAAA,OAAO,MAAA,CAAA,IAAA,CAAY,IAAI,IAAA,KAAS,YAAA;AAAA,EAClC;AAGA,EAAA,IAAI,OAAO,MAAA,KAAW,WAAA,IAAe,MAAA,CAAO,QAAA,EAAU;AACpD,IAAA,MAAM,QAAA,GAAW,OAAO,QAAA,CAAS,QAAA;AACjC,IAAA,OAAO,aAAa,WAAA,IAAe,QAAA,KAAa,WAAA,IAAe,QAAA,CAAS,SAAS,QAAQ,CAAA;AAAA,EAC3F;AAEA,EAAA,OAAO,KAAA;AACT;;;ACbA,IAAI,gBAAA,GAAoC,IAAA;AAEjC,SAAS,KAAK,MAAA,EAA4B;AAC/C,EAAA,IAAI,CAAC,OAAO,MAAA,EAAQ;AAClB,IAAA,OAAA,CAAQ,MAAM,iDAAiD,CAAA;AAC/D,IAAA;AAAA,EACF;AAEA,EAAA,IAAI,CAAC,WAAU,EAAG;AAChB,IAAA,OAAA,CAAQ,KAAK,kDAAkD,CAAA;AAC/D,IAAA;AAAA,EACF;AAEA,EAAA,IAAI,gBAAA,EAAkB;AACpB,IA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AW,CAAA;AAChC,IAAA,MAAM,KAAA,GAAQ,IAAI,GAAA,CAAI,MAAA,CAAO,SAAS,IAAI,CAAA;AAC1C,IAAA,KAAA,CAAM,YAAA,CAAa,OAAO,QAAQ,CAAA;AAClC,IAAA,OAAA,CAAQ,YAAA,CAAa,IAAA,EAAM,EAAA,EAAI,KAAA,CAAM,UAAU,CAAA;AAAA,EACjD,CAAA,MAAO;AAEL,IAAA,MAAM,SAAS,cAAA,EAAe;AAC9B,IAAA,IAAI,MAAA,EAAQ;AACV,MAAA,SAAA,GAAY,MAAA,CAAO,IAAA;AACnB,MAAA,KAAA,GAAQ,MAAA,CAAO,KAAA;AAAA,IACjB;AAAA,EACF;AAGA,EAAA,IAAI,aAAa,KAAA,EAAO;AACtB,IAAA,MAAM,MAAA,GAAS,IAAI,MAAA,EAAO;AAC1B,IAAA,MAAA,CAAO,IAAA,CAAK,WAAW,KAAK,CAAA;AAAA,EAC9B;AACF","file":"index.js","sourcesContent":["export function isDevMode(): boolean {\n // Check NODE_ENV (works with bundlers)\n if (typeof process !== 'undefined' && process.env?.NODE_ENV) {\n return process.env.NODE_ENV !== 'production'\n }\n\n // Check import.meta.env (Vite)\n if (typeof import.meta !== 'undefined' && import.meta.env?.MODE) {\n return import.meta.env.MODE !== 'production'\n }\n\n // Check hostname (works without bundler)\n if (typeof window !== 'undefined' && window.location) {\n const hostname = window.location.hostname\n return hostname === 'localhost' || hostname === '127.0.0.1' || hostname.endsWith('.local')\n }\n\n return false\n}\n","// Feedback initialization - extracted for lazy loading\nimport { isDevMode } from './feedback/dev-mode'\nimport { Feedback } from './feedback/Feedback'\nimport type { WidgetConfig } from './feedback/types'\n\nlet feedbackInstance: Feedback | null = null\n\nexport function init(config: WidgetConfig): void {\n if (!config.apiKey) {\n console.error('[OurRoadmaps] Missing required apiKey in config')\n return\n }\n\n if (!isDevMode()) {\n console.info('[OurRoadmaps] Widget disabled in production mode')\n return\n }\n\n if (feedbackInstance) {\n console.warn('[OurRoadmaps] Widget already initialized')\n return\n }\n\n feedbackInstance = new Feedback(config)\n feedbackInstance.mount()\n}\n\nexport function destroy(): void {\n if (feedbackInstance) {\n feedbackInstance.unmount()\n feedbackInstance = null\n }\n}\n","// Feedback module\n\nexport type { WidgetConfig } from './feedback/types'\nexport { destroy, init } from './feedback-init'\nexport type {\n Action,\n Anchor,\n Annotation,\n AnnotationsConfig,\n AnnotationsController,\n CursorConfig,\n CursorController,\n OverlayController,\n OverlayError,\n OverlayOptions,\n OverlayScript,\n Target,\n ValidationResult,\n} from './overlay'\n// Overlay module\nexport { createOverlay, Overlay } from './overlay'\n\n// Review module\nexport { Review } from './review'\nexport type { PinData, ReviewOptions } from './review'\n\n// For UMD bundle - expose on window\nimport { destroy, init } from './feedback-init'\nimport { createOverlay } from './overlay'\nimport { Review } from './review'\nimport { storeToken, getStoredToken } from './review/TokenStorage'\n\nif (typeof window !== 'undefined') {\n // biome-ignore lint/suspicious/noExplicitAny: Required for UMD global assignment\n ;(window as any).OurRoadmaps = { init, destroy, createOverlay, Review }\n}\n\n// Auto-init review mode: check URL params first, then sessionStorage\nif (typeof window !== 'undefined') {\n let tokenType: 'review' | 'triage' | null = null\n let token: string | null = null\n\n // 1. Check URL params (first visit via email/slack link)\n const params = new URLSearchParams(window.location.search)\n const reviewToken = params.get('review')\n const triageToken = params.get('triage')\n\n if (reviewToken) {\n tokenType = 'review'\n token = reviewToken\n storeToken('review', reviewToken)\n // Strip token from URL to prevent leaking into history/referrer\n const clean = new URL(window.location.href)\n clean.searchParams.delete('review')\n history.replaceState(null, '', clean.toString())\n } else if (triageToken) {\n tokenType = 'triage'\n token = triageToken\n storeToken('triage', triageToken)\n const clean = new URL(window.location.href)\n clean.searchParams.delete('triage')\n history.replaceState(null, '', clean.toString())\n } else {\n // 2. No URL param — check sessionStorage (subsequent navigation)\n const stored = getStoredToken()\n if (stored) {\n tokenType = stored.type\n token = stored.token\n }\n }\n\n // 3. Initialize if we have a token\n if (tokenType && token) {\n const review = new Review()\n review.init(tokenType, token)\n }\n}\n"]}
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkWL3SZK6Q_cjs = require('../chunk-WL3SZK6Q.cjs');
3
+ var chunkYBGLMQP5_cjs = require('../chunk-YBGLMQP5.cjs');
4
4
  require('../chunk-4DE2IREA.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "Review", {
9
9
  enumerable: true,
10
- get: function () { return chunkWL3SZK6Q_cjs.Review; }
10
+ get: function () { return chunkYBGLMQP5_cjs.Review; }
11
11
  });
12
12
  //# sourceMappingURL=index.cjs.map
13
13
  //# sourceMappingURL=index.cjs.map
@@ -34,7 +34,7 @@ declare class Review {
34
34
  private mode;
35
35
  private _isDestroyed;
36
36
  constructor(_options?: ReviewOptions);
37
- init(): Promise<void>;
37
+ init(tokenType: 'review' | 'triage', token: string): Promise<void>;
38
38
  private showErrorOverlay;
39
39
  destroy(): void;
40
40
  }
@@ -34,7 +34,7 @@ declare class Review {
34
34
  private mode;
35
35
  private _isDestroyed;
36
36
  constructor(_options?: ReviewOptions);
37
- init(): Promise<void>;
37
+ init(tokenType: 'review' | 'triage', token: string): Promise<void>;
38
38
  private showErrorOverlay;
39
39
  destroy(): void;
40
40
  }
@@ -1,4 +1,4 @@
1
- export { Review } from '../chunk-2Q3BAT55.js';
1
+ export { Review } from '../chunk-266CLLX4.js';
2
2
  import '../chunk-V6TY7KAL.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- "use strict";var OurRoadmaps=(()=>{var p=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var L=(n,e,t)=>e in n?p(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var N=(n,e)=>{for(var t in e)p(n,t,{get:e[t],enumerable:!0})},S=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of M(e))!P.call(n,o)&&o!==t&&p(n,o,{get:()=>e[o],enumerable:!(i=k(e,o))||i.enumerable});return n};var H=n=>S(p({},"__esModule",{value:!0}),n);var r=(n,e,t)=>L(n,typeof e!="symbol"?e+"":e,t);var _={};N(_,{Review:()=>f});var D={},b=(typeof D<"u","https://api.ourroadmaps.com");async function w(n){let e=await fetch(`${b}/v1/prototype-review/${n}`);if(e.status===410)throw new s("expired","This feedback session has expired");if(e.status===404)throw new s("invalid","This review link is not valid");if(!e.ok)throw new s("error","Something went wrong");return(await e.json()).data}async function x(n,e){let t=await fetch(`${b}/v1/prototype-review/${n}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new s("error","Failed to submit comment");return(await t.json()).data}async function m(n){let e=await fetch(`${b}/v1/prototype-review/${n}/comments`);if(!e.ok)throw new s("error","Failed to load comments");return(await e.json()).data}var s=class extends Error{constructor(t,i){super(i);this.code=t;this.name="ReviewError"}};function E(n,e){let t=document.elementFromPoint(n,e),i=document.documentElement,o=(n+window.scrollX)/i.scrollWidth*100,a=(e+window.scrollY)/i.scrollHeight*100;if(!t||t===document.body||t===i)return{pinX:o,pinY:a,element:{selector:"body",tag:"body",text:"",ariaLabel:null,className:"",boundingBox:{x:0,y:0,w:i.scrollWidth,h:i.scrollHeight}},context:{parentTag:"",parentText:"",grandparentTag:"",siblings:[],nearbyText:""},viewportWidth:window.innerWidth,viewportHeight:window.innerHeight};let l=t.getBoundingClientRect();return{pinX:o,pinY:a,element:{selector:R(t),tag:t.tagName.toLowerCase(),text:c(t).slice(0,200),ariaLabel:t.getAttribute("aria-label"),className:t.className&&typeof t.className=="string"?t.className:"",boundingBox:{x:Math.round(l.x),y:Math.round(l.y),w:Math.round(l.width),h:Math.round(l.height)}},context:{parentTag:t.parentElement?`${t.parentElement.tagName.toLowerCase()}${y(t.parentElement)}`:"",parentText:t.parentElement?c(t.parentElement).slice(0,100):"",grandparentTag:t.parentElement?.parentElement?`${t.parentElement.parentElement.tagName.toLowerCase()}${y(t.parentElement.parentElement)}`:"",siblings:$(t),nearbyText:z(t).slice(0,200)},viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}}function R(n){let e=[],t=n;for(;t&&t!==document.body;){if(t.id){e.unshift(`#${t.id}`);break}let i=t.tagName.toLowerCase();if(t.className&&typeof t.className=="string"){let o=t.className.trim().split(/\s+/).slice(0,2).join(".");o&&(i+=`.${o}`)}e.unshift(i),t=t.parentElement}return e.join(" > ")}function c(n){let e="";for(let t of n.childNodes)t.nodeType===Node.TEXT_NODE&&(e+=t.textContent?.trim()||"");return e.trim()||n.textContent?.trim().slice(0,200)||""}function y(n){if(!n.className||typeof n.className!="string")return"";let e=n.className.trim().split(/\s+/).slice(0,2).join(".");return e?`.${e}`:""}function $(n){if(!n.parentElement)return[];let e=[];for(let t of n.parentElement.children){if(t===n)continue;let i=t.tagName.toLowerCase(),o=(t.textContent?.trim()||"").slice(0,50);if(e.push(o?`${i}:${o}`:i),e.length>=4)break}return e}function z(n){let e=n.parentElement,t=0;for(;e&&t<3;){let i=c(e);if(i&&i!==c(n))return i;e=e.parentElement,t++}return""}var T=`
1
+ "use strict";var OurRoadmaps=(()=>{var v=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var O=Object.prototype.hasOwnProperty;var _=(n,t,e)=>t in n?v(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var X=(n,t)=>{for(var e in t)v(n,e,{get:t[e],enumerable:!0})},F=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Y(t))!O.call(n,o)&&o!==e&&v(n,o,{get:()=>t[o],enumerable:!(i=A(t,o))||i.enumerable});return n};var W=n=>F(v({},"__esModule",{value:!0}),n);var r=(n,t,e)=>_(n,typeof t!="symbol"?t+"":t,e);var K={};X(K,{Review:()=>P});var B={},S=(typeof B<"u","https://api.ourroadmaps.com");async function k(n){let t=await fetch(`${S}/v1/prototype-review/${n}`);if(t.status===410)throw new m("expired","This feedback session has expired");if(t.status===404)throw new m("invalid","This review link is not valid");if(!t.ok)throw new m("error","Something went wrong");return(await t.json()).data}async function L(n,t){let e=await fetch(`${S}/v1/prototype-review/${n}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!e.ok)throw new m("error","Failed to submit comment");return(await e.json()).data}async function w(n){let t=await fetch(`${S}/v1/prototype-review/${n}/comments`);if(!t.ok)throw new m("error","Failed to load comments");return(await t.json()).data}var m=class extends Error{constructor(e,i){super(i);this.code=e;this.name="ReviewError"}};function $(n,t){let e=document.elementFromPoint(n,t),i=document.documentElement,o=(n+window.scrollX)/i.scrollWidth*100,s=(t+window.scrollY)/i.scrollHeight*100;if(!e||e===document.body||e===i)return{pinX:o,pinY:s,element:{selector:"body",tag:"body",text:"",ariaLabel:null,className:"",boundingBox:{x:0,y:0,w:i.scrollWidth,h:i.scrollHeight}},context:{parentTag:"",parentText:"",grandparentTag:"",siblings:[],nearbyText:""},viewportWidth:window.innerWidth,viewportHeight:window.innerHeight};let a=e.getBoundingClientRect();return{pinX:o,pinY:s,element:{selector:j(e),tag:e.tagName.toLowerCase(),text:b(e).slice(0,200),ariaLabel:e.getAttribute("aria-label"),className:e.className&&typeof e.className=="string"?e.className:"",boundingBox:{x:Math.round(a.x),y:Math.round(a.y),w:Math.round(a.width),h:Math.round(a.height)}},context:{parentTag:e.parentElement?`${e.parentElement.tagName.toLowerCase()}${R(e.parentElement)}`:"",parentText:e.parentElement?b(e.parentElement).slice(0,100):"",grandparentTag:e.parentElement?.parentElement?`${e.parentElement.parentElement.tagName.toLowerCase()}${R(e.parentElement.parentElement)}`:"",siblings:q(e),nearbyText:G(e).slice(0,200)},viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}}function j(n){let t=[],e=n;for(;e&&e!==document.body;){if(e.id){t.unshift(`#${e.id}`);break}let i=e.tagName.toLowerCase();if(e.className&&typeof e.className=="string"){let o=e.className.trim().split(/\s+/).slice(0,2).join(".");o&&(i+=`.${o}`)}t.unshift(i),e=e.parentElement}return t.join(" > ")}function b(n){let t="";for(let e of n.childNodes)e.nodeType===Node.TEXT_NODE&&(t+=e.textContent?.trim()||"");return t.trim()||n.textContent?.trim().slice(0,200)||""}function R(n){if(!n.className||typeof n.className!="string")return"";let t=n.className.trim().split(/\s+/).slice(0,2).join(".");return t?`.${t}`:""}function q(n){if(!n.parentElement)return[];let t=[];for(let e of n.parentElement.children){if(e===n)continue;let i=e.tagName.toLowerCase(),o=(e.textContent?.trim()||"").slice(0,50);if(t.push(o?`${i}:${o}`:i),t.length>=4)break}return t}function G(n){let t=n.parentElement,e=0;for(;t&&e<3;){let i=b(t);if(i&&i!==b(n))return i;t=t.parentElement,e++}return""}var D=`
2
2
  :host {
3
3
  all: initial;
4
4
  }
@@ -257,7 +257,7 @@
257
257
  transition-duration: 0.01ms !important;
258
258
  }
259
259
  }
260
- `,C=`
260
+ `,z=`
261
261
  body {
262
262
  position: relative !important;
263
263
  }
@@ -314,32 +314,25 @@ body {
314
314
  transition-duration: 0.01ms !important;
315
315
  }
316
316
  }
317
- `;var g="roadmaps-review-pin-styles",d=class{constructor(){r(this,"container");r(this,"pins",new Map);r(this,"styleEl",null);this.container=document.createElement("div"),this.container.className="pin-container"}mount(){document.getElementById(g)||(this.styleEl=document.createElement("style"),this.styleEl.id=g,this.styleEl.textContent=C,document.head.appendChild(this.styleEl)),document.body.appendChild(this.container)}addPin(e,t,i,o){let a=document.createElement("div");a.className=o?"review-pin":"review-pin review-pin--other",a.textContent=String(e),a.style.left=`${t}%`,a.style.top=`${i}%`,a.dataset.pinNumber=String(e),this.container.appendChild(a),this.pins.set(e,a)}removePin(e){let t=this.pins.get(e);t&&(t.remove(),this.pins.delete(e))}highlightPin(e){for(let[t,i]of this.pins)i.classList.toggle("review-pin--highlighted",t===e)}clearHighlight(){for(let e of this.pins.values())e.classList.remove("review-pin--highlighted")}destroy(){this.container.remove(),this.pins.clear(),this.styleEl?(this.styleEl.remove(),this.styleEl=null):document.getElementById(g)?.remove()}};var h=class{constructor(e){this.shadowRoot=e;r(this,"card",null);r(this,"onSubmit",null);r(this,"onCancel",null)}show(e){this.hide(),this.onSubmit=e.onSubmit,this.onCancel=e.onCancel,this.card=document.createElement("div"),this.card.className="review-comment-card",this.card.style.left=`${Math.min(e.x,window.innerWidth-320)}px`,this.card.style.top=`${Math.min(e.y+20,window.innerHeight-200)}px`,this.card.innerHTML=`
317
+ `;var M="roadmaps-review-pin-styles",u=class{constructor(){r(this,"container");r(this,"pins",new Map);r(this,"styleEl",null);this.container=document.createElement("div"),this.container.className="pin-container"}mount(){document.getElementById(M)||(this.styleEl=document.createElement("style"),this.styleEl.id=M,this.styleEl.textContent=z,document.head.appendChild(this.styleEl)),document.body.appendChild(this.container)}addPin(t,e,i,o,s){let a=document.createElement("div");a.className=o?"review-pin":"review-pin review-pin--other",a.textContent=String(t),a.style.left=`${e}%`,a.style.top=`${i}%`,a.dataset.pinNumber=String(t),a.dataset.pageUrl=s,this.container.appendChild(a),this.pins.set(t,{el:a,pageUrl:s})}removePin(t){let e=this.pins.get(t);e&&(e.el.remove(),this.pins.delete(t))}highlightPin(t){for(let[e,{el:i}]of this.pins)i.classList.toggle("review-pin--highlighted",e===t)}clearHighlight(){for(let{el:t}of this.pins.values())t.classList.remove("review-pin--highlighted")}filterByPage(t){for(let{el:e,pageUrl:i}of this.pins.values())e.style.display=i===t?"":"none"}showAll(){for(let{el:t}of this.pins.values())t.style.display=""}countForPage(t){let e=0;for(let{pageUrl:i}of this.pins.values())i===t&&e++;return e}destroy(){this.container.remove(),this.pins.clear(),this.styleEl?(this.styleEl.remove(),this.styleEl=null):document.getElementById(M)?.remove()}};var x=class{constructor(t){this.shadowRoot=t;r(this,"card",null);r(this,"onSubmit",null);r(this,"onCancel",null)}show(t){this.hide(),this.onSubmit=t.onSubmit,this.onCancel=t.onCancel,this.card=document.createElement("div"),this.card.className="review-comment-card",this.card.style.left=`${Math.min(t.x,window.innerWidth-320)}px`,this.card.style.top=`${Math.min(t.y+20,window.innerHeight-200)}px`,this.card.innerHTML=`
318
318
  <textarea class="review-comment-input" placeholder="Leave your feedback..." rows="3"></textarea>
319
319
  <div class="review-comment-actions">
320
320
  <button class="review-btn review-btn--cancel">Cancel</button>
321
321
  <button class="review-btn review-btn--submit">Submit</button>
322
322
  </div>
323
323
  <div class="review-comment-error" style="display:none"></div>
324
- `,this.attachListeners(),this.shadowRoot.appendChild(this.card),this.card.querySelector("textarea")?.focus()}hide(){this.card?.remove(),this.card=null}showForGeneral(e){this.show({x:window.innerWidth/2-150,y:window.innerHeight/2-100,onSubmit:e.onSubmit,onCancel:e.onCancel})}attachListeners(){this.card&&(this.card.querySelector(".review-btn--cancel")?.addEventListener("click",()=>{this.onCancel?.(),this.hide()}),this.card.querySelector(".review-btn--submit")?.addEventListener("click",()=>this.handleSubmit()),this.card.querySelector("textarea")?.addEventListener("keydown",e=>{(e.metaKey||e.ctrlKey)&&e.key==="Enter"&&(e.preventDefault(),this.handleSubmit())}))}async handleSubmit(){if(!this.card)return;let e=this.card.querySelector("textarea"),t=e.value.trim();if(!t)return;let i=this.card.querySelector(".review-btn--submit"),o=this.card.querySelector(".review-comment-error");i.disabled=!0,i.textContent="Submitting...",e.disabled=!0,o.style.display="none";try{await this.onSubmit?.(t),this.hide()}catch(a){i.disabled=!1,i.textContent="Submit",e.disabled=!1,o.textContent=a instanceof Error?a.message:"Failed to submit",o.style.display="block"}}};var u=class{constructor(e,t,i){this.token=e;this.shadowRoot=t;this.initData=i;r(this,"pinManager");r(this,"commentCard");r(this,"nextPinNumber");r(this,"pendingPinNumber",null);r(this,"promptEl",null);r(this,"toolbarEl",null);r(this,"clickHandler",null);this.pinManager=new d,this.commentCard=new h(t),this.nextPinNumber=i.nextPinNumber}async init(){document.body.style.cursor="crosshair",this.pinManager.mount(),this.showPrompt(),this.renderToolbar(),await this.loadExistingPins(),this.clickHandler=e=>this.handleClick(e),document.addEventListener("click",this.clickHandler,!0)}showPrompt(){this.promptEl=document.createElement("div"),this.promptEl.className="review-prompt",this.promptEl.innerHTML=`
324
+ `,this.attachListeners(),this.shadowRoot.appendChild(this.card),this.card.querySelector("textarea")?.focus()}hide(){this.card?.remove(),this.card=null}showForGeneral(t){this.show({x:window.innerWidth/2-150,y:window.innerHeight/2-100,onSubmit:t.onSubmit,onCancel:t.onCancel})}attachListeners(){this.card&&(this.card.querySelector(".review-btn--cancel")?.addEventListener("click",()=>{this.onCancel?.(),this.hide()}),this.card.querySelector(".review-btn--submit")?.addEventListener("click",()=>this.handleSubmit()),this.card.querySelector("textarea")?.addEventListener("keydown",t=>{(t.metaKey||t.ctrlKey)&&t.key==="Enter"&&(t.preventDefault(),this.handleSubmit())}))}async handleSubmit(){if(!this.card)return;let t=this.card.querySelector("textarea"),e=t.value.trim();if(!e)return;let i=this.card.querySelector(".review-btn--submit"),o=this.card.querySelector(".review-comment-error");i.disabled=!0,i.textContent="Submitting...",t.disabled=!0,o.style.display="none";try{await this.onSubmit?.(e),this.hide()}catch(s){i.disabled=!1,i.textContent="Submit",t.disabled=!1,o.textContent=s instanceof Error?s.message:"Failed to submit",o.style.display="block"}}};function d(){return window.location.pathname+window.location.search+window.location.hash}var g=class{constructor(t){this.onChange=t;r(this,"popstateHandler",null);r(this,"hashchangeHandler",null);r(this,"originalPushState",null);r(this,"originalReplaceState",null);r(this,"lastPageId");this.lastPageId=d()}start(){if(this.originalPushState)return;let t=()=>{let e=d();e!==this.lastPageId&&(this.lastPageId=e,this.onChange(e))};this.popstateHandler=t,window.addEventListener("popstate",this.popstateHandler),this.hashchangeHandler=t,window.addEventListener("hashchange",this.hashchangeHandler),this.originalPushState=history.pushState.bind(history),this.originalReplaceState=history.replaceState.bind(history),history.pushState=(...e)=>{this.originalPushState(...e),t()},history.replaceState=(...e)=>{this.originalReplaceState(...e),t()}}destroy(){this.popstateHandler&&window.removeEventListener("popstate",this.popstateHandler),this.hashchangeHandler&&window.removeEventListener("hashchange",this.hashchangeHandler),this.originalPushState&&(history.pushState=this.originalPushState),this.originalReplaceState&&(history.replaceState=this.originalReplaceState)}};var y=class{constructor(t,e,i){this.token=t;this.shadowRoot=e;this.initData=i;r(this,"pinManager");r(this,"commentCard");r(this,"nextPinNumber");r(this,"pendingPinNumber",null);r(this,"promptEl",null);r(this,"toolbarEl",null);r(this,"clickHandler",null);r(this,"pageListener",null);this.pinManager=new u,this.commentCard=new x(e),this.nextPinNumber=i.nextPinNumber}async init(){document.body.style.cursor="crosshair",this.pinManager.mount(),this.showPrompt(),this.renderToolbar(),await this.loadExistingPins(),this.pinManager.filterByPage(d()),this.pageListener=new g(t=>{this.pinManager.filterByPage(t)}),this.pageListener.start(),this.clickHandler=t=>this.handleClick(t),document.addEventListener("click",this.clickHandler,!0)}showPrompt(){this.promptEl=document.createElement("div"),this.promptEl.className="review-prompt",this.promptEl.innerHTML=`
325
325
  <h3 style="margin:0 0 8px;font-size:16px;">Click anywhere to leave feedback</h3>
326
326
  <p style="margin:0;color:#666;font-size:14px;">Drop numbered pins on elements you want to comment on</p>
327
- `,this.shadowRoot.appendChild(this.promptEl),setTimeout(()=>this.dismissPrompt(),5e3)}dismissPrompt(){this.promptEl&&(this.promptEl.remove(),this.promptEl=null)}renderToolbar(){this.toolbarEl=document.createElement("div"),this.toolbarEl.className="review-toolbar",this.updateToolbar(),this.shadowRoot.appendChild(this.toolbarEl)}updateToolbar(){if(!this.toolbarEl)return;let e=this.nextPinNumber-1;this.toolbarEl.innerHTML=`
327
+ `,this.shadowRoot.appendChild(this.promptEl),setTimeout(()=>this.dismissPrompt(),5e3)}dismissPrompt(){this.promptEl&&(this.promptEl.remove(),this.promptEl=null)}renderToolbar(){this.toolbarEl=document.createElement("div"),this.toolbarEl.className="review-toolbar",this.updateToolbar(),this.shadowRoot.appendChild(this.toolbarEl)}updateToolbar(){if(!this.toolbarEl)return;let t=this.nextPinNumber-1;this.toolbarEl.innerHTML=`
328
328
  <span style="font-weight:500;">${this.initData.session.name}</span>
329
- <span style="opacity:0.7;">${e} pin${e!==1?"s":""}</span>
329
+ <span style="opacity:0.7;">${t} pin${t!==1?"s":""}</span>
330
330
  <button class="review-btn review-btn--submit" style="margin-left:auto;padding:6px 12px;font-size:13px;">General Comment</button>
331
- `,this.toolbarEl.querySelector("button")?.addEventListener("click",t=>{t.stopPropagation(),this.handleGeneralComment()})}async loadExistingPins(){try{let e=await m(this.token);for(let t of e)if(t.pinNumber!=null&&t.pinData){let i=t.commentText!=null;this.pinManager.addPin(t.pinNumber,t.pinData.pinX,t.pinData.pinY,i)}}catch{}}handleClick(e){if(e.composedPath().some(a=>a instanceof HTMLElement&&a.closest?.("#ourroadmaps-review"))||this.pendingPinNumber!=null)return;this.dismissPrompt();let i=E(e.clientX,e.clientY),o=this.nextPinNumber;this.pinManager.addPin(o,i.pinX,i.pinY,!0),this.pendingPinNumber=o,this.commentCard.show({x:e.clientX,y:e.clientY,onSubmit:async a=>{await x(this.token,{commentText:a,pinNumber:o,pinData:i,pageUrl:window.location.pathname}),this.pendingPinNumber=null,this.nextPinNumber++,this.updateToolbar(),this.showToast("Comment saved")},onCancel:()=>{this.pinManager.removePin(o),this.pendingPinNumber=null}}),e.preventDefault(),e.stopPropagation()}handleGeneralComment(){this.pendingPinNumber==null&&this.commentCard.showForGeneral({onSubmit:async e=>{await x(this.token,{commentText:e,pinNumber:null,pinData:null,pageUrl:window.location.pathname}),this.showToast("Comment saved")},onCancel:()=>{}})}showToast(e){let t=document.createElement("div");t.className="review-toast",t.textContent=e,this.shadowRoot.appendChild(t),setTimeout(()=>t.remove(),2500)}destroy(){document.body.style.cursor="",this.clickHandler&&document.removeEventListener("click",this.clickHandler,!0),this.dismissPrompt(),this.toolbarEl?.remove(),this.commentCard.hide(),this.pinManager.destroy()}};var v=class{constructor(e,t){this.token=e;this.shadowRoot=t;r(this,"pinManager");r(this,"toolbarEl",null);r(this,"tooltipEl",null);r(this,"comments",[]);r(this,"pinClickHandler",null);this.pinManager=new d}async init(){this.pinManager.mount();try{this.comments=await m(this.token);for(let e of this.comments)e.pinNumber!=null&&e.pinData&&this.pinManager.addPin(e.pinNumber,e.pinData.pinX,e.pinData.pinY,!0)}catch{}this.renderToolbar(),this.pinClickHandler=e=>{let t=e.target;if(t.classList?.contains("review-pin")){let i=Number(t.dataset.pinNumber);i&&this.handlePinClick(i,e)}},document.addEventListener("click",this.pinClickHandler,!0)}renderToolbar(){this.toolbarEl=document.createElement("div"),this.toolbarEl.className="review-toolbar";let e=this.comments.filter(t=>t.pinNumber!=null).length;this.toolbarEl.innerHTML=`
332
- <span style="font-weight:500;">Triage Mode</span>
333
- <span style="opacity:0.7;">${e} pin${e!==1?"s":""}</span>
334
- `,this.shadowRoot.appendChild(this.toolbarEl)}handlePinClick(e,t){this.hideTooltip(),this.pinManager.highlightPin(e);let i=this.comments.find(l=>l.pinNumber===e);if(!i)return;this.tooltipEl=document.createElement("div"),this.tooltipEl.className="review-tooltip";let o=new Date(i.createdAt).toLocaleString();this.tooltipEl.innerHTML=`
335
- <div style="font-weight:500;margin-bottom:4px;">Pin #${e}</div>
336
- <div style="margin-bottom:4px;">${i.commentText||"(no text)"}</div>
337
- <div style="font-size:11px;opacity:0.7;">${o}</div>
338
- `,this.tooltipEl.style.position="fixed",this.tooltipEl.style.left=`${Math.min(t.clientX+16,window.innerWidth-300)}px`,this.tooltipEl.style.top=`${Math.min(t.clientY-10,window.innerHeight-150)}px`,this.shadowRoot.appendChild(this.tooltipEl);let a=l=>{l.target!==this.tooltipEl&&!this.tooltipEl?.contains(l.target)&&(this.hideTooltip(),this.pinManager.clearHighlight(),document.removeEventListener("click",a,!0))};setTimeout(()=>document.addEventListener("click",a,!0),0)}hideTooltip(){this.tooltipEl?.remove(),this.tooltipEl=null}destroy(){this.pinClickHandler&&document.removeEventListener("click",this.pinClickHandler,!0),this.hideTooltip(),this.toolbarEl?.remove(),this.pinManager.destroy()}};var f=class{constructor(e={}){r(this,"root");r(this,"shadow");r(this,"mode",null);r(this,"_isDestroyed",!1);this.root=document.createElement("div"),this.root.id="ourroadmaps-review",this.shadow=this.root.attachShadow({mode:"open"});let t=document.createElement("style");t.textContent=T,this.shadow.appendChild(t),document.body.appendChild(this.root)}async init(){let e=new URLSearchParams(window.location.search),t=e.get("review"),i=e.get("triage");if(t)try{let o=await w(t);this.mode=new u(t,this.shadow,o),await this.mode.init()}catch(o){o instanceof s&&this.showErrorOverlay(o.code==="expired"?"This feedback session has expired":"This review link is no longer valid")}else if(i)try{await w(i),this.mode=new v(i,this.shadow),await this.mode.init()}catch(o){o instanceof s&&this.showErrorOverlay(o.code==="expired"?"This feedback session has expired":"This review link is no longer valid")}}showErrorOverlay(e){let t=document.createElement("div");t.className="review-expired-overlay",t.innerHTML=`
331
+ `,this.toolbarEl.querySelector("button")?.addEventListener("click",e=>{e.stopPropagation(),this.handleGeneralComment()})}async loadExistingPins(){try{let t=await w(this.token);for(let e of t)if(e.pinNumber!=null&&e.pinData){let i=e.commentText!=null;this.pinManager.addPin(e.pinNumber,e.pinData.pinX,e.pinData.pinY,i,e.pageUrl??"")}}catch{}}handleClick(t){if(t.composedPath().some(s=>s instanceof HTMLElement&&s.closest?.("#ourroadmaps-review"))||this.pendingPinNumber!=null)return;this.dismissPrompt();let i=$(t.clientX,t.clientY),o=this.nextPinNumber;this.pinManager.addPin(o,i.pinX,i.pinY,!0,d()),this.pendingPinNumber=o,this.commentCard.show({x:t.clientX,y:t.clientY,onSubmit:async s=>{await L(this.token,{commentText:s,pinNumber:o,pinData:i,pageUrl:d()}),this.pendingPinNumber=null,this.nextPinNumber++,this.updateToolbar(),this.showToast("Comment saved")},onCancel:()=>{this.pinManager.removePin(o),this.pendingPinNumber=null}}),t.preventDefault(),t.stopPropagation()}handleGeneralComment(){this.pendingPinNumber==null&&this.commentCard.showForGeneral({onSubmit:async t=>{await L(this.token,{commentText:t,pinNumber:null,pinData:null,pageUrl:d()}),this.showToast("Comment saved")},onCancel:()=>{}})}showToast(t){let e=document.createElement("div");e.className="review-toast",e.textContent=t,this.shadowRoot.appendChild(e),setTimeout(()=>e.remove(),2500)}destroy(){document.body.style.cursor="",this.clickHandler&&document.removeEventListener("click",this.clickHandler,!0),this.pageListener?.destroy(),this.dismissPrompt(),this.toolbarEl?.remove(),this.commentCard.hide(),this.pinManager.destroy()}};var J="ourroadmaps:token";function N(){try{sessionStorage.removeItem(J)}catch{}}var E=class{constructor(t,e){this.token=t;this.shadowRoot=e;r(this,"pinManager");r(this,"toolbarEl",null);r(this,"tooltipEl",null);r(this,"comments",[]);r(this,"pinClickHandler",null);r(this,"pageListener",null);r(this,"showAllPages",!1);this.pinManager=new u}async init(){this.pinManager.mount();try{this.comments=await w(this.token);for(let t of this.comments)t.pinNumber!=null&&t.pinData&&this.pinManager.addPin(t.pinNumber,t.pinData.pinX,t.pinData.pinY,!0,t.pageUrl??"")}catch{}this.pinManager.filterByPage(d()),this.renderToolbar(),this.pageListener=new g(t=>{this.showAllPages||this.pinManager.filterByPage(t),this.updateToolbar()}),this.pageListener.start(),this.pinClickHandler=t=>{let e=t.target;if(e.classList?.contains("review-pin")){let i=Number(e.dataset.pinNumber);i&&this.handlePinClick(i,t)}},document.addEventListener("click",this.pinClickHandler,!0),this.autoFocusPin()}renderToolbar(){this.toolbarEl=document.createElement("div"),this.toolbarEl.className="review-toolbar",this.updateToolbar(),this.shadowRoot.appendChild(this.toolbarEl)}updateToolbar(){if(!this.toolbarEl)return;let t=this.comments.filter(l=>l.pinNumber!=null).length,e=d(),i=this.pinManager.countForPage(e),o=new URL(e,window.location.origin),s=o.hash?`${o.pathname}${o.hash.split("?")[0]}`:o.pathname||"/";this.toolbarEl.innerHTML="";let a=document.createElement("span");a.style.fontWeight="500",a.textContent="Triage Mode",this.toolbarEl.appendChild(a);let h=document.createElement("span");h.style.opacity="0.7",this.showAllPages?h.textContent=`${t} pin${t!==1?"s":""}`:h.textContent=`${i} pin${i!==1?"s":""} on ${s} (${t} total)`,this.toolbarEl.appendChild(h);let c=document.createElement("button");c.className="review-btn review-btn--submit",c.style.cssText="margin-left:auto;padding:6px 12px;font-size:13px;",c.textContent=this.showAllPages?"This page":"All pages",c.addEventListener("click",l=>{l.stopPropagation(),this.togglePageFilter()}),this.toolbarEl.appendChild(c)}togglePageFilter(){this.showAllPages=!this.showAllPages,this.showAllPages?this.pinManager.showAll():this.pinManager.filterByPage(d()),this.updateToolbar()}handlePinClick(t,e){this.hideTooltip(),this.pinManager.highlightPin(t),this.showTooltipForPin(t,e.clientX+16,e.clientY-10)}showTooltipForPin(t,e,i){this.hideTooltip();let o=this.comments.find(p=>p.pinNumber===t);if(!o)return;this.tooltipEl=document.createElement("div"),this.tooltipEl.className="review-tooltip";let s=new Date(o.createdAt).toLocaleString(),a=document.createElement("div");if(a.style.cssText="font-weight:500;margin-bottom:4px;",a.textContent=`Pin #${t}`,this.tooltipEl.appendChild(a),o.reviewerName){let p=document.createElement("div");p.style.cssText="font-size:11px;opacity:0.7;margin-bottom:2px;",p.textContent=o.reviewerName,this.tooltipEl.appendChild(p)}let h=document.createElement("div");h.style.cssText="margin-bottom:4px;",h.textContent=o.commentText||"(no text)",this.tooltipEl.appendChild(h);let c=document.createElement("div");c.style.cssText="font-size:11px;opacity:0.7;",c.textContent=s,this.tooltipEl.appendChild(c);let l=o.pageUrl??"";if(l&&l!==d()){let p=document.createElement("div");p.style.cssText="margin-top:6px;padding-top:6px;border-top:1px solid rgba(255,255,255,0.2);font-size:12px;";let C=document.createElement("span");C.style.opacity="0.7",C.textContent=`Page: ${l.split("?")[0].split("#")[0]||"/"} \u2014 `,p.appendChild(C);let f=document.createElement("a");f.style.cssText="color:#a78bfa;cursor:pointer;text-decoration:underline;pointer-events:auto;",f.textContent="Navigate there?",f.addEventListener("click",U=>{U.stopPropagation(),this.navigateToPin(l,t)}),p.appendChild(f),this.tooltipEl.appendChild(p),this.tooltipEl.style.pointerEvents="auto"}let T=e??window.innerWidth/2,I=i??window.innerHeight/3;this.tooltipEl.style.position="fixed",this.tooltipEl.style.left=`${Math.min(T,window.innerWidth-300)}px`,this.tooltipEl.style.top=`${Math.min(I,window.innerHeight-150)}px`,this.shadowRoot.appendChild(this.tooltipEl);let H=p=>{p.target!==this.tooltipEl&&!this.tooltipEl?.contains(p.target)&&(this.hideTooltip(),this.pinManager.clearHighlight(),document.removeEventListener("click",H,!0))};setTimeout(()=>document.addEventListener("click",H,!0),0)}navigateToPin(t,e){this.hideTooltip(),this.pinManager.clearHighlight();let i=new URL(t,window.location.origin);i.searchParams.set("pin",String(e)),window.location.href=i.toString()}autoFocusPin(){let e=new URLSearchParams(window.location.search).get("pin");if(!e)return;let i=Number(e);if(!i)return;let o=this.comments.find(l=>l.pinNumber===i);if(!o?.pinData)return;let s=o.pageUrl??"";if(s){let l=new URL(window.location.href);l.searchParams.delete("pin");let T=l.pathname+l.search+l.hash;if(s!==T){this.navigateToPin(s,i);return}}this.pinManager.showAll(),this.showAllPages=!0,this.updateToolbar();let a=document.documentElement,h=o.pinData.pinX/100*a.scrollWidth,c=o.pinData.pinY/100*a.scrollHeight;window.scrollTo({left:h-window.innerWidth/2,top:c-window.innerHeight/2,behavior:"smooth"}),setTimeout(()=>{this.pinManager.highlightPin(i),this.showTooltipForPin(i)},500)}hideTooltip(){this.tooltipEl?.remove(),this.tooltipEl=null}destroy(){this.pinClickHandler&&document.removeEventListener("click",this.pinClickHandler,!0),this.pageListener?.destroy(),this.hideTooltip(),this.toolbarEl?.remove(),this.pinManager.destroy()}};var P=class{constructor(t={}){r(this,"root");r(this,"shadow");r(this,"mode",null);r(this,"_isDestroyed",!1);this.root=document.createElement("div"),this.root.id="ourroadmaps-review",this.shadow=this.root.attachShadow({mode:"open"});let e=document.createElement("style");e.textContent=D,this.shadow.appendChild(e),document.body.appendChild(this.root)}async init(t,e){if(t==="review")try{let i=await k(e);this.mode=new y(e,this.shadow,i),await this.mode.init()}catch(i){i instanceof m&&(N(),this.showErrorOverlay(i.code==="expired"?"This feedback session has expired":"This review link is no longer valid"))}else if(t==="triage")try{await k(e),this.mode=new E(e,this.shadow),await this.mode.init()}catch(i){i instanceof m&&(N(),this.showErrorOverlay(i.code==="expired"?"This feedback session has expired":"This review link is no longer valid"))}}showErrorOverlay(t){let e=document.createElement("div");e.className="review-expired-overlay",e.innerHTML=`
339
332
  <div class="review-expired-card">
340
333
  <h2 style="margin:0 0 8px;font-size:18px;">Session Unavailable</h2>
341
- <p style="margin:0;color:#666;font-size:14px;">${e}</p>
334
+ <p style="margin:0;color:#666;font-size:14px;">${t}</p>
342
335
  <p style="margin:12px 0 0;color:#999;font-size:13px;">Contact the prototype owner for a new link.</p>
343
336
  </div>
344
- `,this.shadow.appendChild(t),document.body.style.filter="grayscale(0.8)"}destroy(){this._isDestroyed||(this._isDestroyed=!0,this.mode?.destroy(),this.root.remove(),document.body.style.filter="")}};return H(_);})();
337
+ `,this.shadow.appendChild(e),document.body.style.filter="grayscale(0.8)"}destroy(){this._isDestroyed||(this._isDestroyed=!0,this.mode?.destroy(),this.root.remove(),document.body.style.filter="")}};return W(K);})();
345
338
  //# sourceMappingURL=review.global.js.map