@pairbo/ui-kit 0.1.1 → 0.2.1

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.
@@ -1400,7 +1400,7 @@ const dt=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)
1400
1400
  .cta-buttons pbo-button::part(base) {
1401
1401
  font-size: var(--pbo-font-size-medium);
1402
1402
  }
1403
- `;var Kd=Object.defineProperty,Zd=Object.getOwnPropertyDescriptor,Jd=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Zd(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Kd(e,i,o),o};let Qd=class extends Kh{constructor(){super(...arguments),this.windowHeight=window.innerHeight,this.resizeTimeout=null,this.formData={font:"",text:"",color:"",alignment:""},this.charsNum=0,this.ctaButtonState=Qd.CTA_STATES.primary,this.cardInnerImageUrl="../../../public/Greeting Card from Pairbo.png",this.handleResize=()=>{this.resizeTimeout&&window.clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout((()=>{this.windowHeight=window.innerHeight}),50)}}firstUpdated(){this.textArea.addEventListener("invalid",(()=>{alert("Please add a message to continue")}))}get form(){var t,e,i,s;return{font:null==(t=this.fontSelector)?void 0:t.value,text:null==(e=this.greetingText)?void 0:e.value,color:null==(i=this.textColor)?void 0:i.value,alignment:null==(s=this.textAlignment)?void 0:s.value}}handleFormChange(t){var e;this.ctaButtonState=Qd.CTA_STATES.primary;const i=t.target,s={...this.formData};i.classList.contains("font-selector")?s.font=(null==(e=null==i?void 0:i.value)?void 0:e.value)||" Font form control not implemented yet":i.classList.contains("greeting-text")?s.text=i.value:i.classList.contains("text-color")?s.color=i.value:i.classList.contains("text-alignment")&&(s.alignment=i.value),this.formData={...s},this.emit("pbo-change",{detail:this.form})}hostConnected(){this.addEventListener("pbo-change",this.handleFormChange)}hostDisconnected(){this.removeEventListener("pbo-change",this.handleFormChange)}submitFormHandler(t){var e;t.preventDefault();const i=null==(e=t.submitter)?void 0:e.name;if("danger"!==this.ctaButtonState.type)return""===this.greetingText.value||null===this.greetingText.value||void 0===this.greetingText.value?(this.ctaButtonState=Qd.CTA_STATES.danger,void this.greetingText.focus()):void alert("Form submitted with data:");"skip"===i&&alert("Skipping, adding empty message")}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.handleResize)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.handleResize),this.resizeTimeout&&window.clearTimeout(this.resizeTimeout)}render(){const t=223-this.formData.text.length;return U`
1403
+ `,Kd=()=>/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent),Zd=t=>null!=t,Jd=t=>Object.entries(t).reduce(((t,[e,i])=>(null==i||(t[e]=i),t)),{});var Qd=Object.defineProperty,tu=Object.getOwnPropertyDescriptor,eu=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?tu(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Qd(e,i,o),o};let iu=class extends Kh{constructor(){super(...arguments),this.windowHeight=window.innerHeight,this.resizeTimeout=null,this.charsNum=0,this.ctaButtonState=iu.CTA_STATES.primary,this.cardInnerImageUrl="../../../public/Greeting Card from Pairbo.png",this.card=null,this.submitTypeForm=t=>{console.error("submitTypingForm function not implemented",t)},this.handleResize=()=>{this.resizeTimeout&&window.clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout((()=>{this.windowHeight=window.innerHeight}),50)}}firstUpdated(){this.textArea.addEventListener("invalid",(()=>{alert("Please add a message to continue")}))}get formData(){var t,e,i,s,r,o,n,a;const l={pboCardId:(null==(t=this.card)?void 0:t.pboId)||"Unknown",productId:null==(e=this.card)?void 0:e.productId,sku:null==(i=this.card)?void 0:i.sku,variantId:null==(s=this.card)?void 0:s.variantId,font:(null==(r=this.fontSelector)?void 0:r.value)||"",text:(null==(o=this.greetingText)?void 0:o.value)||"",color:(null==(n=this.textColor)?void 0:n.value)||"",alignment:(null==(a=this.textAlignment)?void 0:a.value)||""};return Jd(l)}handleFormChange(t){this.ctaButtonState=iu.CTA_STATES.primary,this.emit("pbo-change",{detail:this.formData})}hostConnected(){this.addEventListener("pbo-change",this.handleFormChange)}hostDisconnected(){this.removeEventListener("pbo-change",this.handleFormChange)}submitFormHandler(t){var e;t.preventDefault();const i=null==(e=t.submitter)?void 0:e.name;if("danger"!==this.ctaButtonState.type)return""===this.greetingText.value||null===this.greetingText.value||void 0===this.greetingText.value?(this.ctaButtonState=iu.CTA_STATES.danger,void this.greetingText.focus()):void this.submitTypeForm(this.formData);"skip"===i&&this.submitTypeForm(this.formData)}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.handleResize)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.handleResize),this.resizeTimeout&&window.clearTimeout(this.resizeTimeout)}render(){const t=223-this.formData.text.length;return U`
1404
1404
  <form class="typing-form" @submit=${this.submitFormHandler}>
1405
1405
  <pbo-textarea
1406
1406
  class="greeting-text"
@@ -1494,13 +1494,13 @@ const dt=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)
1494
1494
  ${"danger"===this.ctaButtonState.type?U`<pbo-button name="skip" type="submit" variant="text" size="small" class="skip">Skip</pbo-button>`:""}
1495
1495
  </div>
1496
1496
  </form>
1497
- `}};Qd.styles=[sl,$h,qd],Qd.dependencies={"pbo-selector":t.PboSelector,"pbo-textarea":Xd,"pbo-color-radio-group":Pd,"pbo-radio-group":Pd,"pbo-radio-button":Pd,"pbo-button":hd},Qd.CTA_STATES={danger:{type:"danger",message:"Add a message to Continue"},primary:{type:"primary",message:"Save and Continue"}},Jd([vt(".greeting-text")],Qd.prototype,"greetingText",2),Jd([vt(".font-selector")],Qd.prototype,"fontSelector",2),Jd([vt(".text-color")],Qd.prototype,"textColor",2),Jd([vt(".text-alignment")],Qd.prototype,"textAlignment",2),Jd([vt(".typing-form")],Qd.prototype,"typingForm",2),Jd([vt("pbo-textarea")],Qd.prototype,"textArea",2),Jd([ft()],Qd.prototype,"windowHeight",2),Jd([ft()],Qd.prototype,"formData",2),Jd([ft()],Qd.prototype,"charsNum",2),Jd([ft()],Qd.prototype,"ctaButtonState",2),Jd([gt({type:String,reflect:!0})],Qd.prototype,"cardInnerImageUrl",2),Qd=Jd([dt("pbo-type-form")],Qd);
1497
+ `}};iu.styles=[sl,$h,qd],iu.dependencies={"pbo-selector":t.PboSelector,"pbo-textarea":Xd,"pbo-color-radio-group":Pd,"pbo-radio-group":Pd,"pbo-radio-button":Pd,"pbo-button":hd},iu.CTA_STATES={danger:{type:"danger",message:"Add a message to Continue"},primary:{type:"primary",message:"Save and Continue"}},eu([vt(".greeting-text")],iu.prototype,"greetingText",2),eu([vt(".font-selector")],iu.prototype,"fontSelector",2),eu([vt(".text-color")],iu.prototype,"textColor",2),eu([vt(".text-alignment")],iu.prototype,"textAlignment",2),eu([vt(".typing-form")],iu.prototype,"typingForm",2),eu([vt("pbo-textarea")],iu.prototype,"textArea",2),eu([ft()],iu.prototype,"windowHeight",2),eu([ft()],iu.prototype,"charsNum",2),eu([ft()],iu.prototype,"ctaButtonState",2),eu([gt({type:String,reflect:!0})],iu.prototype,"cardInnerImageUrl",2),eu([gt()],iu.prototype,"card",2),eu([gt()],iu.prototype,"submitTypeForm",2),iu=eu([dt("pbo-type-form")],iu);
1498
1498
  /**
1499
1499
  * @license
1500
1500
  * Copyright 2017 Google LLC
1501
1501
  * SPDX-License-Identifier: BSD-3-Clause
1502
1502
  */
