@verdocs/web-sdk 6.8.5 → 6.8.7

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.
Files changed (152) hide show
  1. package/dist/cjs/index-CQ5bTnED.js +14 -6
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/verdocs-build.cjs.entry.js +4 -2
  4. package/dist/cjs/verdocs-build.entry.cjs.js.map +1 -1
  5. package/dist/cjs/{verdocs-button-panel_2.cjs.entry.js → verdocs-button-panel.cjs.entry.js} +1 -27
  6. package/dist/cjs/verdocs-button-panel.entry.cjs.js.map +1 -0
  7. package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +2 -2
  8. package/dist/cjs/verdocs-envelope-sidebar.entry.cjs.js.map +1 -1
  9. package/dist/cjs/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.cjs.js.map +1 -0
  10. package/dist/cjs/{verdocs-preview_7.cjs.entry.js → verdocs-preview_6.cjs.entry.js} +35 -194
  11. package/dist/cjs/verdocs-tabs.cjs.entry.js +31 -0
  12. package/dist/cjs/verdocs-tabs.entry.cjs.js.map +1 -0
  13. package/dist/cjs/verdocs-template-settings.cjs.entry.js +150 -0
  14. package/dist/cjs/verdocs-template-settings.entry.cjs.js.map +1 -0
  15. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  16. package/dist/collection/components/embeds/verdocs-build/verdocs-build.css +4 -0
  17. package/dist/collection/components/embeds/verdocs-build/verdocs-build.js +5 -3
  18. package/dist/collection/components/embeds/verdocs-build/verdocs-build.js.map +1 -1
  19. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.css +8 -0
  20. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +1 -1
  21. package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js.map +1 -1
  22. package/dist/collection/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.css +41 -49
  23. package/dist/collection/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.js +25 -45
  24. package/dist/collection/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.js.map +1 -1
  25. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +11 -36
  26. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js.map +1 -1
  27. package/dist/components/{p-BYDdRCru.js → p-_cxVjdiK.js} +11 -11
  28. package/dist/components/p-_cxVjdiK.js.map +1 -0
  29. package/dist/components/p-eZKhg-2i.js +156 -0
  30. package/dist/components/p-eZKhg-2i.js.map +1 -0
  31. package/dist/components/verdocs-build.js +72 -94
  32. package/dist/components/verdocs-build.js.map +1 -1
  33. package/dist/components/verdocs-button-panel.js +98 -1
  34. package/dist/components/verdocs-button-panel.js.map +1 -1
  35. package/dist/components/verdocs-envelope-sidebar.js +2 -2
  36. package/dist/components/verdocs-envelope-sidebar.js.map +1 -1
  37. package/dist/components/verdocs-tabs.js +45 -1
  38. package/dist/components/verdocs-tabs.js.map +1 -1
  39. package/dist/components/verdocs-template-build-tabs.js +1 -1
  40. package/dist/components/verdocs-template-fields.js +1 -1
  41. package/dist/components/verdocs-template-settings.js +215 -1
  42. package/dist/components/verdocs-template-settings.js.map +1 -1
  43. package/dist/custom-elements.json +0 -6
  44. package/dist/esm/index-BIRwgFLv.js +14 -6
  45. package/dist/esm/loader.js +1 -1
  46. package/dist/esm/verdocs-build.entry.js +4 -2
  47. package/dist/esm/verdocs-build.entry.js.map +1 -1
  48. package/dist/{components/p-rboJNAPD.js → esm/verdocs-button-panel.entry.js} +9 -32
  49. package/dist/esm/verdocs-button-panel.entry.js.map +1 -0
  50. package/dist/esm/verdocs-envelope-sidebar.entry.js +2 -2
  51. package/dist/esm/verdocs-envelope-sidebar.entry.js.map +1 -1
  52. package/dist/esm/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.js.map +1 -0
  53. package/dist/esm/{verdocs-preview_7.entry.js → verdocs-preview_6.entry.js} +37 -195
  54. package/dist/{components/p-e7e4Os6T.js → esm/verdocs-tabs.entry.js} +8 -29
  55. package/dist/esm/verdocs-tabs.entry.js.map +1 -0
  56. package/dist/{components/p-Cp7g7TMK.js → esm/verdocs-template-settings.entry.js} +12 -84
  57. package/dist/esm/verdocs-template-settings.entry.js.map +1 -0
  58. package/dist/esm/verdocs-web-sdk.js +1 -1
  59. package/dist/esm-es5/index-BIRwgFLv.js +1 -1
  60. package/dist/esm-es5/loader.js +1 -1
  61. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  62. package/dist/esm-es5/verdocs-build.entry.js.map +1 -1
  63. package/dist/esm-es5/verdocs-button-panel.entry.js +2 -0
  64. package/dist/esm-es5/verdocs-button-panel.entry.js.map +1 -0
  65. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
  66. package/dist/esm-es5/verdocs-envelope-sidebar.entry.js.map +1 -1
  67. package/dist/esm-es5/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.js.map +1 -0
  68. package/dist/esm-es5/verdocs-preview_6.entry.js +8 -0
  69. package/dist/esm-es5/verdocs-preview_6.entry.js.map +1 -0
  70. package/dist/esm-es5/verdocs-tabs.entry.js +2 -0
  71. package/dist/esm-es5/verdocs-tabs.entry.js.map +1 -0
  72. package/dist/esm-es5/verdocs-template-settings.entry.js +2 -0
  73. package/dist/esm-es5/verdocs-template-settings.entry.js.map +1 -0
  74. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  75. package/dist/types/components/embeds/verdocs-build/verdocs-build.d.ts +1 -1
  76. package/dist/types/components/templates/verdocs-template-build-tabs/verdocs-template-build-tabs.d.ts +8 -3
  77. package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.d.ts +2 -8
  78. package/dist/types/components.d.ts +2 -4
  79. package/dist/verdocs-web-sdk/p-069169a7.entry.js +2 -0
  80. package/dist/verdocs-web-sdk/{p-5340c596.entry.js.map → p-069169a7.entry.js.map} +1 -1
  81. package/dist/verdocs-web-sdk/p-0fcfde01.entry.js +8 -0
  82. package/dist/verdocs-web-sdk/p-0fcfde01.entry.js.map +1 -0
  83. package/dist/verdocs-web-sdk/p-267c890e.entry.js +2 -0
  84. package/dist/verdocs-web-sdk/p-267c890e.entry.js.map +1 -0
  85. package/dist/verdocs-web-sdk/p-2e4d6431.system.entry.js +8 -0
  86. package/dist/verdocs-web-sdk/p-2e4d6431.system.entry.js.map +1 -0
  87. package/dist/verdocs-web-sdk/p-2fc50938.system.entry.js +2 -0
  88. package/dist/verdocs-web-sdk/{p-49cd823f.system.entry.js.map → p-2fc50938.system.entry.js.map} +1 -1
  89. package/dist/verdocs-web-sdk/p-39b03469.entry.js +2 -0
  90. package/dist/verdocs-web-sdk/p-39b03469.entry.js.map +1 -0
  91. package/dist/verdocs-web-sdk/p-5ee3ef82.entry.js +2 -0
  92. package/dist/verdocs-web-sdk/{p-da28bd7d.entry.js.map → p-5ee3ef82.entry.js.map} +1 -1
  93. package/dist/verdocs-web-sdk/p-8229308e.system.entry.js +2 -0
  94. package/dist/verdocs-web-sdk/{p-e65af831.system.entry.js.map → p-8229308e.system.entry.js.map} +1 -1
  95. package/dist/verdocs-web-sdk/p-B8zpaHu-.system.js +1 -1
  96. package/dist/verdocs-web-sdk/p-Bb7iRsoQ.system.js.map +1 -0
  97. package/dist/verdocs-web-sdk/p-CCv1s4sj.system.js.map +1 -0
  98. package/dist/verdocs-web-sdk/p-D1RF_rpl.system.js.map +1 -0
  99. package/dist/verdocs-web-sdk/p-DFNdvv2j.system.js.map +1 -0
  100. package/dist/verdocs-web-sdk/p-DrBEr1CO.system.js.map +1 -0
  101. package/dist/verdocs-web-sdk/p-a06b40a9.system.entry.js +2 -0
  102. package/dist/verdocs-web-sdk/p-a06b40a9.system.entry.js.map +1 -0
  103. package/dist/verdocs-web-sdk/p-b04c507f.system.entry.js +2 -0
  104. package/dist/verdocs-web-sdk/p-b04c507f.system.entry.js.map +1 -0
  105. package/dist/verdocs-web-sdk/p-dde291ad.system.entry.js +2 -0
  106. package/dist/verdocs-web-sdk/p-dde291ad.system.entry.js.map +1 -0
  107. package/dist/verdocs-web-sdk/p-fd923850.entry.js +2 -0
  108. package/dist/verdocs-web-sdk/p-fd923850.entry.js.map +1 -0
  109. package/dist/verdocs-web-sdk/p-wKFmf5bX.system.js.map +1 -0
  110. package/dist/verdocs-web-sdk/verdocs-build.entry.esm.js.map +1 -1
  111. package/dist/verdocs-web-sdk/verdocs-button-panel.entry.esm.js.map +1 -0
  112. package/dist/verdocs-web-sdk/verdocs-envelope-sidebar.entry.esm.js.map +1 -1
  113. package/dist/verdocs-web-sdk/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.esm.js.map +1 -0
  114. package/dist/verdocs-web-sdk/verdocs-tabs.entry.esm.js.map +1 -0
  115. package/dist/verdocs-web-sdk/verdocs-template-settings.entry.esm.js.map +1 -0
  116. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  117. package/package.json +1 -1
  118. package/dist/cjs/verdocs-button-panel.verdocs-tabs.entry.cjs.js.map +0 -1
  119. package/dist/cjs/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.cjs.js.map +0 -1
  120. package/dist/components/p-BYDdRCru.js.map +0 -1
  121. package/dist/components/p-Cp7g7TMK.js.map +0 -1
  122. package/dist/components/p-e7e4Os6T.js.map +0 -1
  123. package/dist/components/p-hDK3S4nn.js +0 -188
  124. package/dist/components/p-hDK3S4nn.js.map +0 -1
  125. package/dist/components/p-rboJNAPD.js.map +0 -1
  126. package/dist/esm/verdocs-button-panel.verdocs-tabs.entry.js.map +0 -1
  127. package/dist/esm/verdocs-button-panel_2.entry.js +0 -105
  128. package/dist/esm/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.js.map +0 -1
  129. package/dist/esm-es5/verdocs-button-panel.verdocs-tabs.entry.js.map +0 -1
  130. package/dist/esm-es5/verdocs-button-panel_2.entry.js +0 -2
  131. package/dist/esm-es5/verdocs-button-panel_2.entry.js.map +0 -1
  132. package/dist/esm-es5/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.js.map +0 -1
  133. package/dist/esm-es5/verdocs-preview_7.entry.js +0 -8
  134. package/dist/esm-es5/verdocs-preview_7.entry.js.map +0 -1
  135. package/dist/verdocs-web-sdk/p-07bd9f14.entry.js +0 -2
  136. package/dist/verdocs-web-sdk/p-07bd9f14.entry.js.map +0 -1
  137. package/dist/verdocs-web-sdk/p-49cd823f.system.entry.js +0 -2
  138. package/dist/verdocs-web-sdk/p-5340c596.entry.js +0 -2
  139. package/dist/verdocs-web-sdk/p-5bc00fc6.entry.js +0 -8
  140. package/dist/verdocs-web-sdk/p-5bc00fc6.entry.js.map +0 -1
  141. package/dist/verdocs-web-sdk/p-BZv_Bu9M.system.js.map +0 -1
  142. package/dist/verdocs-web-sdk/p-CEiXLEdr.system.js.map +0 -1
  143. package/dist/verdocs-web-sdk/p-DEv3ZZhp.system.js.map +0 -1
  144. package/dist/verdocs-web-sdk/p-DGOssAS4.system.js.map +0 -1
  145. package/dist/verdocs-web-sdk/p-acf58947.system.entry.js +0 -8
  146. package/dist/verdocs-web-sdk/p-acf58947.system.entry.js.map +0 -1
  147. package/dist/verdocs-web-sdk/p-da28bd7d.entry.js +0 -2
  148. package/dist/verdocs-web-sdk/p-e3075674.system.entry.js +0 -2
  149. package/dist/verdocs-web-sdk/p-e3075674.system.entry.js.map +0 -1
  150. package/dist/verdocs-web-sdk/p-e65af831.system.entry.js +0 -2
  151. package/dist/verdocs-web-sdk/verdocs-button-panel.verdocs-tabs.entry.esm.js.map +0 -1
  152. package/dist/verdocs-web-sdk/verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.esm.js.map +0 -1
