@verdocs/web-sdk 1.12.35 → 1.12.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/verdocs-send.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-create_3.cjs.entry.js +10 -9
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +1 -1
- package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.js +7 -4
- package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js +3 -5
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-template-create2.js +7 -4
- package/dist/components/verdocs-template-roles2.js +3 -5
- package/dist/custom-elements.json +1487 -0
- package/dist/docs.json +1 -1
- package/dist/esm/verdocs-send.entry.js +1 -1
- package/dist/esm/verdocs-template-create_3.entry.js +10 -9
- package/dist/esm-es5/verdocs-send.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-create_3.entry.js +1 -1
- package/dist/types/components/templates/verdocs-template-roles/verdocs-template-roles.d.ts +2 -2
- package/dist/verdocs-web-sdk/{p-fe2ab7b9.entry.js → p-26425865.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-6caf1137.system.js +1 -1
- package/dist/verdocs-web-sdk/p-9492a0fe.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-afd51296.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-c4229602.system.entry.js → p-c46c6a49.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/verdocs-web-sdk/p-5cf14e4c.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-6e1e787a.system.entry.js +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,o,r){function i(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,n){function a(e){try{l(r.next(e))}catch(e){n(e)}}function s(e){try{l(r["throw"](e))}catch(e){n(e)}}function l(e){e.done?o(e.value):i(e.value).then(a,s)}l((r=r.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:[]},r,i,n,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 l([e,t])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(o)try{if(r=1,i&&(n=a[0]&2?i["return"]:a[0]?i["throw"]||((n=i["return"])&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;if(i=0,n)a=[a[0]&2,n.value];switch(a[0]){case 0:case 1:n=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;i=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(n=o.trys,n=n.length>0&&n[n.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!n||a[1]>n[0]&&a[1]<n[3])){o.label=a[1];break}if(a[0]===6&&o.label<n[1]){o.label=n[1];n=a;break}if(n&&o.label<n[2]){o.label=n[2];o.ops.push(a);break}if(n[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e];i=0}finally{r=n=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,o){if(o||arguments.length===2)for(var r=0,i=t.length,n;r<i;r++){if(n||!(r in t)){if(!n)n=Array.prototype.slice.call(t,0,r);n[r]=t[r]}}return e.concat(n||Array.prototype.slice.call(t))};System.register(["./p-871407e9.system.js","./p-d46a428b.system.js","./p-69912cbf.system.js","./p-63398dca.system.js","./p-5c043400.system.js","./p-187b20b7.system.js","./p-9a20f533.system.js","./p-b1288daf.system.js","./p-0d81757b.system.js","./p-71b8bb54.system.js","./p-8ac64953.system.js","./p-8229e6df.system.js","./p-05eb4fed.system.js","./p-db003554.system.js","./p-327858f0.system.js","./p-51a3ea62.system.js","./p-d50523fd.system.js"],(function(e){"use strict";var t,o,r,i,n,a,s,l,d,c,p,u,g,m,h,f,v,x,b,w,y,q,C,E,k;return{setters:[function(e){t=e.r;o=e.c;r=e.h;i=e.H;n=e.F;a=e.a},function(){},function(e){s=e.c;l=e.g},function(e){d=e.c},function(e){c=e.V;p=e.T},function(e){u=e.S},function(e){g=e.i},function(e){m=e.u;h=e.c},function(e){f=e.b;v=e.r;x=e.e;b=e.f;w=e.h},function(e){y=e.s},function(e){q=e.l},function(e){C=e.u;E=e.c},function(e){k=e.g},function(){},function(){},function(){},function(){}],execute:function(){var M;var L='verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .progress-wrapper{padding:20px}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';var Z=" ";var _='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>';var R=e("verdocs_template_create",function(){function e(e){t(this,e);this.exit=o(this,"exit",7);this.next=o(this,"next",7);this.sdkError=o(this,"sdkError",7);this.endpoint=c.getDefault();this.file=undefined;this.creating=false;this.progressLabel="Uploading...";this.progressPercent=0}e.prototype.componentWillLoad=function(){this.endpoint.setTimeout(3e4);this.endpoint.loadSession()};e.prototype.handleFileChanged=function(e){var t;this.file=((t=e.target.files)===null||t===void 0?void 0:t[0])||null;console.log("[CREATE] Selected file",this.file)};e.prototype.handleUpload=function(e){e.stopPropagation();var t=document.getElementById("verdocs-template-create-file");t.click()};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleSubmit=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o,r,i,n,a,c,p;var g=this;return __generator(this,(function(m){switch(m.label){case 0:e.stopPropagation();console.log("Submitting");if(!this.file){return[2]}this.creating=true;this.progressLabel="Uploading...";m.label=1;case 1:m.trys.push([1,5,,6]);return[4,s(this.endpoint,{name:this.file.name})];case 2:n=m.sent();console.log("[CREATE] Created template",n);return[4,d(this.endpoint,n.id,this.file,(function(e){console.log("Upload progress",e);g.progressPercent=e}))];case 3:a=m.sent();console.log("[CREATE] Created document",a);this.progressLabel="Processing...";this.progressPercent=0;return[4,l(this.endpoint,n.id)];case 4:c=m.sent();(t=this.next)===null||t===void 0?void 0:t.emit(c);this.creating=false;this.progressLabel="";this.progressPercent=0;return[3,6];case 5:p=m.sent();console.log("[CREATE] Error creating template",p);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new u(p.message,(r=p.response)===null||r===void 0?void 0:r.status,(i=p.response)===null||i===void 0?void 0:i.data));this.creating=false;return[3,6];case 6:return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return r(i,null,r("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return r("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},r("input",{type:"file",id:"verdocs-template-create-file",multiple:true,accept:"application/pdf",style:{display:"none"},onChange:function(t){return e.handleFileChanged(t)}}),this.creating?r("div",{class:"loader-wrapper"},r("verdocs-loader",null),this.progressLabel&&r("div",{class:"progress-wrapper"},r("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):r("div",{class:"upload-box"},r("div",null,r("span",{innerHTML:_})),r("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),r("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?Z:"Or, if you prefer..."),r("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:function(t){return e.handleUpload(t)}})),r("div",{class:"buttons"},r("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.creating}),r("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:!this.file||this.creating})))};return e}());R.style=L;var H="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;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}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 S='<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 I='<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 A='<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 T='<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 D='<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 N='<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 P='<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 B=[{id:"signature",tooltip:"Signature",icon:T},{id:"initial",tooltip:"Initials",icon:D},{id:"sep1",tooltip:"",icon:j},{id:"textbox",tooltip:"Text Box",icon:z},{id:"textarea",tooltip:"Text Area",icon:S},{id:"checkbox_group",tooltip:"Check Box",icon:I},{id:"radio_button_group",tooltip:"Radio Button",icon:V},{id:"dropdown",tooltip:"Dropdown",icon:P},{id:"sep2",tooltip:"",icon:j},{id:"date",tooltip:"Date",icon:A},{id:"timestamp",tooltip:"Timestamp",icon:N}];var F=e("verdocs_template_fields",function(){function e(e){t(this,e);this.sdkError=o(this,"sdkError",7);this.templateUpdated=o(this,"templateUpdated",7);this.pageHeights={};this.cachedPageInfo={};this.endpoint=c.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.selectedRoleName="";this.rerender=1}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,r,i,n,a,s;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,,6]);this.endpoint.loadSession();if(!this.templateId){console.log("[FIELDS] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return[2]}l.label=1;case 1:l.trys.push([1,3,,4]);console.log("[FIELDS] Loading template ".concat(this.templateId),this.endpoint.session);return[4,q(this.endpoint,this.templateId,true)];case 2:l.sent();this.selectedRoleName=y.roleNames[0];console.log("Starting with role",this.selectedRoleName);return[3,4];case 3:a=l.sent();console.log("[FIELDS] Error loading template",a);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new u(a.message,(t=a.response)===null||t===void 0?void 0:t.status,(o=a.response)===null||o===void 0?void 0:o.data));return[3,4];case 4:return[3,6];case 5:s=l.sent();console.log("[FIELDS] Error with preview session",s);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new u(s.message,(i=s.response)===null||i===void 0?void 0:i.status,(n=s.response)===null||n===void 0?void 0:n.data));return[3,6];case 6:return[2]}}))}))};e.prototype.componentDidRender=function(){g.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.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(r){console.log("[FIELDS] handleFieldChange",e,t,o);this.rerender++;return[2]}))}))};e.prototype.attachFieldAttributes=function(e,t,o,r){var i=this;r.addEventListener("input",(function(e){return i.handleFieldChange(t,e)}));r.addEventListener("settingsChanged",(function(){var e;console.log("Settings",y.fields);i.selectedRoleName=t.role_name;console.log("settings changed",i.selectedRoleName,t);r.setAttribute("roleindex",f(y.roleNames,t.role_name));i.rerender++;r.setAttribute("rerender",i.rerender);(e=i.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:i.endpoint,template:y.template,event:"updated-field"})}));r.addEventListener("deleted",(function(){var e;console.log("deleted",i,t);r.remove();i.rerender++;(e=i.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:i.endpoint,template:y.template,event:"updated-field"})}));r.setAttribute("roleindex",o);r.setAttribute("pageNumber",e.pageNumber);r.setAttribute("xScale",e.xScale);r.setAttribute("yScale",e.yScale);r.setAttribute("name",t.name)};e.prototype.handlePageRendered=function(e){var t=this;var o=e.detail;console.log("[FIELDS] Page rendered",o.pageNumber,o);this.cachedPageInfo[o.pageNumber]=o;this.pageHeights[o.pageNumber]=o.naturalHeight;var r=y.fields.filter((function(e){return e.page_sequence===o.pageNumber}));r.forEach((function(e){var r=f(y.roleNames,e.role_name);var i=v(e,o,r,{disabled:true,editable:true,draggable:true});if(!i){return}if(Array.isArray(i)){i.forEach((function(i){t.attachFieldAttributes(o,e,r,i);g(i).draggable({listeners:{start:function(e){console.log("[FIELDS] Drag started",e.type,e.target)},move:function(e){var t=+(e.target.getAttribute("posX")||0);var o=+(e.target.getAttribute("posY")||0);var r=+(e.target.getAttribute("xScale")||1);var i=+(e.target.getAttribute("yScale")||1);var n=e.dx/r+t;var a=e.dy/i+o;e.target.setAttribute("posX",n);e.target.setAttribute("posy",a);x(e.target,"translate","".concat(n,"px, ").concat(a,"px"))},end:t.handleMoveField.bind(t)}})}))}else{t.attachFieldAttributes(o,e,r,i);g(i).draggable({listeners:{start:function(e){console.log("[FIELDS] Drag started",e.type,e.target)},move:function(e){var t=+(e.target.getAttribute("posX")||0);var o=+(e.target.getAttribute("posY")||0);var r=+(e.target.getAttribute("xScale")||1);var i=+(e.target.getAttribute("yScale")||1);var n=e.dx/r+t;var a=e.dy/i+o;e.target.setAttribute("posX",n);e.target.setAttribute("posy",a);x(e.target,"translate","".concat(n,"px, ").concat(a,"px"))},end:t.handleMoveField.bind(t)}})}}))};e.prototype.handleMoveField=function(e){return __awaiter(this,void 0,void 0,(function(){var t,o,r,i,n,a,s,l,d,c,p,u,g,h,f,v,x,b,w,q;return __generator(this,(function(C){switch(C.label){case 0:t=e.target.getAttribute("pageNumber");o=this.cachedPageInfo[t],r=o.naturalWidth,i=r===void 0?612:r,n=o.naturalHeight,a=n===void 0?792:n,s=o.renderedHeight,l=s===void 0?792:s;console.log("[FIELDS] Drag ended",t,e.target);d=e.target.getBoundingClientRect();c=e.target.parentElement;p=c.getBoundingClientRect();u=Math.max(d.left-p.left,0);g=Math.max(l-(p.bottom-d.bottom),0);h=this.viewCoordinatesToPageCoordinates(u,g,t,i-e.rect.width,a-e.rect.height),f=h.x,v=h.y;x=e.target.getAttribute("name");b=+(e.target.getAttribute("option")||"0");w=y.fields.find((function(e){return e.name===x}));console.log("Will update",x,b,w);if(!w)return[3,2];switch(w.type){case"attachment":case"payment":case"initial":case"signature":case"date":case"dropdown":case"textarea":case"textbox":case"timestamp":w.setting.x=f;w.setting.y=v;break;case"checkbox_group":case"radio_button_group":{q=w.setting.options[b];if(q){q.x=f;q.y=v}}break}return[4,m(this.endpoint,this.templateId,x,w)];case 1:C.sent();this.handlePageRendered({detail:this.cachedPageInfo[t]});C.label=2;case 2:return[2]}}))}))};e.prototype.generateFieldName=function(e,t){var o=1;var r;do{r="".concat(e,"P").concat(t,"-").concat(o);console.log("testing field",r);o++}while(y.fields.some((function(e){return e.name===r})));console.log("Will use field name",r,y.fields);return r};e.prototype.viewCoordinatesToPageCoordinates=function(e,t,o,r,i){var n=this.cachedPageInfo[o],a=n.xScale,s=a===void 0?1:a,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/s,r));var g=Math.floor(Math.min(Math.max(p-t,0)/d,i));return{x:u,y:g}};e.prototype.handleClickPage=function(e,t){return __awaiter(this,void 0,void 0,(function(){var o,r,i,n,a,s,l,d,c,p,u,g,m,f,v,x;return __generator(this,(function(q){switch(q.label){case 0:if(!this.placing)return[3,2];console.log("Placing field",this.placing,t.sequence,e.offsetX,e.offsetY);r=t.sequence;i=e.offsetX;n=e.offsetY;a=b(this.placing);s=w(this.placing);l=this.cachedPageInfo[r];console.log("Cached page",l);d=l.naturalWidth,c=d===void 0?612:d,p=l.naturalHeight,u=p===void 0?792:p;g=this.viewCoordinatesToPageCoordinates(i,n,r,c-a,u-s);m=Math.floor(g.x);f=Math.floor(g.y);v={name:this.generateFieldName(this.placing,r),role_name:this.selectedRoleName,template_id:this.templateId,type:this.placing,required:true,page_sequence:r,validator:null,setting:{x:m,y:f}};switch(v.type){case"attachment":case"payment":v.setting={x:m,y:f};break;case"initial":case"signature":v.setting={x:m,y:f,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:m,y:f}]};break;case"date":v.setting={x:m,y:f,width:a,height:s,result:""};break;case"dropdown":v.required=false;v.setting={x:m,y:f,width:a,height:s,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:m,y:f}]};break;case"textarea":case"textbox":v.setting={x:m,y:f,width:a,height:s,result:"",leading:0,alignment:0,upperCase:false};break;case"timestamp":v.setting={x:m,y:f,width:a,height:s};break}if(v.type==="textarea"){v.type="textbox"}return[4,h(this.endpoint,this.templateId,v)];case 1:x=q.sent();console.log("Saved field",x);y.fields.push(x);this.placing=null;(o=this.templateUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,template:y.template,event:"added-field"});this.handlePageRendered({detail:this.cachedPageInfo[r]});q.label=2;case 2:return[2]}}))}))};e.prototype.render=function(){var e;var t=this;if(!this.endpoint.session){return r(i,null,r("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(y.loading||!y.template){return r(i,null,r("verdocs-loader",null))}var o=__spreadArray([],y.template.pages,true);o.sort((function(e,t){return e.sequence-t.sequence}));return r(i,{class:this.placing?(e={},e["placing-".concat(this.placing)]=true,e):{},"data-r":this.rerender,onSubmit:function(){console.log("onSubmit")}},r("div",{id:"verdocs-template-fields-toolbar"},B.map((function(e){return r("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:function(){if(e.tooltip){t.placing=e.id}}})}))),r("div",{class:"pages"},o.map((function(e){return r("verdocs-template-document-page",{templateId:e.template_id,documentId:e.document_id,pageNumber:e.sequence,virtualWidth:612,virtualHeight:792,onClick:function(o){return t.handleClickPage(o,e)},onPageRendered:function(e){return t.handlePageRendered(e)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})}))))};return e}());F.style=H;var O='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:#4c56cb;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;display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-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 U=(M={},M[p.EVERYONE]="Everyone",M[p.EVERYONE_AS_CREATOR]="Everyone as Me",M[p.ORGANIZATION_MEMBER]="Organization member",M[p.ORGANIZATION_MEMBER_AS_CREATOR]="Organization Member as Me",M[p.CREATOR]="Me",M);var Q='<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 W='<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 Y='<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 X='<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 G='<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 K='<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 J='<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 $='<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 ee=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.templateUpdated=o(this,"templateUpdated",7);this.sequences=[];this.endpoint=c.getDefault();this.templateId="";this.showingRoleDialog=null;this.showingSenderDialog=false;this.sender=null;this.forceRerender=1}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,r,i,n,a,s;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,5,,6]);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]}l.label=1;case 1:l.trys.push([1,3,,4]);console.log("[ROLES] Loading template ".concat(this.templateId),this.endpoint.session);return[4,q(this.endpoint,this.templateId,true)];case 2:l.sent();return[3,4];case 3:a=l.sent();console.log("[ROLES] Error loading template",a);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new u(a.message,(t=a.response)===null||t===void 0?void 0:t.status,(o=a.response)===null||o===void 0?void 0:o.data));return[3,4];case 4:this.sortTemplateRoles();this.renumberTemplateRoles();return[3,6];case 5:s=l.sent();console.log("[FIELDS] Error with preview session",s);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new u(s.message,(i=s.response)===null||i===void 0?void 0:i.status,(n=s.response)===null||n===void 0?void 0:n.data));return[3,6];case 6:return[2]}}))}))};e.prototype.componentDidRender=function(){g.dynamicDrop(true);g(".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("posX")||0);var r=+(t.target.getAttribute("posY")||0);var i=t.dx+o;var n=t.dy+r;t.target.setAttribute("posX",i);t.target.setAttribute("posy",n);t.target.style.transform="translate(".concat(i+100,"px, ").concat(n-40,"px)")}.bind(this),end:function e(t){t.target.classList.remove("dragging");this.el.classList.remove("dragging");t.target.setAttribute("posX",0);t.target.setAttribute("posy",0);t.target.style.transform="translate(0px, 0px)"}.bind(this)}});g(".dropzone").dropzone({overlap:.05,ondrop:function e(t){var o=this;var r,i;t.target.classList.remove("active");var n=t.relatedTarget.dataset.rolename;var a=+t.target.dataset.sequence;var s=+t.target.dataset.order;var l=(r=y.template)===null||r===void 0?void 0:r.roles.find((function(e){return e.name===n}));if(l){l.sequence=a;l.order=s;this.sortTemplateRoles();this.renumberTemplateRoles();this.forceRerender++;Promise.all((i=y.template)===null||i===void 0?void 0:i.roles.map((function(e){return C(o.endpoint,o.templateId,e.name,{sequence:e.sequence,order:e.order})}))).then((function(){var e;console.log("[ROLES] Updated roles");(e=o.templateUpdated)===null||e===void 0?void 0:e.emit({event:"updated-role",endpoint:o.endpoint,template:y.template})})).catch((function(e){return console.log("[ROLES] Role updates failed",e)}))}}.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(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();(t=this.next)===null||t===void 0?void 0:t.emit()};e.prototype.sortTemplateRoles=function(){var e;(e=y.template)===null||e===void 0?void 0:e.roles.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence}))};e.prototype.extractSequenceNumbers=function(){var e=this;var t;this.sequences=[];(t=y.template)===null||t===void 0?void 0:t.roles.forEach((function(t){if(!e.sequences.includes(t.sequence)){e.sequences.push(t.sequence)}}))};e.prototype.renumberTemplateRoles=function(){this.extractSequenceNumbers();var e=[];this.sequences.sort((function(e,t){return e-t}));this.sequences.forEach((function(t,o){var r;(r=y.template)===null||r===void 0?void 0:r.roles.filter((function(e){return e.sequence===t})).forEach((function(t,r){if(!e.includes(t.name)){t.sequence=o+1;t.order=r+1;e.push(t.name)}}))}));this.extractSequenceNumbers()};e.prototype.getNextRoleName=function(){var e,t;var o="";var r=(e=y.template)===null||e===void 0?void 0:e.roles.length;do{r++;o="Recipient ".concat(r)}while(!o||((t=y.template)===null||t===void 0?void 0:t.roles.some((function(e){return e.name===o}))));return o};e.prototype.handleAddRole=function(e,t){var o=this;e.stopPropagation();var r=y.template.roles.filter((function(e){return e.sequence===t})).length+1;var i=this.getNextRoleName();console.log("Will create",i,t,r);E(this.endpoint,this.templateId,{template_id:this.templateId,name:i,full_name:"",email:"",phone:"",sequence:t,order:r,type:"signer",delegator:false}).then((function(e){var t;console.log("Created role",e);y.template.roles.push(e);o.renumberTemplateRoles();o.forceRerender++;(t=o.templateUpdated)===null||t===void 0?void 0:t.emit({event:"created-role",endpoint:o.endpoint,template:y.template})})).catch((function(e){console.log("Error creating role",e)}))};e.prototype.handleAddStep=function(e,t){var o=this;e.stopPropagation();var r=1;var i=this.getNextRoleName();console.log("Will create",i,t,r);E(this.endpoint,this.templateId,{template_id:this.templateId,name:i,full_name:"",email:"",phone:"",sequence:t,order:r,type:"signer",delegator:false}).then((function(e){var t;console.log("Created role",e);y.template.roles.push(e);o.renumberTemplateRoles();o.forceRerender++;(t=o.templateUpdated)===null||t===void 0?void 0:t.emit({event:"created-role",endpoint:o.endpoint,template:y.template})})).catch((function(e){console.log("Error creating role",e)}))};e.prototype.render=function(){var e=this;var t;if(!this.endpoint.session){return r(i,null,r("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(y.loading||!y.template){return r(i,null,r("verdocs-loader",null))}var o=(((t=y.template)===null||t===void 0?void 0:t.roles)||[]).map((function(e){return e.name}));return r(i,null,r("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off","data-r":this.forceRerender},r("h5",null,"Roles and Workflow"),r("div",{class:"participants"},r("div",{class:"left-line"}),r("div",{class:"row"},r("div",{class:"icon",innerHTML:W}),r("div",{class:"row-roles"},r("div",{class:"sender"},r("span",{class:"label"},"Sender:")," ",U[y.template.sender]," ",r("div",{class:"settings-button",innerHTML:Q,onClick:function(){return e.showingSenderDialog=true},"aria-role":"button"})))),r("div",{class:"row add-sequence","data-sequence":0},r("div",{class:"icon",innerHTML:G}),r("div",{class:"row-roles"},r("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((function(t){return r(n,null,r("div",{class:"row"},r("div",{class:"icon",innerHTML:Y}),r("div",{class:"row-roles"},r("div",{class:"dropzone","data-order":.5,"data-sequence":t}),y.template.roles.filter((function(e){return e.sequence===t})).map((function(i){var a=!i.email;return a?r(n,null,r("div",{class:"recipient",style:{backgroundColor:k(f(o,i.name))},"data-rolename":i.name},r("span",{class:"type-icon",innerHTML:i.type==="signer"?K:i.type==="cc"?$:J}),i.name," ",r("div",{class:"settings-button",innerHTML:Q,onClick:function(){return e.showingRoleDialog=i.name},"aria-role":"button"})),r("div",{class:"dropzone","data-order":i.order+.5,"data-sequence":t})):r(n,null,r("div",{class:"recipient",style:{borderColor:k(f(o,i.name))},"data-rolename":i.name},r("span",{class:"type-icon",innerHTML:i.type==="signer"?K:i.type==="cc"?$:J}),i.full_name," ",r("div",{class:"settings-button",innerHTML:Q,onClick:function(){return e.showingRoleDialog=i.name},"aria-role":"button"})),r("div",{class:"dropzone","data-order":i.order+.5,"data-sequence":t}))})),r("button",{class:"add-role",innerHTML:G,onClick:function(o){return e.handleAddRole(o,t)}}))),e.sequences.length>0&&r("div",{class:"row add-sequence","data-sequence":t},r("div",{class:"row-roles"},r("div",{class:"icon",innerHTML:G}),r("div",{class:"dropzone","data-sequence":t+1,"data-order":1},"Add Step"))))})),r("div",{class:"row","data-sequence":this.sequences.length+1},r("div",{class:"row-roles"},r("div",{class:"icon",innerHTML:G}),r("button",{class:"add-step",innerHTML:G,onClick:function(t){return e.handleAddStep(t,e.sequences.length+1)}}))),r("div",{class:"row"},r("div",{class:"icon",innerHTML:X}),r("div",{class:"row-roles"},r("div",{class:"complete"},"Document Complete")))),o.length<1&&r("div",{class:"empty"},"You must add at least one Role before proceeding.",r("br",null)," Click the ",r("span",{innerHTML:G})," Add button above to get started."),r("div",{class:"buttons"},r("div",{class:"flex-fill"}),r("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),r("verdocs-button",{label:"OK",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:o.length<1}))),this.showingRoleDialog&&r("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:function(){e.showingRoleDialog=null;e.forceRerender++},onDelete:function(t){var o;console.log("deleted",t.detail);e.renumberTemplateRoles();e.showingRoleDialog=null;e.forceRerender++;(o=e.templateUpdated)===null||o===void 0?void 0:o.emit({event:"deleted-role",endpoint:e.endpoint,template:y.template})}}),this.showingSenderDialog&&r("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:function(){return e.showingSenderDialog=false}}))};Object.defineProperty(e.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return e}());ee.style=O}}}));
|