@verdocs/web-sdk 6.14.0 → 6.14.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.
- package/dist/cjs/verdocs-preview_6.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-preview_6.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-template-star.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-template-star.cjs.entry.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.css +3 -0
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +1 -1
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
- package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.js +2 -2
- package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.js.map +1 -1
- package/dist/components/p-Cisooi3V.js +2 -0
- package/dist/components/p-Cisooi3V.js.map +1 -0
- package/dist/components/{p-DslyN9XL.js → p-ClWqxMkZ.js} +2 -2
- package/dist/components/{p-DslyN9XL.js.map → p-ClWqxMkZ.js.map} +1 -1
- package/dist/components/verdocs-build.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-template-star.js +1 -1
- package/dist/components/verdocs-templates-list.js +1 -1
- package/dist/custom-elements.json +2523 -0
- package/dist/esm/verdocs-preview_6.entry.js +2 -2
- package/dist/esm/verdocs-preview_6.entry.js.map +1 -1
- package/dist/esm/verdocs-template-star.entry.js +2 -2
- package/dist/esm/verdocs-template-star.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-star.entry.js.map +1 -1
- package/dist/verdocs-web-sdk/{p-5455e818.entry.js → p-442b6b04.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-5455e818.entry.js.map → p-442b6b04.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-BdZ5Ghsa.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-bd1bcb9d.system.entry.js → p-ab798e66.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-ab798e66.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-e3f13498.entry.js → p-ad4ae5c3.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-ad4ae5c3.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-20bc8055.system.entry.js → p-dea0ae12.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-20bc8055.system.entry.js.map → p-dea0ae12.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/components/p-DPF2i0o5.js +0 -2
- package/dist/components/p-DPF2i0o5.js.map +0 -1
- package/dist/verdocs-web-sdk/p-bd1bcb9d.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-e3f13498.entry.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getRoleNames","template","roles","map","role","name","getRoleIndex","role_name","Math","max","findIndex","verdocsSendCss","chevronRightIcon","chevronLeftIcon","warningIcon","infoIcon","externalLinkIcon","VERDOCS_LOGO_URL","SWIPE_START_FRACTION","SWIPE_MIN_DISTANCE","SWIPE_MAX_DURATION","MIN_EXPIRY_DAYS","MAX_EXPIRY_DAYS","DEFAULT_EXPIRY_DAYS","AUTH_METHOD_LABELS","email","passcode","sms","kba","id","VerdocsSend","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","templateListenerId","endpoint","DefaultEndpoint","templateId","environment","showCancel","brandKey","swipeStart","swallowNextClick","loadedOrganizationId","containerId","random","toString","substring","view","editingRoleId","sessionContacts","sending","brands","organization","expiresInDays","noContact","senderDefaults","senderName","senderEmail","rolesCompleted","loading","disconnectedCallback","unlistenToTemplate","componentDidLoad","el","addEventListener","e","stopPropagation","preventDefault","componentDidRender","updateScrollFade","querySelector","_a","toggleAttribute","_b","listenToTemplate","console","log","Store","subscribe","getTemplate","recomputeRolesCompleted","loadBrands","organizationId","organization_id","changedOrganization","stillCurrent","getBrands","then","catch","getOrganization","handleExpiryInput","digits","target","value","replace","String","min","Number","effectiveExpiryDays","days","expiresAt","Date","now","store","delListener","reset","effectiveSenderName","effectiveSenderEmail","senderOverrides","trim","sender_name","undefined","sender_email","onTemplateIdChanged","newTemplateId","componentWillLoad","onSessionChanged","_endpoint","_session","profile","me","first_name","last_name","phone","formatFullName","getOrganizationContacts","contacts","loadSession","session","sdkError","emit","SDKError","message","response","status","_c","data","rolesAtLevel","forEach","level","sequence","length","push","isValidEmail","getSequenceNumbers","sequences","Object","keys","s","sort","a","b","getRolesAtLevel","filter","index","getRoleById","match","find","getRecipientOptionLabels","recipient","labels","auth_methods","method","delegator","name_locked","getDefaultBrand","defaultId","default_brand_id","brand","getDefaultBrandLabel","getSelectedBrandLabel","key","showView","handleSelectContact","detail","handleClickRole","handleSend","localeData","Intl","DateTimeFormat","resolvedOptions","details","template_id","initial_reminder","followup_reminders","recipients","values","timezone","timeZone","locale","expires_at","toISOString","no_contact","brand_key","beforeSendResult","beforeSend","defaultPrevented","createEnvelope","r","send","envelope_id","envelope","VerdocsToast","error","handleCancel","exit","handleSwipeStart","pane","currentTarget","rect","getBoundingClientRect","onTextEntry","closest","call","clientX","left","width","x","y","clientY","time","handleSwipeEnd","start","dx","dy","abs","renderDetailHeader","title","h","class","type","onClick","innerHTML","renderDetailBody","content","onScroll","renderDoneButton","label","size","renderRecipientView","roleIndex","style","backgroundColor","getRGBA","onExit","onNext","contactSuggestions","templateRole","onSearchContacts","searchContacts","renderBrandSwatch","fallbackInitial","image","favicon_url","thumbnail_url","src","alt","primary_color","toUpperCase","renderBrandOption","sub","swatch","option","selected","renderBrandView","defaultBrand","others","localeCompare","hasBrands","href","getWebAppUrl","rel","renderExpiresView","when","toLocaleDateString","month","day","year","toLocaleTimeString","hour","minute","inputMode","placeholder","disabled","onInput","renderSenderView","validEmail","htmlFor","renderNotificationsView","checked","renderDetail","render","Host","display","levels","rolesAssigned","allRolesAssigned","assignedEmails","toLowerCase","hasDuplicateEmails","Set","expiresShort","sendable","is_sendable","completed","assigned","optionLabels","off","variant","onPointerDown","onPointerUp","onPointerCancel"],"sources":["src/utils/Templates.ts","src/components/embeds/verdocs-send/verdocs-send.scss?tag=verdocs-send","src/components/embeds/verdocs-send/verdocs-send.tsx"],"sourcesContent":["import {ITemplate} from '@verdocs/js-sdk';\n\nexport const getRoleNames = (template: ITemplate | null) => (template?.roles || []).map(role => role.name);\n\nexport const getRoleIndex = (template: ITemplate | null, role_name: string) =>\n Math.max(\n getRoleNames(template).findIndex(name => name === role_name),\n 0,\n );\n","@import '../../../theme.scss';\n\nverdocs-send {\n --send-ink: var(--verdocs-body-color, #111827);\n --send-ink-2: #374151;\n --send-muted: #6b7280;\n --send-faint: #9ca3af;\n --send-rule: #e5e7eb;\n --send-control-border: #d1d5db;\n --send-accent: var(--verdocs-link-color, #{$secondary-color});\n --send-accent-tint: #f4f5fc;\n --send-accent-tint-2: #e6e7f8;\n --send-warning-bg: #fffbeb;\n --send-warning-border: #fde68a;\n --send-warning-icon: #d97706;\n --send-warning-text: #78350f;\n --send-radius: var(--verdocs-dialog-radius, 8px);\n --send-min-height: 480px;\n --send-max-width: 480px;\n\n display: none;\n position: relative;\n overflow: hidden;\n width: 100%;\n min-width: 0;\n max-width: var(--verdocs-send-max-width, var(--send-max-width));\n box-sizing: border-box;\n background: #ffffff;\n color: var(--send-ink);\n font-size: 14px;\n border-radius: var(--send-radius);\n border: 1px solid var(--send-rule);\n font-family: $verdocs-primary-font;\n\n * {\n box-sizing: border-box;\n }\n\n &.sendable {\n display: block;\n }\n\n // The main pane sets the card's height. The detail pane sits beside it, off-canvas to the\n // right, and the track slides one pane-width left when a detail view is open. Detail views\n // taller than the card scroll inside it.\n .track {\n position: relative;\n display: flex;\n flex-direction: column;\n min-height: var(--send-min-height);\n transition: transform 220ms ease-out;\n }\n\n &.detail-open .track {\n transform: translateX(-100%);\n }\n\n @media (prefers-reduced-motion: reduce) {\n .track {\n transition: none;\n }\n }\n\n .pane {\n padding: 16px;\n display: flex;\n flex-direction: column;\n }\n\n .main-pane {\n flex: 1;\n }\n\n .detail-pane {\n position: absolute;\n top: 0;\n left: 100%;\n bottom: 0;\n width: 100%;\n overflow: hidden;\n }\n\n .detail {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n }\n\n // The body scrolls between a fixed header and a pinned Done button. The fade sits over the\n // body's bottom edge and shows only while there is more below (classes set by updateScrollFade).\n .detail-body-wrap {\n position: relative;\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n }\n\n .detail-body {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n }\n\n .scroll-fade {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 36px;\n opacity: 0;\n pointer-events: none;\n transition: opacity 150ms ease-out;\n background: linear-gradient(rgba(255, 255, 255, 0), #ffffff);\n }\n\n .scrollable:not(.at-end) > .scroll-fade {\n opacity: 1;\n }\n\n .recipient-detail verdocs-contact-picker {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n }\n\n .section-title {\n font-size: 12px;\n font-weight: 600;\n color: var(--send-ink-2);\n margin: 0 0 6px 0;\n }\n\n .delivery-title {\n margin-top: 16px;\n }\n\n .step {\n font-size: 11px;\n color: var(--send-muted);\n padding: 10px 0 4px 0;\n }\n\n .recipient,\n .kv {\n all: unset;\n display: flex;\n width: 100%;\n min-width: 0;\n max-width: 100%;\n box-sizing: border-box;\n cursor: pointer;\n align-items: center;\n column-gap: 10px;\n border-top: 1px solid var(--send-rule);\n color: var(--send-ink);\n font-family: inherit;\n\n &:focus-visible {\n outline: 2px solid var(--send-accent);\n outline-offset: -2px;\n border-radius: 4px;\n }\n\n .chevron {\n flex: 0 0 16px;\n width: 16px;\n height: 16px;\n color: var(--send-faint);\n\n svg {\n width: 16px;\n height: 16px;\n display: block;\n }\n }\n }\n\n .recipient {\n padding: 8px 6px 8px 0;\n\n &:last-child {\n border-bottom: 1px solid var(--send-rule);\n }\n\n .who {\n flex: 1;\n // Stop a long name/email from making the panel grow\n width: 0;\n min-width: 0;\n display: flex;\n flex-direction: column;\n }\n\n .role-name {\n font-size: 13px;\n font-weight: 600;\n }\n\n .who-detail {\n font-size: 12px;\n color: var(--send-muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &.configure {\n color: var(--send-accent);\n font-weight: 500;\n }\n }\n\n .options {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n margin-top: 3px;\n }\n\n .pill {\n height: 18px;\n padding: 0 6px;\n border-radius: 999px;\n font-size: 10px;\n font-weight: 500;\n display: inline-flex;\n align-items: center;\n background: var(--send-accent-tint);\n color: var(--send-ink-2);\n }\n }\n\n .role-dot {\n flex: 0 0 10px;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n border: 1px solid rgba(0, 0, 0, 0.1);\n }\n\n .kv {\n height: 40px;\n padding: 0 6px 0 0;\n font-size: 13px;\n\n &:last-child {\n border-bottom: 1px solid var(--send-rule);\n }\n\n &:disabled {\n cursor: default;\n color: var(--send-muted);\n }\n\n .key {\n flex: 0 0 84px;\n color: var(--send-muted);\n }\n\n .value {\n flex: 1;\n width: 0;\n min-width: 0;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n small {\n font-size: inherit;\n font-weight: 400;\n color: var(--send-muted);\n }\n\n // Name on one line, email on the next: each line truncates on its own.\n &.stacked {\n display: flex;\n flex-direction: column;\n row-gap: 1px;\n white-space: normal;\n\n .line {\n display: block;\n min-width: 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n small.line {\n font-size: 12px;\n }\n }\n\n &.off {\n color: var(--send-warning-icon);\n }\n }\n\n &:has(.value.stacked) {\n height: auto;\n min-height: 40px;\n padding-top: 6px;\n padding-bottom: 6px;\n }\n }\n\n .main-spacer,\n .detail-spacer {\n flex: 1;\n }\n\n .buttons {\n display: flex;\n margin-top: 14px;\n column-gap: 10px;\n flex-wrap: wrap;\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n\n .error-message {\n width: 100%;\n color: $verdocs-red-1;\n font-size: 13px;\n margin-bottom: 10px;\n }\n }\n\n // Detail views\n .detail-header {\n display: flex;\n align-items: center;\n column-gap: 8px;\n margin: -2px 0 14px 0;\n\n .back {\n all: unset;\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n color: var(--send-accent);\n font-family: inherit;\n flex: 0 0 52px;\n\n .icon,\n .icon svg {\n width: 16px;\n height: 16px;\n display: block;\n }\n\n &:focus-visible {\n outline: 2px solid var(--send-accent);\n outline-offset: 2px;\n border-radius: 4px;\n }\n }\n\n .detail-title {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n column-gap: 8px;\n font-size: 14px;\n font-weight: 600;\n text-align: center;\n }\n\n .detail-header-spacer {\n flex: 0 0 52px;\n }\n }\n\n .detail-footer {\n margin-top: 10px;\n padding-top: 12px;\n border-top: 1px solid var(--send-rule);\n\n verdocs-button,\n verdocs-button button {\n width: 100%;\n }\n }\n\n .hint {\n font-size: 12px;\n line-height: 1.5;\n color: var(--send-muted);\n margin: 10px 0 0 0;\n }\n\n .option-list {\n display: flex;\n flex-direction: column;\n }\n\n .option {\n all: unset;\n display: flex;\n width: 100%;\n cursor: pointer;\n align-items: center;\n column-gap: 10px;\n padding: 10px 0;\n font-size: 13px;\n font-family: inherit;\n color: var(--send-ink);\n border-top: 1px solid var(--send-rule);\n\n &:first-child {\n border-top: 0;\n }\n\n &:focus-visible {\n outline: 2px solid var(--send-accent);\n outline-offset: -2px;\n border-radius: 4px;\n }\n\n .radio {\n flex: 0 0 16px;\n width: 16px;\n height: 16px;\n border-radius: 50%;\n border: 1px solid var(--send-control-border);\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n &.selected .radio {\n border-color: var(--send-accent);\n\n &::after {\n content: '';\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--send-accent);\n }\n }\n\n .swatch {\n flex: 0 0 22px;\n width: 22px;\n height: 22px;\n border-radius: 5px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 9px;\n font-weight: 700;\n color: #ffffff;\n overflow: hidden;\n\n &.logo {\n background: #ffffff;\n border: 1px solid var(--send-rule);\n }\n\n img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n display: block;\n }\n }\n\n .option-label {\n flex: 1;\n width: 0;\n min-width: 0;\n display: flex;\n flex-direction: column;\n\n small {\n font-size: 11px;\n color: var(--send-muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n }\n }\n\n .option-divider {\n height: 0;\n margin: 2px 0;\n border-top: 1px solid var(--send-control-border);\n\n + .option {\n border-top: 0;\n }\n }\n\n .hint a {\n color: var(--send-accent);\n font-weight: 500;\n text-decoration: none;\n border-bottom: 1px solid var(--send-accent-tint-2);\n\n .icon,\n .icon svg {\n width: 11px;\n height: 11px;\n display: inline-block;\n vertical-align: -1px;\n margin-left: 2px;\n }\n }\n\n .expires-field {\n position: relative;\n\n input {\n width: 100%;\n height: 36px;\n padding: 0 52px 0 10px;\n font-size: 14px;\n font-family: inherit;\n color: var(--send-ink);\n background: #ffffff;\n border: 1px solid var(--send-control-border);\n border-radius: 6px;\n outline: none;\n\n &:focus {\n border-color: var(--send-accent);\n box-shadow: 0 0 0 2px var(--send-accent-tint-2);\n }\n\n &::placeholder {\n color: var(--send-faint);\n }\n }\n\n .suffix {\n position: absolute;\n right: 10px;\n top: 0;\n height: 36px;\n display: flex;\n align-items: center;\n font-size: 13px;\n color: var(--send-muted);\n pointer-events: none;\n }\n }\n\n .sender-field {\n display: flex;\n flex-direction: column;\n row-gap: 4px;\n margin: 0 0 10px 0;\n\n label {\n font-size: 12px;\n font-weight: 500;\n color: var(--send-ink-2);\n }\n\n input {\n width: 100%;\n height: 36px;\n padding: 0 10px;\n font-size: 14px;\n font-family: inherit;\n color: var(--send-ink);\n background: #ffffff;\n border: 1px solid var(--send-control-border);\n border-radius: 6px;\n outline: none;\n\n &:focus {\n border-color: var(--send-accent);\n box-shadow: 0 0 0 2px var(--send-accent-tint-2);\n }\n }\n\n .field-error {\n font-size: 12px;\n color: $verdocs-red-1;\n }\n }\n\n .notice {\n display: flex;\n column-gap: 10px;\n margin-top: 4px;\n padding: 10px 12px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 6px;\n color: var(--send-ink-2);\n background: var(--send-accent-tint);\n border: 1px solid var(--send-accent-tint-2);\n\n > .icon {\n flex: 0 0 18px;\n width: 18px;\n height: 18px;\n margin-top: 1px;\n color: var(--send-accent);\n\n svg {\n width: 18px;\n height: 18px;\n display: block;\n }\n }\n }\n\n .warning {\n display: flex;\n column-gap: 10px;\n margin-top: 12px;\n padding: 10px 12px;\n font-size: 12px;\n line-height: 1.5;\n border-radius: 6px;\n color: var(--send-warning-text);\n background: var(--send-warning-bg);\n border: 1px solid var(--send-warning-border);\n\n > .icon {\n flex: 0 0 18px;\n width: 18px;\n height: 18px;\n margin-top: 1px;\n color: var(--send-warning-icon);\n\n svg {\n width: 18px;\n height: 18px;\n display: block;\n }\n }\n }\n\n .notice a,\n .warning a {\n color: var(--send-accent);\n font-weight: 500;\n text-decoration: none;\n border-bottom: 1px solid var(--send-accent-tint-2);\n\n .icon,\n .icon svg {\n width: 11px;\n height: 11px;\n display: inline-block;\n vertical-align: -1px;\n margin-left: 2px;\n }\n }\n\n verdocs-checkbox {\n display: block;\n padding: 4px 0;\n font-size: 13px;\n }\n}\n","import type {IBrand, IOrganization, TRecipientAuthMethod} from '@verdocs/js-sdk';\nimport {Component, Element, Prop, State, h, Event, EventEmitter, Host, Method, Watch} from '@stencil/core';\nimport type {ICreateEnvelopeFromTemplateRequest, ICreateEnvelopeRecipientFromTemplate, IEnvelope, IRecipient, ITemplate} from '@verdocs/js-sdk';\nimport {createEnvelope, formatFullName, getBrands, getOrganization, getTemplate, getOrganizationContacts, getRGBA, isValidEmail, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {IContactSearchEvent} from '../../envelopes/verdocs-contact-picker/verdocs-contact-picker';\nimport {DefaultEndpoint, getWebAppUrl} from '../../../utils/Environment';\nimport {getRoleIndex, getRoleNames} from '../../../utils/Templates';\nimport {updateScrollFade} from '../../../utils/ScrollFade';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst chevronRightIcon =\n '<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>';\n\nconst chevronLeftIcon =\n '<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>';\n\nconst warningIcon =\n '<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>';\n\nconst infoIcon =\n '<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>';\n\nconst externalLinkIcon =\n '<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>';\n\nconst VERDOCS_LOGO_URL = 'https://app.verdocs.com/assets/blue-logo.svg';\n\n// Swipe mechanics for mobile users in detail views\nconst SWIPE_START_FRACTION = 0.25;\nconst SWIPE_MIN_DISTANCE = 60;\nconst SWIPE_MAX_DURATION = 500;\n\n// Expiration controls. The API is less strict, but Web users prefer a simpler setup so we just range-limit it 1..120 here.\nconst MIN_EXPIRY_DAYS = 1;\nconst MAX_EXPIRY_DAYS = 120;\nconst DEFAULT_EXPIRY_DAYS = 120;\n\nconst AUTH_METHOD_LABELS: Record<TRecipientAuthMethod, string> = {\n email: 'Email',\n passcode: 'Passcode',\n sms: 'SMS',\n kba: 'KBA',\n id: 'ID check',\n};\n\ntype TSendView = 'main' | 'recipient' | 'brand' | 'expires' | 'notifications' | 'sender';\n\nexport interface ISendEventDetail extends ICreateEnvelopeFromTemplateRequest {\n name: string;\n template_id: string;\n recipients: ICreateEnvelopeRecipientFromTemplate[];\n template: ITemplate;\n}\n\nexport interface ISentEventDetail extends ICreateEnvelopeFromTemplateRequest {\n name: string;\n template_id: string;\n recipients: ICreateEnvelopeRecipientFromTemplate[];\n envelope_id: string;\n envelope: IEnvelope;\n}\n\n/**\n * Display a form to send a template to one or more recipients in an envelope for signing.\n * Host applications should ensure the template is \"sendable\" before displaying this component.\n * To be sendable, a template must have at least one document attached, at least one participant\n * defined, and at least one field assigned to every \"signer\" participant. This component will\n * hide itself if the template is not sendable.\n *\n * ```ts\n * <verdocs-send\n * templateId={TEMPLATE_ID}\n * onBeforeSend={({ detail })) => { console.log('Sending... Show a spinner...', detail) }\n * onSend={({ detail }) => { console.log('Sent! Hide the spinner...', detail) }\n * onExit={({ detail }) => { console.log('Send cancelled.', detail) }\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-send',\n styleUrl: 'verdocs-send.scss',\n shadow: false,\n})\nexport class VerdocsSend {\n private templateListenerId = null;\n\n @Element() el: HTMLElement;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = DefaultEndpoint;\n\n /**\n * The ID of the template to create the document from.\n */\n @Prop({reflect: true}) templateId: string | null = null;\n\n /**\n * The environment the control is being called from, e.g. 'web'. This has an impact on how certain\n * operations such as email communications are handled to ensure users receive the correct URLs for\n * their invitations. Setting this to unknown values may produce unexpected/incorrect behaviors.\n * If environment is not known, do this set this property.\n */\n @Prop() environment: string = '';\n\n /**\n * Whether to show the cancel button. It may be useful to disable this in environments where\n * the embed is shown in a non-wizard flow with its own navigation for the user to exit.\n */\n @Prop() showCancel = true;\n\n /**\n * Preselect a brand by key, overriding the organization default.\n */\n @Prop({mutable: true}) brandKey = '';\n\n /**\n * The user is sending an envelope the form and clicked send.\n */\n @Event({composed: true}) beforeSend: EventEmitter<ISendEventDetail>;\n\n /**\n * The user completed the form and clicked send.\n */\n @Event({composed: true}) send: EventEmitter<ISentEventDetail>;\n\n /**\n * Event fired when the step is cancelled. This is called exit to avoid conflicts with the JS-reserved \"cancel\" event name.\n */\n @Event({composed: true}) exit: EventEmitter;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the user enters text in a search field. The parent application may use this to update\n * the `contactSuggestions` property.\n */\n @Event({composed: true}) searchContacts: EventEmitter<IContactSearchEvent>;\n\n private swipeStart: {x: number; y: number; time: number} | null = null;\n private swallowNextClick = false;\n private loadedOrganizationId = '';\n\n @State() containerId = `verdocs-send-${Math.random().toString(36).substring(2, 11)}`;\n @State() view: TSendView = 'main';\n @State() editingRoleId = '';\n @State() sessionContacts: {id: string; first_name: string; last_name: string; email: string; phone: string}[] = [];\n @State() sending = false;\n @State() brands: IBrand[] = [];\n @State() organization: IOrganization | null = null;\n @State() expiresInDays = '';\n @State() noContact = false;\n @State() senderDefaults = {name: '', email: ''};\n @State() senderName = '';\n @State() senderEmail = '';\n @State() rolesCompleted: Record<string, Partial<IRecipient>> = {};\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n disconnectedCallback() {\n this.unlistenToTemplate();\n }\n\n componentDidLoad() {\n this.el.addEventListener(\n 'click',\n e => {\n if (this.swallowNextClick) {\n this.swallowNextClick = false;\n e.stopPropagation();\n e.preventDefault();\n }\n },\n true,\n );\n }\n\n // Make off-canvas controls leave the tab order\n componentDidRender() {\n updateScrollFade(this.el.querySelector('.detail-body'));\n this.el.querySelector('.main-pane')?.toggleAttribute('inert', this.view !== 'main');\n this.el.querySelector('.detail-pane')?.toggleAttribute('inert', this.view === 'main');\n }\n\n async listenToTemplate() {\n console.log('[SEND] Loading template', this.templateId);\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n true,\n (template: ITemplate) => {\n console.log('[SEND] Got new template', template);\n this.template = template;\n this.loading = false;\n this.rolesCompleted = {};\n this.view = 'main';\n this.editingRoleId = '';\n this.recomputeRolesCompleted();\n this.loadBrands();\n },\n );\n }\n\n loadBrands() {\n const organizationId = this.template?.organization_id;\n if (!organizationId || organizationId === this.loadedOrganizationId) {\n return;\n }\n\n const changedOrganization = !!this.loadedOrganizationId;\n this.loadedOrganizationId = organizationId;\n this.brands = [];\n this.organization = null;\n if (changedOrganization) {\n this.brandKey = '';\n }\n\n const stillCurrent = () => this.template?.organization_id === organizationId;\n\n getBrands(this.endpoint, organizationId)\n .then(brands => {\n if (stillCurrent()) {\n this.brands = brands || [];\n }\n })\n .catch(e => console.log('[SEND] Unable to load brands', e));\n\n getOrganization(this.endpoint, organizationId)\n .then(organization => {\n if (stillCurrent()) {\n this.organization = organization;\n }\n })\n .catch(e => console.log('[SEND] Unable to load organization', e));\n }\n\n handleExpiryInput(e: any) {\n const digits = (e.target.value || '').replace(/[^0-9]/g, '');\n this.expiresInDays = digits ? String(Math.min(Math.max(Number(digits), MIN_EXPIRY_DAYS), MAX_EXPIRY_DAYS)) : '';\n e.target.value = this.expiresInDays;\n }\n\n effectiveExpiryDays(): number {\n const days = Number(this.expiresInDays);\n return days >= MIN_EXPIRY_DAYS ? days : DEFAULT_EXPIRY_DAYS;\n }\n\n expiresAt(): Date {\n return new Date(Date.now() + this.effectiveExpiryDays() * 24 * 60 * 60 * 1000);\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n @Method()\n async reset() {\n this.rolesCompleted = {};\n this.view = 'main';\n this.editingRoleId = '';\n this.brandKey = '';\n this.expiresInDays = '';\n this.noContact = false;\n this.senderName = '';\n this.senderEmail = '';\n }\n\n // sender_name and sender_email are the contact for recipient questions and the completion\n // notice. They default to the signed-in user and are only sent when edited away from that.\n // The From line of the invitation email is the brand's (then the org's) and is not set here.\n effectiveSenderName() {\n return this.senderName || this.senderDefaults.name;\n }\n\n effectiveSenderEmail() {\n return this.senderEmail || this.senderDefaults.email;\n }\n\n senderOverrides() {\n const name = this.senderName.trim();\n const email = this.senderEmail.trim();\n return {\n sender_name: name && name !== this.senderDefaults.name ? name : undefined,\n sender_email: email && email !== this.senderDefaults.email ? email : undefined,\n };\n }\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string) {\n console.log('[SEND] Template ID changed', newTemplateId);\n this.listenToTemplate();\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.onSessionChanged((_endpoint, _session, profile) => {\n if (!profile) {\n return;\n }\n\n const me = {\n id: profile.id,\n first_name: profile.first_name,\n last_name: profile.last_name,\n email: profile.email,\n phone: profile.phone,\n };\n\n if (profile) {\n this.senderDefaults = {name: formatFullName(profile), email: profile.email || ''};\n this.sessionContacts = [me];\n\n getOrganizationContacts(this.endpoint)\n .then(contacts => {\n console.log('[SEND] Got contacts', contacts);\n this.sessionContacts = [...contacts, me];\n })\n .catch(e => {\n console.log('[SEND] Error getting contacts', e);\n });\n }\n });\n\n this.endpoint.loadSession();\n\n if (!this.endpoint.session) {\n console.log('[SEND] Unable to start Send operation, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n console.log(`[SEND] Missing required template ID ${this.templateId}`);\n return;\n }\n\n this.listenToTemplate();\n } catch (e) {\n console.log('[SEND] Error with send session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n recomputeRolesCompleted() {\n this.rolesCompleted = {};\n\n const rolesAtLevel: Record<number, Partial<IRecipient>[]> = {};\n (this.template?.roles || []).forEach(role => {\n const level = role.sequence;\n rolesAtLevel[level] ||= [];\n const id = `r-${level}-${rolesAtLevel[level].length}`;\n rolesAtLevel[level].push({...role, id, role_name: role.name, first_name: role.first_name, last_name: role.last_name});\n\n // if (role.first_name && (isValidEmail(role.email) || isValidPhone(role.phone))) {\n if (role.first_name && isValidEmail(role.email)) {\n this.rolesCompleted[id] = {...role, id, role_name: role.name, first_name: role.first_name, last_name: role.last_name};\n }\n });\n }\n\n getSequenceNumbers() {\n // This is cleaner with a Set but we found a regression in some target environments where\n // this breaks down. Reverting to an older technique while we diagnose it.\n const sequences: Record<number, boolean> = {};\n (this.template?.roles || []).forEach(role => {\n sequences[role.sequence] = true;\n });\n return Object.keys(sequences)\n .map(s => +s)\n .sort((a, b) => a - b);\n }\n\n getRolesAtLevel(level: number) {\n const rolesAtLevel = (this.template?.roles || [])\n .filter(role => role.sequence === level)\n .map((role, index) => ({\n ...role,\n id: `r-${level}-${index}`,\n role_name: role.name,\n first_name: role.first_name,\n last_name: role.last_name,\n }));\n return rolesAtLevel as Partial<IRecipient>[];\n }\n\n getRoleById(id: string): Partial<IRecipient> | null {\n for (const level of this.getSequenceNumbers()) {\n const match = this.getRolesAtLevel(level).find(role => role.id === id);\n if (match) {\n return match;\n }\n }\n\n return null;\n }\n\n // We only show options the sender switched on.\n getRecipientOptionLabels(recipient: Partial<IRecipient> | undefined): string[] {\n if (!recipient) {\n return [];\n }\n\n const labels = (recipient.auth_methods || []).filter(method => method !== 'email').map(method => AUTH_METHOD_LABELS[method] || method);\n if (recipient.delegator) {\n labels.push('May delegate');\n }\n\n if (recipient.name_locked) {\n labels.push('Name locked');\n }\n\n return labels;\n }\n\n getDefaultBrand(): IBrand | null {\n const defaultId = this.organization?.default_brand_id;\n return (defaultId && this.brands.find(brand => brand.id === defaultId)) || null;\n }\n\n getDefaultBrandLabel() {\n const name = this.getDefaultBrand()?.name;\n return `Default (${name || 'Verdocs'})`;\n }\n\n getSelectedBrandLabel() {\n if (!this.brandKey) {\n return this.getDefaultBrandLabel();\n }\n\n const brand = this.brands.find(b => b.key === this.brandKey);\n return brand?.name || brand?.key || this.brandKey;\n }\n\n showView(view: TSendView) {\n this.view = view;\n }\n\n handleSelectContact(e: any, role: Partial<IRecipient>) {\n e.preventDefault();\n this.rolesCompleted = {...this.rolesCompleted, [role.id]: {...role, ...e.detail}};\n this.editingRoleId = '';\n this.view = 'main';\n }\n\n handleClickRole(e: any, role: Partial<IRecipient>) {\n e.stopPropagation();\n this.editingRoleId = role.id;\n this.view = 'recipient';\n }\n\n handleSend(e: any) {\n if (this.sending) {\n console.log('[SEND] Skipping duplicate send', e);\n return;\n }\n\n console.log('[SEND] Sending', e);\n e.preventDefault();\n e.stopPropagation();\n\n this.sending = true;\n const localeData = Intl.DateTimeFormat().resolvedOptions();\n\n const details: ICreateEnvelopeFromTemplateRequest = {\n template_id: this.templateId,\n name: this.template?.name || 'New Envelope',\n environment: this.environment,\n initial_reminder: 0,\n followup_reminders: 0,\n recipients: Object.values(this.rolesCompleted) as ICreateEnvelopeRecipientFromTemplate[],\n timezone: localeData.timeZone,\n locale: localeData.locale,\n expires_at: this.expiresAt().toISOString(),\n };\n\n details.no_contact = this.noContact;\n const {sender_name, sender_email} = this.senderOverrides();\n if (sender_name) {\n details.sender_name = sender_name;\n }\n if (sender_email) {\n details.sender_email = sender_email;\n }\n if (this.brandKey) {\n details.brand_key = this.brandKey;\n }\n\n const beforeSendResult = this.beforeSend.emit({...details, name: details.name!, template: this.template});\n if (beforeSendResult.defaultPrevented) {\n console.log('[SEND] Send cancelled by parent', details);\n this.sending = false;\n return;\n }\n\n console.log('[SEND] Creating envelope', details);\n createEnvelope(this.endpoint, details)\n .then(r => {\n console.log('[SEND] Send envelope', r);\n this.reset().catch((e: any) => console.log('Unknown Error', e));\n this.sending = false;\n this.send?.emit({...details, name: details.name!, envelope_id: r.id, envelope: r});\n })\n .catch(e => {\n console.log('[SEND] Send error', e);\n VerdocsToast(e.response?.data?.error || 'Error creating envelope, please try again later.');\n this.sending = false;\n this.sdkError?.emit(e);\n });\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n this.exit?.emit();\n }\n\n handleSwipeStart(e: PointerEvent) {\n this.swallowNextClick = false;\n const pane = e.currentTarget as HTMLElement;\n const rect = pane.getBoundingClientRect();\n const onTextEntry = !!(e.target as HTMLElement)?.closest?.('input, textarea, select, [contenteditable]');\n if (this.view === 'main' || onTextEntry || e.clientX - rect.left > rect.width * SWIPE_START_FRACTION) {\n this.swipeStart = null;\n return;\n }\n\n this.swipeStart = {x: e.clientX, y: e.clientY, time: Date.now()};\n }\n\n handleSwipeEnd(e: PointerEvent) {\n const start = this.swipeStart;\n this.swipeStart = null;\n if (!start) {\n return;\n }\n\n const dx = e.clientX - start.x;\n const dy = Math.abs(e.clientY - start.y);\n if (dx >= SWIPE_MIN_DISTANCE && dx > dy && Date.now() - start.time <= SWIPE_MAX_DURATION) {\n this.swallowNextClick = true;\n this.showView('main');\n }\n }\n\n renderDetailHeader(title: any) {\n return (\n <div class=\"detail-header\">\n <button type=\"button\" class=\"back\" onClick={() => this.showView('main')}>\n <span class=\"icon\" innerHTML={chevronLeftIcon} />\n Back\n </button>\n <div class=\"detail-title\">{title}</div>\n <div class=\"detail-header-spacer\" />\n </div>\n );\n }\n\n renderDetailBody(content: any) {\n return (\n <div class=\"detail-body-wrap\">\n <div class=\"detail-body\" onScroll={(e: any) => updateScrollFade(e.target)}>\n {content}\n </div>\n <div class=\"scroll-fade\" />\n </div>\n );\n }\n\n renderDoneButton() {\n return (\n <div class=\"detail-footer\">\n <verdocs-button label=\"Done\" size=\"small\" onClick={() => this.showView('main')} />\n </div>\n );\n }\n\n renderRecipientView() {\n const role = this.getRoleById(this.editingRoleId);\n if (!role) {\n return <div class=\"detail recipient-detail\">{this.renderDetailHeader('Recipient')}</div>;\n }\n\n const roleIndex = getRoleIndex(this.template, role.role_name);\n return (\n <div class=\"detail recipient-detail\">\n {this.renderDetailHeader([<span class=\"role-dot\" style={{backgroundColor: getRGBA(roleIndex)}} />, role.role_name])}\n <verdocs-contact-picker\n key={role.id}\n showCancel={false}\n onExit={() => this.showView('main')}\n onNext={e => this.handleSelectContact(e, role)}\n contactSuggestions={this.sessionContacts}\n templateRole={(this.rolesCompleted[role.id] ?? role) as IRecipient}\n onSearchContacts={e => this.searchContacts?.emit(e.detail)}\n />\n </div>\n );\n }\n\n renderBrandSwatch(brand: IBrand | null, fallbackInitial: string) {\n const image = brand?.favicon_url || brand?.thumbnail_url || (brand ? null : VERDOCS_LOGO_URL);\n if (image) {\n return (\n <span class=\"swatch logo\">\n <img src={image} alt=\"\" />\n </span>\n );\n }\n\n return (\n <span class=\"swatch\" style={{backgroundColor: brand?.primary_color || '#4c56cb'}}>\n {fallbackInitial.substring(0, 2).toUpperCase()}\n </span>\n );\n }\n\n renderBrandOption(key: string, label: string, sub: string, swatch: any) {\n return (\n <button type=\"button\" class={{option: true, selected: this.brandKey === key}} onClick={() => (this.brandKey = key)}>\n <span class=\"radio\" />\n {swatch}\n <span class=\"option-label\">\n {label}\n <small>{sub}</small>\n </span>\n </button>\n );\n }\n\n renderBrandView() {\n const defaultBrand = this.getDefaultBrand();\n const others = this.brands.filter(brand => brand.id !== defaultBrand?.id).sort((a, b) => (a.name || a.key).localeCompare(b.name || b.key));\n const hasBrands = this.brands.length > 0;\n\n return (\n <div class=\"detail\">\n {this.renderDetailHeader('Brand')}\n {this.renderDetailBody([\n <div class=\"option-list\">\n {this.renderBrandOption('', this.getDefaultBrandLabel(), 'Organization default', this.renderBrandSwatch(defaultBrand, defaultBrand?.name || 'V'))}\n {others.length > 0 && <div class=\"option-divider\" />}\n {others.map(brand => this.renderBrandOption(brand.key, brand.name || brand.key, brand.key, this.renderBrandSwatch(brand, brand.name || brand.key)))}\n </div>,\n !hasBrands && (\n <p class=\"hint\">\n Configure the look and feel of the signing experience by{' '}\n <a href={`${getWebAppUrl(this.endpoint)}/settings/branding`} target=\"_blank\" rel=\"noopener\">\n Creating a Brand\n <span class=\"icon\" innerHTML={externalLinkIcon} />\n </a>\n .\n </p>\n ),\n ])}\n {this.renderDoneButton()}\n </div>\n );\n }\n\n renderExpiresView() {\n const expiresAt = this.expiresAt();\n const when = `${expiresAt.toLocaleDateString(undefined, {month: 'short', day: 'numeric', year: 'numeric'})} at ${expiresAt.toLocaleTimeString(undefined, {hour: 'numeric', minute: '2-digit'})}`;\n\n return (\n <div class=\"detail\">\n {this.renderDetailHeader('Expiration')}\n {this.renderDetailBody([\n <div class=\"expires-field\">\n <input\n type=\"text\"\n inputMode=\"numeric\"\n aria-label=\"Expires in (days)\"\n placeholder={String(DEFAULT_EXPIRY_DAYS)}\n value={this.expiresInDays}\n disabled={this.sending}\n onInput={(e: any) => this.handleExpiryInput(e)}\n />\n <span class=\"suffix\">days</span>\n </div>,\n <p class=\"hint\">\n This envelope will expire on {when}. Expirations may be set from {MIN_EXPIRY_DAYS}-{MAX_EXPIRY_DAYS} days. If left blank, this will default to {DEFAULT_EXPIRY_DAYS}.\n </p>,\n ])}\n {this.renderDoneButton()}\n </div>\n );\n }\n\n renderSenderView() {\n const validEmail = !this.senderEmail.trim() || isValidEmail(this.senderEmail.trim());\n return (\n <div class=\"detail\">\n {this.renderDetailHeader('Sender')}\n {this.renderDetailBody([\n <div class=\"sender-field\">\n <label htmlFor={`${this.containerId}-sender-name`}>Name</label>\n <input\n id={`${this.containerId}-sender-name`}\n type=\"text\"\n value={this.effectiveSenderName()}\n disabled={this.sending}\n onInput={(e: any) => (this.senderName = e.target.value)}\n />\n </div>,\n <div class=\"sender-field\">\n <label htmlFor={`${this.containerId}-sender-email`}>Email</label>\n <input\n id={`${this.containerId}-sender-email`}\n type=\"email\"\n value={this.effectiveSenderEmail()}\n disabled={this.sending}\n onInput={(e: any) => (this.senderEmail = e.target.value)}\n />\n {!validEmail && <div class=\"field-error\">Enter a valid email address.</div>}\n </div>,\n <div class=\"notice\">\n <span class=\"icon\" innerHTML={infoIcon} />\n <div>\n Specify where envelope-completed email notifications and \"Ask a Question\" submissions are delivered. To customize the \"From\" address for email notifications, please\n configure those in{' '}\n <a href={`${getWebAppUrl(this.endpoint)}/settings/branding`} target=\"_blank\" rel=\"noopener\">\n Brands\n <span class=\"icon\" innerHTML={externalLinkIcon} />\n </a>\n .\n </div>\n </div>,\n ])}\n {this.renderDoneButton()}\n </div>\n );\n }\n\n renderNotificationsView() {\n return (\n <div class=\"detail\">\n {this.renderDetailHeader('Notifications')}\n {this.renderDetailBody([\n <verdocs-checkbox size=\"small\" label=\"Disable notifications\" checked={this.noContact} onInput={(e: any) => (this.noContact = !!e.target.checked)} />,\n this.noContact && (\n <div class=\"warning\">\n <span class=\"icon\" innerHTML={warningIcon} />\n <div>\n 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\n via an API call. We strongly recommend enabling{' '}\n <a href={`${getWebAppUrl(this.endpoint)}/settings/webhooks`} target=\"_blank\" rel=\"noopener\">\n Webhooks\n <span class=\"icon\" innerHTML={externalLinkIcon} />\n </a>{' '}\n to help automate this process.\n </div>\n </div>\n ),\n ])}\n {this.renderDoneButton()}\n </div>\n );\n }\n\n renderDetail() {\n switch (this.view) {\n case 'recipient':\n return this.renderRecipientView();\n case 'brand':\n return this.renderBrandView();\n case 'expires':\n return this.renderExpiresView();\n case 'notifications':\n return this.renderNotificationsView();\n case 'sender':\n return this.renderSenderView();\n default:\n return null;\n }\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host style={{display: 'flex'}}>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n const levels = this.getSequenceNumbers();\n const rolesAssigned = Object.values(this.rolesCompleted).filter(recipient => isValidEmail(recipient.email) && recipient.first_name && recipient.last_name);\n const allRolesAssigned = rolesAssigned.length >= getRoleNames(this.template).length;\n const assignedEmails = rolesAssigned.map(r => r.email.toLowerCase());\n const hasDuplicateEmails = new Set(assignedEmails).size < assignedEmails.length;\n const expiresAt = this.expiresAt();\n const expiresShort = expiresAt.toLocaleDateString(undefined, {month: 'short', day: 'numeric'});\n\n return (\n <Host class={{'sendable': this.template?.is_sendable, 'detail-open': this.view !== 'main'}}>\n <div class=\"track\">\n <div class=\"pane main-pane\" aria-hidden={this.view !== 'main' ? 'true' : 'false'}>\n <div class=\"section-title\">Recipients</div>\n <div class=\"recipients\">\n {levels.map(level => [\n levels.length > 1 && <div class=\"step\">Step {level}</div>,\n this.getRolesAtLevel(level).map(role => {\n const roleIndex = getRoleIndex(this.template, role.role_name);\n const completed = this.rolesCompleted[role.id];\n const assigned = completed && rolesAssigned.findIndex(r => r.role_name === role.role_name) > -1;\n const optionLabels = this.getRecipientOptionLabels(completed);\n\n return (\n <button type=\"button\" class=\"recipient\" data-ri={roleIndex} data-rn={role.role_name} onClick={e => this.handleClickRole(e, role)}>\n <span class=\"role-dot\" style={{backgroundColor: getRGBA(roleIndex)}} />\n <span class=\"who\">\n <span class=\"role-name\">{role.role_name}</span>\n {assigned ? (\n <span class=\"who-detail\">\n {formatFullName(completed)} · {completed.email}\n </span>\n ) : (\n <span class=\"who-detail configure\">Configure recipient</span>\n )}\n {optionLabels.length > 0 && (\n <span class=\"options\">\n {optionLabels.map(label => (\n <span class=\"pill\">{label}</span>\n ))}\n </span>\n )}\n </span>\n <span class=\"chevron\" innerHTML={chevronRightIcon} />\n </button>\n );\n }),\n ])}\n </div>\n\n <div class=\"section-title delivery-title\">Delivery</div>\n <div class=\"delivery\">\n <button type=\"button\" class=\"kv\" onClick={() => this.showView('brand')} disabled={this.sending}>\n <span class=\"key\">Brand</span>\n <span class=\"value\">{this.getSelectedBrandLabel()}</span>\n <span class=\"chevron\" innerHTML={chevronRightIcon} />\n </button>\n <button type=\"button\" class=\"kv\" onClick={() => this.showView('expires')} disabled={this.sending}>\n <span class=\"key\">Expires</span>\n <span class=\"value\">\n {this.effectiveExpiryDays()} days <small>· {expiresShort}</small>\n </span>\n <span class=\"chevron\" innerHTML={chevronRightIcon} />\n </button>\n <button type=\"button\" class=\"kv\" onClick={() => this.showView('sender')} disabled={this.sending}>\n <span class=\"key\">Sender</span>\n <span class=\"value stacked\">\n <span class=\"line\">{this.effectiveSenderName() || this.effectiveSenderEmail()}</span>\n {this.effectiveSenderName() && this.effectiveSenderEmail() ? <small class=\"line\">{this.effectiveSenderEmail()}</small> : null}\n </span>\n <span class=\"chevron\" innerHTML={chevronRightIcon} />\n </button>\n <button type=\"button\" class=\"kv\" onClick={() => this.showView('notifications')} disabled={this.sending}>\n <span class=\"key\">Notifications</span>\n <span class={{value: true, off: this.noContact}}>{this.noContact ? 'Off' : 'On'}</span>\n <span class=\"chevron\" innerHTML={chevronRightIcon} />\n </button>\n </div>\n\n <div class=\"main-spacer\" />\n\n <div class=\"buttons\">\n {hasDuplicateEmails && <div class=\"error-message\">Recipients cannot share the same email.</div>}\n {this.sending && <verdocs-spinner />}\n {this.showCancel && <verdocs-button label=\"Cancel\" size=\"small\" variant=\"outline\" onClick={e => this.handleCancel(e)} disabled={this.sending} />}\n <verdocs-button label=\"Send\" size=\"small\" disabled={!allRolesAssigned || this.sending || hasDuplicateEmails} onClick={e => this.handleSend(e)} />\n </div>\n </div>\n\n <div\n class=\"pane detail-pane\"\n aria-hidden={this.view === 'main' ? 'true' : 'false'}\n onPointerDown={e => this.handleSwipeStart(e)}\n onPointerUp={e => this.handleSwipeEnd(e)}\n onPointerCancel={() => (this.swipeStart = null)}\n >\n {this.renderDetail()}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"upBAEO,MAAMA,EAAgBC,KAAgCA,IAAQ,MAARA,SAAQ,SAARA,EAAUC,QAAS,IAAIC,KAAIC,GAAQA,EAAKC,OAE9F,MAAMC,EAAe,CAACL,EAA4BM,IACvDC,KAAKC,IACHT,EAAaC,GAAUS,WAAUL,GAAQA,IAASE,IAClD,GCPJ,MAAMI,EAAiB,IAAM,uoZCY7B,MAAMC,EACJ,iMAEF,MAAMC,EACJ,mMAEF,MAAMC,EACJ,2RAEF,MAAMC,EACJ,uOAEF,MAAMC,EACJ,uNAEF,MAAMC,EAAmB,+CAGzB,MAAMC,EAAuB,IAC7B,MAAMC,EAAqB,GAC3B,MAAMC,EAAqB,IAG3B,MAAMC,EAAkB,EACxB,MAAMC,EAAkB,IACxB,MAAMC,EAAsB,IAE5B,MAAMC,EAA2D,CAC/DC,MAAO,QACPC,SAAU,WACVC,IAAK,MACLC,IAAK,MACLC,GAAI,Y,MA0COC,EAAWC,EAAA,MAAAD,UAAAE,EALxB,WAAAC,CAAAC,G,iNAMUC,KAAAC,mBAAqB,KAOrBD,KAAAE,SAA4BC,EAKbH,KAAAI,WAA4B,KAQ3CJ,KAAAK,YAAsB,GAMtBL,KAAAM,WAAa,KAKEN,KAAAO,SAAW,GA6B1BP,KAAAQ,WAA0D,KAC1DR,KAAAS,iBAAmB,MACnBT,KAAAU,qBAAuB,GAEtBV,KAAAW,YAAc,gBAAgBtC,KAAKuC,SAASC,SAAS,IAAIC,UAAU,EAAG,MACtEd,KAAAe,KAAkB,OAClBf,KAAAgB,cAAgB,GAChBhB,KAAAiB,gBAAuG,GACvGjB,KAAAkB,QAAU,MACVlB,KAAAmB,OAAmB,GACnBnB,KAAAoB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M,KAAKkB,SAAWkL,EAAA,wBAChBpM,KAAKM,YAAc8L,EAAA,kBAAgBS,MAAM,SAASC,KAAK,QAAQsE,QAAQ,UAAU7E,QAAStK,GAAKjC,KAAK4K,aAAa3I,GAAI0N,SAAU3P,KAAKkB,UACrIkL,EAAA,kBAAgBS,MAAM,OAAOC,KAAK,QAAQ6C,UAAWa,GAAoBxQ,KAAKkB,SAAWyP,EAAoBpE,QAAStK,GAAKjC,KAAKgJ,WAAW/G,OAI/ImK,EAAA,OACEC,MAAM,mBAAkB,cACXrM,KAAKe,OAAS,OAAS,OAAS,QAC7CsQ,cAAepP,GAAKjC,KAAK8K,iBAAiB7I,GAC1CqP,YAAarP,GAAKjC,KAAK6L,eAAe5J,GACtCsP,gBAAiB,IAAOvR,KAAKQ,WAAa,MAEzCR,KAAKkQ,iB","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as s,h as r,d as a,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as n,toggleTemplateStar as o}from"@verdocs/js-sdk";const l=()=>`verdocs-template-star{display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-template-star .star{line-height:10px}verdocs-template-star .star.updating{-webkit-animation:spinningStar 2s infinite linear;animation:spinningStar 2s infinite linear}verdocs-template-star .star svg{width:24px;height:24px}verdocs-template-star .count{color:#595c5d;font-size:14px;margin-left:10px}@-webkit-keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}`;const c=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" /></svg>`;const d=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z" clip-rule="evenodd" /></svg>`;const
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as t,H as e,c as s,h as r,d as a,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as n,toggleTemplateStar as o}from"@verdocs/js-sdk";const l=()=>`verdocs-template-star{display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-template-star .star{line-height:10px}verdocs-template-star .star.updating{-webkit-animation:spinningStar 2s infinite linear;animation:spinningStar 2s infinite linear}verdocs-template-star .star svg{width:24px;height:24px}verdocs-template-star .count{color:#595c5d;font-size:14px;margin-left:10px}@-webkit-keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}`;const c=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" /></svg>`;const d=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z" clip-rule="evenodd" /></svg>`;const m=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.starChange=s(this,"starChange");this.sdkError=s(this,"sdkError");this.endpoint=n.getDefault();this.updating=false}async componentWillLoad(){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[TEMPLATES] Must be authenticated");return}}toggle(t){t.stopPropagation();this.updating=true;o(this.endpoint,this.template.id).then((t=>{this.updating=false;this.template.star_counter=t.star_counter;this.starChange.emit({templateId:this.template.id,starred:t.star_counter>0,count:t.star_counter})})).catch((t=>{this.updating=false;console.log("[STAR] Error toggling template star",t.message);this.sdkError.emit(t)}))}render(){return r(a,{key:"3ad893e322e75e91b50bb0e88a52351a3ae08b12"},r("div",{key:"abcc59607ae57838800e568d43c75488b0a5528d",class:`star ${this.updating?"updating":""}`,innerHTML:this.template.star_counter?d:c,onClick:t=>this.toggle(t)}),r("div",{key:"2a369be78c9f89ae8cad98286b33f1e6e8b182a9",class:"count"},this.template.star_counter||"--"))}static get style(){return l()}},[0,"verdocs-template-star",{endpoint:[16],template:[1040],updating:[32]}]);function f(){if(typeof customElements==="undefined"){return}const t=["verdocs-template-star"];t.forEach((t=>{switch(t){case"verdocs-template-star":if(!customElements.get(i(t))){customElements.define(i(t),m)}break}}))}export{m as V,f as d};
|
|
2
|
+
//# sourceMappingURL=p-ClWqxMkZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["verdocsTemplateStarCss","OutlineStarIcon","SolidStarIcon","VerdocsTemplateStar","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","endpoint","VerdocsEndpoint","getDefault","updating","componentWillLoad","loadSession","session","console","log","toggle","e","stopPropagation","toggleTemplateStar","template","id","then","r","star_counter","starChange","emit","templateId","starred","count","catch","message","sdkError","render","h","Host","key","class","innerHTML","onClick"],"sources":["src/components/templates/verdocs-template-star/verdocs-template-star.scss?tag=verdocs-template-star","src/components/templates/verdocs-template-star/verdocs-template-star.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-star {\n display: flex;\n flex: 0 0 60px;\n align-items: center;\n flex-direction: row;\n font-family: $primary-font;\n\n .star {\n line-height: 10px;\n\n &.updating {\n animation: spinningStar 2s infinite linear;\n }\n\n svg {\n width: 24px;\n height: 24px;\n }\n }\n\n .count {\n color: #595c5d;\n font-size: 14px;\n margin-left: 10px;\n }\n}\n\n@keyframes spinningStar {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(359deg);\n }\n}\n","import {VerdocsEndpoint, toggleTemplateStar, ITemplate} from '@verdocs/js-sdk';\nimport {Component, Prop, h, Host, Event, EventEmitter, State} from '@stencil/core';\nimport {SDKError} from '../../../utils/errors';\n\nconst OutlineStarIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z\" /></svg>`;\n\nconst SolidStarIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z\" clip-rule=\"evenodd\" /></svg>`;\n\n/**\n * Displays a clickable star that allows users to mark frequently-used templates.\n */\n@Component({\n tag: 'verdocs-template-star',\n styleUrl: 'verdocs-template-star.scss',\n})\nexport class VerdocsTemplateStar {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The template to display the star for.\n */\n @Prop({mutable: true}) template: ITemplate;\n\n /**\n * Event fired when the user toggles the star on or off. The event detail will contain\n * the new \"starred\" status and count.\n */\n @Event({composed: true}) starChange: EventEmitter<{templateId: string; starred: boolean; count: number}>;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() updating = false;\n\n async componentWillLoad() {\n this.endpoint.loadSession();\n\n if (!this.endpoint.session) {\n console.log('[TEMPLATES] Must be authenticated');\n return;\n }\n }\n\n toggle(e: any) {\n e.stopPropagation();\n this.updating = true;\n toggleTemplateStar(
|
|
1
|
+
{"version":3,"names":["verdocsTemplateStarCss","OutlineStarIcon","SolidStarIcon","VerdocsTemplateStar","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","endpoint","VerdocsEndpoint","getDefault","updating","componentWillLoad","loadSession","session","console","log","toggle","e","stopPropagation","toggleTemplateStar","template","id","then","r","star_counter","starChange","emit","templateId","starred","count","catch","message","sdkError","render","h","Host","key","class","innerHTML","onClick"],"sources":["src/components/templates/verdocs-template-star/verdocs-template-star.scss?tag=verdocs-template-star","src/components/templates/verdocs-template-star/verdocs-template-star.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-star {\n display: flex;\n flex: 0 0 60px;\n align-items: center;\n flex-direction: row;\n font-family: $primary-font;\n\n .star {\n line-height: 10px;\n\n &.updating {\n animation: spinningStar 2s infinite linear;\n }\n\n svg {\n width: 24px;\n height: 24px;\n }\n }\n\n .count {\n color: #595c5d;\n font-size: 14px;\n margin-left: 10px;\n }\n}\n\n@keyframes spinningStar {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(359deg);\n }\n}\n","import {VerdocsEndpoint, toggleTemplateStar, ITemplate} from '@verdocs/js-sdk';\nimport {Component, Prop, h, Host, Event, EventEmitter, State} from '@stencil/core';\nimport {SDKError} from '../../../utils/errors';\n\nconst OutlineStarIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\"><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z\" /></svg>`;\n\nconst SolidStarIcon = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z\" clip-rule=\"evenodd\" /></svg>`;\n\n/**\n * Displays a clickable star that allows users to mark frequently-used templates.\n */\n@Component({\n tag: 'verdocs-template-star',\n styleUrl: 'verdocs-template-star.scss',\n})\nexport class VerdocsTemplateStar {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The template to display the star for.\n */\n @Prop({mutable: true}) template: ITemplate;\n\n /**\n * Event fired when the user toggles the star on or off. The event detail will contain\n * the new \"starred\" status and count.\n */\n @Event({composed: true}) starChange: EventEmitter<{templateId: string; starred: boolean; count: number}>;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() updating = false;\n\n async componentWillLoad() {\n this.endpoint.loadSession();\n\n if (!this.endpoint.session) {\n console.log('[TEMPLATES] Must be authenticated');\n return;\n }\n }\n\n toggle(e: any) {\n e.stopPropagation();\n this.updating = true;\n toggleTemplateStar(this.endpoint, this.template.id)\n .then(r => {\n this.updating = false;\n this.template.star_counter = r.star_counter;\n this.starChange.emit({\n templateId: this.template.id,\n starred: r.star_counter > 0,\n count: r.star_counter,\n });\n })\n .catch(e => {\n this.updating = false;\n console.log('[STAR] Error toggling template star', e.message);\n this.sdkError.emit(e);\n });\n }\n\n render() {\n return (\n <Host>\n <div class={`star ${this.updating ? 'updating' : ''}`} innerHTML={this.template.star_counter ? SolidStarIcon : OutlineStarIcon} onClick={e => this.toggle(e)} />\n <div class=\"count\">{this.template.star_counter || '--'}</div>\n </Host>\n );\n }\n}\n"],"mappings":"iJAAA,MAAMA,EAAyB,IAAM,izBCIrC,MAAMC,EAAkB,whBAExB,MAAMC,EAAgB,6a,MASTC,EAAmBC,EAAA,MAAAD,UAAAE,EAJhC,WAAAC,CAAAC,G,kHAQUC,KAAAC,SAA4BC,EAAgBC,aAmB3CH,KAAAI,SAAW,KAuCrB,CArCC,uBAAMC,GACJL,KAAKC,SAASK,cAEd,IAAKN,KAAKC,SAASM,QAAS,CAC1BC,QAAQC,IAAI,qCACZ,M,EAIJ,MAAAC,CAAOC,GACLA,EAAEC,kBACFZ,KAAKI,SAAW,KAChBS,EAAmBb,KAAKC,SAAUD,KAAKc,SAASC,IAC7CC,MAAKC,IACJjB,KAAKI,SAAW,MAChBJ,KAAKc,SAASI,aAAeD,EAAEC,aAC/BlB,KAAKmB,WAAWC,KAAK,CACnBC,WAAYrB,KAAKc,SAASC,GAC1BO,QAASL,EAAEC,aAAe,EAC1BK,MAAON,EAAEC,cACT,IAEHM,OAAMb,IACLX,KAAKI,SAAW,MAChBI,QAAQC,IAAI,sCAAuCE,EAAEc,SACrDzB,KAAK0B,SAASN,KAAKT,EAAE,G,CAI3B,MAAAgB,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,4CACHF,EAAA,OAAAE,IAAA,2CAAKC,MAAO,QAAQ/B,KAAKI,SAAW,WAAa,KAAM4B,UAAWhC,KAAKc,SAASI,aAAexB,EAAgBD,EAAiBwC,QAAStB,GAAKX,KAAKU,OAAOC,KAC1JiB,EAAA,OAAAE,IAAA,2CAAKC,MAAM,SAAS/B,KAAKc,SAASI,cAAgB,M","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as s,c as t,h as o,d as r,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as d,getTemplate as a}from"@verdocs/js-sdk";import{S as l}from"./p-C1sRVZWv.js";import{S as c}from"./p-C7hFgM52.js";import{d as n}from"./p-Bb5V9TQx.js";import{d as m}from"./p-NtvxlYzY.js";import{d as p}from"./p-C-v22G3g.js";import{d as f}from"./p-CaFhF-9s.js";import{d as v}from"./p-C90lxyUX.js";import{d as h}from"./p-5M_R8La0.js";import{d as u}from"./p-BLsFdjFq.js";import{d as b}from"./p-C8ZliaLz.js";import{d as x}from"./p-YCI5JKXK.js";import{d as k}from"./p-h3swu3rA.js";import{d as w}from"./p-DbWcp3S8.js";import{d as E}from"./p-BPcxbmXF.js";import{d as g}from"./p-CAJJndLX.js";import{d as j}from"./p-DMaRtkQF.js";import{d as y}from"./p-DReW8CSB.js";import{d as C}from"./p-BSX4GfGg.js";import{d as I}from"./p-C8yiLtCJ.js";import{d as D}from"./p-DHzSlpJw.js";import{d as B}from"./p-DqzFuSNN.js";import{d as U}from"./p-DsSqGIBJ.js";import{d as L}from"./p-5FU3bYQ3.js";import{d as S}from"./p-DhOuB4nS.js";import{d as T}from"./p-BIi4c9Gz.js";import{d as F}from"./p-CdnjpaJt.js";import{d as N}from"./p-Bodw4NVB.js";import{d as z}from"./p-DPF2i0o5.js";import{d as J}from"./p-DreV6Npp.js";import{d as R}from"./p-Lo1dCgyv.js";import{d as G}from"./p-DFbeKrpm.js";import{d as M}from"./p-DX713VO2.js";import{d as V}from"./p-qLNetL5t.js";import{d as X}from"./p-ByEpps_M.js";import{d as Y}from"./p-DeAwyTxI.js";import{d as P}from"./p-CnD-TaPJ.js";import{d as W}from"./p-PfdIkMoz.js";import{d as q}from"./p-B-ul_Soj.js";import{d as A}from"./p-DM3wePVp.js";const Q=()=>`verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{display:block;width:500px;max-width:95%;-webkit-box-sizing:border-box;box-sizing:border-box;margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157);box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157)}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}`;const K=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.cancel=t(this,"cancel");this.sdkError=t(this,"sdkError");this.stepChanged=t(this,"stepChanged");this.send=t(this,"send");this.templateUpdated=t(this,"templateUpdated");this.templateCreated=t(this,"templateCreated");this.rolesUpdated=t(this,"rolesUpdated");this.templateListenerId=null;this.endpoint=d.getDefault();this.templateId=null;this.step="preview";this.loading=true;this.template=null}onTemplateIdChanged(e,s){if(!s&&e&&this.step==="attachments"){this.step="preview"}this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}onStepChanged(){this.loadTemplate(this.templateId).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,s,t,o,r,i;try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return}if(!this.templateId){console.log(`[BUILD] No template ID, activating upload mode`);this.step="attachments";this.loading=false;return}try{this.loadTemplate(this.templateId).catch((e=>console.log("[BUILD] Unable to load template",e)))}catch(o){console.log("[BUILD] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new l(o.message,(s=o.response)===null||s===void 0?void 0:s.status,(t=o.response)===null||t===void 0?void 0:t.data))}}catch(e){console.log("[BUILD] Error with builder session",e);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new l(e.message,(r=e.response)===null||r===void 0?void 0:r.status,(i=e.response)===null||i===void 0?void 0:i.data))}}async loadTemplate(e){if(e){c.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}}disconnectedCallback(){console.log("[BUILD] Disconnected");this.unlistenToTemplate()}unlistenToTemplate(){if(this.templateListenerId){c.store.delListener(this.templateListenerId);this.templateListenerId=null}}handleCancel(){var e;this.step="preview";(e=this.cancel)===null||e===void 0?void 0:e.emit()}async handleTemplateCreated(e){var s;await this.loadTemplate(e);this.templateId=e;this.step="roles";(s=this.stepChanged)===null||s===void 0?void 0:s.emit("roles")}async handleRolesUpdated(e){var s;console.log("[BUILD] Roloes updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}async handleTemplateUpdated(e){var s;console.log("[BUILD] Template updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}handleAttachmentsNext(){var e;this.step="roles";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("roles")}handleRolesNext(){var e;this.step="fields";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("fields")}handleStepChanged(e){var s;this.step=e;(s=this.stepChanged)===null||s===void 0?void 0:s.emit(e)}render(){if(this.loading){return o(r,{class:"loading"},o("verdocs-loader",null))}if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return o(r,null,o("div",{class:"content"},o("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:e=>{var s;return(s=this.sdkError)===null||s===void 0?void 0:s.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),this.step==="attachments"&&o("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleAttachmentsNext(),onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="roles"&&o("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleRolesNext(),onRolesUpdated:e=>this.handleRolesUpdated(e)}),this.step==="fields"&&o("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="preview"&&o("div",{class:"preview-container"},o("div",{class:"preview-send-wrapper"},o("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:e=>{var s;return(s=this.send)===null||s===void 0?void 0:s.emit(e.detail)},style:{width:"100%"}})),o("div",{class:"preview-preview-wrapper"},o("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))}get el(){return this}static get watchers(){return{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}}static get style(){return Q()}},[0,"verdocs-build",{endpoint:[16],templateId:[1537,"template-id"],step:[1537],loading:[32],template:[32]},undefined,{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}]);function Z(){if(typeof customElements==="undefined"){return}const e=["verdocs-build","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-contact-picker","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-file-chooser","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-menu-panel","verdocs-ok-dialog","verdocs-portal","verdocs-preview","verdocs-progress-bar","verdocs-select-input","verdocs-send","verdocs-spinner","verdocs-template-attachments","verdocs-template-build-tabs","verdocs-template-document-page","verdocs-template-field-properties","verdocs-template-fields","verdocs-template-role-properties","verdocs-template-roles","verdocs-text-input","verdocs-toolbar-icon","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-build":if(!customElements.get(i(e))){customElements.define(i(e),K)}break;case"verdocs-button":if(!customElements.get(i(e))){n()}break;case"verdocs-checkbox":if(!customElements.get(i(e))){m()}break;case"verdocs-component-error":if(!customElements.get(i(e))){p()}break;case"verdocs-contact-picker":if(!customElements.get(i(e))){f()}break;case"verdocs-dialog":if(!customElements.get(i(e))){v()}break;case"verdocs-field-attachment":if(!customElements.get(i(e))){h()}break;case"verdocs-field-checkbox":if(!customElements.get(i(e))){u()}break;case"verdocs-field-date":if(!customElements.get(i(e))){b()}break;case"verdocs-field-dropdown":if(!customElements.get(i(e))){x()}break;case"verdocs-field-initial":if(!customElements.get(i(e))){k()}break;case"verdocs-field-radio":if(!customElements.get(i(e))){w()}break;case"verdocs-field-signature":if(!customElements.get(i(e))){E()}break;case"verdocs-field-textarea":if(!customElements.get(i(e))){g()}break;case"verdocs-field-textbox":if(!customElements.get(i(e))){j()}break;case"verdocs-field-timestamp":if(!customElements.get(i(e))){y()}break;case"verdocs-file-chooser":if(!customElements.get(i(e))){C()}break;case"verdocs-flag":if(!customElements.get(i(e))){I()}break;case"verdocs-help-icon":if(!customElements.get(i(e))){D()}break;case"verdocs-loader":if(!customElements.get(i(e))){B()}break;case"verdocs-menu-panel":if(!customElements.get(i(e))){U()}break;case"verdocs-ok-dialog":if(!customElements.get(i(e))){L()}break;case"verdocs-portal":if(!customElements.get(i(e))){S()}break;case"verdocs-preview":if(!customElements.get(i(e))){T()}break;case"verdocs-progress-bar":if(!customElements.get(i(e))){F()}break;case"verdocs-select-input":if(!customElements.get(i(e))){N()}break;case"verdocs-send":if(!customElements.get(i(e))){z()}break;case"verdocs-spinner":if(!customElements.get(i(e))){J()}break;case"verdocs-template-attachments":if(!customElements.get(i(e))){R()}break;case"verdocs-template-build-tabs":if(!customElements.get(i(e))){G()}break;case"verdocs-template-document-page":if(!customElements.get(i(e))){M()}break;case"verdocs-template-field-properties":if(!customElements.get(i(e))){V()}break;case"verdocs-template-fields":if(!customElements.get(i(e))){X()}break;case"verdocs-template-role-properties":if(!customElements.get(i(e))){Y()}break;case"verdocs-template-roles":if(!customElements.get(i(e))){P()}break;case"verdocs-text-input":if(!customElements.get(i(e))){W()}break;case"verdocs-toolbar-icon":if(!customElements.get(i(e))){q()}break;case"verdocs-upload-dialog":if(!customElements.get(i(e))){A()}break}}))}const _=K;const O=Z;export{_ as VerdocsBuild,O as defineCustomElement};
|
|
1
|
+
import{p as e,H as s,c as t,h as o,d as r,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as d,getTemplate as a}from"@verdocs/js-sdk";import{S as l}from"./p-C1sRVZWv.js";import{S as c}from"./p-C7hFgM52.js";import{d as n}from"./p-Bb5V9TQx.js";import{d as m}from"./p-NtvxlYzY.js";import{d as p}from"./p-C-v22G3g.js";import{d as f}from"./p-CaFhF-9s.js";import{d as v}from"./p-C90lxyUX.js";import{d as h}from"./p-5M_R8La0.js";import{d as u}from"./p-BLsFdjFq.js";import{d as b}from"./p-C8ZliaLz.js";import{d as x}from"./p-YCI5JKXK.js";import{d as k}from"./p-h3swu3rA.js";import{d as w}from"./p-DbWcp3S8.js";import{d as E}from"./p-BPcxbmXF.js";import{d as g}from"./p-CAJJndLX.js";import{d as j}from"./p-DMaRtkQF.js";import{d as y}from"./p-DReW8CSB.js";import{d as C}from"./p-BSX4GfGg.js";import{d as I}from"./p-C8yiLtCJ.js";import{d as D}from"./p-DHzSlpJw.js";import{d as B}from"./p-DqzFuSNN.js";import{d as U}from"./p-DsSqGIBJ.js";import{d as L}from"./p-5FU3bYQ3.js";import{d as S}from"./p-DhOuB4nS.js";import{d as T}from"./p-BIi4c9Gz.js";import{d as N}from"./p-CdnjpaJt.js";import{d as F}from"./p-Bodw4NVB.js";import{d as z}from"./p-Cisooi3V.js";import{d as J}from"./p-DreV6Npp.js";import{d as R}from"./p-Lo1dCgyv.js";import{d as V}from"./p-DFbeKrpm.js";import{d as G}from"./p-DX713VO2.js";import{d as M}from"./p-qLNetL5t.js";import{d as X}from"./p-ByEpps_M.js";import{d as Y}from"./p-DeAwyTxI.js";import{d as W}from"./p-CnD-TaPJ.js";import{d as q}from"./p-PfdIkMoz.js";import{d as A}from"./p-B-ul_Soj.js";import{d as P}from"./p-DM3wePVp.js";const Q=()=>`verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{display:block;width:500px;max-width:95%;-webkit-box-sizing:border-box;box-sizing:border-box;margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157);box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157)}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}`;const K=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.cancel=t(this,"cancel");this.sdkError=t(this,"sdkError");this.stepChanged=t(this,"stepChanged");this.send=t(this,"send");this.templateUpdated=t(this,"templateUpdated");this.templateCreated=t(this,"templateCreated");this.rolesUpdated=t(this,"rolesUpdated");this.templateListenerId=null;this.endpoint=d.getDefault();this.templateId=null;this.step="preview";this.loading=true;this.template=null}onTemplateIdChanged(e,s){if(!s&&e&&this.step==="attachments"){this.step="preview"}this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}onStepChanged(){this.loadTemplate(this.templateId).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,s,t,o,r,i;try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return}if(!this.templateId){console.log(`[BUILD] No template ID, activating upload mode`);this.step="attachments";this.loading=false;return}try{this.loadTemplate(this.templateId).catch((e=>console.log("[BUILD] Unable to load template",e)))}catch(o){console.log("[BUILD] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new l(o.message,(s=o.response)===null||s===void 0?void 0:s.status,(t=o.response)===null||t===void 0?void 0:t.data))}}catch(e){console.log("[BUILD] Error with builder session",e);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new l(e.message,(r=e.response)===null||r===void 0?void 0:r.status,(i=e.response)===null||i===void 0?void 0:i.data))}}async loadTemplate(e){if(e){c.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}}disconnectedCallback(){console.log("[BUILD] Disconnected");this.unlistenToTemplate()}unlistenToTemplate(){if(this.templateListenerId){c.store.delListener(this.templateListenerId);this.templateListenerId=null}}handleCancel(){var e;this.step="preview";(e=this.cancel)===null||e===void 0?void 0:e.emit()}async handleTemplateCreated(e){var s;await this.loadTemplate(e);this.templateId=e;this.step="roles";(s=this.stepChanged)===null||s===void 0?void 0:s.emit("roles")}async handleRolesUpdated(e){var s;console.log("[BUILD] Roloes updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}async handleTemplateUpdated(e){var s;console.log("[BUILD] Template updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}handleAttachmentsNext(){var e;this.step="roles";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("roles")}handleRolesNext(){var e;this.step="fields";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("fields")}handleStepChanged(e){var s;this.step=e;(s=this.stepChanged)===null||s===void 0?void 0:s.emit(e)}render(){if(this.loading){return o(r,{class:"loading"},o("verdocs-loader",null))}if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return o(r,null,o("div",{class:"content"},o("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:e=>{var s;return(s=this.sdkError)===null||s===void 0?void 0:s.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),this.step==="attachments"&&o("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleAttachmentsNext(),onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="roles"&&o("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleRolesNext(),onRolesUpdated:e=>this.handleRolesUpdated(e)}),this.step==="fields"&&o("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="preview"&&o("div",{class:"preview-container"},o("div",{class:"preview-send-wrapper"},o("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:e=>{var s;return(s=this.send)===null||s===void 0?void 0:s.emit(e.detail)},style:{width:"100%"}})),o("div",{class:"preview-preview-wrapper"},o("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))}get el(){return this}static get watchers(){return{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}}static get style(){return Q()}},[0,"verdocs-build",{endpoint:[16],templateId:[1537,"template-id"],step:[1537],loading:[32],template:[32]},undefined,{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}]);function Z(){if(typeof customElements==="undefined"){return}const e=["verdocs-build","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-contact-picker","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-file-chooser","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-menu-panel","verdocs-ok-dialog","verdocs-portal","verdocs-preview","verdocs-progress-bar","verdocs-select-input","verdocs-send","verdocs-spinner","verdocs-template-attachments","verdocs-template-build-tabs","verdocs-template-document-page","verdocs-template-field-properties","verdocs-template-fields","verdocs-template-role-properties","verdocs-template-roles","verdocs-text-input","verdocs-toolbar-icon","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-build":if(!customElements.get(i(e))){customElements.define(i(e),K)}break;case"verdocs-button":if(!customElements.get(i(e))){n()}break;case"verdocs-checkbox":if(!customElements.get(i(e))){m()}break;case"verdocs-component-error":if(!customElements.get(i(e))){p()}break;case"verdocs-contact-picker":if(!customElements.get(i(e))){f()}break;case"verdocs-dialog":if(!customElements.get(i(e))){v()}break;case"verdocs-field-attachment":if(!customElements.get(i(e))){h()}break;case"verdocs-field-checkbox":if(!customElements.get(i(e))){u()}break;case"verdocs-field-date":if(!customElements.get(i(e))){b()}break;case"verdocs-field-dropdown":if(!customElements.get(i(e))){x()}break;case"verdocs-field-initial":if(!customElements.get(i(e))){k()}break;case"verdocs-field-radio":if(!customElements.get(i(e))){w()}break;case"verdocs-field-signature":if(!customElements.get(i(e))){E()}break;case"verdocs-field-textarea":if(!customElements.get(i(e))){g()}break;case"verdocs-field-textbox":if(!customElements.get(i(e))){j()}break;case"verdocs-field-timestamp":if(!customElements.get(i(e))){y()}break;case"verdocs-file-chooser":if(!customElements.get(i(e))){C()}break;case"verdocs-flag":if(!customElements.get(i(e))){I()}break;case"verdocs-help-icon":if(!customElements.get(i(e))){D()}break;case"verdocs-loader":if(!customElements.get(i(e))){B()}break;case"verdocs-menu-panel":if(!customElements.get(i(e))){U()}break;case"verdocs-ok-dialog":if(!customElements.get(i(e))){L()}break;case"verdocs-portal":if(!customElements.get(i(e))){S()}break;case"verdocs-preview":if(!customElements.get(i(e))){T()}break;case"verdocs-progress-bar":if(!customElements.get(i(e))){N()}break;case"verdocs-select-input":if(!customElements.get(i(e))){F()}break;case"verdocs-send":if(!customElements.get(i(e))){z()}break;case"verdocs-spinner":if(!customElements.get(i(e))){J()}break;case"verdocs-template-attachments":if(!customElements.get(i(e))){R()}break;case"verdocs-template-build-tabs":if(!customElements.get(i(e))){V()}break;case"verdocs-template-document-page":if(!customElements.get(i(e))){G()}break;case"verdocs-template-field-properties":if(!customElements.get(i(e))){M()}break;case"verdocs-template-fields":if(!customElements.get(i(e))){X()}break;case"verdocs-template-role-properties":if(!customElements.get(i(e))){Y()}break;case"verdocs-template-roles":if(!customElements.get(i(e))){W()}break;case"verdocs-text-input":if(!customElements.get(i(e))){q()}break;case"verdocs-toolbar-icon":if(!customElements.get(i(e))){A()}break;case"verdocs-upload-dialog":if(!customElements.get(i(e))){P()}break}}))}const _=K;const O=Z;export{_ as VerdocsBuild,O as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-build.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as o,d as s}from"./p-
|
|
1
|
+
import{V as o,d as s}from"./p-Cisooi3V.js";const t=o;const i=s;export{t as VerdocsSend,i as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-send.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as
|
|
1
|
+
import{V as o,d as s}from"./p-ClWqxMkZ.js";const t=o;const p=s;export{t as VerdocsTemplateStar,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-template-star.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,c as s,h as i,d as a,t as l}from"./p-yZBlG3YQ.js";import{d}from"./p-DGOUAxVN.js";import{VerdocsEndpoint as o,getTemplates as r,deleteTemplate as c,integerSequence as n,canPerformTemplateAction as p}from"@verdocs/js-sdk";import{S as h}from"./p-C1sRVZWv.js";import{d as m}from"./p-C90lxyUX.js";import{d as v}from"./p-D4wfy1ym.js";import{d as f}from"./p-C8yiLtCJ.js";import{d as u}from"./p-DHzSlpJw.js";import{d as x}from"./p-5FU3bYQ3.js";import{d as g}from"./p-Q-li_kJ_.js";import{d as w}from"./p-DhOuB4nS.js";import{d as b}from"./p-BeDDvLcN.js";import{d as k}from"./p-DreV6Npp.js";import{d as y}from"./p-DslyN9XL.js";import{d as z}from"./p-PfdIkMoz.js";const M=()=>`verdocs-templates-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-templates-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-templates-list .header .filter{width:150px}verdocs-templates-list .header verdocs-text-input{margin:0}verdocs-templates-list .header verdocs-text-input input{height:32px}verdocs-templates-list .filter{-ms-flex-align:center;align-items:center}verdocs-templates-list .template-placeholder{height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin:5px 0;border-radius:5px;background:#f5f5fa}verdocs-templates-list .template{width:100%;margin:2px 0;border:1px solid #ffffff;background:#ffffff}verdocs-templates-list .template:hover{cursor:pointer;background:#ededff;border:1px solid #a7a7f5}verdocs-templates-list .template .inner{gap:12px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;container-type:inline-size}verdocs-templates-list .template .inner svg{width:24px;height:24px}verdocs-templates-list .name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:black;font-size:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media screen and (max-width: 1300px){verdocs-templates-list .name{font-size:16px}}verdocs-templates-list .spacer{margin:0;height:30px;-ms-flex:0 0 1px;flex:0 0 1px;display:-ms-flexbox;display:flex;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-templates-list .spacer{display:none}}verdocs-templates-list .empty-text{font-size:20px;text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-templates-list .usage,verdocs-templates-list .ownership,verdocs-templates-list .last-used{gap:10px;color:#444;display:-ms-flexbox;display:flex;font-size:16px;margin:0 0 0 10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-templates-list .usage span,verdocs-templates-list .usage svg,verdocs-templates-list .ownership span,verdocs-templates-list .ownership svg,verdocs-templates-list .last-used span,verdocs-templates-list .last-used svg{width:24px;height:24px}verdocs-templates-list .usage span,verdocs-templates-list .ownership span,verdocs-templates-list .last-used span{display:block}@media screen and (max-width: 700px){verdocs-templates-list verdocs-template-star{display:none}}verdocs-templates-list .ownership{-ms-flex:0 0 100px;flex:0 0 100px}@media screen and (max-width: 700px){verdocs-templates-list .ownership{display:none}}verdocs-templates-list .last-used{-ms-flex:0 0 130px;flex:0 0 130px}verdocs-templates-list .usage{-ms-flex:0 0 60px;flex:0 0 60px}verdocs-templates-list .header-row{display:none}verdocs-templates-list table{container-type:size;max-width:100%;overflow:hidden;table-layout:fixed}verdocs-templates-list .data-row{cursor:pointer;background:#ededff;border:1px solid #a7a7f5}verdocs-templates-list .data-col svg{width:24px;height:24px}verdocs-templates-list .col-name{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@container (max-width:700 px){verdocs-templates-list verdocs-templates-list .col-starred{display:none}}`;const H=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" /></svg>`;const L=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z" /></svg>`;const S=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M3.75 21h16.5M4.5 3h15M5.25 3v18m13.5-18v18M9 6.75h1.5m-1.5 3h1.5m-1.5 3h1.5m3-6H15m-1.5 3H15m-1.5 3H15M9 21v-3.375c0-.621.504-1.125 1.125-1.125h3.75c.621 0 1.125.504 1.125 1.125V21" /></svg>`;const E=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75" /></svg>`;const V=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 122.88 122.88"><g><path d="M81.61,4.73c0-2.61,2.58-4.73,5.77-4.73c3.19,0,5.77,2.12,5.77,4.73v20.72c0,2.61-2.58,4.73-5.77,4.73 c-3.19,0-5.77-2.12-5.77-4.73V4.73L81.61,4.73z M66.11,103.81c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2H81.9 c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H66.11L66.11,103.81z M15.85,67.09c-0.34,0-0.61-1.43-0.61-3.2 c0-1.77,0.27-3.2,0.61-3.2h15.79c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H15.85L15.85,67.09z M40.98,67.09 c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2h15.79c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H40.98 L40.98,67.09z M66.11,67.09c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2H81.9c0.34,0,0.61,1.43,0.61,3.2 c0,1.77-0.27,3.2-0.61,3.2H66.11L66.11,67.09z M91.25,67.09c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2h15.79 c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H91.25L91.25,67.09z M15.85,85.45c-0.34,0-0.61-1.43-0.61-3.2 c0-1.77,0.27-3.2,0.61-3.2h15.79c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H15.85L15.85,85.45z M40.98,85.45 c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2h15.79c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H40.98 L40.98,85.45z M66.11,85.45c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2H81.9c0.34,0,0.61,1.43,0.61,3.2 c0,1.77-0.27,3.2-0.61,3.2H66.11L66.11,85.45z M91.25,85.45c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2h15.79 c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H91.25L91.25,85.45z M15.85,103.81c-0.34,0-0.61-1.43-0.61-3.2 c0-1.77,0.27-3.2,0.61-3.2h15.79c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H15.85L15.85,103.81z M40.98,103.81 c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2h15.79c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H40.98 L40.98,103.81z M29.61,4.73c0-2.61,2.58-4.73,5.77-4.73s5.77,2.12,5.77,4.73v20.72c0,2.61-2.58,4.73-5.77,4.73 s-5.77-2.12-5.77-4.73V4.73L29.61,4.73z M6.4,45.32h110.07V21.47c0-0.8-0.33-1.53-0.86-2.07c-0.53-0.53-1.26-0.86-2.07-0.86H103 c-1.77,0-3.2-1.43-3.2-3.2c0-1.77,1.43-3.2,3.2-3.2h10.55c2.57,0,4.9,1.05,6.59,2.74c1.69,1.69,2.74,4.02,2.74,6.59v27.06v65.03 c0,2.57-1.05,4.9-2.74,6.59c-1.69,1.69-4.02,2.74-6.59,2.74H9.33c-2.57,0-4.9-1.05-6.59-2.74C1.05,118.45,0,116.12,0,113.55V48.52 V21.47c0-2.57,1.05-4.9,2.74-6.59c1.69-1.69,4.02-2.74,6.59-2.74H20.6c1.77,0,3.2,1.43,3.2,3.2c0,1.77-1.43,3.2-3.2,3.2H9.33 c-0.8,0-1.53,0.33-2.07,0.86c-0.53,0.53-0.86,1.26-0.86,2.07V45.32L6.4,45.32z M116.48,51.73H6.4v61.82c0,0.8,0.33,1.53,0.86,2.07 c0.53,0.53,1.26,0.86,2.07,0.86h104.22c0.8,0,1.53-0.33,2.07-0.86c0.53-0.53,0.86-1.26,0.86-2.07V51.73L116.48,51.73z M50.43,18.54 c-1.77,0-3.2-1.43-3.2-3.2c0-1.77,1.43-3.2,3.2-3.2h21.49c1.77,0,3.2,1.43,3.2,3.2c0,1.77-1.43,3.2-3.2,3.2H50.43L50.43,18.54z"/></g></svg>`;const P=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 410.2"><path d="M35.28 35.51h32.54v43.42c0 10.58 4.27 20.06 11.35 27.23 17.03 17.14 45.5 17.45 63.06.93 7.71-7.29 12.4-17.14 12.4-28.16V35.51h65.71v43.42c0 6.34 1.56 12.3 4.35 17.6 2.03 3.85 4.71 7.37 7.92 10.43l2.41 2.24c1.79 1.46 3.71 2.79 5.76 3.97l.31.18.07.04.25.13.16.1.15.08.27.14.05.03.32.17.05.03.27.13.15.08.17.09.26.12.07.04.32.16.03.01.31.15.12.06.2.09.24.11.1.05.33.14.34.16.1.04.23.1.21.09.13.05.31.13h.03l.34.14.08.04.27.1.18.07.16.06.3.11.05.02.34.12.06.02.3.11.16.05.19.07.26.09.09.03.35.12.02.01.34.1.13.04.22.07.25.07.11.03.36.11.36.1.11.03.25.07.22.06.14.04.34.09h.02l.37.1.08.02.29.06.19.05.17.03.32.08.05.01.37.08.06.01.31.06.17.04.21.03.28.06.09.02.37.07h.03l.35.06.14.03.23.03.27.04.11.02.38.06.38.05.12.01.26.04.23.03.15.01.35.05h.03l.39.04.08.01.3.02.21.02.17.02.34.02.05.01.39.03h.05l.34.02.18.01.21.01.3.02h.08l.39.01.03.01.36.01h.39l.28.01h.96l.33-.01h.39l.18-.01.2-.01.25-.01h.13l.32-.02h.07l.38-.02h.01l.37-.02.07-.01.32-.02.12-.01.26-.02.19-.02.19-.02.25-.02.13-.01.31-.04h.07l.37-.05h.01l.37-.04.06-.01.32-.04.12-.02.26-.03.18-.03.19-.03.24-.04.14-.02.3-.05.07-.01.36-.06h.01l.37-.07.05-.01.32-.06.12-.02.25-.05.18-.04.19-.04.23-.05.14-.03.29-.07.08-.01.35-.08.01-.01.36-.08.05-.02.31-.08.11-.02.25-.07.17-.04.2-.06.22-.05.14-.05.28-.08.07-.02.34-.09.02-.01.36-.11.03-.01.32-.1.1-.03.25-.08.16-.05.19-.07.22-.07.13-.04.28-.1.08-.03.32-.11.02-.01.35-.13.04-.01.3-.11.09-.04.26-.1.15-.06.19-.07.21-.09.13-.05.26-.11.08-.03.32-.13.02-.01.33-.14.04-.02.3-.13.09-.04.24-.11.14-.07.19-.08.19-.1.14-.06.25-.12.08-.03.3-.16h.03l.32-.17.03-.01.29-.16.09-.04.24-.12.13-.07.19-.1.18-.1.14-.07.23-.13.08-.05.29-.16.03-.01.31-.18c1.11-.64 2.17-1.31 3.2-2.03l2.71-1.95c4.36-3.56 7.92-7.88 10.43-12.76 2.73-5.26 4.25-11.19 4.25-17.5V35.51h33.97c9.68 0 18.5 3.98 24.91 10.38 6.4 6.37 10.38 15.2 10.38 24.9V192.9H365.1v-53.83H11.3v233.49c0 15.25 12.49 27.74 27.75 27.74h298.3c15.27 0 27.75-12.51 27.75-27.74V325.6h11.31v49.32c0 9.7-3.98 18.53-10.37 24.91-6.42 6.39-15.24 10.37-24.92 10.37H35.28c-9.68 0-18.49-3.97-24.89-10.37C3.97 393.41 0 384.59 0 374.92V70.79C0 61.12 3.97 52.3 10.36 45.9c6.43-6.42 15.25-10.39 24.92-10.39zm211.43-21.54c0-7.71 7.61-13.97 17.03-13.97 9.42 0 17.04 6.26 17.04 13.97v64.96c0 7.7-7.62 13.96-17.04 13.96-9.42 0-17.03-6.26-17.03-13.96V13.97zm-152.52 0C94.19 6.26 101.81 0 111.23 0c9.42 0 17.03 6.26 17.03 13.97v64.96c0 7.7-7.61 13.96-17.03 13.96-9.42 0-17.04-6.26-17.04-13.96V13.97zm311.37 327.72c1.48-14.79 2.69-32.45 3.59-46.5h-75.88v-71.88h77.43c-.39-14.06-1.17-31.75-2.35-46.58-.96-5.93 6.02-9.73 10.51-5.9l90.89 82.99c2.7 2.31 3.02 6.38.7 9.08l-.74.73-93.65 84.05c-4.6 3.89-11.47-.19-10.5-5.99zM63.51 286h50.56c3.53 0 6.43 2.91 6.43 6.44v42.06c0 3.52-2.91 6.44-6.43 6.44H63.51c-3.53 0-6.44-2.91-6.44-6.44v-42.06c0-3.54 2.9-6.44 6.44-6.44zm198.44-98.62h50.55c3.23 0 5.92 2.43 6.37 5.52h-16v49.42h-40.92c-3.53 0-6.45-2.9-6.45-6.45v-42.05c0-3.54 2.9-6.44 6.45-6.44zm0 98.62h40.92v39.6h16.07v8.9c0 3.52-2.92 6.44-6.44 6.44h-50.55c-3.53 0-6.45-2.91-6.45-6.44v-42.06c0-3.54 2.9-6.44 6.45-6.44zm-98.5-98.62h50.56c3.53 0 6.43 2.92 6.43 6.44v42.05c0 3.53-2.91 6.45-6.43 6.45h-50.56c-3.53 0-6.44-2.9-6.44-6.45v-42.05c0-3.54 2.9-6.44 6.44-6.44zm-99.94 0h50.56c3.53 0 6.43 2.92 6.43 6.44v42.05c0 3.53-2.91 6.45-6.43 6.45H63.51c-3.53 0-6.44-2.9-6.44-6.45v-42.05c0-3.54 2.9-6.44 6.44-6.44zM163.45 286h50.56c3.53 0 6.43 2.91 6.43 6.44v42.06c0 3.52-2.91 6.44-6.43 6.44h-50.56c-3.53 0-6.44-2.91-6.44-6.44v-42.06c0-3.54 2.9-6.44 6.44-6.44z"/></svg>`;const T=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 506.49"><path fill-rule="nonzero" d="m371.06 415.61-43.25 11.52 6.23-46.41 37.02 34.89zm6.76-177.5c36.98 0 70.56 15.04 94.83 39.35C496.96 301.7 512 335.25 512 372.31c0 37.02-15.02 70.61-39.3 94.88l-.68.64c-24.23 23.88-57.5 38.66-94.2 38.66-37.06 0-70.61-15.04-94.88-39.31l-.64-.69c-23.9-24.24-38.68-57.53-38.68-94.18 0-37.06 15.04-70.61 39.32-94.89 24.27-24.27 57.85-39.31 94.88-39.31zm78.74 55.41c-20.09-20.11-47.96-32.58-78.74-32.58-30.75 0-58.61 12.47-78.75 32.62-20.15 20.14-32.62 48-32.62 78.75 0 30.5 12.25 58.14 32.02 78.19l.6.55c20.14 20.14 48 32.61 78.75 32.61 30.48 0 58.12-12.25 78.21-32.02l.54-.58c20.15-20.15 32.61-48 32.61-78.75s-12.48-58.61-32.62-78.79zM294.24 17.11C294.24 7.69 303.52 0 315.1 0c11.57 0 20.87 7.64 20.87 17.11v74.85c0 9.42-9.3 17.11-20.87 17.11-11.58 0-20.86-7.65-20.86-17.11V17.11zM56.8 242.28c-1.17 0-2.23-5.2-2.23-11.57 0-6.38.92-11.53 2.23-11.53h56.94c1.18 0 2.24 5.2 2.24 11.53 0 6.39-.92 11.57-2.24 11.57H56.8zm90.77 0c-1.17 0-2.23-5.2-2.23-11.57 0-6.38.92-11.53 2.23-11.53h56.94c1.18 0 2.24 5.2 2.24 11.53 0 6.39-.92 11.57-2.24 11.57h-56.94zm90.77 0c-1.16 0-2.22-5.2-2.22-11.57 0-6.38.92-11.53 2.22-11.53h56.94c1.19 0 2.25 5.15 2.25 11.49-5.7 3.55-11.2 7.44-16.43 11.61h-42.76zm-181.4 66.24c-1.18 0-2.24-5.2-2.24-11.57 0-6.38.93-11.58 2.24-11.58h56.94c1.18 0 2.22 5.2 2.22 11.58 0 6.37-.91 11.57-2.22 11.57H56.94zm90.77 0c-1.18 0-2.24-5.2-2.24-11.57 0-6.38.93-11.58 2.24-11.58h56.94c1.18 0 2.23 5.2 2.23 11.58 0 6.37-.92 11.57-2.23 11.57h-56.94zM57.06 374.8c-1.18 0-2.24-5.2-2.24-11.59 0-6.36.94-11.56 2.24-11.56H114c1.19 0 2.24 5.2 2.24 11.56 0 6.39-.93 11.59-2.24 11.59H57.06zm90.78 0c-1.19 0-2.25-5.2-2.25-11.59 0-6.36.94-11.56 2.25-11.56h56.94c1.18 0 2.24 5.2 2.24 11.56 0 6.39-.94 11.59-2.24 11.59h-56.94zM106.83 17.11C106.83 7.69 116.1 0 127.69 0c11.57 0 20.86 7.64 20.86 17.11v74.85c0 9.42-9.34 17.11-20.86 17.11-11.59 0-20.86-7.65-20.86-17.11V17.11zM22.97 163.64h397.39V77.46c0-2.94-1.19-5.53-3.09-7.43-1.9-1.9-4.59-3.08-7.42-3.08h-38.1c-6.39 0-11.59-5.2-11.59-11.57 0-6.38 5.2-11.58 11.59-11.58h38.1c9.32 0 17.7 3.77 23.82 9.88 6.12 6.14 9.88 14.5 9.88 23.83v136.81c-7.61-2.62-15.41-4.73-23.44-6.29v-21.38h.25H22.97v223.17c0 2.94 1.18 5.52 3.08 7.42 1.91 1.9 4.61 3.08 7.44 3.08h188.85c2.16 8.02 4.86 15.84 8.11 23.36H33.71c-9.3 0-17.7-3.75-23.84-9.89C3.75 427.72 0 419.36 0 410.02V77.55c0-9.29 3.75-17.7 9.87-23.82 6.14-6.13 14.5-9.89 23.84-9.89h40.67c6.38 0 11.57 5.2 11.57 11.57C85.95 61.8 80.76 67 74.38 67H33.71c-2.96 0-5.54 1.18-7.44 3.08-1.9 1.9-3.09 4.59-3.09 7.43v86.16h-.21v-.03zm158.95-96.69c-6.39 0-11.57-5.2-11.57-11.57 0-6.38 5.18-11.58 11.57-11.58h77.55c6.39 0 11.57 5.2 11.57 11.58 0 6.37-5.18 11.57-11.57 11.57h-77.55zm161.66 303.24 45.37-51.33c.72-.84 1.78-1.34 2.85-1.36.69-.01 1.37.13 1.98.45l32.94 29.96c.66.59 1.05 1.46 1.06 2.35.02 1-.39 1.98-1.16 2.66l-46.15 52.16-36.95-34.89h.06z"/></svg>`;const U=[{value:"private_shared",label:"Personal + Shared"},{value:"private",label:"Personal"},{value:"shared",label:"Shared"},{value:"public",label:"Public"}];const C=[{value:"all",label:"All"},{value:"starred",label:"Starred"},{value:"unstarred",label:"Not Starred"}];const j=[{value:"name",label:"Name"},{value:"created_at",label:"Created"},{value:"updated_at",label:"Last Updated"},{value:"last_used_at",label:"Last Used"},{value:"counter",label:"Most Used"},{value:"star_counter",label:"Most Starred"}];const _=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.sdkError=s(this,"sdkError");this.viewTemplate=s(this,"viewTemplate");this.signNow=s(this,"signNow");this.submittedData=s(this,"submittedData");this.editTemplate=s(this,"editTemplate");this.templateDeleted=s(this,"templateDeleted");this.changeSort=s(this,"changeSort");this.changeVisibility=s(this,"changeVisibility");this.changeStarred=s(this,"changeStarred");this.changeName=s(this,"changeName");this.endpoint=o.getDefault();this.visibility="private_shared";this.starred="all";this.sort="updated_at";this.name="";this.allowedActions=["send","submitted","link","edit","delete"];this.showPagination=true;this.rowsPerPage=10;this.selectedPage=0;this.count=0;this.initiallyLoaded=false;this.loading=true;this.confirmDelete=null;this.templates=[];this.localNameFilter="";this.handleOptionSelected=(e,t)=>{var s,i,a,l;if(e==="send"){(s=this.viewTemplate)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,template:t})}else if(e==="signnow"){(i=this.signNow)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:t})}else if(e==="submitted"){(a=this.submittedData)===null||a===void 0?void 0:a.emit({endpoint:this.endpoint,template:t})}else if(e==="edit"){(l=this.editTemplate)===null||l===void 0?void 0:l.emit({endpoint:this.endpoint,template:t})}else if(e==="delete"){this.confirmDelete=t}}}handleSharingUpdated(){return this.queryTemplates()}handleStarredUpdated(){return this.queryTemplates()}handleSortUpdated(){return this.queryTemplates()}handleNameUpdated(){return this.queryTemplates()}handlePageUpdated(){return this.queryTemplates()}componentWillLoad(){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[TEMPLATES] Must be authenticated");return}}async componentDidLoad(){await this.queryTemplates();this.initiallyLoaded=true}async queryTemplates(){var e,t,s;console.log("[TEMPLATES] Querying templates");this.loading=true;try{let e={visibility:this.visibility,page:this.selectedPage,rows:this.rowsPerPage};if(this.name.trim()!==""){e.q=this.name.trim()}const t=await r(this.endpoint,e);this.templates=t.templates;this.count=t.count;this.loading=false}catch(i){this.loading=false;console.log("[TEMPLATES] Error listing templates",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new h(i.message,(t=i.response)===null||t===void 0?void 0:t.status,(s=i.response)===null||s===void 0?void 0:s.data))}}deleteTemplate(e){this.confirmDelete=null;c(this.endpoint,e.id).then((()=>{var t;console.log("[TEMPLATES] Deleted template",e);(t=this.templateDeleted)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:e});return this.queryTemplates()})).catch((t=>{var s,i,a;console.log("[TEMPLATES] Error deleting template",e);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new h(t.message,(i=t.response)===null||i===void 0?void 0:i.status,(a=t.response)===null||a===void 0?void 0:a.data))}))}render(){const e=!this.localNameFilter?this.templates:this.templates.filter((e=>e.name.toLowerCase().includes(this.localNameFilter.toLowerCase())));return i(a,{key:"95b03f96b3fb38b3af2e05eada009b599071415c"},i("div",{key:"1592fce5753a5b69ae618176cc58bcddaf32fa9e",class:"header"},i("div",{key:"29b68bea6bbe1846bbba59389b28680f2cda49c9",class:"filter"},i("verdocs-text-input",{key:"ee7a027846988fcd447dc2ece67e07c854b3e3b0",id:"verdocs-filter-name",value:this.name,clearable:true,autocomplete:"off",placeholder:"Filter by Name...",onInput:e=>this.localNameFilter=e.target.value.trim(),onFocusout:e=>{var t;this.name=e.target.value.trim();this.localNameFilter=e.target.value.trim();(t=this.changeName)===null||t===void 0?void 0:t.emit(this.name)}})),i("verdocs-quick-filter",{key:"14cd7836cd14510f06a4b251cf78e0fc1bd50996",label:"Visibility",value:this.visibility,options:U,onOptionSelected:e=>{var t;this.visibility=e.detail.value;(t=this.changeVisibility)===null||t===void 0?void 0:t.emit(this.visibility)}}),i("verdocs-quick-filter",{key:"f722ac95e33a3eecfc08ce8bf8f1a39dfa77269a",label:"Starred",value:this.starred,options:C,onOptionSelected:e=>{var t;this.starred=e.detail.value;(t=this.changeStarred)===null||t===void 0?void 0:t.emit(this.starred)}}),i("verdocs-quick-filter",{key:"56bffbdb611506fe699371a706d6e88fa8bd9ec3",label:"Sort By",value:this.sort,options:j,onOptionSelected:e=>{var t;this.sort=e.detail.value;(t=this.changeSort)===null||t===void 0?void 0:t.emit(this.sort)}}),this.loading&&i("verdocs-spinner",{key:"77aad3d28fa546b9757bc7becd892909cea29722",mode:"dark",size:24}),i("div",{key:"3e3fa4c99a3ab80d9ea515f9f7657d3fc4ee6e48",style:{display:"flex",flex:"1"}})),e.map((e=>{const t=this.sort==="created_at"?"created_at":this.sort==="updated_at"?"updated_at":"last_used_at";const s=e[t];const a=[];const l=[];if(this.allowedActions.includes("send")){a.push({label:"Preview / Send",id:"send",disabled:!p(this.endpoint.profile,"read",e)})}if(this.allowedActions.includes("signnow")){a.push({label:"Sign Now",id:"signnow",disabled:true})}if(this.allowedActions.includes("submitted")){a.push({label:""});a.push({label:"Submissions",id:"submitted",disabled:!p(this.endpoint.profile,"read",e)})}if(this.allowedActions.includes("link")||this.allowedActions.includes("edit")||this.allowedActions.includes("delete")){a.push({label:""});if(this.allowedActions.includes("link")||this.allowedActions.includes("edit")||this.allowedActions.includes("delete")){a.push({label:"Edit",id:"edit",disabled:!l.includes("write")})}if(this.allowedActions.includes("link")||this.allowedActions.includes("edit")||this.allowedActions.includes("delete")){a.push({label:"Delete",id:"delete",disabled:!l.includes("delete")})}}return i("div",{class:"template",onClick:()=>{var t;(t=this.viewTemplate)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:e})}},i("div",{class:"inner"},i("verdocs-template-star",{template:e,endpoint:this.endpoint}),i("div",{class:"spacer icon-spacer"}),i("div",{class:"name"},e.name),i("div",{class:"spacer usage-spacer"}),i("div",{class:"usage"},i("span",{innerHTML:E,title:"Usage Counter"}),e.counter||"--"),i("div",{class:"spacer last-used-spacer"}),i("div",{class:"last-used"},t==="created_at"&&i("span",{innerHTML:V,title:"Created"}),t==="updated_at"&&i("span",{innerHTML:T,title:"Last Updated"}),t==="last_used_at"&&i("span",{innerHTML:P,title:"Last Used"}),s?d.format(new Date(s),"P"):"Never"),i("div",{class:"spacer ownership-spacer"}),e.is_public&&i("div",{class:"ownership"},i("span",{innerHTML:H})," Public"),!e.is_public&&!e.is_personal&&i("div",{class:"ownership"},i("span",{innerHTML:L})," Private"),!e.is_public&&e.is_personal&&i("div",{class:"ownership"},i("span",{innerHTML:S})," Shared"),i("verdocs-dropdown",{options:a,onOptionSelected:t=>this.handleOptionSelected(t.detail.id,e)})))})),!this.initiallyLoaded&&i("div",{key:"b4985d899aea79ae9a2a1e7007017df757994743"},n(0,this.rowsPerPage).map((()=>i("div",{class:"template-placeholder"})))),this.initiallyLoaded&&!this.templates.length&&i("div",{key:"620b5ae9cd78d9dedcb494a4aefea21fd167201f",class:"empty-text"},"No matching templates found. Please adjust your filters and try again."),this.initiallyLoaded&&this.templates.length&&this.showPagination?i("div",{style:{marginTop:"20px"}},i("verdocs-pagination",{selectedPage:this.selectedPage,perPage:this.rowsPerPage,itemCount:this.count,onSelectPage:e=>{this.selectedPage=e.detail.selectedPage}})):i("div",null),this.confirmDelete&&i("verdocs-ok-dialog",{key:"6d6241326ba5d13f77a8fa1d1f13753a56653909",heading:"Delete this Template?",message:"This operation cannot be undone.",onNext:()=>this.deleteTemplate(this.confirmDelete),onExit:()=>this.confirmDelete=null,showCancel:true}))}static get watchers(){return{sharing:[{handleSharingUpdated:0}],starred:[{handleStarredUpdated:0}],sort:[{handleSortUpdated:0}],name:[{handleNameUpdated:0}],selectedPage:[{handlePageUpdated:0}]}}static get style(){return M()}},[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]},undefined,{sharing:[{handleSharingUpdated:0}],starred:[{handleStarredUpdated:0}],sort:[{handleSortUpdated:0}],name:[{handleNameUpdated:0}],selectedPage:[{handlePageUpdated:0}]}]);function N(){if(typeof customElements==="undefined"){return}const e=["verdocs-templates-list","verdocs-dialog","verdocs-dropdown","verdocs-flag","verdocs-help-icon","verdocs-ok-dialog","verdocs-pagination","verdocs-portal","verdocs-quick-filter","verdocs-spinner","verdocs-template-star","verdocs-text-input"];e.forEach((e=>{switch(e){case"verdocs-templates-list":if(!customElements.get(l(e))){customElements.define(l(e),_)}break;case"verdocs-dialog":if(!customElements.get(l(e))){m()}break;case"verdocs-dropdown":if(!customElements.get(l(e))){v()}break;case"verdocs-flag":if(!customElements.get(l(e))){f()}break;case"verdocs-help-icon":if(!customElements.get(l(e))){u()}break;case"verdocs-ok-dialog":if(!customElements.get(l(e))){x()}break;case"verdocs-pagination":if(!customElements.get(l(e))){g()}break;case"verdocs-portal":if(!customElements.get(l(e))){w()}break;case"verdocs-quick-filter":if(!customElements.get(l(e))){b()}break;case"verdocs-spinner":if(!customElements.get(l(e))){k()}break;case"verdocs-template-star":if(!customElements.get(l(e))){y()}break;case"verdocs-text-input":if(!customElements.get(l(e))){z()}break}}))}const D=_;const A=N;export{D as VerdocsTemplatesList,A as defineCustomElement};
|
|
1
|
+
import{p as e,H as t,c as s,h as i,d as a,t as l}from"./p-yZBlG3YQ.js";import{d}from"./p-DGOUAxVN.js";import{VerdocsEndpoint as o,getTemplates as r,deleteTemplate as c,integerSequence as n,canPerformTemplateAction as p}from"@verdocs/js-sdk";import{S as h}from"./p-C1sRVZWv.js";import{d as m}from"./p-C90lxyUX.js";import{d as v}from"./p-D4wfy1ym.js";import{d as f}from"./p-C8yiLtCJ.js";import{d as u}from"./p-DHzSlpJw.js";import{d as x}from"./p-5FU3bYQ3.js";import{d as g}from"./p-Q-li_kJ_.js";import{d as w}from"./p-DhOuB4nS.js";import{d as b}from"./p-BeDDvLcN.js";import{d as k}from"./p-DreV6Npp.js";import{d as y}from"./p-ClWqxMkZ.js";import{d as z}from"./p-PfdIkMoz.js";const M=()=>`verdocs-templates-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}verdocs-templates-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-templates-list .header .filter{width:150px}verdocs-templates-list .header verdocs-text-input{margin:0}verdocs-templates-list .header verdocs-text-input input{height:32px}verdocs-templates-list .filter{-ms-flex-align:center;align-items:center}verdocs-templates-list .template-placeholder{height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin:5px 0;border-radius:5px;background:#f5f5fa}verdocs-templates-list .template{width:100%;margin:2px 0;border:1px solid #ffffff;background:#ffffff}verdocs-templates-list .template:hover{cursor:pointer;background:#ededff;border:1px solid #a7a7f5}verdocs-templates-list .template .inner{gap:12px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;container-type:inline-size}verdocs-templates-list .template .inner svg{width:24px;height:24px}verdocs-templates-list .name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:black;font-size:16px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media screen and (max-width: 1300px){verdocs-templates-list .name{font-size:16px}}verdocs-templates-list .spacer{margin:0;height:30px;-ms-flex:0 0 1px;flex:0 0 1px;display:-ms-flexbox;display:flex;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-templates-list .spacer{display:none}}verdocs-templates-list .empty-text{font-size:20px;text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-templates-list .usage,verdocs-templates-list .ownership,verdocs-templates-list .last-used{gap:10px;color:#444;display:-ms-flexbox;display:flex;font-size:16px;margin:0 0 0 10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-templates-list .usage span,verdocs-templates-list .usage svg,verdocs-templates-list .ownership span,verdocs-templates-list .ownership svg,verdocs-templates-list .last-used span,verdocs-templates-list .last-used svg{width:24px;height:24px}verdocs-templates-list .usage span,verdocs-templates-list .ownership span,verdocs-templates-list .last-used span{display:block}@media screen and (max-width: 700px){verdocs-templates-list verdocs-template-star{display:none}}verdocs-templates-list .ownership{-ms-flex:0 0 100px;flex:0 0 100px}@media screen and (max-width: 700px){verdocs-templates-list .ownership{display:none}}verdocs-templates-list .last-used{-ms-flex:0 0 130px;flex:0 0 130px}verdocs-templates-list .usage{-ms-flex:0 0 60px;flex:0 0 60px}verdocs-templates-list .header-row{display:none}verdocs-templates-list table{container-type:size;max-width:100%;overflow:hidden;table-layout:fixed}verdocs-templates-list .data-row{cursor:pointer;background:#ededff;border:1px solid #a7a7f5}verdocs-templates-list .data-col svg{width:24px;height:24px}verdocs-templates-list .col-name{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@container (max-width:700 px){verdocs-templates-list verdocs-templates-list .col-starred{display:none}}`;const H=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" /></svg>`;const L=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z" /></svg>`;const S=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M3.75 21h16.5M4.5 3h15M5.25 3v18m13.5-18v18M9 6.75h1.5m-1.5 3h1.5m-1.5 3h1.5m3-6H15m-1.5 3H15m-1.5 3H15M9 21v-3.375c0-.621.504-1.125 1.125-1.125h3.75c.621 0 1.125.504 1.125 1.125V21" /></svg>`;const E=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75" /></svg>`;const V=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 122.88 122.88"><g><path d="M81.61,4.73c0-2.61,2.58-4.73,5.77-4.73c3.19,0,5.77,2.12,5.77,4.73v20.72c0,2.61-2.58,4.73-5.77,4.73 c-3.19,0-5.77-2.12-5.77-4.73V4.73L81.61,4.73z M66.11,103.81c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2H81.9 c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H66.11L66.11,103.81z M15.85,67.09c-0.34,0-0.61-1.43-0.61-3.2 c0-1.77,0.27-3.2,0.61-3.2h15.79c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H15.85L15.85,67.09z M40.98,67.09 c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2h15.79c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H40.98 L40.98,67.09z M66.11,67.09c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2H81.9c0.34,0,0.61,1.43,0.61,3.2 c0,1.77-0.27,3.2-0.61,3.2H66.11L66.11,67.09z M91.25,67.09c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2h15.79 c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H91.25L91.25,67.09z M15.85,85.45c-0.34,0-0.61-1.43-0.61-3.2 c0-1.77,0.27-3.2,0.61-3.2h15.79c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H15.85L15.85,85.45z M40.98,85.45 c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2h15.79c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H40.98 L40.98,85.45z M66.11,85.45c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2H81.9c0.34,0,0.61,1.43,0.61,3.2 c0,1.77-0.27,3.2-0.61,3.2H66.11L66.11,85.45z M91.25,85.45c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2h15.79 c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H91.25L91.25,85.45z M15.85,103.81c-0.34,0-0.61-1.43-0.61-3.2 c0-1.77,0.27-3.2,0.61-3.2h15.79c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H15.85L15.85,103.81z M40.98,103.81 c-0.34,0-0.61-1.43-0.61-3.2c0-1.77,0.27-3.2,0.61-3.2h15.79c0.34,0,0.61,1.43,0.61,3.2c0,1.77-0.27,3.2-0.61,3.2H40.98 L40.98,103.81z M29.61,4.73c0-2.61,2.58-4.73,5.77-4.73s5.77,2.12,5.77,4.73v20.72c0,2.61-2.58,4.73-5.77,4.73 s-5.77-2.12-5.77-4.73V4.73L29.61,4.73z M6.4,45.32h110.07V21.47c0-0.8-0.33-1.53-0.86-2.07c-0.53-0.53-1.26-0.86-2.07-0.86H103 c-1.77,0-3.2-1.43-3.2-3.2c0-1.77,1.43-3.2,3.2-3.2h10.55c2.57,0,4.9,1.05,6.59,2.74c1.69,1.69,2.74,4.02,2.74,6.59v27.06v65.03 c0,2.57-1.05,4.9-2.74,6.59c-1.69,1.69-4.02,2.74-6.59,2.74H9.33c-2.57,0-4.9-1.05-6.59-2.74C1.05,118.45,0,116.12,0,113.55V48.52 V21.47c0-2.57,1.05-4.9,2.74-6.59c1.69-1.69,4.02-2.74,6.59-2.74H20.6c1.77,0,3.2,1.43,3.2,3.2c0,1.77-1.43,3.2-3.2,3.2H9.33 c-0.8,0-1.53,0.33-2.07,0.86c-0.53,0.53-0.86,1.26-0.86,2.07V45.32L6.4,45.32z M116.48,51.73H6.4v61.82c0,0.8,0.33,1.53,0.86,2.07 c0.53,0.53,1.26,0.86,2.07,0.86h104.22c0.8,0,1.53-0.33,2.07-0.86c0.53-0.53,0.86-1.26,0.86-2.07V51.73L116.48,51.73z M50.43,18.54 c-1.77,0-3.2-1.43-3.2-3.2c0-1.77,1.43-3.2,3.2-3.2h21.49c1.77,0,3.2,1.43,3.2,3.2c0,1.77-1.43,3.2-3.2,3.2H50.43L50.43,18.54z"/></g></svg>`;const P=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 410.2"><path d="M35.28 35.51h32.54v43.42c0 10.58 4.27 20.06 11.35 27.23 17.03 17.14 45.5 17.45 63.06.93 7.71-7.29 12.4-17.14 12.4-28.16V35.51h65.71v43.42c0 6.34 1.56 12.3 4.35 17.6 2.03 3.85 4.71 7.37 7.92 10.43l2.41 2.24c1.79 1.46 3.71 2.79 5.76 3.97l.31.18.07.04.25.13.16.1.15.08.27.14.05.03.32.17.05.03.27.13.15.08.17.09.26.12.07.04.32.16.03.01.31.15.12.06.2.09.24.11.1.05.33.14.34.16.1.04.23.1.21.09.13.05.31.13h.03l.34.14.08.04.27.1.18.07.16.06.3.11.05.02.34.12.06.02.3.11.16.05.19.07.26.09.09.03.35.12.02.01.34.1.13.04.22.07.25.07.11.03.36.11.36.1.11.03.25.07.22.06.14.04.34.09h.02l.37.1.08.02.29.06.19.05.17.03.32.08.05.01.37.08.06.01.31.06.17.04.21.03.28.06.09.02.37.07h.03l.35.06.14.03.23.03.27.04.11.02.38.06.38.05.12.01.26.04.23.03.15.01.35.05h.03l.39.04.08.01.3.02.21.02.17.02.34.02.05.01.39.03h.05l.34.02.18.01.21.01.3.02h.08l.39.01.03.01.36.01h.39l.28.01h.96l.33-.01h.39l.18-.01.2-.01.25-.01h.13l.32-.02h.07l.38-.02h.01l.37-.02.07-.01.32-.02.12-.01.26-.02.19-.02.19-.02.25-.02.13-.01.31-.04h.07l.37-.05h.01l.37-.04.06-.01.32-.04.12-.02.26-.03.18-.03.19-.03.24-.04.14-.02.3-.05.07-.01.36-.06h.01l.37-.07.05-.01.32-.06.12-.02.25-.05.18-.04.19-.04.23-.05.14-.03.29-.07.08-.01.35-.08.01-.01.36-.08.05-.02.31-.08.11-.02.25-.07.17-.04.2-.06.22-.05.14-.05.28-.08.07-.02.34-.09.02-.01.36-.11.03-.01.32-.1.1-.03.25-.08.16-.05.19-.07.22-.07.13-.04.28-.1.08-.03.32-.11.02-.01.35-.13.04-.01.3-.11.09-.04.26-.1.15-.06.19-.07.21-.09.13-.05.26-.11.08-.03.32-.13.02-.01.33-.14.04-.02.3-.13.09-.04.24-.11.14-.07.19-.08.19-.1.14-.06.25-.12.08-.03.3-.16h.03l.32-.17.03-.01.29-.16.09-.04.24-.12.13-.07.19-.1.18-.1.14-.07.23-.13.08-.05.29-.16.03-.01.31-.18c1.11-.64 2.17-1.31 3.2-2.03l2.71-1.95c4.36-3.56 7.92-7.88 10.43-12.76 2.73-5.26 4.25-11.19 4.25-17.5V35.51h33.97c9.68 0 18.5 3.98 24.91 10.38 6.4 6.37 10.38 15.2 10.38 24.9V192.9H365.1v-53.83H11.3v233.49c0 15.25 12.49 27.74 27.75 27.74h298.3c15.27 0 27.75-12.51 27.75-27.74V325.6h11.31v49.32c0 9.7-3.98 18.53-10.37 24.91-6.42 6.39-15.24 10.37-24.92 10.37H35.28c-9.68 0-18.49-3.97-24.89-10.37C3.97 393.41 0 384.59 0 374.92V70.79C0 61.12 3.97 52.3 10.36 45.9c6.43-6.42 15.25-10.39 24.92-10.39zm211.43-21.54c0-7.71 7.61-13.97 17.03-13.97 9.42 0 17.04 6.26 17.04 13.97v64.96c0 7.7-7.62 13.96-17.04 13.96-9.42 0-17.03-6.26-17.03-13.96V13.97zm-152.52 0C94.19 6.26 101.81 0 111.23 0c9.42 0 17.03 6.26 17.03 13.97v64.96c0 7.7-7.61 13.96-17.03 13.96-9.42 0-17.04-6.26-17.04-13.96V13.97zm311.37 327.72c1.48-14.79 2.69-32.45 3.59-46.5h-75.88v-71.88h77.43c-.39-14.06-1.17-31.75-2.35-46.58-.96-5.93 6.02-9.73 10.51-5.9l90.89 82.99c2.7 2.31 3.02 6.38.7 9.08l-.74.73-93.65 84.05c-4.6 3.89-11.47-.19-10.5-5.99zM63.51 286h50.56c3.53 0 6.43 2.91 6.43 6.44v42.06c0 3.52-2.91 6.44-6.43 6.44H63.51c-3.53 0-6.44-2.91-6.44-6.44v-42.06c0-3.54 2.9-6.44 6.44-6.44zm198.44-98.62h50.55c3.23 0 5.92 2.43 6.37 5.52h-16v49.42h-40.92c-3.53 0-6.45-2.9-6.45-6.45v-42.05c0-3.54 2.9-6.44 6.45-6.44zm0 98.62h40.92v39.6h16.07v8.9c0 3.52-2.92 6.44-6.44 6.44h-50.55c-3.53 0-6.45-2.91-6.45-6.44v-42.06c0-3.54 2.9-6.44 6.45-6.44zm-98.5-98.62h50.56c3.53 0 6.43 2.92 6.43 6.44v42.05c0 3.53-2.91 6.45-6.43 6.45h-50.56c-3.53 0-6.44-2.9-6.44-6.45v-42.05c0-3.54 2.9-6.44 6.44-6.44zm-99.94 0h50.56c3.53 0 6.43 2.92 6.43 6.44v42.05c0 3.53-2.91 6.45-6.43 6.45H63.51c-3.53 0-6.44-2.9-6.44-6.45v-42.05c0-3.54 2.9-6.44 6.44-6.44zM163.45 286h50.56c3.53 0 6.43 2.91 6.43 6.44v42.06c0 3.52-2.91 6.44-6.43 6.44h-50.56c-3.53 0-6.44-2.91-6.44-6.44v-42.06c0-3.54 2.9-6.44 6.44-6.44z"/></svg>`;const C=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 506.49"><path fill-rule="nonzero" d="m371.06 415.61-43.25 11.52 6.23-46.41 37.02 34.89zm6.76-177.5c36.98 0 70.56 15.04 94.83 39.35C496.96 301.7 512 335.25 512 372.31c0 37.02-15.02 70.61-39.3 94.88l-.68.64c-24.23 23.88-57.5 38.66-94.2 38.66-37.06 0-70.61-15.04-94.88-39.31l-.64-.69c-23.9-24.24-38.68-57.53-38.68-94.18 0-37.06 15.04-70.61 39.32-94.89 24.27-24.27 57.85-39.31 94.88-39.31zm78.74 55.41c-20.09-20.11-47.96-32.58-78.74-32.58-30.75 0-58.61 12.47-78.75 32.62-20.15 20.14-32.62 48-32.62 78.75 0 30.5 12.25 58.14 32.02 78.19l.6.55c20.14 20.14 48 32.61 78.75 32.61 30.48 0 58.12-12.25 78.21-32.02l.54-.58c20.15-20.15 32.61-48 32.61-78.75s-12.48-58.61-32.62-78.79zM294.24 17.11C294.24 7.69 303.52 0 315.1 0c11.57 0 20.87 7.64 20.87 17.11v74.85c0 9.42-9.3 17.11-20.87 17.11-11.58 0-20.86-7.65-20.86-17.11V17.11zM56.8 242.28c-1.17 0-2.23-5.2-2.23-11.57 0-6.38.92-11.53 2.23-11.53h56.94c1.18 0 2.24 5.2 2.24 11.53 0 6.39-.92 11.57-2.24 11.57H56.8zm90.77 0c-1.17 0-2.23-5.2-2.23-11.57 0-6.38.92-11.53 2.23-11.53h56.94c1.18 0 2.24 5.2 2.24 11.53 0 6.39-.92 11.57-2.24 11.57h-56.94zm90.77 0c-1.16 0-2.22-5.2-2.22-11.57 0-6.38.92-11.53 2.22-11.53h56.94c1.19 0 2.25 5.15 2.25 11.49-5.7 3.55-11.2 7.44-16.43 11.61h-42.76zm-181.4 66.24c-1.18 0-2.24-5.2-2.24-11.57 0-6.38.93-11.58 2.24-11.58h56.94c1.18 0 2.22 5.2 2.22 11.58 0 6.37-.91 11.57-2.22 11.57H56.94zm90.77 0c-1.18 0-2.24-5.2-2.24-11.57 0-6.38.93-11.58 2.24-11.58h56.94c1.18 0 2.23 5.2 2.23 11.58 0 6.37-.92 11.57-2.23 11.57h-56.94zM57.06 374.8c-1.18 0-2.24-5.2-2.24-11.59 0-6.36.94-11.56 2.24-11.56H114c1.19 0 2.24 5.2 2.24 11.56 0 6.39-.93 11.59-2.24 11.59H57.06zm90.78 0c-1.19 0-2.25-5.2-2.25-11.59 0-6.36.94-11.56 2.25-11.56h56.94c1.18 0 2.24 5.2 2.24 11.56 0 6.39-.94 11.59-2.24 11.59h-56.94zM106.83 17.11C106.83 7.69 116.1 0 127.69 0c11.57 0 20.86 7.64 20.86 17.11v74.85c0 9.42-9.34 17.11-20.86 17.11-11.59 0-20.86-7.65-20.86-17.11V17.11zM22.97 163.64h397.39V77.46c0-2.94-1.19-5.53-3.09-7.43-1.9-1.9-4.59-3.08-7.42-3.08h-38.1c-6.39 0-11.59-5.2-11.59-11.57 0-6.38 5.2-11.58 11.59-11.58h38.1c9.32 0 17.7 3.77 23.82 9.88 6.12 6.14 9.88 14.5 9.88 23.83v136.81c-7.61-2.62-15.41-4.73-23.44-6.29v-21.38h.25H22.97v223.17c0 2.94 1.18 5.52 3.08 7.42 1.91 1.9 4.61 3.08 7.44 3.08h188.85c2.16 8.02 4.86 15.84 8.11 23.36H33.71c-9.3 0-17.7-3.75-23.84-9.89C3.75 427.72 0 419.36 0 410.02V77.55c0-9.29 3.75-17.7 9.87-23.82 6.14-6.13 14.5-9.89 23.84-9.89h40.67c6.38 0 11.57 5.2 11.57 11.57C85.95 61.8 80.76 67 74.38 67H33.71c-2.96 0-5.54 1.18-7.44 3.08-1.9 1.9-3.09 4.59-3.09 7.43v86.16h-.21v-.03zm158.95-96.69c-6.39 0-11.57-5.2-11.57-11.57 0-6.38 5.18-11.58 11.57-11.58h77.55c6.39 0 11.57 5.2 11.57 11.58 0 6.37-5.18 11.57-11.57 11.57h-77.55zm161.66 303.24 45.37-51.33c.72-.84 1.78-1.34 2.85-1.36.69-.01 1.37.13 1.98.45l32.94 29.96c.66.59 1.05 1.46 1.06 2.35.02 1-.39 1.98-1.16 2.66l-46.15 52.16-36.95-34.89h.06z"/></svg>`;const T=[{value:"private_shared",label:"Personal + Shared"},{value:"private",label:"Personal"},{value:"shared",label:"Shared"},{value:"public",label:"Public"}];const U=[{value:"all",label:"All"},{value:"starred",label:"Starred"},{value:"unstarred",label:"Not Starred"}];const j=[{value:"name",label:"Name"},{value:"created_at",label:"Created"},{value:"updated_at",label:"Last Updated"},{value:"last_used_at",label:"Last Used"},{value:"counter",label:"Most Used"},{value:"star_counter",label:"Most Starred"}];const _=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.sdkError=s(this,"sdkError");this.viewTemplate=s(this,"viewTemplate");this.signNow=s(this,"signNow");this.submittedData=s(this,"submittedData");this.editTemplate=s(this,"editTemplate");this.templateDeleted=s(this,"templateDeleted");this.changeSort=s(this,"changeSort");this.changeVisibility=s(this,"changeVisibility");this.changeStarred=s(this,"changeStarred");this.changeName=s(this,"changeName");this.endpoint=o.getDefault();this.visibility="private_shared";this.starred="all";this.sort="updated_at";this.name="";this.allowedActions=["send","submitted","link","edit","delete"];this.showPagination=true;this.rowsPerPage=10;this.selectedPage=0;this.count=0;this.initiallyLoaded=false;this.loading=true;this.confirmDelete=null;this.templates=[];this.localNameFilter="";this.handleOptionSelected=(e,t)=>{var s,i,a,l;if(e==="send"){(s=this.viewTemplate)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,template:t})}else if(e==="signnow"){(i=this.signNow)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:t})}else if(e==="submitted"){(a=this.submittedData)===null||a===void 0?void 0:a.emit({endpoint:this.endpoint,template:t})}else if(e==="edit"){(l=this.editTemplate)===null||l===void 0?void 0:l.emit({endpoint:this.endpoint,template:t})}else if(e==="delete"){this.confirmDelete=t}}}handleSharingUpdated(){return this.queryTemplates()}handleStarredUpdated(){return this.queryTemplates()}handleSortUpdated(){return this.queryTemplates()}handleNameUpdated(){return this.queryTemplates()}handlePageUpdated(){return this.queryTemplates()}componentWillLoad(){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[TEMPLATES] Must be authenticated");return}}async componentDidLoad(){await this.queryTemplates();this.initiallyLoaded=true}async queryTemplates(){var e,t,s;console.log("[TEMPLATES] Querying templates");this.loading=true;try{let e={visibility:this.visibility,page:this.selectedPage,rows:this.rowsPerPage};if(this.name.trim()!==""){e.q=this.name.trim()}const t=await r(this.endpoint,e);this.templates=t.templates;this.count=t.count;this.loading=false}catch(i){this.loading=false;console.log("[TEMPLATES] Error listing templates",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new h(i.message,(t=i.response)===null||t===void 0?void 0:t.status,(s=i.response)===null||s===void 0?void 0:s.data))}}deleteTemplate(e){this.confirmDelete=null;c(this.endpoint,e.id).then((()=>{var t;console.log("[TEMPLATES] Deleted template",e);(t=this.templateDeleted)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:e});return this.queryTemplates()})).catch((t=>{var s,i,a;console.log("[TEMPLATES] Error deleting template",e);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new h(t.message,(i=t.response)===null||i===void 0?void 0:i.status,(a=t.response)===null||a===void 0?void 0:a.data))}))}render(){const e=!this.localNameFilter?this.templates:this.templates.filter((e=>e.name.toLowerCase().includes(this.localNameFilter.toLowerCase())));return i(a,{key:"95b03f96b3fb38b3af2e05eada009b599071415c"},i("div",{key:"1592fce5753a5b69ae618176cc58bcddaf32fa9e",class:"header"},i("div",{key:"29b68bea6bbe1846bbba59389b28680f2cda49c9",class:"filter"},i("verdocs-text-input",{key:"ee7a027846988fcd447dc2ece67e07c854b3e3b0",id:"verdocs-filter-name",value:this.name,clearable:true,autocomplete:"off",placeholder:"Filter by Name...",onInput:e=>this.localNameFilter=e.target.value.trim(),onFocusout:e=>{var t;this.name=e.target.value.trim();this.localNameFilter=e.target.value.trim();(t=this.changeName)===null||t===void 0?void 0:t.emit(this.name)}})),i("verdocs-quick-filter",{key:"14cd7836cd14510f06a4b251cf78e0fc1bd50996",label:"Visibility",value:this.visibility,options:T,onOptionSelected:e=>{var t;this.visibility=e.detail.value;(t=this.changeVisibility)===null||t===void 0?void 0:t.emit(this.visibility)}}),i("verdocs-quick-filter",{key:"f722ac95e33a3eecfc08ce8bf8f1a39dfa77269a",label:"Starred",value:this.starred,options:U,onOptionSelected:e=>{var t;this.starred=e.detail.value;(t=this.changeStarred)===null||t===void 0?void 0:t.emit(this.starred)}}),i("verdocs-quick-filter",{key:"56bffbdb611506fe699371a706d6e88fa8bd9ec3",label:"Sort By",value:this.sort,options:j,onOptionSelected:e=>{var t;this.sort=e.detail.value;(t=this.changeSort)===null||t===void 0?void 0:t.emit(this.sort)}}),this.loading&&i("verdocs-spinner",{key:"77aad3d28fa546b9757bc7becd892909cea29722",mode:"dark",size:24}),i("div",{key:"3e3fa4c99a3ab80d9ea515f9f7657d3fc4ee6e48",style:{display:"flex",flex:"1"}})),e.map((e=>{const t=this.sort==="created_at"?"created_at":this.sort==="updated_at"?"updated_at":"last_used_at";const s=e[t];const a=[];const l=[];if(this.allowedActions.includes("send")){a.push({label:"Preview / Send",id:"send",disabled:!p(this.endpoint.profile,"read",e)})}if(this.allowedActions.includes("signnow")){a.push({label:"Sign Now",id:"signnow",disabled:true})}if(this.allowedActions.includes("submitted")){a.push({label:""});a.push({label:"Submissions",id:"submitted",disabled:!p(this.endpoint.profile,"read",e)})}if(this.allowedActions.includes("link")||this.allowedActions.includes("edit")||this.allowedActions.includes("delete")){a.push({label:""});if(this.allowedActions.includes("link")||this.allowedActions.includes("edit")||this.allowedActions.includes("delete")){a.push({label:"Edit",id:"edit",disabled:!l.includes("write")})}if(this.allowedActions.includes("link")||this.allowedActions.includes("edit")||this.allowedActions.includes("delete")){a.push({label:"Delete",id:"delete",disabled:!l.includes("delete")})}}return i("div",{class:"template",onClick:()=>{var t;(t=this.viewTemplate)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:e})}},i("div",{class:"inner"},i("verdocs-template-star",{template:e,endpoint:this.endpoint}),i("div",{class:"spacer icon-spacer"}),i("div",{class:"name"},e.name),i("div",{class:"spacer usage-spacer"}),i("div",{class:"usage"},i("span",{innerHTML:E,title:"Usage Counter"}),e.counter||"--"),i("div",{class:"spacer last-used-spacer"}),i("div",{class:"last-used"},t==="created_at"&&i("span",{innerHTML:V,title:"Created"}),t==="updated_at"&&i("span",{innerHTML:C,title:"Last Updated"}),t==="last_used_at"&&i("span",{innerHTML:P,title:"Last Used"}),s?d.format(new Date(s),"P"):"Never"),i("div",{class:"spacer ownership-spacer"}),e.is_public&&i("div",{class:"ownership"},i("span",{innerHTML:H})," Public"),!e.is_public&&!e.is_personal&&i("div",{class:"ownership"},i("span",{innerHTML:L})," Private"),!e.is_public&&e.is_personal&&i("div",{class:"ownership"},i("span",{innerHTML:S})," Shared"),i("verdocs-dropdown",{options:a,onOptionSelected:t=>this.handleOptionSelected(t.detail.id,e)})))})),!this.initiallyLoaded&&i("div",{key:"b4985d899aea79ae9a2a1e7007017df757994743"},n(0,this.rowsPerPage).map((()=>i("div",{class:"template-placeholder"})))),this.initiallyLoaded&&!this.templates.length&&i("div",{key:"620b5ae9cd78d9dedcb494a4aefea21fd167201f",class:"empty-text"},"No matching templates found. Please adjust your filters and try again."),this.initiallyLoaded&&this.templates.length&&this.showPagination?i("div",{style:{marginTop:"20px"}},i("verdocs-pagination",{selectedPage:this.selectedPage,perPage:this.rowsPerPage,itemCount:this.count,onSelectPage:e=>{this.selectedPage=e.detail.selectedPage}})):i("div",null),this.confirmDelete&&i("verdocs-ok-dialog",{key:"6d6241326ba5d13f77a8fa1d1f13753a56653909",heading:"Delete this Template?",message:"This operation cannot be undone.",onNext:()=>this.deleteTemplate(this.confirmDelete),onExit:()=>this.confirmDelete=null,showCancel:true}))}static get watchers(){return{sharing:[{handleSharingUpdated:0}],starred:[{handleStarredUpdated:0}],sort:[{handleSortUpdated:0}],name:[{handleNameUpdated:0}],selectedPage:[{handlePageUpdated:0}]}}static get style(){return M()}},[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]},undefined,{sharing:[{handleSharingUpdated:0}],starred:[{handleStarredUpdated:0}],sort:[{handleSortUpdated:0}],name:[{handleNameUpdated:0}],selectedPage:[{handlePageUpdated:0}]}]);function N(){if(typeof customElements==="undefined"){return}const e=["verdocs-templates-list","verdocs-dialog","verdocs-dropdown","verdocs-flag","verdocs-help-icon","verdocs-ok-dialog","verdocs-pagination","verdocs-portal","verdocs-quick-filter","verdocs-spinner","verdocs-template-star","verdocs-text-input"];e.forEach((e=>{switch(e){case"verdocs-templates-list":if(!customElements.get(l(e))){customElements.define(l(e),_)}break;case"verdocs-dialog":if(!customElements.get(l(e))){m()}break;case"verdocs-dropdown":if(!customElements.get(l(e))){v()}break;case"verdocs-flag":if(!customElements.get(l(e))){f()}break;case"verdocs-help-icon":if(!customElements.get(l(e))){u()}break;case"verdocs-ok-dialog":if(!customElements.get(l(e))){x()}break;case"verdocs-pagination":if(!customElements.get(l(e))){g()}break;case"verdocs-portal":if(!customElements.get(l(e))){w()}break;case"verdocs-quick-filter":if(!customElements.get(l(e))){b()}break;case"verdocs-spinner":if(!customElements.get(l(e))){k()}break;case"verdocs-template-star":if(!customElements.get(l(e))){y()}break;case"verdocs-text-input":if(!customElements.get(l(e))){z()}break}}))}const D=_;const A=N;export{D as VerdocsTemplatesList,A as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-templates-list.js.map
|