@verdocs/web-sdk 2.3.70 → 2.3.72
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/{TemplateStore-89072ea0.js → TemplateStore-ae59084b.js} +1 -1
- package/dist/cjs/{VerdocsEndpoint-8f298664.js → VerdocsEndpoint-f4ef9333.js} +5 -2
- package/dist/cjs/ipc-test.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-activity-box.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-checkbox_5.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-attachment_15.cjs.entry.js +6 -1
- package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview_8.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-quick-functions_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-settings.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.js +5 -4
- package/dist/collection/components/templates/verdocs-template-document-page/verdocs-template-document-page.js +4 -0
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +1 -1
- package/dist/components/VerdocsEndpoint.js +5 -2
- package/dist/components/verdocs-field-textbox2.js +5 -4
- package/dist/components/verdocs-template-document-page2.js +4 -0
- package/dist/components/verdocs-template-fields2.js +1 -1
- package/dist/custom-elements.json +2143 -0
- package/dist/docs.json +5 -5
- package/dist/esm/{TemplateStore-7fba801e.js → TemplateStore-99bf97f0.js} +1 -1
- package/dist/esm/{VerdocsEndpoint-56fa3371.js → VerdocsEndpoint-eab308f6.js} +5 -2
- package/dist/esm/ipc-test.entry.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-activity-box.entry.js +1 -1
- package/dist/esm/verdocs-auth.entry.js +1 -1
- package/dist/esm/verdocs-build.entry.js +2 -2
- package/dist/esm/verdocs-checkbox_5.entry.js +2 -2
- package/dist/esm/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm/verdocs-field-attachment_15.entry.js +6 -1
- package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm/verdocs-preview_8.entry.js +2 -2
- package/dist/esm/verdocs-quick-functions_2.entry.js +1 -1
- package/dist/esm/verdocs-search.entry.js +1 -1
- package/dist/esm/verdocs-settings-api-keys_4.entry.js +1 -1
- package/dist/esm/verdocs-settings.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +1 -1
- package/dist/esm/verdocs-template-fields_4.entry.js +3 -3
- package/dist/esm/verdocs-template-star.entry.js +1 -1
- package/dist/esm/verdocs-templates-list.entry.js +1 -1
- package/dist/esm/verdocs-view.entry.js +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/{TemplateStore-7fba801e.js → TemplateStore-99bf97f0.js} +1 -1
- package/dist/esm-es5/VerdocsEndpoint-eab308f6.js +1 -0
- package/dist/esm-es5/ipc-test.entry.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-checkbox_5.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_15.entry.js +1 -1
- package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-search.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
- package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-view.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/templates/verdocs-template-document-page/verdocs-template-document-page.d.ts +1 -0
- package/dist/verdocs-web-sdk/{p-cf703fe4.entry.js → p-06618569.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d7f90328.system.entry.js → p-0b0cc39b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ea80fcea.entry.js → p-0e4f5403.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-10310263.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-db5de7e8.entry.js → p-159aeaf2.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-80e69a68.entry.js → p-2d47c6af.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9fc06f7b.entry.js → p-332141f2.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d1092a62.system.entry.js → p-356e4c15.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f2a169d8.entry.js → p-38ea0d20.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-26646a40.entry.js → p-3fa35da3.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9d4a5fd8.entry.js → p-40f5b1c5.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-47c63cc7.js → p-45ecd6eb.js} +1 -1
- package/dist/verdocs-web-sdk/{p-116f7900.entry.js → p-501d9168.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0abf0058.system.entry.js → p-58e85310.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9054234f.entry.js → p-5ddc43f4.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4861684b.entry.js → p-6a93295c.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-17598002.system.entry.js → p-7519fe6e.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-17bf98f2.system.entry.js → p-77c145b3.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b6231fd3.system.entry.js → p-7b3dfc4b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4d98f194.system.entry.js → p-7e5a1766.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-508808d2.entry.js → p-84679597.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d0a09719.entry.js → p-8a7324b6.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-997a4959.entry.js → p-90539070.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-151c33dd.system.entry.js → p-9a816526.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-77d3c570.entry.js → p-9d748d04.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e13b21ca.system.entry.js → p-a50982c8.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c80237f9.entry.js → p-a7907ccf.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9ceff040.system.entry.js → p-a9b80271.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8b0a5309.entry.js → p-ac042888.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-035a3ce2.entry.js → p-ac07d476.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-5050f8a2.system.entry.js → p-b0e0084b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-b252cfb6.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-637187de.entry.js → p-b8063124.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-72f22ee9.system.entry.js → p-baf16d17.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a16eba51.system.entry.js → p-bea26fb0.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-00e8cfa6.system.entry.js → p-bf8e6ba1.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c118d024.system.entry.js → p-c5fd0435.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d39e4a26.system.entry.js → p-c73e78c8.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-cff87d52.system.js → p-d0d9ac6d.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ea96b41e.entry.js → p-d315d7ca.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-bb2ff79c.entry.js → p-d53aec0f.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-e04d8f5d.js +1 -0
- package/dist/verdocs-web-sdk/{p-e311d75f.system.entry.js → p-e0e99a5d.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6384f444.system.entry.js → p-e3623a0c.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d0bbe952.system.entry.js → p-e4b14b93.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-04ac4336.system.entry.js → p-f0dfd635.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-f246348c.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-3995b09b.system.entry.js → p-f3947f39.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +3 -3
- package/dist/esm-es5/VerdocsEndpoint-56fa3371.js +0 -1
- package/dist/verdocs-web-sdk/p-035f6b38.js +0 -1
- package/dist/verdocs-web-sdk/p-358ce165.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-3efa7c26.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-9bf2d124.system.js +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
import{d as t}from"./p-05788c2b.js";var e,n;!function(t){t.CREATOR="creator",t.ORGANIZATION_MEMBER="organization_member",t.ORGANIZATION_MEMBER_AS_CREATOR="organization_member_as_creator",t.EVERYONE="everyone",t.EVERYONE_AS_CREATOR="everyone_as_creator"}(e||(e={})),function(t){t.TEMPLATE_CREATOR_CREATE_PUBLIC="template:creator:create:public",t.TEMPLATE_CREATOR_CREATE_ORG="template:creator:create:org",t.TEMPLATE_CREATOR_CREATE_PERSONAL="template:creator:create:personal",t.TEMPLATE_CREATOR_DELETE="template:creator:delete",t.TEMPLATE_CREATOR_VISIBILITY="template:creator:visibility",t.TEMPLATE_MEMBER_READ="template:member:read",t.TEMPLATE_MEMBER_WRITE="template:member:write",t.TEMPLATE_MEMBER_DELETE="template:member:delete",t.TEMPLATE_MEMBER_VISIBILITY="template:member:visibility"}(n||(n={}));var r,o=function(t,e,r){var o,s;if(!r&&!e.includes("create"))return{canPerform:!1,message:"Missing required template object"};var u=(null==t?void 0:t.profile_id)||"BOGUS";if(!u)return{canPerform:!1,message:"Active session required"};var c=(null==r?void 0:r.profile_id)===u,a=(null==r?void 0:r.organization_id)===((null==t?void 0:t.organization_id)||"BOGUS"),l=null!==(o=null==r?void 0:r.is_personal)&&void 0!==o&&o,f=null!==(s=null==r?void 0:r.is_public)&&void 0!==s&&s,h=[];switch(e){case"create_personal":h.push(n.TEMPLATE_CREATOR_CREATE_PERSONAL);break;case"create_org":h.push(n.TEMPLATE_CREATOR_CREATE_ORG);break;case"create_public":h.push(n.TEMPLATE_CREATOR_CREATE_PUBLIC);break;case"read":c||(!l&&a||!f)&&h.push(n.TEMPLATE_MEMBER_READ);break;case"write":c||(h.push(n.TEMPLATE_MEMBER_READ),h.push(n.TEMPLATE_MEMBER_WRITE));break;case"change_visibility_personal":h.push(c?n.TEMPLATE_CREATOR_CREATE_PERSONAL:n.TEMPLATE_MEMBER_VISIBILITY);break;case"change_visibility_org":h.push(c?n.TEMPLATE_CREATOR_CREATE_ORG:n.TEMPLATE_MEMBER_VISIBILITY);break;case"change_visibility_public":c?(h.push(n.TEMPLATE_CREATOR_CREATE_PUBLIC),h.push(n.TEMPLATE_CREATOR_VISIBILITY)):h.push(n.TEMPLATE_MEMBER_VISIBILITY);break;case"delete":h.push(c?n.TEMPLATE_CREATOR_DELETE:n.TEMPLATE_MEMBER_DELETE);break;default:return{canPerform:!1,message:"Action is not defined"}}return i(t,h)?{canPerform:!0,message:""}:{canPerform:!1,message:"Insufficient access to perform '".concat(e,"'. Needed permissions: ").concat(h.toString())}},i=function(t,e){return e.every((function(e){return((null==t?void 0:t.permissions)||[]).includes(e)}))},s=function(t,e){return t.api.get("/templates/".concat(e)).then((function(t){return t.data}))},u=["name","is_personal","is_public","sender","description","roles","fields"],c=function(t,e,n){var r={timeout:12e4,onUploadProgress:function(t){var e=t.total||1,r=t.loaded||0;null==n||n(Math.floor(100*r/(e||1)),r,e||1)}};if(e.documents&&e.documents[0]instanceof File){var o=new FormData;return u.forEach((function(t){void 0!==e[t]&&o.append(t,e[t])})),e.documents.forEach((function(t){o.append("documents",t,t.name)})),t.api.post("/v2/templates",o,r).then((function(t){return t.data}))}return t.api.post("/v2/templates",e,r).then((function(t){return t.data}))},a=function(t,e,n){return t.api.put("/templates/".concat(e),n).then((function(t){return t.data}))},l=function(t,e){return t.api.delete("/templates/".concat(e)).then((function(t){return t.data}))};!function(t){t.CREATED_AT="created_at",t.UPDATED_AT="updated_at",t.NAME="name",t.LAST_USED_AT="last_used_at",t.COUNTER="counter",t.STAR_COUNTER="star_counter"}(r||(r={}));var f,h,d,m,p,b,w=function(t,e){return void 0===e&&(e={}),n=void 0,r=void 0,i=function(){return function(t,e){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(c){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,r=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){s.label=u[1];break}if(6===u[0]&&s.label<o[1]){s.label=o[1],o=u;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(u);break}o[2]&&s.ops.pop(),s.trys.pop();continue}u=e.call(t,s)}catch(t){u=[6,t],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}(this,(function(){return[2,t.api.post("/templates/list",e).then((function(t){return t.data}))]}))},new((o=void 0)||(o=Promise))((function(t,e){function s(t){try{c(i.next(t))}catch(t){e(t)}}function u(t){try{c(i.throw(t))}catch(t){e(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(t){t(n)}))).then(s,u)}c((i=i.apply(n,r||[])).next())}));var n,r,o,i};function y(t,e){return function(){return t.apply(e,arguments)}}!function(t){t.CREATOR="creator",t.ORGANIZATION_MEMBER="organization_member",t.ORGANIZATION_MEMBER_AS_CREATOR="organization_member_as_creator",t.EVERYONE="everyone",t.EVERYONE_AS_CREATOR="everyone_as_creator"}(f||(f={})),function(t){t.CREATE_PERSONAL="create_personal",t.CREATE_ORG="create_org",t.CREATE_PUBLIC="create_public",t.READ="read",t.WRITE="write",t.DELETE="delete",t.CHANGE_VISIBILITY_PERSONAL="change_visibility_personal",t.CHANGE_VISIBILITY_ORG="change_visibility_org",t.CHANGE_VISIBILITY_PUBLIC="change_visibility_public"}(h||(h={})),function(t){t.CREATED_AT="created_at",t.UPDATED_AT="updated_at",t.NAME="name",t.LAST_USED_AT="last_used_at",t.COUNTER="counter",t.STAR_COUNTER="star_counter"}(d||(d={})),function(t){t.RCOMMON="rcommon:access",t.RFORM_ACCESS="rform:access",t.ORG_CREATE="org:create",t.ORG_VIEW="org:view",t.ORG_UPDATE="org:update",t.ORG_DELETE="org:delete",t.ORG_TRANSFER="org:transfer",t.ORG_LIST="org:list",t.OWNER_ADD="owner:add",t.OWNER_REMOVE="owner:remove",t.ADMIN_ADD="admin:add",t.ADMIN_REMOVE="admin:remove",t.MEMBER_VIEW="member:view",t.MEMBER_ADD="member:add",t.MEMBER_REMOVE="member:remove",t.TEMPLATE_CREATOR_DELETE="template:creator:delete",t.TEMPLATE_CREATOR_VISIBILITY="template:creator:visibility",t.TEMPLATE_CREATOR_CREATE_ORG="template:creator:create:org",t.TEMPLATE_CREATOR_CREATE_PUBLIC="template:creator:create:public",t.TEMPLATE_CREATOR_CREATE_PERSONAL="template:creator:create:personal",t.TEMPLATE_MEMBER_READ="template:member:read",t.TEMPLATE_MEMBER_WRITE="template:member:write",t.TEMPLATE_MEMBER_DELETE="template:member:delete",t.TEMPLATE_MEMBER_VISIBILITY="template:member:visibility"}(m||(m={})),function(t){t.ENV_ESSENTIAL="env:essential",t.ORG_STANDARD="org:standard"}(p||(p={})),function(t){t.OWNER="owner",t.BASIC_USER="basic_user",t.MEMBER="member"}(b||(b={}));const{toString:g}=Object.prototype,{getPrototypeOf:v}=Object,O=(S=Object.create(null),t=>{const e=g.call(t);return S[e]||(S[e]=e.slice(8,-1).toLowerCase())});var S;const _=t=>(t=t.toLowerCase(),e=>O(e)===t),R=t=>e=>typeof e===t,{isArray:E}=Array,j=R("undefined"),A=_("ArrayBuffer"),T=R("string"),N=R("function"),P=R("number"),x=t=>null!==t&&"object"==typeof t,F=t=>{if("object"!==O(t))return!1;const e=v(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},B=_("Date"),U=_("File"),D=_("Blob"),k=_("FileList"),C=_("URLSearchParams");function L(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,o;if("object"!=typeof t&&(t=[t]),E(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let s;for(r=0;r<i;r++)s=o[r],e.call(null,t[s],s,t)}}function q(t,e){e=e.toLowerCase();const n=Object.keys(t);let r,o=n.length;for(;o-- >0;)if(r=n[o],e===r.toLowerCase())return r;return null}const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,M=t=>!j(t)&&t!==I,z=(J="undefined"!=typeof Uint8Array&&v(Uint8Array),t=>J&&t instanceof J);var J;const H=_("HTMLFormElement"),K=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),G=_("RegExp"),V=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};L(n,((n,o)=>{let i;!1!==(i=e(n,o,t))&&(r[o]=i||n)})),Object.defineProperties(t,r)},$="abcdefghijklmnopqrstuvwxyz",W={DIGIT:"0123456789",ALPHA:$,ALPHA_DIGIT:$+$.toUpperCase()+"0123456789"},X=_("AsyncFunction"),Z={isArray:E,isArrayBuffer:A,isBuffer:function(t){return null!==t&&!j(t)&&null!==t.constructor&&!j(t.constructor)&&N(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||N(t.append)&&("formdata"===(e=O(t))||"object"===e&&N(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&A(t.buffer),e},isString:T,isNumber:P,isBoolean:t=>!0===t||!1===t,isObject:x,isPlainObject:F,isUndefined:j,isDate:B,isFile:U,isBlob:D,isRegExp:G,isFunction:N,isStream:t=>x(t)&&N(t.pipe),isURLSearchParams:C,isTypedArray:z,isFileList:k,forEach:L,merge:function t(){const{caseless:e}=M(this)&&this||{},n={},r=(r,o)=>{const i=e&&q(n,o)||o;n[i]=F(n[i])&&F(r)?t(n[i],r):F(r)?t({},r):E(r)?r.slice():r};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&L(arguments[t],r);return n},extend:(t,e,n,{allOwnKeys:r}={})=>(L(e,((e,r)=>{t[r]=n&&N(e)?y(e,n):e}),{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let o,i,s;const u={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],r&&!r(s,t,e)||u[s]||(e[s]=t[s],u[s]=!0);t=!1!==n&&v(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:O,kindOfTest:_,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length);const r=t.indexOf(e,n-=e.length);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(E(t))return t;let e=t.length;if(!P(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:H,hasOwnProperty:K,hasOwnProp:K,reduceDescriptors:V,freezeMethods:t=>{V(t,((e,n)=>{if(N(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;N(t[n])&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return E(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:q,global:I,isContextDefined:M,ALPHABET:W,generateString:(t=16,e=W.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&N(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(x(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const o=E(t)?[]:{};return L(t,((t,e)=>{const i=n(t,r+1);!j(i)&&(o[e]=i)})),e[r]=void 0,o}}return t};return n(t,0)},isAsyncFn:X,isThenable:t=>t&&(x(t)||N(t))&&N(t.then)&&N(t.catch)};function Q(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}Z.inherits(Q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Z.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Y=Q.prototype,tt={};function et(t){return Z.isPlainObject(t)||Z.isArray(t)}function nt(t){return Z.endsWith(t,"[]")?t.slice(0,-2):t}function rt(t,e,n){return t?t.concat(e).map((function(t,e){return t=nt(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{tt[t]={value:t}})),Object.defineProperties(Q,tt),Object.defineProperty(Y,"isAxiosError",{value:!0}),Q.from=(t,e,n,r,o,i)=>{const s=Object.create(Y);return Z.toFlatObject(t,s,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),Q.call(s,t.message,e,n,r,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const ot=Z.toFlatObject(Z,{},null,(function(t){return/^is[A-Z]/.test(t)}));function it(t,e,n){if(!Z.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=Z.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!Z.isUndefined(e[t])}))).metaTokens,o=n.visitor||a,i=n.dots,s=n.indexes,u=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Z.isSpecCompliantForm(e);if(!Z.isFunction(o))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(Z.isDate(t))return t.toISOString();if(!u&&Z.isBlob(t))throw new Q("Blob is not supported. Use a Buffer instead.");return Z.isArrayBuffer(t)||Z.isTypedArray(t)?u&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function a(t,n,o){let u=t;if(t&&!o&&"object"==typeof t)if(Z.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(Z.isArray(t)&&function(t){return Z.isArray(t)&&!t.some(et)}(t)||(Z.isFileList(t)||Z.endsWith(n,"[]"))&&(u=Z.toArray(t)))return n=nt(n),u.forEach((function(t,r){!Z.isUndefined(t)&&null!==t&&e.append(!0===s?rt([n],r,i):null===s?n:n+"[]",c(t))})),!1;return!!et(t)||(e.append(rt(o,n,i),c(t)),!1)}const l=[],f=Object.assign(ot,{defaultVisitor:a,convertValue:c,isVisitable:et});if(!Z.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!Z.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),Z.forEach(n,(function(n,i){!0===(!(Z.isUndefined(n)||null===n)&&o.call(e,n,Z.isString(i)?i.trim():i,r,f))&&t(n,r?r.concat(i):[i])})),l.pop()}}(t),e}function st(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function ut(t,e){this._pairs=[],t&&it(t,this,e)}const ct=ut.prototype;function at(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function lt(t,e,n){if(!e)return t;const r=n&&n.encode||at,o=n&&n.serialize;let i;if(i=o?o(e,n):Z.isURLSearchParams(e)?e.toString():new ut(e,n).toString(r),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}ct.append=function(t,e){this._pairs.push([t,e])},ct.toString=function(t){const e=t?function(e){return t.call(this,e,st)}:st;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};class ft{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Z.forEach(this.handlers,(function(e){null!==e&&t(e)}))}}const ht={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ut,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},mt="undefined"!=typeof window&&"undefined"!=typeof document,pt=(bt="undefined"!=typeof navigator&&navigator.product,mt&&["ReactNative","NativeScript","NS"].indexOf(bt)<0);var bt;const wt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,yt={...Object.freeze({__proto__:null,hasBrowserEnv:mt,hasStandardBrowserWebWorkerEnv:wt,hasStandardBrowserEnv:pt}),...dt};function gt(t){function e(t,n,r,o){let i=t[o++];const s=Number.isFinite(+i),u=o>=t.length;return i=!i&&Z.isArray(r)?r.length:i,u?(r[i]=Z.hasOwnProp(r,i)?[r[i],n]:n,!s):(r[i]&&Z.isObject(r[i])||(r[i]=[]),e(t,n,r[i],o)&&Z.isArray(r[i])&&(r[i]=function(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],e[i]=t[i];return e}(r[i])),!s)}if(Z.isFormData(t)&&Z.isFunction(t.entries)){const n={};return Z.forEachEntry(t,((t,r)=>{e(function(t){return Z.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null}const vt={transitional:ht,adapter:["xhr","http"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,o=Z.isObject(t);if(o&&Z.isHTMLForm(t)&&(t=new FormData(t)),Z.isFormData(t))return r&&r?JSON.stringify(gt(t)):t;if(Z.isArrayBuffer(t)||Z.isBuffer(t)||Z.isStream(t)||Z.isFile(t)||Z.isBlob(t))return t;if(Z.isArrayBufferView(t))return t.buffer;if(Z.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return it(t,new yt.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return yt.isNode&&Z.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=Z.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return it(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||r?(e.setContentType("application/json",!1),function(t){if(Z.isString(t))try{return(0,JSON.parse)(t),Z.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||vt.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(t&&Z.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw Q.from(t,Q.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yt.classes.FormData,Blob:yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(["delete","get","head","post","put","patch"],(t=>{vt.headers[t]={}}));const Ot=Z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),St=Symbol("internals");function _t(t){return t&&String(t).trim().toLowerCase()}function Rt(t){return!1===t||null==t?t:Z.isArray(t)?t.map(Rt):String(t)}function Et(t,e,n,r,o){return Z.isFunction(r)?r.call(this,e,n):(o&&(e=n),Z.isString(e)?Z.isString(r)?-1!==e.indexOf(r):Z.isRegExp(r)?r.test(e):void 0:void 0)}class jt{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function o(t,e,n){const o=_t(e);if(!o)throw new Error("header name must be a non-empty string");const i=Z.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||e]=Rt(t))}const i=(t,e)=>Z.forEach(t,((t,n)=>o(t,n,e)));return Z.isPlainObject(t)||t instanceof this.constructor?i(t,e):Z.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim())?i((t=>{const e={};let n,r,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),n=t.substring(0,o).trim().toLowerCase(),r=t.substring(o+1).trim(),!n||e[n]&&Ot[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e):null!=t&&o(e,t,n),this}get(t,e){if(t=_t(t)){const n=Z.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(Z.isFunction(e))return e.call(this,t,n);if(Z.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=_t(t)){const n=Z.findKey(this,t);return!(!n||void 0===this[n]||e&&!Et(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function o(t){if(t=_t(t)){const o=Z.findKey(n,t);!o||e&&!Et(0,n[o],o,e)||(delete n[o],r=!0)}}return Z.isArray(t)?t.forEach(o):o(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const o=e[n];t&&!Et(0,this[o],o,t,!0)||(delete this[o],r=!0)}return r}normalize(t){const e=this,n={};return Z.forEach(this,((r,o)=>{const i=Z.findKey(n,o);if(i)return e[i]=Rt(r),void delete e[o];const s=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete e[o],e[s]=Rt(r),n[s]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return Z.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&Z.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[St]=this[St]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=_t(t);e[r]||(function(t,e){const n=Z.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,o){return this[r].call(this,e,t,n,o)},configurable:!0})}))}(n,t),e[r]=!0)}return Z.isArray(t)?t.forEach(r):r(t),this}}function At(t,e){const n=this||vt,r=e||n,o=jt.from(r.headers);let i=r.data;return Z.forEach(t,(function(t){i=t.call(n,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function Tt(t){return!(!t||!t.__CANCEL__)}function Nt(t,e,n){Q.call(this,null==t?"canceled":t,Q.ERR_CANCELED,e,n),this.name="CanceledError"}jt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Z.reduceDescriptors(jt.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}})),Z.freezeMethods(jt),Z.inherits(Nt,Q,{__CANCEL__:!0});const Pt=yt.hasStandardBrowserEnv?{write(t,e,n,r,o,i){const s=[t+"="+encodeURIComponent(e)];Z.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),Z.isString(r)&&s.push("path="+r),Z.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function xt(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Ft=yt.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let n;function r(n){let r=n;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return n=r(window.location.href),function(t){const e=Z.isString(t)?r(t):t;return e.protocol===n.protocol&&e.host===n.host}}():function(){return!0};function Bt(t,e){let n=0;const r=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o,i=0,s=0;return e=void 0!==e?e:1e3,function(u){const c=Date.now(),a=r[s];o||(o=c),n[i]=u,r[i]=c;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),c-o<e)return;const h=a&&c-a;return h?Math.round(1e3*f/h):void 0}}(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,u=i-n,c=r(u);n=i;const a={loaded:i,total:s,progress:s?i/s:void 0,bytes:u,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:o};a[e?"download":"upload"]=!0,t(a)}}const Ut={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){let r=t.data;const o=jt.from(t.headers).normalize();let i,s,{responseType:u,withXSRFToken:c}=t;function a(){t.cancelToken&&t.cancelToken.unsubscribe(i),t.signal&&t.signal.removeEventListener("abort",i)}if(Z.isFormData(r))if(yt.hasStandardBrowserEnv||yt.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(s=o.getContentType())){const[t,...e]=s?s.split(";").map((t=>t.trim())).filter(Boolean):[];o.setContentType([t||"multipart/form-data",...e].join("; "))}let l=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",n=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(e+":"+n))}const f=xt(t.baseURL,t.url);function h(){if(!l)return;const r=jt.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new Q("Request failed with status code "+n.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}((function(t){e(t),a()}),(function(t){n(t),a()}),{data:u&&"text"!==u&&"json"!==u?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:t,request:l}),l=null}if(l.open(t.method.toUpperCase(),lt(f,t.params,t.paramsSerializer),!0),l.timeout=t.timeout,"onloadend"in l?l.onloadend=h:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(h)},l.onabort=function(){l&&(n(new Q("Request aborted",Q.ECONNABORTED,t,l)),l=null)},l.onerror=function(){n(new Q("Network Error",Q.ERR_NETWORK,t,l)),l=null},l.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(new Q(e,(t.transitional||ht).clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,t,l)),l=null},yt.hasStandardBrowserEnv&&(c&&Z.isFunction(c)&&(c=c(t)),c||!1!==c&&Ft(f))){const e=t.xsrfHeaderName&&t.xsrfCookieName&&Pt.read(t.xsrfCookieName);e&&o.set(t.xsrfHeaderName,e)}void 0===r&&o.setContentType(null),"setRequestHeader"in l&&Z.forEach(o.toJSON(),(function(t,e){l.setRequestHeader(e,t)})),Z.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),u&&"json"!==u&&(l.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&l.addEventListener("progress",Bt(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",Bt(t.onUploadProgress)),(t.cancelToken||t.signal)&&(i=e=>{l&&(n(!e||e.type?new Nt(null,t,l):e),l.abort(),l=null)},t.cancelToken&&t.cancelToken.subscribe(i),t.signal&&(t.signal.aborted?i():t.signal.addEventListener("abort",i)));const d=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(f);d&&-1===yt.protocols.indexOf(d)?n(new Q("Unsupported protocol "+d+":",Q.ERR_BAD_REQUEST,t)):l.send(r||null)}))}};Z.forEach(Ut,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Dt=t=>`- ${t}`,kt=t=>Z.isFunction(t)||null===t||!1===t,Ct=t=>{t=Z.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let i=0;i<e;i++){let e;if(n=t[i],r=n,!kt(n)&&(r=Ut[(e=String(n)).toLowerCase()],void 0===r))throw new Q(`Unknown adapter '${e}'`);if(r)break;o[e||"#"+i]=r}if(!r){const t=Object.entries(o).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));throw new Q("There is no suitable adapter to dispatch the request "+(e?t.length>1?"since :\n"+t.map(Dt).join("\n"):" "+Dt(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Lt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Nt(null,t)}function qt(t){return Lt(t),t.headers=jt.from(t.headers),t.data=At.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Ct(t.adapter||vt.adapter)(t).then((function(e){return Lt(t),e.data=At.call(t,t.transformResponse,e),e.headers=jt.from(e.headers),e}),(function(e){return Tt(e)||(Lt(t),e&&e.response&&(e.response.data=At.call(t,t.transformResponse,e.response),e.response.headers=jt.from(e.response.headers))),Promise.reject(e)}))}const It=t=>t instanceof jt?t.toJSON():t;function Mt(t,e){e=e||{};const n={};function r(t,e,n){return Z.isPlainObject(t)&&Z.isPlainObject(e)?Z.merge.call({caseless:n},t,e):Z.isPlainObject(e)?Z.merge({},e):Z.isArray(e)?e.slice():e}function o(t,e,n){return Z.isUndefined(e)?Z.isUndefined(t)?void 0:r(void 0,t,n):r(t,e,n)}function i(t,e){if(!Z.isUndefined(e))return r(void 0,e)}function s(t,e){return Z.isUndefined(e)?Z.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function u(n,o,i){return i in e?r(n,o):i in t?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u,headers:(t,e)=>o(It(t),It(e),!0)};return Z.forEach(Object.keys(Object.assign({},t,e)),(function(r){const i=c[r]||o,s=i(t[r],e[r],r);Z.isUndefined(s)&&i!==u||(n[r]=s)})),n}const zt={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{zt[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const Jt={};zt.transitional=function(t,e,n){function r(t,e){return"[Axios v1.6.2] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,o,i)=>{if(!1===t)throw new Q(r(o," has been removed"+(e?" in "+e:"")),Q.ERR_DEPRECATED);return e&&!Jt[o]&&(Jt[o]=!0,console.warn(r(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,o,i)}};const Ht={assertOptions:function(t,e,n){if("object"!=typeof t)throw new Q("options must be an object",Q.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],s=e[i];if(s){const e=t[i],n=void 0===e||s(e,i,t);if(!0!==n)throw new Q("option "+i+" must be "+n,Q.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Q("Unknown option "+i,Q.ERR_BAD_OPTION)}},validators:zt},Kt=Ht.validators;class Gt{constructor(t){this.defaults=t,this.interceptors={request:new ft,response:new ft}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Mt(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:o}=e;void 0!==n&&Ht.assertOptions(n,{silentJSONParsing:Kt.transitional(Kt.boolean),forcedJSONParsing:Kt.transitional(Kt.boolean),clarifyTimeoutError:Kt.transitional(Kt.boolean)},!1),null!=r&&(Z.isFunction(r)?e.paramsSerializer={serialize:r}:Ht.assertOptions(r,{encode:Kt.function,serialize:Kt.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&Z.merge(o.common,o[e.method]);o&&Z.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=jt.concat(i,o);const s=[];let u=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(u=u&&t.synchronous,s.unshift(t.fulfilled,t.rejected))}));const c=[];let a;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let l,f=0;if(!u){const t=[qt.bind(this),void 0];for(t.unshift.apply(t,s),t.push.apply(t,c),l=t.length,a=Promise.resolve(e);f<l;)a=a.then(t[f++],t[f++]);return a}l=s.length;let h=e;for(f=0;f<l;){const t=s[f++],e=s[f++];try{h=t(h)}catch(t){e.call(this,t);break}}try{a=qt.call(this,h)}catch(t){return Promise.reject(t)}for(f=0,l=c.length;f<l;)a=a.then(c[f++],c[f++]);return a}getUri(t){return lt(xt((t=Mt(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}Z.forEach(["delete","get","head","options"],(function(t){Gt.prototype[t]=function(e,n){return this.request(Mt(n||{},{method:t,url:e,data:(n||{}).data}))}})),Z.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,o){return this.request(Mt(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Gt.prototype[t]=e(),Gt.prototype[t+"Form"]=e(!0)}));class Vt{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,o){n.reason||(n.reason=new Nt(t,r,o),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new Vt((function(e){t=e})),cancel:t}}}const $t={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries($t).forEach((([t,e])=>{$t[e]=t}));const Wt=function t(e){const n=new Gt(e),r=y(Gt.prototype.request,n);return Z.extend(r,Gt.prototype,n,{allOwnKeys:!0}),Z.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(Mt(e,n))},r}(vt);Wt.Axios=Gt,Wt.CanceledError=Nt,Wt.CancelToken=Vt,Wt.isCancel=Tt,Wt.VERSION="1.6.2",Wt.toFormData=it,Wt.AxiosError=Q,Wt.Cancel=Wt.CanceledError,Wt.all=function(t){return Promise.all(t)},Wt.spread=function(t){return function(e){return t.apply(null,e)}},Wt.isAxiosError=function(t){return Z.isObject(t)&&!0===t.isAxiosError},Wt.mergeConfig=Mt,Wt.AxiosHeaders=jt,Wt.formToJSON=t=>gt(Z.isHTMLForm(t)?new FormData(t):t),Wt.getAdapter=Ct,Wt.HttpStatusCode=$t,Wt.default=Wt;var Xt=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")},Zt=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return Xt()}try{return __global__||Xt()}finally{delete Object.prototype.__global__}}(),Qt=Symbol.for("verdocs-default-endpoint"),Yt=function(t){return console.debug("[JS-SDK] ".concat(t.method.toUpperCase()," ").concat(t.baseURL).concat(t.url),t.data?JSON.stringify(t.data):""),t},te=function(){function e(t){this.environment="verdocs",this.sessionType="user",this.baseURL="https://beta.verdocs.com"===window.location.origin?"https://stage-api.verdocs.com":"https://api.verdocs.com",this.clientID="not-set",this.timeout=6e4,this.token=null,this.nextListenerId=0,this.sessionListeners=new Map,this.requestLoggerId=null,this.session=null,this.baseURL=(null==t?void 0:t.baseURL)||this.baseURL,this.timeout=(null==t?void 0:t.timeout)||this.timeout,this.environment=(null==t?void 0:t.environment)||this.environment,this.sessionType=(null==t?void 0:t.sessionType)||this.sessionType,this.clientID=(null==t?void 0:t.clientID)||this.clientID,this.api=Wt.create({baseURL:this.baseURL,timeout:this.timeout})}return e.prototype.setDefault=function(){Zt[Qt]=this},e.getDefault=function(){return Zt[Qt]||(Zt[Qt]=new e,window.console.debug("[JS_SDK] Created default endpoint",Zt[Qt].baseURL)),Zt[Qt]},e.prototype.getEnvironment=function(){return this.environment},e.prototype.getSessionType=function(){return this.sessionType},e.prototype.getBaseURL=function(){return this.baseURL},e.prototype.getClientID=function(){return this.clientID},e.prototype.getTimeout=function(){return this.timeout},e.prototype.getSession=function(){return this.session},e.prototype.setEnvironment=function(t){return this.environment=t,this},e.prototype.setSessionType=function(t){return this.sessionType=t,this},e.prototype.setBaseURL=function(t){return this.baseURL=t,this.api.defaults.baseURL=t,this},e.prototype.setClientID=function(t){return this.clientID=t,this.api.defaults.headers.common["X-Client-ID"]=t,this},e.prototype.setTimeout=function(t){return this.timeout=t,this.api.defaults.timeout=t,this},e.prototype.logRequests=function(t){return t&&null===this.requestLoggerId?this.requestLoggerId=this.api.interceptors.request.use(Yt):t||null===this.requestLoggerId||this.api.interceptors.request.eject(this.requestLoggerId),this},e.prototype.setToken=function(e){if(!e)return this.clearSession();var n=t(e);return null===n||n.exp&&1e3*n.exp<(new Date).getTime()?(window.console.warn("[JS_SDK] Ignoring attempt to use expired session token"),this.clearSession()):(this.token=e,this.session=n,"user"===this.sessionType?this.api.defaults.headers.common.Authorization="Bearer ".concat(e):this.api.defaults.headers.common.signer="Bearer ".concat(e),localStorage.setItem(this.sessionStorageKey(),e),this.notifySessionListeners(),this)},e.prototype.getToken=function(){return this.token},e.prototype.sessionStorageKey=function(){return"verdocs-session-".concat(this.getSessionType(),"-").concat(this.getEnvironment())},e.prototype.clearSession=function(){return localStorage.removeItem(this.sessionStorageKey()),delete this.api.defaults.headers.common.Authorization,delete this.api.defaults.headers.common.signer,this.session=null,this.token=null,this.notifySessionListeners(),this},e.prototype.clearSignerSession=function(){return localStorage.removeItem(this.sessionStorageKey()),delete this.api.defaults.headers.common.Authorization,this.session=null,this.token=null,this.notifySessionListeners(),this},e.prototype.notifySessionListeners=function(){var t=this;this.sessionListeners.forEach((function(e){try{e(t,t.session)}catch(t){}}))},e.prototype.onSessionChanged=function(t){var e=this;this.nextListenerId++;var n=Symbol.for(""+this.nextListenerId);return this.sessionListeners.set(n,t),function(){e.sessionListeners.delete(n)}},e.prototype.loadSession=function(){var t=localStorage.getItem(this.sessionStorageKey());return t?this.setToken(t):this.clearSession()},e}();export{f as T,te as V,h as a,c as b,o as c,l as d,s as g,w as l,a as u}
|
@@ -1 +0,0 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,o,i){function r(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,n){function s(e){try{l(i.next(e))}catch(e){n(e)}}function a(e){try{l(i["throw"](e))}catch(e){n(e)}}function l(e){e.done?o(e.value):r(e.value).then(s,a)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,r,n,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(o)try{if(i=1,r&&(n=s[0]&2?r["return"]:s[0]?r["throw"]||((n=r["return"])&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;if(r=0,n)s=[s[0]&2,n.value];switch(s[0]){case 0:case 1:n=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;r=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(n=o.trys,n=n.length>0&&n[n.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(s[0]===6&&o.label<n[1]){o.label=n[1];n=s;break}if(n&&o.label<n[2]){o.label=n[2];o.ops.push(s);break}if(n[2])o.ops.pop();o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e];r=0}finally{i=n=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,o){if(o||arguments.length===2)for(var i=0,r=t.length,n;i<r;i++){if(n||!(i in t)){if(!n)n=Array.prototype.slice.call(t,0,i);n[i]=t[i]}}return e.concat(n||Array.prototype.slice.call(t))};System.register(["./p-fbb8023f.system.js","./p-015163c1.system.js","./p-54498887.system.js","./p-9bf2d124.system.js","./p-b1288daf.system.js","./p-3bcd86ea.system.js","./p-95080569.system.js","./p-cacffa79.system.js","./p-8324a7a3.system.js","./p-cff87d52.system.js","./p-187b20b7.system.js","./p-05eb4fed.system.js","./p-bbee73c8.system.js","./p-3af6b910.system.js","./p-8aae8d16.system.js","./p-d8cd6b59.system.js","./p-dc9c4361.system.js"],(function(e){"use strict";var t,o,i,r,n,s,a,l,d,c,p,u,h,m,f,g,v,x,b,w,y,E,S,k,_,q,R,C,I;return{setters:[function(e){t=e.r;o=e.c;i=e.h;r=e.H;n=e.F;s=e.a},function(e){a=e.i},function(){},function(e){l=e.V;d=e.T;c=e.u},function(e){p=e.u;u=e.c},function(e){h=e.i},function(e){m=e.g;f=e.u},function(e){g=e.r;v=e.e;x=e.f;b=e.b;w=e.h;y=e.i},function(e){E=e.g;S=e.c;k=e.u;_=e.d;q=e.a},function(e){R=e.g},function(e){C=e.S},function(e){I=e.g},function(){},function(){},function(){},function(){},function(){}],execute:function(){var M;var A=function(e,t,o){return e.api.post("/templates/".concat(t,"/roles"),o).then((function(e){return e.data}))};var L=function(e,t,o,i){return e.api.put("/templates/".concat(t,"/roles/").concat(o),i).then((function(e){return e.data}))};var Z=function(e,t,o){return e.api.delete("/templates/".concat(t,"/roles/").concat(o)).then((function(e){return e.data}))};var N="verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields #verdocs-template-fields-toolbar{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio_button_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";var z='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>';var T='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z"/></svg>';var O='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>';var V='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>';var H='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>';var D='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>';var P='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>';var B='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z"></path></svg>';var F='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>';var j='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>';var U=[{id:"signature",tooltip:"Signature",icon:D},{id:"initial",tooltip:"Initials",icon:P},{id:"sep1",tooltip:"",icon:j},{id:"textbox",tooltip:"Text Box",icon:z},{id:"textarea",tooltip:"Text Area",icon:T},{id:"checkbox_group",tooltip:"Check Box",icon:O},{id:"radio_button_group",tooltip:"Radio Button",icon:V},{id:"dropdown",tooltip:"Dropdown",icon:F},{id:"sep2",tooltip:"",icon:j},{id:"date",tooltip:"Date",icon:H},{id:"timestamp",tooltip:"Timestamp",icon:B}];var Q=e("verdocs_template_fields",function(){function e(e){t(this,e);this.sdkError=o(this,"sdkError",7);this.templateUpdated=o(this,"templateUpdated",7);this.fieldsUpdated=o(this,"fieldsUpdated",7);this.pageHeights={};this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.cachedPageInfo={};this.endpoint=l.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.showMustSelectRole=false;this.selectedRoleName="";this.loading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o;var i=this;return __generator(this,(function(r){try{this.endpoint.loadSession();if(!this.templateId){console.log("[FIELDS] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[FIELDS] Unable to start builder session, must be authenticated");return[2]}R(this.endpoint,this.templateId,true).then((function(e){var t,o;i.templateStore=e;console.log("[PREVIEW] Loaded Template Store",e.state);i.fieldStore=m(i.templateId);i.roleStore=E(i.templateId);i.selectedRoleName=((o=(t=i.roleStore.get("roles"))===null||t===void 0?void 0:t[0])===null||o===void 0?void 0:o.name)||"";console.log("[PREVIEW] Loaded template",i.templateStore.state,i.roleStore.get("roles"),i.fieldStore.get("fields"));i.loading=false;i.fieldStore.onChange("fields",(function(e){var t;console.log("[FIELDS] Fields changed",{fields:e});(t=i.fieldsUpdated)===null||t===void 0?void 0:t.emit({event:"updated",endpoint:i.endpoint,templateId:i.templateId,fields:e})}))})).catch((function(e){console.log(e)}))}catch(i){console.log("[FIELDS] Error with preview session",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new C(i.message,(t=i.response)===null||t===void 0?void 0:t.status,(o=i.response)===null||o===void 0?void 0:o.data))}return[2]}))}))};e.prototype.componentDidRender=function(){a.dynamicDrop(true);var e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null;var t=document.getElementById("verdocs-template-fields-toolbar");if(e&&t){console.log("[FIELDS] Moving toolbar");t.remove();e.append(t)}};e.prototype.componentWillUpdate=function(){var e=this;var t;var o=this.roleStore.get("roles");if(!this.selectedRoleName||!o.find((function(t){return t&&t.name===e.selectedRoleName}))){this.selectedRoleName=((t=o[0])===null||t===void 0?void 0:t.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}};e.prototype.handleKeyDown=function(e){if(e.key==="Escape"){this.placing=null}};e.prototype.handleFieldChange=function(e,t,o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){console.log("[FIELDS] handleFieldChange",e,t,o);return[2]}))}))};e.prototype.attachFieldAttributes=function(e,t,o){var i=this;o.addEventListener("input",(function(e){return i.handleFieldChange(t,e)}));o.addEventListener("settingsChanged",(function(e){var t,o;console.log("Settings changed",e.detail);(t=i.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:i.endpoint,template:(o=i.templateStore)===null||o===void 0?void 0:o.state,event:"added-field"})}));o.addEventListener("deleted",(function(){var e,r;console.log("[FIELDS] Deleted",i,t);o.remove();(e=i.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:i.endpoint,template:(r=i.templateStore)===null||r===void 0?void 0:r.state,event:"updated-field"})}));o.setAttribute("templateid",this.templateId);o.setAttribute("fieldname",t.name);o.setAttribute("pageNumber",e.pageNumber);o.setAttribute("xScale",e.xScale);o.setAttribute("yScale",e.yScale);o.setAttribute("name",t.name)};e.prototype.handlePageRendered=function(e){var t=this;var o=e.detail;console.log("[FIELDS] Page rendered",o.pageNumber,o.xScale,o.yScale);this.cachedPageInfo[o.pageNumber]=o;this.pageHeights[o.pageNumber]=o.naturalHeight;this.fieldStore.get("fields").filter((function(e){return e&&e.page_sequence===o.pageNumber})).forEach((function(e){var o=b(e);var i=document.getElementById(o);if(i){i.setAttribute("fieldname",e.name);i.setAttribute("pagenumber",String(e.page_sequence));t.makeDraggable(i)}}))};e.prototype.reRenderField=function(e,t){var o=this;var i=this.cachedPageInfo[t];var r=g(e,i,{disabled:true,editable:true,draggable:true});if(!r){return}if(Array.isArray(r)){r.forEach((function(t){o.attachFieldAttributes(i,e,t);o.makeDraggable(t)}))}else{this.attachFieldAttributes(i,e,r);this.makeDraggable(r)}};e.prototype.makeDraggable=function(e){a(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})};e.prototype.handleMoveField=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o,i,r,n,s;return __generator(this,(function(a){t=+(e.target.getAttribute("posX")||0);o=+(e.target.getAttribute("posY")||0);i=+(e.target.getAttribute("xScale")||1);r=+(e.target.getAttribute("yScale")||1);n=e.dx/i+t;s=e.dy/r+o;e.target.setAttribute("posX",n);e.target.setAttribute("posy",s);v(e.target,"translate","".concat(n,"px, ").concat(s,"px"));return[2]}))}))};e.prototype.handleMoveEnd=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o,i,r,n,s,a,l,d,c,u,h,m,g,v,b,E,S,k,_,q,R,C,I,M;return __generator(this,(function(A){switch(A.label){case 0:i=e.target.getAttribute("fieldname");r=+(e.target.getAttribute("option")||"0");n=this.fieldStore.get("fields").find((function(e){return e.name===i}));if(!n){console.log("[FIELDS] Unable to find field",i,e.target);return[2]}s=e.target.getAttribute("pagenumber");a=this.cachedPageInfo[s],l=a.naturalWidth,d=l===void 0?612:l,c=a.naturalHeight,u=c===void 0?792:c,h=a.renderedHeight,m=h===void 0?792:h;g=e.target.getBoundingClientRect();v=e.target.parentElement;b=v.getBoundingClientRect();E=n.setting.width||w(n.type);S=n.setting.height||y(n.type);k=Math.max(g.left-b.left,0);_=Math.max(m-(b.bottom-g.bottom),0);q=this.viewCoordinatesToPageCoordinates(k,_,s,d-E,u-S),R=q.x,C=q.y;switch(n.type){case"attachment":case"payment":case"initial":case"signature":case"date":case"dropdown":case"textarea":case"textbox":case"timestamp":n.setting.x=R;n.setting.y=C;break;case"checkbox_group":case"radio_button_group":{I=n.setting.options[r];if(I){I.x=R;I.y=C}}break}console.log("[FIELDS] Will update",i,C,r,n);return[4,p(this.endpoint,this.templateId,i,n)];case 1:M=A.sent();f(this.fieldStore,i,M);e.target.removeAttribute("posX");e.target.removeAttribute("posY");console.log("Will remove CSS transform",e.target.style.transform);x(e.target);console.log("[FIELDS] Updated",i,M);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:(o=this.templateStore)===null||o===void 0?void 0:o.state,event:"updated-field"});return[2]}}))}))};e.prototype.generateFieldName=function(e,t){var o=1;var i;do{i="".concat(e,"P").concat(t,"-").concat(o);o++}while(this.fieldStore.get("fields").some((function(e){return e&&e.name===i})));return i};e.prototype.viewCoordinatesToPageCoordinates=function(e,t,o,i,r){var n=this.cachedPageInfo[o],s=n.xScale,a=s===void 0?1:s,l=n.yScale,d=l===void 0?1:l,c=n.renderedHeight,p=c===void 0?792:c;var u=Math.floor(Math.min(e/a,i));var h=Math.floor(Math.min(Math.max(p-t,0)/d,r));return{x:u,y:h}};e.prototype.handleClickPage=function(e,t){return __awaiter(this,void 0,void 0,(function(){var o,i,r,n,s,a,l,d,c,p,h,m,f,g,v,x;return __generator(this,(function(b){switch(b.label){case 0:if(!this.placing)return[3,2];r=e.offsetX;n=e.offsetY;s=w(this.placing);a=y(this.placing);l=this.cachedPageInfo[t];d=l.naturalWidth,c=d===void 0?612:d,p=l.naturalHeight,h=p===void 0?792:p;m=this.viewCoordinatesToPageCoordinates(r,n,t,c-s,h-a);f=Math.floor(m.x);g=Math.floor(m.y);v={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,document_id:l.documentId,type:this.placing,required:true,page_sequence:t,validator:null,setting:{x:f,y:g},x:f,y:g,tabindex:0,width:s,height:a};console.log("[FIELDS] Will save new field",v);switch(v.type){case"attachment":case"payment":v.setting={x:f,y:g};break;case"initial":case"signature":v.setting={x:f,y:g,result:""};break;case"checkbox_group":v.setting={minimum_checked:0,maximum_checked:1e3,options:[{id:"".concat(v.name,"-1"),value:"Option 1",checked:false,x:f,y:g}]};break;case"date":v.setting={x:f,y:g,width:s,height:a,result:""};break;case"dropdown":v.required=false;v.setting={x:f,y:g,width:s,height:a,value:null,placeholder:"Choose",options:[{id:"option-1",value:"Option 1"}]};break;case"radio_button_group":v.setting={options:[{id:"".concat(v.name,"-1"),value:"Option 1",selected:false,x:f,y:g}]};break;case"textarea":case"textbox":v.setting={x:f,y:g,width:s,height:a,result:"",leading:0,alignment:0,upperCase:false};break;case"timestamp":v.setting={x:f,y:g,width:s,height:a};break}if(v.type==="textarea"){v.setting.leading=16;v.type="textbox"}return[4,u(this.endpoint,this.templateId,v)];case 1:x=b.sent();console.log("[FIELDS] Saved field",x);this.fieldStore.set("fields",__spreadArray(__spreadArray([],this.fieldStore.get("fields"),true),[x],false));this.placing=null;this.reRenderField(x,t);(o=this.templateUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,template:(i=this.templateStore)===null||i===void 0?void 0:i.state,event:"added-field"});b.label=2;case 2:return[2]}}))}))};e.prototype.render=function(){var e;var t=this;var o,n,s;if(!this.endpoint.session){return i(r,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading||!((o=this.templateStore)===null||o===void 0?void 0:o.state.isLoaded)){return i(r,null,i("verdocs-loader",null))}var a=this.roleStore.get("roles").map((function(e){return{value:e.name,label:e.name}}));return i(r,{class:this.placing?(e={},e["placing-".concat(this.placing)]=true,e):{},onSubmit:function(){}},i("div",{id:"verdocs-template-fields-toolbar"},i("div",{class:"add-for"},"Add field:"),i("verdocs-select-input",{value:this.selectedRoleName,options:a,onInput:function(e){return t.selectedRoleName=e.target.value}}),U.map((function(e){return i("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:function(){if(e.tooltip){if(t.selectedRoleName){t.placing=e.id}else{t.showMustSelectRole=true}}}})}))),i("div",{class:"pages"},(((s=(n=this.templateStore)===null||n===void 0?void 0:n.state)===null||s===void 0?void 0:s.template_documents)||[]).map((function(e){var o=h(1,e.page_numbers);return o.map((function(o){return i("verdocs-template-document-page",{templateId:t.templateId,documentId:e.id,pageNumber:o,virtualWidth:612,virtualHeight:792,editable:true,done:false,onClick:function(e){return t.handleClickPage(e,o)},onPageRendered:function(e){return t.handlePageRendered(e)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})}))}))),this.showMustSelectRole&&i("verdocs-ok-dialog",{heading:"Unable to add field",message:this.roleStore.get("roles").length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:function(){return t.showMustSelectRole=false}}))};return e}());Q.style=N;var Y='verdocs-template-role-properties{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-template-role-properties .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-role-properties .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-role-properties verdocs-text-input{margin:0 0 10px 0}verdocs-template-role-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}';var W='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>';var G=e("verdocs_template_role_properties",function(){function e(e){t(this,e);this.close=o(this,"close",7);this.delete=o(this,"delete",7);this.sdkError=o(this,"sdkError",7);this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.endpoint=l.getDefault();this.templateId="";this.roleName="";this.sender=d.EVERYONE;this.dirty=false;this.saving=false;this.name="";this.type="signer";this.full_name="";this.email="";this.phone="";this.delegator=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,i,r,n;var s=this;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLE_PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLE_PROPERTIES] Unable to start builder session, must be authenticated");return[2]}i=this;return[4,R(this.endpoint,this.templateId,false)];case 1:i.templateStore=a.sent();this.fieldStore=m(this.templateId);this.roleStore=S(this.templateStore.state);r=this.roleStore.state.roles.find((function(e){return e.name===s.roleName}));if(r){this.name=r.name;this.type=r.type;this.full_name=r.full_name;this.email=r.email;this.phone=r.phone;this.delegator=r.delegator;console.log("[ROLE_PROPERTIES] Editing role",r)}return[3,3];case 2:n=a.sent();console.log("[ROLE_PROPERTIES Error with preview session",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new C(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(o=n.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t=this;var o;e.stopPropagation();var i=this.roleStore.state.roles.find((function(e){return e.name===t.roleName}));if(i){this.name=i.name;this.type=i.type;this.full_name=i.full_name;this.email=i.email;this.phone=i.phone;this.delegator=i.delegator}this.dirty=false;(o=this.close)===null||o===void 0?void 0:o.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){e.stopPropagation();this.saving=true;L(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,full_name:this.full_name,email:this.email,phone:this.phone,delegator:this.delegator}).then((function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(o){console.log("[ROLE_PROPERTIES] Update result",e);this.saving=false;this.dirty=false;k(this.roleStore,this.roleName,e);(t=this.close)===null||t===void 0?void 0:t.emit();return[2]}))}))})).catch((function(e){console.log("[ROLE_PROPERTIES Update error",e);t.saving=false}));return[2]}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){e.stopPropagation();if(window.confirm("Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.")){Z(this.endpoint,this.templateId,this.roleName).then((function(){var e;_(t.roleStore,t.roleName);(e=t.delete)===null||e===void 0?void 0:e.emit({templateId:t.templateId,roleName:t.roleName})})).catch((function(e){console.log("[ROLE_PROPERTIES Deletion error",e)}))}return[2]}))}))};e.prototype.render=function(){var e=this;var t=this.fieldStore.get("fields").some((function(t){return t.role_name===e.roleName}));return i(r,null,i("div",{class:"background-overlay",onClick:function(t){return e.handleCancel(t)}},i("div",{class:"dialog"},i("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},i("verdocs-text-input",{id:"verdocs-role-name",label:"Role Name",value:this.name,autocomplete:"off",disabled:t,helpText:t?"This role has fields assigned and can no longer be renamed.":"A unique name to identify the role in the workflow. Submitted data will also be tagged with this value.",placeholder:"Role Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}}),i("div",{class:"row"},i("div",{class:"input-label"},"Type:"),i("verdocs-select-input",{value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:function(t){e.type=t.target.value;e.dirty=true}}),i("verdocs-help-icon",{text:"Most participants are Signers. CC roles are notified when documents are signed, but have no other actions. Approvers get notified when signing is completed to perform a final review."})),i("verdocs-text-input",{id:"verdocs-recipient-email",label:"Full Name",value:this.full_name,autocomplete:"off",helpText:"The recipient's full name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Full Name...",onInput:function(t){e.full_name=t.target.value;e.dirty=true}}),i("verdocs-text-input",{id:"verdocs-recipient-email",label:"Email",value:this.email,autocomplete:"off",helpText:"The recipient's email address, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Email Address...",onInput:function(t){e.email=t.target.value;e.dirty=true}}),i("verdocs-text-input",{id:"verdocs-recipient-phone",label:"Phone",value:this.phone,autocomplete:"off",helpText:"The recipient's phone number, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Phone Number...",onInput:function(t){e.phone=t.target.value;e.dirty=true}}),i("div",{class:"row"},i("div",{class:"input-label"},"May Delegate:"),i("div",{class:"checkbox-wrapper"},i("verdocs-checkbox",{checked:this.delegator,onInput:function(t){e.delegator=t.target.checked;e.dirty=true}})),i("verdocs-help-icon",{text:"If enabled, this recipient may delegate their actions to another individual."})),i("div",{class:"buttons"},i("button",{class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:W}),i("div",{style:{flex:"1"}}),i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))))};return e}());G.style=Y;var X='verdocs-template-roles{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#46497d;margin:0 0 10px 0}verdocs-template-roles>form .participants{position:relative}verdocs-template-roles>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-roles>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;min-height:35px;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-roles>form .row .row-roles{-ms-flex:1;flex:1;gap:10px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-roles>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 15px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-roles>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-roles>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-roles>form .row .settings-button{display:-ms-flexbox;display:flex;cursor:pointer;margin:0 0 0 9px}verdocs-template-roles>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;border-radius:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:2px solid #aeb4bf}verdocs-template-roles>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:0 12px 0 0}verdocs-template-roles>form .row .recipient.dragging{position:absolute}verdocs-template-roles>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-roles>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-roles>form .row .dropzone svg{fill:#cccccc}verdocs-template-roles>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-roles>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .add-role{display:none}verdocs-template-roles.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-roles.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-roles .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:20px;height:20px;stroke:#666666;margin-bottom:-5px}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}';var J=(M={},M[d.EVERYONE]="Everyone",M[d.EVERYONE_AS_CREATOR]="Everyone as Me",M[d.ORGANIZATION_MEMBER]="Organization member",M[d.ORGANIZATION_MEMBER_AS_CREATOR]="Organization Member as Me",M[d.CREATOR]="Me",M);var K='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>';var $='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>';var ee='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>';var te='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>';var oe='<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>';var ie='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>';var re='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>';var ne='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>';var se=e("verdocs_template_roles",function(){function e(e){t(this,e);this.next=o(this,"next",7);this.exit=o(this,"exit",7);this.sdkError=o(this,"sdkError",7);this.rolesUpdated=o(this,"rolesUpdated",7);this.templateStore=null;this.roleStore=null;this.endpoint=l.getDefault();this.templateId="";this.showingRoleDialog=null;this.showingSenderDialog=false;this.sender=null;this.loading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,i;var r=this;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}return[4,R(this.endpoint,this.templateId,false).then((function(e){var t;r.templateStore=e;r.roleStore=E(r.templateId);console.log("RS",(t=r.roleStore)===null||t===void 0?void 0:t.state);r.loading=false;r.roleStore.onChange("roles",(function(e){var t;console.log("[ROLES] Roles changed",{roles:e});(t=r.rolesUpdated)===null||t===void 0?void 0:t.emit({event:"updated",endpoint:r.endpoint,templateId:r.templateId,roles:e})}))})).catch((function(e){console.log(e)}))];case 1:n.sent();return[3,3];case 2:i=n.sent();console.log("[FIELDS] Error with preview session",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new C(i.message,(t=i.response)===null||t===void 0?void 0:t.status,(o=i.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.componentDidRender=function(){a.dynamicDrop(true);a(".recipient").draggable({listeners:{start:function e(t){t.target.classList.add("dragging");this.el.classList.add("dragging")}.bind(this),move:function e(t){var o=+(t.target.getAttribute("dX")||0);var i=+(t.target.getAttribute("dY")||0);var r=+(t.target.dataset["sequence"]||0);var n=+(t.target.dataset["order"]||0);var s=t.dx+o;var a=t.dy+i;t.target.setAttribute("dX",s);t.target.setAttribute("dY",a);var l=t.target.getBoundingClientRect();console.log("w",l.width);t.target.style.transform="translate(".concat(s+l.width-(n+1),"px, ").concat(a-l.height*r,"px)")}.bind(this),end:function e(t){t.target.classList.remove("dragging");this.el.classList.remove("dragging");t.target.removeAttribute("dX");t.target.removeAttribute("dY");t.target.style.transform=null}.bind(this)}});a(".dropzone").dropzone({overlap:.05,ondrop:function e(t){return __awaiter(this,void 0,void 0,(function(){var e,o,i,r;return __generator(this,(function(n){switch(n.label){case 0:console.log("dropped",t.target.classList);t.target.classList.remove("active");o=t.relatedTarget.dataset.rolename;i=+t.target.dataset.sequence;r=+t.target.dataset.order;k(this.roleStore,o,{sequence:i,order:r});return[4,this.renumberTemplateRoles()];case 1:n.sent();console.log("[ROLES] Updated roles",this.getSortedRoles());(e=this.rolesUpdated)===null||e===void 0?void 0:e.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))}.bind(this),ondropactivate:function(e){e.target.classList.add("visible")},ondropdeactivate:function(e){e.target.classList.remove("visible")},ondragenter:function(e){e.target.classList.add("active")},ondragleave:function(e){e.target.classList.remove("active")}})};e.prototype.handleCancel=function(){var e;(e=this.exit)===null||e===void 0?void 0:e.emit()};e.prototype.handleSubmit=function(){var e;(e=this.next)===null||e===void 0?void 0:e.emit()};e.prototype.getSortedRoles=function(){return this.roleStore.state.roles.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence}))};e.prototype.getSequenceNumbers=function(){var e=[];this.getSortedRoles().forEach((function(t){if(!e.includes(t.sequence)){e.push(t.sequence)}}));return e.sort((function(e,t){return e-t}))};e.prototype.getRoleNames=function(){var e=this.getSortedRoles();return e.map((function(e){return e.name}))};e.prototype.getRolesAtSequence=function(e){return this.roleStore.state.roles.filter((function(t){return t&&t.sequence===e}))};e.prototype.renumberTemplateRoles=function(){var e=this;console.log("Renumbering roles",this.getSequenceNumbers(),JSON.stringify(this.roleStore.state));var t=[];var o=[];this.getSequenceNumbers().forEach((function(i,r){e.getRolesAtSequence(i).forEach((function(i,n){if(!t.includes(i.name)){i.sequence=r+1;i.order=n+1;t.push(i.name);o.push(L(e.endpoint,e.templateId,i.name,{sequence:i.sequence,order:i.order}))}}))}));return Promise.all(o)};e.prototype.getNextRoleName=function(){console.log("Getting next role name",JSON.stringify(this.roleStore.state));var e="";var t=Object.keys(this.roleStore.state).length-1;do{t++;e="Recipient ".concat(t)}while(!e||this.roleStore.state.roles.some((function(t){return t&&t.name===e})));return e};e.prototype.callCreateRole=function(e,t,o){var i=this;console.log("[ROLES] Will create role",{name:e,sequence:t,order:o});A(this.endpoint,this.templateId,{template_id:this.templateId,name:e,sequence:t,order:o,full_name:"",email:"",phone:"",type:"signer",delegator:false}).then((function(e){return __awaiter(i,void 0,void 0,(function(){var t;return __generator(this,(function(o){switch(o.label){case 0:console.log("[ROLES] Created role",e);this.roleStore.set("roles",__spreadArray(__spreadArray([],this.roleStore.state.roles,true),[e],false));return[4,this.renumberTemplateRoles()];case 1:o.sent();(t=this.rolesUpdated)===null||t===void 0?void 0:t.emit({event:"added",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))})).catch((function(e){console.log("[ROLES] Error creating role",e)}))};e.prototype.handleAddRole=function(e,t){e.stopPropagation();var o=this.getRolesAtSequence(t).length+1;var i=this.getNextRoleName();this.callCreateRole(i,t,o)};e.prototype.handleAddStep=function(e,t){e.stopPropagation();var o=1;var i=this.getNextRoleName();this.callCreateRole(i,t,o)};e.prototype.render=function(){var e=this;var t,o,s,a;if(!this.endpoint.session){return i(r,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(this.loading||!((t=this.templateStore)===null||t===void 0?void 0:t.state.isLoaded)){console.log("Loading",this.loading,(o=this.templateStore)===null||o===void 0?void 0:o.state.isLoaded);return i(r,{class:"loading"},i("verdocs-loader",null))}console.log("Rendering roles",this.roleStore.get("roles"));var l=this.getRoleNames();var d=this.getSequenceNumbers();console.log("Rendering",l,d);return i(r,null,i("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},i("h5",null,"Roles and Workflow"),i("div",{class:"participants"},i("div",{class:"left-line"}),i("div",{class:"row"},i("div",{class:"icon",innerHTML:$}),i("div",{class:"row-roles"},i("div",{class:"sender"},i("span",{class:"label"},"Sender:")," ",J[(a=(s=this.templateStore)===null||s===void 0?void 0:s.state)===null||a===void 0?void 0:a.sender]," ",i("div",{class:"settings-button",innerHTML:K,onClick:function(){return e.showingSenderDialog=true},"aria-role":"button"})))),i("div",{class:"row add-sequence","data-sequence":0},i("div",{class:"icon",innerHTML:oe}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),d.map((function(t){return i(n,null,i("div",{class:"row"},i("div",{class:"icon",innerHTML:ee}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-order":.5,"data-sequence":t}),e.getRolesAtSequence(t).map((function(o){var r=!o.email;return r?i(n,null,i("div",{class:"recipient",style:{backgroundColor:I(q(e.roleStore,o.name))},"data-rolename":o.name,"data-sequence":t,"data-order":o.order},i("span",{class:"type-icon",innerHTML:o.type==="signer"?ie:o.type==="cc"?ne:re}),o.name," ",i("div",{class:"settings-button",innerHTML:K,onClick:function(){return e.showingRoleDialog=o.name},"aria-role":"button"})),i("div",{class:"dropzone","data-order":o.order+.5,"data-sequence":t})):i(n,null,i("div",{class:"recipient",style:{borderColor:I(q(e.roleStore,o.name))},"data-rolename":o.name,"data-sequence":t,"data-order":o.order},i("span",{class:"type-icon",innerHTML:o.type==="signer"?ie:o.type==="cc"?ne:re}),o.full_name," ",i("div",{class:"settings-button",innerHTML:K,onClick:function(){return e.showingRoleDialog=o.name},"aria-role":"button"})),i("div",{class:"dropzone","data-order":o.order+.5,"data-sequence":t}))})),i("button",{class:"add-role",innerHTML:oe,onClick:function(o){return e.handleAddRole(o,t)}}))),d.length>0&&i("div",{class:"row add-sequence","data-sequence":t},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:oe}),i("div",{class:"dropzone","data-sequence":t+1,"data-order":1},"Add Step"))))})),i("div",{class:"row","data-sequence":d.length+1},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:oe}),i("button",{class:"add-step",innerHTML:oe,onClick:function(t){return e.handleAddStep(t,d.length+1)}}))),i("div",{class:"row"},i("div",{class:"icon",innerHTML:te}),i("div",{class:"row-roles"},i("div",{class:"complete"},"Document Complete")))),l.length<1&&i("div",{class:"empty"},"You must add at least one Role before proceeding.",i("br",null)," Click the ",i("span",{innerHTML:oe})," Add button above to get started."),i("div",{class:"buttons"},i("div",{class:"flex-fill"}),i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(){return e.handleCancel()}}),i("verdocs-button",{label:"OK",size:"small",onClick:function(){return e.handleSubmit()},disabled:l.length<1}))),this.showingRoleDialog&&i("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:function(){e.showingRoleDialog=null},onDelete:function(){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:this.showingRoleDialog=null;return[4,this.renumberTemplateRoles()];case 1:t.sent();(e=this.rolesUpdated)===null||e===void 0?void 0:e.emit({event:"deleted",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()});return[2]}}))}))}}),this.showingSenderDialog&&i("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:function(){return e.showingSenderDialog=false}}))};Object.defineProperty(e.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return e}());se.style=X;var ae='verdocs-template-sender{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender .background-overlay{position:absolute;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-template-sender .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-sender .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-sender .buttons verdocs-button{margin-left:16px}verdocs-template-sender .options{row-gap:10px}verdocs-template-sender .options .option{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .options .option .description{margin-left:10px}verdocs-template-sender .options .option .description .name{display:inline-block;vertical-align:top;margin-top:4px;margin-right:4px}';var le=e("verdocs_template_sender",function(){function e(e){t(this,e);this.close=o(this,"close",7);this.sdkError=o(this,"sdkError",7);this.store=null;this.endpoint=l.getDefault();this.templateId="";this.sender=d.EVERYONE;this.saving=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,i,r,n,s;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[SENDER] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SENDER] Unable to start builder session, must be authenticated");return[2]}n=this;return[4,R(this.endpoint,this.templateId,false)];case 1:n.store=a.sent();this.sender=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.sender;return[3,3];case 2:s=a.sent();console.log("[SENDER] Error with preview session",s);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new C(s.message,(i=s.response)===null||i===void 0?void 0:i.status,(r=s.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleClose=function(){this.close.emit()};e.prototype.handleDismiss=function(e){if(e.target.className==="background-overlay"){e.preventDefault();this.handleClose()}};e.prototype.handleSelectSetting=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){this.saving=true;c(this.endpoint,this.templateId,{sender:e}).then((function(o){var i;console.log("Update result",o);if((i=t.store)===null||i===void 0?void 0:i.state){t.store.state.sender=e}t.saving=false;t.sender=e})).catch((function(e){console.log("Error saving",e);t.saving=false}));return[2]}))}))};e.prototype.render=function(){var e=this;return i(r,null,i("div",{class:"background-overlay",onClick:function(t){return e.handleDismiss(t)}},i("div",{class:"dialog"},i("div",{class:"options"},i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:d.EVERYONE,checked:this.sender===d.EVERYONE,onInput:function(){return e.handleSelectSetting(d.EVERYONE)}}),i("div",{class:"description"},i("div",{class:"name"},"Anyone on the Web"),i("verdocs-help-icon",{text:"Anyone can use this template. (Make its visibility is set to to 'Public' or 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:d.EVERYONE_AS_CREATOR,checked:this.sender===d.EVERYONE_AS_CREATOR,onInput:function(){return e.handleSelectSetting(d.EVERYONE_AS_CREATOR)}}),i("div",{class:"description"},i("div",{class:"name"},"Anyone on the Web as me"),i("verdocs-help-icon",{text:"Anyone can use this template on my behalf. (Make sure its visibility is set to 'Public' or 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:d.ORGANIZATION_MEMBER,checked:this.sender===d.ORGANIZATION_MEMBER,onInput:function(){return e.handleSelectSetting(d.ORGANIZATION_MEMBER)}}),i("div",{class:"description"},i("div",{class:"name"},"Anyone in my organization"),i("verdocs-help-icon",{text:"Anyone in my organization can use this template. (Make sure its visibility is set to 'Shared')"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:d.ORGANIZATION_MEMBER_AS_CREATOR,checked:this.sender===d.ORGANIZATION_MEMBER_AS_CREATOR,onInput:function(){return e.handleSelectSetting(d.ORGANIZATION_MEMBER_AS_CREATOR)}}),i("div",{class:"description"},i("div",{class:"name"},"Anyone in my organization as me"),i("verdocs-help-icon",{text:"Anyone in my organization can use this template on my behalf. (Make sure its visibility is set to to 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:d.CREATOR,checked:this.sender===d.CREATOR,onInput:function(){return e.handleSelectSetting(d.CREATOR)}}),i("div",{class:"description"},i("div",{class:"name"},"Me"),i("verdocs-help-icon",{text:"Only I can use this template."})))),i("div",{class:"buttons"},i("verdocs-button",{label:"Close",onClick:function(){return e.handleClose()}})))))};return e}());le.style=ae}}}));
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as e,c as t,h as s,H as i,F as o,a as l}from"./p-14b44491.js";import{i as r}from"./p-4bda4c50.js";import"./p-05788c2b.js";import{V as a,T as n,u as d}from"./p-035f6b38.js";import{u as p,c}from"./p-feb442b1.js";import{i as h}from"./p-5e808a0b.js";import{g as m,u as v}from"./p-ef20cb50.js";import{r as f,e as g,f as u,b as x,h as b,i as w}from"./p-a3d7cdda.js";import{g as y,c as k,u as q,d as E,a as C}from"./p-b086f9be.js";import{g as M}from"./p-47c63cc7.js";import{S as L}from"./p-7a1b2643.js";import{g as Z}from"./p-6de76553.js";import"./p-eab67c09.js";import"./p-7648c449.js";import"./p-dc2ad047.js";import"./p-839f6f0d.js";import"./p-c220af42.js";var z=function(e,t,s,i){return e.api.put("/templates/".concat(t,"/roles/").concat(s),i).then((function(e){return e.data}))};const S='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>',H=[{id:"signature",tooltip:"Signature",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>'},{id:"initial",tooltip:"Initials",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>'},{id:"sep1",tooltip:"",icon:S},{id:"textbox",tooltip:"Text Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>'},{id:"textarea",tooltip:"Text Area",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z"/></svg>'},{id:"checkbox_group",tooltip:"Check Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>'},{id:"radio_button_group",tooltip:"Radio Button",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>'},{id:"dropdown",tooltip:"Dropdown",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>'},{id:"sep2",tooltip:"",icon:S},{id:"date",tooltip:"Date",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>'},{id:"timestamp",tooltip:"Timestamp",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z"></path></svg>'}],V=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.fieldsUpdated=t(this,"fieldsUpdated",7),this.pageHeights={},this.templateStore=null,this.fieldStore=null,this.roleStore=null,this.cachedPageInfo={},this.endpoint=a.getDefault(),this.templateId=null,this.toolbarTargetId=null,this.placing=null,this.showMustSelectRole=!1,this.selectedRoleName="",this.loading=!0}async componentWillLoad(){var e,t,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[FIELDS] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[FIELDS] Unable to start builder session, must be authenticated");M(this.endpoint,this.templateId,!0).then((e=>{var t,s;this.templateStore=e,console.log("[PREVIEW] Loaded Template Store",e.state),this.fieldStore=m(this.templateId),this.roleStore=y(this.templateId),this.selectedRoleName=(null===(s=null===(t=this.roleStore.get("roles"))||void 0===t?void 0:t[0])||void 0===s?void 0:s.name)||"",console.log("[PREVIEW] Loaded template",this.templateStore.state,this.roleStore.get("roles"),this.fieldStore.get("fields")),this.loading=!1,this.fieldStore.onChange("fields",(e=>{var t;console.log("[FIELDS] Fields changed",{fields:e}),null===(t=this.fieldsUpdated)||void 0===t||t.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,fields:e})}))})).catch((e=>{console.log(e)}))}catch(i){console.log("[FIELDS] Error with preview session",i),null===(e=this.sdkError)||void 0===e||e.emit(new L(i.message,null===(t=i.response)||void 0===t?void 0:t.status,null===(s=i.response)||void 0===s?void 0:s.data))}}componentDidRender(){r.dynamicDrop(!0);const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null,t=document.getElementById("verdocs-template-fields-toolbar");e&&t&&(console.log("[FIELDS] Moving toolbar"),t.remove(),e.append(t))}componentWillUpdate(){var e;const t=this.roleStore.get("roles");this.selectedRoleName&&t.find((e=>e&&e.name===this.selectedRoleName))||(this.selectedRoleName=(null===(e=t[0])||void 0===e?void 0:e.name)||"",console.log("[FIELDS] Selected new role",this.selectedRoleName))}handleKeyDown(e){"Escape"===e.key&&(this.placing=null)}async handleFieldChange(e,t,s){console.log("[FIELDS] handleFieldChange",e,t,s)}attachFieldAttributes(e,t,s){s.addEventListener("input",(e=>this.handleFieldChange(t,e))),s.addEventListener("settingsChanged",(e=>{var t,s;console.log("Settings changed",e.detail),null===(t=this.templateUpdated)||void 0===t||t.emit({endpoint:this.endpoint,template:null===(s=this.templateStore)||void 0===s?void 0:s.state,event:"added-field"})})),s.addEventListener("deleted",(()=>{var e,i;console.log("[FIELDS] Deleted",this,t),s.remove(),null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:null===(i=this.templateStore)||void 0===i?void 0:i.state,event:"updated-field"})})),s.setAttribute("templateid",this.templateId),s.setAttribute("fieldname",t.name),s.setAttribute("pageNumber",e.pageNumber),s.setAttribute("xScale",e.xScale),s.setAttribute("yScale",e.yScale),s.setAttribute("name",t.name)}handlePageRendered(e){const t=e.detail;console.log("[FIELDS] Page rendered",t.pageNumber,t.xScale,t.yScale),this.cachedPageInfo[t.pageNumber]=t,this.pageHeights[t.pageNumber]=t.naturalHeight,this.fieldStore.get("fields").filter((e=>e&&e.page_sequence===t.pageNumber)).forEach((e=>{const t=x(e),s=document.getElementById(t);s&&(s.setAttribute("fieldname",e.name),s.setAttribute("pagenumber",String(e.page_sequence)),this.makeDraggable(s))}))}reRenderField(e,t){const s=this.cachedPageInfo[t],i=f(e,s,{disabled:!0,editable:!0,draggable:!0});i&&(Array.isArray(i)?i.forEach((t=>{this.attachFieldAttributes(s,e,t),this.makeDraggable(t)})):(this.attachFieldAttributes(s,e,i),this.makeDraggable(i)))}makeDraggable(e){r(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})}async handleMoveField(e){const t=+(e.target.getAttribute("posX")||0),s=+(e.target.getAttribute("posY")||0),i=+(e.target.getAttribute("xScale")||1),o=+(e.target.getAttribute("yScale")||1),l=e.dx/i+t,r=e.dy/o+s;e.target.setAttribute("posX",l),e.target.setAttribute("posy",r),g(e.target,"translate",`${l}px, ${r}px`)}async handleMoveEnd(e){var t,s;const i=e.target.getAttribute("fieldname"),o=+(e.target.getAttribute("option")||"0"),l=this.fieldStore.get("fields").find((e=>e.name===i));if(!l)return void console.log("[FIELDS] Unable to find field",i,e.target);const r=e.target.getAttribute("pagenumber"),{naturalWidth:a=612,naturalHeight:n=792,renderedHeight:d=792}=this.cachedPageInfo[r],c=e.target.getBoundingClientRect(),h=e.target.parentElement.getBoundingClientRect(),m=l.setting.width||b(l.type),f=l.setting.height||w(l.type),g=Math.max(c.left-h.left,0),x=Math.max(d-(h.bottom-c.bottom),0),{x:y,y:k}=this.viewCoordinatesToPageCoordinates(g,x,r,a-m,n-f);switch(l.type){case"attachment":case"payment":case"initial":case"signature":case"date":case"dropdown":case"textarea":case"textbox":case"timestamp":l.setting.x=y,l.setting.y=k;break;case"checkbox_group":case"radio_button_group":{const e=l.setting.options[o];e&&(e.x=y,e.y=k)}}console.log("[FIELDS] Will update",i,k,o,l);const q=await p(this.endpoint,this.templateId,i,l);v(this.fieldStore,i,q),e.target.removeAttribute("posX"),e.target.removeAttribute("posY"),console.log("Will remove CSS transform",e.target.style.transform),u(e.target),console.log("[FIELDS] Updated",i,q),null===(t=this.templateUpdated)||void 0===t||t.emit({endpoint:this.endpoint,template:null===(s=this.templateStore)||void 0===s?void 0:s.state,event:"updated-field"})}generateFieldName(e,t){let s,i=1;do{s=`${e}P${t}-${i}`,i++}while(this.fieldStore.get("fields").some((e=>e&&e.name===s)));return s}viewCoordinatesToPageCoordinates(e,t,s,i,o){const{xScale:l=1,yScale:r=1,renderedHeight:a=792}=this.cachedPageInfo[s];return{x:Math.floor(Math.min(e/l,i)),y:Math.floor(Math.min(Math.max(a-t,0)/r,o))}}async handleClickPage(e,t){var s,i;if(this.placing){const o=e.offsetX,l=e.offsetY,r=b(this.placing),a=w(this.placing),n=this.cachedPageInfo[t],{naturalWidth:d=612,naturalHeight:p=792}=n,h=this.viewCoordinatesToPageCoordinates(o,l,t,d-r,p-a),m=Math.floor(h.x),v=Math.floor(h.y),f={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,document_id:n.documentId,type:this.placing,required:!0,page_sequence:t,validator:null,setting:{x:m,y:v},x:m,y:v,tabindex:0,width:r,height:a};switch(console.log("[FIELDS] Will save new field",f),f.type){case"attachment":case"payment":f.setting={x:m,y:v};break;case"initial":case"signature":f.setting={x:m,y:v,result:""};break;case"checkbox_group":f.setting={minimum_checked:0,maximum_checked:1e3,options:[{id:`${f.name}-1`,value:"Option 1",checked:!1,x:m,y:v}]};break;case"date":f.setting={x:m,y:v,width:r,height:a,result:""};break;case"dropdown":f.required=!1,f.setting={x:m,y:v,width:r,height:a,value:null,placeholder:"Choose",options:[{id:"option-1",value:"Option 1"}]};break;case"radio_button_group":f.setting={options:[{id:`${f.name}-1`,value:"Option 1",selected:!1,x:m,y:v}]};break;case"textarea":case"textbox":f.setting={x:m,y:v,width:r,height:a,result:"",leading:0,alignment:0,upperCase:!1};break;case"timestamp":f.setting={x:m,y:v,width:r,height:a}}"textarea"===f.type&&(f.setting.leading=16,f.type="textbox");const g=await c(this.endpoint,this.templateId,f);console.log("[FIELDS] Saved field",g),this.fieldStore.set("fields",[...this.fieldStore.get("fields"),g]),this.placing=null,this.reRenderField(g,t),null===(s=this.templateUpdated)||void 0===s||s.emit({endpoint:this.endpoint,template:null===(i=this.templateStore)||void 0===i?void 0:i.state,event:"added-field"})}}render(){var e,t,o;if(!this.endpoint.session)return s(i,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(this.loading||!(null===(e=this.templateStore)||void 0===e?void 0:e.state.isLoaded))return s(i,null,s("verdocs-loader",null));const l=this.roleStore.get("roles").map((e=>({value:e.name,label:e.name})));return s(i,{class:this.placing?{[`placing-${this.placing}`]:!0}:{},onSubmit:()=>{}},s("div",{id:"verdocs-template-fields-toolbar"},s("div",{class:"add-for"},"Add field:"),s("verdocs-select-input",{value:this.selectedRoleName,options:l,onInput:e=>this.selectedRoleName=e.target.value}),H.map((e=>s("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:()=>{e.tooltip&&(this.selectedRoleName?this.placing=e.id:this.showMustSelectRole=!0)}})))),s("div",{class:"pages"},((null===(o=null===(t=this.templateStore)||void 0===t?void 0:t.state)||void 0===o?void 0:o.template_documents)||[]).map((e=>h(1,e.page_numbers).map((t=>s("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:612,virtualHeight:792,editable:!0,done:!1,onClick:e=>this.handleClickPage(e,t),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})))))),this.showMustSelectRole&&s("verdocs-ok-dialog",{heading:"Unable to add field",message:this.roleStore.get("roles").length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=!1}))}};V.style="verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields #verdocs-template-fields-toolbar{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio_button_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";const I=class{constructor(s){e(this,s),this.close=t(this,"close",7),this.delete=t(this,"delete",7),this.sdkError=t(this,"sdkError",7),this.templateStore=null,this.fieldStore=null,this.roleStore=null,this.endpoint=a.getDefault(),this.templateId="",this.roleName="",this.sender=n.EVERYONE,this.dirty=!1,this.saving=!1,this.name="",this.type="signer",this.full_name="",this.email="",this.phone="",this.delegator=!1}async componentWillLoad(){var e,t,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLE_PROPERTIES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLE_PROPERTIES] Unable to start builder session, must be authenticated");this.templateStore=await M(this.endpoint,this.templateId,!1),this.fieldStore=m(this.templateId),this.roleStore=k(this.templateStore.state);const e=this.roleStore.state.roles.find((e=>e.name===this.roleName));e&&(this.name=e.name,this.type=e.type,this.full_name=e.full_name,this.email=e.email,this.phone=e.phone,this.delegator=e.delegator,console.log("[ROLE_PROPERTIES] Editing role",e))}catch(i){console.log("[ROLE_PROPERTIES Error with preview session",i),null===(e=this.sdkError)||void 0===e||e.emit(new L(i.message,null===(t=i.response)||void 0===t?void 0:t.status,null===(s=i.response)||void 0===s?void 0:s.data))}}handleCancel(e){var t;e.stopPropagation();const s=this.roleStore.state.roles.find((e=>e.name===this.roleName));s&&(this.name=s.name,this.type=s.type,this.full_name=s.full_name,this.email=s.email,this.phone=s.phone,this.delegator=s.delegator),this.dirty=!1,null===(t=this.close)||void 0===t||t.emit()}async handleSave(e){e.stopPropagation(),this.saving=!0,z(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,full_name:this.full_name,email:this.email,phone:this.phone,delegator:this.delegator}).then((async e=>{var t;console.log("[ROLE_PROPERTIES] Update result",e),this.saving=!1,this.dirty=!1,q(this.roleStore,this.roleName,e),null===(t=this.close)||void 0===t||t.emit()})).catch((e=>{console.log("[ROLE_PROPERTIES Update error",e),this.saving=!1}))}async handleDelete(e){var t,s,i;e.stopPropagation(),window.confirm("Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.")&&(t=this.endpoint,s=this.templateId,i=this.roleName,t.api.delete("/templates/".concat(s,"/roles/").concat(i)).then((function(e){return e.data}))).then((()=>{var e;E(this.roleStore,this.roleName),null===(e=this.delete)||void 0===e||e.emit({templateId:this.templateId,roleName:this.roleName})})).catch((e=>{console.log("[ROLE_PROPERTIES Deletion error",e)}))}render(){const e=this.fieldStore.get("fields").some((e=>e.role_name===this.roleName));return s(i,null,s("div",{class:"background-overlay",onClick:e=>this.handleCancel(e)},s("div",{class:"dialog"},s("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},s("verdocs-text-input",{id:"verdocs-role-name",label:"Role Name",value:this.name,autocomplete:"off",disabled:e,helpText:e?"This role has fields assigned and can no longer be renamed.":"A unique name to identify the role in the workflow. Submitted data will also be tagged with this value.",placeholder:"Role Name...",onInput:e=>{this.name=e.target.value,this.dirty=!0}}),s("div",{class:"row"},s("div",{class:"input-label"},"Type:"),s("verdocs-select-input",{value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:e=>{this.type=e.target.value,this.dirty=!0}}),s("verdocs-help-icon",{text:"Most participants are Signers. CC roles are notified when documents are signed, but have no other actions. Approvers get notified when signing is completed to perform a final review."})),s("verdocs-text-input",{id:"verdocs-recipient-email",label:"Full Name",value:this.full_name,autocomplete:"off",helpText:"The recipient's full name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Full Name...",onInput:e=>{this.full_name=e.target.value,this.dirty=!0}}),s("verdocs-text-input",{id:"verdocs-recipient-email",label:"Email",value:this.email,autocomplete:"off",helpText:"The recipient's email address, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Email Address...",onInput:e=>{this.email=e.target.value,this.dirty=!0}}),s("verdocs-text-input",{id:"verdocs-recipient-phone",label:"Phone",value:this.phone,autocomplete:"off",helpText:"The recipient's phone number, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Phone Number...",onInput:e=>{this.phone=e.target.value,this.dirty=!0}}),s("div",{class:"row"},s("div",{class:"input-label"},"May Delegate:"),s("div",{class:"checkbox-wrapper"},s("verdocs-checkbox",{checked:this.delegator,onInput:e=>{this.delegator=e.target.checked,this.dirty=!0}})),s("verdocs-help-icon",{text:"If enabled, this recipient may delegate their actions to another individual."})),s("div",{class:"buttons"},s("button",{class:"delete-button",disabled:this.dirty,onClick:e=>this.handleDelete(e),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>'}),s("div",{style:{flex:"1"}}),s("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),s("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)}))))))}};I.style='verdocs-template-role-properties{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-template-role-properties .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-role-properties .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-role-properties verdocs-text-input{margin:0 0 10px 0}verdocs-template-role-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}';const R={[n.EVERYONE]:"Everyone",[n.EVERYONE_AS_CREATOR]:"Everyone as Me",[n.ORGANIZATION_MEMBER]:"Organization member",[n.ORGANIZATION_MEMBER_AS_CREATOR]:"Organization Member as Me",[n.CREATOR]:"Me"},T='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>',_='<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>',D='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>',O='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>',j='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>',P=class{constructor(s){e(this,s),this.next=t(this,"next",7),this.exit=t(this,"exit",7),this.sdkError=t(this,"sdkError",7),this.rolesUpdated=t(this,"rolesUpdated",7),this.templateStore=null,this.roleStore=null,this.endpoint=a.getDefault(),this.templateId="",this.showingRoleDialog=null,this.showingSenderDialog=!1,this.sender=null,this.loading=!0}async componentWillLoad(){var e,t,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");await M(this.endpoint,this.templateId,!1).then((e=>{var t;this.templateStore=e,this.roleStore=y(this.templateId),console.log("RS",null===(t=this.roleStore)||void 0===t?void 0:t.state),this.loading=!1,this.roleStore.onChange("roles",(e=>{var t;console.log("[ROLES] Roles changed",{roles:e}),null===(t=this.rolesUpdated)||void 0===t||t.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:e})}))})).catch((e=>{console.log(e)}))}catch(i){console.log("[FIELDS] Error with preview session",i),null===(e=this.sdkError)||void 0===e||e.emit(new L(i.message,null===(t=i.response)||void 0===t?void 0:t.status,null===(s=i.response)||void 0===s?void 0:s.data))}}componentDidRender(){r.dynamicDrop(!0),r(".recipient").draggable({listeners:{start:function(e){e.target.classList.add("dragging"),this.el.classList.add("dragging")}.bind(this),move:function(e){const t=+(e.target.getAttribute("dX")||0),s=+(e.target.getAttribute("dY")||0),i=+(e.target.dataset.sequence||0),o=+(e.target.dataset.order||0),l=e.dx+t,r=e.dy+s;e.target.setAttribute("dX",l),e.target.setAttribute("dY",r);const a=e.target.getBoundingClientRect();console.log("w",a.width),e.target.style.transform=`translate(${l+a.width-(o+1)}px, ${r-a.height*i}px)`}.bind(this),end:function(e){e.target.classList.remove("dragging"),this.el.classList.remove("dragging"),e.target.removeAttribute("dX"),e.target.removeAttribute("dY"),e.target.style.transform=null}.bind(this)}}),r(".dropzone").dropzone({overlap:.05,ondrop:async function(e){var t;console.log("dropped",e.target.classList),e.target.classList.remove("active"),q(this.roleStore,e.relatedTarget.dataset.rolename,{sequence:+e.target.dataset.sequence,order:+e.target.dataset.order}),await this.renumberTemplateRoles(),console.log("[ROLES] Updated roles",this.getSortedRoles()),null===(t=this.rolesUpdated)||void 0===t||t.emit({event:"updated",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})}.bind(this),ondropactivate:e=>{e.target.classList.add("visible")},ondropdeactivate:e=>{e.target.classList.remove("visible")},ondragenter:e=>{e.target.classList.add("active")},ondragleave:e=>{e.target.classList.remove("active")}})}handleCancel(){var e;null===(e=this.exit)||void 0===e||e.emit()}handleSubmit(){var e;null===(e=this.next)||void 0===e||e.emit()}getSortedRoles(){return this.roleStore.state.roles.sort(((e,t)=>e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence))}getSequenceNumbers(){const e=[];return this.getSortedRoles().forEach((t=>{e.includes(t.sequence)||e.push(t.sequence)})),e.sort(((e,t)=>e-t))}getRoleNames(){return this.getSortedRoles().map((e=>e.name))}getRolesAtSequence(e){return this.roleStore.state.roles.filter((t=>t&&t.sequence===e))}renumberTemplateRoles(){console.log("Renumbering roles",this.getSequenceNumbers(),JSON.stringify(this.roleStore.state));const e=[],t=[];return this.getSequenceNumbers().forEach(((s,i)=>{this.getRolesAtSequence(s).forEach(((s,o)=>{e.includes(s.name)||(s.sequence=i+1,s.order=o+1,e.push(s.name),t.push(z(this.endpoint,this.templateId,s.name,{sequence:s.sequence,order:s.order})))}))})),Promise.all(t)}getNextRoleName(){console.log("Getting next role name",JSON.stringify(this.roleStore.state));let e="",t=Object.keys(this.roleStore.state).length-1;do{t++,e=`Recipient ${t}`}while(!e||this.roleStore.state.roles.some((t=>t&&t.name===e)));return e}callCreateRole(e,t,s){var i,o,l;console.log("[ROLES] Will create role",{name:e,sequence:t,order:s}),(i=this.endpoint,o=this.templateId,l={template_id:this.templateId,name:e,sequence:t,order:s,full_name:"",email:"",phone:"",type:"signer",delegator:!1},i.api.post("/templates/".concat(o,"/roles"),l).then((function(e){return e.data}))).then((async e=>{var t;console.log("[ROLES] Created role",e),this.roleStore.set("roles",[...this.roleStore.state.roles,e]),await this.renumberTemplateRoles(),null===(t=this.rolesUpdated)||void 0===t||t.emit({event:"added",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})})).catch((e=>{console.log("[ROLES] Error creating role",e)}))}handleAddRole(e,t){e.stopPropagation();const s=this.getRolesAtSequence(t).length+1,i=this.getNextRoleName();this.callCreateRole(i,t,s)}handleAddStep(e,t){e.stopPropagation();const s=this.getNextRoleName();this.callCreateRole(s,t,1)}render(){var e,t,l,r;if(!this.endpoint.session)return s(i,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(this.loading||!(null===(e=this.templateStore)||void 0===e?void 0:e.state.isLoaded))return console.log("Loading",this.loading,null===(t=this.templateStore)||void 0===t?void 0:t.state.isLoaded),s(i,{class:"loading"},s("verdocs-loader",null));console.log("Rendering roles",this.roleStore.get("roles"));const a=this.getRoleNames(),n=this.getSequenceNumbers();return console.log("Rendering",a,n),s(i,null,s("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},s("h5",null,"Roles and Workflow"),s("div",{class:"participants"},s("div",{class:"left-line"}),s("div",{class:"row"},s("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>'}),s("div",{class:"row-roles"},s("div",{class:"sender"},s("span",{class:"label"},"Sender:")," ",R[null===(r=null===(l=this.templateStore)||void 0===l?void 0:l.state)||void 0===r?void 0:r.sender]," ",s("div",{class:"settings-button",innerHTML:T,onClick:()=>this.showingSenderDialog=!0,"aria-role":"button"})))),s("div",{class:"row add-sequence","data-sequence":0},s("div",{class:"icon",innerHTML:_}),s("div",{class:"row-roles"},s("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),n.map((e=>s(o,null,s("div",{class:"row"},s("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'}),s("div",{class:"row-roles"},s("div",{class:"dropzone","data-order":.5,"data-sequence":e}),this.getRolesAtSequence(e).map((t=>s(o,null,t.email?s("div",{class:"recipient",style:{borderColor:Z(C(this.roleStore,t.name))},"data-rolename":t.name,"data-sequence":e,"data-order":t.order},s("span",{class:"type-icon",innerHTML:"signer"===t.type?D:"cc"===t.type?j:O}),t.full_name," ",s("div",{class:"settings-button",innerHTML:T,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})):s("div",{class:"recipient",style:{backgroundColor:Z(C(this.roleStore,t.name))},"data-rolename":t.name,"data-sequence":e,"data-order":t.order},s("span",{class:"type-icon",innerHTML:"signer"===t.type?D:"cc"===t.type?j:O}),t.name," ",s("div",{class:"settings-button",innerHTML:T,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})),s("div",{class:"dropzone","data-order":t.order+.5,"data-sequence":e})))),s("button",{class:"add-role",innerHTML:_,onClick:t=>this.handleAddRole(t,e)}))),n.length>0&&s("div",{class:"row add-sequence","data-sequence":e},s("div",{class:"row-roles"},s("div",{class:"icon",innerHTML:_}),s("div",{class:"dropzone","data-sequence":e+1,"data-order":1},"Add Step")))))),s("div",{class:"row","data-sequence":n.length+1},s("div",{class:"row-roles"},s("div",{class:"icon",innerHTML:_}),s("button",{class:"add-step",innerHTML:_,onClick:e=>this.handleAddStep(e,n.length+1)}))),s("div",{class:"row"},s("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>'}),s("div",{class:"row-roles"},s("div",{class:"complete"},"Document Complete")))),a.length<1&&s("div",{class:"empty"},"You must add at least one Role before proceeding.",s("br",null)," Click the ",s("span",{innerHTML:_})," Add button above to get started."),s("div",{class:"buttons"},s("div",{class:"flex-fill"}),s("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:()=>this.handleCancel()}),s("verdocs-button",{label:"OK",size:"small",onClick:()=>this.handleSubmit(),disabled:a.length<1}))),this.showingRoleDialog&&s("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:()=>{this.showingRoleDialog=null},onDelete:async()=>{var e;this.showingRoleDialog=null,await this.renumberTemplateRoles(),null===(e=this.rolesUpdated)||void 0===e||e.emit({event:"deleted",endpoint:this.endpoint,templateId:this.templateId,roles:this.getSortedRoles()})}}),this.showingSenderDialog&&s("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:()=>this.showingSenderDialog=!1}))}get el(){return l(this)}};P.style='verdocs-template-roles{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#46497d;margin:0 0 10px 0}verdocs-template-roles>form .participants{position:relative}verdocs-template-roles>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-roles>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;min-height:35px;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-roles>form .row .row-roles{-ms-flex:1;flex:1;gap:10px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-roles>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 15px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-roles>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-roles>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-roles>form .row .settings-button{display:-ms-flexbox;display:flex;cursor:pointer;margin:0 0 0 9px}verdocs-template-roles>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;border-radius:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:2px solid #aeb4bf}verdocs-template-roles>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:0 12px 0 0}verdocs-template-roles>form .row .recipient.dragging{position:absolute}verdocs-template-roles>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-roles>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-roles>form .row .dropzone svg{fill:#cccccc}verdocs-template-roles>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-roles>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .add-role{display:none}verdocs-template-roles.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-roles.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-roles .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:20px;height:20px;stroke:#666666;margin-bottom:-5px}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}';const A=class{constructor(s){e(this,s),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.sender=n.EVERYONE,this.saving=!1}async componentWillLoad(){var e,t,s,i,o;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[SENDER] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[SENDER] Unable to start builder session, must be authenticated");this.store=await M(this.endpoint,this.templateId,!1),this.sender=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.sender}catch(e){console.log("[SENDER] Error with preview session",e),null===(s=this.sdkError)||void 0===s||s.emit(new L(e.message,null===(i=e.response)||void 0===i?void 0:i.status,null===(o=e.response)||void 0===o?void 0:o.data))}}handleClose(){this.close.emit()}handleDismiss(e){"background-overlay"===e.target.className&&(e.preventDefault(),this.handleClose())}async handleSelectSetting(e){this.saving=!0,d(this.endpoint,this.templateId,{sender:e}).then((t=>{var s;console.log("Update result",t),(null===(s=this.store)||void 0===s?void 0:s.state)&&(this.store.state.sender=e),this.saving=!1,this.sender=e})).catch((e=>{console.log("Error saving",e),this.saving=!1}))}render(){return s(i,null,s("div",{class:"background-overlay",onClick:e=>this.handleDismiss(e)},s("div",{class:"dialog"},s("div",{class:"options"},s("div",{class:"option"},s("verdocs-radio-button",{name:"template-sender",value:n.EVERYONE,checked:this.sender===n.EVERYONE,onInput:()=>this.handleSelectSetting(n.EVERYONE)}),s("div",{class:"description"},s("div",{class:"name"},"Anyone on the Web"),s("verdocs-help-icon",{text:"Anyone can use this template. (Make its visibility is set to to 'Public' or 'Shared'.)"}))),s("div",{class:"option"},s("verdocs-radio-button",{name:"template-sender",value:n.EVERYONE_AS_CREATOR,checked:this.sender===n.EVERYONE_AS_CREATOR,onInput:()=>this.handleSelectSetting(n.EVERYONE_AS_CREATOR)}),s("div",{class:"description"},s("div",{class:"name"},"Anyone on the Web as me"),s("verdocs-help-icon",{text:"Anyone can use this template on my behalf. (Make sure its visibility is set to 'Public' or 'Shared'.)"}))),s("div",{class:"option"},s("verdocs-radio-button",{name:"template-sender",value:n.ORGANIZATION_MEMBER,checked:this.sender===n.ORGANIZATION_MEMBER,onInput:()=>this.handleSelectSetting(n.ORGANIZATION_MEMBER)}),s("div",{class:"description"},s("div",{class:"name"},"Anyone in my organization"),s("verdocs-help-icon",{text:"Anyone in my organization can use this template. (Make sure its visibility is set to 'Shared')"}))),s("div",{class:"option"},s("verdocs-radio-button",{name:"template-sender",value:n.ORGANIZATION_MEMBER_AS_CREATOR,checked:this.sender===n.ORGANIZATION_MEMBER_AS_CREATOR,onInput:()=>this.handleSelectSetting(n.ORGANIZATION_MEMBER_AS_CREATOR)}),s("div",{class:"description"},s("div",{class:"name"},"Anyone in my organization as me"),s("verdocs-help-icon",{text:"Anyone in my organization can use this template on my behalf. (Make sure its visibility is set to to 'Shared'.)"}))),s("div",{class:"option"},s("verdocs-radio-button",{name:"template-sender",value:n.CREATOR,checked:this.sender===n.CREATOR,onInput:()=>this.handleSelectSetting(n.CREATOR)}),s("div",{class:"description"},s("div",{class:"name"},"Me"),s("verdocs-help-icon",{text:"Only I can use this template."})))),s("div",{class:"buttons"},s("verdocs-button",{label:"Close",onClick:()=>this.handleClose()})))))}};A.style='verdocs-template-sender{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender .background-overlay{position:absolute;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-template-sender .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-sender .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-sender .buttons verdocs-button{margin-left:16px}verdocs-template-sender .options{row-gap:10px}verdocs-template-sender .options .option{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .options .option .description{margin-left:10px}verdocs-template-sender .options .option .description .name{display:inline-block;vertical-align:top;margin-top:4px;margin-right:4px}';export{V as verdocs_template_fields,I as verdocs_template_role_properties,P as verdocs_template_roles,A as verdocs_template_sender}
|
@@ -1 +0,0 @@
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign.apply(this,arguments)};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};System.register(["./p-54498887.system.js"],(function(e){"use strict";var t;return{setters:[function(e){t=e.d}],execute:function(){e({T:void 0,a:void 0});var r;(function(e){e["CREATOR"]="creator";e["ORGANIZATION_MEMBER"]="organization_member";e["ORGANIZATION_MEMBER_AS_CREATOR"]="organization_member_as_creator";e["EVERYONE"]="everyone";e["EVERYONE_AS_CREATOR"]="everyone_as_creator"})(r||(r={}));var n;(function(e){e["TEMPLATE_CREATOR_CREATE_PUBLIC"]="template:creator:create:public";e["TEMPLATE_CREATOR_CREATE_ORG"]="template:creator:create:org";e["TEMPLATE_CREATOR_CREATE_PERSONAL"]="template:creator:create:personal";e["TEMPLATE_CREATOR_DELETE"]="template:creator:delete";e["TEMPLATE_CREATOR_VISIBILITY"]="template:creator:visibility";e["TEMPLATE_MEMBER_READ"]="template:member:read";e["TEMPLATE_MEMBER_WRITE"]="template:member:write";e["TEMPLATE_MEMBER_DELETE"]="template:member:delete";e["TEMPLATE_MEMBER_VISIBILITY"]="template:member:visibility"})(n||(n={}));var i=e("c",(function(e,t,r){var i,a;if(!r&&!t.includes("create")){return{canPerform:false,message:"Missing required template object"}}var s=(e===null||e===void 0?void 0:e.profile_id)||"BOGUS";var u=(e===null||e===void 0?void 0:e.organization_id)||"BOGUS";if(!s){return{canPerform:false,message:"Active session required"}}var c=(r===null||r===void 0?void 0:r.profile_id)===s;var f=(r===null||r===void 0?void 0:r.organization_id)===u;var l=(i=r===null||r===void 0?void 0:r.is_personal)!==null&&i!==void 0?i:false;var p=(a=r===null||r===void 0?void 0:r.is_public)!==null&&a!==void 0?a:false;var d=[];switch(t){case"create_personal":d.push(n.TEMPLATE_CREATOR_CREATE_PERSONAL);break;case"create_org":d.push(n.TEMPLATE_CREATOR_CREATE_ORG);break;case"create_public":d.push(n.TEMPLATE_CREATOR_CREATE_PUBLIC);break;case"read":if(!c){if(!l&&f||!p){d.push(n.TEMPLATE_MEMBER_READ)}}break;case"write":if(!c){d.push(n.TEMPLATE_MEMBER_READ);d.push(n.TEMPLATE_MEMBER_WRITE)}break;case"change_visibility_personal":if(c){d.push(n.TEMPLATE_CREATOR_CREATE_PERSONAL)}else{d.push(n.TEMPLATE_MEMBER_VISIBILITY)}break;case"change_visibility_org":if(c){d.push(n.TEMPLATE_CREATOR_CREATE_ORG)}else{d.push(n.TEMPLATE_MEMBER_VISIBILITY)}break;case"change_visibility_public":if(c){d.push(n.TEMPLATE_CREATOR_CREATE_PUBLIC);d.push(n.TEMPLATE_CREATOR_VISIBILITY)}else{d.push(n.TEMPLATE_MEMBER_VISIBILITY)}break;case"delete":if(c){d.push(n.TEMPLATE_CREATOR_DELETE)}else{d.push(n.TEMPLATE_MEMBER_DELETE)}break;default:return{canPerform:false,message:"Action is not defined"}}if(o(e,d)){return{canPerform:true,message:""}}return{canPerform:false,message:"Insufficient access to perform '".concat(t,"'. Needed permissions: ").concat(d.toString())}}));var o=function(e,t){return t.every((function(t){return((e===null||e===void 0?void 0:e.permissions)||[]).includes(t)}))};var a=undefined&&undefined.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n["throw"](e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(a,s)}u((n=n.apply(e,t||[])).next())}))};var s=undefined&&undefined.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(s){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(r=0)),r)try{if(n=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var u=e("g",(function(e,t){return e.api.get("/templates/".concat(t)).then((function(e){return e.data}))}));var c=["name","is_personal","is_public","sender","description","roles","fields"];var f=e("b",(function(e,t,r){var n={timeout:12e4,onUploadProgress:function(e){var t=e.total||1;var n=e.loaded||0;r===null||r===void 0?void 0:r(Math.floor(n*100/(t||1)),n,t||1)}};if(t.documents&&t.documents[0]instanceof File){var i=new FormData;c.forEach((function(e){if(t[e]!==undefined){i.append(e,t[e])}}));t.documents.forEach((function(e){i.append("documents",e,e.name)}));return e.api.post("/v2/templates",i,n).then((function(e){return e.data}))}else{return e.api.post("/v2/templates",t,n).then((function(e){return e.data}))}}));var l=e("u",(function(e,t,r){return e.api.put("/templates/".concat(t),r).then((function(e){return e.data}))}));var p=e("d",(function(e,t){return e.api.delete("/templates/".concat(t)).then((function(e){return e.data}))}));var d;(function(e){e["CREATED_AT"]="created_at";e["UPDATED_AT"]="updated_at";e["NAME"]="name";e["LAST_USED_AT"]="last_used_at";e["COUNTER"]="counter";e["STAR_COUNTER"]="star_counter"})(d||(d={}));var h=e("l",(function(e,t){if(t===void 0){t={}}return a(void 0,void 0,void 0,(function(){return s(this,(function(r){return[2,e.api.post("/templates/list",t).then((function(e){return e.data}))]}))}))}));var v;(function(e){e["CREATOR"]="creator";e["ORGANIZATION_MEMBER"]="organization_member";e["ORGANIZATION_MEMBER_AS_CREATOR"]="organization_member_as_creator";e["EVERYONE"]="everyone";e["EVERYONE_AS_CREATOR"]="everyone_as_creator"})(v||(v=e("T",{})));var E;(function(e){e["CREATE_PERSONAL"]="create_personal";e["CREATE_ORG"]="create_org";e["CREATE_PUBLIC"]="create_public";e["READ"]="read";e["WRITE"]="write";e["DELETE"]="delete";e["CHANGE_VISIBILITY_PERSONAL"]="change_visibility_personal";e["CHANGE_VISIBILITY_ORG"]="change_visibility_org";e["CHANGE_VISIBILITY_PUBLIC"]="change_visibility_public"})(E||(E=e("a",{})));var m;(function(e){e["CREATED_AT"]="created_at";e["UPDATED_AT"]="updated_at";e["NAME"]="name";e["LAST_USED_AT"]="last_used_at";e["COUNTER"]="counter";e["STAR_COUNTER"]="star_counter"})(m||(m={}));var y;(function(e){e["RCOMMON"]="rcommon:access";e["RFORM_ACCESS"]="rform:access";e["ORG_CREATE"]="org:create";e["ORG_VIEW"]="org:view";e["ORG_UPDATE"]="org:update";e["ORG_DELETE"]="org:delete";e["ORG_TRANSFER"]="org:transfer";e["ORG_LIST"]="org:list";e["OWNER_ADD"]="owner:add";e["OWNER_REMOVE"]="owner:remove";e["ADMIN_ADD"]="admin:add";e["ADMIN_REMOVE"]="admin:remove";e["MEMBER_VIEW"]="member:view";e["MEMBER_ADD"]="member:add";e["MEMBER_REMOVE"]="member:remove";e["TEMPLATE_CREATOR_DELETE"]="template:creator:delete";e["TEMPLATE_CREATOR_VISIBILITY"]="template:creator:visibility";e["TEMPLATE_CREATOR_CREATE_ORG"]="template:creator:create:org";e["TEMPLATE_CREATOR_CREATE_PUBLIC"]="template:creator:create:public";e["TEMPLATE_CREATOR_CREATE_PERSONAL"]="template:creator:create:personal";e["TEMPLATE_MEMBER_READ"]="template:member:read";e["TEMPLATE_MEMBER_WRITE"]="template:member:write";e["TEMPLATE_MEMBER_DELETE"]="template:member:delete";e["TEMPLATE_MEMBER_VISIBILITY"]="template:member:visibility"})(y||(y={}));var g;(function(e){e["ENV_ESSENTIAL"]="env:essential";e["ORG_STANDARD"]="org:standard"})(g||(g={}));var _;(function(e){e["OWNER"]="owner";e["BASIC_USER"]="basic_user";e["MEMBER"]="member"})(_||(_={}));function b(e,t){return function r(){return e.apply(t,arguments)}}var R=Object.prototype.toString;var T=Object.getPrototypeOf;var A=function(e){return function(t){var r=R.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));var O=function(e){e=e.toLowerCase();return function(t){return A(t)===e}};var w=function(e){return function(t){return typeof t===e}};var S=Array.isArray;var L=w("undefined");function C(e){return e!==null&&!L(e)&&e.constructor!==null&&!L(e.constructor)&&M(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var P=O("ArrayBuffer");function N(e){var t;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){t=ArrayBuffer.isView(e)}else{t=e&&e.buffer&&P(e.buffer)}return t}var I=w("string");var M=w("function");var B=w("number");var D=function(e){return e!==null&&typeof e==="object"};var j=function(e){return e===true||e===false};var U=function(e){if(A(e)!=="object"){return false}var t=T(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var x=O("Date");var F=O("File");var k=O("Blob");var q=O("FileList");var z=function(e){return D(e)&&M(e.pipe)};var V=function(e){var t;return e&&(typeof FormData==="function"&&e instanceof FormData||M(e.append)&&((t=A(e))==="formdata"||t==="object"&&M(e.toString)&&e.toString()==="[object FormData]"))};var G=O("URLSearchParams");var H=function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function J(e,t,r){var n=r===void 0?{}:r,i=n.allOwnKeys,o=i===void 0?false:i;if(e===null||typeof e==="undefined"){return}var a;var s;if(typeof e!=="object"){e=[e]}if(S(e)){for(a=0,s=e.length;a<s;a++){t.call(null,e[a],a,e)}}else{var u=o?Object.getOwnPropertyNames(e):Object.keys(e);var c=u.length;var f=void 0;for(a=0;a<c;a++){f=u[a];t.call(null,e[f],f,e)}}}function W(e,t){t=t.toLowerCase();var r=Object.keys(e);var n=r.length;var i;while(n-- >0){i=r[n];if(t===i.toLowerCase()){return i}}return null}var K=function(){if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global}();var Y=function(e){return!L(e)&&e!==K};function X(){var e=(Y(this)&&this||{}).caseless;var t={};var r=function(r,n){var i=e&&W(t,n)||n;if(U(t[i])&&U(r)){t[i]=X(t[i],r)}else if(U(r)){t[i]=X({},r)}else if(S(r)){t[i]=r.slice()}else{t[i]=r}};for(var n=0,i=arguments.length;n<i;n++){arguments[n]&&J(arguments[n],r)}return t}var Z=function(e,t,r,n){var i=n===void 0?{}:n,o=i.allOwnKeys;J(t,(function(t,n){if(r&&M(t)){e[n]=b(t,r)}else{e[n]=t}}),{allOwnKeys:o});return e};var $=function(e){if(e.charCodeAt(0)===65279){e=e.slice(1)}return e};var Q=function(e,t,r,n){e.prototype=Object.create(t.prototype,n);e.prototype.constructor=e;Object.defineProperty(e,"super",{value:t.prototype});r&&Object.assign(e.prototype,r)};var ee=function(e,t,r,n){var i;var o;var a;var s={};t=t||{};if(e==null)return t;do{i=Object.getOwnPropertyNames(e);o=i.length;while(o-- >0){a=i[o];if((!n||n(a,e,t))&&!s[a]){t[a]=e[a];s[a]=true}}e=r!==false&&T(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t};var te=function(e,t,r){e=String(e);if(r===undefined||r>e.length){r=e.length}r-=t.length;var n=e.indexOf(t,r);return n!==-1&&n===r};var re=function(e){if(!e)return null;if(S(e))return e;var t=e.length;if(!B(t))return null;var r=new Array(t);while(t-- >0){r[t]=e[t]}return r};var ne=function(e){return function(t){return e&&t instanceof e}}(typeof Uint8Array!=="undefined"&&T(Uint8Array));var ie=function(e,t){var r=e&&e[Symbol.iterator];var n=r.call(e);var i;while((i=n.next())&&!i.done){var o=i.value;t.call(e,o[0],o[1])}};var oe=function(e,t){var r;var n=[];while((r=e.exec(t))!==null){n.push(r)}return n};var ae=O("HTMLFormElement");var se=function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function e(t,r,n){return r.toUpperCase()+n}))};var ue=function(e){var t=e.hasOwnProperty;return function(e,r){return t.call(e,r)}}(Object.prototype);var ce=O("RegExp");var fe=function(e,t){var r=Object.getOwnPropertyDescriptors(e);var n={};J(r,(function(r,i){var o;if((o=t(r,i,e))!==false){n[i]=o||r}}));Object.defineProperties(e,n)};var le=function(e){fe(e,(function(t,r){if(M(e)&&["arguments","caller","callee"].indexOf(r)!==-1){return false}var n=e[r];if(!M(n))return;t.enumerable=false;if("writable"in t){t.writable=false;return}if(!t.set){t.set=function(){throw Error("Can not rewrite read-only method '"+r+"'")}}}))};var pe=function(e,t){var r={};var n=function(e){e.forEach((function(e){r[e]=true}))};S(e)?n(e):n(String(e).split(t));return r};var de=function(){};var he=function(e,t){e=+e;return Number.isFinite(e)?e:t};var ve="abcdefghijklmnopqrstuvwxyz";var Ee="0123456789";var me={DIGIT:Ee,ALPHA:ve,ALPHA_DIGIT:ve+ve.toUpperCase()+Ee};var ye=function(e,t){if(e===void 0){e=16}if(t===void 0){t=me.ALPHA_DIGIT}var r="";var n=t.length;while(e--){r+=t[Math.random()*n|0]}return r};function ge(e){return!!(e&&M(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var _e=function(e){var t=new Array(10);var r=function(e,n){if(D(e)){if(t.indexOf(e)>=0){return}if(!("toJSON"in e)){t[n]=e;var i=S(e)?[]:{};J(e,(function(e,t){var o=r(e,n+1);!L(o)&&(i[t]=o)}));t[n]=undefined;return i}}return e};return r(e,0)};var be=O("AsyncFunction");var Re=function(e){return e&&(D(e)||M(e))&&M(e.then)&&M(e.catch)};var Te={isArray:S,isArrayBuffer:P,isBuffer:C,isFormData:V,isArrayBufferView:N,isString:I,isNumber:B,isBoolean:j,isObject:D,isPlainObject:U,isUndefined:L,isDate:x,isFile:F,isBlob:k,isRegExp:ce,isFunction:M,isStream:z,isURLSearchParams:G,isTypedArray:ne,isFileList:q,forEach:J,merge:X,extend:Z,trim:H,stripBOM:$,inherits:Q,toFlatObject:ee,kindOf:A,kindOfTest:O,endsWith:te,toArray:re,forEachEntry:ie,matchAll:oe,isHTMLForm:ae,hasOwnProperty:ue,hasOwnProp:ue,reduceDescriptors:fe,freezeMethods:le,toObjectSet:pe,toCamelCase:se,noop:de,toFiniteNumber:he,findKey:W,global:K,isContextDefined:Y,ALPHABET:me,generateString:ye,isSpecCompliantForm:ge,toJSONObject:_e,isAsyncFn:be,isThenable:Re};function Ae(e,t,r,n,i){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack}this.message=e;this.name="AxiosError";t&&(this.code=t);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}Te.inherits(Ae,Error,{toJSON:function e(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Te.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Oe=Ae.prototype;var we={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){we[e]={value:e}}));Object.defineProperties(Ae,we);Object.defineProperty(Oe,"isAxiosError",{value:true});Ae.from=function(e,t,r,n,i,o){var a=Object.create(Oe);Te.toFlatObject(e,a,(function e(t){return t!==Error.prototype}),(function(e){return e!=="isAxiosError"}));Ae.call(a,e.message,t,r,n,i);a.cause=e;a.name=e.name;o&&Object.assign(a,o);return a};var Se=null;function Le(e){return Te.isPlainObject(e)||Te.isArray(e)}function Ce(e){return Te.endsWith(e,"[]")?e.slice(0,-2):e}function Pe(e,t,r){if(!e)return t;return e.concat(t).map((function e(t,n){t=Ce(t);return!r&&n?"["+t+"]":t})).join(r?".":"")}function Ne(e){return Te.isArray(e)&&!e.some(Le)}var Ie=Te.toFlatObject(Te,{},null,(function e(t){return/^is[A-Z]/.test(t)}));function Me(e,t,r){if(!Te.isObject(e)){throw new TypeError("target must be an object")}t=t||new FormData;r=Te.toFlatObject(r,{metaTokens:true,dots:false,indexes:false},false,(function e(t,r){return!Te.isUndefined(r[t])}));var n=r.metaTokens;var i=r.visitor||f;var o=r.dots;var a=r.indexes;var s=r.Blob||typeof Blob!=="undefined"&&Blob;var u=s&&Te.isSpecCompliantForm(t);if(!Te.isFunction(i)){throw new TypeError("visitor must be a function")}function c(e){if(e===null)return"";if(Te.isDate(e)){return e.toISOString()}if(!u&&Te.isBlob(e)){throw new Ae("Blob is not supported. Use a Buffer instead.")}if(Te.isArrayBuffer(e)||Te.isTypedArray(e)){return u&&typeof Blob==="function"?new Blob([e]):Buffer.from(e)}return e}function f(e,r,i){var s=e;if(e&&!i&&typeof e==="object"){if(Te.endsWith(r,"{}")){r=n?r:r.slice(0,-2);e=JSON.stringify(e)}else if(Te.isArray(e)&&Ne(e)||(Te.isFileList(e)||Te.endsWith(r,"[]"))&&(s=Te.toArray(e))){r=Ce(r);s.forEach((function e(n,i){!(Te.isUndefined(n)||n===null)&&t.append(a===true?Pe([r],i,o):a===null?r:r+"[]",c(n))}));return false}}if(Le(e)){return true}t.append(Pe(i,r,o),c(e));return false}var l=[];var p=Object.assign(Ie,{defaultVisitor:f,convertValue:c,isVisitable:Le});function d(e,r){if(Te.isUndefined(e))return;if(l.indexOf(e)!==-1){throw Error("Circular reference detected in "+r.join("."))}l.push(e);Te.forEach(e,(function e(n,o){var a=!(Te.isUndefined(n)||n===null)&&i.call(t,n,Te.isString(o)?o.trim():o,r,p);if(a===true){d(n,r?r.concat(o):[o])}}));l.pop()}if(!Te.isObject(e)){throw new TypeError("data must be an object")}d(e);return t}function Be(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function e(r){return t[r]}))}function De(e,t){this._pairs=[];e&&Me(e,this,t)}var je=De.prototype;je.append=function e(t,r){this._pairs.push([t,r])};je.toString=function e(t){var r=t?function(e){return t.call(this,e,Be)}:Be;return this._pairs.map((function e(t){return r(t[0])+"="+r(t[1])}),"").join("&")};function Ue(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function xe(e,t,r){if(!t){return e}var n=r&&r.encode||Ue;var i=r&&r.serialize;var o;if(i){o=i(t,r)}else{o=Te.isURLSearchParams(t)?t.toString():new De(t,r).toString(n)}if(o){var a=e.indexOf("#");if(a!==-1){e=e.slice(0,a)}e+=(e.indexOf("?")===-1?"?":"&")+o}return e}var Fe=function(){function e(){this.handlers=[]}e.prototype.use=function(e,t,r){this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:false,runWhen:r?r.runWhen:null});return this.handlers.length-1};e.prototype.eject=function(e){if(this.handlers[e]){this.handlers[e]=null}};e.prototype.clear=function(){if(this.handlers){this.handlers=[]}};e.prototype.forEach=function(e){Te.forEach(this.handlers,(function t(r){if(r!==null){e(r)}}))};return e}();var ke={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};var qe=typeof URLSearchParams!=="undefined"?URLSearchParams:De;var ze=typeof FormData!=="undefined"?FormData:null;var Ve=typeof Blob!=="undefined"?Blob:null;var Ge={isBrowser:true,classes:{URLSearchParams:qe,FormData:ze,Blob:Ve},protocols:["http","https","file","blob","url","data"]};var He=typeof window!=="undefined"&&typeof document!=="undefined";var Je=function(e){return He&&["ReactNative","NativeScript","NS"].indexOf(e)<0}(typeof navigator!=="undefined"&&navigator.product);var We=function(){return typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function"}();var Ke=Object.freeze({__proto__:null,hasBrowserEnv:He,hasStandardBrowserWebWorkerEnv:We,hasStandardBrowserEnv:Je});var Ye=__assign(__assign({},Ke),Ge);function Xe(e,t){return Me(e,new Ye.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){if(Ye.isNode&&Te.isBuffer(e)){this.append(t,e.toString("base64"));return false}return n.defaultVisitor.apply(this,arguments)}},t))}function Ze(e){return Te.matchAll(/\w+|\[(\w*)]/g,e).map((function(e){return e[0]==="[]"?"":e[1]||e[0]}))}function $e(e){var t={};var r=Object.keys(e);var n;var i=r.length;var o;for(n=0;n<i;n++){o=r[n];t[o]=e[o]}return t}function Qe(e){function t(e,r,n,i){var o=e[i++];var a=Number.isFinite(+o);var s=i>=e.length;o=!o&&Te.isArray(n)?n.length:o;if(s){if(Te.hasOwnProp(n,o)){n[o]=[n[o],r]}else{n[o]=r}return!a}if(!n[o]||!Te.isObject(n[o])){n[o]=[]}var u=t(e,r,n[o],i);if(u&&Te.isArray(n[o])){n[o]=$e(n[o])}return!a}if(Te.isFormData(e)&&Te.isFunction(e.entries)){var r={};Te.forEachEntry(e,(function(e,n){t(Ze(e),n,r,0)}));return r}return null}function et(e,t,r){if(Te.isString(e)){try{(t||JSON.parse)(e);return Te.trim(e)}catch(e){if(e.name!=="SyntaxError"){throw e}}}return(r||JSON.stringify)(e)}var tt={transitional:ke,adapter:["xhr","http"],transformRequest:[function e(t,r){var n=r.getContentType()||"";var i=n.indexOf("application/json")>-1;var o=Te.isObject(t);if(o&&Te.isHTMLForm(t)){t=new FormData(t)}var a=Te.isFormData(t);if(a){if(!i){return t}return i?JSON.stringify(Qe(t)):t}if(Te.isArrayBuffer(t)||Te.isBuffer(t)||Te.isStream(t)||Te.isFile(t)||Te.isBlob(t)){return t}if(Te.isArrayBufferView(t)){return t.buffer}if(Te.isURLSearchParams(t)){r.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return t.toString()}var s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1){return Xe(t,this.formSerializer).toString()}if((s=Te.isFileList(t))||n.indexOf("multipart/form-data")>-1){var u=this.env&&this.env.FormData;return Me(s?{"files[]":t}:t,u&&new u,this.formSerializer)}}if(o||i){r.setContentType("application/json",false);return et(t)}return t}],transformResponse:[function e(t){var r=this.transitional||tt.transitional;var n=r&&r.forcedJSONParsing;var i=this.responseType==="json";if(t&&Te.isString(t)&&(n&&!this.responseType||i)){var o=r&&r.silentJSONParsing;var a=!o&&i;try{return JSON.parse(t)}catch(e){if(a){if(e.name==="SyntaxError"){throw Ae.from(e,Ae.ERR_BAD_RESPONSE,this,null,this.response)}throw e}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ye.classes.FormData,Blob:Ye.classes.Blob},validateStatus:function e(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};Te.forEach(["delete","get","head","post","put","patch"],(function(e){tt.headers[e]={}}));var rt=Te.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var nt=function(e){var t={};var r;var n;var i;e&&e.split("\n").forEach((function e(o){i=o.indexOf(":");r=o.substring(0,i).trim().toLowerCase();n=o.substring(i+1).trim();if(!r||t[r]&&rt[r]){return}if(r==="set-cookie"){if(t[r]){t[r].push(n)}else{t[r]=[n]}}else{t[r]=t[r]?t[r]+", "+n:n}}));return t};var it=Symbol("internals");function ot(e){return e&&String(e).trim().toLowerCase()}function at(e){if(e===false||e==null){return e}return Te.isArray(e)?e.map(at):String(e)}function st(e){var t=Object.create(null);var r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;var n;while(n=r.exec(e)){t[n[1]]=n[2]}return t}var ut=function(e){return/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())};function ct(e,t,r,n,i){if(Te.isFunction(n)){return n.call(this,t,r)}if(i){t=r}if(!Te.isString(t))return;if(Te.isString(n)){return t.indexOf(n)!==-1}if(Te.isRegExp(n)){return n.test(t)}}function ft(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r}))}function lt(e,t){var r=Te.toCamelCase(" "+t);["get","set","has"].forEach((function(n){Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:true})}))}var pt=function(){function e(e){e&&this.set(e)}e.prototype.set=function(e,t,r){var n=this;function i(e,t,r){var i=ot(t);if(!i){throw new Error("header name must be a non-empty string")}var o=Te.findKey(n,i);if(!o||n[o]===undefined||r===true||r===undefined&&n[o]!==false){n[o||t]=at(e)}}var o=function(e,t){return Te.forEach(e,(function(e,r){return i(e,r,t)}))};if(Te.isPlainObject(e)||e instanceof this.constructor){o(e,t)}else if(Te.isString(e)&&(e=e.trim())&&!ut(e)){o(nt(e),t)}else{e!=null&&i(t,e,r)}return this};e.prototype.get=function(e,t){e=ot(e);if(e){var r=Te.findKey(this,e);if(r){var n=this[r];if(!t){return n}if(t===true){return st(n)}if(Te.isFunction(t)){return t.call(this,n,r)}if(Te.isRegExp(t)){return t.exec(n)}throw new TypeError("parser must be boolean|regexp|function")}}};e.prototype.has=function(e,t){e=ot(e);if(e){var r=Te.findKey(this,e);return!!(r&&this[r]!==undefined&&(!t||ct(this,this[r],r,t)))}return false};e.prototype.delete=function(e,t){var r=this;var n=false;function i(e){e=ot(e);if(e){var i=Te.findKey(r,e);if(i&&(!t||ct(r,r[i],i,t))){delete r[i];n=true}}}if(Te.isArray(e)){e.forEach(i)}else{i(e)}return n};e.prototype.clear=function(e){var t=Object.keys(this);var r=t.length;var n=false;while(r--){var i=t[r];if(!e||ct(this,this[i],i,e,true)){delete this[i];n=true}}return n};e.prototype.normalize=function(e){var t=this;var r={};Te.forEach(this,(function(n,i){var o=Te.findKey(r,i);if(o){t[o]=at(n);delete t[i];return}var a=e?ft(i):String(i).trim();if(a!==i){delete t[i]}t[a]=at(n);r[a]=true}));return this};e.prototype.concat=function(){var e;var t=[];for(var r=0;r<arguments.length;r++){t[r]=arguments[r]}return(e=this.constructor).concat.apply(e,__spreadArray([this],t,false))};e.prototype.toJSON=function(e){var t=Object.create(null);Te.forEach(this,(function(r,n){r!=null&&r!==false&&(t[n]=e&&Te.isArray(r)?r.join(", "):r)}));return t};e.prototype[Symbol.iterator]=function(){return Object.entries(this.toJSON())[Symbol.iterator]()};e.prototype.toString=function(){return Object.entries(this.toJSON()).map((function(e){var t=e[0],r=e[1];return t+": "+r})).join("\n")};Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return"AxiosHeaders"},enumerable:false,configurable:true});e.from=function(e){return e instanceof this?e:new this(e)};e.concat=function(e){var t=[];for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}var n=new this(e);t.forEach((function(e){return n.set(e)}));return n};e.accessor=function(e){var t=this[it]=this[it]={accessors:{}};var r=t.accessors;var n=this.prototype;function i(e){var t=ot(e);if(!r[t]){lt(n,e);r[t]=true}}Te.isArray(e)?e.forEach(i):i(e);return this};return e}();pt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Te.reduceDescriptors(pt.prototype,(function(e,t){var r=e.value;var n=t[0].toUpperCase()+t.slice(1);return{get:function(){return r},set:function(e){this[n]=e}}}));Te.freezeMethods(pt);function dt(e,t){var r=this||tt;var n=t||r;var i=pt.from(n.headers);var o=n.data;Te.forEach(e,(function e(n){o=n.call(r,o,i.normalize(),t?t.status:undefined)}));i.normalize();return o}function ht(e){return!!(e&&e.__CANCEL__)}function vt(e,t,r){Ae.call(this,e==null?"canceled":e,Ae.ERR_CANCELED,t,r);this.name="CanceledError"}Te.inherits(vt,Ae,{__CANCEL__:true});function Et(e,t,r){var n=r.config.validateStatus;if(!r.status||!n||n(r.status)){e(r)}else{t(new Ae("Request failed with status code "+r.status,[Ae.ERR_BAD_REQUEST,Ae.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}}var mt=Ye.hasStandardBrowserEnv?{write:function(e,t,r,n,i,o){var a=[e+"="+encodeURIComponent(t)];Te.isNumber(r)&&a.push("expires="+new Date(r).toGMTString());Te.isString(n)&&a.push("path="+n);Te.isString(i)&&a.push("domain="+i);o===true&&a.push("secure");document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function yt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function gt(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function _t(e,t){if(e&&!yt(t)){return gt(e,t)}return t}var bt=Ye.hasStandardBrowserEnv?function e(){var t=/(msie|trident)/i.test(navigator.userAgent);var r=document.createElement("a");var n;function i(e){var n=e;if(t){r.setAttribute("href",n);n=r.href}r.setAttribute("href",n);return{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}n=i(window.location.href);return function e(t){var r=Te.isString(t)?i(t):t;return r.protocol===n.protocol&&r.host===n.host}}():function e(){return function e(){return true}}();function Rt(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Tt(e,t){e=e||10;var r=new Array(e);var n=new Array(e);var i=0;var o=0;var a;t=t!==undefined?t:1e3;return function s(u){var c=Date.now();var f=n[o];if(!a){a=c}r[i]=u;n[i]=c;var l=o;var p=0;while(l!==i){p+=r[l++];l=l%e}i=(i+1)%e;if(i===o){o=(o+1)%e}if(c-a<t){return}var d=f&&c-f;return d?Math.round(p*1e3/d):undefined}}function At(e,t){var r=0;var n=Tt(50,250);return function(i){var o=i.loaded;var a=i.lengthComputable?i.total:undefined;var s=o-r;var u=n(s);var c=o<=a;r=o;var f={loaded:o,total:a,progress:a?o/a:undefined,bytes:s,rate:u?u:undefined,estimated:u&&a&&c?(a-o)/u:undefined,event:i};f[t?"download":"upload"]=true;e(f)}}var Ot=typeof XMLHttpRequest!=="undefined";var wt=Ot&&function(e){return new Promise((function t(r,n){var i=e.data;var o=pt.from(e.headers).normalize();var a=e.responseType,s=e.withXSRFToken;var u;function c(){if(e.cancelToken){e.cancelToken.unsubscribe(u)}if(e.signal){e.signal.removeEventListener("abort",u)}}var f;if(Te.isFormData(i)){if(Ye.hasStandardBrowserEnv||Ye.hasStandardBrowserWebWorkerEnv){o.setContentType(false)}else if((f=o.getContentType())!==false){var l=f?f.split(";").map((function(e){return e.trim()})).filter(Boolean):[],p=l[0],d=l.slice(1);o.setContentType(__spreadArray([p||"multipart/form-data"],d,true).join("; "))}}var h=new XMLHttpRequest;if(e.auth){var v=e.auth.username||"";var E=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(v+":"+E))}var m=_t(e.baseURL,e.url);h.open(e.method.toUpperCase(),xe(m,e.params,e.paramsSerializer),true);h.timeout=e.timeout;function y(){if(!h){return}var t=pt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());var i=!a||a==="text"||a==="json"?h.responseText:h.response;var o={data:i,status:h.status,statusText:h.statusText,headers:t,config:e,request:h};Et((function e(t){r(t);c()}),(function e(t){n(t);c()}),o);h=null}if("onloadend"in h){h.onloadend=y}else{h.onreadystatechange=function e(){if(!h||h.readyState!==4){return}if(h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)){return}setTimeout(y)}}h.onabort=function t(){if(!h){return}n(new Ae("Request aborted",Ae.ECONNABORTED,e,h));h=null};h.onerror=function t(){n(new Ae("Network Error",Ae.ERR_NETWORK,e,h));h=null};h.ontimeout=function t(){var r=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";var i=e.transitional||ke;if(e.timeoutErrorMessage){r=e.timeoutErrorMessage}n(new Ae(r,i.clarifyTimeoutError?Ae.ETIMEDOUT:Ae.ECONNABORTED,e,h));h=null};if(Ye.hasStandardBrowserEnv){s&&Te.isFunction(s)&&(s=s(e));if(s||s!==false&&bt(m)){var g=e.xsrfHeaderName&&e.xsrfCookieName&&mt.read(e.xsrfCookieName);if(g){o.set(e.xsrfHeaderName,g)}}}i===undefined&&o.setContentType(null);if("setRequestHeader"in h){Te.forEach(o.toJSON(),(function e(t,r){h.setRequestHeader(r,t)}))}if(!Te.isUndefined(e.withCredentials)){h.withCredentials=!!e.withCredentials}if(a&&a!=="json"){h.responseType=e.responseType}if(typeof e.onDownloadProgress==="function"){h.addEventListener("progress",At(e.onDownloadProgress,true))}if(typeof e.onUploadProgress==="function"&&h.upload){h.upload.addEventListener("progress",At(e.onUploadProgress))}if(e.cancelToken||e.signal){u=function(t){if(!h){return}n(!t||t.type?new vt(null,e,h):t);h.abort();h=null};e.cancelToken&&e.cancelToken.subscribe(u);if(e.signal){e.signal.aborted?u():e.signal.addEventListener("abort",u)}}var _=Rt(m);if(_&&Ye.protocols.indexOf(_)===-1){n(new Ae("Unsupported protocol "+_+":",Ae.ERR_BAD_REQUEST,e));return}h.send(i||null)}))};var St={http:Se,xhr:wt};Te.forEach(St,(function(e,t){if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var Lt=function(e){return"- ".concat(e)};var Ct=function(e){return Te.isFunction(e)||e===null||e===false};var Pt={getAdapter:function(e){e=Te.isArray(e)?e:[e];var t=e.length;var r;var n;var i={};for(var o=0;o<t;o++){r=e[o];var a=void 0;n=r;if(!Ct(r)){n=St[(a=String(r)).toLowerCase()];if(n===undefined){throw new Ae("Unknown adapter '".concat(a,"'"))}}if(n){break}i[a||"#"+o]=n}if(!n){var s=Object.entries(i).map((function(e){var t=e[0],r=e[1];return"adapter ".concat(t," ")+(r===false?"is not supported by the environment":"is not available in the build")}));var u=t?s.length>1?"since :\n"+s.map(Lt).join("\n"):" "+Lt(s[0]):"as no adapter specified";throw new Ae("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return n},adapters:St};function Nt(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new vt(null,e)}}function It(e){Nt(e);e.headers=pt.from(e.headers);e.data=dt.call(e,e.transformRequest);if(["post","put","patch"].indexOf(e.method)!==-1){e.headers.setContentType("application/x-www-form-urlencoded",false)}var t=Pt.getAdapter(e.adapter||tt.adapter);return t(e).then((function t(r){Nt(e);r.data=dt.call(e,e.transformResponse,r);r.headers=pt.from(r.headers);return r}),(function t(r){if(!ht(r)){Nt(e);if(r&&r.response){r.response.data=dt.call(e,e.transformResponse,r.response);r.response.headers=pt.from(r.response.headers)}}return Promise.reject(r)}))}var Mt=function(e){return e instanceof pt?e.toJSON():e};function Bt(e,t){t=t||{};var r={};function n(e,t,r){if(Te.isPlainObject(e)&&Te.isPlainObject(t)){return Te.merge.call({caseless:r},e,t)}else if(Te.isPlainObject(t)){return Te.merge({},t)}else if(Te.isArray(t)){return t.slice()}return t}function i(e,t,r){if(!Te.isUndefined(t)){return n(e,t,r)}else if(!Te.isUndefined(e)){return n(undefined,e,r)}}function o(e,t){if(!Te.isUndefined(t)){return n(undefined,t)}}function a(e,t){if(!Te.isUndefined(t)){return n(undefined,t)}else if(!Te.isUndefined(e)){return n(undefined,e)}}function s(r,i,o){if(o in t){return n(r,i)}else if(o in e){return n(undefined,r)}}var u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:function(e,t){return i(Mt(e),Mt(t),true)}};Te.forEach(Object.keys(Object.assign({},e,t)),(function n(o){var a=u[o]||i;var c=a(e[o],t[o],o);Te.isUndefined(c)&&a!==s||(r[o]=c)}));return r}var Dt="1.6.2";var jt={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){jt[e]=function r(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var Ut={};jt.transitional=function e(t,r,n){function i(e,t){return"[Axios v"+Dt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(e,n,o){if(t===false){throw new Ae(i(n," has been removed"+(r?" in "+r:"")),Ae.ERR_DEPRECATED)}if(r&&!Ut[n]){Ut[n]=true;console.warn(i(n," has been deprecated since v"+r+" and will be removed in the near future"))}return t?t(e,n,o):true}};function xt(e,t,r){if(typeof e!=="object"){throw new Ae("options must be an object",Ae.ERR_BAD_OPTION_VALUE)}var n=Object.keys(e);var i=n.length;while(i-- >0){var o=n[i];var a=t[o];if(a){var s=e[o];var u=s===undefined||a(s,o,e);if(u!==true){throw new Ae("option "+o+" must be "+u,Ae.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new Ae("Unknown option "+o,Ae.ERR_BAD_OPTION)}}}var Ft={assertOptions:xt,validators:jt};var kt=Ft.validators;var qt=function(){function e(e){this.defaults=e;this.interceptors={request:new Fe,response:new Fe}}e.prototype.request=function(e,t){if(typeof e==="string"){t=t||{};t.url=e}else{t=e||{}}t=Bt(this.defaults,t);var r=t.transitional,n=t.paramsSerializer,i=t.headers;if(r!==undefined){Ft.assertOptions(r,{silentJSONParsing:kt.transitional(kt.boolean),forcedJSONParsing:kt.transitional(kt.boolean),clarifyTimeoutError:kt.transitional(kt.boolean)},false)}if(n!=null){if(Te.isFunction(n)){t.paramsSerializer={serialize:n}}else{Ft.assertOptions(n,{encode:kt.function,serialize:kt.function},true)}}t.method=(t.method||this.defaults.method||"get").toLowerCase();var o=i&&Te.merge(i.common,i[t.method]);i&&Te.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete i[e]}));t.headers=pt.concat(o,i);var a=[];var s=true;this.interceptors.request.forEach((function e(r){if(typeof r.runWhen==="function"&&r.runWhen(t)===false){return}s=s&&r.synchronous;a.unshift(r.fulfilled,r.rejected)}));var u=[];this.interceptors.response.forEach((function e(t){u.push(t.fulfilled,t.rejected)}));var c;var f=0;var l;if(!s){var p=[It.bind(this),undefined];p.unshift.apply(p,a);p.push.apply(p,u);l=p.length;c=Promise.resolve(t);while(f<l){c=c.then(p[f++],p[f++])}return c}l=a.length;var d=t;f=0;while(f<l){var h=a[f++];var v=a[f++];try{d=h(d)}catch(e){v.call(this,e);break}}try{c=It.call(this,d)}catch(e){return Promise.reject(e)}f=0;l=u.length;while(f<l){c=c.then(u[f++],u[f++])}return c};e.prototype.getUri=function(e){e=Bt(this.defaults,e);var t=_t(e.baseURL,e.url);return xe(t,e.params,e.paramsSerializer)};return e}();Te.forEach(["delete","get","head","options"],(function e(t){qt.prototype[t]=function(e,r){return this.request(Bt(r||{},{method:t,url:e,data:(r||{}).data}))}}));Te.forEach(["post","put","patch"],(function e(t){function r(e){return function r(n,i,o){return this.request(Bt(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}qt.prototype[t]=r();qt.prototype[t+"Form"]=r(true)}));var zt=function(){function e(e){if(typeof e!=="function"){throw new TypeError("executor must be a function.")}var t;this.promise=new Promise((function e(r){t=r}));var r=this;this.promise.then((function(e){if(!r._listeners)return;var t=r._listeners.length;while(t-- >0){r._listeners[t](e)}r._listeners=null}));this.promise.then=function(e){var t;var n=new Promise((function(e){r.subscribe(e);t=e})).then(e);n.cancel=function e(){r.unsubscribe(t)};return n};e((function e(n,i,o){if(r.reason){return}r.reason=new vt(n,i,o);t(r.reason)}))}e.prototype.throwIfRequested=function(){if(this.reason){throw this.reason}};e.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}if(this._listeners){this._listeners.push(e)}else{this._listeners=[e]}};e.prototype.unsubscribe=function(e){if(!this._listeners){return}var t=this._listeners.indexOf(e);if(t!==-1){this._listeners.splice(t,1)}};e.source=function(){var t;var r=new e((function e(r){t=r}));return{token:r,cancel:t}};return e}();function Vt(e){return function t(r){return e.apply(null,r)}}function Gt(e){return Te.isObject(e)&&e.isAxiosError===true}var Ht={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ht).forEach((function(e){var t=e[0],r=e[1];Ht[r]=t}));function Jt(e){var t=new qt(e);var r=b(qt.prototype.request,t);Te.extend(r,qt.prototype,t,{allOwnKeys:true});Te.extend(r,t,null,{allOwnKeys:true});r.create=function t(r){return Jt(Bt(e,r))};return r}var Wt=Jt(tt);Wt.Axios=qt;Wt.CanceledError=vt;Wt.CancelToken=zt;Wt.isCancel=ht;Wt.VERSION=Dt;Wt.toFormData=Me;Wt.AxiosError=Ae;Wt.Cancel=Wt.CanceledError;Wt.all=function e(t){return Promise.all(t)};Wt.spread=Vt;Wt.isAxiosError=Gt;Wt.mergeConfig=Bt;Wt.AxiosHeaders=pt;Wt.formToJSON=function(e){return Qe(Te.isHTMLForm(e)?new FormData(e):e)};Wt.getAdapter=Pt.getAdapter;Wt.HttpStatusCode=Ht;Wt.default=Wt;var Kt=function(){if(typeof self==="object"&&self)return self;if(typeof window==="object"&&window)return window;throw new Error("Unable to resolve global `this`")};var Yt=function(){if(this)return this;if(typeof globalThis==="object"&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:true})}catch(e){return Kt()}try{if(!__global__)return Kt();return __global__}finally{delete Object.prototype.__global__}}();var Xt=Symbol.for("verdocs-default-endpoint");var Zt=function(e){console.debug("[JS-SDK] ".concat(e.method.toUpperCase()," ").concat(e.baseURL).concat(e.url),e.data?JSON.stringify(e.data):"");return e};var $t=e("V",function(){function e(e){this.environment="verdocs";this.sessionType="user";this.baseURL=window.location.origin==="https://beta.verdocs.com"?"https://stage-api.verdocs.com":"https://api.verdocs.com";this.clientID="not-set";this.timeout=6e4;this.token=null;this.nextListenerId=0;this.sessionListeners=new Map;this.requestLoggerId=null;this.session=null;this.baseURL=(e===null||e===void 0?void 0:e.baseURL)||this.baseURL;this.timeout=(e===null||e===void 0?void 0:e.timeout)||this.timeout;this.environment=(e===null||e===void 0?void 0:e.environment)||this.environment;this.sessionType=(e===null||e===void 0?void 0:e.sessionType)||this.sessionType;this.clientID=(e===null||e===void 0?void 0:e.clientID)||this.clientID;this.api=Wt.create({baseURL:this.baseURL,timeout:this.timeout})}e.prototype.setDefault=function(){Yt[Xt]=this};e.getDefault=function(){if(!Yt[Xt]){Yt[Xt]=new e;window.console.debug("[JS_SDK] Created default endpoint",Yt[Xt].baseURL)}return Yt[Xt]};e.prototype.getEnvironment=function(){return this.environment};e.prototype.getSessionType=function(){return this.sessionType};e.prototype.getBaseURL=function(){return this.baseURL};e.prototype.getClientID=function(){return this.clientID};e.prototype.getTimeout=function(){return this.timeout};e.prototype.getSession=function(){return this.session};e.prototype.setEnvironment=function(e){this.environment=e;return this};e.prototype.setSessionType=function(e){this.sessionType=e;return this};e.prototype.setBaseURL=function(e){this.baseURL=e;this.api.defaults.baseURL=e;return this};e.prototype.setClientID=function(e){this.clientID=e;this.api.defaults.headers.common["X-Client-ID"]=e;return this};e.prototype.setTimeout=function(e){this.timeout=e;this.api.defaults.timeout=e;return this};e.prototype.logRequests=function(e){if(e&&this.requestLoggerId===null){this.requestLoggerId=this.api.interceptors.request.use(Zt)}else if(!e&&this.requestLoggerId!==null){this.api.interceptors.request.eject(this.requestLoggerId)}return this};e.prototype.setToken=function(e){if(!e){return this.clearSession()}var r=t(e);if(r===null||r.exp&&r.exp*1e3<(new Date).getTime()){window.console.warn("[JS_SDK] Ignoring attempt to use expired session token");return this.clearSession()}this.token=e;this.session=r;if(this.sessionType==="user"){this.api.defaults.headers.common.Authorization="Bearer ".concat(e)}else{this.api.defaults.headers.common.signer="Bearer ".concat(e)}localStorage.setItem(this.sessionStorageKey(),e);this.notifySessionListeners();return this};e.prototype.getToken=function(){return this.token};e.prototype.sessionStorageKey=function(){return"verdocs-session-".concat(this.getSessionType(),"-").concat(this.getEnvironment())};e.prototype.clearSession=function(){localStorage.removeItem(this.sessionStorageKey());delete this.api.defaults.headers.common.Authorization;delete this.api.defaults.headers.common.signer;this.session=null;this.token=null;this.notifySessionListeners();return this};e.prototype.clearSignerSession=function(){localStorage.removeItem(this.sessionStorageKey());delete this.api.defaults.headers.common.Authorization;this.session=null;this.token=null;this.notifySessionListeners();return this};e.prototype.notifySessionListeners=function(){var e=this;this.sessionListeners.forEach((function(t){try{t(e,e.session)}catch(e){}}))};e.prototype.onSessionChanged=function(e){var t=this;this.nextListenerId++;var r=Symbol.for(""+this.nextListenerId);this.sessionListeners.set(r,e);return function(){t.sessionListeners.delete(r)}};e.prototype.loadSession=function(){var e=localStorage.getItem(this.sessionStorageKey());if(!e){return this.clearSession()}return this.setToken(e)};return e}())}}}));
|