@@ -8,8 +8,8 @@ var Datastore = require('./Datastore-B-sxWSPD.js');
8
8
  var Environment = require('./Environment-3vWt0C1Q.js');
9
9
  var Toast = require('./Toast-BgG-6jAg.js');
10
10
  var Icons = require('./Icons-TVvtZ5iL.js');
11
- var index$2 = require('./index-CeUF44L9.js');
12
11
  var interact_min = require('./interact.min-BAnZvLwr.js');
12
+ require('./index-CeUF44L9.js');
13
13
  require('./Types-YJQtg77a.js');
14
14
  require('./_commonjsHelpers-BJu3ubxk.js');
15
15
 
@@ -523,11 +523,8 @@ const VerdocsTemplateAttachments = class {
523
523
  };
524
524
  VerdocsTemplateAttachments.style = verdocsTemplateAttachmentsCss;
525
525
 
526
- const verdocsTemplateBuildTabsCss = "verdocs-template-build-tabs{-ms-flex:1;flex:1;gap:15px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif)}verdocs-template-build-tabs verdocs-button-panel svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-build-tabs verdocs-template-attachments,verdocs-template-build-tabs verdocs-template-roles{margin:20px}verdocs-template-build-tabs verdocs-template-fields{border-top:1px solid #777777}verdocs-template-build-tabs verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-template-build-tabs verdocs-template-fields{width:100%}verdocs-template-build-tabs verdocs-preview{-ms-flex:1;flex:1}.template-details-panel .row{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:8px;margin:10px 0}.template-details-panel label{-ms-flex:0 0 70px;flex:0 0 70px}.template-details-panel .value{-ms-flex:1;flex:1;font-weight:300;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-details-panel .icon-button{cursor:pointer;opacity:0.8;-ms-flex:0;flex:0;width:18px;height:18px}.template-details-panel .icon-button svg{stroke:#000000;width:18px;height:18px}.template-details-panel .icon-button:hover{opacity:1}";
526
+ const verdocsTemplateBuildTabsCss = "verdocs-template-build-tabs{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end;-ms-flex:0 0 50px;flex:0 0 50px;width:100%;background:#ffffff;color:#72757d;border-bottom:1px solid #dddddd;-webkit-filter:drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));filter:drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif)}verdocs-template-build-tabs .tab{position:relative;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:50px;padding:0 4px;background:#e7e7e7;font-weight:700;font-size:12px;cursor:pointer}@media (min-width: 768px){verdocs-template-build-tabs .tab{padding:0 8px 0 24px;font-size:14px}}verdocs-template-build-tabs .tab svg{position:absolute;top:0;right:-19px;z-index:10;pointer-events:none;display:none}@media (min-width: 768px){verdocs-template-build-tabs .tab svg{display:block}}verdocs-template-build-tabs .tab.active{background:#ffffff;color:#707ae5}verdocs-template-build-tabs .tab.disabled{cursor:default;color:#d1d5db}";
527
527
 
