@creaditor/web-starterkit 1.0.41 → 1.0.42

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 (191) hide show
  1. package/dist/112.creaditor.bundle.js.gz +0 -0
  2. package/dist/1142.creaditor.bundle.js.gz +0 -0
  3. package/dist/1204.creaditor.bundle.js.gz +0 -0
  4. package/dist/1271.creaditor.bundle.js.gz +0 -0
  5. package/dist/1317.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  6. package/dist/1317.creaditor.bundle.js.gz +0 -0
  7. package/dist/1334.creaditor.bundle.js.gz +0 -0
  8. package/dist/1396.creaditor.bundle.js.gz +0 -0
  9. package/dist/1403.creaditor.bundle.js.gz +0 -0
  10. package/dist/1456.creaditor.bundle.js.gz +0 -0
  11. package/dist/1529.creaditor.bundle.js.gz +0 -0
  12. package/dist/168.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  13. package/dist/168.creaditor.bundle.js.gz +0 -0
  14. package/dist/170.creaditor.bundle.js.gz +0 -0
  15. package/dist/175.creaditor.bundle.js.gz +0 -0
  16. package/dist/1972.creaditor.bundle.js.gz +0 -0
  17. package/dist/2001.creaditor.bundle.js +16 -16
  18. package/dist/2001.creaditor.bundle.js.gz +0 -0
  19. package/dist/211.creaditor.bundle.js.gz +0 -0
  20. package/dist/2112.creaditor.bundle.js.gz +0 -0
  21. package/dist/2154.creaditor.bundle.js.gz +0 -0
  22. package/dist/2234.creaditor.bundle.js.gz +0 -0
  23. package/dist/2298.creaditor.bundle.js.gz +0 -0
  24. package/dist/235.creaditor.bundle.js.gz +0 -0
  25. package/dist/2350.creaditor.bundle.js.gz +0 -0
  26. package/dist/2377.creaditor.bundle.js.gz +0 -0
  27. package/dist/2384.creaditor.bundle.js.gz +0 -0
  28. package/dist/2397.creaditor.bundle.js.gz +0 -0
  29. package/dist/2409.creaditor.bundle.js.gz +0 -0
  30. package/dist/2547.creaditor.bundle.js.gz +0 -0
  31. package/dist/2550.creaditor.bundle.js.gz +0 -0
  32. package/dist/2590.creaditor.bundle.js.gz +0 -0
  33. package/dist/2682.creaditor.bundle.js +195 -0
  34. package/dist/{7051.creaditor.bundle.js.LICENSE.txt → 2682.creaditor.bundle.js.LICENSE.txt} +0 -6
  35. package/dist/{7051.creaditor.bundle.js.LICENSE.txt.gz → 2682.creaditor.bundle.js.LICENSE.txt.gz} +0 -0
  36. package/dist/2682.creaditor.bundle.js.gz +0 -0
  37. package/dist/2706.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  38. package/dist/2706.creaditor.bundle.js.gz +0 -0
  39. package/dist/271.creaditor.bundle.js.gz +0 -0
  40. package/dist/2717.creaditor.bundle.js.gz +0 -0
  41. package/dist/2765.creaditor.bundle.js.gz +0 -0
  42. package/dist/2773.creaditor.bundle.js.gz +0 -0
  43. package/dist/2833.creaditor.bundle.js.gz +0 -0
  44. package/dist/2837.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  45. package/dist/2837.creaditor.bundle.js.gz +0 -0
  46. package/dist/2956.creaditor.bundle.js.gz +0 -0
  47. package/dist/2963.creaditor.bundle.js.gz +0 -0
  48. package/dist/3105.creaditor.bundle.js.gz +0 -0
  49. package/dist/3233.creaditor.bundle.js.gz +0 -0
  50. package/dist/3418.creaditor.bundle.js.gz +0 -0
  51. package/dist/3521.creaditor.bundle.js.gz +0 -0
  52. package/dist/353.creaditor.bundle.js.gz +0 -0
  53. package/dist/3545.creaditor.bundle.js.gz +0 -0
  54. package/dist/3553.creaditor.bundle.js.gz +0 -0
  55. package/dist/3606.creaditor.bundle.js.gz +0 -0
  56. package/dist/3792.creaditor.bundle.js.gz +0 -0
  57. package/dist/380.creaditor.bundle.js.gz +0 -0
  58. package/dist/3827.creaditor.bundle.js.gz +0 -0
  59. package/dist/3847.creaditor.bundle.js.gz +0 -0
  60. package/dist/3875.creaditor.bundle.js.gz +0 -0
  61. package/dist/3971.creaditor.bundle.js.gz +0 -0
  62. package/dist/4061.creaditor.bundle.js.gz +0 -0
  63. package/dist/407.creaditor.bundle.js.gz +0 -0
  64. package/dist/4074.creaditor.bundle.js.gz +0 -0
  65. package/dist/4100.creaditor.bundle.js.gz +0 -0
  66. package/dist/4109.creaditor.bundle.js.gz +0 -0
  67. package/dist/4114.creaditor.bundle.js.gz +0 -0
  68. package/dist/4161.creaditor.bundle.js.gz +0 -0
  69. package/dist/4186.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  70. package/dist/4186.creaditor.bundle.js.gz +0 -0
  71. package/dist/4288.creaditor.bundle.js.gz +0 -0
  72. package/dist/4413.creaditor.bundle.js.gz +0 -0
  73. package/dist/4475.creaditor.bundle.js.gz +0 -0
  74. package/dist/453.creaditor.bundle.js.gz +0 -0
  75. package/dist/4615.creaditor.bundle.js.gz +0 -0
  76. package/dist/4639.creaditor.bundle.js.gz +0 -0
  77. package/dist/467.creaditor.bundle.js.gz +0 -0
  78. package/dist/4762.creaditor.bundle.js.gz +0 -0
  79. package/dist/4770.creaditor.bundle.js.gz +0 -0
  80. package/dist/4819.creaditor.bundle.js +235 -198
  81. package/dist/4819.creaditor.bundle.js.gz +0 -0
  82. package/dist/4947.creaditor.bundle.js.gz +0 -0
  83. package/dist/4987.creaditor.bundle.js.gz +0 -0
  84. package/dist/4988.creaditor.bundle.js.gz +0 -0
  85. package/dist/5119.creaditor.bundle.js.gz +0 -0
  86. package/dist/5133.creaditor.bundle.js.gz +0 -0
  87. package/dist/5156.creaditor.bundle.js.gz +0 -0
  88. package/dist/5284.creaditor.bundle.js.gz +0 -0
  89. package/dist/5379.creaditor.bundle.js.gz +0 -0
  90. package/dist/5391.creaditor.bundle.js.gz +0 -0
  91. package/dist/5411.creaditor.bundle.js.gz +0 -0
  92. package/dist/5501.creaditor.bundle.js.gz +0 -0
  93. package/dist/5530.creaditor.bundle.js.gz +0 -0
  94. package/dist/5666.creaditor.bundle.js.gz +0 -0
  95. package/dist/567.creaditor.bundle.js.gz +0 -0
  96. package/dist/5713.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  97. package/dist/5713.creaditor.bundle.js.gz +0 -0
  98. package/dist/574.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  99. package/dist/574.creaditor.bundle.js.gz +0 -0
  100. package/dist/578.creaditor.bundle.js.gz +0 -0
  101. package/dist/5791.creaditor.bundle.js.gz +0 -0
  102. package/dist/5839.creaditor.bundle.js.gz +0 -0
  103. package/dist/5849.creaditor.bundle.js.gz +0 -0
  104. package/dist/5850.creaditor.bundle.js.gz +0 -0
  105. package/dist/5884.creaditor.bundle.js.gz +0 -0
  106. package/dist/59.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  107. package/dist/59.creaditor.bundle.js.gz +0 -0
  108. package/dist/5909.creaditor.bundle.js.gz +0 -0
  109. package/dist/5926.creaditor.bundle.js.gz +0 -0
  110. package/dist/6036.creaditor.bundle.js.gz +0 -0
  111. package/dist/6216.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  112. package/dist/6216.creaditor.bundle.js.gz +0 -0
  113. package/dist/638.creaditor.bundle.js.gz +0 -0
  114. package/dist/6442.creaditor.bundle.js.gz +0 -0
  115. package/dist/6496.creaditor.bundle.js.gz +0 -0
  116. package/dist/653.creaditor.bundle.js.gz +0 -0
  117. package/dist/6751.creaditor.bundle.js.gz +0 -0
  118. package/dist/6814.creaditor.bundle.js.gz +0 -0
  119. package/dist/6937.creaditor.bundle.js.gz +0 -0
  120. package/dist/7055.creaditor.bundle.js.gz +0 -0
  121. package/dist/715.creaditor.bundle.js +4 -4
  122. package/dist/715.creaditor.bundle.js.gz +0 -0
  123. package/dist/7155.creaditor.bundle.js.gz +0 -0
  124. package/dist/7209.creaditor.bundle.js.gz +0 -0
  125. package/dist/7238.creaditor.bundle.js.gz +0 -0
  126. package/dist/7255.creaditor.bundle.js.gz +0 -0
  127. package/dist/738.creaditor.bundle.js.gz +0 -0
  128. package/dist/7380.creaditor.bundle.js.gz +0 -0
  129. package/dist/7463.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  130. package/dist/7463.creaditor.bundle.js.gz +0 -0
  131. package/dist/7466.creaditor.bundle.js.gz +0 -0
  132. package/dist/752.creaditor.bundle.js.gz +0 -0
  133. package/dist/7523.creaditor.bundle.js.gz +0 -0
  134. package/dist/7564.creaditor.bundle.js.gz +0 -0
  135. package/dist/7654.creaditor.bundle.js.gz +0 -0
  136. package/dist/767.creaditor.bundle.js.gz +0 -0
  137. package/dist/7789.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  138. package/dist/7789.creaditor.bundle.js.gz +0 -0
  139. package/dist/7838.creaditor.bundle.js.gz +0 -0
  140. package/dist/7918.creaditor.bundle.js.gz +0 -0
  141. package/dist/7937.creaditor.bundle.js.gz +0 -0
  142. package/dist/7997.creaditor.bundle.js.gz +0 -0
  143. package/dist/8042.creaditor.bundle.js.gz +0 -0
  144. package/dist/8064.creaditor.bundle.js.gz +0 -0
  145. package/dist/8141.creaditor.bundle.js.gz +0 -0
  146. package/dist/8173.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  147. package/dist/8173.creaditor.bundle.js.gz +0 -0
  148. package/dist/8196.creaditor.bundle.js.gz +0 -0
  149. package/dist/823.creaditor.bundle.js.gz +0 -0
  150. package/dist/8250.creaditor.bundle.js.gz +0 -0
  151. package/dist/8251.creaditor.bundle.js.gz +0 -0
  152. package/dist/8299.creaditor.bundle.js.gz +0 -0
  153. package/dist/8315.creaditor.bundle.js.gz +0 -0
  154. package/dist/8443.creaditor.bundle.js.gz +0 -0
  155. package/dist/8516.creaditor.bundle.js.gz +0 -0
  156. package/dist/8533.creaditor.bundle.js.gz +0 -0
  157. package/dist/8547.creaditor.bundle.js.gz +0 -0
  158. package/dist/8570.creaditor.bundle.js.gz +0 -0
  159. package/dist/8646.creaditor.bundle.js.gz +0 -0
  160. package/dist/8654.creaditor.bundle.js.gz +0 -0
  161. package/dist/8854.creaditor.bundle.js.gz +0 -0
  162. package/dist/8878.creaditor.bundle.js.gz +0 -0
  163. package/dist/8916.creaditor.bundle.js.gz +0 -0
  164. package/dist/8921.creaditor.bundle.js.gz +0 -0
  165. package/dist/898.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  166. package/dist/898.creaditor.bundle.js.gz +0 -0
  167. package/dist/8983.creaditor.bundle.js.gz +0 -0
  168. package/dist/9041.creaditor.bundle.js.gz +0 -0
  169. package/dist/9158.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  170. package/dist/9158.creaditor.bundle.js.gz +0 -0
  171. package/dist/9250.creaditor.bundle.js.gz +0 -0
  172. package/dist/9386.creaditor.bundle.js.gz +0 -0
  173. package/dist/9431.creaditor.bundle.js.gz +0 -0
  174. package/dist/9453.creaditor.bundle.js.gz +0 -0
  175. package/dist/9570.creaditor.bundle.js.gz +0 -0
  176. package/dist/9694.creaditor.bundle.js.gz +0 -0
  177. package/dist/975.creaditor.bundle.js.gz +0 -0
  178. package/dist/976.creaditor.bundle.js.gz +0 -0
  179. package/dist/9986.creaditor.bundle.js.gz +0 -0
  180. package/dist/9990.creaditor.bundle.js.gz +0 -0
  181. package/dist/9994.creaditor.bundle.js.gz +0 -0
  182. package/dist/creaditor.bundle.js +3 -3
  183. package/dist/creaditor.bundle.js.LICENSE.txt.gz +0 -0
  184. package/dist/creaditor.bundle.js.gz +0 -0
  185. package/dist/index.html.gz +0 -0
  186. package/dist/service-worker.js +1 -1
  187. package/dist/service-worker.js.gz +0 -0
  188. package/dist/workbox-f3063069.js.gz +0 -0
  189. package/package.json +1 -1
  190. package/dist/7051.creaditor.bundle.js +0 -162
  191. package/dist/7051.creaditor.bundle.js.gz +0 -0
@@ -3928,7 +3928,7 @@
3928
3928
  }
3929
3929
  `],customElements.define("cdtr-html-import-panel",Ct);const Et=t=>(0,n.A)("cdtr-col",(0,b.A)({},t,{fitContent:!0}),(0,n.A)("aside",{className:(0,x.A)(E.root,"cdtr-plugin","no-select")},(0,n.A)("div",{className:E.inner},(0,n.A)("cdtr-sidebar-content-switcher",null,(0,n.A)("div",{slot:"main",style:{display:"flex",flexDirection:"column",height:"100%"}},(0,n.A)("div",{style:{display:"flex",alignItems:"center",gap:"2px",padding:"5px 6px 5px 12px",borderBottom:"1px solid #e9e9e9",minHeight:"47px"}},(0,n.A)("cdtr-breadcrumbs",{mainText:!0,style:{flex:1,minWidth:0,padding:0,border:"none",overflow:"hidden"}}),(0,n.A)("cdtr-sidebar-menu",null),(0,n.A)("button",{tabindex:"0","aria-label":"Collapse panel",onClick:()=>{L.A.dispatch("toggle-side-menu",{opened:!1})},className:E.toggleMenu},(0,n.A)("img",{width:"20",height:"20",alt:"",style:{display:"block"},src:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 6 15 12 9 18'/%3E%3C/svg%3E"}))),(0,n.A)("design-factory",{style:{overflow:"auto",flex:1,position:"relative"}}))),(0,n.A)("cdtr-mcp-connection-panel",null),(0,n.A)("cdtr-html-import-panel",null)),(0,n.A)(v,{style:{position:"absolute",bottom:"-15px",borderTop:"1px solid #dbdbdb"}})));var St=a(79323),Mt={};Mt.setAttributes=p(),Mt.insert=c().bind(null,"head"),Mt.domAPI=s(),Mt.insertStyleElement=u();o()(St.A,Mt);const Bt=St.A&&St.A.locals?St.A.locals:void 0;var Tt,Lt=a(94471),It=a.n(Lt),Ot=a(53871),Ht=a.n(Ot),Nt=a(30072),Rt=a.n(Nt),zt=a(19901),Pt=a.n(zt),$t=[],Dt=function(){return $t.some(function(t){return t.activeTargets.length>0})},jt="ResizeObserver loop completed with undelivered notifications.";!function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"}(Tt||(Tt={}));var Ft,Ut=function(t){return Object.freeze(t)},qt=function(t,e){this.inlineSize=t,this.blockSize=e,Ut(this)},Wt=function(){function t(t,e,n,r){return this.x=t,this.y=e,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Ut(this)}return t.prototype.toJSON=function(){var t=this;return{x:t.x,y:t.y,top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Vt=function(t){return t instanceof SVGElement&&"getBBox"in t},Yt=function(t){if(Vt(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var o=t,i=o.offsetWidth,a=o.offsetHeight;return!(i||a||t.getClientRects().length)},Xt=function(t){var e;if(t instanceof Element)return!0;var n=null===(e=null==t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},Zt="undefined"!=typeof window?window:{},Jt=new WeakMap,Kt=/auto|scroll/,Gt=/^tb|vertical/,Qt=/msie|trident/i.test(Zt.navigator&&Zt.navigator.userAgent),te=function(t){return parseFloat(t||"0")},ee=function(t,e,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=!1),new qt((n?e:t)||0,(n?t:e)||0)},ne=Ut({devicePixelContentBoxSize:ee(),borderBoxSize:ee(),contentBoxSize:ee(),contentRect:new Wt(0,0,0,0)}),re=function(t,e){if(void 0===e&&(e=!1),Jt.has(t)&&!e)return Jt.get(t);if(Yt(t))return Jt.set(t,ne),ne;var n=getComputedStyle(t),r=Vt(t)&&t.ownerSVGElement&&t.getBBox(),o=!Qt&&"border-box"===n.boxSizing,i=Gt.test(n.writingMode||""),a=!r&&Kt.test(n.overflowY||""),s=!r&&Kt.test(n.overflowX||""),l=r?0:te(n.paddingTop),c=r?0:te(n.paddingRight),d=r?0:te(n.paddingBottom),p=r?0:te(n.paddingLeft),h=r?0:te(n.borderTopWidth),u=r?0:te(n.borderRightWidth),f=r?0:te(n.borderBottomWidth),m=p+c,g=l+d,b=(r?0:te(n.borderLeftWidth))+u,y=h+f,w=s?t.offsetHeight-y-t.clientHeight:0,_=a?t.offsetWidth-b-t.clientWidth:0,A=o?m+b:0,x=o?g+y:0,v=r?r.width:te(n.width)-A-_,k=r?r.height:te(n.height)-x-w,C=v+m+_+b,E=k+g+w+y,S=Ut({devicePixelContentBoxSize:ee(Math.round(v*devicePixelRatio),Math.round(k*devicePixelRatio),i),borderBoxSize:ee(C,E,i),contentBoxSize:ee(v,k,i),contentRect:new Wt(p,l,v,k)});return Jt.set(t,S),S},oe=function(t,e,n){var r=re(t,n),o=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case Tt.DEVICE_PIXEL_CONTENT_BOX:return a;case Tt.BORDER_BOX:return o;default:return i}},ie=function(t){var e=re(t);this.target=t,this.contentRect=e.contentRect,this.borderBoxSize=Ut([e.borderBoxSize]),this.contentBoxSize=Ut([e.contentBoxSize]),this.devicePixelContentBoxSize=Ut([e.devicePixelContentBoxSize])},ae=function(t){if(Yt(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},se=function(){var t=1/0,e=[];$t.forEach(function(n){if(0!==n.activeTargets.length){var r=[];n.activeTargets.forEach(function(e){var n=new ie(e.target),o=ae(e.target);r.push(n),e.lastReportedSize=oe(e.target,e.observedBox),o<t&&(t=o)}),e.push(function(){n.callback.call(n.observer,r,n.observer)}),n.activeTargets.splice(0,n.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){(0,r[n])()}return t},le=function(t){$t.forEach(function(e){e.activeTargets.splice(0,e.activeTargets.length),e.skippedTargets.splice(0,e.skippedTargets.length),e.observationTargets.forEach(function(n){n.isActive()&&(ae(n.target)>t?e.activeTargets.push(n):e.skippedTargets.push(n))})})},ce=function(){var t,e=0;for(le(e);Dt();)e=se(),le(e);return $t.some(function(t){return t.skippedTargets.length>0})&&("function"==typeof ErrorEvent?t=new ErrorEvent("error",{message:jt}):((t=document.createEvent("Event")).initEvent("error",!1,!1),t.message=jt),window.dispatchEvent(t)),e>0},de=[],pe=function(t){if(!Ft){var e=0,n=document.createTextNode("");new MutationObserver(function(){return de.splice(0).forEach(function(t){return t()})}).observe(n,{characterData:!0}),Ft=function(){n.textContent="".concat(e?e--:e++)}}de.push(t),Ft()},he=0,ue={attributes:!0,characterData:!0,childList:!0,subtree:!0},fe=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],me=function(t){return void 0===t&&(t=0),Date.now()+t},ge=!1,be=new(function(){function t(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return t.prototype.run=function(t){var e=this;if(void 0===t&&(t=250),!ge){ge=!0;var n,r=me(t);n=function(){var n=!1;try{n=ce()}finally{if(ge=!1,t=r-me(),!he)return;n?e.run(1e3):t>0?e.run(t):e.start()}},pe(function(){requestAnimationFrame(n)})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var t=this,e=function(){return t.observer&&t.observer.observe(document.body,ue)};document.body?e():Zt.addEventListener("DOMContentLoaded",e)},t.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),fe.forEach(function(e){return Zt.addEventListener(e,t.listener,!0)}))},t.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),fe.forEach(function(e){return Zt.removeEventListener(e,t.listener,!0)}),this.stopped=!0)},t}()),ye=function(t){!he&&t>0&&be.start(),!(he+=t)&&be.stop()},we=function(){function t(t,e){this.target=t,this.observedBox=e||Tt.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var t,e=oe(this.target,this.observedBox,!0);return t=this.target,Vt(t)||function(t){switch(t.tagName){case"INPUT":if("image"!==t.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(t)||"inline"!==getComputedStyle(t).display||(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),_e=function(t,e){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=e},Ae=new WeakMap,xe=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},ve=function(){function t(){}return t.connect=function(t,e){var n=new _e(t,e);Ae.set(t,n)},t.observe=function(t,e,n){var r=Ae.get(t),o=0===r.observationTargets.length;xe(r.observationTargets,e)<0&&(o&&$t.push(r),r.observationTargets.push(new we(e,n&&n.box)),ye(1),be.schedule())},t.unobserve=function(t,e){var n=Ae.get(t),r=xe(n.observationTargets,e),o=1===n.observationTargets.length;r>=0&&(o&&$t.splice($t.indexOf(n),1),n.observationTargets.splice(r,1),ye(-1))},t.disconnect=function(t){var e=this,n=Ae.get(t);n.observationTargets.slice().forEach(function(n){return e.unobserve(t,n.target)}),n.activeTargets.splice(0,n.activeTargets.length)},t}(),ke=function(){function t(t){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof t)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");ve.connect(this,t)}return t.prototype.observe=function(t,e){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Xt(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ve.observe(this,t,e)},t.prototype.unobserve=function(t){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Xt(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ve.unobserve(this,t)},t.prototype.disconnect=function(){ve.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();const Ce=function(t){const e=Array.prototype.reduce.call(t,(t,e)=>{const n=e.name.match(/data-amazingbar-(.+)/);if(n){const r=n[1].replace(/\W+(.)/g,(t,e)=>e.toUpperCase());switch(e.value){case"true":t[r]=!0;break;case"false":t[r]=!1;break;case void 0:t[r]=!0;break;default:t[r]=e.value}}return t},{});return e};function Ee(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView:window}function Se(t){return t&&t.ownerDocument?t.ownerDocument:document}let Me=null,Be=null;function Te(t){if(null===Me){const e=Se(t);if(void 0===e)return Me=0,Me;const n=e.body,r=e.createElement("div");r.classList.add("amazingbar-hide-scrollbar"),n.appendChild(r);const o=r.getBoundingClientRect().right;n.removeChild(r),Me=o}return Me}It()&&window.addEventListener("resize",()=>{Be!==window.devicePixelRatio&&(Be=window.devicePixelRatio,Me=null)});class Le{constructor(t,e){this.onScroll=t=>{const e=Ee(this.el);this.scrollXTicking||(e.requestAnimationFrame(this.scrollX),this.scrollXTicking=!0),this.scrollYTicking||(e.requestAnimationFrame(this.scrollY),this.scrollYTicking=!0),"function"==typeof this.options.onScroll&&this.options.onScroll(t);t=new Event("scroll");document.body.dispatchEvent(t)},this.scrollX=()=>{this.axis.x.isOverflowing&&(this.showScrollbar("x"),this.positionScrollbar("x")),this.scrollXTicking=!1},this.scrollY=()=>{this.axis.y.isOverflowing&&(this.showScrollbar("y"),this.positionScrollbar("y")),this.scrollYTicking=!1},this.onMouseEnter=()=>{this.showScrollbar("x"),this.showScrollbar("y")},this.onMouseMove=t=>{this.mouseX=t.clientX,this.mouseY=t.clientY,(this.axis.x.isOverflowing||this.axis.x.forceVisible)&&this.onMouseMoveForAxis("x"),(this.axis.y.isOverflowing||this.axis.y.forceVisible)&&this.onMouseMoveForAxis("y")},this.onMouseLeave=()=>{this.onMouseMove.cancel(),(this.axis.x.isOverflowing||this.axis.x.forceVisible)&&this.onMouseLeaveForAxis("x"),(this.axis.y.isOverflowing||this.axis.y.forceVisible)&&this.onMouseLeaveForAxis("y"),this.mouseX=-1,this.mouseY=-1},this.onWindowResize=()=>{this.scrollbarWidth=this.getScrollbarWidth(),this.hideNativeScrollbar()},this.hideScrollbars=()=>{this.axis.x.track.rect=this.axis.x.track.el.getBoundingClientRect(),this.axis.y.track.rect=this.axis.y.track.el.getBoundingClientRect(),this.isWithinBounds(this.axis.y.track.rect)||(this.axis.y.scrollbar.el.classList.remove(this.classNames.visible),this.axis.y.isVisible=!1),this.isWithinBounds(this.axis.x.track.rect)||(this.axis.x.scrollbar.el.classList.remove(this.classNames.visible),this.axis.x.isVisible=!1)},this.onPointerEvent=t=>{let e,n;this.axis.x.track.rect=this.axis.x.track.el.getBoundingClientRect(),this.axis.y.track.rect=this.axis.y.track.el.getBoundingClientRect(),(this.axis.x.isOverflowing||this.axis.x.forceVisible)&&(e=this.isWithinBounds(this.axis.x.track.rect)),(this.axis.y.isOverflowing||this.axis.y.forceVisible)&&(n=this.isWithinBounds(this.axis.y.track.rect)),(e||n)&&(t.preventDefault(),t.stopPropagation(),"mousedown"===t.type&&(e&&(this.axis.x.scrollbar.rect=this.axis.x.scrollbar.el.getBoundingClientRect(),this.isWithinBounds(this.axis.x.scrollbar.rect)?this.onDragStart(t,"x"):this.onTrackClick(t,"x")),n&&(this.axis.y.scrollbar.rect=this.axis.y.scrollbar.el.getBoundingClientRect(),this.isWithinBounds(this.axis.y.scrollbar.rect)?this.onDragStart(t,"y"):this.onTrackClick(t,"y"))))},this.drag=t=>{let e;const n=this.axis[this.draggedAxis].track,r=n.rect[this.axis[this.draggedAxis].sizeAttr],o=this.axis[this.draggedAxis].scrollbar,i=this.contentWrapperEl[this.axis[this.draggedAxis].scrollSizeAttr],a=parseInt(this.elStyles[this.axis[this.draggedAxis].sizeAttr],10);t.preventDefault(),t.stopPropagation(),e="y"===this.draggedAxis?t.pageY:t.pageX;let s=(e-n.rect[this.axis[this.draggedAxis].offsetAttr]-this.axis[this.draggedAxis].dragOffset)/(r-o.size)*(i-a);"x"===this.draggedAxis&&(s=this.isRtl&&Le.getRtlHelpers().isRtlScrollbarInverted?s-(r+o.size):s,s=this.isRtl&&Le.getRtlHelpers().isRtlScrollingInverted?-s:s),this.contentWrapperEl[this.axis[this.draggedAxis].scrollOffsetAttr]=s},this.onEndDrag=t=>{const e=Se(this.el),n=Ee(this.el);t.preventDefault(),t.stopPropagation(),this.el.classList.remove(this.classNames.dragging),e.removeEventListener("mousemove",this.drag,!0),e.removeEventListener("mouseup",this.onEndDrag,!0),this.removePreventClickId=n.setTimeout(()=>{e.removeEventListener("click",this.preventClick,!0),e.removeEventListener("dblclick",this.preventClick,!0),this.removePreventClickId=null})},this.preventClick=t=>{t.preventDefault(),t.stopPropagation()},this.el=t,this.minScrollbarWidth=20,this.options={...Le.defaultOptions,...e},this.classNames={...Le.defaultOptions.classNames,...this.options.classNames},this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,Le.instances.has(this.el)||(this.recalculate=Ht()(this.recalculate.bind(this),64),this.onMouseMove=Ht()(this.onMouseMove.bind(this),64),this.hideScrollbars=Rt()(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=Rt()(this.onWindowResize.bind(this),64,{leading:!0}),Le.getRtlHelpers=Pt()(Le.getRtlHelpers),this.init())}static getRtlHelpers(){const t=document.createElement("div");t.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>';const e=t.firstElementChild;document.body.appendChild(e);const n=e.firstElementChild;e.scrollLeft=0;const r=Le.getOffset(e),o=Le.getOffset(n);e.scrollLeft=999;const i=Le.getOffset(n);return{isRtlScrollingInverted:r.left!==o.left&&o.left-i.left!==0,isRtlScrollbarInverted:r.left!==o.left}}static getOffset(t){const e=t.getBoundingClientRect(),n=Se(t),r=Ee(t);return{top:e.top+(r.pageYOffset||n.documentElement.scrollTop),left:e.left+(r.pageXOffset||n.documentElement.scrollLeft)}}init(){Le.instances.set(this.el,this),It()&&(this.initDOM(),this.setAccessibilityAttributes(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())}initDOM(){if(Array.prototype.filter.call(this.el.children,t=>t.classList.contains(this.classNames.wrapper)).length)this.wrapperEl=this.el.querySelector(`.${this.classNames.wrapper}`),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector(`.${this.classNames.contentWrapper}`),this.contentEl=this.options.contentNode||this.el.querySelector(`.${this.classNames.contentEl}`),this.offsetEl=this.el.querySelector(`.${this.classNames.offset}`),this.maskEl=this.el.querySelector(`.${this.classNames.mask}`),this.placeholderEl=this.findChild(this.wrapperEl,`.${this.classNames.placeholder}`),this.heightAutoObserverWrapperEl=this.el.querySelector(`.${this.classNames.heightAutoObserverWrapperEl}`),this.heightAutoObserverEl=this.el.querySelector(`.${this.classNames.heightAutoObserverEl}`),this.axis.x.track.el=this.findChild(this.el,`.${this.classNames.track}.${this.classNames.horizontal}`),this.axis.y.track.el=this.findChild(this.el,`.${this.classNames.track}.${this.classNames.vertical}`);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl),this.offsetEl.appendChild(this.contentWrapperEl),this.maskEl.appendChild(this.offsetEl),this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl),this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl),this.wrapperEl.appendChild(this.maskEl),this.wrapperEl.appendChild(this.placeholderEl),this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){const t=document.createElement("div"),e=document.createElement("div");t.classList.add(this.classNames.track),e.classList.add(this.classNames.scrollbar),t.appendChild(e),this.axis.x.track.el=t.cloneNode(!0),this.axis.x.track.el.classList.add(this.classNames.horizontal),this.axis.y.track.el=t.cloneNode(!0),this.axis.y.track.el.classList.add(this.classNames.vertical),this.el.appendChild(this.axis.x.track.el),this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector(`.${this.classNames.scrollbar}`),this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector(`.${this.classNames.scrollbar}`),this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible)),this.el.setAttribute("data-amazingbar","init")}setAccessibilityAttributes(){const t=this.options.ariaLabel||"scrollable content";this.contentWrapperEl.setAttribute("tabindex","0"),this.contentWrapperEl.setAttribute("role","region"),this.contentWrapperEl.setAttribute("aria-label",t)}initListeners(){const t=Ee(this.el);this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(t=>{this.el.addEventListener(t,this.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(t=>{this.el.addEventListener(t,this.onPointerEvent,{capture:!0,passive:!0})}),this.el.addEventListener("mousemove",this.onMouseMove),this.el.addEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl.addEventListener("scroll",this.onScroll),t.addEventListener("resize",this.onWindowResize);let e=!1;const n=t.ResizeObserver||ke;this.resizeObserver=new n(()=>{e&&this.recalculate()}),this.resizeObserver.observe(this.el),this.resizeObserver.observe(this.contentEl),t.requestAnimationFrame(()=>{e=!0}),this.mutationObserver=new t.MutationObserver(this.recalculate),this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})}recalculate(){const t=Ee(this.el);this.elStyles=t.getComputedStyle(this.el),this.isRtl="rtl"===this.elStyles.direction;const e=this.heightAutoObserverEl.offsetHeight<=1,n=this.heightAutoObserverEl.offsetWidth<=1,r=this.contentEl.offsetWidth,o=this.contentWrapperEl.offsetWidth,i=this.elStyles.overflowX,a=this.elStyles.overflowY;this.contentEl.style.padding=`${this.elStyles.paddingTop} ${this.elStyles.paddingRight} ${this.elStyles.paddingBottom} ${this.elStyles.paddingLeft}`,this.wrapperEl.style.margin=`-${this.elStyles.paddingTop} -${this.elStyles.paddingRight} -${this.elStyles.paddingBottom} -${this.elStyles.paddingLeft}`;const s=this.contentEl.scrollHeight,l=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=e?"auto":"100%",this.placeholderEl.style.width=n?`${r}px`:"auto",this.placeholderEl.style.height=`${s}px`;const c=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=l>r,this.axis.y.isOverflowing=s>c,this.axis.x.isOverflowing="hidden"!==i&&this.axis.x.isOverflowing,this.axis.y.isOverflowing="hidden"!==a&&this.axis.y.isOverflowing,this.axis.x.forceVisible="x"===this.options.forceVisible||!0===this.options.forceVisible,this.axis.y.forceVisible="y"===this.options.forceVisible||!0===this.options.forceVisible,this.hideNativeScrollbar();let d=this.axis.x.isOverflowing?this.scrollbarWidth:0,p=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&l>o-p,this.axis.y.isOverflowing=this.axis.y.isOverflowing&&s>c-d,this.axis.x.scrollbar.size=this.getScrollbarSize("x"),this.axis.y.scrollbar.size=this.getScrollbarSize("y"),this.axis.x.scrollbar.el.style.width=`${this.axis.x.scrollbar.size}px`,this.axis.y.scrollbar.el.style.height=`${this.axis.y.scrollbar.size}px`,this.positionScrollbar("x"),this.positionScrollbar("y"),this.toggleTrackVisibility("x"),this.toggleTrackVisibility("y")}getScrollbarSize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y";if(!this.axis[t].isOverflowing)return 0;const e=this.contentEl[this.axis[t].scrollSizeAttr],n=this.axis[t].track.el[this.axis[t].offsetSizeAttr];let r,o=n/e;return r=Math.max(~~(o*n),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(r=Math.min(r,this.options.scrollbarMaxSize)),r}positionScrollbar(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y";if(!this.axis[t].isOverflowing)return;const e=this.contentWrapperEl[this.axis[t].scrollSizeAttr],n=this.axis[t].track.el[this.axis[t].offsetSizeAttr],r=parseInt(this.elStyles[this.axis[t].sizeAttr],10),o=this.axis[t].scrollbar;let i=this.contentWrapperEl[this.axis[t].scrollOffsetAttr];i="x"===t&&this.isRtl&&Le.getRtlHelpers().isRtlScrollingInverted?-i:i;let a=i/(e-r),s=~~((n-o.size)*a);s="x"===t&&this.isRtl&&Le.getRtlHelpers().isRtlScrollbarInverted?s+(n-o.size):s,o.el.style.transform="x"===t?`translate3d(${s}px, 0, 0)`:`translate3d(0, ${s}px, 0)`}toggleTrackVisibility(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y";const e=this.axis[t].track.el,n=this.axis[t].scrollbar.el;this.axis[t].isOverflowing||this.axis[t].forceVisible?(e.style.visibility="visible",this.contentWrapperEl.style[this.axis[t].overflowAttr]="scroll"):(e.style.visibility="hidden",this.contentWrapperEl.style[this.axis[t].overflowAttr]="hidden"),this.axis[t].isOverflowing?n.style.display="block":n.style.display="none"}hideNativeScrollbar(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?`-${this.scrollbarWidth}px`:0,this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?`-${this.scrollbarWidth}px`:0}onMouseMoveForAxis(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y";this.axis[t].track.rect=this.axis[t].track.el.getBoundingClientRect(),this.axis[t].scrollbar.rect=this.axis[t].scrollbar.el.getBoundingClientRect();this.isWithinBounds(this.axis[t].scrollbar.rect)?this.axis[t].scrollbar.el.classList.add(this.classNames.hover):this.axis[t].scrollbar.el.classList.remove(this.classNames.hover),this.isWithinBounds(this.axis[t].track.rect)?(this.showScrollbar(t),this.axis[t].track.el.classList.add(this.classNames.hover)):this.axis[t].track.el.classList.remove(this.classNames.hover)}onMouseLeaveForAxis(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y";this.axis[t].track.el.classList.remove(this.classNames.hover),this.axis[t].scrollbar.el.classList.remove(this.classNames.hover)}showScrollbar(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"y",e=this.axis[t].scrollbar.el;this.axis[t].isVisible||(e.classList.add(this.classNames.visible),this.axis[t].isVisible=!0),this.options.autoHide&&this.hideScrollbars()}onDragStart(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y";const n=Se(this.el),r=Ee(this.el),o=this.axis[e].scrollbar,i="y"===e?t.pageY:t.pageX;this.axis[e].dragOffset=i-o.rect[this.axis[e].offsetAttr],this.draggedAxis=e,this.el.classList.add(this.classNames.dragging),n.addEventListener("mousemove",this.drag,!0),n.addEventListener("mouseup",this.onEndDrag,!0),null===this.removePreventClickId?(n.addEventListener("click",this.preventClick,!0),n.addEventListener("dblclick",this.preventClick,!0)):(r.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)}onTrackClick(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y";if(!this.options.clickOnTrack)return;const n=Ee(this.el);this.axis[e].scrollbar.rect=this.axis[e].scrollbar.el.getBoundingClientRect();const r=this.axis[e].scrollbar.rect[this.axis[e].offsetAttr],o=parseInt(this.elStyles[this.axis[e].sizeAttr],10);let i=this.contentWrapperEl[this.axis[e].scrollOffsetAttr];const a=("y"===e?this.mouseY-r:this.mouseX-r)<0?-1:1,s=-1===a?i-o:i+o,l=()=>{-1===a?i>s&&(i-=this.options.clickOnTrackSpeed,this.contentWrapperEl.scrollTo({[this.axis[e].offsetAttr]:i}),n.requestAnimationFrame(l)):i<s&&(i+=this.options.clickOnTrackSpeed,this.contentWrapperEl.scrollTo({[this.axis[e].offsetAttr]:i}),n.requestAnimationFrame(l))};l()}getContentElement(){return this.contentEl}getScrollElement(){return this.contentWrapperEl}getScrollbarWidth(){try{return"none"===getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display||"scrollbarWidth"in document.documentElement.style||"-ms-overflow-style"in document.documentElement.style?0:Te(this.el)}catch(t){return Te(this.el)}}removeListeners(){const t=Ee(this.el);this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter),["mousedown","click","dblclick"].forEach(t=>{this.el.removeEventListener(t,this.onPointerEvent,!0)}),["touchstart","touchend","touchmove"].forEach(t=>{this.el.removeEventListener(t,this.onPointerEvent,{capture:!0,passive:!0})}),this.el.removeEventListener("mousemove",this.onMouseMove),this.el.removeEventListener("mouseleave",this.onMouseLeave),this.contentWrapperEl&&this.contentWrapperEl.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onWindowResize),this.mutationObserver&&this.mutationObserver.disconnect(),this.resizeObserver&&this.resizeObserver.disconnect(),this.recalculate.cancel(),this.onMouseMove.cancel(),this.hideScrollbars.cancel(),this.onWindowResize.cancel()}unMount(){this.removeListeners(),Le.instances.delete(this.el)}isWithinBounds(t){return this.mouseX>=t.left&&this.mouseX<=t.left+t.width&&this.mouseY>=t.top&&this.mouseY<=t.top+t.height}findChild(t,e){const n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector;return Array.prototype.filter.call(t.children,t=>n.call(t,e))[0]}}Le.defaultOptions={autoHide:!0,forceVisible:!1,clickOnTrack:!0,clickOnTrackSpeed:40,classNames:{contentEl:"amazingbar-content",contentWrapper:"amazingbar-content-wrapper",offset:"amazingbar-offset",mask:"amazingbar-mask",wrapper:"amazingbar-wrapper",placeholder:"amazingbar-placeholder",scrollbar:"amazingbar-scrollbar",track:"amazingbar-track",heightAutoObserverWrapperEl:"amazingbar-height-auto-observer-wrapper",heightAutoObserverEl:"amazingbar-height-auto-observer",visible:"amazingbar-visible",horizontal:"amazingbar-horizontal",vertical:"amazingbar-vertical",hover:"amazingbar-hover",dragging:"amazingbar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3},Le.instances=new WeakMap,Le.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.removeEventListener("load",this.initDOMLoadedElements),Array.prototype.forEach.call(document.querySelectorAll("[data-amazingbar]"),t=>{"init"===t.getAttribute("data-amazingbar")||Le.instances.has(t)||new Le(t,Ce(t.attributes))})},Le.removeObserver=function(){this.globalObserver.disconnect()},Le.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this),"undefined"!=typeof MutationObserver&&(this.globalObserver=new MutationObserver(Le.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0})),"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?window.setTimeout(this.initDOMLoadedElements):(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements))},Le.handleMutations=t=>{t.forEach(t=>{Array.prototype.forEach.call(t.addedNodes,t=>{1===t.nodeType&&(t.hasAttribute("data-amazingbar")?!Le.instances.has(t)&&document.documentElement.contains(t)&&new Le(t,Ce(t.attributes)):Array.prototype.forEach.call(t.querySelectorAll("[data-amazingbar]"),function(t){"init"!==t.getAttribute("data-amazingbar")&&!Le.instances.has(t)&&document.documentElement.contains(t)&&new Le(t,Ce(t.attributes))}))}),Array.prototype.forEach.call(t.removedNodes,t=>{1===t.nodeType&&("init"===t.getAttribute("data-amazingbar")?Le.instances.has(t)&&!document.documentElement.contains(t)&&Le.instances.get(t).unMount():Array.prototype.forEach.call(t.querySelectorAll('[data-amazingbar="init"]'),t=>{Le.instances.has(t)&&!document.documentElement.contains(t)&&Le.instances.get(t).unMount()}))})})},Le.getOptions=Ce,It()&&Le.initHtmlApi();const Ie=Le;var Oe=a(43214);const He=Ie,Ne=j.Ay,Re=t=>{const e=T.M,{children:r}=t,o=t=>{requestAnimationFrame(()=>{L.A.dispatch("onScroll",t),Ne.app.dispatch("onScroll",t);const e=new Event("scroll");window.dispatchEvent(e)})},i=(0,n.A)("div",{className:Bt.childrenHolder},r),a=()=>{const t=c.querySelector("#main-page--cdtr");if(!t)return setTimeout(()=>{a()},1e3);const e=t.getBoundingClientRect();let n=e.width;if(0===n)return setTimeout(()=>{a()},1e3);e.width>document.body.offsetWidth&&(n=document.body.offsetWidth),(0,Oe.A)({id:"page-max-width",context:{"[data-type='text'], [data-type='block'], [data-type='section']":{maxWidth:n+"px"}}})};window.addEventListener("resize",()=>{requestAnimationFrame(()=>{a()})});const s=e.get("config","pageWidth"),l=e.get("config","channel"),c=(0,n.A)("div",{style:{top:"newsletter"===l?"20px":"15px",width:s?s+"px":null,maxWidth:"100%"},id:"main-page-wrapper",onScroll:o,className:Bt.root},(0,n.A)("div",{ref:{onMount:()=>{setTimeout(()=>{a(),Ne.dispatch("change",{})},0)}},className:Bt.wrapper,id:"main-page--cdtr"},i,"web"===l?(0,n.A)("div",{id:"popups-instructions"},(0,n.A)("lang-text",{text:"popups_instructions"})):null),(0,n.A)("noscript",null,(0,n.A)("style",null," .amazingbar-content-wrapper {\n overflow: auto;\n }")));return setTimeout(()=>{new He(c,{onScroll:o,autoHide:!0,autoHideTimeout:1e3})},500),c};var ze=a(4075);class Pe extends S.WF{constructor(){super(),this.width=0}createRenderRoot(){return this}render(){const t=`\n .container {\n width: 100%;\n margin-right: auto;\n margin-left: auto;\n display: flex;\n flex-wrap: wrap;\n }\n \n @media (min-width: 576px) {\n .container {\n max-width: 540px;\n }\n }\n @media (min-width: 768px) {\n .container {\n max-width: 720px;\n }\n }\n @media (min-width: 992px) {\n .container {\n max-width: calc(960px - ${this.width/2}px);\n }\n }\n @media (min-width: 1200px) {\n .container {\n max-width: calc(1140px - ${this.width}px);\n }\n }\n @media (min-width: 1400px) {\n .container {\n max-width: calc(1320px - ${this.width}px);\n }\n }\n\n /* --- Popups surface (page vs popups builder) -----------------------\n Popups are top-level modalable blocks under root. On the page surface\n they are hidden. On the popups surface the page is hidden and ONLY the\n active popup (chosen in the sidebar list, marked data-active-popup) is\n shown, centered on a dimmed modal backdrop, as a normal editable block\n you build by dragging elements into it. The surface rail\n (cdtr-surface-rail) toggles surface-page/surface-popups on\n #main-page-wrapper and plays the one-shot .surface-anim fade. */\n #main-page-wrapper:not(.surface-popups) [data-modalable="true"] {\n display: none !important;\n }\n /* Designer-canvas grid backdrop behind the popup (Figma-style), instead of\n a flat/dimmed page — the popup card floats above it. */\n #main-page-wrapper.surface-popups {\n background-color: #6b6e76;\n background-image:\n linear-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1px),\n linear-gradient(90deg, rgba(255, 255, 255, 0.10) 1px, transparent 1px);\n background-size: 24px 24px;\n }\n /* The page canvas is normally a solid white sheet; drop it to transparent\n on the popups surface so the wrapper's grid backdrop shows through. */\n #main-page-wrapper.surface-popups #main-page--cdtr {\n position: relative;\n min-height: calc(100vh - 120px);\n background: transparent !important;\n }\n #main-page-wrapper.surface-popups .root-component {\n position: relative;\n z-index: 1;\n }\n #main-page-wrapper.surface-popups .root-component,\n #main-page-wrapper.surface-popups .root-component > div {\n background: transparent !important;\n }\n /* Top gap as padding on the popup's immediate parent, so the popup's own\n margin-top can't collapse through it and the card doesn't stick up. */\n #main-page-wrapper.surface-popups .root-component > div {\n padding-top: 56px !important;\n }\n #main-page-wrapper.surface-popups .root-component > div > :not([data-modalable="true"]) {\n display: none !important;\n }\n /* Hide every popup except the active one. */\n #main-page-wrapper.surface-popups [data-modalable="true"]:not([data-active-popup="true"]) {\n display: none !important;\n }\n #main-page-wrapper.surface-popups [data-modalable="true"][data-active-popup="true"] {\n display: block !important;\n max-width: 640px;\n margin: 0 auto 48px;\n background: #fff;\n border-radius: 10px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);\n position: relative;\n z-index: 2;\n min-height: 120px;\n }\n /* Guidance text under the popup (popups surface only). */\n #popups-instructions {\n display: none;\n }\n #main-page-wrapper.surface-popups #popups-instructions {\n display: block;\n position: relative;\n z-index: 2;\n max-width: 640px;\n margin: 20px auto 56px;\n text-align: center;\n color: rgba(255, 255, 255, 0.9);\n font-size: 13px;\n line-height: 1.7;\n }\n /* Simple fade when switching surfaces (no flip/spin). */\n @keyframes cdtr-surface-fade {\n from { opacity: 0.2; }\n to { opacity: 1; }\n }\n #main-page-wrapper.surface-anim .root-component {\n animation: cdtr-surface-fade 0.2s ease-out;\n }\n `;return S.qy`<style>