1503
- const tu=t=>{return null!=(null==(i=null==(e=t)?void 0:e._$litType$)?void 0:i.h)?t._$litType$.h:t.strings;var e,i},eu=Rh(class extends Bh{constructor(t){super(t),this.et=new WeakMap}render(t){return[t]}update(t,[e]){const i=Ld(this.it)?tu(this.it):null,s=Ld(e)?tu(e):null;if(null!==i&&(null===s||i!==s)){const e=Hd(t).pop();let s=this.et.get(i);if(void 0===s){const t=document.createDocumentFragment();s=lt(X,t),s.setConnected(!1),this.et.set(i,s)}$d(s,[e]),Bd(s,0,e)}if(null!==s){if(null===i||i!==s){const e=this.et.get(s);if(void 0!==e){const i=Hd(e).pop();t._$AR(),Bd(t,0,i),$d(t,[i])}}this.it=e}else this.it=void 0;return this.render(e)}}),iu=l`
1503
+ const su=t=>{return null!=(null==(i=null==(e=t)?void 0:e._$litType$)?void 0:i.h)?t._$litType$.h:t.strings;var e,i},ru=Rh(class extends Bh{constructor(t){super(t),this.et=new WeakMap}render(t){return[t]}update(t,[e]){const i=Ld(this.it)?su(this.it):null,s=Ld(e)?su(e):null;if(null!==i&&(null===s||i!==s)){const e=Hd(t).pop();let s=this.et.get(i);if(void 0===s){const t=document.createDocumentFragment();s=lt(X,t),s.setConnected(!1),this.et.set(i,s)}$d(s,[e]),Bd(s,0,e)}if(null!==s){if(null===i||i!==s){const e=this.et.get(s);if(void 0!==e){const i=Hd(e).pop();t._$AR(),Bd(t,0,i),$d(t,[i])}}this.it=e}else this.it=void 0;return this.render(e)}}),ou=l`
1504
1504
  :host {
1505
1505
  display: block;
1506
1506
  width: 100%;
@@ -1608,7 +1608,7 @@ const tu=t=>{return null!=(null==(i=null==(e=t)?void 0:e._$litType$)?void 0:i.h)
1608
1608
 
1609
1609
  .main-slide-container ul li {
1610
1610
  }
1611
- `,su=".splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__arrow{-ms-flex-align:center;align-items:center;background:#ccc;border:0;border-radius:50%;cursor:pointer;display:-ms-flexbox;display:flex;height:2em;-ms-flex-pack:center;justify-content:center;opacity:.7;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2em;z-index:1}.splide__arrow svg{fill:#000;height:1.2em;width:1.2em}.splide__arrow:hover:not(:disabled){opacity:.9}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #0bf;outline-offset:3px}.splide__pagination{bottom:.5em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:50%;display:inline-block;height:8px;margin:3px;opacity:.7;padding:0;position:relative;transition:transform .2s linear;width:8px}.splide__pagination__page.is-active{background:#fff;transform:scale(1.4);z-index:1}.splide__pagination__page:hover{cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #0bf;outline-offset:3px}.splide__progress__bar{background:#ccc;height:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0)}.splide__slide:focus{outline:0}@supports (outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #0bf}}@supports (outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #0bf}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#0bf}}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #0bf;outline-offset:3px}.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;cursor:pointer}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #000}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:auto;padding:1em 0;right:.5em;top:0}",ru=()=>/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent),ou=t=>null!=t;var nu=Object.defineProperty,au=Object.getOwnPropertyDescriptor,lu=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?au(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&nu(e,i,o),o};let cu=class extends Kh{constructor(){super(...arguments),this.card=null,this.focusIndex=0,this.livePreviewProps={font:"Monsieur La Doulaise",text:"",color:"rgb(0,0,0)",alignment:"left"},this.handwrittenPreviewProps={isLoading:!1,processedFileUrl:null},this.type="type",this.mainImageTemplates=[],this.closeZoomedPreview=()=>{this.zoomedPreview&&(this.zoomedPreview.open=!1)},this.openZoomedPreview=()=>{this.zoomedPreview&&(this.zoomedPreview.open=!0)},this.handleOpenZoomedClick=t=>{if(!ru())return t.preventDefault(),void t.stopPropagation();this.openZoomedPreview()}}firstUpdated(){this.addEventListener("handwritten-image-dimensions-changed",(t=>{var e,i;const{detail:s}=t,r=null==(e=this.shadowRoot)?void 0:e.querySelector("#handwritten-main-canvas"),o=null==(i=this.shadowRoot)?void 0:i.querySelector("#handwritten-zoomed-preview-canvas");r&&o&&(r.imageWidth=s.width,r.imageHeight=s.height,r.imageTop=s.top,r.imageLeft=s.left,o.imageWidth=s.width,o.imageHeight=s.height,o.imageTop=s.top,o.imageLeft=s.left)})),this.updateComplete,this.thumbnailElements[this.focusIndex].classList.add("active"),this.mainSlideElements[this.focusIndex].classList.add("active");const t=(t,e)=>{t.addEventListener("click",(()=>{this.focusOn(e)}))};for(let e=0;e<this.thumbnailElements.length;e++)t(this.thumbnailElements[e],e)}handleCardChange(t,e){var i,s,r,o;e&&(this.mainImageTemplates=[U`<img src="${e.medias.cover.url||"https://picsum.photos/id/1/300/400"}" alt="" />`,U`<pbo-type-canvas
1611
+ `,nu=".splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__arrow{-ms-flex-align:center;align-items:center;background:#ccc;border:0;border-radius:50%;cursor:pointer;display:-ms-flexbox;display:flex;height:2em;-ms-flex-pack:center;justify-content:center;opacity:.7;padding:0;position:absolute;top:50%;transform:translateY(-50%);width:2em;z-index:1}.splide__arrow svg{fill:#000;height:1.2em;width:1.2em}.splide__arrow:hover:not(:disabled){opacity:.9}.splide__arrow:disabled{opacity:.3}.splide__arrow:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide__arrow--prev{left:1em}.splide__arrow--prev svg{transform:scaleX(-1)}.splide__arrow--next{right:1em}.splide.is-focus-in .splide__arrow:focus{outline:3px solid #0bf;outline-offset:3px}.splide__pagination{bottom:.5em;left:0;padding:0 1em;position:absolute;right:0;z-index:1}.splide__pagination__page{background:#ccc;border:0;border-radius:50%;display:inline-block;height:8px;margin:3px;opacity:.7;padding:0;position:relative;transition:transform .2s linear;width:8px}.splide__pagination__page.is-active{background:#fff;transform:scale(1.4);z-index:1}.splide__pagination__page:hover{cursor:pointer;opacity:.9}.splide__pagination__page:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__pagination__page:focus{outline:3px solid #0bf;outline-offset:3px}.splide__progress__bar{background:#ccc;height:3px}.splide__slide{-webkit-tap-highlight-color:rgba(0,0,0,0)}.splide__slide:focus{outline:0}@supports (outline-offset:-3px){.splide__slide:focus-visible{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide__slide:focus-visible{border:3px solid #0bf}}@supports (outline-offset:-3px){.splide.is-focus-in .splide__slide:focus{outline:3px solid #0bf;outline-offset:-3px}}@media screen and (-ms-high-contrast:none){.splide.is-focus-in .splide__slide:focus{border:3px solid #0bf}.splide.is-focus-in .splide__track>.splide__list>.splide__slide:focus{border-color:#0bf}}.splide__toggle{cursor:pointer}.splide__toggle:focus-visible{outline:3px solid #0bf;outline-offset:3px}.splide.is-focus-in .splide__toggle:focus{outline:3px solid #0bf;outline-offset:3px}.splide__track--nav>.splide__list>.splide__slide{border:3px solid transparent;cursor:pointer}.splide__track--nav>.splide__list>.splide__slide.is-active{border:3px solid #000}.splide__arrows--rtl .splide__arrow--prev{left:auto;right:1em}.splide__arrows--rtl .splide__arrow--prev svg{transform:scaleX(1)}.splide__arrows--rtl .splide__arrow--next{left:1em;right:auto}.splide__arrows--rtl .splide__arrow--next svg{transform:scaleX(-1)}.splide__arrows--ttb .splide__arrow{left:50%;transform:translate(-50%)}.splide__arrows--ttb .splide__arrow--prev{top:1em}.splide__arrows--ttb .splide__arrow--prev svg{transform:rotate(-90deg)}.splide__arrows--ttb .splide__arrow--next{bottom:1em;top:auto}.splide__arrows--ttb .splide__arrow--next svg{transform:rotate(90deg)}.splide__pagination--ttb{bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;left:auto;padding:1em 0;right:.5em;top:0}";var au=Object.defineProperty,lu=Object.getOwnPropertyDescriptor,cu=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?lu(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&au(e,i,o),o};let hu=class extends Kh{constructor(){super(...arguments),this.card=null,this.focusIndex=0,this.livePreviewProps={font:"Monsieur La Doulaise",text:"",color:"rgb(0,0,0)",alignment:"left"},this.handwrittenPreviewProps={isLoading:!1,processedFileUrl:null},this.type="type",this.mainImageTemplates=[],this.closeZoomedPreview=()=>{this.zoomedPreview&&(this.zoomedPreview.open=!1)},this.openZoomedPreview=()=>{this.zoomedPreview&&(this.zoomedPreview.open=!0)},this.handleOpenZoomedClick=t=>{if(!Kd())return t.preventDefault(),void t.stopPropagation();this.openZoomedPreview()}}firstUpdated(){this.addEventListener("handwritten-image-dimensions-changed",(t=>{var e,i;const{detail:s}=t,r=null==(e=this.shadowRoot)?void 0:e.querySelector("#handwritten-main-canvas"),o=null==(i=this.shadowRoot)?void 0:i.querySelector("#handwritten-zoomed-preview-canvas");r&&o&&(r.imageWidth=s.width,r.imageHeight=s.height,r.imageTop=s.top,r.imageLeft=s.left,o.imageWidth=s.width,o.imageHeight=s.height,o.imageTop=s.top,o.imageLeft=s.left)})),this.updateComplete,this.thumbnailElements[this.focusIndex].classList.add("active"),this.mainSlideElements[this.focusIndex].classList.add("active");const t=(t,e)=>{t.addEventListener("click",(()=>{this.focusOn(e)}))};for(let e=0;e<this.thumbnailElements.length;e++)t(this.thumbnailElements[e],e)}handleCardChange(t,e){var i,s,r,o;e&&(this.mainImageTemplates=[U`<img src="${e.medias.cover.url||"https://picsum.photos/id/1/300/400"}" alt="" />`,U`<pbo-type-canvas
1612
1612
  background-url=${e.medias.insert.url}
1613
1613
  message=${null==(i=this.livePreviewProps)?void 0:i.text}
1614
1614
  alignment=${(null==(s=this.livePreviewProps)?void 0:s.alignment)||"left"}
@@ -1640,7 +1640,7 @@ const tu=t=>{return null!=(null==(i=null==(e=t)?void 0:e._$litType$)?void 0:i.h)
1640
1640
  <ul>
1641
1641
  <li class="main-slide" @click="${this.handleOpenZoomedClick}">
1642
1642
  <img src="${(null==(s=this.card)?void 0:s.medias.cover.url)||"https://picsum.photos/id/1/300/400"}" alt="" />
1643
- ${ru()?U`<div class="zoomed-preview-open-button" @click="${this.handleOpenZoomedClick}">
1643
+ ${Kd()?U`<div class="zoomed-preview-open-button" @click="${this.handleOpenZoomedClick}">
1644
1644
  <svg
1645
1645
  stroke="currentColor"
1646
1646
  fill="none"
@@ -1661,7 +1661,7 @@ const tu=t=>{return null!=(null==(i=null==(e=t)?void 0:e._$litType$)?void 0:i.h)
1661
1661
  </div>`:""}
1662
1662
  </li>
1663
1663
  <li class="main-slide" @click="${this.handleOpenZoomedClick}">
1664
- ${eu("type"===this.type?U`<pbo-type-canvas
1664
+ ${ru("type"===this.type?U`<pbo-type-canvas
1665
1665
  background-url=${null==(r=this.card)?void 0:r.medias.insert.url}
1666
1666
  message=${null==(o=this.livePreviewProps)?void 0:o.text}
1667
1667
  alignment=${(null==(n=this.livePreviewProps)?void 0:n.alignment)||"left"}
@@ -1674,7 +1674,7 @@ const tu=t=>{return null!=(null==(i=null==(e=t)?void 0:e._$litType$)?void 0:i.h)
1674
1674
  handwritten-url=${this.handwrittenPreviewProps.processedFileUrl}
1675
1675
  @click="${this.handleOpenZoomedClick}"
1676
1676
  ></pbo-handwritten-canvas>`)}
1677
- ${ru()?U`<div class="zoomed-preview-open-button">
1677
+ ${Kd()?U`<div class="zoomed-preview-open-button">
1678
1678
  <svg
1679
1679
  stroke="currentColor"
1680
1680
  fill="none"
@@ -1696,7 +1696,7 @@ const tu=t=>{return null!=(null==(i=null==(e=t)?void 0:e._$litType$)?void 0:i.h)
1696
1696
  </li>
1697
1697
  <li class="main-slide" @click=${this.handleOpenZoomedClick}>
1698
1698
  <img src="${(null==(h=this.card)?void 0:h.medias.rendered_2.url)||"https://picsum.photos/id/10/300/400"}" alt="" />
1699
- ${ru()?U`<div class="zoomed-preview-open-button" @click="${this.handleOpenZoomedClick}">
1699
+ ${Kd()?U`<div class="zoomed-preview-open-button" @click="${this.handleOpenZoomedClick}">
1700
1700
  <svg
1701
1701
  stroke="currentColor"
1702
1702
  fill="none"
@@ -1735,7 +1735,7 @@ const tu=t=>{return null!=(null==(i=null==(e=t)?void 0:e._$litType$)?void 0:i.h)
1735
1735
  alt=""
1736
1736
  style=${wd({display:0===this.focusIndex?"block":"none"})}
1737
1737
  />
1738
- ${eu("type"===this.type?U`<pbo-type-canvas
1738
+ ${ru("type"===this.type?U`<pbo-type-canvas
1739
1739
  background-url=${null==(p=this.card)?void 0:p.medias.insert.url}
1740
1740
  message=${null==(g=this.livePreviewProps)?void 0:g.text}
1741
1741
  alignment=${(null==(f=this.livePreviewProps)?void 0:f.alignment)||"left"}
@@ -1744,7 +1744,7 @@ const tu=t=>{return null!=(null==(i=null==(e=t)?void 0:e._$litType$)?void 0:i.h)
1744
1744
  @click="${this.handleOpenZoomedClick}"
1745
1745
  style=${wd({display:1===this.focusIndex?"block":"none"})}
1746
1746
  ></pbo-type-canvas>`:"")}
1747
- ${eu("handwritten"===this.type?U`<pbo-handwritten-canvas
1747
+ ${ru("handwritten"===this.type?U`<pbo-handwritten-canvas
1748
1748
  id="handwritten-zoomed-preview-canvas"
1749
1749
  background-url=${null==(b=this.card)?void 0:b.medias.insert.url}
1750
1750
  handwritten-url=${this.handwrittenPreviewProps.processedFileUrl}
@@ -1758,7 +1758,7 @@ const tu=t=>{return null!=(null==(i=null==(e=t)?void 0:e._$litType$)?void 0:i.h)
1758
1758
  />
1759
1759
  </pbo-zoomed-preview>
1760
1760
  </pbo-drawer>
1761
- `}};cu.styles=[sl,iu,a(su)],cu.dependencies={"fabric-example":t.FabricExample},lu([gt({type:Object})],cu.prototype,"card",2),lu([gt({type:Number,reflect:!0})],cu.prototype,"focusIndex",2),lu([gt({type:Object})],cu.prototype,"livePreviewProps",2),lu([gt()],cu.prototype,"handwrittenPreviewProps",2),lu([gt()],cu.prototype,"type",2),lu([vt("#thumbnails")],cu.prototype,"thumbnailCarousel",2),lu([vt("#main-carousel")],cu.prototype,"mainCarousel",2),lu([vt(".editor__zoomed")],cu.prototype,"zoomedPreview",2),lu([vt(".main-slide.active")],cu.prototype,"activeMainSlide",2),lu([vt("pbo-type-canvas")],cu.prototype,"typeCanvas",2),lu([yt(".thumbnail")],cu.prototype,"thumbnailElements",2),lu([yt(".main-slide")],cu.prototype,"mainSlideElements",2),lu([ft()],cu.prototype,"mainImageTemplates",2),lu([il("card")],cu.prototype,"handleCardChange",1),lu([il("focusIndex")],cu.prototype,"handleFocusIndexChange",1),cu=lu([dt("pbo-editor-card-slider")],cu);var hu=Object.defineProperty,du=Object.getOwnPropertyDescriptor,uu=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?du(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&hu(e,i,o),o};let pu=class extends Kh{constructor(){super(...arguments),this.cardInnerImageUrl="../../../public/Greeting Card from Pairbo.png",this.card=null,this.formData={font:"Monsieur La Doulaise",text:"",color:"rgb(0,0,0)",alignment:"left"},this.handwrittenFormState={isLoading:!1,processedFileUrl:""},this.editorType="type",this.handleTypingFormChange=()=>{this.formData=this.typingForm.form,this.slider.focusOn(1)},this.handelHandwrittenFormChange=t=>{this.handwrittenFormState=t.detail,this.slider.focusOn(1)},this.openZoomedPreview=()=>{this.zoomedPreview&&(this.zoomedPreview.open=!0)},this.closeZoomedPreview=()=>{this.zoomedPreview&&(this.zoomedPreview.open=!1)},this.handleEditorChange=t=>{this.editorType=t.detail.value}}firstUpdated(){this.addEventListener("handwritten-image-dimensions-changed",(t=>{this.handwrittenForm.setDimensions(t.detail)})),this.typingForm.addEventListener("pbo-change",this.handleTypingFormChange),this.handwrittenForm.addEventListener("pbo-change",this.handelHandwrittenFormChange),document.addEventListener("pbo-zoomed-preview-open",(()=>{this.openZoomedPreview()}))}handleCardInnerImageUrlChange(){this.requestUpdate()}handleCardChange(){this.card&&(this.slider.card=this.card,this.requestUpdate())}disconnectedCallback(){this.typingForm.removeEventListener("pbo-change",this.handleTypingFormChange),this.handwrittenForm.removeEventListener("pbo-change",this.handelHandwrittenFormChange)}render(){var t;return U`
1761
+ `}};hu.styles=[sl,ou,a(nu)],hu.dependencies={"fabric-example":t.FabricExample},cu([gt({type:Object})],hu.prototype,"card",2),cu([gt({type:Number,reflect:!0})],hu.prototype,"focusIndex",2),cu([gt({type:Object})],hu.prototype,"livePreviewProps",2),cu([gt()],hu.prototype,"handwrittenPreviewProps",2),cu([gt()],hu.prototype,"type",2),cu([vt("#thumbnails")],hu.prototype,"thumbnailCarousel",2),cu([vt("#main-carousel")],hu.prototype,"mainCarousel",2),cu([vt(".editor__zoomed")],hu.prototype,"zoomedPreview",2),cu([vt(".main-slide.active")],hu.prototype,"activeMainSlide",2),cu([vt("pbo-type-canvas")],hu.prototype,"typeCanvas",2),cu([yt(".thumbnail")],hu.prototype,"thumbnailElements",2),cu([yt(".main-slide")],hu.prototype,"mainSlideElements",2),cu([ft()],hu.prototype,"mainImageTemplates",2),cu([il("card")],hu.prototype,"handleCardChange",1),cu([il("focusIndex")],hu.prototype,"handleFocusIndexChange",1),hu=cu([dt("pbo-editor-card-slider")],hu);var du=Object.defineProperty,uu=Object.getOwnPropertyDescriptor,pu=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?uu(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&du(e,i,o),o};let gu=class extends Kh{constructor(){super(...arguments),this.cardInnerImageUrl="../../../public/Greeting Card from Pairbo.png",this.card=null,this.formData={font:"Monsieur La Doulaise",text:"",color:"rgb(0,0,0)",alignment:"left"},this.handwrittenFormState={isLoading:!1,processedFileUrl:""},this.editorType="type",this.handleTypingFormChange=()=>{this.formData=this.typeForm.formData,this.slider.focusOn(1)},this.handelHandwrittenFormChange=t=>{this.handwrittenFormState=t.detail,this.slider.focusOn(1)},this.openZoomedPreview=()=>{this.zoomedPreview&&(this.zoomedPreview.open=!0)},this.closeZoomedPreview=()=>{this.zoomedPreview&&(this.zoomedPreview.open=!1)},this.handleEditorChange=t=>{this.editorType=t.detail.value}}firstUpdated(){this.addEventListener("handwritten-image-dimensions-changed",(t=>{this.handwrittenForm.setDimensions(t.detail)})),this.typeForm.addEventListener("pbo-change",this.handleTypingFormChange),this.handwrittenForm.addEventListener("pbo-change",this.handelHandwrittenFormChange),document.addEventListener("pbo-zoomed-preview-open",(()=>{this.openZoomedPreview()}))}handleCardInnerImageUrlChange(){this.requestUpdate()}handleCardChange(){this.card&&(this.slider.card=this.card,this.requestUpdate(),this.typeForm.card=this.card,this.handwrittenForm.card=this.card)}disconnectedCallback(){this.typeForm.removeEventListener("pbo-change",this.handleTypingFormChange),this.handwrittenForm.removeEventListener("pbo-change",this.handelHandwrittenFormChange)}render(){var t;return U`
1762
1762
  <div class="editor">
1763
1763
  <div class="editor__card">
1764
1764
  <pbo-editor-card-slider
@@ -1772,10 +1772,13 @@ const tu=t=>{return null!=(null==(i=null==(e=t)?void 0:e._$litType$)?void 0:i.h)
1772
1772
  <div class="editor__form">
1773
1773
  <pbo-editor-selector @pbo-change=${this.handleEditorChange}></pbo-editor-selector>
1774
1774
  <pbo-type-form
1775
+ .submitTypeForm=${this.submitTypeForm}
1775
1776
  style=${wd({display:"type"===this.editorType?"block":"none"})}
1776
1777
  ></pbo-type-form>
1777
1778
  <pbo-handwritten-form
1778
1779
  style=${wd({display:"handwritten"===this.editorType?"block":"none"})}
1780
+ .submitHandwrittenForm=${this.submitHandwrittenForm}
1781
+ .getProcessedImg=${this.getProcessedImg}
1779
1782
  ></pbo-handwritten-form>
1780
1783
  </div>
1781
1784
  </div>
@@ -1793,7 +1796,7 @@ const tu=t=>{return null!=(null==(i=null==(e=t)?void 0:e._$litType$)?void 0:i.h)
1793
1796
  .close=${this.closeZoomedPreview}
1794
1797
  ></pbo-zoomed-preview>
1795
1798
  </pbo-drawer>
1796
- `}};pu.styles=[sl,Yd],pu.dependencies={"editor-card-slider":cu,"fabric-example":t.FabricExample,"pbo-type-form":Qd},uu([gt({type:String,reflect:!0})],pu.prototype,"cardInnerImageUrl",2),uu([vt("pbo-type-form")],pu.prototype,"typingForm",2),uu([vt("pbo-handwritten-form")],pu.prototype,"handwrittenForm",2),uu([vt("pbo-editor-card-slider")],pu.prototype,"slider",2),uu([vt(".editor__zoomed")],pu.prototype,"zoomedPreview",2),uu([gt({type:Object})],pu.prototype,"card",2),uu([ft()],pu.prototype,"formData",2),uu([ft()],pu.prototype,"handwrittenFormState",2),uu([ft()],pu.prototype,"editorType",2),uu([il("cardInnerImageUrl")],pu.prototype,"handleCardInnerImageUrlChange",1),uu([il("card")],pu.prototype,"handleCardChange",1),pu=uu([dt("pbo-editor")],pu);const gu=pu,fu=Qd,mu=cu,vu=l`
1799
+ `}};gu.styles=[sl,Yd],gu.dependencies={"editor-card-slider":hu,"fabric-example":t.FabricExample,"pbo-type-form":iu},pu([gt({type:String,reflect:!0})],gu.prototype,"cardInnerImageUrl",2),pu([gt({type:Object})],gu.prototype,"card",2),pu([gt()],gu.prototype,"submitTypeForm",2),pu([gt()],gu.prototype,"submitHandwrittenForm",2),pu([gt()],gu.prototype,"getProcessedImg",2),pu([vt("pbo-type-form")],gu.prototype,"typeForm",2),pu([vt("pbo-handwritten-form")],gu.prototype,"handwrittenForm",2),pu([vt("pbo-editor-card-slider")],gu.prototype,"slider",2),pu([vt(".editor__zoomed")],gu.prototype,"zoomedPreview",2),pu([ft()],gu.prototype,"formData",2),pu([ft()],gu.prototype,"handwrittenFormState",2),pu([ft()],gu.prototype,"editorType",2),pu([il("cardInnerImageUrl")],gu.prototype,"handleCardInnerImageUrlChange",1),pu([il("card")],gu.prototype,"handleCardChange",1),gu=pu([dt("pbo-editor")],gu);const fu=gu,mu=iu,vu=hu,bu=l`
1797
1800
  :host {
1798
1801
  display: block;
1799
1802
  }
@@ -1857,19 +1860,19 @@ const tu=t=>{return null!=(null==(i=null==(e=t)?void 0:e._$litType$)?void 0:i.h)
1857
1860
  .splide__slide img:hover {
1858
1861
  transform: scale(1.1);
1859
1862
  }
1860
- `;function bu(t,e,i){return e&&function(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}
1863
+ `;function yu(t,e,i){return e&&function(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}
1861
1864
  /*!
1862
1865
  * Splide.js
1863
1866
  * Version : 4.1.4
1864
1867
  * License : MIT
1865
1868
  * Copyright: 2022 Naotoshi Fujita
1866
- */var yu="(prefers-reduced-motion: reduce)",_u={CREATED:1,MOUNTED:2,IDLE:3,MOVING:4,SCROLLING:5,DRAGGING:6,DESTROYED:7};function xu(t){t.length=0}function wu(t,e,i){return Array.prototype.slice.call(t,e,i)}function Cu(t){return t.bind.apply(t,[null].concat(wu(arguments,1)))}var Su=setTimeout,Tu=function(){};function ku(t){return requestAnimationFrame(t)}function Ou(t,e){return typeof e===t}function Eu(t){return!Fu(t)&&Ou("object",t)}var Au=Array.isArray,Mu=Cu(Ou,"function"),Du=Cu(Ou,"string"),Pu=Cu(Ou,"undefined");function Fu(t){return null===t}function Iu(t){try{return t instanceof(t.ownerDocument.defaultView||window).HTMLElement}catch(e){return!1}}function ju(t){return Au(t)?t:[t]}function Lu(t,e){ju(t).forEach(e)}function Ru(t,e){return t.indexOf(e)>-1}function Bu(t,e){return t.push.apply(t,ju(e)),t}function zu(t,e,i){t&&Lu(e,(function(e){e&&t.classList[i?"add":"remove"](e)}))}function $u(t,e){zu(t,Du(e)?e.split(" "):e,!0)}function Hu(t,e){Lu(e,t.appendChild.bind(t))}function Nu(t,e){Lu(t,(function(t){var i=(e||t).parentNode;i&&i.insertBefore(t,e)}))}function Vu(t,e){return Iu(t)&&(t.msMatchesSelector||t.matches).call(t,e)}function Uu(t,e){var i=t?wu(t.children):[];return e?i.filter((function(t){return Vu(t,e)})):i}function Wu(t,e){return e?Uu(t,e)[0]:t.firstElementChild}var Xu=Object.keys;function Gu(t,e,i){return t&&(i?Xu(t).reverse():Xu(t)).forEach((function(i){"__proto__"!==i&&e(t[i],i)})),t}function Yu(t){return wu(arguments,1).forEach((function(e){Gu(e,(function(i,s){t[s]=e[s]}))})),t}function qu(t){return wu(arguments,1).forEach((function(e){Gu(e,(function(e,i){Au(e)?t[i]=e.slice():Eu(e)?t[i]=qu({},Eu(t[i])?t[i]:{},e):t[i]=e}))})),t}function Ku(t,e){Lu(e||Xu(t),(function(e){delete t[e]}))}function Zu(t,e){Lu(t,(function(t){Lu(e,(function(e){t&&t.removeAttribute(e)}))}))}function Ju(t,e,i){Eu(e)?Gu(e,(function(e,i){Ju(t,i,e)})):Lu(t,(function(t){Fu(i)||""===i?Zu(t,e):t.setAttribute(e,String(i))}))}function Qu(t,e,i){var s=document.createElement(t);return e&&(Du(e)?$u(s,e):Ju(s,e)),i&&Hu(i,s),s}function tp(t,e,i){if(Pu(i))return getComputedStyle(t)[e];Fu(i)||(t.style[e]=""+i)}function ep(t,e){tp(t,"display",e)}function ip(t){t.setActive&&t.setActive()||t.focus({preventScroll:!0})}function sp(t,e){return t.getAttribute(e)}function rp(t,e){return t&&t.classList.contains(e)}function op(t){return t.getBoundingClientRect()}function np(t){Lu(t,(function(t){t&&t.parentNode&&t.parentNode.removeChild(t)}))}function ap(t){return Wu((new DOMParser).parseFromString(t,"text/html").body)}function lp(t,e){t.preventDefault(),e&&(t.stopPropagation(),t.stopImmediatePropagation())}function cp(t,e){return t&&t.querySelector(e)}function hp(t,e){return e?wu(t.querySelectorAll(e)):[]}function dp(t,e){zu(t,e,!1)}function up(t){return t.timeStamp}function pp(t){return Du(t)?t:t?t+"px":""}var gp="splide",fp="data-"+gp;function mp(t,e){if(!t)throw new Error("["+gp+"] "+(e||""))}var vp=Math.min,bp=Math.max,yp=Math.floor,_p=Math.ceil,xp=Math.abs;function wp(t,e,i){return xp(t-e)<i}function Cp(t,e,i,s){var r=vp(e,i),o=bp(e,i);return s?r<t&&t<o:r<=t&&t<=o}function Sp(t,e,i){var s=vp(e,i),r=bp(e,i);return vp(bp(s,t),r)}function Tp(t){return+(t>0)-+(t<0)}function kp(t,e){return Lu(e,(function(e){t=t.replace("%s",""+e)})),t}function Op(t){return t<10?"0"+t:""+t}var Ep={};function Ap(){var t=[];function e(t,e,i){Lu(t,(function(t){t&&Lu(e,(function(e){e.split(" ").forEach((function(e){var s=e.split(".");i(t,s[0],s[1])}))}))}))}return{bind:function(i,s,r,o){e(i,s,(function(e,i,s){var n="addEventListener"in e,a=n?e.removeEventListener.bind(e,i,r,o):e.removeListener.bind(e,r);n?e.addEventListener(i,r,o):e.addListener(r),t.push([e,i,s,r,a])}))},unbind:function(i,s,r){e(i,s,(function(e,i,s){t=t.filter((function(t){return!!(t[0]!==e||t[1]!==i||t[2]!==s||r&&t[3]!==r)||(t[4](),!1)}))}))},dispatch:function(t,e,i){var s,r=!0;return"function"==typeof CustomEvent?s=new CustomEvent(e,{bubbles:r,detail:i}):(s=document.createEvent("CustomEvent")).initCustomEvent(e,r,!1,i),t.dispatchEvent(s),s},destroy:function(){t.forEach((function(t){t[4]()})),xu(t)}}}var Mp="mounted",Dp="ready",Pp="move",Fp="moved",Ip="click",jp="active",Lp="inactive",Rp="visible",Bp="hidden",zp="refresh",$p="updated",Hp="resize",Np="resized",Vp="scroll",Up="scrolled",Wp="destroy",Xp="arrows:mounted",Gp="navigation:mounted",Yp="autoplay:play",qp="autoplay:pause",Kp="lazyload:loaded",Zp="sk",Jp="sh",Qp="ei";function tg(t){var e=t?t.event.bus:document.createDocumentFragment(),i=Ap();return t&&t.event.on(Wp,i.destroy),Yu(i,{bus:e,on:function(t,s){i.bind(e,ju(t).join(" "),(function(t){s.apply(s,Au(t.detail)?t.detail:[])}))},off:Cu(i.unbind,e),emit:function(t){i.dispatch(e,t,wu(arguments,1))}})}function eg(t,e,i,s){var r,o,n=Date.now,a=0,l=!0,c=0;function h(){if(!l){if(a=t?vp((n()-r)/t,1):1,i&&i(a),a>=1&&(e(),r=n(),s&&++c>=s))return d();o=ku(h)}}function d(){l=!0}function u(){o&&cancelAnimationFrame(o),a=0,o=0,l=!0}return{start:function(e){e||u(),r=n()-(e?a*t:0),l=!1,o=ku(h)},rewind:function(){r=n(),a=0,i&&i(a)},pause:d,cancel:u,set:function(e){t=e},isPaused:function(){return l}}}var ig="Arrow",sg=ig+"Left",rg=ig+"Right",og=ig+"Up",ng=ig+"Down",ag="ttb",lg={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[og,rg],ArrowRight:[ng,sg]};var cg="role",hg="tabindex",dg="aria-",ug=dg+"controls",pg=dg+"current",gg=dg+"selected",fg=dg+"label",mg=dg+"labelledby",vg=dg+"hidden",bg=dg+"orientation",yg=dg+"roledescription",_g=dg+"live",xg=dg+"busy",wg=dg+"atomic",Cg=[cg,hg,"disabled",ug,pg,fg,mg,vg,bg,yg],Sg=gp+"__",Tg="is-",kg=gp,Og=Sg+"track",Eg=Sg+"list",Ag=Sg+"slide",Mg=Ag+"--clone",Dg=Ag+"__container",Pg=Sg+"arrows",Fg=Sg+"arrow",Ig=Fg+"--prev",jg=Fg+"--next",Lg=Sg+"pagination",Rg=Lg+"__page",Bg=Sg+"progress"+"__bar",zg=Sg+"toggle",$g=Sg+"sr",Hg=Tg+"initialized",Ng=Tg+"active",Vg=Tg+"prev",Ug=Tg+"next",Wg=Tg+"visible",Xg=Tg+"loading",Gg=Tg+"focus-in",Yg=Tg+"overflow",qg=[Ng,Wg,Vg,Ug,Xg,Gg,Yg],Kg={slide:Ag,clone:Mg,arrows:Pg,arrow:Fg,prev:Ig,next:jg,pagination:Lg,page:Rg,spinner:Sg+"spinner"};var Zg="touchstart mousedown",Jg="touchmove mousemove",Qg="touchend touchcancel mouseup click";var tf="slide",ef="loop",sf="fade";function rf(t,e,i,s){var r,o=tg(t),n=o.on,a=o.emit,l=o.bind,c=t.Components,h=t.root,d=t.options,u=d.isNavigation,p=d.updateOnMove,g=d.i18n,f=d.pagination,m=d.slideFocus,v=c.Direction.resolve,b=sp(s,"style"),y=sp(s,fg),_=i>-1,x=Wu(s,"."+Dg);function w(){var r=t.splides.map((function(t){var i=t.splide.Components.Slides.getAt(e);return i?i.slide.id:""})).join(" ");Ju(s,fg,kp(g.slideX,(_?i:e)+1)),Ju(s,ug,r),Ju(s,cg,m?"button":""),m&&Zu(s,yg)}function C(){r||S()}function S(){if(!r){var i=t.index;(o=T())!==rp(s,Ng)&&(zu(s,Ng,o),Ju(s,pg,u&&o||""),a(o?jp:Lp,k)),function(){var e=function(){if(t.is(sf))return T();var e=op(c.Elements.track),i=op(s),r=v("left",!0),o=v("right",!0);return yp(e[r])<=_p(i[r])&&yp(i[o])<=_p(e[o])}(),i=!e&&(!T()||_);t.state.is([4,5])||Ju(s,vg,i||"");Ju(hp(s,d.focusableNodes||""),hg,i?-1:""),m&&Ju(s,hg,i?-1:0);e!==rp(s,Wg)&&(zu(s,Wg,e),a(e?Rp:Bp,k));if(!e&&document.activeElement===s){var r=c.Slides.getAt(t.index);r&&ip(r.slide)}}(),zu(s,Vg,e===i-1),zu(s,Ug,e===i+1)}var o}function T(){var s=t.index;return s===e||d.cloneStatus&&s===i}var k={index:e,slideIndex:i,slide:s,container:x,isClone:_,mount:function(){_||(s.id=h.id+"-slide"+Op(e+1),Ju(s,cg,f?"tabpanel":"group"),Ju(s,yg,g.slide),Ju(s,fg,y||kp(g.slideLabel,[e+1,t.length]))),l(s,"click",Cu(a,Ip,k)),l(s,"keydown",Cu(a,Zp,k)),n([Fp,Jp,Up],S),n(Gp,w),p&&n(Pp,C)},destroy:function(){r=!0,o.destroy(),dp(s,qg),Zu(s,Cg),Ju(s,"style",b),Ju(s,fg,y||"")},update:S,style:function(t,e,i){tp(i&&x||s,t,e)},isWithin:function(i,s){var r=xp(i-e);return _||!d.rewind&&!t.is(ef)||(r=vp(r,t.length-r)),r<=s}};return k}var of=fp+"-interval";var nf={passive:!1,capture:!0};var af={Spacebar:" ",Right:rg,Left:sg,Up:og,Down:ng};function lf(t){return t=Du(t)?t:t.key,af[t]||t}var cf="keydown";var hf=fp+"-lazy",df=hf+"-srcset",uf="["+hf+"], ["+df+"]";var pf=[" ","Enter"];var gf=Object.freeze({__proto__:null,Media:function(t,e,i){var s=t.state,r=i.breakpoints||{},o=i.reducedMotion||{},n=Ap(),a=[];function l(t){t&&n.destroy()}function c(t,e){var i=matchMedia(e);n.bind(i,"change",h),a.push([t,i])}function h(){var e=s.is(7),r=i.direction,o=a.reduce((function(t,e){return qu(t,e[1].matches?e[0]:{})}),{});Ku(i),d(o),i.destroy?t.destroy("completely"===i.destroy):e?(l(!0),t.mount()):r!==i.direction&&t.refresh()}function d(e,r,o){qu(i,e),r&&qu(Object.getPrototypeOf(i),e),!o&&s.is(1)||t.emit($p,i)}return{setup:function(){var t="min"===i.mediaQuery;Xu(r).sort((function(e,i){return t?+e-+i:+i-+e})).forEach((function(e){c(r[e],"("+(t?"min":"max")+"-width:"+e+"px)")})),c(o,yu),h()},destroy:l,reduce:function(t){matchMedia(yu).matches&&(t?qu(i,o):Ku(i,Xu(o)))},set:d}},Direction:function(t,e,i){return{resolve:function(t,e,s){var r="rtl"!==(s=s||i.direction)||e?s===ag?0:-1:1;return lg[t]&&lg[t][r]||t.replace(/width|left|right/i,(function(t,e){var i=lg[t.toLowerCase()][r]||t;return e>0?i.charAt(0).toUpperCase()+i.slice(1):i}))},orient:function(t){return t*("rtl"===i.direction?1:-1)}}},Elements:function(t,e,i){var s,r,o,n=tg(t),a=n.on,l=n.bind,c=t.root,h=i.i18n,d={},u=[],p=[],g=[];function f(){s=b("."+Og),r=Wu(s,"."+Eg),mp(s&&r,"A track/list element is missing."),Bu(u,Uu(r,"."+Ag+":not(."+Mg+")")),Gu({arrows:Pg,pagination:Lg,prev:Ig,next:jg,bar:Bg,toggle:zg},(function(t,e){d[e]=b("."+t)})),Yu(d,{root:c,track:s,list:r,slides:u}),function(){var t=c.id||(o=gp,""+o+Op(Ep[o]=(Ep[o]||0)+1)),e=i.role;var o;c.id=t,s.id=s.id||t+"-track",r.id=r.id||t+"-list",!sp(c,cg)&&"SECTION"!==c.tagName&&e&&Ju(c,cg,e);Ju(c,yg,h.carousel),Ju(r,cg,"presentation")}(),v()}function m(t){var e=Cg.concat("style");xu(u),dp(c,p),dp(s,g),Zu([s,r],e),Zu(c,t?e:["style",yg])}function v(){dp(c,p),dp(s,g),p=y(kg),g=y(Og),$u(c,p),$u(s,g),Ju(c,fg,i.label),Ju(c,mg,i.labelledby)}function b(t){var e=cp(c,t);return e&&function(t,e){if(Mu(t.closest))return t.closest(e);for(var i=t;i&&1===i.nodeType&&!Vu(i,e);)i=i.parentElement;return i}(e,"."+kg)===c?e:void 0}function y(t){return[t+"--"+i.type,t+"--"+i.direction,i.drag&&t+"--draggable",i.isNavigation&&t+"--nav",t===kg&&Ng]}return Yu(d,{setup:f,mount:function(){a(zp,m),a(zp,f),a($p,v),l(document,Zg+" keydown",(function(t){o="keydown"===t.type}),{capture:!0}),l(c,"focusin",(function(){zu(c,Gg,!!o)}))},destroy:m})},Slides:function(t,e,i){var s=tg(t),r=s.on,o=s.emit,n=s.bind,a=e.Elements,l=a.slides,c=a.list,h=[];function d(){l.forEach((function(t,e){p(t,e,-1)}))}function u(){f((function(t){t.destroy()})),xu(h)}function p(e,i,s){var r=rf(t,i,s,e);r.mount(),h.push(r),h.sort((function(t,e){return t.index-e.index}))}function g(t){return t?m((function(t){return!t.isClone})):h}function f(t,e){g(e).forEach(t)}function m(t){return h.filter(Mu(t)?t:function(e){return Du(t)?Vu(e.slide,t):Ru(ju(t),e.index)})}return{mount:function(){d(),r(zp,u),r(zp,d)},destroy:u,update:function(){f((function(t){t.update()}))},register:p,get:g,getIn:function(t){var s=e.Controller,r=s.toIndex(t),o=s.hasFocus()?1:i.perPage;return m((function(t){return Cp(t.index,r,r+o-1)}))},getAt:function(t){return m(t)[0]},add:function(t,e){Lu(t,(function(t){if(Du(t)&&(t=ap(t)),Iu(t)){var s=l[e];s?Nu(t,s):Hu(c,t),$u(t,i.classes.slide),r=t,a=Cu(o,Hp),h=hp(r,"img"),(d=h.length)?h.forEach((function(t){n(t,"load error",(function(){--d||a()}))})):a()}var r,a,h,d})),o(zp)},remove:function(t){np(m(t).map((function(t){return t.slide}))),o(zp)},forEach:f,filter:m,style:function(t,e,i){f((function(s){s.style(t,e,i)}))},getLength:function(t){return t?l.length:h.length},isEnough:function(){return h.length>i.perPage}}},Layout:function(t,e,i){var s,r,o,n=tg(t),a=n.on,l=n.bind,c=n.emit,h=e.Slides,d=e.Direction.resolve,u=e.Elements,p=u.root,g=u.track,f=u.list,m=h.getAt,v=h.style;function b(){s=i.direction===ag,tp(p,"maxWidth",pp(i.width)),tp(g,d("paddingLeft"),_(!1)),tp(g,d("paddingRight"),_(!0)),y(!0)}function y(t){var e=op(p);(t||r.width!==e.width||r.height!==e.height)&&(tp(g,"height",function(){var t="";s&&(mp(t=x(),"height or heightRatio is missing."),t="calc("+t+" - "+_(!1)+" - "+_(!0)+")");return t}()),v(d("marginRight"),pp(i.gap)),v("width",i.autoWidth?null:pp(i.fixedWidth)||(s?"":w())),v("height",pp(i.fixedHeight)||(s?i.autoHeight?null:w():x()),!0),r=e,c(Np),o!==(o=E())&&(zu(p,Yg,o),c("overflow",o)))}function _(t){var e=i.padding,s=d(t?"right":"left");return e&&pp(e[s]||(Eu(e)?0:e))||"0px"}function x(){return pp(i.height||op(f).width*i.heightRatio)}function w(){var t=pp(i.gap);return"calc((100%"+(t&&" + "+t)+")/"+(i.perPage||1)+(t&&" - "+t)+")"}function C(){return op(f)[d("width")]}function S(t,e){var i=m(t||0);return i?op(i.slide)[d("width")]+(e?0:O()):0}function T(t,e){var i=m(t);if(i){var s=op(i.slide)[d("right")],r=op(f)[d("left")];return xp(s-r)+(e?0:O())}return 0}function k(e){return T(t.length-1)-T(0)+S(0,e)}function O(){var t=m(0);return t&&parseFloat(tp(t.slide,d("marginRight")))||0}function E(){return t.is(sf)||k(!0)>C()}return{mount:function(){var t,e;b(),l(window,"resize load",(t=Cu(c,Hp),e=eg(0,t,null,1),function(){e.isPaused()&&e.start()})),a([$p,zp],b),a(Hp,y)},resize:y,listSize:C,slideSize:S,sliderSize:k,totalSize:T,getPadding:function(t){return parseFloat(tp(g,d("padding"+(t?"Right":"Left"))))||0},isOverflow:E}},Clones:function(t,e,i){var s,r=tg(t),o=r.on,n=e.Elements,a=e.Slides,l=e.Direction.resolve,c=[];function h(){o(zp,d),o([$p,Hp],p),(s=g())&&(!function(e){var s=a.get().slice(),r=s.length;if(r){for(;s.length<e;)Bu(s,s);Bu(s.slice(-e),s.slice(0,e)).forEach((function(o,l){var h=l<e,d=function(e,s){var r=e.cloneNode(!0);return $u(r,i.classes.clone),r.id=t.root.id+"-clone"+Op(s+1),r}(o.slide,l);h?Nu(d,s[0].slide):Hu(n.list,d),Bu(c,d),a.register(d,l-e+(h?0:r),o.index)}))}}(s),e.Layout.resize(!0))}function d(){u(),h()}function u(){np(c),xu(c),r.destroy()}function p(){var t=g();s!==t&&(s<t||!t)&&r.emit(zp)}function g(){var s=i.clones;if(t.is(ef)){if(Pu(s)){var r=i[l("fixedWidth")]&&e.Layout.slideSize(0);s=r&&_p(op(n.track)[l("width")]/r)||i[l("autoWidth")]&&t.length||2*i.perPage}}else s=0;return s}return{mount:h,destroy:u}},Move:function(t,e,i){var s,r=tg(t),o=r.on,n=r.emit,a=t.state.set,l=e.Layout,c=l.slideSize,h=l.getPadding,d=l.totalSize,u=l.listSize,p=l.sliderSize,g=e.Direction,f=g.resolve,m=g.orient,v=e.Elements,b=v.list,y=v.track;function _(){e.Controller.isBusy()||(e.Scroll.cancel(),x(t.index),e.Slides.update())}function x(t){w(k(t,!0))}function w(i,s){if(!t.is(sf)){var r=s?i:function(i){if(t.is(ef)){var s=T(i),r=s>e.Controller.getEnd();(s<0||r)&&(i=C(i,r))}return i}(i);tp(b,"transform","translate"+f("X")+"("+r+"px)"),i!==r&&n(Jp)}}function C(t,e){var i=t-E(e),s=p();return t-=m(s*(_p(xp(i)/s)||1))*(e?1:-1)}function S(){w(O(),!0),s.cancel()}function T(t){for(var i=e.Slides.get(),s=0,r=1/0,o=0;o<i.length;o++){var n=i[o].index,a=xp(k(n,!0)-t);if(!(a<=r))break;r=a,s=n}return s}function k(e,s){var r=m(d(e-1)-function(t){var e=i.focus;return"center"===e?(u()-c(t,!0))/2:+e*c(t)||0}(e));return s?function(e){i.trimSpace&&t.is(tf)&&(e=Sp(e,0,m(p(!0)-u())));return e}(r):r}function O(){var t=f("left");return op(b)[t]-op(y)[t]+m(h(!1))}function E(t){return k(t?e.Controller.getEnd():0,!!i.trimSpace)}return{mount:function(){s=e.Transition,o([Mp,Np,$p,zp],_)},move:function(t,e,i,r){var o,l;t!==e&&(o=t>i,l=m(C(O(),o)),o?l>=0:l<=b[f("scrollWidth")]-op(y)[f("width")])&&(S(),w(C(O(),t>i),!0)),a(4),n(Pp,e,i,t),s.start(e,(function(){a(3),n(Fp,e,i,t),r&&r()}))},jump:x,translate:w,shift:C,cancel:S,toIndex:T,toPosition:k,getPosition:O,getLimit:E,exceededLimit:function(t,e){e=Pu(e)?O():e;var i=!0!==t&&m(e)<m(E(!1)),s=!1!==t&&m(e)>m(E(!0));return i||s},reposition:_}},Controller:function(t,e,i){var s,r,o,n,a=tg(t),l=a.on,c=a.emit,h=e.Move,d=h.getPosition,u=h.getLimit,p=h.toPosition,g=e.Slides,f=g.isEnough,m=g.getLength,v=i.omitEnd,b=t.is(ef),y=t.is(tf),_=Cu(k,!1),x=Cu(k,!0),w=i.start||0,C=w;function S(){r=m(!0),o=i.perMove,n=i.perPage,s=A();var t=Sp(w,0,v?s:r-1);t!==w&&(w=t,h.reposition())}function T(){s!==A()&&c(Qp)}function k(t,e){var i=o||(F()?1:n),r=O(w+i*(t?-1:1),w,!(o||F()));return-1===r&&y&&!wp(d(),u(!t),1)?t?0:s:e?r:E(r)}function O(e,a,l){if(f()||F()){var c=function(e){if(y&&"move"===i.trimSpace&&e!==w)for(var s=d();s===p(e,!0)&&Cp(e,0,t.length-1,!i.rewind);)e<w?--e:++e;return e}(e);c!==e&&(a=e,e=c,l=!1),e<0||e>s?e=o||!Cp(0,e,a,!0)&&!Cp(s,a,e,!0)?b?l?e<0?-(r%n||n):r:e:i.rewind?e<0?s:0:-1:M(D(e)):l&&e!==a&&(e=M(D(a)+(e<a?-1:1)))}else e=-1;return e}function E(t){return b?(t+r)%r||0:t}function A(){for(var t=r-(F()||b&&o?1:n);v&&t-- >0;)if(p(r-1,!0)!==p(t,!0)){t++;break}return Sp(t,0,r-1)}function M(t){return Sp(F()?t:n*t,0,s)}function D(t){return F()?vp(t,s):yp((t>=s?r-1:t)/n)}function P(t){t!==w&&(C=w,w=t)}function F(){return!Pu(i.focus)||i.isNavigation}function I(){return t.state.is([4,5])&&!!i.waitForTransition}return{mount:function(){S(),l([$p,zp,Qp],S),l(Np,T)},go:function(t,e,i){if(!I()){var r=function(t){var e=w;if(Du(t)){var i=t.match(/([+\-<>])(\d+)?/)||[],r=i[1],o=i[2];"+"===r||"-"===r?e=O(w+ +(""+r+(+o||1)),w):">"===r?e=o?M(+o):_(!0):"<"===r&&(e=x(!0))}else e=b?t:Sp(t,0,s);return e}(t),o=E(r);o>-1&&(e||o!==w)&&(P(o),h.move(r,o,C,i))}},scroll:function(t,i,r,o){e.Scroll.scroll(t,i,r,(function(){var t=E(h.toIndex(d()));P(v?vp(t,s):t),o&&o()}))},getNext:_,getPrev:x,getAdjacent:k,getEnd:A,setIndex:P,getIndex:function(t){return t?C:w},toIndex:M,toPage:D,toDest:function(t){var e=h.toIndex(t);return y?Sp(e,0,s):e},hasFocus:F,isBusy:I}},Arrows:function(t,e,i){var s,r,o=tg(t),n=o.on,a=o.bind,l=o.emit,c=i.classes,h=i.i18n,d=e.Elements,u=e.Controller,p=d.arrows,g=d.track,f=p,m=d.prev,v=d.next,b={};function y(){!function(){var t=i.arrows;!t||m&&v||(f=p||Qu("div",c.arrows),m=C(!0),v=C(!1),s=!0,Hu(f,[m,v]),!p&&Nu(f,g));m&&v&&(Yu(b,{prev:m,next:v}),ep(f,t?"":"none"),$u(f,r=Pg+"--"+i.direction),t&&(n([Mp,Fp,zp,Up,Qp],S),a(v,"click",Cu(w,">")),a(m,"click",Cu(w,"<")),S(),Ju([m,v],ug,g.id),l(Xp,m,v)))}(),n($p,_)}function _(){x(),y()}function x(){o.destroy(),dp(f,r),s?(np(p?[m,v]:f),m=v=null):Zu([m,v],Cg)}function w(t){u.go(t,!0)}function C(t){return ap('<button class="'+c.arrow+" "+(t?c.prev:c.next)+'" type="button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40" focusable="false"><path d="'+(i.arrowPath||"m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z")+'" />')}function S(){if(m&&v){var e=t.index,i=u.getPrev(),s=u.getNext(),r=i>-1&&e<i?h.last:h.prev,o=s>-1&&e>s?h.first:h.next;m.disabled=i<0,v.disabled=s<0,Ju(m,fg,r),Ju(v,fg,o),l("arrows:updated",m,v,i,s)}}return{arrows:b,mount:y,destroy:x,update:S}},Autoplay:function(t,e,i){var s,r,o=tg(t),n=o.on,a=o.bind,l=o.emit,c=eg(i.interval,t.go.bind(t,">"),(function(t){var e=d.bar;e&&tp(e,"width",100*t+"%"),l("autoplay:playing",t)})),h=c.isPaused,d=e.Elements,u=e.Elements,p=u.root,g=u.toggle,f=i.autoplay,m="pause"===f;function v(){h()&&e.Slides.isEnough()&&(c.start(!i.resetProgress),r=s=m=!1,_(),l(Yp))}function b(t){void 0===t&&(t=!0),m=!!t,_(),h()||(c.pause(),l(qp))}function y(){m||(s||r?b(!1):v())}function _(){g&&(zu(g,Ng,!m),Ju(g,fg,i.i18n[m?"play":"pause"]))}function x(t){var s=e.Slides.getAt(t);c.set(s&&+sp(s.slide,of)||i.interval)}return{mount:function(){f&&(!function(){i.pauseOnHover&&a(p,"mouseenter mouseleave",(function(t){s="mouseenter"===t.type,y()}));i.pauseOnFocus&&a(p,"focusin focusout",(function(t){r="focusin"===t.type,y()}));g&&a(g,"click",(function(){m?v():b(!0)}));n([Pp,Vp,zp],c.rewind),n(Pp,x)}(),g&&Ju(g,ug,d.track.id),m||v(),_())},destroy:c.cancel,play:v,pause:b,isPaused:h}},Cover:function(t,e,i){var s=tg(t).on;function r(t){e.Slides.forEach((function(e){var i=Wu(e.container||e.slide,"img");i&&i.src&&o(t,i,e)}))}function o(t,e,i){i.style("background",t?'center/cover no-repeat url("'+e.src+'")':"",!0),ep(e,t?"none":"")}return{mount:function(){i.cover&&(s(Kp,Cu(o,!0)),s([Mp,$p,zp],Cu(r,!0)))},destroy:Cu(r,!1)}},Scroll:function(t,e,i){var s,r,o=tg(t),n=o.on,a=o.emit,l=t.state.set,c=e.Move,h=c.getPosition,d=c.getLimit,u=c.exceededLimit,p=c.translate,g=t.is(tf),f=1;function m(t,i,o,n,d){var p=h();if(y(),o&&(!g||!u())){var m=e.Layout.sliderSize(),_=Tp(t)*m*yp(xp(t)/m)||0;t=c.toPosition(e.Controller.toDest(t%m))+_}var x=wp(p,t,1);f=1,i=x?0:i||bp(xp(t-p)/1.5,800),r=n,s=eg(i,v,Cu(b,p,t,d),1),l(5),a(Vp),s.start()}function v(){l(3),r&&r(),a(Up)}function b(t,e,s,o){var n=h(),a=t+(e-t)*function(t){var e=i.easingFunc;return e?e(t):1-Math.pow(1-t,4)}(o),l=(a-n)*f;p(n+l),g&&!s&&u()&&(f*=.6,xp(l)<10&&m(d(u(!0)),600,!1,r,!0))}function y(){s&&s.cancel()}function _(){s&&!s.isPaused()&&(y(),v())}return{mount:function(){n(Pp,y),n([$p,zp],_)},destroy:y,scroll:m,cancel:_}},Drag:function(t,e,i){var s,r,o,n,a,l,c,h,d=tg(t),u=d.on,p=d.emit,g=d.bind,f=d.unbind,m=t.state,v=e.Move,b=e.Scroll,y=e.Controller,_=e.Elements.track,x=e.Media.reduce,w=e.Direction,C=w.resolve,S=w.orient,T=v.getPosition,k=v.exceededLimit,O=!1;function E(){var t=i.drag;z(!t),n="free"===t}function A(t){if(l=!1,!c){var e=B(t);s=t.target,r=i.noDrag,Vu(s,"."+Rg+", ."+Fg)||r&&Vu(s,r)||!e&&t.button||(y.isBusy()?lp(t,!0):(h=e?_:window,a=m.is([4,5]),o=null,g(h,Jg,M,nf),g(h,Qg,D,nf),v.cancel(),b.cancel(),F(t)))}var s,r}function M(e){if(m.is(6)||(m.set(6),p("drag")),e.cancelable)if(a){v.translate(s+I(e)/(O&&t.is(tf)?5:1));var r=j(e)>200,o=O!==(O=k());(r||o)&&F(e),l=!0,p("dragging"),lp(e)}else(function(t){return xp(I(t))>xp(I(t,!0))})(e)&&(a=function(t){var e=i.dragMinThreshold,s=Eu(e),r=s&&e.mouse||0,o=(s?e.touch:+e)||10;return xp(I(t))>(B(t)?o:r)}(e),lp(e))}function D(s){m.is(6)&&(m.set(3),p("dragged")),a&&(!function(s){var r=function(e){if(t.is(ef)||!O){var i=j(e);if(i&&i<200)return I(e)/i}return 0}(s),o=function(t){return T()+Tp(t)*vp(xp(t)*(i.flickPower||600),n?1/0:e.Layout.listSize()*(i.flickMaxPages||1))}(r),a=i.rewind&&i.rewindByDrag;x(!1),n?y.scroll(o,0,i.snap):t.is(sf)?y.go(S(Tp(r))<0?a?"<":"-":a?">":"+"):t.is(tf)&&O&&a?y.go(k(!0)?">":"<"):y.go(y.toDest(o),!0);x(!0)}(s),lp(s)),f(h,Jg,M),f(h,Qg,D),a=!1}function P(t){!c&&l&&lp(t,!0)}function F(t){o=r,r=t,s=T()}function I(t,e){return R(t,e)-R(L(t),e)}function j(t){return up(t)-up(L(t))}function L(t){return r===t&&o||r}function R(t,e){return(B(t)?t.changedTouches[0]:t)["page"+C(e?"Y":"X")]}function B(t){return"undefined"!=typeof TouchEvent&&t instanceof TouchEvent}function z(t){c=t}return{mount:function(){g(_,Jg,Tu,nf),g(_,Qg,Tu,nf),g(_,Zg,A,nf),g(_,"click",P,{capture:!0}),g(_,"dragstart",lp),u([Mp,$p],E)},disable:z,isDragging:function(){return a}}},Keyboard:function(t,e,i){var s,r,o=tg(t),n=o.on,a=o.bind,l=o.unbind,c=t.root,h=e.Direction.resolve;function d(){var t=i.keyboard;t&&(s="global"===t?window:c,a(s,cf,g))}function u(){l(s,cf)}function p(){var t=r;r=!0,Su((function(){r=t}))}function g(e){if(!r){var i=lf(e);i===h(sg)?t.go("<"):i===h(rg)&&t.go(">")}}return{mount:function(){d(),n($p,u),n($p,d),n(Pp,p)},destroy:u,disable:function(t){r=t}}},LazyLoad:function(t,e,i){var s=tg(t),r=s.on,o=s.off,n=s.bind,a=s.emit,l="sequential"===i.lazyLoad,c=[Fp,Up],h=[];function d(){xu(h),e.Slides.forEach((function(t){hp(t.slide,uf).forEach((function(e){var s=sp(e,hf),r=sp(e,df);if(s!==e.src||r!==e.srcset){var o=i.classes.spinner,n=e.parentElement,a=Wu(n,"."+o)||Qu("span",o,n);h.push([e,t,a]),e.src||ep(e,"none")}}))})),l?f():(o(c),r(c,u),u())}function u(){(h=h.filter((function(e){var s=i.perPage*((i.preloadPages||1)+1)-1;return!e[1].isWithin(t.index,s)||p(e)}))).length||o(c)}function p(t){var e=t[0];$u(t[1].slide,Xg),n(e,"load error",Cu(g,t)),Ju(e,"src",sp(e,hf)),Ju(e,"srcset",sp(e,df)),Zu(e,hf),Zu(e,df)}function g(t,e){var i=t[0],s=t[1];dp(s.slide,Xg),"error"!==e.type&&(np(t[2]),ep(i,""),a(Kp,i,s),a(Hp)),l&&f()}function f(){h.length&&p(h.shift())}return{mount:function(){i.lazyLoad&&(d(),r(zp,d))},destroy:Cu(xu,h),check:u}},Pagination:function(t,e,i){var s,r,o=tg(t),n=o.on,a=o.emit,l=o.bind,c=e.Slides,h=e.Elements,d=e.Controller,u=d.hasFocus,p=d.getIndex,g=d.go,f=e.Direction.resolve,m=h.pagination,v=[];function b(){s&&(np(m?wu(s.children):s),dp(s,r),xu(v),s=null),o.destroy()}function y(t){g(">"+t,!0)}function _(t,e){var i=v.length,s=lf(e),r=x(),o=-1;s===f(rg,!1,r)?o=++t%i:s===f(sg,!1,r)?o=(--t+i)%i:"Home"===s?o=0:"End"===s&&(o=i-1);var n=v[o];n&&(ip(n.button),g(">"+o),lp(e,!0))}function x(){return i.paginationDirection||i.direction}function w(t){return v[d.toPage(t)]}function C(){var t=w(p(!0)),e=w(p());if(t){var i=t.button;dp(i,Ng),Zu(i,gg),Ju(i,hg,-1)}if(e){var r=e.button;$u(r,Ng),Ju(r,gg,!0),Ju(r,hg,"")}a("pagination:updated",{list:s,items:v},t,e)}return{items:v,mount:function e(){b(),n([$p,zp,Qp],e);var o=i.pagination;m&&ep(m,o?"":"none"),o&&(n([Pp,Vp,Up],C),function(){var e=t.length,o=i.classes,n=i.i18n,a=i.perPage,p=u()?d.getEnd()+1:_p(e/a);$u(s=m||Qu("ul",o.pagination,h.track.parentElement),r=Lg+"--"+x()),Ju(s,cg,"tablist"),Ju(s,fg,n.select),Ju(s,bg,x()===ag?"vertical":"");for(var g=0;g<p;g++){var f=Qu("li",null,s),b=Qu("button",{class:o.page,type:"button"},f),w=c.getIn(g).map((function(t){return t.slide.id})),C=!u()&&a>1?n.pageX:n.slideX;l(b,"click",Cu(y,g)),i.paginationKeyboard&&l(b,"keydown",Cu(_,g)),Ju(f,cg,"presentation"),Ju(b,cg,"tab"),Ju(b,ug,w.join(" ")),Ju(b,fg,kp(C,g+1)),Ju(b,hg,-1),v.push({li:f,button:b,page:g})}}(),C(),a("pagination:mounted",{list:s,items:v},w(t.index)))},destroy:b,getAt:w,update:C}},Sync:function(t,e,i){var s=i.isNavigation,r=i.slideFocus,o=[];function n(){var e,i;t.splides.forEach((function(e){e.isParent||(l(t,e.splide),l(e.splide,t))})),s&&(e=tg(t),(i=e.on)(Ip,h),i(Zp,d),i([Mp,$p],c),o.push(e),e.emit(Gp,t.splides))}function a(){o.forEach((function(t){t.destroy()})),xu(o)}function l(t,e){var i=tg(t);i.on(Pp,(function(t,i,s){e.go(e.is(ef)?s:t)})),o.push(i)}function c(){Ju(e.Elements.list,bg,i.direction===ag?"vertical":"")}function h(e){t.go(e.index)}function d(t,e){Ru(pf,lf(e))&&(h(t),lp(e))}return{setup:Cu(e.Media.set,{slideFocus:Pu(r)?s:r},!0),mount:n,destroy:a,remount:function(){a(),n()}}},Wheel:function(t,e,i){var s=tg(t).bind,r=0;function o(s){if(s.cancelable){var o=s.deltaY,n=o<0,a=up(s),l=i.wheelMinThreshold||0,c=i.wheelSleep||0;xp(o)>l&&a-r>c&&(t.go(n?"<":">"),r=a),function(s){return!i.releaseWheel||t.state.is(4)||-1!==e.Controller.getAdjacent(s)}(n)&&lp(s)}}return{mount:function(){i.wheel&&s(e.Elements.track,"wheel",o,nf)}}},Live:function(t,e,i){var s=tg(t).on,r=e.Elements.track,o=i.live&&!i.isNavigation,n=Qu("span",$g),a=eg(90,Cu(l,!1));function l(t){Ju(r,xg,t),t?(Hu(r,n),a.start()):(np(n),a.cancel())}function c(t){o&&Ju(r,_g,t?"off":"polite")}return{mount:function(){o&&(c(!e.Autoplay.isPaused()),Ju(r,wg,!0),n.textContent="…",s(Yp,Cu(c,!0)),s(qp,Cu(c,!1)),s([Fp,Up],Cu(l,!0)))},disable:c,destroy:function(){Zu(r,[_g,wg,xg]),np(n)}}}}),ff={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:Kg,i18n:{prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function mf(t,e,i){var s=e.Slides;function r(){s.forEach((function(t){t.style("transform","translateX(-"+100*t.index+"%)")}))}return{mount:function(){tg(t).on([Mp,zp],r)},start:function(t,e){s.style("transition","opacity "+i.speed+"ms "+i.easing),Su(e)},cancel:Tu}}function vf(t,e,i){var s,r=e.Move,o=e.Controller,n=e.Scroll,a=e.Elements.list,l=Cu(tp,a,"transition");function c(){l(""),n.cancel()}return{mount:function(){tg(t).bind(a,"transitionend",(function(t){t.target===a&&s&&(c(),s())}))},start:function(e,a){var c=r.toPosition(e,!0),h=r.getPosition(),d=function(e){var s=i.rewindSpeed;if(t.is(tf)&&s){var r=o.getIndex(!0),n=o.getEnd();if(0===r&&e>=n||r>=n&&0===e)return s}return i.speed}(e);xp(c-h)>=1&&d>=1?i.useScroll?n.scroll(c,d,!1,a):(l("transform "+d+"ms "+i.easing),r.translate(c,!0),s=a):(r.jump(e),a())},cancel:c}}var bf=function(){function t(e,i){var s;this.event=tg(),this.Components={},this.state=(s=1,{set:function(t){s=t},is:function(t){return Ru(ju(t),s)}}),this.splides=[],this._o={},this._E={};var r=Du(e)?cp(document,e):e;mp(r,r+" is invalid."),this.root=r,i=qu({label:sp(r,fg)||"",labelledby:sp(r,mg)||""},ff,t.defaults,i||{});try{qu(i,JSON.parse(sp(r,fp)))}catch(o){mp(!1,"Invalid JSON")}this._o=Object.create(qu({},i))}var e=t.prototype;return e.mount=function(t,e){var i=this,s=this.state,r=this.Components;return mp(s.is([1,7]),"Already mounted!"),s.set(1),this._C=r,this._T=e||this._T||(this.is(sf)?mf:vf),this._E=t||this._E,Gu(Yu({},gf,this._E,{Transition:this._T}),(function(t,e){var s=t(i,r,i._o);r[e]=s,s.setup&&s.setup()})),Gu(r,(function(t){t.mount&&t.mount()})),this.emit(Mp),$u(this.root,Hg),s.set(3),this.emit(Dp),this},e.sync=function(t){return this.splides.push({splide:t}),t.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this._C.Sync.remount(),t.Components.Sync.remount()),this},e.go=function(t){return this._C.Controller.go(t),this},e.on=function(t,e){return this.event.on(t,e),this},e.off=function(t){return this.event.off(t),this},e.emit=function(t){var e;return(e=this.event).emit.apply(e,[t].concat(wu(arguments,1))),this},e.add=function(t,e){return this._C.Slides.add(t,e),this},e.remove=function(t){return this._C.Slides.remove(t),this},e.is=function(t){return this._o.type===t},e.refresh=function(){return this.emit(zp),this},e.destroy=function(t){void 0===t&&(t=!0);var e=this.event,i=this.state;return i.is(1)?tg(this).on(Dp,this.destroy.bind(this,t)):(Gu(this._C,(function(e){e.destroy&&e.destroy(t)}),!0),e.emit(Wp),e.destroy(),t&&xu(this.splides),i.set(7)),this},bu(t,[{key:"options",get:function(){return this._o},set:function(t){this._C.Media.set(t,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),t}(),yf=bf;
1869
+ */var _u="(prefers-reduced-motion: reduce)",xu={CREATED:1,MOUNTED:2,IDLE:3,MOVING:4,SCROLLING:5,DRAGGING:6,DESTROYED:7};function wu(t){t.length=0}function Cu(t,e,i){return Array.prototype.slice.call(t,e,i)}function Su(t){return t.bind.apply(t,[null].concat(Cu(arguments,1)))}var Tu=setTimeout,ku=function(){};function Ou(t){return requestAnimationFrame(t)}function Eu(t,e){return typeof e===t}function Au(t){return!Iu(t)&&Eu("object",t)}var Mu=Array.isArray,Du=Su(Eu,"function"),Pu=Su(Eu,"string"),Fu=Su(Eu,"undefined");function Iu(t){return null===t}function ju(t){try{return t instanceof(t.ownerDocument.defaultView||window).HTMLElement}catch(e){return!1}}function Lu(t){return Mu(t)?t:[t]}function Ru(t,e){Lu(t).forEach(e)}function Bu(t,e){return t.indexOf(e)>-1}function zu(t,e){return t.push.apply(t,Lu(e)),t}function $u(t,e,i){t&&Ru(e,(function(e){e&&t.classList[i?"add":"remove"](e)}))}function Hu(t,e){$u(t,Pu(e)?e.split(" "):e,!0)}function Nu(t,e){Ru(e,t.appendChild.bind(t))}function Vu(t,e){Ru(t,(function(t){var i=(e||t).parentNode;i&&i.insertBefore(t,e)}))}function Uu(t,e){return ju(t)&&(t.msMatchesSelector||t.matches).call(t,e)}function Wu(t,e){var i=t?Cu(t.children):[];return e?i.filter((function(t){return Uu(t,e)})):i}function Xu(t,e){return e?Wu(t,e)[0]:t.firstElementChild}var Gu=Object.keys;function Yu(t,e,i){return t&&(i?Gu(t).reverse():Gu(t)).forEach((function(i){"__proto__"!==i&&e(t[i],i)})),t}function qu(t){return Cu(arguments,1).forEach((function(e){Yu(e,(function(i,s){t[s]=e[s]}))})),t}function Ku(t){return Cu(arguments,1).forEach((function(e){Yu(e,(function(e,i){Mu(e)?t[i]=e.slice():Au(e)?t[i]=Ku({},Au(t[i])?t[i]:{},e):t[i]=e}))})),t}function Zu(t,e){Ru(e||Gu(t),(function(e){delete t[e]}))}function Ju(t,e){Ru(t,(function(t){Ru(e,(function(e){t&&t.removeAttribute(e)}))}))}function Qu(t,e,i){Au(e)?Yu(e,(function(e,i){Qu(t,i,e)})):Ru(t,(function(t){Iu(i)||""===i?Ju(t,e):t.setAttribute(e,String(i))}))}function tp(t,e,i){var s=document.createElement(t);return e&&(Pu(e)?Hu(s,e):Qu(s,e)),i&&Nu(i,s),s}function ep(t,e,i){if(Fu(i))return getComputedStyle(t)[e];Iu(i)||(t.style[e]=""+i)}function ip(t,e){ep(t,"display",e)}function sp(t){t.setActive&&t.setActive()||t.focus({preventScroll:!0})}function rp(t,e){return t.getAttribute(e)}function op(t,e){return t&&t.classList.contains(e)}function np(t){return t.getBoundingClientRect()}function ap(t){Ru(t,(function(t){t&&t.parentNode&&t.parentNode.removeChild(t)}))}function lp(t){return Xu((new DOMParser).parseFromString(t,"text/html").body)}function cp(t,e){t.preventDefault(),e&&(t.stopPropagation(),t.stopImmediatePropagation())}function hp(t,e){return t&&t.querySelector(e)}function dp(t,e){return e?Cu(t.querySelectorAll(e)):[]}function up(t,e){$u(t,e,!1)}function pp(t){return t.timeStamp}function gp(t){return Pu(t)?t:t?t+"px":""}var fp="splide",mp="data-"+fp;function vp(t,e){if(!t)throw new Error("["+fp+"] "+(e||""))}var bp=Math.min,yp=Math.max,_p=Math.floor,xp=Math.ceil,wp=Math.abs;function Cp(t,e,i){return wp(t-e)<i}function Sp(t,e,i,s){var r=bp(e,i),o=yp(e,i);return s?r<t&&t<o:r<=t&&t<=o}function Tp(t,e,i){var s=bp(e,i),r=yp(e,i);return bp(yp(s,t),r)}function kp(t){return+(t>0)-+(t<0)}function Op(t,e){return Ru(e,(function(e){t=t.replace("%s",""+e)})),t}function Ep(t){return t<10?"0"+t:""+t}var Ap={};function Mp(){var t=[];function e(t,e,i){Ru(t,(function(t){t&&Ru(e,(function(e){e.split(" ").forEach((function(e){var s=e.split(".");i(t,s[0],s[1])}))}))}))}return{bind:function(i,s,r,o){e(i,s,(function(e,i,s){var n="addEventListener"in e,a=n?e.removeEventListener.bind(e,i,r,o):e.removeListener.bind(e,r);n?e.addEventListener(i,r,o):e.addListener(r),t.push([e,i,s,r,a])}))},unbind:function(i,s,r){e(i,s,(function(e,i,s){t=t.filter((function(t){return!!(t[0]!==e||t[1]!==i||t[2]!==s||r&&t[3]!==r)||(t[4](),!1)}))}))},dispatch:function(t,e,i){var s,r=!0;return"function"==typeof CustomEvent?s=new CustomEvent(e,{bubbles:r,detail:i}):(s=document.createEvent("CustomEvent")).initCustomEvent(e,r,!1,i),t.dispatchEvent(s),s},destroy:function(){t.forEach((function(t){t[4]()})),wu(t)}}}var Dp="mounted",Pp="ready",Fp="move",Ip="moved",jp="click",Lp="active",Rp="inactive",Bp="visible",zp="hidden",$p="refresh",Hp="updated",Np="resize",Vp="resized",Up="scroll",Wp="scrolled",Xp="destroy",Gp="arrows:mounted",Yp="navigation:mounted",qp="autoplay:play",Kp="autoplay:pause",Zp="lazyload:loaded",Jp="sk",Qp="sh",tg="ei";function eg(t){var e=t?t.event.bus:document.createDocumentFragment(),i=Mp();return t&&t.event.on(Xp,i.destroy),qu(i,{bus:e,on:function(t,s){i.bind(e,Lu(t).join(" "),(function(t){s.apply(s,Mu(t.detail)?t.detail:[])}))},off:Su(i.unbind,e),emit:function(t){i.dispatch(e,t,Cu(arguments,1))}})}function ig(t,e,i,s){var r,o,n=Date.now,a=0,l=!0,c=0;function h(){if(!l){if(a=t?bp((n()-r)/t,1):1,i&&i(a),a>=1&&(e(),r=n(),s&&++c>=s))return d();o=Ou(h)}}function d(){l=!0}function u(){o&&cancelAnimationFrame(o),a=0,o=0,l=!0}return{start:function(e){e||u(),r=n()-(e?a*t:0),l=!1,o=Ou(h)},rewind:function(){r=n(),a=0,i&&i(a)},pause:d,cancel:u,set:function(e){t=e},isPaused:function(){return l}}}var sg="Arrow",rg=sg+"Left",og=sg+"Right",ng=sg+"Up",ag=sg+"Down",lg="ttb",cg={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[ng,og],ArrowRight:[ag,rg]};var hg="role",dg="tabindex",ug="aria-",pg=ug+"controls",gg=ug+"current",fg=ug+"selected",mg=ug+"label",vg=ug+"labelledby",bg=ug+"hidden",yg=ug+"orientation",_g=ug+"roledescription",xg=ug+"live",wg=ug+"busy",Cg=ug+"atomic",Sg=[hg,dg,"disabled",pg,gg,mg,vg,bg,yg,_g],Tg=fp+"__",kg="is-",Og=fp,Eg=Tg+"track",Ag=Tg+"list",Mg=Tg+"slide",Dg=Mg+"--clone",Pg=Mg+"__container",Fg=Tg+"arrows",Ig=Tg+"arrow",jg=Ig+"--prev",Lg=Ig+"--next",Rg=Tg+"pagination",Bg=Rg+"__page",zg=Tg+"progress"+"__bar",$g=Tg+"toggle",Hg=Tg+"sr",Ng=kg+"initialized",Vg=kg+"active",Ug=kg+"prev",Wg=kg+"next",Xg=kg+"visible",Gg=kg+"loading",Yg=kg+"focus-in",qg=kg+"overflow",Kg=[Vg,Xg,Ug,Wg,Gg,Yg,qg],Zg={slide:Mg,clone:Dg,arrows:Fg,arrow:Ig,prev:jg,next:Lg,pagination:Rg,page:Bg,spinner:Tg+"spinner"};var Jg="touchstart mousedown",Qg="touchmove mousemove",tf="touchend touchcancel mouseup click";var ef="slide",sf="loop",rf="fade";function of(t,e,i,s){var r,o=eg(t),n=o.on,a=o.emit,l=o.bind,c=t.Components,h=t.root,d=t.options,u=d.isNavigation,p=d.updateOnMove,g=d.i18n,f=d.pagination,m=d.slideFocus,v=c.Direction.resolve,b=rp(s,"style"),y=rp(s,mg),_=i>-1,x=Xu(s,"."+Pg);function w(){var r=t.splides.map((function(t){var i=t.splide.Components.Slides.getAt(e);return i?i.slide.id:""})).join(" ");Qu(s,mg,Op(g.slideX,(_?i:e)+1)),Qu(s,pg,r),Qu(s,hg,m?"button":""),m&&Ju(s,_g)}function C(){r||S()}function S(){if(!r){var i=t.index;(o=T())!==op(s,Vg)&&($u(s,Vg,o),Qu(s,gg,u&&o||""),a(o?Lp:Rp,k)),function(){var e=function(){if(t.is(rf))return T();var e=np(c.Elements.track),i=np(s),r=v("left",!0),o=v("right",!0);return _p(e[r])<=xp(i[r])&&_p(i[o])<=xp(e[o])}(),i=!e&&(!T()||_);t.state.is([4,5])||Qu(s,bg,i||"");Qu(dp(s,d.focusableNodes||""),dg,i?-1:""),m&&Qu(s,dg,i?-1:0);e!==op(s,Xg)&&($u(s,Xg,e),a(e?Bp:zp,k));if(!e&&document.activeElement===s){var r=c.Slides.getAt(t.index);r&&sp(r.slide)}}(),$u(s,Ug,e===i-1),$u(s,Wg,e===i+1)}var o}function T(){var s=t.index;return s===e||d.cloneStatus&&s===i}var k={index:e,slideIndex:i,slide:s,container:x,isClone:_,mount:function(){_||(s.id=h.id+"-slide"+Ep(e+1),Qu(s,hg,f?"tabpanel":"group"),Qu(s,_g,g.slide),Qu(s,mg,y||Op(g.slideLabel,[e+1,t.length]))),l(s,"click",Su(a,jp,k)),l(s,"keydown",Su(a,Jp,k)),n([Ip,Qp,Wp],S),n(Yp,w),p&&n(Fp,C)},destroy:function(){r=!0,o.destroy(),up(s,Kg),Ju(s,Sg),Qu(s,"style",b),Qu(s,mg,y||"")},update:S,style:function(t,e,i){ep(i&&x||s,t,e)},isWithin:function(i,s){var r=wp(i-e);return _||!d.rewind&&!t.is(sf)||(r=bp(r,t.length-r)),r<=s}};return k}var nf=mp+"-interval";var af={passive:!1,capture:!0};var lf={Spacebar:" ",Right:og,Left:rg,Up:ng,Down:ag};function cf(t){return t=Pu(t)?t:t.key,lf[t]||t}var hf="keydown";var df=mp+"-lazy",uf=df+"-srcset",pf="["+df+"], ["+uf+"]";var gf=[" ","Enter"];var ff=Object.freeze({__proto__:null,Media:function(t,e,i){var s=t.state,r=i.breakpoints||{},o=i.reducedMotion||{},n=Mp(),a=[];function l(t){t&&n.destroy()}function c(t,e){var i=matchMedia(e);n.bind(i,"change",h),a.push([t,i])}function h(){var e=s.is(7),r=i.direction,o=a.reduce((function(t,e){return Ku(t,e[1].matches?e[0]:{})}),{});Zu(i),d(o),i.destroy?t.destroy("completely"===i.destroy):e?(l(!0),t.mount()):r!==i.direction&&t.refresh()}function d(e,r,o){Ku(i,e),r&&Ku(Object.getPrototypeOf(i),e),!o&&s.is(1)||t.emit(Hp,i)}return{setup:function(){var t="min"===i.mediaQuery;Gu(r).sort((function(e,i){return t?+e-+i:+i-+e})).forEach((function(e){c(r[e],"("+(t?"min":"max")+"-width:"+e+"px)")})),c(o,_u),h()},destroy:l,reduce:function(t){matchMedia(_u).matches&&(t?Ku(i,o):Zu(i,Gu(o)))},set:d}},Direction:function(t,e,i){return{resolve:function(t,e,s){var r="rtl"!==(s=s||i.direction)||e?s===lg?0:-1:1;return cg[t]&&cg[t][r]||t.replace(/width|left|right/i,(function(t,e){var i=cg[t.toLowerCase()][r]||t;return e>0?i.charAt(0).toUpperCase()+i.slice(1):i}))},orient:function(t){return t*("rtl"===i.direction?1:-1)}}},Elements:function(t,e,i){var s,r,o,n=eg(t),a=n.on,l=n.bind,c=t.root,h=i.i18n,d={},u=[],p=[],g=[];function f(){s=b("."+Eg),r=Xu(s,"."+Ag),vp(s&&r,"A track/list element is missing."),zu(u,Wu(r,"."+Mg+":not(."+Dg+")")),Yu({arrows:Fg,pagination:Rg,prev:jg,next:Lg,bar:zg,toggle:$g},(function(t,e){d[e]=b("."+t)})),qu(d,{root:c,track:s,list:r,slides:u}),function(){var t=c.id||(o=fp,""+o+Ep(Ap[o]=(Ap[o]||0)+1)),e=i.role;var o;c.id=t,s.id=s.id||t+"-track",r.id=r.id||t+"-list",!rp(c,hg)&&"SECTION"!==c.tagName&&e&&Qu(c,hg,e);Qu(c,_g,h.carousel),Qu(r,hg,"presentation")}(),v()}function m(t){var e=Sg.concat("style");wu(u),up(c,p),up(s,g),Ju([s,r],e),Ju(c,t?e:["style",_g])}function v(){up(c,p),up(s,g),p=y(Og),g=y(Eg),Hu(c,p),Hu(s,g),Qu(c,mg,i.label),Qu(c,vg,i.labelledby)}function b(t){var e=hp(c,t);return e&&function(t,e){if(Du(t.closest))return t.closest(e);for(var i=t;i&&1===i.nodeType&&!Uu(i,e);)i=i.parentElement;return i}(e,"."+Og)===c?e:void 0}function y(t){return[t+"--"+i.type,t+"--"+i.direction,i.drag&&t+"--draggable",i.isNavigation&&t+"--nav",t===Og&&Vg]}return qu(d,{setup:f,mount:function(){a($p,m),a($p,f),a(Hp,v),l(document,Jg+" keydown",(function(t){o="keydown"===t.type}),{capture:!0}),l(c,"focusin",(function(){$u(c,Yg,!!o)}))},destroy:m})},Slides:function(t,e,i){var s=eg(t),r=s.on,o=s.emit,n=s.bind,a=e.Elements,l=a.slides,c=a.list,h=[];function d(){l.forEach((function(t,e){p(t,e,-1)}))}function u(){f((function(t){t.destroy()})),wu(h)}function p(e,i,s){var r=of(t,i,s,e);r.mount(),h.push(r),h.sort((function(t,e){return t.index-e.index}))}function g(t){return t?m((function(t){return!t.isClone})):h}function f(t,e){g(e).forEach(t)}function m(t){return h.filter(Du(t)?t:function(e){return Pu(t)?Uu(e.slide,t):Bu(Lu(t),e.index)})}return{mount:function(){d(),r($p,u),r($p,d)},destroy:u,update:function(){f((function(t){t.update()}))},register:p,get:g,getIn:function(t){var s=e.Controller,r=s.toIndex(t),o=s.hasFocus()?1:i.perPage;return m((function(t){return Sp(t.index,r,r+o-1)}))},getAt:function(t){return m(t)[0]},add:function(t,e){Ru(t,(function(t){if(Pu(t)&&(t=lp(t)),ju(t)){var s=l[e];s?Vu(t,s):Nu(c,t),Hu(t,i.classes.slide),r=t,a=Su(o,Np),h=dp(r,"img"),(d=h.length)?h.forEach((function(t){n(t,"load error",(function(){--d||a()}))})):a()}var r,a,h,d})),o($p)},remove:function(t){ap(m(t).map((function(t){return t.slide}))),o($p)},forEach:f,filter:m,style:function(t,e,i){f((function(s){s.style(t,e,i)}))},getLength:function(t){return t?l.length:h.length},isEnough:function(){return h.length>i.perPage}}},Layout:function(t,e,i){var s,r,o,n=eg(t),a=n.on,l=n.bind,c=n.emit,h=e.Slides,d=e.Direction.resolve,u=e.Elements,p=u.root,g=u.track,f=u.list,m=h.getAt,v=h.style;function b(){s=i.direction===lg,ep(p,"maxWidth",gp(i.width)),ep(g,d("paddingLeft"),_(!1)),ep(g,d("paddingRight"),_(!0)),y(!0)}function y(t){var e=np(p);(t||r.width!==e.width||r.height!==e.height)&&(ep(g,"height",function(){var t="";s&&(vp(t=x(),"height or heightRatio is missing."),t="calc("+t+" - "+_(!1)+" - "+_(!0)+")");return t}()),v(d("marginRight"),gp(i.gap)),v("width",i.autoWidth?null:gp(i.fixedWidth)||(s?"":w())),v("height",gp(i.fixedHeight)||(s?i.autoHeight?null:w():x()),!0),r=e,c(Vp),o!==(o=E())&&($u(p,qg,o),c("overflow",o)))}function _(t){var e=i.padding,s=d(t?"right":"left");return e&&gp(e[s]||(Au(e)?0:e))||"0px"}function x(){return gp(i.height||np(f).width*i.heightRatio)}function w(){var t=gp(i.gap);return"calc((100%"+(t&&" + "+t)+")/"+(i.perPage||1)+(t&&" - "+t)+")"}function C(){return np(f)[d("width")]}function S(t,e){var i=m(t||0);return i?np(i.slide)[d("width")]+(e?0:O()):0}function T(t,e){var i=m(t);if(i){var s=np(i.slide)[d("right")],r=np(f)[d("left")];return wp(s-r)+(e?0:O())}return 0}function k(e){return T(t.length-1)-T(0)+S(0,e)}function O(){var t=m(0);return t&&parseFloat(ep(t.slide,d("marginRight")))||0}function E(){return t.is(rf)||k(!0)>C()}return{mount:function(){var t,e;b(),l(window,"resize load",(t=Su(c,Np),e=ig(0,t,null,1),function(){e.isPaused()&&e.start()})),a([Hp,$p],b),a(Np,y)},resize:y,listSize:C,slideSize:S,sliderSize:k,totalSize:T,getPadding:function(t){return parseFloat(ep(g,d("padding"+(t?"Right":"Left"))))||0},isOverflow:E}},Clones:function(t,e,i){var s,r=eg(t),o=r.on,n=e.Elements,a=e.Slides,l=e.Direction.resolve,c=[];function h(){o($p,d),o([Hp,Np],p),(s=g())&&(!function(e){var s=a.get().slice(),r=s.length;if(r){for(;s.length<e;)zu(s,s);zu(s.slice(-e),s.slice(0,e)).forEach((function(o,l){var h=l<e,d=function(e,s){var r=e.cloneNode(!0);return Hu(r,i.classes.clone),r.id=t.root.id+"-clone"+Ep(s+1),r}(o.slide,l);h?Vu(d,s[0].slide):Nu(n.list,d),zu(c,d),a.register(d,l-e+(h?0:r),o.index)}))}}(s),e.Layout.resize(!0))}function d(){u(),h()}function u(){ap(c),wu(c),r.destroy()}function p(){var t=g();s!==t&&(s<t||!t)&&r.emit($p)}function g(){var s=i.clones;if(t.is(sf)){if(Fu(s)){var r=i[l("fixedWidth")]&&e.Layout.slideSize(0);s=r&&xp(np(n.track)[l("width")]/r)||i[l("autoWidth")]&&t.length||2*i.perPage}}else s=0;return s}return{mount:h,destroy:u}},Move:function(t,e,i){var s,r=eg(t),o=r.on,n=r.emit,a=t.state.set,l=e.Layout,c=l.slideSize,h=l.getPadding,d=l.totalSize,u=l.listSize,p=l.sliderSize,g=e.Direction,f=g.resolve,m=g.orient,v=e.Elements,b=v.list,y=v.track;function _(){e.Controller.isBusy()||(e.Scroll.cancel(),x(t.index),e.Slides.update())}function x(t){w(k(t,!0))}function w(i,s){if(!t.is(rf)){var r=s?i:function(i){if(t.is(sf)){var s=T(i),r=s>e.Controller.getEnd();(s<0||r)&&(i=C(i,r))}return i}(i);ep(b,"transform","translate"+f("X")+"("+r+"px)"),i!==r&&n(Qp)}}function C(t,e){var i=t-E(e),s=p();return t-=m(s*(xp(wp(i)/s)||1))*(e?1:-1)}function S(){w(O(),!0),s.cancel()}function T(t){for(var i=e.Slides.get(),s=0,r=1/0,o=0;o<i.length;o++){var n=i[o].index,a=wp(k(n,!0)-t);if(!(a<=r))break;r=a,s=n}return s}function k(e,s){var r=m(d(e-1)-function(t){var e=i.focus;return"center"===e?(u()-c(t,!0))/2:+e*c(t)||0}(e));return s?function(e){i.trimSpace&&t.is(ef)&&(e=Tp(e,0,m(p(!0)-u())));return e}(r):r}function O(){var t=f("left");return np(b)[t]-np(y)[t]+m(h(!1))}function E(t){return k(t?e.Controller.getEnd():0,!!i.trimSpace)}return{mount:function(){s=e.Transition,o([Dp,Vp,Hp,$p],_)},move:function(t,e,i,r){var o,l;t!==e&&(o=t>i,l=m(C(O(),o)),o?l>=0:l<=b[f("scrollWidth")]-np(y)[f("width")])&&(S(),w(C(O(),t>i),!0)),a(4),n(Fp,e,i,t),s.start(e,(function(){a(3),n(Ip,e,i,t),r&&r()}))},jump:x,translate:w,shift:C,cancel:S,toIndex:T,toPosition:k,getPosition:O,getLimit:E,exceededLimit:function(t,e){e=Fu(e)?O():e;var i=!0!==t&&m(e)<m(E(!1)),s=!1!==t&&m(e)>m(E(!0));return i||s},reposition:_}},Controller:function(t,e,i){var s,r,o,n,a=eg(t),l=a.on,c=a.emit,h=e.Move,d=h.getPosition,u=h.getLimit,p=h.toPosition,g=e.Slides,f=g.isEnough,m=g.getLength,v=i.omitEnd,b=t.is(sf),y=t.is(ef),_=Su(k,!1),x=Su(k,!0),w=i.start||0,C=w;function S(){r=m(!0),o=i.perMove,n=i.perPage,s=A();var t=Tp(w,0,v?s:r-1);t!==w&&(w=t,h.reposition())}function T(){s!==A()&&c(tg)}function k(t,e){var i=o||(F()?1:n),r=O(w+i*(t?-1:1),w,!(o||F()));return-1===r&&y&&!Cp(d(),u(!t),1)?t?0:s:e?r:E(r)}function O(e,a,l){if(f()||F()){var c=function(e){if(y&&"move"===i.trimSpace&&e!==w)for(var s=d();s===p(e,!0)&&Sp(e,0,t.length-1,!i.rewind);)e<w?--e:++e;return e}(e);c!==e&&(a=e,e=c,l=!1),e<0||e>s?e=o||!Sp(0,e,a,!0)&&!Sp(s,a,e,!0)?b?l?e<0?-(r%n||n):r:e:i.rewind?e<0?s:0:-1:M(D(e)):l&&e!==a&&(e=M(D(a)+(e<a?-1:1)))}else e=-1;return e}function E(t){return b?(t+r)%r||0:t}function A(){for(var t=r-(F()||b&&o?1:n);v&&t-- >0;)if(p(r-1,!0)!==p(t,!0)){t++;break}return Tp(t,0,r-1)}function M(t){return Tp(F()?t:n*t,0,s)}function D(t){return F()?bp(t,s):_p((t>=s?r-1:t)/n)}function P(t){t!==w&&(C=w,w=t)}function F(){return!Fu(i.focus)||i.isNavigation}function I(){return t.state.is([4,5])&&!!i.waitForTransition}return{mount:function(){S(),l([Hp,$p,tg],S),l(Vp,T)},go:function(t,e,i){if(!I()){var r=function(t){var e=w;if(Pu(t)){var i=t.match(/([+\-<>])(\d+)?/)||[],r=i[1],o=i[2];"+"===r||"-"===r?e=O(w+ +(""+r+(+o||1)),w):">"===r?e=o?M(+o):_(!0):"<"===r&&(e=x(!0))}else e=b?t:Tp(t,0,s);return e}(t),o=E(r);o>-1&&(e||o!==w)&&(P(o),h.move(r,o,C,i))}},scroll:function(t,i,r,o){e.Scroll.scroll(t,i,r,(function(){var t=E(h.toIndex(d()));P(v?bp(t,s):t),o&&o()}))},getNext:_,getPrev:x,getAdjacent:k,getEnd:A,setIndex:P,getIndex:function(t){return t?C:w},toIndex:M,toPage:D,toDest:function(t){var e=h.toIndex(t);return y?Tp(e,0,s):e},hasFocus:F,isBusy:I}},Arrows:function(t,e,i){var s,r,o=eg(t),n=o.on,a=o.bind,l=o.emit,c=i.classes,h=i.i18n,d=e.Elements,u=e.Controller,p=d.arrows,g=d.track,f=p,m=d.prev,v=d.next,b={};function y(){!function(){var t=i.arrows;!t||m&&v||(f=p||tp("div",c.arrows),m=C(!0),v=C(!1),s=!0,Nu(f,[m,v]),!p&&Vu(f,g));m&&v&&(qu(b,{prev:m,next:v}),ip(f,t?"":"none"),Hu(f,r=Fg+"--"+i.direction),t&&(n([Dp,Ip,$p,Wp,tg],S),a(v,"click",Su(w,">")),a(m,"click",Su(w,"<")),S(),Qu([m,v],pg,g.id),l(Gp,m,v)))}(),n(Hp,_)}function _(){x(),y()}function x(){o.destroy(),up(f,r),s?(ap(p?[m,v]:f),m=v=null):Ju([m,v],Sg)}function w(t){u.go(t,!0)}function C(t){return lp('<button class="'+c.arrow+" "+(t?c.prev:c.next)+'" type="button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" width="40" height="40" focusable="false"><path d="'+(i.arrowPath||"m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z")+'" />')}function S(){if(m&&v){var e=t.index,i=u.getPrev(),s=u.getNext(),r=i>-1&&e<i?h.last:h.prev,o=s>-1&&e>s?h.first:h.next;m.disabled=i<0,v.disabled=s<0,Qu(m,mg,r),Qu(v,mg,o),l("arrows:updated",m,v,i,s)}}return{arrows:b,mount:y,destroy:x,update:S}},Autoplay:function(t,e,i){var s,r,o=eg(t),n=o.on,a=o.bind,l=o.emit,c=ig(i.interval,t.go.bind(t,">"),(function(t){var e=d.bar;e&&ep(e,"width",100*t+"%"),l("autoplay:playing",t)})),h=c.isPaused,d=e.Elements,u=e.Elements,p=u.root,g=u.toggle,f=i.autoplay,m="pause"===f;function v(){h()&&e.Slides.isEnough()&&(c.start(!i.resetProgress),r=s=m=!1,_(),l(qp))}function b(t){void 0===t&&(t=!0),m=!!t,_(),h()||(c.pause(),l(Kp))}function y(){m||(s||r?b(!1):v())}function _(){g&&($u(g,Vg,!m),Qu(g,mg,i.i18n[m?"play":"pause"]))}function x(t){var s=e.Slides.getAt(t);c.set(s&&+rp(s.slide,nf)||i.interval)}return{mount:function(){f&&(!function(){i.pauseOnHover&&a(p,"mouseenter mouseleave",(function(t){s="mouseenter"===t.type,y()}));i.pauseOnFocus&&a(p,"focusin focusout",(function(t){r="focusin"===t.type,y()}));g&&a(g,"click",(function(){m?v():b(!0)}));n([Fp,Up,$p],c.rewind),n(Fp,x)}(),g&&Qu(g,pg,d.track.id),m||v(),_())},destroy:c.cancel,play:v,pause:b,isPaused:h}},Cover:function(t,e,i){var s=eg(t).on;function r(t){e.Slides.forEach((function(e){var i=Xu(e.container||e.slide,"img");i&&i.src&&o(t,i,e)}))}function o(t,e,i){i.style("background",t?'center/cover no-repeat url("'+e.src+'")':"",!0),ip(e,t?"none":"")}return{mount:function(){i.cover&&(s(Zp,Su(o,!0)),s([Dp,Hp,$p],Su(r,!0)))},destroy:Su(r,!1)}},Scroll:function(t,e,i){var s,r,o=eg(t),n=o.on,a=o.emit,l=t.state.set,c=e.Move,h=c.getPosition,d=c.getLimit,u=c.exceededLimit,p=c.translate,g=t.is(ef),f=1;function m(t,i,o,n,d){var p=h();if(y(),o&&(!g||!u())){var m=e.Layout.sliderSize(),_=kp(t)*m*_p(wp(t)/m)||0;t=c.toPosition(e.Controller.toDest(t%m))+_}var x=Cp(p,t,1);f=1,i=x?0:i||yp(wp(t-p)/1.5,800),r=n,s=ig(i,v,Su(b,p,t,d),1),l(5),a(Up),s.start()}function v(){l(3),r&&r(),a(Wp)}function b(t,e,s,o){var n=h(),a=t+(e-t)*function(t){var e=i.easingFunc;return e?e(t):1-Math.pow(1-t,4)}(o),l=(a-n)*f;p(n+l),g&&!s&&u()&&(f*=.6,wp(l)<10&&m(d(u(!0)),600,!1,r,!0))}function y(){s&&s.cancel()}function _(){s&&!s.isPaused()&&(y(),v())}return{mount:function(){n(Fp,y),n([Hp,$p],_)},destroy:y,scroll:m,cancel:_}},Drag:function(t,e,i){var s,r,o,n,a,l,c,h,d=eg(t),u=d.on,p=d.emit,g=d.bind,f=d.unbind,m=t.state,v=e.Move,b=e.Scroll,y=e.Controller,_=e.Elements.track,x=e.Media.reduce,w=e.Direction,C=w.resolve,S=w.orient,T=v.getPosition,k=v.exceededLimit,O=!1;function E(){var t=i.drag;z(!t),n="free"===t}function A(t){if(l=!1,!c){var e=B(t);s=t.target,r=i.noDrag,Uu(s,"."+Bg+", ."+Ig)||r&&Uu(s,r)||!e&&t.button||(y.isBusy()?cp(t,!0):(h=e?_:window,a=m.is([4,5]),o=null,g(h,Qg,M,af),g(h,tf,D,af),v.cancel(),b.cancel(),F(t)))}var s,r}function M(e){if(m.is(6)||(m.set(6),p("drag")),e.cancelable)if(a){v.translate(s+I(e)/(O&&t.is(ef)?5:1));var r=j(e)>200,o=O!==(O=k());(r||o)&&F(e),l=!0,p("dragging"),cp(e)}else(function(t){return wp(I(t))>wp(I(t,!0))})(e)&&(a=function(t){var e=i.dragMinThreshold,s=Au(e),r=s&&e.mouse||0,o=(s?e.touch:+e)||10;return wp(I(t))>(B(t)?o:r)}(e),cp(e))}function D(s){m.is(6)&&(m.set(3),p("dragged")),a&&(!function(s){var r=function(e){if(t.is(sf)||!O){var i=j(e);if(i&&i<200)return I(e)/i}return 0}(s),o=function(t){return T()+kp(t)*bp(wp(t)*(i.flickPower||600),n?1/0:e.Layout.listSize()*(i.flickMaxPages||1))}(r),a=i.rewind&&i.rewindByDrag;x(!1),n?y.scroll(o,0,i.snap):t.is(rf)?y.go(S(kp(r))<0?a?"<":"-":a?">":"+"):t.is(ef)&&O&&a?y.go(k(!0)?">":"<"):y.go(y.toDest(o),!0);x(!0)}(s),cp(s)),f(h,Qg,M),f(h,tf,D),a=!1}function P(t){!c&&l&&cp(t,!0)}function F(t){o=r,r=t,s=T()}function I(t,e){return R(t,e)-R(L(t),e)}function j(t){return pp(t)-pp(L(t))}function L(t){return r===t&&o||r}function R(t,e){return(B(t)?t.changedTouches[0]:t)["page"+C(e?"Y":"X")]}function B(t){return"undefined"!=typeof TouchEvent&&t instanceof TouchEvent}function z(t){c=t}return{mount:function(){g(_,Qg,ku,af),g(_,tf,ku,af),g(_,Jg,A,af),g(_,"click",P,{capture:!0}),g(_,"dragstart",cp),u([Dp,Hp],E)},disable:z,isDragging:function(){return a}}},Keyboard:function(t,e,i){var s,r,o=eg(t),n=o.on,a=o.bind,l=o.unbind,c=t.root,h=e.Direction.resolve;function d(){var t=i.keyboard;t&&(s="global"===t?window:c,a(s,hf,g))}function u(){l(s,hf)}function p(){var t=r;r=!0,Tu((function(){r=t}))}function g(e){if(!r){var i=cf(e);i===h(rg)?t.go("<"):i===h(og)&&t.go(">")}}return{mount:function(){d(),n(Hp,u),n(Hp,d),n(Fp,p)},destroy:u,disable:function(t){r=t}}},LazyLoad:function(t,e,i){var s=eg(t),r=s.on,o=s.off,n=s.bind,a=s.emit,l="sequential"===i.lazyLoad,c=[Ip,Wp],h=[];function d(){wu(h),e.Slides.forEach((function(t){dp(t.slide,pf).forEach((function(e){var s=rp(e,df),r=rp(e,uf);if(s!==e.src||r!==e.srcset){var o=i.classes.spinner,n=e.parentElement,a=Xu(n,"."+o)||tp("span",o,n);h.push([e,t,a]),e.src||ip(e,"none")}}))})),l?f():(o(c),r(c,u),u())}function u(){(h=h.filter((function(e){var s=i.perPage*((i.preloadPages||1)+1)-1;return!e[1].isWithin(t.index,s)||p(e)}))).length||o(c)}function p(t){var e=t[0];Hu(t[1].slide,Gg),n(e,"load error",Su(g,t)),Qu(e,"src",rp(e,df)),Qu(e,"srcset",rp(e,uf)),Ju(e,df),Ju(e,uf)}function g(t,e){var i=t[0],s=t[1];up(s.slide,Gg),"error"!==e.type&&(ap(t[2]),ip(i,""),a(Zp,i,s),a(Np)),l&&f()}function f(){h.length&&p(h.shift())}return{mount:function(){i.lazyLoad&&(d(),r($p,d))},destroy:Su(wu,h),check:u}},Pagination:function(t,e,i){var s,r,o=eg(t),n=o.on,a=o.emit,l=o.bind,c=e.Slides,h=e.Elements,d=e.Controller,u=d.hasFocus,p=d.getIndex,g=d.go,f=e.Direction.resolve,m=h.pagination,v=[];function b(){s&&(ap(m?Cu(s.children):s),up(s,r),wu(v),s=null),o.destroy()}function y(t){g(">"+t,!0)}function _(t,e){var i=v.length,s=cf(e),r=x(),o=-1;s===f(og,!1,r)?o=++t%i:s===f(rg,!1,r)?o=(--t+i)%i:"Home"===s?o=0:"End"===s&&(o=i-1);var n=v[o];n&&(sp(n.button),g(">"+o),cp(e,!0))}function x(){return i.paginationDirection||i.direction}function w(t){return v[d.toPage(t)]}function C(){var t=w(p(!0)),e=w(p());if(t){var i=t.button;up(i,Vg),Ju(i,fg),Qu(i,dg,-1)}if(e){var r=e.button;Hu(r,Vg),Qu(r,fg,!0),Qu(r,dg,"")}a("pagination:updated",{list:s,items:v},t,e)}return{items:v,mount:function e(){b(),n([Hp,$p,tg],e);var o=i.pagination;m&&ip(m,o?"":"none"),o&&(n([Fp,Up,Wp],C),function(){var e=t.length,o=i.classes,n=i.i18n,a=i.perPage,p=u()?d.getEnd()+1:xp(e/a);Hu(s=m||tp("ul",o.pagination,h.track.parentElement),r=Rg+"--"+x()),Qu(s,hg,"tablist"),Qu(s,mg,n.select),Qu(s,yg,x()===lg?"vertical":"");for(var g=0;g<p;g++){var f=tp("li",null,s),b=tp("button",{class:o.page,type:"button"},f),w=c.getIn(g).map((function(t){return t.slide.id})),C=!u()&&a>1?n.pageX:n.slideX;l(b,"click",Su(y,g)),i.paginationKeyboard&&l(b,"keydown",Su(_,g)),Qu(f,hg,"presentation"),Qu(b,hg,"tab"),Qu(b,pg,w.join(" ")),Qu(b,mg,Op(C,g+1)),Qu(b,dg,-1),v.push({li:f,button:b,page:g})}}(),C(),a("pagination:mounted",{list:s,items:v},w(t.index)))},destroy:b,getAt:w,update:C}},Sync:function(t,e,i){var s=i.isNavigation,r=i.slideFocus,o=[];function n(){var e,i;t.splides.forEach((function(e){e.isParent||(l(t,e.splide),l(e.splide,t))})),s&&(e=eg(t),(i=e.on)(jp,h),i(Jp,d),i([Dp,Hp],c),o.push(e),e.emit(Yp,t.splides))}function a(){o.forEach((function(t){t.destroy()})),wu(o)}function l(t,e){var i=eg(t);i.on(Fp,(function(t,i,s){e.go(e.is(sf)?s:t)})),o.push(i)}function c(){Qu(e.Elements.list,yg,i.direction===lg?"vertical":"")}function h(e){t.go(e.index)}function d(t,e){Bu(gf,cf(e))&&(h(t),cp(e))}return{setup:Su(e.Media.set,{slideFocus:Fu(r)?s:r},!0),mount:n,destroy:a,remount:function(){a(),n()}}},Wheel:function(t,e,i){var s=eg(t).bind,r=0;function o(s){if(s.cancelable){var o=s.deltaY,n=o<0,a=pp(s),l=i.wheelMinThreshold||0,c=i.wheelSleep||0;wp(o)>l&&a-r>c&&(t.go(n?"<":">"),r=a),function(s){return!i.releaseWheel||t.state.is(4)||-1!==e.Controller.getAdjacent(s)}(n)&&cp(s)}}return{mount:function(){i.wheel&&s(e.Elements.track,"wheel",o,af)}}},Live:function(t,e,i){var s=eg(t).on,r=e.Elements.track,o=i.live&&!i.isNavigation,n=tp("span",Hg),a=ig(90,Su(l,!1));function l(t){Qu(r,wg,t),t?(Nu(r,n),a.start()):(ap(n),a.cancel())}function c(t){o&&Qu(r,xg,t?"off":"polite")}return{mount:function(){o&&(c(!e.Autoplay.isPaused()),Qu(r,Cg,!0),n.textContent="…",s(qp,Su(c,!0)),s(Kp,Su(c,!1)),s([Ip,Wp],Su(l,!0)))},disable:c,destroy:function(){Ju(r,[xg,Cg,wg]),ap(n)}}}}),mf={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:!0,arrows:!0,pagination:!0,paginationKeyboard:!0,interval:5e3,pauseOnHover:!0,pauseOnFocus:!0,resetProgress:!0,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:!0,direction:"ltr",trimSpace:!0,focusableNodes:"a, button, textarea, input, select, iframe",live:!0,classes:Zg,i18n:{prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"},reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function vf(t,e,i){var s=e.Slides;function r(){s.forEach((function(t){t.style("transform","translateX(-"+100*t.index+"%)")}))}return{mount:function(){eg(t).on([Dp,$p],r)},start:function(t,e){s.style("transition","opacity "+i.speed+"ms "+i.easing),Tu(e)},cancel:ku}}function bf(t,e,i){var s,r=e.Move,o=e.Controller,n=e.Scroll,a=e.Elements.list,l=Su(ep,a,"transition");function c(){l(""),n.cancel()}return{mount:function(){eg(t).bind(a,"transitionend",(function(t){t.target===a&&s&&(c(),s())}))},start:function(e,a){var c=r.toPosition(e,!0),h=r.getPosition(),d=function(e){var s=i.rewindSpeed;if(t.is(ef)&&s){var r=o.getIndex(!0),n=o.getEnd();if(0===r&&e>=n||r>=n&&0===e)return s}return i.speed}(e);wp(c-h)>=1&&d>=1?i.useScroll?n.scroll(c,d,!1,a):(l("transform "+d+"ms "+i.easing),r.translate(c,!0),s=a):(r.jump(e),a())},cancel:c}}var yf=function(){function t(e,i){var s;this.event=eg(),this.Components={},this.state=(s=1,{set:function(t){s=t},is:function(t){return Bu(Lu(t),s)}}),this.splides=[],this._o={},this._E={};var r=Pu(e)?hp(document,e):e;vp(r,r+" is invalid."),this.root=r,i=Ku({label:rp(r,mg)||"",labelledby:rp(r,vg)||""},mf,t.defaults,i||{});try{Ku(i,JSON.parse(rp(r,mp)))}catch(o){vp(!1,"Invalid JSON")}this._o=Object.create(Ku({},i))}var e=t.prototype;return e.mount=function(t,e){var i=this,s=this.state,r=this.Components;return vp(s.is([1,7]),"Already mounted!"),s.set(1),this._C=r,this._T=e||this._T||(this.is(rf)?vf:bf),this._E=t||this._E,Yu(qu({},ff,this._E,{Transition:this._T}),(function(t,e){var s=t(i,r,i._o);r[e]=s,s.setup&&s.setup()})),Yu(r,(function(t){t.mount&&t.mount()})),this.emit(Dp),Hu(this.root,Ng),s.set(3),this.emit(Pp),this},e.sync=function(t){return this.splides.push({splide:t}),t.splides.push({splide:this,isParent:!0}),this.state.is(3)&&(this._C.Sync.remount(),t.Components.Sync.remount()),this},e.go=function(t){return this._C.Controller.go(t),this},e.on=function(t,e){return this.event.on(t,e),this},e.off=function(t){return this.event.off(t),this},e.emit=function(t){var e;return(e=this.event).emit.apply(e,[t].concat(Cu(arguments,1))),this},e.add=function(t,e){return this._C.Slides.add(t,e),this},e.remove=function(t){return this._C.Slides.remove(t),this},e.is=function(t){return this._o.type===t},e.refresh=function(){return this.emit($p),this},e.destroy=function(t){void 0===t&&(t=!0);var e=this.event,i=this.state;return i.is(1)?eg(this).on(Pp,this.destroy.bind(this,t)):(Yu(this._C,(function(e){e.destroy&&e.destroy(t)}),!0),e.emit(Xp),e.destroy(),t&&wu(this.splides),i.set(7)),this},yu(t,[{key:"options",get:function(){return this._o},set:function(t){this._C.Media.set(t,!0,!0)}},{key:"length",get:function(){return this._C.Slides.getLength(!0)}},{key:"index",get:function(){return this._C.Controller.getIndex()}}]),t}(),_f=yf;
1867
1870
  /**
1868
1871
  * @license
1869
1872
  * Copyright 2021 Google LLC
1870
1873
  * SPDX-License-Identifier: BSD-3-Clause
1871
1874
  */
1872
- function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defaults={},yf.STATES=_u;var xf=Object.defineProperty,wf=Object.getOwnPropertyDescriptor,Cf=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?wf(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&xf(e,i,o),o};let Sf=class extends Kh{constructor(){super(...arguments),this.slides=[],this.cards=[],this.firstUpdated=()=>{this.imageSplide=new yf(this.imageCarousel,{perPage:2,perMove:1,autoHeight:!0,gap:"0.6%",rewind:!1,pagination:!1,isNavigation:!1,mediaQuery:"min",breakpoints:{640:{perPage:4,gap:"1rem"}}}),this.imageSplide.on("arrows:mounted arrows:updated",(()=>{this.updateArrowVisibility()})),this.imageSplide.mount()},this.disconnectedCallback=()=>{var t;super.disconnectedCallback(),null==(t=this.imageSplide)||t.destroy()},this.clickHandler=t=>{const e=t.target;this.emit("pbo-category-card-selected",{detail:{cardId:e.dataset.cardId}})}}updateArrowVisibility(){const t=this.imageCarousel.querySelector(".splide__arrow--next"),e=this.imageCarousel.querySelector(".splide__arrow--prev");t.style.visibility=t.disabled?"hidden":"visible",e.style.visibility=e.disabled?"hidden":"visible"}render(){return U`
1875
+ function*xf(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}_f.defaults={},_f.STATES=xu;var wf=Object.defineProperty,Cf=Object.getOwnPropertyDescriptor,Sf=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Cf(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&wf(e,i,o),o};let Tf=class extends Kh{constructor(){super(...arguments),this.slides=[],this.cards=[],this.firstUpdated=()=>{this.imageSplide=new _f(this.imageCarousel,{perPage:2,perMove:1,autoHeight:!0,gap:"0.6%",rewind:!1,pagination:!1,isNavigation:!1,mediaQuery:"min",breakpoints:{640:{perPage:4,gap:"1rem"}}}),this.imageSplide.on("arrows:mounted arrows:updated",(()=>{this.updateArrowVisibility()})),this.imageSplide.mount()},this.disconnectedCallback=()=>{var t;super.disconnectedCallback(),null==(t=this.imageSplide)||t.destroy()},this.clickHandler=t=>{const e=t.target;this.emit("pbo-category-card-selected",{detail:{cardId:e.dataset.cardId}})}}updateArrowVisibility(){const t=this.imageCarousel.querySelector(".splide__arrow--next"),e=this.imageCarousel.querySelector(".splide__arrow--prev");t.style.visibility=t.disabled?"hidden":"visible",e.style.visibility=e.disabled?"hidden":"visible"}render(){return U`
1873
1876
  <div class="category-container">
1874
1877
  <slot name="title"></slot>
1875
1878
  <div
@@ -1879,13 +1882,13 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
1879
1882
  >
1880
1883
  <div class="splide__track">
1881
1884
  <ul class="splide__list">
1882
- ${_f(this.cards,(t=>U`
1885
+ ${xf(this.cards,(t=>U`
1883
1886
  <li class="splide__slide">
1884
1887
  <img
1885
1888
  src=${t.medias.cover.url}
1886
1889
  alt="${t.medias.cover.alt}"
1887
1890
  @click=${this.clickHandler}
1888
- data-card-id="${t.id}"
1891
+ data-card-id="${t.pboId}"
1889
1892
  />
1890
1893
  </li>
1891
1894
  `))}
@@ -1893,7 +1896,7 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
1893
1896
  </div>
1894
1897
  </div>
1895
1898
  </div>
1896
- `}};Sf.styles=[sl,vu,a(su)],Cf([vt("#category-carousel")],Sf.prototype,"imageCarousel",2),Cf([ft()],Sf.prototype,"imageSplide",2),Cf([ft()],Sf.prototype,"slides",2),Cf([gt({type:Array,converter:{fromAttribute(t){try{return JSON.parse(t||"[]")}catch(e){return console.error("Invalid JSON for 'cards':",t),[]}},toAttribute:t=>JSON.stringify(t)}})],Sf.prototype,"cards",2),Sf=Cf([dt("pbo-category")],Sf);const Tf=Sf,kf=l`
1899
+ `}};Tf.styles=[sl,bu,a(nu)],Sf([vt("#category-carousel")],Tf.prototype,"imageCarousel",2),Sf([ft()],Tf.prototype,"imageSplide",2),Sf([ft()],Tf.prototype,"slides",2),Sf([gt({type:Array,converter:{fromAttribute(t){try{return JSON.parse(t||"[]")}catch(e){return console.error("Invalid JSON for 'cards':",t),[]}},toAttribute:t=>JSON.stringify(t)}})],Tf.prototype,"cards",2),Tf=Sf([dt("pbo-category")],Tf);const kf=Tf,Of=l`
1897
1900
  :host {
1898
1901
  --size: 70%;
1899
1902
  --header-spacing: var(--pbo-spacing-large);
@@ -1978,7 +1981,7 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
1978
1981
  width: 100%;
1979
1982
  height: var(--size);
1980
1983
  }
1981
- `;var Of=Object.defineProperty,Ef=Object.getOwnPropertyDescriptor,Af=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Ef(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Of(e,i,o),o};let Mf=class extends Kh{constructor(){super(...arguments),this.open=!1,this.placement="bottom",this.radius=!0,this.contained=!1}requestClose(t){this.hide()}async hide(){this.open=!1,this.emit("pbo-after-drawer-closed")}async show(){this.open||(this.open=!0)}handleOpenChange(){this.open?this.drawer.hidden=!1:this.drawer.hidden=!0}firstUpdated(){this.drawer.hidden=!this.open}render(){return U`
1984
+ `;var Ef=Object.defineProperty,Af=Object.getOwnPropertyDescriptor,Mf=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Af(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Ef(e,i,o),o};let Df=class extends Kh{constructor(){super(...arguments),this.open=!1,this.placement="bottom",this.radius=!0,this.contained=!1}requestClose(t){this.hide()}async hide(){this.open=!1,this.emit("pbo-after-drawer-closed")}async show(){this.open||(this.open=!0)}handleOpenChange(){this.open?this.drawer.hidden=!1:this.drawer.hidden=!0}firstUpdated(){this.drawer.hidden=!this.open}render(){return U`
1982
1985
  <div
1983
1986
  part="base"
1984
1987
  class=${zh({drawer:!0,"drawer--bottom":"bottom"===this.placement,"drawer--top":"top"===this.placement,"drawer--left":"left"===this.placement,"drawer--right":"right"===this.placement,"drawer--open":this.open,"drawer--contained":this.contained})}
@@ -1995,7 +1998,7 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
1995
1998
  <slot part="body" class="drawer__body"></slot>
1996
1999
  </div>
1997
2000
  </div>
1998
- `}};Mf.styles=[sl,kf],Af([vt(".drawer")],Mf.prototype,"drawer",2),Af([gt({type:Boolean,reflect:!0})],Mf.prototype,"open",2),Af([gt({reflect:!0})],Mf.prototype,"placement",2),Af([gt({type:Boolean,reflect:!0})],Mf.prototype,"radius",2),Af([gt({type:Boolean,reflect:!0})],Mf.prototype,"contained",2),Af([il("open",{waitUntilFirstUpdate:!0})],Mf.prototype,"handleOpenChange",1),Mf=Af([dt("pbo-drawer")],Mf);const Df=Mf,Pf=l`
2001
+ `}};Df.styles=[sl,Of],Mf([vt(".drawer")],Df.prototype,"drawer",2),Mf([gt({type:Boolean,reflect:!0})],Df.prototype,"open",2),Mf([gt({reflect:!0})],Df.prototype,"placement",2),Mf([gt({type:Boolean,reflect:!0})],Df.prototype,"radius",2),Mf([gt({type:Boolean,reflect:!0})],Df.prototype,"contained",2),Mf([il("open",{waitUntilFirstUpdate:!0})],Df.prototype,"handleOpenChange",1),Df=Mf([dt("pbo-drawer")],Df);const Pf=Df,Ff=l`
1999
2002
  :host {
2000
2003
  display: block;
2001
2004
  width: 100%;
@@ -2097,7 +2100,7 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
2097
2100
  grid-column: 4 / span 7;
2098
2101
  }
2099
2102
  }
2100
- `;var Ff=Object.defineProperty,If=Object.getOwnPropertyDescriptor,jf=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?If(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Ff(e,i,o),o};let Lf=class extends Kh{constructor(){super(...arguments),this.onClose=()=>{},this.currentPage="selection",this.selectedCard=null,this.categories=[],this.selectedCardId=null,this.selectedCardDetails=null,this.handleCardSelected=t=>{const{cardId:e}=t.detail,i=this.findCardInCategoryById(e);console.log(t),this.editorEl.card=i,this.goToEditor()}}goToEditor(){this.currentPage="editor"}goToSelector(){this.currentPage="selection"}connectedCallback(){var t;super.connectedCallback(),null==(t=this.shadowRoot)||t.addEventListener("pbo-category-card-selected",this.handleCardSelected)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.shadowRoot)||t.removeEventListener("pbo-category-card-selected",this.handleCardSelected)}firstUpdated(){this.cardSelectionEl.categories=this.categories}handleCategoriesUpdate(){console.log(this.categories),this.cardSelectionEl&&void 0!==this.categories&&this.categories.length>0&&(this.cardSelectionEl.categories=this.categories,this.requestUpdate())}findCardInCategoryById(t){console.log("Categories from findCardInCategoryById",this.categories);for(const e of this.categories){const i=e.cards.find((e=>e.id===t));if(console.log("card from findCardInCategoryById",i),i)return i}return null}render(){return U`
2103
+ `;var If=Object.defineProperty,jf=Object.getOwnPropertyDescriptor,Lf=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?jf(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&If(e,i,o),o};let Rf=class extends Kh{constructor(){super(...arguments),this.onClose=()=>{},this.currentPage="selection",this.categories=[],this.selectedCard=null,this.selectedCardId=null,this.selectedCardDetails=null,this.handleCardSelected=t=>{const{cardId:e}=t.detail,i=this.findCardInCategoryById(e);console.log(t),this.editorEl.card=i,this.goToEditor()}}handleSubmitTypeFormUpdate(){this.editorEl.submitTypeForm=this.submitTypeForm}handleSubmitHandwrittenFormUpdate(){this.editorEl.submitHandwrittenForm=this.submitHandwrittenForm}handleGetProcessedImgUpdate(){this.editorEl.getProcessedImg=this.getProcessedImg}goToEditor(){this.currentPage="editor"}goToSelector(){this.currentPage="selection"}connectedCallback(){var t;super.connectedCallback(),null==(t=this.shadowRoot)||t.addEventListener("pbo-category-card-selected",this.handleCardSelected)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this.shadowRoot)||t.removeEventListener("pbo-category-card-selected",this.handleCardSelected)}firstUpdated(){this.cardSelectionEl.categories=this.categories}handleCategoriesUpdate(){console.log(this.categories),this.cardSelectionEl&&void 0!==this.categories&&this.categories.length>0&&(this.cardSelectionEl.categories=this.categories,this.requestUpdate())}findCardInCategoryById(t){console.log("Categories from findCardInCategoryById",this.categories);for(const e of this.categories){const i=e.cards.find((e=>e.pboId===t));if(console.log("card from findCardInCategoryById",i),i)return i}return null}render(){return U`
2101
2104
  <div part="base" class="page-manager">
2102
2105
  <div class="header">
2103
2106
  <div class="back-button">
@@ -2139,15 +2142,15 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
2139
2142
  </div>
2140
2143
  </div>
2141
2144
  </div>
2142
- `}};Lf.styles=[sl,Pf],jf([vt("pbo-card-selection")],Lf.prototype,"cardSelectionEl",2),jf([vt("pbo-editor")],Lf.prototype,"editorEl",2),jf([gt({type:Function})],Lf.prototype,"onClose",2),jf([gt({type:String,reflect:!0})],Lf.prototype,"currentPage",2),jf([ft()],Lf.prototype,"selectedCard",2),jf([gt()],Lf.prototype,"categories",2),jf([ft()],Lf.prototype,"selectedCardId",2),jf([ft()],Lf.prototype,"selectedCardDetails",2),jf([il("categories")],Lf.prototype,"handleCategoriesUpdate",1),Lf=jf([dt("pbo-page-manager")],Lf);const Rf=Lf,Bf=l`
2145
+ `}};Rf.styles=[sl,Ff],Lf([vt("pbo-card-selection")],Rf.prototype,"cardSelectionEl",2),Lf([vt("pbo-editor")],Rf.prototype,"editorEl",2),Lf([gt({type:Function})],Rf.prototype,"onClose",2),Lf([gt({type:String,reflect:!0})],Rf.prototype,"currentPage",2),Lf([gt()],Rf.prototype,"categories",2),Lf([gt()],Rf.prototype,"submitTypeForm",2),Lf([gt()],Rf.prototype,"submitHandwrittenForm",2),Lf([gt()],Rf.prototype,"getProcessedImg",2),Lf([ft()],Rf.prototype,"selectedCard",2),Lf([ft()],Rf.prototype,"selectedCardId",2),Lf([ft()],Rf.prototype,"selectedCardDetails",2),Lf([il("submitTypeForm")],Rf.prototype,"handleSubmitTypeFormUpdate",1),Lf([il("submitHandwrittenForm")],Rf.prototype,"handleSubmitHandwrittenFormUpdate",1),Lf([il("getProcessedImg")],Rf.prototype,"handleGetProcessedImgUpdate",1),Lf([il("categories")],Rf.prototype,"handleCategoriesUpdate",1),Rf=Lf([dt("pbo-page-manager")],Rf);const Bf=Rf,zf=l`
2143
2146
  :host {
2144
2147
  display: block;
2145
2148
  }
2146
- `;var zf=Object.defineProperty,$f=Object.getOwnPropertyDescriptor,Hf=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?$f(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&zf(e,i,o),o};let Nf=class extends Kh{constructor(){super(...arguments),this.categories=[]}render(){return U`
2147
- ${_f(this.categories,(t=>U`<pbo-category .cards=${t.cards} .name=${t.name}>
2149
+ `;var $f=Object.defineProperty,Hf=Object.getOwnPropertyDescriptor,Nf=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Hf(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&$f(e,i,o),o};let Vf=class extends Kh{constructor(){super(...arguments),this.categories=[]}render(){return U`
2150
+ ${xf(this.categories,(t=>U`<pbo-category .cards=${t.cards} .name=${t.name}>
2148
2151
  <h3 slot="title">${t.name}</h3>
2149
2152
  </pbo-category>`))}
2150
- `}};Nf.styles=[sl,Bf],Hf([gt({type:Array})],Nf.prototype,"categories",2),Nf=Hf([dt("pbo-card-selection")],Nf);const Vf=Nf,Uf=l`
2153
+ `}};Vf.styles=[sl,zf],Nf([gt({type:Array})],Vf.prototype,"categories",2),Vf=Nf([dt("pbo-card-selection")],Vf);const Uf=Vf,Wf=l`
2151
2154
  :host {
2152
2155
  display: block;
2153
2156
  width: 100%;
@@ -2175,7 +2178,7 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
2175
2178
  display: block;
2176
2179
  object-fit: contain;
2177
2180
  }
2178
- `;var Wf=Object.defineProperty,Xf=Object.getOwnPropertyDescriptor,Gf=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Xf(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Wf(e,i,o),o};let Yf=class extends Kh{constructor(){super(...arguments),this.backgroundImageUrl=void 0,this.message="",this.font="Arial",this.color="#000",this.alignment="left",this.backgroundImage=void 0,this.backgroundFabImg=void 0,this.rect=void 0,this.textBox=void 0,this.areaPosition={left:0,top:0},this.areaSize={width:0,height:0}}handleAlignmentChange(t,e){t!==e&&this.textBox&&(this.textBox.set("textAlign",e),this.canvas.renderAll())}handleColorChange(t,e){t!==e&&this.textBox&&(this.textBox.set("fill",e),this.canvas.renderAll())}handleFontChange(t,e){t!==e&&this.textBox&&(this.textBox.set("fontFamily",e),this.canvas.renderAll())}handleMessageChange(t,e){if(this.textBox){this.textBox.set("text",e);const t=this.textBox.textLines;t.length>12&&this.textBox.set("text",t.slice(0,12).join("\n")),this.updateTextAreaPosition(),this.canvas.renderAll()}}async handleBackgroundImageUrlChange(){this.canvas&&(this.backgroundFabImg&&this.canvas.remove(this.backgroundFabImg),await this.appendBackgroundImageToCanvas(this.backgroundImageUrl||"https://cdn.shopify.com/s/files/1/1956/2323/files/insert_86e8bcd5-3e82-4910-b350-485fa6958502.png?v=1726598821"),this.updateTextAreaPosition(),this.canvas.renderAll())}updateTextAreaPosition(){this.areaPosition={left:.084*this.canvas.getWidth(),top:.4874*this.canvas.getHeight()},this.areaSize={width:.832*this.canvas.getWidth(),height:this.canvas.getHeight()-this.areaPosition.top-this.areaPosition.left},this.rect?(this.rect.set("left",this.areaPosition.left),this.rect.set("top",this.areaPosition.top),this.rect.set("width",this.areaSize.width),this.rect.set("height",this.areaSize.height)):(this.rect=new so({left:this.areaPosition.left,top:this.areaPosition.top,width:this.areaSize.width,height:this.areaSize.height,selectable:!1,fill:"rgba(255, 255, 255, 0)"}),this.canvas.add(this.rect)),this.textBox?(this.textBox.set("left",this.areaPosition.left),this.textBox.set("top",this.areaPosition.top),this.textBox.set("width",this.areaSize.width),this.textBox.set("height",this.areaSize.height),this.textBox.set("lineHeight",1.1),this.textBox.set("fontSize",this.areaSize.height/13/1.1)):(this.textBox=new ha(this.message,{left:this.areaPosition.left,top:this.areaPosition.top,width:this.areaSize.width,height:this.areaSize.height,lineHeight:1.1,fontSize:this.areaSize.height/13/1.1,alignment:"left",selectable:!1,objectCaching:!1,paintFirst:"stroke",strokeWidth:.5}),this.canvas.add(this.textBox))}async firstUpdated(){this.canvas=new Jo(this.baseCanvas,{width:500,height:500,containerClass:"fabric-container",selection:!1}),this.backgroundImageUrl&&await this.appendBackgroundImageToCanvas(this.backgroundImageUrl,(()=>{})),this.updateTextAreaPosition(),this.canvas.renderAll()}async appendBackgroundImageToCanvas(t,e){const i=await xa.fromURL(t);i.selectable=!1,this.backgroundFabImg=i,this.canvas.setDimensions({width:i.width,height:i.height}),this.canvas.add(i),this.canvas.sendObjectToBack(i),await this.canvas.renderAll(),e&&e()}render(){return U`<canvas class="base-canvas"></canvas> `}};Yf.styles=[sl,Uf],Gf([gt({attribute:"background-url"})],Yf.prototype,"backgroundImageUrl",2),Gf([gt()],Yf.prototype,"message",2),Gf([gt()],Yf.prototype,"font",2),Gf([gt()],Yf.prototype,"color",2),Gf([gt()],Yf.prototype,"alignment",2),Gf([vt(".base-canvas")],Yf.prototype,"baseCanvas",2),Gf([ft()],Yf.prototype,"canvas",2),Gf([ft()],Yf.prototype,"backgroundImage",2),Gf([ft()],Yf.prototype,"backgroundFabImg",2),Gf([ft()],Yf.prototype,"rect",2),Gf([ft()],Yf.prototype,"textBox",2),Gf([ft()],Yf.prototype,"areaPosition",2),Gf([ft()],Yf.prototype,"areaSize",2),Gf([il("alignment")],Yf.prototype,"handleAlignmentChange",1),Gf([il("color")],Yf.prototype,"handleColorChange",1),Gf([il("font")],Yf.prototype,"handleFontChange",1),Gf([il("message")],Yf.prototype,"handleMessageChange",1),Gf([il("backgroundImageUrl")],Yf.prototype,"handleBackgroundImageUrlChange",1),Yf=Gf([dt("pbo-type-canvas")],Yf);const qf=Yf,Kf=l`
2181
+ `;var Xf=Object.defineProperty,Gf=Object.getOwnPropertyDescriptor,Yf=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Gf(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Xf(e,i,o),o};let qf=class extends Kh{constructor(){super(...arguments),this.backgroundImageUrl=void 0,this.message="",this.font="Arial",this.color="#000",this.alignment="left",this.backgroundImage=void 0,this.backgroundFabImg=void 0,this.rect=void 0,this.textBox=void 0,this.areaPosition={left:0,top:0},this.areaSize={width:0,height:0}}handleAlignmentChange(t,e){t!==e&&this.textBox&&(this.textBox.set("textAlign",e),this.canvas.renderAll())}handleColorChange(t,e){t!==e&&this.textBox&&(this.textBox.set("fill",e),this.canvas.renderAll())}handleFontChange(t,e){t!==e&&this.textBox&&(this.textBox.set("fontFamily",e),this.canvas.renderAll())}handleMessageChange(t,e){if(this.textBox){this.textBox.set("text",e);const t=this.textBox.textLines;t.length>12&&this.textBox.set("text",t.slice(0,12).join("\n")),this.updateTextAreaPosition(),this.canvas.renderAll()}}async handleBackgroundImageUrlChange(){this.canvas&&(this.backgroundFabImg&&this.canvas.remove(this.backgroundFabImg),await this.appendBackgroundImageToCanvas(this.backgroundImageUrl||"https://cdn.shopify.com/s/files/1/1956/2323/files/insert_86e8bcd5-3e82-4910-b350-485fa6958502.png?v=1726598821"),this.updateTextAreaPosition(),this.canvas.renderAll())}updateTextAreaPosition(){this.areaPosition={left:.084*this.canvas.getWidth(),top:.4874*this.canvas.getHeight()},this.areaSize={width:.832*this.canvas.getWidth(),height:this.canvas.getHeight()-this.areaPosition.top-this.areaPosition.left},this.rect?(this.rect.set("left",this.areaPosition.left),this.rect.set("top",this.areaPosition.top),this.rect.set("width",this.areaSize.width),this.rect.set("height",this.areaSize.height)):(this.rect=new so({left:this.areaPosition.left,top:this.areaPosition.top,width:this.areaSize.width,height:this.areaSize.height,selectable:!1,fill:"rgba(255, 255, 255, 0)"}),this.canvas.add(this.rect)),this.textBox?(this.textBox.set("left",this.areaPosition.left),this.textBox.set("top",this.areaPosition.top),this.textBox.set("width",this.areaSize.width),this.textBox.set("height",this.areaSize.height),this.textBox.set("lineHeight",1.1),this.textBox.set("fontSize",this.areaSize.height/13/1.1)):(this.textBox=new ha(this.message,{left:this.areaPosition.left,top:this.areaPosition.top,width:this.areaSize.width,height:this.areaSize.height,lineHeight:1.1,fontSize:this.areaSize.height/13/1.1,alignment:"left",selectable:!1,objectCaching:!1,paintFirst:"stroke",strokeWidth:.5}),this.canvas.add(this.textBox))}async firstUpdated(){this.canvas=new Jo(this.baseCanvas,{width:500,height:500,containerClass:"fabric-container",selection:!1}),this.backgroundImageUrl&&await this.appendBackgroundImageToCanvas(this.backgroundImageUrl,(()=>{})),this.updateTextAreaPosition(),this.canvas.renderAll()}async appendBackgroundImageToCanvas(t,e){const i=await xa.fromURL(t);i.selectable=!1,this.backgroundFabImg=i,this.canvas.setDimensions({width:i.width,height:i.height}),this.canvas.add(i),this.canvas.sendObjectToBack(i),await this.canvas.renderAll(),e&&e()}render(){return U`<canvas class="base-canvas"></canvas> `}};qf.styles=[sl,Wf],Yf([gt({attribute:"background-url"})],qf.prototype,"backgroundImageUrl",2),Yf([gt()],qf.prototype,"message",2),Yf([gt()],qf.prototype,"font",2),Yf([gt()],qf.prototype,"color",2),Yf([gt()],qf.prototype,"alignment",2),Yf([vt(".base-canvas")],qf.prototype,"baseCanvas",2),Yf([ft()],qf.prototype,"canvas",2),Yf([ft()],qf.prototype,"backgroundImage",2),Yf([ft()],qf.prototype,"backgroundFabImg",2),Yf([ft()],qf.prototype,"rect",2),Yf([ft()],qf.prototype,"textBox",2),Yf([ft()],qf.prototype,"areaPosition",2),Yf([ft()],qf.prototype,"areaSize",2),Yf([il("alignment")],qf.prototype,"handleAlignmentChange",1),Yf([il("color")],qf.prototype,"handleColorChange",1),Yf([il("font")],qf.prototype,"handleFontChange",1),Yf([il("message")],qf.prototype,"handleMessageChange",1),Yf([il("backgroundImageUrl")],qf.prototype,"handleBackgroundImageUrlChange",1),qf=Yf([dt("pbo-type-canvas")],qf);const Kf=qf,Zf=l`
2179
2182
  :host {
2180
2183
  display: block;
2181
2184
  height: 100%;
@@ -2216,7 +2219,7 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
2216
2219
  fill: #fff9f9;
2217
2220
  scale: 1.1;
2218
2221
  }
2219
- `;var Zf=Object.defineProperty,Jf=Object.getOwnPropertyDescriptor,Qf=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Jf(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Zf(e,i,o),o};let tm=class extends Kh{constructor(){super(...arguments),this.formData={font:"Monsieur La Doulaise",text:"",color:"rgb(0,0,0)",alignment:"left"},this.cardUrl="",this.handwrittenPreviewProps={isLoading:!1,url:""}}render(){return U`
2222
+ `;var Jf=Object.defineProperty,Qf=Object.getOwnPropertyDescriptor,tm=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Qf(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&Jf(e,i,o),o};let em=class extends Kh{constructor(){super(...arguments),this.formData={font:"Monsieur La Doulaise",text:"",color:"rgb(0,0,0)",alignment:"left"},this.cardUrl="",this.handwrittenPreviewProps={isLoading:!1,url:""}}render(){return U`
2220
2223
  <div class="panel">
2221
2224
  <div class="zoomed-preview">
2222
2225
  <div
@@ -2234,7 +2237,7 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
2234
2237
  </svg>
2235
2238
  </div>
2236
2239
  </div>
2237
- `}};tm.styles=[sl,Kf],Qf([gt()],tm.prototype,"formData",2),Qf([gt()],tm.prototype,"cardUrl",2),Qf([gt()],tm.prototype,"close",2),Qf([gt()],tm.prototype,"handwrittenPreviewProps",2),tm=Qf([dt("pbo-zoomed-preview")],tm);const em=tm,im=l`
2240
+ `}};em.styles=[sl,Zf],tm([gt()],em.prototype,"formData",2),tm([gt()],em.prototype,"cardUrl",2),tm([gt()],em.prototype,"close",2),tm([gt()],em.prototype,"handwrittenPreviewProps",2),em=tm([dt("pbo-zoomed-preview")],em);const im=em,sm=l`
2238
2241
  :host {
2239
2242
  display: block;
2240
2243
  }
@@ -2253,7 +2256,7 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
2253
2256
  .choice-wrapper {
2254
2257
  display: inline-flex;
2255
2258
  }
2256
- `;var sm=Object.defineProperty,rm=Object.getOwnPropertyDescriptor,om=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?rm(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&sm(e,i,o),o};let nm=class extends Kh{constructor(){super(...arguments),this.hasSlotController=new Fh(this,"help-text","label"),this.size="medium",this.label=""}get value(){var t;return null==(t=this._choices)?void 0:t.getValue().value}firstUpdated(){this._initializeChoices()}_initializeChoices(){var t;null==(t=this._choices)||t.destroy(),this._choices=new Dh(this.choiceEl,{allowHTML:!0,searchEnabled:!1,shouldSort:!1,removeItemButton:!1,shadowRoot:this.shadowRoot,choices:[{value:"type",label:' \n <div class="choice-wrapper">\n <span class="label">Type message\n <svg\n stroke="currentColor"\n fill="none"\n stroke-width="0"\n viewBox="0 0 24 24"\n height="1.6em"\n width="1.6em"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path d="M6.5 3H3V6.5H4V4H6.5V3Z" fill="currentColor"></path>\n <path d="M8.5 4V3H11V4H8.5Z" fill="currentColor"></path>\n <path d="M13 4H15.5V3H13V4Z" fill="currentColor"></path>\n <path d="M17.5 3V4H20V6.5H21V3H17.5Z" fill="currentColor"></path>\n <path d="M21 8.5H20V11H21V8.5Z" fill="currentColor"></path>\n <path d="M21 13H20V15.5H21V13Z" fill="currentColor"></path>\n <path d="M21 17.5H20V20H17.5V21H21V17.5Z" fill="currentColor"></path>\n <path d="M15.5 21V20H13V21H15.5Z" fill="currentColor"></path>\n <path d="M11 21V20H8.5V21H11Z" fill="currentColor"></path>\n <path d="M6.5 21V20H4V17.5H3V21H6.5Z" fill="currentColor"></path>\n <path d="M3 15.5H4V13H3V15.5Z" fill="currentColor"></path>\n <path d="M3 11H4V8.5H3V11Z" fill="currentColor"></path>\n <path d="M11 9.5H7V7.5H17V9.5H13V16.5H11V9.5Z" fill="currentColor"></path>\n </svg>\n </span>'},{value:"handwritten",label:' \n <div class="choice-wrapper">\n <span class="label">Upload handwritten message\n <svg\n stroke="currentColor"\n fill="none"\n stroke-width="0"\n viewBox="0 0 24 24"\n height="1.6em"\n width="1.6em"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M21.2635 2.29289C20.873 1.90237 20.2398 1.90237 19.8493 2.29289L18.9769 3.16525C17.8618 2.63254 16.4857 2.82801 15.5621 3.75165L4.95549 14.3582L10.6123 20.0151L21.2189 9.4085C22.1426 8.48486 22.338 7.1088 21.8053 5.99367L22.6777 5.12132C23.0682 4.7308 23.0682 4.09763 22.6777 3.70711L21.2635 2.29289ZM16.9955 10.8035L10.6123 17.1867L7.78392 14.3582L14.1671 7.9751L16.9955 10.8035ZM18.8138 8.98525L19.8047 7.99429C20.1953 7.60376 20.1953 6.9706 19.8047 6.58007L18.3905 5.16586C18 4.77534 17.3668 4.77534 16.9763 5.16586L15.9853 6.15683L18.8138 8.98525Z"\n fill="currentColor"\n ></path>\n <path d="M2 22.9502L4.12171 15.1717L9.77817 20.8289L2 22.9502Z" fill="currentColor"></path>\n </svg>\n <svg\n stroke="currentColor"\n fill="currentColor"\n stroke-width="0"\n viewBox="0 0 512 512"\n height="1.6em"\n width="1.6em"\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle cx="256" cy="275" r="57.5"></circle>\n <path\n d="M417.5 160H363c-4.6 0-8.9-2-12-5.4-28.4-31.8-39.1-42.6-50.7-42.6h-85.5c-11.7 0-23.2 10.8-51.7 42.7-3 3.4-7.4 5.3-11.9 5.3h-4.1v-8c0-4.4-3.6-8-8-8h-26c-4.4 0-8 3.6-8 8v8h-7.5C79.9 160 64 173.2 64 190.7v176c0 17.5 15.9 33.3 33.5 33.3h320c17.6 0 30.5-15.8 30.5-33.3v-176c0-17.5-12.9-30.7-30.5-30.7zM260 360.4c-50.3 2.3-91.7-39.1-89.4-89.4 2-43.9 37.5-79.4 81.4-81.4 50.3-2.3 91.7 39.1 89.4 89.4-2 43.9-37.5 79.4-81.4 81.4zM352 218c-7.2 0-13-5.8-13-13s5.8-13 13-13 13 5.8 13 13-5.8 13-13 13z"\n ></path>\n </svg>\n <svg\n stroke="currentColor"\n fill="currentColor"\n stroke-width="0"\n viewBox="0 0 512 512"\n height="1.6em"\n width="1.6em"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill="none"\n stroke-linecap="round"\n stroke-linejoin="round"\n stroke-width="32"\n d="M336 192h40a40 40 0 0 1 40 40v192a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V232a40 40 0 0 1 40-40h40m160-64-80-80-80 80m80 193V48"\n ></path>\n </svg>\n </span>'}],placeholder:!1,shouldSortItems:!1,itemSelectText:""}),this.choiceEl.addEventListener("change",(t=>{const e=t.target;this.dispatchEvent(new CustomEvent("pbo-change",{detail:{value:e.value},bubbles:!0,composed:!0}))}))}render(){const t=this.hasSlotController.test("label"),e=!!this.label||!!t;return U` <div
2259
+ `;var rm=Object.defineProperty,om=Object.getOwnPropertyDescriptor,nm=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?om(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&rm(e,i,o),o};let am=class extends Kh{constructor(){super(...arguments),this.hasSlotController=new Fh(this,"help-text","label"),this.size="medium",this.label=""}get value(){var t;return null==(t=this._choices)?void 0:t.getValue().value}firstUpdated(){this._initializeChoices()}_initializeChoices(){var t;null==(t=this._choices)||t.destroy(),this._choices=new Dh(this.choiceEl,{allowHTML:!0,searchEnabled:!1,shouldSort:!1,removeItemButton:!1,shadowRoot:this.shadowRoot,choices:[{value:"type",label:' \n <div class="choice-wrapper">\n <span class="label">Type message\n <svg\n stroke="currentColor"\n fill="none"\n stroke-width="0"\n viewBox="0 0 24 24"\n height="1.6em"\n width="1.6em"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path d="M6.5 3H3V6.5H4V4H6.5V3Z" fill="currentColor"></path>\n <path d="M8.5 4V3H11V4H8.5Z" fill="currentColor"></path>\n <path d="M13 4H15.5V3H13V4Z" fill="currentColor"></path>\n <path d="M17.5 3V4H20V6.5H21V3H17.5Z" fill="currentColor"></path>\n <path d="M21 8.5H20V11H21V8.5Z" fill="currentColor"></path>\n <path d="M21 13H20V15.5H21V13Z" fill="currentColor"></path>\n <path d="M21 17.5H20V20H17.5V21H21V17.5Z" fill="currentColor"></path>\n <path d="M15.5 21V20H13V21H15.5Z" fill="currentColor"></path>\n <path d="M11 21V20H8.5V21H11Z" fill="currentColor"></path>\n <path d="M6.5 21V20H4V17.5H3V21H6.5Z" fill="currentColor"></path>\n <path d="M3 15.5H4V13H3V15.5Z" fill="currentColor"></path>\n <path d="M3 11H4V8.5H3V11Z" fill="currentColor"></path>\n <path d="M11 9.5H7V7.5H17V9.5H13V16.5H11V9.5Z" fill="currentColor"></path>\n </svg>\n </span>'},{value:"handwritten",label:' \n <div class="choice-wrapper">\n <span class="label">Upload handwritten message\n <svg\n stroke="currentColor"\n fill="none"\n stroke-width="0"\n viewBox="0 0 24 24"\n height="1.6em"\n width="1.6em"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill-rule="evenodd"\n clip-rule="evenodd"\n d="M21.2635 2.29289C20.873 1.90237 20.2398 1.90237 19.8493 2.29289L18.9769 3.16525C17.8618 2.63254 16.4857 2.82801 15.5621 3.75165L4.95549 14.3582L10.6123 20.0151L21.2189 9.4085C22.1426 8.48486 22.338 7.1088 21.8053 5.99367L22.6777 5.12132C23.0682 4.7308 23.0682 4.09763 22.6777 3.70711L21.2635 2.29289ZM16.9955 10.8035L10.6123 17.1867L7.78392 14.3582L14.1671 7.9751L16.9955 10.8035ZM18.8138 8.98525L19.8047 7.99429C20.1953 7.60376 20.1953 6.9706 19.8047 6.58007L18.3905 5.16586C18 4.77534 17.3668 4.77534 16.9763 5.16586L15.9853 6.15683L18.8138 8.98525Z"\n fill="currentColor"\n ></path>\n <path d="M2 22.9502L4.12171 15.1717L9.77817 20.8289L2 22.9502Z" fill="currentColor"></path>\n </svg>\n <svg\n stroke="currentColor"\n fill="currentColor"\n stroke-width="0"\n viewBox="0 0 512 512"\n height="1.6em"\n width="1.6em"\n xmlns="http://www.w3.org/2000/svg"\n >\n <circle cx="256" cy="275" r="57.5"></circle>\n <path\n d="M417.5 160H363c-4.6 0-8.9-2-12-5.4-28.4-31.8-39.1-42.6-50.7-42.6h-85.5c-11.7 0-23.2 10.8-51.7 42.7-3 3.4-7.4 5.3-11.9 5.3h-4.1v-8c0-4.4-3.6-8-8-8h-26c-4.4 0-8 3.6-8 8v8h-7.5C79.9 160 64 173.2 64 190.7v176c0 17.5 15.9 33.3 33.5 33.3h320c17.6 0 30.5-15.8 30.5-33.3v-176c0-17.5-12.9-30.7-30.5-30.7zM260 360.4c-50.3 2.3-91.7-39.1-89.4-89.4 2-43.9 37.5-79.4 81.4-81.4 50.3-2.3 91.7 39.1 89.4 89.4-2 43.9-37.5 79.4-81.4 81.4zM352 218c-7.2 0-13-5.8-13-13s5.8-13 13-13 13 5.8 13 13-5.8 13-13 13z"\n ></path>\n </svg>\n <svg\n stroke="currentColor"\n fill="currentColor"\n stroke-width="0"\n viewBox="0 0 512 512"\n height="1.6em"\n width="1.6em"\n xmlns="http://www.w3.org/2000/svg"\n >\n <path\n fill="none"\n stroke-linecap="round"\n stroke-linejoin="round"\n stroke-width="32"\n d="M336 192h40a40 40 0 0 1 40 40v192a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V232a40 40 0 0 1 40-40h40m160-64-80-80-80 80m80 193V48"\n ></path>\n </svg>\n </span>'}],placeholder:!1,shouldSortItems:!1,itemSelectText:""}),this.choiceEl.addEventListener("change",(t=>{const e=t.target;this.dispatchEvent(new CustomEvent("pbo-change",{detail:{value:e.value},bubbles:!0,composed:!0}))}))}render(){const t=this.hasSlotController.test("label"),e=!!this.label||!!t;return U` <div
2257
2260
  class=${zh({"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--radio-group":!0,"form-control--has-label":e})}
2258
2261
  >
2259
2262
  <label
@@ -2265,7 +2268,7 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
2265
2268
  <slot name="label">${this.label}</slot>
2266
2269
  </label>
2267
2270
  </div>
2268
- <select part="base" class="js-choice"></select>`}};nm.styles=[sl,im,$h,a(Ph)],om([gt()],nm.prototype,"size",2),om([gt()],nm.prototype,"label",2),om([vt(".js-choice")],nm.prototype,"choiceEl",2),nm=om([dt("pbo-editor-selector")],nm);const am=nm,lm=l`
2271
+ <select part="base" class="js-choice"></select>`}};am.styles=[sl,sm,$h,a(Ph)],nm([gt()],am.prototype,"size",2),nm([gt()],am.prototype,"label",2),nm([vt(".js-choice")],am.prototype,"choiceEl",2),am=nm([dt("pbo-editor-selector")],am);const lm=am,cm=l`
2269
2272
  :host {
2270
2273
  display: block;
2271
2274
  }
@@ -2302,7 +2305,7 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
2302
2305
  margin-top: var(--pbo-spacing-2x-small);
2303
2306
  font-size: var(--pbo-font-size-medium);
2304
2307
  }
2305
- `;var cm=Object.defineProperty,hm=Object.getOwnPropertyDescriptor,dm=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?hm(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&cm(e,i,o),o};let um=class extends Kh{constructor(){super(...arguments),this.sourceImg=null,this.processedFileUrl=null,this.handwrittenDimensions={top:null,left:null,width:null,height:null,cardHeight:null,cardWidth:null}}showPicker(){this.imageInput.showPicker()}handleSourceImgChange(t,e){this.processedFileUrl=null,t!==e&&this.emit("pbo-change",{detail:{isLoading:!0,processedFileUrl:null}})}handleProcessImageChange(t,e){e&&t!==e&&this.emit("pbo-change",{detail:{isLoading:!1,processedFileUrl:e}})}setDimensions(t){this.handwrittenDimensions=t}get form(){return{isLoading:this.sourceImg&&!this.processedFileUrl,processedFileUrl:this.processedFileUrl}}async handleFileChange(t){var e,i;const s=null==(i=null==(e=t.target)?void 0:e.files)?void 0:i[0];if(null==s)return;this.sourceImg=s;const r=await new Promise((t=>{setTimeout((()=>{t({fileUrl:s?URL.createObjectURL(s):null})}),2e3)}));this.processedFileUrl=r.fileUrl}handleSubmit(t){t.preventDefault(),console.log(t);const e=177.8/this.handwrittenDimensions.cardHeight,i=127/this.handwrittenDimensions.cardWidth;let s={items:[{quantity:1,properties:{_position_x:this.handwrittenDimensions.top*i,_position_y:this.handwrittenDimensions.left*e,_height:this.handwrittenDimensions.height*e,_width:this.handwrittenDimensions.width*i}}]};console.log(s)}render(){return U`
2308
+ `;var hm=Object.defineProperty,dm=Object.getOwnPropertyDescriptor,um=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?dm(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&hm(e,i,o),o};let pm=class extends Kh{constructor(){super(...arguments),this.card=null,this.submitHandwrittenForm=t=>{console.warn("submitHandwrittenForm not implemented",t)},this.getProcessedImg=async t=>(console.warn("getProcessedImg not implemented",t.name),{pred_image_uid:"",masked_img:""}),this.sourceImg=null,this.processedImg={fileUrl:null,imgId:null},this.processedFileUrl=null,this.handwrittenDimensions={top:null,left:null,width:null,height:null,cardHeight:null,cardWidth:null}}showPicker(){this.imageInput.showPicker()}handleSourceImgChange(t,e){this.processedFileUrl=null,t!==e&&this.emit("pbo-change",{detail:{isLoading:!0,processedFileUrl:null}})}handleProcessImageChange(t,e){e&&t!==e&&this.emit("pbo-change",{detail:{isLoading:!1,processedFileUrl:e}})}get formData(){var t,e,i,s;const r=177.8/this.handwrittenDimensions.cardHeight,o=127/this.handwrittenDimensions.cardWidth,n={pboCardId:(null==(t=this.card)?void 0:t.pboId)||"Unknown",productId:null==(e=this.card)?void 0:e.productId,sku:null==(i=this.card)?void 0:i.sku,variantId:null==(s=this.card)?void 0:s.variantId,pred_image_uid:this.processedImg.imgId||"",position_x:this.handwrittenDimensions.top*o,position_y:this.handwrittenDimensions.left*r,height:this.handwrittenDimensions.height*r,width:this.handwrittenDimensions.width*o};return Jd(n)}setDimensions(t){this.handwrittenDimensions=t}get form(){return{isLoading:this.sourceImg&&!this.processedFileUrl,processedFileUrl:this.processedFileUrl}}async handleFileChange(t){var e,i;const s=null==(i=null==(e=t.target)?void 0:e.files)?void 0:i[0];if(null==s)return;this.sourceImg=s;const r=await this.getProcessedImg(s);this.processedFileUrl=`data:image/png;base64,${r.masked_img}`}handleSubmit(t){t.preventDefault(),this.submitHandwrittenForm(this.formData)}render(){return U`
2306
2309
  <form name="handwritten-form" class="handwritten-form" @submit=${this.handleSubmit}>
2307
2310
  <section>
2308
2311
  <h1>Step 1</h1>
@@ -2345,8 +2348,9 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
2345
2348
  variant="primary"
2346
2349
  class="submit-cta"
2347
2350
  style=${wd({display:this.sourceImg&&this.processedFileUrl?"block":"none"})}
2348
- >Save and Continue</pbo-button
2349
2351
  >
2352
+ Save and Continue
2353
+ </pbo-button>
2350
2354
  <pbo-button
2351
2355
  name="reupload"
2352
2356
  variant="text"
@@ -2359,7 +2363,7 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
2359
2363
  </pbo-button>
2360
2364
  </div>
2361
2365
  </form>
2362
- `}};um.styles=[sl,lm],dm([vt(".pixel-input")],um.prototype,"imageInput",2),dm([vt(".handwritten-form")],um.prototype,"handwrittenForm",2),dm([ft()],um.prototype,"sourceImg",2),dm([ft()],um.prototype,"processedFileUrl",2),dm([ft()],um.prototype,"handwrittenDimensions",2),dm([il("sourceImg")],um.prototype,"handleSourceImgChange",1),dm([il("processedFileUrl")],um.prototype,"handleProcessImageChange",1),um=dm([dt("pbo-handwritten-form")],um);const pm=um,gm=l`
2366
+ `}};pm.styles=[sl,cm],um([vt(".pixel-input")],pm.prototype,"imageInput",2),um([vt(".handwritten-form")],pm.prototype,"handwrittenForm",2),um([gt()],pm.prototype,"card",2),um([gt()],pm.prototype,"submitHandwrittenForm",2),um([gt()],pm.prototype,"getProcessedImg",2),um([ft()],pm.prototype,"sourceImg",2),um([ft()],pm.prototype,"processedImg",2),um([ft()],pm.prototype,"processedFileUrl",2),um([ft()],pm.prototype,"handwrittenDimensions",2),um([il("sourceImg")],pm.prototype,"handleSourceImgChange",1),um([il("processedFileUrl")],pm.prototype,"handleProcessImageChange",1),pm=um([dt("pbo-handwritten-form")],pm);const gm=pm,fm=l`
2363
2367
  :host {
2364
2368
  display: block;
2365
2369
  width: 100%;
@@ -2387,7 +2391,7 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
2387
2391
  display: block;
2388
2392
  object-fit: contain;
2389
2393
  }
2390
- `;var fm=Object.defineProperty,mm=Object.getOwnPropertyDescriptor,vm=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?mm(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&fm(e,i,o),o};let bm=class extends Kh{constructor(){super(...arguments),this.backgroundImageUrl=void 0,this.handwrittenImageUrl=void 0,this.imageHeight=null,this.imageWidth=null,this.imageLeft=null,this.imageTop=null,this.backgroundFabImg=void 0,this.rect=void 0,this.areaPosition={left:0,top:0},this.handwrittenImage=void 0,this.clipMaskOverlay=void 0,this.areaSize={width:0,height:0},this._dimensionsUpdateTimeout=void 0}async handleBackgroundImageUrlChange(){this.canvas&&(this.backgroundFabImg&&this.canvas.remove(this.backgroundFabImg),await this.appendBackgroundImageToCanvas(this.backgroundImageUrl||"https://cdn.shopify.com/s/files/1/1956/2323/files/insert_86e8bcd5-3e82-4910-b350-485fa6958502.png?v=1726598821"),this.updateProcessedImgAreaPosition(),this.canvas.renderAll())}async handleHandwrittenImageUrlChange(t,e){if(this.canvas){if(this.handwrittenImage&&this.canvas.remove(this.handwrittenImage),e){this.handwrittenImage=await xa.fromURL(e),this.handwrittenImage.selectable=!0,this.handwrittenImage.lockRotation=!0,this.handwrittenImage.lockScalingFlip=!0;const t=this.areaSize.width/this.handwrittenImage.width,i=this.areaSize.height/this.handwrittenImage.height,s=Math.min(t,i);this.handwrittenImage.set({transparentCorners:!1,cornerColor:"#4287f5",cornerStyle:"circle",cornerSize:this.areaSize.width*(ru()?.06:.03),cornerStrokeWidth:2,cornerStrokeColor:"#2563eb",touchCornerSize:this.areaSize.width*(ru()?.2:.06),scalingLimitations:"preserveAspectRatio",left:this.areaPosition.left,top:this.areaPosition.top,scaleX:s,scaleY:s,bringToFrontOnSelect:!1,borderColor:"#4287f5",borderScaleFactor:1.5}),this.setHandwrittenImageDimensions({top:this.areaPosition.top,left:this.areaPosition.left,height:this.handwrittenImage.height*s,width:this.handwrittenImage.width*s}),this.handwrittenImage.setControlsVisibility({tl:!0,tr:!0,bl:!0,br:!0,mt:!1,mb:!1,ml:!1,mr:!1,mtr:!1});const r=new so({width:this.areaSize.width,height:this.areaSize.height,left:this.areaPosition.left,top:this.areaPosition.top,absolutePositioned:!0});this.handwrittenImage.set({clipPath:r}),this.handwrittenImage.on("scaling",(t=>{const{top:e,left:i,height:s,width:r,scaleX:o,scaleY:n}=t.transform.target;this.setHandwrittenImageDimensions({top:e,left:i,height:s*n,width:r*o})})),this.handwrittenImage.on("moving",(t=>{const{top:e,left:i}=t.transform.target;this.setHandwrittenImageDimensions({top:e,left:i})})),this.handwrittenImage.on("selected",(()=>{var t,e;null==(t=this.rect)||t.set("visible",!0),null==(e=this.handwrittenImage)||e.set("clipPath",null),this.clipMaskOverlay?this.clipMaskOverlay.set("visible",!0):(this.clipMaskOverlay=this.createClipMaskOverlay(),this.canvas.add(this.clipMaskOverlay)),this.canvas.bringObjectToFront(this.clipMaskOverlay),this.canvas.renderAll()})),this.handwrittenImage.on("deselected",(()=>{var t,e,i;null==(t=this.rect)||t.set("visible",!1),null==(e=this.handwrittenImage)||e.set({clipPath:r}),null==(i=this.clipMaskOverlay)||i.set("visible",!1)})),this.canvas.add(this.handwrittenImage),this.canvas.renderAll()}this.updateProcessedImgAreaPosition(),this.canvas.renderAll()}}createClipMaskOverlay(){const t=this.canvas.getWidth(),e=this.canvas.getHeight(),{left:i,top:s}=this.areaPosition,{width:r,height:o}=this.areaSize,n="rgba(0,0,0,0.1)",a=new so({left:0,top:0,width:t,height:s,fill:n,selectable:!1,evented:!1}),l=new so({left:0,top:s+o,width:t,height:e-(s+o),fill:n,selectable:!1,evented:!1}),c=new so({left:0,top:s,width:i,height:o,fill:n,selectable:!1,evented:!1}),h=new so({left:i+r,top:s,width:t-(i+r),height:o,fill:n,selectable:!1,evented:!1});return new bo([a,l,c,h],{selectable:!1,evented:!1})}updateProcessedImgAreaPosition(){this.areaPosition={left:.084*this.canvas.getWidth(),top:.4874*this.canvas.getHeight()},this.areaSize={width:.832*this.canvas.getWidth(),height:this.canvas.getHeight()-this.areaPosition.top-this.areaPosition.left},this.rect?(this.rect.set("left",this.areaPosition.left),this.rect.set("top",this.areaPosition.top),this.rect.set("width",this.areaSize.width),this.rect.set("height",this.areaSize.height)):(this.rect=new so({left:this.areaPosition.left,top:this.areaPosition.top,width:this.areaSize.width,height:this.areaSize.height,selectable:!1,fill:"rgba(255, 255, 255, 0.5)",visible:!1,evented:!1}),this.canvas.add(this.rect))}handleHandwrittenImageDimensionsChange(t,e){this._dimensionsUpdateTimeout&&clearTimeout(this._dimensionsUpdateTimeout),this._dimensionsUpdateTimeout=setTimeout((()=>{var t,e,i;this.applyHandwrittenImageDimensions(),null==(t=this.canvas)||t.renderAll(),this.emit("handwritten-image-dimensions-changed",{detail:{left:this.imageLeft,top:this.imageTop,width:this.imageWidth,height:this.imageHeight,cardHeight:(null==(e=this.backgroundFabImg)?void 0:e.height)||0,cardWidth:(null==(i=this.backgroundFabImg)?void 0:i.width)||0}})}),300)}applyHandwrittenImageDimensions(){ou(this.handwrittenImage)&&ou(this.imageLeft)&&ou(this.imageTop)&&ou(this.imageWidth)&&ou(this.imageHeight)&&(this.handwrittenImage.set({left:this.imageLeft,top:this.imageTop}),this.handwrittenImage.scaleToHeight(this.imageHeight),this.handwrittenImage.scaleToWidth(this.imageWidth))}setHandwrittenImageDimensions(t){const{top:e=null,left:i=null,height:s=null,width:r=null}=t;e||i||s||r?(i&&this.imageLeft!==i&&(this.imageLeft=i),e&&this.imageTop!==e&&(this.imageTop=e),s&&this.imageHeight!==s&&(this.imageHeight=s),r&&this.imageWidth!==r&&(this.imageWidth=r)):console.warn("Invalid dimensions provided for handwritten image")}async firstUpdated(){this.canvas=new Jo(this.baseCanvas,{width:500,height:500,containerClass:"fabric-container",preserveObjectStacking:!0}),this.backgroundImageUrl&&await this.appendBackgroundImageToCanvas(this.backgroundImageUrl,(()=>{})),this.updateProcessedImgAreaPosition(),this.canvas.renderAll()}async appendBackgroundImageToCanvas(t,e){const i=await xa.fromURL(t);i.selectable=!1,this.backgroundFabImg=i,this.canvas.setDimensions({width:i.width,height:i.height}),this.canvas.add(i),this.canvas.sendObjectToBack(i),await this.canvas.renderAll(),e&&e()}render(){return U`<canvas class="base-canvas"></canvas> `}};bm.styles=[sl,gm],vm([gt({attribute:"background-url"})],bm.prototype,"backgroundImageUrl",2),vm([gt({attribute:"handwritten-url"})],bm.prototype,"handwrittenImageUrl",2),vm([gt({type:Number,reflect:!0,attribute:"height"})],bm.prototype,"imageHeight",2),vm([gt({type:Number,reflect:!0,attribute:"width"})],bm.prototype,"imageWidth",2),vm([gt({type:Number,reflect:!0,attribute:"left"})],bm.prototype,"imageLeft",2),vm([gt({type:Number,reflect:!0,attribute:"top"})],bm.prototype,"imageTop",2),vm([vt(".base-canvas")],bm.prototype,"baseCanvas",2),vm([ft()],bm.prototype,"canvas",2),vm([ft()],bm.prototype,"backgroundFabImg",2),vm([ft()],bm.prototype,"rect",2),vm([ft()],bm.prototype,"areaPosition",2),vm([ft()],bm.prototype,"handwrittenImage",2),vm([ft()],bm.prototype,"clipMaskOverlay",2),vm([ft()],bm.prototype,"areaSize",2),vm([il("backgroundImageUrl")],bm.prototype,"handleBackgroundImageUrlChange",1),vm([il("handwrittenImageUrl")],bm.prototype,"handleHandwrittenImageUrlChange",1),vm([il("imageLeft"),il("imageTop"),il("imageWidth"),il("imageHeight")],bm.prototype,"handleHandwrittenImageDimensionsChange",1),bm=vm([dt("pbo-handwritten-canvas")],bm);const ym=bm,_m=l`
2394
+ `;var mm=Object.defineProperty,vm=Object.getOwnPropertyDescriptor,bm=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?vm(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&mm(e,i,o),o};let ym=class extends Kh{constructor(){super(...arguments),this.backgroundImageUrl=void 0,this.handwrittenImageUrl=void 0,this.imageHeight=null,this.imageWidth=null,this.imageLeft=null,this.imageTop=null,this.backgroundFabImg=void 0,this.rect=void 0,this.areaPosition={left:0,top:0},this.handwrittenImage=void 0,this.clipMaskOverlay=void 0,this.areaSize={width:0,height:0},this._dimensionsUpdateTimeout=void 0}async handleBackgroundImageUrlChange(){this.canvas&&(this.backgroundFabImg&&this.canvas.remove(this.backgroundFabImg),await this.appendBackgroundImageToCanvas(this.backgroundImageUrl||"https://cdn.shopify.com/s/files/1/1956/2323/files/insert_86e8bcd5-3e82-4910-b350-485fa6958502.png?v=1726598821"),this.updateProcessedImgAreaPosition(),this.canvas.renderAll())}async handleHandwrittenImageUrlChange(t,e){if(this.canvas){if(this.handwrittenImage&&this.canvas.remove(this.handwrittenImage),e){this.handwrittenImage=await xa.fromURL(e),this.handwrittenImage.selectable=!0,this.handwrittenImage.lockRotation=!0,this.handwrittenImage.lockScalingFlip=!0,this.handwrittenImage.noScaleCache=!1;const t=this.areaSize.width/this.handwrittenImage.width,i=this.areaSize.height/this.handwrittenImage.height,s=Math.min(t,i);this.handwrittenImage.set({transparentCorners:!1,cornerColor:"#4287f5",cornerStyle:"circle",cornerSize:this.areaSize.width*(Kd()?.06:.03),cornerStrokeWidth:2,cornerStrokeColor:"#2563eb",touchCornerSize:this.areaSize.width*(Kd()?.2:.06),scalingLimitations:"preserveAspectRatio",left:this.areaPosition.left,top:this.areaPosition.top,scaleX:s,scaleY:s,bringToFrontOnSelect:!1,borderColor:"#4287f5",borderScaleFactor:10}),this.setHandwrittenImageDimensions({top:this.areaPosition.top,left:this.areaPosition.left,height:this.handwrittenImage.height*s,width:this.handwrittenImage.width*s}),this.handwrittenImage.setControlsVisibility({tl:!0,tr:!0,bl:!0,br:!0,mt:!1,mb:!1,ml:!1,mr:!1,mtr:!1});const r=new so({width:this.areaSize.width,height:this.areaSize.height,left:this.areaPosition.left,top:this.areaPosition.top,absolutePositioned:!0});this.handwrittenImage.set({clipPath:r}),this.handwrittenImage.on("scaling",(t=>{const{top:e,left:i,height:s,width:r,scaleX:o,scaleY:n}=t.transform.target;this.setHandwrittenImageDimensions({top:e,left:i,height:s*n,width:r*o})})),this.handwrittenImage.on("moving",(t=>{const{top:e,left:i}=t.transform.target;this.setHandwrittenImageDimensions({top:e,left:i})})),this.handwrittenImage.on("selected",(()=>{var t,e;null==(t=this.rect)||t.set("visible",!0),null==(e=this.handwrittenImage)||e.set("clipPath",null),this.clipMaskOverlay?this.clipMaskOverlay.set("visible",!0):(this.clipMaskOverlay=this.createClipMaskOverlay(),this.canvas.add(this.clipMaskOverlay)),this.canvas.bringObjectToFront(this.clipMaskOverlay),this.canvas.renderAll()})),this.handwrittenImage.on("deselected",(()=>{var t,e,i;null==(t=this.rect)||t.set("visible",!1),null==(e=this.handwrittenImage)||e.set({clipPath:r}),null==(i=this.clipMaskOverlay)||i.set("visible",!1)})),this.canvas.add(this.handwrittenImage),this.canvas.renderAll()}this.updateProcessedImgAreaPosition(),this.canvas.renderAll()}}createClipMaskOverlay(){const t=this.canvas.getWidth(),e=this.canvas.getHeight(),{left:i,top:s}=this.areaPosition,{width:r,height:o}=this.areaSize,n="rgba(0,0,0,0.1)",a=new so({left:0,top:0,width:t,height:s,fill:n,selectable:!1,evented:!1}),l=new so({left:0,top:s+o,width:t,height:e-(s+o),fill:n,selectable:!1,evented:!1}),c=new so({left:0,top:s,width:i,height:o,fill:n,selectable:!1,evented:!1}),h=new so({left:i+r,top:s,width:t-(i+r),height:o,fill:n,selectable:!1,evented:!1});return new bo([a,l,c,h],{selectable:!1,evented:!1})}updateProcessedImgAreaPosition(){this.areaPosition={left:.084*this.canvas.getWidth(),top:.4874*this.canvas.getHeight()},this.areaSize={width:.832*this.canvas.getWidth(),height:this.canvas.getHeight()-this.areaPosition.top-this.areaPosition.left},this.rect?(this.rect.set("left",this.areaPosition.left),this.rect.set("top",this.areaPosition.top),this.rect.set("width",this.areaSize.width),this.rect.set("height",this.areaSize.height)):(this.rect=new so({left:this.areaPosition.left,top:this.areaPosition.top,width:this.areaSize.width,height:this.areaSize.height,selectable:!1,fill:"rgba(255, 255, 255, 0.5)",visible:!1,evented:!1}),this.canvas.add(this.rect))}handleHandwrittenImageDimensionsChange(t,e){this._dimensionsUpdateTimeout&&clearTimeout(this._dimensionsUpdateTimeout),this._dimensionsUpdateTimeout=setTimeout((()=>{var t,e,i;this.applyHandwrittenImageDimensions(),null==(t=this.canvas)||t.renderAll(),this.emit("handwritten-image-dimensions-changed",{detail:{left:this.imageLeft,top:this.imageTop,width:this.imageWidth,height:this.imageHeight,cardHeight:(null==(e=this.backgroundFabImg)?void 0:e.height)||0,cardWidth:(null==(i=this.backgroundFabImg)?void 0:i.width)||0}})}),300)}applyHandwrittenImageDimensions(){Zd(this.handwrittenImage)&&Zd(this.imageLeft)&&Zd(this.imageTop)&&Zd(this.imageWidth)&&Zd(this.imageHeight)&&(this.handwrittenImage.set({left:this.imageLeft,top:this.imageTop}),this.handwrittenImage.scaleToHeight(this.imageHeight),this.handwrittenImage.scaleToWidth(this.imageWidth))}setHandwrittenImageDimensions(t){const{top:e=null,left:i=null,height:s=null,width:r=null}=t;e||i||s||r?(i&&this.imageLeft!==i&&(this.imageLeft=i),e&&this.imageTop!==e&&(this.imageTop=e),s&&this.imageHeight!==s&&(this.imageHeight=s),r&&this.imageWidth!==r&&(this.imageWidth=r)):console.warn("Invalid dimensions provided for handwritten image")}async firstUpdated(){this.canvas=new Jo(this.baseCanvas,{width:500,height:500,containerClass:"fabric-container",preserveObjectStacking:!0}),this.backgroundImageUrl&&await this.appendBackgroundImageToCanvas(this.backgroundImageUrl,(()=>{})),this.updateProcessedImgAreaPosition(),this.canvas.renderAll()}async appendBackgroundImageToCanvas(t,e){const i=await xa.fromURL(t);i.selectable=!1,this.backgroundFabImg=i,this.canvas.setDimensions({width:i.width,height:i.height}),this.canvas.add(i),this.canvas.sendObjectToBack(i),await this.canvas.renderAll(),e&&e()}render(){return U`<canvas class="base-canvas"></canvas> `}};ym.styles=[sl,fm],bm([gt({attribute:"background-url"})],ym.prototype,"backgroundImageUrl",2),bm([gt({attribute:"handwritten-url"})],ym.prototype,"handwrittenImageUrl",2),bm([gt({type:Number,reflect:!0,attribute:"height"})],ym.prototype,"imageHeight",2),bm([gt({type:Number,reflect:!0,attribute:"width"})],ym.prototype,"imageWidth",2),bm([gt({type:Number,reflect:!0,attribute:"left"})],ym.prototype,"imageLeft",2),bm([gt({type:Number,reflect:!0,attribute:"top"})],ym.prototype,"imageTop",2),bm([vt(".base-canvas")],ym.prototype,"baseCanvas",2),bm([ft()],ym.prototype,"canvas",2),bm([ft()],ym.prototype,"backgroundFabImg",2),bm([ft()],ym.prototype,"rect",2),bm([ft()],ym.prototype,"areaPosition",2),bm([ft()],ym.prototype,"handwrittenImage",2),bm([ft()],ym.prototype,"clipMaskOverlay",2),bm([ft()],ym.prototype,"areaSize",2),bm([il("backgroundImageUrl")],ym.prototype,"handleBackgroundImageUrlChange",1),bm([il("handwrittenImageUrl")],ym.prototype,"handleHandwrittenImageUrlChange",1),bm([il("imageLeft"),il("imageTop"),il("imageWidth"),il("imageHeight")],ym.prototype,"handleHandwrittenImageDimensionsChange",1),ym=bm([dt("pbo-handwritten-canvas")],ym);const _m=ym,xm=l`
2391
2395
  :host {
2392
2396
  display: block;
2393
2397
  width: auto;
@@ -2435,7 +2439,7 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
2435
2439
  resize: vertical;
2436
2440
  min-height: 6rem;
2437
2441
  }
2438
- `;var xm=Object.defineProperty,wm=Object.getOwnPropertyDescriptor,Cm=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?wm(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&xm(e,i,o),o};let Sm=class extends Kh{constructor(){super(...arguments),this.hasSlotController=new Fh(this,"is-gift-label","premium-card-label","free-message-label"),this.freeMessage="",this.hidden=!1,this.expand=!1,this.isGift=!0,this.isPremiumChecked=!1,this.isFreeMessageChecked=!1}setGiftOptionEnabled(t){var e;this.isGift=t,this.isGift||(this.isPremiumChecked=!1,this.isFreeMessageChecked=!1,this.freeMessage="",null==(e=this.onFreeMessageClear)||e.call(this))}firstUpdated(t){}setPremiumEnabled(t){var e;this.isPremiumChecked=t,this.isPremiumChecked&&(this.isFreeMessageChecked=!1,null==(e=this.onFreeMessageClear)||e.call(this)),this.isPremiumChecked?this.emit("pbo-open-drawer"):this.emit("pbo-close-drawer"),this.onPremiumSelected&&this.onPremiumSelected(t)}setFreeMessageEnabled(t){var e;this.isFreeMessageChecked=t,this.isFreeMessageChecked||(this.freeMessage="",null==(e=this.onFreeMessageClear)||e.call(this))}handlePremiumChange(t){const e=t.target.checked;this.setPremiumEnabled(e)}render(){const t=this.hasSlotController.test("is-gift-label"),e=this.hasSlotController.test("premium-card-label"),i=this.hasSlotController.test("free-message-label");return U`
2442
+ `;var wm=Object.defineProperty,Cm=Object.getOwnPropertyDescriptor,Sm=(t,e,i,s)=>{for(var r,o=s>1?void 0:s?Cm(e,i):e,n=t.length-1;n>=0;n--)(r=t[n])&&(o=(s?r(e,i,o):r(o))||o);return s&&o&&wm(e,i,o),o};let Tm=class extends Kh{constructor(){super(...arguments),this.hasSlotController=new Fh(this,"is-gift-label","premium-card-label","free-message-label"),this.freeMessage="",this.hidden=!1,this.expand=!1,this.isGift=!0,this.isPremiumChecked=!1,this.isFreeMessageChecked=!1}setGiftOptionEnabled(t){var e;this.isGift=t,this.isGift||(this.isPremiumChecked=!1,this.isFreeMessageChecked=!1,this.freeMessage="",null==(e=this.onFreeMessageClear)||e.call(this))}firstUpdated(t){}setPremiumEnabled(t){var e;this.isPremiumChecked=t,this.isPremiumChecked&&(this.isFreeMessageChecked=!1,null==(e=this.onFreeMessageClear)||e.call(this)),this.isPremiumChecked?this.emit("pbo-open-drawer"):this.emit("pbo-close-drawer"),this.onPremiumSelected&&this.onPremiumSelected(t)}setFreeMessageEnabled(t){var e;this.isFreeMessageChecked=t,this.isFreeMessageChecked||(this.freeMessage="",null==(e=this.onFreeMessageClear)||e.call(this))}handlePremiumChange(t){const e=t.target.checked;this.setPremiumEnabled(e)}render(){const t=this.hasSlotController.test("is-gift-label"),e=this.hasSlotController.test("premium-card-label"),i=this.hasSlotController.test("free-message-label");return U`
2439
2443
  <div part="base" class="gift-options" ?hidden=${this.hidden}>
2440
2444
  <!-- 🎁 Is this a gift -->
2441
2445
  <div class="is-gift" part="is-gift" ?hidden=${!t}>
@@ -2485,4 +2489,4 @@ function*_f(t,e){if(void 0!==t){let i=0;for(const s of t)yield e(s,i++)}}yf.defa
2485
2489
  <div></div>
2486
2490
  </div>
2487
2491
  </div>
2488
- `}clear(){this.isPremiumChecked=!1,this.isFreeMessageChecked=!1,this.freeMessage=""}};Sm.styles=[sl,_m],Cm([gt()],Sm.prototype,"freeMessage",2),Cm([gt({type:Function})],Sm.prototype,"onPremiumSelected",2),Cm([gt({type:Function})],Sm.prototype,"onFreeMessageChange",2),Cm([gt({type:Function})],Sm.prototype,"onFreeMessageClear",2),Cm([gt({type:Boolean,reflect:!0})],Sm.prototype,"hidden",2),Cm([gt({type:Boolean,reflect:!0})],Sm.prototype,"expand",2),Cm([ft()],Sm.prototype,"isGift",2),Cm([ft()],Sm.prototype,"isPremiumChecked",2),Cm([ft()],Sm.prototype,"isFreeMessageChecked",2),Sm=Cm([dt("pbo-gift-options")],Sm);const Tm=Sm;t.PboButton=dd,t.PboButtonGroup=bd,t.PboCardSelection=Vf,t.PboCategory=Tf,t.PboDrawer=Df,t.PboEditor=gu,t.PboEditorCardSlider=mu,t.PboEditorSelector=am,t.PboGiftOption=Tm,t.PboHandwrittenCanvas=ym,t.PboHandwrittenForm=pm,t.PboPageManager=Rf,t.PboRadioButton=Od,t.PboRadioGroup=Fd,t.PboTextarea=Gd,t.PboTypeCanvas=qf,t.PboTypeForm=fu,t.PboZoomedPreview=em,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
2492
+ `}clear(){this.isPremiumChecked=!1,this.isFreeMessageChecked=!1,this.freeMessage=""}};Tm.styles=[sl,xm],Sm([gt()],Tm.prototype,"freeMessage",2),Sm([gt({type:Function})],Tm.prototype,"onPremiumSelected",2),Sm([gt({type:Function})],Tm.prototype,"onFreeMessageChange",2),Sm([gt({type:Function})],Tm.prototype,"onFreeMessageClear",2),Sm([gt({type:Boolean,reflect:!0})],Tm.prototype,"hidden",2),Sm([gt({type:Boolean,reflect:!0})],Tm.prototype,"expand",2),Sm([ft()],Tm.prototype,"isGift",2),Sm([ft()],Tm.prototype,"isPremiumChecked",2),Sm([ft()],Tm.prototype,"isFreeMessageChecked",2),Tm=Sm([dt("pbo-gift-options")],Tm);const km=Tm;t.PboButton=dd,t.PboButtonGroup=bd,t.PboCardSelection=Uf,t.PboCategory=kf,t.PboDrawer=Pf,t.PboEditor=fu,t.PboEditorCardSlider=vu,t.PboEditorSelector=lm,t.PboGiftOption=km,t.PboHandwrittenCanvas=_m,t.PboHandwrittenForm=gm,t.PboPageManager=Bf,t.PboRadioButton=Od,t.PboRadioGroup=Fd,t.PboTextarea=Gd,t.PboTypeCanvas=Kf,t.PboTypeForm=mu,t.PboZoomedPreview=im,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));