@verdocs/web-sdk 5.0.32 → 5.0.34
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/index-ccac8641.js +8 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +8 -7
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js.map +1 -1
- package/dist/cjs/{verdocs-envelope-recipient-link_2.cjs.entry.js → verdocs-envelope-recipient-link.cjs.entry.js} +1 -25
- package/dist/cjs/verdocs-envelope-recipient-link.cjs.entry.js.map +1 -0
- package/dist/cjs/{verdocs-preview_6.cjs.entry.js → verdocs-preview_7.cjs.entry.js} +146 -15
- package/dist/cjs/verdocs-preview_7.cjs.entry.js.map +1 -0
- package/dist/cjs/verdocs-switch.cjs.entry.js +32 -0
- package/dist/cjs/verdocs-switch.cjs.entry.js.map +1 -0
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/controls/verdocs-switch/verdocs-switch.css +2 -2
- package/dist/collection/components/controls/verdocs-switch/verdocs-switch.js +3 -3
- package/dist/collection/components/controls/verdocs-switch/verdocs-switch.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-build/verdocs-build.js +1 -1
- package/dist/collection/components/embeds/verdocs-build/verdocs-build.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +16 -16
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.css +3 -3
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js +7 -6
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js.map +1 -1
- package/dist/collection/components/templates/verdocs-template-settings/verdocs-template-settings.css +57 -0
- package/dist/collection/components/templates/verdocs-template-settings/verdocs-template-settings.js +282 -0
- package/dist/collection/components/templates/verdocs-template-settings/verdocs-template-settings.js.map +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p-f4e068a9.js → p-38e1fed8.js} +4 -4
- package/dist/components/{p-f4e068a9.js.map → p-38e1fed8.js.map} +1 -1
- package/dist/components/p-7ad22da6.js +212 -0
- package/dist/components/p-7ad22da6.js.map +1 -0
- package/dist/components/{p-449f2b47.js → p-a1ba64de.js} +11 -16
- package/dist/components/p-a1ba64de.js.map +1 -0
- package/dist/components/{p-27548ebd.js → p-a443bd3a.js} +9 -8
- package/dist/components/{p-27548ebd.js.map → p-a443bd3a.js.map} +1 -1
- package/dist/components/verdocs-build.js +85 -73
- package/dist/components/verdocs-build.js.map +1 -1
- package/dist/components/verdocs-contact-picker.js +1 -1
- package/dist/components/verdocs-envelope-sidebar.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-switch.js +1 -1
- package/dist/components/verdocs-template-settings.d.ts +11 -0
- package/dist/components/verdocs-template-settings.js +8 -0
- package/dist/components/verdocs-template-settings.js.map +1 -0
- package/dist/custom-elements.json +14 -1
- package/dist/esm/index-272d51a4.js +8 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-build.entry.js +1 -1
- package/dist/esm/verdocs-build.entry.js.map +1 -1
- package/dist/esm/verdocs-contact-picker_2.entry.js +8 -7
- package/dist/esm/verdocs-contact-picker_2.entry.js.map +1 -1
- package/dist/esm/{verdocs-envelope-recipient-link_2.entry.js → verdocs-envelope-recipient-link.entry.js} +2 -25
- package/dist/esm/verdocs-envelope-recipient-link.entry.js.map +1 -0
- package/dist/esm/{verdocs-preview_6.entry.js → verdocs-preview_7.entry.js} +147 -17
- package/dist/esm/verdocs-preview_7.entry.js.map +1 -0
- package/dist/esm/verdocs-switch.entry.js +28 -0
- package/dist/esm/verdocs-switch.entry.js.map +1 -0
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/index-272d51a4.js +1 -1
- package/dist/esm-es5/index-272d51a4.js.map +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js.map +1 -1
- package/dist/esm-es5/{verdocs-envelope-recipient-link_2.entry.js → verdocs-envelope-recipient-link.entry.js} +2 -2
- package/dist/esm-es5/verdocs-envelope-recipient-link.entry.js.map +1 -0
- package/dist/esm-es5/verdocs-preview_7.entry.js +8 -0
- package/dist/esm-es5/verdocs-preview_7.entry.js.map +1 -0
- package/dist/esm-es5/verdocs-switch.entry.js +2 -0
- package/dist/esm-es5/verdocs-switch.entry.js.map +1 -0
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js.map +1 -1
- package/dist/types/components/controls/verdocs-switch/verdocs-switch.d.ts +1 -1
- package/dist/types/components/embeds/verdocs-send/verdocs-send.d.ts +3 -2
- package/dist/types/components/templates/verdocs-template-settings/verdocs-template-settings.d.ts +55 -0
- package/dist/types/components.d.ts +81 -6
- package/dist/verdocs-web-sdk/p-09460960.entry.js +8 -0
- package/dist/verdocs-web-sdk/p-09460960.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-17457a7a.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-17457a7a.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-21e9abff.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-21e9abff.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-27ddc017.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-27ddc017.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-5df005a9.system.entry.js +8 -0
- package/dist/verdocs-web-sdk/p-5df005a9.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-69527aaf.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-69527aaf.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-6f1e2f2f.entry.js → p-8e699235.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-8e699235.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-a1aefbfc.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-a1aefbfc.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-cabfdb9d.system.entry.js → p-a63b359e.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-a63b359e.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-dddd328d.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-dddd328d.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-e2b70dfb.system.js +1 -1
- package/dist/verdocs-web-sdk/p-e2b70dfb.system.js.map +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js.map +0 -1
- package/dist/cjs/verdocs-preview_6.cjs.entry.js.map +0 -1
- package/dist/components/p-449f2b47.js.map +0 -1
- package/dist/esm/verdocs-envelope-recipient-link_2.entry.js.map +0 -1
- package/dist/esm/verdocs-preview_6.entry.js.map +0 -1
- package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js.map +0 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js +0 -8
- package/dist/esm-es5/verdocs-preview_6.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-0666fb5d.system.entry.js +0 -8
- package/dist/verdocs-web-sdk/p-0666fb5d.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-6f1e2f2f.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-8d7d61ee.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-8d7d61ee.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-b9fee1a7.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-b9fee1a7.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-cabfdb9d.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-d58010a4.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-d58010a4.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-e3efeb57.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-e3efeb57.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-f81f766c.entry.js +0 -8
- package/dist/verdocs-web-sdk/p-f81f766c.entry.js.map +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["verdocsBuildCss","VerdocsBuildStyle0","VerdocsBuild","this","templateListenerId","VerdocsEndpoint","getDefault","onTemplateIdChanged","newTemplateId","oldTemplateId","step","loadTemplate","catch","e","console","log","onStepChanged","templateId","componentWillLoad","endpoint","loadSession","session","_a","sdkError","emit","SDKError","message","_b","response","status","_c","data","_d","_e","_f","Store","subscribe","getTemplate","template","loading","disconnectedCallback","unlistenToTemplate","store","delListener","handleCancel","handleTemplateCreated","stepChanged","handleRolesUpdated","templateUpdated","detail","handleTemplateUpdated","handleAttachmentsNext","handleRolesNext","handleStepChanged","render","h","Host","class","onSdkError","onExit","onNext","onTemplateUpdated","onRolesUpdated","style","flexDirection","gap","display","maxWidth","margin","backgroundColor","padding","onSend","send","width","flex"],"sources":["src/components/embeds/verdocs-build/verdocs-build.scss?tag=verdocs-build","src/components/embeds/verdocs-build/verdocs-build.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-build {\n display: flex;\n flex-direction: column;\n font-family: $verdocs-primary-font;\n\n .content {\n flex: 1;\n gap: 20px;\n display: flex;\n align-items: center;\n flex-direction: column;\n //box-shadow: 0 0 7px -3px #000000cc;\n }\n\n verdocs-template-attachments,\n verdocs-template-roles {\n margin: 20px;\n }\n\n verdocs-template-fields {\n border-top: 1px solid #777777;\n }\n\n verdocs-template-attachments {\n padding: 20px;\n background: #ffffff;\n }\n\n verdocs-template-fields {\n width: 100%;\n }\n\n verdocs-preview {\n flex: 1;\n }\n\n .preview-container {\n flex-direction: row;\n display: flex;\n width: 100%;\n background-color: #eeeeee;\n max-height: 100%;\n\n @media all and (max-width: 450px) {\n flex-direction: column;\n }\n }\n\n .preview-send-wrapper {\n display: flex;\n flex: 0 0 300px;\n background-color: #ffffff;\n box-shadow: 1px 1px 6px -2px #0000007f;\n\n @media all and (max-width: 450px) {\n flex: 0;\n }\n }\n\n .preview-preview-wrapper {\n display: flex;\n flex: 1;\n justify-content: center;\n overflow-y: scroll;\n }\n}\n","import {getTemplate, ICreateEnvelopeRecipient, IRole, ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, Prop, h, Element, Event, EventEmitter, Host, Watch, State} from '@stencil/core';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nexport type TVerdocsBuildStep = 'attachments' | 'roles' | 'settings' | 'fields' | 'preview';\n\n/**\n * Display a template building experience. Several event callbacks provide status updates to the\n * parent application to support interface updates.\n *\n * ```ts\n * <verdocs-build templateId={templateId} step=\"preview\" onSend={(detail) => {\n * console.log('Sent envelope from template', detail);\n * }} />\n * ```\n */\n@Component({\n tag: 'verdocs-build',\n styleUrl: 'verdocs-build.scss',\n shadow: false,\n})\nexport class VerdocsBuild {\n private templateListenerId = null;\n\n @Element() el!: any;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from. Unlike most other components, this is an optional parameter here.\n * If the template ID is known, `step` may also be specified to force displaying a specific step in the creation process.\n * If it is not specified, `step` will be ignored and the create step will be shown.\n */\n @Prop({reflect: true, mutable: true}) templateId: string | null = null;\n\n /**\n * The step in the creation process to display.\n */\n @Prop({reflect: true, mutable: true}) step: TVerdocsBuildStep = 'preview';\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 selects a different step.\n */\n @Event({composed: true}) stepChanged: EventEmitter<TVerdocsBuildStep>;\n\n /**\n * The user completed the Send form and clicked send.\n */\n @Event({composed: true}) send: EventEmitter<{recipients: ICreateEnvelopeRecipient[]; name: string; template_id: string}>;\n\n /**\n * Event fired when the template is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) templateUpdated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: string}>;\n\n /**\n * Event fired when the template is created by the upload step.\n */\n @Event({composed: true}) templateCreated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: string}>;\n\n /**\n * Event fired when roles are updated in the roles step.\n */\n @Event({composed: true}) rolesUpdated: EventEmitter<{endpoint: VerdocsEndpoint; templateId: string; event: 'added' | 'deleted' | 'updated'; roles: IRole[]}>;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string, oldTemplateId: string) {\n if (!oldTemplateId && newTemplateId && this.step === 'attachments') {\n this.step = 'preview';\n }\n\n this.loadTemplate(newTemplateId).catch((e: any) => console.log('Unknown Error', e));\n }\n\n @Watch('step')\n onStepChanged() {\n // We reload the template here even if only the step changed in case\n // we were out of sync before\n this.loadTemplate(this.templateId).catch((e: any) => console.log('Unknown Error', e));\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n if (!this.endpoint.session) {\n console.log('[BUILD] Unable to start builder session, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n console.log(`[BUILD] No template ID, activating upload mode`);\n this.step = 'attachments';\n return;\n }\n\n try {\n this.loadTemplate(this.templateId).catch(e => console.log('[BUILD] Unable to load template', e));\n } catch (e) {\n console.log('[BUILD] Error loading template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n } catch (e) {\n console.log('[BUILD] Error with builder session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n async loadTemplate(templateId: string) {\n if (templateId) {\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n }\n\n disconnectedCallback() {\n console.log('[BUILD] Disconnected');\n this.unlistenToTemplate();\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n handleCancel() {\n this.step = 'preview';\n }\n\n async handleTemplateCreated(templateId: string) {\n await this.loadTemplate(templateId);\n this.templateId = templateId;\n this.step = 'roles';\n this.stepChanged?.emit('roles');\n }\n\n async handleRolesUpdated(e: any) {\n this.templateUpdated?.emit(e.detail);\n }\n\n async handleTemplateUpdated(e: any) {\n this.templateUpdated?.emit(e.detail);\n }\n\n handleAttachmentsNext() {\n this.step = 'roles';\n this.stepChanged?.emit('roles');\n }\n\n handleRolesNext() {\n this.step = 'fields';\n this.stepChanged?.emit('fields');\n }\n\n handleStepChanged(step: TVerdocsBuildStep) {\n this.step = step;\n this.stepChanged?.emit(step);\n }\n\n render() {\n if (this.loading) {\n return (\n <Host class=\"loading\">\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n return (\n <Host>\n <div class=\"content\">\n <verdocs-template-build-tabs\n endpoint={this.endpoint}\n templateId={this.templateId}\n step={this.step}\n onSdkError={e => this.sdkError?.emit(e.detail)}\n onStepChanged={e => this.handleStepChanged(e.detail)}\n />\n\n {this.step === 'attachments' && (\n <verdocs-template-attachments\n templateId={this.templateId}\n endpoint={this.endpoint}\n onExit={() => this.handleCancel()}\n onNext={() => this.handleAttachmentsNext()}\n onTemplateUpdated={e => this.handleTemplateUpdated(e)}\n />\n )}\n\n {this.step === 'roles' && (\n <verdocs-template-roles\n templateId={this.templateId}\n endpoint={this.endpoint}\n onExit={() => this.handleCancel()}\n onNext={() => this.handleRolesNext()}\n onRolesUpdated={e => this.handleRolesUpdated(e)}\n />\n )}\n\n {this.step === 'settings' && (\n <div style={{flexDirection: 'column', gap: '20px', display: 'flex', maxWidth: '400px', margin: '20px'}}>\n <verdocs-template-name\n templateId={this.templateId}\n endpoint={this.endpoint}\n style={{backgroundColor: '#ffffff', padding: '20px'}}\n onTemplateUpdated={e => this.handleTemplateUpdated(e)}\n />\n <verdocs-template-reminders\n templateId={this.templateId}\n endpoint={this.endpoint}\n style={{backgroundColor: '#ffffff', padding: '20px'}}\n onTemplateUpdated={e => this.handleTemplateUpdated(e)}\n />\n <verdocs-template-visibility\n templateId={this.templateId}\n endpoint={this.endpoint}\n style={{backgroundColor: '#ffffff', padding: '20px'}}\n onTemplateUpdated={e => this.handleTemplateUpdated(e)}\n />\n </div>\n )}\n\n {this.step === 'fields' && <verdocs-template-fields templateId={this.templateId} endpoint={this.endpoint} onTemplateUpdated={e => this.handleTemplateUpdated(e)} />}\n\n {this.step === 'preview' && (\n <div class=\"preview-container\">\n <div class=\"preview-send-wrapper\">\n <verdocs-send templateId={this.templateId} endpoint={this.endpoint} onSend={e => this.send?.emit(e.detail)} style={{width: '100%'}} />\n </div>\n <div class=\"preview-preview-wrapper\">\n <verdocs-preview templateId={this.templateId} endpoint={this.endpoint} style={{display: 'flex', flex: '1', maxWidth: '1000px'}} />\n </div>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"2MAAA,MAAMA,EAAkB,quDACxB,MAAAC,EAAeD,E,MCqBFE,EAAY,M,6QACfC,KAAAC,mBAAqB,K,cAO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AAU0C,kBAAmBhD,GAAKV,KAAK+C,sBAAsBrC,KAE5JV,KAAKO,OAAS,WACb6C,EAAA,OAAKE,MAAM,qBACTF,EAAA,OAAKE,MAAM,wBACTF,EAAA,gBAActC,WAAYd,KAAKc,WAAYE,SAAUhB,KAAKgB,SAAUoD,OAAQ1D,IAAC,IAAAS,EAAI,OAAAA,EAAAnB,KAAKqE,QAAI,MAAAlD,SAAA,SAAAA,EAAEE,KAAKX,EAAEoC,OAAO,EAAEc,MAAO,CAACU,MAAO,WAE7HlB,EAAA,OAAKE,MAAM,2BACTF,EAAA,mBAAiBtC,WAAYd,KAAKc,WAAYE,SAAUhB,KAAKgB,SAAU4C,MAAO,CAACG,QAAS,OAAQQ,KAAM,IAAKP,SAAU,e","ignoreList":[]}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
System.register(["./p-9186f42e.system.js","@verdocs/js-sdk","./p-f29eb00a.system.js","./p-21b1acec.system.js","./p-d738b5db.system.js","./p-2c5350ec.system.js"],(function(e){"use strict";var t,o,i,c,a,s,n,r,d;return{setters:[function(e){t=e.r;o=e.c;i=e.h;c=e.F;a=e.H},function(e){s=e.VerdocsEndpoint;n=e.formatFullName;r=e.isValidEmail},function(e){d=e.h},function(){},function(){},function(){}],execute:function(){var l='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{gap:12px;width:300px;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5fa}verdocs-contact-picker form .row{gap:8px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-contact-picker form .row.message{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}verdocs-contact-picker form .names-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .names-row>input{font-size:14px;width:103px}verdocs-contact-picker form .kba-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .kba-row verdocs-select-input{margin:0}verdocs-contact-picker form .pin-code{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .pin-code>input{-ms-flex:0;flex:0;width:133px;font-size:14px;margin-left:58px}verdocs-contact-picker form .address{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .address>input{-ms-flex:1;flex:1;font-size:14px;margin-left:58px}verdocs-contact-picker form .zip-code{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .zip-code>input{-ms-flex:1;flex:1;font-size:14px;margin-left:58px}verdocs-contact-picker form label{display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;font-size:14px;font-weight:500;color:#5c6575}verdocs-contact-picker form .row.message label{-ms-flex:0;flex:0}verdocs-contact-picker form .row.message input{width:100%}verdocs-contact-picker form input{-ms-flex:1;flex:1;padding:6px;font-size:14px;border-radius:3px;background:rgba(0, 0, 0, 0.0196078431);border:1px solid rgba(112, 122, 229, 0.3725490196)}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;max-height:225px;overflow-y:scroll;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{width:32px;height:32px}verdocs-contact-picker form .dropdown .suggestion .avatar{width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}';var f=l;var p='<svg focusable="false" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';var u='<svg focusable="false" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z" clip-rule="evenodd" /></svg>';var b='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-user"><path d="M15 13a3 3 0 1 0-6 0"/><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"/><circle cx="12" cy="8" r="2"/></svg>';var h=e("verdocs_contact_picker",function(){function e(e){t(this,e);this.searchContacts=o(this,"searchContacts",7);this.exit=o(this,"exit",7);this.next=o(this,"next",7);this.endpoint=s.getDefault();this.templateRole=null;this.contactSuggestions=[];this.first_name=undefined;this.last_name=undefined;this.email=undefined;this.phone=undefined;this.zip=undefined;this.address=undefined;this.message=undefined;this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.showKba=false;this.kba_method="";this.kba_pin="";this.nameFieldId="verdocs-contact-picker-name-".concat(Math.random().toString(36).substring(2,11));this.firstNameFieldId="verdocs-contact-picker-firstname-".concat(Math.random().toString(36).substring(2,11));this.lastNameFieldId="verdocs-contact-picker-lastname-".concat(Math.random().toString(36).substring(2,11));this.emailFieldId="verdocs-contact-picker-email-".concat(Math.random().toString(36).substring(2,11));this.phoneFieldId="verdocs-contact-picker-phone-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentWillLoad=function(){if(this.templateRole){var e=n(this.templateRole);var t=e.split(" ");var o=this.templateRole.first_name||t.shift()||"";var i=this.templateRole.last_name||t.join(" ")||"";this.first_name=o;this.last_name=i;this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.message=this.templateRole.message||"";this.showMessage=this.message!=="";this.kba_method=this.templateRole.kba_method||"";this.kba_pin=this.templateRole.kba_pin||"";this.showKba=!!this.kba_method}};e.prototype.handleFirstNameChange=function(e){var t;this.first_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.first_name})};e.prototype.handleLastNameChange=function(e){var t;this.last_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.last_name})};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.next)===null||t===void 0?void 0:t.emit({first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator,kba_method:this.kba_method,kba_pin:this.kba_pin,address:this.address,zip:this.zip})};e.prototype.handleSelectSuggestion=function(e,t){e.stopPropagation();this.first_name=t.first_name;this.last_name=t.last_name;this.email=t.email;this.phone=t.phone;this.showSuggestions=false};e.prototype.render=function(){var e=this;var t=this.first_name&&this.last_name&&r(this.email);var o=!this.kba_method||this.kba_method==="pin"&&this.kba_pin||this.kba_method==="identity";var a=t&&o;return i("form",{key:"2ce99d1c3ae979f25dde56e4a9dc7ec56cec2542",onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},i("div",{key:"6257ebf610c9ea9a8f6238311ad1b4ed0095e498",class:"row"},i("label",{key:"c36d51599847033b0c096c9d5de7d8af49e05c7d",htmlFor:this.nameFieldId},"Name:"),i("div",{key:"23cdb2afffff2ede3429c8591093eb89ca89d4b6",class:"names-row"},i("input",{key:"d281392383863edbcfc14440e18631b97962ea2f",id:this.firstNameFieldId,name:this.firstNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.first_name,placeholder:"First...",onFocus:function(){var t;return e.showSuggestions=((t=e.contactSuggestions)===null||t===void 0?void 0:t.length)>0},onInput:function(t){return e.handleFirstNameChange(t)}}),i("input",{key:"eea0626eb854ae95c32ad7e98d479a614e7df81c",id:this.lastNameFieldId,name:this.lastNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.last_name,placeholder:"Last...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleLastNameChange(t)}})),this.showSuggestions&&i("div",{key:"2e3fc57f42e3281b83b03e53b92c07243dcff544",class:"dropdown"},this.contactSuggestions.filter((function(t){return!e.first_name||t.first_name.toLowerCase().includes(e.first_name.toLowerCase())})).map((function(t){var o;return i("div",{key:(o=t.id)!==null&&o!==void 0?o:t.email,class:"suggestion",onClick:function(o){return e.handleSelectSuggestion(o,t)}},t.picture?i("img",{alt:"Avatar",class:"avatar",src:t.picture}):i("div",{class:"avatar",innerHTML:b}),i("div",{class:"details"},i("div",{class:"name"},n(t)),t.email&&i("div",{class:"destination"},t.email),t.phone&&i("div",{class:"destination"},t.phone)))})))),i("div",{key:"f18fd6d889ea70f8a5e51bd1780007b3ff061b56",class:"row"},i("label",{key:"5cda3922bb705ed0d3af00644df9ef8d42042021",htmlFor:this.emailFieldId},"Email:"),i("input",{key:"34474c4c8bbbde2802b3c2f58ea3abed4b3e27f6",id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.email,placeholder:"Email address...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.email=t.target.value}})),i("div",{key:"c757b186ca60272855ed5701c59857856dcd863f",class:"row"},i("label",{key:"1d971705ab36609db6a4e9cb7d24281d98441cd5",htmlFor:this.phoneFieldId},"Phone:"),i("input",{key:"2a516e28498a6727409ef51e61ca3fe912c65789",id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.phone,placeholder:"Phone (SMS)...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){e.phone=d(t.target.value)}})),this.showKba&&i(c,{key:"05cdb2c78abc3156d04a012c40a52f2c6ab24a86"},i("div",{key:"56d53a04ba6ab45ecc30f11e44669ad503400a49",class:"kba-row"},i("label",{key:"8af91071db065071bb40e931ea92231f31e9c0c9"},"KBA:"),i("verdocs-select-input",{key:"3f2eec31ee0078779eeed5d3f2fbd222fcdbaa42",value:this.kba_method,onInput:function(t){e.kba_method=t.target.value;e.zip="";e.address="";e.kba_pin=""},options:[{label:"None",value:""},{label:"PIN Code",value:"pin"},{label:"Full Verification",value:"identity"}]}),i("div",{key:"33e9efc07399e6930264b4b79f73a5497728c7c7",style:{flex:"1"}}),i("verdocs-help-icon",{key:"bc5ec8ad3fcf22a4f9a0f4659b574e238526574a",text:"Knowledge-Based Authentication adds additional authentication for this user either via a simple PIN code or full address validation. NOTE: There may be a fee for using this feature."})),this.kba_method==="pin"&&i("div",{key:"cd07404e1e9cd0a344c0975bdd23b2374d97ad61",class:"row pin-code"},i("input",{key:"92909cedb50e11bffe60dcd032b2d8c3dd901834",id:"verdocs-pin-code",name:"verdocs-pin-code",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.kba_pin,placeholder:"PIN Code...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.kba_pin=t.target.value}})),this.kba_method==="identity"&&i("div",{key:"6ad1983ac8f9394bb9f35a8a9bba2f16d48d7bcd",class:"row address"},i("input",{key:"d598a1fb52b77eb85f17bda65f1730900d1d94e5",id:"verdocs-address",name:"verdocs-address",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.address,placeholder:"Address...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.address=t.target.value}}),i("verdocs-help-icon",{key:"09d3cfa8e92c6c59cda2cff599ae474296de35a0",text:"Pre-fill the recipient's current street address. They will still be asked ID challenge questions."})),this.kba_method==="identity"&&i("div",{key:"1ccb3caa35f5474f40245ca1fe9c11aa175b4cc2",class:"row zip-code"},i("input",{key:"e967aba3ffac6e25f359c56c0bd5cd057394ad82",id:"verdocs-zip-code",name:"verdocs-zip-code",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.zip,placeholder:"Zip Code...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.zip=t.target.value}}),i("verdocs-help-icon",{key:"b4075b320d84028e8717e8383113751155a6aebf",text:"Pre-fill the recipient's current zip code. They will still be asked ID challenge questions."}))),this.showMessage&&i("div",{key:"8212baa1274eb1dd98deeec972afeeb5bfb3c400",class:"row message"},i("label",{key:"1b1c58c77ebd0dfd1e193e68a9bf472d93b8914f",htmlFor:"verdocs-contact-picker-message"},"Message:"),i("input",{key:"d5525496367b3fa0bde52a91bad7f68964454a3c",id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.message,placeholder:"Message shown in invitation...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.message=t.target.value}})),i("div",{key:"c39a19e49ea3ae82ecb287bf2acb87734237fdb9",class:"buttons"},i("verdocs-toggle-button",{key:"311f86449b98cad74d5811473578ab223237d39e",icon:u,size:"small",active:this.showKba,onToggle:function(t){e.showKba=t.detail.active;if(!t.detail.active){e.kba_pin="";e.kba_method="";e.zip=""}e.showSuggestions=false}}),i("verdocs-toggle-button",{key:"c51c8bba37758ad6ada6946d9c2df9880204b1be",icon:p,size:"small",active:this.showMessage,onToggle:function(t){e.showMessage=t.detail.active;e.showSuggestions=false}}),i("div",{key:"747951c6d9273bf5142be1f20b6e51a2cc4239d5",class:"flex-fill"}),i("verdocs-button",{key:"12f60448cac7f6bb6804119ad620bdc77d4c0c9c",variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),i("verdocs-button",{key:"507b52e7904d9e5c31e1ba40c7ffa0ccba7763f2",label:"OK",size:"small",disabled:!a,onClick:!a?function(){}:function(t){return e.handleSubmit(t)}})))};return e}());h.style=f;var v='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toggle-button{font-family:"Inter", "Barlow", sans-serif}verdocs-toggle-button button{border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#cccccc;color:#33364b}verdocs-toggle-button button svg{max-width:100%;max-height:100%;fill:#33364b}verdocs-toggle-button button.active{background:#55bc81;color:#f5f5fa}verdocs-toggle-button button.active svg{fill:#f5f5fa}verdocs-toggle-button button:focus{border:none;outline:none}verdocs-toggle-button.size-normal button{width:40px;height:40px;padding:6px;border-radius:4px}verdocs-toggle-button.size-small button{width:34px;height:34px;padding:4px;border-radius:2px}';var m=v;var x=e("verdocs_toggle_button",function(){function e(e){t(this,e);this.toggle=o(this,"toggle",7);this.active=false;this.icon=null;this.label=null;this.size="normal";this._active=false}e.prototype.componentWillLoad=function(){this._active=this.active};e.prototype.handleToggle=function(e){var t;e.stopPropagation();var o=!this._active;this._active=o;(t=this.toggle)===null||t===void 0?void 0:t.emit({active:o})};e.prototype.render=function(){var e=this;return i(a,{key:"57d988cf0335a521279382d8c91be3b7af3b1f87",class:"size-".concat(this.size)},this.icon?i("button",{innerHTML:this.icon,class:{active:this._active},onClick:function(t){return e.handleToggle(t)}}):i("button",{class:{active:this._active},onClick:function(t){return e.handleToggle(t)}},this.label))};return e}());x.style=m}}}));
|
2
|
-
//# sourceMappingURL=p-8d7d61ee.system.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["verdocsContactPickerCss","VerdocsContactPickerStyle0","messageIcon","kbaIcon","addrBookIcon","VerdocsContactPicker","exports","VerdocsEndpoint","getDefault","concat","Math","random","toString","substring","class_1","prototype","componentWillLoad","this","templateRole","fullName","formatFullName","nameComponents","split","firstName","first_name","shift","lastName","last_name","join","email","phone","delegator","message","showMessage","kba_method","kba_pin","showKba","handleFirstNameChange","e","target","value","_a","searchContacts","emit","query","handleLastNameChange","handleCancel","stopPropagation","showSuggestions","exit","handleSubmit","next","address","zip","handleSelectSuggestion","suggestion","render","_this","hasBasics","isValidEmail","hasKbaRequirements","canSubmit","h","key","onSubmit","preventDefault","onClick","autocomplete","class","htmlFor","nameFieldId","id","firstNameFieldId","name","type","placeholder","onFocus","contactSuggestions","length","onInput","lastNameFieldId","filter","toLowerCase","includes","map","picture","alt","src","innerHTML","emailFieldId","autoComplete","phoneFieldId","convertToE164","Fragment","options","label","style","flex","text","icon","size","active","onToggle","detail","variant","disabled","verdocsToggleButtonCss","VerdocsToggleButtonStyle0","VerdocsToggleButton","class_2","_active","handleToggle","newState","toggle","Host"],"sources":["src/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.scss?tag=verdocs-contact-picker","src/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.tsx","src/components/controls/verdocs-toggle-button/verdocs-toggle-button.scss?tag=verdocs-toggle-button","src/components/controls/verdocs-toggle-button/verdocs-toggle-button.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-contact-picker {\n display: block;\n border: 1px solid #ebebeb;\n background-color: $verdocs-grey-4;\n font-family: $verdocs-primary-font;\n box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.1);\n\n form {\n gap: 12px;\n width: 300px;\n padding: 12px;\n display: flex;\n flex-direction: column;\n background-color: $verdocs-grey-3;\n\n .row {\n gap: 8px;\n display: flex;\n position: relative;\n flex-direction: row;\n align-items: center;\n\n &.message {\n flex-direction: column;\n align-items: flex-start;\n }\n }\n\n .names-row {\n gap: 8px;\n display: flex;\n flex-direction: row;\n\n > input {\n font-size: 14px;\n width: 103px;\n }\n }\n\n .kba-row {\n gap: 8px;\n display: flex;\n align-items: center;\n flex-direction: row;\n\n verdocs-select-input {\n margin: 0;\n }\n }\n\n .pin-code {\n gap: 8px;\n display: flex;\n align-items: center;\n flex-direction: row;\n\n > input {\n flex: 0;\n width: 133px;\n font-size: 14px;\n margin-left: 58px;\n }\n }\n\n .address {\n gap: 8px;\n display: flex;\n align-items: center;\n flex-direction: row;\n\n > input {\n flex: 1;\n font-size: 14px;\n margin-left: 58px;\n }\n }\n\n .zip-code {\n gap: 8px;\n display: flex;\n align-items: center;\n flex-direction: row;\n\n > input {\n flex: 1;\n font-size: 14px;\n margin-left: 58px;\n }\n }\n\n label {\n display: flex;\n flex: 0 0 50px;\n font-size: 14px;\n font-weight: 500;\n color: $verdocs-bg-4;\n }\n\n .row.message label {\n flex: 0;\n }\n\n .row.message input {\n width: 100%;\n }\n\n input {\n flex: 1;\n padding: 6px;\n font-size: 14px;\n border-radius: 3px;\n background: #00000005;\n border: 1px solid $border-color-extralight;\n\n &:focus {\n outline: none;\n }\n }\n\n .dropdown {\n left: 0;\n right: 0;\n top: 49px;\n z-index: 1000000;\n max-height: 225px;\n overflow-y: scroll;\n position: absolute;\n background: #ffffff;\n box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.1);\n\n .suggestion {\n display: flex;\n padding: 6px 12px;\n align-items: center;\n flex-direction: row;\n\n svg {\n width: 32px;\n height: 32px;\n }\n\n .avatar {\n width: 32px;\n height: 32px;\n flex: 0 0 32px;\n margin-right: 8px;\n border-radius: 100%;\n }\n\n .details {\n display: flex;\n flex-direction: column;\n }\n\n .name {\n font-size: 16px;\n font-weight: 500;\n margin-bottom: 3px;\n color: $verdocs-grey-0;\n }\n\n .destination {\n font-size: 14px;\n margin-bottom: 3px;\n color: $verdocs-grey-1;\n }\n\n &:hover {\n background: #eee;\n cursor: pointer;\n }\n }\n }\n }\n\n .buttons {\n display: flex;\n column-gap: 6px;\n margin-top: 16px;\n flex-direction: row;\n\n .flex-fill {\n flex: 1;\n }\n }\n\n ::placeholder {\n color: $verdocs-bg-2;\n }\n\n // @see https://community.logmein.com/t5/LastPass-Support-Discussions/placeholder-text-overrides-data-lpignore-quot-true-quot/td-p/295135\n // LastPass is ignoring the data-lpignore attribute in some cases\n [data-lastpass-icon-root] {\n display: none !important;\n }\n}\n","import {Component, h, Event, EventEmitter, Fragment, Prop, State} from '@stencil/core';\nimport {formatFullName, IProfile, IRecipient, isValidEmail, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {convertToE164} from '../../../utils/utils';\n\nconst messageIcon =\n '<svg focusable=\"false\" viewBox=\"0 0 24 24\"><path d=\"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z\"></path></svg>';\n\n// const delegateIcon =\n// '<svg focusable=\"false\" viewBox=\"0 0 24 24\"><path d=\"M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0 4c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H6v-1.4c0-2 4-3.1 6-3.1s6 1.1 6 3.1V19z\"></path></svg>';\n\nconst kbaIcon =\n '<svg focusable=\"false\" viewBox=\"0 0 24 24\"><path fill-rule=\"evenodd\" d=\"M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z\" clip-rule=\"evenodd\" /></svg>';\n\nconst addrBookIcon = `<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"lucide lucide-book-user\"><path d=\"M15 13a3 3 0 1 0-6 0\"/><path d=\"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20\"/><circle cx=\"12\" cy=\"8\" r=\"2\"/></svg>`;\n\nexport interface IContactSearchEvent {\n query: string;\n}\n\nexport interface IContactSelectEvent {\n first_name: string;\n last_name: string;\n email: string;\n phone: string;\n message: string;\n delegator: boolean;\n kba_method: string;\n kba_pin: string;\n address: string;\n zip: string;\n}\n\nexport type TPickerContact = Partial<IProfile>;\n\n/**\n * Display a contact picker suitable for filling out Recipient objects when sending Envelopes.\n *\n * This picker can also be integrated with a backend to provide contact list / suggestion / address-book style behavior. As the\n * user interacts with the component, the text entered in the name fields is sent back to the parent via the `searchContacts` event.\n * The parent can use that text as a query string to call a backend to obtain appropriate contacts to show. This list may also be\n * hard-coded ahead of time to provide the user with smart suggestions on initial display, such as \"Recently Used\" contacts, or\n * to always display the user's own contact record.\n *\n * ```ts\n * <verdocs-contact-picker\n * templateRole={role}\n * contactSuggestions={[]}\n * onNext={e => console.log('Contact completed', e.detail)}\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-contact-picker',\n styleUrl: 'verdocs-contact-picker.scss',\n shadow: false,\n})\nexport class VerdocsContactPicker {\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 role that this contact will be assigned to.\n */\n @Prop() templateRole: Partial<IRecipient> | null = null;\n\n /**\n * If set, suggestions will be displayed in a drop-down list to the user. It is recommended that the number\n * of suggestions be limited to the 5 best matching records.\n */\n @Prop() contactSuggestions: TPickerContact[] = [];\n\n /**\n * Event fired when the user enters text in the search field. The calling application may use this to update\n * the `contactSuggestions` property.\n */\n @Event({composed: true}) searchContacts: EventEmitter<IContactSearchEvent>;\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 when the user changes the type.\n */\n @Event({composed: true}) next: EventEmitter<IContactSelectEvent>;\n\n @State() first_name: string;\n @State() last_name: string;\n @State() email: string;\n @State() phone: string;\n @State() zip: string;\n @State() address: string;\n @State() message: string;\n @State() showSuggestions: boolean = false;\n @State() showMessage: boolean = false;\n @State() delegator: boolean = false;\n @State() showKba: boolean = false;\n @State() kba_method: '' | 'pin' | 'identity' = '';\n @State() kba_pin: string = '';\n\n @State() nameFieldId = `verdocs-contact-picker-name-${Math.random().toString(36).substring(2, 11)}`;\n @State() firstNameFieldId = `verdocs-contact-picker-firstname-${Math.random().toString(36).substring(2, 11)}`;\n @State() lastNameFieldId = `verdocs-contact-picker-lastname-${Math.random().toString(36).substring(2, 11)}`;\n @State() emailFieldId = `verdocs-contact-picker-email-${Math.random().toString(36).substring(2, 11)}`;\n @State() phoneFieldId = `verdocs-contact-picker-phone-${Math.random().toString(36).substring(2, 11)}`;\n\n componentWillLoad() {\n if (this.templateRole) {\n const fullName = formatFullName(this.templateRole);\n const nameComponents = fullName.split(' ');\n const firstName = this.templateRole.first_name || nameComponents.shift() || '';\n const lastName = this.templateRole.last_name || nameComponents.join(' ') || '';\n this.first_name = firstName;\n this.last_name = lastName;\n\n this.email = this.templateRole.email || '';\n this.phone = this.templateRole.phone || '';\n this.delegator = this.templateRole.delegator || false;\n this.message = this.templateRole.message || '';\n this.showMessage = this.message !== '';\n this.kba_method = this.templateRole.kba_method || '';\n this.kba_pin = this.templateRole.kba_pin || '';\n this.showKba = !!this.kba_method;\n // TODO: Allow template roles to have zip codes predefined?\n }\n }\n\n handleFirstNameChange(e: any) {\n this.first_name = e.target.value;\n this.searchContacts?.emit({query: this.first_name});\n }\n\n handleLastNameChange(e: any) {\n this.last_name = e.target.value;\n this.searchContacts?.emit({query: this.last_name});\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n this.showSuggestions = false;\n this.exit?.emit();\n }\n\n handleSubmit(e: any) {\n e.stopPropagation();\n\n this.showSuggestions = false;\n this.next?.emit({\n first_name: this.first_name,\n last_name: this.last_name,\n email: this.email,\n phone: this.phone,\n message: this.message,\n delegator: this.delegator,\n kba_method: this.kba_method,\n kba_pin: this.kba_pin,\n address: this.address,\n zip: this.zip,\n });\n }\n\n handleSelectSuggestion(e: any, suggestion: TPickerContact) {\n e.stopPropagation();\n\n this.first_name = suggestion.first_name;\n this.last_name = suggestion.last_name;\n this.email = suggestion.email;\n this.phone = suggestion.phone;\n this.showSuggestions = false;\n }\n\n // The reason for the random names/IDs is to disable browser autocomplete. We set the autocomplete tags but many browsers ignore them\n // and show a duplicate autocomplete picker on top of our own.\n render() {\n // TODO: Re-activate this one SMS is re-enabled\n // const hasBasics = this.first_name && this.last_name && (isValidEmail(this.email) || isValidPhone(this.phone));\n const hasBasics = this.first_name && this.last_name && isValidEmail(this.email);\n const hasKbaRequirements =\n !this.kba_method ||\n (this.kba_method === 'pin' && this.kba_pin) ||\n this.kba_method === 'identity';\n // TODO: For discussion\n // (this.kba_method === 'identity' && this.address && this.zip)\n const canSubmit = hasBasics && hasKbaRequirements;\n\n return (\n <form onSubmit={e => e.preventDefault()} onClick={e => e.stopPropagation()} autocomplete=\"off\">\n <div class=\"row\">\n <label htmlFor={this.nameFieldId}>Name:</label>\n <div class=\"names-row\">\n <input\n id={this.firstNameFieldId}\n name={this.firstNameFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.first_name}\n placeholder=\"First...\"\n onFocus={() => (this.showSuggestions = this.contactSuggestions?.length > 0)}\n onInput={e => this.handleFirstNameChange(e)}\n />\n <input\n id={this.lastNameFieldId}\n name={this.lastNameFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.last_name}\n placeholder=\"Last...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={e => this.handleLastNameChange(e)}\n />\n </div>\n\n {this.showSuggestions && (\n <div class=\"dropdown\">\n {this.contactSuggestions\n .filter(suggestion => !this.first_name || suggestion.first_name.toLowerCase().includes(this.first_name.toLowerCase()))\n .map(suggestion => (\n <div key={suggestion.id ?? suggestion.email} class=\"suggestion\" onClick={e => this.handleSelectSuggestion(e, suggestion)}>\n {suggestion.picture ? <img alt=\"Avatar\" class=\"avatar\" src={suggestion.picture} /> : <div class=\"avatar\" innerHTML={addrBookIcon} />}\n <div class=\"details\">\n <div class=\"name\">{formatFullName(suggestion)}</div>\n {suggestion.email && <div class=\"destination\">{suggestion.email}</div>}\n {suggestion.phone && <div class=\"destination\">{suggestion.phone}</div>}\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n <div class=\"row\">\n <label htmlFor={this.emailFieldId}>Email:</label>\n <input\n id={this.emailFieldId}\n name={this.emailFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autoComplete=\"blocked\"\n value={this.email}\n placeholder=\"Email address...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.email = e.target.value)}\n />\n </div>\n\n <div class=\"row\">\n <label htmlFor={this.phoneFieldId}>Phone:</label>\n <input\n id={this.phoneFieldId}\n name={this.phoneFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autoComplete=\"blocked\"\n value={this.phone}\n placeholder=\"Phone (SMS)...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => {\n this.phone = convertToE164(e.target.value);\n }}\n />\n </div>\n\n {this.showKba && (\n <Fragment>\n <div class=\"kba-row\">\n <label>KBA:</label>\n <verdocs-select-input\n value={this.kba_method}\n onInput={(e: any) => {\n this.kba_method = e.target.value;\n this.zip = '';\n this.address = '';\n this.kba_pin = '';\n }}\n options={[\n {label: 'None', value: ''},\n {label: 'PIN Code', value: 'pin'},\n {label: 'Full Verification', value: 'identity'},\n ]}\n />\n <div style={{flex: '1'}}></div>\n <verdocs-help-icon text=\"Knowledge-Based Authentication adds additional authentication for this user either via a simple PIN code or full address validation. NOTE: There may be a fee for using this feature.\" />\n </div>\n\n {this.kba_method === 'pin' && (\n <div class=\"row pin-code\">\n <input\n id=\"verdocs-pin-code\"\n name=\"verdocs-pin-code\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.kba_pin}\n placeholder=\"PIN Code...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.kba_pin = e.target.value)}\n />\n </div>\n )}\n\n {this.kba_method === 'identity' && (\n <div class=\"row address\">\n <input\n id=\"verdocs-address\"\n name=\"verdocs-address\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.address}\n placeholder=\"Address...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.address = e.target.value)}\n />\n <verdocs-help-icon text=\"Pre-fill the recipient's current street address. They will still be asked ID challenge questions.\" />\n </div>\n )}\n\n {this.kba_method === 'identity' && (\n <div class=\"row zip-code\">\n <input\n id=\"verdocs-zip-code\"\n name=\"verdocs-zip-code\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.zip}\n placeholder=\"Zip Code...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.zip = e.target.value)}\n />\n <verdocs-help-icon text=\"Pre-fill the recipient's current zip code. They will still be asked ID challenge questions.\" />\n </div>\n )}\n </Fragment>\n )}\n\n {this.showMessage && (\n <div class=\"row message\">\n <label htmlFor=\"verdocs-contact-picker-message\">Message:</label>\n <input\n id=\"verdocs-contact-picker-message\"\n name=\"verdocs-contact-picker-message\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.message}\n placeholder=\"Message shown in invitation...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.message = e.target.value)}\n />\n </div>\n )}\n\n <div class=\"buttons\">\n <verdocs-toggle-button\n icon={kbaIcon}\n size=\"small\"\n active={this.showKba}\n onToggle={e => {\n this.showKba = e.detail.active;\n if (!e.detail.active) {\n this.kba_pin = '';\n this.kba_method = '';\n this.zip = '';\n }\n this.showSuggestions = false;\n }}\n />\n <verdocs-toggle-button\n icon={messageIcon}\n size=\"small\"\n active={this.showMessage}\n onToggle={e => {\n this.showMessage = e.detail.active;\n this.showSuggestions = false;\n }}\n />\n\n <div class=\"flex-fill\" />\n\n <verdocs-button variant=\"outline\" label=\"Cancel\" size=\"small\" onClick={e => this.handleCancel(e)} />\n <verdocs-button label=\"OK\" size=\"small\" disabled={!canSubmit} onClick={!canSubmit ? () => {} : e => this.handleSubmit(e)} />\n </div>\n </form>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-toggle-button {\n font-family: $primary-font;\n\n button {\n border: none;\n outline: none;\n cursor: pointer;\n align-items: center;\n display: inline-flex;\n justify-content: center;\n background: $verdocs-bg-1;\n color: $verdocs-dark-blue;\n\n svg {\n max-width: 100%;\n max-height: 100%;\n fill: $verdocs-dark-blue;\n }\n\n &.active {\n background: $verdocs-green;\n color: $verdocs-grey-3;\n\n svg {\n fill: $verdocs-grey-3;\n }\n }\n\n &:focus {\n border: none;\n outline: none;\n }\n }\n\n &.size-normal button {\n width: 40px;\n height: 40px;\n padding: 6px;\n border-radius: 4px;\n }\n\n &.size-small button {\n width: 34px;\n height: 34px;\n padding: 4px;\n border-radius: 2px;\n }\n}\n","import {Component, Prop, h, State, Event, EventEmitter, Host} from '@stencil/core';\n\n/**\n * Displays a single button that can be toggled on or off by clicking it.\n *\n * ```ts\n * <verdocs-toggle-button icon={MessageIcon} size=\"normal\" active={true} />\n * ```\n */\n@Component({\n tag: 'verdocs-toggle-button',\n styleUrl: 'verdocs-toggle-button.scss',\n})\nexport class VerdocsToggleButton {\n @Prop() active = false;\n\n /**\n * If set, should be an SVG object. This will be rendered as the button's visible element. If icon is supplied, label is ignored.\n */\n @Prop() icon?: string | null = null;\n\n /**\n * If set, should be an SVG object. This will be rendered as the button's visible element. If icon is supplied, label is ignored.\n */\n @Prop() label?: string | null = null;\n\n /**\n * How large the button should be. Small buttons are intended for dialog boxes and other smaller scale UI regions.\n */\n @Prop() size?: 'small' | 'normal' = 'normal';\n\n /**\n * Event fired when the button is pressed.\n */\n @Event({composed: true}) toggle!: EventEmitter<{active: boolean}>;\n\n @State() _active = false;\n\n componentWillLoad() {\n this._active = this.active;\n }\n\n handleToggle(e: any) {\n e.stopPropagation();\n\n const newState = !this._active;\n this._active = newState;\n this.toggle?.emit({active: newState});\n }\n\n render() {\n return (\n <Host class={`size-${this.size}`}>\n {this.icon ? (\n <button innerHTML={this.icon} class={{active: this._active}} onClick={e => this.handleToggle(e)} />\n ) : (\n <button class={{active: this._active}} onClick={e => this.handleToggle(e)}>\n {this.label}\n </button>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"+ZAAA,IAAMA,EAA0B,23IAChC,IAAAC,EAAeD,ECGf,IAAME,EACJ,4LAKF,IAAMC,EACJ,sjBAEF,IAAMC,EAAe,oU,IA2CRC,EAAoBC,EAAA,oC,2IAIKC,EAAgBC,a,kBAKD,K,wBAMJ,G,mLAyBX,M,iBACJ,M,eACF,M,aACF,M,gBACmB,G,aACpB,G,iBAEJ,+BAAAC,OAA+BC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,K,sBAClE,oCAAAJ,OAAoCC,K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AgG,aAAA,SAAazE,G,MACXA,EAAES,kBAEF,IAAMiE,GAAY/F,KAAK6F,QACvB7F,KAAK6F,QAAUE,GACfvE,EAAAxB,KAAKgG,UAAM,MAAAxE,SAAA,SAAAA,EAAEE,KAAK,CAAC0D,OAAQW,G,EAG7BH,EAAA9F,UAAAyC,OAAA,eAAAC,EAAAxC,KACE,OACE6C,EAACoD,EAAI,CAAAnD,IAAA,2CAACK,MAAO,QAAA3D,OAAQQ,KAAKmF,OACvBnF,KAAKkF,KACJrC,EAAA,UAAQ0B,UAAWvE,KAAKkF,KAAM/B,MAAO,CAACiC,OAAQpF,KAAK6F,SAAU5C,QAAS,SAAA5B,GAAK,OAAAmB,EAAKsD,aAAazE,EAAlB,IAE3EwB,EAAA,UAAQM,MAAO,CAACiC,OAAQpF,KAAK6F,SAAU5C,QAAS,SAAA5B,GAAK,OAAAmB,EAAKsD,aAAazE,EAAlB,GAClDrB,KAAK8E,O,WA5Cc,I","ignoreList":[]}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{r as e,c as i,h as t,H as r}from"./p-b9654a5e.js";import{VerdocsEndpoint as o,getEnvelope as s,getInPersonLink as n,formatFullName as l}from"@verdocs/js-sdk";import{V as c}from"./p-04c07b7b.js";import{S as a}from"./p-fd97809c.js";import{S as d}from"./p-d4be87ef.js";const p='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-envelope-recipient-link{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:100000;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-family:"Inter", "Barlow", sans-serif;background-color:rgba(0, 0, 0, 0.4980392157)}verdocs-envelope-recipient-link .summary-content{width:600px;display:-ms-flexbox;display:flex;max-width:90%;font-size:18px;-ms-flex:0 0 600px;flex:0 0 600px;border-radius:6px;background:#ffffff;-ms-flex-direction:column;flex-direction:column;padding:30px 20px 20px}verdocs-envelope-recipient-link .summary-content .summary-title{font-size:20px;font-weight:700;margin:0 0 10px 0;color:#33364b}verdocs-envelope-recipient-link .summary-recipient{display:-ms-flexbox;display:flex;color:#33364b;margin:8px 0 24px 0;-ms-flex-direction:column;flex-direction:column}verdocs-envelope-recipient-link .summary-recipient .role-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;margin:0 0 8px 0;color:#092c4c}verdocs-envelope-recipient-link .summary-recipient .role-info{gap:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end}verdocs-envelope-recipient-link .summary-recipient .role-full-name{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:rgb(249, 250, 251)}verdocs-envelope-recipient-link .summary-recipient .recipient-link{width:120px;padding:0 16px;font-weight:500;margin:0 0 0 8px;text-align:center;font-size:0.875rem;border-radius:100%;color:rgb(55, 65, 81);line-height:1.25rem;background-color:#d8d8d8;border:2px solid rgb(156, 163, 175)}verdocs-envelope-recipient-link .summary-recipient .link-wrapper{gap:5px;display:-ms-flexbox;display:flex;margin:4px 0 0 0;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-recipient-link .summary-recipient .link-wrapper .link{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;overflow:hidden;margin:0 6px 0 0;border-radius:4px;white-space:nowrap;-ms-flex-align:center;align-items:center;text-overflow:ellipsis;border:1px solid #cccccc;background:rgb(249, 250, 251)}verdocs-envelope-recipient-link .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:10px 0 0 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-envelope-recipient-link .buttons verdocs-button{-ms-flex:0 0 120px;flex:0 0 120px;margin-left:10px;white-space:nowrap}verdocs-envelope-recipient-link .buttons verdocs-button button{width:100%}';const h=p;const b=class{constructor(t){e(this,t);this.next=i(this,"next",7);this.sdkError=i(this,"sdkError",7);this.envelopeListenerId=null;this.endpoint=o.getDefault();this.envelopeId="";this.roleName="";this.isOpen=undefined;this.gettingLink=true;this.link="";this.loading=true;this.envelope=null;this.recipient=null}async componentWillLoad(){var e,i,t;try{this.endpoint.loadSession();if(!this.envelopeId){console.log(`[RECIPIENT_LINK] Missing required envelope ID ${this.envelopeId}`);return}if(!this.endpoint.session){console.log("[RECIPIENT_LINK] Unable to start session, must be authenticated");return}this.listenToEnvelope()}catch(r){console.log("[RECIPIENT_LINK] Error loading envelope",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new a(r.message,(i=r.response)===null||i===void 0?void 0:i.status,(t=r.response)===null||t===void 0?void 0:t.data))}}disconnectedCallback(){this.unlistenToEnvelope()}async listenToEnvelope(){console.log("[SIDEBAR] Loading envelope",this.envelopeId);this.unlistenToEnvelope();d.subscribe("envelopes",this.envelopeId,(()=>s(this.endpoint,this.envelopeId)),false,(e=>{var i;this.envelope=e;this.loading=false;this.recipient=(((i=this.envelope)===null||i===void 0?void 0:i.recipients)||[]).find((e=>e.role_name===this.roleName));this.getLink(this.recipient)}))}unlistenToEnvelope(){if(this.envelopeListenerId){d.store.delListener(this.envelopeListenerId);this.envelopeListenerId=null}}handleDone(e){var i;e.preventDefault();(i=this.next)===null||i===void 0?void 0:i.emit({envelope:this.envelope})}copyLink(e){navigator.clipboard.writeText(e).then((()=>c("Link copied to clipboard!",{style:"success",duration:3e3}))).catch((e=>{console.warn("[RECIPIENT_LINK] Error copying to clipboard",e);c(`Unable to copy to clipboard: ${e.message}`,{style:"error"})}))}getLink(e){this.gettingLink=true;n(this.endpoint,e.envelope_id,e.role_name).then((e=>{this.gettingLink=false;this.link=e.link})).catch((e=>{this.gettingLink=false;console.log("[RECIPIENT_LINK] Error getting link",e);c("Unable to get link: "+e.message,{style:"error"})}))}render(){if(this.loading||!this.recipient){return t(r,null)}const e=l(this.recipient);return t(r,null,t("div",{class:"summary-content"},t("h1",{class:"summary-title"},"In-Person Signing Link"),t("div",{class:"summary-rows"},t("div",{class:"summary-recipient"},t("div",{class:"role-name"},this.recipient.role_name),t("div",{class:"role-details"},t("div",{class:"role-info"},t("div",{class:"role-full-name"},e," (",this.recipient.email||this.recipient.phone,")"),!this.link&&t("verdocs-button",{size:"small",variant:"outline",label:this.gettingLink?"Loading...":"Get Link",disabled:this.gettingLink,onClick:()=>this.getLink(this.recipient)})),this.link&&t("div",{class:"link-wrapper"},t("div",{class:"link"},this.link),t("verdocs-button",{size:"small",variant:"outline",label:"Copy",onClick:()=>this.copyLink(this.link)}))))),t("div",{class:"buttons"},t("verdocs-button",{size:"small",label:"Done",onClick:e=>this.handleDone(e)}))))}};b.style=h;const f='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-switch{font-family:"Inter", "Barlow", sans-serif}verdocs-switch .switch{display:-ms-inline-flexbox;display:inline-flex;height:24px;width:44px;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:12px;border:transparent;-webkit-transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:150ms;transition-duration:150ms}verdocs-switch .switch.primary[data-state=checked]{background:#55bc81}verdocs-switch .switch.primary[data-state=unchecked]{background:#e3e3e3}verdocs-switch .switch.secondary[data-state=checked]{background:#4c56cb}verdocs-switch .switch.secondary[data-state=unchecked]{background:#e3e3e3}verdocs-switch .slider{display:block;width:20px;height:20px;border-radius:20px;background:#ffffff;-webkit-box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:150ms;transition-duration:150ms}verdocs-switch .slider[data-state=checked]{-webkit-transform:translateX(22px);transform:translateX(22px)}verdocs-switch .slider[data-state=unchecked]{-webkit-transform:translateX(2px);transform:translateX(2px)}verdocs-switch .switch.disabled.primary,verdocs-switch .switch.disabled.secondary{cursor:not-allowed;background:#666666}';const x=f;const m=class{constructor(t){e(this,t);this.checkedChange=i(this,"checkedChange",7);this.checked=false;this.theme="primary";this.disabled=false}render(){return t("button",{key:"e9153549bcee6b924ce7a7d620d1096fa91782d2",value:"on",type:"button",role:"switch",class:`switch ${this.theme} ${this.disabled?"disabled":""}`,"data-state":this.checked?"checked":"unchecked","aria-checked":this.checked?"checked":"unchecked",onClick:()=>{var e;if(!this.disabled){this.checked=!this.checked;(e=this.checkedChange)===null||e===void 0?void 0:e.emit(this.checked)}}},t("span",{key:"61d97d7571b7f52f186ce44daaf0ef7132c6d5f6","data-state":this.checked?"checked":"unchecked",class:"slider"}))}};m.style=x;export{b as verdocs_envelope_recipient_link,m as verdocs_switch};
|
2
|
-
//# sourceMappingURL=p-b9fee1a7.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["verdocsEnvelopeRecipientLinkCss","VerdocsEnvelopeRecipientLinkStyle0","VerdocsEnvelopeRecipientLink","this","envelopeListenerId","VerdocsEndpoint","getDefault","componentWillLoad","endpoint","loadSession","envelopeId","console","log","session","listenToEnvelope","e","_a","sdkError","emit","SDKError","message","_b","response","status","_c","data","disconnectedCallback","unlistenToEnvelope","Store","subscribe","getEnvelope","envelope","loading","recipient","recipients","find","r","role_name","roleName","getLink","store","delListener","handleDone","preventDefault","next","copyLink","link","navigator","clipboard","writeText","then","VerdocsToast","style","duration","catch","warn","gettingLink","getInPersonLink","envelope_id","render","h","Host","fullName","formatFullName","class","email","phone","size","variant","label","disabled","onClick","verdocsSwitchCss","VerdocsSwitchStyle0","VerdocsSwitch","key","value","type","role","theme","checked","checkedChange"],"sources":["src/components/envelopes/verdocs-envelope-recipient-link/verdocs-envelope-recipient-link.scss?tag=verdocs-envelope-recipient-link","src/components/envelopes/verdocs-envelope-recipient-link/verdocs-envelope-recipient-link.tsx","src/components/controls/verdocs-switch/verdocs-switch.scss?tag=verdocs-switch","src/components/controls/verdocs-switch/verdocs-switch.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-envelope-recipient-link {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n z-index: 100000;\n position: fixed;\n align-items: center;\n justify-content: center;\n font-family: $primary-font;\n background-color: #0000007f;\n\n .summary-content {\n width: 600px;\n display: flex;\n max-width: 90%;\n font-size: 18px;\n flex: 0 0 600px;\n border-radius: 6px;\n background: #ffffff;\n flex-direction: column;\n padding: 30px 20px 20px;\n\n .summary-title {\n font-size: 20px;\n font-weight: 700;\n margin: 0 0 10px 0;\n color: $verdocs-dark-blue;\n }\n }\n\n .summary-recipient {\n display: flex;\n color: $verdocs-grey-1;\n margin: 8px 0 24px 0;\n flex-direction: column;\n\n .role-name {\n flex: 1;\n display: flex;\n font-size: 14px;\n font-weight: 600;\n margin: 0 0 8px 0;\n color: $verdocs-grey-0;\n }\n\n .role-details {\n }\n\n .role-info {\n gap: 5px;\n display: flex;\n flex-direction: row;\n align-items: flex-end;\n }\n\n .role-full-name {\n flex: 1;\n height: 34px;\n display: flex;\n font-size: 16px;\n padding: 0 12px;\n border-radius: 4px;\n align-items: center;\n border: 1px solid #cccccc;\n background: rgb(249, 250, 251);\n }\n\n .recipient-link {\n width: 120px;\n padding: 0 16px;\n font-weight: 500;\n margin: 0 0 0 8px;\n text-align: center;\n font-size: 0.875rem;\n border-radius: 100%;\n color: rgb(55, 65, 81);\n line-height: 1.25rem;\n background-color: #d8d8d8;\n border: 2px solid rgb(156, 163, 175);\n }\n\n .link-wrapper {\n gap: 5px;\n display: flex;\n margin: 4px 0 0 0;\n flex-direction: row;\n\n .link {\n flex: 1;\n height: 34px;\n display: flex;\n font-size: 16px;\n padding: 0 12px;\n overflow: hidden;\n margin: 0 6px 0 0;\n border-radius: 4px;\n white-space: nowrap;\n align-items: center;\n text-overflow: ellipsis;\n border: 1px solid #cccccc;\n background: rgb(249, 250, 251);\n }\n }\n }\n\n .buttons {\n display: flex;\n column-gap: 15px;\n margin: 10px 0 0 0;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n\n verdocs-button {\n flex: 0 0 120px;\n margin-left: 10px;\n white-space: nowrap;\n\n button {\n width: 100%;\n }\n }\n }\n}\n","import {Component, Prop, Host, h, State, Event, EventEmitter} from '@stencil/core';\nimport {formatFullName, getEnvelope, getInPersonLink, IEnvelope, IRecipient, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Displays a single recipient from an envelope, with the opportunity to copy an in-person\n * signing link for that recipient to use.\n */\n@Component({\n tag: 'verdocs-envelope-recipient-link',\n styleUrl: 'verdocs-envelope-recipient-link.scss',\n})\nexport class VerdocsEnvelopeRecipientLink {\n private envelopeListenerId = null;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The envelope ID to edit.\n */\n @Prop() envelopeId: string = '';\n\n /**\n * The role to load.\n */\n @Prop() roleName: string = '';\n\n /**\n * Event fired when the user clicks Done to proceed. It is up to the host application\n * to redirect the user to the appropriate next workflow step.\n */\n @Event({composed: true}) next: EventEmitter<{envelope: IEnvelope}>;\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() isOpen: boolean;\n @State() gettingLink = true;\n @State() link = '';\n\n @State() loading = true;\n @State() envelope: IEnvelope | null = null;\n @State() recipient: IRecipient | null = null;\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.envelopeId) {\n console.log(`[RECIPIENT_LINK] Missing required envelope ID ${this.envelopeId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[RECIPIENT_LINK] Unable to start session, must be authenticated');\n return;\n }\n\n this.listenToEnvelope();\n } catch (e) {\n console.log('[RECIPIENT_LINK] Error loading envelope', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n disconnectedCallback() {\n this.unlistenToEnvelope();\n }\n\n async listenToEnvelope() {\n console.log('[SIDEBAR] Loading envelope', this.envelopeId);\n this.unlistenToEnvelope();\n Store.subscribe(\n 'envelopes',\n this.envelopeId,\n () => getEnvelope(this.endpoint, this.envelopeId),\n false,\n (envelope: IEnvelope) => {\n this.envelope = envelope;\n this.loading = false;\n\n this.recipient = (this.envelope?.recipients || []).find(r => r.role_name === this.roleName);\n this.getLink(this.recipient);\n },\n );\n }\n\n unlistenToEnvelope() {\n if (this.envelopeListenerId) {\n Store.store.delListener(this.envelopeListenerId);\n this.envelopeListenerId = null;\n }\n }\n\n handleDone(e: any) {\n e.preventDefault();\n this.next?.emit({envelope: this.envelope});\n }\n\n copyLink(link: string) {\n navigator.clipboard\n .writeText(link)\n .then(() => VerdocsToast('Link copied to clipboard!', {style: 'success', duration: 3000}))\n .catch(e => {\n console.warn('[RECIPIENT_LINK] Error copying to clipboard', e);\n VerdocsToast(`Unable to copy to clipboard: ${e.message}`, {style: 'error'});\n });\n }\n\n getLink(recipient: IRecipient) {\n this.gettingLink = true;\n getInPersonLink(this.endpoint, recipient.envelope_id, recipient.role_name)\n .then(response => {\n this.gettingLink = false;\n this.link = response.link;\n // NOTE: Left here for documentation purposes. We don't auto-copy the link because many browsers now\n // error on that because we aren't the focus/gesture-initiator since we're a new component just being\n // drawn in the DOM. So we let the user click to trigger that.\n // this.copyLink(response.link);\n })\n .catch(e => {\n this.gettingLink = false;\n console.log('[RECIPIENT_LINK] Error getting link', e);\n VerdocsToast('Unable to get link: ' + e.message, {style: 'error'});\n });\n }\n\n render() {\n if (this.loading || !this.recipient) {\n return <Host />;\n }\n\n // const recipientsWithActions = getRecipientsWithActions(this.store.state); const showLinkButton = recipientCanAct(recipient, recipientsWithActions); const link =\n // this.links[recipient.role_name]; const gettingLink = this.gettingLinks[recipient.role_name]; return (\n\n const fullName = formatFullName(this.recipient);\n return (\n <Host>\n <div class=\"summary-content\">\n <h1 class=\"summary-title\">In-Person Signing Link</h1>\n <div class=\"summary-rows\">\n <div class=\"summary-recipient\">\n <div class=\"role-name\">{this.recipient.role_name}</div>\n <div class=\"role-details\">\n <div class=\"role-info\">\n <div class=\"role-full-name\">\n {fullName} ({this.recipient.email || this.recipient.phone})\n </div>\n {!this.link && (\n <verdocs-button\n size=\"small\"\n variant=\"outline\"\n label={this.gettingLink ? 'Loading...' : 'Get Link'}\n disabled={this.gettingLink}\n onClick={() => this.getLink(this.recipient)}\n />\n )}\n </div>\n\n {this.link && (\n <div class=\"link-wrapper\">\n <div class=\"link\">{this.link}</div>\n <verdocs-button size=\"small\" variant=\"outline\" label=\"Copy\" onClick={() => this.copyLink(this.link)} />\n </div>\n )}\n </div>\n </div>\n </div>\n\n <div class=\"buttons\">\n <verdocs-button size=\"small\" label=\"Done\" onClick={e => this.handleDone(e)} />\n </div>\n </div>\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-switch {\n font-family: $primary-font;\n\n .switch {\n display: inline-flex;\n height: 24px;\n width: 44px;\n flex-shrink: 0;\n align-items: center;\n cursor: pointer;\n border-radius: 12px;\n border: transparent;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n }\n\n .switch.primary[data-state='checked'] {\n background: $primary-color;\n }\n\n .switch.primary[data-state='unchecked'] {\n background: $extra-light-border-color;\n }\n\n .switch.secondary[data-state='checked'] {\n background: $secondary-color;\n }\n\n .switch.secondary[data-state='unchecked'] {\n background: $extra-light-border-color;\n }\n\n .slider {\n display: block;\n width: 20px;\n height: 20px;\n border-radius: 20px;\n background: #ffffff;\n box-shadow:\n 0 10px 15px -3px rgb(0 0 0 / 0.1),\n 0 4px 6px -4px rgb(0 0 0 / 0.1);\n transition-property: transform;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n }\n\n .slider[data-state='checked'] {\n transform: translateX(22px);\n }\n\n .slider[data-state='unchecked'] {\n transform: translateX(2px);\n }\n\n .switch.disabled.primary,\n .switch.disabled.secondary {\n cursor: not-allowed;\n background: $dark-disabled-color;\n }\n}\n","import {Component, Prop, h, EventEmitter, Event} from '@stencil/core';\n\n/**\n * Displays a toggle switch.\n *\n * ```ts\n * <verdocs-switch checked={sendReminders} onCheckedChange={setSendReminders} />\n * ```\n */\n@Component({\n tag: 'verdocs-switch',\n styleUrl: 'verdocs-switch.scss',\n})\nexport class VerdocsSwitch {\n @Prop({mutable: true}) checked: boolean = false;\n\n /**\n * Select purple or green treatments.\n */\n @Prop() theme: 'primary' | 'secondary' = 'primary';\n\n /**\n * Should the field be disabled?\n */\n @Prop() disabled: boolean = false;\n\n @Event({composed: true}) checkedChange: EventEmitter<boolean>;\n\n render() {\n return (\n <button\n value=\"on\"\n type=\"button\"\n role=\"switch\"\n class={`switch ${this.theme} ${this.disabled ? 'disabled' : ''}`}\n data-state={this.checked ? 'checked' : 'unchecked'}\n aria-checked={this.checked ? 'checked' : 'unchecked'}\n onClick={() => {\n if (!this.disabled) {\n this.checked = !this.checked;\n this.checkedChange?.emit(this.checked);\n }\n }}\n >\n <span data-state={this.checked ? 'checked' : 'unchecked'} class=\"slider\"></span>\n </button>\n );\n }\n}\n"],"mappings":"iRAAA,MAAMA,EAAkC,ghGACxC,MAAAC,EAAeD,E,MCaFE,EAA4B,M,uFAC/BC,KAAAC,mBAAqB,K,cAKOC,EAAgBC,a,gBAKvB,G,cAKF,G,uCAeJ,K,UACP,G,aAEG,K,cACmB,K,eACE,I,CAExC,uBAAMC,G,UACJ,IACEJ,KAAKK,SAASC,cAEd,IAAKN,KAAKO,WAAY,CACpBC,QAAQC,IAAI,iDAAiDT,KAAKO,cAClE,M,CAGF,IAAKP,KAAKK,SAASK,QAAS,CAC1BF,QAAQC,IAAI,mEACZ,M,CAGFT,KAAKW,kB,CACL,MAAOC,GACPJ,QAAQC,IAAI,0CAA2CG,IACvDC,EAAAb,KAAKc,YAAQ,MAAAD,SAAA,SAAAA,EAAEE,KAAK,IAAIC,EAASJ,EAAEK,SAASC,EAAAN,EAAEO,YAAQ,MAAAD,SAAA,SAAAA,EAAEE,QAAQC,EAAAT,EAAEO,YAAQ,MAAAE,SAAA,SAAAA,EAAEC,M,EAIhF,oBAAAC,GACEvB,KAAKwB,oB,CAGP,sBAAMb,GACJH,QAAQC,IAAI,6BAA8BT,KAAKO,YAC/CP,KAAKwB,qBACLC,EAAMC,UACJ,YACA1B,KAAKO,YACL,IAAMoB,EAAY3B,KAAKK,SAAUL,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AAM,W","ignoreList":[]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["verdocsBuildCss","VerdocsBuildStyle0","VerdocsBuild","exports","this","templateListenerId","VerdocsEndpoint","getDefault","class_1","prototype","onTemplateIdChanged","newTemplateId","oldTemplateId","step","loadTemplate","catch","e","console","log","onStepChanged","templateId","componentWillLoad","endpoint","loadSession","session","_a","sdkError","emit","SDKError","message","_b","response","status","_c","data","_d","_e","_f","Store","subscribe","getTemplate","_this","template","loading","disconnectedCallback","unlistenToTemplate","store","delListener","handleCancel","handleTemplateCreated","_g","sent","stepChanged","handleRolesUpdated","templateUpdated","detail","handleTemplateUpdated","handleAttachmentsNext","handleRolesNext","handleStepChanged","render","h","Host","class","onSdkError","onExit","onNext","onTemplateUpdated","onRolesUpdated","style","flexDirection","gap","display","maxWidth","margin","backgroundColor","padding","onSend","send","width","flex"],"sources":["src/components/embeds/verdocs-build/verdocs-build.scss?tag=verdocs-build","src/components/embeds/verdocs-build/verdocs-build.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-build {\n display: flex;\n flex-direction: column;\n font-family: $verdocs-primary-font;\n\n .content {\n flex: 1;\n gap: 20px;\n display: flex;\n align-items: center;\n flex-direction: column;\n //box-shadow: 0 0 7px -3px #000000cc;\n }\n\n verdocs-template-attachments,\n verdocs-template-roles {\n margin: 20px;\n }\n\n verdocs-template-fields {\n border-top: 1px solid #777777;\n }\n\n verdocs-template-attachments {\n padding: 20px;\n background: #ffffff;\n }\n\n verdocs-template-fields {\n width: 100%;\n }\n\n verdocs-preview {\n flex: 1;\n }\n\n .preview-container {\n flex-direction: row;\n display: flex;\n width: 100%;\n background-color: #eeeeee;\n max-height: 100%;\n\n @media all and (max-width: 450px) {\n flex-direction: column;\n }\n }\n\n .preview-send-wrapper {\n display: flex;\n flex: 0 0 300px;\n background-color: #ffffff;\n box-shadow: 1px 1px 6px -2px #0000007f;\n\n @media all and (max-width: 450px) {\n flex: 0;\n }\n }\n\n .preview-preview-wrapper {\n display: flex;\n flex: 1;\n justify-content: center;\n overflow-y: scroll;\n }\n}\n","import {getTemplate, ICreateEnvelopeRecipient, IRole, ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, Prop, h, Element, Event, EventEmitter, Host, Watch, State} from '@stencil/core';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nexport type TVerdocsBuildStep = 'attachments' | 'roles' | 'settings' | 'fields' | 'preview';\n\n/**\n * Display a template building experience. Several event callbacks provide status updates to the\n * parent application to support interface updates.\n *\n * ```ts\n * <verdocs-build templateId={templateId} step=\"preview\" onSend={(detail) => {\n * console.log('Sent envelope from template', detail);\n * }} />\n * ```\n */\n@Component({\n tag: 'verdocs-build',\n styleUrl: 'verdocs-build.scss',\n shadow: false,\n})\nexport class VerdocsBuild {\n private templateListenerId = null;\n\n @Element() el!: any;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The ID of the template to create the document from. Unlike most other components, this is an optional parameter here.\n * If the template ID is known, `step` may also be specified to force displaying a specific step in the creation process.\n * If it is not specified, `step` will be ignored and the create step will be shown.\n */\n @Prop({reflect: true, mutable: true}) templateId: string | null = null;\n\n /**\n * The step in the creation process to display.\n */\n @Prop({reflect: true, mutable: true}) step: TVerdocsBuildStep = 'preview';\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 selects a different step.\n */\n @Event({composed: true}) stepChanged: EventEmitter<TVerdocsBuildStep>;\n\n /**\n * The user completed the Send form and clicked send.\n */\n @Event({composed: true}) send: EventEmitter<{recipients: ICreateEnvelopeRecipient[]; name: string; template_id: string}>;\n\n /**\n * Event fired when the template is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) templateUpdated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: string}>;\n\n /**\n * Event fired when the template is created by the upload step.\n */\n @Event({composed: true}) templateCreated: EventEmitter<{endpoint: VerdocsEndpoint; template: ITemplate; event: string}>;\n\n /**\n * Event fired when roles are updated in the roles step.\n */\n @Event({composed: true}) rolesUpdated: EventEmitter<{endpoint: VerdocsEndpoint; templateId: string; event: 'added' | 'deleted' | 'updated'; roles: IRole[]}>;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n @Watch('templateId')\n onTemplateIdChanged(newTemplateId: string, oldTemplateId: string) {\n if (!oldTemplateId && newTemplateId && this.step === 'attachments') {\n this.step = 'preview';\n }\n\n this.loadTemplate(newTemplateId).catch((e: any) => console.log('Unknown Error', e));\n }\n\n @Watch('step')\n onStepChanged() {\n // We reload the template here even if only the step changed in case\n // we were out of sync before\n this.loadTemplate(this.templateId).catch((e: any) => console.log('Unknown Error', e));\n }\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n if (!this.endpoint.session) {\n console.log('[BUILD] Unable to start builder session, must be authenticated');\n return;\n }\n\n if (!this.templateId) {\n console.log(`[BUILD] No template ID, activating upload mode`);\n this.step = 'attachments';\n return;\n }\n\n try {\n this.loadTemplate(this.templateId).catch(e => console.log('[BUILD] Unable to load template', e));\n } catch (e) {\n console.log('[BUILD] Error loading template', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n } catch (e) {\n console.log('[BUILD] Error with builder session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n async loadTemplate(templateId: string) {\n if (templateId) {\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n }\n\n disconnectedCallback() {\n console.log('[BUILD] Disconnected');\n this.unlistenToTemplate();\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n handleCancel() {\n this.step = 'preview';\n }\n\n async handleTemplateCreated(templateId: string) {\n await this.loadTemplate(templateId);\n this.templateId = templateId;\n this.step = 'roles';\n this.stepChanged?.emit('roles');\n }\n\n async handleRolesUpdated(e: any) {\n this.templateUpdated?.emit(e.detail);\n }\n\n async handleTemplateUpdated(e: any) {\n this.templateUpdated?.emit(e.detail);\n }\n\n handleAttachmentsNext() {\n this.step = 'roles';\n this.stepChanged?.emit('roles');\n }\n\n handleRolesNext() {\n this.step = 'fields';\n this.stepChanged?.emit('fields');\n }\n\n handleStepChanged(step: TVerdocsBuildStep) {\n this.step = step;\n this.stepChanged?.emit(step);\n }\n\n render() {\n if (this.loading) {\n return (\n <Host class=\"loading\">\n <verdocs-loader />\n </Host>\n );\n }\n\n if (!this.endpoint.session) {\n return (\n <Host>\n <verdocs-component-error message=\"You must be authenticated to use this module.\" />\n </Host>\n );\n }\n\n return (\n <Host>\n <div class=\"content\">\n <verdocs-template-build-tabs\n endpoint={this.endpoint}\n templateId={this.templateId}\n step={this.step}\n onSdkError={e => this.sdkError?.emit(e.detail)}\n onStepChanged={e => this.handleStepChanged(e.detail)}\n />\n\n {this.step === 'attachments' && (\n <verdocs-template-attachments\n templateId={this.templateId}\n endpoint={this.endpoint}\n onExit={() => this.handleCancel()}\n onNext={() => this.handleAttachmentsNext()}\n onTemplateUpdated={e => this.handleTemplateUpdated(e)}\n />\n )}\n\n {this.step === 'roles' && (\n <verdocs-template-roles\n templateId={this.templateId}\n endpoint={this.endpoint}\n onExit={() => this.handleCancel()}\n onNext={() => this.handleRolesNext()}\n onRolesUpdated={e => this.handleRolesUpdated(e)}\n />\n )}\n\n {this.step === 'settings' && (\n <div style={{flexDirection: 'column', gap: '20px', display: 'flex', maxWidth: '400px', margin: '20px'}}>\n <verdocs-template-name\n templateId={this.templateId}\n endpoint={this.endpoint}\n style={{backgroundColor: '#ffffff', padding: '20px'}}\n onTemplateUpdated={e => this.handleTemplateUpdated(e)}\n />\n <verdocs-template-reminders\n templateId={this.templateId}\n endpoint={this.endpoint}\n style={{backgroundColor: '#ffffff', padding: '20px'}}\n onTemplateUpdated={e => this.handleTemplateUpdated(e)}\n />\n <verdocs-template-visibility\n templateId={this.templateId}\n endpoint={this.endpoint}\n style={{backgroundColor: '#ffffff', padding: '20px'}}\n onTemplateUpdated={e => this.handleTemplateUpdated(e)}\n />\n </div>\n )}\n\n {this.step === 'fields' && <verdocs-template-fields templateId={this.templateId} endpoint={this.endpoint} onTemplateUpdated={e => this.handleTemplateUpdated(e)} />}\n\n {this.step === 'preview' && (\n <div class=\"preview-container\">\n <div class=\"preview-send-wrapper\">\n <verdocs-send templateId={this.templateId} endpoint={this.endpoint} onSend={e => this.send?.emit(e.detail)} style={{width: '100%'}} />\n </div>\n <div class=\"preview-preview-wrapper\">\n <verdocs-preview templateId={this.templateId} endpoint={this.endpoint} style={{display: 'flex', flex: '1', maxWidth: '1000px'}} />\n </div>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"mxDAAA,IAAMA,EAAkB,quDACxB,IAAAC,EAAeD,E,ICqBFE,EAAYC,EAAA,2B,4QACfC,KAAAC,mBAAqB,K,cAOOC,EAAgBC,a,gBAOc,K,UAKF,U,aAiC7C,K,cACmB,I,CAGtCC,EAAAC,UAAAC,oBAAA,SAAoBC,EAAuBC,GACzC,IAAKA,GAAiBD,GAAiBP,KAAKS,OAAS,cAAe,CAClET,KAAKS,KAAO,S,CAGdT,KAAKU,aAAaH,GAAeI,OAAM,SAACC,GAAW,OAAAC,QAAQC,IAAI,gBAAiBF,EAA7B,G,EAIrDR,EAAAC,UAAAU,cAAA,WAGEf,KAAKU,aAAaV,KAAKgB,YAAYL,OAAM,SAACC,GAAW,OAAAC,QAAQC,IAAI,gBAAiBF,EAA7B,G,EAGjDR,EAAAC,UAAAY,kBAAN,W,qGACE,IACEjB,KAAKkB,SAASC,cACd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AAYgD,EAAA,2BAAyBzC,WAAYhB,KAAKgB,WAAYE,SAAUlB,KAAKkB,SAAU6C,kBAAmB,SAAAnD,GAAK,OAAAyB,EAAKe,sBAAsBxC,EAA3B,IAEjIZ,KAAKS,OAAS,WACbgD,EAAA,OAAKE,MAAM,qBACTF,EAAA,OAAKE,MAAM,wBACTF,EAAA,gBAAczC,WAAYhB,KAAKgB,WAAYE,SAAUlB,KAAKkB,SAAUuD,OAAQ,SAAA7D,GAAC,IAAAS,EAAI,OAAAA,EAAAgB,EAAKqC,QAAI,MAAArD,SAAA,SAAAA,EAAEE,KAAKX,EAAEuC,OAAO,EAAEc,MAAO,CAACU,MAAO,WAE7HlB,EAAA,OAAKE,MAAM,2BACTF,EAAA,mBAAiBzC,WAAYhB,KAAKgB,WAAYE,SAAUlB,KAAKkB,SAAU+C,MAAO,CAACG,QAAS,OAAQQ,KAAM,IAAKP,SAAU,e,kRA9O5G,I","ignoreList":[]}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
import{r as e,c as t,h as o,F as s,H as i}from"./p-b9654a5e.js";import{VerdocsEndpoint as a,formatFullName as c,isValidEmail as d}from"@verdocs/js-sdk";import{h as r}from"./p-0c45b79c.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";import"./p-12bab948.js";const l='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{gap:12px;width:300px;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5fa}verdocs-contact-picker form .row{gap:8px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-contact-picker form .row.message{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}verdocs-contact-picker form .names-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .names-row>input{font-size:14px;width:103px}verdocs-contact-picker form .kba-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .kba-row verdocs-select-input{margin:0}verdocs-contact-picker form .pin-code{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .pin-code>input{-ms-flex:0;flex:0;width:133px;font-size:14px;margin-left:58px}verdocs-contact-picker form .address{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .address>input{-ms-flex:1;flex:1;font-size:14px;margin-left:58px}verdocs-contact-picker form .zip-code{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .zip-code>input{-ms-flex:1;flex:1;font-size:14px;margin-left:58px}verdocs-contact-picker form label{display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;font-size:14px;font-weight:500;color:#5c6575}verdocs-contact-picker form .row.message label{-ms-flex:0;flex:0}verdocs-contact-picker form .row.message input{width:100%}verdocs-contact-picker form input{-ms-flex:1;flex:1;padding:6px;font-size:14px;border-radius:3px;background:rgba(0, 0, 0, 0.0196078431);border:1px solid rgba(112, 122, 229, 0.3725490196)}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;max-height:225px;overflow-y:scroll;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{width:32px;height:32px}verdocs-contact-picker form .dropdown .suggestion .avatar{width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}';const n=l;const f='<svg focusable="false" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';const p='<svg focusable="false" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z" clip-rule="evenodd" /></svg>';const h=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-user"><path d="M15 13a3 3 0 1 0-6 0"/><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"/><circle cx="12" cy="8" r="2"/></svg>`;const b=class{constructor(o){e(this,o);this.searchContacts=t(this,"searchContacts",7);this.exit=t(this,"exit",7);this.next=t(this,"next",7);this.endpoint=a.getDefault();this.templateRole=null;this.contactSuggestions=[];this.first_name=undefined;this.last_name=undefined;this.email=undefined;this.phone=undefined;this.zip=undefined;this.address=undefined;this.message=undefined;this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.showKba=false;this.kba_method="";this.kba_pin="";this.nameFieldId=`verdocs-contact-picker-name-${Math.random().toString(36).substring(2,11)}`;this.firstNameFieldId=`verdocs-contact-picker-firstname-${Math.random().toString(36).substring(2,11)}`;this.lastNameFieldId=`verdocs-contact-picker-lastname-${Math.random().toString(36).substring(2,11)}`;this.emailFieldId=`verdocs-contact-picker-email-${Math.random().toString(36).substring(2,11)}`;this.phoneFieldId=`verdocs-contact-picker-phone-${Math.random().toString(36).substring(2,11)}`}componentWillLoad(){if(this.templateRole){const e=c(this.templateRole);const t=e.split(" ");const o=this.templateRole.first_name||t.shift()||"";const s=this.templateRole.last_name||t.join(" ")||"";this.first_name=o;this.last_name=s;this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.message=this.templateRole.message||"";this.showMessage=this.message!=="";this.kba_method=this.templateRole.kba_method||"";this.kba_pin=this.templateRole.kba_pin||"";this.showKba=!!this.kba_method}}handleFirstNameChange(e){var t;this.first_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.first_name})}handleLastNameChange(e){var t;this.last_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.last_name})}handleCancel(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.exit)===null||t===void 0?void 0:t.emit()}handleSubmit(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.next)===null||t===void 0?void 0:t.emit({first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator,kba_method:this.kba_method,kba_pin:this.kba_pin,address:this.address,zip:this.zip})}handleSelectSuggestion(e,t){e.stopPropagation();this.first_name=t.first_name;this.last_name=t.last_name;this.email=t.email;this.phone=t.phone;this.showSuggestions=false}render(){const e=this.first_name&&this.last_name&&d(this.email);const t=!this.kba_method||this.kba_method==="pin"&&this.kba_pin||this.kba_method==="identity";const i=e&&t;return o("form",{key:"2ce99d1c3ae979f25dde56e4a9dc7ec56cec2542",onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},o("div",{key:"6257ebf610c9ea9a8f6238311ad1b4ed0095e498",class:"row"},o("label",{key:"c36d51599847033b0c096c9d5de7d8af49e05c7d",htmlFor:this.nameFieldId},"Name:"),o("div",{key:"23cdb2afffff2ede3429c8591093eb89ca89d4b6",class:"names-row"},o("input",{key:"d281392383863edbcfc14440e18631b97962ea2f",id:this.firstNameFieldId,name:this.firstNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.first_name,placeholder:"First...",onFocus:()=>{var e;return this.showSuggestions=((e=this.contactSuggestions)===null||e===void 0?void 0:e.length)>0},onInput:e=>this.handleFirstNameChange(e)}),o("input",{key:"eea0626eb854ae95c32ad7e98d479a614e7df81c",id:this.lastNameFieldId,name:this.lastNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.last_name,placeholder:"Last...",onFocus:()=>this.showSuggestions=false,onInput:e=>this.handleLastNameChange(e)})),this.showSuggestions&&o("div",{key:"2e3fc57f42e3281b83b03e53b92c07243dcff544",class:"dropdown"},this.contactSuggestions.filter((e=>!this.first_name||e.first_name.toLowerCase().includes(this.first_name.toLowerCase()))).map((e=>{var t;return o("div",{key:(t=e.id)!==null&&t!==void 0?t:e.email,class:"suggestion",onClick:t=>this.handleSelectSuggestion(t,e)},e.picture?o("img",{alt:"Avatar",class:"avatar",src:e.picture}):o("div",{class:"avatar",innerHTML:h}),o("div",{class:"details"},o("div",{class:"name"},c(e)),e.email&&o("div",{class:"destination"},e.email),e.phone&&o("div",{class:"destination"},e.phone)))})))),o("div",{key:"f18fd6d889ea70f8a5e51bd1780007b3ff061b56",class:"row"},o("label",{key:"5cda3922bb705ed0d3af00644df9ef8d42042021",htmlFor:this.emailFieldId},"Email:"),o("input",{key:"34474c4c8bbbde2802b3c2f58ea3abed4b3e27f6",id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.email,placeholder:"Email address...",onFocus:()=>this.showSuggestions=false,onInput:e=>this.email=e.target.value})),o("div",{key:"c757b186ca60272855ed5701c59857856dcd863f",class:"row"},o("label",{key:"1d971705ab36609db6a4e9cb7d24281d98441cd5",htmlFor:this.phoneFieldId},"Phone:"),o("input",{key:"2a516e28498a6727409ef51e61ca3fe912c65789",id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.phone,placeholder:"Phone (SMS)...",onFocus:()=>this.showSuggestions=false,onInput:e=>{this.phone=r(e.target.value)}})),this.showKba&&o(s,{key:"05cdb2c78abc3156d04a012c40a52f2c6ab24a86"},o("div",{key:"56d53a04ba6ab45ecc30f11e44669ad503400a49",class:"kba-row"},o("label",{key:"8af91071db065071bb40e931ea92231f31e9c0c9"},"KBA:"),o("verdocs-select-input",{key:"3f2eec31ee0078779eeed5d3f2fbd222fcdbaa42",value:this.kba_method,onInput:e=>{this.kba_method=e.target.value;this.zip="";this.address="";this.kba_pin=""},options:[{label:"None",value:""},{label:"PIN Code",value:"pin"},{label:"Full Verification",value:"identity"}]}),o("div",{key:"33e9efc07399e6930264b4b79f73a5497728c7c7",style:{flex:"1"}}),o("verdocs-help-icon",{key:"bc5ec8ad3fcf22a4f9a0f4659b574e238526574a",text:"Knowledge-Based Authentication adds additional authentication for this user either via a simple PIN code or full address validation. NOTE: There may be a fee for using this feature."})),this.kba_method==="pin"&&o("div",{key:"cd07404e1e9cd0a344c0975bdd23b2374d97ad61",class:"row pin-code"},o("input",{key:"92909cedb50e11bffe60dcd032b2d8c3dd901834",id:"verdocs-pin-code",name:"verdocs-pin-code",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.kba_pin,placeholder:"PIN Code...",onFocus:()=>this.showSuggestions=false,onInput:e=>this.kba_pin=e.target.value})),this.kba_method==="identity"&&o("div",{key:"6ad1983ac8f9394bb9f35a8a9bba2f16d48d7bcd",class:"row address"},o("input",{key:"d598a1fb52b77eb85f17bda65f1730900d1d94e5",id:"verdocs-address",name:"verdocs-address",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.address,placeholder:"Address...",onFocus:()=>this.showSuggestions=false,onInput:e=>this.address=e.target.value}),o("verdocs-help-icon",{key:"09d3cfa8e92c6c59cda2cff599ae474296de35a0",text:"Pre-fill the recipient's current street address. They will still be asked ID challenge questions."})),this.kba_method==="identity"&&o("div",{key:"1ccb3caa35f5474f40245ca1fe9c11aa175b4cc2",class:"row zip-code"},o("input",{key:"e967aba3ffac6e25f359c56c0bd5cd057394ad82",id:"verdocs-zip-code",name:"verdocs-zip-code",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.zip,placeholder:"Zip Code...",onFocus:()=>this.showSuggestions=false,onInput:e=>this.zip=e.target.value}),o("verdocs-help-icon",{key:"b4075b320d84028e8717e8383113751155a6aebf",text:"Pre-fill the recipient's current zip code. They will still be asked ID challenge questions."}))),this.showMessage&&o("div",{key:"8212baa1274eb1dd98deeec972afeeb5bfb3c400",class:"row message"},o("label",{key:"1b1c58c77ebd0dfd1e193e68a9bf472d93b8914f",htmlFor:"verdocs-contact-picker-message"},"Message:"),o("input",{key:"d5525496367b3fa0bde52a91bad7f68964454a3c",id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.message,placeholder:"Message shown in invitation...",onFocus:()=>this.showSuggestions=false,onInput:e=>this.message=e.target.value})),o("div",{key:"c39a19e49ea3ae82ecb287bf2acb87734237fdb9",class:"buttons"},o("verdocs-toggle-button",{key:"311f86449b98cad74d5811473578ab223237d39e",icon:p,size:"small",active:this.showKba,onToggle:e=>{this.showKba=e.detail.active;if(!e.detail.active){this.kba_pin="";this.kba_method="";this.zip=""}this.showSuggestions=false}}),o("verdocs-toggle-button",{key:"c51c8bba37758ad6ada6946d9c2df9880204b1be",icon:f,size:"small",active:this.showMessage,onToggle:e=>{this.showMessage=e.detail.active;this.showSuggestions=false}}),o("div",{key:"747951c6d9273bf5142be1f20b6e51a2cc4239d5",class:"flex-fill"}),o("verdocs-button",{key:"12f60448cac7f6bb6804119ad620bdc77d4c0c9c",variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e)}),o("verdocs-button",{key:"507b52e7904d9e5c31e1ba40c7ffa0ccba7763f2",label:"OK",size:"small",disabled:!i,onClick:!i?()=>{}:e=>this.handleSubmit(e)})))}};b.style=n;const u='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toggle-button{font-family:"Inter", "Barlow", sans-serif}verdocs-toggle-button button{border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#cccccc;color:#33364b}verdocs-toggle-button button svg{max-width:100%;max-height:100%;fill:#33364b}verdocs-toggle-button button.active{background:#55bc81;color:#f5f5fa}verdocs-toggle-button button.active svg{fill:#f5f5fa}verdocs-toggle-button button:focus{border:none;outline:none}verdocs-toggle-button.size-normal button{width:40px;height:40px;padding:6px;border-radius:4px}verdocs-toggle-button.size-small button{width:34px;height:34px;padding:4px;border-radius:2px}';const m=u;const g=class{constructor(o){e(this,o);this.toggle=t(this,"toggle",7);this.active=false;this.icon=null;this.label=null;this.size="normal";this._active=false}componentWillLoad(){this._active=this.active}handleToggle(e){var t;e.stopPropagation();const o=!this._active;this._active=o;(t=this.toggle)===null||t===void 0?void 0:t.emit({active:o})}render(){return o(i,{key:"57d988cf0335a521279382d8c91be3b7af3b1f87",class:`size-${this.size}`},this.icon?o("button",{innerHTML:this.icon,class:{active:this._active},onClick:e=>this.handleToggle(e)}):o("button",{class:{active:this._active},onClick:e=>this.handleToggle(e)},this.label))}};g.style=m;export{b as verdocs_contact_picker,g as verdocs_toggle_button};
|
2
|
-
//# sourceMappingURL=p-d58010a4.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["verdocsContactPickerCss","VerdocsContactPickerStyle0","messageIcon","kbaIcon","addrBookIcon","VerdocsContactPicker","VerdocsEndpoint","getDefault","Math","random","toString","substring","componentWillLoad","this","templateRole","fullName","formatFullName","nameComponents","split","firstName","first_name","shift","lastName","last_name","join","email","phone","delegator","message","showMessage","kba_method","kba_pin","showKba","handleFirstNameChange","e","target","value","_a","searchContacts","emit","query","handleLastNameChange","handleCancel","stopPropagation","showSuggestions","exit","handleSubmit","next","address","zip","handleSelectSuggestion","suggestion","render","hasBasics","isValidEmail","hasKbaRequirements","canSubmit","h","key","onSubmit","preventDefault","onClick","autocomplete","class","htmlFor","nameFieldId","id","firstNameFieldId","name","type","placeholder","onFocus","contactSuggestions","length","onInput","lastNameFieldId","filter","toLowerCase","includes","map","picture","alt","src","innerHTML","emailFieldId","autoComplete","phoneFieldId","convertToE164","Fragment","options","label","style","flex","text","icon","size","active","onToggle","detail","variant","disabled","verdocsToggleButtonCss","VerdocsToggleButtonStyle0","VerdocsToggleButton","_active","handleToggle","newState","toggle","Host"],"sources":["src/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.scss?tag=verdocs-contact-picker","src/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.tsx","src/components/controls/verdocs-toggle-button/verdocs-toggle-button.scss?tag=verdocs-toggle-button","src/components/controls/verdocs-toggle-button/verdocs-toggle-button.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-contact-picker {\n display: block;\n border: 1px solid #ebebeb;\n background-color: $verdocs-grey-4;\n font-family: $verdocs-primary-font;\n box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.1);\n\n form {\n gap: 12px;\n width: 300px;\n padding: 12px;\n display: flex;\n flex-direction: column;\n background-color: $verdocs-grey-3;\n\n .row {\n gap: 8px;\n display: flex;\n position: relative;\n flex-direction: row;\n align-items: center;\n\n &.message {\n flex-direction: column;\n align-items: flex-start;\n }\n }\n\n .names-row {\n gap: 8px;\n display: flex;\n flex-direction: row;\n\n > input {\n font-size: 14px;\n width: 103px;\n }\n }\n\n .kba-row {\n gap: 8px;\n display: flex;\n align-items: center;\n flex-direction: row;\n\n verdocs-select-input {\n margin: 0;\n }\n }\n\n .pin-code {\n gap: 8px;\n display: flex;\n align-items: center;\n flex-direction: row;\n\n > input {\n flex: 0;\n width: 133px;\n font-size: 14px;\n margin-left: 58px;\n }\n }\n\n .address {\n gap: 8px;\n display: flex;\n align-items: center;\n flex-direction: row;\n\n > input {\n flex: 1;\n font-size: 14px;\n margin-left: 58px;\n }\n }\n\n .zip-code {\n gap: 8px;\n display: flex;\n align-items: center;\n flex-direction: row;\n\n > input {\n flex: 1;\n font-size: 14px;\n margin-left: 58px;\n }\n }\n\n label {\n display: flex;\n flex: 0 0 50px;\n font-size: 14px;\n font-weight: 500;\n color: $verdocs-bg-4;\n }\n\n .row.message label {\n flex: 0;\n }\n\n .row.message input {\n width: 100%;\n }\n\n input {\n flex: 1;\n padding: 6px;\n font-size: 14px;\n border-radius: 3px;\n background: #00000005;\n border: 1px solid $border-color-extralight;\n\n &:focus {\n outline: none;\n }\n }\n\n .dropdown {\n left: 0;\n right: 0;\n top: 49px;\n z-index: 1000000;\n max-height: 225px;\n overflow-y: scroll;\n position: absolute;\n background: #ffffff;\n box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.1);\n\n .suggestion {\n display: flex;\n padding: 6px 12px;\n align-items: center;\n flex-direction: row;\n\n svg {\n width: 32px;\n height: 32px;\n }\n\n .avatar {\n width: 32px;\n height: 32px;\n flex: 0 0 32px;\n margin-right: 8px;\n border-radius: 100%;\n }\n\n .details {\n display: flex;\n flex-direction: column;\n }\n\n .name {\n font-size: 16px;\n font-weight: 500;\n margin-bottom: 3px;\n color: $verdocs-grey-0;\n }\n\n .destination {\n font-size: 14px;\n margin-bottom: 3px;\n color: $verdocs-grey-1;\n }\n\n &:hover {\n background: #eee;\n cursor: pointer;\n }\n }\n }\n }\n\n .buttons {\n display: flex;\n column-gap: 6px;\n margin-top: 16px;\n flex-direction: row;\n\n .flex-fill {\n flex: 1;\n }\n }\n\n ::placeholder {\n color: $verdocs-bg-2;\n }\n\n // @see https://community.logmein.com/t5/LastPass-Support-Discussions/placeholder-text-overrides-data-lpignore-quot-true-quot/td-p/295135\n // LastPass is ignoring the data-lpignore attribute in some cases\n [data-lastpass-icon-root] {\n display: none !important;\n }\n}\n","import {Component, h, Event, EventEmitter, Fragment, Prop, State} from '@stencil/core';\nimport {formatFullName, IProfile, IRecipient, isValidEmail, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {convertToE164} from '../../../utils/utils';\n\nconst messageIcon =\n '<svg focusable=\"false\" viewBox=\"0 0 24 24\"><path d=\"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z\"></path></svg>';\n\n// const delegateIcon =\n// '<svg focusable=\"false\" viewBox=\"0 0 24 24\"><path d=\"M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0 4c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H6v-1.4c0-2 4-3.1 6-3.1s6 1.1 6 3.1V19z\"></path></svg>';\n\nconst kbaIcon =\n '<svg focusable=\"false\" viewBox=\"0 0 24 24\"><path fill-rule=\"evenodd\" d=\"M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z\" clip-rule=\"evenodd\" /></svg>';\n\nconst addrBookIcon = `<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"lucide lucide-book-user\"><path d=\"M15 13a3 3 0 1 0-6 0\"/><path d=\"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20\"/><circle cx=\"12\" cy=\"8\" r=\"2\"/></svg>`;\n\nexport interface IContactSearchEvent {\n query: string;\n}\n\nexport interface IContactSelectEvent {\n first_name: string;\n last_name: string;\n email: string;\n phone: string;\n message: string;\n delegator: boolean;\n kba_method: string;\n kba_pin: string;\n address: string;\n zip: string;\n}\n\nexport type TPickerContact = Partial<IProfile>;\n\n/**\n * Display a contact picker suitable for filling out Recipient objects when sending Envelopes.\n *\n * This picker can also be integrated with a backend to provide contact list / suggestion / address-book style behavior. As the\n * user interacts with the component, the text entered in the name fields is sent back to the parent via the `searchContacts` event.\n * The parent can use that text as a query string to call a backend to obtain appropriate contacts to show. This list may also be\n * hard-coded ahead of time to provide the user with smart suggestions on initial display, such as \"Recently Used\" contacts, or\n * to always display the user's own contact record.\n *\n * ```ts\n * <verdocs-contact-picker\n * templateRole={role}\n * contactSuggestions={[]}\n * onNext={e => console.log('Contact completed', e.detail)}\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-contact-picker',\n styleUrl: 'verdocs-contact-picker.scss',\n shadow: false,\n})\nexport class VerdocsContactPicker {\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 role that this contact will be assigned to.\n */\n @Prop() templateRole: Partial<IRecipient> | null = null;\n\n /**\n * If set, suggestions will be displayed in a drop-down list to the user. It is recommended that the number\n * of suggestions be limited to the 5 best matching records.\n */\n @Prop() contactSuggestions: TPickerContact[] = [];\n\n /**\n * Event fired when the user enters text in the search field. The calling application may use this to update\n * the `contactSuggestions` property.\n */\n @Event({composed: true}) searchContacts: EventEmitter<IContactSearchEvent>;\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 when the user changes the type.\n */\n @Event({composed: true}) next: EventEmitter<IContactSelectEvent>;\n\n @State() first_name: string;\n @State() last_name: string;\n @State() email: string;\n @State() phone: string;\n @State() zip: string;\n @State() address: string;\n @State() message: string;\n @State() showSuggestions: boolean = false;\n @State() showMessage: boolean = false;\n @State() delegator: boolean = false;\n @State() showKba: boolean = false;\n @State() kba_method: '' | 'pin' | 'identity' = '';\n @State() kba_pin: string = '';\n\n @State() nameFieldId = `verdocs-contact-picker-name-${Math.random().toString(36).substring(2, 11)}`;\n @State() firstNameFieldId = `verdocs-contact-picker-firstname-${Math.random().toString(36).substring(2, 11)}`;\n @State() lastNameFieldId = `verdocs-contact-picker-lastname-${Math.random().toString(36).substring(2, 11)}`;\n @State() emailFieldId = `verdocs-contact-picker-email-${Math.random().toString(36).substring(2, 11)}`;\n @State() phoneFieldId = `verdocs-contact-picker-phone-${Math.random().toString(36).substring(2, 11)}`;\n\n componentWillLoad() {\n if (this.templateRole) {\n const fullName = formatFullName(this.templateRole);\n const nameComponents = fullName.split(' ');\n const firstName = this.templateRole.first_name || nameComponents.shift() || '';\n const lastName = this.templateRole.last_name || nameComponents.join(' ') || '';\n this.first_name = firstName;\n this.last_name = lastName;\n\n this.email = this.templateRole.email || '';\n this.phone = this.templateRole.phone || '';\n this.delegator = this.templateRole.delegator || false;\n this.message = this.templateRole.message || '';\n this.showMessage = this.message !== '';\n this.kba_method = this.templateRole.kba_method || '';\n this.kba_pin = this.templateRole.kba_pin || '';\n this.showKba = !!this.kba_method;\n // TODO: Allow template roles to have zip codes predefined?\n }\n }\n\n handleFirstNameChange(e: any) {\n this.first_name = e.target.value;\n this.searchContacts?.emit({query: this.first_name});\n }\n\n handleLastNameChange(e: any) {\n this.last_name = e.target.value;\n this.searchContacts?.emit({query: this.last_name});\n }\n\n handleCancel(e: any) {\n e.stopPropagation();\n this.showSuggestions = false;\n this.exit?.emit();\n }\n\n handleSubmit(e: any) {\n e.stopPropagation();\n\n this.showSuggestions = false;\n this.next?.emit({\n first_name: this.first_name,\n last_name: this.last_name,\n email: this.email,\n phone: this.phone,\n message: this.message,\n delegator: this.delegator,\n kba_method: this.kba_method,\n kba_pin: this.kba_pin,\n address: this.address,\n zip: this.zip,\n });\n }\n\n handleSelectSuggestion(e: any, suggestion: TPickerContact) {\n e.stopPropagation();\n\n this.first_name = suggestion.first_name;\n this.last_name = suggestion.last_name;\n this.email = suggestion.email;\n this.phone = suggestion.phone;\n this.showSuggestions = false;\n }\n\n // The reason for the random names/IDs is to disable browser autocomplete. We set the autocomplete tags but many browsers ignore them\n // and show a duplicate autocomplete picker on top of our own.\n render() {\n // TODO: Re-activate this one SMS is re-enabled\n // const hasBasics = this.first_name && this.last_name && (isValidEmail(this.email) || isValidPhone(this.phone));\n const hasBasics = this.first_name && this.last_name && isValidEmail(this.email);\n const hasKbaRequirements =\n !this.kba_method ||\n (this.kba_method === 'pin' && this.kba_pin) ||\n this.kba_method === 'identity';\n // TODO: For discussion\n // (this.kba_method === 'identity' && this.address && this.zip)\n const canSubmit = hasBasics && hasKbaRequirements;\n\n return (\n <form onSubmit={e => e.preventDefault()} onClick={e => e.stopPropagation()} autocomplete=\"off\">\n <div class=\"row\">\n <label htmlFor={this.nameFieldId}>Name:</label>\n <div class=\"names-row\">\n <input\n id={this.firstNameFieldId}\n name={this.firstNameFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.first_name}\n placeholder=\"First...\"\n onFocus={() => (this.showSuggestions = this.contactSuggestions?.length > 0)}\n onInput={e => this.handleFirstNameChange(e)}\n />\n <input\n id={this.lastNameFieldId}\n name={this.lastNameFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.last_name}\n placeholder=\"Last...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={e => this.handleLastNameChange(e)}\n />\n </div>\n\n {this.showSuggestions && (\n <div class=\"dropdown\">\n {this.contactSuggestions\n .filter(suggestion => !this.first_name || suggestion.first_name.toLowerCase().includes(this.first_name.toLowerCase()))\n .map(suggestion => (\n <div key={suggestion.id ?? suggestion.email} class=\"suggestion\" onClick={e => this.handleSelectSuggestion(e, suggestion)}>\n {suggestion.picture ? <img alt=\"Avatar\" class=\"avatar\" src={suggestion.picture} /> : <div class=\"avatar\" innerHTML={addrBookIcon} />}\n <div class=\"details\">\n <div class=\"name\">{formatFullName(suggestion)}</div>\n {suggestion.email && <div class=\"destination\">{suggestion.email}</div>}\n {suggestion.phone && <div class=\"destination\">{suggestion.phone}</div>}\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n <div class=\"row\">\n <label htmlFor={this.emailFieldId}>Email:</label>\n <input\n id={this.emailFieldId}\n name={this.emailFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autoComplete=\"blocked\"\n value={this.email}\n placeholder=\"Email address...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.email = e.target.value)}\n />\n </div>\n\n <div class=\"row\">\n <label htmlFor={this.phoneFieldId}>Phone:</label>\n <input\n id={this.phoneFieldId}\n name={this.phoneFieldId}\n type=\"text\"\n data-lpignore=\"true\"\n autoComplete=\"blocked\"\n value={this.phone}\n placeholder=\"Phone (SMS)...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => {\n this.phone = convertToE164(e.target.value);\n }}\n />\n </div>\n\n {this.showKba && (\n <Fragment>\n <div class=\"kba-row\">\n <label>KBA:</label>\n <verdocs-select-input\n value={this.kba_method}\n onInput={(e: any) => {\n this.kba_method = e.target.value;\n this.zip = '';\n this.address = '';\n this.kba_pin = '';\n }}\n options={[\n {label: 'None', value: ''},\n {label: 'PIN Code', value: 'pin'},\n {label: 'Full Verification', value: 'identity'},\n ]}\n />\n <div style={{flex: '1'}}></div>\n <verdocs-help-icon text=\"Knowledge-Based Authentication adds additional authentication for this user either via a simple PIN code or full address validation. NOTE: There may be a fee for using this feature.\" />\n </div>\n\n {this.kba_method === 'pin' && (\n <div class=\"row pin-code\">\n <input\n id=\"verdocs-pin-code\"\n name=\"verdocs-pin-code\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.kba_pin}\n placeholder=\"PIN Code...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.kba_pin = e.target.value)}\n />\n </div>\n )}\n\n {this.kba_method === 'identity' && (\n <div class=\"row address\">\n <input\n id=\"verdocs-address\"\n name=\"verdocs-address\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.address}\n placeholder=\"Address...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.address = e.target.value)}\n />\n <verdocs-help-icon text=\"Pre-fill the recipient's current street address. They will still be asked ID challenge questions.\" />\n </div>\n )}\n\n {this.kba_method === 'identity' && (\n <div class=\"row zip-code\">\n <input\n id=\"verdocs-zip-code\"\n name=\"verdocs-zip-code\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.zip}\n placeholder=\"Zip Code...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.zip = e.target.value)}\n />\n <verdocs-help-icon text=\"Pre-fill the recipient's current zip code. They will still be asked ID challenge questions.\" />\n </div>\n )}\n </Fragment>\n )}\n\n {this.showMessage && (\n <div class=\"row message\">\n <label htmlFor=\"verdocs-contact-picker-message\">Message:</label>\n <input\n id=\"verdocs-contact-picker-message\"\n name=\"verdocs-contact-picker-message\"\n type=\"text\"\n data-lpignore=\"true\"\n autocomplete=\"blocked\"\n value={this.message}\n placeholder=\"Message shown in invitation...\"\n onFocus={() => (this.showSuggestions = false)}\n onInput={(e: any) => (this.message = e.target.value)}\n />\n </div>\n )}\n\n <div class=\"buttons\">\n <verdocs-toggle-button\n icon={kbaIcon}\n size=\"small\"\n active={this.showKba}\n onToggle={e => {\n this.showKba = e.detail.active;\n if (!e.detail.active) {\n this.kba_pin = '';\n this.kba_method = '';\n this.zip = '';\n }\n this.showSuggestions = false;\n }}\n />\n <verdocs-toggle-button\n icon={messageIcon}\n size=\"small\"\n active={this.showMessage}\n onToggle={e => {\n this.showMessage = e.detail.active;\n this.showSuggestions = false;\n }}\n />\n\n <div class=\"flex-fill\" />\n\n <verdocs-button variant=\"outline\" label=\"Cancel\" size=\"small\" onClick={e => this.handleCancel(e)} />\n <verdocs-button label=\"OK\" size=\"small\" disabled={!canSubmit} onClick={!canSubmit ? () => {} : e => this.handleSubmit(e)} />\n </div>\n </form>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-toggle-button {\n font-family: $primary-font;\n\n button {\n border: none;\n outline: none;\n cursor: pointer;\n align-items: center;\n display: inline-flex;\n justify-content: center;\n background: $verdocs-bg-1;\n color: $verdocs-dark-blue;\n\n svg {\n max-width: 100%;\n max-height: 100%;\n fill: $verdocs-dark-blue;\n }\n\n &.active {\n background: $verdocs-green;\n color: $verdocs-grey-3;\n\n svg {\n fill: $verdocs-grey-3;\n }\n }\n\n &:focus {\n border: none;\n outline: none;\n }\n }\n\n &.size-normal button {\n width: 40px;\n height: 40px;\n padding: 6px;\n border-radius: 4px;\n }\n\n &.size-small button {\n width: 34px;\n height: 34px;\n padding: 4px;\n border-radius: 2px;\n }\n}\n","import {Component, Prop, h, State, Event, EventEmitter, Host} from '@stencil/core';\n\n/**\n * Displays a single button that can be toggled on or off by clicking it.\n *\n * ```ts\n * <verdocs-toggle-button icon={MessageIcon} size=\"normal\" active={true} />\n * ```\n */\n@Component({\n tag: 'verdocs-toggle-button',\n styleUrl: 'verdocs-toggle-button.scss',\n})\nexport class VerdocsToggleButton {\n @Prop() active = false;\n\n /**\n * If set, should be an SVG object. This will be rendered as the button's visible element. If icon is supplied, label is ignored.\n */\n @Prop() icon?: string | null = null;\n\n /**\n * If set, should be an SVG object. This will be rendered as the button's visible element. If icon is supplied, label is ignored.\n */\n @Prop() label?: string | null = null;\n\n /**\n * How large the button should be. Small buttons are intended for dialog boxes and other smaller scale UI regions.\n */\n @Prop() size?: 'small' | 'normal' = 'normal';\n\n /**\n * Event fired when the button is pressed.\n */\n @Event({composed: true}) toggle!: EventEmitter<{active: boolean}>;\n\n @State() _active = false;\n\n componentWillLoad() {\n this._active = this.active;\n }\n\n handleToggle(e: any) {\n e.stopPropagation();\n\n const newState = !this._active;\n this._active = newState;\n this.toggle?.emit({active: newState});\n }\n\n render() {\n return (\n <Host class={`size-${this.size}`}>\n {this.icon ? (\n <button innerHTML={this.icon} class={{active: this._active}} onClick={e => this.handleToggle(e)} />\n ) : (\n <button class={{active: this._active}} onClick={e => this.handleToggle(e)}>\n {this.label}\n </button>\n )}\n </Host>\n );\n }\n}\n"],"mappings":"oQAAA,MAAMA,EAA0B,23IAChC,MAAAC,EAAeD,ECGf,MAAME,EACJ,4LAKF,MAAMC,EACJ,sjBAEF,MAAMC,EAAe,oU,MA2CRC,EAAoB,M,4IAIKC,EAAgBC,a,kBAKD,K,wBAMJ,G,mLAyBX,M,iBACJ,M,eACF,M,aACF,M,gBACmB,G,aACpB,G,iBAEJ,+BAA+BC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,M,sBAClE,oCAAoCH,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,M,qBAC7E,mCAAmCH,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,M,kBAC9E,gCAAgCH,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,M,kBACxE,gCAAgCH,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAA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gB,YACboE,SAAU/D,IACRrB,KAAKgB,YAAcK,EAAEgE,OAAOF,OAC5BnF,KAAK+B,gBAAkB,KAAK,IAIhCa,EAAA,OAAAC,IAAA,2CAAKK,MAAM,cAEXN,EAAA,kBAAAC,IAAA,2CAAgByC,QAAQ,UAAUT,MAAM,SAASK,KAAK,QAAQlC,QAAS3B,GAAKrB,KAAK6B,aAAaR,KAC9FuB,EAAA,kBAAAC,IAAA,2CAAgBgC,MAAM,KAAKK,KAAK,QAAQK,UAAW5C,EAAWK,SAAUL,EAAY,OAAWtB,GAAKrB,KAAKiC,aAAaZ,M,aClYhI,MAAMmE,EAAyB,miCAC/B,MAAAC,EAAeD,E,MCYFE,EAAmB,M,oEACb,M,UAKc,K,WAKC,K,UAKI,S,aAOjB,K,CAEnB,iBAAA3F,GACEC,KAAK2F,QAAU3F,KAAKmF,M,CAGtB,YAAAS,CAAavE,G,MACXA,EAAES,kBAEF,MAAM+D,GAAY7F,KAAK2F,QACvB3F,KAAK2F,QAAUE,GACfrE,EAAAxB,KAAK8F,UAAM,MAAAtE,SAAA,SAAAA,EAAEE,KAAK,CAACyD,OAAQU,G,CAG7B,MAAAtD,GACE,OACEK,EAACmD,EAAI,CAAAlD,IAAA,2CAACK,MAAO,QAAQlD,KAAKkF,QACvBlF,KAAKiF,KACJrC,EAAA,UAAQ0B,UAAWtE,KAAKiF,KAAM/B,MAAO,CAACiC,OAAQnF,KAAK2F,SAAU3C,QAAS3B,GAAKrB,KAAK4F,aAAavE,KAE7FuB,EAAA,UAAQM,MAAO,CAACiC,OAAQnF,KAAK2F,SAAU3C,QAAS3B,GAAKrB,KAAK4F,aAAavE,IACpErB,KAAK6E,O","ignoreList":[]}
|
@@ -1,2 +0,0 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,i,t,r){function n(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function c(e){try{a(r["throw"](e))}catch(e){o(e)}}function a(e){e.done?t(e.value):n(e.value).then(s,c)}a((r=r.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,n,o,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(i){return a([e,i])}}function a(c){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,c[0]&&(t=0)),t)try{if(r=1,n&&(o=c[0]&2?n["return"]:c[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;if(n=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:t.label++;return{value:c[1],done:false};case 5:t.label++;n=c[1];c=[0];continue;case 7:c=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){t.label=c[1];break}if(c[0]===6&&t.label<o[1]){t.label=o[1];o=c;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(c);break}if(o[2])t.ops.pop();t.trys.pop();continue}c=i.call(e,t)}catch(e){c=[6,e];n=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};System.register(["./p-9186f42e.system.js","@verdocs/js-sdk","./p-9b26e4e0.system.js","./p-c8a15cb7.system.js","./p-52c3e8b0.system.js"],(function(e){"use strict";var i,t,r,n,o,s,c,a,l,d,u;return{setters:[function(e){i=e.r;t=e.c;r=e.h;n=e.H},function(e){o=e.VerdocsEndpoint;s=e.getEnvelope;c=e.getInPersonLink;a=e.formatFullName},function(e){l=e.V},function(e){d=e.S},function(e){u=e.S}],execute:function(){var f='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-envelope-recipient-link{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:100000;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-family:"Inter", "Barlow", sans-serif;background-color:rgba(0, 0, 0, 0.4980392157)}verdocs-envelope-recipient-link .summary-content{width:600px;display:-ms-flexbox;display:flex;max-width:90%;font-size:18px;-ms-flex:0 0 600px;flex:0 0 600px;border-radius:6px;background:#ffffff;-ms-flex-direction:column;flex-direction:column;padding:30px 20px 20px}verdocs-envelope-recipient-link .summary-content .summary-title{font-size:20px;font-weight:700;margin:0 0 10px 0;color:#33364b}verdocs-envelope-recipient-link .summary-recipient{display:-ms-flexbox;display:flex;color:#33364b;margin:8px 0 24px 0;-ms-flex-direction:column;flex-direction:column}verdocs-envelope-recipient-link .summary-recipient .role-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;margin:0 0 8px 0;color:#092c4c}verdocs-envelope-recipient-link .summary-recipient .role-info{gap:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end}verdocs-envelope-recipient-link .summary-recipient .role-full-name{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #cccccc;background:rgb(249, 250, 251)}verdocs-envelope-recipient-link .summary-recipient .recipient-link{width:120px;padding:0 16px;font-weight:500;margin:0 0 0 8px;text-align:center;font-size:0.875rem;border-radius:100%;color:rgb(55, 65, 81);line-height:1.25rem;background-color:#d8d8d8;border:2px solid rgb(156, 163, 175)}verdocs-envelope-recipient-link .summary-recipient .link-wrapper{gap:5px;display:-ms-flexbox;display:flex;margin:4px 0 0 0;-ms-flex-direction:row;flex-direction:row}verdocs-envelope-recipient-link .summary-recipient .link-wrapper .link{-ms-flex:1;flex:1;height:34px;display:-ms-flexbox;display:flex;font-size:16px;padding:0 12px;overflow:hidden;margin:0 6px 0 0;border-radius:4px;white-space:nowrap;-ms-flex-align:center;align-items:center;text-overflow:ellipsis;border:1px solid #cccccc;background:rgb(249, 250, 251)}verdocs-envelope-recipient-link .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:10px 0 0 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-envelope-recipient-link .buttons verdocs-button{-ms-flex:0 0 120px;flex:0 0 120px;margin-left:10px;white-space:nowrap}verdocs-envelope-recipient-link .buttons verdocs-button button{width:100%}';var p=f;var b=e("verdocs_envelope_recipient_link",function(){function e(e){i(this,e);this.next=t(this,"next",7);this.sdkError=t(this,"sdkError",7);this.envelopeListenerId=null;this.endpoint=o.getDefault();this.envelopeId="";this.roleName="";this.isOpen=undefined;this.gettingLink=true;this.link="";this.loading=true;this.envelope=null;this.recipient=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,t;return __generator(this,(function(r){try{this.endpoint.loadSession();if(!this.envelopeId){console.log("[RECIPIENT_LINK] Missing required envelope ID ".concat(this.envelopeId));return[2]}if(!this.endpoint.session){console.log("[RECIPIENT_LINK] Unable to start session, must be authenticated");return[2]}this.listenToEnvelope()}catch(r){console.log("[RECIPIENT_LINK] Error loading envelope",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new d(r.message,(i=r.response)===null||i===void 0?void 0:i.status,(t=r.response)===null||t===void 0?void 0:t.data))}return[2]}))}))};e.prototype.disconnectedCallback=function(){this.unlistenToEnvelope()};e.prototype.listenToEnvelope=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(i){console.log("[SIDEBAR] Loading envelope",this.envelopeId);this.unlistenToEnvelope();u.subscribe("envelopes",this.envelopeId,(function(){return s(e.endpoint,e.envelopeId)}),false,(function(i){var t;e.envelope=i;e.loading=false;e.recipient=(((t=e.envelope)===null||t===void 0?void 0:t.recipients)||[]).find((function(i){return i.role_name===e.roleName}));e.getLink(e.recipient)}));return[2]}))}))};e.prototype.unlistenToEnvelope=function(){if(this.envelopeListenerId){u.store.delListener(this.envelopeListenerId);this.envelopeListenerId=null}};e.prototype.handleDone=function(e){var i;e.preventDefault();(i=this.next)===null||i===void 0?void 0:i.emit({envelope:this.envelope})};e.prototype.copyLink=function(e){navigator.clipboard.writeText(e).then((function(){return l("Link copied to clipboard!",{style:"success",duration:3e3})})).catch((function(e){console.warn("[RECIPIENT_LINK] Error copying to clipboard",e);l("Unable to copy to clipboard: ".concat(e.message),{style:"error"})}))};e.prototype.getLink=function(e){var i=this;this.gettingLink=true;c(this.endpoint,e.envelope_id,e.role_name).then((function(e){i.gettingLink=false;i.link=e.link})).catch((function(e){i.gettingLink=false;console.log("[RECIPIENT_LINK] Error getting link",e);l("Unable to get link: "+e.message,{style:"error"})}))};e.prototype.render=function(){var e=this;if(this.loading||!this.recipient){return r(n,null)}var i=a(this.recipient);return r(n,null,r("div",{class:"summary-content"},r("h1",{class:"summary-title"},"In-Person Signing Link"),r("div",{class:"summary-rows"},r("div",{class:"summary-recipient"},r("div",{class:"role-name"},this.recipient.role_name),r("div",{class:"role-details"},r("div",{class:"role-info"},r("div",{class:"role-full-name"},i," (",this.recipient.email||this.recipient.phone,")"),!this.link&&r("verdocs-button",{size:"small",variant:"outline",label:this.gettingLink?"Loading...":"Get Link",disabled:this.gettingLink,onClick:function(){return e.getLink(e.recipient)}})),this.link&&r("div",{class:"link-wrapper"},r("div",{class:"link"},this.link),r("verdocs-button",{size:"small",variant:"outline",label:"Copy",onClick:function(){return e.copyLink(e.link)}}))))),r("div",{class:"buttons"},r("verdocs-button",{size:"small",label:"Done",onClick:function(i){return e.handleDone(i)}}))))};return e}());b.style=p;var h='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-switch{font-family:"Inter", "Barlow", sans-serif}verdocs-switch .switch{display:-ms-inline-flexbox;display:inline-flex;height:24px;width:44px;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:12px;border:transparent;-webkit-transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, fill, stroke, -webkit-text-decoration-color;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:150ms;transition-duration:150ms}verdocs-switch .switch.primary[data-state=checked]{background:#55bc81}verdocs-switch .switch.primary[data-state=unchecked]{background:#e3e3e3}verdocs-switch .switch.secondary[data-state=checked]{background:#4c56cb}verdocs-switch .switch.secondary[data-state=unchecked]{background:#e3e3e3}verdocs-switch .slider{display:block;width:20px;height:20px;border-radius:20px;background:#ffffff;-webkit-box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:150ms;transition-duration:150ms}verdocs-switch .slider[data-state=checked]{-webkit-transform:translateX(22px);transform:translateX(22px)}verdocs-switch .slider[data-state=unchecked]{-webkit-transform:translateX(2px);transform:translateX(2px)}verdocs-switch .switch.disabled.primary,verdocs-switch .switch.disabled.secondary{cursor:not-allowed;background:#666666}';var x=h;var m=e("verdocs_switch",function(){function e(e){i(this,e);this.checkedChange=t(this,"checkedChange",7);this.checked=false;this.theme="primary";this.disabled=false}e.prototype.render=function(){var e=this;return r("button",{key:"e9153549bcee6b924ce7a7d620d1096fa91782d2",value:"on",type:"button",role:"switch",class:"switch ".concat(this.theme," ").concat(this.disabled?"disabled":""),"data-state":this.checked?"checked":"unchecked","aria-checked":this.checked?"checked":"unchecked",onClick:function(){var i;if(!e.disabled){e.checked=!e.checked;(i=e.checkedChange)===null||i===void 0?void 0:i.emit(e.checked)}}},r("span",{key:"61d97d7571b7f52f186ce44daaf0ef7132c6d5f6","data-state":this.checked?"checked":"unchecked",class:"slider"}))};return e}());m.style=x}}}));
|
2
|
-
//# sourceMappingURL=p-e3efeb57.system.entry.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"names":["verdocsEnvelopeRecipientLinkCss","VerdocsEnvelopeRecipientLinkStyle0","VerdocsEnvelopeRecipientLink","exports","this","envelopeListenerId","VerdocsEndpoint","getDefault","class_1","prototype","componentWillLoad","endpoint","loadSession","envelopeId","console","log","concat","session","listenToEnvelope","e","_a","sdkError","emit","SDKError","message","_b","response","status","_c","data","disconnectedCallback","unlistenToEnvelope","Store","subscribe","getEnvelope","_this","envelope","loading","recipient","recipients","find","r","role_name","roleName","getLink","store","delListener","handleDone","preventDefault","next","copyLink","link","navigator","clipboard","writeText","then","VerdocsToast","style","duration","catch","warn","gettingLink","getInPersonLink","envelope_id","render","h","Host","fullName","formatFullName","class","email","phone","size","variant","label","disabled","onClick","verdocsSwitchCss","VerdocsSwitchStyle0","VerdocsSwitch","class_2","key","value","type","role","theme","checked","checkedChange"],"sources":["src/components/envelopes/verdocs-envelope-recipient-link/verdocs-envelope-recipient-link.scss?tag=verdocs-envelope-recipient-link","src/components/envelopes/verdocs-envelope-recipient-link/verdocs-envelope-recipient-link.tsx","src/components/controls/verdocs-switch/verdocs-switch.scss?tag=verdocs-switch","src/components/controls/verdocs-switch/verdocs-switch.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-envelope-recipient-link {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n z-index: 100000;\n position: fixed;\n align-items: center;\n justify-content: center;\n font-family: $primary-font;\n background-color: #0000007f;\n\n .summary-content {\n width: 600px;\n display: flex;\n max-width: 90%;\n font-size: 18px;\n flex: 0 0 600px;\n border-radius: 6px;\n background: #ffffff;\n flex-direction: column;\n padding: 30px 20px 20px;\n\n .summary-title {\n font-size: 20px;\n font-weight: 700;\n margin: 0 0 10px 0;\n color: $verdocs-dark-blue;\n }\n }\n\n .summary-recipient {\n display: flex;\n color: $verdocs-grey-1;\n margin: 8px 0 24px 0;\n flex-direction: column;\n\n .role-name {\n flex: 1;\n display: flex;\n font-size: 14px;\n font-weight: 600;\n margin: 0 0 8px 0;\n color: $verdocs-grey-0;\n }\n\n .role-details {\n }\n\n .role-info {\n gap: 5px;\n display: flex;\n flex-direction: row;\n align-items: flex-end;\n }\n\n .role-full-name {\n flex: 1;\n height: 34px;\n display: flex;\n font-size: 16px;\n padding: 0 12px;\n border-radius: 4px;\n align-items: center;\n border: 1px solid #cccccc;\n background: rgb(249, 250, 251);\n }\n\n .recipient-link {\n width: 120px;\n padding: 0 16px;\n font-weight: 500;\n margin: 0 0 0 8px;\n text-align: center;\n font-size: 0.875rem;\n border-radius: 100%;\n color: rgb(55, 65, 81);\n line-height: 1.25rem;\n background-color: #d8d8d8;\n border: 2px solid rgb(156, 163, 175);\n }\n\n .link-wrapper {\n gap: 5px;\n display: flex;\n margin: 4px 0 0 0;\n flex-direction: row;\n\n .link {\n flex: 1;\n height: 34px;\n display: flex;\n font-size: 16px;\n padding: 0 12px;\n overflow: hidden;\n margin: 0 6px 0 0;\n border-radius: 4px;\n white-space: nowrap;\n align-items: center;\n text-overflow: ellipsis;\n border: 1px solid #cccccc;\n background: rgb(249, 250, 251);\n }\n }\n }\n\n .buttons {\n display: flex;\n column-gap: 15px;\n margin: 10px 0 0 0;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n\n verdocs-button {\n flex: 0 0 120px;\n margin-left: 10px;\n white-space: nowrap;\n\n button {\n width: 100%;\n }\n }\n }\n}\n","import {Component, Prop, Host, h, State, Event, EventEmitter} from '@stencil/core';\nimport {formatFullName, getEnvelope, getInPersonLink, IEnvelope, IRecipient, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Displays a single recipient from an envelope, with the opportunity to copy an in-person\n * signing link for that recipient to use.\n */\n@Component({\n tag: 'verdocs-envelope-recipient-link',\n styleUrl: 'verdocs-envelope-recipient-link.scss',\n})\nexport class VerdocsEnvelopeRecipientLink {\n private envelopeListenerId = null;\n\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * The envelope ID to edit.\n */\n @Prop() envelopeId: string = '';\n\n /**\n * The role to load.\n */\n @Prop() roleName: string = '';\n\n /**\n * Event fired when the user clicks Done to proceed. It is up to the host application\n * to redirect the user to the appropriate next workflow step.\n */\n @Event({composed: true}) next: EventEmitter<{envelope: IEnvelope}>;\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() isOpen: boolean;\n @State() gettingLink = true;\n @State() link = '';\n\n @State() loading = true;\n @State() envelope: IEnvelope | null = null;\n @State() recipient: IRecipient | null = null;\n\n async componentWillLoad() {\n try {\n this.endpoint.loadSession();\n\n if (!this.envelopeId) {\n console.log(`[RECIPIENT_LINK] Missing required envelope ID ${this.envelopeId}`);\n return;\n }\n\n if (!this.endpoint.session) {\n console.log('[RECIPIENT_LINK] Unable to start session, must be authenticated');\n return;\n }\n\n this.listenToEnvelope();\n } catch (e) {\n console.log('[RECIPIENT_LINK] Error loading envelope', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n }\n }\n\n disconnectedCallback() {\n this.unlistenToEnvelope();\n }\n\n async listenToEnvelope() {\n console.log('[SIDEBAR] Loading envelope', this.envelopeId);\n this.unlistenToEnvelope();\n Store.subscribe(\n 'envelopes',\n this.envelopeId,\n () => getEnvelope(this.endpoint, this.envelopeId),\n false,\n (envelope: IEnvelope) => {\n this.envelope = envelope;\n this.loading = false;\n\n this.recipient = (this.envelope?.recipients || []).find(r => r.role_name === this.roleName);\n this.getLink(this.recipient);\n },\n );\n }\n\n unlistenToEnvelope() {\n if (this.envelopeListenerId) {\n Store.store.delListener(this.envelopeListenerId);\n this.envelopeListenerId = null;\n }\n }\n\n handleDone(e: any) {\n e.preventDefault();\n this.next?.emit({envelope: this.envelope});\n }\n\n copyLink(link: string) {\n navigator.clipboard\n .writeText(link)\n .then(() => VerdocsToast('Link copied to clipboard!', {style: 'success', duration: 3000}))\n .catch(e => {\n console.warn('[RECIPIENT_LINK] Error copying to clipboard', e);\n VerdocsToast(`Unable to copy to clipboard: ${e.message}`, {style: 'error'});\n });\n }\n\n getLink(recipient: IRecipient) {\n this.gettingLink = true;\n getInPersonLink(this.endpoint, recipient.envelope_id, recipient.role_name)\n .then(response => {\n this.gettingLink = false;\n this.link = response.link;\n // NOTE: Left here for documentation purposes. We don't auto-copy the link because many browsers now\n // error on that because we aren't the focus/gesture-initiator since we're a new component just being\n // drawn in the DOM. So we let the user click to trigger that.\n // this.copyLink(response.link);\n })\n .catch(e => {\n this.gettingLink = false;\n console.log('[RECIPIENT_LINK] Error getting link', e);\n VerdocsToast('Unable to get link: ' + e.message, {style: 'error'});\n });\n }\n\n render() {\n if (this.loading || !this.recipient) {\n return <Host />;\n }\n\n // const recipientsWithActions = getRecipientsWithActions(this.store.state); const showLinkButton = recipientCanAct(recipient, recipientsWithActions); const link =\n // this.links[recipient.role_name]; const gettingLink = this.gettingLinks[recipient.role_name]; return (\n\n const fullName = formatFullName(this.recipient);\n return (\n <Host>\n <div class=\"summary-content\">\n <h1 class=\"summary-title\">In-Person Signing Link</h1>\n <div class=\"summary-rows\">\n <div class=\"summary-recipient\">\n <div class=\"role-name\">{this.recipient.role_name}</div>\n <div class=\"role-details\">\n <div class=\"role-info\">\n <div class=\"role-full-name\">\n {fullName} ({this.recipient.email || this.recipient.phone})\n </div>\n {!this.link && (\n <verdocs-button\n size=\"small\"\n variant=\"outline\"\n label={this.gettingLink ? 'Loading...' : 'Get Link'}\n disabled={this.gettingLink}\n onClick={() => this.getLink(this.recipient)}\n />\n )}\n </div>\n\n {this.link && (\n <div class=\"link-wrapper\">\n <div class=\"link\">{this.link}</div>\n <verdocs-button size=\"small\" variant=\"outline\" label=\"Copy\" onClick={() => this.copyLink(this.link)} />\n </div>\n )}\n </div>\n </div>\n </div>\n\n <div class=\"buttons\">\n <verdocs-button size=\"small\" label=\"Done\" onClick={e => this.handleDone(e)} />\n </div>\n </div>\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-switch {\n font-family: $primary-font;\n\n .switch {\n display: inline-flex;\n height: 24px;\n width: 44px;\n flex-shrink: 0;\n align-items: center;\n cursor: pointer;\n border-radius: 12px;\n border: transparent;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n }\n\n .switch.primary[data-state='checked'] {\n background: $primary-color;\n }\n\n .switch.primary[data-state='unchecked'] {\n background: $extra-light-border-color;\n }\n\n .switch.secondary[data-state='checked'] {\n background: $secondary-color;\n }\n\n .switch.secondary[data-state='unchecked'] {\n background: $extra-light-border-color;\n }\n\n .slider {\n display: block;\n width: 20px;\n height: 20px;\n border-radius: 20px;\n background: #ffffff;\n box-shadow:\n 0 10px 15px -3px rgb(0 0 0 / 0.1),\n 0 4px 6px -4px rgb(0 0 0 / 0.1);\n transition-property: transform;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n }\n\n .slider[data-state='checked'] {\n transform: translateX(22px);\n }\n\n .slider[data-state='unchecked'] {\n transform: translateX(2px);\n }\n\n .switch.disabled.primary,\n .switch.disabled.secondary {\n cursor: not-allowed;\n background: $dark-disabled-color;\n }\n}\n","import {Component, Prop, h, EventEmitter, Event} from '@stencil/core';\n\n/**\n * Displays a toggle switch.\n *\n * ```ts\n * <verdocs-switch checked={sendReminders} onCheckedChange={setSendReminders} />\n * ```\n */\n@Component({\n tag: 'verdocs-switch',\n styleUrl: 'verdocs-switch.scss',\n})\nexport class VerdocsSwitch {\n @Prop({mutable: true}) checked: boolean = false;\n\n /**\n * Select purple or green treatments.\n */\n @Prop() theme: 'primary' | 'secondary' = 'primary';\n\n /**\n * Should the field be disabled?\n */\n @Prop() disabled: boolean = false;\n\n @Event({composed: true}) checkedChange: EventEmitter<boolean>;\n\n render() {\n return (\n <button\n value=\"on\"\n type=\"button\"\n role=\"switch\"\n class={`switch ${this.theme} ${this.disabled ? 'disabled' : ''}`}\n data-state={this.checked ? 'checked' : 'unchecked'}\n aria-checked={this.checked ? 'checked' : 'unchecked'}\n onClick={() => {\n if (!this.disabled) {\n this.checked = !this.checked;\n this.checkedChange?.emit(this.checked);\n }\n }}\n >\n <span data-state={this.checked ? 'checked' : 'unchecked'} class=\"slider\"></span>\n </button>\n );\n }\n}\n"],"mappings":"o2DAAA,IAAMA,EAAkC,ghGACxC,IAAAC,EAAeD,E,ICaFE,EAA4BC,EAAA,6C,sFAC/BC,KAAAC,mBAAqB,K,cAKOC,EAAgBC,a,gBAKvB,G,cAKF,G,uCAeJ,K,UACP,G,aAEG,K,cACmB,K,eACE,I,CAElC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