@verdocs/web-sdk 6.13.0 → 6.13.1

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 (52) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/verdocs-preview_6.cjs.entry.js +43 -2
  3. package/dist/cjs/verdocs-preview_6.cjs.entry.js.map +1 -1
  4. package/dist/cjs/verdocs-sign.cjs.entry.js +39 -7
  5. package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
  6. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  7. package/dist/collection/components/embeds/verdocs-send/verdocs-send.css +55 -0
  8. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +45 -1
  9. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
  10. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +39 -7
  11. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
  12. package/dist/components/p-VqyGWtIp.js +2 -0
  13. package/dist/components/p-VqyGWtIp.js.map +1 -0
  14. package/dist/components/verdocs-build.js +1 -1
  15. package/dist/components/verdocs-send.js +1 -1
  16. package/dist/components/verdocs-sign.js +1 -1
  17. package/dist/components/verdocs-sign.js.map +1 -1
  18. package/dist/esm/loader.js +1 -1
  19. package/dist/esm/verdocs-preview_6.entry.js +44 -3
  20. package/dist/esm/verdocs-preview_6.entry.js.map +1 -1
  21. package/dist/esm/verdocs-sign.entry.js +39 -7
  22. package/dist/esm/verdocs-sign.entry.js.map +1 -1
  23. package/dist/esm/verdocs-web-sdk.js +1 -1
  24. package/dist/esm-es5/loader.js +1 -1
  25. package/dist/esm-es5/verdocs-preview_6.entry.js +2 -2
  26. package/dist/esm-es5/verdocs-preview_6.entry.js.map +1 -1
  27. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  28. package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
  29. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  30. package/dist/types/components/embeds/verdocs-send/verdocs-send.d.ts +14 -1
  31. package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +1 -0
  32. package/dist/verdocs-web-sdk/p-575b6f98.system.entry.js +8 -0
  33. package/dist/verdocs-web-sdk/p-575b6f98.system.entry.js.map +1 -0
  34. package/dist/verdocs-web-sdk/p-957e4cb0.entry.js +2 -0
  35. package/dist/verdocs-web-sdk/p-957e4cb0.entry.js.map +1 -0
  36. package/dist/verdocs-web-sdk/p-BdZ5Ghsa.system.js +1 -1
  37. package/dist/verdocs-web-sdk/p-f3924e9e.entry.js +8 -0
  38. package/dist/verdocs-web-sdk/p-f3924e9e.entry.js.map +1 -0
  39. package/dist/verdocs-web-sdk/p-f41af68e.system.entry.js +2 -0
  40. package/dist/verdocs-web-sdk/p-f41af68e.system.entry.js.map +1 -0
  41. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  42. package/package.json +1 -1
  43. package/dist/components/p-CnUZ9w2T.js +0 -2
  44. package/dist/components/p-CnUZ9w2T.js.map +0 -1
  45. package/dist/verdocs-web-sdk/p-2a6a3bc6.entry.js +0 -2
  46. package/dist/verdocs-web-sdk/p-2a6a3bc6.entry.js.map +0 -1
  47. package/dist/verdocs-web-sdk/p-5404f6bf.system.entry.js +0 -2
  48. package/dist/verdocs-web-sdk/p-5404f6bf.system.entry.js.map +0 -1
  49. package/dist/verdocs-web-sdk/p-788c8d67.system.entry.js +0 -8
  50. package/dist/verdocs-web-sdk/p-788c8d67.system.entry.js.map +0 -1
  51. package/dist/verdocs-web-sdk/p-987d5653.entry.js +0 -8
  52. package/dist/verdocs-web-sdk/p-987d5653.entry.js.map +0 -1
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,a){function n(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,d){function s(e){try{l(a.next(e))}catch(e){d(e)}}function o(e){try{l(a["throw"](e))}catch(e){d(e)}}function l(e){e.done?i(e.value):n(e.value).then(s,o)}l((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},a,n,d,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=o(0),s["throw"]=o(1),s["return"]=o(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return l([e,t])}}function l(o){if(a)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(i=0)),i)try{if(a=1,n&&(d=o[0]&2?n["return"]:o[0]?n["throw"]||((d=n["return"])&&d.call(n),0):n.next)&&!(d=d.call(n,o[1])).done)return d;if(n=0,d)o=[o[0]&2,d.value];switch(o[0]){case 0:case 1:d=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;n=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(d=i.trys,d=d.length>0&&d[d.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!d||o[1]>d[0]&&o[1]<d[3])){i.label=o[1];break}if(o[0]===6&&i.label<d[1]){i.label=d[1];d=o;break}if(d&&i.label<d[2]){i.label=d[2];i.ops.push(o);break}if(d[2])i.ops.pop();i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e];n=0}finally{a=d=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-De3fNE_u.system.js","./p-BbPAtVJG.system.js"],(function(e,t){"use strict";var i,a,n;return{setters:[function(t){i=t.p;a=t.b;e("setNonce",t.s)},function(e){n=e.g}],execute:function(){var e=this;var d=function(){var e=t.meta.url;var a={};if(e!==""){a.resourcesUrl=new URL(".",e).href}return i(a)};d().then((function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,n()];case 1:e.sent();return[2,a(JSON.parse('[["p-99e594ef.system",[[0,"verdocs-build",{"endpoint":[16],"templateId":[1537,"template-id"],"step":[1537],"loading":[32],"template":[32]},null,{"templateId":[{"onTemplateIdChanged":0}],"step":[{"onStepChanged":0}]}]]],["p-5404f6bf.system",[[0,"verdocs-sign",{"endpoint":[1040],"envelopeId":[513,"envelope-id"],"roleId":[513,"role-id"],"inviteCode":[513,"invite-code"],"headerTargetId":[1,"header-target-id"],"toolbarStyle":[1,"toolbar-style"],"recipient":[32],"hasSignature":[32],"nextButtonLabel":[32],"nextSubmits":[32],"fatalErrorHeader":[32],"fatalErrorMessage":[32],"focusedField":[32],"disclosures":[32],"fieldUpdateCounter":[32],"submitting":[32],"submitted":[32],"isDone":[32],"showDone":[32],"adoptingSignature":[32],"showLoadError":[32],"finishLater":[32],"showFinishLater":[32],"agreed":[32],"signatureId":[32],"initialId":[32],"documentsSingularPlural":[32],"authStep":[32],"authMethodStates":[32],"pageNumber":[32],"kbaQuestions":[32],"showSpinner":[32],"declining":[32],"delegating":[32],"delegated":[32],"kbaChoices":[32],"showDownloadDialog":[32],"loading":[32],"envelope":[32],"zoomLevel":[32],"signingProgressMode":[32],"polling":[32]}]]],["p-143428bc.system",[[0,"verdocs-envelopes-list",{"endpoint":[16],"view":[1537],"status":[1537],"sort":[1537],"match":[1537],"showPagination":[4,"show-pagination"],"rowsPerPage":[2,"rows-per-page"],"selectedPage":[2,"selected-page"],"count":[32],"initiallyLoaded":[32],"loading":[32],"selectedEnvelopes":[32],"envelopes":[32]},null,{"view":[{"handleViewUpdated":0}],"status":[{"handleStatusUpdated":0}],"sort":[{"handleSortUpdated":0}],"match":[{"handleMatchUpdated":0}],"selectedPage":[{"handlePageUpdated":0}]}]]],["p-d6e9c671.system",[[0,"verdocs-templates-list",{"endpoint":[16],"visibility":[1537],"starred":[1537],"sort":[1537],"name":[1537],"allowedActions":[1040],"showPagination":[4,"show-pagination"],"rowsPerPage":[2,"rows-per-page"],"selectedPage":[2,"selected-page"],"count":[32],"initiallyLoaded":[32],"loading":[32],"confirmDelete":[32],"templates":[32],"localNameFilter":[32]},null,{"sharing":[{"handleSharingUpdated":0}],"starred":[{"handleStarredUpdated":0}],"sort":[{"handleSortUpdated":0}],"name":[{"handleNameUpdated":0}],"selectedPage":[{"handlePageUpdated":0}]}]]],["p-228c0fa3.system",[[0,"verdocs-envelope-sidebar",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"activeTab":[32],"panelOpen":[32],"showRecipientDialog":[32],"showCancelDialog":[32],"showReinviteDialog":[32],"showUpdateDialog":[32],"remindersEnabled":[32],"updatingReminders":[32],"initialReminder":[32],"followupReminders":[32],"loading":[32],"envelope":[32]}]]],["p-439d36b0.system",[[0,"verdocs-field-payment",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"done":[516],"editable":[516],"moveable":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"fields":[16],"pageNum":[2,"page-num"],"roleName":[1,"role-name"],"fieldId":[1,"field-id"],"recipients":[8],"selectedRoleName":[1,"selected-role-name"],"pdfPages":[16],"currentSignature":[1,"current-signature"],"currentSignatureId":[1,"current-signature-id"],"currentInitial":[1,"current-initial"],"currentInitialId":[1,"current-initial-id"],"signed":[4],"roleindex":[2],"showingProperties":[32],"focused":[32],"preparedMessage":[32],"signatureUrl":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}]]],["p-4b269de0.system",[[0,"verdocs-template-settings",{"endpoint":[16],"templateId":[1,"template-id"],"name":[32],"visibility":[32],"sender":[32],"sendReminders":[32],"initialReminder":[32],"followupReminders":[32],"dirty":[32],"loading":[32],"template":[32]}]]],["p-9a40e58c.system",[[0,"verdocs-template-create",{"endpoint":[16],"maxSize":[1026,"max-size"],"file":[32],"creating":[32],"progressLabel":[32],"progressPercent":[32],"errorMessage":[32]}]]],["p-502ebdcc.system",[[0,"verdocs-auth",{"endpoint":[16],"visible":[4],"logo":[1],"displayMode":[1025,"display-mode"],"showSocialLogins":[4,"show-social-logins"],"org_name":[32],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"verificationCode":[32],"newPassword":[32],"password":[32],"confirmpass":[32],"submitting":[32],"resendDisabled":[32],"session":[32],"profile":[32],"providers":[32],"mfaToken":[32],"mfaCode":[32],"recoveryCode":[32],"useRecoveryCode":[32],"mfaError":[32]},null,{"showSocialLogins":[{"onShowSocialLoginsChanged":0}]}]]],["p-27a47940.system",[[0,"verdocs-initial-dialog",{"initials":[1],"fontLoaded":[32],"enteredInitials":[32],"mode":[32]}]]],["p-44ecadef.system",[[0,"verdocs-signature-dialog",{"name":[1],"fontLoaded":[32],"enteredName":[32],"mode":[32],"isDrawing":[32],"hasDrawnSignature":[32],"hasUploadedImage":[32],"uploadedFileName":[32]}]]],["p-c00eccde.system",[[0,"verdocs-date-input",{"value":[1537],"label":[1],"placeholder":[1],"helpText":[1,"help-text"],"disabled":[4],"required":[4],"showingPw":[32],"focused":[32],"containerId":[32],"focusField":[64]}]]],["p-88244ef4.system",[[0,"verdocs-envelope-recipient-summary",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"canSendAnother":[4,"can-send-another"],"canView":[4,"can-view"],"canDone":[4,"can-done"],"isOpen":[32],"recipientStatusIcons":[32],"containerId":[32],"gettingLinks":[32],"links":[32],"loading":[32],"envelope":[32]}]]],["p-97bd4ed2.system",[[0,"verdocs-multiselect",{"label":[1],"placeholder":[1],"options":[16],"selectedOptions":[16],"showPicker":[32]}]]],["p-0d19368a.system",[[0,"verdocs-signing-progress",{"mode":[1],"focusedField":[1,"focused-field"],"fields":[16],"recipientFields":[16]}]]],["p-679511ac.system",[[260,"verdocs-button-panel",{"icon":[1],"showPanel":[64],"hidePanel":[64],"toggle":[64]}]]],["p-5c27f03b.system",[[0,"verdocs-quick-functions",{"endpoint":[16]}]]],["p-b2113b3c.system",[[0,"verdocs-search-box",{"endpoint":[16],"placeholder":[1],"type":[1],"query":[1],"grabsFocus":[4,"grabs-focus"],"focusField":[64]}]]],["p-5870592f.system",[[0,"verdocs-search-tabs",{"selected":[32]}]]],["p-4227fb1f.system",[[0,"verdocs-table",{"columns":[16],"data":[16]}]]],["p-7cb69139.system",[[260,"verdocs-tabs",{"tabs":[16],"selectedTab":[2,"selected-tab"]}]]],["p-23f53034.system",[[0,"verdocs-template-card",{"template":[16]}]]],["p-c8b08801.system",[[0,"verdocs-template-tags",{"tags":[16]}]]],["p-4c1f0f08.system",[[0,"verdocs-toggle",{"options":[16],"theme":[1],"selectedOption":[32]}]]],["p-ea2c3707.system",[[0,"verdocs-toggle-button",{"active":[4],"icon":[1],"label":[1],"size":[1],"_active":[32]}]]],["p-0259b666.system",[[0,"verdocs-status-indicator",{"size":[1],"theme":[1],"status":[1],"envelope":[16],"isOpen":[32],"containerId":[32]}]]],["p-20bc8055.system",[[0,"verdocs-template-star",{"endpoint":[16],"template":[1040],"updating":[32]}]]],["p-83153211.system",[[0,"verdocs-envelope-update-recipient",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"roleName":[1,"role-name"],"isOpen":[32],"gettingLink":[32],"link":[32],"loading":[32],"envelope":[32],"originalRecipient":[32],"updatedRecipient":[32]}],[0,"verdocs-envelope-recipient-link",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"roleName":[1,"role-name"],"isOpen":[32],"gettingLink":[32],"link":[32],"loading":[32],"envelope":[32],"recipient":[32]}]]],["p-38800961.system",[[0,"verdocs-contact-picker",{"endpoint":[16],"templateRole":[16],"contactSuggestions":[16],"showCancel":[4,"show-cancel"],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"zip":[32],"address":[32],"message":[32],"showSuggestions":[32],"showMessage":[32],"delegator":[32],"name_locked":[32],"auth_methods":[32],"passcode":[32],"firstNameFieldId":[32],"lastNameFieldId":[32],"emailFieldId":[32],"phoneFieldId":[32],"activeEntitlements":[32],"authMethodsLoading":[32]},[[4,"click","handleDocumentClick"]]]]],["p-d0b56329.system",[[0,"verdocs-radio-button",{"checked":[4],"name":[1],"value":[1],"disabled":[4]}]]],["p-82723d6c.system",[[0,"verdocs-switch",{"checked":[1028],"theme":[1],"disabled":[4]}]]],["p-08dbefe5.system",[[0,"verdocs-text-input",{"value":[1537],"label":[1],"placeholder":[1],"description":[1],"autocomplete":[1],"helpText":[1,"help-text"],"clearable":[4],"copyable":[4],"type":[1],"disabled":[4],"required":[4],"showingPw":[32]}],[0,"verdocs-help-icon",{"text":[1],"icon":[1],"containerId":[32]}],[0,"verdocs-button",{"label":[1],"startIcon":[1,"start-icon"],"endIcon":[1,"end-icon"],"size":[1],"type":[1],"variant":[1],"disabled":[4]}]]],["p-6fb7fd6d.system",[[0,"verdocs-template-field-properties",{"endpoint":[16],"templateId":[1,"template-id"],"fieldName":[1025,"field-name"],"helpText":[1,"help-text"],"dirty":[32],"label":[32],"type":[32],"name":[32],"required":[32],"readonly":[32],"roleName":[32],"group":[32],"fieldType":[32],"options":[32],"placeholder":[32],"defaultValue":[32],"showingHelp":[32],"loading":[32],"template":[32]}],[0,"verdocs-select-input",{"value":[1],"label":[1],"options":[16],"disabled":[4]}],[0,"verdocs-checkbox",{"checked":[4],"name":[1],"label":[1],"value":[1],"theme":[1],"size":[1],"disabled":[4]}],[0,"verdocs-component-error",{"message":[1]}],[0,"verdocs-loader"]]],["p-053026c5.system",[[0,"verdocs-template-role-properties",{"endpoint":[16],"templateId":[1,"template-id"],"roleName":[1,"role-name"],"dirty":[32],"saving":[32],"name":[32],"type":[32],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"delegator":[32],"loading":[32],"template":[32]}],[260,"verdocs-menu-panel",{"side":[1],"overlay":[4],"width":[2]},[[4,"click","handleClick"]]]]],["p-7dd394be.system",[[0,"verdocs-quick-filter",{"options":[16],"label":[1],"value":[1537],"placeholder":[1],"open":[32]}],[0,"verdocs-pagination",{"selectedPage":[1538,"selected-page"],"itemCount":[2,"item-count"],"perPage":[2,"per-page"]}]]],["p-9bd688f5.system",[[0,"verdocs-dropdown",{"options":[16],"containerId":[32],"showPicker":[32]}]]],["p-99a6b317.system",[[0,"verdocs-toolbar-icon",{"text":[1],"icon":[1],"placement":[1],"containerId":[32]}],[0,"verdocs-template-document-page",{"endpoint":[16],"editable":[4],"disabled":[4],"done":[4],"templateId":[513,"template-id"],"documentId":[513,"document-id"],"pageNumber":[514,"page-number"],"virtualWidth":[2,"virtual-width"],"virtualHeight":[1026,"virtual-height"],"layers":[16],"containerId":[32],"renderedWidth":[32],"renderedHeight":[32],"naturalWidth":[32],"naturalHeight":[32],"aspectRatio":[32],"skipFirstNotification":[32],"pageDisplayUri":[32],"xScale":[32],"yScale":[32],"loading":[32],"template":[32]}]]],["p-122f8333.system",[[0,"verdocs-file-chooser",{"endpoint":[16],"file":[32]}],[0,"verdocs-progress-bar",{"label":[1],"showPercent":[4,"show-percent"],"percent":[2]}]]],["p-81785ed8.system",[[0,"verdocs-spinner",{"size":[2],"mode":[1]}]]],["p-f20b49d6.system",[[260,"verdocs-dialog",{"persistent":[4]}]]],["p-9048f998.system",[[0,"verdocs-ok-dialog",{"heading":[1],"message":[1],"buttonLabel":[1,"button-label"],"showCancel":[4,"show-cancel"],"closed":[32]}]]],["p-ced860ec.system",[[0,"verdocs-flag",{"variant":[1],"label":[1],"showSkip":[4,"show-skip"]}]]],["p-788c8d67.system",[[0,"verdocs-template-fields",{"endpoint":[16],"templateId":[1537,"template-id"],"toolbarTargetId":[1,"toolbar-target-id"],"placing":[32],"showMustSelectRole":[32],"selectedRoleName":[32],"loading":[32],"template":[32]},[[4,"keydown","handleKeyDown"],[0,"settingsChanged","handleFieldSettingsChanged"],[0,"deleted","handleFieldDeleted"]],{"templateId":[{"onTemplateIdChanged":0}]}],[0,"verdocs-preview",{"endpoint":[16],"templateId":[1,"template-id"],"loading":[32],"template":[32]},null,{"templateId":[{"onTemplateIdChanged":0}]}],[0,"verdocs-template-roles",{"endpoint":[16],"templateId":[1,"template-id"],"showingRoleDialog":[32],"sender":[32],"dragging":[32],"loading":[32],"template":[32]}],[0,"verdocs-send",{"endpoint":[16],"templateId":[513,"template-id"],"environment":[1],"showCancel":[4,"show-cancel"],"brandKey":[1025,"brand-key"],"containerId":[32],"view":[32],"editingRoleId":[32],"sessionContacts":[32],"sending":[32],"brands":[32],"organization":[32],"expiresInDays":[32],"noContact":[32],"rolesCompleted":[32],"loading":[32],"template":[32],"reset":[64]},null,{"templateId":[{"onTemplateIdChanged":0}]}],[0,"verdocs-template-attachments",{"endpoint":[16],"templateId":[1,"template-id"],"uploading":[32],"progressLabel":[32],"progressPercent":[32],"showDeleteError":[32],"confirmDeleteDocument":[32],"loading":[32],"template":[32]}],[0,"verdocs-template-build-tabs",{"endpoint":[16],"templateId":[1537,"template-id"],"step":[1537],"loading":[32],"template":[32]},null,{"templateId":[{"onTemplateIdChanged":0}],"step":[{"onStepChanged":0}]}]]],["p-3f9102c4.system",[[0,"verdocs-sign-footer",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"isDone":[4,"is-done"],"askingQuestion":[32],"declinine":[32],"envelope":[32]}],[0,"verdocs-download-dialog",{"signed":[4],"polling":[4],"documents":[16],"hasCertificate":[4,"has-certificate"]}],[0,"verdocs-envelope-document-page",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"documentId":[1,"document-id"],"pageNumber":[2,"page-number"],"virtualWidth":[2,"virtual-width"],"virtualHeight":[1026,"virtual-height"],"layers":[16],"type":[1],"containerId":[32],"renderedWidth":[32],"renderedHeight":[32],"naturalWidth":[32],"naturalHeight":[32],"aspectRatio":[32],"skipFirstNotification":[32],"pageDisplayUri":[32]}],[0,"verdocs-question-dialog",{"question":[1025],"closed":[32]}]]],["p-df921f12.system",[[0,"verdocs-view",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"headerTargetId":[1,"header-target-id"],"canceling":[32],"showCancelDone":[32],"showLoadError":[32],"loading":[32],"envelope":[32],"zoomLevel":[32],"showDownloadDialog":[32],"polling":[32]}],[0,"verdocs-kba-dialog",{"step":[2],"steps":[2],"helptitle":[1],"helptext":[1],"mode":[1],"label":[1],"placeholder":[1],"recipient":[16],"choices":[16],"agreed":[32],"response":[32],"updatedRecipient":[32],"dobContainerId":[32]}],[0,"verdocs-adopt-signature-dialog",{"name":[1],"nameLocked":[4,"name-locked"],"fontLoaded":[32],"enteredName":[32],"enteredInitials":[32],"mode":[32],"isDrawing":[32],"hasDrawnSignature":[32],"hasDrawnInitials":[32]}],[0,"verdocs-otp-dialog",{"endpoint":[1040],"method":[1],"resendDisabled":[32],"response":[32]}],[0,"verdocs-passcode-dialog",{"endpoint":[1040],"response":[32]}],[0,"verdocs-disclosure-dialog",{"disclosures":[1],"delegator":[4],"accepted":[32]}],[0,"verdocs-delegate-dialog",{"endpoint":[1040],"envelope":[16],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"message":[32]}]]],["p-a1d9a507.system",[[0,"verdocs-organization-card",{"organization":[16],"hovered":[32]},[[1,"mouseover","onMouseOver"],[1,"mouseout","onMouseOut"]]],[260,"verdocs-portal",{"anchor":[1],"voffset":[2]},[[11,"scroll","handleScroll"],[9,"resize","handleResize"],[4,"click","handleClick"]]]]],["p-c5f8125b.system",[[0,"verdocs-field-attachment",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"dialogOpen":[32],"selectedFile":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-checkbox",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"done":[516],"editable":[516],"moveable":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-date",{"source":[513],"sourceid":[513],"fieldname":[513],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"field":[16],"isPreview":[516,"is-preview"],"containerId":[32],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-dropdown",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-initial",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"disabled":[516],"initials":[513],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"initialid":[513],"isPreview":[516,"is-preview"],"showingProperties":[32],"focused":[32],"menuOpen":[32],"tempInitials":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-radio",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"required":[516],"done":[516],"editable":[516],"moveable":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-signature",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"name":[513],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"signatureid":[513],"isPreview":[516,"is-preview"],"showingProperties":[32],"focused":[32],"menuOpen":[32],"tempSignature":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"],[0,"blur","onBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-textarea",{"endpoint":[16],"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-textbox",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"multiline":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-timestamp",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[2],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-upload-dialog",{"maxSize":[1026,"max-size"],"existingFile":[1032,"existing-file"],"draggingOver":[32],"confirmDelete":[32],"selectedFiles":[32],"errorMessage":[32]}]]]]'),t)]}}))}))}))}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,a){function n(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,d){function s(e){try{l(a.next(e))}catch(e){d(e)}}function o(e){try{l(a["throw"](e))}catch(e){d(e)}}function l(e){e.done?i(e.value):n(e.value).then(s,o)}l((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},a,n,d,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=o(0),s["throw"]=o(1),s["return"]=o(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(e){return function(t){return l([e,t])}}function l(o){if(a)throw new TypeError("Generator is already executing.");while(s&&(s=0,o[0]&&(i=0)),i)try{if(a=1,n&&(d=o[0]&2?n["return"]:o[0]?n["throw"]||((d=n["return"])&&d.call(n),0):n.next)&&!(d=d.call(n,o[1])).done)return d;if(n=0,d)o=[o[0]&2,d.value];switch(o[0]){case 0:case 1:d=o;break;case 4:i.label++;return{value:o[1],done:false};case 5:i.label++;n=o[1];o=[0];continue;case 7:o=i.ops.pop();i.trys.pop();continue;default:if(!(d=i.trys,d=d.length>0&&d[d.length-1])&&(o[0]===6||o[0]===2)){i=0;continue}if(o[0]===3&&(!d||o[1]>d[0]&&o[1]<d[3])){i.label=o[1];break}if(o[0]===6&&i.label<d[1]){i.label=d[1];d=o;break}if(d&&i.label<d[2]){i.label=d[2];i.ops.push(o);break}if(d[2])i.ops.pop();i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e];n=0}finally{a=d=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-De3fNE_u.system.js","./p-BbPAtVJG.system.js"],(function(e,t){"use strict";var i,a,n;return{setters:[function(t){i=t.p;a=t.b;e("setNonce",t.s)},function(e){n=e.g}],execute:function(){var e=this;var d=function(){var e=t.meta.url;var a={};if(e!==""){a.resourcesUrl=new URL(".",e).href}return i(a)};d().then((function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,n()];case 1:e.sent();return[2,a(JSON.parse('[["p-99e594ef.system",[[0,"verdocs-build",{"endpoint":[16],"templateId":[1537,"template-id"],"step":[1537],"loading":[32],"template":[32]},null,{"templateId":[{"onTemplateIdChanged":0}],"step":[{"onStepChanged":0}]}]]],["p-f41af68e.system",[[0,"verdocs-sign",{"endpoint":[1040],"envelopeId":[513,"envelope-id"],"roleId":[513,"role-id"],"inviteCode":[513,"invite-code"],"headerTargetId":[1,"header-target-id"],"toolbarStyle":[1,"toolbar-style"],"recipient":[32],"hasSignature":[32],"nextButtonLabel":[32],"nextSubmits":[32],"fatalErrorHeader":[32],"fatalErrorMessage":[32],"focusedField":[32],"disclosures":[32],"fieldUpdateCounter":[32],"submitting":[32],"submitted":[32],"isDone":[32],"showDone":[32],"adoptingSignature":[32],"showLoadError":[32],"finishLater":[32],"showFinishLater":[32],"agreed":[32],"signatureId":[32],"initialId":[32],"documentsSingularPlural":[32],"authStep":[32],"authMethodStates":[32],"pageNumber":[32],"kbaQuestions":[32],"showSpinner":[32],"declining":[32],"delegating":[32],"delegated":[32],"kbaChoices":[32],"showDownloadDialog":[32],"loading":[32],"envelope":[32],"zoomLevel":[32],"signingProgressMode":[32],"polling":[32]}]]],["p-143428bc.system",[[0,"verdocs-envelopes-list",{"endpoint":[16],"view":[1537],"status":[1537],"sort":[1537],"match":[1537],"showPagination":[4,"show-pagination"],"rowsPerPage":[2,"rows-per-page"],"selectedPage":[2,"selected-page"],"count":[32],"initiallyLoaded":[32],"loading":[32],"selectedEnvelopes":[32],"envelopes":[32]},null,{"view":[{"handleViewUpdated":0}],"status":[{"handleStatusUpdated":0}],"sort":[{"handleSortUpdated":0}],"match":[{"handleMatchUpdated":0}],"selectedPage":[{"handlePageUpdated":0}]}]]],["p-d6e9c671.system",[[0,"verdocs-templates-list",{"endpoint":[16],"visibility":[1537],"starred":[1537],"sort":[1537],"name":[1537],"allowedActions":[1040],"showPagination":[4,"show-pagination"],"rowsPerPage":[2,"rows-per-page"],"selectedPage":[2,"selected-page"],"count":[32],"initiallyLoaded":[32],"loading":[32],"confirmDelete":[32],"templates":[32],"localNameFilter":[32]},null,{"sharing":[{"handleSharingUpdated":0}],"starred":[{"handleStarredUpdated":0}],"sort":[{"handleSortUpdated":0}],"name":[{"handleNameUpdated":0}],"selectedPage":[{"handlePageUpdated":0}]}]]],["p-228c0fa3.system",[[0,"verdocs-envelope-sidebar",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"activeTab":[32],"panelOpen":[32],"showRecipientDialog":[32],"showCancelDialog":[32],"showReinviteDialog":[32],"showUpdateDialog":[32],"remindersEnabled":[32],"updatingReminders":[32],"initialReminder":[32],"followupReminders":[32],"loading":[32],"envelope":[32]}]]],["p-439d36b0.system",[[0,"verdocs-field-payment",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"done":[516],"editable":[516],"moveable":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"fields":[16],"pageNum":[2,"page-num"],"roleName":[1,"role-name"],"fieldId":[1,"field-id"],"recipients":[8],"selectedRoleName":[1,"selected-role-name"],"pdfPages":[16],"currentSignature":[1,"current-signature"],"currentSignatureId":[1,"current-signature-id"],"currentInitial":[1,"current-initial"],"currentInitialId":[1,"current-initial-id"],"signed":[4],"roleindex":[2],"showingProperties":[32],"focused":[32],"preparedMessage":[32],"signatureUrl":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}]]],["p-4b269de0.system",[[0,"verdocs-template-settings",{"endpoint":[16],"templateId":[1,"template-id"],"name":[32],"visibility":[32],"sender":[32],"sendReminders":[32],"initialReminder":[32],"followupReminders":[32],"dirty":[32],"loading":[32],"template":[32]}]]],["p-9a40e58c.system",[[0,"verdocs-template-create",{"endpoint":[16],"maxSize":[1026,"max-size"],"file":[32],"creating":[32],"progressLabel":[32],"progressPercent":[32],"errorMessage":[32]}]]],["p-502ebdcc.system",[[0,"verdocs-auth",{"endpoint":[16],"visible":[4],"logo":[1],"displayMode":[1025,"display-mode"],"showSocialLogins":[4,"show-social-logins"],"org_name":[32],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"verificationCode":[32],"newPassword":[32],"password":[32],"confirmpass":[32],"submitting":[32],"resendDisabled":[32],"session":[32],"profile":[32],"providers":[32],"mfaToken":[32],"mfaCode":[32],"recoveryCode":[32],"useRecoveryCode":[32],"mfaError":[32]},null,{"showSocialLogins":[{"onShowSocialLoginsChanged":0}]}]]],["p-27a47940.system",[[0,"verdocs-initial-dialog",{"initials":[1],"fontLoaded":[32],"enteredInitials":[32],"mode":[32]}]]],["p-44ecadef.system",[[0,"verdocs-signature-dialog",{"name":[1],"fontLoaded":[32],"enteredName":[32],"mode":[32],"isDrawing":[32],"hasDrawnSignature":[32],"hasUploadedImage":[32],"uploadedFileName":[32]}]]],["p-c00eccde.system",[[0,"verdocs-date-input",{"value":[1537],"label":[1],"placeholder":[1],"helpText":[1,"help-text"],"disabled":[4],"required":[4],"showingPw":[32],"focused":[32],"containerId":[32],"focusField":[64]}]]],["p-88244ef4.system",[[0,"verdocs-envelope-recipient-summary",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"canSendAnother":[4,"can-send-another"],"canView":[4,"can-view"],"canDone":[4,"can-done"],"isOpen":[32],"recipientStatusIcons":[32],"containerId":[32],"gettingLinks":[32],"links":[32],"loading":[32],"envelope":[32]}]]],["p-97bd4ed2.system",[[0,"verdocs-multiselect",{"label":[1],"placeholder":[1],"options":[16],"selectedOptions":[16],"showPicker":[32]}]]],["p-0d19368a.system",[[0,"verdocs-signing-progress",{"mode":[1],"focusedField":[1,"focused-field"],"fields":[16],"recipientFields":[16]}]]],["p-679511ac.system",[[260,"verdocs-button-panel",{"icon":[1],"showPanel":[64],"hidePanel":[64],"toggle":[64]}]]],["p-5c27f03b.system",[[0,"verdocs-quick-functions",{"endpoint":[16]}]]],["p-b2113b3c.system",[[0,"verdocs-search-box",{"endpoint":[16],"placeholder":[1],"type":[1],"query":[1],"grabsFocus":[4,"grabs-focus"],"focusField":[64]}]]],["p-5870592f.system",[[0,"verdocs-search-tabs",{"selected":[32]}]]],["p-4227fb1f.system",[[0,"verdocs-table",{"columns":[16],"data":[16]}]]],["p-7cb69139.system",[[260,"verdocs-tabs",{"tabs":[16],"selectedTab":[2,"selected-tab"]}]]],["p-23f53034.system",[[0,"verdocs-template-card",{"template":[16]}]]],["p-c8b08801.system",[[0,"verdocs-template-tags",{"tags":[16]}]]],["p-4c1f0f08.system",[[0,"verdocs-toggle",{"options":[16],"theme":[1],"selectedOption":[32]}]]],["p-ea2c3707.system",[[0,"verdocs-toggle-button",{"active":[4],"icon":[1],"label":[1],"size":[1],"_active":[32]}]]],["p-0259b666.system",[[0,"verdocs-status-indicator",{"size":[1],"theme":[1],"status":[1],"envelope":[16],"isOpen":[32],"containerId":[32]}]]],["p-20bc8055.system",[[0,"verdocs-template-star",{"endpoint":[16],"template":[1040],"updating":[32]}]]],["p-83153211.system",[[0,"verdocs-envelope-update-recipient",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"roleName":[1,"role-name"],"isOpen":[32],"gettingLink":[32],"link":[32],"loading":[32],"envelope":[32],"originalRecipient":[32],"updatedRecipient":[32]}],[0,"verdocs-envelope-recipient-link",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"roleName":[1,"role-name"],"isOpen":[32],"gettingLink":[32],"link":[32],"loading":[32],"envelope":[32],"recipient":[32]}]]],["p-38800961.system",[[0,"verdocs-contact-picker",{"endpoint":[16],"templateRole":[16],"contactSuggestions":[16],"showCancel":[4,"show-cancel"],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"zip":[32],"address":[32],"message":[32],"showSuggestions":[32],"showMessage":[32],"delegator":[32],"name_locked":[32],"auth_methods":[32],"passcode":[32],"firstNameFieldId":[32],"lastNameFieldId":[32],"emailFieldId":[32],"phoneFieldId":[32],"activeEntitlements":[32],"authMethodsLoading":[32]},[[4,"click","handleDocumentClick"]]]]],["p-d0b56329.system",[[0,"verdocs-radio-button",{"checked":[4],"name":[1],"value":[1],"disabled":[4]}]]],["p-82723d6c.system",[[0,"verdocs-switch",{"checked":[1028],"theme":[1],"disabled":[4]}]]],["p-08dbefe5.system",[[0,"verdocs-text-input",{"value":[1537],"label":[1],"placeholder":[1],"description":[1],"autocomplete":[1],"helpText":[1,"help-text"],"clearable":[4],"copyable":[4],"type":[1],"disabled":[4],"required":[4],"showingPw":[32]}],[0,"verdocs-help-icon",{"text":[1],"icon":[1],"containerId":[32]}],[0,"verdocs-button",{"label":[1],"startIcon":[1,"start-icon"],"endIcon":[1,"end-icon"],"size":[1],"type":[1],"variant":[1],"disabled":[4]}]]],["p-6fb7fd6d.system",[[0,"verdocs-template-field-properties",{"endpoint":[16],"templateId":[1,"template-id"],"fieldName":[1025,"field-name"],"helpText":[1,"help-text"],"dirty":[32],"label":[32],"type":[32],"name":[32],"required":[32],"readonly":[32],"roleName":[32],"group":[32],"fieldType":[32],"options":[32],"placeholder":[32],"defaultValue":[32],"showingHelp":[32],"loading":[32],"template":[32]}],[0,"verdocs-select-input",{"value":[1],"label":[1],"options":[16],"disabled":[4]}],[0,"verdocs-checkbox",{"checked":[4],"name":[1],"label":[1],"value":[1],"theme":[1],"size":[1],"disabled":[4]}],[0,"verdocs-component-error",{"message":[1]}],[0,"verdocs-loader"]]],["p-053026c5.system",[[0,"verdocs-template-role-properties",{"endpoint":[16],"templateId":[1,"template-id"],"roleName":[1,"role-name"],"dirty":[32],"saving":[32],"name":[32],"type":[32],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"delegator":[32],"loading":[32],"template":[32]}],[260,"verdocs-menu-panel",{"side":[1],"overlay":[4],"width":[2]},[[4,"click","handleClick"]]]]],["p-7dd394be.system",[[0,"verdocs-quick-filter",{"options":[16],"label":[1],"value":[1537],"placeholder":[1],"open":[32]}],[0,"verdocs-pagination",{"selectedPage":[1538,"selected-page"],"itemCount":[2,"item-count"],"perPage":[2,"per-page"]}]]],["p-9bd688f5.system",[[0,"verdocs-dropdown",{"options":[16],"containerId":[32],"showPicker":[32]}]]],["p-99a6b317.system",[[0,"verdocs-toolbar-icon",{"text":[1],"icon":[1],"placement":[1],"containerId":[32]}],[0,"verdocs-template-document-page",{"endpoint":[16],"editable":[4],"disabled":[4],"done":[4],"templateId":[513,"template-id"],"documentId":[513,"document-id"],"pageNumber":[514,"page-number"],"virtualWidth":[2,"virtual-width"],"virtualHeight":[1026,"virtual-height"],"layers":[16],"containerId":[32],"renderedWidth":[32],"renderedHeight":[32],"naturalWidth":[32],"naturalHeight":[32],"aspectRatio":[32],"skipFirstNotification":[32],"pageDisplayUri":[32],"xScale":[32],"yScale":[32],"loading":[32],"template":[32]}]]],["p-122f8333.system",[[0,"verdocs-file-chooser",{"endpoint":[16],"file":[32]}],[0,"verdocs-progress-bar",{"label":[1],"showPercent":[4,"show-percent"],"percent":[2]}]]],["p-81785ed8.system",[[0,"verdocs-spinner",{"size":[2],"mode":[1]}]]],["p-f20b49d6.system",[[260,"verdocs-dialog",{"persistent":[4]}]]],["p-9048f998.system",[[0,"verdocs-ok-dialog",{"heading":[1],"message":[1],"buttonLabel":[1,"button-label"],"showCancel":[4,"show-cancel"],"closed":[32]}]]],["p-ced860ec.system",[[0,"verdocs-flag",{"variant":[1],"label":[1],"showSkip":[4,"show-skip"]}]]],["p-575b6f98.system",[[0,"verdocs-template-fields",{"endpoint":[16],"templateId":[1537,"template-id"],"toolbarTargetId":[1,"toolbar-target-id"],"placing":[32],"showMustSelectRole":[32],"selectedRoleName":[32],"loading":[32],"template":[32]},[[4,"keydown","handleKeyDown"],[0,"settingsChanged","handleFieldSettingsChanged"],[0,"deleted","handleFieldDeleted"]],{"templateId":[{"onTemplateIdChanged":0}]}],[0,"verdocs-preview",{"endpoint":[16],"templateId":[1,"template-id"],"loading":[32],"template":[32]},null,{"templateId":[{"onTemplateIdChanged":0}]}],[0,"verdocs-template-roles",{"endpoint":[16],"templateId":[1,"template-id"],"showingRoleDialog":[32],"sender":[32],"dragging":[32],"loading":[32],"template":[32]}],[0,"verdocs-send",{"endpoint":[16],"templateId":[513,"template-id"],"environment":[1],"showCancel":[4,"show-cancel"],"brandKey":[1025,"brand-key"],"containerId":[32],"view":[32],"editingRoleId":[32],"sessionContacts":[32],"sending":[32],"brands":[32],"organization":[32],"expiresInDays":[32],"noContact":[32],"senderDefaults":[32],"senderName":[32],"senderEmail":[32],"rolesCompleted":[32],"loading":[32],"template":[32],"reset":[64]},null,{"templateId":[{"onTemplateIdChanged":0}]}],[0,"verdocs-template-attachments",{"endpoint":[16],"templateId":[1,"template-id"],"uploading":[32],"progressLabel":[32],"progressPercent":[32],"showDeleteError":[32],"confirmDeleteDocument":[32],"loading":[32],"template":[32]}],[0,"verdocs-template-build-tabs",{"endpoint":[16],"templateId":[1537,"template-id"],"step":[1537],"loading":[32],"template":[32]},null,{"templateId":[{"onTemplateIdChanged":0}],"step":[{"onStepChanged":0}]}]]],["p-3f9102c4.system",[[0,"verdocs-sign-footer",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"isDone":[4,"is-done"],"askingQuestion":[32],"declinine":[32],"envelope":[32]}],[0,"verdocs-download-dialog",{"signed":[4],"polling":[4],"documents":[16],"hasCertificate":[4,"has-certificate"]}],[0,"verdocs-envelope-document-page",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"documentId":[1,"document-id"],"pageNumber":[2,"page-number"],"virtualWidth":[2,"virtual-width"],"virtualHeight":[1026,"virtual-height"],"layers":[16],"type":[1],"containerId":[32],"renderedWidth":[32],"renderedHeight":[32],"naturalWidth":[32],"naturalHeight":[32],"aspectRatio":[32],"skipFirstNotification":[32],"pageDisplayUri":[32]}],[0,"verdocs-question-dialog",{"question":[1025],"closed":[32]}]]],["p-df921f12.system",[[0,"verdocs-view",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"headerTargetId":[1,"header-target-id"],"canceling":[32],"showCancelDone":[32],"showLoadError":[32],"loading":[32],"envelope":[32],"zoomLevel":[32],"showDownloadDialog":[32],"polling":[32]}],[0,"verdocs-kba-dialog",{"step":[2],"steps":[2],"helptitle":[1],"helptext":[1],"mode":[1],"label":[1],"placeholder":[1],"recipient":[16],"choices":[16],"agreed":[32],"response":[32],"updatedRecipient":[32],"dobContainerId":[32]}],[0,"verdocs-adopt-signature-dialog",{"name":[1],"nameLocked":[4,"name-locked"],"fontLoaded":[32],"enteredName":[32],"enteredInitials":[32],"mode":[32],"isDrawing":[32],"hasDrawnSignature":[32],"hasDrawnInitials":[32]}],[0,"verdocs-otp-dialog",{"endpoint":[1040],"method":[1],"resendDisabled":[32],"response":[32]}],[0,"verdocs-passcode-dialog",{"endpoint":[1040],"response":[32]}],[0,"verdocs-disclosure-dialog",{"disclosures":[1],"delegator":[4],"accepted":[32]}],[0,"verdocs-delegate-dialog",{"endpoint":[1040],"envelope":[16],"first_name":[32],"last_name":[32],"email":[32],"phone":[32],"message":[32]}]]],["p-a1d9a507.system",[[0,"verdocs-organization-card",{"organization":[16],"hovered":[32]},[[1,"mouseover","onMouseOver"],[1,"mouseout","onMouseOut"]]],[260,"verdocs-portal",{"anchor":[1],"voffset":[2]},[[11,"scroll","handleScroll"],[9,"resize","handleResize"],[4,"click","handleClick"]]]]],["p-c5f8125b.system",[[0,"verdocs-field-attachment",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"dialogOpen":[32],"selectedFile":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-checkbox",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"done":[516],"editable":[516],"moveable":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-date",{"source":[513],"sourceid":[513],"fieldname":[513],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"field":[16],"isPreview":[516,"is-preview"],"containerId":[32],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-dropdown",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-initial",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"disabled":[516],"initials":[513],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"initialid":[513],"isPreview":[516,"is-preview"],"showingProperties":[32],"focused":[32],"menuOpen":[32],"tempInitials":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-radio",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"required":[516],"done":[516],"editable":[516],"moveable":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-signature",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"name":[513],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"signatureid":[513],"isPreview":[516,"is-preview"],"showingProperties":[32],"focused":[32],"menuOpen":[32],"tempSignature":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[0,"blur","handleBlur"],[0,"blur","onBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-textarea",{"endpoint":[16],"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-textbox",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"multiline":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[514],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-field-timestamp",{"source":[513],"sourceid":[513],"fieldname":[513],"field":[16],"isPreview":[516,"is-preview"],"disabled":[516],"editable":[516],"moveable":[516],"done":[516],"xscale":[514],"yscale":[514],"pagenumber":[2],"showingProperties":[32],"focused":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]},[[2,"blur","handleBlur"]],{"editable":[{"onEditableChanged":0}]}],[0,"verdocs-upload-dialog",{"maxSize":[1026,"max-size"],"existingFile":[1032,"existing-file"],"draggingOver":[32],"confirmDelete":[32],"selectedFiles":[32],"errorMessage":[32]}]]]]'),t)]}}))}))}))}}}));
2
2
  //# sourceMappingURL=p-BdZ5Ghsa.system.js.map
@@ -0,0 +1,8 @@
1
+ import{r as e,c as t,h as i,H as s,F as n,g as o}from"./p-CjTHbolG.js";import{i as r}from"./p-COaijEV0.js";import{VerdocsEndpoint as l,getTemplate as a,integerSequence as d,getBrands as c,getOrganization as h,formatFullName as f,getOrganizationContacts as u,isValidEmail as p,createEnvelope as v,getRGBA as m,createTemplateDocument as g,deleteTemplateDocument as x,updateField as b,createField as w,updateTemplateRole as y,createTemplateRole as k}from"@verdocs/js-sdk";import{a as E,g as S,h as C,i as q,j as M,d as T,k as I}from"./p-CGsVCy75.js";import{S as z}from"./p-C1sRVZWv.js";import{S as D}from"./p-C7hFgM52.js";import{D as L,g as H}from"./p-Cq60Emo_.js";import{u as Z}from"./p-7UEjZarN.js";import{V as O}from"./p-D97GxsI-.js";import{a as _,P as V,J as N,b as R,F as j,c as A,T as B,D as U}from"./p-DobS6Y7w.js";import"./p-B85MJLTf.js";import"./p-BglCURB-.js";import"./p-CIxfEdV7.js";const $=()=>`verdocs-preview{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}`;const P=class{constructor(i){e(this,i);this.sdkError=t(this,"sdkError");this.templateListenerId=null;this.renderedPages={};this.endpoint=l.getDefault();this.templateId=null;this.loading=true;this.template=null}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();D.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){D.store.delListener(this.templateListenerId);this.templateListenerId=null}}onTemplateIdChanged(e){console.log("[PREVIEW] Template ID changed",e);this.listenToTemplate()}async componentWillLoad(){var e,t,i;try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[PREVIEW] Unable to start builder session, must be authenticated");return}if(!this.templateId){console.log(`[PREVIEW] Missing required template ID ${this.templateId}`);return}this.listenToTemplate()}catch(s){console.log("[PREVIEW] Error with preview session",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new z(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data))}}componentDidRender(){var e;(e=this.hostEl)===null||e===void 0?void 0:e.querySelectorAll(".verdocs-field").forEach((e=>{r(e).unset()}))}handlePageRendered(e){var t;const i=e.detail;this.renderedPages[`${i.documentId}:${i.pageNumber}`]=i;const s=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).filter((e=>{if(e["document_id"]){return e["document_id"]===i.documentId&&e.page===i.pageNumber}return e.page===i.pageNumber}));s.forEach((e=>E("template",e,i,{disabled:true,editable:false,draggable:false})))}render(){var e;if(this.loading){return i(s,null,i("verdocs-loader",null))}return i(s,null,(((e=this.template)===null||e===void 0?void 0:e.documents)||[]).map((e=>{const t=d(1,e.pages);return i(n,null,t.map((t=>{var s;const n=((s=e.page_sizes)===null||s===void 0?void 0:s[t])||{width:612,height:792};return i("verdocs-template-document-page",{templateId:e.template_id,documentId:e.id,pageNumber:t,disabled:true,editable:false,done:false,virtualWidth:n.width,virtualHeight:n.height,onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))})))}get hostEl(){return o(this)}static get watchers(){return{templateId:[{onTemplateIdChanged:0}]}}};P.style=$();const F=e=>((e===null||e===void 0?void 0:e.roles)||[]).map((e=>e.name));const W=(e,t)=>Math.max(F(e).findIndex((e=>e===t)),0);const Q=()=>`verdocs-send{--send-ink:var(--verdocs-body-color, #111827);--send-ink-2:#374151;--send-muted:#6b7280;--send-faint:#9ca3af;--send-rule:#e5e7eb;--send-control-border:#d1d5db;--send-accent:var(--verdocs-link-color, #4c56cb);--send-accent-tint:#f4f5fc;--send-accent-tint-2:#e6e7f8;--send-warning-bg:#fffbeb;--send-warning-border:#fde68a;--send-warning-icon:#d97706;--send-warning-text:#78350f;--send-radius:var(--verdocs-dialog-radius, 8px);--send-min-height:480px;--send-max-width:480px;display:none;position:relative;overflow:hidden;width:100%;max-width:var(--verdocs-send-max-width, var(--send-max-width));-webkit-box-sizing:border-box;box-sizing:border-box;background:#ffffff;color:var(--send-ink);font-size:14px;border-radius:var(--send-radius);border:1px solid var(--send-rule);font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-send *{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-send.sendable{display:block}verdocs-send .track{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-height:var(--send-min-height);-webkit-transition:-webkit-transform 220ms ease-out;transition:-webkit-transform 220ms ease-out;transition:transform 220ms ease-out;transition:transform 220ms ease-out, -webkit-transform 220ms ease-out}verdocs-send.detail-open .track{-webkit-transform:translateX(-100%);transform:translateX(-100%)}@media (prefers-reduced-motion: reduce){verdocs-send .track{-webkit-transition:none;transition:none}}verdocs-send .pane{padding:16px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-send .main-pane{-ms-flex:1;flex:1}verdocs-send .detail-pane{position:absolute;top:0;left:100%;bottom:0;width:100%;overflow:hidden}verdocs-send .detail{-ms-flex:1;flex:1;min-height:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-send .detail-body-wrap{position:relative;-ms-flex:1;flex:1;min-height:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-send .detail-body{-ms-flex:1;flex:1;min-height:0;overflow-y:auto}verdocs-send .scroll-fade{position:absolute;left:0;right:0;bottom:0;height:36px;opacity:0;pointer-events:none;-webkit-transition:opacity 150ms ease-out;transition:opacity 150ms ease-out;background:-webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(#ffffff));background:linear-gradient(rgba(255, 255, 255, 0), #ffffff)}verdocs-send .scrollable:not(.at-end)>.scroll-fade{opacity:1}verdocs-send .recipient-detail verdocs-contact-picker{-ms-flex:1;flex:1;min-height:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-send .section-title{font-size:12px;font-weight:600;color:var(--send-ink-2);margin:0 0 6px 0}verdocs-send .delivery-title{margin-top:16px}verdocs-send .step{font-size:11px;color:var(--send-muted);padding:10px 0 4px 0}verdocs-send .recipient,verdocs-send .kv{all:unset;display:-ms-flexbox;display:flex;width:100%;cursor:pointer;-ms-flex-align:center;align-items:center;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;border-top:1px solid var(--send-rule);color:var(--send-ink);font-family:inherit}verdocs-send .recipient:focus-visible,verdocs-send .kv:focus-visible{outline:2px solid var(--send-accent);outline-offset:-2px;border-radius:4px}verdocs-send .recipient .chevron,verdocs-send .kv .chevron{-ms-flex:0 0 16px;flex:0 0 16px;width:16px;height:16px;color:var(--send-faint)}verdocs-send .recipient .chevron svg,verdocs-send .kv .chevron svg{width:16px;height:16px;display:block}verdocs-send .recipient{padding:8px 6px 8px 0}verdocs-send .recipient:last-child{border-bottom:1px solid var(--send-rule)}verdocs-send .recipient .who{-ms-flex:1;flex:1;min-width:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-send .recipient .role-name{font-size:13px;font-weight:600}verdocs-send .recipient .who-detail{font-size:12px;color:var(--send-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-send .recipient .who-detail.configure{color:var(--send-accent);font-weight:500}verdocs-send .recipient .options{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:4px;margin-top:3px}verdocs-send .recipient .pill{height:18px;padding:0 6px;border-radius:999px;font-size:10px;font-weight:500;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;background:var(--send-accent-tint);color:var(--send-ink-2)}verdocs-send .role-dot{-ms-flex:0 0 10px;flex:0 0 10px;width:10px;height:10px;border-radius:50%;border:1px solid rgba(0, 0, 0, 0.1)}verdocs-send .kv{height:40px;padding:0 6px 0 0;font-size:13px}verdocs-send .kv:last-child{border-bottom:1px solid var(--send-rule)}verdocs-send .kv:disabled{cursor:default;color:var(--send-muted)}verdocs-send .kv .key{-ms-flex:0 0 84px;flex:0 0 84px;color:var(--send-muted)}verdocs-send .kv .value{-ms-flex:1;flex:1;min-width:0;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-send .kv .value small{font-size:inherit;font-weight:400;color:var(--send-muted)}verdocs-send .kv .value.off{color:var(--send-warning-icon)}verdocs-send .main-spacer,verdocs-send .detail-spacer{-ms-flex:1;flex:1}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:14px;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}verdocs-send .buttons .error-message{width:100%;color:#cc0000;font-size:13px;margin-bottom:10px}verdocs-send .detail-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin:-2px 0 14px 0}verdocs-send .detail-header .back{all:unset;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;cursor:pointer;font-size:13px;font-weight:500;color:var(--send-accent);font-family:inherit;-ms-flex:0 0 52px;flex:0 0 52px}verdocs-send .detail-header .back .icon,verdocs-send .detail-header .back .icon svg{width:16px;height:16px;display:block}verdocs-send .detail-header .back:focus-visible{outline:2px solid var(--send-accent);outline-offset:2px;border-radius:4px}verdocs-send .detail-header .detail-title{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;font-size:14px;font-weight:600;text-align:center}verdocs-send .detail-header .detail-header-spacer{-ms-flex:0 0 52px;flex:0 0 52px}verdocs-send .detail-footer{margin-top:10px;padding-top:12px;border-top:1px solid var(--send-rule)}verdocs-send .detail-footer verdocs-button,verdocs-send .detail-footer verdocs-button button{width:100%}verdocs-send .hint{font-size:12px;line-height:1.5;color:var(--send-muted);margin:10px 0 0 0}verdocs-send .option-list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-send .option{all:unset;display:-ms-flexbox;display:flex;width:100%;cursor:pointer;-ms-flex-align:center;align-items:center;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;padding:10px 0;font-size:13px;font-family:inherit;color:var(--send-ink);border-top:1px solid var(--send-rule)}verdocs-send .option:first-child{border-top:0}verdocs-send .option:focus-visible{outline:2px solid var(--send-accent);outline-offset:-2px;border-radius:4px}verdocs-send .option .radio{-ms-flex:0 0 16px;flex:0 0 16px;width:16px;height:16px;border-radius:50%;border:1px solid var(--send-control-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-send .option.selected .radio{border-color:var(--send-accent)}verdocs-send .option.selected .radio::after{content:"";width:8px;height:8px;border-radius:50%;background:var(--send-accent)}verdocs-send .option .swatch{-ms-flex:0 0 22px;flex:0 0 22px;width:22px;height:22px;border-radius:5px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-size:9px;font-weight:700;color:#ffffff;overflow:hidden}verdocs-send .option .swatch.logo{background:#ffffff;border:1px solid var(--send-rule)}verdocs-send .option .swatch img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain;display:block}verdocs-send .option .option-label{-ms-flex:1;flex:1;min-width:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-send .option .option-label small{font-size:11px;color:var(--send-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-send .option-divider{height:0;margin:2px 0;border-top:1px solid var(--send-control-border)}verdocs-send .option-divider+.option{border-top:0}verdocs-send .hint a{color:var(--send-accent);font-weight:500;text-decoration:none;border-bottom:1px solid var(--send-accent-tint-2)}verdocs-send .hint a .icon,verdocs-send .hint a .icon svg{width:11px;height:11px;display:inline-block;vertical-align:-1px;margin-left:2px}verdocs-send .expires-field{position:relative}verdocs-send .expires-field input{width:100%;height:36px;padding:0 52px 0 10px;font-size:14px;font-family:inherit;color:var(--send-ink);background:#ffffff;border:1px solid var(--send-control-border);border-radius:6px;outline:none}verdocs-send .expires-field input:focus{border-color:var(--send-accent);-webkit-box-shadow:0 0 0 2px var(--send-accent-tint-2);box-shadow:0 0 0 2px var(--send-accent-tint-2)}verdocs-send .expires-field input::-webkit-input-placeholder{color:var(--send-faint)}verdocs-send .expires-field input::-moz-placeholder{color:var(--send-faint)}verdocs-send .expires-field input:-ms-input-placeholder{color:var(--send-faint)}verdocs-send .expires-field input::-ms-input-placeholder{color:var(--send-faint)}verdocs-send .expires-field input::placeholder{color:var(--send-faint)}verdocs-send .expires-field .suffix{position:absolute;right:10px;top:0;height:36px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;font-size:13px;color:var(--send-muted);pointer-events:none}verdocs-send .sender-field{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;row-gap:4px;margin:0 0 10px 0}verdocs-send .sender-field label{font-size:12px;font-weight:500;color:var(--send-ink-2)}verdocs-send .sender-field input{width:100%;height:36px;padding:0 10px;font-size:14px;font-family:inherit;color:var(--send-ink);background:#ffffff;border:1px solid var(--send-control-border);border-radius:6px;outline:none}verdocs-send .sender-field input:focus{border-color:var(--send-accent);-webkit-box-shadow:0 0 0 2px var(--send-accent-tint-2);box-shadow:0 0 0 2px var(--send-accent-tint-2)}verdocs-send .sender-field .field-error{font-size:12px;color:#cc0000}verdocs-send .notice{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-top:4px;padding:10px 12px;font-size:12px;line-height:1.5;border-radius:6px;color:var(--send-ink-2);background:var(--send-accent-tint);border:1px solid var(--send-accent-tint-2)}verdocs-send .notice>.icon{-ms-flex:0 0 18px;flex:0 0 18px;width:18px;height:18px;margin-top:1px;color:var(--send-accent)}verdocs-send .notice>.icon svg{width:18px;height:18px;display:block}verdocs-send .warning{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-top:12px;padding:10px 12px;font-size:12px;line-height:1.5;border-radius:6px;color:var(--send-warning-text);background:var(--send-warning-bg);border:1px solid var(--send-warning-border)}verdocs-send .warning>.icon{-ms-flex:0 0 18px;flex:0 0 18px;width:18px;height:18px;margin-top:1px;color:var(--send-warning-icon)}verdocs-send .warning>.icon svg{width:18px;height:18px;display:block}verdocs-send .warning a{color:var(--send-accent);font-weight:500;text-decoration:none;border-bottom:1px solid var(--send-accent-tint-2)}verdocs-send .warning a .icon,verdocs-send .warning a .icon svg{width:11px;height:11px;display:inline-block;vertical-align:-1px;margin-left:2px}verdocs-send verdocs-checkbox{display:block;padding:4px 0;font-size:13px}`;const Y='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 6 6 6-6 6"/></svg>';const J='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m15 18-6-6 6-6"/></svg>';const G='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/><path d="M12 9v4M12 17h.01"/></svg>';const X='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4M12 8h.01"/></svg>';const K='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h6v6M10 14 21 3M21 14v7H3V3h7"/></svg>';const ee="https://app.verdocs.com/assets/blue-logo.svg";const te=.25;const ie=60;const se=500;const ne=1;const oe=120;const re=120;const le={email:"Email",passcode:"Passcode",sms:"SMS",kba:"KBA",id:"ID check"};const ae=class{constructor(i){e(this,i);this.beforeSend=t(this,"beforeSend");this.send=t(this,"send");this.exit=t(this,"exit");this.sdkError=t(this,"sdkError");this.searchContacts=t(this,"searchContacts");this.templateListenerId=null;this.endpoint=L;this.templateId=null;this.environment="";this.showCancel=true;this.brandKey="";this.swipeStart=null;this.swallowNextClick=false;this.loadedOrganizationId="";this.containerId=`verdocs-send-${Math.random().toString(36).substring(2,11)}`;this.view="main";this.editingRoleId="";this.sessionContacts=[];this.sending=false;this.brands=[];this.organization=null;this.expiresInDays="";this.noContact=false;this.senderDefaults={name:"",email:""};this.senderName="";this.senderEmail="";this.rolesCompleted={};this.loading=true;this.template=null}disconnectedCallback(){this.unlistenToTemplate()}componentDidLoad(){this.el.addEventListener("click",(e=>{if(this.swallowNextClick){this.swallowNextClick=false;e.stopPropagation();e.preventDefault()}}),true)}componentDidRender(){var e,t;Z(this.el.querySelector(".detail-body"));(e=this.el.querySelector(".main-pane"))===null||e===void 0?void 0:e.toggleAttribute("inert",this.view!=="main");(t=this.el.querySelector(".detail-pane"))===null||t===void 0?void 0:t.toggleAttribute("inert",this.view==="main")}async listenToTemplate(){console.log("[SEND] Loading template",this.templateId);this.unlistenToTemplate();D.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),true,(e=>{console.log("[SEND] Got new template",e);this.template=e;this.loading=false;this.rolesCompleted={};this.view="main";this.editingRoleId="";this.recomputeRolesCompleted();this.loadBrands()}))}loadBrands(){var e;const t=(e=this.template)===null||e===void 0?void 0:e.organization_id;if(!t||t===this.loadedOrganizationId){return}const i=!!this.loadedOrganizationId;this.loadedOrganizationId=t;this.brands=[];this.organization=null;if(i){this.brandKey=""}const s=()=>{var e;return((e=this.template)===null||e===void 0?void 0:e.organization_id)===t};c(this.endpoint,t).then((e=>{if(s()){this.brands=e||[]}})).catch((e=>console.log("[SEND] Unable to load brands",e)));h(this.endpoint,t).then((e=>{if(s()){this.organization=e}})).catch((e=>console.log("[SEND] Unable to load organization",e)))}handleExpiryInput(e){const t=(e.target.value||"").replace(/[^0-9]/g,"");this.expiresInDays=t?String(Math.min(Math.max(Number(t),ne),oe)):"";e.target.value=this.expiresInDays}effectiveExpiryDays(){const e=Number(this.expiresInDays);return e>=ne?e:re}expiresAt(){return new Date(Date.now()+this.effectiveExpiryDays()*24*60*60*1e3)}unlistenToTemplate(){if(this.templateListenerId){D.store.delListener(this.templateListenerId);this.templateListenerId=null}}async reset(){this.rolesCompleted={};this.view="main";this.editingRoleId="";this.brandKey="";this.expiresInDays="";this.noContact=false;this.senderName="";this.senderEmail=""}effectiveSenderName(){return this.senderName||this.senderDefaults.name}effectiveSenderEmail(){return this.senderEmail||this.senderDefaults.email}senderOverrides(){const e=this.senderName.trim();const t=this.senderEmail.trim();return{sender_name:e&&e!==this.senderDefaults.name?e:undefined,sender_email:t&&t!==this.senderDefaults.email?t:undefined}}onTemplateIdChanged(e){console.log("[SEND] Template ID changed",e);this.listenToTemplate()}async componentWillLoad(){var e,t,i;try{this.endpoint.onSessionChanged(((e,t,i)=>{if(!i){return}const s={id:i.id,first_name:i.first_name,last_name:i.last_name,email:i.email,phone:i.phone};if(i){this.senderDefaults={name:f(i),email:i.email||""};this.sessionContacts=[s];u(this.endpoint).then((e=>{console.log("[SEND] Got contacts",e);this.sessionContacts=[...e,s]})).catch((e=>{console.log("[SEND] Error getting contacts",e)}))}}));this.endpoint.loadSession();if(!this.endpoint.session){console.log("[SEND] Unable to start Send operation, must be authenticated");return}if(!this.templateId){console.log(`[SEND] Missing required template ID ${this.templateId}`);return}this.listenToTemplate()}catch(s){console.log("[SEND] Error with send session",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new z(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data))}}recomputeRolesCompleted(){var e;this.rolesCompleted={};const t={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((e=>{const i=e.sequence;t[i]||(t[i]=[]);const s=`r-${i}-${t[i].length}`;t[i].push({...e,id:s,role_name:e.name,first_name:e.first_name,last_name:e.last_name});if(e.first_name&&p(e.email)){this.rolesCompleted[s]={...e,id:s,role_name:e.name,first_name:e.first_name,last_name:e.last_name}}}))}getSequenceNumbers(){var e;const t={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((e=>{t[e.sequence]=true}));return Object.keys(t).map((e=>+e)).sort(((e,t)=>e-t))}getRolesAtLevel(e){var t;const i=(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).filter((t=>t.sequence===e)).map(((t,i)=>({...t,id:`r-${e}-${i}`,role_name:t.name,first_name:t.first_name,last_name:t.last_name})));return i}getRoleById(e){for(const t of this.getSequenceNumbers()){const i=this.getRolesAtLevel(t).find((t=>t.id===e));if(i){return i}}return null}getRecipientOptionLabels(e){if(!e){return[]}const t=(e.auth_methods||[]).filter((e=>e!=="email")).map((e=>le[e]||e));if(e.delegator){t.push("May delegate")}if(e.name_locked){t.push("Name locked")}return t}getDefaultBrand(){var e;const t=(e=this.organization)===null||e===void 0?void 0:e.default_brand_id;return t&&this.brands.find((e=>e.id===t))||null}getDefaultBrandLabel(){var e;const t=(e=this.getDefaultBrand())===null||e===void 0?void 0:e.name;return`Default (${t||"Verdocs"})`}getSelectedBrandLabel(){if(!this.brandKey){return this.getDefaultBrandLabel()}const e=this.brands.find((e=>e.key===this.brandKey));return(e===null||e===void 0?void 0:e.name)||(e===null||e===void 0?void 0:e.key)||this.brandKey}showView(e){this.view=e}handleSelectContact(e,t){e.preventDefault();this.rolesCompleted={...this.rolesCompleted,[t.id]:{...t,...e.detail}};this.editingRoleId="";this.view="main"}handleClickRole(e,t){e.stopPropagation();this.editingRoleId=t.id;this.view="recipient"}handleSend(e){var t;if(this.sending){console.log("[SEND] Skipping duplicate send",e);return}console.log("[SEND] Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;const i=Intl.DateTimeFormat().resolvedOptions();const s={template_id:this.templateId,name:((t=this.template)===null||t===void 0?void 0:t.name)||"New Envelope",environment:this.environment,initial_reminder:0,followup_reminders:0,recipients:Object.values(this.rolesCompleted),timezone:i.timeZone,locale:i.locale,expires_at:this.expiresAt().toISOString()};s.no_contact=this.noContact;const{sender_name:n,sender_email:o}=this.senderOverrides();if(n){s.sender_name=n}if(o){s.sender_email=o}if(this.brandKey){s.brand_key=this.brandKey}const r=this.beforeSend.emit({...s,name:s.name,template:this.template});if(r.defaultPrevented){console.log("[SEND] Send cancelled by parent",s);this.sending=false;return}console.log("[SEND] Creating envelope",s);v(this.endpoint,s).then((e=>{var t;console.log("[SEND] Send envelope",e);this.reset().catch((e=>console.log("Unknown Error",e)));this.sending=false;(t=this.send)===null||t===void 0?void 0:t.emit({...s,name:s.name,envelope_id:e.id,envelope:e})})).catch((e=>{var t,i,s;console.log("[SEND] Send error",e);O(((i=(t=e.response)===null||t===void 0?void 0:t.data)===null||i===void 0?void 0:i.error)||"Error creating envelope, please try again later.");this.sending=false;(s=this.sdkError)===null||s===void 0?void 0:s.emit(e)}))}handleCancel(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()}handleSwipeStart(e){var t,i;this.swallowNextClick=false;const s=e.currentTarget;const n=s.getBoundingClientRect();const o=!!((i=(t=e.target)===null||t===void 0?void 0:t.closest)===null||i===void 0?void 0:i.call(t,"input, textarea, select, [contenteditable]"));if(this.view==="main"||o||e.clientX-n.left>n.width*te){this.swipeStart=null;return}this.swipeStart={x:e.clientX,y:e.clientY,time:Date.now()}}handleSwipeEnd(e){const t=this.swipeStart;this.swipeStart=null;if(!t){return}const i=e.clientX-t.x;const s=Math.abs(e.clientY-t.y);if(i>=ie&&i>s&&Date.now()-t.time<=se){this.swallowNextClick=true;this.showView("main")}}renderDetailHeader(e){return i("div",{class:"detail-header"},i("button",{type:"button",class:"back",onClick:()=>this.showView("main")},i("span",{class:"icon",innerHTML:J}),"Back"),i("div",{class:"detail-title"},e),i("div",{class:"detail-header-spacer"}))}renderDetailBody(e){return i("div",{class:"detail-body-wrap"},i("div",{class:"detail-body",onScroll:e=>Z(e.target)},e),i("div",{class:"scroll-fade"}))}renderDoneButton(){return i("div",{class:"detail-footer"},i("verdocs-button",{label:"Done",size:"small",onClick:()=>this.showView("main")}))}renderRecipientView(){var e;const t=this.getRoleById(this.editingRoleId);if(!t){return i("div",{class:"detail recipient-detail"},this.renderDetailHeader("Recipient"))}const s=W(this.template,t.role_name);return i("div",{class:"detail recipient-detail"},this.renderDetailHeader([i("span",{class:"role-dot",style:{backgroundColor:m(s)}}),t.role_name]),i("verdocs-contact-picker",{key:t.id,showCancel:false,onExit:()=>this.showView("main"),onNext:e=>this.handleSelectContact(e,t),contactSuggestions:this.sessionContacts,templateRole:(e=this.rolesCompleted[t.id])!==null&&e!==void 0?e:t,onSearchContacts:e=>{var t;return(t=this.searchContacts)===null||t===void 0?void 0:t.emit(e.detail)}}))}renderBrandSwatch(e,t){const s=(e===null||e===void 0?void 0:e.favicon_url)||(e===null||e===void 0?void 0:e.thumbnail_url)||(e?null:ee);if(s){return i("span",{class:"swatch logo"},i("img",{src:s,alt:""}))}return i("span",{class:"swatch",style:{backgroundColor:(e===null||e===void 0?void 0:e.primary_color)||"#4c56cb"}},t.substring(0,2).toUpperCase())}renderBrandOption(e,t,s,n){return i("button",{type:"button",class:{option:true,selected:this.brandKey===e},onClick:()=>this.brandKey=e},i("span",{class:"radio"}),n,i("span",{class:"option-label"},t,i("small",null,s)))}renderBrandView(){const e=this.getDefaultBrand();const t=this.brands.filter((t=>t.id!==(e===null||e===void 0?void 0:e.id))).sort(((e,t)=>(e.name||e.key).localeCompare(t.name||t.key)));const s=this.brands.length>0;return i("div",{class:"detail"},this.renderDetailHeader("Brand"),this.renderDetailBody([i("div",{class:"option-list"},this.renderBrandOption("",this.getDefaultBrandLabel(),"Organization default",this.renderBrandSwatch(e,(e===null||e===void 0?void 0:e.name)||"V")),t.length>0&&i("div",{class:"option-divider"}),t.map((e=>this.renderBrandOption(e.key,e.name||e.key,e.key,this.renderBrandSwatch(e,e.name||e.key))))),!s&&i("p",{class:"hint"},"Configure the look and feel of the signing experience by"," ",i("a",{href:`${H(this.endpoint)}/settings/branding`,target:"_blank",rel:"noopener"},"Creating a Brand",i("span",{class:"icon",innerHTML:K})),".")]),this.renderDoneButton())}renderExpiresView(){const e=this.expiresAt();const t=`${e.toLocaleDateString(undefined,{month:"short",day:"numeric",year:"numeric"})} at ${e.toLocaleTimeString(undefined,{hour:"numeric",minute:"2-digit"})}`;return i("div",{class:"detail"},this.renderDetailHeader("Expiration"),this.renderDetailBody([i("div",{class:"expires-field"},i("input",{type:"text",inputMode:"numeric","aria-label":"Expires in (days)",placeholder:String(re),value:this.expiresInDays,disabled:this.sending,onInput:e=>this.handleExpiryInput(e)}),i("span",{class:"suffix"},"days")),i("p",{class:"hint"},"This envelope will expire on ",t,". Expirations may be set from ",ne,"-",oe," days. If left blank, this will default to ",re,".")]),this.renderDoneButton())}renderSenderView(){const e=!this.senderEmail.trim()||p(this.senderEmail.trim());return i("div",{class:"detail"},this.renderDetailHeader("Sender"),this.renderDetailBody([i("div",{class:"sender-field"},i("label",{htmlFor:`${this.containerId}-sender-name`},"Name"),i("input",{id:`${this.containerId}-sender-name`,type:"text",value:this.effectiveSenderName(),disabled:this.sending,onInput:e=>this.senderName=e.target.value})),i("div",{class:"sender-field"},i("label",{htmlFor:`${this.containerId}-sender-email`},"Email"),i("input",{id:`${this.containerId}-sender-email`,type:"email",value:this.effectiveSenderEmail(),disabled:this.sending,onInput:e=>this.senderEmail=e.target.value}),!e&&i("div",{class:"field-error"},"Enter a valid email address.")),i("div",{class:"notice"},i("span",{class:"icon",innerHTML:X}),i("div",null,"These set the name recipients see as the sender and where replies and notifications go. Messages are still delivered from the Verdocs address; a custom sender configured under Settings is needed for delivery from your own domain."))]),this.renderDoneButton())}renderNotificationsView(){return i("div",{class:"detail"},this.renderDetailHeader("Notifications"),this.renderDetailBody([i("verdocs-checkbox",{size:"small",label:"Disable notifications",checked:this.noContact,onInput:e=>this.noContact=!!e.target.checked}),this.noContact&&i("div",{class:"warning"},i("span",{class:"icon",innerHTML:G}),i("div",null,"Disabling notifications turns off invitations and reminders to recipients as well as status updates to you. You may obtain invite links in the recipient summary or via an API call. We strongly recommend enabling"," ",i("a",{href:`${H(this.endpoint)}/settings/webhooks`,target:"_blank",rel:"noopener"},"Webhooks",i("span",{class:"icon",innerHTML:K}))," ","to help automate this process."))]),this.renderDoneButton())}renderDetail(){switch(this.view){case"recipient":return this.renderRecipientView();case"brand":return this.renderBrandView();case"expires":return this.renderExpiresView();case"notifications":return this.renderNotificationsView();case"sender":return this.renderSenderView();default:return null}}render(){var e;if(this.loading){return i(s,null,i("verdocs-loader",null))}if(!this.endpoint.session){return i(s,{style:{display:"flex"}},i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}const t=this.getSequenceNumbers();const n=Object.values(this.rolesCompleted).filter((e=>p(e.email)&&e.first_name&&e.last_name));const o=n.length>=F(this.template).length;const r=n.map((e=>e.email.toLowerCase()));const l=new Set(r).size<r.length;const a=this.expiresAt();const d=a.toLocaleDateString(undefined,{month:"short",day:"numeric"});return i(s,{class:{sendable:(e=this.template)===null||e===void 0?void 0:e.is_sendable,"detail-open":this.view!=="main"}},i("div",{class:"track"},i("div",{class:"pane main-pane","aria-hidden":this.view!=="main"?"true":"false"},i("div",{class:"section-title"},"Recipients"),i("div",{class:"recipients"},t.map((e=>[t.length>1&&i("div",{class:"step"},"Step ",e),this.getRolesAtLevel(e).map((e=>{const t=W(this.template,e.role_name);const s=this.rolesCompleted[e.id];const o=s&&n.findIndex((t=>t.role_name===e.role_name))>-1;const r=this.getRecipientOptionLabels(s);return i("button",{type:"button",class:"recipient","data-ri":t,"data-rn":e.role_name,onClick:t=>this.handleClickRole(t,e)},i("span",{class:"role-dot",style:{backgroundColor:m(t)}}),i("span",{class:"who"},i("span",{class:"role-name"},e.role_name),o?i("span",{class:"who-detail"},f(s)," · ",s.email):i("span",{class:"who-detail configure"},"Configure recipient"),r.length>0&&i("span",{class:"options"},r.map((e=>i("span",{class:"pill"},e))))),i("span",{class:"chevron",innerHTML:Y}))}))]))),i("div",{class:"section-title delivery-title"},"Delivery"),i("div",{class:"delivery"},i("button",{type:"button",class:"kv",onClick:()=>this.showView("brand"),disabled:this.sending},i("span",{class:"key"},"Brand"),i("span",{class:"value"},this.getSelectedBrandLabel()),i("span",{class:"chevron",innerHTML:Y})),i("button",{type:"button",class:"kv",onClick:()=>this.showView("expires"),disabled:this.sending},i("span",{class:"key"},"Expires"),i("span",{class:"value"},this.effectiveExpiryDays()," days ",i("small",null,"· ",d)),i("span",{class:"chevron",innerHTML:Y})),i("button",{type:"button",class:"kv",onClick:()=>this.showView("sender"),disabled:this.sending},i("span",{class:"key"},"Sender"),i("span",{class:"value"},this.effectiveSenderName()||this.effectiveSenderEmail(),this.effectiveSenderName()&&this.effectiveSenderEmail()?i("small",null," · ",this.effectiveSenderEmail()):null),i("span",{class:"chevron",innerHTML:Y})),i("button",{type:"button",class:"kv",onClick:()=>this.showView("notifications"),disabled:this.sending},i("span",{class:"key"},"Notifications"),i("span",{class:{value:true,off:this.noContact}},this.noContact?"Off":"On"),i("span",{class:"chevron",innerHTML:Y}))),i("div",{class:"main-spacer"}),i("div",{class:"buttons"},l&&i("div",{class:"error-message"},"Recipients cannot share the same email."),this.sending&&i("verdocs-spinner",null),this.showCancel&&i("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:e=>this.handleCancel(e),disabled:this.sending}),i("verdocs-button",{label:"Send",size:"small",disabled:!o||this.sending||l,onClick:e=>this.handleSend(e)}))),i("div",{class:"pane detail-pane","aria-hidden":this.view==="main"?"true":"false",onPointerDown:e=>this.handleSwipeStart(e),onPointerUp:e=>this.handleSwipeEnd(e),onPointerCancel:()=>this.swipeStart=null},this.renderDetail())))}get el(){return o(this)}static get watchers(){return{templateId:[{onTemplateIdChanged:0}]}}};ae.style=Q();const de=()=>`verdocs-template-attachments{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}`;const ce=class{constructor(i){e(this,i);this.exit=t(this,"exit");this.next=t(this,"next");this.templateUpdated=t(this,"templateUpdated");this.sdkError=t(this,"sdkError");this.templateListenerId=null;this.endpoint=l.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.loading=true;this.template=null}async componentWillLoad(){var e,t,i;try{this.endpoint.loadSession();if(!this.templateId){console.log(`[ROLES] Missing required template ID ${this.templateId}`);return}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return}this.listenToTemplate()}catch(s){console.log("[TEMPLATE ATTACHMENTS] Error loading template",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new z(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data))}}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();D.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){D.store.delListener(this.templateListenerId);this.templateListenerId=null}}handleCancel(e){e.stopPropagation();this.exit.emit()}handleUploadProgress(e){if(e>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=e}}async handleUpload(e){var t,i,s,n;e.stopPropagation();const o=e.detail.file;if(!o){return}console.log("[ATTACHMENTS] Uploading...",o);this.uploading=true;this.progressLabel="Uploading...";try{const e=await g(this.endpoint,this.templateId,o,this.handleUploadProgress.bind(this));console.log("[ATTACHMENTS] Created attachment",e);this.template=await D.getTemplate(this.endpoint,this.templateId,true);console.log("[ATTACHMENTS] Updated template",this.template);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:this.template,event:"attachments"});this.uploading=false;this.progressLabel="";this.progressPercent=0}catch(e){console.log("[ATTACHMENTS] Error creating template",e);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new z(e.message,(s=e.response)===null||s===void 0?void 0:s.status,(n=e.response)===null||n===void 0?void 0:n.data));this.uploading=false}}handleNext(e){var t;e.stopPropagation();this.uploading=false;this.progressLabel="";this.progressPercent=0;(t=this.next)===null||t===void 0?void 0:t.emit({template:this.template})}async confirmDelete(){await x(this.endpoint,this.confirmDeleteDocument.id);this.template=await D.getTemplate(this.endpoint,this.templateId,true);console.log("[ATTACHMENTS] New template",this.template);this.confirmDeleteDocument=null}async handleDelete(e){var t;if((((t=this.template)===null||t===void 0?void 0:t.documents)||[]).length>1){this.confirmDeleteDocument=e}else{this.showDeleteError=true}}getFileIcon(e){switch(e.mime){case"application/pdf":return R;case"image/jpeg":return N;case"image/png":return V;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return _}return j}render(){var e,t;if(!this.endpoint.session){return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading){return i(s,{class:"loading"},i("verdocs-loader",null))}if(!this.endpoint.session||!this.template){return i(s,{class:"empty"})}return i(s,null,i("h5",null,"Existing Attachments"),i("div",{class:"attachments"},(((e=this.template)===null||e===void 0?void 0:e.documents)||[]).map((e=>i("div",{class:"attachment"},i("div",{class:"file-icon",innerHTML:this.getFileIcon(e)}),i("div",{class:"filename",title:e.name},e.name),i("div",{class:"pages"},i("div",{class:"count"},e.pages),i("div",{class:"pages-icon",innerHTML:A})),i("div",{class:"trash-icon",innerHTML:B,onClick:()=>this.handleDelete(e)}))))),i("h5",null,"Attach a New Document"),this.uploading?i("div",{class:"loader-wrapper"},i("verdocs-loader",null),this.progressLabel&&i("div",{class:"progress-wrapper"},i("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):i("verdocs-file-chooser",{onFileSelected:e=>this.handleUpload(e)}),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.uploading}),i("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleNext(e),disabled:!(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).length||this.uploading})),this.showDeleteError&&i("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:()=>this.showDeleteError=false}),this.confirmDeleteDocument&&i("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:()=>this.confirmDelete(),showCancel:true,onExit:()=>{this.confirmDeleteDocument=null}}))}};ce.style=de();const he=()=>`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}`;const fe=class{constructor(i){e(this,i);this.sdkError=t(this,"sdkError");this.stepChanged=t(this,"stepChanged");this.templateListenerId=null;this.endpoint=l.getDefault();this.templateId=null;this.step="preview";this.loading=true;this.template=null}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();D.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){D.store.delListener(this.templateListenerId);this.templateListenerId=null}}onTemplateIdChanged(e){console.log("[BUILD_TABS] Template ID changed",e);this.listenToTemplate()}onStepChanged(e){console.log("[BUILD_TABS] Step changed",e)}async componentWillLoad(){var e,t,i;try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");return}if(!this.templateId){this.step="attachments";console.log("[BUILD_TABS] Missing required template ID, forcing view to attachments");return}this.listenToTemplate()}catch(s){console.log("[BUILD_TABS] Error loading template",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new z(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data))}}handleSelect(e){var t;if(e.disabled||e.id===this.step){return}this.step=e.id;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e.id)}render(){var e,t,n;if(this.loading){return i(s,null,i("verdocs-loader",null))}if(!this.endpoint.session){return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}const o=(((e=this.template)===null||e===void 0?void 0:e.documents)||[]).length>0;const r=o&&(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).length>0;const l=r&&(((n=this.template)===null||n===void 0?void 0:n.fields)||[]).length>0;const a=[{id:"attachments",label:"Attachments",disabled:false},{id:"roles",label:"Workflow",disabled:!o},{id:"fields",label:"Fields",disabled:!r},{id:"preview",label:"Preview & Send",disabled:!l}];return i(s,null,a.map((e=>{const t=e.id===this.step;const s=["tab"];if(t)s.push("active");if(e.disabled)s.push("disabled");return i("div",{class:s.join(" "),onClick:()=>this.handleSelect(e)},i("span",null,e.label),i("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"19",height:"50",viewBox:"0 0 19 50"},i("polygon",{points:"0,0 19,25 0,50",fill:t?"#ffffff":"#e7e7e7"})))})))}static get watchers(){return{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}}};fe.style=he();const ue=()=>`verdocs-template-fields{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .pages .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-template-fields .pages .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-template-fields .pages .document-separator:first-child{margin-top:0}verdocs-template-fields #verdocs-template-fields-toolbar{width:100%;height:50px;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}verdocs-template-fields.placing-attachment{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-checkbox{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' 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' /%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-radio{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url("data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' 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'%3E%3C/path%3E%3C/svg%3E") 16 16, pointer}`;const pe='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>';const ve='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>';const me='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>';const ge='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>';const xe='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>';const be='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>';const we='<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>';const ye='<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>';const ke='<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>';const Ee=[{id:"signature",tooltip:"Signature",icon:xe,class:"signature"},{id:"initial",tooltip:"Initials",icon:be,class:"initial"},{id:"sep1",tooltip:"",icon:ke,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:pe,class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:ve,class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:me,class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:we,class:"dropdown"},{id:"sep2",tooltip:"",icon:ke,class:"separator"},{id:"date",tooltip:"Date",icon:ge,class:"date"},{id:"attachment",tooltip:"Attachment",icon:ye,class:"attachment"}];const Se=class{constructor(i){e(this,i);this.sdkError=t(this,"sdkError");this.templateUpdated=t(this,"templateUpdated");this.templateListenerId=null;this.endpoint=l.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.showMustSelectRole=false;this.selectedRoleName="";this.loading=true;this.template=null;this.pageHeights={};this.cachedPageInfo={}}onTemplateIdChanged(){this.listenToTemplate()}handleKeyDown(e){if(e.key==="Escape"){this.placing=null}}handleFieldSettingsChanged(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"updated-field"})}handleFieldDeleted(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"deleted-field"})}async componentWillLoad(){var e,t,i;try{this.endpoint.loadSession();if(!this.templateId){console.log(`[FIELDS] Missing required template ID ${this.templateId}`);return}if(!this.endpoint.session){console.log("[FIELDS] Unable to start builder session, must be authenticated");return}this.listenToTemplate()}catch(s){console.log("[FIELDS] Error with fields session",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new z(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data))}}componentDidRender(){r.dynamicDrop(true);document.querySelectorAll(".verdocs-field").forEach((e=>{this.makeDraggable(e)}));const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null;const t=document.getElementById("verdocs-template-fields-toolbar");if(e&&t){t.remove();e.append(t)}}componentWillUpdate(){var e,t;const i=[...((e=this.template)===null||e===void 0?void 0:e.roles)||[]].sort(((e,t)=>{var i,s;return((i=e.sequence)!==null&&i!==void 0?i:0)-((s=t.sequence)!==null&&s!==void 0?s:0)}));if(!this.selectedRoleName||!i.find((e=>e&&e.name===this.selectedRoleName))){this.selectedRoleName=((t=i[0])===null||t===void 0?void 0:t.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();D.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),false,(e=>{var t;console.log("Template updated");this.template=e;this.loading=false;if(!this.selectedRoleName){const i=[...e.roles||[]].sort(((e,t)=>{var i,s;return((i=e.sequence)!==null&&i!==void 0?i:0)-((s=t.sequence)!==null&&s!==void 0?s:0)}));this.selectedRoleName=((t=i[0])===null||t===void 0?void 0:t.name)||""}}))}unlistenToTemplate(){if(this.templateListenerId){D.store.delListener(this.templateListenerId);this.templateListenerId=null}}handlePageRendered(e){var t,i;var s,n;const o=e.detail;console.log("[FIELDS] Page rendered",o.documentId,o.pageNumber,o.xScale,o.yScale);(t=(s=this.cachedPageInfo)[n=o.documentId])!==null&&t!==void 0?t:s[n]={};this.cachedPageInfo[o.documentId][o.pageNumber]=o;this.pageHeights[o.pageNumber]=o.naturalHeight;(((i=this.template)===null||i===void 0?void 0:i.fields)||[]).filter((e=>e&&e.page===o.pageNumber)).forEach((e=>{const t=S(e);const i=document.getElementById(t);if(i){i.setAttribute("templateid",this.templateId);i.setAttribute("fieldname",e.name);i.setAttribute("documentid",String(e.document_id));i.setAttribute("pagenumber",String(e.page));i.setAttribute("xScale",String(o.xScale));i.setAttribute("yScale",String(o.yScale));this.makeDraggable(i)}}))}makeDraggable(e){r(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})}async handleMoveField(e){const t=+(e.target.getAttribute("posX")||0);const i=+(e.target.getAttribute("posY")||0);const s=+(e.target.getAttribute("xScale")||1);const n=+(e.target.getAttribute("yScale")||1);const o=e.dx/s+t;const r=e.dy/n+i;e.target.setAttribute("posX",o);e.target.setAttribute("posy",r);C(e.target,"translate",`${o}px, ${r}px`)}async handleMoveEnd(e){var t,i,s,n,o,r,l,a;const d=e.target.getAttribute("fieldname");const c=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).find((e=>e.name===d));if(!c){console.log("[FIELDS] Unable to find field",d,e.target);return}const h=e.target.getAttribute("pagenumber");const f=e.target.getAttribute("documentid");let{naturalWidth:u=612,naturalHeight:p=792,renderedHeight:v=792}=this.cachedPageInfo[f][h];const m=e.target.getBoundingClientRect();const g=e.target.parentElement;const x=g.getBoundingClientRect();const w=c.width||I(c.type);const y=c.height||T(c.type);const k=Math.max(m.left-x.left,0);let E=Math.max(v-(x.bottom-m.bottom),0);let S=parseInt(h);if(E>v){S=Math.min(S+1,((n=(s=((i=this.template)===null||i===void 0?void 0:i.documents)||[])===null||s===void 0?void 0:s[0])===null||n===void 0?void 0:n.pages)||1);E-=v;v=this.cachedPageInfo[f][S].renderedHeight;console.log("Next page",{newPageNumber:S,newY:E,renderedHeight:v})}else if(E<0){S=Math.max(S-1,1);v=this.cachedPageInfo[f][S].renderedHeight;E+=v;console.log("[FIELDS] Next page",{newPageNumber:S,newY:E,renderedHeight:v})}const{x:C,y:L}=this.viewCoordinatesToPageCoordinates(k,E,f,h,u-w,p-y);try{const t={x:C,y:L,page:S};const i=await b(this.endpoint,this.templateId,d,t);console.log("[FIELDS] Updated",i);const s=JSON.parse(JSON.stringify(this.template));const n=s.fields.findIndex((e=>e.name===d));if(n>-1){s.fields[n]=i}D.updateTemplate(this.templateId,s);e.target.removeAttribute("posX");e.target.removeAttribute("posY");q(e.target);const{xScale:r=1,yScale:l=1}=this.cachedPageInfo[f][h];M(e.target,i,r,l);(o=this.templateUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,template:s,event:"updated-field"})}catch(t){O("Error updating field, please try again later",{style:"error"});console.log("[FIELDS] Error updating field",t);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new z(t.message,(l=t.response)===null||l===void 0?void 0:l.status,(a=t.response)===null||a===void 0?void 0:a.data));e.target.removeAttribute("posX");e.target.removeAttribute("posY");q(e.target)}}generateFieldName(e,t){var i;let s=1;let n;do{n=`${e}P${t}-${s}`;s++}while((((i=this.template)===null||i===void 0?void 0:i.fields)||[]).some((e=>e&&e.name===n)));return n}viewCoordinatesToPageCoordinates(e,t,i,s,n,o){const{xScale:r=1,yScale:l=1,renderedHeight:a=792}=this.cachedPageInfo[i][s];const d=Math.floor(Math.min(e/r,n));const c=Math.floor(Math.min(Math.max(a-t,0)/l,o));return{x:d,y:c}}async handleClickPage(e,t,i){var s;if(this.placing){const n=e.offsetX;const o=e.offsetY;const r=I(this.placing);const l=T(this.placing);const a=this.cachedPageInfo[t][i];const{naturalWidth:d=612,naturalHeight:c=792}=a;const h=this.viewCoordinatesToPageCoordinates(n,o,t,i,d-r,c-l);const f=Math.floor(h.x);const u=Math.floor(h.y);const p={name:this.generateFieldName(this.placing,i),role_name:this.selectedRoleName,template_id:this.templateId,document_id:a.documentId,type:this.placing,required:this.placing!=="radio"&&this.placing!=="attachment"&&this.placing!=="checkbox",page:i,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:f,y:u,width:r,height:l,multiline:false,readonly:false,options:this.placing==="radio"?[{id:"option-1",label:"Option 1"}]:[]};const v=await w(this.endpoint,this.templateId,p);console.log("[FIELDS] Created field",v);const m=JSON.parse(JSON.stringify(this.template));m.fields.push(v);D.updateTemplate(this.templateId,m);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,template:m,event:"added-field"});this.placing=null}}render(){var e,t,o;console.log("Rendering");if(this.loading){return i(s,null,i("verdocs-loader",null))}if(!this.endpoint.session){return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}const r=[...((e=this.template)===null||e===void 0?void 0:e.roles)||[]].sort(((e,t)=>{var i,s;return((i=e.sequence)!==null&&i!==void 0?i:0)-((s=t.sequence)!==null&&s!==void 0?s:0)}));const l=r.map((e=>({value:e.name,label:e.full_name?`${e.name}: ${e.full_name}`:e.name})));return i(s,{class:this.placing?{[`placing-${this.placing}`]:true}:{},onSubmit:()=>{}},i("div",{id:"verdocs-template-fields-toolbar"},i("div",{class:"add-for"},"Add field:"),i("verdocs-select-input",{value:this.selectedRoleName,options:l,onInput:e=>this.selectedRoleName=e.target.value}),Ee.map((e=>i("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,class:e.class,onClick:()=>{if(e.tooltip){if(this.selectedRoleName){this.placing=e.id}else{this.showMustSelectRole=true}}}})))),i("div",{class:"pages"},(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).map((e=>{const t=d(1,e.pages);return t.map((t=>{var s;const o=e.page_sizes[t];return i(n,null,((s=this.template)===null||s===void 0?void 0:s.documents.length)>1&&i("div",{class:"document-separator"},i("div",{innerHTML:U}),i("span",null,e.name)),i("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:(o===null||o===void 0?void 0:o.width)||612,virtualHeight:(o===null||o===void 0?void 0:o.height)||792,disabled:true,editable:true,done:false,onClick:i=>this.handleClickPage(i,e.id,t),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))}))}))),this.showMustSelectRole&&i("verdocs-ok-dialog",{heading:"Unable to add field",message:(((o=this.template)===null||o===void 0?void 0:o.roles)||[]).length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=false}))}static get watchers(){return{templateId:[{onTemplateIdChanged:0}]}}};Se.style=ue();
2
+ /**!
3
+ * Sortable 1.15.7
4
+ * @author RubaXa <trash@rubaxa.org>
5
+ * @author owenm <owen23355@gmail.com>
6
+ * @license MIT
7
+ */function Ce(e,t,i){return(t=Le(t))in e?Object.defineProperty(e,t,{value:i,enumerable:true,configurable:true,writable:true}):e[t]=i,e}function qe(){return qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},qe.apply(null,arguments)}function Me(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}function Te(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Me(Object(i),true).forEach((function(t){Ce(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Me(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Ie(e,t){if(null==e)return{};var i,s,n=ze(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],-1===t.indexOf(i)&&{}.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function ze(e,t){if(null==e)return{};var i={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}function De(e,t){if("object"!=typeof e||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,t);if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function Le(e){var t=De(e,"string");return"symbol"==typeof t?t:t+""}function He(e){"@babel/helpers - typeof";return He="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},He(e)}var Ze="1.15.7";function Oe(e){if(typeof window!=="undefined"&&window.navigator){return!!navigator.userAgent.match(e)}}var _e=Oe(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);var Ve=Oe(/Edge/i);var Ne=Oe(/firefox/i);var Re=Oe(/safari/i)&&!Oe(/chrome/i)&&!Oe(/android/i);var je=Oe(/iP(ad|od|hone)/i);var Ae=Oe(/chrome/i)&&Oe(/android/i);var Be={capture:false,passive:false};function Ue(e,t,i){e.addEventListener(t,i,!_e&&Be)}function $e(e,t,i){e.removeEventListener(t,i,!_e&&Be)}function Pe(e,t){if(!t)return;t[0]===">"&&(t=t.substring(1));if(e){try{if(e.matches){return e.matches(t)}else if(e.msMatchesSelector){return e.msMatchesSelector(t)}else if(e.webkitMatchesSelector){return e.webkitMatchesSelector(t)}}catch(e){return false}}return false}function Fe(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function We(e,t,i,s){if(e){i=i||document;do{if(t!=null&&(t[0]===">"?e.parentNode===i&&Pe(e,t):Pe(e,t))||s&&e===i){return e}if(e===i)break}while(e=Fe(e))}return null}var Qe=/\s+/g;function Ye(e,t,i){if(e&&t){if(e.classList){e.classList[i?"add":"remove"](t)}else{var s=(" "+e.className+" ").replace(Qe," ").replace(" "+t+" "," ");e.className=(s+(i?" "+t:"")).replace(Qe," ")}}}function Je(e,t,i){var s=e&&e.style;if(s){if(i===void 0){if(document.defaultView&&document.defaultView.getComputedStyle){i=document.defaultView.getComputedStyle(e,"")}else if(e.currentStyle){i=e.currentStyle}return t===void 0?i:i[t]}else{if(!(t in s)&&t.indexOf("webkit")===-1){t="-webkit-"+t}s[t]=i+(typeof i==="string"?"":"px")}}}function Ge(e,t){var i="";if(typeof e==="string"){i=e}else{do{var s=Je(e,"transform");if(s&&s!=="none"){i=s+" "+i}}while(!t&&(e=e.parentNode))}var n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return n&&new n(i)}function Xe(e,t,i){if(e){var s=e.getElementsByTagName(t),n=0,o=s.length;if(i){for(;n<o;n++){i(s[n],n)}}return s}return[]}function Ke(){var e=document.scrollingElement;if(e){return e}else{return document.documentElement}}function et(e,t,i,s,n){if(!e.getBoundingClientRect&&e!==window)return;var o,r,l,a,d,c,h;if(e!==window&&e.parentNode&&e!==Ke()){o=e.getBoundingClientRect();r=o.top;l=o.left;a=o.bottom;d=o.right;c=o.height;h=o.width}else{r=0;l=0;a=window.innerHeight;d=window.innerWidth;c=window.innerHeight;h=window.innerWidth}if((t||i)&&e!==window){n=n||e.parentNode;if(!_e){do{if(n&&n.getBoundingClientRect&&(Je(n,"transform")!=="none"||i&&Je(n,"position")!=="static")){var f=n.getBoundingClientRect();r-=f.top+parseInt(Je(n,"border-top-width"));l-=f.left+parseInt(Je(n,"border-left-width"));a=r+o.height;d=l+o.width;break}}while(n=n.parentNode)}}if(s&&e!==window){var u=Ge(n||e),p=u&&u.a,v=u&&u.d;if(u){r/=v;l/=p;h/=p;c/=v;a=r+c;d=l+h}}return{top:r,left:l,bottom:a,right:d,width:h,height:c}}function tt(e,t,i){var s=lt(e,true),n=et(e)[t];while(s){var o=et(s)[i],r=void 0;{r=n>=o}if(!r)return s;if(s===Ke())break;s=lt(s,false)}return false}function it(e,t,i,s){var n=0,o=0,r=e.children;while(o<r.length){if(r[o].style.display!=="none"&&r[o]!==bi.ghost&&(s||r[o]!==bi.dragged)&&We(r[o],i.draggable,e,false)){if(n===t){return r[o]}n++}o++}return null}function st(e,t){var i=e.lastElementChild;while(i&&(i===bi.ghost||Je(i,"display")==="none"||t&&!Pe(i,t))){i=i.previousElementSibling}return i||null}function nt(e,t){var i=0;if(!e||!e.parentNode){return-1}while(e=e.previousElementSibling){if(e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==bi.clone&&(!t||Pe(e,t))){i++}}return i}function ot(e){var t=0,i=0,s=Ke();if(e){do{var n=Ge(e),o=n.a,r=n.d;t+=e.scrollLeft*o;i+=e.scrollTop*r}while(e!==s&&(e=e.parentNode))}return[t,i]}function rt(e,t){for(var i in e){if(!e.hasOwnProperty(i))continue;for(var s in t){if(t.hasOwnProperty(s)&&t[s]===e[i][s])return Number(i)}}return-1}function lt(e,t){if(!e||!e.getBoundingClientRect)return Ke();var i=e;var s=false;do{if(i.clientWidth<i.scrollWidth||i.clientHeight<i.scrollHeight){var n=Je(i);if(i.clientWidth<i.scrollWidth&&(n.overflowX=="auto"||n.overflowX=="scroll")||i.clientHeight<i.scrollHeight&&(n.overflowY=="auto"||n.overflowY=="scroll")){if(!i.getBoundingClientRect||i===document.body)return Ke();if(s||t)return i;s=true}}}while(i=i.parentNode);return Ke()}function at(e,t){if(e&&t){for(var i in t){if(t.hasOwnProperty(i)){e[i]=t[i]}}}return e}function dt(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var ct;function ht(e,t){return function(){if(!ct){var i=arguments,s=this;if(i.length===1){e.call(s,i[0])}else{e.apply(s,i)}ct=setTimeout((function(){ct=void 0}),t)}}}function ft(){clearTimeout(ct);ct=void 0}function ut(e,t,i){e.scrollLeft+=t;e.scrollTop+=i}function pt(e){var t=window.Polymer;var i=window.jQuery||window.Zepto;if(t&&t.dom){return t.dom(e).cloneNode(true)}else if(i){return i(e).clone(true)[0]}else{return e.cloneNode(true)}}function vt(e,t,i){var s={};Array.from(e.children).forEach((function(n){var o,r,l,a;if(!We(n,t.draggable,e,false)||n.animated||n===i)return;var d=et(n);s.left=Math.min((o=s.left)!==null&&o!==void 0?o:Infinity,d.left);s.top=Math.min((r=s.top)!==null&&r!==void 0?r:Infinity,d.top);s.right=Math.max((l=s.right)!==null&&l!==void 0?l:-Infinity,d.right);s.bottom=Math.max((a=s.bottom)!==null&&a!==void 0?a:-Infinity,d.bottom)}));s.width=s.right-s.left;s.height=s.bottom-s.top;s.x=s.left;s.y=s.top;return s}var mt="Sortable"+(new Date).getTime();function gt(){var e=[],t;return{captureAnimationState:function t(){e=[];if(!this.options.animation)return;var i=[].slice.call(this.el.children);i.forEach((function(t){if(Je(t,"display")==="none"||t===bi.ghost)return;e.push({target:t,rect:et(t)});var i=Te({},e[e.length-1].rect);if(t.thisAnimationDuration){var s=Ge(t,true);if(s){i.top-=s.f;i.left-=s.e}}t.fromRect=i}))},addAnimationState:function t(i){e.push(i)},removeAnimationState:function t(i){e.splice(rt(e,{target:i}),1)},animateAll:function i(s){var n=this;if(!this.options.animation){clearTimeout(t);if(typeof s==="function")s();return}var o=false,r=0;e.forEach((function(e){var t=0,i=e.target,s=i.fromRect,l=et(i),a=i.prevFromRect,d=i.prevToRect,c=e.rect,h=Ge(i,true);if(h){l.top-=h.f;l.left-=h.e}i.toRect=l;if(i.thisAnimationDuration){if(dt(a,l)&&!dt(s,l)&&(c.top-l.top)/(c.left-l.left)===(s.top-l.top)/(s.left-l.left)){t=bt(c,a,d,n.options)}}if(!dt(l,s)){i.prevFromRect=s;i.prevToRect=l;if(!t){t=n.options.animation}n.animate(i,c,l,t)}if(t){o=true;r=Math.max(r,t);clearTimeout(i.animationResetTimer);i.animationResetTimer=setTimeout((function(){i.animationTime=0;i.prevFromRect=null;i.fromRect=null;i.prevToRect=null;i.thisAnimationDuration=null}),t);i.thisAnimationDuration=t}}));clearTimeout(t);if(!o){if(typeof s==="function")s()}else{t=setTimeout((function(){if(typeof s==="function")s()}),r)}e=[]},animate:function e(t,i,s,n){if(n){Je(t,"transition","");Je(t,"transform","");var o=Ge(this.el),r=o&&o.a,l=o&&o.d,a=(i.left-s.left)/(r||1),d=(i.top-s.top)/(l||1);t.animatingX=!!a;t.animatingY=!!d;Je(t,"transform","translate3d("+a+"px,"+d+"px,0)");this.forRepaintDummy=xt(t);Je(t,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:""));Je(t,"transform","translate3d(0,0,0)");typeof t.animated==="number"&&clearTimeout(t.animated);t.animated=setTimeout((function(){Je(t,"transition","");Je(t,"transform","");t.animated=false;t.animatingX=false;t.animatingY=false}),n)}}}}function xt(e){return e.offsetWidth}function bt(e,t,i,s){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-i.top,2)+Math.pow(t.left-i.left,2))*s.animation}var wt=[];var yt={initializeByDefault:true};var kt={mount:function e(t){for(var i in yt){if(yt.hasOwnProperty(i)&&!(i in t)){t[i]=yt[i]}}wt.forEach((function(e){if(e.pluginName===t.pluginName){throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}}));wt.push(t)},pluginEvent:function e(t,i,s){var n=this;this.eventCanceled=false;s.cancel=function(){n.eventCanceled=true};var o=t+"Global";wt.forEach((function(e){if(!i[e.pluginName])return;if(i[e.pluginName][o]){i[e.pluginName][o](Te({sortable:i},s))}if(i.options[e.pluginName]&&i[e.pluginName][t]){i[e.pluginName][t](Te({sortable:i},s))}}))},initializePlugins:function e(t,i,s,n){wt.forEach((function(e){var n=e.pluginName;if(!t.options[n]&&!e.initializeByDefault)return;var o=new e(t,i,t.options);o.sortable=t;o.options=t.options;t[n]=o;qe(s,o.defaults)}));for(var o in t.options){if(!t.options.hasOwnProperty(o))continue;var r=this.modifyOption(t,o,t.options[o]);if(typeof r!=="undefined"){t.options[o]=r}}},getEventProperties:function e(t,i){var s={};wt.forEach((function(e){if(typeof e.eventProperties!=="function")return;qe(s,e.eventProperties.call(i[e.pluginName],t))}));return s},modifyOption:function e(t,i,s){var n;wt.forEach((function(e){if(!t[e.pluginName])return;if(e.optionListeners&&typeof e.optionListeners[i]==="function"){n=e.optionListeners[i].call(t[e.pluginName],s)}}));return n}};function Et(e){var t=e.sortable,i=e.rootEl,s=e.name,n=e.targetEl,o=e.cloneEl,r=e.toEl,l=e.fromEl,a=e.oldIndex,d=e.newIndex,c=e.oldDraggableIndex,h=e.newDraggableIndex,f=e.originalEvent,u=e.putSortable,p=e.extraEventProperties;t=t||i&&i[mt];if(!t)return;var v,m=t.options,g="on"+s.charAt(0).toUpperCase()+s.substr(1);if(window.CustomEvent&&!_e&&!Ve){v=new CustomEvent(s,{bubbles:true,cancelable:true})}else{v=document.createEvent("Event");v.initEvent(s,true,true)}v.to=r||i;v.from=l||i;v.item=n||i;v.clone=o;v.oldIndex=a;v.newIndex=d;v.oldDraggableIndex=c;v.newDraggableIndex=h;v.originalEvent=f;v.pullMode=u?u.lastPutMode:undefined;var x=Te(Te({},p),kt.getEventProperties(s,t));for(var b in x){v[b]=x[b]}if(i){i.dispatchEvent(v)}if(m[g]){m[g].call(t,v)}}var St=["evt"];var Ct=function e(t,i){var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},n=s.evt,o=Ie(s,St);kt.pluginEvent.bind(bi)(t,i,Te({dragEl:Mt,parentEl:Tt,ghostEl:It,rootEl:zt,nextEl:Dt,lastDownEl:Lt,cloneEl:Ht,cloneHidden:Zt,dragStarted:Jt,putSortable:jt,activeSortable:bi.active,originalEvent:n,oldIndex:Ot,oldDraggableIndex:Vt,newIndex:_t,newDraggableIndex:Nt,hideGhostForTarget:vi,unhideGhostForTarget:mi,cloneNowHidden:function e(){Zt=true},cloneNowShown:function e(){Zt=false},dispatchSortableEvent:function e(t){qt({sortable:i,name:t,originalEvent:n})}},o))};function qt(e){Et(Te({putSortable:jt,cloneEl:Ht,targetEl:Mt,rootEl:zt,oldIndex:Ot,oldDraggableIndex:Vt,newIndex:_t,newDraggableIndex:Nt},e))}var Mt,Tt,It,zt,Dt,Lt,Ht,Zt,Ot,_t,Vt,Nt,Rt,jt,At=false,Bt=false,Ut=[],$t,Pt,Ft,Wt,Qt,Yt,Jt,Gt,Xt,Kt=false,ei=false,ti,ii,si=[],ni=false,oi=[];var ri=typeof document!=="undefined",li=je,ai=Ve||_e?"cssFloat":"float",di=ri&&!Ae&&!je&&"draggable"in document.createElement("div"),ci=function(){if(!ri)return;if(_e){return false}var e=document.createElement("x");e.style.cssText="pointer-events:auto";return e.style.pointerEvents==="auto"}(),hi=function e(t,i){var s=Je(t),n=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),o=it(t,0,i),r=it(t,1,i),l=o&&Je(o),a=r&&Je(r),d=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+et(o).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+et(r).width;if(s.display==="flex"){return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal"}if(s.display==="grid"){return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal"}if(o&&l["float"]&&l["float"]!=="none"){var h=l["float"]==="left"?"left":"right";return r&&(a.clear==="both"||a.clear===h)?"vertical":"horizontal"}return o&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||d>=n&&s[ai]==="none"||r&&s[ai]==="none"&&d+c>n)?"vertical":"horizontal"},fi=function e(t,i,s){var n=s?t.left:t.top,o=s?t.right:t.bottom,r=s?t.width:t.height,l=s?i.left:i.top,a=s?i.right:i.bottom,d=s?i.width:i.height;return n===l||o===a||n+r/2===l+d/2},ui=function e(t,i){var s;Ut.some((function(e){var n=e[mt].options.emptyInsertThreshold;if(!n||st(e))return;var o=et(e),r=t>=o.left-n&&t<=o.right+n,l=i>=o.top-n&&i<=o.bottom+n;if(r&&l){return s=e}}));return s},pi=function e(t){function i(e,t){return function(s,n,o,r){var l=s.options.group.name&&n.options.group.name&&s.options.group.name===n.options.group.name;if(e==null&&(t||l)){return true}else if(e==null||e===false){return false}else if(t&&e==="clone"){return e}else if(typeof e==="function"){return i(e(s,n,o,r),t)(s,n,o,r)}else{var a=(t?s:n).options.group.name;return e===true||typeof e==="string"&&e===a||e.join&&e.indexOf(a)>-1}}}var s={};var n=t.group;if(!n||He(n)!="object"){n={name:n}}s.name=n.name;s.checkPull=i(n.pull,true);s.checkPut=i(n.put);s.revertClone=n.revertClone;t.group=s},vi=function e(){if(!ci&&It){Je(It,"display","none")}},mi=function e(){if(!ci&&It){Je(It,"display","")}};if(ri&&!Ae){document.addEventListener("click",(function(e){if(Bt){e.preventDefault();e.stopPropagation&&e.stopPropagation();e.stopImmediatePropagation&&e.stopImmediatePropagation();Bt=false;return false}}),true)}var gi=function e(t){if(Mt){t=t.touches?t.touches[0]:t;var i=ui(t.clientX,t.clientY);if(i){var s={};for(var n in t){if(t.hasOwnProperty(n)){s[n]=t[n]}}s.target=s.rootEl=i;s.preventDefault=void 0;s.stopPropagation=void 0;i[mt]._onDragOver(s)}}};var xi=function e(t){if(Mt){Mt.parentNode[mt]._isOutsideThisEl(t.target)}};function bi(e,t){if(!(e&&e.nodeType&&e.nodeType===1)){throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e))}this.el=e;this.options=t=qe({},t);e[mt]=this;var i={group:null,sort:true,disabled:false,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:false,invertedSwapThreshold:null,removeCloneOnHide:true,direction:function t(){return hi(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:true,animation:0,easing:null,setData:function e(t,i){t.setData("Text",i.textContent)},dropBubble:false,dragoverBubble:false,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:false,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:false,fallbackClass:"sortable-fallback",fallbackOnBody:false,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:bi.supportPointer!==false&&"PointerEvent"in window&&(!Re||je),emptyInsertThreshold:5};kt.initializePlugins(this,e,i);for(var s in i){!(s in t)&&(t[s]=i[s])}pi(t);for(var n in this){if(n.charAt(0)==="_"&&typeof this[n]==="function"){this[n]=this[n].bind(this)}}this.nativeDraggable=t.forceFallback?false:di;if(this.nativeDraggable){this.options.touchStartThreshold=1}if(t.supportPointer){Ue(e,"pointerdown",this._onTapStart)}else{Ue(e,"mousedown",this._onTapStart);Ue(e,"touchstart",this._onTapStart)}if(this.nativeDraggable){Ue(e,"dragover",this);Ue(e,"dragenter",this)}Ut.push(this.el);t.store&&t.store.get&&this.sort(t.store.get(this)||[]);qe(this,gt())}bi.prototype={constructor:bi,_isOutsideThisEl:function e(t){if(!this.el.contains(t)&&t!==this.el){Gt=null}},_getDirection:function e(t,i){return typeof this.options.direction==="function"?this.options.direction.call(this,t,i,Mt):this.options.direction},_onTapStart:function e(t){if(!t.cancelable)return;var i=this,s=this.el,n=this.options,o=n.preventOnFilter,r=t.type,l=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,a=(l||t).target,d=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||a,c=n.filter;Ii(s);if(Mt){return}if(/mousedown|pointerdown/.test(r)&&t.button!==0||n.disabled){return}if(d.isContentEditable){return}if(!this.nativeDraggable&&Re&&a&&a.tagName.toUpperCase()==="SELECT"){return}a=We(a,n.draggable,s,false);if(a&&a.animated){return}if(Lt===a){return}Ot=nt(a);Vt=nt(a,n.draggable);if(typeof c==="function"){if(c.call(this,t,a,this)){qt({sortable:i,rootEl:d,name:"filter",targetEl:a,toEl:s,fromEl:s});Ct("filter",i,{evt:t});o&&t.preventDefault();return}}else if(c){c=c.split(",").some((function(e){e=We(d,e.trim(),s,false);if(e){qt({sortable:i,rootEl:e,name:"filter",targetEl:a,fromEl:s,toEl:s});Ct("filter",i,{evt:t});return true}}));if(c){o&&t.preventDefault();return}}if(n.handle&&!We(d,n.handle,s,false)){return}this._prepareDragStart(t,l,a)},_prepareDragStart:function e(t,i,s){var n=this,o=n.el,r=n.options,l=o.ownerDocument,a;if(s&&!Mt&&s.parentNode===o){var d=et(s);zt=o;Mt=s;Tt=Mt.parentNode;Dt=Mt.nextSibling;Lt=s;Rt=r.group;bi.dragged=Mt;$t={target:Mt,clientX:(i||t).clientX,clientY:(i||t).clientY};Qt=$t.clientX-d.left;Yt=$t.clientY-d.top;this._lastX=(i||t).clientX;this._lastY=(i||t).clientY;Mt.style["will-change"]="all";a=function e(){Ct("delayEnded",n,{evt:t});if(bi.eventCanceled){n._onDrop();return}n._disableDelayedDragEvents();if(!Ne&&n.nativeDraggable){Mt.draggable=true}n._triggerDragStart(t,i);qt({sortable:n,name:"choose",originalEvent:t});Ye(Mt,r.chosenClass,true)};r.ignore.split(",").forEach((function(e){Xe(Mt,e.trim(),ki)}));Ue(l,"dragover",gi);Ue(l,"mousemove",gi);Ue(l,"touchmove",gi);if(r.supportPointer){Ue(l,"pointerup",n._onDrop);!this.nativeDraggable&&Ue(l,"pointercancel",n._onDrop)}else{Ue(l,"mouseup",n._onDrop);Ue(l,"touchend",n._onDrop);Ue(l,"touchcancel",n._onDrop)}if(Ne&&this.nativeDraggable){this.options.touchStartThreshold=4;Mt.draggable=true}Ct("delayStart",this,{evt:t});if(r.delay&&(!r.delayOnTouchOnly||i)&&(!this.nativeDraggable||!(Ve||_e))){if(bi.eventCanceled){this._onDrop();return}if(r.supportPointer){Ue(l,"pointerup",n._disableDelayedDrag);Ue(l,"pointercancel",n._disableDelayedDrag)}else{Ue(l,"mouseup",n._disableDelayedDrag);Ue(l,"touchend",n._disableDelayedDrag);Ue(l,"touchcancel",n._disableDelayedDrag)}Ue(l,"mousemove",n._delayedDragTouchMoveHandler);Ue(l,"touchmove",n._delayedDragTouchMoveHandler);r.supportPointer&&Ue(l,"pointermove",n._delayedDragTouchMoveHandler);n._dragStartTimer=setTimeout(a,r.delay)}else{a()}}},_delayedDragTouchMoveHandler:function e(t){var i=t.touches?t.touches[0]:t;if(Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))){this._disableDelayedDrag()}},_disableDelayedDrag:function e(){Mt&&ki(Mt);clearTimeout(this._dragStartTimer);this._disableDelayedDragEvents()},_disableDelayedDragEvents:function e(){var t=this.el.ownerDocument;$e(t,"mouseup",this._disableDelayedDrag);$e(t,"touchend",this._disableDelayedDrag);$e(t,"touchcancel",this._disableDelayedDrag);$e(t,"pointerup",this._disableDelayedDrag);$e(t,"pointercancel",this._disableDelayedDrag);$e(t,"mousemove",this._delayedDragTouchMoveHandler);$e(t,"touchmove",this._delayedDragTouchMoveHandler);$e(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function e(t,i){i=i||t.pointerType=="touch"&&t;if(!this.nativeDraggable||i){if(this.options.supportPointer){Ue(document,"pointermove",this._onTouchMove)}else if(i){Ue(document,"touchmove",this._onTouchMove)}else{Ue(document,"mousemove",this._onTouchMove)}}else{Ue(Mt,"dragend",this);Ue(zt,"dragstart",this._onDragStart)}try{if(document.selection){zi((function(){document.selection.empty()}))}else{window.getSelection().removeAllRanges()}}catch(e){}},_dragStarted:function e(t,i){At=false;if(zt&&Mt){Ct("dragStarted",this,{evt:i});if(this.nativeDraggable){Ue(document,"dragover",xi)}var s=this.options;!t&&Ye(Mt,s.dragClass,false);Ye(Mt,s.ghostClass,true);bi.active=this;t&&this._appendGhost();qt({sortable:this,name:"start",originalEvent:i})}else{this._nulling()}},_emulateDragOver:function e(){if(Pt){this._lastX=Pt.clientX;this._lastY=Pt.clientY;vi();var t=document.elementFromPoint(Pt.clientX,Pt.clientY);var i=t;while(t&&t.shadowRoot){t=t.shadowRoot.elementFromPoint(Pt.clientX,Pt.clientY);if(t===i)break;i=t}Mt.parentNode[mt]._isOutsideThisEl(t);if(i){do{if(i[mt]){var s=void 0;s=i[mt]._onDragOver({clientX:Pt.clientX,clientY:Pt.clientY,target:t,rootEl:i});if(s&&!this.options.dragoverBubble){break}}t=i}while(i=Fe(i))}mi()}},_onTouchMove:function e(t){if($t){var i=this.options,s=i.fallbackTolerance,n=i.fallbackOffset,o=t.touches?t.touches[0]:t,r=It&&Ge(It,true),l=It&&r&&r.a,a=It&&r&&r.d,d=li&&ii&&ot(ii),c=(o.clientX-$t.clientX+n.x)/(l||1)+(d?d[0]-si[0]:0)/(l||1),h=(o.clientY-$t.clientY+n.y)/(a||1)+(d?d[1]-si[1]:0)/(a||1);if(!bi.active&&!At){if(s&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<s){return}this._onDragStart(t,true)}if(It){if(r){r.e+=c-(Ft||0);r.f+=h-(Wt||0)}else{r={a:1,b:0,c:0,d:1,e:c,f:h}}var f="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");Je(It,"webkitTransform",f);Je(It,"mozTransform",f);Je(It,"msTransform",f);Je(It,"transform",f);Ft=c;Wt=h;Pt=o}t.cancelable&&t.preventDefault()}},_appendGhost:function e(){if(!It){var t=this.options.fallbackOnBody?document.body:zt,i=et(Mt,true,li,true,t),s=this.options;if(li){ii=t;while(Je(ii,"position")==="static"&&Je(ii,"transform")==="none"&&ii!==document){ii=ii.parentNode}if(ii!==document.body&&ii!==document.documentElement){if(ii===document)ii=Ke();i.top+=ii.scrollTop;i.left+=ii.scrollLeft}else{ii=Ke()}si=ot(ii)}It=Mt.cloneNode(true);Ye(It,s.ghostClass,false);Ye(It,s.fallbackClass,true);Ye(It,s.dragClass,true);Je(It,"transition","");Je(It,"transform","");Je(It,"box-sizing","border-box");Je(It,"margin",0);Je(It,"top",i.top);Je(It,"left",i.left);Je(It,"width",i.width);Je(It,"height",i.height);Je(It,"opacity","0.8");Je(It,"position",li?"absolute":"fixed");Je(It,"zIndex","100000");Je(It,"pointerEvents","none");bi.ghost=It;t.appendChild(It);Je(It,"transform-origin",Qt/parseInt(It.style.width)*100+"% "+Yt/parseInt(It.style.height)*100+"%")}},_onDragStart:function e(t,i){var s=this;var n=t.dataTransfer;var o=s.options;Ct("dragStart",this,{evt:t});if(bi.eventCanceled){this._onDrop();return}Ct("setupClone",this);if(!bi.eventCanceled){Ht=pt(Mt);Ht.removeAttribute("id");Ht.draggable=false;Ht.style["will-change"]="";this._hideClone();Ye(Ht,this.options.chosenClass,false);bi.clone=Ht}s.cloneId=zi((function(){Ct("clone",s);if(bi.eventCanceled)return;if(!s.options.removeCloneOnHide){zt.insertBefore(Ht,Mt)}s._hideClone();qt({sortable:s,name:"clone"})}));!i&&Ye(Mt,o.dragClass,true);if(i){Bt=true;s._loopId=setInterval(s._emulateDragOver,50)}else{$e(document,"mouseup",s._onDrop);$e(document,"touchend",s._onDrop);$e(document,"touchcancel",s._onDrop);if(n){n.effectAllowed="move";o.setData&&o.setData.call(s,n,Mt)}Ue(document,"drop",s);Je(Mt,"transform","translateZ(0)")}At=true;s._dragStartId=zi(s._dragStarted.bind(s,i,t));Ue(document,"selectstart",s);Jt=true;window.getSelection().removeAllRanges();if(Re){Je(document.body,"user-select","none")}},_onDragOver:function e(t){var i=this.el,s=t.target,n,o,r,l=this.options,a=l.group,d=bi.active,c=Rt===a,h=l.sort,f=jt||d,u,p=this,v=false;if(ni)return;function m(e,l){Ct(e,p,Te({evt:t,isOwner:c,axis:u?"vertical":"horizontal",revert:r,dragRect:n,targetRect:o,canSort:h,fromSortable:f,target:s,completed:x,onMove:function e(s,o){return yi(zt,i,Mt,n,s,et(s),t,o)},changed:b},l))}function g(){m("dragOverAnimationCapture");p.captureAnimationState();if(p!==f){f.captureAnimationState()}}function x(e){m("dragOverCompleted",{insertion:e});if(e){if(c){d._hideClone()}else{d._showClone(p)}if(p!==f){Ye(Mt,jt?jt.options.ghostClass:d.options.ghostClass,false);Ye(Mt,l.ghostClass,true)}if(jt!==p&&p!==bi.active){jt=p}else if(p===bi.active&&jt){jt=null}if(f===p){p._ignoreWhileAnimating=s}p.animateAll((function(){m("dragOverAnimationComplete");p._ignoreWhileAnimating=null}));if(p!==f){f.animateAll();f._ignoreWhileAnimating=null}}if(s===Mt&&!Mt.animated||s===i&&!s.animated){Gt=null}if(!l.dragoverBubble&&!t.rootEl&&s!==document){Mt.parentNode[mt]._isOutsideThisEl(t.target);!e&&gi(t)}!l.dragoverBubble&&t.stopPropagation&&t.stopPropagation();return v=true}function b(){_t=nt(Mt);Nt=nt(Mt,l.draggable);qt({sortable:p,name:"change",toEl:i,newIndex:_t,newDraggableIndex:Nt,originalEvent:t})}if(t.preventDefault!==void 0){t.cancelable&&t.preventDefault()}s=We(s,l.draggable,i,true);m("dragOver");if(bi.eventCanceled)return v;if(Mt.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s){return x(false)}Bt=false;if(d&&!l.disabled&&(c?h||(r=Tt!==zt):jt===this||(this.lastPutMode=Rt.checkPull(this,d,Mt,t))&&a.checkPut(this,d,Mt,t))){u=this._getDirection(t,s)==="vertical";n=et(Mt);m("dragOverValid");if(bi.eventCanceled)return v;if(r){Tt=zt;g();this._hideClone();m("revert");if(!bi.eventCanceled){if(Dt){zt.insertBefore(Mt,Dt)}else{zt.appendChild(Mt)}}return x(true)}var w=st(i,l.draggable);if(!w||Ci(t,u,this)&&!w.animated){if(w===Mt){return x(false)}if(w&&i===t.target){s=w}if(s){o=et(s)}if(yi(zt,i,Mt,n,s,o,t,!!s)!==false){g();if(w&&w.nextSibling){i.insertBefore(Mt,w.nextSibling)}else{i.appendChild(Mt)}Tt=i;b();return x(true)}}else if(w&&Si(t,u,this)){var y=it(i,0,l,true);if(y===Mt){return x(false)}s=y;o=et(s);if(yi(zt,i,Mt,n,s,o,t,false)!==false){g();i.insertBefore(Mt,y);Tt=i;b();return x(true)}}else if(s.parentNode===i){o=et(s);var k=0,E,S=Mt.parentNode!==i,C=!fi(Mt.animated&&Mt.toRect||n,s.animated&&s.toRect||o,u),q=u?"top":"left",M=tt(s,"top","top")||tt(Mt,"top","top"),T=M?M.scrollTop:void 0;if(Gt!==s){E=o[q];Kt=false;ei=!C&&l.invertSwap||S}k=qi(t,s,o,u,C?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,ei,Gt===s);var I;if(k!==0){var z=nt(Mt);do{z-=k;I=Tt.children[z]}while(I&&(Je(I,"display")==="none"||I===It))}if(k===0||I===s){return x(false)}Gt=s;Xt=k;var D=s.nextElementSibling,L=false;L=k===1;var H=yi(zt,i,Mt,n,s,o,t,L);if(H!==false){if(H===1||H===-1){L=H===1}ni=true;setTimeout(Ei,30);g();if(L&&!D){i.appendChild(Mt)}else{s.parentNode.insertBefore(Mt,L?D:s)}if(M){ut(M,0,T-M.scrollTop)}Tt=Mt.parentNode;if(E!==undefined&&!ei){ti=Math.abs(E-et(s)[q])}b();return x(true)}}if(i.contains(Mt)){return x(false)}}return false},_ignoreWhileAnimating:null,_offMoveEvents:function e(){$e(document,"mousemove",this._onTouchMove);$e(document,"touchmove",this._onTouchMove);$e(document,"pointermove",this._onTouchMove);$e(document,"dragover",gi);$e(document,"mousemove",gi);$e(document,"touchmove",gi)},_offUpEvents:function e(){var t=this.el.ownerDocument;$e(t,"mouseup",this._onDrop);$e(t,"touchend",this._onDrop);$e(t,"pointerup",this._onDrop);$e(t,"pointercancel",this._onDrop);$e(t,"touchcancel",this._onDrop);$e(document,"selectstart",this)},_onDrop:function e(t){var i=this.el,s=this.options;_t=nt(Mt);Nt=nt(Mt,s.draggable);Ct("drop",this,{evt:t});Tt=Mt&&Mt.parentNode;_t=nt(Mt);Nt=nt(Mt,s.draggable);if(bi.eventCanceled){this._nulling();return}At=false;ei=false;Kt=false;clearInterval(this._loopId);clearTimeout(this._dragStartTimer);Di(this.cloneId);Di(this._dragStartId);if(this.nativeDraggable){$e(document,"drop",this);$e(i,"dragstart",this._onDragStart)}this._offMoveEvents();this._offUpEvents();if(Re){Je(document.body,"user-select","")}Je(Mt,"transform","");if(t){if(Jt){t.cancelable&&t.preventDefault();!s.dropBubble&&t.stopPropagation()}It&&It.parentNode&&It.parentNode.removeChild(It);if(zt===Tt||jt&&jt.lastPutMode!=="clone"){Ht&&Ht.parentNode&&Ht.parentNode.removeChild(Ht)}if(Mt){if(this.nativeDraggable){$e(Mt,"dragend",this)}ki(Mt);Mt.style["will-change"]="";if(Jt&&!At){Ye(Mt,jt?jt.options.ghostClass:this.options.ghostClass,false)}Ye(Mt,this.options.chosenClass,false);qt({sortable:this,name:"unchoose",toEl:Tt,newIndex:null,newDraggableIndex:null,originalEvent:t});if(zt!==Tt){if(_t>=0){qt({rootEl:Tt,name:"add",toEl:Tt,fromEl:zt,originalEvent:t});qt({sortable:this,name:"remove",toEl:Tt,originalEvent:t});qt({rootEl:Tt,name:"sort",toEl:Tt,fromEl:zt,originalEvent:t});qt({sortable:this,name:"sort",toEl:Tt,originalEvent:t})}jt&&jt.save()}else{if(_t!==Ot){if(_t>=0){qt({sortable:this,name:"update",toEl:Tt,originalEvent:t});qt({sortable:this,name:"sort",toEl:Tt,originalEvent:t})}}}if(bi.active){if(_t==null||_t===-1){_t=Ot;Nt=Vt}qt({sortable:this,name:"end",toEl:Tt,originalEvent:t});this.save()}}}this._nulling()},_nulling:function e(){Ct("nulling",this);zt=Mt=Tt=It=Dt=Ht=Lt=Zt=$t=Pt=Jt=_t=Nt=Ot=Vt=Gt=Xt=jt=Rt=bi.dragged=bi.ghost=bi.clone=bi.active=null;var t=this.el;oi.forEach((function(e){if(t.contains(e)){e.checked=true}}));oi.length=Ft=Wt=0},handleEvent:function e(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":if(Mt){this._onDragOver(t);wi(t)}break;case"selectstart":t.preventDefault();break}},toArray:function e(){var t=[],i,s=this.el.children,n=0,o=s.length,r=this.options;for(;n<o;n++){i=s[n];if(We(i,r.draggable,this.el,false)){t.push(i.getAttribute(r.dataIdAttr)||Ti(i))}}return t},sort:function e(t,i){var s={},n=this.el;this.toArray().forEach((function(e,t){var i=n.children[t];if(We(i,this.options.draggable,n,false)){s[e]=i}}),this);i&&this.captureAnimationState();t.forEach((function(e){if(s[e]){n.removeChild(s[e]);n.appendChild(s[e])}}));i&&this.animateAll()},save:function e(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function e(t,i){return We(t,i||this.options.draggable,this.el,false)},option:function e(t,i){var s=this.options;if(i===void 0){return s[t]}else{var n=kt.modifyOption(this,t,i);if(typeof n!=="undefined"){s[t]=n}else{s[t]=i}if(t==="group"){pi(s)}}},destroy:function e(){Ct("destroy",this);var t=this.el;t[mt]=null;$e(t,"mousedown",this._onTapStart);$e(t,"touchstart",this._onTapStart);$e(t,"pointerdown",this._onTapStart);if(this.nativeDraggable){$e(t,"dragover",this);$e(t,"dragenter",this)}Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")}));this._onDrop();this._disableDelayedDragEvents();Ut.splice(Ut.indexOf(this.el),1);this.el=t=null},_hideClone:function e(){if(!Zt){Ct("hideClone",this);if(bi.eventCanceled)return;Je(Ht,"display","none");if(this.options.removeCloneOnHide&&Ht.parentNode){Ht.parentNode.removeChild(Ht)}Zt=true}},_showClone:function e(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Zt){Ct("showClone",this);if(bi.eventCanceled)return;if(Mt.parentNode==zt&&!this.options.group.revertClone){zt.insertBefore(Ht,Mt)}else if(Dt){zt.insertBefore(Ht,Dt)}else{zt.appendChild(Ht)}if(this.options.group.revertClone){this.animate(Mt,Ht)}Je(Ht,"display","");Zt=false}}};function wi(e){if(e.dataTransfer){e.dataTransfer.dropEffect="move"}e.cancelable&&e.preventDefault()}function yi(e,t,i,s,n,o,r,l){var a,d=e[mt],c=d.options.onMove,h;if(window.CustomEvent&&!_e&&!Ve){a=new CustomEvent("move",{bubbles:true,cancelable:true})}else{a=document.createEvent("Event");a.initEvent("move",true,true)}a.to=t;a.from=e;a.dragged=i;a.draggedRect=s;a.related=n||t;a.relatedRect=o||et(t);a.willInsertAfter=l;a.originalEvent=r;e.dispatchEvent(a);if(c){h=c.call(d,a,r)}return h}function ki(e){e.draggable=false}function Ei(){ni=false}function Si(e,t,i){var s=et(it(i.el,0,i.options,true));var n=vt(i.el,i.options,It);var o=10;return t?e.clientX<n.left-o||e.clientY<s.top&&e.clientX<s.right:e.clientY<n.top-o||e.clientY<s.bottom&&e.clientX<s.left}function Ci(e,t,i){var s=et(st(i.el,i.options.draggable));var n=vt(i.el,i.options,It);var o=10;return t?e.clientX>n.right+o||e.clientY>s.bottom&&e.clientX>s.left:e.clientY>n.bottom+o||e.clientX>s.right&&e.clientY>s.top}function qi(e,t,i,s,n,o,r,l){var a=s?e.clientY:e.clientX,d=s?i.height:i.width,c=s?i.top:i.left,h=s?i.bottom:i.right,f=false;if(!r){if(l&&ti<d*n){if(!Kt&&(Xt===1?a>c+d*o/2:a<h-d*o/2)){Kt=true}if(!Kt){if(Xt===1?a<c+ti:a>h-ti){return-Xt}}else{f=true}}else{if(a>c+d*(1-n)/2&&a<h-d*(1-n)/2){return Mi(t)}}}f=f||r;if(f){if(a<c+d*o/2||a>h-d*o/2){return a>c+d/2?1:-1}}return 0}function Mi(e){if(nt(Mt)<nt(e)){return 1}else{return-1}}function Ti(e){var t=e.tagName+e.className+e.src+e.href+e.textContent,i=t.length,s=0;while(i--){s+=t.charCodeAt(i)}return s.toString(36)}function Ii(e){oi.length=0;var t=e.getElementsByTagName("input");var i=t.length;while(i--){var s=t[i];s.checked&&oi.push(s)}}function zi(e){return setTimeout(e,0)}function Di(e){return clearTimeout(e)}if(ri){Ue(document,"touchmove",(function(e){if((bi.active||At)&&e.cancelable){e.preventDefault()}}))}bi.utils={on:Ue,off:$e,css:Je,find:Xe,is:function e(t,i){return!!We(t,i,t,false)},extend:at,throttle:ht,closest:We,toggleClass:Ye,clone:pt,index:nt,nextTick:zi,cancelNextTick:Di,detectDirection:hi,getChild:it,expando:mt};bi.get=function(e){return e[mt]};bi.mount=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++){t[i]=arguments[i]}if(t[0].constructor===Array)t=t[0];t.forEach((function(e){if(!e.prototype||!e.prototype.constructor){throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e))}if(e.utils)bi.utils=Te(Te({},bi.utils),e.utils);kt.mount(e)}))};bi.create=function(e,t){return new bi(e,t)};bi.version=Ze;var Li=[],Hi,Zi,Oi=false,_i,Vi,Ni,Ri;function ji(){function e(){this.defaults={scroll:true,forceAutoScrollFallback:false,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:true};for(var e in this){if(e.charAt(0)==="_"&&typeof this[e]==="function"){this[e]=this[e].bind(this)}}}e.prototype={dragStarted:function e(t){var i=t.originalEvent;if(this.sortable.nativeDraggable){Ue(document,"dragover",this._handleAutoScroll)}else{if(this.options.supportPointer){Ue(document,"pointermove",this._handleFallbackAutoScroll)}else if(i.touches){Ue(document,"touchmove",this._handleFallbackAutoScroll)}else{Ue(document,"mousemove",this._handleFallbackAutoScroll)}}},dragOverCompleted:function e(t){var i=t.originalEvent;if(!this.options.dragOverBubble&&!i.rootEl){this._handleAutoScroll(i)}},drop:function e(){if(this.sortable.nativeDraggable){$e(document,"dragover",this._handleAutoScroll)}else{$e(document,"pointermove",this._handleFallbackAutoScroll);$e(document,"touchmove",this._handleFallbackAutoScroll);$e(document,"mousemove",this._handleFallbackAutoScroll)}Bi();Ai();ft()},nulling:function e(){Ni=Zi=Hi=Oi=Ri=_i=Vi=null;Li.length=0},_handleFallbackAutoScroll:function e(t){this._handleAutoScroll(t,true)},_handleAutoScroll:function e(t,i){var s=this;var n=(t.touches?t.touches[0]:t).clientX,o=(t.touches?t.touches[0]:t).clientY,r=document.elementFromPoint(n,o);Ni=t;if(i||this.options.forceAutoScrollFallback||Ve||_e||Re){Ui(t,this.options,r,i);var l=lt(r,true);if(Oi&&(!Ri||n!==_i||o!==Vi)){Ri&&Bi();Ri=setInterval((function(){var e=lt(document.elementFromPoint(n,o),true);if(e!==l){l=e;Ai()}Ui(t,s.options,e,i)}),10);_i=n;Vi=o}}else{if(!this.options.bubbleScroll||lt(r,true)===Ke()){Ai();return}Ui(t,this.options,lt(r,false),false)}}};return qe(e,{pluginName:"scroll",initializeByDefault:true})}function Ai(){Li.forEach((function(e){clearInterval(e.pid)}));Li=[]}function Bi(){clearInterval(Ri)}var Ui=ht((function(e,t,i,s){if(!t.scroll)return;var n=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,r=t.scrollSensitivity,l=t.scrollSpeed,a=Ke();var d=false,c;if(Zi!==i){Zi=i;Ai();Hi=t.scroll;c=t.scrollFn;if(Hi===true){Hi=lt(i,true)}}var h=0;var f=Hi;do{var u=f,p=et(u),v=p.top,m=p.bottom,g=p.left,x=p.right,b=p.width,w=p.height,y=void 0,k=void 0,E=u.scrollWidth,S=u.scrollHeight,C=Je(u),q=u.scrollLeft,M=u.scrollTop;if(u===a){y=b<E&&(C.overflowX==="auto"||C.overflowX==="scroll"||C.overflowX==="visible");k=w<S&&(C.overflowY==="auto"||C.overflowY==="scroll"||C.overflowY==="visible")}else{y=b<E&&(C.overflowX==="auto"||C.overflowX==="scroll");k=w<S&&(C.overflowY==="auto"||C.overflowY==="scroll")}var T=y&&(Math.abs(x-n)<=r&&q+b<E)-(Math.abs(g-n)<=r&&!!q);var I=k&&(Math.abs(m-o)<=r&&M+w<S)-(Math.abs(v-o)<=r&&!!M);if(!Li[h]){for(var z=0;z<=h;z++){if(!Li[z]){Li[z]={}}}}if(Li[h].vx!=T||Li[h].vy!=I||Li[h].el!==u){Li[h].el=u;Li[h].vx=T;Li[h].vy=I;clearInterval(Li[h].pid);if(T!=0||I!=0){d=true;Li[h].pid=setInterval(function(){if(s&&this.layer===0){bi.active._onTouchMove(Ni)}var t=Li[this.layer].vy?Li[this.layer].vy*l:0;var i=Li[this.layer].vx?Li[this.layer].vx*l:0;if(typeof c==="function"){if(c.call(bi.dragged.parentNode[mt],i,t,e,Ni,Li[this.layer].el)!=="continue"){return}}ut(Li[this.layer].el,i,t)}.bind({layer:h}),24)}}h++}while(t.bubbleScroll&&f!==a&&(f=lt(f,false)));Oi=d}),30);var $i=function e(t){var i=t.originalEvent,s=t.putSortable,n=t.dragEl,o=t.activeSortable,r=t.dispatchSortableEvent,l=t.hideGhostForTarget,a=t.unhideGhostForTarget;if(!i)return;var d=s||o;l();var c=i.changedTouches&&i.changedTouches.length?i.changedTouches[0]:i;var h=document.elementFromPoint(c.clientX,c.clientY);a();if(d&&!d.el.contains(h)){r("spill");this.onSpill({dragEl:n,putSortable:s})}};function Pi(){}Pi.prototype={startIndex:null,dragStart:function e(t){var i=t.oldDraggableIndex;this.startIndex=i},onSpill:function e(t){var i=t.dragEl,s=t.putSortable;this.sortable.captureAnimationState();if(s){s.captureAnimationState()}var n=it(this.sortable.el,this.startIndex,this.options);if(n){this.sortable.el.insertBefore(i,n)}else{this.sortable.el.appendChild(i)}this.sortable.animateAll();if(s){s.animateAll()}},drop:$i};qe(Pi,{pluginName:"revertOnSpill"});function Fi(){}Fi.prototype={onSpill:function e(t){var i=t.dragEl,s=t.putSortable;var n=s||this.sortable;n.captureAnimationState();i.parentNode&&i.parentNode.removeChild(i);n.animateAll()},drop:$i};qe(Fi,{pluginName:"removeOnSpill"});bi.mount(new ji);bi.mount(Fi,Pi);const Wi=()=>`verdocs-template-roles{display:block;max-width:600px;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-template-roles .roles{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:10px;margin-top:10px}verdocs-template-roles .roles .sequence{gap:10px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;font-weight:500;padding:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;border-bottom:1px dotted #e3e3e3}verdocs-template-roles .roles .sequence.add-sequence{color:#777777;line-height:34px}verdocs-template-roles .roles .sequence-label{font-size:18px;line-height:32px}verdocs-template-roles .roles .sequence-roles{gap:10px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .roles .role{height:32px;cursor:move;display:-ms-flexbox;display:flex;max-width:200px;position:relative;border-radius:32px;background-color:#eff7fb;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 14px 0 34px;border:1px solid #ccc;-ms-flex-direction:column;flex-direction:column}verdocs-template-roles .roles .role .role-name{font-size:14px;overflow:hidden;font-weight:400;line-height:30px;white-space:nowrap;text-overflow:ellipsis}verdocs-template-roles .roles .role .icons{position:absolute;left:1px;top:-3px;cursor:pointer;padding:5px;z-index:10}verdocs-template-roles .roles .role .icons .gear-button{display:none;-webkit-transform:scale(1.1);transform:scale(1.1);margin:4px 0 0 1px}verdocs-template-roles .roles .role .icons .type-icon{opacity:0.6;display:block;-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-roles .roles .role .icons:hover .gear-button{display:block}verdocs-template-roles .roles .role .icons:hover .type-icon{display:none}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#46497d;margin:0 0 10px 0}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{opacity:0.3;padding:0 10px;cursor:pointer;background:none;height:32px;border:1px solid #cccccc;border-radius:32px}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles .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-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:16px;height:16px;stroke:#666666;margin-bottom:2px;display:inline-block}verdocs-template-roles .sequence-roles{display:-ms-flexbox;display:flex;max-width:400px}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}`;const Qi='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>';const Yi=`<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>`;const Ji='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>';const Gi=`<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>`;const Xi=`<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>`;const Ki=class{constructor(i){e(this,i);this.next=t(this,"next");this.exit=t(this,"exit");this.sdkError=t(this,"sdkError");this.rolesUpdated=t(this,"rolesUpdated");this.templateListenerId=null;this.endpoint=l.getDefault();this.templateId="";this.showingRoleDialog=null;this.sender=null;this.dragging=false;this.loading=true;this.template=null;this.sortableRefs=[]}disconnectedCallback(){this.unlistenToTemplate();this.cleanupSortables()}async listenToTemplate(){console.log("[ROLES] Loading template",this.templateId);this.unlistenToTemplate();D.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),false,(e=>{console.log("[ROLES] Template Updated",e);this.template=e;this.loading=false}))}unlistenToTemplate(){if(this.templateListenerId){D.store.delListener(this.templateListenerId);this.templateListenerId=null}}async componentWillLoad(){var e,t,i;try{this.endpoint.loadSession();if(!this.templateId){console.log(`[ROLES] Missing required template ID ${this.templateId}`);return}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return}this.listenToTemplate()}catch(s){console.log("[ROLES] Error with preview session",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new z(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data))}}cleanupSortables(){this.sortableRefs.forEach((e=>e.destroy()));this.sortableRefs.length=0}componentDidRender(){this.cleanupSortables();const e=this.getSequenceNumbers();(e||[]).forEach((e=>{const t=document.getElementById(`verdocs-roles-sequence-${e}`);if(t){const e=new bi(t,{group:"roles",animation:150,dragoverBubble:true,filter:".no-drag",onEnd:this.handleMoveEnd.bind(this),onChoose:()=>this.dragging=true,onUnchoose:()=>this.dragging=false});this.sortableRefs.push(e)}}));const t=document.getElementById(`verdocs-roles-sequence-add-target`);if(t){console.log("[ROLES] Applying sortable to add-sequence slot");const e=new bi(t,{group:"roles",animation:150,dragoverBubble:true,filter:".no-drag",onEnd:this.handleMoveEnd.bind(this),onChoose:()=>this.dragging=true,onUnchoose:()=>this.dragging=false});this.sortableRefs.push(e)}}handleMoveEnd(e){const t=+e.from.dataset.sequence;const i=+e.to.dataset.sequence;const s=+e.oldIndex+1;const n=+e.newIndex+1;console.log(`Move from ${t}:${s} to ${i}:${n}`,e.item);const o={};const r=this.getSequenceNumbers();r.forEach((e=>{const t=this.getRolesAtSequence(e);o[String(e)]=JSON.parse(JSON.stringify(t))}));o[r[r.length-1]+1]=[];const l=o[t].splice(s-1,1)[0];o[i]||(o[i]=[]);o[i].splice(n-1,0,l);const a=[];Object.entries(o).forEach((([e,t])=>{t.forEach(((t,i)=>{if(!t){return}const s=+i+1;if(t.sequence!==+e||t.order!==s){t.sequence=+e;t.order=s;a.push(y(this.endpoint,this.templateId,t.name,{sequence:+e,order:s}).then((e=>console.log("[ROLES] Updated role",t.name,e))).catch((e=>console.log("[ROLES] Error updating role",e))))}}))}));return Promise.all(a).then((async()=>console.log("[ROLES] Done renumbering"))).catch((e=>console.log("[ROLES] Error updating roles",e)))}handleCancel(){var e;(e=this.exit)===null||e===void 0?void 0:e.emit()}handleSubmit(){var e;(e=this.next)===null||e===void 0?void 0:e.emit()}getSortedRoles(){var e;return(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).sort(((e,t)=>e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence))}getSequenceNumbers(){const e={};this.getSortedRoles().forEach((t=>{e[t.sequence]=true}));console.log("[ROLES] Sequences",e);return Object.keys(e).map((e=>+e)).sort(((e,t)=>e-t))}getRoleNames(){const e=this.getSortedRoles();return e.map((e=>e.name))}getRolesAtSequence(e){var t;return(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).filter((t=>t&&t.sequence===e))}async renumberTemplateRoles(){var e;const t={};const i=[];const s=this.getSequenceNumbers();(s||[]).forEach((e=>{(t[e]||[]).forEach(((t,s)=>{const n=+s+1;if(t.sequence!==+e||t.order!==n){console.log("[ROLES] Updating role",t.name,"from",t.sequence,t.order,"to",e,n);t.sequence=+e;t.order=n;i.push(y(this.endpoint,this.templateId,t.name,{sequence:+e,order:n}).then((e=>console.log("[ROLES] Updated role",t.name,e))).catch((e=>console.log("[ROLES] Error updating role",e))))}}))}));console.log(`[ROLES] Awaiting ${i.length} renumber requests`);await Promise.all(i).then((async()=>{const e=JSON.parse(JSON.stringify(this.template));e.roles=Object.keys(t).reduce(((e,i)=>e.concat(t[i])),[]);console.log("[ROLES] Done renumbering",e.roles.map((e=>({name:e.name,sequence:e.sequence,order:e.order}))));D.updateTemplate(this.templateId,e)}));(e=this.rolesUpdated)===null||e===void 0?void 0:e.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})}getNextRoleName(){var e,t;let i="";let s=(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).length;do{s++;i=`Recipient ${s}`}while(!i||(((t=this.template)===null||t===void 0?void 0:t.roles)||[]).some((e=>e&&e.name===i)));return i}callCreateRole(e,t,i){console.log("[ROLES] Will create role",{name:e,sequence:t,order:i});k(this.endpoint,this.templateId,{template_id:this.templateId,name:e,sequence:t,message:"",order:i,full_name:null,first_name:"",last_name:"",email:"",phone:"",type:"signer",delegator:false,name_locked:false}).then((async e=>{var t;console.log("[ROLES] Created role",e);console.log("Updating template in data store");await D.getTemplate(this.endpoint,this.templateId,true);(t=this.rolesUpdated)===null||t===void 0?void 0:t.emit({event:"added",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})})).catch((e=>{console.log("[ROLES] Error creating role",e)}))}handleAddRole(e,t){e.stopPropagation();const i=this.getRolesAtSequence(t).length+1;const s=this.getNextRoleName();this.callCreateRole(s,t,i)}handleAddStep(e,t){e.stopPropagation();const i=1;const s=this.getNextRoleName();this.callCreateRole(s,t,i)}render(){if(!this.endpoint.session){return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading||!this.template){return i(s,{class:"loading"},i("verdocs-loader",null))}const e=this.getRoleNames();const t=this.getSequenceNumbers();const n=t&&t.length>0?(t[t.length-1]||0)+1:1;console.log("[ROLES] Rendering",{roleNames:e,sequences:t,nextSequence:n});return i(s,{class:{dragging:this.dragging}},i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("h5",null,"Roles and Workflow"),i("div",{class:"roles"},t.map(((e,t)=>i("div",{class:"sequence"},i("div",{class:"sequence-label no-drag"},t+1,"."),i("div",{class:"sequence-roles",id:`verdocs-roles-sequence-${e}`,"data-sequence":e},this.getRolesAtSequence(e).map((t=>{const s=!t.email||!t.first_name||!t.last_name;return s?i("div",{class:"role","data-rolename":t.name,"data-sequence":e,"data-order":t.order},i("div",{class:"role-name"},t.name),i("div",{class:"icons"},i("div",{class:"gear-button",innerHTML:Qi,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"}),i("span",{class:"type-icon",innerHTML:t.type==="signer"?Ji:t.type==="cc"?Xi:Gi}))):i("div",{class:"role","data-rolename":t.name,"data-sequence":e,"data-order":t.order},i("div",{class:"role-name"},f(t)),i("div",{class:"icons"},i("div",{class:"gear-button",innerHTML:Qi,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"}),i("span",{class:"type-icon",innerHTML:t.type==="signer"?Ji:t.type==="cc"?Xi:Gi})))}))),i("button",{class:"add-role no-drag",onClick:t=>this.handleAddRole(t,e)},"+ Add Role")))),i("div",{class:"sequence add-sequence"},i("div",{class:"sequence-label no-drag"},t.length+1,"."),i("div",{class:"sequence-roles",id:`verdocs-roles-sequence-add-target`,"data-sequence":n}),i("button",{class:"add-role no-drag",onClick:e=>this.handleAddRole(e,n)},"+ Add Role"))),e.length<1&&i("div",{class:"empty"},"You must add at least one Role before proceeding.",i("br",null)," Click the ",i("span",{innerHTML:Yi})," Add button above to get started."),i("div",{class:"buttons"},i("div",{class:"flex-fill"}),i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:()=>this.handleCancel()}),i("verdocs-button",{label:"OK",size:"small",onClick:()=>this.handleSubmit(),disabled:e.length<1}))),this.showingRoleDialog&&i("verdocs-menu-panel",{onClose:()=>this.showingRoleDialog=null},i("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:()=>{var e;(e=document.getElementById("verdocs-menu-panel-overlay"))===null||e===void 0?void 0:e.remove();this.showingRoleDialog=null},onDelete:async()=>{var e;this.showingRoleDialog=null;await this.renumberTemplateRoles();(e=this.rolesUpdated)===null||e===void 0?void 0:e.emit({event:"deleted",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})}})))}get el(){return o(this)}};Ki.style=Wi();export{P as verdocs_preview,ae as verdocs_send,ce as verdocs_template_attachments,fe as verdocs_template_build_tabs,Se as verdocs_template_fields,Ki as verdocs_template_roles};
8
+ //# sourceMappingURL=p-f3924e9e.entry.js.map