3930
3930
  ${t}
3931
- </style>`}}Pe.properties={width:{type:Number,reflect:!0}},customElements.define("cdtr-container-style",Pe);var $e=a(69172),De=a(82706);var je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};const Fe="object"===("undefined"==typeof window?"undefined":je(window))&&"object"===("undefined"==typeof document?"undefined":je(document))&&9===document.nodeType;function Ue(t){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ue(t)}function qe(t){var e=function(t,e){if("object"!=Ue(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Ue(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ue(e)?e:e+""}function We(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qe(r.key),r)}}function Ve(t,e,n){return e&&We(t.prototype,e),n&&We(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ye(t,e){return Ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ye(t,e)}function Xe(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Ye(t,e)}function Ze(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var Je={}.constructor;function Ke(t){if(null==t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Ke);if(t.constructor!==Je)return t;var e={};for(var n in t)e[n]=Ke(t[n]);return e}function Ge(t,e,n){void 0===t&&(t="unnamed");var r=n.jss,o=Ke(e),i=r.plugins.onCreateRule(t,o,n);return i||(t[0],null)}var Qe=function(t,e){for(var n="",r=0;r<t.length&&"!important"!==t[r];r++)n&&(n+=e),n+=t[r];return n},tn=function(t){if(!Array.isArray(t))return t;var e="";if(Array.isArray(t[0]))for(var n=0;n<t.length&&"!important"!==t[n];n++)e&&(e+=", "),e+=Qe(t[n]," ");else e=Qe(t,", ");return"!important"===t[t.length-1]&&(e+=" !important"),e};function en(t){return t&&!1===t.format?{linebreak:"",space:""}:{linebreak:"\n",space:" "}}function nn(t,e){for(var n="",r=0;r<e;r++)n+=" ";return n+t}function rn(t,e,n){void 0===n&&(n={});var r="";if(!e)return r;var o=n.indent,i=void 0===o?0:o,a=e.fallbacks;!1===n.format&&(i=-1/0);var s=en(n),l=s.linebreak,c=s.space;if(t&&i++,a)if(Array.isArray(a))for(var d=0;d<a.length;d++){var p=a[d];for(var h in p){var u=p[h];null!=u&&(r&&(r+=l),r+=nn(h+":"+c+tn(u)+";",i))}}else for(var f in a){var m=a[f];null!=m&&(r&&(r+=l),r+=nn(f+":"+c+tn(m)+";",i))}for(var g in e){var b=e[g];null!=b&&"fallbacks"!==g&&(r&&(r+=l),r+=nn(g+":"+c+tn(b)+";",i))}return(r||n.allowEmpty)&&t?(r&&(r=""+l+r+l),nn(""+t+c+"{"+r,--i)+nn("}",i)):r}var on=/([[\].#*$><+~=|^:(),"'`\s])/g,an="undefined"!=typeof CSS&&CSS.escape,sn=function(t){return an?an(t):t.replace(on,"\\$1")},ln=function(){function t(t,e,n){this.type="style",this.isProcessed=!1;var r=n.sheet,o=n.Renderer;this.key=t,this.options=n,this.style=e,r?this.renderer=r.renderer:o&&(this.renderer=new o)}return t.prototype.prop=function(t,e,n){if(void 0===e)return this.style[t];var r=!!n&&n.force;if(!r&&this.style[t]===e)return this;var o=e;n&&!1===n.process||(o=this.options.jss.plugins.onChangeValue(e,t,this));var i=null==o||!1===o,a=t in this.style;if(i&&!a&&!r)return this;var s=i&&a;if(s?delete this.style[t]:this.style[t]=o,this.renderable&&this.renderer)return s?this.renderer.removeProperty(this.renderable,t):this.renderer.setProperty(this.renderable,t,o),this;var l=this.options.sheet;return l&&l.attached,this},t}(),cn=function(t){function e(e,n,r){var o;o=t.call(this,e,n,r)||this;var i=r.selector,a=r.scoped,s=r.sheet,l=r.generateId;return i?o.selectorText=i:!1!==a&&(o.id=l(Ze(Ze(o)),s),o.selectorText="."+sn(o.id)),o}Xe(e,t);var n=e.prototype;return n.applyTo=function(t){var e=this.renderer;if(e){var n=this.toJSON();for(var r in n)e.setProperty(t,r,n[r])}return this},n.toJSON=function(){var t={};for(var e in this.style){var n=this.style[e];"object"!=typeof n?t[e]=n:Array.isArray(n)&&(t[e]=tn(n))}return t},n.toString=function(t){var e=this.options.sheet,n=!!e&&e.options.link?(0,b.A)({},t,{allowEmpty:!0}):t;return rn(this.selectorText,this.style,n)},Ve(e,[{key:"selector",set:function(t){if(t!==this.selectorText){this.selectorText=t;var e=this.renderer,n=this.renderable;if(n&&e)e.setSelector(n,t)||e.replaceRule(n,this)}},get:function(){return this.selectorText}}]),e}(ln),dn={onCreateRule:function(t,e,n){return"@"===t[0]||n.parent&&"keyframes"===n.parent.type?null:new cn(t,e,n)}},pn={indent:1,children:!0},hn=/@([\w-]+)/,un=function(){function t(t,e,n){this.type="conditional",this.isProcessed=!1,this.key=t;var r=t.match(hn);for(var o in this.at=r?r[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new zn((0,b.A)({},n,{parent:this})),e)this.rules.add(o,e[o]);this.rules.process()}var e=t.prototype;return e.getRule=function(t){return this.rules.get(t)},e.indexOf=function(t){return this.rules.indexOf(t)},e.addRule=function(t,e,n){var r=this.rules.add(t,e,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},e.replaceRule=function(t,e,n){var r=this.rules.replace(t,e,n);return r&&this.options.jss.plugins.onProcessRule(r),r},e.toString=function(t){void 0===t&&(t=pn);var e=en(t).linebreak;if(null==t.indent&&(t.indent=pn.indent),null==t.children&&(t.children=pn.children),!1===t.children)return this.query+" {}";var n=this.rules.toString(t);return n?this.query+" {"+e+n+e+"}":""},t}(),fn=/@container|@media|@supports\s+/,mn={onCreateRule:function(t,e,n){return fn.test(t)?new un(t,e,n):null}},gn={indent:1,children:!0},bn=/@keyframes\s+([\w-]+)/,yn=function(){function t(t,e,n){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var r=t.match(bn);r&&r[1]?this.name=r[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var o=n.scoped,i=n.sheet,a=n.generateId;for(var s in this.id=!1===o?this.name:sn(a(this,i)),this.rules=new zn((0,b.A)({},n,{parent:this})),e)this.rules.add(s,e[s],(0,b.A)({},n,{parent:this}));this.rules.process()}return t.prototype.toString=function(t){void 0===t&&(t=gn);var e=en(t).linebreak;if(null==t.indent&&(t.indent=gn.indent),null==t.children&&(t.children=gn.children),!1===t.children)return this.at+" "+this.id+" {}";var n=this.rules.toString(t);return n&&(n=""+e+n+e),this.at+" "+this.id+" {"+n+"}"},t}(),wn=/@keyframes\s+/,_n=/\$([\w-]+)/g,An=function(t,e){return"string"==typeof t?t.replace(_n,function(t,n){return n in e?e[n]:t}):t},xn=function(t,e,n){var r=t[e],o=An(r,n);o!==r&&(t[e]=o)},vn={onCreateRule:function(t,e,n){return"string"==typeof t&&wn.test(t)?new yn(t,e,n):null},onProcessStyle:function(t,e,n){return"style"===e.type&&n?("animation-name"in t&&xn(t,"animation-name",n.keyframes),"animation"in t&&xn(t,"animation",n.keyframes),t):t},onChangeValue:function(t,e,n){var r=n.options.sheet;if(!r)return t;switch(e){case"animation":case"animation-name":return An(t,r.keyframes);default:return t}}},kn=function(t){function e(){return t.apply(this,arguments)||this}return Xe(e,t),e.prototype.toString=function(t){var e=this.options.sheet,n=!!e&&e.options.link?(0,b.A)({},t,{allowEmpty:!0}):t;return rn(this.key,this.style,n)},e}(ln),Cn={onCreateRule:function(t,e,n){return n.parent&&"keyframes"===n.parent.type?new kn(t,e,n):null}},En=function(){function t(t,e,n){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=t,this.style=e,this.options=n}return t.prototype.toString=function(t){var e=en(t).linebreak;if(Array.isArray(this.style)){for(var n="",r=0;r<this.style.length;r++)n+=rn(this.at,this.style[r]),this.style[r+1]&&(n+=e);return n}return rn(this.at,this.style,t)},t}(),Sn=/@font-face/,Mn={onCreateRule:function(t,e,n){return Sn.test(t)?new En(t,e,n):null}},Bn=function(){function t(t,e,n){this.type="viewport",this.at="@viewport",this.isProcessed=!1,this.key=t,this.style=e,this.options=n}return t.prototype.toString=function(t){return rn(this.key,this.style,t)},t}(),Tn={onCreateRule:function(t,e,n){return"@viewport"===t||"@-ms-viewport"===t?new Bn(t,e,n):null}},Ln=function(){function t(t,e,n){this.type="simple",this.isProcessed=!1,this.key=t,this.value=e,this.options=n}return t.prototype.toString=function(t){if(Array.isArray(this.value)){for(var e="",n=0;n<this.value.length;n++)e+=this.key+" "+this.value[n]+";",this.value[n+1]&&(e+="\n");return e}return this.key+" "+this.value+";"},t}(),In={"@charset":!0,"@import":!0,"@namespace":!0},On={onCreateRule:function(t,e,n){return t in In?new Ln(t,e,n):null}},Hn=[dn,mn,vn,Cn,Mn,Tn,On],Nn={process:!0},Rn={force:!0,process:!0},zn=function(){function t(t){this.map={},this.raw={},this.index=[],this.counter=0,this.options=t,this.classes=t.classes,this.keyframes=t.keyframes}var e=t.prototype;return e.add=function(t,e,n){var r=this.options,o=r.parent,i=r.sheet,a=r.jss,s=r.Renderer,l=r.generateId,c=r.scoped,d=(0,b.A)({classes:this.classes,parent:o,sheet:i,jss:a,Renderer:s,generateId:l,scoped:c,name:t,keyframes:this.keyframes,selector:void 0},n),p=t;t in this.raw&&(p=t+"-d"+this.counter++),this.raw[p]=e,p in this.classes&&(d.selector="."+sn(this.classes[p]));var h=Ge(p,e,d);if(!h)return null;this.register(h);var u=void 0===d.index?this.index.length:d.index;return this.index.splice(u,0,h),h},e.replace=function(t,e,n){var r=this.get(t),o=this.index.indexOf(r);r&&this.remove(r);var i=n;return-1!==o&&(i=(0,b.A)({},n,{index:o})),this.add(t,e,i)},e.get=function(t){return this.map[t]},e.remove=function(t){this.unregister(t),delete this.raw[t.key],this.index.splice(this.index.indexOf(t),1)},e.indexOf=function(t){return this.index.indexOf(t)},e.process=function(){var t=this.options.jss.plugins;this.index.slice(0).forEach(t.onProcessRule,t)},e.register=function(t){this.map[t.key]=t,t instanceof cn?(this.map[t.selector]=t,t.id&&(this.classes[t.key]=t.id)):t instanceof yn&&this.keyframes&&(this.keyframes[t.name]=t.id)},e.unregister=function(t){delete this.map[t.key],t instanceof cn?(delete this.map[t.selector],delete this.classes[t.key]):t instanceof yn&&delete this.keyframes[t.name]},e.update=function(){var t,e,n;if("string"==typeof(arguments.length<=0?void 0:arguments[0])?(t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1],n=arguments.length<=2?void 0:arguments[2]):(e=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],t=null),t)this.updateOne(this.get(t),e,n);else for(var r=0;r<this.index.length;r++)this.updateOne(this.index[r],e,n)},e.updateOne=function(e,n,r){void 0===r&&(r=Nn);var o=this.options,i=o.jss.plugins,a=o.sheet;if(e.rules instanceof t)e.rules.update(n,r);else{var s=e.style;if(i.onUpdate(n,e,a,r),r.process&&s&&s!==e.style){for(var l in i.onProcessStyle(e.style,e,a),e.style){var c=e.style[l];c!==s[l]&&e.prop(l,c,Rn)}for(var d in s){var p=e.style[d],h=s[d];null==p&&p!==h&&e.prop(d,null,Rn)}}}},e.toString=function(t){for(var e="",n=this.options.sheet,r=!!n&&n.options.link,o=en(t).linebreak,i=0;i<this.index.length;i++){var a=this.index[i].toString(t);(a||r)&&(e&&(e+=o),e+=a)}return e},t}(),Pn=function(){function t(t,e){for(var n in this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=(0,b.A)({},e,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),e.Renderer&&(this.renderer=new e.Renderer(this)),this.rules=new zn(this.options),t)this.rules.add(n,t[n]);this.rules.process()}var e=t.prototype;return e.attach=function(){return this.attached||(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy()),this},e.detach=function(){return this.attached?(this.renderer&&this.renderer.detach(),this.attached=!1,this):this},e.addRule=function(t,e,n){var r=this.queue;this.attached&&!r&&(this.queue=[]);var o=this.rules.add(t,e,n);return o?(this.options.jss.plugins.onProcessRule(o),this.attached?this.deployed?(r?r.push(o):(this.insertRule(o),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0)),o):o:(this.deployed=!1,o)):null},e.replaceRule=function(t,e,n){var r=this.rules.get(t);if(!r)return this.addRule(t,e,n);var o=this.rules.replace(t,e,n);return o&&this.options.jss.plugins.onProcessRule(o),this.attached?this.deployed?(this.renderer&&(o?r.renderable&&this.renderer.replaceRule(r.renderable,o):this.renderer.deleteRule(r)),o):o:(this.deployed=!1,o)},e.insertRule=function(t){this.renderer&&this.renderer.insertRule(t)},e.addRules=function(t,e){var n=[];for(var r in t){var o=this.addRule(r,t[r],e);o&&n.push(o)}return n},e.getRule=function(t){return this.rules.get(t)},e.deleteRule=function(t){var e="object"==typeof t?t:this.rules.get(t);return!(!e||this.attached&&!e.renderable)&&(this.rules.remove(e),!(this.attached&&e.renderable&&this.renderer)||this.renderer.deleteRule(e.renderable))},e.indexOf=function(t){return this.rules.indexOf(t)},e.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},e.update=function(){var t;return(t=this.rules).update.apply(t,arguments),this},e.updateOne=function(t,e,n){return this.rules.updateOne(t,e,n),this},e.toString=function(t){return this.rules.toString(t)},t}(),$n=function(){function t(){this.plugins={internal:[],external:[]},this.registry={}}var e=t.prototype;return e.onCreateRule=function(t,e,n){for(var r=0;r<this.registry.onCreateRule.length;r++){var o=this.registry.onCreateRule[r](t,e,n);if(o)return o}return null},e.onProcessRule=function(t){if(!t.isProcessed){for(var e=t.options.sheet,n=0;n<this.registry.onProcessRule.length;n++)this.registry.onProcessRule[n](t,e);t.style&&this.onProcessStyle(t.style,t,e),t.isProcessed=!0}},e.onProcessStyle=function(t,e,n){for(var r=0;r<this.registry.onProcessStyle.length;r++)e.style=this.registry.onProcessStyle[r](e.style,e,n)},e.onProcessSheet=function(t){for(var e=0;e<this.registry.onProcessSheet.length;e++)this.registry.onProcessSheet[e](t)},e.onUpdate=function(t,e,n,r){for(var o=0;o<this.registry.onUpdate.length;o++)this.registry.onUpdate[o](t,e,n,r)},e.onChangeValue=function(t,e,n){for(var r=t,o=0;o<this.registry.onChangeValue.length;o++)r=this.registry.onChangeValue[o](r,e,n);return r},e.use=function(t,e){void 0===e&&(e={queue:"external"});var n=this.plugins[e.queue];-1===n.indexOf(t)&&(n.push(t),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce(function(t,e){for(var n in e)n in t&&t[n].push(e[n]);return t},{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},t}(),Dn=function(){function t(){this.registry=[]}var e=t.prototype;return e.add=function(t){var e=this.registry,n=t.options.index;if(-1===e.indexOf(t))if(0===e.length||n>=this.index)e.push(t);else for(var r=0;r<e.length;r++)if(e[r].options.index>n)return void e.splice(r,0,t)},e.reset=function(){this.registry=[]},e.remove=function(t){var e=this.registry.indexOf(t);this.registry.splice(e,1)},e.toString=function(t){for(var e=void 0===t?{}:t,n=e.attached,r=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(e,["attached"]),o=en(r).linebreak,i="",a=0;a<this.registry.length;a++){var s=this.registry[a];null!=n&&s.attached!==n||(i&&(i+=o),i+=s.toString(r))}return i},Ve(t,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),t}(),jn=new Dn,Fn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof self&&self.Math===Math?self:Function("return this")(),Un="2f1acc6c3a606b082e5eef5e54414ffb";null==Fn[Un]&&(Fn[Un]=0);var qn=Fn[Un]++,Wn=function(t){void 0===t&&(t={});var e=0;return function(n,r){e+=1;var o="",i="";return r&&(r.options.classNamePrefix&&(i=r.options.classNamePrefix),null!=r.options.jss.id&&(o=String(r.options.jss.id))),t.minify?""+(i||"c")+qn+o+e:i+n.key+"-"+qn+(o?"-"+o:"")+"-"+e}},Vn=function(t){var e;return function(){return e||(e=t()),e}},Yn=function(t,e){try{return t.attributeStyleMap?t.attributeStyleMap.get(e):t.style.getPropertyValue(e)}catch(t){return""}},Xn=function(t,e,n){try{var r=n;if(Array.isArray(n)&&(r=tn(n)),t.attributeStyleMap)t.attributeStyleMap.set(e,r);else{var o=r?r.indexOf("!important"):-1,i=o>-1?r.substr(0,o-1):r;t.style.setProperty(e,i,o>-1?"important":"")}}catch(t){return!1}return!0},Zn=function(t,e){try{t.attributeStyleMap?t.attributeStyleMap.delete(e):t.style.removeProperty(e)}catch(t){}},Jn=function(t,e){return t.selectorText=e,t.selectorText===e},Kn=Vn(function(){return document.querySelector("head")});function Gn(t){var e=jn.registry;if(e.length>0){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.attached&&r.options.index>e.index&&r.options.insertionPoint===e.insertionPoint)return r}return null}(e,t);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=function(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];if(r.attached&&r.options.insertionPoint===e.insertionPoint)return r}return null}(e,t),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=t.insertionPoint;if(r&&"string"==typeof r){var o=function(t){for(var e=Kn(),n=0;n<e.childNodes.length;n++){var r=e.childNodes[n];if(8===r.nodeType&&r.nodeValue.trim()===t)return r}return null}(r);if(o)return{parent:o.parentNode,node:o.nextSibling}}return!1}var Qn=Vn(function(){var t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null}),tr=function(t,e,n){try{"insertRule"in t?t.insertRule(e,n):"appendRule"in t&&t.appendRule(e)}catch(t){return!1}return t.cssRules[n]},er=function(t,e){var n=t.cssRules.length;return void 0===e||e>n?n:e},nr=function(){function t(t){this.getPropertyValue=Yn,this.setProperty=Xn,this.removeProperty=Zn,this.setSelector=Jn,this.hasInsertedRules=!1,this.cssRules=[],t&&jn.add(t),this.sheet=t;var e=this.sheet?this.sheet.options:{},n=e.media,r=e.meta,o=e.element;this.element=o||function(){var t=document.createElement("style");return t.textContent="\n",t}(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var i=Qn();i&&this.element.setAttribute("nonce",i)}var e=t.prototype;return e.attach=function(){if(!this.element.parentNode&&this.sheet){!function(t,e){var n=e.insertionPoint,r=Gn(e);if(!1!==r&&r.parent)r.parent.insertBefore(t,r.node);else if(n&&"number"==typeof n.nodeType){var o=n,i=o.parentNode;i&&i.insertBefore(t,o.nextSibling)}else Kn().appendChild(t)}(this.element,this.sheet.options);var t=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&t&&(this.hasInsertedRules=!1,this.deploy())}},e.detach=function(){if(this.sheet){var t=this.element.parentNode;t&&t.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},e.deploy=function(){var t=this.sheet;t&&(t.options.link?this.insertRules(t.rules):this.element.textContent="\n"+t.toString()+"\n")},e.insertRules=function(t,e){for(var n=0;n<t.index.length;n++)this.insertRule(t.index[n],n,e)},e.insertRule=function(t,e,n){if(void 0===n&&(n=this.element.sheet),t.rules){var r=t,o=n;if("conditional"===t.type||"keyframes"===t.type){var i=er(n,e);if(!1===(o=tr(n,r.toString({children:!1}),i)))return!1;this.refCssRule(t,i,o)}return this.insertRules(r.rules,o),o}var a=t.toString();if(!a)return!1;var s=er(n,e),l=tr(n,a,s);return!1!==l&&(this.hasInsertedRules=!0,this.refCssRule(t,s,l),l)},e.refCssRule=function(t,e,n){t.renderable=n,t.options.parent instanceof Pn&&this.cssRules.splice(e,0,n)},e.deleteRule=function(t){var e=this.element.sheet,n=this.indexOf(t);return-1!==n&&(e.deleteRule(n),this.cssRules.splice(n,1),!0)},e.indexOf=function(t){return this.cssRules.indexOf(t)},e.replaceRule=function(t,e){var n=this.indexOf(t);return-1!==n&&(this.element.sheet.deleteRule(n),this.cssRules.splice(n,1),this.insertRule(e,n))},e.getRules=function(){return this.element.sheet.cssRules},t}(),rr=0,or=function(){function t(t){this.id=rr++,this.version="10.10.0",this.plugins=new $n,this.options={id:{minify:!1},createGenerateId:Wn,Renderer:Fe?nr:null,plugins:[]},this.generateId=Wn({minify:!1});for(var e=0;e<Hn.length;e++)this.plugins.use(Hn[e],{queue:"internal"});this.setup(t)}var e=t.prototype;return e.setup=function(t){return void 0===t&&(t={}),t.createGenerateId&&(this.options.createGenerateId=t.createGenerateId),t.id&&(this.options.id=(0,b.A)({},this.options.id,t.id)),(t.createGenerateId||t.id)&&(this.generateId=this.options.createGenerateId(this.options.id)),null!=t.insertionPoint&&(this.options.insertionPoint=t.insertionPoint),"Renderer"in t&&(this.options.Renderer=t.Renderer),t.plugins&&this.use.apply(this,t.plugins),this},e.createStyleSheet=function(t,e){void 0===e&&(e={});var n=e.index;"number"!=typeof n&&(n=0===jn.index?0:jn.index+1);var r=new Pn(t,(0,b.A)({},e,{jss:this,generateId:e.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(r),r},e.removeStyleSheet=function(t){return t.detach(),jn.remove(t),this},e.createRule=function(t,e,n){if(void 0===e&&(e={}),void 0===n&&(n={}),"object"==typeof t)return this.createRule(void 0,t,e);var r=(0,b.A)({},n,{name:t,jss:this,Renderer:this.options.Renderer});r.generateId||(r.generateId=this.generateId),r.classes||(r.classes={}),r.keyframes||(r.keyframes={});var o=Ge(t,e,r);return o&&this.plugins.onProcessRule(o),o},e.use=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach(function(e){t.plugins.use(e)}),this},t}(),ir="object"==typeof CSS&&null!=CSS&&"number"in CSS;var ar=function(t){return new or(t)}();const sr=ar;var lr=Date.now(),cr="fnValues"+lr,dr="fnStyle"+ ++lr;const pr=function(){return{onCreateRule:function(t,e,n){if("function"!=typeof e)return null;var r=Ge(t,{},n);return r[dr]=e,r},onProcessStyle:function(t,e){if(cr in e||dr in e)return t;var n={};for(var r in t){var o=t[r];"function"==typeof o&&(delete t[r],n[r]=o)}return e[cr]=n,t},onUpdate:function(t,e,n,r){var o=e,i=o[dr];i&&(o.style=i(t)||{});var a=o[cr];if(a)for(var s in a)o.prop(s,a[s](t),r)}}};var hr=a(71158),ur=function(t){return t&&t[hr.A]&&t===t[hr.A]()};const fr=function(t){return{onCreateRule:function(e,n,r){if(!ur(n))return null;var o=n,i=Ge(e,{},r);return o.subscribe(function(e){for(var n in e)i.prop(n,e[n],t)}),i},onProcessRule:function(e){if(!e||"style"===e.type){var n=e,r=n.style,o=function(e){var o=r[e];if(!ur(o))return"continue";delete r[e],o.subscribe({next:function(r){n.prop(e,r,t)}})};for(var i in r)o(i)}}}};var mr=/;\n/,gr=function(t){"string"==typeof t.style&&(t.style=function(t){for(var e={},n=t.split(mr),r=0;r<n.length;r++){var o=(n[r]||"").trim();if(o){var i=o.indexOf(":");if(-1!==i){var a=o.substr(0,i).trim(),s=o.substr(i+1).trim();e[a]=s}}}return e}(t.style))};const br=function(){return{onProcessRule:gr}};var yr="@global",wr="@global ",_r=function(){function t(t,e,n){for(var r in this.type="global",this.at=yr,this.isProcessed=!1,this.key=t,this.options=n,this.rules=new zn((0,b.A)({},n,{parent:this})),e)this.rules.add(r,e[r]);this.rules.process()}var e=t.prototype;return e.getRule=function(t){return this.rules.get(t)},e.addRule=function(t,e,n){var r=this.rules.add(t,e,n);return r&&this.options.jss.plugins.onProcessRule(r),r},e.replaceRule=function(t,e,n){var r=this.rules.replace(t,e,n);return r&&this.options.jss.plugins.onProcessRule(r),r},e.indexOf=function(t){return this.rules.indexOf(t)},e.toString=function(t){return this.rules.toString(t)},t}(),Ar=function(){function t(t,e,n){this.type="global",this.at=yr,this.isProcessed=!1,this.key=t,this.options=n;var r=t.substr(8);this.rule=n.jss.createRule(r,e,(0,b.A)({},n,{parent:this}))}return t.prototype.toString=function(t){return this.rule?this.rule.toString(t):""},t}(),xr=/\s*,\s*/g;function vr(t,e){for(var n=t.split(xr),r="",o=0;o<n.length;o++)r+=e+" "+n[o].trim(),n[o+1]&&(r+=", ");return r}const kr=function(){return{onCreateRule:function(t,e,n){if(!t)return null;if(t===yr)return new _r(t,e,n);if("@"===t[0]&&t.substr(0,8)===wr)return new Ar(t,e,n);var r=n.parent;return r&&("global"===r.type||r.options.parent&&"global"===r.options.parent.type)&&(n.scoped=!1),n.selector||!1!==n.scoped||(n.selector=t),null},onProcessRule:function(t,e){"style"===t.type&&e&&(function(t,e){var n=t.options,r=t.style,o=r?r[yr]:null;if(o){for(var i in o)e.addRule(i,o[i],(0,b.A)({},n,{selector:vr(i,t.selector)}));delete r[yr]}}(t,e),function(t,e){var n=t.options,r=t.style;for(var o in r)if("@"===o[0]&&o.substr(0,7)===yr){var i=vr(o.substr(7),t.selector);e.addRule(i,r[o],(0,b.A)({},n,{selector:i})),delete r[o]}}(t,e))}}};var Cr=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},Er="extendCurrValue"+Date.now();function Sr(t,e,n,r){return void 0===r&&(r={}),function(t,e,n,r){if("string"!=typeof t.extend)if(Array.isArray(t.extend))for(var o=0;o<t.extend.length;o++){var i=t.extend[o];Sr("string"==typeof i?(0,b.A)({},t,{extend:i}):t.extend[o],e,n,r)}else for(var a in t.extend)"extend"!==a?Cr(t.extend[a])?(a in r||(r[a]={}),Sr(t.extend[a],e,n,r[a])):r[a]=t.extend[a]:Sr(t.extend.extend,e,n,r);else{if(!n)return;var s=n.getRule(t.extend);if(!s)return;if(s===e)return;var l=s.options.parent;l&&Sr(l.rules.raw[t.extend],e,n,r)}}(t,e,n,r),function(t,e,n,r){for(var o in t)"extend"!==o&&(Cr(r[o])&&Cr(t[o])?Sr(t[o],e,n,r[o]):Cr(t[o])?r[o]=Sr(t[o],e,n):r[o]=t[o])}(t,e,n,r),r}const Mr=function(){return{onProcessStyle:function(t,e,n){return"extend"in t?Sr(t,e,n):t},onChangeValue:function(t,e,n){if("extend"!==e)return t;if(null==t||!1===t){for(var r in n[Er])n.prop(r,null);return n[Er]=null,null}if("object"==typeof t){for(var o in t)n.prop(o,t[o]);n[Er]=t}return null}}};var Br=/\s*,\s*/g,Tr=/&/g,Lr=/\$([\w-]+)/g;const Ir=function(){function t(t,e){return function(n,r){var o=t.getRule(r)||e&&e.getRule(r);return o?o.selector:r}}function e(t,e){for(var n=e.split(Br),r=t.split(Br),o="",i=0;i<n.length;i++)for(var a=n[i],s=0;s<r.length;s++){var l=r[s];o&&(o+=", "),o+=-1!==l.indexOf("&")?l.replace(Tr,a):a+" "+l}return o}function n(t,e,n){if(n)return(0,b.A)({},n,{index:n.index+1});var r=t.options.nestingLevel;r=void 0===r?1:r+1;var o=(0,b.A)({},t.options,{nestingLevel:r,index:e.indexOf(t)+1});return delete o.name,o}return{onProcessStyle:function(r,o,i){if("style"!==o.type)return r;var a,s,l=o,c=l.options.parent;for(var d in r){var p=-1!==d.indexOf("&"),h="@"===d[0];if(p||h){if(a=n(l,c,a),p){var u=e(d,l.selector);s||(s=t(c,i)),u=u.replace(Lr,s);var f=l.key+"-"+d;"replaceRule"in c?c.replaceRule(f,r[d],(0,b.A)({},a,{selector:u})):c.addRule(f,r[d],(0,b.A)({},a,{selector:u}))}else h&&c.addRule(d,{},a).addRule(l.key,r[d],{selector:l.selector});delete r[d]}}return r}}};function Or(t,e){if(!e)return!0;if(Array.isArray(e)){for(var n=0;n<e.length;n++){if(!Or(t,e[n]))return!1}return!0}if(e.indexOf(" ")>-1)return Or(t,e.split(" "));var r=t.options.parent;if("$"===e[0]){var o=r.getRule(e.substr(1));return!!o&&(o!==t&&(r.classes[t.key]+=" "+r.classes[o.key],!0))}return r.classes[t.key]+=" "+e,!0}const Hr=function(){return{onProcessStyle:function(t,e){return"composes"in t?(Or(e,t.composes),delete t.composes,t):t}}};var Nr=/[A-Z]/g,Rr=/^ms-/,zr={};function Pr(t){return"-"+t.toLowerCase()}const $r=function(t){if(zr.hasOwnProperty(t))return zr[t];var e=t.replace(Nr,Pr);return zr[t]=Rr.test(e)?"-"+e:e};function Dr(t){var e={};for(var n in t){e[0===n.indexOf("--")?n:$r(n)]=t[n]}return t.fallbacks&&(Array.isArray(t.fallbacks)?e.fallbacks=t.fallbacks.map(Dr):e.fallbacks=Dr(t.fallbacks)),e}const jr=function(){return{onProcessStyle:function(t){if(Array.isArray(t)){for(var e=0;e<t.length;e++)t[e]=Dr(t[e]);return t}return Dr(t)},onChangeValue:function(t,e,n){if(0===e.indexOf("--"))return t;var r=$r(e);return e===r?t:(n.prop(r,t),null)}}};var Fr=ir&&CSS?CSS.px:"px",Ur=ir&&CSS?CSS.ms:"ms",qr=ir&&CSS?CSS.percent:"%";function Wr(t){var e=/(-[a-z])/g,n=function(t){return t[1].toUpperCase()},r={};for(var o in t)r[o]=t[o],r[o.replace(e,n)]=t[o];return r}var Vr=Wr({"animation-delay":Ur,"animation-duration":Ur,"background-position":Fr,"background-position-x":Fr,"background-position-y":Fr,"background-size":Fr,border:Fr,"border-bottom":Fr,"border-bottom-left-radius":Fr,"border-bottom-right-radius":Fr,"border-bottom-width":Fr,"border-left":Fr,"border-left-width":Fr,"border-radius":Fr,"border-right":Fr,"border-right-width":Fr,"border-top":Fr,"border-top-left-radius":Fr,"border-top-right-radius":Fr,"border-top-width":Fr,"border-width":Fr,"border-block":Fr,"border-block-end":Fr,"border-block-end-width":Fr,"border-block-start":Fr,"border-block-start-width":Fr,"border-block-width":Fr,"border-inline":Fr,"border-inline-end":Fr,"border-inline-end-width":Fr,"border-inline-start":Fr,"border-inline-start-width":Fr,"border-inline-width":Fr,"border-start-start-radius":Fr,"border-start-end-radius":Fr,"border-end-start-radius":Fr,"border-end-end-radius":Fr,margin:Fr,"margin-bottom":Fr,"margin-left":Fr,"margin-right":Fr,"margin-top":Fr,"margin-block":Fr,"margin-block-end":Fr,"margin-block-start":Fr,"margin-inline":Fr,"margin-inline-end":Fr,"margin-inline-start":Fr,padding:Fr,"padding-bottom":Fr,"padding-left":Fr,"padding-right":Fr,"padding-top":Fr,"padding-block":Fr,"padding-block-end":Fr,"padding-block-start":Fr,"padding-inline":Fr,"padding-inline-end":Fr,"padding-inline-start":Fr,"mask-position-x":Fr,"mask-position-y":Fr,"mask-size":Fr,height:Fr,width:Fr,"min-height":Fr,"max-height":Fr,"min-width":Fr,"max-width":Fr,bottom:Fr,left:Fr,top:Fr,right:Fr,inset:Fr,"inset-block":Fr,"inset-block-end":Fr,"inset-block-start":Fr,"inset-inline":Fr,"inset-inline-end":Fr,"inset-inline-start":Fr,"box-shadow":Fr,"text-shadow":Fr,"column-gap":Fr,"column-rule":Fr,"column-rule-width":Fr,"column-width":Fr,"font-size":Fr,"font-size-delta":Fr,"letter-spacing":Fr,"text-decoration-thickness":Fr,"text-indent":Fr,"text-stroke":Fr,"text-stroke-width":Fr,"word-spacing":Fr,motion:Fr,"motion-offset":Fr,outline:Fr,"outline-offset":Fr,"outline-width":Fr,perspective:Fr,"perspective-origin-x":qr,"perspective-origin-y":qr,"transform-origin":qr,"transform-origin-x":qr,"transform-origin-y":qr,"transform-origin-z":qr,"transition-delay":Ur,"transition-duration":Ur,"vertical-align":Fr,"flex-basis":Fr,"shape-margin":Fr,size:Fr,gap:Fr,grid:Fr,"grid-gap":Fr,"row-gap":Fr,"grid-row-gap":Fr,"grid-column-gap":Fr,"grid-template-rows":Fr,"grid-template-columns":Fr,"grid-auto-rows":Fr,"grid-auto-columns":Fr,"box-shadow-x":Fr,"box-shadow-y":Fr,"box-shadow-blur":Fr,"box-shadow-spread":Fr,"font-line-height":Fr,"text-shadow-x":Fr,"text-shadow-y":Fr,"text-shadow-blur":Fr});function Yr(t,e,n){if(null==e)return e;if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]=Yr(t,e[r],n);else if("object"==typeof e)if("fallbacks"===t)for(var o in e)e[o]=Yr(o,e[o],n);else for(var i in e)e[i]=Yr(t+"-"+i,e[i],n);else if("number"==typeof e&&!1===isNaN(e)){var a=n[t]||Vr[t];return!a||0===e&&a===Fr?e.toString():"function"==typeof a?a(e).toString():""+e+a}return e}const Xr=function(t){void 0===t&&(t={});var e=Wr(t);return{onProcessStyle:function(t,n){if("style"!==n.type)return t;for(var r in t)t[r]=Yr(r,t[r],e);return t},onChangeValue:function(t,n){return Yr(n,t,e)}}};var Zr={"background-size":!0,"background-position":!0,border:!0,"border-bottom":!0,"border-left":!0,"border-top":!0,"border-right":!0,"border-radius":!0,"border-image":!0,"border-width":!0,"border-style":!0,"border-color":!0,"box-shadow":!0,flex:!0,margin:!0,padding:!0,outline:!0,"transform-origin":!0,transform:!0,transition:!0},Jr={position:!0,size:!0},Kr={padding:{top:0,right:0,bottom:0,left:0},margin:{top:0,right:0,bottom:0,left:0},background:{attachment:null,color:null,image:null,position:null,repeat:null},border:{width:null,style:null,color:null},"border-top":{width:null,style:null,color:null},"border-right":{width:null,style:null,color:null},"border-bottom":{width:null,style:null,color:null},"border-left":{width:null,style:null,color:null},outline:{width:null,style:null,color:null},"list-style":{type:null,position:null,image:null},transition:{property:null,duration:null,"timing-function":null,timingFunction:null,delay:null},animation:{name:null,duration:null,"timing-function":null,timingFunction:null,delay:null,"iteration-count":null,iterationCount:null,direction:null,"fill-mode":null,fillMode:null,"play-state":null,playState:null},"box-shadow":{x:0,y:0,blur:0,spread:0,color:null,inset:null},"text-shadow":{x:0,y:0,blur:null,color:null}},Gr={border:{radius:"border-radius",image:"border-image",width:"border-width",style:"border-style",color:"border-color"},"border-bottom":{width:"border-bottom-width",style:"border-bottom-style",color:"border-bottom-color"},"border-top":{width:"border-top-width",style:"border-top-style",color:"border-top-color"},"border-left":{width:"border-left-width",style:"border-left-style",color:"border-left-color"},"border-right":{width:"border-right-width",style:"border-right-style",color:"border-right-color"},background:{size:"background-size",image:"background-image"},font:{style:"font-style",variant:"font-variant",weight:"font-weight",stretch:"font-stretch",size:"font-size",family:"font-family",lineHeight:"line-height","line-height":"line-height"},flex:{grow:"flex-grow",basis:"flex-basis",direction:"flex-direction",wrap:"flex-wrap",flow:"flex-flow",shrink:"flex-shrink"},align:{self:"align-self",items:"align-items",content:"align-content"},grid:{"template-columns":"grid-template-columns",templateColumns:"grid-template-columns","template-rows":"grid-template-rows",templateRows:"grid-template-rows","template-areas":"grid-template-areas",templateAreas:"grid-template-areas",template:"grid-template","auto-columns":"grid-auto-columns",autoColumns:"grid-auto-columns","auto-rows":"grid-auto-rows",autoRows:"grid-auto-rows","auto-flow":"grid-auto-flow",autoFlow:"grid-auto-flow",row:"grid-row",column:"grid-column","row-start":"grid-row-start",rowStart:"grid-row-start","row-end":"grid-row-end",rowEnd:"grid-row-end","column-start":"grid-column-start",columnStart:"grid-column-start","column-end":"grid-column-end",columnEnd:"grid-column-end",area:"grid-area",gap:"grid-gap","row-gap":"grid-row-gap",rowGap:"grid-row-gap","column-gap":"grid-column-gap",columnGap:"grid-column-gap"}};function Qr(t,e,n,r){return null==n[e]?t:0===t.length?[]:Array.isArray(t[0])?Qr(t[0],e,n,r):"object"==typeof t[0]?function(t,e,n){return t.map(function(t){return to(t,e,n,!1,!0)})}(t,e,r):[t]}function to(t,e,n,r,o){if(!Kr[e]&&!Gr[e])return[];var i=[];if(Gr[e]&&(t=function(t,e,n,r){for(var o in n){var i=n[o];if(void 0!==t[o]&&(r||!e.prop(i))){var a,s=eo((a={},a[i]=t[o],a),e)[i];r?e.style.fallbacks[i]=s:e.style[i]=s}delete t[o]}return t}(t,n,Gr[e],r)),Object.keys(t).length)for(var a in Kr[e])t[a]?Array.isArray(t[a])?i.push(null===Jr[a]?t[a]:t[a].join(" ")):i.push(t[a]):null!=Kr[e][a]&&i.push(Kr[e][a]);return!i.length||o?i:[i]}function eo(t,e,n){for(var r in t){var o=t[r];if(Array.isArray(o)){if(!Array.isArray(o[0])){if("fallbacks"===r){for(var i=0;i<t.fallbacks.length;i++)t.fallbacks[i]=eo(t.fallbacks[i],e,!0);continue}t[r]=Qr(o,r,Zr,e),t[r].length||delete t[r]}}else if("object"==typeof o){if("fallbacks"===r){t.fallbacks=eo(t.fallbacks,e,!0);continue}t[r]=to(o,r,e,n),t[r].length||delete t[r]}else""===t[r]&&delete t[r]}return t}const no=function(){return{onProcessStyle:function(t,e){if(!t||"style"!==e.type)return t;if(Array.isArray(t)){for(var n=0;n<t.length;n++)t[n]=eo(t[n],e);return t}return eo(t,e)}}};function ro(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function oo(t){return function(t){if(Array.isArray(t))return ro(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ro(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ro(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var io="",ao="",so="",lo="",co=Fe&&"ontouchstart"in document.documentElement;if(Fe){var po={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},ho=document.createElement("p").style;for(var uo in po)if(uo+"Transform"in ho){io=uo,ao=po[uo];break}"Webkit"===io&&"msHyphens"in ho&&(io="ms",ao=po.ms,lo="edge"),"Webkit"===io&&"-apple-trailing-word"in ho&&(so="apple")}var fo=io,mo=ao,go=so,bo=lo,yo=co;var wo={noPrefill:["appearance"],supportedProperty:function(t){return"appearance"===t&&("ms"===fo?"-webkit-"+t:mo+t)}},_o={noPrefill:["color-adjust"],supportedProperty:function(t){return"color-adjust"===t&&("Webkit"===fo?mo+"print-"+t:t)}},Ao=/[-\s]+(.)?/g;function xo(t,e){return e?e.toUpperCase():""}function vo(t){return t.replace(Ao,xo)}function ko(t){return vo("-"+t)}var Co,Eo={noPrefill:["mask"],supportedProperty:function(t,e){if(!/^mask/.test(t))return!1;if("Webkit"===fo){var n="mask-image";if(vo(n)in e)return t;if(fo+ko(n)in e)return mo+t}return t}},So={noPrefill:["text-orientation"],supportedProperty:function(t){return"text-orientation"===t&&("apple"!==go||yo?t:mo+t)}},Mo={noPrefill:["transform"],supportedProperty:function(t,e,n){return"transform"===t&&(n.transform?t:mo+t)}},Bo={noPrefill:["transition"],supportedProperty:function(t,e,n){return"transition"===t&&(n.transition?t:mo+t)}},To={noPrefill:["writing-mode"],supportedProperty:function(t){return"writing-mode"===t&&("Webkit"===fo||"ms"===fo&&"edge"!==bo?mo+t:t)}},Lo={noPrefill:["user-select"],supportedProperty:function(t){return"user-select"===t&&("Moz"===fo||"ms"===fo||"apple"===go?mo+t:t)}},Io={supportedProperty:function(t,e){return!!/^break-/.test(t)&&("Webkit"===fo?"WebkitColumn"+ko(t)in e&&mo+"column-"+t:"Moz"===fo&&("page"+ko(t)in e&&"page-"+t))}},Oo={supportedProperty:function(t,e){if(!/^(border|margin|padding)-inline/.test(t))return!1;if("Moz"===fo)return t;var n=t.replace("-inline","");return fo+ko(n)in e&&mo+n}},Ho={supportedProperty:function(t,e){return vo(t)in e&&t}},No={supportedProperty:function(t,e){var n=ko(t);return"-"===t[0]||"-"===t[0]&&"-"===t[1]?t:fo+n in e?mo+t:"Webkit"!==fo&&"Webkit"+n in e&&"-webkit-"+t}},Ro={supportedProperty:function(t){return"scroll-snap"===t.substring(0,11)&&("ms"===fo?""+mo+t:t)}},zo={supportedProperty:function(t){return"overscroll-behavior"===t&&("ms"===fo?mo+"scroll-chaining":t)}},Po={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},$o={supportedProperty:function(t,e){var n=Po[t];return!!n&&(fo+ko(n)in e&&mo+n)}},Do={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},jo=Object.keys(Do),Fo=function(t){return mo+t},Uo={supportedProperty:function(t,e,n){var r=n.multiple;if(jo.indexOf(t)>-1){var o=Do[t];if(!Array.isArray(o))return fo+ko(o)in e&&mo+o;if(!r)return!1;for(var i=0;i<o.length;i++)if(!(fo+ko(o[0])in e))return!1;return o.map(Fo)}return!1}},qo=[wo,_o,Eo,So,Mo,Bo,To,Lo,Io,Oo,Ho,No,Ro,zo,$o,Uo],Wo=qo.filter(function(t){return t.supportedProperty}).map(function(t){return t.supportedProperty}),Vo=qo.filter(function(t){return t.noPrefill}).reduce(function(t,e){return t.push.apply(t,oo(e.noPrefill)),t},[]),Yo={};if(Fe){Co=document.createElement("p");var Xo=window.getComputedStyle(document.documentElement,"");for(var Zo in Xo)isNaN(Zo)||(Yo[Xo[Zo]]=Xo[Zo]);Vo.forEach(function(t){return delete Yo[t]})}function Jo(t,e){if(void 0===e&&(e={}),!Co)return t;if(null!=Yo[t])return Yo[t];"transition"!==t&&"transform"!==t||(e[t]=t in Co.style);for(var n=0;n<Wo.length&&(Yo[t]=Wo[n](t,Co.style,e),!Yo[t]);n++);try{Co.style[t]=""}catch(t){return!1}return Yo[t]}var Ko,Go={},Qo={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},ti=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;function ei(t,e,n){if("var"===e)return"var";if("all"===e)return"all";if("all"===n)return", all";var r=e?Jo(e):", "+Jo(n);return r||(e||n)}function ni(t,e){var n=e;if(!Ko||"content"===t)return e;if("string"!=typeof n||!isNaN(parseInt(n,10)))return n;var r=t+n;if(null!=Go[r])return Go[r];try{Ko.style[t]=n}catch(t){return Go[r]=!1,!1}if(Qo[t])n=n.replace(ti,ei);else if(""===Ko.style[t]&&("-ms-flex"===(n=mo+n)&&(Ko.style[t]="-ms-flexbox"),Ko.style[t]=n,""===Ko.style[t]))return Go[r]=!1,!1;return Ko.style[t]="",Go[r]=n,Go[r]}Fe&&(Ko=document.createElement("p"));const ri=function(){function t(e){for(var n in e){var r=e[n];if("fallbacks"===n&&Array.isArray(r))e[n]=r.map(t);else{var o=!1,i=Jo(n);i&&i!==n&&(o=!0);var a=!1,s=ni(i,tn(r));s&&s!==r&&(a=!0),(o||a)&&(o&&delete e[n],e[i||n]=s||r)}}return e}return{onProcessRule:function(t){if("keyframes"===t.type){var e=t;e.at=function(t){return"-"===t[1]||"ms"===fo?t:"@"+mo+"keyframes"+t.substr(10)}(e.at)}},onProcessStyle:function(e,n){return"style"!==n.type?e:t(e)},onChangeValue:function(t,e){return ni(e,tn(t))||t}}};const oi=function(){var t=function(t,e){return t.length===e.length?t>e?1:-1:t.length-e.length};return{onProcessStyle:function(e,n){if("style"!==n.type)return e;for(var r={},o=Object.keys(e).sort(t),i=0;i<o.length;i++)r[o[i]]=e[o[i]];return r}}};const ii=function(t){return void 0===t&&(t={}),{plugins:[pr(),fr(t.observable),br(),kr(),Mr(),Ir(),Hr(),jr(),Xr(t.defaultUnit),no(),ri(),oi()]}};var ai=a(89343),si={};si.setAttributes=p(),si.insert=c().bind(null,"head"),si.domAPI=s(),si.insertStyleElement=u();o()(ai.A,si);ai.A&&ai.A.locals&&ai.A.locals;class li{constructor(t,e){this.createResizer=t=>{const e=document.createElement("div");return e.className=t,e.classList.add("resizer"),e};const{keepRatio:n,container:r=document.body,onResize:o,minWidth:i,minHeight:a,rotate:s}=e;this.querySelector=t,this.keepRatio=n,this.container=r,this.isImage=!1,this.rotate=s,this.canKeepRatio=!1,this.mounted=!1,this.onResize=o,this.minimum_size=i,this.minimum_height=a||10,this.axis="x",this.resizers=[],this.clickedResizer=null,this.element,this.isMouseDown=!1,this.original_width=0,this.original_height=0,this.original_x=0,this.original_y=0,this.original_mouse_x=0,this.original_mouse_y=0,this.onDraggable=this.onDraggable.bind(this),this.resize=this.resize.bind(this),this.stopResize=this.stopResize.bind(this),this.onClickedTarget=this.onClickedTarget.bind(this),this.rePosition=this.rePosition.bind(this),this.init=this.init.bind(this),this.onClickResizer=this.onClickResizer.bind(this),this.init()}onClickResizer(t){this.clickedResizer=t.target,t.preventDefault(),this.isMouseDown=!0;const e=this.element.getBoundingClientRect();this.original_width=parseFloat(e.width),this.original_height=parseFloat(e.height),this.original_x=this.element.getBoundingClientRect().left,this.original_y=this.element.getBoundingClientRect().top,this.original_mouse_x=t.pageX,this.original_mouse_y=t.pageY,window.addEventListener("mousemove",this.resize),window.addEventListener("mouseup",this.stopResize)}createSizePreview(){const t=document.createElement("div");return t.classList.add("size-preview"),t}createImageRatioResizer(){const t=document.createElement("div");return t.classList.add("img-ratio-resizer"),t.classList.add("bottom-right"),t}createBorder(t){const e=document.createElement("div");if(e.classList.add("resizable-border"),e.classList.add(t),"bottom"===t){const t=document.createElement("div");t.classList.add("bottom-ruler"),e.appendChild(t)}if("top"===t){const t=document.createElement("div");t.classList.add("top-ruler"),e.appendChild(t)}if("left"===t){const t=document.createElement("div");t.classList.add("left-ruler"),e.appendChild(t)}if("right"===t){const t=document.createElement("div");t.classList.add("right-ruler"),e.appendChild(t)}return e}init(){this.sizePreview=this.createSizePreview(),this.imageRatioResizer=this.createImageRatioResizer(),this.imageRatioResizer.addEventListener("mousedown",this.onClickResizer),this.borders=[this.createBorder("left"),this.createBorder("right"),this.createBorder("bottom"),this.createBorder("top")];const t=this.resizers=[this.createResizer("bottom-center"),this.createResizer("left-center"),this.createResizer("right-center"),this.createResizer("bottom-left"),this.createResizer("bottom-right"),this.createResizer("top-right"),this.createResizer("top-left")];this.rotate&&t.push(this.createResizer("rotate"));for(let e=0;e<t.length;e++)t[e].addEventListener("mousedown",this.onClickResizer);window.addEventListener("mousedown",this.onClickedTarget)}onDraggable(t){this.stopResize(t)}onClickedTarget(t){if(this.isMouseDown)return;let e=t.target;const n=t.path?t.path:t.composedPath&&t.composedPath();Array.isArray(n)&&n.length>0&&(e=n[0]);for(let t=0;t<this.resizers.length;t++){const n=this.resizers[t];if(e.closest("."+n.className.split(" ").join(".")))return}const r=e.closest(this.querySelector);r?(this.stopResize(t),this.mounted=!0,this.canKeepRatio=!1,this.isImage=!1,this.axis="xy"===r.getAttribute("cdtr-resize-axis")?"xy":"x",this.isImage?(document.body.appendChild(this.imageRatioResizer),this.resizers.forEach(t=>t.remove())):(this.resizers.forEach(t=>{this.canResizeY()||!t.classList.contains("bottom-center")?document.body.appendChild(t):t.remove()}),this.imageRatioResizer.remove()),this.borders.forEach(t=>document.body.appendChild(t)),this.element=r,this.element.addEventListener("drag",this.onDraggable),this.rePosition(),this.container?.addEventListener("scroll",this.rePosition),window.addEventListener("scroll",this.rePosition),window.addEventListener("resize",this.rePosition)):this.stopResize(t)}stopResize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.borders.forEach(t=>t.classList.remove("on-resizing")),this.isMouseDown=!1,this.sizePreview.remove(),window.removeEventListener("mouseup",this.stopResize),window.removeEventListener("mousemove",this.resize),this.mounted&&"mouseup"===t.type||(this.mounted=!1,this.borders.forEach(t=>t.remove()),this.resizers.forEach(t=>t.remove()),this.element?.removeEventListener("drag",this.onDraggable),this.imageRatioResizer.remove(),this.container?.removeEventListener("scroll",this.rePosition),window.removeEventListener("scroll",this.rePosition),window.removeEventListener("resize",this.rePosition),this.element=null)}canResizeY(){return"xy"===this.axis}heightFromDrag(t){let e=this.original_height+(t.pageY-this.original_mouse_y);return e<this.minimum_height&&(e=this.minimum_height),e+"px"}resize(t){if(this.borders.forEach(t=>t.classList.add("on-resizing")),document.body.appendChild(this.sizePreview),this.sizePreview.style.left=t.clientX+50+"px",this.sizePreview.style.top=t.clientY+"px",this.clickedResizer.classList.contains("left-center")){let e=this.original_width-(t.pageX-this.original_mouse_x);e+="px",this.onResize(this.element,{width:e})}else if(this.clickedResizer.classList.contains("right-center")){let e=this.original_width+(t.pageX-this.original_mouse_x);e>this.minimum_size&&(e+="px",this.onResize(this.element,{width:e}))}else if(this.clickedResizer.classList.contains("bottom-center")){const e=this.keepRatio&&this.canKeepRatio?"auto":this.heightFromDrag(t);this.onResize(this.element,{height:e})}else if(this.clickedResizer.classList.contains("bottom-right")){const e={};let n=this.original_width+(t.pageX-this.original_mouse_x);n>this.minimum_size&&(e.width=n+"px"),this.canResizeY()&&(e.height=this.heightFromDrag(t)),(e.width||e.height)&&this.onResize(this.element,e)}else if(this.clickedResizer.classList.contains("bottom-left")){const e={width:this.original_width-(t.pageX-this.original_mouse_x)+"px"};this.canResizeY()&&(e.height=this.heightFromDrag(t)),this.onResize(this.element,e)}else if(this.clickedResizer.classList.contains("top-right")){let e=this.original_width+(t.pageX-this.original_mouse_x);e>this.minimum_size&&(e+="px",this.onResize(this.element,{width:e}))}else if(this.clickedResizer.classList.contains("top-left")){let e=this.original_width-(t.pageX-this.original_mouse_x);e>this.minimum_size&&(e+="px",this.onResize(this.element,{width:e}))}else if(this.clickedResizer.classList.contains("rotate")){const{clientY:e,clientX:n}=t,r=this.element.getBoundingClientRect(),o=Math.atan2(e-r.y,n-r.x);this.element.style.transform=`rotate(${o}rad)`}this.rePosition()}rePosition(){window.requestAnimationFrame(()=>{if(!this.element)return;const t=this.element.getBoundingClientRect();if(this.sizePreview&&(this.sizePreview.innerHTML=this.canResizeY()?`w:${parseInt(t.width)} h:${parseInt(t.height)}`:`w:${parseInt(t.width)}`),this.borders.forEach(e=>{if(e.classList.contains("left"))e.style.width="1px",e.style.left=t.left+"px",e.style.top=t.top+"px",e.style.height=t.height+"px";else if(e.classList.contains("right"))e.style.width="1px",e.style.left=t.right+"px",e.style.top=t.top+"px",e.style.height=t.height+"px";else if(e.classList.contains("top")){e.style.left=t.left+"px",e.style.top=t.top+"px",e.style.width=t.width+"px",e.style.height="1px";const n=e.querySelector(".top-ruler");n&&(n.style.top=t.top+"px")}else if(e.classList.contains("bottom")){e.style.height="1px",e.style.left=t.left+"px",e.style.top=t.bottom+"px",e.style.width=t.width+"px";const n=e.querySelector(".bottom-ruler");n&&(n.style.top=t.bottom+"px")}}),this.isImage)this.imageRatioResizer.style.left=t.left+t.width+"px",this.imageRatioResizer.style.top=t.bottom+"px";else for(let e=0;e<this.resizers.length;e++){const n=this.resizers[e];n.classList.contains("bottom-left")?(n.style.left=t.left+"px",n.style.top=t.bottom+"px"):n.classList.contains("bottom-right")?(n.style.left=t.right+"px",n.style.top=t.bottom+"px"):n.classList.contains("top-right")?(n.style.left=t.right+"px",n.style.top=t.top+"px"):n.classList.contains("top-left")?(n.style.left=t.left+"px",n.style.top=t.top+"px"):n.classList.contains("left-center")?(n.style.left=t.left+"px",n.style.top=(t.top+t.bottom)/2+"px"):n.classList.contains("right-center")?(n.style.left=t.right+"px",n.style.top=(t.top+t.bottom)/2+"px"):n.classList.contains("bottom-center")?(n.style.left=(t.left+t.right)/2+"px",n.style.top=t.bottom+"px"):n.classList.contains("rotate")&&(n.style.left=(t.left+t.right)/2+"px",n.style.top=t.top-60+"px")}})}}var ci=a(64749);class di{constructor(t,e){e||(e={}),this.querySelector=t,this.pose={initX:0,initY:0,firstX:0,firstY:0},this.onMouseMove=t=>{if(this.target){if("ghost"===e.mode){this.target.style.zIndex=-1;const n=this.getHoverElement(t);if(e.drop&&n){const t=n.closest(e.drop);t&&e.drop&&"function"==typeof e.onHover?e.onHover({drag:this.originalTarget,drop:t}):"function"==typeof e.onHoverout&&e.onHoverout()}this.target.style.zIndex=9999999}const n=this.target.getBoundingClientRect();let r=this.pose.initY+t.pageY-this.pose.firstY,o=this.pose.initX+t.pageX-this.pose.firstX;e.maxTop&&e.maxTop>r&&(r=e.maxTop),r<=0&&(r=0),r>window.innerHeight-n.height&&(r=window.innerHeight-n.height),o<=0&&(o=0),o+n.width>=window.innerWidth&&(o=window.innerWidth-n.width),this.target.style.left=o+"px",this.target.style.top=r+"px"}else window.removeEventListener("mousemove",this.onMouseMove,!1)},this.onMouseDown=t=>{if(1!==t.which)return;Array.from(document.querySelectorAll("[mode='ghost']")).forEach(t=>t.remove());const n=t.target,r=n.closest(this.querySelector);if(!r)return null;const o=r.getAttribute("handle");if(o){if(!n.closest(o))return null}this.target=r,this.originalTarget=r;const i=r.getBoundingClientRect();"ghost"===e.mode&&(this.target=r.cloneNode(!0),this.target.mode="ghost",this.target.setAttribute("mode","ghost"),this.target.setAttribute("style",(0,ci.i)({position:"fixed",zIndex:-1,width:i.width+"px",maxWidth:"initial",minWidth:"initial",left:i.left+"px",top:i.top+"px",opacity:.5})),document.body.appendChild(this.target)),this.pose.initX=r.offsetLeft||i.left,this.pose.initY=r.offsetTop||i.top,this.pose.firstX=t.pageX,this.pose.firstY=t.pageY,window.addEventListener("mousemove",this.onMouseMove,!1),window.addEventListener("mouseup",t=>{const n=this.getHoverElement(t);if(e.drop){const t=n.closest(e.drop);t&&"function"==typeof e.onAcceptDrop&&e.onAcceptDrop({drag:this.originalTarget,drop:t}),"function"==typeof e.onDrop&&e.onDrop({drag:this.originalTarget})}window.removeEventListener("mousemove",this.onMouseMove,!1),"ghost"===e.mode&&this.target&&this.target.remove(),this.target=null},{once:!0})},this.start()}getHoverElement(t){this.target&&(this.target.style.zIndex=-1);return document.elementFromPoint(t.clientX,t.clientY)}start(){document.body.addEventListener("mousedown",this.onMouseDown)}destroy(){document.body.removeEventListener("mousedown",this.onMouseDown)}}var pi=a(39148),hi={};hi.setAttributes=p(),hi.insert=c().bind(null,"head"),hi.domAPI=s(),hi.insertStyleElement=u();o()(pi.A,hi);const ui=pi.A&&pi.A.locals?pi.A.locals:void 0;function fi(t){if("buttons"in(t=t||window.event))return 1===t.buttons;return 1===(t.which||t.button)}const mi=function(t,e,r){if(!t)return;let o,i;i=t.cloneNode(!0),t.parentElement?t=i.getBoundingClientRect():(document.body.appendChild(i),i.style=`\n width:${t.style.width||"100px"};\n height:${t.style.height||"100px"};\n background:var(--primary);\n opacity:.4;\n `,o={...i.getBoundingClientRect()},o.left=e,o.top=r),i.remove();const a=(0,n.A)("div",null,i.cloneNode(!0));["cdtr-move-handle-bar","[data-mounted]"].forEach(t=>{a.querySelectorAll(t).forEach(t=>t.remove())});const s=a.querySelector(".selected");return s&&s.classList.remove("selected"),o&&(a.style.position="fixed",a.classList.add("mirror"),a.style.opacity=1,a.style.zIndex=999999999,a.style.overflow="hidden",a.style.transition="all 1s",a.style.width=`${o.width}px`,a.style.height=`${o.height}px`,a.style.border="1px solid #484553b3",a.style.top=`${o.top}px`,a.style.left=`${o.left}px`,a.__offsetX=e-o.left,a.__offsetY=r-o.top),document.body.appendChild(a),setTimeout(()=>{a.style.transform="rotate(10deg)"},100),a},gi="touchmove",bi="mousemove",yi="mouseup",wi="mousedown",_i="touchend",Ai="touchstart",xi="left",vi="right",ki="top",Ci="bottom",Ei="__sortable_draggable-guide-line";var Si=a(20195);const Mi="15PX";function Bi(t,e){if(t.closest("[data-draggable-for]")){const e=t.dataset.draggableFor;if(e){let t=j.Ay.getComponent(e);if(t){if("card"===t.type){const e=t.closest("col");e&&(t=e)}return t.element}}}let n,r=t;for(;r||!n;){let t;if(r&&(t=r.closest(e)),t){n=t;break}r=r.parentElement||r.offsetParent}return n}class Ti{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.createGuideLine(),this.onMouseUp=this.onMouseUp.bind(this),this.dragStart=this.dragStart.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.dragEnd=this.dragEnd.bind(this),this.moveY=0,this.moveX=0,this.isValid=!0,this.mouseUp=!1,this.optionsInit(t),this.init()}optionsInit(t){this.options={draggable:t.draggable,handle:t.handle,delay:"number"==typeof t.delay?t.delay:0,preventDefault:t.preventDefault,direction:t.direction,onStart:t.onStart,finally:t.finally,on:t.on,onMove:t.onMove,onClone:t.onClone,onEnd:t.onEnd,body:t.body||document.body,clone:t.clone,group:t.group,sort:t.sort}}createGuideLine(){this.guideLine=document.createElement("div"),this.guideLine.className=Ei,this.guideLine.classList.add(ui.guideLine),this.guideLine.style.position="absolute",this.guideLine.style.opacity=1,this.guideLine.style.border="1px solid blue"}init(){this.bindDrag()}dragEnd(){if(this.dragStarted=!1,this.styles&&this.styles.remove(),this.mouseUp=!0,this.mirror&&(this.mirror.remove(),this.mirror=null),this.guideLine.remove(),this.guideLine.style.left="-9999px",this.guideLine.style.top="-9999px",document.removeEventListener(bi,this.onMouseMove),document.removeEventListener(gi,this.onMouseMove,{passive:!1}),document.removeEventListener(yi,this.dragEnd),document.removeEventListener(_i,this.dragEnd),this.dragEl&&this.dragEl.classList.remove(ui.whileDragging),this.options.clone&&cloneEl.remove(),this.direction&&this.dropEl){const t=!0===this.options.clone?this.dragEl.cloneNode(!0):this.dragEl;!0===this.options.clone&&"function"==typeof this.options.onClone&&this.options.onClone({clone:this.cloneEl});let e=this.direction;if("left"===e?e="beforebegin":"right"===e&&(e="afterend"),this.isValid&&"function"==typeof this.options.onEnd){this.dragEl;this.options.onEnd({item:this.dragEl,dragType:this.dragEl.getAttribute("draggable-element"),dropType:this.dropEl.getAttribute("droppable-element"),clone:t,to:this.dropEl,direction:this.direction})}this.dragEl=null,this.dropEl=null}}onMouseMove(t){if(t.preventDefault(),this.isValid=!0,t.type===bi&&!fi(t))return this.guideLine.remove(),void document.removeEventListener(bi,this.onMouseMove);const e=t.type===gi?t.touches[0].clientY:t.clientY,n=t.type===gi?t.touches[0].clientX:t.clientX,r=t.type===gi?t.touches[0].pageY:t.pageY;e<this.moveY?this.mouseDirection=ki:e>this.moveY&&(this.mouseDirection=Ci),this.moveY=e,this.moveX=n;const o=()=>{"string"==typeof this.options.body&&(this.options.body=document.querySelector(this.options.body));let t=this.options.body;this.mirror&&this.moveY<100&&this.mouseDirection===ki?(t.scroll(0,t.scrollTop-1),setTimeout(()=>{o()},100)):this.mirror&&window.innerHeight-this.moveY<100&&this.mouseDirection===Ci&&(t.scroll(0,t.scrollTop+1),setTimeout(()=>{o()},100))};this.mirror&&this.dragEl&&(this.mirror.style.left=n-document.body.offsetLeft-this.mirror.__offsetX+"px",this.mirror.style.top=e-document.body.offsetTop-this.mirror.__offsetY+"px",this.mirror.style.display="none");let i,a=document.elementsFromPoint(n,e);if(this.mirror&&(this.mirror.style.display="block"),o(),a=a.map(t=>t.closest("[droppable-element]")).filter(t=>t),0===a.length)return;let s=0;i=a[s],this.targets=a;const l=t=>{this.dragEl.closest("[droppable-element]")?.getAttribute("droppable-element");if(t=t.closest("[droppable-element]"),this.dragEl&&this.dragEl.getAttribute("data-drop-only")){const e=t.closest(`[data-type='${this.dragEl.getAttribute("data-drop-only")}']`);e&&(t=e)}const e=t.getAttribute("droppable-element"),n=t.getAttribute("droppable-if"),o=t.getAttribute("droppable-direction")||"top,bottom,left,right",i=this.dragEl.getAttribute("draggable-direction")||"top,bottom";t.getAttribute("droppable-bottom");if("col"===this.dragEl.dataset.type&&"col"!==t.dataset.type){if(!(t=t.closest("[droppable-element='col']")))return;this.dropEl=t}let c=t.getBoundingClientRect();if("section"===e&&"section"!==this.dragEl.dataset.dropOnly){const e=t.querySelector("[data-type='block']:last-child");if(e){const t=e.getBoundingClientRect();return this.direction=Ci,this.dropEl=e,this.guideLine.style.top=`${r-r+window.pageYOffset+t.top+t.height}px`,this.guideLine.style.left=`${t.left}px`,this.guideLine.style.height=Mi,this.guideLine.style.width=`${t.width}px`,this.guideLine.style.opacity=1,void document.body.appendChild(this.guideLine)}}if(-1===o.indexOf("bottom")&&-1===o.indexOf("top")||-1===i.indexOf("bottom")&&-1===i.indexOf("top")||(this.guideLine.style.opacity=1,this.guideLine.style.width=`${c.width}px`,this.guideLine.style.height=Mi),"none"!==o&&-1!==o.indexOf("bottom")&&-1!==i.indexOf("bottom")&&c.bottom>this.moveY&&c.bottom-c.height/2<this.moveY&&(this.direction=Ci,this.dropEl=t,this.guideLine.style.top=`${r-r+window.pageYOffset+c.top+c.height}px`,this.guideLine.style.left=`${c.left}px`),"none"!==o&&-1!==o.indexOf("top")&&-1!==i.indexOf("top")&&c.top<this.moveY&&c.top+c.height/2>this.moveY&&(this.dropEl=t,this.direction=ki,this.guideLine.style.top=`${r-r+window.pageYOffset+c.top}px`,this.guideLine.style.left=`${c.left}px`),"none"!==o&&o.indexOf("left")>-1&&i.indexOf("left")>-1&&c.top<this.moveY&&c.left<this.moveX&&c.left+c.width/4>this.moveX&&(this.dropEl=t,this.direction=xi,this.guideLine.style.height=c.height+"px",this.guideLine.style.width=Mi,this.guideLine.style.top=`${r-r+window.pageYOffset+c.top}px`,this.guideLine.style.left=`${c.left}px`),"none"!==o&&o.indexOf("right")>-1&&i.indexOf("right")>-1&&c.top<this.moveY&&c.right-c.width/4<this.moveX&&(this.dropEl=t,this.direction=vi,this.guideLine.style.height=c.height+"px",this.guideLine.style.width=Mi,this.guideLine.style.top=`${r-r+window.pageYOffset+c.top}px`,this.guideLine.style.left=`${c.left+c.width}px`),n&&"empty"===n){this.guideLine.style.opacity=.5;const e=j.Ay.getComponent(t.dataset.id);if(!e)return console.error("compoent not founded");if(0===e.children.length){this.direction=ki,this.dropEl=t;const e=t.getBoundingClientRect(),n=(100>e.height&&e.height,1320>e.width?e.width:1320);this.guideLine.style.width=n+"px",this.guideLine.style.top=e.top+"px",this.guideLine.style.left=e.left+e.width/2-n/2+"px",document.body.appendChild(this.guideLine)}}if("none"!==o){var d=this.direction;if(this.guideLine.classList.remove(ui.bottomMode),-1===o.indexOf(d)){if(s<a.length-1)return s++,l(a[s])}else document.body.appendChild(this.guideLine)}};if(l(i),"function"==typeof this.options.onMove){const t=this.options.onMove({item:this.dragEl,to:this.dropEl||i,guideLine:this.guideLine,direction:this.direction,targets:this.targets,dragType:this.dragEl.getAttribute("draggable-element"),dropType:(this.dropEl||i).getAttribute("droppable-element")});if("boolean"==typeof t&&!t)return this.guideLine.remove(),this.isValid=!1,!1;this.dragStarted||(this.dragStarted=!0,"function"==typeof this.options.onStart&&this.options.onStart({item:this.dragEl,dragType:this.dragEl.getAttribute("draggable-element"),dropType:(this.dropEl||i).getAttribute("droppable-element"),direction:this.direction}))}}onMouseUp(){"function"==typeof this.options.finally&&this.options.finally(),this.mouseUp||this.dragEnd(),clearTimeout(this.pressDelay),document.removeEventListener(yi,this.onMouseUp)}dragStart(t){let e;if(this.mouseUp=!1,this.isValid=!0,t.type===wi&&!fi(t))return;this.can=!0;const r=()=>{let r,o=window.__dragoned_selected_element||t.originalTarget||t.target;if(window.__dragoned_selected_element&&(r=window.__dragoned_selected_element,delete window.__dragoned_selected_element),t.target.for){document.querySelector(`[data-id="${t.target.for}"]`)}const i=t.path?t.path:t.composedPath&&t.composedPath();Array.isArray(i)&&i.length>0&&(o=i[0]);let a=!1;if(o instanceof HTMLElement&&(a=!0),!a)for(var s in o)o.hasOwnProperty(s)&&(a=!0);try{o.parentElement}catch(t){a=!1}if(!a)return;if(this.options.handle&&o&&"function"==typeof o.closest&&(e=o.closest(this.options.handle),!e))return this.guideLine.remove(),!1;document.body.appendChild(this.guideLine);const l=t.type===Ai?t.touches[0].clientY:t.clientY,c=t.type===Ai?t.touches[0].clientX:t.clientX;let d=t.path?t.path:t.composedPath&&t.composedPath();if(!r){Array.isArray(d)&&0===d.length&&(d=[t.originalTarget||t.target]);for(let t=0;t<d.length;t++){const e=d[t];if(r=Bi(e,"[draggable-element]"),r){this.dragEl=r;break}}}return r?(setTimeout(()=>{this.mouseUp||this.mirror||(this.mirror=mi(r.querySelector("[element-draggable-mirror]")||r.closest("[element-draggable-mirror]")||r.closest("[draggable-element]")||r,c,l),this.dragEl.classList.add(ui.whileDragging))},250),this.styles=(0,n.A)("style",null,"body{\n cursor: grabbing;\n }\n "),document.body.appendChild(this.styles),this.dragEl=r,document.addEventListener(bi,this.onMouseMove),document.addEventListener(yi,this.dragEnd),!0):(this.guideLine.remove(),!1)};document.addEventListener(yi,this.onMouseUp),this.pressDelay=setTimeout(()=>{if(!1===this.mouseUp){if(!r())return}},this.options.delay)}bindDrag(){Si.A.connect(Si.q.MOUSE_DOWN,this.dragStart)}destroy(){Si.A.disconnect(Si.q.MOUSE_DOWN,this.dragStart),this.mirror&&this.mirror.remove(),this.guideLine&&this.guideLine.remove()}}var Li=a(4807),Ii=a(3474),Oi=a(83965),Hi=a(67549);const Ni=t=>{let{item:e,to:n,direction:r,isNew:o}=t;const i=[],a=T.M.get("components",e.dataset.id),s=T.M.get("components",n.dataset.id),l=s.parent(),c=a.parent();let d=l.children.findIndex(t=>t===s.id);"right"===r&&d++;c.children.findIndex(t=>t===a.id);if("col"!==a.type){const t={type:"col",props:{lg:0,style:{}}},e=j.Ay.createComponent({body:t,parentId:l.id,index:d});i.push(new Li.A({componentId:e.id,parentId:l.id,index:d,body:t}));const o=c.children.findIndex(t=>t===a.id),s=new Ii.A({componentId:a.id,oldParentId:c.id,newParentId:e.id,oldIndex:o,newIndex:d});i.push(s),j.Ay.moveComponent(s),"left"===r?n.parentNode.insertBefore(e.element,n):"right"===r&&n.parentNode.insertBefore(e.element,n.nextSibling),e.appendChild(a.element)}else if("col"===a.type){const t=c.children.findIndex(t=>t===a.id),e=new Ii.A({componentId:a.id,oldParentId:c.id,newParentId:l.id,oldIndex:t,newIndex:d});i.push(e),j.Ay.moveComponent(e)}(0,Oi.i)(c).forEach(t=>i.push(t));{const t=s.closest("block");if(t){(0,Hi.s)(t).forEach(t=>i.push(t))}}{const t=c.closest("block");if(t){(0,Hi.s)(t).forEach(t=>i.push(t))}}return i};var Ri=a(81139);const zi=t=>{let{item:e,to:n,direction:r}=t;const o=[],i=T.M.get("components",e.dataset.id),a=i.parent(),s=a.children.findIndex(t=>t===i.id);T.M.get("components",n.dataset.id);let l=T.M.get("components",n.dataset.id),c=l.parent();if(i.id===l.id)return console.warn("cant move to itself"),null;let d=c.children.findIndex(t=>t===l.id);if("bottom"!==r&&"right"!==r||d++,"bottom"===r||"top"===r){const t={type:"row",props:{},children:[]};"col"!==i.type?t.children.push({type:"col",props:{lg:12},children:[]}):o.push(new Ri.A({componentId:i.id,key:"lg",value:12}));c.parent();const e=j.Ay.createComponent({body:t,parentId:c.id,index:d});o.push(new Li.A({componentId:e.id,parentId:c.id,index:d,body:t}));let n=T.M.get("components",e.children[0]);n||(n=e);const r=new Ii.A({componentId:i.id,newParentId:n.id,oldParentId:a.id,oldIndex:s,newIndex:0});j.Ay.moveComponent(r),o.push(r)}else if("left"===r||"right"===r){const t={type:"col",props:{lg:0},children:[]};let e=c,n=d;if("col"===c.type&&(j.Ay.updateComponent(c,"lg",0),o.push(new Ri.A({componentId:c.id,key:"lg",value:0})),e=c.parent(),n=e.children.findIndex(t=>t===c.id),-1===n))throw new Error("col not found in parent");"right"===r&&n++;const l=j.Ay.createComponent({body:t,parentId:e.id,index:n});o.push(new Li.A({componentId:l.id,parentId:e.id,index:n,body:t}));const p=new Ii.A({componentId:i.id,newParentId:l.id,oldParentId:a.id,oldIndex:s,newIndex:0});j.Ay.moveComponent(p),o.push(p)}(0,Oi.i)(a).forEach(t=>o.push(t));{const t=a.closest("block");if(t){(0,Hi.s)(t).forEach(t=>o.push(t))}}return o};var Pi=a(3832);const $i=t=>{let{item:e,to:n,direction:r}=t;const o=[],i=T.M.get("components",e.dataset.id),a=i.parent(),s=i.closest("block"),l=T.M.get("components",n.dataset.id),c=(l.parent(),l.closest("block")),d=c.closest("section");let p=d.children.findIndex(t=>t===c.id);const h=T.M.get("components",d.children[p]),u={type:"block",props:{style:h?.props?.style||{}},children:[{type:"col",props:{lg:0,style:{}}}]};"bottom"===r&&p++;const f=j.Ay.createComponent({body:u,parentId:d.id,index:p});o.push(new Li.A({componentId:f.id,parentId:d.id,index:p,body:u}));const m=f.children[0],g=a.children.findIndex(t=>t===i.id),b={componentId:i.id,oldParentId:a.id,newParentId:m,oldIndex:g,newIndex:0};o.push(new Ii.A(b)),j.Ay.moveComponent(b);if((0,Oi.i)(a).forEach(t=>o.push(t)),s){(0,Hi.s)(s).forEach(t=>o.push(t))}const y=l.closest("block");if(y){const t=(0,Hi.s)(y);(0,Pi.Ay)({steps:t,force:!0,update:!0})}return o};var Di=a(18057),ji=a(96374);const Fi=["profile","businessProfile","business_profile","context","businessContext","business_context","data"];function Ui(t){let e={...t};for(const t of Fi){const n=e[t];n&&"object"==typeof n&&!Array.isArray(n)&&(delete e[t],e={...n,...e})}return e}const qi=/^(#([0-9a-f]{3}|[0-9a-f]{6})|rgba?\([^)]*\)|hsla?\([^)]*\))$/i;function Wi(t){return"string"==typeof t&&qi.test(t.trim())}function Vi(t,e){if(!t||"object"!=typeof t)return null;for(const n of e)if(Wi(t[n]))return t[n].trim();return null}const Yi=["colors","palette","theme","brand","brandColors","brand_colors","visualIdentity"];function Xi(t){const e=[t];for(const n of Yi){const r=t[n];r&&"object"==typeof r&&!Array.isArray(r)&&e.push(r)}return e}function Zi(t){for(const e of["colors","palette","brandColors","brand_colors"]){const n=t[e];if(Array.isArray(n)){const t=n.filter(Wi).map(t=>t.trim());if(t.length)return t}}return[]}const Ji=["primaryColor","primary_color","primary","main","brandColor","brand_color"],Ki=["secondaryColor","secondary_color","secondary","accentColor","accent_color","accent"],Gi=["primaryContrastColor","primary_contrast_color","primaryContrast","primaryText","primary_text","onPrimary","on_primary"],Qi=["secondaryContrastColor","secondary_contrast_color","secondaryContrast","secondaryText","secondary_text","onSecondary","on_secondary"],ta=["textColor","text_color","bodyColor","body_color","paragraphColor","fontColor"],ea=["headingColor","heading_color","headingsColor","titleColor","title_color"];function na(t){return(0,ji.d)("#FFFFFF",t)>=(0,ji.d)("#000000",t)?"#FFFFFF":"#000000"}function ra(){const t=T.M.get("businessContext");return t&&"object"==typeof t?Ui(t):null}const oa=`${(0,U.Ay)()?"http://127.0.0.1:8000":"https://studio.creaditor.ai"}/api/business-analyze`;async function ia(t){const e=await async function(t){const e=!(!t||!t.forceRefresh),n="function"==typeof j.Ay.studioTokenProvider?j.Ay.studioTokenProvider:null;if(n)try{const t=await n({forceRefresh:e});if("string"==typeof t&&t.length>0)return t}catch(t){console.warn("[business-context] studioTokenProvider threw; falling back to editor.studioToken.",t)}return"string"==typeof j.Ay.studioToken&&j.Ay.studioToken.length>0?j.Ay.studioToken:null}({forceRefresh:t}),n={Accept:"application/json"};return e&&(n.Authorization=`Bearer ${e}`),fetch(oa,{method:"GET",headers:n})}let aa=null;async function sa(){return aa||(aa=(async()=>{try{let t=await ia(!1);if(401===t.status&&(t=await ia(!0)),!t.ok)return console.warn(`[business-context] fetch failed: HTTP ${t.status}`),null;const e=await t.json();return T.M.set({businessContext:e}),e}catch(t){return console.warn("[business-context] fetch error",t),null}finally{aa=null}})(),aa)}function la(t){return"string"==typeof t&&/^(https?:\/\/|data:image\/)/i.test(t.trim())}function ca(t){return/(^|_|\b)logo(_?(url|src|image|href))?$/i.test(t)}function da(){const t=T.M.get("businessContext");if(!t||"object"!=typeof t)return(0,U.Ay)()&&console.warn("[business-context] businessContext is not in the store yet — the logo element will render its placeholder. Is cdtr-studio up on 127.0.0.1:8000, and is the studio token valid?"),null;const e=Ui(t),n=e.logo||e.logoUrl;if(la(n))return n.trim();const r=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,n=[t];for(let t=0;t<=e&&n.length>0;t++){const t=[];for(const e of n)if(e&&"object"==typeof e){for(const[t,n]of Object.entries(e))if(ca(t)&&la(n))return n.trim();for(const n of Object.values(e))n&&"object"==typeof n&&t.push(n)}n=t}return null}(t);return r||((0,U.Ay)()&&console.warn("[business-context] no logo found in businessContext; the logo element will render its placeholder. Top-level keys:",Object.keys(t),t),null)}function pa(t,e){t&&(Array.isArray(t.children)?t.children.forEach(t=>{pa(t,e)}):t&&"object"==typeof t&&e(t))}function ha(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(Array.isArray(t))t.forEach(t=>{ha(t,e,n)});else if(t&&"object"==typeof t){const r="heading"===t.type?"heading":"paragraph"===t.type?"paragraph":n;Array.isArray(t.content)?(e(t,r),t.content.forEach(t=>{ha(t,e,r)})):e(t,r)}else e(t,n)}const ua=t=>{const e=T.M.get("components").find(t=>"root"===t.type),n=e?.props?.style?.fontFamily,r=e?.props?.defaultColorParagraphs||e?.props?.default_color_paragraphs,o=e?.props?.defaultColorHeadings||e?.props?.default_color_headings,i=e?.props?.primaryColor,a=e?.props?.primaryContrastColor,s=T.M.get("theme","primary"),l=T.M.get("theme","primaryText");var c;return fa(t,{fontFamily:n,primaryColor:i?`var(--cdtr-primary, ${i})`:s||void 0,primaryContrastColor:a?`var(--cdtr-primary-contrast, ${a})`:l||void 0,defaultColorParagraphs:r,defaultColorHeadings:o||("string"==typeof(c=s)&&c&&!/gradient/i.test(c)?s:void 0)}),t};function fa(t,e){const{fontFamily:n,primaryColor:r,primaryContrastColor:o,defaultColorParagraphs:i,defaultColorHeadings:a,defaultBackgroundButtons:s,defaultColorButtons:l}=e;if(t?.props?.style){if(n&&(t.props.style.fontFamily=n),"image"===t.type&&("logo"===t.props.alt?.toLowerCase()||"logo"===t.props.as)){const e=da();"string"==typeof e&&(t.props.src=e,t.props.style.height="auto")}s&&(t.props.style.background=s),l&&(t.props.style.color=l)}pa(t,t=>{if(r&&"button"===t?.type&&(t.props.style.background=r),o&&"button"===t?.type&&(t.props.style.color=o),"divider"===t?.type){const e=T.M.get("components").filter(t=>"divider"===t.type&&t.isInDom());if(e.length>0){const n=e.map(t=>`${t.props.style.borderColor}-${t.props.style.borderTopWidth}`),r=function(t){if(t.length<2)return t[0]||null;const e={};for(let n=0;n<t.length-1;n++){const r=t[n],o=t[n+1];e[r]||(e[r]={}),e[r][o]=(e[r][o]||0)+1}const n=e[t[t.length-1]];if(!n)return t[0];let r=null,o=0;for(const[t,e]of Object.entries(n))e>o&&(o=e,r=t);return r}(n);if(r){const n=e.find(t=>`${t.props.style.borderColor}-${t.props.style.borderTopWidth}`==`${r.split("-")[0]}-${r.split("-")[1]}`);n&&(t.props=n.props)}}}if("button"===t?.type){try{const e=T.M.get("components").find(t=>"button"===t.type&&t.isInDom());e&&(e.props.style.background&&(t.props.style.background=e.props.style.background),e.props.text&&(t.props.text=e.props.text))}catch(t){console.log("error",t)}const e=t.props?.style?.background;if("string"==typeof e&&e&&!/gradient|var\(/i.test(e)){const n=t.props?.style?.color||o||"#ffffff";t.props.style.color=(0,ji.w)(n,e)}}if("countdown"===t.type){const e=T.M.get("components").find(t=>"countdown"===t.type&&t.isInDom());e&&(t.props=e.props)}if("countdown-v2"===t.type){const e=T.M.get("components").find(t=>"countdown-v2"===t.type&&t.isInDom());e&&(t.props=e.props)}if("social"===t.type){const e=T.M.get("components").find(t=>"social"===t.type&&t.isInDom());e&&(t.props=e.props)}if("spacer"===t.type){const e=T.M.get("components").find(t=>"spacer"===t.type&&t.isInDom());e&&(t.props=e.props)}}),t?.props?.items&&Array.isArray(t.props.items)&&t.props.items.forEach(t=>{if(t?.props?.style){if(n&&(t.props.style.fontFamily=n),"button"===t.type){r&&(t.props.style.background=r);const e=t.props?.style?.background;if("string"==typeof e&&e&&!/gradient|var\(/i.test(e)){const n=t.props?.style?.color||o||"#ffffff";t.props.style.color=(0,ji.w)(n,e)}else o&&(t.props.style.color=o)}}else t?.style&&n&&(t.style.fontFamily=n)}),t?.props?.text?.childNodes?.content&&t?.props?.text?.childNodes?.content&&ha(t?.props?.text?.childNodes?.content,(t,e)=>{t&&Array.isArray(t.marks)&&t.marks.forEach(t=>{if(t&&t.attrs&&"object"==typeof t.attrs&&(t.attrs.fontFamily&&n&&(t.attrs.fontFamily=n),t.attrs.color)){let n=null;"heading"===e?n=a||i:"paragraph"===e&&(n=i),n&&(t.attrs.color=n)}})}),t&&t.children&&Array.isArray(t.children)&&t.children.forEach(t=>{fa(t,e)})}const ma=t=>{let{template:e,to:n,direction:r}=t;const o=[];T.M.get("components",n.dataset.id);let i=T.M.get("components",n.dataset.id),a=i.parent(),s=a.children.findIndex(t=>t===i.id);if(e.body=ua(e.body),"bottom"!==r&&"right"!==r||s++,"bottom"===r||"top"===r){const t={type:"row",props:{},children:[{type:"col",props:{lg:12},children:[e.body]}]},n=(a.parent(),j.Ay.createComponent({body:t,parentId:a.id,index:s}));o.push(new Li.A({componentId:n.id,parentId:a.id,index:s,body:t}))}else if("left"===r||"right"===r){const t={type:"col",props:{lg:0},children:[e.body]};let n=a,i=s;if("col"===a.type&&(j.Ay.updateComponent(a,"lg",0),o.push(new Ri.A({componentId:a.id,key:"lg",value:0})),n=a.parent(),i=n.children.findIndex(t=>t===a.id),-1===i))throw new Error("col not found in parent");"right"===r&&i++;const l=j.Ay.createComponent({body:t,parentId:n.id,index:i});o.push(new Li.A({componentId:l.id,parentId:n.id,index:i,body:t}))}return o},ga=t=>{let{template:e,to:n,direction:r}=t;const o=[];let i=T.M.get("components",n.dataset.id),a=i.parent(),s=a.children.findIndex(t=>t===i.id);e.body=ua(e.body),"right"===r&&s++;const l={type:"col",props:{lg:0,style:{}},children:[e.body]},c=j.Ay.createComponent({body:l,parentId:a.id,index:s});if(o.push(new Li.A({componentId:c.id,parentId:a.id,index:s,body:l})),a&&"block"===a.type){(0,Hi.s)(a).forEach(t=>o.push(t))}return o};var ba=a(15035);const ya=t=>{let{template:e,to:n,direction:r}=t;const o=[];let i=T.M.get("components",n.dataset.id);if(!i)throw new Error("toItemCompose is not found");if(i&&"section"===i.type){const t=i.children[i.children.length-1];i=T.M.get("components",t)}const a=i.closest("block");let s=i.parent(),l=s.children.findIndex(t=>t===i.id);"bottom"!==r&&"left"!==r||l++,delete a.props.style.boxShadow,e.body=ua(e.body);const c="block"===e.body.type?e.body:{type:"block",props:{style:a.props.style,classList:[]},children:[{type:"col",props:{lg:0},children:[e.body]}]};c.props.style.width||(c.props.style.width="610px"),"menu"!==c.props.as&&(c.props.style=a.props.style),(t=>{const e=j.Ay.configure;j.Ay.globalCommands.bodyWalk(t.body,t=>{if("form"===t.type&&e&&Array.isArray(e.plugins)){const n=e?.plugins.find(t=>"form"===t.name);n&&n.configure&&Array.isArray(n.configure.defaultFields)&&Array.isArray(n.configure.fields)&&[...n.configure.defaultFields].reverse().forEach(e=>{const r=n.configure.fields.find(t=>t.id===e.id);if(r&&!t.props.items.find(t=>t.id===r.id)){const e=(0,ba.v)(r);e&&t.props.items.unshift(e)}})}})})({body:c});const d=j.Ay.createComponent({body:c,parentId:s.id,index:l});return o.push(new Li.A({componentId:d.id,parentId:s.id,index:l,body:c})),o},wa=t=>{let{template:e,to:n,direction:r}=t;const o=[];let i=T.M.get("components",n.dataset.id);const a=i.parent().children.findIndex(t=>t===i.id);let s;if(e.components){const t=new Map;e.components.forEach(e=>{const n=e.id||e._id;if(n){const r=`${e.type}-${Math.random().toString(36).substr(2,9)}`;t.set(n,r)}}),e.components.forEach(e=>{const n=e.id||e._id;if(n&&t.has(n)){const r=t.get(n);e.id=r,e._id=r}Array.isArray(e.children)&&(e.children=e.children.map(e=>t.get(e)||e)),Array.isArray(e.elements)&&(e.elements=e.elements.map(e=>t.get(e)||e))}),s=(0,ze.G)(e.components||[]),e.body=s}"section"===e.body.type&&(i=i.closest("root"));let l=a;"bottom"===r&&l++,e.body=ua(e.body);let c="block"===e.body.type?e.body:{type:"block",props:{style:{padding:"10px",marginTop:"0",marginBottom:"0",marginLeft:"auto",marginRight:"auto",backgroundColor:"transparent",maxWidth:"1320px",justifyContent:"center",width:"610px"},classList:[]}};"section"===e.body.type&&(c=e.body),"block"!==e.body.type&&"section"!==e.body.type&&(c.children=[{type:"col",props:{lg:0},children:[e.body]}]);const d=j.Ay.createComponent({body:c,parentId:i.id,index:l});if(o.push(new Li.A({componentId:d.id,parentId:i.id,index:l,body:c})),"block"===!e.body.type){const t={type:"col",props:{lg:0,style:{}}},n=j.Ay.createComponent({body:t,parentId:d.id,index:0});o.push(new Li.A({componentId:n.id,parentId:d.id,index:0,body:t}));const r=j.Ay.createComponent({body:e.body,parentId:n.id,index:0});o.push(new Li.A({componentId:r.id,parentId:n.id,index:0}))}return o},_a=t=>{let{item:e,to:n,direction:r}=t;const o=[],i=T.M.get("components",e.dataset.id),a=i.parent(),s=i.closest("block"),l=T.M.get("components",n.dataset.id),c="top"===r?l.children[0]:l.children[l.children.length-1],d=c?T.M.get("components",c):null,p={type:"block",props:{style:d?.props?.style?{...d.props.style}:{padding:"10px",marginTop:"0",marginBottom:"0",marginLeft:"auto",marginRight:"auto",backgroundColor:"transparent",maxWidth:"1320px",justifyContent:"center",width:"610px"},classList:[]},children:[{type:"col",props:{lg:0,style:{}}}]},h="top"===r?0:l.children.length,u=j.Ay.createComponent({body:p,parentId:l.id,index:h});o.push(new Li.A({componentId:u.id,parentId:l.id,index:h,body:p}));const f=u.children[0],m=a.children.findIndex(t=>t===i.id),g={componentId:i.id,oldParentId:a.id,newParentId:f,oldIndex:m,newIndex:0};o.push(new Ii.A(g)),j.Ay.moveComponent(g);if((0,Oi.i)(a).forEach(t=>o.push(t)),s){const t=(0,Hi.s)(s);(0,Pi.Ay)({steps:t,force:!0,update:!0})}return o};var Aa=a(8064);class xa{constructor(){this.delayer=new Di.A}start(){let t,e=[],r=!1;const o=(0,n.A)("div",{style:{padding:"10px",background:"var(--primary)",borderRadius:"2px",width:"80px",color:"#fff",fontSize:"13px",fontFamily:"Arial",position:"absolute",top:"5px",textAlign:"var(--text-align-locale)"}});new Ti({sort:!0,clone:!1,handle:".draggable-element-handle",body:".amazingbar-content-wrapper",onStart:e=>{let{item:o,dragType:i,dropType:a}=e;const s=document.querySelector(".cdtr-text-editor-plugin");s&&(s.style.display="none"),r=(0,Aa.isAnchorDrag)(o),document.body.classList.toggle("cdtr-anchor-attaching",r),r&&(0,Aa.injectAnchorDragStyles)(),L.A.dispatch("elements:draggable:start",{item:o,dragType:i,dropType:a});const l=j.Ay.getEditor("text-editor");l&&l.destroy({from:"design-factory"}),t=(0,n.A)("style",null,`\n [data-name="add-new-block-v1"]{\n display:none !important;\n }\n .block-component > .sortable > .col-component > .row-of-col {\n max-width:90%; \n margin-right:auto;\n margin-left:auto;\n }\n ${"block"===a?"":"[droppable-element='element']{\n border:1px dashed #4845542e;\n }"}\n [droppable-element='block']{\n border-top:1px dashed #484554a8;\n border-bottom:1px dashed #484554a8;\n }\n\n ${"block"===a?"":"[droppable-element='col']{\n border-left:1px dashed #484554a8;\n border-right:1px dashed #484554a8;\n }"}\n `),document.body.appendChild(t)},onCancel:()=>{},finally:()=>{const n=document.querySelector(".cdtr-text-editor-plugin");n&&(n.style.display=null),L.A.dispatch("elements:draggable:end",{}),t&&t.remove(),(0,Aa.clearDropTarget)(),(0,Aa.removeAnchorDragStyles)(),document.body.classList.remove("cdtr-anchor-attaching"),r=!1,e.forEach(t=>{t.classList.remove("move-left"),t.classList.remove("move-right"),t.classList.remove("move-top"),t.classList.remove("move-bottom"),t.classList.remove("on-moving")}),e=[]},onMove:t=>{let{item:n,to:i,direction:a,targets:s,guideLine:l,dragType:c,dropType:d}=t;if(i!==this.lastTarget&&(this.delayer.run(()=>{this.lastTarget=i,l.appendChild(o)},100),o.remove()),r){const t=(0,Aa.resolveBlockElement)(i);return(0,Aa.highlightDropTarget)(t),void(o.innerHTML=T.M.get("lang",t?"attach_anchor_to_block":"drop_anchor_on_a_block"))}const p=s.find(t=>t.closest("[data-type='col']"));if(n===i&&p&&T.M.get("components",p.dataset.id).children.length<1)return!1;const h=i.getAttribute("droppable-element");if(!h)return!1;const u=T.M.get("components",n.dataset.id);if(i.classList.add("on-moving"),u){const t=u.closest("block");t&&-1===e.indexOf(t.element)&&(t.element.classList.add("on-moving"),e.push(t.element))}e.forEach(t=>{t.classList.remove("move-left"),t.classList.remove("move-right"),t.classList.remove("move-top"),t.classList.remove("move-bottom")}),"element"===h?("left"===a?(o.innerHTML=T.M.get("lang","left-to-element"),o.style.transform="translate(-120%, -50%)",i.classList.add("move-right")):"right"===a?(o.style.transform="translate(20%, -50%)",o.innerHTML=T.M.get("lang","right-to-element"),i.classList.add("move-left")):"top"===a?(o.innerHTML=T.M.get("lang","top-to-element"),i.classList.add("move-bottom")):"bottom"===a&&(i.classList.add("move-top"),o.innerHTML=T.M.get("lang","bottom-to-element")),e.push(i)):"col"===h?"left"===a?o.innerHTML=T.M.get("lang","open-new-cell-from-left"):"right"===a&&(o.innerHTML=T.M.get("lang","open-new-cell-from-right")):"block"===h&&("top"===a?o.innerHTML=T.M.get("lang","open-new-block-from-top"):"bottom"===a&&(o.innerHTML=T.M.get("lang","open-new-block-from-bottom")))},onEnd:t=>{let{item:e,to:n,direction:r,dragType:o,dropType:i,autoDrop:a}=t;if(a||n?.dataset?.id!==e?.dataset?.id){if((0,Aa.isAnchorDrag)(e)){const t=(0,Aa.resolveBlockElement)(n);if(t){const n=e.__template,r=n&&n.body&&n.body.props||{};if((0,Aa.attachAnchorToBlock)(t,{name:r.name,color:r.color,explain:!(0,Aa.isLinkPickerAnchorDrag)(e)})&&!(0,Aa.isLinkPickerAnchorDrag)(e)){const e=T.M.get("components",t.dataset.id);e&&j.Ay.clean().selectComponent(e)}}return}try{if("create:element"===o){e.dataset.group;const t=e.dataset.id,a=T.M.get("components_templates")||[],s=e.__template,l=s&&s.id===t?s:a.find(e=>e.id===t);if(!l)throw new Error("cant find the template","#jj-vk545gh");const c=j.Ay.getTemplate(l?.body?.type);if(c&&(c.interactions=[],c.show_on_desktop=!0,c.show_on_mobile=!0,c.show_on_tablet=!0,("button"===l.body.type||"social"===l.body.type||"countdown"===l.body.type)&&(l.body.props=c)),"create:element"===o)if("element"===i)if("left"===r||"right"===r){const t=n.closest(".col-component"),e=ga({template:l,to:t,direction:r});e&&(0,Pi.Ay)({steps:e,force:!0,update:!0})}else{const t=ma({template:l,to:n,direction:r});t&&((0,Pi.Ay)({steps:t,force:!0,update:!0}),j.Ay.clean().selectComponent(T.M.get("components",e.dataset.id)))}else if("col"!==i||"right"!==r&&"left"!==r){if("col"===i){const t=T.M.get("components",n.dataset.id);if(t){if(t.children[t.children.length-1]){const t=ma({template:l,to:n,direction:r,update:!0});t&&(0,Pi.Ay)({steps:t,force:!0,update:!0})}}}else if("block"===i){const t=ya({template:l,to:n,direction:r});t&&(0,Pi.Ay)({steps:t,force:!0,update:!0})}else if("section"===i){const t=wa({template:l,to:n,direction:r});t&&(0,Pi.Ay)({steps:t,force:!0,update:!0})}}else{const t=ga({template:l,to:n,direction:r});t&&(0,Pi.Ay)({steps:t,force:!0,update:!0})}return}if("element"===o&&"block"===i){const t=T.M.get("components",e.dataset.id);if(t.closest("block")===n)return}if("block"===i&&"element"===o){const t=T.M.get("components",e.dataset.id).parent(),r=T.M.get("components",n.dataset.id).closest("block"),o=r.closest("section"),i=t.closest("section");if(r&&1===r.children.length&&o===i&&r===t)return}if("col"!==i||"left"!==r&&"right"!==r){if("col"===i){if(n.dataset.id===e.dataset.id)return;const t=T.M.get("components",n.dataset.id);if(t){const n=t.children[t.children.length-1];if(n){const t=zi({item:e,to:T.M.get("components",n).element,direction:r,update:!0});(0,Pi.Ay)({steps:t,force:!0,update:!0})}}}else if("element"===o&&"element"===i)if("left"===r||"right"===r){const t=n.closest(".col-component"),o=t?Ni({item:e,to:t,direction:r}):zi({item:e,to:n,direction:r,update:!0});o&&(0,Pi.Ay)({steps:o,force:!0,update:!0})}else{const t=zi({item:e,to:n,direction:r,update:!0});t&&((0,Pi.Ay)({steps:t,force:!0,update:!0}),j.Ay.clean().selectComponent(T.M.get("components",e.dataset.id)))}else if("element"===o&&"block"===i){const t=$i({item:e,to:n,direction:r});t&&(0,Pi.Ay)({steps:t,force:!0,update:!0})}else if("element"===o&&"section"===i){const t=_a({item:e,to:n,direction:r});(0,Pi.Ay)({steps:t,force:!0,update:!0})}}else{const t=Ni({item:e,to:n,direction:r});t&&(0,Pi.Ay)({steps:t,force:!0,update:!0})}}catch(t){j.Ay.commands.goToError(),j.Ay.commands.logError({msg:t.message,error_code:"#c4111",info:{data:t.stack},s:"E"}),console.error(t)}}}});const i=new li("[cdtr-resizable='true']",{container:document.querySelector(".amazingbar-content-wrapper"),minWidth:30,onResize(t,e){let{width:n,height:r}=e;const o=t.closest("[data-type]");if(!o)return void console.warn("element must have data-type to use resizeable functionality");n=parseInt(n);const i=T.M.get("components",o.dataset.id);if(i&&"function"==typeof i.resize)i.resize({width:n,height:r});else if(i){const e=i.type;if("card"!==e){const e=t.closest(".card-component")||t.closest(".col-component"),r=e?e.offsetWidth:9999999;r<n&&(n=r)}if("card"===e){const e=t.closest(".block-component"),r=e?e.offsetWidth:9999999;r<n&&(n=r)}switch(e){case"button":{const t={minWidth:"10px"};Number.isFinite(n)&&(t.width=n+"px"),r&&(t.height=r),j.Ay.store().execCommand2({transactions:[{type:"button",key:"style",value:t}]});break}case"countdown":j.Ay.store().execCommand2({transactions:[{type:"countdown",key:"style",value:{width:n+"px",minWidth:"80px"}}]});break;case"text":j.Ay.store().execCommand2({transactions:[{type:"text",key:"style",value:{width:n+"px"}}]});break;case"card":j.Ay.store().execCommand2({transactions:[{type:"card",key:"style",value:{width:n+"px"}}]});break;case"video":j.Ay.store().execCommand("style",{width:n+"px",height:n/1.4+"px"});break;case"image":case"giphy":case"qr":n&&j.Ay.store().execCommand("style",{width:n+"px",height:"auto"});break;case"icon":n&&j.Ay.store().execCommand("style",{width:n+"px",height:n+"px"});break;case"svg":n&&j.Ay.store().execCommand("width",n+"px");break;default:console.warn("no type found for resizable")}}else{if("inline-image"===t.getAttribute("data-type")){const t=j.Ay.getSelectedComponent(),e=t?.[0];return void(e&&e.tiptap.chain().updateImage({width:n+"px"}))}}}});j.Ay.addEditor({type:"global",name:"draggable-window-editor",editor:new di(".drop-modal-draggable")}),j.Ay.addEditor({type:"images",name:"resizable",editor:i}),L.A.subscribe("onScroll",()=>{i&&"function"==typeof i.rePosition&&i.rePosition()}),j.Ay.on("update",()=>{i&&"function"==typeof i.rePosition&&i.rePosition()}),L.A.subscribe("resize-page",()=>{i.stopResize({})})}}const va=a(91937),{v4:ka}=a(77203),Ca=function(t,e){let{group:n,name:r,thumb:o,placement:i,staticName:a,tags:s,puzzle:l,props:c,index:d,icon:p,id:h}=e;this.index=d,this.id=h||va(r),this.render=t,c&&"object"==typeof c||(c={}),"function"==typeof t?this.body=t():t&&"object"==typeof t?this.body=t:console.error("menu element not valid",t),this.props=c,this.puzzle=l||p,this.tags=s||[],this.group=n,this.name=r,this.thumb=o,this.placement=i,a&&(this.staticName=a)},Ea="activeSurface",Sa="activePopupId",Ma=T.M;function Ba(){return Ma.get(Ea)||"page"}function Ta(t){const e=document.getElementById("main-page-wrapper");if(!e)return;const n="popups"===t;e.classList.toggle("surface-popups",n),e.classList.toggle("surface-page",!n),e.classList.remove("surface-anim"),requestAnimationFrame(()=>e.classList.add("surface-anim")),n&&Na()}function La(t){t!==Ba()?(Ma.set({[Ea]:t}),Ta(t),L.A.dispatch("surface-change",{surface:t})):Ta(t)}function Ia(){const t=(j.Ay.getComponents?.()||[]).find(t=>t&&"root"===t.type);return t?.children?t.children.map(t=>Ma.get("components",t)).filter(t=>!!t&&"block"===t.type&&!!t.props?.modalable):[]}function Oa(){const t=Ma.get(Sa),e=Ia();return t&&e.some(e=>e.id===t)?t:e[0]?.id||null}function Ha(t){Ma.set({[Sa]:t}),Na();const e=Ia().find(e=>e.id===t);e&&j.Ay.clean().selectComponent(e),L.A.dispatch("active-popup-change",{id:t})}function Na(){const t=document.getElementById("main-page-wrapper");if(!t)return;const e=Array.from(t.querySelectorAll('[data-modalable="true"]')),n=e.map(t=>t.getAttribute("data-id"));let r=Ma.get(Sa);r&&n.includes(r)||(r=n[0]||null),e.forEach(t=>{t.setAttribute("data-active-popup",t.getAttribute("data-id")===r?"true":"false")})}function Ra(t){const e=Ma.get("config","editor","configure","plugins")||[],n=Ma.get("config","channel")||"web";for(const r of e){if(!r||"function"!=typeof r.menu)continue;let o;try{o=r.menu({Compose:Ca,schemes:e,channel:n})}catch{continue}const i=o?.body;if(i?.type===t)return JSON.parse(JSON.stringify(i))}return null}function za(t){const e=(j.Ay.getComponents?.()||[]).find(t=>t&&"root"===t.type),n=Ia(),r=n.find(e=>e.id===t);if(!e||!r)return null;const o=e.children||[],i=o.indexOf(t),a=i>=0?i+1:o.length,s=j.Ay.store().cloneComponent({componentId:t,parentId:e.id,index:a});if(!s?.id)return null;const l=r.props?.modalName||`${Ma.get("lang","new_modal")||"Popup"} ${n.indexOf(r)+1}`,c=Ia().map(t=>t.props?.modalName||"").filter(Boolean);return j.Ay.updateComponent(s,"modalName",function(t,e){const n=Ma.get("lang","copy_suffix")||"copy",r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=`${t.replace(new RegExp(`\\s+${r}(\\s+\\d+)?$`,"i"),"")} ${n}`;if(!e.includes(o))return o;let i=2;for(;e.includes(`${o} ${i}`);)i+=1;return`${o} ${i}`}(l,c)),La("popups"),Ha(s.id),L.A.dispatch("popups-change",{}),s}let Pa=!1;var $a=a(40648);class Da extends S.WF{constructor(){super(),this.errors={},this.indicators=[],this.lang=T.M.get("config","language"),this.scrollHandler=this.updatePositions.bind(this),this.resizeHandler=this.updatePositions.bind(this)}connectedCallback(){super.connectedCallback(),j.Ay.on("detectErrors",t=>{this.errors=t,this.updateIndicators()}),j.Ay.on("change",()=>{this.updateIndicators()}),window.addEventListener("scroll",this.scrollHandler,!0),window.addEventListener("resize",this.resizeHandler),this.updateIndicators()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("scroll",this.scrollHandler,!0),window.removeEventListener("resize",this.resizeHandler)}updateIndicators(){this.indicators=[],this.errors.buttons&&this.errors.buttons.forEach(t=>{t.element&&this.indicators.push({id:`button-${t.id}`,element:t.element,type:"button",error:t,message:this.getButtonErrorMessage()})}),this.errors.images&&this.errors.images.forEach(t=>{t.element&&this.indicators.push({id:`image-${t.id}`,element:t.element,type:"image",error:t,message:this.getImageErrorMessage()})}),this.errors.links&&this.errors.links.forEach(t=>{t.element&&this.indicators.push({id:`link-${t.id}`,element:t.element,type:"link",error:t,message:this.getLinkErrorMessage()})}),this.errors.social&&this.errors.social.forEach(t=>{t.compose&&t.compose.element&&this.indicators.push({id:`social-${t.compose.id}-${t.itemIndex}`,element:t.compose.element,type:"social",error:t,message:this.getSocialErrorMessage()})}),this.errors.socialLinks&&this.errors.socialLinks.forEach(t=>{t.compose&&t.compose.element&&this.indicators.push({id:`social-link-${t.compose.id}-${t.itemIndex}`,element:t.compose.element,type:"socialLink",error:t,message:this.getSocialLinkErrorMessage()})}),this.requestUpdate(),this.updatePositions()}updatePositions(){this.updateComplete.then(()=>{this.indicators.forEach(t=>{const e=t.element.getBoundingClientRect(),n=this.shadowRoot.querySelector(`[data-indicator-id="${t.id}"]`);n&&(n.style.left=e.right-8+"px",n.style.top=e.top-8+"px")})})}getButtonErrorMessage(){const t={en:{title:"Button Missing Link",content:"This button doesn't have a link attached. Click to add a link in the properties panel.",action:"Add Link"},he:{title:"כפתור חסר קישור",content:"לכפתור הזה אין קישור. לחץ כדי להוסיף קישור בלוח המאפיינים.",action:"הוסף קישור"}};return t[this.lang]||t.en}getImageErrorMessage(){const t={en:{title:"Placeholder Image",content:"This image is still using a placeholder. Click to replace it with an actual image.",action:"Replace Image"},he:{title:"תמונת ברירת מחדל",content:"התמונה הזו עדיין משתמשת בתמונת ברירת מחדל. לחץ כדי להחליף אותה בתמונה אמיתית.",action:"החלף תמונה"}};return t[this.lang]||t.en}getLinkErrorMessage(){const t={en:{title:"Invalid Link",content:"This link is invalid or broken. Click to fix the URL in the properties panel.",action:"Fix Link"},he:{title:"קישור לא תקין",content:"הקישור הזה לא תקין או שבור. לחץ כדי לתקן את הכתובת בלוח המאפיינים.",action:"תקן קישור"}};return t[this.lang]||t.en}getSocialErrorMessage(){const t={en:{title:"Social Icon Missing Link",content:"This social icon doesn't have a link attached. Click to add a link in the properties panel.",action:"Add Link"},he:{title:"אייקון חברתי חסר קישור",content:"לאייקון החברתי הזה אין קישור. לחץ כדי להוסיף קישור בלוח המאפיינים.",action:"הוסף קישור"}};return t[this.lang]||t.en}getSocialLinkErrorMessage(){const t={en:{title:"Invalid Social Link",content:"This social icon has an invalid or broken link. Click to fix the URL in the properties panel.",action:"Fix Link"},he:{title:"קישור חברתי לא תקין",content:"לאייקון החברתי הזה יש קישור לא תקין או שבור. לחץ כדי לתקן את הכתובת בלוח המאפיינים.",action:"תקן קישור"}};return t[this.lang]||t.en}handleIndicatorClick(t){this.closeAllPopovers();const e=this.shadowRoot.querySelector(`[data-popover-id="${t.id}"]`);e&&e.classList.add("show")}getTabName(t){switch(t){case"image":return"style";case"button":case"link":case"social":case"socialLink":return"interactions";default:return null}}getSectionLabel(t){switch(t){case"image":return"image";case"button":case"link":case"social":case"socialLink":return"link";default:return null}}activeSidebarTab(){let t=null;const e=n=>{n&&n.querySelectorAll&&n.querySelectorAll("*").forEach(n=>{"CDTR-EDITOR-TABS"===n.tagName&&(t=n.getAttribute("data-active-tab")),n.shadowRoot&&e(n.shadowRoot)})};return e(document),t}handleActionClick(t){const e="social"===t.type||"socialLink"===t.type?t.error.compose:t.error,n=this.getTabName(t.type),r=this.getSectionLabel(t.type),o=e&&e.id,i=()=>o&&document.querySelector(`[data-id="${o}"]`)||t.element||e&&e.element||null,a=i()?.closest?.('[data-modalable="true"]'),s=a?a.getAttribute("data-id"):null,l=!!s&&("popups"!==Ba()||Oa()!==s);l&&(La("popups"),Ha(s));const c=()=>{const t=i();if(!t)return;const e=t.closest&&t.closest(".amazingbar-content-wrapper")||null;if(e){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=r.top-n.top-(e.clientHeight-r.height)/2;e.scrollTop+=o}else"function"==typeof t.scrollIntoView&&t.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})},d=()=>{j.Ay.clean().selectComponent(e),setTimeout(c,300);const t=e=>{const o=this.activeSidebarTab();null==o&&e>0?setTimeout(()=>t(e-1),80):(n&&o!==n&&j.Ay.dispatch("editor-tabs",{name:n}),this.revealSidebarSections(r))};setTimeout(()=>t(10),400)};l?setTimeout(d,350):d(),this.closeAllPopovers()}revealSidebarSections(t){const e=()=>{let e=0;const n=r=>{r&&r.querySelectorAll&&r.querySelectorAll("*").forEach(r=>{"CDTR-EDITOR-SECTION"===r.tagName&&(r.open=!0,e++,t&&r.getAttribute("data-label")===t&&r.persistKey&&(0,$a.Q)(r.persistKey,!0)),r.shadowRoot&&n(r.shadowRoot)})};return n(document),e};e();let n=0;const r=setInterval(()=>{e(),++n>=20&&clearInterval(r)},100)}closeAllPopovers(){this.shadowRoot.querySelectorAll(".popover").forEach(t=>{t.classList.remove("show")})}handleCloseClick(t){t.stopPropagation(),this.closeAllPopovers()}render(){return S.qy`
3931
+ </style>`}}Pe.properties={width:{type:Number,reflect:!0}},customElements.define("cdtr-container-style",Pe);var $e=a(69172),De=a(82706);var je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};const Fe="object"===("undefined"==typeof window?"undefined":je(window))&&"object"===("undefined"==typeof document?"undefined":je(document))&&9===document.nodeType;function Ue(t){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ue(t)}function qe(t){var e=function(t,e){if("object"!=Ue(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Ue(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ue(e)?e:e+""}function We(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,qe(r.key),r)}}function Ve(t,e,n){return e&&We(t.prototype,e),n&&We(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ye(t,e){return Ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ye(t,e)}function Xe(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Ye(t,e)}function Ze(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var Je={}.constructor;function Ke(t){if(null==t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(Ke);if(t.constructor!==Je)return t;var e={};for(var n in t)e[n]=Ke(t[n]);return e}function Ge(t,e,n){void 0===t&&(t="unnamed");var r=n.jss,o=Ke(e),i=r.plugins.onCreateRule(t,o,n);return i||(t[0],null)}var Qe=function(t,e){for(var n="",r=0;r<t.length&&"!important"!==t[r];r++)n&&(n+=e),n+=t[r];return n},tn=function(t){if(!Array.isArray(t))return t;var e="";if(Array.isArray(t[0]))for(var n=0;n<t.length&&"!important"!==t[n];n++)e&&(e+=", "),e+=Qe(t[n]," ");else e=Qe(t,", ");return"!important"===t[t.length-1]&&(e+=" !important"),e};function en(t){return t&&!1===t.format?{linebreak:"",space:""}:{linebreak:"\n",space:" "}}function nn(t,e){for(var n="",r=0;r<e;r++)n+=" ";return n+t}function rn(t,e,n){void 0===n&&(n={});var r="";if(!e)return r;var o=n.indent,i=void 0===o?0:o,a=e.fallbacks;!1===n.format&&(i=-1/0);var s=en(n),l=s.linebreak,c=s.space;if(t&&i++,a)if(Array.isArray(a))for(var d=0;d<a.length;d++){var p=a[d];for(var h in p){var u=p[h];null!=u&&(r&&(r+=l),r+=nn(h+":"+c+tn(u)+";",i))}}else for(var f in a){var m=a[f];null!=m&&(r&&(r+=l),r+=nn(f+":"+c+tn(m)+";",i))}for(var g in e){var b=e[g];null!=b&&"fallbacks"!==g&&(r&&(r+=l),r+=nn(g+":"+c+tn(b)+";",i))}return(r||n.allowEmpty)&&t?(r&&(r=""+l+r+l),nn(""+t+c+"{"+r,--i)+nn("}",i)):r}var on=/([[\].#*$><+~=|^:(),"'`\s])/g,an="undefined"!=typeof CSS&&CSS.escape,sn=function(t){return an?an(t):t.replace(on,"\\$1")},ln=function(){function t(t,e,n){this.type="style",this.isProcessed=!1;var r=n.sheet,o=n.Renderer;this.key=t,this.options=n,this.style=e,r?this.renderer=r.renderer:o&&(this.renderer=new o)}return t.prototype.prop=function(t,e,n){if(void 0===e)return this.style[t];var r=!!n&&n.force;if(!r&&this.style[t]===e)return this;var o=e;n&&!1===n.process||(o=this.options.jss.plugins.onChangeValue(e,t,this));var i=null==o||!1===o,a=t in this.style;if(i&&!a&&!r)return this;var s=i&&a;if(s?delete this.style[t]:this.style[t]=o,this.renderable&&this.renderer)return s?this.renderer.removeProperty(this.renderable,t):this.renderer.setProperty(this.renderable,t,o),this;var l=this.options.sheet;return l&&l.attached,this},t}(),cn=function(t){function e(e,n,r){var o;o=t.call(this,e,n,r)||this;var i=r.selector,a=r.scoped,s=r.sheet,l=r.generateId;return i?o.selectorText=i:!1!==a&&(o.id=l(Ze(Ze(o)),s),o.selectorText="."+sn(o.id)),o}Xe(e,t);var n=e.prototype;return n.applyTo=function(t){var e=this.renderer;if(e){var n=this.toJSON();for(var r in n)e.setProperty(t,r,n[r])}return this},n.toJSON=function(){var t={};for(var e in this.style){var n=this.style[e];"object"!=typeof n?t[e]=n:Array.isArray(n)&&(t[e]=tn(n))}return t},n.toString=function(t){var e=this.options.sheet,n=!!e&&e.options.link?(0,b.A)({},t,{allowEmpty:!0}):t;return rn(this.selectorText,this.style,n)},Ve(e,[{key:"selector",set:function(t){if(t!==this.selectorText){this.selectorText=t;var e=this.renderer,n=this.renderable;if(n&&e)e.setSelector(n,t)||e.replaceRule(n,this)}},get:function(){return this.selectorText}}]),e}(ln),dn={onCreateRule:function(t,e,n){return"@"===t[0]||n.parent&&"keyframes"===n.parent.type?null:new cn(t,e,n)}},pn={indent:1,children:!0},hn=/@([\w-]+)/,un=function(){function t(t,e,n){this.type="conditional",this.isProcessed=!1,this.key=t;var r=t.match(hn);for(var o in this.at=r?r[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new zn((0,b.A)({},n,{parent:this})),e)this.rules.add(o,e[o]);this.rules.process()}var e=t.prototype;return e.getRule=function(t){return this.rules.get(t)},e.indexOf=function(t){return this.rules.indexOf(t)},e.addRule=function(t,e,n){var r=this.rules.add(t,e,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},e.replaceRule=function(t,e,n){var r=this.rules.replace(t,e,n);return r&&this.options.jss.plugins.onProcessRule(r),r},e.toString=function(t){void 0===t&&(t=pn);var e=en(t).linebreak;if(null==t.indent&&(t.indent=pn.indent),null==t.children&&(t.children=pn.children),!1===t.children)return this.query+" {}";var n=this.rules.toString(t);return n?this.query+" {"+e+n+e+"}":""},t}(),fn=/@container|@media|@supports\s+/,mn={onCreateRule:function(t,e,n){return fn.test(t)?new un(t,e,n):null}},gn={indent:1,children:!0},bn=/@keyframes\s+([\w-]+)/,yn=function(){function t(t,e,n){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var r=t.match(bn);r&&r[1]?this.name=r[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var o=n.scoped,i=n.sheet,a=n.generateId;for(var s in this.id=!1===o?this.name:sn(a(this,i)),this.rules=new zn((0,b.A)({},n,{parent:this})),e)this.rules.add(s,e[s],(0,b.A)({},n,{parent:this}));this.rules.process()}return t.prototype.toString=function(t){void 0===t&&(t=gn);var e=en(t).linebreak;if(null==t.indent&&(t.indent=gn.indent),null==t.children&&(t.children=gn.children),!1===t.children)return this.at+" "+this.id+" {}";var n=this.rules.toString(t);return n&&(n=""+e+n+e),this.at+" "+this.id+" {"+n+"}"},t}(),wn=/@keyframes\s+/,_n=/\$([\w-]+)/g,An=function(t,e){return"string"==typeof t?t.replace(_n,function(t,n){return n in e?e[n]:t}):t},xn=function(t,e,n){var r=t[e],o=An(r,n);o!==r&&(t[e]=o)},vn={onCreateRule:function(t,e,n){return"string"==typeof t&&wn.test(t)?new yn(t,e,n):null},onProcessStyle:function(t,e,n){return"style"===e.type&&n?("animation-name"in t&&xn(t,"animation-name",n.keyframes),"animation"in t&&xn(t,"animation",n.keyframes),t):t},onChangeValue:function(t,e,n){var r=n.options.sheet;if(!r)return t;switch(e){case"animation":case"animation-name":return An(t,r.keyframes);default:return t}}},kn=function(t){function e(){return t.apply(this,arguments)||this}return Xe(e,t),e.prototype.toString=function(t){var e=this.options.sheet,n=!!e&&e.options.link?(0,b.A)({},t,{allowEmpty:!0}):t;return rn(this.key,this.style,n)},e}(ln),Cn={onCreateRule:function(t,e,n){return n.parent&&"keyframes"===n.parent.type?new kn(t,e,n):null}},En=function(){function t(t,e,n){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=t,this.style=e,this.options=n}return t.prototype.toString=function(t){var e=en(t).linebreak;if(Array.isArray(this.style)){for(var n="",r=0;r<this.style.length;r++)n+=rn(this.at,this.style[r]),this.style[r+1]&&(n+=e);return n}return rn(this.at,this.style,t)},t}(),Sn=/@font-face/,Mn={onCreateRule:function(t,e,n){return Sn.test(t)?new En(t,e,n):null}},Bn=function(){function t(t,e,n){this.type="viewport",this.at="@viewport",this.isProcessed=!1,this.key=t,this.style=e,this.options=n}return t.prototype.toString=function(t){return rn(this.key,this.style,t)},t}(),Tn={onCreateRule:function(t,e,n){return"@viewport"===t||"@-ms-viewport"===t?new Bn(t,e,n):null}},Ln=function(){function t(t,e,n){this.type="simple",this.isProcessed=!1,this.key=t,this.value=e,this.options=n}return t.prototype.toString=function(t){if(Array.isArray(this.value)){for(var e="",n=0;n<this.value.length;n++)e+=this.key+" "+this.value[n]+";",this.value[n+1]&&(e+="\n");return e}return this.key+" "+this.value+";"},t}(),In={"@charset":!0,"@import":!0,"@namespace":!0},On={onCreateRule:function(t,e,n){return t in In?new Ln(t,e,n):null}},Hn=[dn,mn,vn,Cn,Mn,Tn,On],Nn={process:!0},Rn={force:!0,process:!0},zn=function(){function t(t){this.map={},this.raw={},this.index=[],this.counter=0,this.options=t,this.classes=t.classes,this.keyframes=t.keyframes}var e=t.prototype;return e.add=function(t,e,n){var r=this.options,o=r.parent,i=r.sheet,a=r.jss,s=r.Renderer,l=r.generateId,c=r.scoped,d=(0,b.A)({classes:this.classes,parent:o,sheet:i,jss:a,Renderer:s,generateId:l,scoped:c,name:t,keyframes:this.keyframes,selector:void 0},n),p=t;t in this.raw&&(p=t+"-d"+this.counter++),this.raw[p]=e,p in this.classes&&(d.selector="."+sn(this.classes[p]));var h=Ge(p,e,d);if(!h)return null;this.register(h);var u=void 0===d.index?this.index.length:d.index;return this.index.splice(u,0,h),h},e.replace=function(t,e,n){var r=this.get(t),o=this.index.indexOf(r);r&&this.remove(r);var i=n;return-1!==o&&(i=(0,b.A)({},n,{index:o})),this.add(t,e,i)},e.get=function(t){return this.map[t]},e.remove=function(t){this.unregister(t),delete this.raw[t.key],this.index.splice(this.index.indexOf(t),1)},e.indexOf=function(t){return this.index.indexOf(t)},e.process=function(){var t=this.options.jss.plugins;this.index.slice(0).forEach(t.onProcessRule,t)},e.register=function(t){this.map[t.key]=t,t instanceof cn?(this.map[t.selector]=t,t.id&&(this.classes[t.key]=t.id)):t instanceof yn&&this.keyframes&&(this.keyframes[t.name]=t.id)},e.unregister=function(t){delete this.map[t.key],t instanceof cn?(delete this.map[t.selector],delete this.classes[t.key]):t instanceof yn&&delete this.keyframes[t.name]},e.update=function(){var t,e,n;if("string"==typeof(arguments.length<=0?void 0:arguments[0])?(t=arguments.length<=0?void 0:arguments[0],e=arguments.length<=1?void 0:arguments[1],n=arguments.length<=2?void 0:arguments[2]):(e=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],t=null),t)this.updateOne(this.get(t),e,n);else for(var r=0;r<this.index.length;r++)this.updateOne(this.index[r],e,n)},e.updateOne=function(e,n,r){void 0===r&&(r=Nn);var o=this.options,i=o.jss.plugins,a=o.sheet;if(e.rules instanceof t)e.rules.update(n,r);else{var s=e.style;if(i.onUpdate(n,e,a,r),r.process&&s&&s!==e.style){for(var l in i.onProcessStyle(e.style,e,a),e.style){var c=e.style[l];c!==s[l]&&e.prop(l,c,Rn)}for(var d in s){var p=e.style[d],h=s[d];null==p&&p!==h&&e.prop(d,null,Rn)}}}},e.toString=function(t){for(var e="",n=this.options.sheet,r=!!n&&n.options.link,o=en(t).linebreak,i=0;i<this.index.length;i++){var a=this.index[i].toString(t);(a||r)&&(e&&(e+=o),e+=a)}return e},t}(),Pn=function(){function t(t,e){for(var n in this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=(0,b.A)({},e,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),e.Renderer&&(this.renderer=new e.Renderer(this)),this.rules=new zn(this.options),t)this.rules.add(n,t[n]);this.rules.process()}var e=t.prototype;return e.attach=function(){return this.attached||(this.renderer&&this.renderer.attach(),this.attached=!0,this.deployed||this.deploy()),this},e.detach=function(){return this.attached?(this.renderer&&this.renderer.detach(),this.attached=!1,this):this},e.addRule=function(t,e,n){var r=this.queue;this.attached&&!r&&(this.queue=[]);var o=this.rules.add(t,e,n);return o?(this.options.jss.plugins.onProcessRule(o),this.attached?this.deployed?(r?r.push(o):(this.insertRule(o),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0)),o):o:(this.deployed=!1,o)):null},e.replaceRule=function(t,e,n){var r=this.rules.get(t);if(!r)return this.addRule(t,e,n);var o=this.rules.replace(t,e,n);return o&&this.options.jss.plugins.onProcessRule(o),this.attached?this.deployed?(this.renderer&&(o?r.renderable&&this.renderer.replaceRule(r.renderable,o):this.renderer.deleteRule(r)),o):o:(this.deployed=!1,o)},e.insertRule=function(t){this.renderer&&this.renderer.insertRule(t)},e.addRules=function(t,e){var n=[];for(var r in t){var o=this.addRule(r,t[r],e);o&&n.push(o)}return n},e.getRule=function(t){return this.rules.get(t)},e.deleteRule=function(t){var e="object"==typeof t?t:this.rules.get(t);return!(!e||this.attached&&!e.renderable)&&(this.rules.remove(e),!(this.attached&&e.renderable&&this.renderer)||this.renderer.deleteRule(e.renderable))},e.indexOf=function(t){return this.rules.indexOf(t)},e.deploy=function(){return this.renderer&&this.renderer.deploy(),this.deployed=!0,this},e.update=function(){var t;return(t=this.rules).update.apply(t,arguments),this},e.updateOne=function(t,e,n){return this.rules.updateOne(t,e,n),this},e.toString=function(t){return this.rules.toString(t)},t}(),$n=function(){function t(){this.plugins={internal:[],external:[]},this.registry={}}var e=t.prototype;return e.onCreateRule=function(t,e,n){for(var r=0;r<this.registry.onCreateRule.length;r++){var o=this.registry.onCreateRule[r](t,e,n);if(o)return o}return null},e.onProcessRule=function(t){if(!t.isProcessed){for(var e=t.options.sheet,n=0;n<this.registry.onProcessRule.length;n++)this.registry.onProcessRule[n](t,e);t.style&&this.onProcessStyle(t.style,t,e),t.isProcessed=!0}},e.onProcessStyle=function(t,e,n){for(var r=0;r<this.registry.onProcessStyle.length;r++)e.style=this.registry.onProcessStyle[r](e.style,e,n)},e.onProcessSheet=function(t){for(var e=0;e<this.registry.onProcessSheet.length;e++)this.registry.onProcessSheet[e](t)},e.onUpdate=function(t,e,n,r){for(var o=0;o<this.registry.onUpdate.length;o++)this.registry.onUpdate[o](t,e,n,r)},e.onChangeValue=function(t,e,n){for(var r=t,o=0;o<this.registry.onChangeValue.length;o++)r=this.registry.onChangeValue[o](r,e,n);return r},e.use=function(t,e){void 0===e&&(e={queue:"external"});var n=this.plugins[e.queue];-1===n.indexOf(t)&&(n.push(t),this.registry=[].concat(this.plugins.external,this.plugins.internal).reduce(function(t,e){for(var n in e)n in t&&t[n].push(e[n]);return t},{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},t}(),Dn=function(){function t(){this.registry=[]}var e=t.prototype;return e.add=function(t){var e=this.registry,n=t.options.index;if(-1===e.indexOf(t))if(0===e.length||n>=this.index)e.push(t);else for(var r=0;r<e.length;r++)if(e[r].options.index>n)return void e.splice(r,0,t)},e.reset=function(){this.registry=[]},e.remove=function(t){var e=this.registry.indexOf(t);this.registry.splice(e,1)},e.toString=function(t){for(var e=void 0===t?{}:t,n=e.attached,r=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(e,["attached"]),o=en(r).linebreak,i="",a=0;a<this.registry.length;a++){var s=this.registry[a];null!=n&&s.attached!==n||(i&&(i+=o),i+=s.toString(r))}return i},Ve(t,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),t}(),jn=new Dn,Fn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof self&&self.Math===Math?self:Function("return this")(),Un="2f1acc6c3a606b082e5eef5e54414ffb";null==Fn[Un]&&(Fn[Un]=0);var qn=Fn[Un]++,Wn=function(t){void 0===t&&(t={});var e=0;return function(n,r){e+=1;var o="",i="";return r&&(r.options.classNamePrefix&&(i=r.options.classNamePrefix),null!=r.options.jss.id&&(o=String(r.options.jss.id))),t.minify?""+(i||"c")+qn+o+e:i+n.key+"-"+qn+(o?"-"+o:"")+"-"+e}},Vn=function(t){var e;return function(){return e||(e=t()),e}},Yn=function(t,e){try{return t.attributeStyleMap?t.attributeStyleMap.get(e):t.style.getPropertyValue(e)}catch(t){return""}},Xn=function(t,e,n){try{var r=n;if(Array.isArray(n)&&(r=tn(n)),t.attributeStyleMap)t.attributeStyleMap.set(e,r);else{var o=r?r.indexOf("!important"):-1,i=o>-1?r.substr(0,o-1):r;t.style.setProperty(e,i,o>-1?"important":"")}}catch(t){return!1}return!0},Zn=function(t,e){try{t.attributeStyleMap?t.attributeStyleMap.delete(e):t.style.removeProperty(e)}catch(t){}},Jn=function(t,e){return t.selectorText=e,t.selectorText===e},Kn=Vn(function(){return document.querySelector("head")});function Gn(t){var e=jn.registry;if(e.length>0){var n=function(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(r.attached&&r.options.index>e.index&&r.options.insertionPoint===e.insertionPoint)return r}return null}(e,t);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=function(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];if(r.attached&&r.options.insertionPoint===e.insertionPoint)return r}return null}(e,t),n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=t.insertionPoint;if(r&&"string"==typeof r){var o=function(t){for(var e=Kn(),n=0;n<e.childNodes.length;n++){var r=e.childNodes[n];if(8===r.nodeType&&r.nodeValue.trim()===t)return r}return null}(r);if(o)return{parent:o.parentNode,node:o.nextSibling}}return!1}var Qn=Vn(function(){var t=document.querySelector('meta[property="csp-nonce"]');return t?t.getAttribute("content"):null}),tr=function(t,e,n){try{"insertRule"in t?t.insertRule(e,n):"appendRule"in t&&t.appendRule(e)}catch(t){return!1}return t.cssRules[n]},er=function(t,e){var n=t.cssRules.length;return void 0===e||e>n?n:e},nr=function(){function t(t){this.getPropertyValue=Yn,this.setProperty=Xn,this.removeProperty=Zn,this.setSelector=Jn,this.hasInsertedRules=!1,this.cssRules=[],t&&jn.add(t),this.sheet=t;var e=this.sheet?this.sheet.options:{},n=e.media,r=e.meta,o=e.element;this.element=o||function(){var t=document.createElement("style");return t.textContent="\n",t}(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var i=Qn();i&&this.element.setAttribute("nonce",i)}var e=t.prototype;return e.attach=function(){if(!this.element.parentNode&&this.sheet){!function(t,e){var n=e.insertionPoint,r=Gn(e);if(!1!==r&&r.parent)r.parent.insertBefore(t,r.node);else if(n&&"number"==typeof n.nodeType){var o=n,i=o.parentNode;i&&i.insertBefore(t,o.nextSibling)}else Kn().appendChild(t)}(this.element,this.sheet.options);var t=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&t&&(this.hasInsertedRules=!1,this.deploy())}},e.detach=function(){if(this.sheet){var t=this.element.parentNode;t&&t.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},e.deploy=function(){var t=this.sheet;t&&(t.options.link?this.insertRules(t.rules):this.element.textContent="\n"+t.toString()+"\n")},e.insertRules=function(t,e){for(var n=0;n<t.index.length;n++)this.insertRule(t.index[n],n,e)},e.insertRule=function(t,e,n){if(void 0===n&&(n=this.element.sheet),t.rules){var r=t,o=n;if("conditional"===t.type||"keyframes"===t.type){var i=er(n,e);if(!1===(o=tr(n,r.toString({children:!1}),i)))return!1;this.refCssRule(t,i,o)}return this.insertRules(r.rules,o),o}var a=t.toString();if(!a)return!1;var s=er(n,e),l=tr(n,a,s);return!1!==l&&(this.hasInsertedRules=!0,this.refCssRule(t,s,l),l)},e.refCssRule=function(t,e,n){t.renderable=n,t.options.parent instanceof Pn&&this.cssRules.splice(e,0,n)},e.deleteRule=function(t){var e=this.element.sheet,n=this.indexOf(t);return-1!==n&&(e.deleteRule(n),this.cssRules.splice(n,1),!0)},e.indexOf=function(t){return this.cssRules.indexOf(t)},e.replaceRule=function(t,e){var n=this.indexOf(t);return-1!==n&&(this.element.sheet.deleteRule(n),this.cssRules.splice(n,1),this.insertRule(e,n))},e.getRules=function(){return this.element.sheet.cssRules},t}(),rr=0,or=function(){function t(t){this.id=rr++,this.version="10.10.0",this.plugins=new $n,this.options={id:{minify:!1},createGenerateId:Wn,Renderer:Fe?nr:null,plugins:[]},this.generateId=Wn({minify:!1});for(var e=0;e<Hn.length;e++)this.plugins.use(Hn[e],{queue:"internal"});this.setup(t)}var e=t.prototype;return e.setup=function(t){return void 0===t&&(t={}),t.createGenerateId&&(this.options.createGenerateId=t.createGenerateId),t.id&&(this.options.id=(0,b.A)({},this.options.id,t.id)),(t.createGenerateId||t.id)&&(this.generateId=this.options.createGenerateId(this.options.id)),null!=t.insertionPoint&&(this.options.insertionPoint=t.insertionPoint),"Renderer"in t&&(this.options.Renderer=t.Renderer),t.plugins&&this.use.apply(this,t.plugins),this},e.createStyleSheet=function(t,e){void 0===e&&(e={});var n=e.index;"number"!=typeof n&&(n=0===jn.index?0:jn.index+1);var r=new Pn(t,(0,b.A)({},e,{jss:this,generateId:e.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(r),r},e.removeStyleSheet=function(t){return t.detach(),jn.remove(t),this},e.createRule=function(t,e,n){if(void 0===e&&(e={}),void 0===n&&(n={}),"object"==typeof t)return this.createRule(void 0,t,e);var r=(0,b.A)({},n,{name:t,jss:this,Renderer:this.options.Renderer});r.generateId||(r.generateId=this.generateId),r.classes||(r.classes={}),r.keyframes||(r.keyframes={});var o=Ge(t,e,r);return o&&this.plugins.onProcessRule(o),o},e.use=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach(function(e){t.plugins.use(e)}),this},t}(),ir="object"==typeof CSS&&null!=CSS&&"number"in CSS;var ar=function(t){return new or(t)}();const sr=ar;var lr=Date.now(),cr="fnValues"+lr,dr="fnStyle"+ ++lr;const pr=function(){return{onCreateRule:function(t,e,n){if("function"!=typeof e)return null;var r=Ge(t,{},n);return r[dr]=e,r},onProcessStyle:function(t,e){if(cr in e||dr in e)return t;var n={};for(var r in t){var o=t[r];"function"==typeof o&&(delete t[r],n[r]=o)}return e[cr]=n,t},onUpdate:function(t,e,n,r){var o=e,i=o[dr];i&&(o.style=i(t)||{});var a=o[cr];if(a)for(var s in a)o.prop(s,a[s](t),r)}}};var hr=a(71158),ur=function(t){return t&&t[hr.A]&&t===t[hr.A]()};const fr=function(t){return{onCreateRule:function(e,n,r){if(!ur(n))return null;var o=n,i=Ge(e,{},r);return o.subscribe(function(e){for(var n in e)i.prop(n,e[n],t)}),i},onProcessRule:function(e){if(!e||"style"===e.type){var n=e,r=n.style,o=function(e){var o=r[e];if(!ur(o))return"continue";delete r[e],o.subscribe({next:function(r){n.prop(e,r,t)}})};for(var i in r)o(i)}}}};var mr=/;\n/,gr=function(t){"string"==typeof t.style&&(t.style=function(t){for(var e={},n=t.split(mr),r=0;r<n.length;r++){var o=(n[r]||"").trim();if(o){var i=o.indexOf(":");if(-1!==i){var a=o.substr(0,i).trim(),s=o.substr(i+1).trim();e[a]=s}}}return e}(t.style))};const br=function(){return{onProcessRule:gr}};var yr="@global",wr="@global ",_r=function(){function t(t,e,n){for(var r in this.type="global",this.at=yr,this.isProcessed=!1,this.key=t,this.options=n,this.rules=new zn((0,b.A)({},n,{parent:this})),e)this.rules.add(r,e[r]);this.rules.process()}var e=t.prototype;return e.getRule=function(t){return this.rules.get(t)},e.addRule=function(t,e,n){var r=this.rules.add(t,e,n);return r&&this.options.jss.plugins.onProcessRule(r),r},e.replaceRule=function(t,e,n){var r=this.rules.replace(t,e,n);return r&&this.options.jss.plugins.onProcessRule(r),r},e.indexOf=function(t){return this.rules.indexOf(t)},e.toString=function(t){return this.rules.toString(t)},t}(),Ar=function(){function t(t,e,n){this.type="global",this.at=yr,this.isProcessed=!1,this.key=t,this.options=n;var r=t.substr(8);this.rule=n.jss.createRule(r,e,(0,b.A)({},n,{parent:this}))}return t.prototype.toString=function(t){return this.rule?this.rule.toString(t):""},t}(),xr=/\s*,\s*/g;function vr(t,e){for(var n=t.split(xr),r="",o=0;o<n.length;o++)r+=e+" "+n[o].trim(),n[o+1]&&(r+=", ");return r}const kr=function(){return{onCreateRule:function(t,e,n){if(!t)return null;if(t===yr)return new _r(t,e,n);if("@"===t[0]&&t.substr(0,8)===wr)return new Ar(t,e,n);var r=n.parent;return r&&("global"===r.type||r.options.parent&&"global"===r.options.parent.type)&&(n.scoped=!1),n.selector||!1!==n.scoped||(n.selector=t),null},onProcessRule:function(t,e){"style"===t.type&&e&&(function(t,e){var n=t.options,r=t.style,o=r?r[yr]:null;if(o){for(var i in o)e.addRule(i,o[i],(0,b.A)({},n,{selector:vr(i,t.selector)}));delete r[yr]}}(t,e),function(t,e){var n=t.options,r=t.style;for(var o in r)if("@"===o[0]&&o.substr(0,7)===yr){var i=vr(o.substr(7),t.selector);e.addRule(i,r[o],(0,b.A)({},n,{selector:i})),delete r[o]}}(t,e))}}};var Cr=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},Er="extendCurrValue"+Date.now();function Sr(t,e,n,r){return void 0===r&&(r={}),function(t,e,n,r){if("string"!=typeof t.extend)if(Array.isArray(t.extend))for(var o=0;o<t.extend.length;o++){var i=t.extend[o];Sr("string"==typeof i?(0,b.A)({},t,{extend:i}):t.extend[o],e,n,r)}else for(var a in t.extend)"extend"!==a?Cr(t.extend[a])?(a in r||(r[a]={}),Sr(t.extend[a],e,n,r[a])):r[a]=t.extend[a]:Sr(t.extend.extend,e,n,r);else{if(!n)return;var s=n.getRule(t.extend);if(!s)return;if(s===e)return;var l=s.options.parent;l&&Sr(l.rules.raw[t.extend],e,n,r)}}(t,e,n,r),function(t,e,n,r){for(var o in t)"extend"!==o&&(Cr(r[o])&&Cr(t[o])?Sr(t[o],e,n,r[o]):Cr(t[o])?r[o]=Sr(t[o],e,n):r[o]=t[o])}(t,e,n,r),r}const Mr=function(){return{onProcessStyle:function(t,e,n){return"extend"in t?Sr(t,e,n):t},onChangeValue:function(t,e,n){if("extend"!==e)return t;if(null==t||!1===t){for(var r in n[Er])n.prop(r,null);return n[Er]=null,null}if("object"==typeof t){for(var o in t)n.prop(o,t[o]);n[Er]=t}return null}}};var Br=/\s*,\s*/g,Tr=/&/g,Lr=/\$([\w-]+)/g;const Ir=function(){function t(t,e){return function(n,r){var o=t.getRule(r)||e&&e.getRule(r);return o?o.selector:r}}function e(t,e){for(var n=e.split(Br),r=t.split(Br),o="",i=0;i<n.length;i++)for(var a=n[i],s=0;s<r.length;s++){var l=r[s];o&&(o+=", "),o+=-1!==l.indexOf("&")?l.replace(Tr,a):a+" "+l}return o}function n(t,e,n){if(n)return(0,b.A)({},n,{index:n.index+1});var r=t.options.nestingLevel;r=void 0===r?1:r+1;var o=(0,b.A)({},t.options,{nestingLevel:r,index:e.indexOf(t)+1});return delete o.name,o}return{onProcessStyle:function(r,o,i){if("style"!==o.type)return r;var a,s,l=o,c=l.options.parent;for(var d in r){var p=-1!==d.indexOf("&"),h="@"===d[0];if(p||h){if(a=n(l,c,a),p){var u=e(d,l.selector);s||(s=t(c,i)),u=u.replace(Lr,s);var f=l.key+"-"+d;"replaceRule"in c?c.replaceRule(f,r[d],(0,b.A)({},a,{selector:u})):c.addRule(f,r[d],(0,b.A)({},a,{selector:u}))}else h&&c.addRule(d,{},a).addRule(l.key,r[d],{selector:l.selector});delete r[d]}}return r}}};function Or(t,e){if(!e)return!0;if(Array.isArray(e)){for(var n=0;n<e.length;n++){if(!Or(t,e[n]))return!1}return!0}if(e.indexOf(" ")>-1)return Or(t,e.split(" "));var r=t.options.parent;if("$"===e[0]){var o=r.getRule(e.substr(1));return!!o&&(o!==t&&(r.classes[t.key]+=" "+r.classes[o.key],!0))}return r.classes[t.key]+=" "+e,!0}const Hr=function(){return{onProcessStyle:function(t,e){return"composes"in t?(Or(e,t.composes),delete t.composes,t):t}}};var Nr=/[A-Z]/g,Rr=/^ms-/,zr={};function Pr(t){return"-"+t.toLowerCase()}const $r=function(t){if(zr.hasOwnProperty(t))return zr[t];var e=t.replace(Nr,Pr);return zr[t]=Rr.test(e)?"-"+e:e};function Dr(t){var e={};for(var n in t){e[0===n.indexOf("--")?n:$r(n)]=t[n]}return t.fallbacks&&(Array.isArray(t.fallbacks)?e.fallbacks=t.fallbacks.map(Dr):e.fallbacks=Dr(t.fallbacks)),e}const jr=function(){return{onProcessStyle:function(t){if(Array.isArray(t)){for(var e=0;e<t.length;e++)t[e]=Dr(t[e]);return t}return Dr(t)},onChangeValue:function(t,e,n){if(0===e.indexOf("--"))return t;var r=$r(e);return e===r?t:(n.prop(r,t),null)}}};var Fr=ir&&CSS?CSS.px:"px",Ur=ir&&CSS?CSS.ms:"ms",qr=ir&&CSS?CSS.percent:"%";function Wr(t){var e=/(-[a-z])/g,n=function(t){return t[1].toUpperCase()},r={};for(var o in t)r[o]=t[o],r[o.replace(e,n)]=t[o];return r}var Vr=Wr({"animation-delay":Ur,"animation-duration":Ur,"background-position":Fr,"background-position-x":Fr,"background-position-y":Fr,"background-size":Fr,border:Fr,"border-bottom":Fr,"border-bottom-left-radius":Fr,"border-bottom-right-radius":Fr,"border-bottom-width":Fr,"border-left":Fr,"border-left-width":Fr,"border-radius":Fr,"border-right":Fr,"border-right-width":Fr,"border-top":Fr,"border-top-left-radius":Fr,"border-top-right-radius":Fr,"border-top-width":Fr,"border-width":Fr,"border-block":Fr,"border-block-end":Fr,"border-block-end-width":Fr,"border-block-start":Fr,"border-block-start-width":Fr,"border-block-width":Fr,"border-inline":Fr,"border-inline-end":Fr,"border-inline-end-width":Fr,"border-inline-start":Fr,"border-inline-start-width":Fr,"border-inline-width":Fr,"border-start-start-radius":Fr,"border-start-end-radius":Fr,"border-end-start-radius":Fr,"border-end-end-radius":Fr,margin:Fr,"margin-bottom":Fr,"margin-left":Fr,"margin-right":Fr,"margin-top":Fr,"margin-block":Fr,"margin-block-end":Fr,"margin-block-start":Fr,"margin-inline":Fr,"margin-inline-end":Fr,"margin-inline-start":Fr,padding:Fr,"padding-bottom":Fr,"padding-left":Fr,"padding-right":Fr,"padding-top":Fr,"padding-block":Fr,"padding-block-end":Fr,"padding-block-start":Fr,"padding-inline":Fr,"padding-inline-end":Fr,"padding-inline-start":Fr,"mask-position-x":Fr,"mask-position-y":Fr,"mask-size":Fr,height:Fr,width:Fr,"min-height":Fr,"max-height":Fr,"min-width":Fr,"max-width":Fr,bottom:Fr,left:Fr,top:Fr,right:Fr,inset:Fr,"inset-block":Fr,"inset-block-end":Fr,"inset-block-start":Fr,"inset-inline":Fr,"inset-inline-end":Fr,"inset-inline-start":Fr,"box-shadow":Fr,"text-shadow":Fr,"column-gap":Fr,"column-rule":Fr,"column-rule-width":Fr,"column-width":Fr,"font-size":Fr,"font-size-delta":Fr,"letter-spacing":Fr,"text-decoration-thickness":Fr,"text-indent":Fr,"text-stroke":Fr,"text-stroke-width":Fr,"word-spacing":Fr,motion:Fr,"motion-offset":Fr,outline:Fr,"outline-offset":Fr,"outline-width":Fr,perspective:Fr,"perspective-origin-x":qr,"perspective-origin-y":qr,"transform-origin":qr,"transform-origin-x":qr,"transform-origin-y":qr,"transform-origin-z":qr,"transition-delay":Ur,"transition-duration":Ur,"vertical-align":Fr,"flex-basis":Fr,"shape-margin":Fr,size:Fr,gap:Fr,grid:Fr,"grid-gap":Fr,"row-gap":Fr,"grid-row-gap":Fr,"grid-column-gap":Fr,"grid-template-rows":Fr,"grid-template-columns":Fr,"grid-auto-rows":Fr,"grid-auto-columns":Fr,"box-shadow-x":Fr,"box-shadow-y":Fr,"box-shadow-blur":Fr,"box-shadow-spread":Fr,"font-line-height":Fr,"text-shadow-x":Fr,"text-shadow-y":Fr,"text-shadow-blur":Fr});function Yr(t,e,n){if(null==e)return e;if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]=Yr(t,e[r],n);else if("object"==typeof e)if("fallbacks"===t)for(var o in e)e[o]=Yr(o,e[o],n);else for(var i in e)e[i]=Yr(t+"-"+i,e[i],n);else if("number"==typeof e&&!1===isNaN(e)){var a=n[t]||Vr[t];return!a||0===e&&a===Fr?e.toString():"function"==typeof a?a(e).toString():""+e+a}return e}const Xr=function(t){void 0===t&&(t={});var e=Wr(t);return{onProcessStyle:function(t,n){if("style"!==n.type)return t;for(var r in t)t[r]=Yr(r,t[r],e);return t},onChangeValue:function(t,n){return Yr(n,t,e)}}};var Zr={"background-size":!0,"background-position":!0,border:!0,"border-bottom":!0,"border-left":!0,"border-top":!0,"border-right":!0,"border-radius":!0,"border-image":!0,"border-width":!0,"border-style":!0,"border-color":!0,"box-shadow":!0,flex:!0,margin:!0,padding:!0,outline:!0,"transform-origin":!0,transform:!0,transition:!0},Jr={position:!0,size:!0},Kr={padding:{top:0,right:0,bottom:0,left:0},margin:{top:0,right:0,bottom:0,left:0},background:{attachment:null,color:null,image:null,position:null,repeat:null},border:{width:null,style:null,color:null},"border-top":{width:null,style:null,color:null},"border-right":{width:null,style:null,color:null},"border-bottom":{width:null,style:null,color:null},"border-left":{width:null,style:null,color:null},outline:{width:null,style:null,color:null},"list-style":{type:null,position:null,image:null},transition:{property:null,duration:null,"timing-function":null,timingFunction:null,delay:null},animation:{name:null,duration:null,"timing-function":null,timingFunction:null,delay:null,"iteration-count":null,iterationCount:null,direction:null,"fill-mode":null,fillMode:null,"play-state":null,playState:null},"box-shadow":{x:0,y:0,blur:0,spread:0,color:null,inset:null},"text-shadow":{x:0,y:0,blur:null,color:null}},Gr={border:{radius:"border-radius",image:"border-image",width:"border-width",style:"border-style",color:"border-color"},"border-bottom":{width:"border-bottom-width",style:"border-bottom-style",color:"border-bottom-color"},"border-top":{width:"border-top-width",style:"border-top-style",color:"border-top-color"},"border-left":{width:"border-left-width",style:"border-left-style",color:"border-left-color"},"border-right":{width:"border-right-width",style:"border-right-style",color:"border-right-color"},background:{size:"background-size",image:"background-image"},font:{style:"font-style",variant:"font-variant",weight:"font-weight",stretch:"font-stretch",size:"font-size",family:"font-family",lineHeight:"line-height","line-height":"line-height"},flex:{grow:"flex-grow",basis:"flex-basis",direction:"flex-direction",wrap:"flex-wrap",flow:"flex-flow",shrink:"flex-shrink"},align:{self:"align-self",items:"align-items",content:"align-content"},grid:{"template-columns":"grid-template-columns",templateColumns:"grid-template-columns","template-rows":"grid-template-rows",templateRows:"grid-template-rows","template-areas":"grid-template-areas",templateAreas:"grid-template-areas",template:"grid-template","auto-columns":"grid-auto-columns",autoColumns:"grid-auto-columns","auto-rows":"grid-auto-rows",autoRows:"grid-auto-rows","auto-flow":"grid-auto-flow",autoFlow:"grid-auto-flow",row:"grid-row",column:"grid-column","row-start":"grid-row-start",rowStart:"grid-row-start","row-end":"grid-row-end",rowEnd:"grid-row-end","column-start":"grid-column-start",columnStart:"grid-column-start","column-end":"grid-column-end",columnEnd:"grid-column-end",area:"grid-area",gap:"grid-gap","row-gap":"grid-row-gap",rowGap:"grid-row-gap","column-gap":"grid-column-gap",columnGap:"grid-column-gap"}};function Qr(t,e,n,r){return null==n[e]?t:0===t.length?[]:Array.isArray(t[0])?Qr(t[0],e,n,r):"object"==typeof t[0]?function(t,e,n){return t.map(function(t){return to(t,e,n,!1,!0)})}(t,e,r):[t]}function to(t,e,n,r,o){if(!Kr[e]&&!Gr[e])return[];var i=[];if(Gr[e]&&(t=function(t,e,n,r){for(var o in n){var i=n[o];if(void 0!==t[o]&&(r||!e.prop(i))){var a,s=eo((a={},a[i]=t[o],a),e)[i];r?e.style.fallbacks[i]=s:e.style[i]=s}delete t[o]}return t}(t,n,Gr[e],r)),Object.keys(t).length)for(var a in Kr[e])t[a]?Array.isArray(t[a])?i.push(null===Jr[a]?t[a]:t[a].join(" ")):i.push(t[a]):null!=Kr[e][a]&&i.push(Kr[e][a]);return!i.length||o?i:[i]}function eo(t,e,n){for(var r in t){var o=t[r];if(Array.isArray(o)){if(!Array.isArray(o[0])){if("fallbacks"===r){for(var i=0;i<t.fallbacks.length;i++)t.fallbacks[i]=eo(t.fallbacks[i],e,!0);continue}t[r]=Qr(o,r,Zr,e),t[r].length||delete t[r]}}else if("object"==typeof o){if("fallbacks"===r){t.fallbacks=eo(t.fallbacks,e,!0);continue}t[r]=to(o,r,e,n),t[r].length||delete t[r]}else""===t[r]&&delete t[r]}return t}const no=function(){return{onProcessStyle:function(t,e){if(!t||"style"!==e.type)return t;if(Array.isArray(t)){for(var n=0;n<t.length;n++)t[n]=eo(t[n],e);return t}return eo(t,e)}}};function ro(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function oo(t){return function(t){if(Array.isArray(t))return ro(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ro(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ro(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var io="",ao="",so="",lo="",co=Fe&&"ontouchstart"in document.documentElement;if(Fe){var po={Moz:"-moz-",ms:"-ms-",O:"-o-",Webkit:"-webkit-"},ho=document.createElement("p").style;for(var uo in po)if(uo+"Transform"in ho){io=uo,ao=po[uo];break}"Webkit"===io&&"msHyphens"in ho&&(io="ms",ao=po.ms,lo="edge"),"Webkit"===io&&"-apple-trailing-word"in ho&&(so="apple")}var fo=io,mo=ao,go=so,bo=lo,yo=co;var wo={noPrefill:["appearance"],supportedProperty:function(t){return"appearance"===t&&("ms"===fo?"-webkit-"+t:mo+t)}},_o={noPrefill:["color-adjust"],supportedProperty:function(t){return"color-adjust"===t&&("Webkit"===fo?mo+"print-"+t:t)}},Ao=/[-\s]+(.)?/g;function xo(t,e){return e?e.toUpperCase():""}function vo(t){return t.replace(Ao,xo)}function ko(t){return vo("-"+t)}var Co,Eo={noPrefill:["mask"],supportedProperty:function(t,e){if(!/^mask/.test(t))return!1;if("Webkit"===fo){var n="mask-image";if(vo(n)in e)return t;if(fo+ko(n)in e)return mo+t}return t}},So={noPrefill:["text-orientation"],supportedProperty:function(t){return"text-orientation"===t&&("apple"!==go||yo?t:mo+t)}},Mo={noPrefill:["transform"],supportedProperty:function(t,e,n){return"transform"===t&&(n.transform?t:mo+t)}},Bo={noPrefill:["transition"],supportedProperty:function(t,e,n){return"transition"===t&&(n.transition?t:mo+t)}},To={noPrefill:["writing-mode"],supportedProperty:function(t){return"writing-mode"===t&&("Webkit"===fo||"ms"===fo&&"edge"!==bo?mo+t:t)}},Lo={noPrefill:["user-select"],supportedProperty:function(t){return"user-select"===t&&("Moz"===fo||"ms"===fo||"apple"===go?mo+t:t)}},Io={supportedProperty:function(t,e){return!!/^break-/.test(t)&&("Webkit"===fo?"WebkitColumn"+ko(t)in e&&mo+"column-"+t:"Moz"===fo&&("page"+ko(t)in e&&"page-"+t))}},Oo={supportedProperty:function(t,e){if(!/^(border|margin|padding)-inline/.test(t))return!1;if("Moz"===fo)return t;var n=t.replace("-inline","");return fo+ko(n)in e&&mo+n}},Ho={supportedProperty:function(t,e){return vo(t)in e&&t}},No={supportedProperty:function(t,e){var n=ko(t);return"-"===t[0]||"-"===t[0]&&"-"===t[1]?t:fo+n in e?mo+t:"Webkit"!==fo&&"Webkit"+n in e&&"-webkit-"+t}},Ro={supportedProperty:function(t){return"scroll-snap"===t.substring(0,11)&&("ms"===fo?""+mo+t:t)}},zo={supportedProperty:function(t){return"overscroll-behavior"===t&&("ms"===fo?mo+"scroll-chaining":t)}},Po={"flex-grow":"flex-positive","flex-shrink":"flex-negative","flex-basis":"flex-preferred-size","justify-content":"flex-pack",order:"flex-order","align-items":"flex-align","align-content":"flex-line-pack"},$o={supportedProperty:function(t,e){var n=Po[t];return!!n&&(fo+ko(n)in e&&mo+n)}},Do={flex:"box-flex","flex-grow":"box-flex","flex-direction":["box-orient","box-direction"],order:"box-ordinal-group","align-items":"box-align","flex-flow":["box-orient","box-direction"],"justify-content":"box-pack"},jo=Object.keys(Do),Fo=function(t){return mo+t},Uo={supportedProperty:function(t,e,n){var r=n.multiple;if(jo.indexOf(t)>-1){var o=Do[t];if(!Array.isArray(o))return fo+ko(o)in e&&mo+o;if(!r)return!1;for(var i=0;i<o.length;i++)if(!(fo+ko(o[0])in e))return!1;return o.map(Fo)}return!1}},qo=[wo,_o,Eo,So,Mo,Bo,To,Lo,Io,Oo,Ho,No,Ro,zo,$o,Uo],Wo=qo.filter(function(t){return t.supportedProperty}).map(function(t){return t.supportedProperty}),Vo=qo.filter(function(t){return t.noPrefill}).reduce(function(t,e){return t.push.apply(t,oo(e.noPrefill)),t},[]),Yo={};if(Fe){Co=document.createElement("p");var Xo=window.getComputedStyle(document.documentElement,"");for(var Zo in Xo)isNaN(Zo)||(Yo[Xo[Zo]]=Xo[Zo]);Vo.forEach(function(t){return delete Yo[t]})}function Jo(t,e){if(void 0===e&&(e={}),!Co)return t;if(null!=Yo[t])return Yo[t];"transition"!==t&&"transform"!==t||(e[t]=t in Co.style);for(var n=0;n<Wo.length&&(Yo[t]=Wo[n](t,Co.style,e),!Yo[t]);n++);try{Co.style[t]=""}catch(t){return!1}return Yo[t]}var Ko,Go={},Qo={transition:1,"transition-property":1,"-webkit-transition":1,"-webkit-transition-property":1},ti=/(^\s*[\w-]+)|, (\s*[\w-]+)(?![^()]*\))/g;function ei(t,e,n){if("var"===e)return"var";if("all"===e)return"all";if("all"===n)return", all";var r=e?Jo(e):", "+Jo(n);return r||(e||n)}function ni(t,e){var n=e;if(!Ko||"content"===t)return e;if("string"!=typeof n||!isNaN(parseInt(n,10)))return n;var r=t+n;if(null!=Go[r])return Go[r];try{Ko.style[t]=n}catch(t){return Go[r]=!1,!1}if(Qo[t])n=n.replace(ti,ei);else if(""===Ko.style[t]&&("-ms-flex"===(n=mo+n)&&(Ko.style[t]="-ms-flexbox"),Ko.style[t]=n,""===Ko.style[t]))return Go[r]=!1,!1;return Ko.style[t]="",Go[r]=n,Go[r]}Fe&&(Ko=document.createElement("p"));const ri=function(){function t(e){for(var n in e){var r=e[n];if("fallbacks"===n&&Array.isArray(r))e[n]=r.map(t);else{var o=!1,i=Jo(n);i&&i!==n&&(o=!0);var a=!1,s=ni(i,tn(r));s&&s!==r&&(a=!0),(o||a)&&(o&&delete e[n],e[i||n]=s||r)}}return e}return{onProcessRule:function(t){if("keyframes"===t.type){var e=t;e.at=function(t){return"-"===t[1]||"ms"===fo?t:"@"+mo+"keyframes"+t.substr(10)}(e.at)}},onProcessStyle:function(e,n){return"style"!==n.type?e:t(e)},onChangeValue:function(t,e){return ni(e,tn(t))||t}}};const oi=function(){var t=function(t,e){return t.length===e.length?t>e?1:-1:t.length-e.length};return{onProcessStyle:function(e,n){if("style"!==n.type)return e;for(var r={},o=Object.keys(e).sort(t),i=0;i<o.length;i++)r[o[i]]=e[o[i]];return r}}};const ii=function(t){return void 0===t&&(t={}),{plugins:[pr(),fr(t.observable),br(),kr(),Mr(),Ir(),Hr(),jr(),Xr(t.defaultUnit),no(),ri(),oi()]}};var ai=a(89343),si={};si.setAttributes=p(),si.insert=c().bind(null,"head"),si.domAPI=s(),si.insertStyleElement=u();o()(ai.A,si);ai.A&&ai.A.locals&&ai.A.locals;class li{constructor(t,e){this.createResizer=t=>{const e=document.createElement("div");return e.className=t,e.classList.add("resizer"),e};const{keepRatio:n,container:r=document.body,onResize:o,minWidth:i,minHeight:a,rotate:s}=e;this.querySelector=t,this.keepRatio=n,this.container=r,this.isImage=!1,this.rotate=s,this.canKeepRatio=!1,this.mounted=!1,this.onResize=o,this.minimum_size=i,this.minimum_height=a||10,this.axis="x",this.resizers=[],this.clickedResizer=null,this.element,this.isMouseDown=!1,this.original_width=0,this.original_height=0,this.original_x=0,this.original_y=0,this.original_mouse_x=0,this.original_mouse_y=0,this.onDraggable=this.onDraggable.bind(this),this.resize=this.resize.bind(this),this.stopResize=this.stopResize.bind(this),this.onClickedTarget=this.onClickedTarget.bind(this),this.rePosition=this.rePosition.bind(this),this.init=this.init.bind(this),this.onClickResizer=this.onClickResizer.bind(this),this.init()}onClickResizer(t){this.clickedResizer=t.target,t.preventDefault(),this.isMouseDown=!0;const e=this.element.getBoundingClientRect();this.original_width=parseFloat(e.width),this.original_height=parseFloat(e.height),this.original_x=this.element.getBoundingClientRect().left,this.original_y=this.element.getBoundingClientRect().top,this.original_mouse_x=t.pageX,this.original_mouse_y=t.pageY,window.addEventListener("mousemove",this.resize),window.addEventListener("mouseup",this.stopResize)}createSizePreview(){const t=document.createElement("div");return t.classList.add("size-preview"),t}createImageRatioResizer(){const t=document.createElement("div");return t.classList.add("img-ratio-resizer"),t.classList.add("bottom-right"),t}createBorder(t){const e=document.createElement("div");if(e.classList.add("resizable-border"),e.classList.add(t),"bottom"===t){const t=document.createElement("div");t.classList.add("bottom-ruler"),e.appendChild(t)}if("top"===t){const t=document.createElement("div");t.classList.add("top-ruler"),e.appendChild(t)}if("left"===t){const t=document.createElement("div");t.classList.add("left-ruler"),e.appendChild(t)}if("right"===t){const t=document.createElement("div");t.classList.add("right-ruler"),e.appendChild(t)}return e}init(){this.sizePreview=this.createSizePreview(),this.imageRatioResizer=this.createImageRatioResizer(),this.imageRatioResizer.addEventListener("mousedown",this.onClickResizer),this.borders=[this.createBorder("left"),this.createBorder("right"),this.createBorder("bottom"),this.createBorder("top")];const t=this.resizers=[this.createResizer("bottom-center"),this.createResizer("left-center"),this.createResizer("right-center"),this.createResizer("bottom-left"),this.createResizer("bottom-right"),this.createResizer("top-right"),this.createResizer("top-left")];this.rotate&&t.push(this.createResizer("rotate"));for(let e=0;e<t.length;e++)t[e].addEventListener("mousedown",this.onClickResizer);window.addEventListener("mousedown",this.onClickedTarget)}onDraggable(t){this.stopResize(t)}onClickedTarget(t){if(this.isMouseDown)return;let e=t.target;const n=t.path?t.path:t.composedPath&&t.composedPath();Array.isArray(n)&&n.length>0&&(e=n[0]);for(let t=0;t<this.resizers.length;t++){const n=this.resizers[t];if(e.closest("."+n.className.split(" ").join(".")))return}const r=e.closest(this.querySelector);r?(this.stopResize(t),this.mounted=!0,this.canKeepRatio=!1,this.isImage=!1,this.axis="xy"===r.getAttribute("cdtr-resize-axis")?"xy":"x",this.isImage?(document.body.appendChild(this.imageRatioResizer),this.resizers.forEach(t=>t.remove())):(this.resizers.forEach(t=>{this.canResizeY()||!t.classList.contains("bottom-center")?document.body.appendChild(t):t.remove()}),this.imageRatioResizer.remove()),this.borders.forEach(t=>document.body.appendChild(t)),this.element=r,this.element.addEventListener("drag",this.onDraggable),this.rePosition(),this.container?.addEventListener("scroll",this.rePosition),window.addEventListener("scroll",this.rePosition),window.addEventListener("resize",this.rePosition)):this.stopResize(t)}stopResize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.borders.forEach(t=>t.classList.remove("on-resizing")),this.isMouseDown=!1,this.sizePreview.remove(),window.removeEventListener("mouseup",this.stopResize),window.removeEventListener("mousemove",this.resize),this.mounted&&"mouseup"===t.type||(this.mounted=!1,this.borders.forEach(t=>t.remove()),this.resizers.forEach(t=>t.remove()),this.element?.removeEventListener("drag",this.onDraggable),this.imageRatioResizer.remove(),this.container?.removeEventListener("scroll",this.rePosition),window.removeEventListener("scroll",this.rePosition),window.removeEventListener("resize",this.rePosition),this.element=null)}canResizeY(){return"xy"===this.axis}heightFromDrag(t){let e=this.original_height+(t.pageY-this.original_mouse_y);return e<this.minimum_height&&(e=this.minimum_height),e+"px"}resize(t){if(this.borders.forEach(t=>t.classList.add("on-resizing")),document.body.appendChild(this.sizePreview),this.sizePreview.style.left=t.clientX+50+"px",this.sizePreview.style.top=t.clientY+"px",this.clickedResizer.classList.contains("left-center")){let e=this.original_width-(t.pageX-this.original_mouse_x);e+="px",this.onResize(this.element,{width:e})}else if(this.clickedResizer.classList.contains("right-center")){let e=this.original_width+(t.pageX-this.original_mouse_x);e>this.minimum_size&&(e+="px",this.onResize(this.element,{width:e}))}else if(this.clickedResizer.classList.contains("bottom-center")){const e=this.keepRatio&&this.canKeepRatio?"auto":this.heightFromDrag(t);this.onResize(this.element,{height:e})}else if(this.clickedResizer.classList.contains("bottom-right")){const e={};let n=this.original_width+(t.pageX-this.original_mouse_x);n>this.minimum_size&&(e.width=n+"px"),this.canResizeY()&&(e.height=this.heightFromDrag(t)),(e.width||e.height)&&this.onResize(this.element,e)}else if(this.clickedResizer.classList.contains("bottom-left")){const e={width:this.original_width-(t.pageX-this.original_mouse_x)+"px"};this.canResizeY()&&(e.height=this.heightFromDrag(t)),this.onResize(this.element,e)}else if(this.clickedResizer.classList.contains("top-right")){let e=this.original_width+(t.pageX-this.original_mouse_x);e>this.minimum_size&&(e+="px",this.onResize(this.element,{width:e}))}else if(this.clickedResizer.classList.contains("top-left")){let e=this.original_width-(t.pageX-this.original_mouse_x);e>this.minimum_size&&(e+="px",this.onResize(this.element,{width:e}))}else if(this.clickedResizer.classList.contains("rotate")){const{clientY:e,clientX:n}=t,r=this.element.getBoundingClientRect(),o=Math.atan2(e-r.y,n-r.x);this.element.style.transform=`rotate(${o}rad)`}this.rePosition()}rePosition(){window.requestAnimationFrame(()=>{if(!this.element)return;const t=this.element.getBoundingClientRect();if(this.sizePreview&&(this.sizePreview.innerHTML=this.canResizeY()?`w:${parseInt(t.width)} h:${parseInt(t.height)}`:`w:${parseInt(t.width)}`),this.borders.forEach(e=>{if(e.classList.contains("left"))e.style.width="1px",e.style.left=t.left+"px",e.style.top=t.top+"px",e.style.height=t.height+"px";else if(e.classList.contains("right"))e.style.width="1px",e.style.left=t.right+"px",e.style.top=t.top+"px",e.style.height=t.height+"px";else if(e.classList.contains("top")){e.style.left=t.left+"px",e.style.top=t.top+"px",e.style.width=t.width+"px",e.style.height="1px";const n=e.querySelector(".top-ruler");n&&(n.style.top=t.top+"px")}else if(e.classList.contains("bottom")){e.style.height="1px",e.style.left=t.left+"px",e.style.top=t.bottom+"px",e.style.width=t.width+"px";const n=e.querySelector(".bottom-ruler");n&&(n.style.top=t.bottom+"px")}}),this.isImage)this.imageRatioResizer.style.left=t.left+t.width+"px",this.imageRatioResizer.style.top=t.bottom+"px";else for(let e=0;e<this.resizers.length;e++){const n=this.resizers[e];n.classList.contains("bottom-left")?(n.style.left=t.left+"px",n.style.top=t.bottom+"px"):n.classList.contains("bottom-right")?(n.style.left=t.right+"px",n.style.top=t.bottom+"px"):n.classList.contains("top-right")?(n.style.left=t.right+"px",n.style.top=t.top+"px"):n.classList.contains("top-left")?(n.style.left=t.left+"px",n.style.top=t.top+"px"):n.classList.contains("left-center")?(n.style.left=t.left+"px",n.style.top=(t.top+t.bottom)/2+"px"):n.classList.contains("right-center")?(n.style.left=t.right+"px",n.style.top=(t.top+t.bottom)/2+"px"):n.classList.contains("bottom-center")?(n.style.left=(t.left+t.right)/2+"px",n.style.top=t.bottom+"px"):n.classList.contains("rotate")&&(n.style.left=(t.left+t.right)/2+"px",n.style.top=t.top-60+"px")}})}}var ci=a(64749);class di{constructor(t,e){e||(e={}),this.querySelector=t,this.pose={initX:0,initY:0,firstX:0,firstY:0},this.onMouseMove=t=>{if(this.target){if("ghost"===e.mode){this.target.style.zIndex=-1;const n=this.getHoverElement(t);if(e.drop&&n){const t=n.closest(e.drop);t&&e.drop&&"function"==typeof e.onHover?e.onHover({drag:this.originalTarget,drop:t}):"function"==typeof e.onHoverout&&e.onHoverout()}this.target.style.zIndex=9999999}const n=this.target.getBoundingClientRect();let r=this.pose.initY+t.pageY-this.pose.firstY,o=this.pose.initX+t.pageX-this.pose.firstX;e.maxTop&&e.maxTop>r&&(r=e.maxTop),r<=0&&(r=0),r>window.innerHeight-n.height&&(r=window.innerHeight-n.height),o<=0&&(o=0),o+n.width>=window.innerWidth&&(o=window.innerWidth-n.width),this.target.style.left=o+"px",this.target.style.top=r+"px"}else window.removeEventListener("mousemove",this.onMouseMove,!1)},this.onMouseDown=t=>{if(1!==t.which)return;Array.from(document.querySelectorAll("[mode='ghost']")).forEach(t=>t.remove());const n=t.target,r=n.closest(this.querySelector);if(!r)return null;const o=r.getAttribute("handle");if(o){if(!n.closest(o))return null}this.target=r,this.originalTarget=r;const i=r.getBoundingClientRect();"ghost"===e.mode&&(this.target=r.cloneNode(!0),this.target.mode="ghost",this.target.setAttribute("mode","ghost"),this.target.setAttribute("style",(0,ci.i)({position:"fixed",zIndex:-1,width:i.width+"px",maxWidth:"initial",minWidth:"initial",left:i.left+"px",top:i.top+"px",opacity:.5})),document.body.appendChild(this.target)),this.pose.initX=r.offsetLeft||i.left,this.pose.initY=r.offsetTop||i.top,this.pose.firstX=t.pageX,this.pose.firstY=t.pageY,window.addEventListener("mousemove",this.onMouseMove,!1),window.addEventListener("mouseup",t=>{const n=this.getHoverElement(t);if(e.drop){const t=n.closest(e.drop);t&&"function"==typeof e.onAcceptDrop&&e.onAcceptDrop({drag:this.originalTarget,drop:t}),"function"==typeof e.onDrop&&e.onDrop({drag:this.originalTarget})}window.removeEventListener("mousemove",this.onMouseMove,!1),"ghost"===e.mode&&this.target&&this.target.remove(),this.target=null},{once:!0})},this.start()}getHoverElement(t){this.target&&(this.target.style.zIndex=-1);return document.elementFromPoint(t.clientX,t.clientY)}start(){document.body.addEventListener("mousedown",this.onMouseDown)}destroy(){document.body.removeEventListener("mousedown",this.onMouseDown)}}var pi=a(39148),hi={};hi.setAttributes=p(),hi.insert=c().bind(null,"head"),hi.domAPI=s(),hi.insertStyleElement=u();o()(pi.A,hi);const ui=pi.A&&pi.A.locals?pi.A.locals:void 0;function fi(t){if("buttons"in(t=t||window.event))return 1===t.buttons;return 1===(t.which||t.button)}const mi=function(t,e,r){if(!t)return;let o,i;i=t.cloneNode(!0),t.parentElement?t=i.getBoundingClientRect():(document.body.appendChild(i),i.style=`\n width:${t.style.width||"100px"};\n height:${t.style.height||"100px"};\n background:var(--primary);\n opacity:.4;\n `,o={...i.getBoundingClientRect()},o.left=e,o.top=r),i.remove();const a=(0,n.A)("div",null,i.cloneNode(!0));["cdtr-move-handle-bar","[data-mounted]"].forEach(t=>{a.querySelectorAll(t).forEach(t=>t.remove())});const s=a.querySelector(".selected");return s&&s.classList.remove("selected"),o&&(a.style.position="fixed",a.classList.add("mirror"),a.style.opacity=1,a.style.zIndex=999999999,a.style.overflow="hidden",a.style.transition="all 1s",a.style.width=`${o.width}px`,a.style.height=`${o.height}px`,a.style.border="1px solid #484553b3",a.style.top=`${o.top}px`,a.style.left=`${o.left}px`,a.__offsetX=e-o.left,a.__offsetY=r-o.top),document.body.appendChild(a),setTimeout(()=>{a.style.transform="rotate(10deg)"},100),a},gi="touchmove",bi="mousemove",yi="mouseup",wi="mousedown",_i="touchend",Ai="touchstart",xi="left",vi="right",ki="top",Ci="bottom",Ei="__sortable_draggable-guide-line";var Si=a(20195);const Mi="15PX";function Bi(t,e){if(t.closest("[data-draggable-for]")){const e=t.dataset.draggableFor;if(e){let t=j.Ay.getComponent(e);if(t){if("card"===t.type){const e=t.closest("col");e&&(t=e)}return t.element}}}let n,r=t;for(;r||!n;){let t;if(r&&(t=r.closest(e)),t){n=t;break}r=r.parentElement||r.offsetParent}return n}class Ti{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.createGuideLine(),this.onMouseUp=this.onMouseUp.bind(this),this.dragStart=this.dragStart.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.dragEnd=this.dragEnd.bind(this),this.moveY=0,this.moveX=0,this.isValid=!0,this.mouseUp=!1,this.optionsInit(t),this.init()}optionsInit(t){this.options={draggable:t.draggable,handle:t.handle,delay:"number"==typeof t.delay?t.delay:0,preventDefault:t.preventDefault,direction:t.direction,onStart:t.onStart,finally:t.finally,on:t.on,onMove:t.onMove,onClone:t.onClone,onEnd:t.onEnd,body:t.body||document.body,clone:t.clone,group:t.group,sort:t.sort}}createGuideLine(){this.guideLine=document.createElement("div"),this.guideLine.className=Ei,this.guideLine.classList.add(ui.guideLine),this.guideLine.style.position="absolute",this.guideLine.style.opacity=1,this.guideLine.style.border="1px solid blue"}init(){this.bindDrag()}dragEnd(){if(this.dragStarted=!1,this.styles&&this.styles.remove(),this.mouseUp=!0,this.mirror&&(this.mirror.remove(),this.mirror=null),this.guideLine.remove(),this.guideLine.style.left="-9999px",this.guideLine.style.top="-9999px",document.removeEventListener(bi,this.onMouseMove),document.removeEventListener(gi,this.onMouseMove,{passive:!1}),document.removeEventListener(yi,this.dragEnd),document.removeEventListener(_i,this.dragEnd),this.dragEl&&this.dragEl.classList.remove(ui.whileDragging),this.options.clone&&cloneEl.remove(),this.direction&&this.dropEl){const t=!0===this.options.clone?this.dragEl.cloneNode(!0):this.dragEl;!0===this.options.clone&&"function"==typeof this.options.onClone&&this.options.onClone({clone:this.cloneEl});let e=this.direction;if("left"===e?e="beforebegin":"right"===e&&(e="afterend"),this.isValid&&"function"==typeof this.options.onEnd){this.dragEl;this.options.onEnd({item:this.dragEl,dragType:this.dragEl.getAttribute("draggable-element"),dropType:this.dropEl.getAttribute("droppable-element"),clone:t,to:this.dropEl,direction:this.direction})}this.dragEl=null,this.dropEl=null}}onMouseMove(t){if(t.preventDefault(),this.isValid=!0,t.type===bi&&!fi(t))return this.guideLine.remove(),void document.removeEventListener(bi,this.onMouseMove);const e=t.type===gi?t.touches[0].clientY:t.clientY,n=t.type===gi?t.touches[0].clientX:t.clientX,r=t.type===gi?t.touches[0].pageY:t.pageY;e<this.moveY?this.mouseDirection=ki:e>this.moveY&&(this.mouseDirection=Ci),this.moveY=e,this.moveX=n;const o=()=>{"string"==typeof this.options.body&&(this.options.body=document.querySelector(this.options.body));let t=this.options.body;this.mirror&&this.moveY<100&&this.mouseDirection===ki?(t.scroll(0,t.scrollTop-1),setTimeout(()=>{o()},100)):this.mirror&&window.innerHeight-this.moveY<100&&this.mouseDirection===Ci&&(t.scroll(0,t.scrollTop+1),setTimeout(()=>{o()},100))};this.mirror&&this.dragEl&&(this.mirror.style.left=n-document.body.offsetLeft-this.mirror.__offsetX+"px",this.mirror.style.top=e-document.body.offsetTop-this.mirror.__offsetY+"px",this.mirror.style.display="none");let i,a=document.elementsFromPoint(n,e);if(this.mirror&&(this.mirror.style.display="block"),o(),a=a.map(t=>t.closest("[droppable-element]")).filter(t=>t),0===a.length)return;let s=0;i=a[s],this.targets=a;const l=t=>{this.dragEl.closest("[droppable-element]")?.getAttribute("droppable-element");if(t=t.closest("[droppable-element]"),this.dragEl&&this.dragEl.getAttribute("data-drop-only")){const e=t.closest(`[data-type='${this.dragEl.getAttribute("data-drop-only")}']`);e&&(t=e)}const e=t.getAttribute("droppable-element"),n=t.getAttribute("droppable-if"),o=t.getAttribute("droppable-direction")||"top,bottom,left,right",i=this.dragEl.getAttribute("draggable-direction")||"top,bottom";t.getAttribute("droppable-bottom");if("col"===this.dragEl.dataset.type&&"col"!==t.dataset.type){if(!(t=t.closest("[droppable-element='col']")))return;this.dropEl=t}let c=t.getBoundingClientRect();if("section"===e&&"section"!==this.dragEl.dataset.dropOnly){const e=t.querySelector("[data-type='block']:last-child");if(e){const t=e.getBoundingClientRect();return this.direction=Ci,this.dropEl=e,this.guideLine.style.top=`${r-r+window.pageYOffset+t.top+t.height}px`,this.guideLine.style.left=`${t.left}px`,this.guideLine.style.height=Mi,this.guideLine.style.width=`${t.width}px`,this.guideLine.style.opacity=1,void document.body.appendChild(this.guideLine)}}if(-1===o.indexOf("bottom")&&-1===o.indexOf("top")||-1===i.indexOf("bottom")&&-1===i.indexOf("top")||(this.guideLine.style.opacity=1,this.guideLine.style.width=`${c.width}px`,this.guideLine.style.height=Mi),"none"!==o&&-1!==o.indexOf("bottom")&&-1!==i.indexOf("bottom")&&c.bottom>this.moveY&&c.bottom-c.height/2<this.moveY&&(this.direction=Ci,this.dropEl=t,this.guideLine.style.top=`${r-r+window.pageYOffset+c.top+c.height}px`,this.guideLine.style.left=`${c.left}px`),"none"!==o&&-1!==o.indexOf("top")&&-1!==i.indexOf("top")&&c.top<this.moveY&&c.top+c.height/2>this.moveY&&(this.dropEl=t,this.direction=ki,this.guideLine.style.top=`${r-r+window.pageYOffset+c.top}px`,this.guideLine.style.left=`${c.left}px`),"none"!==o&&o.indexOf("left")>-1&&i.indexOf("left")>-1&&c.top<this.moveY&&c.left<this.moveX&&c.left+c.width/4>this.moveX&&(this.dropEl=t,this.direction=xi,this.guideLine.style.height=c.height+"px",this.guideLine.style.width=Mi,this.guideLine.style.top=`${r-r+window.pageYOffset+c.top}px`,this.guideLine.style.left=`${c.left}px`),"none"!==o&&o.indexOf("right")>-1&&i.indexOf("right")>-1&&c.top<this.moveY&&c.right-c.width/4<this.moveX&&(this.dropEl=t,this.direction=vi,this.guideLine.style.height=c.height+"px",this.guideLine.style.width=Mi,this.guideLine.style.top=`${r-r+window.pageYOffset+c.top}px`,this.guideLine.style.left=`${c.left+c.width}px`),n&&"empty"===n){this.guideLine.style.opacity=.5;const e=j.Ay.getComponent(t.dataset.id);if(!e)return console.error("compoent not founded");if(0===e.children.length){this.direction=ki,this.dropEl=t;const e=t.getBoundingClientRect(),n=(100>e.height&&e.height,1320>e.width?e.width:1320);this.guideLine.style.width=n+"px",this.guideLine.style.top=e.top+"px",this.guideLine.style.left=e.left+e.width/2-n/2+"px",document.body.appendChild(this.guideLine)}}if("none"!==o){var d=this.direction;if(this.guideLine.classList.remove(ui.bottomMode),-1===o.indexOf(d)){if(s<a.length-1)return s++,l(a[s])}else document.body.appendChild(this.guideLine)}};if(l(i),"function"==typeof this.options.onMove){const t=this.options.onMove({item:this.dragEl,to:this.dropEl||i,guideLine:this.guideLine,direction:this.direction,targets:this.targets,dragType:this.dragEl.getAttribute("draggable-element"),dropType:(this.dropEl||i).getAttribute("droppable-element")});if("boolean"==typeof t&&!t)return this.guideLine.remove(),this.isValid=!1,!1;this.dragStarted||(this.dragStarted=!0,"function"==typeof this.options.onStart&&this.options.onStart({item:this.dragEl,dragType:this.dragEl.getAttribute("draggable-element"),dropType:(this.dropEl||i).getAttribute("droppable-element"),direction:this.direction}))}}onMouseUp(){"function"==typeof this.options.finally&&this.options.finally(),this.mouseUp||this.dragEnd(),clearTimeout(this.pressDelay),document.removeEventListener(yi,this.onMouseUp)}dragStart(t){let e;if(this.mouseUp=!1,this.isValid=!0,t.type===wi&&!fi(t))return;this.can=!0;const r=()=>{let r,o=window.__dragoned_selected_element||t.originalTarget||t.target;if(window.__dragoned_selected_element&&(r=window.__dragoned_selected_element,delete window.__dragoned_selected_element),t.target.for){document.querySelector(`[data-id="${t.target.for}"]`)}const i=t.path?t.path:t.composedPath&&t.composedPath();Array.isArray(i)&&i.length>0&&(o=i[0]);let a=!1;if(o instanceof HTMLElement&&(a=!0),!a)for(var s in o)o.hasOwnProperty(s)&&(a=!0);try{o.parentElement}catch(t){a=!1}if(!a)return;if(this.options.handle&&o&&"function"==typeof o.closest&&(e=o.closest(this.options.handle),!e))return this.guideLine.remove(),!1;document.body.appendChild(this.guideLine);const l=t.type===Ai?t.touches[0].clientY:t.clientY,c=t.type===Ai?t.touches[0].clientX:t.clientX;let d=t.path?t.path:t.composedPath&&t.composedPath();if(!r){Array.isArray(d)&&0===d.length&&(d=[t.originalTarget||t.target]);for(let t=0;t<d.length;t++){const e=d[t];if(r=Bi(e,"[draggable-element]"),r){this.dragEl=r;break}}}return r?(setTimeout(()=>{this.mouseUp||this.mirror||(this.mirror=mi(r.querySelector("[element-draggable-mirror]")||r.closest("[element-draggable-mirror]")||r.closest("[draggable-element]")||r,c,l),this.dragEl.classList.add(ui.whileDragging))},250),this.styles=(0,n.A)("style",null,"body{\n cursor: grabbing;\n }\n "),document.body.appendChild(this.styles),this.dragEl=r,document.addEventListener(bi,this.onMouseMove),document.addEventListener(yi,this.dragEnd),!0):(this.guideLine.remove(),!1)};document.addEventListener(yi,this.onMouseUp),this.pressDelay=setTimeout(()=>{if(!1===this.mouseUp){if(!r())return}},this.options.delay)}bindDrag(){Si.A.connect(Si.q.MOUSE_DOWN,this.dragStart)}destroy(){Si.A.disconnect(Si.q.MOUSE_DOWN,this.dragStart),this.mirror&&this.mirror.remove(),this.guideLine&&this.guideLine.remove()}}var Li=a(4807),Ii=a(3474),Oi=a(83965),Hi=a(67549);const Ni=t=>{let{item:e,to:n,direction:r,isNew:o}=t;const i=[],a=T.M.get("components",e.dataset.id),s=T.M.get("components",n.dataset.id),l=s.parent(),c=a.parent();let d=l.children.findIndex(t=>t===s.id);"right"===r&&d++;c.children.findIndex(t=>t===a.id);if("col"!==a.type){const t={type:"col",props:{lg:0,style:{}}},e=j.Ay.createComponent({body:t,parentId:l.id,index:d});i.push(new Li.A({componentId:e.id,parentId:l.id,index:d,body:t}));const o=c.children.findIndex(t=>t===a.id),s=new Ii.A({componentId:a.id,oldParentId:c.id,newParentId:e.id,oldIndex:o,newIndex:d});i.push(s),j.Ay.moveComponent(s),"left"===r?n.parentNode.insertBefore(e.element,n):"right"===r&&n.parentNode.insertBefore(e.element,n.nextSibling),e.appendChild(a.element)}else if("col"===a.type){const t=c.children.findIndex(t=>t===a.id),e=new Ii.A({componentId:a.id,oldParentId:c.id,newParentId:l.id,oldIndex:t,newIndex:d});i.push(e),j.Ay.moveComponent(e)}(0,Oi.i)(c).forEach(t=>i.push(t));{const t=s.closest("block");if(t){(0,Hi.s)(t).forEach(t=>i.push(t))}}{const t=c.closest("block");if(t){(0,Hi.s)(t).forEach(t=>i.push(t))}}return i};var Ri=a(81139);const zi=t=>{let{item:e,to:n,direction:r}=t;const o=[],i=T.M.get("components",e.dataset.id),a=i.parent(),s=a.children.findIndex(t=>t===i.id);T.M.get("components",n.dataset.id);let l=T.M.get("components",n.dataset.id),c=l.parent();if(i.id===l.id)return console.warn("cant move to itself"),null;let d=c.children.findIndex(t=>t===l.id);if("bottom"!==r&&"right"!==r||d++,"bottom"===r||"top"===r){const t={type:"row",props:{},children:[]};"col"!==i.type?t.children.push({type:"col",props:{lg:12},children:[]}):o.push(new Ri.A({componentId:i.id,key:"lg",value:12}));c.parent();const e=j.Ay.createComponent({body:t,parentId:c.id,index:d});o.push(new Li.A({componentId:e.id,parentId:c.id,index:d,body:t}));let n=T.M.get("components",e.children[0]);n||(n=e);const r=new Ii.A({componentId:i.id,newParentId:n.id,oldParentId:a.id,oldIndex:s,newIndex:0});j.Ay.moveComponent(r),o.push(r)}else if("left"===r||"right"===r){const t={type:"col",props:{lg:0},children:[]};let e=c,n=d;if("col"===c.type&&(j.Ay.updateComponent(c,"lg",0),o.push(new Ri.A({componentId:c.id,key:"lg",value:0})),e=c.parent(),n=e.children.findIndex(t=>t===c.id),-1===n))throw new Error("col not found in parent");"right"===r&&n++;const l=j.Ay.createComponent({body:t,parentId:e.id,index:n});o.push(new Li.A({componentId:l.id,parentId:e.id,index:n,body:t}));const p=new Ii.A({componentId:i.id,newParentId:l.id,oldParentId:a.id,oldIndex:s,newIndex:0});j.Ay.moveComponent(p),o.push(p)}(0,Oi.i)(a).forEach(t=>o.push(t));{const t=a.closest("block");if(t){(0,Hi.s)(t).forEach(t=>o.push(t))}}return o};var Pi=a(3832);const $i=t=>{let{item:e,to:n,direction:r}=t;const o=[],i=T.M.get("components",e.dataset.id),a=i.parent(),s=i.closest("block"),l=T.M.get("components",n.dataset.id),c=(l.parent(),l.closest("block")),d=c.closest("section");let p=d.children.findIndex(t=>t===c.id);const h=T.M.get("components",d.children[p]),u={type:"block",props:{style:h?.props?.style||{}},children:[{type:"col",props:{lg:0,style:{}}}]};"bottom"===r&&p++;const f=j.Ay.createComponent({body:u,parentId:d.id,index:p});o.push(new Li.A({componentId:f.id,parentId:d.id,index:p,body:u}));const m=f.children[0],g=a.children.findIndex(t=>t===i.id),b={componentId:i.id,oldParentId:a.id,newParentId:m,oldIndex:g,newIndex:0};o.push(new Ii.A(b)),j.Ay.moveComponent(b);if((0,Oi.i)(a).forEach(t=>o.push(t)),s){(0,Hi.s)(s).forEach(t=>o.push(t))}const y=l.closest("block");if(y){const t=(0,Hi.s)(y);(0,Pi.Ay)({steps:t,force:!0,update:!0})}return o};var Di=a(18057),ji=a(96374);const Fi=["profile","businessProfile","business_profile","context","businessContext","business_context","data"];function Ui(t){let e={...t};for(const t of Fi){const n=e[t];n&&"object"==typeof n&&!Array.isArray(n)&&(delete e[t],e={...n,...e})}return e}const qi=/^(#([0-9a-f]{3}|[0-9a-f]{6})|rgba?\([^)]*\)|hsla?\([^)]*\))$/i;function Wi(t){return"string"==typeof t&&qi.test(t.trim())}function Vi(t,e){if(!t||"object"!=typeof t)return null;for(const n of e)if(Wi(t[n]))return t[n].trim();return null}const Yi=["colors","palette","theme","brand","brandColors","brand_colors","visualIdentity"];function Xi(t){const e=[t];for(const n of Yi){const r=t[n];r&&"object"==typeof r&&!Array.isArray(r)&&e.push(r)}return e}function Zi(t){for(const e of["colors","palette","brandColors","brand_colors"]){const n=t[e];if(Array.isArray(n)){const t=n.filter(Wi).map(t=>t.trim());if(t.length)return t}}return[]}const Ji=["primaryColor","primary_color","primary","main","brandColor","brand_color"],Ki=["secondaryColor","secondary_color","secondary","accentColor","accent_color","accent"],Gi=["primaryContrastColor","primary_contrast_color","primaryContrast","primaryText","primary_text","onPrimary","on_primary"],Qi=["secondaryContrastColor","secondary_contrast_color","secondaryContrast","secondaryText","secondary_text","onSecondary","on_secondary"],ta=["textColor","text_color","bodyColor","body_color","paragraphColor","fontColor"],ea=["headingColor","heading_color","headingsColor","titleColor","title_color"];function na(t){return(0,ji.d)("#FFFFFF",t)>=(0,ji.d)("#000000",t)?"#FFFFFF":"#000000"}function ra(){const t=T.M.get("businessContext");return t&&"object"==typeof t?Ui(t):null}const oa=`${(0,U.Ay)()?"http://127.0.0.1:8000":"https://studio.creaditor.ai"}/api/business-analyze`;async function ia(t){const e=await async function(t){const e=!(!t||!t.forceRefresh),n="function"==typeof j.Ay.studioTokenProvider?j.Ay.studioTokenProvider:null;if(n)try{const t=await n({forceRefresh:e});if("string"==typeof t&&t.length>0)return t}catch(t){console.warn("[business-context] studioTokenProvider threw; falling back to editor.studioToken.",t)}return"string"==typeof j.Ay.studioToken&&j.Ay.studioToken.length>0?j.Ay.studioToken:null}({forceRefresh:t}),n={Accept:"application/json"};return e&&(n.Authorization=`Bearer ${e}`),fetch(oa,{method:"GET",headers:n})}let aa=null;async function sa(){return aa||(aa=(async()=>{try{let t=await ia(!1);if(401===t.status&&(t=await ia(!0)),!t.ok)return console.warn(`[business-context] fetch failed: HTTP ${t.status}`),null;const e=await t.json();return T.M.set({businessContext:e}),e}catch(t){return console.warn("[business-context] fetch error",t),null}finally{aa=null}})(),aa)}function la(t){return"string"==typeof t&&/^(https?:\/\/|data:image\/)/i.test(t.trim())}function ca(t){return/(^|_|\b)logo(_?(url|src|image|href))?$/i.test(t)}function da(){const t=T.M.get("businessContext");if(!t||"object"!=typeof t)return(0,U.Ay)()&&console.warn("[business-context] businessContext is not in the store yet — the logo element will render its placeholder. Is cdtr-studio up on 127.0.0.1:8000, and is the studio token valid?"),null;const e=Ui(t),n=e.logo||e.logoUrl;if(la(n))return n.trim();const r=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,n=[t];for(let t=0;t<=e&&n.length>0;t++){const t=[];for(const e of n)if(e&&"object"==typeof e){for(const[t,n]of Object.entries(e))if(ca(t)&&la(n))return n.trim();for(const n of Object.values(e))n&&"object"==typeof n&&t.push(n)}n=t}return null}(t);return r||((0,U.Ay)()&&console.warn("[business-context] no logo found in businessContext; the logo element will render its placeholder. Top-level keys:",Object.keys(t),t),null)}function pa(t,e){t&&(Array.isArray(t.children)?t.children.forEach(t=>{pa(t,e)}):t&&"object"==typeof t&&e(t))}function ha(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(Array.isArray(t))t.forEach(t=>{ha(t,e,n)});else if(t&&"object"==typeof t){const r="heading"===t.type?"heading":"paragraph"===t.type?"paragraph":n;Array.isArray(t.content)?(e(t,r),t.content.forEach(t=>{ha(t,e,r)})):e(t,r)}else e(t,n)}const ua=t=>{const e=T.M.get("components").find(t=>"root"===t.type),n=e?.props?.style?.fontFamily,r=e?.props?.defaultColorParagraphs||e?.props?.default_color_paragraphs,o=e?.props?.defaultColorHeadings||e?.props?.default_color_headings,i=e?.props?.primaryColor,a=e?.props?.primaryContrastColor,s=T.M.get("theme","primary"),l=T.M.get("theme","primaryText");var c;return fa(t,{fontFamily:n,primaryColor:i?`var(--cdtr-primary, ${i})`:s||void 0,primaryContrastColor:a?`var(--cdtr-primary-contrast, ${a})`:l||void 0,defaultColorParagraphs:r,defaultColorHeadings:o||("string"==typeof(c=s)&&c&&!/gradient/i.test(c)?s:void 0)}),t};function fa(t,e){const{fontFamily:n,primaryColor:r,primaryContrastColor:o,defaultColorParagraphs:i,defaultColorHeadings:a,defaultBackgroundButtons:s,defaultColorButtons:l}=e;if(t?.props?.style){if(n&&(t.props.style.fontFamily=n),"image"===t.type&&("logo"===t.props.alt?.toLowerCase()||"logo"===t.props.as)){const e=da();"string"==typeof e&&(t.props.src=e,t.props.style.height="auto")}s&&(t.props.style.background=s),l&&(t.props.style.color=l)}pa(t,t=>{if(r&&"button"===t?.type&&(t.props.style.background=r),o&&"button"===t?.type&&(t.props.style.color=o),"divider"===t?.type){const e=T.M.get("components").filter(t=>"divider"===t.type&&t.isInDom());if(e.length>0){const n=e.map(t=>`${t.props.style.borderColor}-${t.props.style.borderTopWidth}`),r=function(t){if(t.length<2)return t[0]||null;const e={};for(let n=0;n<t.length-1;n++){const r=t[n],o=t[n+1];e[r]||(e[r]={}),e[r][o]=(e[r][o]||0)+1}const n=e[t[t.length-1]];if(!n)return t[0];let r=null,o=0;for(const[t,e]of Object.entries(n))e>o&&(o=e,r=t);return r}(n);if(r){const n=e.find(t=>`${t.props.style.borderColor}-${t.props.style.borderTopWidth}`==`${r.split("-")[0]}-${r.split("-")[1]}`);n&&(t.props=n.props)}}}if("button"===t?.type){try{const e=T.M.get("components").find(t=>"button"===t.type&&t.isInDom());e&&(e.props.style.background&&(t.props.style.background=e.props.style.background),e.props.text&&(t.props.text=e.props.text))}catch(t){console.log("error",t)}const e=t.props?.style?.background;if("string"==typeof e&&e&&!/gradient|var\(/i.test(e)){const n=t.props?.style?.color||o||"#ffffff";t.props.style.color=(0,ji.w)(n,e)}}if("countdown"===t.type){const e=T.M.get("components").find(t=>"countdown"===t.type&&t.isInDom());e&&(t.props=e.props)}if("countdown-v2"===t.type){const e=T.M.get("components").find(t=>"countdown-v2"===t.type&&t.isInDom());e&&(t.props=e.props)}if("social"===t.type){const e=T.M.get("components").find(t=>"social"===t.type&&t.isInDom());e&&(t.props=e.props)}if("spacer"===t.type){const e=T.M.get("components").find(t=>"spacer"===t.type&&t.isInDom());e&&(t.props=e.props)}}),t?.props?.items&&Array.isArray(t.props.items)&&t.props.items.forEach(t=>{if(t?.props?.style){if(n&&(t.props.style.fontFamily=n),"button"===t.type){r&&(t.props.style.background=r);const e=t.props?.style?.background;if("string"==typeof e&&e&&!/gradient|var\(/i.test(e)){const n=t.props?.style?.color||o||"#ffffff";t.props.style.color=(0,ji.w)(n,e)}else o&&(t.props.style.color=o)}}else t?.style&&n&&(t.style.fontFamily=n)}),t?.props?.text?.childNodes?.content&&t?.props?.text?.childNodes?.content&&ha(t?.props?.text?.childNodes?.content,(t,e)=>{t&&Array.isArray(t.marks)&&t.marks.forEach(t=>{if(t&&t.attrs&&"object"==typeof t.attrs&&(t.attrs.fontFamily&&n&&(t.attrs.fontFamily=n),t.attrs.color)){let n=null;"heading"===e?n=a||i:"paragraph"===e&&(n=i),n&&(t.attrs.color=n)}})}),t&&t.children&&Array.isArray(t.children)&&t.children.forEach(t=>{fa(t,e)})}const ma=t=>{let{template:e,to:n,direction:r}=t;const o=[];T.M.get("components",n.dataset.id);let i=T.M.get("components",n.dataset.id),a=i.parent(),s=a.children.findIndex(t=>t===i.id);if(e.body=ua(e.body),"bottom"!==r&&"right"!==r||s++,"bottom"===r||"top"===r){const t={type:"row",props:{},children:[{type:"col",props:{lg:12},children:[e.body]}]},n=(a.parent(),j.Ay.createComponent({body:t,parentId:a.id,index:s}));o.push(new Li.A({componentId:n.id,parentId:a.id,index:s,body:t}))}else if("left"===r||"right"===r){const t={type:"col",props:{lg:0},children:[e.body]};let n=a,i=s;if("col"===a.type&&(j.Ay.updateComponent(a,"lg",0),o.push(new Ri.A({componentId:a.id,key:"lg",value:0})),n=a.parent(),i=n.children.findIndex(t=>t===a.id),-1===i))throw new Error("col not found in parent");"right"===r&&i++;const l=j.Ay.createComponent({body:t,parentId:n.id,index:i});o.push(new Li.A({componentId:l.id,parentId:n.id,index:i,body:t}))}return o},ga=t=>{let{template:e,to:n,direction:r}=t;const o=[];let i=T.M.get("components",n.dataset.id),a=i.parent(),s=a.children.findIndex(t=>t===i.id);e.body=ua(e.body),"right"===r&&s++;const l={type:"col",props:{lg:0,style:{}},children:[e.body]},c=j.Ay.createComponent({body:l,parentId:a.id,index:s});if(o.push(new Li.A({componentId:c.id,parentId:a.id,index:s,body:l})),a&&"block"===a.type){(0,Hi.s)(a).forEach(t=>o.push(t))}return o};var ba=a(15035);const ya=t=>{let{template:e,to:n,direction:r}=t;const o=[];let i=T.M.get("components",n.dataset.id);if(!i)throw new Error("toItemCompose is not found");if(i&&"section"===i.type){const t=i.children[i.children.length-1];i=T.M.get("components",t)}const a=i.closest("block");let s=i.parent(),l=s.children.findIndex(t=>t===i.id);"bottom"!==r&&"left"!==r||l++,delete a.props.style.boxShadow,e.body=ua(e.body);const c="block"===e.body.type?e.body:{type:"block",props:{style:a.props.style,classList:[]},children:[{type:"col",props:{lg:0},children:[e.body]}]};c.props.style.width||(c.props.style.width="610px"),"menu"!==c.props.as&&(c.props.style=a.props.style),(t=>{const e=j.Ay.configure;j.Ay.globalCommands.bodyWalk(t.body,t=>{if("form"===t.type&&e&&Array.isArray(e.plugins)){const n=e?.plugins.find(t=>"form"===t.name);n&&n.configure&&Array.isArray(n.configure.defaultFields)&&Array.isArray(n.configure.fields)&&[...n.configure.defaultFields].reverse().forEach(e=>{const r=n.configure.fields.find(t=>t.id===e.id);if(r&&!t.props.items.find(t=>t.id===r.id)){const e=(0,ba.v)(r);e&&t.props.items.unshift(e)}})}})})({body:c});const d=j.Ay.createComponent({body:c,parentId:s.id,index:l});return o.push(new Li.A({componentId:d.id,parentId:s.id,index:l,body:c})),o},wa=t=>{let{template:e,to:n,direction:r}=t;const o=[];let i=T.M.get("components",n.dataset.id);const a=i.parent().children.findIndex(t=>t===i.id);let s;if(e.components){const t=new Map;e.components.forEach(e=>{const n=e.id||e._id;if(n){const r=`${e.type}-${Math.random().toString(36).substr(2,9)}`;t.set(n,r)}}),e.components.forEach(e=>{const n=e.id||e._id;if(n&&t.has(n)){const r=t.get(n);e.id=r,e._id=r}Array.isArray(e.children)&&(e.children=e.children.map(e=>t.get(e)||e)),Array.isArray(e.elements)&&(e.elements=e.elements.map(e=>t.get(e)||e))}),s=(0,ze.G)(e.components||[]),e.body=s}"section"===e.body.type&&(i=i.closest("root"));let l=a;"bottom"===r&&l++,e.body=ua(e.body);let c="block"===e.body.type?e.body:{type:"block",props:{style:{padding:"10px",marginTop:"0",marginBottom:"0",marginLeft:"auto",marginRight:"auto",backgroundColor:"transparent",maxWidth:"1320px",justifyContent:"center",width:"610px"},classList:[]}};"section"===e.body.type&&(c=e.body),"block"!==e.body.type&&"section"!==e.body.type&&(c.children=[{type:"col",props:{lg:0},children:[e.body]}]);const d=j.Ay.createComponent({body:c,parentId:i.id,index:l});if(o.push(new Li.A({componentId:d.id,parentId:i.id,index:l,body:c})),"block"===!e.body.type){const t={type:"col",props:{lg:0,style:{}}},n=j.Ay.createComponent({body:t,parentId:d.id,index:0});o.push(new Li.A({componentId:n.id,parentId:d.id,index:0,body:t}));const r=j.Ay.createComponent({body:e.body,parentId:n.id,index:0});o.push(new Li.A({componentId:r.id,parentId:n.id,index:0}))}return o},_a=t=>{let{item:e,to:n,direction:r}=t;const o=[],i=T.M.get("components",e.dataset.id),a=i.parent(),s=i.closest("block"),l=T.M.get("components",n.dataset.id),c="top"===r?l.children[0]:l.children[l.children.length-1],d=c?T.M.get("components",c):null,p={type:"block",props:{style:d?.props?.style?{...d.props.style}:{padding:"10px",marginTop:"0",marginBottom:"0",marginLeft:"auto",marginRight:"auto",backgroundColor:"transparent",maxWidth:"1320px",justifyContent:"center",width:"610px"},classList:[]},children:[{type:"col",props:{lg:0,style:{}}}]},h="top"===r?0:l.children.length,u=j.Ay.createComponent({body:p,parentId:l.id,index:h});o.push(new Li.A({componentId:u.id,parentId:l.id,index:h,body:p}));const f=u.children[0],m=a.children.findIndex(t=>t===i.id),g={componentId:i.id,oldParentId:a.id,newParentId:f,oldIndex:m,newIndex:0};o.push(new Ii.A(g)),j.Ay.moveComponent(g);if((0,Oi.i)(a).forEach(t=>o.push(t)),s){const t=(0,Hi.s)(s);(0,Pi.Ay)({steps:t,force:!0,update:!0})}return o};var Aa=a(8064);class xa{constructor(){this.delayer=new Di.A}start(){let t,e=[],r=!1;const o=(0,n.A)("div",{style:{padding:"10px",background:"var(--primary)",borderRadius:"2px",width:"80px",color:"#fff",fontSize:"13px",fontFamily:"Arial",position:"absolute",top:"5px",textAlign:"var(--text-align-locale)"}});new Ti({sort:!0,clone:!1,handle:".draggable-element-handle",body:".amazingbar-content-wrapper",onStart:e=>{let{item:o,dragType:i,dropType:a}=e;const s=document.querySelector(".cdtr-text-editor-plugin");s&&(s.style.display="none"),r=(0,Aa.isAnchorDrag)(o),document.body.classList.toggle("cdtr-anchor-attaching",r),r&&(0,Aa.injectAnchorDragStyles)(),L.A.dispatch("elements:draggable:start",{item:o,dragType:i,dropType:a});const l=j.Ay.getEditor("text-editor");l&&l.destroy({from:"design-factory"}),t=(0,n.A)("style",null,`\n [data-name="add-new-block-v1"]{\n display:none !important;\n }\n .block-component > .sortable > .col-component > .row-of-col {\n max-width:90%; \n margin-right:auto;\n margin-left:auto;\n }\n ${"block"===a?"":"[droppable-element='element']{\n border:1px dashed #4845542e;\n }"}\n [droppable-element='block']{\n border-top:1px dashed #484554a8;\n border-bottom:1px dashed #484554a8;\n }\n\n ${"block"===a?"":"[droppable-element='col']{\n border-left:1px dashed #484554a8;\n border-right:1px dashed #484554a8;\n }"}\n `),document.body.appendChild(t)},onCancel:()=>{},finally:()=>{const n=document.querySelector(".cdtr-text-editor-plugin");n&&(n.style.display=null),L.A.dispatch("elements:draggable:end",{}),t&&t.remove(),(0,Aa.clearDropTarget)(),(0,Aa.removeAnchorDragStyles)(),document.body.classList.remove("cdtr-anchor-attaching"),r=!1,e.forEach(t=>{t.classList.remove("move-left"),t.classList.remove("move-right"),t.classList.remove("move-top"),t.classList.remove("move-bottom"),t.classList.remove("on-moving")}),e=[]},onMove:t=>{let{item:n,to:i,direction:a,targets:s,guideLine:l,dragType:c,dropType:d}=t;if(i!==this.lastTarget&&(this.delayer.run(()=>{this.lastTarget=i,l.appendChild(o)},100),o.remove()),r){const t=(0,Aa.resolveBlockElement)(i);return(0,Aa.highlightDropTarget)(t),void(o.innerHTML=T.M.get("lang",t?"attach_anchor_to_block":"drop_anchor_on_a_block"))}const p=s.find(t=>t.closest("[data-type='col']"));if(n===i&&p&&T.M.get("components",p.dataset.id).children.length<1)return!1;const h=i.getAttribute("droppable-element");if(!h)return!1;const u=T.M.get("components",n.dataset.id);if(i.classList.add("on-moving"),u){const t=u.closest("block");t&&-1===e.indexOf(t.element)&&(t.element.classList.add("on-moving"),e.push(t.element))}e.forEach(t=>{t.classList.remove("move-left"),t.classList.remove("move-right"),t.classList.remove("move-top"),t.classList.remove("move-bottom")}),"element"===h?("left"===a?(o.innerHTML=T.M.get("lang","left-to-element"),o.style.transform="translate(-120%, -50%)",i.classList.add("move-right")):"right"===a?(o.style.transform="translate(20%, -50%)",o.innerHTML=T.M.get("lang","right-to-element"),i.classList.add("move-left")):"top"===a?(o.innerHTML=T.M.get("lang","top-to-element"),i.classList.add("move-bottom")):"bottom"===a&&(i.classList.add("move-top"),o.innerHTML=T.M.get("lang","bottom-to-element")),e.push(i)):"col"===h?"left"===a?o.innerHTML=T.M.get("lang","open-new-cell-from-left"):"right"===a&&(o.innerHTML=T.M.get("lang","open-new-cell-from-right")):"block"===h&&("top"===a?o.innerHTML=T.M.get("lang","open-new-block-from-top"):"bottom"===a&&(o.innerHTML=T.M.get("lang","open-new-block-from-bottom")))},onEnd:t=>{let{item:e,to:n,direction:r,dragType:o,dropType:i,autoDrop:a}=t;if(a||n?.dataset?.id!==e?.dataset?.id){if((0,Aa.isAnchorDrag)(e)){const t=(0,Aa.resolveBlockElement)(n);if(t){const n=e.__template,r=n&&n.body&&n.body.props||{};if((0,Aa.attachAnchorToBlock)(t,{name:r.name,color:r.color,explain:!(0,Aa.isLinkPickerAnchorDrag)(e)})&&!(0,Aa.isLinkPickerAnchorDrag)(e)){const e=T.M.get("components",t.dataset.id);e&&j.Ay.clean().selectComponent(e)}}return}try{if("create:element"===o){e.dataset.group;const t=e.dataset.id,a=T.M.get("components_templates")||[],s=e.__template,l=s&&s.id===t?s:a.find(e=>e.id===t);if(!l)throw new Error("cant find the template","#jj-vk545gh");const c=j.Ay.getTemplate(l?.body?.type);if(c&&(c.interactions=[],c.show_on_desktop=!0,c.show_on_mobile=!0,c.show_on_tablet=!0,("button"===l.body.type||"social"===l.body.type||"countdown"===l.body.type)&&(l.body.props=c)),"create:element"===o)if("element"===i)if("left"===r||"right"===r){const t=n.closest(".col-component"),e=ga({template:l,to:t,direction:r});e&&(0,Pi.Ay)({steps:e,force:!0,update:!0})}else{const t=ma({template:l,to:n,direction:r});t&&((0,Pi.Ay)({steps:t,force:!0,update:!0}),j.Ay.clean().selectComponent(T.M.get("components",e.dataset.id)))}else if("col"!==i||"right"!==r&&"left"!==r){if("col"===i){const t=T.M.get("components",n.dataset.id);if(t){if(t.children[t.children.length-1]){const t=ma({template:l,to:n,direction:r,update:!0});t&&(0,Pi.Ay)({steps:t,force:!0,update:!0})}}}else if("block"===i){const t=ya({template:l,to:n,direction:r});t&&(0,Pi.Ay)({steps:t,force:!0,update:!0})}else if("section"===i){const t=wa({template:l,to:n,direction:r});t&&(0,Pi.Ay)({steps:t,force:!0,update:!0})}}else{const t=ga({template:l,to:n,direction:r});t&&(0,Pi.Ay)({steps:t,force:!0,update:!0})}return}if("element"===o&&"block"===i){const t=T.M.get("components",e.dataset.id);if(t.closest("block")===n)return}if("block"===i&&"element"===o){const t=T.M.get("components",e.dataset.id).parent(),r=T.M.get("components",n.dataset.id).closest("block"),o=r.closest("section"),i=t.closest("section");if(r&&1===r.children.length&&o===i&&r===t)return}if("col"!==i||"left"!==r&&"right"!==r){if("col"===i){if(n.dataset.id===e.dataset.id)return;const t=T.M.get("components",n.dataset.id);if(t){const n=t.children[t.children.length-1];if(n){const t=zi({item:e,to:T.M.get("components",n).element,direction:r,update:!0});(0,Pi.Ay)({steps:t,force:!0,update:!0})}}}else if("element"===o&&"element"===i)if("left"===r||"right"===r){const t=n.closest(".col-component"),o=t?Ni({item:e,to:t,direction:r}):zi({item:e,to:n,direction:r,update:!0});o&&(0,Pi.Ay)({steps:o,force:!0,update:!0})}else{const t=zi({item:e,to:n,direction:r,update:!0});t&&((0,Pi.Ay)({steps:t,force:!0,update:!0}),j.Ay.clean().selectComponent(T.M.get("components",e.dataset.id)))}else if("element"===o&&"block"===i){const t=$i({item:e,to:n,direction:r});t&&(0,Pi.Ay)({steps:t,force:!0,update:!0})}else if("element"===o&&"section"===i){const t=_a({item:e,to:n,direction:r});(0,Pi.Ay)({steps:t,force:!0,update:!0})}}else{const t=Ni({item:e,to:n,direction:r});t&&(0,Pi.Ay)({steps:t,force:!0,update:!0})}}catch(t){j.Ay.commands.goToError(),j.Ay.commands.logError({msg:t.message,error_code:"#c4111",info:{data:t.stack},s:"E"}),console.error(t)}}}});const i=new li("[cdtr-resizable='true']",{container:document.querySelector(".amazingbar-content-wrapper"),minWidth:30,onResize(t,e){let{width:n,height:r}=e;const o=t.closest("[data-type]");if(!o)return void console.warn("element must have data-type to use resizeable functionality");n=parseInt(n);const i=T.M.get("components",o.dataset.id);if(i&&"function"==typeof i.resize)i.resize({width:n,height:r});else if(i){const e=i.type;if("card"!==e){const e=t.closest(".card-component")||t.closest(".col-component"),r=e?e.offsetWidth:9999999;r<n&&(n=r)}if("card"===e){const e=t.closest(".block-component"),r=e?e.offsetWidth:9999999;r<n&&(n=r)}switch(e){case"button":{const t={minWidth:"10px"};Number.isFinite(n)&&(t.width=n+"px"),r&&(t.height=r),j.Ay.store().execCommand2({transactions:[{type:"button",key:"style",value:t}]});break}case"countdown":j.Ay.store().execCommand2({transactions:[{type:"countdown",key:"style",value:{width:n+"px",minWidth:"80px"}}]});break;case"text":j.Ay.store().execCommand2({transactions:[{type:"text",key:"style",value:{width:n+"px"}}]});break;case"card":j.Ay.store().execCommand2({transactions:[{type:"card",key:"style",value:{width:n+"px"}}]});break;case"video":j.Ay.store().execCommand("style",{width:n+"px",height:n/1.4+"px"});break;case"image":case"giphy":case"qr":n&&j.Ay.store().execCommand("style",{width:n+"px",height:"auto"});break;case"icon":n&&j.Ay.store().execCommand("style",{width:n+"px",height:n+"px"});break;case"svg":n&&j.Ay.store().execCommand("width",n+"px");break;default:console.warn("no type found for resizable")}}else{if("inline-image"===t.getAttribute("data-type")){const t=j.Ay.getSelectedComponent(),e=t?.[0];return void(e&&e.tiptap.chain().updateImage({width:n+"px"}))}}}});j.Ay.addEditor({type:"global",name:"draggable-window-editor",editor:new di(".drop-modal-draggable")}),j.Ay.addEditor({type:"images",name:"resizable",editor:i}),L.A.subscribe("onScroll",()=>{i&&"function"==typeof i.rePosition&&i.rePosition()}),j.Ay.on("update",()=>{i&&"function"==typeof i.rePosition&&i.rePosition()}),L.A.subscribe("resize-page",()=>{i.stopResize({})})}}const va=a(91937),{v4:ka}=a(77203),Ca=function(t,e){let{group:n,name:r,thumb:o,placement:i,staticName:a,tags:s,puzzle:l,props:c,index:d,icon:p,id:h}=e;this.index=d,this.id=h||va(r),this.render=t,c&&"object"==typeof c||(c={}),"function"==typeof t?this.body=t():t&&"object"==typeof t?this.body=t:console.error("menu element not valid",t),this.props=c,this.puzzle=l||p,this.tags=s||[],this.group=n,this.name=r,this.thumb=o,this.placement=i,a&&(this.staticName=a)},Ea="activeSurface",Sa="activePopupId",Ma=T.M;function Ba(){return Ma.get(Ea)||"page"}function Ta(t){const e=document.getElementById("main-page-wrapper");if(!e)return;const n="popups"===t;e.classList.toggle("surface-popups",n),e.classList.toggle("surface-page",!n),e.classList.remove("surface-anim"),requestAnimationFrame(()=>e.classList.add("surface-anim")),n&&Na()}function La(t){t!==Ba()?(Ma.set({[Ea]:t}),Ta(t),L.A.dispatch("surface-change",{surface:t})):Ta(t)}function Ia(){const t=(j.Ay.getComponents?.()||[]).find(t=>t&&"root"===t.type);return t?.children?t.children.map(t=>Ma.get("components",t)).filter(t=>!!t&&"block"===t.type&&!!t.props?.modalable):[]}function Oa(){const t=Ma.get(Sa),e=Ia();return t&&e.some(e=>e.id===t)?t:e[0]?.id||null}function Ha(t){Ma.set({[Sa]:t}),Na();const e=Ia().find(e=>e.id===t);e&&j.Ay.clean().selectComponent(e),L.A.dispatch("active-popup-change",{id:t})}function Na(){const t=document.getElementById("main-page-wrapper");if(!t)return;const e=Array.from(t.querySelectorAll('[data-modalable="true"]')),n=e.map(t=>t.getAttribute("data-id"));let r=Ma.get(Sa);r&&n.includes(r)||(r=n[0]||null),e.forEach(t=>{t.setAttribute("data-active-popup",t.getAttribute("data-id")===r?"true":"false")})}function Ra(t){const e=Ma.get("config","editor","configure","plugins")||[],n=Ma.get("config","channel")||"web";for(const r of e){if(!r||"function"!=typeof r.menu)continue;let o;try{o=r.menu({Compose:Ca,schemes:e,channel:n,components:[]})}catch{continue}const i=o?.body;if(i?.type===t)return JSON.parse(JSON.stringify(i))}return null}function za(t){const e=(j.Ay.getComponents?.()||[]).find(t=>t&&"root"===t.type),n=Ia(),r=n.find(e=>e.id===t);if(!e||!r)return null;const o=e.children||[],i=o.indexOf(t),a=i>=0?i+1:o.length,s=j.Ay.store().cloneComponent({componentId:t,parentId:e.id,index:a});if(!s?.id)return null;const l=r.props?.modalName||`${Ma.get("lang","new_modal")||"Popup"} ${n.indexOf(r)+1}`,c=Ia().map(t=>t.props?.modalName||"").filter(Boolean);return j.Ay.updateComponent(s,"modalName",function(t,e){const n=Ma.get("lang","copy_suffix")||"copy",r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=`${t.replace(new RegExp(`\\s+${r}(\\s+\\d+)?$`,"i"),"")} ${n}`;if(!e.includes(o))return o;let i=2;for(;e.includes(`${o} ${i}`);)i+=1;return`${o} ${i}`}(l,c)),La("popups"),Ha(s.id),L.A.dispatch("popups-change",{}),s}let Pa=!1;var $a=a(40648);class Da extends S.WF{constructor(){super(),this.errors={},this.indicators=[],this.lang=T.M.get("config","language"),this.scrollHandler=this.updatePositions.bind(this),this.resizeHandler=this.updatePositions.bind(this)}connectedCallback(){super.connectedCallback(),j.Ay.on("detectErrors",t=>{this.errors=t,this.updateIndicators()}),j.Ay.on("change",()=>{this.updateIndicators()}),window.addEventListener("scroll",this.scrollHandler,!0),window.addEventListener("resize",this.resizeHandler),this.updateIndicators()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("scroll",this.scrollHandler,!0),window.removeEventListener("resize",this.resizeHandler)}updateIndicators(){this.indicators=[],this.errors.buttons&&this.errors.buttons.forEach(t=>{t.element&&this.indicators.push({id:`button-${t.id}`,element:t.element,type:"button",error:t,message:this.getButtonErrorMessage()})}),this.errors.images&&this.errors.images.forEach(t=>{t.element&&this.indicators.push({id:`image-${t.id}`,element:t.element,type:"image",error:t,message:this.getImageErrorMessage()})}),this.errors.links&&this.errors.links.forEach(t=>{t.element&&this.indicators.push({id:`link-${t.id}`,element:t.element,type:"link",error:t,message:this.getLinkErrorMessage()})}),this.errors.social&&this.errors.social.forEach(t=>{t.compose&&t.compose.element&&this.indicators.push({id:`social-${t.compose.id}-${t.itemIndex}`,element:t.compose.element,type:"social",error:t,message:this.getSocialErrorMessage()})}),this.errors.socialLinks&&this.errors.socialLinks.forEach(t=>{t.compose&&t.compose.element&&this.indicators.push({id:`social-link-${t.compose.id}-${t.itemIndex}`,element:t.compose.element,type:"socialLink",error:t,message:this.getSocialLinkErrorMessage()})}),this.requestUpdate(),this.updatePositions()}updatePositions(){this.updateComplete.then(()=>{this.indicators.forEach(t=>{const e=t.element.getBoundingClientRect(),n=this.shadowRoot.querySelector(`[data-indicator-id="${t.id}"]`);n&&(n.style.left=e.right-8+"px",n.style.top=e.top-8+"px")})})}getButtonErrorMessage(){const t={en:{title:"Button Missing Link",content:"This button doesn't have a link attached. Click to add a link in the properties panel.",action:"Add Link"},he:{title:"כפתור חסר קישור",content:"לכפתור הזה אין קישור. לחץ כדי להוסיף קישור בלוח המאפיינים.",action:"הוסף קישור"}};return t[this.lang]||t.en}getImageErrorMessage(){const t={en:{title:"Placeholder Image",content:"This image is still using a placeholder. Click to replace it with an actual image.",action:"Replace Image"},he:{title:"תמונת ברירת מחדל",content:"התמונה הזו עדיין משתמשת בתמונת ברירת מחדל. לחץ כדי להחליף אותה בתמונה אמיתית.",action:"החלף תמונה"}};return t[this.lang]||t.en}getLinkErrorMessage(){const t={en:{title:"Invalid Link",content:"This link is invalid or broken. Click to fix the URL in the properties panel.",action:"Fix Link"},he:{title:"קישור לא תקין",content:"הקישור הזה לא תקין או שבור. לחץ כדי לתקן את הכתובת בלוח המאפיינים.",action:"תקן קישור"}};return t[this.lang]||t.en}getSocialErrorMessage(){const t={en:{title:"Social Icon Missing Link",content:"This social icon doesn't have a link attached. Click to add a link in the properties panel.",action:"Add Link"},he:{title:"אייקון חברתי חסר קישור",content:"לאייקון החברתי הזה אין קישור. לחץ כדי להוסיף קישור בלוח המאפיינים.",action:"הוסף קישור"}};return t[this.lang]||t.en}getSocialLinkErrorMessage(){const t={en:{title:"Invalid Social Link",content:"This social icon has an invalid or broken link. Click to fix the URL in the properties panel.",action:"Fix Link"},he:{title:"קישור חברתי לא תקין",content:"לאייקון החברתי הזה יש קישור לא תקין או שבור. לחץ כדי לתקן את הכתובת בלוח המאפיינים.",action:"תקן קישור"}};return t[this.lang]||t.en}handleIndicatorClick(t){this.closeAllPopovers();const e=this.shadowRoot.querySelector(`[data-popover-id="${t.id}"]`);e&&e.classList.add("show")}getTabName(t){switch(t){case"image":return"style";case"button":case"link":case"social":case"socialLink":return"interactions";default:return null}}getSectionLabel(t){switch(t){case"image":return"image";case"button":case"link":case"social":case"socialLink":return"link";default:return null}}activeSidebarTab(){let t=null;const e=n=>{n&&n.querySelectorAll&&n.querySelectorAll("*").forEach(n=>{"CDTR-EDITOR-TABS"===n.tagName&&(t=n.getAttribute("data-active-tab")),n.shadowRoot&&e(n.shadowRoot)})};return e(document),t}handleActionClick(t){const e="social"===t.type||"socialLink"===t.type?t.error.compose:t.error,n=this.getTabName(t.type),r=this.getSectionLabel(t.type),o=e&&e.id,i=()=>o&&document.querySelector(`[data-id="${o}"]`)||t.element||e&&e.element||null,a=i()?.closest?.('[data-modalable="true"]'),s=a?a.getAttribute("data-id"):null,l=!!s&&("popups"!==Ba()||Oa()!==s);l&&(La("popups"),Ha(s));const c=()=>{const t=i();if(!t)return;const e=t.closest&&t.closest(".amazingbar-content-wrapper")||null;if(e){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o=r.top-n.top-(e.clientHeight-r.height)/2;e.scrollTop+=o}else"function"==typeof t.scrollIntoView&&t.scrollIntoView({behavior:"auto",block:"center",inline:"nearest"})},d=()=>{j.Ay.clean().selectComponent(e),setTimeout(c,300);const t=e=>{const o=this.activeSidebarTab();null==o&&e>0?setTimeout(()=>t(e-1),80):(n&&o!==n&&j.Ay.dispatch("editor-tabs",{name:n}),this.revealSidebarSections(r))};setTimeout(()=>t(10),400)};l?setTimeout(d,350):d(),this.closeAllPopovers()}revealSidebarSections(t){const e=()=>{let e=0;const n=r=>{r&&r.querySelectorAll&&r.querySelectorAll("*").forEach(r=>{"CDTR-EDITOR-SECTION"===r.tagName&&(r.open=!0,e++,t&&r.getAttribute("data-label")===t&&r.persistKey&&(0,$a.Q)(r.persistKey,!0)),r.shadowRoot&&n(r.shadowRoot)})};return n(document),e};e();let n=0;const r=setInterval(()=>{e(),++n>=20&&clearInterval(r)},100)}closeAllPopovers(){this.shadowRoot.querySelectorAll(".popover").forEach(t=>{t.classList.remove("show")})}handleCloseClick(t){t.stopPropagation(),this.closeAllPopovers()}render(){return S.qy`
3932
3932
  ${this.indicators.map(t=>S.qy`
3933
3933
  <div
3934
3934
  class="error-indicator"
@@ -10256,7 +10256,7 @@
10256
10256
  stroke-width="1.6"
10257
10257
  stroke-linejoin="round"
10258
10258
  />
10259
- </svg>`,mu={elements:t=>S.qy`<cdtr-elements-menu-v1
10259
+ </svg>`;const mu={elements:t=>S.qy`<cdtr-elements-menu-v1
10260
10260
  .components=${t.currentComponents}
10261
10261
  ></cdtr-elements-menu-v1>`,"block-component":t=>S.qy`<cdtr-blocks-menu-v1
10262
10262
  .components=${t.currentComponents}
@@ -10269,7 +10269,7 @@
10269
10269
  @close=${t.onDragElementStart}
10270
10270
  ></cdtr-backgrounds-menu-v1>`,amp:()=>S.qy`<cdtr-amp-menu-v1></cdtr-amp-menu-v1>`},gu=t=>S.qy`<cdtr-blocks-menu-v1
10271
10271
  .components=${t.currentComponents}
10272
- ></cdtr-blocks-menu-v1>`,bu=[{id:"elements",groupName:"elements",icon:cu,label:"elements"},{id:"addons",groupName:"free-dnd-component",icon:du,label:"addons"},{id:"blocks",groupName:"block-component",icon:pu,label:"ready_blocks"},{id:"sections",groupName:"section-component",icon:hu,label:"section"},{id:"backgrounds",groupName:"backgrounds",icon:uu,label:"backgrounds"},{id:"amp",groupName:"amp",icon:fu,label:"amp",chip:"coming_soon"}];class yu extends S.WF{constructor(){super(),this.afterElement=void 0,this.onBusinessContext=void 0,this.onOpenAddMenu=void 0,this.onCloseAddMenu=void 0,this.onSurfaceChange=void 0,this.currentComponents=[],this.components=[],this.groupName="elements",this.elementType=null,this.disabledOptions=!1;const t=T.M;this.popupsOnly="popups"===t.get("activeSurface"),this.onDragElementStart=this.onDragElementStart.bind(this),this.onDragElementEnd=this.onDragElementEnd.bind(this),this.onBusinessContext=()=>this.requestUpdate(),this.onOpenAddMenu=t=>{const{target:e,type:n,disabledOptions:r}=t||{};e&&(this.afterElement=e),this.disabledOptions="boolean"==typeof r&&r,this.elementType=n||null,n&&(this.groupName=n),this.dispatchEvent(new CustomEvent("open",{}))},this.onCloseAddMenu=()=>this.onCloseMenu(),this.onSurfaceChange=t=>{const e=t?.surface;this.popupsOnly="popups"===e,this.popupsOnly&&(this.groupName="elements")}}loadComponentByGroupName(t){const e=T.M;this.currentComponents=t.filter(t=>t.group===this.groupName),e.set({components_templates:t})}onCloseMenu(){this.dispatchEvent(new CustomEvent("close",{}))}loadComponents(t){this.groupName=t}onDragElementStart(){this.onElementsDrag=!0,this.onCloseMenu()}onDragElementEnd(){this.onElementsDrag=!1}connectedCallback(){super.connectedCallback(),T.M.connect(["businessContext"],this.onBusinessContext),L.A.subscribe("elements:draggable:start",this.onDragElementStart),L.A.subscribe("elements:draggable:end",this.onDragElementEnd),L.A.subscribe("surface-change",this.onSurfaceChange),L.A.subscribe("open_add_menu",this.onOpenAddMenu),L.A.subscribe("close_add_menu",this.onCloseAddMenu)}disconnectedCallback(){super.disconnectedCallback(),T.M.disconnect(this.onBusinessContext);const t=L.A;t.unSubscribe("open_add_menu",this.onOpenAddMenu),t.unSubscribe("close_add_menu",this.onCloseAddMenu),t.unSubscribe("surface-change",this.onSurfaceChange),t.unSubscribe("elements:draggable:start",this.onDragElementStart),t.unSubscribe("elements:draggable:end",this.onDragElementEnd)}_getSchemesForGroup(){const t=T.M;if("elements"===this.groupName||"free-dnd-component"===this.groupName)return t.get("config","editor","configure","plugins");if("block-component"===this.groupName)return t.get("config","editor","configure","blocks");const e=t.get("config","editor","configure","customBlocks"),n="function"==typeof e?e():e;return(Array.isArray(n)?n:[]).filter(t=>t.group===this.groupName).map(t=>function(t){let{id:e,name:n,index:r,tags:o,children:i,icon:a,group:s,isDeletable:l,isEditable:c,_id:d}=t;return{id:e,name:n,icon:a,index:r,_id:d,isDeletable:l,isEditable:c,group:"block-component",menu:t=>{let{Compose:e,schemes:l}=t;const[c]=function t(e){return e.map(e=>{const n=`${e.type}-${Math.random().toString(36).substr(2,9)}`;return e.id&&(e.ref=e.id),e.id=e._id=n,e.children&&(e.children=t(e.children)),e})}([i]);return new e(c,{group:s,name:n,tags:o,index:r,icon:a})}}}(t))}_buildComponentsFromSchemes(t){if(!Array.isArray(t))return[];const e=T.M,n=e.get("config","editor","configure","plugins"),r=e.get("config","channel")||"web",o=[];return t.forEach(e=>{if(!e||"object"!=typeof e||"function"!=typeof e.menu)return;const i=e.menu({Compose:Ca,schemes:n,channel:r});if(i&&(i.isDeletable=e.isDeletable,i.isEditable=e.isEditable,i._id=e._id,i.group===this.groupName))if("number"==typeof i.index){const e=Math.min(i.index,t.length);o.splice(e,0,i)}else o.push(i)}),o}renderFactory(){if(!this.opened)return null;const t=this._getSchemesForGroup(),e=this._buildComponentsFromSchemes(t);this.components=e,this.loadComponentByGroupName(e);return(mu[this.groupName]??gu)({currentComponents:this.currentComponents,onDragElementStart:this.onDragElementStart})}render(){const e=T.M,n=e.get("config","editor","configure","editorProps","menu")||{},{blocks:r=!0,sections:o=!0,elements:i=!0,backgrounds:a=!0,addons:s=!1}=n,l=e.get("config","editor","configure","blocksCategories"),c="function"==typeof l?l():l,d=Array.isArray(c)?c:[];this.popupsOnly?this.groupName="elements":r||(this.groupName="backgrounds");const p="newsletter"===(e.get("config","channel")||"web"),h="section-component"===this.groupName,u=h?"min(650px, 94vw)":"600px",f=h?"3":"4",m=h?"9":"";return this.opened?S.qy`<cdtr-drawer
10272
+ ></cdtr-blocks-menu-v1>`,bu=[{id:"elements",groupName:"elements",icon:cu,label:"elements"},{id:"addons",groupName:"free-dnd-component",icon:du,label:"addons"},{id:"blocks",groupName:"block-component",icon:pu,label:"ready_blocks"},{id:"sections",groupName:"section-component",icon:hu,label:"section"},{id:"backgrounds",groupName:"backgrounds",icon:uu,label:"backgrounds"},{id:"amp",groupName:"amp",icon:fu,label:"amp",chip:"coming_soon"}];class yu extends S.WF{constructor(){super(),this.afterElement=void 0,this.onBusinessContext=void 0,this.onOpenAddMenu=void 0,this.onCloseAddMenu=void 0,this.onSurfaceChange=void 0,this.currentComponents=[],this.components=[],this.groupName="elements",this.elementType=null,this.disabledOptions=!1;const t=T.M;this.popupsOnly="popups"===t.get("activeSurface"),this.onDragElementStart=this.onDragElementStart.bind(this),this.onDragElementEnd=this.onDragElementEnd.bind(this),this.onBusinessContext=()=>this.requestUpdate(),this.onOpenAddMenu=t=>{const{target:e,type:n,disabledOptions:r}=t||{};e&&(this.afterElement=e),this.disabledOptions="boolean"==typeof r&&r,this.elementType=n||null,n&&(this.groupName=n),this.dispatchEvent(new CustomEvent("open",{}))},this.onCloseAddMenu=()=>this.onCloseMenu(),this.onSurfaceChange=t=>{const e=t?.surface;this.popupsOnly="popups"===e,this.popupsOnly&&(this.groupName="elements")}}loadComponentByGroupName(t){const e=T.M;this.currentComponents=t.filter(t=>t.group===this.groupName),e.set({components_templates:t})}onCloseMenu(){this.dispatchEvent(new CustomEvent("close",{}))}loadComponents(t){this.groupName=t}onDragElementStart(){this.onElementsDrag=!0,this.onCloseMenu()}onDragElementEnd(){this.onElementsDrag=!1}connectedCallback(){super.connectedCallback(),T.M.connect(["businessContext"],this.onBusinessContext),L.A.subscribe("elements:draggable:start",this.onDragElementStart),L.A.subscribe("elements:draggable:end",this.onDragElementEnd),L.A.subscribe("surface-change",this.onSurfaceChange),L.A.subscribe("open_add_menu",this.onOpenAddMenu),L.A.subscribe("close_add_menu",this.onCloseAddMenu)}disconnectedCallback(){super.disconnectedCallback(),T.M.disconnect(this.onBusinessContext);const t=L.A;t.unSubscribe("open_add_menu",this.onOpenAddMenu),t.unSubscribe("close_add_menu",this.onCloseAddMenu),t.unSubscribe("surface-change",this.onSurfaceChange),t.unSubscribe("elements:draggable:start",this.onDragElementStart),t.unSubscribe("elements:draggable:end",this.onDragElementEnd)}_getSchemesForGroup(){const t=T.M;if("elements"===this.groupName||"free-dnd-component"===this.groupName)return t.get("config","editor","configure","plugins");if("block-component"===this.groupName)return t.get("config","editor","configure","blocks");const e=t.get("config","editor","configure","customBlocks"),n="function"==typeof e?e():e;return(Array.isArray(n)?n:[]).filter(t=>t.group===this.groupName).map(t=>function(t){let{id:e,name:n,index:r,tags:o,children:i,icon:a,group:s,isDeletable:l,isEditable:c,_id:d}=t;return{id:e,name:n,icon:a,index:r,_id:d,isDeletable:l,isEditable:c,group:"block-component",menu:t=>{let{Compose:e,schemes:l}=t;const[c]=function t(e){return e.map(e=>{const n=`${e.type}-${Math.random().toString(36).substr(2,9)}`;return e.id&&(e.ref=e.id),e.id=e._id=n,e.children&&(e.children=t(e.children)),e})}([i]);return new e(c,{group:s,name:n,tags:o,index:r,icon:a})}}}(t))}_buildComponentsFromSchemes(t){if(!Array.isArray(t))return[];const e=T.M,n=e.get("config","editor","configure","plugins"),r=e.get("config","channel")||"web",o=function(){const t=T.M.get("components");return t&&"object"==typeof t?Object.values(t).filter(t=>t&&"object"==typeof t&&t.element?.isConnected):[]}(),i=[];return t.forEach(e=>{if(!e||"object"!=typeof e||"function"!=typeof e.menu)return;const a=e.menu({Compose:Ca,schemes:n,channel:r,components:o});if(a&&(a.isDeletable=e.isDeletable,a.isEditable=e.isEditable,a._id=e._id,a.group===this.groupName))if("number"==typeof a.index){const e=Math.min(a.index,t.length);i.splice(e,0,a)}else i.push(a)}),i}renderFactory(){if(!this.opened)return null;const t=this._getSchemesForGroup(),e=this._buildComponentsFromSchemes(t);this.components=e,this.loadComponentByGroupName(e);return(mu[this.groupName]??gu)({currentComponents:this.currentComponents,onDragElementStart:this.onDragElementStart})}render(){const e=T.M,n=e.get("config","editor","configure","editorProps","menu")||{},{blocks:r=!0,sections:o=!0,elements:i=!0,backgrounds:a=!0,addons:s=!1}=n,l=e.get("config","editor","configure","blocksCategories"),c="function"==typeof l?l():l,d=Array.isArray(c)?c:[];this.popupsOnly?this.groupName="elements":r||(this.groupName="backgrounds");const p="newsletter"===(e.get("config","channel")||"web"),h="section-component"===this.groupName,u=h?"min(650px, 94vw)":"600px",f=h?"3":"4",m=h?"9":"";return this.opened?S.qy`<cdtr-drawer
10273
10273
  .dim=${this.onElementsDrag}
10274
10274
  backdropStyle="z-index:-1"
10275
10275
  style="position: fixed;top:0;transition:transform .3s ease-in-out;z-index:var(--z-modal, 1000)"