@creaditor/newsletter-starterkit 1.0.53 → 1.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/1260.creaditor.bundle.js +297 -128
  2. package/dist/1260.creaditor.bundle.js.gz +0 -0
  3. package/dist/1271.creaditor.bundle.js +1 -439
  4. package/dist/1271.creaditor.bundle.js.gz +0 -0
  5. package/dist/1403.creaditor.bundle.js +110 -0
  6. package/dist/1403.creaditor.bundle.js.gz +0 -0
  7. package/dist/1529.creaditor.bundle.js +1 -1
  8. package/dist/1529.creaditor.bundle.js.gz +0 -0
  9. package/dist/1565.creaditor.bundle.js +338 -138
  10. package/dist/1565.creaditor.bundle.js.gz +0 -0
  11. package/dist/168.creaditor.bundle.js +4 -4
  12. package/dist/168.creaditor.bundle.js.gz +0 -0
  13. package/dist/170.creaditor.bundle.js +11 -5
  14. package/dist/170.creaditor.bundle.js.gz +0 -0
  15. package/dist/2384.creaditor.bundle.js +56 -8
  16. package/dist/2384.creaditor.bundle.js.gz +0 -0
  17. package/dist/2590.creaditor.bundle.js +1 -2
  18. package/dist/2590.creaditor.bundle.js.gz +0 -0
  19. package/dist/3095.creaditor.bundle.js +91 -58
  20. package/dist/3095.creaditor.bundle.js.gz +0 -0
  21. package/dist/3521.creaditor.bundle.js +11 -9
  22. package/dist/3521.creaditor.bundle.js.gz +0 -0
  23. package/dist/3553.creaditor.bundle.js +1 -1
  24. package/dist/3553.creaditor.bundle.js.gz +0 -0
  25. package/dist/3932.creaditor.bundle.js +3 -3
  26. package/dist/3932.creaditor.bundle.js.gz +0 -0
  27. package/dist/4114.creaditor.bundle.js +1 -0
  28. package/dist/4114.creaditor.bundle.js.gz +0 -0
  29. package/dist/4186.creaditor.bundle.js +1 -1
  30. package/dist/4186.creaditor.bundle.js.gz +0 -0
  31. package/dist/453.creaditor.bundle.js +1 -1
  32. package/dist/453.creaditor.bundle.js.gz +0 -0
  33. package/dist/4569.creaditor.bundle.js +30 -190
  34. package/dist/4569.creaditor.bundle.js.gz +0 -0
  35. package/dist/4819.creaditor.bundle.js +198 -235
  36. package/dist/4819.creaditor.bundle.js.gz +0 -0
  37. package/dist/5340.creaditor.bundle.js +126 -36
  38. package/dist/5340.creaditor.bundle.js.gz +0 -0
  39. package/dist/574.creaditor.bundle.js +5 -5
  40. package/dist/574.creaditor.bundle.js.gz +0 -0
  41. package/dist/589.creaditor.bundle.js +9 -9
  42. package/dist/589.creaditor.bundle.js.gz +0 -0
  43. package/dist/5926.creaditor.bundle.js +24 -31
  44. package/dist/5926.creaditor.bundle.js.gz +0 -0
  45. package/dist/638.creaditor.bundle.js +3 -3
  46. package/dist/638.creaditor.bundle.js.gz +0 -0
  47. package/dist/6713.creaditor.bundle.js +151 -0
  48. package/dist/6713.creaditor.bundle.js.gz +0 -0
  49. package/dist/7209.creaditor.bundle.js +2 -3
  50. package/dist/7209.creaditor.bundle.js.gz +0 -0
  51. package/dist/7238.creaditor.bundle.js +3 -3
  52. package/dist/7238.creaditor.bundle.js.gz +0 -0
  53. package/dist/752.creaditor.bundle.js +3 -7
  54. package/dist/752.creaditor.bundle.js.gz +0 -0
  55. package/dist/763.creaditor.bundle.js +1 -1
  56. package/dist/763.creaditor.bundle.js.gz +0 -0
  57. package/dist/7789.creaditor.bundle.js +25 -0
  58. package/dist/7789.creaditor.bundle.js.LICENSE.txt +32 -0
  59. package/dist/7789.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  60. package/dist/7789.creaditor.bundle.js.gz +0 -0
  61. package/dist/7937.creaditor.bundle.js +63 -115
  62. package/dist/7937.creaditor.bundle.js.gz +0 -0
  63. package/dist/8173.creaditor.bundle.js +1 -1
  64. package/dist/8173.creaditor.bundle.js.gz +0 -0
  65. package/dist/8305.creaditor.bundle.js +6 -6
  66. package/dist/8305.creaditor.bundle.js.gz +0 -0
  67. package/dist/8516.creaditor.bundle.js +1 -1
  68. package/dist/8516.creaditor.bundle.js.gz +0 -0
  69. package/dist/8676.creaditor.bundle.js +1 -0
  70. package/dist/8676.creaditor.bundle.js.gz +0 -0
  71. package/dist/8916.creaditor.bundle.js +4 -4
  72. package/dist/8916.creaditor.bundle.js.gz +0 -0
  73. package/dist/9041.creaditor.bundle.js +1 -1
  74. package/dist/9041.creaditor.bundle.js.gz +0 -0
  75. package/dist/9158.creaditor.bundle.js +613 -0
  76. package/dist/9158.creaditor.bundle.js.LICENSE.txt +10 -0
  77. package/dist/9158.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  78. package/dist/9158.creaditor.bundle.js.gz +0 -0
  79. package/dist/9162.creaditor.bundle.js +4 -3
  80. package/dist/9162.creaditor.bundle.js.gz +0 -0
  81. package/dist/9694.creaditor.bundle.js +1 -1
  82. package/dist/9694.creaditor.bundle.js.gz +0 -0
  83. package/dist/creaditor.bundle.js +2795 -874
  84. package/dist/creaditor.bundle.js.gz +0 -0
  85. package/dist/service-worker.js +1 -1
  86. package/dist/service-worker.js.gz +0 -0
  87. package/package.json +1 -1