528
- const HelpIcon = '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" fill="#5c6575"><path d="M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z"/></svg>';
529
- const CopyIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75" /></svg>`;
530
- const STEPS = ['attachments', 'roles', 'settings', 'fields', 'preview'];
531
528
  const VerdocsTemplateBuildTabs = class {
532
529
  constructor(hostRef) {
533
530
  index$1.registerInstance(this, hostRef);
@@ -594,28 +591,16 @@ const VerdocsTemplateBuildTabs = class {
594
591
  (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new errors.SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
595
592
  }
596
593
  }
597
- setStep(e) {
594
+ handleSelect(tab) {
598
595
  var _a;
599
- console.log('[BUILD_TABS] Selected step', e.detail.tab.id);
600
- e.stopPropagation();
601
- e.preventDefault();
602
- this.step = e.detail.tab.id;
603
- (_a = this.stepChanged) === null || _a === void 0 ? void 0 : _a.emit(e.detail.tab.id);
604
- }
605
- copyTemplateId() {
606
- navigator.clipboard
607
- .writeText(this.templateId)
608
- .then(() => {
609
- Toast.VerdocsToast('Template ID copied', { style: 'success', duration: 3000 });
610
- })
611
- .catch(e => {
612
- var _a;
613
- console.warn('[BUILD_TABS] Error copying to clipboard', e);
614
- (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(e);
615
- });
596
+ if (tab.disabled || tab.id === this.step) {
597
+ return;
598
+ }
599
+ this.step = tab.id;
600
+ (_a = this.stepChanged) === null || _a === void 0 ? void 0 : _a.emit(tab.id);
616
601
  }
617
602
  render() {
618
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
603
+ var _a, _b, _c;
619
604
  if (this.loading) {
620
605
  return (index$1.h(index$1.Host, null, index$1.h("verdocs-loader", null)));
621
606
  }
@@ -623,26 +608,23 @@ const VerdocsTemplateBuildTabs = class {
623
608
  return (index$1.h(index$1.Host, null, index$1.h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
624
609
  }
625
610
  const canEditRoles = (((_a = this.template) === null || _a === void 0 ? void 0 : _a.documents) || []).length > 0;
626
- let canEditFields = canEditRoles && (((_b = this.template) === null || _b === void 0 ? void 0 : _b.roles) || []).length > 0;
611
+ const canEditFields = canEditRoles && (((_b = this.template) === null || _b === void 0 ? void 0 : _b.roles) || []).length > 0;
627
612
  const canPreview = canEditFields && (((_c = this.template) === null || _c === void 0 ? void 0 : _c.fields) || []).length > 0;
628
- let selectedStepIndex = Math.max(STEPS.indexOf(this.step), 0);
629
- if (!canPreview && selectedStepIndex >= 4) {
630
- selectedStepIndex = 3;
631
- }
632
- if (!canEditFields && selectedStepIndex >= 3) {
633
- selectedStepIndex = 1;
634
- }
635
- if (!canEditRoles && selectedStepIndex >= 1) {
636
- selectedStepIndex = 0;
637
- }
638
- return (index$1.h(index$1.Host, null, index$1.h("verdocs-tabs", { onSelectTab: e => this.setStep(e), selectedTab: selectedStepIndex, tabs: [
639
- { id: 'attachments', disabled: false, label: 'Attachment(s)' },
640
- { id: 'roles', disabled: !canEditRoles, label: 'Roles' },
641
- { id: 'settings', disabled: !canEditFields, label: 'Settings' },
642
- { id: 'fields', disabled: !canEditFields, label: 'Fields' },
643
- { id: 'preview', disabled: !canPreview, label: 'Preview/Send' },
644
- ] }), this.templateId && (index$1.h("div", { class: "info" }, index$1.h("verdocs-button-panel", { icon: HelpIcon }, index$1.h("div", { class: "template-details-panel" }, index$1.h("h6", null, "Template Details"), index$1.h("div", { class: "row" }, index$1.h("label", null, "ID:"), index$1.h("div", { class: "value" }, this.templateId), index$1.h("div", { class: "icon-button", innerHTML: CopyIcon, onClick: () => this.copyTemplateId() })), index$1.h("div", { class: "row" }, index$1.h("label", null, "Name:"), index$1.h("div", { class: "value" }, (_d = this.template) === null || _d === void 0 ? void 0 : _d.name)), index$1.h("div", { class: "row" }, index$1.h("label", null, "Visibility:"), index$1.h("div", { class: "value" }, ((_e = this.template) === null || _e === void 0 ? void 0 : _e.is_public) ? 'Public' : ((_f = this.template) === null || _f === void 0 ? void 0 : _f.is_personal) ? 'Private' : 'Shared')), index$1.h("div", { class: "row" }, index$1.h("label", null, "Created:"), index$1.h("div", { class: "value" }, ((_g = this.template) === null || _g === void 0 ? void 0 : _g.counter) ? index$2.dateFnsExports.format(new Date((_h = this.template) === null || _h === void 0 ? void 0 : _h.created_at), 'P p') : '')), index$1.h("div", { class: "row" }, index$1.h("label", null, "Used:"), index$1.h("div", { class: "value" }, (_j = this.template) === null || _j === void 0 ? void 0 :
645
- _j.counter, " time(s)"))))))));
613
+ const tabs = [
614
+ { id: 'attachments', label: 'Attachments', disabled: false },
615
+ { id: 'roles', label: 'Workflow', disabled: !canEditRoles },
616
+ { id: 'fields', label: 'Fields', disabled: !canEditFields },
617
+ { id: 'preview', label: 'Preview & Send', disabled: !canPreview },
618
+ ];
619
+ return (index$1.h(index$1.Host, null, tabs.map(tab => {
620
+ const isActive = tab.id === this.step;
621
+ const classes = ['tab'];
622
+ if (isActive)
623
+ classes.push('active');
624
+ if (tab.disabled)
625
+ classes.push('disabled');
626
+ return (index$1.h("div", { class: classes.join(' '), onClick: () => this.handleSelect(tab) }, index$1.h("span", null, tab.label), index$1.h("svg", { "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", width: "19", height: "50", viewBox: "0 0 19 50" }, index$1.h("polygon", { points: "0,0 19,25 0,50", fill: isActive ? '#ffffff' : '#e7e7e7' }))));
627
+ })));
646
628
  }
647
629
  static get watchers() { return {
648
630
  "templateId": ["onTemplateIdChanged"],
@@ -662,7 +644,7 @@ const iconInitial = '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="
662
644
  // const iconTimestamp =
663
645
  // '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z"></path></svg>';
664
646
  const iconDropdown = '<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>';
665
- const iconAttachment = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" /></svg>';
647
+ const iconAttachment = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" /></svg>';
666
648
  const separator = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>';
667
649
  const menuOptions = [
668
650
  { id: 'signature', tooltip: 'Signature', icon: iconSignature, class: 'signature' },
@@ -684,7 +666,6 @@ const VerdocsTemplateFields = class {
684
666
  index$1.registerInstance(this, hostRef);
685
667
  this.sdkError = index$1.createEvent(this, "sdkError");
686
668
  this.templateUpdated = index$1.createEvent(this, "templateUpdated");
687
- this.fieldsUpdated = index$1.createEvent(this, "fieldsUpdated");
688
669
  this.templateListenerId = null;
689
670
  /**
690
671
  * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
@@ -780,23 +761,27 @@ const VerdocsTemplateFields = class {
780
761
  }
781
762
  }
782
763
  attachFieldAttributes(pageInfo, field, el) {
783
- // el.addEventListener('input', e => this.handleFieldChange(field, e));
784
764
  el.addEventListener('settingsChanged', () => {
785
765
  var _a;
786
- (_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template: this.template, event: 'added-field' });
766
+ console.log('[FIELDS] Field settings changed, updating template...');
767
+ (_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template: this.template, event: 'updated-field' });
787
768
  });
788
769
  el.addEventListener('deleted', () => {
789
770
  var _a;
790
771
  el.remove();
791
- (_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template: this.template, event: 'updated-field' });
772
+ console.log('[FIELDS] Field deleted, updating template...');
773
+ (_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template: this.template, event: 'deleted-field' });
792
774
  });
793
775
  el.setAttribute('templateid', this.templateId);
794
776
  el.setAttribute('fieldname', field.name);
795
777
  el.setAttribute('documentid', String(pageInfo.documentId));
778
+ // TODO: Merge these
796
779
  el.setAttribute('pageNumber', String(pageInfo.pageNumber));
780
+ el.setAttribute('pagenumber', String(field.page));
797
781
  el.setAttribute('xScale', String(pageInfo.xScale));
798
782
  el.setAttribute('yScale', String(pageInfo.yScale));
799
783
  el.setAttribute('name', field.name);
784
+ this.makeDraggable(el);
800
785
  }
801
786
  handlePageRendered(e) {
802
787
  var _a, _b;
@@ -812,10 +797,7 @@ const VerdocsTemplateFields = class {
812
797
  const id = utils.getFieldId(field);
813
798
  const el = document.getElementById(id);
814
799
  if (el) {
815
- el.setAttribute('fieldname', field.name);
816
- el.setAttribute('pagenumber', String(field.page));
817
- el.setAttribute('documentid', String(field.document_id));
818
- this.makeDraggable(el);
800
+ this.attachFieldAttributes(pageInfo, field, el);
819
801
  }
820
802
  });
821
803
  }
@@ -3956,151 +3938,10 @@ const VerdocsTemplateRoles = class {
3956
3938
  };
3957
3939
  VerdocsTemplateRoles.style = verdocsTemplateRolesCss;
3958
3940
 
3959
- const verdocsTemplateSettingsCss = "verdocs-template-settings{display:block;max-width:600px;font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif)}verdocs-template-settings>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-settings>form h5{font-size:16px;font-weight:bold;color:#46497d;margin:0 0 10px 0}verdocs-template-settings>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-settings>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-settings>form input:focus{outline:none}verdocs-template-settings>form .row{margin:20px 0 0 0}verdocs-template-settings .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-settings ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-settings ::-moz-placeholder{color:#aaaaaa}verdocs-template-settings :-ms-input-placeholder{color:#aaaaaa}verdocs-template-settings ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-settings ::placeholder{color:#aaaaaa}";
3960
-
3961
- const MS_PER_DAY = 24 * 60 * 60 * 1000;
3962
- const VerdocsTemplateSettings = class {
3963
- constructor(hostRef) {
3964
- index$1.registerInstance(this, hostRef);
3965
- this.next = index$1.createEvent(this, "next");
3966
- this.exit = index$1.createEvent(this, "exit");
3967
- this.sdkError = index$1.createEvent(this, "sdkError");
3968
- this.templateUpdated = index$1.createEvent(this, "templateUpdated");
3969
- this.templateListenerId = null;
3970
- /**
3971
- * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
3972
- */
3973
- this.endpoint = jsSdk.VerdocsEndpoint.getDefault();
3974
- /**
3975
- * The template ID to edit.
3976
- */
3977
- this.templateId = '';
3978
- this.name = null;
3979
- this.visibility = 'private';
3980
- this.sender = 'envelope_creator';
3981
- this.sendReminders = false;
3982
- this.initialReminder = 0;
3983
- this.followupReminders = 0;
3984
- this.dirty = false;
3985
- this.loading = true;
3986
- this.template = null;
3987
- }
3988
- disconnectedCallback() {
3989
- this.unlistenToTemplate();
3990
- }
3991
- async listenToTemplate() {
3992
- console.log('[SETTINGS] Loading template', this.templateId);
3993
- this.unlistenToTemplate();
3994
- Datastore.Store.subscribe('templates', this.templateId, () => jsSdk.getTemplate(this.endpoint, this.templateId), false, (template) => {
3995
- console.log('[SETTINGS] Template Updated', template);
3996
- this.template = template;
3997
- this.name = template.name;
3998
- this.visibility = template.visibility;
3999
- this.sender = template.sender;
4000
- this.sendReminders = template.initial_reminder !== null;
4001
- this.initialReminder = template.initial_reminder ? Math.floor(template.initial_reminder / MS_PER_DAY) : null;
4002
- this.followupReminders = template.followup_reminders ? Math.floor(template.followup_reminders / MS_PER_DAY) : null;
4003
- this.dirty = false;
4004
- this.loading = false;
4005
- });
4006
- }
4007
- unlistenToTemplate() {
4008
- if (this.templateListenerId) {
4009
- Datastore.Store.store.delListener(this.templateListenerId);
4010
- this.templateListenerId = null;
4011
- }
4012
- }
4013
- async componentWillLoad() {
4014
- var _a, _b, _c;
4015
- try {
4016
- this.endpoint.loadSession();
4017
- if (!this.templateId) {
4018
- console.log(`[SETTINGS] Missing required template ID ${this.templateId}`);
4019
- return;
4020
- }
4021
- if (!this.endpoint.session) {
4022
- console.log('[SETTINGS] Unable to start builder session, must be authenticated');
4023
- return;
4024
- }
4025
- this.listenToTemplate();
4026
- }
4027
- catch (e) {
4028
- console.log('[SETTINGS] Error with preview session', e);
4029
- (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new errors.SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
4030
- }
4031
- }
4032
- handleCancel() {
4033
- var _a;
4034
- (_a = this.exit) === null || _a === void 0 ? void 0 : _a.emit();
4035
- }
4036
- handleSubmit() {
4037
- jsSdk.updateTemplate(this.endpoint, this.templateId, {
4038
- name: this.name,
4039
- visibility: this.visibility,
4040
- sender: this.sender,
4041
- initial_reminder: this.sendReminders ? this.initialReminder * MS_PER_DAY : null,
4042
- followup_reminders: this.sendReminders ? this.followupReminders * MS_PER_DAY : null,
4043
- })
4044
- .then(template => {
4045
- var _a, _b;
4046
- console.log('[SETTINGS] Template Updated', template);
4047
- this.dirty = false;
4048
- this.name = template.name;
4049
- this.visibility = template.visibility;
4050
- this.sender = template.sender;
4051
- this.sendReminders = template.initial_reminder !== null;
4052
- this.initialReminder = template.initial_reminder ? Math.floor(template.initial_reminder / MS_PER_DAY) : null;
4053
- this.followupReminders = template.followup_reminders ? Math.floor(template.followup_reminders / MS_PER_DAY) : null;
4054
- (_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template, event: 'update' });
4055
- (_b = this.next) === null || _b === void 0 ? void 0 : _b.emit();
4056
- })
4057
- .catch(e => {
4058
- var _a, _b, _c, _d, _e;
4059
- console.log('[SETTINGS] Error updating template', e);
4060
- (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new errors.SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
4061
- Toast.VerdocsToast(((_e = (_d = e.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.error) || 'Error updating template, please try again later.');
4062
- });
4063
- }
4064
- render() {
4065
- if (!this.endpoint.session) {
4066
- return (index$1.h(index$1.Host, null, index$1.h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
4067
- }
4068
- if (this.loading || !this.template) {
4069
- return (index$1.h(index$1.Host, { class: "loading" }, index$1.h("verdocs-loader", null)));
4070
- }
4071
- return (index$1.h(index$1.Host, null, index$1.h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off" }, index$1.h("h5", null, "Settings"), index$1.h("div", { class: "row" }, index$1.h("verdocs-text-input", { id: "verdocs-field-name", label: "Template Name", value: this.name, autocomplete: "off", placeholder: "Template Name...", onInput: (e) => {
4072
- this.name = e.target.value;
4073
- this.dirty = true;
4074
- } })), index$1.h("div", { class: "row" }, index$1.h("verdocs-select-input", { label: "Visibility", value: this.visibility, onInput: (e) => {
4075
- this.visibility = e.target.value;
4076
- this.dirty = true;
4077
- }, options: [
4078
- { value: 'private', label: 'Private' },
4079
- { value: 'shared', label: 'Shared' },
4080
- { value: 'public', label: 'Public' },
4081
- ] })), index$1.h("div", { class: "row" }, index$1.h("verdocs-select-input", { label: "Owner for envelopes created from this template", value: this.sender, onInput: (e) => {
4082
- this.sender = e.target.value;
4083
- this.dirty = true;
4084
- }, options: [
4085
- { value: 'envelope_creator', label: 'Envelope Creator' },
4086
- { value: 'template_owner', label: 'Template Owner' },
4087
- ] })), index$1.h("div", { class: "row" }, index$1.h("label", null, "Send Reminders"), index$1.h("verdocs-switch", { checked: this.sendReminders, onCheckedChange: e => (this.sendReminders = e.detail) })), this.sendReminders && (index$1.h("div", { class: "row" }, index$1.h("verdocs-text-input", { id: "verdocs-field-name", label: "First Reminder (days)", value: String(this.initialReminder || 0), autocomplete: "off", placeholder: "Delay in days...", onInput: (e) => {
4088
- this.initialReminder = +e.target.value;
4089
- this.dirty = true;
4090
- } }))), this.sendReminders && (index$1.h("div", { class: "row" }, index$1.h("verdocs-text-input", { id: "verdocs-field-name", label: "Follow-up Reminders (days)", value: String(this.followupReminders || 0), autocomplete: "off", placeholder: "Delay in days...", onInput: (e) => {
4091
- this.followupReminders = +e.target.value;
4092
- this.dirty = true;
4093
- } }))), index$1.h("div", { class: "buttons" }, index$1.h("verdocs-button", { variant: "outline", label: "Cancel", size: "small", onClick: () => this.handleCancel() }), index$1.h("verdocs-button", { label: "Save", size: "small", onClick: () => this.handleSubmit(), disabled: !this.dirty })))));
4094
- }
4095
- get el() { return index$1.getElement(this); }
4096
- };
4097
- VerdocsTemplateSettings.style = verdocsTemplateSettingsCss;
4098
-
4099
3941
  exports.verdocs_preview = VerdocsPreview;
4100
3942
  exports.verdocs_send = VerdocsSend;
4101
3943
  exports.verdocs_template_attachments = VerdocsTemplateAttachments;
4102
3944
  exports.verdocs_template_build_tabs = VerdocsTemplateBuildTabs;
4103
3945
  exports.verdocs_template_fields = VerdocsTemplateFields;
4104
3946
  exports.verdocs_template_roles = VerdocsTemplateRoles;
4105
- exports.verdocs_template_settings = VerdocsTemplateSettings;
4106
- //# sourceMappingURL=verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.verdocs-template-settings.entry.cjs.js.map
3947
+ //# sourceMappingURL=verdocs-preview.verdocs-send.verdocs-template-attachments.verdocs-template-build-tabs.verdocs-template-fields.verdocs-template-roles.entry.cjs.js.map
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-CQ5bTnED.js');
4
+
5
+ const verdocsTabsCss = "verdocs-tabs{gap:10px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row;font-family:\"Inter\", \"Barlow\", sans-serif}verdocs-tabs .tab{display:-ms-flexbox;display:flex;color:#111111;cursor:pointer;font-size:14px;font-weight:400;padding:5px 10px;-ms-flex-align:center;align-items:center;text-transform:none;-ms-flex-pack:center;justify-content:center;border-bottom:4px solid transparent}verdocs-tabs .tab:focus{border:none;outline:none}verdocs-tabs .tab.active{color:#000000;font-weight:500;border-bottom:4px solid #654dcb}verdocs-tabs .tab.disabled{color:#aaaaaa;cursor:default}";
6
+
7
+ const VerdocsTabs = class {
8
+ constructor(hostRef) {
9
+ index.registerInstance(this, hostRef);
10
+ this.selectTab = index.createEvent(this, "selectTab");
11
+ /**
12
+ * The tabs to display
13
+ */
14
+ this.tabs = [];
15
+ /**
16
+ * The index of the tab to show selected.
17
+ */
18
+ this.selectedTab = 0;
19
+ }
20
+ handleSelectTab(index) {
21
+ var _a;
22
+ (_a = this.selectTab) === null || _a === void 0 ? void 0 : _a.emit({ tab: this.tabs[index], index });
23
+ }
24
+ render() {
25
+ return (index.h(index.Host, { key: 'b78818a23892499517726f89f5cce6af6b7f42e1' }, this.tabs.map((tab, index$1) => (index.h("div", { class: `tab ${index$1 === this.selectedTab ? 'active' : ''} ${tab.disabled ? 'disabled' : ''}`, onClick: tab.disabled ? () => { } : () => this.handleSelectTab(index$1) }, tab.label))), index.h("div", { key: '2105eefb878bc7237bd9c46d8533085d580b94f8', class: "flex flex-1" }), index.h("slot", { key: 'c477b2f6880442e15bc3bc95f67dec12f1134074' }, index.h("div", { key: 'c6481423137eb98ee64cc9afedea6d43eca89b75' }))));
26
+ }
27
+ };
28
+ VerdocsTabs.style = verdocsTabsCss;
29
+
30
+ exports.verdocs_tabs = VerdocsTabs;
31
+ //# sourceMappingURL=verdocs-tabs.entry.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verdocs-tabs.entry.cjs.js","sources":["src/components/controls/verdocs-tabs/verdocs-tabs.scss?tag=verdocs-tabs","src/components/controls/verdocs-tabs/verdocs-tabs.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-tabs {\n gap: 10px;\n display: flex;\n flex-wrap: wrap;\n flex-direction: row;\n font-family: $primary-font;\n\n .tab {\n display: flex;\n color: #111111;\n cursor: pointer;\n font-size: 14px;\n font-weight: 400;\n padding: 5px 10px;\n align-items: center;\n text-transform: none;\n justify-content: center;\n border-bottom: 4px solid transparent;\n\n &:focus {\n border: none;\n outline: none;\n }\n\n &.active {\n color: #000000;\n font-weight: 500;\n border-bottom: 4px solid #654dcb;\n }\n\n &.disabled {\n color: #aaaaaa;\n cursor: default;\n }\n }\n}\n","import {Component, Prop, Host, h, Event, EventEmitter} from '@stencil/core';\n\nexport interface ITab {\n id?: string;\n label: string;\n disabled?: boolean;\n // TODO: Tooltips?\n}\n\n/**\n * Display a simple row of selectable tabs. This is a controlled element.\n * The parent must adjust selectedTab as selection events are fired.\n *\n * ```ts\n * <verdocs-tabs tabs={[...tabs]} />\n * ```\n */\n@Component({\n tag: 'verdocs-tabs',\n styleUrl: 'verdocs-tabs.scss',\n})\nexport class VerdocsTabs {\n /**\n * The tabs to display\n */\n @Prop() tabs: ITab[] = [];\n\n /**\n * The index of the tab to show selected.\n */\n @Prop() selectedTab: number = 0;\n\n /**\n * Event fired when the user clicks a template to view it. Typically the host application will use this to navigate\n * to the template preview. This is also fired when the user selects \"Preview/Send\" fropm the dropdown menu.\n */\n @Event({composed: true}) selectTab: EventEmitter<{tab: ITab; index: number}>;\n\n handleSelectTab(index: number) {\n this.selectTab?.emit({tab: this.tabs[index], index});\n }\n\n render() {\n return (\n <Host>\n {this.tabs.map((tab, index) => (\n <div class={`tab ${index === this.selectedTab ? 'active' : ''} ${tab.disabled ? 'disabled' : ''}`} onClick={tab.disabled ? () => {} : () => this.handleSelectTab(index)}>\n {tab.label}\n </div>\n ))}\n\n <div class=\"flex flex-1\" />\n\n <slot>\n <div />\n </slot>\n </Host>\n );\n }\n}\n"],"names":["h","Host","index"],"mappings":";;;;AAAA,MAAM,cAAc,GAAG,goBAAgoB;;MCqB1oB,WAAW,GAAA,MAAA;AAJxB,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAKE;;AAEG;AACK,QAAA,IAAI,CAAA,IAAA,GAAW,EAAE;AAEzB;;AAEG;AACK,QAAA,IAAW,CAAA,WAAA,GAAW,CAAC;AA6BhC;AArBC,IAAA,eAAe,CAAC,KAAa,EAAA;;AAC3B,QAAA,CAAA,EAAA,GAAA,IAAI,CAAC,SAAS,0CAAE,IAAI,CAAC,EAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAC,CAAC;;IAGtD,MAAM,GAAA;AACJ,QAAA,QACEA,QAACC,UAAI,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACF,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAEC,OAAK,MACxBF,OAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAE,CAAA,IAAA,EAAOE,OAAK,KAAK,IAAI,CAAC,WAAW,GAAG,QAAQ,GAAG,EAAE,CAAI,CAAA,EAAA,GAAG,CAAC,QAAQ,GAAG,UAAU,GAAG,EAAE,CAAE,CAAA,EAAE,OAAO,EAAE,GAAG,CAAC,QAAQ,GAAG,MAAK,GAAG,GAAG,MAAM,IAAI,CAAC,eAAe,CAACA,OAAK,CAAC,IACpK,GAAG,CAAC,KAAK,CACN,CACP,CAAC,EAEFF,OAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,aAAa,EAAG,CAAA,EAE3BA,OAAA,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,EACEA,OAAO,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,CAAA,CACF,CACF;;;;;;;"}
@@ -0,0 +1,150 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-CQ5bTnED.js');
4
+ var jsSdk = require('@verdocs/js-sdk');
5
+ var Toast = require('./Toast-BgG-6jAg.js');
6
+ var errors = require('./errors-D1XRvnet.js');
7
+ var Datastore = require('./Datastore-B-sxWSPD.js');
8
+
9
+ const verdocsTemplateSettingsCss = "verdocs-template-settings{display:block;max-width:600px;font-family:var(--verdocs-primary-font, \"Inter\", \"Barlow\", sans-serif)}verdocs-template-settings>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-settings>form h5{font-size:16px;font-weight:bold;color:#46497d;margin:0 0 10px 0}verdocs-template-settings>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-settings>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-settings>form input:focus{outline:none}verdocs-template-settings>form .row{margin:20px 0 0 0}verdocs-template-settings .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-settings ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-settings ::-moz-placeholder{color:#aaaaaa}verdocs-template-settings :-ms-input-placeholder{color:#aaaaaa}verdocs-template-settings ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-settings ::placeholder{color:#aaaaaa}";
10
+
11
+ const MS_PER_DAY = 24 * 60 * 60 * 1000;
12
+ const VerdocsTemplateSettings = class {
13
+ constructor(hostRef) {
14
+ index.registerInstance(this, hostRef);
15
+ this.next = index.createEvent(this, "next");
16
+ this.exit = index.createEvent(this, "exit");
17
+ this.sdkError = index.createEvent(this, "sdkError");
18
+ this.templateUpdated = index.createEvent(this, "templateUpdated");
19
+ this.templateListenerId = null;
20
+ /**
21
+ * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.
22
+ */
23
+ this.endpoint = jsSdk.VerdocsEndpoint.getDefault();
24
+ /**
25
+ * The template ID to edit.
26
+ */
27
+ this.templateId = '';
28
+ this.name = null;
29
+ this.visibility = 'private';
30
+ this.sender = 'envelope_creator';
31
+ this.sendReminders = false;
32
+ this.initialReminder = 0;
33
+ this.followupReminders = 0;
34
+ this.dirty = false;
35
+ this.loading = true;
36
+ this.template = null;
37
+ }
38
+ disconnectedCallback() {
39
+ this.unlistenToTemplate();
40
+ }
41
+ async listenToTemplate() {
42
+ console.log('[SETTINGS] Loading template', this.templateId);
43
+ this.unlistenToTemplate();
44
+ Datastore.Store.subscribe('templates', this.templateId, () => jsSdk.getTemplate(this.endpoint, this.templateId), false, (template) => {
45
+ console.log('[SETTINGS] Template Updated', template);
46
+ this.template = template;
47
+ this.name = template.name;
48
+ this.visibility = template.visibility;
49
+ this.sender = template.sender;
50
+ this.sendReminders = template.initial_reminder !== null;
51
+ this.initialReminder = template.initial_reminder ? Math.floor(template.initial_reminder / MS_PER_DAY) : null;
52
+ this.followupReminders = template.followup_reminders ? Math.floor(template.followup_reminders / MS_PER_DAY) : null;
53
+ this.dirty = false;
54
+ this.loading = false;
55
+ });
56
+ }
57
+ unlistenToTemplate() {
58
+ if (this.templateListenerId) {
59
+ Datastore.Store.store.delListener(this.templateListenerId);
60
+ this.templateListenerId = null;
61
+ }
62
+ }
63
+ async componentWillLoad() {
64
+ var _a, _b, _c;
65
+ try {
66
+ this.endpoint.loadSession();
67
+ if (!this.templateId) {
68
+ console.log(`[SETTINGS] Missing required template ID ${this.templateId}`);
69
+ return;
70
+ }
71
+ if (!this.endpoint.session) {
72
+ console.log('[SETTINGS] Unable to start builder session, must be authenticated');
73
+ return;
74
+ }
75
+ this.listenToTemplate();
76
+ }
77
+ catch (e) {
78
+ console.log('[SETTINGS] Error with preview session', e);
79
+ (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new errors.SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
80
+ }
81
+ }
82
+ handleCancel() {
83
+ var _a;
84
+ (_a = this.exit) === null || _a === void 0 ? void 0 : _a.emit();
85
+ }
86
+ handleSubmit() {
87
+ jsSdk.updateTemplate(this.endpoint, this.templateId, {
88
+ name: this.name,
89
+ visibility: this.visibility,
90
+ sender: this.sender,
91
+ initial_reminder: this.sendReminders ? this.initialReminder * MS_PER_DAY : null,
92
+ followup_reminders: this.sendReminders ? this.followupReminders * MS_PER_DAY : null,
93
+ })
94
+ .then(template => {
95
+ var _a, _b;
96
+ console.log('[SETTINGS] Template Updated', template);
97
+ this.dirty = false;
98
+ this.name = template.name;
99
+ this.visibility = template.visibility;
100
+ this.sender = template.sender;
101
+ this.sendReminders = template.initial_reminder !== null;
102
+ this.initialReminder = template.initial_reminder ? Math.floor(template.initial_reminder / MS_PER_DAY) : null;
103
+ this.followupReminders = template.followup_reminders ? Math.floor(template.followup_reminders / MS_PER_DAY) : null;
104
+ (_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template, event: 'update' });
105
+ (_b = this.next) === null || _b === void 0 ? void 0 : _b.emit();
106
+ })
107
+ .catch(e => {
108
+ var _a, _b, _c, _d, _e;
109
+ console.log('[SETTINGS] Error updating template', e);
110
+ (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new errors.SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
111
+ Toast.VerdocsToast(((_e = (_d = e.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.error) || 'Error updating template, please try again later.');
112
+ });
113
+ }
114
+ render() {
115
+ if (!this.endpoint.session) {
116
+ return (index.h(index.Host, null, index.h("verdocs-component-error", { message: "You must be authenticated to use this module." })));
117
+ }
118
+ if (this.loading || !this.template) {
119
+ return (index.h(index.Host, { class: "loading" }, index.h("verdocs-loader", null)));
120
+ }
121
+ return (index.h(index.Host, null, index.h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off" }, index.h("h5", null, "Settings"), index.h("div", { class: "row" }, index.h("verdocs-text-input", { id: "verdocs-field-name", label: "Template Name", value: this.name, autocomplete: "off", placeholder: "Template Name...", onInput: (e) => {
122
+ this.name = e.target.value;
123
+ this.dirty = true;
124
+ } })), index.h("div", { class: "row" }, index.h("verdocs-select-input", { label: "Visibility", value: this.visibility, onInput: (e) => {
125
+ this.visibility = e.target.value;
126
+ this.dirty = true;
127
+ }, options: [
128
+ { value: 'private', label: 'Private' },
129
+ { value: 'shared', label: 'Shared' },
130
+ { value: 'public', label: 'Public' },
131
+ ] })), index.h("div", { class: "row" }, index.h("verdocs-select-input", { label: "Owner for envelopes created from this template", value: this.sender, onInput: (e) => {
132
+ this.sender = e.target.value;
133
+ this.dirty = true;
134
+ }, options: [
135
+ { value: 'envelope_creator', label: 'Envelope Creator' },
136
+ { value: 'template_owner', label: 'Template Owner' },
137
+ ] })), index.h("div", { class: "row" }, index.h("label", null, "Send Reminders"), index.h("verdocs-switch", { checked: this.sendReminders, onCheckedChange: e => (this.sendReminders = e.detail) })), this.sendReminders && (index.h("div", { class: "row" }, index.h("verdocs-text-input", { id: "verdocs-field-name", label: "First Reminder (days)", value: String(this.initialReminder || 0), autocomplete: "off", placeholder: "Delay in days...", onInput: (e) => {
138
+ this.initialReminder = +e.target.value;
139
+ this.dirty = true;
140
+ } }))), this.sendReminders && (index.h("div", { class: "row" }, index.h("verdocs-text-input", { id: "verdocs-field-name", label: "Follow-up Reminders (days)", value: String(this.followupReminders || 0), autocomplete: "off", placeholder: "Delay in days...", onInput: (e) => {
141
+ this.followupReminders = +e.target.value;
142
+ this.dirty = true;
143
+ } }))), index.h("div", { class: "buttons" }, index.h("verdocs-button", { variant: "outline", label: "Cancel", size: "small", onClick: () => this.handleCancel() }), index.h("verdocs-button", { label: "Save", size: "small", onClick: () => this.handleSubmit(), disabled: !this.dirty })))));
144
+ }
145
+ get el() { return index.getElement(this); }
146
+ };
147
+ VerdocsTemplateSettings.style = verdocsTemplateSettingsCss;
148
+
149
+ exports.verdocs_template_settings = VerdocsTemplateSettings;
150
+ //# sourceMappingURL=verdocs-template-settings.entry.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verdocs-template-settings.entry.cjs.js","sources":["src/components/templates/verdocs-template-settings/verdocs-template-settings.scss?tag=verdocs-template-settings","src/components/templates/verdocs-template-settings/verdocs-template-settings.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-settings {\n display: block;\n max-width: 600px;\n font-family: $verdocs-primary-font;\n\n > form {\n display: flex;\n flex-direction: column;\n background-color: $verdocs-grey-4;\n\n // The extra right padding helps ensure when dragged elements move to absolute positioning\n padding: 12px;\n\n h5 {\n font-size: 16px;\n font-weight: bold;\n color: $verdocs-grey-blue;\n margin: 0 0 10px 0;\n }\n\n label {\n display: block;\n font-size: 14px;\n font-weight: 500;\n margin: 0 0 4px 0;\n color: $verdocs-bg-4;\n }\n\n input {\n border: none;\n font-size: 18px;\n padding: 3px 6px 3px 0;\n background: transparent;\n border-bottom: 1px solid $verdocs-dark-blue;\n\n &:focus {\n outline: none;\n }\n }\n\n .row {\n margin: 20px 0 0 0;\n }\n }\n\n .buttons {\n display: flex;\n column-gap: 8px;\n margin-top: 16px;\n flex-direction: row;\n }\n\n ::placeholder {\n color: $verdocs-bg-2;\n }\n}\n","import {Component, h, Element, Event, EventEmitter, Host, Prop, State} from '@stencil/core';\nimport {getTemplate, ITemplate, TTemplateSender, TTemplateVisibility, updateTemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst MS_PER_DAY = 24 * 60 * 60 * 1000;\n\n/**\n * Display an edit form that allows the user to adjust a template's roles and workflow.\n */\n@Component({\n tag: 'verdocs-template-settings',\n styleUrl: 'verdocs-template-settings.scss',\n shadow: false,\n})\nexport class VerdocsTemplateSettings {\n private templateListenerId = null;\n\n @Element()\n el: HTMLElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The template ID to edit.\n */\n @Prop() templateId: string = '';\n\n /**\n * Event fired when the user clicks to proceed.\n */\n @Event({composed: true}) next: EventEmitter;\n\n /**\n * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({composed: true}) exit: EventEmitter;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the template is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) templateUpdated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: string}>;\n\n @State() name: string | null = null;\n @State() visibility: TTemplateVisibility = 'private';\n @State() sender: TTemplateSender = 'envelope_creator';\n @State() sendReminders = false;\n @State() initialReminder = 0;\n @State() followupReminders = 0;\n @State() dirty = false;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n console.log('[SETTINGS] Loading template', this.templateId);\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n console.log('[SETTINGS] Template Updated', template);\n this.template = template;\n this.name = template.name;\n this.visibility = template.visibility;\n this.sender = template.sender;\n this.sendReminders = template.initial_reminder !== null;\n this.initialReminder = template.initial_reminder ? Math.floor(template.initial_reminder / MS_PER_DAY) : null;\n this.followupReminders = template.followup_reminders ? Math.floor(template.followup_reminders / MS_PER_DAY) : null;\n this.dirty = false;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.templateId) {\n console.log(`[SETTINGS] Missing required template ID ${this.templateId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[SETTINGS] Unable to start builder session, must be authenticated');\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[SETTINGS] Error with preview session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n handleCancel() {\n this.exit?.emit();\n }\n\n handleSubmit() {\n updateTemplate(this.endpoint, this.templateId, {\n name: this.name,\n visibility: this.visibility,\n sender: this.sender,\n initial_reminder: this.sendReminders ? this.initialReminder * MS_PER_DAY : null,\n followup_reminders: this.sendReminders ? this.followupReminders * MS_PER_DAY : null,\n })\n .then(template => {\n console.log('[SETTINGS] Template Updated', template);\n this.dirty = false;\n this.name = template.name;\n this.visibility = template.visibility;\n this.sender = template.sender;\n this.sendReminders = template.initial_reminder !== null;\n this.initialReminder = template.initial_reminder ? Math.floor(template.initial_reminder / MS_PER_DAY) : null;\n this.followupReminders = template.followup_reminders ? Math.floor(template.followup_reminders / MS_PER_DAY) : null;\n this.templateUpdated?.emit({endpoint: this.endpoint, template, event: 'update'});\n this.next?.emit();\n })\n .catch(e => {\n console.log('[SETTINGS] Error updating template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n VerdocsToast(e.response?.data?.error || 'Error updating template, please try again later.');\n });\n }\n\n render() {\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n if (this.loading || !this.template) {\n return (\n <Host class=\"loading\">\n <verdocs-loader />\n </Host>\n );\n }\n\n return (\n <Host>\n <form onSubmit={e => e.preventDefault()} onClick={e => e.stopPropagation()} autocomplete=\"off\">\n <h5>Settings</h5>\n\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-name\"\n label=\"Template Name\"\n value={this.name}\n autocomplete=\"off\"\n placeholder=\"Template Name...\"\n onInput={(e: any) => {\n this.name = e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n\n <div class=\"row\">\n <verdocs-select-input\n label=\"Visibility\"\n value={this.visibility}\n onInput={(e: any) => {\n this.visibility = e.target.value;\n this.dirty = true;\n }}\n options={[\n {value: 'private', label: 'Private'},\n {value: 'shared', label: 'Shared'},\n {value: 'public', label: 'Public'},\n ]}\n />\n </div>\n\n <div class=\"row\">\n <verdocs-select-input\n label=\"Owner for envelopes created from this template\"\n value={this.sender}\n onInput={(e: any) => {\n this.sender = e.target.value;\n this.dirty = true;\n }}\n options={[\n {value: 'envelope_creator', label: 'Envelope Creator'},\n {value: 'template_owner', label: 'Template Owner'},\n ]}\n />\n </div>\n\n <div class=\"row\">\n <label>Send Reminders</label>\n <verdocs-switch checked={this.sendReminders} onCheckedChange={e => (this.sendReminders = e.detail)} />\n </div>\n\n {this.sendReminders && (\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-name\"\n label=\"First Reminder (days)\"\n value={String(this.initialReminder || 0)}\n autocomplete=\"off\"\n placeholder=\"Delay in days...\"\n onInput={(e: any) => {\n this.initialReminder = +e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n {this.sendReminders && (\n <div class=\"row\">\n <verdocs-text-input\n id=\"verdocs-field-name\"\n label=\"Follow-up Reminders (days)\"\n value={String(this.followupReminders || 0)}\n autocomplete=\"off\"\n placeholder=\"Delay in days...\"\n onInput={(e: any) => {\n this.followupReminders = +e.target.value;\n this.dirty = true;\n }}\n />\n </div>\n )}\n\n <div class=\"buttons\">\n <verdocs-button variant=\"outline\" label=\"Cancel\" size=\"small\" onClick={() => this.handleCancel()} />\n <verdocs-button label=\"Save\" size=\"small\" onClick={() => this.handleSubmit()} disabled={!this.dirty} />\n </div>\n </form>\n </Host>\n );\n }\n}\n"],"names":["VerdocsEndpoint","Store","getTemplate","SDKError","updateTemplate","VerdocsToast","h","Host"],"mappings":";;;;;;;;AAAA,MAAM,0BAA0B,GAAG,qtCAAqtC;;ACMxvC,MAAM,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;MAUzB,uBAAuB,GAAA,MAAA;AALpC,IAAA,WAAA,CAAA,OAAA,EAAA;;;;;;AAMU,QAAA,IAAkB,CAAA,kBAAA,GAAG,IAAI;AAKjC;;AAEG;AACK,QAAA,IAAA,CAAA,QAAQ,GAAoBA,qBAAe,CAAC,UAAU,EAAE;AAEhE;;AAEG;AACK,QAAA,IAAU,CAAA,UAAA,GAAW,EAAE;AAuBtB,QAAA,IAAI,CAAA,IAAA,GAAkB,IAAI;AAC1B,QAAA,IAAU,CAAA,UAAA,GAAwB,SAAS;AAC3C,QAAA,IAAM,CAAA,MAAA,GAAoB,kBAAkB;AAC5C,QAAA,IAAa,CAAA,aAAA,GAAG,KAAK;AACrB,QAAA,IAAe,CAAA,eAAA,GAAG,CAAC;AACnB,QAAA,IAAiB,CAAA,iBAAA,GAAG,CAAC;AACrB,QAAA,IAAK,CAAA,KAAA,GAAG,KAAK;AAEb,QAAA,IAAO,CAAA,OAAA,GAAG,IAAI;AACd,QAAA,IAAQ,CAAA,QAAA,GAAqB,IAAI;AAwM3C;IAtMC,oBAAoB,GAAA;QAClB,IAAI,CAAC,kBAAkB,EAAE;;AAG3B,IAAA,MAAM,gBAAgB,GAAA;QACp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