@@ -0,0 +1,151 @@
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[6713],{46713(t,e,i){i.r(e),i.d(e,{NextButton:()=>l});var s=i(59929),n=i(86319),o=i(93432),a=i(90090);class r extends s.WF{constructor(){super(),this.raf=0,this.dismissTimer=null,this.dismiss=()=>{this.isConnected&&this.remove()},this.message="Published!",this.sub="Your site is live.",this.url=""}firstUpdated(){this.launchConfetti(),this.dismissTimer=setTimeout(()=>this.dismiss(),4200)}disconnectedCallback(){super.disconnectedCallback(),cancelAnimationFrame(this.raf),this.dismissTimer&&clearTimeout(this.dismissTimer)}launchConfetti(){const t=this.renderRoot.querySelector("canvas");if(!t)return;const e=t.getContext("2d");if(!e)return;const i=window.devicePixelRatio||1,s=window.innerWidth,n=window.innerHeight;t.width=s*i,t.height=n*i,e.scale(i,i);const o=["#e94560","#1a1a2e","#f6c945","#2ec7a9","#4d7cfe","#ffffff"],a=s/2,r=.34*n,l=Math.min(220,Math.round(s/6)),c=Array.from({length:l},(t,e)=>{const i=2*Math.PI*e/l+e%3*.4,s=4+e%9;return{x:a,y:r,vx:Math.cos(i)*s,vy:Math.sin(i)*s-3,size:5+e%5,color:o[e%o.length],rot:e,vrot:(e%2?1:-1)*(.1+e%5*.03),life:1}}),d=performance.now(),h=t=>{const i=t-d;e.clearRect(0,0,s,n);let o=!1;for(const t of c)t.vy+=.16,t.x+=t.vx,t.y+=t.vy,t.rot+=t.vrot,i>2600*.55&&(t.life=Math.max(0,t.life-.02)),t.life>0&&t.y<n+40&&(o=!0),e.save(),e.globalAlpha=t.life,e.translate(t.x,t.y),e.rotate(t.rot),e.fillStyle=t.color,e.fillRect(-t.size/2,-t.size/2,t.size,.6*t.size),e.restore();o&&i<3e3?this.raf=requestAnimationFrame(h):e.clearRect(0,0,s,n)};this.raf=requestAnimationFrame(h)}render(){return s.qy`
2
+ <canvas @click=${this.dismiss}></canvas>
3
+ <div class="card">
4
+ <div class="check">
5
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
6
+ <path d="M5 13l4 4L19 7" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
7
+ </svg>
8
+ </div>
9
+ <p class="title">${this.message}</p>
10
+ ${this.sub?s.qy`<p class="sub">${this.sub}</p>`:null}
11
+ ${this.url?s.qy`<a class="view" href=${this.url} target="_blank" rel="noopener">View site</a>`:null}
12
+ </div>
13
+ `}}r.styles=s.AH`
14
+ :host {
15
+ position: fixed;
16
+ inset: 0;
17
+ z-index: 2147483000;
18
+ pointer-events: none;
19
+ display: block;
20
+ }
21
+ canvas {
22
+ position: absolute;
23
+ inset: 0;
24
+ width: 100%;
25
+ height: 100%;
26
+ }
27
+ .card {
28
+ position: absolute;
29
+ top: 34%;
30
+ left: 50%;
31
+ transform: translate(-50%, -50%) scale(0.9);
32
+ background: #ffffff;
33
+ border-radius: 16px;
34
+ box-shadow: 0 24px 60px rgba(26, 26, 46, 0.28);
35
+ padding: 26px 34px;
36
+ text-align: center;
37
+ font-family: Arial, Helvetica, sans-serif;
38
+ pointer-events: auto;
39
+ opacity: 0;
40
+ animation: pop 0.42s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
41
+ max-width: 88vw;
42
+ }
43
+ @keyframes pop {
44
+ to {
45
+ opacity: 1;
46
+ transform: translate(-50%, -50%) scale(1);
47
+ }
48
+ }
49
+ .check {
50
+ width: 56px;
51
+ height: 56px;
52
+ border-radius: 50%;
53
+ background: #2ec7a9;
54
+ margin: 0 auto 14px;
55
+ display: flex;
56
+ align-items: center;
57
+ justify-content: center;
58
+ }
59
+ .check svg {
60
+ width: 30px;
61
+ height: 30px;
62
+ }
63
+ .title {
64
+ font-size: 20px;
65
+ font-weight: bold;
66
+ color: #1a1a2e;
67
+ margin: 0;
68
+ }
69
+ .sub {
70
+ font-size: 13px;
71
+ color: #8a8f9c;
72
+ margin: 6px 0 0;
73
+ }
74
+ .view {
75
+ display: inline-block;
76
+ margin-top: 16px;
77
+ background: #e94560;
78
+ color: #fff;
79
+ text-decoration: none;
80
+ font-size: 14px;
81
+ font-weight: bold;
82
+ padding: 10px 22px;
83
+ border-radius: 9px;
84
+ }
85
+ `,r.properties={message:{type:String},sub:{type:String},url:{type:String}},customElements.define("cdtr-publish-success",r);class l extends s.WF{constructor(){super(),this.channel="",this.isLoading=!1,this.isLocked=!1,this.lockTimer=null}connectedCallback(){super.connectedCallback(),this.onNextStep||(this.onNextStep=n.M.get("config","onNextStep")),this.channel||(this.channel=n.M.get("config","channel")||"")}disconnectedCallback(){super.disconnectedCallback(),this.clearTimers()}clearTimers(){this.lockTimer&&(clearTimeout(this.lockTimer),this.lockTimer=null)}async handleClick(){if(!this.isLocked&&!this.isLoading){this.isLoading=!0,this.isLocked=!0,this.lockTimer=setTimeout(()=>{this.clearTimers(),this.isLoading=!1,this.isLocked=!1},1e4);try{!!n.M.get("config","access")&&"web"===this.channel&&(await(0,a.bK)({}),this.celebratePublish()),"function"==typeof this.onNextStep&&await this.onNextStep({toHTML:o.FE,toJSON:o.U2})}catch(t){console.error("Error in publish/onNextStep:",t),this.snackbar(n.M.get("lang","publishError")||"Publish failed")}finally{this.clearTimers(),this.isLoading=!1,this.isLocked=!1}}}snackbar(t){const e=n.M.get("commands");e?.snackbar?.(t)}celebratePublish(){const t=document.createElement("cdtr-publish-success");t.message=n.M.get("lang","published")||"Published!",t.sub=n.M.get("lang","publishedSub")||"Your site is live.";const e=n.M.get("app","domains"),i=e?.[0]?.name;i&&(t.url=/^https?:\/\//.test(i)?i:`https://${i}`),document.body.appendChild(t)}render(){const t=!!n.M.get("config","access");if(!(this.onNextStep||"web"===this.channel&&t))return null;const e="web"===this.channel?"publish":"next";return s.qy`
86
+ <paper-button
87
+ @click=${this.handleClick}
88
+ class="next-button"
89
+ ?disabled=${this.isLocked}
90
+ >
91
+ ${this.isLoading?s.qy`
92
+ <div class="loading-spinner"></div>
93
+ `:s.qy`
94
+ <div class="button-content ${this.isLoading?"loading":""}">
95
+ <lang-text text=${e}></lang-text>
96
+ </div>
97
+ `}
98
+ </paper-button>
99
+ `}}l.styles=s.AH`
100
+ :host {
101
+ display: block;
102
+ }
103
+
104
+ .next-button {
105
+ background: var(--primary);
106
+ color: var(--primary-text);
107
+ fill: var(--primary-text);
108
+ text-transform: none;
109
+ color: #fff;
110
+ height: 52px;
111
+ border-radius: 0;
112
+ width: 90px;
113
+ transform: translateX(-4px);
114
+ position: relative;
115
+ overflow: hidden;
116
+ }
117
+
118
+ .next-button:disabled {
119
+ opacity: 0.6;
120
+ cursor: not-allowed;
121
+ }
122
+
123
+ .loading-spinner {
124
+ position: absolute;
125
+ top: 50%;
126
+ left: 50%;
127
+ transform: translate(-50%, -50%);
128
+ width: 20px;
129
+ height: 20px;
130
+ border: 2px solid transparent;
131
+ border-top: 2px solid #fff;
132
+ border-radius: 50%;
133
+ animation: spin 1s linear infinite;
134
+ }
135
+
136
+ @keyframes spin {
137
+ 0% { transform: translate(-50%, -50%) rotate(0deg); }
138
+ 100% { transform: translate(-50%, -50%) rotate(360deg); }
139
+ }
140
+
141
+ .button-content {
142
+ opacity: 1;
143
+ transition: opacity 0.3s ease;
144
+ }
145
+
146
+ .button-content.loading {
147
+ opacity: 0;
148
+ }
149
+
150
+
151
+ `,l.properties={onNextStep:{type:Function},channel:{type:String},isLoading:{type:Boolean},isLocked:{type:Boolean},lockTimer:{type:Number}},customElements.define("cdtr-next-button",l)}}]);
Binary file
@@ -623,7 +623,7 @@
623
623
  color: white;
624
624
  font-weight: bold;
625
625
  }
626
- `,u.properties={isVisible:{type:Boolean},fileName:{type:String},status:{type:String},progress:{type:Number},timeElapsed:{type:Number}},customElements.define("cdtr-upload-progress-monitor",u);var f=s(18396),m=s(13681);class g extends i.WF{constructor(){super(),this.sortBy="ASC",this.files=[],this.folders=[],this.uploadStatus={},this.onSearch=this.onSearch.bind(this),this.close=this.close.bind(this),this.reset=this.reset.bind(this);const e=new f.A;this.eventEmitter=e;const t=o.M.get("config","editor","configure","mediaGalleryManager");e.files=this.files,e.close=this.close,"function"==typeof t&&(e.render=this.reset,console.log("init mediaGalleryManager"),t(e)),this.reset()}reset(){this.dirId=null,this.eventEmitter.dispatch("load-folders",{resolve:e=>{this.folders=e}}),this.eventEmitter.dispatch("load-files",{resolve:e=>{this.files=[...e]}})}uploadFile(e){this.folders||(this.folders=[]);const t=e.detail,s=this.folders.find(e=>e.selected),i=`${t.name}-${Date.now()}`;this.uploadStatus[i]={fileName:t.name,status:"uploading",progress:0,error:null},console.log("Dispatching cdtr-upload-start event for:",t.name),this.dispatchEvent(new CustomEvent("cdtr-upload-start",{detail:{uploadId:i,fileName:t.name,file:t},bubbles:!0,composed:!0})),console.log("Event dispatched"),this.eventEmitter.dispatch("upload-file",{file:t,dirId:s?s.id:null,uploadId:i,execCommand:(e,t)=>{o.M.get("editor").store().execCommand(e,t)},options:{},onProgress:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].progress=e,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("upload-progress",{detail:{uploadId:i,fileName:t.name,progress:e},bubbles:!0,composed:!0})))},onComplete:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].status="completed",this.uploadStatus[i].progress=100,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("cdtr-upload-complete",{detail:{uploadId:i,fileName:t.name,result:e},bubbles:!0,composed:!0})),setTimeout(()=>{delete this.uploadStatus[i],this.requestUpdate("uploadStatus")},3e3))},onError:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].status="error",this.uploadStatus[i].error=e,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("cdtr-upload-error",{detail:{uploadId:i,fileName:t.name,error:e},bubbles:!0,composed:!0})),setTimeout(()=>{delete this.uploadStatus[i],this.requestUpdate("uploadStatus")},5e3))}}),this.opened=!1}onSearch(e){const{value:t,isLiked:s}=e.detail;s?this.eventEmitter.dispatch("load-files",{isLiked:s,resolve:e=>{Array.isArray(e)?this.files=[...e]:console.error("files is not array",e)}}):t.trim().length>2?this.eventEmitter.dispatch("load-files",{filter:"name",search:t,resolve:e=>{this.files=[...e]}}):0===t.trim().length&&this.reset()}onFilter(e){const t=e.detail;this.eventEmitter.dispatch("load-files",{filter:"name",search:t.value})}onSelectFolder(e){const t=e.detail,s=this.sortBy,i=t.id;this.dirId=i,this.eventEmitter.dispatch("load-files",{filter:"dir",dirId:i,sortBy:s,resolve:e=>{this.files=e}})}oncreateNewFolder(e){const t=e.detail;this.eventEmitter.dispatch("create-folder",{name:t,resolve:e=>{this.folders||(this.folders=[]);const t=[...this.folders];t.forEach(e=>e.selected=!1),e.selected=!0,t.unshift(e),this.folders=t,this.onSelectFolder({detail:e})}})}onMoveFile(e){const t=e.detail;this.eventEmitter.dispatch("on-move-file",{data:t,resolve:e=>{if(this.folders||(this.folders=[]),this.dirId===t.folderId)return;const s=this.files.findIndex(e=>e.id===t.fileId);if(-1!==s){const e=[...this.files];e[s].moved=!0,this.files=e}const i=this.folders.findIndex(e=>e.id===t.folderId);if(-1!==i){const e=[...this.folders];e[i].file_count+=1,this.folders=e}}})}onLike(e){const t=e.detail;this.eventEmitter.dispatch("on-like",{fileId:t.id,resolve:e=>{const s=this.files.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.files];e[s].isLiked=!e[s].isLiked,this.files=e}}})}onselectFile(e){const t={detail:e.detail,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",t))}close(){this.dispatchEvent(new CustomEvent("close",{}))}onDleteFile(e){const t=e.detail;this.eventEmitter.dispatch("delete-file",{id:t.id,type:"image",resolve:e=>{const s=this.files.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.files];e.splice(s,1),this.files=e}}})}onLoadMore(){this.eventEmitter.dispatch("lazy-load-files-on-scroll",{resolve:e=>{if(Array.isArray(e)&&e.length>0){const t=[...this.files,...e];this.files=t}}})}onDeleteFolder(e){const t=e.detail;this.eventEmitter.dispatch("delete-folder",{id:t.id,resolve:e=>{this.folders||(this.folders=[]);const s=this.folders.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.folders];e.splice(s,1),this.folders=e}}})}connectedCallback(){super.connectedCallback(),m.vP.on("on:upload-file","gallery:on:upload-file",async e=>{let{image:t,type:s}=e;if("base64"===s){const e=t.split(",")[1]||t,s=atob(e),i=new Array(s.length);for(let e=0;e<s.length;e++)i[e]=s.charCodeAt(e);const r=new Uint8Array(i),o=new Blob([r],{type:"image/png"}),l=new File([o],"uploaded-image.png",{type:"image/png"});this.uploadFile({detail:l})}else if("url"===s){const e=await fetch(t),s=await e.blob(),i=new File([s],"uploaded-image.png",{type:s.type||"image/png"});this.uploadFile({detail:i})}})}render(){return i.qy`
626
+ `,u.properties={isVisible:{type:Boolean},fileName:{type:String},status:{type:String},progress:{type:Number},timeElapsed:{type:Number}},customElements.define("cdtr-upload-progress-monitor",u);var f=s(18396),m=s(13681);class g extends i.WF{constructor(){super(),this.sortBy="ASC",this.files=[],this.folders=[],this.uploadStatus={},this.onSearch=this.onSearch.bind(this),this.close=this.close.bind(this),this.reset=this.reset.bind(this);const e=new f.A;this.eventEmitter=e;const t=o.M.get("config","editor","configure","mediaGalleryManager");e.files=this.files,e.close=this.close,"function"==typeof t&&(e.render=this.reset,console.log("init mediaGalleryManager"),t(e)),this.reset()}reset(){this.dirId=null,this.eventEmitter.dispatch("load-folders",{resolve:e=>{this.folders=e}}),this.eventEmitter.dispatch("load-files",{resolve:e=>{this.files=Array.isArray(e)?[...e]:[]}})}uploadFile(e){this.folders||(this.folders=[]);const t=e.detail,s=this.folders.find(e=>e.selected),i=`${t.name}-${Date.now()}`;this.uploadStatus[i]={fileName:t.name,status:"uploading",progress:0,error:null},console.log("Dispatching cdtr-upload-start event for:",t.name),this.dispatchEvent(new CustomEvent("cdtr-upload-start",{detail:{uploadId:i,fileName:t.name,file:t},bubbles:!0,composed:!0})),console.log("Event dispatched"),this.eventEmitter.dispatch("upload-file",{file:t,dirId:s?s.id:null,uploadId:i,execCommand:(e,t)=>{o.M.get("editor").store().execCommand(e,t)},options:{},onProgress:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].progress=e,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("upload-progress",{detail:{uploadId:i,fileName:t.name,progress:e},bubbles:!0,composed:!0})))},onComplete:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].status="completed",this.uploadStatus[i].progress=100,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("cdtr-upload-complete",{detail:{uploadId:i,fileName:t.name,result:e},bubbles:!0,composed:!0})),setTimeout(()=>{delete this.uploadStatus[i],this.requestUpdate("uploadStatus")},3e3))},onError:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].status="error",this.uploadStatus[i].error=e,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("cdtr-upload-error",{detail:{uploadId:i,fileName:t.name,error:e},bubbles:!0,composed:!0})),setTimeout(()=>{delete this.uploadStatus[i],this.requestUpdate("uploadStatus")},5e3))}}),this.opened=!1}onSearch(e){const{value:t,isLiked:s}=e.detail;s?this.eventEmitter.dispatch("load-files",{isLiked:s,resolve:e=>{Array.isArray(e)?this.files=[...e]:console.error("files is not array",e)}}):t.trim().length>2?this.eventEmitter.dispatch("load-files",{filter:"name",search:t,resolve:e=>{this.files=Array.isArray(e)?[...e]:[]}}):0===t.trim().length&&this.reset()}onFilter(e){const t=e.detail;this.eventEmitter.dispatch("load-files",{filter:"name",search:t.value})}onSelectFolder(e){const t=e.detail,s=this.sortBy,i=t.id;this.dirId=i,this.eventEmitter.dispatch("load-files",{filter:"dir",dirId:i,sortBy:s,resolve:e=>{this.files=e}})}oncreateNewFolder(e){const t=e.detail;this.eventEmitter.dispatch("create-folder",{name:t,resolve:e=>{this.folders||(this.folders=[]);const t=[...this.folders];t.forEach(e=>e.selected=!1),e.selected=!0,t.unshift(e),this.folders=t,this.onSelectFolder({detail:e})}})}onMoveFile(e){const t=e.detail;this.eventEmitter.dispatch("on-move-file",{data:t,resolve:e=>{if(this.folders||(this.folders=[]),this.dirId===t.folderId)return;const s=this.files.findIndex(e=>e.id===t.fileId);if(-1!==s){const e=[...this.files];e[s].moved=!0,this.files=e}const i=this.folders.findIndex(e=>e.id===t.folderId);if(-1!==i){const e=[...this.folders];e[i].file_count+=1,this.folders=e}}})}onLike(e){const t=e.detail;this.eventEmitter.dispatch("on-like",{fileId:t.id,resolve:e=>{const s=this.files.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.files];e[s].isLiked=!e[s].isLiked,this.files=e}}})}onselectFile(e){const t={detail:e.detail,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",t))}close(){this.dispatchEvent(new CustomEvent("close",{}))}onDleteFile(e){const t=e.detail;this.eventEmitter.dispatch("delete-file",{id:t.id,type:"image",resolve:e=>{const s=this.files.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.files];e.splice(s,1),this.files=e}}})}onLoadMore(){this.eventEmitter.dispatch("lazy-load-files-on-scroll",{resolve:e=>{if(Array.isArray(e)&&e.length>0){const t=[...this.files,...e];this.files=t}}})}onDeleteFolder(e){const t=e.detail;this.eventEmitter.dispatch("delete-folder",{id:t.id,resolve:e=>{this.folders||(this.folders=[]);const s=this.folders.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.folders];e.splice(s,1),this.folders=e}}})}connectedCallback(){super.connectedCallback(),m.vP.on("on:upload-file","gallery:on:upload-file",async e=>{let{image:t,type:s}=e;if("base64"===s){const e=t.split(",")[1]||t,s=atob(e),i=new Array(s.length);for(let e=0;e<s.length;e++)i[e]=s.charCodeAt(e);const r=new Uint8Array(i),o=new Blob([r],{type:"image/png"}),l=new File([o],"uploaded-image.png",{type:"image/png"});this.uploadFile({detail:l})}else if("url"===s){const e=await fetch(t),s=await e.blob(),i=new File([s],"uploaded-image.png",{type:s.type||"image/png"});this.uploadFile({detail:i})}})}render(){return i.qy`
627
627
  <cdtr-upload-loading></cdtr-upload-loading>
628
628
  <cdtr-upload-progress-monitor></cdtr-upload-progress-monitor>
629
629
  <cdtr-drawer
@@ -653,8 +653,7 @@
653
653
  ></cdtr-gallery-files>
654
654
  </cdtr-drawer>`}}g.styles=i.AH``,g.properties={folders:{type:Array},files:{type:Array},pageCount:{type:Number},prevUrl:{type:String},nextUrl:{type:String},opened:{type:Boolean},multi:{type:Boolean},uploadStatus:{type:Object}},customElements.define("cdtr-gallery",g)},2590(e,t,s){s.r(t),s.d(t,{TitleEditor:()=>o});var i=s(59929),r=s(86319);class o extends i.WF{constructor(){super(),this.text="",this.whiteSpace="pre"}connectedCallback(){super.connectedCallback(),this.style.fontFamily="var(--font-family)",this.bold&&(this.style.fontWeight="bold")}render(){const e=r.M.get("theme");e&&(this.style.direction=e.direction,this.style.textAlign=this.textAlign||e.textAlign);const t=r.M.get("lang",this.text);return i.qy`<slot
655
655
  ><span
656
- style="-webkit-font-smoothing: antialiased;text-transform:capitalize;
657
- display:inline-block;direction:var(--direction-locale);text-align:var(--text-align-locale);white-space:${this.whiteSpace}"
656
+ style="-webkit-font-smoothing: antialiased;display:inline-block;direction:var(--direction-locale);text-align:var(--text-align-locale);white-space:${this.whiteSpace}"
658
657
  >${t||this.text}</span
659
658
  ></slot
660
659
  >`}}o.properties={text:{type:String,reflect:!1},whiteSpace:{type:String},textAlign:{type:String},bold:{type:Boolean}},customElements.get("lang-text")||customElements.define("lang-text",o)},13681(e,t,s){s.d(t,{vP:()=>c});const i=window.cdtrSignalKey||`___${Math.random().toString(36).substr(2,9)}`;window.cdtrSignalKey=i,window[i]||(window[i]={});const r=window[i],o=window.__cdtrEvents||{};function l(e){return crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e)).then(e=>Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join(""))}function a(e){if(e.length%2!=0)throw new Error("Invalid hex string");const t=new Uint8Array(e.length/2);for(let s=0;s<e.length;s+=2)t[s/2]=parseInt(e.substr(s,2),16);return t}async function n(e){const t=await l(e),s=r[t];if(s){const e=await crypto.subtle.importKey("raw",a(t),{name:"AES-GCM"},!1,["encrypt","decrypt"]),i=await async function(e,t,s){const i=await crypto.subtle.decrypt({name:"AES-GCM",iv:t},e,s);return(new TextDecoder).decode(i)}(e,s.iv,s.encrypted);return JSON.parse(i)}return null}function d(e,t){if(o[e])for(const s in o[e])Object.prototype.hasOwnProperty.call(o[e],s)&&o[e][s].forEach(e=>e(t));Array.isArray(o["*"])&&o["*"].forEach(e=>e(t))}window.__cdtrEvents=o;const c={set:async function(e,t){const s=JSON.parse(JSON.stringify(t)),i=await l(e),n=await crypto.subtle.importKey("raw",a(i),{name:"AES-GCM"},!1,["encrypt","decrypt"]),c=await async function(e,t){const s=crypto.getRandomValues(new Uint8Array(12)),i=(new TextEncoder).encode(t),r=await crypto.subtle.encrypt({name:"AES-GCM",iv:s},e,i);return{iv:s,encrypted:new Uint8Array(r)}}(n,JSON.stringify(s));r[i]=c,o.set&&o.set[i]&&o.set[i].forEach(e=>e(s)),Array.isArray(o["*"])&&o["*"].forEach(e=>e(s)),d(e,s)},get:n,remove:async function(e){const t=await l(e);delete r[t]},on:async function(e,t,s){o[e]||(o[e]={});const i=await l(t);o[e][i]||(o[e][i]=[]),o[e][i].push(e=>{!function(){const e=(new Error).stack;if(e&&e.indexOf(" at <anonymous>:1")>-1)throw console.warn("Function call blocked: Detected console execution."),new Error("Function call blocked: Detected console execution.")}(),s(e)});const r=await n(t);return r&&s(r),i},off:function(e,t){o[e]&&o[e][t]&&delete o[e][t]},dispatch:d,OPTIONS:{SET:"set"}}}}]);
Binary file
@@ -1,4 +1,4 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[7238],{97238(t,e,n){n.r(e),n.d(e,{TextEditorPlugin:()=>l});var i=n(59929),o=n(9507),r=n(40120),s=n(86319),c=n(75068),a=n.n(c);class l extends i.WF{constructor(){super(),this.setHeading=t=>{this.editors.forEach(e=>{e.chain().setHeading({level:t}).run()})},this.onchangeFontFamily=t=>{const e=t.target.value,n=this.fontFamilies.find(t=>t.name===e);n?(this.editors.forEach(t=>{const e=t.view.state.selection;e.from===e.to?t.chain().selectAll().setFontFamily(n).run():t.chain().setFontFamily(n).run()}),this.fontFamily=e):console.error("cant set font family, font family not founded..")},this.onChangeFontSize=t=>{const e=t.target.device;this.device=e;const n=t.target.value;"phone"===e?o.Ay.execCommand("breakpoints",t=>{const e=t.props.breakpoints?.sm||{};a()(e,{style:{fontSize:n+"px"}});return{sm:e}}):this.editors.forEach(t=>{const e=t.view.state.selection;e.from===e.to?t.chain().selectAll().setFontSize(n).run():t.chain().setFontSize(n).run()}),this.fontSize=n},this.onChangeLineHeight=t=>{const e=parseFloat(t.target.value);this.editors.forEach(t=>{const n=t.view.state.selection;n.from===n.to?t.chain().selectAll().setLineHeight(e).run():t.chain().setLineHeight(e).run()}),this.lineHeight=e},this.onChangeletterSpace=t=>{const e=t.target.value+"px";this.editors.forEach(t=>{const n=t.view.state.selection;n.from===n.to?t.chain().selectAll().setLetterSpacing(e).run():t.chain().setLetterSpacing(e).run()}),this.letterSpacing=e},this.onChangeImage=t=>{},this.onFilteredFonts=t=>{const e=t.target.value;this.filteredFonts=this.fontFamilies.filter(t=>t.name.toLowerCase().includes(e.toLowerCase()))},this.onChangeFontColor=t=>{const e=t.target.value;this.editors.forEach(t=>{const n=t.view.state.selection;n.from===n.to?t.chain().selectAll().setColor(e).run():t.chain().setColor(e).run()}),this.fontColor=e},this.editors=[],this.hasTextComponent=!0,this.filteredFonts=[],this.fontFamilies=[],this.onConnect=this.onConnect.bind(this),this.THEMES=[{type:"paragraph",onClick:()=>{this.editors.forEach(t=>{t.chain().setParagraph().run()})}},{type:"h1",onClick:()=>this.setHeading(1)},{type:"h2",onClick:()=>this.setHeading(2)},{type:"h3",onClick:()=>this.setHeading(3)},{type:"h4",onClick:()=>this.setHeading(4)},{type:"h5",onClick:()=>this.setHeading(5)},{type:"h5",onClick:()=>this.setHeading(5)}]}onConnect(){setTimeout(()=>{this.editors=[];const t=o.Ay.getSelectedComponent({find:"text"});if(this.hasTextComponent=t.length>0,t.forEach(t=>{"text"===t.type&&this.editors.push(t.editor)}),this.editors.length>0){const e=this.editors[0];if(e){const n={...e.getAttributes("paragraph"),...e.getAttributes("heading")};"phone"===this.device?this.fontSize=parseInt(t[0].props?.breakpoints?.sm?.style?.fontSize):this.fontSize=parseInt(e.getAttributes("textStyle").fontSize)||16,this.fontColor=e.getAttributes("textStyle").color||"#000",this.fontFamily=e.getAttributes("textStyle").fontFamily?.split(",")[0].replace(/['"]+/g,"")||"Arial",n.lineHeight&&(this.lineHeight=parseFloat(n.lineHeight)),n.letterSpacing&&(this.letterSpacing=parseInt(n.letterSpacing)||1),this.themeType=e.isActive("heading",{level:1})?"h1":e.isActive("heading",{level:2})?"h2":e.isActive("heading",{level:3})?"h3":e.isActive("heading",{level:4})?"h4":e.isActive("heading",{level:5})?"h5":e.isActive("heading",{level:6})?"h6":"paragraph"}}},0)}connectedCallback(){super.connectedCallback(),o.Ay.on("select",this.onConnect),o.Ay.on("update",this.onConnect),this.onConnect(),(0,r.VH)().then(t=>{this.filteredFonts=this.fontFamilies=t})}disconnectedCallback(){super.disconnectedCallback(),o.Ay.off("select",this.onConnect),o.Ay.off("update",this.onConnect)}render(){const t=i.qy`
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[7238],{97238(t,e,n){n.r(e),n.d(e,{TextEditorPlugin:()=>d});var i=n(59929),o=n(36565),r=n(40120),s=n(86319),c=n(75068),a=n.n(c),l=n(18057);class d extends i.WF{constructor(){super(),this.setHeading=t=>{this.editors.forEach(e=>{e.chain().setHeading({level:t}).run()})},this.onchangeFontFamily=t=>{const e=t.target.value,n=this.fontFamilies.find(t=>t.name===e);n?(this.editors.forEach(t=>{const e=t.view.state.selection;e.from===e.to?t.chain().selectAll().setFontFamily(n).run():t.chain().setFontFamily(n).run()}),this.fontFamily=e):console.error("cant set font family, font family not founded..")},this.fontSizeDebouncer=new l.A,this.onChangeFontSize=t=>{const e=t.target.device;this.device=e;const n=t.target.value;"phone"===e?this.fontSizeDebouncer.run(()=>{o.Ay.execCommand("breakpoints",t=>{const e=t.props.breakpoints?.sm||{};return{sm:a()({},e,{style:{fontSize:n+"px"}})}})}):this.editors.forEach(t=>{const e=t.view.state.selection;e.from===e.to?t.chain().selectAll().setFontSize(n).run():t.chain().setFontSize(n).run()}),this.fontSize=n},this.onChangeLineHeight=t=>{const e=parseFloat(t.target.value);this.editors.forEach(t=>{const n=t.view.state.selection;n.from===n.to?t.chain().selectAll().setLineHeight(e).run():t.chain().setLineHeight(e).run()}),this.lineHeight=e},this.onChangeletterSpace=t=>{const e=t.target.value+"px";this.editors.forEach(t=>{const n=t.view.state.selection;n.from===n.to?t.chain().selectAll().setLetterSpacing(e).run():t.chain().setLetterSpacing(e).run()}),this.letterSpacing=e},this.onChangeImage=t=>{},this.onFilteredFonts=t=>{const e=t.target.value;this.filteredFonts=this.fontFamilies.filter(t=>t.name.toLowerCase().includes(e.toLowerCase()))},this.onChangeFontColor=t=>{const e=t.target.value;this.editors.forEach(t=>{const n=t.view.state.selection;n.from===n.to?t.chain().selectAll().setColor(e).run():t.chain().setColor(e).run()}),this.fontColor=e},this.editors=[],this.hasTextComponent=!0,this.filteredFonts=[],this.fontFamilies=[],this.onConnect=this.onConnect.bind(this),this.THEMES=[{type:"paragraph",onClick:()=>{this.editors.forEach(t=>{t.chain().setParagraph().run()})}},{type:"h1",onClick:()=>this.setHeading(1)},{type:"h2",onClick:()=>this.setHeading(2)},{type:"h3",onClick:()=>this.setHeading(3)},{type:"h4",onClick:()=>this.setHeading(4)},{type:"h5",onClick:()=>this.setHeading(5)},{type:"h5",onClick:()=>this.setHeading(5)}]}onConnect(){setTimeout(()=>{this.editors=[];const t=o.Ay.getSelectedComponent({find:"text"});if(this.hasTextComponent=t.length>0,t.forEach(t=>{"text"===t.type&&this.editors.push(t.editor)}),this.editors.length>0){const e=this.editors[0];if(e){const n={...e.getAttributes("paragraph"),...e.getAttributes("heading")};"phone"===this.device?this.fontSize=parseInt(t[0].props?.breakpoints?.sm?.style?.fontSize):this.fontSize=parseInt(e.getAttributes("textStyle").fontSize)||16,this.fontColor=e.getAttributes("textStyle").color||"#000",this.fontFamily=e.getAttributes("textStyle").fontFamily?.split(",")[0].replace(/['"]+/g,"")||"Arial",n.lineHeight&&(this.lineHeight=parseFloat(n.lineHeight)),n.letterSpacing&&(this.letterSpacing=parseInt(n.letterSpacing)||1),this.themeType=e.isActive("heading",{level:1})?"h1":e.isActive("heading",{level:2})?"h2":e.isActive("heading",{level:3})?"h3":e.isActive("heading",{level:4})?"h4":e.isActive("heading",{level:5})?"h5":e.isActive("heading",{level:6})?"h6":"paragraph"}}},0)}connectedCallback(){super.connectedCallback(),o.Ay.on("select",this.onConnect),o.Ay.on("update",this.onConnect),this.onConnect(),(0,r.VH)().then(t=>{this.filteredFonts=this.fontFamilies=t})}disconnectedCallback(){super.disconnectedCallback(),o.Ay.off("select",this.onConnect),o.Ay.off("update",this.onConnect)}render(){const t=i.qy`
2
2
  <cdtr-editor-container>
3
3
  <cdtr-title style="color:var(--micro-info-color)">
4
4
  <i>
@@ -124,8 +124,8 @@
124
124
  min="8"
125
125
  ></cdtr-range-device-editor>
126
126
  </cdtr-editor-container>
127
- `;return this.hasTextComponent?i.qy`${t} `:null}}l.properties={themeType:{type:String},fontFamily:{type:String},fontSize:{type:Number},fontColor:{type:String},lineHeight:{type:Number},letterSpacing:{type:Number},fontFamilies:{type:Array},filteredFonts:{type:Array},hasTextComponent:{type:Boolean},accordion:{type:Boolean},isOpen:{type:Boolean},device:{type:String}},l.styles=i.AH`
127
+ `;return this.hasTextComponent?i.qy`${t} `:null}}d.properties={themeType:{type:String},fontFamily:{type:String},fontSize:{type:Number},fontColor:{type:String},lineHeight:{type:Number},letterSpacing:{type:Number},fontFamilies:{type:Array},filteredFonts:{type:Array},hasTextComponent:{type:Boolean},accordion:{type:Boolean},isOpen:{type:Boolean},device:{type:String}},d.styles=i.AH`
128
128
  .dropdown-button {
129
129
  min-width: 100px;
130
130
  }
131
- `,customElements.define("cdtr-text-editor-plugin",l)}}]);
131
+ `,customElements.define("cdtr-text-editor-plugin",d)}}]);
Binary file
@@ -1,4 +1,4 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[752],{40752(t,e,i){i.r(e),i.d(e,{EditorContainer:()=>a});var n=i(59929);class a extends n.WF{constructor(){super(),this.pt="10px",this.isAnimate=!0}render(){return n.qy`<div
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[752],{40752(t,i,e){e.r(i),e.d(i,{EditorContainer:()=>a});var n=e(59929);class a extends n.WF{constructor(){super(),this.pt="10px",this.isAnimate=!0}render(){return n.qy`<div
2
2
  style="padding-top:${this.pt}"
3
3
  class="container ${this.isAnimate?"animate":""}"
4
4
  >
@@ -11,16 +11,12 @@
11
11
  :host *{
12
12
  direction: var(--direction-locale);
13
13
  }
14
- .container:hover {
15
- background: #9c9c9c0b;
16
- }
17
14
  .container {
18
- padding-left: 15px;
19
- padding-right: 15px;
15
+ padding-inline: var(--editor-container-inline-padding, 16px);
20
16
  display: block;
21
17
  width: 100%;
22
18
  min-height: 20px;
23
- padding-bottom: 10px;
19
+ padding-bottom: 8px;
24
20
  box-sizing: border-box;
25
21
  }
26
22
  .animate {
Binary file
@@ -1 +1 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[763],{10763(e,t,n){n.d(t,{default:()=>B});var o=n(96374);const i=e=>{{const{component:t,commands:n,helpers:i}=e;return{select:e=>{let{changeTab:t,tab:n}=e},tabs:e=>{const t=[{text:"design",selected:!0},{text:"link"},{text:"icons"},{text:"settings"}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:i,changeTab:r,tabs:a}=e;return[{type:"input",title:"whatTheBtnSays",mergeTags:!0,emoji:!0,active:()=>"design"===i.text,value:t.props.text||"",onInput:e=>{const t=e.target.value;n.execCommand("text",t)}},{type:"divider",active:()=>"design"===i.text},{type:"divider",active:()=>"design"===i.text},{type:"typography",active:()=>"design"===i.text,bold:700===t.props.style.fontWeight,italic:"italic"===t.props.style.fontStyle,underline:"underline"===t.props.style.textDecoration,onChange:e=>{switch(e){case"bold":const e=700===t.props.style.fontWeight?400:700;n.execCommand("style",{fontWeight:e});break;case"italic":const o="italic"===t.props.style.fontStyle?"normal":"italic";n.execCommand("style",{fontStyle:o});break;case"underline":const i="underline"===t.props.style.textDecoration?"none":"underline";n.execCommand("style",{textDecoration:i})}}},{type:"divider",active:()=>"design"===i.text},{type:"fontFamily",active:()=>"design"===i.text,value:t.props.style.fontFamily,onChange:e=>{const t=e.target.value;n.execCommand("style",{fontFamily:t})}},{type:"divider",active:()=>"design"===i.text},{type:"slider",title:"fontSize",step:1,min:8,max:50,active:()=>"design"===i.text,value:parseInt(t.props.style.fontSize)||14,onInput:e=>{const t=e.target.value;n.execCommand("style",{fontSize:t+"px",height:"auto"})}},{type:"divider",active:()=>"design"===i.text},{type:"slider",title:"width",min:10,max:500,active:()=>"design"===i.text,value:parseInt(t.props.style.width),onInput:e=>{const t=e.target.value;n.execCommand("style",{width:t+"px",minWidth:null})}},{type:"divider",active:()=>"design"===i.text},{type:"colorpicker",alpha:!1,title:"button_background",active:()=>"design"===i.text,value:t.props.style.background,onChange:e=>{const i=e.target.value,r=(0,o.w)(t.props.style.color,i);n.execCommand("style",{color:r}),n.execCommand("style",{background:i,backgroundColor:null})}},{type:"divider",active:()=>"design"===i.text},{type:"colorpicker",title:"font_color",alpha:!1,active:()=>"design"===i.text,value:t.props.style.color,onChange:e=>{const t=e.target.value;n.execCommand("style",{color:t})}},{type:"divider",active:()=>"design"===i.text},{type:"slider",title:"radius",min:0,max:100,active:()=>"design"===i.text,value:parseInt(t.props.style.borderRadius),onInput:e=>{const t=e.target.value;n.execCommand("style",{borderRadius:t+"px"})}},{type:"divider",active:()=>"design"===i.text},{type:"linkpicker",href:t.props.onClick?.link,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,autofocus:!0,active:()=>"link"===i.text,onChange:e=>{const t={link:e.target.value};n.execCommand("onClick",t)}},{type:"checkbox",title:"hasIcon",useIconsApi:!0,checked:!!t.props.hasIcon,active:()=>"icons"===i.text,onChange:e=>{const t=e.target.checked;n.execCommand("hasIcon",t),n.execCommand("iconDirection","left")}},{type:"dropdown",active:()=>"icons"===i.text&&!0===t.props.hasIcon,title:"iconDirection",value:t.props.iconDirection,onChange:e=>{const t=e.target.value;n.execCommand("iconDirection",t)},items:[{value:"left",label:"left"},{value:"right",label:"right"}]},{type:"slider",title:"size",min:10,max:100,active:()=>"icons"===i.text&&!0===t.props.hasIcon,value:t.props.iconSize||16,onInput:e=>{const t=e.target.value;n.execCommand("iconSize",t)}},{type:"icons",active:()=>"icons"===i.text&&!0===t.props.hasIcon,selectedIcon:t.props.iconUrl,onChange:e=>{const t=e.detail;n.execCommand("iconUrl",t.src)}},{type:"divider",active:()=>"design"===i.text},{type:"borderpicker",title:"border",active:()=>"design"===i.text,value:t.props.style.border,onChange:e=>{const t=e.target.value;n.execCommand("style",{border:t})}},{type:"slider",title:"borderWidth",active:()=>"design"===i.text,value:t.props.style.borderWidth,onInput:e=>{const t=e.target.value;n.execCommand("style",{borderWidth:t+"px"})}},{type:"colorpicker",title:"borderColor",active:()=>"design"===i.text,value:t.props.style.borderColor,onChange:e=>{const t=e.target.value;n.execCommand("style",{borderColor:t})}},{type:"divider",active:()=>"design"===i.text},{type:"spacingPicker",active:()=>"design"===i.text,hasLeft:!1,hasRight:!1,value:{top:parseInt(t.props.style.paddingTop)||0,bottom:parseInt(t.props.style.paddingBottom)||0,left:parseInt(t.props.style.paddingLeft)||0,right:parseInt(t.props.style.paddingRight)||0},onChange:e=>{e.target.value;const t=e.target.topValue,o=e.target.bottomValue,i=e.target.leftValue,r=e.target.rightValue;n.execCommand("style",{paddingTop:t+"px",paddingBottom:o+"px",paddingLeft:i+"px",paddingRight:r+"px",padding:null})}}]}}}},r=e=>{let{helpers:t,editor:n,getFocused:o}=e;return{set:(e,i,r)=>{switch(i){case"style":return e[i]=t.deepMerge(e[i],r),!0;case"text":return e.text=r,o()||n.chain().setContent(r).run(),!0;case"ripple":case"rippleColor":case"scaleOnHover":case"hasIcon":case"iconUrl":case"iconSize":case"iconDirection":return e[i]=r,!0;case"onClick":if(r.link)return e[i]=r,!0}}}};var a=n(72591),s=n.n(a),l=n(88639),c=n.n(l),d=n(88128),p=n.n(d),u=n(30855),m=n.n(u),g=n(93051),A=n.n(g),h=n(49536),y={};y.setAttributes=m(),y.insert=p().bind(null,"head"),y.domAPI=c(),y.insertStyleElement=A();s()(h.A,y);const x=h.A&&h.A.locals?h.A.locals:void 0;var C=n(81318),v=n(1366);const b=C.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,C.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var f=n(85194),E=n(28396);const k=C.YY.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const B=()=>{const e="button";return{name:e,create:t=>{const{createElement:n,compose:o,helpers:a}=t,{arrayToString:s,mergeDiff:l}=a;let c=!1;const d=document.createElement("div"),p=document.createElement("div"),{editor:u}=function(e){let{content:t,element:n}=e;return{element:n,editor:new C.KE({element:n,extensions:[v.A,b,E.A,f.Ay,k],content:t})}}({content:o.props.text,element:p});d.appendChild(p);return u.view.dom.setAttribute("dir","auto"),u.on("update",e=>{let{editor:t}=e;const n=t.getText();o.editor.store().updateComponent(o,"text",n)}),u.on("focus",e=>{let{event:t,editor:n}=e;c=!0}),u.on("blur",e=>{let{event:t,editor:n}=e;c=!1}),d.className=x.button,n({name:e,id:o.id,template:d,commands:{insertContent:e=>{u.commands.insertContent(e),u.chain().focus()}},defaultProps:{style:{height:"auto",width:"200px",padding:"10px",borderRadius:"5px",fontFamily:"Arial",fontSize:"16px"},text:"button"},render:()=>{try{o.props.style.display="",o.props.style.direction=""}catch(e){console.error(e)}l(d,{style:o.props.style}),d.style.height="auto";const e=o.props.hasIcon,t=o.props.iconUrl,n=o.props.iconDirection,i=o.props.iconSize,r="icon_in_button";let a=d.querySelector(`.${r}`)||document.createElement("img");e&&t?(a.className=r,a.src=t,a.style.width=(i||16)+"px",a.style.height=(i||16)+"px",a.style.marginRight="8px",a.style.marginLeft="8px","left"===n?d.insertBefore(a,d.firstChild):d.appendChild(a)):a.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>d,handleBar:!0,validator:r({template:d,helpers:a,editor:u,getFocused:function(){return c}}),schema:o.schema,onSelect:e=>{d.classList.add(e)},onDeselect:e=>{d.classList.remove(e)},elementProps:o,destroy:()=>{u.destroy()},remove:()=>{d.remove()},createEditor:i})}}}},49536(e,t,n){n.d(t,{A:()=>s});var o=n(82001),i=n.n(o),r=n(40935),a=n.n(r)()(i());a.push([e.id,".BEr8unIfy4OEGYhlHclN {\n cursor: text !important;\n}\n.BEr8unIfy4OEGYhlHclN {\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.BEr8unIfy4OEGYhlHclN p {\n margin: 0;\n line-height: 1;\n}\n.cI3RTMAdk9qoZ8mu9Sm9 {\n width: 100%;\n}\n.VSumPf0Ui7b1pl8cMATP {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.Vo2Ewnq6ekWFdNMjxBIB {\n left: -8px;\n cursor: w-resize;\n}\n.WLZC84sb1rfaRnHCDyj8 {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.BEr8unIfy4OEGYhlHclN .VSumPf0Ui7b1pl8cMATP {\n display: none;\n}\n.BEr8unIfy4OEGYhlHclN.Qh20ei1Fa8QUbGinFFbw .VSumPf0Ui7b1pl8cMATP {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n","",{version:3,sources:["webpack://./../web-editors/button-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,uBAAuB;AAOzB;AARA;EAEE,eAAe;EACf,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,SAAS;EACT,cAAc;AAChB;AACA;EACE,WAAW;AACb;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,UAAU;EACV,WAAW;EACX,gCAAgC;EAChC,mBAAmB;AACrB;AACA;EACE,UAAU;EACV,gBAAgB;AAClB;AACA;EACE,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;AACA;;;;;GAKG",sourcesContent:[".button {\n cursor: text !important;\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.button p {\n margin: 0;\n line-height: 1;\n}\n.contentEditable {\n width: 100%;\n}\n.margin {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.marginLeft {\n left: -8px;\n cursor: w-resize;\n}\n.marginRight {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.button .margin {\n display: none;\n}\n.button.selected .margin {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n"],sourceRoot:""}]),a.locals={button:"BEr8unIfy4OEGYhlHclN",contentEditable:"cI3RTMAdk9qoZ8mu9Sm9",margin:"VSumPf0Ui7b1pl8cMATP",marginLeft:"Vo2Ewnq6ekWFdNMjxBIB",marginRight:"WLZC84sb1rfaRnHCDyj8",selected:"Qh20ei1Fa8QUbGinFFbw"};const s=a}}]);
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[763],{10763(e,t,n){n.d(t,{default:()=>I});var o=n(96374),a=n(86319);const i=e=>{{const{component:t,commands:n,helpers:i}=e;return{select:e=>{let{changeTab:t,tab:n}=e},tabs:e=>{const t=[{text:"design",selected:!0},{text:"link"},{text:"icons"},..."web"===a.M.get("config","channel")?[{text:"animations"},{text:"modal"}]:[],{text:"settings"}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:i,changeTab:l,tabs:r}=e;const s=(a.M.get("components")||[]).filter(e=>e&&"block"===e.type&&e.props?.modalable),c=[{value:"",label:"modal_none"},...s.map((e,t)=>({value:e.id,label:e.props?.modalName||`modal ${t+1}`}))],d=t.props.modalBlockId||"",p=c.find(e=>e.value===d)?.label||"modal_none";return[{type:"heading",level:6,text:"open_modal",active:()=>"modal"===i.text},{type:"info",text:s.length?"modal_pick_hint":"modal_none_hint",active:()=>"modal"===i.text},{type:"dropdown",title:"modal_block",active:()=>"modal"===i.text,value:p,selected:d,items:c,onChange:e=>{n.execCommand("modalBlockId",e.target.value)}},{type:"heading",level:6,text:"settings",active:()=>"design"===i.text},{type:"input",title:"whatTheBtnSays",mergeTags:!0,emoji:!0,active:()=>"design"===i.text,value:t.props.text||"",onInput:e=>{const t=e.target.value;n.execCommand("text",t)}},{type:"heading",level:6,text:"typography",active:()=>"design"===i.text},{type:"typography",active:()=>"design"===i.text,bold:700===t.props.style.fontWeight,italic:"italic"===t.props.style.fontStyle,underline:"underline"===t.props.style.textDecoration,onChange:e=>{switch(e){case"bold":const e=700===t.props.style.fontWeight?400:700;n.execCommand("style",{fontWeight:e});break;case"italic":const o="italic"===t.props.style.fontStyle?"normal":"italic";n.execCommand("style",{fontStyle:o});break;case"underline":const a="underline"===t.props.style.textDecoration?"none":"underline";n.execCommand("style",{textDecoration:a})}}},{type:"fontFamily",active:()=>"design"===i.text,value:t.props.style.fontFamily,weight:"web"===a.M.get("config","channel"),weightValue:t.props.style.fontWeight,onChange:e=>{const t=e.target.value;n.execCommand("style",{fontFamily:t})},onWeightChange:e=>{n.execCommand("style",{fontWeight:e.detail.value})}},{type:"slider",title:"fontSize",step:1,min:8,max:50,active:()=>"design"===i.text,value:parseInt(t.props.style.fontSize)||14,onInput:e=>{const t=e.target.value;n.execCommand("style",{fontSize:t+"px",height:"auto"})}},{type:"heading",level:6,text:"dimensions",active:()=>"design"===i.text},{type:"slider",title:"width",min:10,max:500,active:()=>"design"===i.text,value:parseInt(t.props.style.width),onInput:e=>{const t=e.target.value;n.execCommand("style",{width:t+"px",minWidth:null})}},{type:"heading",level:6,text:"colors",active:()=>"design"===i.text},{type:"colorSwatchGroup",active:()=>"design"===i.text,columns:2,items:[{title:"button_background",allowGradient:!0,value:t.props.style.background||"#000000",onChange:e=>{const a=e.target.value;if(!a.includes("gradient(")){const e=(0,o.w)(t.props.style.color,a);n.execCommand("style",{color:e})}n.execCommand("style",{background:a,backgroundColor:null})}},{title:"font_color",value:t.props.style.color||"#ffffff",onChange:e=>{const t=e.target.value;n.execCommand("style",{color:t})}}]},{type:"heading",level:6,text:"border_design",active:()=>"design"===i.text},{type:"slider",title:"radius",min:0,max:100,active:()=>"design"===i.text,value:parseInt(t.props.style.borderRadius),onInput:e=>{const t=e.target.value;n.execCommand("style",{borderRadius:t+"px"})}},{type:"borderpicker",title:"border",active:()=>"design"===i.text,value:t.props.style.border,onChange:e=>{const t=e.target.value;n.execCommand("style",{border:t})}},{type:"slider",title:"borderWidth",active:()=>"design"===i.text,value:t.props.style.borderWidth,onInput:e=>{const t=e.target.value;n.execCommand("style",{borderWidth:t+"px"})}},{type:"colorpicker",title:"borderColor",active:()=>"design"===i.text,value:t.props.style.borderColor,onChange:e=>{const t=e.target.value;n.execCommand("style",{borderColor:t})}},{type:"linkpicker",href:t.props.onClick?.link,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,autofocus:!0,active:()=>"link"===i.text,onChange:e=>{const t={link:e.target.value};n.execCommand("onClick",t)}},{type:"checkbox",title:"hasIcon",useIconsApi:!0,checked:!!t.props.hasIcon,active:()=>"icons"===i.text,onChange:e=>{const t=e.target.checked;n.execCommand("hasIcon",t),n.execCommand("iconDirection","left")}},{type:"dropdown",active:()=>"icons"===i.text&&!0===t.props.hasIcon,title:"iconDirection",value:t.props.iconDirection,onChange:e=>{const t=e.target.value;n.execCommand("iconDirection",t)},items:[{value:"left",label:"left"},{value:"right",label:"right"}]},{type:"slider",title:"size",min:10,max:100,active:()=>"icons"===i.text&&!0===t.props.hasIcon,value:t.props.iconSize||16,onInput:e=>{const t=e.target.value;n.execCommand("iconSize",t)}},{type:"icons",active:()=>"icons"===i.text&&!0===t.props.hasIcon,selectedIcon:t.props.iconUrl,onChange:e=>{const t=e.detail;n.execCommand("iconUrl",t.src)}},{type:"heading",level:6,text:"spacing",active:()=>"design"===i.text},{type:"spacingPicker",active:()=>"design"===i.text,hasLeft:!1,hasRight:!1,value:{top:parseInt(t.props.style.paddingTop)||0,bottom:parseInt(t.props.style.paddingBottom)||0,left:parseInt(t.props.style.paddingLeft)||0,right:parseInt(t.props.style.paddingRight)||0},onChange:e=>{e.target.value;const t=e.target.topValue,o=e.target.bottomValue,a=e.target.leftValue,i=e.target.rightValue;n.execCommand("style",{paddingTop:t+"px",paddingBottom:o+"px",paddingLeft:a+"px",paddingRight:i+"px",padding:null})}}]}}}},l=e=>{let{helpers:t,editor:n,getFocused:o}=e;return{set:(e,a,i)=>{switch(a){case"style":return e[a]=t.deepMerge(e[a],i),!0;case"text":return e.text=i,o()||n.chain().setContent(i).run(),!0;case"ripple":case"rippleColor":case"scaleOnHover":case"hasIcon":case"iconUrl":case"iconSize":case"iconDirection":case"modalBlockId":return e[a]=i,!0;case"onClick":if(i.link)return e[a]=i,!0}}}};var r=n(72591),s=n.n(r),c=n(88639),d=n.n(c),p=n(88128),m=n.n(p),u=n(30855),g=n.n(u),h=n(93051),A=n.n(h),y=n(49536),x={};x.setAttributes=g(),x.insert=m().bind(null,"head"),x.domAPI=d(),x.insertStyleElement=A();s()(y.A,x);const C=y.A&&y.A.locals?y.A.locals:void 0;var b=n(81318),v=n(1366);const f=b.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,b.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var E=n(85194),k=n(28396);const B=b.YY.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const I=()=>{const e="button";return{name:e,create:t=>{const{createElement:n,compose:o,helpers:a}=t,{arrayToString:r,mergeDiff:s}=a;let c=!1;const d=document.createElement("div"),p=document.createElement("div"),{editor:m}=function(e){let{content:t,element:n}=e;return{element:n,editor:new b.KE({element:n,extensions:[v.A,f,k.A,E.Ay,B],content:t})}}({content:o.props.text,element:p});d.appendChild(p);return m.view.dom.setAttribute("dir","auto"),m.on("update",e=>{let{editor:t}=e;const n=t.getText();o.editor.store().updateComponent(o,"text",n)}),m.on("focus",e=>{let{event:t,editor:n}=e;c=!0}),m.on("blur",e=>{let{event:t,editor:n}=e;c=!1}),d.className=C.button,n({name:e,id:o.id,template:d,commands:{insertContent:e=>{m.commands.insertContent(e),m.chain().focus()}},defaultProps:{style:{height:"auto",width:"200px",padding:"10px",borderRadius:"5px",fontFamily:"Arial",fontSize:"16px"},text:"button"},render:()=>{try{o.props.style.display="",o.props.style.direction=""}catch(e){console.error(e)}s(d,{style:o.props.style}),d.style.height="auto";const e=o.props.hasIcon,t=o.props.iconUrl,n=o.props.iconDirection,a=o.props.iconSize,i="icon_in_button";let l=d.querySelector(`.${i}`)||document.createElement("img");e&&t?(l.className=i,l.src=t,l.style.width=(a||16)+"px",l.style.height=(a||16)+"px",l.style.marginRight="8px",l.style.marginLeft="8px","left"===n?d.insertBefore(l,d.firstChild):d.appendChild(l)):l.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>d,handleBar:!0,validator:l({template:d,helpers:a,editor:m,getFocused:function(){return c}}),schema:o.schema,onSelect:e=>{d.classList.add(e)},onDeselect:e=>{d.classList.remove(e)},elementProps:o,destroy:()=>{m.destroy()},remove:()=>{d.remove()},createEditor:i})}}}},49536(e,t,n){n.d(t,{A:()=>r});var o=n(82001),a=n.n(o),i=n(40935),l=n.n(i)()(a());l.push([e.id,".BEr8unIfy4OEGYhlHclN {\n cursor: text !important;\n}\n.BEr8unIfy4OEGYhlHclN {\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.BEr8unIfy4OEGYhlHclN p {\n margin: 0;\n line-height: 1;\n}\n.cI3RTMAdk9qoZ8mu9Sm9 {\n width: 100%;\n}\n.VSumPf0Ui7b1pl8cMATP {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.Vo2Ewnq6ekWFdNMjxBIB {\n left: -8px;\n cursor: w-resize;\n}\n.WLZC84sb1rfaRnHCDyj8 {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.BEr8unIfy4OEGYhlHclN .VSumPf0Ui7b1pl8cMATP {\n display: none;\n}\n.BEr8unIfy4OEGYhlHclN.Qh20ei1Fa8QUbGinFFbw .VSumPf0Ui7b1pl8cMATP {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n","",{version:3,sources:["webpack://./../web-editors/button-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,uBAAuB;AAOzB;AARA;EAEE,eAAe;EACf,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,SAAS;EACT,cAAc;AAChB;AACA;EACE,WAAW;AACb;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,UAAU;EACV,WAAW;EACX,gCAAgC;EAChC,mBAAmB;AACrB;AACA;EACE,UAAU;EACV,gBAAgB;AAClB;AACA;EACE,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;AACA;;;;;GAKG",sourcesContent:[".button {\n cursor: text !important;\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.button p {\n margin: 0;\n line-height: 1;\n}\n.contentEditable {\n width: 100%;\n}\n.margin {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.marginLeft {\n left: -8px;\n cursor: w-resize;\n}\n.marginRight {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.button .margin {\n display: none;\n}\n.button.selected .margin {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n"],sourceRoot:""}]),l.locals={button:"BEr8unIfy4OEGYhlHclN",contentEditable:"cI3RTMAdk9qoZ8mu9Sm9",margin:"VSumPf0Ui7b1pl8cMATP",marginLeft:"Vo2Ewnq6ekWFdNMjxBIB",marginRight:"WLZC84sb1rfaRnHCDyj8",selected:"Qh20ei1Fa8QUbGinFFbw"};const r=l}}]);
Binary file
@@ -0,0 +1,25 @@
1
+ /*! For license information please see 7789.creaditor.bundle.js.LICENSE.txt */
2
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[7789],{68876(t,e,i){i.d(e,{r:()=>k,N:()=>N});i(69130);var n=i(53874);let o;const s={properties:{sizingTarget:{type:Object,value:function(){return this}},fitInto:{type:Object,value:window},noOverlap:{type:Boolean},positionTarget:{type:Element},horizontalAlign:{type:String},verticalAlign:{type:String},dynamicAlign:{type:Boolean},horizontalOffset:{type:Number,value:0,notify:!0},verticalOffset:{type:Number,value:0,notify:!0},autoFitOnAttach:{type:Boolean,value:!1},expandSizingTargetForScrollbars:{type:Boolean,value:!1},_fitInfo:{type:Object}},get _fitWidth(){return this.fitInto===window?this.fitInto.innerWidth:this.fitInto.getBoundingClientRect().width},get _fitHeight(){return this.fitInto===window?this.fitInto.innerHeight:this.fitInto.getBoundingClientRect().height},get _fitLeft(){return this.fitInto===window?0:this.fitInto.getBoundingClientRect().left},get _fitTop(){return this.fitInto===window?0:this.fitInto.getBoundingClientRect().top},get _defaultPositionTarget(){var t=(0,n.tT)(this).parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(t=t.host),t},get _localeHorizontalAlign(){if(this._isRTL){if("right"===this.horizontalAlign)return"left";if("left"===this.horizontalAlign)return"right"}return this.horizontalAlign},get __shouldPosition(){return(this.horizontalAlign||this.verticalAlign)&&this.positionTarget},get _isRTL(){return void 0===this._memoizedIsRTL&&(this._memoizedIsRTL="rtl"==window.getComputedStyle(this).direction),this._memoizedIsRTL},attached:function(){this.positionTarget=this.positionTarget||this._defaultPositionTarget,this.autoFitOnAttach&&("none"===window.getComputedStyle(this).display?setTimeout(function(){this.fit()}.bind(this)):(window.ShadyDOM&&ShadyDOM.flush(),this.fit()))},detached:function(){this.__deferredFit&&(clearTimeout(this.__deferredFit),this.__deferredFit=null)},fit:function(){this.position(),this.constrain(),this.center()},_discoverInfo:function(){if(!this._fitInfo){var t=window.getComputedStyle(this),e=window.getComputedStyle(this.sizingTarget);this._fitInfo={inlineStyle:{top:this.style.top||"",left:this.style.left||"",position:this.style.position||""},sizerInlineStyle:{maxWidth:this.sizingTarget.style.maxWidth||"",maxHeight:this.sizingTarget.style.maxHeight||"",boxSizing:this.sizingTarget.style.boxSizing||""},positionedBy:{vertically:"auto"!==t.top?"top":"auto"!==t.bottom?"bottom":null,horizontally:"auto"!==t.left?"left":"auto"!==t.right?"right":null},sizedBy:{height:"none"!==e.maxHeight,width:"none"!==e.maxWidth,minWidth:parseInt(e.minWidth,10)||0,minHeight:parseInt(e.minHeight,10)||0},margin:{top:parseInt(t.marginTop,10)||0,right:parseInt(t.marginRight,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0}}}},resetFit:function(){var t=this._fitInfo||{};for(var e in t.sizerInlineStyle)this.sizingTarget.style[e]=t.sizerInlineStyle[e];for(var e in t.inlineStyle)this.style[e]=t.inlineStyle[e];this._fitInfo=null},refit:function(){var t=this.sizingTarget.scrollLeft,e=this.sizingTarget.scrollTop;this.resetFit(),this.fit(),this.sizingTarget.scrollLeft=t,this.sizingTarget.scrollTop=e},position:function(){if(!this.__shouldPosition)return;this._discoverInfo(),window.ShadyDOM&&window.ShadyDOM.flush(),this.style.position="fixed",this.sizingTarget.style.boxSizing="border-box",this.style.left="0px",this.style.top="0px";var t=this.getBoundingClientRect(),e=this.__getNormalizedRect(this.positionTarget),i=this.__getNormalizedRect(this.fitInto);let n,s,r,a;this.expandSizingTargetForScrollbars&&(n=this.sizingTarget.offsetWidth,s=this.sizingTarget.offsetHeight,r=this.sizingTarget.clientWidth,a=this.sizingTarget.clientHeight);var l=this._fitInfo.margin,h={width:t.width+l.left+l.right,height:t.height+l.top+l.bottom},c=this.__getPosition(this._localeHorizontalAlign,this.verticalAlign,h,t,e,i),d=c.left+l.left,f=c.top+l.top,u=Math.min(i.right-l.right,d+t.width),_=Math.min(i.bottom-l.bottom,f+t.height);d=Math.max(i.left+l.left,Math.min(d,u-this._fitInfo.sizedBy.minWidth)),f=Math.max(i.top+l.top,Math.min(f,_-this._fitInfo.sizedBy.minHeight));const p=Math.max(u-d,this._fitInfo.sizedBy.minWidth),g=Math.max(_-f,this._fitInfo.sizedBy.minHeight);this.sizingTarget.style.maxWidth=p+"px",this.sizingTarget.style.maxHeight=g+"px";const m=d-t.left,v=f-t.top;if(this.style.left=`${m}px`,this.style.top=`${v}px`,this.expandSizingTargetForScrollbars){const t=this.sizingTarget.offsetHeight,e=t-this.sizingTarget.clientHeight-(s-a);if(e>0){const n=i.height-l.top-l.bottom,o=Math.min(n,g+e);this.sizingTarget.style.maxHeight=`${o}px`;const s=this.sizingTarget.offsetHeight,r=s-t;let a;"top"===c.verticalAlign?a=v:"middle"===c.verticalAlign?a=v-r/2:"bottom"===c.verticalAlign&&(a=v-r),a=Math.max(i.top+l.top,Math.min(a,i.bottom-l.bottom-s)),this.style.top=`${a}px`}const h=this.sizingTarget.offsetWidth,d=h-this.sizingTarget.clientWidth-(n-r);if(d>0){const t=(()=>{if(void 0!==o)return o;const t=document.createElement("div");Object.assign(t.style,{overflow:"auto",position:"fixed",left:"0px",top:"0px",maxWidth:"100px",maxHeight:"100px"});const e=document.createElement("div");return e.style.width="200px",e.style.height="200px",t.appendChild(e),document.body.appendChild(t),o=Math.abs(t.offsetWidth-100)>1?t.offsetWidth-t.clientWidth:0,document.body.removeChild(t),o})(),e=i.width-l.left-l.right,n=Math.min(e,p+d-t);this.sizingTarget.style.maxWidth=`${n}px`;const s=this.sizingTarget.offsetWidth+t,r=s-h;let a;"left"===c.horizontalAlign?a=m:"center"===c.horizontalAlign?a=m-r/2:"right"===c.horizontalAlign&&(a=m-r),a=Math.max(i.left+l.left,Math.min(a,i.right-l.right-s)),this.style.left=`${a}px`}}},constrain:function(){if(!this.__shouldPosition){this._discoverInfo();var t=this._fitInfo;t.positionedBy.vertically||(this.style.position="fixed",this.style.top="0px"),t.positionedBy.horizontally||(this.style.position="fixed",this.style.left="0px"),this.sizingTarget.style.boxSizing="border-box";var e=this.getBoundingClientRect();t.sizedBy.height||this.__sizeDimension(e,t.positionedBy.vertically,"top","bottom","Height"),t.sizedBy.width||this.__sizeDimension(e,t.positionedBy.horizontally,"left","right","Width")}},_sizeDimension:function(t,e,i,n,o){this.__sizeDimension(t,e,i,n,o)},__sizeDimension:function(t,e,i,n,o){var s=this._fitInfo,r=this.__getNormalizedRect(this.fitInto),a="Width"===o?r.width:r.height,l=e===n,h=l?a-t[n]:t[i],c=s.margin[l?i:n],d="offset"+o,f=this[d]-this.sizingTarget[d];this.sizingTarget.style["max"+o]=a-c-h-f+"px"},center:function(){if(!this.__shouldPosition){this._discoverInfo();var t=this._fitInfo.positionedBy;if(!t.vertically||!t.horizontally){this.style.position="fixed",t.vertically||(this.style.top="0px"),t.horizontally||(this.style.left="0px");var e=this.getBoundingClientRect(),i=this.__getNormalizedRect(this.fitInto);if(!t.vertically){var n=i.top-e.top+(i.height-e.height)/2;this.style.top=n+"px"}if(!t.horizontally){var o=i.left-e.left+(i.width-e.width)/2;this.style.left=o+"px"}}}},__getNormalizedRect:function(t){return t===document.documentElement||t===window?{top:0,left:0,width:window.innerWidth,height:window.innerHeight,right:window.innerWidth,bottom:window.innerHeight}:t.getBoundingClientRect()},__getOffscreenArea:function(t,e,i){var n=Math.min(0,t.top)+Math.min(0,i.bottom-(t.top+e.height)),o=Math.min(0,t.left)+Math.min(0,i.right-(t.left+e.width));return Math.abs(n)*e.width+Math.abs(o)*e.height},__getPosition:function(t,e,i,n,o,s){var r,a=[{verticalAlign:"top",horizontalAlign:"left",top:o.top+this.verticalOffset,left:o.left+this.horizontalOffset},{verticalAlign:"top",horizontalAlign:"right",top:o.top+this.verticalOffset,left:o.right-i.width-this.horizontalOffset},{verticalAlign:"bottom",horizontalAlign:"left",top:o.bottom-i.height-this.verticalOffset,left:o.left+this.horizontalOffset},{verticalAlign:"bottom",horizontalAlign:"right",top:o.bottom-i.height-this.verticalOffset,left:o.right-i.width-this.horizontalOffset}];if(this.noOverlap){for(var l=0,h=a.length;l<h;l++){var c={};for(var d in a[l])c[d]=a[l][d];a.push(c)}a[0].top=a[1].top+=o.height,a[2].top=a[3].top-=o.height,a[4].left=a[6].left+=o.width,a[5].left=a[7].left-=o.width}e="auto"===e?null:e,(t="auto"===t?null:t)&&"center"!==t||(a.push({verticalAlign:"top",horizontalAlign:"center",top:o.top+this.verticalOffset+(this.noOverlap?o.height:0),left:o.left-n.width/2+o.width/2+this.horizontalOffset}),a.push({verticalAlign:"bottom",horizontalAlign:"center",top:o.bottom-i.height-this.verticalOffset-(this.noOverlap?o.height:0),left:o.left-n.width/2+o.width/2+this.horizontalOffset})),e&&"middle"!==e||(a.push({verticalAlign:"middle",horizontalAlign:"left",top:o.top-n.height/2+o.height/2+this.verticalOffset,left:o.left+this.horizontalOffset+(this.noOverlap?o.width:0)}),a.push({verticalAlign:"middle",horizontalAlign:"right",top:o.top-n.height/2+o.height/2+this.verticalOffset,left:o.right-i.width-this.horizontalOffset-(this.noOverlap?o.width:0)})),"middle"===e&&"center"===t&&a.push({verticalAlign:"middle",horizontalAlign:"center",top:o.top-n.height/2+o.height/2+this.verticalOffset,left:o.left-n.width/2+o.width/2+this.horizontalOffset});for(l=0;l<a.length;l++){var f=a[l],u=f.verticalAlign===e,_=f.horizontalAlign===t;if(!this.dynamicAlign&&!this.noOverlap&&u&&_){r=f;break}var p=(!e||u)&&(!t||_);if(this.dynamicAlign||p){if(f.offscreenArea=this.__getOffscreenArea(f,i,s),0===f.offscreenArea&&p){r=f;break}r=r||f;var g=f.offscreenArea-r.offscreenArea;(g<0||0===g&&(u||_))&&(r=f)}}return r}};var r=i(12822),a=new Set;const l={properties:{_parentResizable:{type:Object,observer:"_parentResizableChanged"},_notifyingDescendant:{type:Boolean,value:!1}},listeners:{"iron-request-resize-notifications":"_onIronRequestResizeNotifications"},created:function(){this._interestedResizables=[],this._boundNotifyResize=this.notifyResize.bind(this),this._boundOnDescendantIronResize=this._onDescendantIronResize.bind(this)},attached:function(){this._requestResizeNotifications()},detached:function(){this._parentResizable?this._parentResizable.stopResizeNotificationsFor(this):(a.delete(this),window.removeEventListener("resize",this._boundNotifyResize)),this._parentResizable=null},notifyResize:function(){this.isAttached&&(this._interestedResizables.forEach(function(t){this.resizerShouldNotify(t)&&this._notifyDescendant(t)},this),this._fireResize())},assignParentResizable:function(t){this._parentResizable&&this._parentResizable.stopResizeNotificationsFor(this),this._parentResizable=t,t&&-1===t._interestedResizables.indexOf(this)&&(t._interestedResizables.push(this),t._subscribeIronResize(this))},stopResizeNotificationsFor:function(t){var e=this._interestedResizables.indexOf(t);e>-1&&(this._interestedResizables.splice(e,1),this._unsubscribeIronResize(t))},_subscribeIronResize:function(t){t.addEventListener("iron-resize",this._boundOnDescendantIronResize)},_unsubscribeIronResize:function(t){t.removeEventListener("iron-resize",this._boundOnDescendantIronResize)},resizerShouldNotify:function(t){return!0},_onDescendantIronResize:function(t){this._notifyingDescendant?t.stopPropagation():r.sv||this._fireResize()},_fireResize:function(){this.fire("iron-resize",null,{node:this,bubbles:!1})},_onIronRequestResizeNotifications:function(t){var e=(0,n.tT)(t).rootTarget;e!==this&&(e.assignParentResizable(this),this._notifyDescendant(e),t.stopPropagation())},_parentResizableChanged:function(t){t&&window.removeEventListener("resize",this._boundNotifyResize)},_notifyDescendant:function(t){this.isAttached&&(this._notifyingDescendant=!0,t.notifyResize(),this._notifyingDescendant=!1)},_requestResizeNotifications:function(){if(this.isAttached)if("loading"===document.readyState){var t=this._requestResizeNotifications.bind(this);document.addEventListener("readystatechange",function e(){document.removeEventListener("readystatechange",e),t()})}else this._findParent(),this._parentResizable?this._parentResizable._interestedResizables.forEach(function(t){t!==this&&t._findParent()},this):(a.forEach(function(t){t!==this&&t._findParent()},this),window.addEventListener("resize",this._boundNotifyResize),this.notifyResize())},_findParent:function(){this.assignParentResizable(null),this.fire("iron-request-resize-notifications",null,{node:this,bubbles:!0,cancelable:!0}),this._parentResizable?a.delete(this):a.add(this)}};var h=Element.prototype,c=h.matches||h.matchesSelector||h.mozMatchesSelector||h.msMatchesSelector||h.oMatchesSelector||h.webkitMatchesSelector;const d=new class{getTabbableNodes(t){var e=[];return this._collectTabbableNodes(t,e)?this._sortByTabIndex(e):e}isFocusable(t){return c.call(t,"input, select, textarea, button, object")?c.call(t,":not([disabled])"):c.call(t,"a[href], area[href], iframe, [tabindex], [contentEditable]")}isTabbable(t){return this.isFocusable(t)&&c.call(t,':not([tabindex="-1"])')&&this._isVisible(t)}_normalizedTabIndex(t){if(this.isFocusable(t)){var e=t.getAttribute("tabindex")||0;return Number(e)}return-1}_collectTabbableNodes(t,e){if(t.nodeType!==Node.ELEMENT_NODE)return!1;var i=t;if(!this._isVisible(i))return!1;var o,s=this._normalizedTabIndex(i),r=s>0;s>=0&&e.push(i),o="content"===i.localName||"slot"===i.localName?(0,n.tT)(i).getDistributedNodes():(0,n.tT)(i.root||i).children;for(var a=0;a<o.length;a++)r=this._collectTabbableNodes(o[a],e)||r;return r}_isVisible(t){var e=t.style;return"hidden"!==e.visibility&&"none"!==e.display&&("hidden"!==(e=window.getComputedStyle(t)).visibility&&"none"!==e.display)}_sortByTabIndex(t){var e=t.length;if(e<2)return t;var i=Math.ceil(e/2),n=this._sortByTabIndex(t.slice(0,i)),o=this._sortByTabIndex(t.slice(i));return this._mergeSortByTabIndex(n,o)}_mergeSortByTabIndex(t,e){for(var i=[];t.length>0&&e.length>0;)this._hasLowerTabOrder(t[0],e[0])?i.push(e.shift()):i.push(t.shift());return i.concat(t,e)}_hasLowerTabOrder(t,e){var i=Math.max(t.tabIndex,0),n=Math.max(e.tabIndex,0);return 0===i||0===n?n>i:i>n}};var f=i(95586),u=i(47351);(0,f.b)({_template:u.q`
3
+ <style>
4
+ :host {
5
+ position: fixed;
6
+ top: 0;
7
+ left: 0;
8
+ width: 100%;
9
+ height: 100%;
10
+ background-color: var(--iron-overlay-backdrop-background-color, #000);
11
+ opacity: 0;
12
+ transition: opacity 0.2s;
13
+ pointer-events: none;
14
+ @apply --iron-overlay-backdrop;
15
+ }
16
+
17
+ :host(.opened) {
18
+ opacity: var(--iron-overlay-backdrop-opacity, 0.6);
19
+ pointer-events: auto;
20
+ @apply --iron-overlay-backdrop-opened;
21
+ }
22
+ </style>
23
+
24
+ <slot></slot>
25
+ `,is:"iron-overlay-backdrop",properties:{opened:{reflectToAttribute:!0,type:Boolean,value:!1,observer:"_openedChanged"}},listeners:{transitionend:"_onTransitionend"},created:function(){this.__openedRaf=null},attached:function(){this.opened&&this._openedChanged(this.opened)},prepare:function(){this.opened&&!this.parentNode&&(0,n.tT)(document.body).appendChild(this)},open:function(){this.opened=!0},close:function(){this.opened=!1},complete:function(){this.opened||this.parentNode!==document.body||(0,n.tT)(this.parentNode).removeChild(this)},_onTransitionend:function(t){t&&t.target===this&&this.complete()},_openedChanged:function(t){if(t)this.prepare();else{var e=window.getComputedStyle(this);"0s"!==e.transitionDuration&&0!=e.opacity||this.complete()}this.isAttached&&(this.__openedRaf&&(window.cancelAnimationFrame(this.__openedRaf),this.__openedRaf=null),this.scrollTop=this.scrollTop,this.__openedRaf=window.requestAnimationFrame(function(){this.__openedRaf=null,this.toggleClass("opened",this.opened)}.bind(this)))}});var _=i(35915),p=i(15055);const g=new class{constructor(){this._overlays=[],this._minimumZ=101,this._backdropElement=null,p.ch(document.documentElement,"tap",function(){}),document.addEventListener("tap",this._onCaptureClick.bind(this),!0),document.addEventListener("focus",this._onCaptureFocus.bind(this),!0),document.addEventListener("keydown",this._onCaptureKeyDown.bind(this),!0)}get backdropElement(){return this._backdropElement||(this._backdropElement=document.createElement("iron-overlay-backdrop")),this._backdropElement}get deepActiveElement(){var t=document.activeElement;for(t&&t instanceof Element!=!1||(t=document.body);t.root&&(0,n.tT)(t.root).activeElement;)t=(0,n.tT)(t.root).activeElement;return t}_bringOverlayAtIndexToFront(t){var e=this._overlays[t];if(e){var i=this._overlays.length-1,n=this._overlays[i];if(n&&this._shouldBeBehindOverlay(e,n)&&i--,!(t>=i)){var o=Math.max(this.currentOverlayZ(),this._minimumZ);for(this._getZ(e)<=o&&this._applyOverlayZ(e,o);t<i;)this._overlays[t]=this._overlays[t+1],t++;this._overlays[i]=e}}}addOrRemoveOverlay(t){t.opened?this.addOverlay(t):this.removeOverlay(t)}addOverlay(t){var e=this._overlays.indexOf(t);if(e>=0)return this._bringOverlayAtIndexToFront(e),void this.trackBackdrop();var i=this._overlays.length,n=this._overlays[i-1],o=Math.max(this._getZ(n),this._minimumZ),s=this._getZ(t);if(n&&this._shouldBeBehindOverlay(t,n)){this._applyOverlayZ(n,o),i--;var r=this._overlays[i-1];o=Math.max(this._getZ(r),this._minimumZ)}s<=o&&this._applyOverlayZ(t,o),this._overlays.splice(i,0,t),this.trackBackdrop()}removeOverlay(t){var e=this._overlays.indexOf(t);-1!==e&&(this._overlays.splice(e,1),this.trackBackdrop())}currentOverlay(){var t=this._overlays.length-1;return this._overlays[t]}currentOverlayZ(){return this._getZ(this.currentOverlay())}ensureMinimumZ(t){this._minimumZ=Math.max(this._minimumZ,t)}focusOverlay(){var t=this.currentOverlay();t&&t._applyFocus()}trackBackdrop(){var t=this._overlayWithBackdrop();(t||this._backdropElement)&&(this.backdropElement.style.zIndex=this._getZ(t)-1,this.backdropElement.opened=!!t,this.backdropElement.prepare())}getBackdrops(){for(var t=[],e=0;e<this._overlays.length;e++)this._overlays[e].withBackdrop&&t.push(this._overlays[e]);return t}backdropZ(){return this._getZ(this._overlayWithBackdrop())-1}_overlayWithBackdrop(){for(var t=this._overlays.length-1;t>=0;t--)if(this._overlays[t].withBackdrop)return this._overlays[t]}_getZ(t){var e=this._minimumZ;if(t){var i=Number(t.style.zIndex||window.getComputedStyle(t).zIndex);i==i&&(e=i)}return e}_setZ(t,e){t.style.zIndex=e}_applyOverlayZ(t,e){this._setZ(t,e+2)}_overlayInPath(t){t=t||[];for(var e=0;e<t.length;e++)if(t[e]._manager===this)return t[e]}_onCaptureClick(t){var e=this._overlays.length-1;if(-1!==e)for(var i,o=(0,n.tT)(t).path;(i=this._overlays[e])&&this._overlayInPath(o)!==i&&(i._onCaptureClick(t),i.allowClickThrough);)e--}_onCaptureFocus(t){var e=this.currentOverlay();e&&e._onCaptureFocus(t)}_onCaptureKeyDown(t){var e=this.currentOverlay();e&&(_.D.keyboardEventMatchesKeys(t,"esc")?e._onCaptureEsc(t):_.D.keyboardEventMatchesKeys(t,"tab")&&e._onCaptureTab(t))}_shouldBeBehindOverlay(t,e){return!t.alwaysOnTop&&e.alwaysOnTop}};var m,v,y={pageX:0,pageY:0},b=null,z=[],T=["wheel","mousewheel","DOMMouseScroll","touchstart","touchmove"];function w(t){A.indexOf(t)>=0||(0===A.length&&function(){m=m||R.bind(void 0);for(var t=0,e=T.length;t<e;t++)document.addEventListener(T[t],m,{capture:!0,passive:!1})}(),A.push(t),v=A[A.length-1],O=[],x=[])}function C(t){var e=A.indexOf(t);-1!==e&&(A.splice(e,1),v=A[A.length-1],O=[],x=[],0===A.length&&function(){for(var t=0,e=T.length;t<e;t++)document.removeEventListener(T[t],m,{capture:!0,passive:!1})}())}const A=[];let O=null,x=null;function R(t){if(t.cancelable&&function(t){var e=(0,n.tT)(t).rootTarget;"touchmove"!==t.type&&b!==e&&(b=e,z=function(t){for(var e=[],i=t.indexOf(v),n=0;n<=i;n++)if(t[n].nodeType===Node.ELEMENT_NODE){var o=t[n],s=o.style;"scroll"!==s.overflow&&"auto"!==s.overflow&&(s=window.getComputedStyle(o)),"scroll"!==s.overflow&&"auto"!==s.overflow||e.push(o)}return e}((0,n.tT)(t).path));if(!z.length)return!0;if("touchstart"===t.type)return!1;var i=function(t){var e={deltaX:t.deltaX,deltaY:t.deltaY};if("deltaX"in t);else if("wheelDeltaX"in t&&"wheelDeltaY"in t)e.deltaX=-t.wheelDeltaX,e.deltaY=-t.wheelDeltaY;else if("wheelDelta"in t)e.deltaX=0,e.deltaY=-t.wheelDelta;else if("axis"in t)e.deltaX=1===t.axis?t.detail:0,e.deltaY=2===t.axis?t.detail:0;else if(t.targetTouches){var i=t.targetTouches[0];e.deltaX=y.pageX-i.pageX,e.deltaY=y.pageY-i.pageY}return e}(t);return!function(t,e,i){if(!e&&!i)return;for(var n=Math.abs(i)>=Math.abs(e),o=0;o<t.length;o++){var s=t[o];if(n?i<0?s.scrollTop>0:s.scrollTop<s.scrollHeight-s.clientHeight:e<0?s.scrollLeft>0:s.scrollLeft<s.scrollWidth-s.clientWidth)return s}}(z,i.deltaX,i.deltaY)}(t)&&t.preventDefault(),t.targetTouches){var e=t.targetTouches[0];y.pageX=e.pageX,y.pageY=e.pageY}}const N={properties:{opened:{observer:"_openedChanged",type:Boolean,value:!1,notify:!0},canceled:{observer:"_canceledChanged",readOnly:!0,type:Boolean,value:!1},withBackdrop:{observer:"_withBackdropChanged",type:Boolean},noAutoFocus:{type:Boolean,value:!1},noCancelOnEscKey:{type:Boolean,value:!1},noCancelOnOutsideClick:{type:Boolean,value:!1},closingReason:{type:Object},restoreFocusOnClose:{type:Boolean,value:!1},allowClickThrough:{type:Boolean},alwaysOnTop:{type:Boolean},scrollAction:{type:String},_manager:{type:Object,value:g},_focusedChild:{type:Object}},listeners:{"iron-resize":"_onIronResize"},observers:["__updateScrollObservers(isAttached, opened, scrollAction)"],get backdropElement(){return this._manager.backdropElement},get _focusNode(){return this._focusedChild||(0,n.tT)(this).querySelector("[autofocus]")||this},get _focusableNodes(){return d.getTabbableNodes(this)},ready:function(){this.__isAnimating=!1,this.__shouldRemoveTabIndex=!1,this.__firstFocusableNode=this.__lastFocusableNode=null,this.__rafs={},this.__restoreFocusNode=null,this.__scrollTop=this.__scrollLeft=null,this.__onCaptureScroll=this.__onCaptureScroll.bind(this),this.__rootNodes=null,this._ensureSetup()},attached:function(){this.opened&&this._openedChanged(this.opened),this._observer=(0,n.tT)(this).observeNodes(this._onNodesChange)},detached:function(){for(var t in this._observer&&(0,n.tT)(this).unobserveNodes(this._observer),this._observer=null,this.__rafs)null!==this.__rafs[t]&&cancelAnimationFrame(this.__rafs[t]);this.__rafs={},this._manager.removeOverlay(this),this.__isAnimating&&(this.opened?this._finishRenderOpened():(this._applyFocus(),this._finishRenderClosed()))},toggle:function(){this._setCanceled(!1),this.opened=!this.opened},open:function(){this._setCanceled(!1),this.opened=!0},close:function(){this._setCanceled(!1),this.opened=!1},cancel:function(t){this.fire("iron-overlay-canceled",t,{cancelable:!0}).defaultPrevented||(this._setCanceled(!0),this.opened=!1)},invalidateTabbables:function(){this.__firstFocusableNode=this.__lastFocusableNode=null},_ensureSetup:function(){this._overlaySetup||(this._overlaySetup=!0,this.style.outline="none",this.style.display="none")},_openedChanged:function(t){t?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true"),this.isAttached&&(this.__isAnimating=!0,this.__deraf("__openedChanged",this.__openedChanged))},_canceledChanged:function(){this.closingReason=this.closingReason||{},this.closingReason.canceled=this.canceled},_withBackdropChanged:function(){this.withBackdrop&&!this.hasAttribute("tabindex")?(this.setAttribute("tabindex","-1"),this.__shouldRemoveTabIndex=!0):this.__shouldRemoveTabIndex&&(this.removeAttribute("tabindex"),this.__shouldRemoveTabIndex=!1),this.opened&&this.isAttached&&this._manager.trackBackdrop()},_prepareRenderOpened:function(){this.__restoreFocusNode=this._manager.deepActiveElement,this._preparePositioning(),this.refit(),this._finishPositioning(),this.noAutoFocus&&document.activeElement===this._focusNode&&(this._focusNode.blur(),this.__restoreFocusNode.focus())},_renderOpened:function(){this._finishRenderOpened()},_renderClosed:function(){this._finishRenderClosed()},_finishRenderOpened:function(){this.notifyResize(),this.__isAnimating=!1,this.fire("iron-overlay-opened")},_finishRenderClosed:function(){this.style.display="none",this.style.zIndex="",this.notifyResize(),this.__isAnimating=!1,this.fire("iron-overlay-closed",this.closingReason)},_preparePositioning:function(){this.style.transition=this.style.webkitTransition="none",this.style.transform=this.style.webkitTransform="none",this.style.display=""},_finishPositioning:function(){this.style.display="none",this.scrollTop=this.scrollTop,this.style.transition=this.style.webkitTransition="",this.style.transform=this.style.webkitTransform="",this.style.display="",this.scrollTop=this.scrollTop},_applyFocus:function(){if(this.opened)this.noAutoFocus||this._focusNode.focus();else{if(this.restoreFocusOnClose&&this.__restoreFocusNode){var t=this._manager.deepActiveElement;(t===document.body||E(this,t))&&this.__restoreFocusNode.focus()}this.__restoreFocusNode=null,this._focusNode.blur(),this._focusedChild=null}},_onCaptureClick:function(t){this.noCancelOnOutsideClick||this.cancel(t)},_onCaptureFocus:function(t){if(this.withBackdrop){var e=(0,n.tT)(t).path;-1===e.indexOf(this)?(t.stopPropagation(),this._applyFocus()):this._focusedChild=e[0]}},_onCaptureEsc:function(t){this.noCancelOnEscKey||this.cancel(t)},_onCaptureTab:function(t){if(this.withBackdrop){this.__ensureFirstLastFocusables();var e=t.shiftKey,i=e?this.__firstFocusableNode:this.__lastFocusableNode,n=e?this.__lastFocusableNode:this.__firstFocusableNode,o=!1;if(i===n)o=!0;else{var s=this._manager.deepActiveElement;o=s===i||s===this}o&&(t.preventDefault(),this._focusedChild=n,this._applyFocus())}},_onIronResize:function(){this.opened&&!this.__isAnimating&&this.__deraf("refit",this.refit)},_onNodesChange:function(){this.opened&&!this.__isAnimating&&(this.invalidateTabbables(),this.notifyResize())},__ensureFirstLastFocusables:function(){var t=this._focusableNodes;this.__firstFocusableNode=t[0],this.__lastFocusableNode=t[t.length-1]},__openedChanged:function(){this.opened?(this._prepareRenderOpened(),this._manager.addOverlay(this),this._applyFocus(),this._renderOpened()):(this._manager.removeOverlay(this),this._applyFocus(),this._renderClosed())},__deraf:function(t,e){var i=this.__rafs;null!==i[t]&&cancelAnimationFrame(i[t]),i[t]=requestAnimationFrame(function(){i[t]=null,e.call(this)}.bind(this))},__updateScrollObservers:function(t,e,i){t&&e&&this.__isValidScrollAction(i)?("lock"===i&&(this.__saveScrollPosition(),w(this)),this.__addScrollListeners()):(C(this),this.__removeScrollListeners())},__addScrollListeners:function(){if(!this.__rootNodes){if(this.__rootNodes=[],r.sv)for(var t=this;t;)t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host&&this.__rootNodes.push(t),t=t.host||t.assignedSlot||t.parentNode;this.__rootNodes.push(document)}this.__rootNodes.forEach(function(t){t.addEventListener("scroll",this.__onCaptureScroll,{capture:!0,passive:!0})},this)},__removeScrollListeners:function(){this.__rootNodes&&this.__rootNodes.forEach(function(t){t.removeEventListener("scroll",this.__onCaptureScroll,{capture:!0,passive:!0})},this),this.isAttached||(this.__rootNodes=null)},__isValidScrollAction:function(t){return"lock"===t||"refit"===t||"cancel"===t},__onCaptureScroll:function(t){if(!(this.__isAnimating||(0,n.tT)(t).path.indexOf(this)>=0))switch(this.scrollAction){case"lock":this.__restoreScrollPosition();break;case"refit":this.__deraf("refit",this.refit);break;case"cancel":this.cancel(t)}},__saveScrollPosition:function(){document.scrollingElement?(this.__scrollTop=document.scrollingElement.scrollTop,this.__scrollLeft=document.scrollingElement.scrollLeft):(this.__scrollTop=Math.max(document.documentElement.scrollTop,document.body.scrollTop),this.__scrollLeft=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft))},__restoreScrollPosition:function(){document.scrollingElement?(document.scrollingElement.scrollTop=this.__scrollTop,document.scrollingElement.scrollLeft=this.__scrollLeft):(document.documentElement.scrollTop=document.body.scrollTop=this.__scrollTop,document.documentElement.scrollLeft=document.body.scrollLeft=this.__scrollLeft)}},I=t=>t.assignedSlot||t.parentNode||t.host,E=(t,e)=>{for(let i=e;i;i=I(i))if(i===t)return!0;return!1},k=[s,l,N]},74396(t,e,i){i.d(e,{L:()=>n});i(69130);const n=[{properties:{animationConfig:{type:Object},entryAnimation:{observer:"_entryAnimationChanged",type:String},exitAnimation:{observer:"_exitAnimationChanged",type:String}},_entryAnimationChanged:function(){this.animationConfig=this.animationConfig||{},this.animationConfig.entry=[{name:this.entryAnimation,node:this}]},_exitAnimationChanged:function(){this.animationConfig=this.animationConfig||{},this.animationConfig.exit=[{name:this.exitAnimation,node:this}]},_copyProperties:function(t,e){for(var i in e)t[i]=e[i]},_cloneConfig:function(t){var e={isClone:!0};return this._copyProperties(e,t),e},_getAnimationConfigRecursive:function(t,e,i){var n;if(this.animationConfig)if(this.animationConfig.value&&"function"==typeof this.animationConfig.value)this._warn(this._logf("playAnimation","Please put 'animationConfig' inside of your components 'properties' object instead of outside of it."));else if(n=t?this.animationConfig[t]:this.animationConfig,Array.isArray(n)||(n=[n]),n)for(var o,s=0;o=n[s];s++)if(o.animatable)o.animatable._getAnimationConfigRecursive(o.type||t,e,i);else if(o.id){var r=e[o.id];r?(r.isClone||(e[o.id]=this._cloneConfig(r),r=e[o.id]),this._copyProperties(r,o)):e[o.id]=o}else i.push(o)},getAnimationConfig:function(t){var e={},i=[];for(var n in this._getAnimationConfigRecursive(t,e,i),e)i.push(e[n]);return i}},{_configureAnimations:function(t){var e=[],i=[];if(t.length>0)for(let e,n=0;e=t[n];n++){let t=document.createElement(e.name);if(t.isNeonAnimation){let n=null;t.configure||(t.configure=function(t){return null}),n=t.configure(e),i.push({result:n,config:e,neonAnimation:t})}else console.warn(this.is+":",e.name,"not found!")}for(var n=0;n<i.length;n++){let t=i[n].result,o=i[n].config,s=i[n].neonAnimation;try{"function"!=typeof t.cancel&&(t=document.timeline.play(t))}catch(e){t=null,console.warn("Couldnt play","(",o.name,").",e)}t&&e.push({neonAnimation:s,config:o,animation:t})}return e},_shouldComplete:function(t){for(var e=!0,i=0;i<t.length;i++)if("finished"!=t[i].animation.playState){e=!1;break}return e},_complete:function(t){for(var e=0;e<t.length;e++)t[e].neonAnimation.complete(t[e].config);for(e=0;e<t.length;e++)t[e].animation.cancel()},playAnimation:function(t,e){var i=this.getAnimationConfig(t);if(i){this._active=this._active||{},this._active[t]&&(this._complete(this._active[t]),delete this._active[t]);var n=this._configureAnimations(i);if(0!=n.length){this._active[t]=n;for(var o=0;o<n.length;o++)n[o].animation.onfinish=function(){this._shouldComplete(n)&&(this._complete(n),delete this._active[t],this.fire("neon-animation-finish",e,{bubbles:!1}))}.bind(this)}else this.fire("neon-animation-finish",e,{bubbles:!1})}},cancelAnimation:function(){for(var t in this._active){var e=this._active[t];for(var i in e)e[i].animation.cancel()}this._active={}}}]}}]);
@@ -0,0 +1,32 @@
1
+ /**
2
+ @license
3
+ Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4
+ This code may only be used under the BSD style license found at
5
+ http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
6
+ http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
7
+ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
8
+ part of the polymer project is also subject to an additional IP rights grant
9
+ found at http://polymer.github.io/PATENTS.txt
10
+ */
11
+
12
+ /**
13
+ @license
14
+ Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
15
+ This code may only be used under the BSD style license found at
16
+ http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
17
+ http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
18
+ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
19
+ part of the polymer project is also subject to an additional IP rights grant
20
+ found at http://polymer.github.io/PATENTS.txt
21
+ */
22
+
23
+ /**
24
+ @license
25
+ Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
26
+ This code may only be used under the BSD style license found at
27
+ http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
28
+ http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
29
+ found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
30
+ part of the polymer project is also subject to an additional IP rights grant
31
+ found at http://polymer.github.io/PATENTS.txt
32
+ */
Binary file