@tripetto/runner-autoscroll
Version:
Autoscroll UI for running Tripetto forms and surveys.
1,988 lines • 392 kB
JavaScript
/*! Tripetto Autoscroll Runner 9.0.2 - Copyright (C) 2025 Tripetto B.V. - All Rights Reserved */
"use client";
import{mountNamespace as e,SHA2 as t,set as r,arrayItem as o,DateTime as n,findLast as i,Num as a,Debounce as s,L10n as l,Runner as c,isBoolean as u,getString as d,findFirst as p,isFilledString as h,each as v,scheduleFrame as g,Enumerator as f,markdownifyTo as b,isString as m,MarkdownFeatures as y,castToString as $,isNumberFinite as w,castToNumber as k,castToBoolean as x,tripetto as C,condition as S,validator as O,ConditionBlock as z,Str as P,isVariable as B,NodeBlock as V,assert as F,cancelUITimeout as R,scheduleUITimeout as j,verify as D,scheduleAction as T,isFunction as A,scheduleUIInterval as q,cancelUIInterval as M,extendImmutable as I,noop as E,markdownifyToString as L,markdownifyToURL as U,compare as N,cancelFrame as W,scheduleAnimation as _,arraySize as H,Slots as K,HeadlessBlock as Y,castToFloat as X,getAny as J,isObject as Z,unmountNamespace as G,isDefined as Q,filter as ee,map as te,reduce as re,eachReverse as oe,AES as ne,isArray as ie,isPromise as ae,fingerprint as se}from"@tripetto/runner";import{jsx as le,Fragment as ce,jsxs as ue}from"react/jsx-runtime";import{useRef as de,useState as pe,useEffect as he,createElement as ve,StrictMode as ge}from"react";import{styled as fe,createGlobalStyle as be,css as me,StyleSheetManager as ye,keyframes as $e}from"styled-components";export{css,keyframes,styled}from"styled-components";import*as we from"react-dom";import{createPortal as ke}from"react-dom";import{createRoot as xe}from"react-dom/client";function Ce(e){var t=this.constructor;return this.then((function(r){return t.resolve(e()).then((function(){return r}))}),(function(r){return t.resolve(e()).then((function(){return t.reject(r)}))}))}function Se(e){return new this((function(t,r){if(!e||void 0===e.length)return r(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var o=Array.prototype.slice.call(e);if(0===o.length)return t([]);var n=o.length;function i(e,r){if(r&&("object"==typeof r||"function"==typeof r)){var a=r.then;if("function"==typeof a)return void a.call(r,(function(t){i(e,t)}),(function(r){o[e]={status:"rejected",reason:r},0==--n&&t(o)}))}o[e]={status:"fulfilled",value:r},0==--n&&t(o)}for(var a=0;a<o.length;a++)i(a,o[a])}))}function Oe(e,t){this.name="AggregateError",this.errors=e,this.message=t||""}function ze(e){var t=this;return new t((function(r,o){if(!e||void 0===e.length)return o(new TypeError("Promise.any accepts an array"));var n=Array.prototype.slice.call(e);if(0===n.length)return o();for(var i=[],a=0;a<n.length;a++)try{t.resolve(n[a]).then(r).catch((function(e){i.push(e),i.length===n.length&&o(new Oe(i,"All promises were rejected"))}))}catch(e){o(e)}}))}Oe.prototype=Error.prototype;var Pe=setTimeout;function Be(e){return Boolean(e&&void 0!==e.length)}function Ve(){}function Fe(e){if(!(this instanceof Fe))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],qe(e,this)}function Re(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,Fe._immediateFn((function(){var r=1===e._state?t.onFulfilled:t.onRejected;if(null!==r){var o;try{o=r(e._value)}catch(e){return void De(t.promise,e)}je(t.promise,o)}else(1===e._state?je:De)(t.promise,e._value)}))):e._deferreds.push(t)}function je(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var r=t.then;if(t instanceof Fe)return e._state=3,e._value=t,void Te(e);if("function"==typeof r)return void qe((o=r,n=t,function(){o.apply(n,arguments)}),e)}e._state=1,e._value=t,Te(e)}catch(t){De(e,t)}var o,n}function De(e,t){e._state=2,e._value=t,Te(e)}function Te(e){2===e._state&&0===e._deferreds.length&&Fe._immediateFn((function(){e._handled||Fe._unhandledRejectionFn(e._value)}));for(var t=0,r=e._deferreds.length;t<r;t++)Re(e,e._deferreds[t]);e._deferreds=null}function Ae(e,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=r}function qe(e,t){var r=!1;try{e((function(e){r||(r=!0,je(t,e))}),(function(e){r||(r=!0,De(t,e))}))}catch(e){if(r)return;r=!0,De(t,e)}}Fe.prototype.catch=function(e){return this.then(null,e)},Fe.prototype.then=function(e,t){var r=new this.constructor(Ve);return Re(this,new Ae(e,t,r)),r},Fe.prototype.finally=Ce,Fe.all=function(e){return new Fe((function(t,r){if(!Be(e))return r(new TypeError("Promise.all accepts an array"));var o=Array.prototype.slice.call(e);if(0===o.length)return t([]);var n=o.length;function i(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,(function(t){i(e,t)}),r)}o[e]=a,0==--n&&t(o)}catch(e){r(e)}}for(var a=0;a<o.length;a++)i(a,o[a])}))},Fe.any=ze,Fe.allSettled=Se,Fe.resolve=function(e){return e&&"object"==typeof e&&e.constructor===Fe?e:new Fe((function(t){t(e)}))},Fe.reject=function(e){return new Fe((function(t,r){r(e)}))},Fe.race=function(e){return new Fe((function(t,r){if(!Be(e))return r(new TypeError("Promise.race accepts an array"));for(var o=0,n=e.length;o<n;o++)Fe.resolve(e[o]).then(t,r)}))},Fe._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){Pe(e,0)},Fe._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var Me=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();"function"!=typeof Me.Promise?Me.Promise=Fe:(Me.Promise.prototype.finally||(Me.Promise.prototype.finally=Ce),Me.Promise.allSettled||(Me.Promise.allSettled=Se),Me.Promise.any||(Me.Promise.any=ze));var Ie="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}!function(e){var t,r=function(){try{if(e.URLSearchParams&&"bar"===new e.URLSearchParams("foo=bar").get("foo"))return e.URLSearchParams}catch(e){}return null}(),o=r&&"a=1"===new r({a:1}).toString(),n=r&&"+"===new r("s=%2B").get("s"),i=r&&"size"in r.prototype,a="__URLSearchParams__",s=!r||((t=new r).append("s"," &"),"s=+%26"===t.toString()),l=h.prototype,c=!(!e.Symbol||!e.Symbol.iterator);if(!(r&&o&&n&&s&&i)){l.append=function(e,t){m(this[a],e,t)},l.delete=function(e){delete this[a][e]},l.get=function(e){var t=this[a];return this.has(e)?t[e][0]:null},l.getAll=function(e){var t=this[a];return this.has(e)?t[e].slice(0):[]},l.has=function(e){return $(this[a],e)},l.set=function(e,t){this[a][e]=[""+t]},l.toString=function(){var e,t,r,o,n=this[a],i=[];for(t in n)for(r=v(t),e=0,o=n[t];e<o.length;e++)i.push(r+"="+v(o[e]));return i.join("&")};var u,d=e.Proxy&&r&&(!n||!s||!o||!i);d?(u=new Proxy(r,{construct:function(e,t){return new e(new h(t[0]).toString())}})).toString=Function.prototype.toString.bind(h):u=h,Object.defineProperty(e,"URLSearchParams",{value:u});var p=e.URLSearchParams.prototype;p.polyfill=!0,!d&&e.Symbol&&(p[e.Symbol.toStringTag]="URLSearchParams"),"forEach"in p||(p.forEach=function(e,t){var r=b(this.toString());Object.getOwnPropertyNames(r).forEach((function(o){r[o].forEach((function(r){e.call(t,r,o,this)}),this)}),this)}),"sort"in p||(p.sort=function(){var e,t,r,o=b(this.toString()),n=[];for(e in o)n.push(e);for(n.sort(),t=0;t<n.length;t++)this.delete(n[t]);for(t=0;t<n.length;t++){var i=n[t],a=o[i];for(r=0;r<a.length;r++)this.append(i,a[r])}}),"keys"in p||(p.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),f(e)}),"values"in p||(p.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),f(e)}),"entries"in p||(p.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),f(e)}),c&&(p[e.Symbol.iterator]=p[e.Symbol.iterator]||p.entries),"size"in p||Object.defineProperty(p,"size",{get:function(){var e=b(this.toString());if(p===this)throw new TypeError("Illegal invocation at URLSearchParams.invokeGetter");return Object.keys(e).reduce((function(t,r){return t+e[r].length}),0)}})}function h(e){((e=e||"")instanceof URLSearchParams||e instanceof h)&&(e=e.toString()),this[a]=b(e)}function v(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,(function(e){return t[e]}))}function g(e){return e.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,(function(e){return decodeURIComponent(e)}))}function f(t){var r={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return c&&(r[e.Symbol.iterator]=function(){return r}),r}function b(e){var t={};if("object"==typeof e)if(y(e))for(var r=0;r<e.length;r++){var o=e[r];if(!y(o)||2!==o.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");m(t,o[0],o[1])}else for(var n in e)e.hasOwnProperty(n)&&m(t,n,e[n]);else{0===e.indexOf("?")&&(e=e.slice(1));for(var i=e.split("&"),a=0;a<i.length;a++){var s=i[a],l=s.indexOf("=");-1<l?m(t,g(s.slice(0,l)),g(s.slice(l+1))):s&&m(t,g(s),"")}}return t}function m(e,t,r){var o="string"==typeof r?r:null!=r&&"function"==typeof r.toString?r.toString():JSON.stringify(r);$(e,t)?e[t].push(o):e[t]=[o]}function y(e){return!!e&&"[object Array]"===Object.prototype.toString.call(e)}function $(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(void 0!==Ie?Ie:"undefined"!=typeof window?window:Ie);const Le="@tripetto/runner-autoscroll@9.0.2";function Ue(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function Ne(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))}e(Le),"function"==typeof SuppressedError&&SuppressedError;const We=e=>{const t=e.current,r=()=>{t&&0!==t.handle&&(clearTimeout(t.handle),t.handle=0)};return{resolve:()=>{e.current=void 0,t&&(r(),t.resolve())},reject:()=>{e.current=void 0,t&&(r(),t.reject())},cancel:r}};let _e=0;function He(e){return i(e,(e=>e.isPreActive||e.isBeforeActive||e.isActive||e.isAfterActive||e.isPostActive))}function Ke(e,t,r){const n=o(e,t);if(n&&n.isHealthy){let t=n.index;for(;--t>=0;){const o=e[t];if(o.isHistory)break;if(!r||r(o))return o}}}function Ye(e,i,s,l,c){const u="node"===s&&l||void 0,d="prologue"===s&&l||void 0,p="epilogue"===s&&l||void 0,h=("finishing"===s||"pausing"===s)&&l||void 0,v=_e++,g={id:"_"+t.CSHA2_256(u?u.key+("live"===e.viewRef.current&&e.storylineRef.current&&e.storylineRef.current.instance.id):`${s}-${e.sequence.length}`),key:u&&u.key||"_"+t.CSHA2_256(`${s}-${e.sequence.length}`),type:s,node:u,prologue:d,epilogue:p,cancel:h,index:e.sequence.length,state:i,changeState:o=>{r(g,"state","prologue"===g.type&&"preview"!==e.viewRef.current&&"active"===o?"history":o),"history"===g.state&&"live"===e.viewRef.current&&u&&r(g,"key","_"+t.CSHA2_256(`history-${v}`)),u&&"upcoming"===g.state&&r(g,"timeStamp",void 0)},get isHealthy(){const t=o(e.sequence,g.index);return t&&t.id===g.id||!1},get isHistory(){return"history"===g.state},get isPast(){return"past"===g.state},get isPreActive(){return"pre-active"===g.state},get isBeforeActive(){return"before-active"===g.state},get isActive(){return"active"===g.state},get isAfterActive(){return"after-active"===g.state},get isPostActive(){return"post-active"===g.state},get isUpcoming(){return"upcoming"===g.state},get isFirst(){return 0===g.index},get isLast(){return g.index===e.sequence.length-1},get isPaused(){if(g.index+1<e.sequence.length){const t=e.sequence[g.index+1];if("pausing"===t.type||"paused"===t.type||"error"===t.type&&"paused"===t.error)return!0}return!1},get allowActivate(){return!(!g.isHealthy||g.isHistory||!u||!e.storylineRef.current||e.storylineRef.current.isFinishing||e.storylineRef.current.isPausing)},activate:(t=!1)=>{if(u&&e.storylineRef.current&&e.storylineRef.current.isPausing){const t=He(e.sequence);t&&t.cancel&&t.cancel()}if(u&&(!e.storylineRef.current||e.storylineRef.current.isFinishing||e.storylineRef.current.isPausing))return!1;if(We(e.promiseRef).reject(),function(e,t,r,o){if(0===e.length||t<0||t>=e.length||!e[t].isHealthy||!r&&e[t].isHistory&&"prologue"!==e[t].type)return!1;const n=He(e),i=(n||{index:-1}).index;if(i!==t){const s=-1===i?0:a.min(t,i),l=-1===i?e.length-1:a.max(t,i);let c;for(let o=s;o<=l;o++){const n=e[o];if((!n.isHistory||"prologue"===n.type)&&(n.changeState(o===t?"active":o<t?"node"!==n.type?"history":"past":"upcoming"),c||o!==t||(c=n),!r&&o>t&&"node"!==n.type&&"epilogue"!==n.type)){e.splice(o,e.length-o);break}}o&&(n&&!n.isActive&&o("unstage",n.node),c&&o("stage",c.node))}return!0}(e.sequence,g.index,"preview"===e.viewRef.current,c)){const r=()=>{g.changeState("active"),e.update(),e.rules.onInteraction&&e.rules.onInteraction()},o=()=>{if(t&&"preview"!==e.viewRef.current&&e.rules.beforeActiveDuration){const t=e.rules.beforeActiveDuration(g)||0;t?(e.promiseRef.current={resolve:()=>"before-active"===g.state&&r(),reject:()=>g.changeState("upcoming"),handle:setTimeout((()=>g.continue()),t)},g.changeState("before-active"),e.update()):r()}else r()};if("node"===g.type&&e.reset(),t&&"preview"!==e.viewRef.current&&e.rules.preActiveDuration){const t=e.rules.preActiveDuration(g)||0;t>0?(e.promiseRef.current={resolve:()=>"pre-active"===g.state&&o(),reject:()=>g.changeState("upcoming"),handle:setTimeout((()=>g.continue()),t)},g.changeState("pre-active"),e.update()):o()}else o();return e.rules.onInteraction&&e.rules.onInteraction(),!0}return!1},deactivate:()=>!("preview"!==e.viewRef.current||!function(e,t,r){if(t<0||t>=e.length||!e[t].isHealthy||!e[t].isActive)return!1;if(r){const o=e[t];(null==o?void 0:o.isActive)&&r("unstage",o.node)}for(;t<e.length;){const r=e[t];r.isHistory||r.isAfterActive||r.isPostActive||r.changeState("node"!==r.type?"history":"past"),t++}return!0}(e.sequence,g.index,c))&&(e.update(),!0),get allowNext(){return!g.isHistory&&e.storylineRef.current&&!e.storylineRef.current.isEvaluating&&!e.storylineRef.current.isFinishing&&!e.storylineRef.current.isPausing&&(!g.node||g.node.isPassed)&&g.isHealthy&&("preview"===e.viewRef.current||g.index+1<e.sequence.length||e.storylineRef.current.isFinishable||!1)||!1},next:()=>{if(!g.isHealthy)return!1;if("preview"!==e.viewRef.current){const t=()=>{g.node&&g.node.block&&g.node.block.lock()},r=()=>(g.node&&g.node.block&&g.node.block.unlock(),!0);if(e.rules.afterActiveDuration&&g.isActive){const o=e.rules.afterActiveDuration(g)||0;if(o>0)return e.promiseRef.current={resolve:()=>"after-active"===g.state&&g.next(),reject:()=>r()&&g.changeState("node"!==g.type?"history":"past"),handle:setTimeout((()=>g.continue()),o)},t(),g.changeState("after-active"),e.update(),!0}if(e.rules.postActiveDuration&&(g.isActive||g.isAfterActive)){const o=e.rules.postActiveDuration(g)||0;if(o>0)return e.promiseRef.current={resolve:()=>"post-active"===g.state&&g.next(),reject:()=>r()&&g.changeState("node"!==g.type?"history":"past"),handle:setTimeout((()=>g.continue()),o)},t(),g.changeState("post-active"),e.update(),!0}r()}else if(g.deactivate())return!0;return!(g.node&&!g.node.isPassed||g.isHistory)&&(g.index+1<e.sequence.length?e.sequence[g.index+1].activate(!0):"node"!==g.type?(g.changeState("history"),!1):(g.changeState("past"),e.storylineRef.current&&e.storylineRef.current.stepForward()||!1))},get allowUndo(){return!(!e.storylineRef.current||e.storylineRef.current.isFinishing||e.storylineRef.current.isEvaluating||!("node"===g.type&&!e.storylineRef.current.isPausing||"pausing"===g.type&&g.pausingRecipe)||!Ke(e.sequence,g.index,e.rules.canInteract))},undo:()=>{if(e.storylineRef.current&&!e.storylineRef.current.isEvaluating){if("pausing"===g.type&&g.pausingRecipe)return g.pausingRecipe.cancel(),!0;const t=Ke(e.sequence,g.index,e.rules.canInteract);return t&&t.activate(!1)||!1}return!1},get allowSkip(){return e.storylineRef.current&&!e.storylineRef.current.isFinishing&&!e.storylineRef.current.isPausing&&!e.storylineRef.current.isEvaluating&&"node"===g.type&&e.rules.canSkip&&e.rules.canSkip(g)||!1},skip:()=>!(!g.isHealthy||!g.allowSkip)&&(g.node&&g.node.block&&g.node.block.clear(),g.next()),wait:()=>We(e.promiseRef).cancel(),continue:()=>We(e.promiseRef).resolve(),get repeat(){if("epilogue"===g.type&&g.epilogue&&("test"===e.viewRef.current||"live"===e.viewRef.current&&g.epilogue.repeatable)){for(let t=g.index+1;t<e.sequence.length;t++)if("epilogue"!==e.sequence[t].type)return;return()=>{"test"===e.viewRef.current?e.restart():e.runnerRef.current&&!e.runnerRef.current.isRunning&&e.runnerRef.current.start()}}},get kickOff(){if("preview"!==e.viewRef.current&&"prologue"===g.type&&e.runnerRef.current&&!e.runnerRef.current.isRunning&&!e.runnerRef.current.isFinishing&&!e.runnerRef.current.isPausing&&g.isLast)return()=>e.runnerRef.current&&e.runnerRef.current.start()},changeToError:(t,o,i)=>{r(g,"type","error"),r(g,"error",t),r(g,"retry",o),r(g,"cancel",i),r(g,"timeStamp",n.now),g.activate(!0)||e.update()},changeToEpilogue:t=>{r(g,"type","epilogue"),r(g,"epilogue",t),r(g,"timeStamp",n.now),g.activate(!0)||e.update()},changeToPausing:t=>{r(g,"type","pausing"),r(g,"retry",void 0),r(g,"cancel",t),r(g,"timeStamp",void 0),g.activate(!0)||e.update()},changeToPaused:()=>{r(g,"type","paused"),r(g,"retry",void 0),r(g,"cancel",void 0),r(g,"timeStamp",n.now),g.activate(!0)||e.update()},pausingRecipe:void 0,setPausingRecipe:t=>{if("email"===t.recipe)if("pausing"===g.type){const o=()=>{r(g,"pausingRecipe",void 0),r(g,"cancel",void 0),e.update()};r(g,"pausingRecipe",{recipe:t.recipe,complete:e=>{o(),t.complete(e)},cancel:()=>{o(),t.cancel()}}),e.update()}}};return e.sequence.push(g),c&&"active"===i&&c("stage",g.node),g}const Xe=new f;function Je(e,t,r=!0,o,n){return b(e,t,{lineBreaks:r,features:o,reduce:(e,o,i)=>{const a=m(o)?[o]:o;switch(e){case"bold":return ve("b",void 0,...a);case"italic":return ve("i",void 0,...a);case"bold+italic":return ve("b",void 0,ve("i",void 0,...a));case"underline":return ve("u",void 0,...a);case"strikethrough":return ve("s",void 0,...a);case"break":return ve("br");case"hyperlink":return ve("a",{href:$(i),target:"_blank",rel:"noopener"},...a);case"mention":const e=i&&i||void 0;if(e&&e.content.length>0){const o=[];return v(e.content,(i=>{const a=i.value;a&&(o.length>0&&i.separator&&o.push(ve("span",void 0,i.separator)),"string"===i.type?o.push(r&&a&&-1!==a.indexOf("\n")?Je(a.replace(/[@\\]/g,"\\$&"),t,!0,y.None):ve(a?"span":"u",void 0,a||" ")):n&&-1!==n.indexOf("@"+e.id)||o.push(Je(a,t,r,"text"===i.type?y.None:y.Formatting|y.Hyperlinks,(n||"")+"@"+e.id)))})),o.length>0?ve("span",void 0,...o):ve("u",void 0," ")}return ve("u",void 0," ")}return ve("span",{key:Xe.n},...a)}})}var Ze={exports:{}},Ge={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Qe={exports:{}},et=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))},tt=Array.prototype.concat,rt=Array.prototype.slice,ot=Qe.exports=function(e){for(var t=[],r=0,o=e.length;r<o;r++){var n=e[r];et(n)?t=tt.call(t,rt.call(n)):t.push(n)}return t};ot.wrap=function(e){return function(){return e(ot(arguments))}};var nt=Qe.exports,it=Ge,at=nt,st=Object.hasOwnProperty,lt=Object.create(null);for(var ct in it)st.call(it,ct)&&(lt[it[ct]]=ct);var ut=Ze.exports={to:{},get:{}};function dt(e,t,r){return Math.min(Math.max(t,e),r)}function pt(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}ut.get=function(e){var t,r;switch(e.substring(0,3).toLowerCase()){case"hsl":t=ut.get.hsl(e),r="hsl";break;case"hwb":t=ut.get.hwb(e),r="hwb";break;default:t=ut.get.rgb(e),r="rgb"}return t?{model:r,value:t}:null},ut.get.rgb=function(e){if(!e)return null;var t,r,o,n=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=t[2],t=t[1],r=0;r<3;r++){var i=2*r;n[r]=parseInt(t.slice(i,i+2),16)}o&&(n[3]=parseInt(o,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(o=(t=t[1])[3],r=0;r<3;r++)n[r]=parseInt(t[r]+t[r],16);o&&(n[3]=parseInt(o+o,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(r=0;r<3;r++)n[r]=parseInt(t[r+1],0);t[4]&&(t[5]?n[3]=.01*parseFloat(t[4]):n[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(t=e.match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:st.call(it,t[1])?((n=it[t[1]])[3]=1,n):null:null;for(r=0;r<3;r++)n[r]=Math.round(2.55*parseFloat(t[r+1]));t[4]&&(t[5]?n[3]=.01*parseFloat(t[4]):n[3]=parseFloat(t[4]))}for(r=0;r<3;r++)n[r]=dt(n[r],0,255);return n[3]=dt(n[3],0,1),n},ut.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,dt(parseFloat(t[2]),0,100),dt(parseFloat(t[3]),0,100),dt(isNaN(r)?1:r,0,1)]}return null},ut.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,dt(parseFloat(t[2]),0,100),dt(parseFloat(t[3]),0,100),dt(isNaN(r)?1:r,0,1)]}return null},ut.to.hex=function(){var e=at(arguments);return"#"+pt(e[0])+pt(e[1])+pt(e[2])+(e[3]<1?pt(Math.round(255*e[3])):"")},ut.to.rgb=function(){var e=at(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},ut.to.rgb.percent=function(){var e=at(arguments),t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),o=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+r+"%, "+o+"%)":"rgba("+t+"%, "+r+"%, "+o+"%, "+e[3]+")"},ut.to.hsl=function(){var e=at(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},ut.to.hwb=function(){var e=at(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},ut.to.keyword=function(e){return lt[e.slice(0,3)]};var ht=Ze.exports,vt={exports:{}},gt=Ge,ft={};for(var bt in gt)gt.hasOwnProperty(bt)&&(ft[gt[bt]]=bt);var mt=vt.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var yt in mt)if(mt.hasOwnProperty(yt)){if(!("channels"in mt[yt]))throw new Error("missing channels property: "+yt);if(!("labels"in mt[yt]))throw new Error("missing channel labels property: "+yt);if(mt[yt].labels.length!==mt[yt].channels)throw new Error("channel and label counts mismatch: "+yt);var $t=mt[yt].channels,wt=mt[yt].labels;delete mt[yt].channels,delete mt[yt].labels,Object.defineProperty(mt[yt],"channels",{value:$t}),Object.defineProperty(mt[yt],"labels",{value:wt})}function kt(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}mt.rgb.hsl=function(e){var t,r,o=e[0]/255,n=e[1]/255,i=e[2]/255,a=Math.min(o,n,i),s=Math.max(o,n,i),l=s-a;return s===a?t=0:o===s?t=(n-i)/l:n===s?t=2+(i-o)/l:i===s&&(t=4+(o-n)/l),(t=Math.min(60*t,360))<0&&(t+=360),r=(a+s)/2,[t,100*(s===a?0:r<=.5?l/(s+a):l/(2-s-a)),100*r]},mt.rgb.hsv=function(e){var t,r,o,n,i,a=e[0]/255,s=e[1]/255,l=e[2]/255,c=Math.max(a,s,l),u=c-Math.min(a,s,l),d=function(e){return(c-e)/6/u+.5};return 0===u?n=i=0:(i=u/c,t=d(a),r=d(s),o=d(l),a===c?n=o-r:s===c?n=1/3+t-o:l===c&&(n=2/3+r-t),n<0?n+=1:n>1&&(n-=1)),[360*n,100*i,100*c]},mt.rgb.hwb=function(e){var t=e[0],r=e[1],o=e[2];return[mt.rgb.hsl(e)[0],100*(1/255*Math.min(t,Math.min(r,o))),100*(o=1-1/255*Math.max(t,Math.max(r,o)))]},mt.rgb.cmyk=function(e){var t,r=e[0]/255,o=e[1]/255,n=e[2]/255;return[100*((1-r-(t=Math.min(1-r,1-o,1-n)))/(1-t)||0),100*((1-o-t)/(1-t)||0),100*((1-n-t)/(1-t)||0),100*t]},mt.rgb.keyword=function(e){var t=ft[e];if(t)return t;var r,o=1/0;for(var n in gt)if(gt.hasOwnProperty(n)){var i=kt(e,gt[n]);i<o&&(o=i,r=n)}return r},mt.keyword.rgb=function(e){return gt[e]},mt.rgb.xyz=function(e){var t=e[0]/255,r=e[1]/255,o=e[2]/255;return[100*(.4124*(t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(o=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92)),100*(.2126*t+.7152*r+.0722*o),100*(.0193*t+.1192*r+.9505*o)]},mt.rgb.lab=function(e){var t=mt.rgb.xyz(e),r=t[0],o=t[1],n=t[2];return o/=100,n/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116)-16,500*(r-o),200*(o-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},mt.hsl.rgb=function(e){var t,r,o,n,i,a=e[0]/360,s=e[1]/100,l=e[2]/100;if(0===s)return[i=255*l,i,i];t=2*l-(r=l<.5?l*(1+s):l+s-l*s),n=[0,0,0];for(var c=0;c<3;c++)(o=a+1/3*-(c-1))<0&&o++,o>1&&o--,i=6*o<1?t+6*(r-t)*o:2*o<1?r:3*o<2?t+(r-t)*(2/3-o)*6:t,n[c]=255*i;return n},mt.hsl.hsv=function(e){var t=e[0],r=e[1]/100,o=e[2]/100,n=r,i=Math.max(o,.01);return r*=(o*=2)<=1?o:2-o,n*=i<=1?i:2-i,[t,100*(0===o?2*n/(i+n):2*r/(o+r)),100*((o+r)/2)]},mt.hsv.rgb=function(e){var t=e[0]/60,r=e[1]/100,o=e[2]/100,n=Math.floor(t)%6,i=t-Math.floor(t),a=255*o*(1-r),s=255*o*(1-r*i),l=255*o*(1-r*(1-i));switch(o*=255,n){case 0:return[o,l,a];case 1:return[s,o,a];case 2:return[a,o,l];case 3:return[a,s,o];case 4:return[l,a,o];case 5:return[o,a,s]}},mt.hsv.hsl=function(e){var t,r,o,n=e[0],i=e[1]/100,a=e[2]/100,s=Math.max(a,.01);return o=(2-i)*a,r=i*s,[n,100*(r=(r/=(t=(2-i)*s)<=1?t:2-t)||0),100*(o/=2)]},mt.hwb.rgb=function(e){var t,r,o,n,i,a,s,l=e[0]/360,c=e[1]/100,u=e[2]/100,d=c+u;switch(d>1&&(c/=d,u/=d),o=6*l-(t=Math.floor(6*l)),0!=(1&t)&&(o=1-o),n=c+o*((r=1-u)-c),t){default:case 6:case 0:i=r,a=n,s=c;break;case 1:i=n,a=r,s=c;break;case 2:i=c,a=r,s=n;break;case 3:i=c,a=n,s=r;break;case 4:i=n,a=c,s=r;break;case 5:i=r,a=c,s=n}return[255*i,255*a,255*s]},mt.cmyk.rgb=function(e){var t=e[0]/100,r=e[1]/100,o=e[2]/100,n=e[3]/100;return[255*(1-Math.min(1,t*(1-n)+n)),255*(1-Math.min(1,r*(1-n)+n)),255*(1-Math.min(1,o*(1-n)+n))]},mt.xyz.rgb=function(e){var t,r,o,n=e[0]/100,i=e[1]/100,a=e[2]/100;return r=-.9689*n+1.8758*i+.0415*a,o=.0557*n+-.204*i+1.057*a,t=(t=3.2406*n+-1.5372*i+-.4986*a)>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:12.92*o,[255*(t=Math.min(Math.max(0,t),1)),255*(r=Math.min(Math.max(0,r),1)),255*(o=Math.min(Math.max(0,o),1))]},mt.xyz.lab=function(e){var t=e[0],r=e[1],o=e[2];return r/=100,o/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(t-r),200*(r-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},mt.lab.xyz=function(e){var t,r,o,n=e[0];t=e[1]/500+(r=(n+16)/116),o=r-e[2]/200;var i=Math.pow(r,3),a=Math.pow(t,3),s=Math.pow(o,3);return r=i>.008856?i:(r-16/116)/7.787,t=a>.008856?a:(t-16/116)/7.787,o=s>.008856?s:(o-16/116)/7.787,[t*=95.047,r*=100,o*=108.883]},mt.lab.lch=function(e){var t,r=e[0],o=e[1],n=e[2];return(t=360*Math.atan2(n,o)/2/Math.PI)<0&&(t+=360),[r,Math.sqrt(o*o+n*n),t]},mt.lch.lab=function(e){var t,r=e[0],o=e[1];return t=e[2]/360*2*Math.PI,[r,o*Math.cos(t),o*Math.sin(t)]},mt.rgb.ansi16=function(e){var t=e[0],r=e[1],o=e[2],n=1 in arguments?arguments[1]:mt.rgb.hsv(e)[2];if(0===(n=Math.round(n/50)))return 30;var i=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(t/255));return 2===n&&(i+=60),i},mt.hsv.ansi16=function(e){return mt.rgb.ansi16(mt.hsv.rgb(e),e[2])},mt.rgb.ansi256=function(e){var t=e[0],r=e[1],o=e[2];return t===r&&r===o?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(o/255*5)},mt.ansi16.rgb=function(e){var t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),[t=t/10.5*255,t,t];var r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},mt.ansi256.rgb=function(e){if(e>=232){var t=10*(e-232)+8;return[t,t,t]}var r;return e-=16,[Math.floor(e/36)/5*255,Math.floor((r=e%36)/6)/5*255,r%6/5*255]},mt.rgb.hex=function(e){var t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},mt.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];var r=t[0];3===t[0].length&&(r=r.split("").map((function(e){return e+e})).join(""));var o=parseInt(r,16);return[o>>16&255,o>>8&255,255&o]},mt.rgb.hcg=function(e){var t,r=e[0]/255,o=e[1]/255,n=e[2]/255,i=Math.max(Math.max(r,o),n),a=Math.min(Math.min(r,o),n),s=i-a;return t=s<=0?0:i===r?(o-n)/s%6:i===o?2+(n-r)/s:4+(r-o)/s+4,t/=6,[360*(t%=1),100*s,100*(s<1?a/(1-s):0)]},mt.hsl.hcg=function(e){var t=e[1]/100,r=e[2]/100,o=1,n=0;return(o=r<.5?2*t*r:2*t*(1-r))<1&&(n=(r-.5*o)/(1-o)),[e[0],100*o,100*n]},mt.hsv.hcg=function(e){var t=e[1]/100,r=e[2]/100,o=t*r,n=0;return o<1&&(n=(r-o)/(1-o)),[e[0],100*o,100*n]},mt.hcg.rgb=function(e){var t=e[0]/360,r=e[1]/100,o=e[2]/100;if(0===r)return[255*o,255*o,255*o];var n,i=[0,0,0],a=t%1*6,s=a%1,l=1-s;switch(Math.floor(a)){case 0:i[0]=1,i[1]=s,i[2]=0;break;case 1:i[0]=l,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=s;break;case 3:i[0]=0,i[1]=l,i[2]=1;break;case 4:i[0]=s,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=l}return n=(1-r)*o,[255*(r*i[0]+n),255*(r*i[1]+n),255*(r*i[2]+n)]},mt.hcg.hsv=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t),o=0;return r>0&&(o=t/r),[e[0],100*o,100*r]},mt.hcg.hsl=function(e){var t=e[1]/100,r=e[2]/100*(1-t)+.5*t,o=0;return r>0&&r<.5?o=t/(2*r):r>=.5&&r<1&&(o=t/(2*(1-r))),[e[0],100*o,100*r]},mt.hcg.hwb=function(e){var t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},mt.hwb.hcg=function(e){var t=e[1]/100,r=1-e[2]/100,o=r-t,n=0;return o<1&&(n=(r-o)/(1-o)),[e[0],100*o,100*n]},mt.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},mt.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},mt.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},mt.gray.hsl=mt.gray.hsv=function(e){return[0,0,e[0]]},mt.gray.hwb=function(e){return[0,100,e[0]]},mt.gray.cmyk=function(e){return[0,0,0,e[0]]},mt.gray.lab=function(e){return[e[0],0,0]},mt.gray.hex=function(e){var t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},mt.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};var xt=vt.exports,Ct=xt;function St(e){var t=function(){for(var e={},t=Object.keys(Ct),r=t.length,o=0;o<r;o++)e[t[o]]={distance:-1,parent:null};return e}(),r=[e];for(t[e].distance=0;r.length;)for(var o=r.pop(),n=Object.keys(Ct[o]),i=n.length,a=0;a<i;a++){var s=n[a],l=t[s];-1===l.distance&&(l.distance=t[o].distance+1,l.parent=o,r.unshift(s))}return t}function Ot(e,t){return function(r){return t(e(r))}}function zt(e,t){for(var r=[t[e].parent,e],o=Ct[t[e].parent][e],n=t[e].parent;t[n].parent;)r.unshift(t[n].parent),o=Ot(Ct[t[n].parent][n],o),n=t[n].parent;return o.conversion=r,o}var Pt=xt,Bt=function(e){for(var t=St(e),r={},o=Object.keys(t),n=o.length,i=0;i<n;i++){var a=o[i];null!==t[a].parent&&(r[a]=zt(a,t))}return r},Vt={};Object.keys(Pt).forEach((function(e){Vt[e]={},Object.defineProperty(Vt[e],"channels",{value:Pt[e].channels}),Object.defineProperty(Vt[e],"labels",{value:Pt[e].labels});var t=Bt(e);Object.keys(t).forEach((function(r){var o=t[r];Vt[e][r]=function(e){var t=function(t){if(null==t)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var r=e(t);if("object"==typeof r)for(var o=r.length,n=0;n<o;n++)r[n]=Math.round(r[n]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(o),Vt[e][r].raw=function(e){var t=function(t){return null==t?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(o)}))}));var Ft=ht,Rt=Vt,jt=[].slice,Dt=["keyword","gray","hex"],Tt={};Object.keys(Rt).forEach((function(e){Tt[jt.call(Rt[e].labels).sort().join("")]=e}));var At={};function qt(e,t){if(!(this instanceof qt))return new qt(e,t);if(t&&t in Dt&&(t=null),t&&!(t in Rt))throw new Error("Unknown model: "+t);var r,o;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof qt)this.model=e.model,this.color=e.color.slice(),this.valpha=e.valpha;else if("string"==typeof e){var n=Ft.get(e);if(null===n)throw new Error("Unable to parse color from string: "+e);this.model=n.model,o=Rt[this.model].channels,this.color=n.value.slice(0,o),this.valpha="number"==typeof n.value[o]?n.value[o]:1}else if(e.length){this.model=t||"rgb",o=Rt[this.model].channels;var i=jt.call(e,0,o);this.color=Et(i,o),this.valpha="number"==typeof e[o]?e[o]:1}else if("number"==typeof e)e&=16777215,this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;var a=Object.keys(e);"alpha"in e&&(a.splice(a.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);var s=a.sort().join("");if(!(s in Tt))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Tt[s];var l=Rt[this.model].labels,c=[];for(r=0;r<l.length;r++)c.push(e[l[r]]);this.color=Et(c)}if(At[this.model])for(o=Rt[this.model].channels,r=0;r<o;r++){var u=At[this.model][r];u&&(this.color[r]=u(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function Mt(e,t,r){return(e=Array.isArray(e)?e:[e]).forEach((function(e){(At[e]||(At[e]=[]))[t]=r})),e=e[0],function(o){var n;return arguments.length?(r&&(o=r(o)),(n=this[e]()).color[t]=o,n):(n=this[e]().color[t],r&&(n=r(n)),n)}}function It(e){return function(t){return Math.max(0,Math.min(e,t))}}function Et(e,t){for(var r=0;r<t;r++)"number"!=typeof e[r]&&(e[r]=0);return e}qt.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(e){var t=this.model in Ft.to?this:this.rgb(),r=1===(t=t.round("number"==typeof e?e:1)).valpha?t.color:t.color.concat(this.valpha);return Ft.to[t.model](r)},percentString:function(e){var t=this.rgb().round("number"==typeof e?e:1),r=1===t.valpha?t.color:t.color.concat(this.valpha);return Ft.to.rgb.percent(r)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var e={},t=Rt[this.model].channels,r=Rt[this.model].labels,o=0;o<t;o++)e[r[o]]=this.color[o];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray:function(){var e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject:function(){var e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round:function(e){return e=Math.max(e||0,0),new qt(this.color.map(function(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}(e)).concat(this.valpha),this.model)},alpha:function(e){return arguments.length?new qt(this.color.concat(Math.max(0,Math.min(1,e))),this.model):this.valpha},red:Mt("rgb",0,It(255)),green:Mt("rgb",1,It(255)),blue:Mt("rgb",2,It(255)),hue:Mt(["hsl","hsv","hsl","hwb","hcg"],0,(function(e){return(e%360+360)%360})),saturationl:Mt("hsl",1,It(100)),lightness:Mt("hsl",2,It(100)),saturationv:Mt("hsv",1,It(100)),value:Mt("hsv",2,It(100)),chroma:Mt("hcg",1,It(100)),gray:Mt("hcg",2,It(100)),white:Mt("hwb",1,It(100)),wblack:Mt("hwb",2,It(100)),cyan:Mt("cmyk",0,It(100)),magenta:Mt("cmyk",1,It(100)),yellow:Mt("cmyk",2,It(100)),black:Mt("cmyk",3,It(100)),x:Mt("xyz",0,It(100)),y:Mt("xyz",1,It(100)),z:Mt("xyz",2,It(100)),l:Mt("lab",0,It(100)),a:Mt("lab",1),b:Mt("lab",2),keyword:function(e){return arguments.length?new qt(e):Rt[this.model].keyword(this.color)},hex:function(e){return arguments.length?new qt(e):Ft.to.hex(this.rgb().round().color)},rgbNumber:function(){var e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity:function(){for(var e=this.rgb().color,t=[],r=0;r<e.length;r++){var o=e[r]/255;t[r]=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4)}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(e){var t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)},level:function(e){var t=this.contrast(e);return t>=7.1?"AAA":t>=4.5?"AA":""},isDark:function(){var e=this.rgb().color;return(299*e[0]+587*e[1]+114*e[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var e=this.rgb(),t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten:function(e){var t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken:function(e){var t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate:function(e){var t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate:function(e){var t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten:function(e){var t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken:function(e){var t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale:function(){var e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return qt.rgb(t,t,t)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var t=this.hsl(),r=t.color[0];return r=(r=(r+e)%360)<0?360+r:r,t.color[0]=r,t},mix:function(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);var r=e.rgb(),o=this.rgb(),n=void 0===t?.5:t,i=2*n-1,a=r.alpha()-o.alpha(),s=((i*a==-1?i:(i+a)/(1+i*a))+1)/2,l=1-s;return qt.rgb(s*r.red()+l*o.red(),s*r.green()+l*o.green(),s*r.blue()+l*o.blue(),r.alpha()*n+o.alpha()*(1-n))}},Object.keys(Rt).forEach((function(e){if(-1===Dt.indexOf(e)){var t=Rt[e].channels;qt.prototype[e]=function(){if(this.model===e)return new qt(this);if(arguments.length)return new qt(arguments,e);var r,o="number"==typeof arguments[t]?t:this.valpha;return new qt((r=Rt[this.model][e].raw(this.color),Array.isArray(r)?r:[r]).concat(o),e)},qt[e]=function(r){return"number"==typeof r&&(r=Et(jt.call(arguments),t)),new qt(r,e)}}}));var Lt=Ee(qt);const Ut=e=>{if(e&&"transparent"!==(e=e.toLowerCase()))try{return Lt(e)}catch(t){try{return Lt("#"+e)}catch(e){return Lt("rgba(255,255,255,0)")}}return Lt("rgba(255,255,255,0)")},Nt=(e,t)=>{let r=Ut(e);if(t){const e={manipulate:(t,o=!0)=>(o&&(r=t(r)),e),makeBlackOrWhite:(t=!0)=>{if(t){const e=(.299*r.red()+.587*r.green()+.114*r.blue())/255;r=r.red(e>.55?0:255).green(e>.55?0:255).blue(e>.55?0:255).alpha(1)}return e},makeUnclear:t=>(t&&0===r.alpha()&&(r=Ut(t)),e)};t(e)}return r.rgb().string()},Wt=fe.span`
color: ${e=>Nt(e.$errorColor)};
position: relative;
left: 0.1em;
top: 0.18em;
text-transform: uppercase;
font-size: 1.4em;
line-height: 0.5em;
&:after {
content: "*";
}
`,_t=e=>btoa(`<?xml version="1.0" encoding="utf-8"?>\n <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20">\n <path d="M16.218 3.782c-1.794-1.794-4.18-2.782-6.718-2.782s-4.923 0.988-6.718 2.782-2.782 4.18-2.782 6.717 0.988 4.923 2.782 6.718 4.18 2.782 6.718 2.782 4.923-0.988 6.718-2.782 2.782-4.18 2.782-6.718-0.988-4.923-2.782-6.717zM9.5 19c-4.687 0-8.5-3.813-8.5-8.5s3.813-8.5 8.5-8.5c4.687 0 8.5 3.813 8.5 8.5s-3.813 8.5-8.5 8.5z" fill="${e}"></path>\n <path d="M9.5 18c-0 0 0 0 0 0-0.276 0-0.5-0.224-0.5-0.5v-1c0-0.276 0.224-0.5 0.5-0.5v0c0.276 0 0.5 0.224 0.5 0.5v1c0 0.276-0.224 0.5-0.5 0.5z" fill="${e}"></path>\n <path d="M9.5 15c-0.276 0-0.5-0.224-0.5-0.5v-10c0-0.276 0.224-0.5 0.5-0.5s0.5 0.224 0.5 0.5v10c0 0.276-0.224 0.5-0.5 0.5z" fill="${e}"></path>\n </svg>`),Ht=fe.button`
appearance: none;
font-size: 1em;
line-height: 1.5em;
outline: none;
user-select: none;
box-sizing: border-box;
background-color: ${e=>"fill"===e.$mode&&Nt(e.$baseColor)||"transparent"};
border: ${e=>`${e.$outlineSize}px solid ${Nt(e.$baseColor,(t=>t.manipulate((e=>e.darken(.1)),"fill"===e.$mode)))}`};
border-left: ${e=>"middle"===e.$group||"end"===e.$group?"none":void 0};
color: ${e=>Nt(e.$textColor||e.$baseColor,(t=>t.makeBlackOrWhite(!e.$textColor&&"fill"===e.$mode)))};
text-align: left;
border-radius: ${e=>w(e.$roundness)?`${e.$roundness}px`:"0.5em"};
border-top-left-radius: ${e=>e.$group&&"start"!==e.$group?"0":void 0};
border-bottom-left-radius: ${e=>e.$group&&"start"!==e.$group?"0":void 0};
border-top-right-radius: ${e=>e.$group&&"end"!==e.$group?"0":void 0};
border-bottom-right-radius: ${e=>e.$group&&"end"!==e.$group?"0":void 0};
width: ${e=>e.$isImage&&`calc(${"small"===e.$size?75:"large"===e.$size?300:150}px + 1.5em)`};
overflow: ${e=>e.$isImage?"hidden":void 0};
padding: ${e=>.375*e.$scale+"em 0.75em"};
padding-top: ${e=>e.$isImage?"0.75em":void 0};
padding-bottom: ${e=>e.$isImage&&!e.$hasLabel?"0.75em":void 0};
margin: 0;
opacity: ${e=>"outline"===e.$mode?.2:.4};
transition:
color 0.15s ease-in-out,
background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out,
box-shadow 0.15s ease-in-out,
opacity 0.15s ease-in-out;
@media (max-device-width: 500px) {
width: ${e=>e.$isImage&&`calc(${"small"===e.$size?75:"large"===e.$size?280:120}px + 1.5em)`};
}
@media (max-width: 500px) {
width: ${e=>e.$isImage&&`calc(${"small"===e.$size?75:"large"===e.$size?240:120}px + 1.5em)`};
}
> div {
display: flex;
width: ${e=>("small"===e.$size?75:"large"===e.$size?300:150)+"px"};
height: ${e=>("small"===e.$size?75:"large"===e.$size?300:150)+"px"};
min-width: 100%;
background-repeat: no-repeat;
background-size: cover;
background-position: center center;
justify-content: center;
align-items: center;
overflow: hidden;
white-space: nowrap;
> span {
font-size: ${e=>("small"===e.$size?40:"large"===e.$size?160:80)+"px"};
}
@media (max-device-width: 500px) {
width: ${e=>("small"===e.$size?75:"large"===e.$size?240:120)+"px"};
height: ${e=>("small"===e.$size?75:"large"===e.$size?240:120)+"px"};
> span {
font-size: ${e=>("small"===e.$size?40:"large"===e.$size?136:68)+"px"};
}
}
@media (max-width: 500px) {
width: ${e=>("small"===e.$size?75:"large"===e.$size?240:120)+"px"};
height: ${e=>("small"===e.$size?75:"large"===e.$size?240:120)+"px"};
> span {
font-size: ${e=>("small"===e.$size?40:"large"===e.$size?136:68)+"px"};
}
}
}
> span {
display: block;
> span {
display: table-cell;
> small {
display: block;
font-size: 0.8em;
opacity: 0.8;
}
> svg {
width: 1em;
height: 1em;
position: relative;
top: ${e=>"solo"!==e.$iconPosition&&"-2px"};
margin-left: ${e=>"right"===e.$iconPosition&&"0.5em"};
margin-right: ${e=>"left"===e.$iconPosition&&"0.5em"};
overflow: hidden;
vertical-align: middle;
path {
fill: ${e=>Nt(e.$textColor||e.$baseColor,(t=>t.makeBlackOrWhite(!e.$textColor&&"fill"===e.$mode)))};
transition: fill 0.15s ease-in-out;
}
}
}
}
> div + span {
display: flex;
justify-content: center;
margin-top: ${e=>.375*e.$scale+"em"};
text-align: center;
}
&:not(:disabled) {
cursor: pointer;
opacity: 1;
&:hover {
background-color: ${e=>"fill"===e.$hover&&Nt(e.$baseColor,(t=>t.manipulate((e=>e.darken(.05)),"fill"===e.$mode)))||void 0};
border-color: ${e=>"fill"===e.$hover&&Nt(e.$baseColor,(t=>t.manipulate((e=>e.darken(.1)),"fill"===e.$mode)))||void 0};
color: ${e=>"outline"===e.$mode&&"fill"===e.$hover&&Nt(e.$baseColor,(e=>e.makeBlackOrWhite()))||void 0};
box-shadow: 0 0 0 0.2rem ${e=>Nt(e.$baseColor,(e=>e.manipulate((e=>e.alpha(.2)))))};
svg {
path {
fill: ${e=>"outline"===e.$mode&&"fill"===e.$hover&&Nt(e.$baseColor,(e=>e.makeBlackOrWhite()))||void 0};
}
}
}
&:focus {
box-shadow: 0 0 0 0.2rem ${e=>Nt(e.$baseColor,(e=>e.manipulate((e=>e.alpha(.5)))))};
}
&:active {
box-shadow: 0 0 0 0.2rem ${e=>Nt(e.$baseColor,(e=>e.manipulate((e=>e.alpha(.5)))))};
background-color: ${e=>"fill"===e.$hover&&Nt(e.$baseColor,(e=>e.manipulate((e=>e.darken(.15)))))};
}
}
`,Kt=e=>{const t=e.label?e.iconPosition||"left":"solo",r=e.disabled||!e.onClick&&!e.hyperlink;return ue(Ht,{ref:e.onAutoFocus,type:"button",disabled:r,tabIndex:e.tabIndex,"aria-describedby":e.ariaDescribedBy,onFocus:e.onFocus,onBlur:e.onBlur,onKeyDown:t=>e.onTab&&"Tab"===t.key&&!t.shiftKey?(t.preventDefault(),void e.onTab()):e.onCancel&&"Tab"===t.key&&t.shiftKey?(t.preventDefault(),void e.onCancel()):void(e.onKeyDown&&e.onKeyDown(t)),onClick:t=>{t.stopPropagation(),e.hyperlink?window.open(e.hyperlink.url,`_${e.hyperlink.target||"self"}`,"noopener"):e.onClick&&e.onClick()},$baseColor:e.styles.baseColor,$textColor:e.styles.textColor,$outlineSize:e.styles.outlineSize||1,$roundness:e.styles.roundness,$mode:e.styles.mode||"fill",$hover:e.styles.hover||"fill",$iconPosition:t,$scale:e.styles.scale||1,$group:e.styles.group,$hasLabel:!(!e.icon&&!e.label),$isImage:!(!e.image&&!e.emoji),$size:e.size||"medium",children:[(e.image||e.emoji)&&le("div",{style:{backgroundImage:e.image&&`url("${e.image}")`||void 0},children:e.emoji&&le("span",{children:e.emoji})}),(e.icon||e.label)&&ue("span",{children:[e.icon&&"right"!==t&&le("span",{children:e.icon}),e.label&&ue("span",{children:[e.label,e.description&&le("small",{children:e.description})]}),e.icon&&"right"===t&&le("span",{children:e.icon})]})]})};const Yt=32,Xt=16,Jt=500;var Zt={}.hasOwnProperty,Gt=/[ -,\.\/:-@\[-\^`\{-~]/,Qt=/[ -,\.\/:-@\[\]\^`\{-~]/,er=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,tr=function e(t,r){r=function(e,t){if(!e)return t;var r={};for(var o in t)r[o]=Zt.call(e,o)?e[o]:t[o];return r}(r,e.options),"single"!=r.quotes&&"double"!=r.quotes&&(r.quotes="single");for(var o="double"==r.quotes?'"':"'",n=r.isIdentifier,i=t.charAt(0),a="",s=0,l=t.length;s<l;){var c=t.charAt(s++),u=c.charCodeAt(),d=void 0;if(u<32||u>126){if(u>=55296&&u<=56319&&s<l){var p=t.charCodeAt(s++);56320==(64512&p)?u=((1023&u)<<10)+(1023&p)+65536:s--}d="\\"+u.toString(16).toUpperCase()+" "}else d=r.escapeEverything?Gt.test(c)?"\\"+c:"\\"+u.toString(16).toUpperCase()+" ":/[\t\n\f\r\x0B]/.test(c)?"\\"+u.toString(16).toUpperCase()+" ":"\\"==c||!n&&('"'==c&&o==c||"'"==c&&o==c)||n&&Qt.test(c)?"\\"+c:c;a+=d}return n&&(/^-[-\d]/.test(a)?a="\\-"+a.slice(1):/\d/.test(i)&&(a="\\3"+i+" "+a.slice(1))),a=a.replace(er,(function(e,t,r){return t&&t.length%2?e:(t||"")+r})),!n&&r.wrap?o+a+o:a};tr.options={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1},tr.version="3.0.0";var rr=Ee(tr);const or=(e,t)=>{var r,o,n,i,a;const s=rr((null===(r=e.navigation)||void 0===r?void 0:r.backgroundColor)||("rgb(0, 0, 0)"===t?"#f8f9fa":Nt(t,(e=>e.manipulate((e=>e.alpha(.1))))))),l=rr((null===(o=e.navigation)||void 0===o?void 0:o.textColor)||(null===(n=e.navigation)||void 0===n?void 0:n.backgroundColor)&&Nt(null===(i=e.navigation)||void 0===i?void 0:i.backgroundColor,(e=>e.makeBlackOrWhite()))||t);return{backgroundColor:s,textColor:l,progressbarColor:rr((null===(a=e.navigation)||void 0===a?void 0:a.progressbarColor)||l)}},nr=(e,t,r,o)=>{var n,i,s,l,c,u,d,p,h,v,g,f;const b=rr(e.background&&e.background.color||"transparent"),m=Nt(e.color||Nt(b,(e=>e.makeUnclear("#fff").makeBlackOrWhite())),(e=>e.makeUnclear("#000")));return Object.assign(Object.assign({},e),{direction:"horizontal"===e.direction?"horizontal":"vertical",verticalAlignment:e.verticalAlignment||"middle",background:{color:b,url:e.background&&e.background.url&&rr(e.background.url,{quotes:"double"})||void 0,opacity:(null===(n=e.background)||void 0===n?void 0:n.color)&&(null===(i=e.background)||void 0===i?void 0:i.url)?a.range(.01*k(null===(s=e.background)||void 0===s?void 0:s.opacity,100),0,1):1,positioning:rr(e.background&&e.background.positioning||"auto")},font:{family:rr(e.font&&e.font.family||"sans-serif"),size:e.font&&e.font.size&&a.range(k(e.font.size,Xt),8,30)||Xt,sizeSmall:e.font&&e.font.sizeSmall&&a.range(k(e.font.sizeSmall,14),8,30)||14,color:m},inputs:{backgroundColor:rr(e.inputs&&e.inputs.backgroundColor||"transparent"),borderColor:rr(e.inputs&&e.inputs.borderColor||m),borderSize:e.inputs&&k(e.inputs.borderSize,1)||1,roundness:null===(l=e.inputs)||void 0===l?void 0:l.roundness,textColor:rr(e.inputs&&e.inputs.textColor||m),errorColor:rr(e.inputs&&e.inputs.errorColor||"red"),scale:1.62},checkboxes:{backgroundColor:rr(e.inputs&&e.inputs.backgroundColor||"transparent"),borderColor:rr(e.inputs&&e.inputs.borderColor||m),borderSize:e.inputs&&k(e.inputs.borderSize,1)||1,roundness:null===(c=e.inputs)||void 0===c?void 0:c.roundness,textColor:m,errorColor:rr(e.inputs&&e.inputs.errorColor||"red"),scale:1,hideRequiredIndicator:e.hideRequiredIndicator||!1},radiobuttons:{backgroundColor:rr(e.inputs&&e.inputs.backgroundColor||"transparent"),borderColor:rr(e.inputs&&e.inputs.borderColor||m),borderSize:e.inputs&&k(e.inputs.borderSize,1)||1,textColor:m,scale:1},matrix:{backgroundColor:rr(e.inputs&&e.inputs.backgroundColor||"transparent"),borderColor:rr(e.inputs&&e.inputs.borderColor||m),borderSize:e.inputs&&k(e.inputs.borderSize,1)||1,textColor:m,errorColor:rr(e.inputs&&e.inputs.errorColor||"red"),scale:1,hideRequiredIndicator:e.hideRequiredIndicator||!1},yesNo:{yesColor:rr(e.inputs&&e.inputs.agreeColor||"green"),noColor:rr(e.inputs&&e.inputs.declineColor||"red"),alignment:"horizontal",outlineSize:e.inputs&&k(e.inputs.borderSize,1)||1,roundness:null===(u=e.inputs)||void 0===u?void 0:u.roundness,scale:1.62,margin:8},rating:{color:rr(e.inputs&&e.inputs.selectionColor||m),scale:2},scale:{color:rr(e.inputs&&e.inputs.selectionColor||m),outlineSize:e.inputs&&k(e.inputs.borderSize,1)||1,roundness:null===(d=e.inputs)||void 0===d?void 0:d.roundness,scale:1.62,margin:8,labelColor:m},multipleChoice:{color:rr(e.inputs&&e.inputs.selectionColor||m),outlineSize:e.inputs&&k(e.inputs.borderSize,1)||1,roundness:null===(p=e.inputs)||void 0===p?void 0:p.roundness,scale:1.62,margin:8},pictureChoice:{color:rr(e.inputs&&e.inputs.selectionColor||m),outlineSize:e.inputs&&k(e.inputs.borderSize,1)||1,roundness:null===(h=e.inputs)||void 0===h?void 0:h.roundness,scale:1.62,margin:8},fileUpload:{backgroundColor:rr(e.inputs&&e.inputs.backgroundColor||"transparent"),borderColor:rr(e.inputs&&e.inputs.borderColor||m),borderSize:e.inputs&&k(e.inputs.borderSize,1)||1,roundness:null===(v=e.inputs)||void 0===v?void 0:v.roundness,textColor:rr(e.inputs&&e.inputs.textColor||m),errorColor:rr(e.inputs&&e.inputs.errorColor||"red"),scale:1},buttons:{baseColor:rr(e.buttons&&e.buttons.baseColor||m),outlineSize:e.inputs&&k(e.inputs.borderSize,1)||1,roundness:null===(g=e.buttons)||void 0===g?void 0:g.roundness,mode:e.buttons&&"outline"===e.buttons.mode?"outline":"fill",textColor:e.buttons&&e.buttons.textColor&&rr(e.buttons.textColor)||void 0,scale:1.62},finishButton:{baseColor:rr(e.buttons&&(e.buttons.finishColor||e.buttons.baseColor)||"green"),outlineSize:e.inputs&&k(e.inputs.borderSize,1)||1,roundness:null===(f=e.buttons)||void 0===f?void 0:f.roundness,textColor:e.buttons&&!e.buttons.finishColor&&e.buttons.textColor&&rr(e.buttons.textColor)||void 0,mode:"fill",scale:1.62},navigation:"always"===e.showNavigation||t&&"auto"===$(e.showNavigation,"auto")?or(e,m):void 0,showProgressbar:x(e.showProgressbar,!0),showSeparateSubmit:x(e.showSeparateSubmit,!0),showPreviousButton:x(e.showPreviousButton,!0),showScrollbar:"vertical"===e.direction&&!e.disableScrolling&&e.showScrollbar,noBranding:r&&(o||e.noBranding)||!1})};function ir(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}let ar=class extends z{isMatch(){const e=this.valueOf();if(e){const t=P.lowercase(e.string),r=P.lowercase((()=>{if(B(this.props.match)){const e=this.variableFor(this.props.match);return e&&e.hasValue?e.string:""}return this.parseVariables(this.props.match||"")})());switch(this.props.mode){case"domain":case"not-domain":return r&&t.substr(t.lastIndexOf("@")+1)===r==("domain"===this.props.mode)||!1;case"address":case"not-address":return t===r==("address"===this.props.mode)||!1;case"defined":return""!==t;case"undefined":return""===t}}return!1}};ir([S],ar.prototype,"isMatch",null),ar=ir([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-email"})],ar);const sr=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,lr=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;let cr=class extends V{constructor(){super(...arguments),this.emailSlot=F(this.valueOf("email")),this.required=this.emailSlot.slot.required||!1}validate(){return!this.emailSlot.string||("rfc822"===this.props.validation?sr:lr).test(this.emailSlot.value)}};ir([O],cr.prototype,"validate",null);const ur=(e,t)=>{void 0!==t&&e(t)},dr=(e,t,r)=>o=>{e(!0),r&&ur(t,r(o))},pr=(e,t,r)=>o=>{e(!1),r&&ur(t,r(o))},hr=e=>{e.current.id=setTimeout((()=>e.current.cb&&e.current.cb()),200)},vr=50,gr=1e3/60,fr=1e3,br=fe.input`
appearance: none;
outline: none;
box-sizing: border-box;
display: block;
width: 100%;
font-size: 1em;
line-height: 1.5em;
background-color: ${e=>Nt(e.$error&&"transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor?e.$errorColor:e.$backgroundColor)};
background-image: ${e=>e.$error?`url("data:image/svg+xml;base64,${_t(Nt(e.$errorColor,(t=>t.makeBlackOrWhite("transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor))))}")`:void 0};
background-repeat: no-repeat;
background-size: ${8/7}em;
background-position: right 0.375em center;
border: ${e=>`${"transparent"===e.$backgroundColor&&"transparent"===e.$borderColor?0:e.$borderSize}px solid ${Nt(e.$error?e.$errorColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)}`};
color: ${e=>Nt(e.$error?"transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor?Nt(e.$errorColor,(e=>e.makeBlackOrWhite())):e.$errorColor:e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
border-radius: ${e=>w(e.$roundness)?`${e.$roundness}px`:"0.5em"};
padding: ${e=>"transparent"===e.$backgroundColor&&"transparent"===e.$borderColor?"0":.375*e.$scale+"em 0.75em"};
padding-right: ${e=>e.$error&&8/7+.75+"em"||void 0};
margin: 0;
opacity: 0.65;
transition:
color 0.15s ease-in-out,
background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out,
box-shadow 0.15s ease-in-out,
opacity 0.15s ease-in-out;
&::placeholder {
color: ${e=>Nt(e.$error?"transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor?Nt(e.$errorColor,(e=>e.makeBlackOrWhite())):e.$errorColor:e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
opacity: 0.5;
transition: color 0.15s ease-in-out opacity 0.15s ease-in-out;
}
&:not(:disabled):not([readonly]) {
opacity: 1;
&:hover {
box-shadow: ${e=>("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$error?e.$errorColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.2)))))}`||void 0};
}
&:focus {
background-color: ${e=>Nt(e.$backgroundColor)};
background-image: ${e=>e.$errorVisible?void 0:"none"};
border-color: ${e=>Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)};
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
box-shadow: ${e=>("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.5)))))}`||void 0};
&::placeholder {
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
opacity: 0.3;
}
}
}
`,mr=e=>{const t=e.value,r=de({duration:0,handle:0}),[o,i]=pe(!1),[s,l]=pe("object"==typeof t?$(t.pristine):t||""),[c,u]="object"==typeof t?[o?s:t.string,o=>{R(r.current.handle),l(o);const i=a.range(2*r.current.duration,gr,fr);r.current.handle=j((()=>{const i=n.precise;r.current.handle=0,r.current.update=()=>{r.current.duration=n.elapsed(i,!0),r.current.update=void 0},"url"===e.type&&o&&-1===o.toLowerCase().indexOf("://")?t.pristine=`https://${o}`:t.pristine=o||void 0}),i)}]:[s,l],[d,p]=pe(!!c),h=de();return he((()=>{h.current&&!o&&(h.current.value=c)}),[c]),he((()=>()=>{R(r.current.handle)}),[]),r.current.update&&r.current.update(),le(br,{id:e.id,ref:t=>{e.onAutoFocus&&e.onAutoFocus(t),h.current=t},type:e.type||"text",list:e.list,tabIndex:e.tabIndex,placeholder:e.placeholder,required:e.required||!1,disabled:e.disabled||!1,readOnly:e.readOnly||"object"==typeof t&&(t.isFrozen||t.isLocked)||!1,maxLength:e.maxLength||void 0,defaultValue:c,name:e.autoComplete,autoComplete:e.autoComplete||"off",inputMode:e.inputMode||"text","aria-describedby":e.ariaDescribedBy,onChange:t=>{u(t.target.value),p(!0),e.onChange&&ur(u,e.onChange(t.target.value))},onFocus:dr(i,u,e.onFocus),onBlur:pr(i,u,e.onBlur),onKeyDown:t=>{"Enter"===t.key&&e.onSubmit?(t.preventDefault(),e.onSubmit()):"Escape"===t.key?t.currentTarget.blur():"Tab"===t.key&&(t.shiftKey?e.onCancel&&(t.preventDefault(),e.onCancel()):e.onSubmit&&(t.preventDefault(),e.onSubmit()))},$backgroundColor:e.styles.backgroundColor||"transparent",$borderColor:e.styles.borderColor||"transparent",$borderSize:e.styles.borderSize||1,$roundness:e.styles.roundness,$textColor:e.styles.textColor,$errorColor:e.styles.errorColor,$errorVisible:d,$error:e.error||!1,$scale:e.styles.scale||1})},yr=e=>mr(Object.assign(Object.assign({type:"email",inputMode:"email",autoComplete:"email"},e),{placeholder:e.placeholder||"@"}));let $r=class extends cr{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(yr,{id:e.id,styles:e.styles.inputs,value:this.emailSlot,required:this.required,error:e.isFailed,tabIndex:e.tabIndex,placeholder:e.placeholder,ariaDescribedBy:e.ariaDescribedBy,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};$r=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-email"})],$r);const wr=e=>{var t;const n=function(e,t){const n=t||{},a=de(),f=de(),b=de(),m=de([]),y=de(),$=de("test"===(w=e.view)||"preview"===w?w:"live");var w;const k=de(!1),x=de(),C=de("live"===$.current&&e.snapshot&&n.restore),[S,O]=pe(),[z,P]=pe(),B=de(),[V,F]=pe({}),R=de(),j=e=>R.current&&R.current(e),D=e=>({runnerRef:a,storylineRef:b,viewRef:$,promiseRef:x,sequence:e,rules:n,reset:()=>j(void 0),restart:H,update:W});let T=!1;const A=de(new s((()=>{a.current&&a.current.instance&&f.current&&f.current.onChange&&f.current.onChange(a.current.instance)}))),q=de(new s((()=>{a.current&&a.current.instance&&f.current&&f.current.onData&&f.current.onData(a.current.instance)}))),M=()=>a.current&&!a.current.isRunning&&!a.current.isFinishing&&!a.current.isPausing||!1,I=()=>"preview"!==$.current&&a.current&&!a.current.isFinishing&&!a.current.isPausing||!1,E=e=>{return!(!("live"===$.current&&a.current&&a.current.isRunning&&b.current)||b.current.isEmpty||b.current.isEvaluating||a.current.isFinishing||a.current.isPausing)&&!!(e||"sequence"!==n.mode||(t=He(m.current))&&(n.canInteract?n.canInteract(t):"node"===t.type)&&t);var t},L=()=>a.current&&a.current.isRunning&&!a.current.isFinishing&&!a.current.isPausing&&(!b.current||!b.current.isEmpty)||!1,U=(t,r)=>{e.onAction&&r&&a.current&&a.current.isRunning&&e.onAction(t,{fingerprint:a.current.fingerprint,name:a.current.name},r&&{id:r.key,name:r.props.name||"",get alias(){var e;const t=d(null===(e=r.block)||void 0===e?void 0:e.props,"alias");if(t)return t;if(r.node.slots){const e=p(r.node.slots.all,(e=>!("static"!==e.kind||!e.alias)));if(e)return e.alias}}})},N=e=>{if(T=!0,a.current){const t=a.current.storyline;if(b.current=t,"sequence"===n.mode){const o=m.current;if(!t||t.isFinishing||t.isPausing||!t.isChanged&&!e){if(!t&&"finished"!==a.current.status&&"paused"!==a.current.status){const e=(p(o,(e=>("test"===$.current||!e.isHistory)&&"prologue"!==e.type))||{index:o.length}).index;o.splice(e,o.length-e)}}else{const e=o.length>0&&"prologue"===o[0].type&&o[0],a=t.prologue;e&&!a||!e&&a?_():e&&a&&r(e,"prologue",a);const s=t.nodes,l=He(o);let c=0,u=l&&(l.node&&l.node.key||l.index)||C.current&&C.current.key||-1,d=(p(o,(e=>"preview"===$.current?"prologue"!==e.type:!e.isHistory&&"node"===e.type))||{index:o.length}).index;for(;d<o.length&&c<s.length;d++,c++){const e=o[d],t=s[c];if(!e.node||e.node.key!==t.key)break;if(r(e,"node",t),(e.isPreActive||e.isBeforeActive||e.isActive||e.isAfterActive||e.isPostActive)&&(u=d),"preview"!==$.current&&t.isFailed){d++,c++;break}}for(d<o.length&&o.splice(d,o.length-d);c<s.length;c++,d++){const e=s[c],t=Ye(D(o),u===e.key||-1===u&&"preview"!==$.current||(h(u)||-1===u)&&"preview"!==$.current&&e.isFailed?"active":h(u)||-1===u&&"preview"===$.current?"past":"upcoming","node",e,U);"active"===t.state&&(t.activate(e.key!==C.current&&(1===o.length||t.index>0&&t.index<o.length&&o[t.index-1].isHistory)),u=d)}if("preview"!==$.current){if(t.isEmpty&&1===o.length&&"prologue"===o[0].type&&(Ye(D(o),"upcoming","epilogue",t.epilogue),"live"===$.current&&n.banner&&y.current)){const e=n.banner(y.current);e&&Ye(D(o),"upcoming","epilogue",e)}if(h(u)||-1===u){const e=p(o,(e=>!e.isHistory&&(!e.node||e.node.isFailed)))||i(o,(e=>!e.isHistory));e&&e.activate(!0)}}else{const e=o.length>0&&"epilogue"===o[o.length-1].type&&o[o.length-1];if(!e&&o.length>0){const e=Ye(D(o),"upcoming","epilogue",t.epilogue);l&&"epilogue"===l.type&&e.activate(!1)}else e&&r(e,"epilogue",t.epilogue)}}if(C.current){if(C.current.timeStamp){const e=He(o);e&&r(e,"timeStamp",C.current.timeStamp)}C.current=void 0}}!t&&n.onRestart&&n.onRestart()}T=!1,W()},W=()=>{var e;if(!T){if("sequence"===n.mode&&"preview"!==$.current){const t=He(m.current);if(t&&"active"===t.state&&("node"===t.type&&n.canActivate&&n.canActivate(t)||"epilogue"===t.type||"paused"===t.type))t.next();else if(!t&&"blend"===n.prologue){const t=1===m.current.length&&"prologue"===m.current[0].type&&m.current[0];t&&t.isHistory&&t.prologue&&!t.prologue.button&&(null===(e=a.current)||void 0===e||e.start())}}F((e=>({current:e.current}))),A.current.invoke()}},_=()=>{j(void 0),B.current=void 0,"sequence"===n.mode&&(m.current.splice(0,m.current.length),a.current&&a.current.prologue&&Ye(D(m.current),"history","prologue",a.current.prologue))},H=(e=!1)=>{if(I()&&a.current){if(_(),e&&a.current.isRunning||!a.current.prologue)a.current.restart(e);else if(a.current.stop(),"sequence"===n.mode){const t=1===m.current.length&&"prologue"===m.current[0].type&&m.current[0];t&&t.activate(!e)}else W();!e&&n.onRestart&&n.onRestart()}},K=()=>{if(a.current&&M()){if("sequence"===n.mode){const e=o(m.current,0);if(e&&"prologue"===e.type)return void e.activate(!0)}a.current.start()}};if(R.current=e=>{V.current!==e&&(F({current:e}),A.current.invoke())},y.current||(y.current=e.l10nNamespace||l.Namespace.create(n.namespace||"")),S&&"sequence"===n.mode){const e=m.current.length>0&&"prologue"===m.current[0].type&&m.current[0];e&&r(e,"prologue",S.prologue)}if(z){if("sequence"===n.mode){const e=m.current,t=e.length>0&&"epilogue"===e[e.length-1].type&&e[e.length-1];!t&&z.epilogue&&"preview"===$.current?Ye(D(e),"upcoming","epilogue",z.epilogue):t&&r(t,"epilogue",z.epilogue)}B.current&&(B.current=Object.assign(Object.assign({},z.epilogue),{context:B.current.context}))}if(!a.current){if(a.current=new c({namespace:n.namespace,definition:e.definition,l10n:y.current,mode:"sequence"===n.mode?"progressive":n.mode||"progressive",bookmarks:n.bookmarks||"default",preview:"preview"===$.current,test:"test"===$.current,snapshot:"live"===$.current&&e.snapshot||void 0,data:e.onImport}),C.current="live"===$.current&&n.restore||void 0,a.current.onChange=()=>N(!1),a.current.onData=()=>{j(void 0),q.current.invoke(),n.onInteraction&&n.onInteraction()},a.current.onFinish=t=>("live"!==$.current||e.onSubmit||e.onComplete)&&new Promise(((r,o)=>{const i=a.current&&a.current.storyline,s="sequence"===n.mode&&m.current,c=s&&Ye(D(s),"upcoming","finishing"),d=o=>{s&&v(s,(e=>{"node"===e.type&&e.changeState("history")})),r(o),e.onComplete&&e.onComplete(t,o),g((()=>{if(B.current=i&&i.epilogue,j("finished"),"live"===$.current&&i&&i.epilogue&&i.epilogue.getRedirect){const e=i.epilogue.getRedirect();if(e)return void window.location.replace(e)}if(s&&(c&&c.changeToEpilogue((null==i?void 0:i.epilogue)||{}),"live"===$.current&&n.banner&&y.current)){const e=n.banner(y.current);e&&Ye(D(s),"upcoming","epilogue",e)}}))},p=e=>{c&&c.changeToError("outdated"===e||"rejected"===e?e:"unknown",i&&i.isFinishable&&(()=>{i&&i.isFinishable&&(s&&s.splice(c.index,s.length-c.index),i.finish())})||void 0),j("outdated"===e?"error-outdated":"rejected"===e?"error-rejected":"error"),e&&"outdated"!==e&&"rejected"!==e&&console.log(e),o(e)},h="live"===$.current&&e.onSubmit&&e.onSubmit(t,(e.l10nNamespace||l.Namespace.global).current,(e.l10nNamespace||l.Namespace.global).locale.identifier,n.namespace)||void 0;!h||u(h)?!u(h)||h?d("live"!==$.current?"TEST123":void 0):p():(j("finishing"),c&&c.activate(!0),h.then(d).catch(p))}))||!1,e.onAction){const t=a.current,r=e.onAction;a.current.hook("OnStart","synchronous",(()=>{r("start",{fingerprint:t.fingerprint,name:t.name})})),a.current.hook("OnFinish","synchronous",(()=>{r("complete",{fingerprint:t.fingerprint,name:t.name})})),a.current.hook("OnPause","synchronous",(()=>{r("pause",{fingerprint:t.fingerprint,name:t.name})}))}_(),("boolean"==typeof n.autoStart||"blend"!==n.prologue&&a.current.prologue)&&!n.autoStart||K()}return f.current=e,he((()=>{var e,t;const r=(null===(e=a.current)||void 0===e?void 0:e.uniqueId)||0;return f.current&&f.current.onReady&&f.current.onReady(null===(t=a.current)||void 0===t?void 0:t.instance),()=>{var e;(null===(e=a.current)||void 0===e?void 0:e.uniqueId)===r&&("sequence"===n.mode&&m.current.splice(0,m.current.length),a.current.destroy(),n.onDestroy&&n.onDestroy(),f.current&&f.current.onDestroy&&f.current.onDestroy(),a.current=void 0)}}),[e.definition,e.snapshot]),{l10n:y.current,get definition(){return a.current&&a.current.definition||e.definition},set definition(e){if(C.current&&(C.current=void 0),a.current&&!a.current.isFinishing&&!a.current.isPausing){const t=a.current.reload(e,!("preview"===$.current||!e.prologue)),r=t||a.current.instance;T=!!t,"preview"===$.current||S||z||r&&r.isRunning&&!(m.current.length>0&&"epilogue"===m.current[m.current.length-1].type)||(T=!1,H("test"===$.current))}},get instance(){return a.current&&a.current.instance},get fingerprint(){return a.current&&a.current.fingerprint||""},get stencil(){return a.current&&a.current.stencil("exportables")||""},get actionables(){return a.current&&a.current.stencil("actionables")||""},get view(){return $.current},set view(e){if(e!==$.current){"test"===$.current&&(k.current=a.current&&a.current.isRunning||!1);const t="preview"===e,r="test"===e;if($.current=e,a.current&&(a.current.isTest=r,a.current.isPreview!==t&&(_(),a.current.isPreview=t,"preview"===e||"test"===e&&k.current)))return;H()}},get mode(){var e;return"sequence"!==n.mode&&((null===(e=a.current)||void 0===e?void 0:e.mode)||"progressive")||void 0},set mode(e){"sequence"!==n.mode&&e&&a.current&&(a.current.mode=e)},storyline:"sequence"===n.mode?m.current:b.current,get prologue(){var e,t;return("preview"===$.current||"test"===$.current&&!(null===(e=a.current)||void 0===e?void 0:e.isRunning)&&"finished"!==V.current)&&S?S.prologue:null===(t=a.current)||void 0===t?void 0:t.prologue},get epilogue(){var e;return("preview"===$.current||"test"===$.current&&!(null===(e=a.current)||void 0===e?void 0:e.isRunning)&&"finished"===V.current)&&z?z.epilogue:B.current},get status(){return(b.current&&b.current.isEvaluating?"evaluating":V.current)||a.current&&a.current.status||"empty"},get isRunning(){return a.current&&a.current.isRunning||!1},get isFinishing(){return a.current&&a.current.isFinishing||!1},get isPausing(){return a.current&&a.current.isPausing||!1},get isEvaluating(){return b.current&&b.current.isEvaluating||!1},get allowStart(){return M()},get allowRestart(){return I()},get allowPause(){return E(!1)},get allowStop(){return L()},kickOff:K,start:()=>{if(M()&&a.current)return j(void 0),a.current.start()},restart:H,reload:e=>{C.current&&(C.current=void 0),!a.current||a.current.isFinishing||a.current.isPausing||(T=!!a.current.reload(e,!1),W())},pause:(e,t)=>{if(!a.current||!E(!1))return;const r="sequence"===n.mode&&m.current;if(r){const e=He(r);if(e&&"error"===e.type&&"paused"===e.error)r.splice(e.index,r.length-e.index);else{const t=(o=e)&&(n.canInteract?n.canInteract(o):"node"===o.type)&&o||void 0;t&&t.index+1<r.length&&r.splice(t.index+1,r.length-t.index-1)}}var o;return t?a.current.pause(e,((e,o)=>{const n=()=>{o(!1),j(void 0),i&&(i.undo(),N(!0))},i=r&&Ye(D(r),"upcoming","pausing",n);j("pausing"),i&&i.activate(!0),t(e,((e,t)=>{if(o("succeeded"===e),j("succeeded"===e?"paused":"failed"===e?"error-paused":void 0),i&&"canceled"!==e)if("succeeded"===e)i.changeToPaused(),r&&v(r,(e=>{"node"===e.type&&e.changeState("history")}));else if(i.changeToError("paused",t&&(()=>{i.changeToPausing(n),j("pausing"),t()}),n),t)return;i&&"canceled"===e&&(i.undo(),N(!0))}),i||void 0)})):a.current.pause(e)},snapshot:e=>{if(a.current&&E(!0))return a.current.snapshot(e)},stop:()=>L()&&a.current&&a.current.stop(),update:W,discard:()=>{"error"!==V.current&&"error-outdated"!==V.current&&"error-rejected"!==V.current&&"error-paused"!==V.current||j(void 0)},get preview(){return"preview"===$.current?S?"prologue":z?"epilogue":"blocks":void 0},doAction:U,doPreview:e=>{if("prologue"===e.type){if(O("start"===e.action?{prologue:e.ref}:void 0),"start"===e.action&&e.subscribe){const t=new s((e=>O({prologue:e})),100);e.subscribe((e=>t.invoke(e)))}}else if("epilogue"===e.type&&(P("start"===e.action?{epilogue:e.ref}:void 0),"start"===e.action&&e.subscribe)){const t=new s((e=>P({epilogue:e})),100);e.subscribe((e=>t.invoke(e)))}"preview"===$.current&&n.onPreview&&("prologue"===e.type?n.onPreview(e.action,"prologue",void 0):"epilogue"===e.type?n.onPreview(e.action,"epilogue",void 0):"node"===e.type&&n.onPreview(e.action,"block",e.ref.id))},resetPreview:()=>{S&&O({prologue:void 0}),z&&P({epilogue:void 0})}}}(e,{namespace:Le,mode:(null===(t=e.styles)||void 0===t?void 0:t.hideWhenFailed)?"progressive":"ahead",onPreview:(t,r,o)=>{"start"===t&&e.onScrollIntoView&&"block"===r&&o&&!e.onScrollIntoView(o)?S.current=o:"end"===t&&(S.current=void 0)},onRestart:()=>{C.current&&C.current()},onDestroy:()=>{var t;(null===(t=e.controller)||void 0===t?void 0:t.current)&&(e.controller.current=void 0)}}),a=function(){const e=de();if(!e.current){const t={};e.current={fetch:(e,r,o,n,i)=>{const a=r.key,s=!r.hasChanged()&&t[a];return s&&s.isActivated===n&&s.status===o&&s.isPassed===r.isPassed&&s.tabIndex===i?s.buffer:(t[a]={buffer:e(),status:o,isActivated:n,isPassed:r.isPassed,tabIndex:i}).buffer},purge:()=>{v(t,((e,r)=>{delete t[r]}),{keys:!0})}}}return e.current}(),[f]=pe((()=>e.license&&D("@tripetto/runner-autoscroll",e.license)||!1)),[b,m,y]=((e,t,r,o,n,i)=>{const a=de(e||{}),s=de();return s.current||(s.current=nr(a.current,t,r,o)),[a.current,s.current,e=>{a.current=e,s.current=nr(e,t,r,o),n(e.hideWhenFailed?"progressive":"ahead"),i()}]})(e.styles,"live"!==n.view||"page"===e.display,f,e.removeBranding||!1,(e=>n.mode=e),(()=>{a.purge(),n.update()})),[$,w,k]=((e,t,r,o)=>{const n=de(e||{}),i=de(),a=e=>{n.current=e,i.current&&i.current()};return i.current=()=>{o&&o(),r.update()},[n.current,e=>{t?t(e).then((()=>a(e))).catch((()=>a(e))):a(e)},e=>{t&&("auto"!==n.current.language&&n.current.language||e||navigator.language)!==r.l10n.current&&t(n.current).then((()=>{i.current&&i.current()}))}]})(e.l10n,e.onL10n,n,(()=>a.purge())),x=de(),C=de(),S=de(),O=de(),z=de(),P=()=>e.onPause?n.pause(e.onSnapshot("pause"),((t,o)=>{const a=(r,n)=>{var i;z.current&&e.onSnapshotEnd(null===(i=t.b)||void 0===i?void 0:i.a),z.current=void 0,o(r,n)},s=e=>{const t=e();!t||u(t)?a(u(t)&&!t?"failed":"succeeded",(()=>s(e))):t.then((()=>{a("succeeded")})).catch((t=>{a("failed",(()=>s(e))),t&&console.log(t)}))};if(A(e.onPause)){const r=e.onPause;s((()=>r(t,(e.l10nNamespace||l.Namespace.global).current,(e.l10nNamespace||l.Namespace.global).locale.identifier,Le)))}else if(e.onPause&&"email"===e.onPause.recipe){const o=e.onPause.onPause;e.onSnapshotStart(),z.current={recipe:"email",isCompleting:!1,complete:i=>{z.current=Object.assign(Object.assign({},z.current),{isCompleting:!0}),t.b?r(t.b,"d",i):r(t,"b",{d:i}),O.current=t,n.update(),s((()=>o(i,t,(e.l10nNamespace||l.Namespace.global).current,(e.l10nNamespace||l.Namespace.global).locale.identifier,Le)))},cancel:()=>a("canceled"),get emailAddress(){const t=O.current||e.snapshot,r=n.storyline&&i(n.storyline.nodes,(e=>!!(e.isPassed&&e.block instanceof $r)));return t&&t.b&&t.b.d||r&&r.block instanceof $r&&r.block.emailSlot.isSealed&&r.block.emailSlot.value||""}}}else a("succeeded")})):n.pause(e.onSnapshot("pause")),B={title:n.definition.name,view:n.view,preview:n.preview,storyline:n.storyline,update:n.update,start:()=>(e.onStart&&e.onStart(),n.start()),restart:n.restart,reload:n.reload,isFinishable:n.storyline&&(n.storyline.isFinishable||"preview"===n.view)||!1,isPausable:!("live"!==n.view||!e.onPause),pause:n.allowPause&&e.onPause&&P||void 0,pausing:z.current,status:n.status,prologue:("stopped"===n.status||"prologue"===n.preview)&&n.prologue||void 0,epilogue:"finished"===n.status||"epilogue"===n.preview?n.epilogue||{}:void 0,discard:n.discard,resetPreview:n.resetPreview};return C.current=e.onRestart,(e.controller||e.onController)&&(x.current={get definition(){return n.definition},set definition(e){n.definition=e,k(n.definition&&n.definition.language)},get instance(){return n.instance},get fingerprint(){return n.fingerprint},get styles(){return b},set styles(e){y(e)},get l10n(){return $},set l10n(e){w(e)},get view(){return n.view},set view(e){n.view=e},get snapshot(){return n.snapshot(e.onSnapshot("snapshot"))},get isRunning(){return n.isRunning},get isFinishing(){return n.isFinishing},get isPausing(){return n.isPausing},get isLicensed(){return f},get allowStart(){return n.allowStart},get allowRestart(){return n.allowRestart},get allowPause(){return n.allowPause},get allowStop(){return n.allowStop},start:B.start,restart:B.restart,pause:P,stop:n.stop,doPreview:n.doPreview},e.controller&&(e.controller.current=x.current),e.onController&&e.onController(x)),he((()=>{S.current&&"preview"===n.view&&T((()=>{!S.current||"preview"===n.view&&e.onScrollIntoView&&!e.onScrollIntoView(S.current)||(S.current=void 0)}))})),[B,a,n.l10n,m,e.attachments,n.doAction]};function kr(e,t){const r=e.getBoundingClientRect();return a.inRange(r.left,t.current.left,t.current.left+t.current.width)&&a.inRange(r.right,t.current.left,t.current.left+t.current.width)&&a.inRange(r.top,t.current.top,t.current.top+t.current.height)&&a.inRange(r.bottom,t.current.top,t.current.top+t.current.height)}const xr={},Cr={},Sr={};let Or=0;const zr=e=>("number"==typeof Cr[e]?Cr[e]++:Cr[e]=1,"boolean"!=typeof Sr[e]&&(Sr[e]=!1),[()=>{Sr[e]||(Sr[e]=!0,Pr()||(delete Cr[e],v(xr,(e=>{e&&e.update(!0)}))))},()=>{"number"==typeof Cr[e]&&Cr[e]>0&&(Cr[e]--,Cr[e]||(delete Cr[e],delete Sr[e]))}]),Pr=()=>"boolean"==typeof p(Sr,(e=>!e)),Br=fe.div`
position: absolute;
left: ${e=>e.$isPage||"live"!==e.$view?"32px":0};
top: ${e=>e.$isPage||"live"!==e.$view?"8px":0};
height: ${Yt}px;
transform: ${e=>!e.$isActivated&&`translate${"horizontal"===e.$styles.direction?"X":"Y"}(16px)`};
opacity: ${e=>e.$isActivated?.6:0};
pointer-events: ${e=>e.$isActivated?"auto":"none"};
transition:
opacity 0.3s ease-out 0.2s,
transform 0.3s ease-out 0.2s;
cursor: pointer;
font-size: 12px;
user-select: none;
@media (${e=>"live"===e.$view?"max-device-width":"max-width"}: ${Jt}px) {
left: ${e=>e.$isPage||"live"!==e.$view?"16px":0};
}
> svg {
width: 16px;
height: 16px;
position: relative;
top: ${e=>(e.$styles.direction,3)}px;
margin-right: 4px;
}
&:hover {
opacity: ${e=>e.$isActivated?1:0};
}
`,Vr=e=>ue(Br,{onClick:e.onClick,$styles:e.styles,$view:e.view,$isPage:e.isPage,$isActivated:e.isActivated,children:[le("svg",{viewBox:"0 0 20 20",children:"horizontal"===e.styles.direction?le("path",{fill:e.styles.font.color,d:"M0.646 10.146l6-6c0.195-0.195 0.512-0.195 0.707 0s0.195 0.512 0 0.707l-5.146 5.146h16.293c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5h-16.293l5.146 5.146c0.195 0.195 0.195 0.512 0 0.707-0.098 0.098-0.226 0.146-0.354 0.146s-0.256-0.049-0.354-0.146l-6-6c-0.195-0.195-0.195-0.512 0-0.707z"}):le("path",{fill:e.styles.font.color,d:"M9.146 0.646l-6 6c-0.195 0.195-0.195 0.512 0 0.707s0.512 0.195 0.707 0l5.146-5.146v16.293c0 0.276 0.224 0.5 0.5 0.5s0.5-0.224 0.5-0.5v-16.293l5.146 5.146c0.195 0.195 0.512 0.195 0.707 0 0.098-0.098 0.146-0.226 0.146-0.354s-0.049-0.256-0.146-0.354l-6-6c-0.195-0.195-0.512-0.195-0.707 0z"})}),e.l10n.pgettext("runner#1|🆗 Buttons","Back")]}),Fr=fe.div`
display: block;
color: ${e=>Nt(e.$styles.font.color,(e=>e.manipulate((e=>e.alpha(.4)))))};
margin-top: ${1}em !important;
font-size: 0.85em;
text-align: ${e=>e.$alignment||"left"};
opacity: ${e=>!u(e.$visible)||e.$visible?1:0};
transition: ${e=>"color 0.15s ease-in-out,"+(e.$visible?"opacity 1s ease-out 0.5s":"opacity 0.3s ease-out")};
pointer-events: ${e=>!u(e.$visible)||e.$visible?"auto":"none"};
user-select: none;
> a {
text-decoration: none !important;
transition: color 0.5s;
&:hover {
color: ${e=>e.$styles.font.color} !important;
text-decoration: none !important;
}
}
`,Rr=e=>e.styles.noBranding||"preview"===e.view?le(ce,{}):le(Fr,{$styles:e.styles,$alignment:e.alignment,$visible:e.visible,children:le("a",{href:"https://tripetto.com/your-tripetto-experience/?utm_source=tripetto_runner_autoscroll&utm_medium=tripetto_runners&utm_campaign=tripetto_branding&utm_content=form",target:"_blank",children:e.l10n.pgettext("runner:autoscroll","Powered by Tripetto")})}),jr=fe.div`
display: ${e=>e.$isMessage||"horizontal"!==e.$styles.direction?"block":"flex"};
min-width: 100%;
flex-direction: ${e=>!e.$isMessage&&"horizontal"===e.$styles.direction&&"row"};
flex-wrap: ${e=>!e.$isMessage&&"horizontal"===e.$styles.direction&&"nowrap"};
align-items: ${e=>!e.$isMessage&&"horizontal"===e.$styles.direction&&"start"};
align-self: ${e=>e.$center&&"center"};
opacity: ${e=>x(e.$isCalculated,!0)?1:0};
font-size: ${e=>e.$size&&`${e.$size}px`||void 0};
line-height: ${e=>e.$size?"1.5em":void 0};
> div {
color: ${e=>e.$styles.font.color};
flex: ${e=>!e.$isMessage&&"horizontal"===e.$styles.direction&&"0 0 calc(100vw)"};
transition: color 0.15s ease-in-out;
}
`,Dr=fe.div`
display: block;
position: relative;
contain: content;
opacity: ${e=>e.$isMessage||e.$isActivated&&!e.$isLocked?1:e.$isHidden?0:.2};
pointer-events: ${e=>e.$isMessage||e.$isActivated&&!e.$isLocked?"auto":"none"};
transition:
opacity 0.5s,
color 0.15s ease-in-out !important;
user-select: ${e=>!e.$isMessage&&e.$isActivated?"auto":"none"};
padding-left: ${e=>`${e.$isPage||"live"!==e.$view||e.$styles.showEnumerators?Yt:5}px`};
padding-right: ${e=>`${e.$isPage||"live"!==e.$view||e.$styles.showScrollbar?Yt:5}px`};
padding-top: ${e=>`${Yt+(e.$isPage||"live"!==e.$view?8:0)}px`};
padding-bottom: ${e=>`${Yt+(e.$isPage||"live"!==e.$view?8:0)}px`};
z-index: 1;
@media (${e=>"live"===e.$view?"max-device-width":"max-width"}: ${Jt}px) {
padding-left: ${e=>(e.$isPage||"live"!==e.$view||e.$styles.showEnumerators?16:5)+"px"};
padding-right: ${e=>(e.$isPage||"live"!==e.$view||e.$styles.showScrollbar?16:5)+"px"};
}
&:first-child {
padding-top: ${e=>!e.$isPage&&"live"===e.$view&&"5px"};
}
&:last-child {
padding-bottom: ${e=>!e.$isPage&&"live"===e.$view&&!e.$hasBanner&&(e.$isMessage||!e.$styles.navigation)&&"5px"};
}
> div:first-child {
max-width: ${e=>"horizontal"===e.$styles.direction&&e.$isPage&&"1076px"};
> * {
margin-top: ${1}em !important;
&:first-child {
margin-top: 0 !important;
}
}
> h2 + p {
margin-top: ${.5}em !important;
}
> h2 + h3 {
margin-top: ${.5}em !important;
}
> h3 + p {
margin-top: ${.5}em !important;
}
}
> div:nth-child(2) {
max-width: ${e=>"horizontal"===e.$styles.direction&&e.$isPage&&"1140px"};
}
> div {
margin-left: ${e=>"horizontal"===e.$styles.direction&&e.$isPage&&"auto"};
margin-right: ${e=>"horizontal"===e.$styles.direction&&e.$isPage&&"auto"};
}
`,Tr=fe.div`
position: absolute;
left: ${e=>"live"!==e.$view||e.$isPage?0:`${e.$styles.showEnumerators?Yt:5}px`};
top: 0;
right: 0;
bottom: 0;
pointer-events: ${e=>e.$isActivated?"none":"auto"};
cursor: default;
${Fr} {
position: absolute;
bottom: ${e=>e.$isPage||"live"!==e.$view?"8px":0};
left: ${e=>e.$isPage||"live"!==e.$view?"32px":void 0};
> a {
position: relative;
top: 0.1em;
}
@media (${e=>"live"===e.$view?"max-device-width":"max-width"}: ${Jt}px) {
left: ${e=>e.$isPage||"live"!==e.$view?"16px":void 0};
}
}
`,Ar=e=>ue(Dr,{ref:e.element,"data-block":e.identifier,style:{width:e.width,top:e.top},$view:e.view,$styles:e.styles,$isPage:e.isPage,$isActivated:e.isActivated,$isHidden:e.isHidden,$isLocked:e.isLocked,$isMessage:e.isMessage,$hasBanner:e.l10n&&e.onActivate&&!e.styles.navigation&&!e.styles.noBranding&&"preview"!==e.view,children:[le("div",{children:e.children}),e.l10n&&e.onActivate&&ue(Tr,{onClick:!e.isActivated&&!e.isHidden&&e.onActivate||void 0,$view:e.view,$styles:e.styles,$isPage:e.isPage,$isActivated:e.isActivated,children:[e.styles.showPreviousButton&&e.onPrevious&&le(Vr,{l10n:e.l10n,styles:e.styles,view:e.view,isPage:e.isPage,isActivated:e.isActivated||!1,onClick:e.onPrevious}),!e.styles.navigation&&le(Rr,{l10n:e.l10n,styles:e.styles,view:e.view,alignment:"left",visible:e.showBanner})]})]}),qr=fe.h2`
display: block;
margin: 0;
padding: 0;
font-weight: bold;
font-size: 2em;
line-height: 1.2em;
text-align: ${e=>e.$alignment||"left"};
user-select: none;
`,Mr=fe.span`
font-size: 14px;
font-weight: normal;
line-height: 1em;
display: inline-block;
width: 32px;
margin-left: -32px;
text-align: center;
@media (${e=>"live"===e.$view?"max-device-width":"max-width"}: ${Jt}px) {
display: none;
}
`,Ir=fe.p`
margin: 0;
padding: 0;
font-size: 1em;
text-align: ${e=>e.$alignment||"left"};
user-select: none;
`,Er=fe.small`
display: block;
margin: 0;
padding: 0;
font-size: 0.8em;
user-select: none;
cursor: default;
`,Lr=fe.nav`
margin-top: 0 !important;
min-height: ${2.8125}em;
display: flex;
flex-wrap: wrap;
justify-content: ${e=>e.$alignment};
opacity: ${e=>e.$isActivated?1:0};
transform: ${e=>e.$isActivated?"none":"horizontal"===e.$styles.direction?"translateX(-1em)":"translateY(1em)"};
transition:
opacity 0.3s ease-out 0.2s,
transform 0.3s ease-out 0.2s;
> * {
margin-top: ${.5}em !important;
margin-left: ${1}em;
&:first-child {
margin-left: 0;
}
}
&:first-child > * {
margin-top: 0 !important;
}
`,Ur=e=>le(Lr,{$styles:e.styles,$isActivated:x(e.isActivated,!0),$alignment:e.alignment||"left",children:e.children});const Nr=ue("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",children:[le("path",{d:"M18.5 9.382l-2.606-5.211c-0.328-0.657-1.16-1.171-1.894-1.171h-2.5c-0.276 0-0.5 0.224-0.5 0.5s0.224 0.5 0.5 0.5h2.5c0.362 0 0.838 0.295 1 0.618l2.606 5.211c0.028 0.055 0.055 0.117 0.081 0.183-0.061-0.008-0.123-0.012-0.187-0.012h-5c-0.276 0-0.5 0.224-0.5 0.5 0 1.378-1.122 2.5-2.5 2.5s-2.5-1.122-2.5-2.5c0-0.276-0.224-0.5-0.5-0.5h-5c-0.063 0-0.125 0.004-0.187 0.012 0.026-0.066 0.053-0.128 0.081-0.183l2.606-5.211c0.162-0.323 0.638-0.618 1-0.618h2.5c0.276 0 0.5-0.224 0.5-0.5s-0.224-0.5-0.5-0.5h-2.5c-0.734 0-1.566 0.514-1.894 1.171l-2.606 5.211c-0.28 0.561-0.5 1.491-0.5 2.118v4c0 0.827 0.673 1.5 1.5 1.5h16c0.827 0 1.5-0.673 1.5-1.5v-4c0-0.627-0.22-1.557-0.5-2.118zM18 15.5c0 0.276-0.224 0.5-0.5 0.5h-16c-0.276 0-0.5-0.224-0.5-0.5v-4c0-0.276 0.224-0.5 0.5-0.5h4.536c0.243 1.694 1.704 3 3.464 3s3.221-1.306 3.464-3h4.536c0.276 0 0.5 0.224 0.5 0.5v4z"}),le("path",{d:"M11.854 6.646c-0.195-0.195-0.512-0.195-0.707 0l-1.146 1.146v-4.293c0-0.276-0.224-0.5-0.5-0.5s-0.5 0.224-0.5 0.5v4.293l-1.146-1.146c-0.195-0.195-0.512-0.195-0.707 0s-0.195 0.512 0 0.707l2 2c0.098 0.098 0.226 0.146 0.354 0.146s0.256-0.049 0.354-0.146l2-2c0.195-0.195 0.195-0.512-0-0.707z"})]}),Wr=le("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",children:le("path",{d:"M10.707 10.5l8.646-8.646c0.195-0.195 0.195-0.512 0-0.707s-0.512-0.195-0.707 0l-8.646 8.646-8.646-8.646c-0.195-0.195-0.512-0.195-0.707 0s-0.195 0.512 0 0.707l8.646 8.646-8.646 8.646c-0.195 0.195-0.195 0.512 0 0.707 0.098 0.098 0.226 0.146 0.354 0.146s0.256-0.049 0.354-0.146l8.646-8.646 8.646 8.646c0.098 0.098 0.226 0.146 0.354 0.146s0.256-0.049 0.354-0.146c0.195-0.195 0.195-0.512 0-0.707l-8.646-8.646z"})}),_r="pause",Hr=e=>{var t;const[r,o]=pe((null===(t=e.controller)||void 0===t?void 0:t.emailAddress)||""),[n,i]=pe(!1),a=function(e){return e&&/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e)||!1}(r),s=!!e.controller;return ue(Ar,{element:e.onElement(_r),styles:e.styles,view:e.view,isPage:e.isPage,isActivated:s,isHidden:!e.controller,children:[le(qr,{children:e.l10n.pgettext("runner#8|⏸ Pause conversation","Pause this conversation")}),le(Ir,{children:e.l10n.pgettext("runner#8|⏸ Pause conversation","Receive a link by email to resume later on any device, right where you left off.")}),le(yr,{styles:e.styles.inputs,required:!0,disabled:!e.controller||e.controller.isCompleting,value:r,placeholder:e.l10n.pgettext("runner#8|⏸ Pause conversation","Your email address..."),error:n&&!a,onChange:o,onFocus:()=>i(!0),onAutoFocus:e.onAutoFocus({key:_r},s),onSubmit:()=>a&&e.controller&&e.controller.complete(r),onCancel:()=>e.controller&&e.controller.cancel()}),ue(Ur,{styles:e.styles,isActivated:!0,children:[le(Kt,{styles:e.styles.buttons,icon:Nr,label:e.controller&&e.controller.isCompleting?e.l10n.pgettext("runner#3|🩺 Status information","Pausing..."):e.l10n.pgettext("runner#8|⏸ Pause conversation","Receive resume link"),disabled:!e.controller||e.controller.isCompleting||!a,onClick:()=>e.controller&&e.controller.complete(r)}),le(Kt,{styles:Object.assign(Object.assign({},e.styles.buttons),{mode:"outline"}),icon:Wr,disabled:!e.controller||e.controller.isCompleting,label:e.l10n.pgettext("runner#8|⏸ Pause conversation","Cancel pausing"),onClick:()=>e.controller&&e.controller.cancel()})]})]},_r)},Kr=le("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",children:le("path",{d:"M5.5 17.5c-0.128 0-0.256-0.049-0.354-0.146l-5-5c-0.195-0.195-0.195-0.512 0-0.707s0.512-0.195 0.707 0l4.646 4.646 13.646-13.646c0.195-0.195 0.512-0.195 0.707 0s0.195 0.512 0 0.707l-14 14c-0.098 0.098-0.226 0.146-0.354 0.146z"})}),Yr=fe.div`
display: block;
color: ${e=>Nt(e.$styles.font.color,(e=>e.manipulate((e=>e.alpha(.4)))))};
transition: color 0.15s ease-in-out;
align-self: center;
font-size: 0.85em;
user-select: none;
`,Xr=e=>le(Yr,{$styles:e.styles,children:e.l10n.pgettext("runner:autoscroll","Disabled in preview mode")}),Jr="submit",Zr=e=>{const t=e.active===Jr;return le(Ar,{element:e.onElement(Jr),l10n:e.l10n,styles:e.styles,view:e.view,isPage:e.isPage,isActivated:t,isHidden:e.styles.hideUpcoming&&!t,width:e.width,top:e.offset,onActivate:e.onActivate,onPrevious:e.onPrevious,children:ue(Ur,{styles:e.styles,isActivated:!0,children:[le(Kt,{styles:e.styles.finishButton,disabled:"finishing"===e.status||"pausing"===e.status||"evaluating"===e.status,icon:Kr,label:"finishing"===e.status?e.l10n.pgettext("runner#3|🩺 Status information","Submitting..."):e.l10n.pgettext("runner#1|🆗 Buttons","Submit"),onClick:"preview"===e.view?()=>E():e.onSubmit,onAutoFocus:e.onAutoFocus({key:Jr},t),onTab:e.onTab,onCancel:e.onPrevious}),"preview"===e.view&&le(Xr,{l10n:e.l10n,styles:e.styles})]})},Jr)},Gr=le("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",children:le("path",{d:"M19.354 10.146l-6-6c-0.195-0.195-0.512-0.195-0.707 0s-0.195 0.512 0 0.707l5.146 5.146h-16.293c-0.276 0-0.5 0.224-0.5 0.5s0.224 0.5 0.5 0.5h16.293l-5.146 5.146c-0.195 0.195-0.195 0.512 0 0.707 0.098 0.098 0.226 0.146 0.354 0.146s0.256-0.049 0.354-0.146l6-6c0.195-0.195 0.195-0.512 0-0.707z"})}),Qr=le("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",children:le("path",{d:"M9.854 19.354l6-6c0.195-0.195 0.195-0.512 0-0.707s-0.512-0.195-0.707 0l-5.146 5.146v-16.293c0-0.276-0.224-0.5-0.5-0.5s-0.5 0.224-0.5 0.5v16.293l-5.146-5.146c-0.195-0.195-0.512-0.195-0.707 0-0.098 0.098-0.146 0.226-0.146 0.354s0.049 0.256 0.146 0.354l6 6c0.195 0.195 0.512 0.195 0.707 0z"})}),eo=le("svg",{"aria-hidden":"true",viewBox:"0 0 5800 5800",children:le("path",{d:"M2300 4700l0 -3600c0,-110 -90,-200 -200,-200l-600 0c-113,0 -200,88 -200,200l0 3600c0,110 90,200 200,200l600 0c110,0 200,-90 200,-200zm200 -3600l0 3600c0,220 -180,400 -400,400l-600 0c-220,0 -400,-180 -400,-400l0 -3600c0,-220 180,-400 400,-400l600 0c220,0 400,180 400,400zm2000 3600l0 -3600c0,-110 -90,-200 -200,-200l-600 0c-110,0 -200,90 -200,200l0 3600c0,110 90,200 200,200l600 0c110,0 200,-90 200,-200zm200 -3600l0 3600c0,220 -180,400 -400,400l-600 0c-220,0 -400,-180 -400,-400l0 -3600c0,-220 180,-400 400,-400l600 0c220,0 400,180 400,400z"})}),to=le("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",children:le("path",{d:"M19.854 8.646c-0.195-0.195-0.512-0.195-0.707 0l-1.149 1.149c-0.051-2.060-0.878-3.99-2.341-5.452-1.511-1.511-3.52-2.343-5.657-2.343s-4.146 0.832-5.657 2.343-2.343 3.52-2.343 5.657 0.832 4.146 2.343 5.657 3.52 2.343 5.657 2.343c2.974 0 5.686-1.635 7.077-4.266 0.129-0.244 0.036-0.547-0.208-0.676s-0.547-0.036-0.676 0.208c-1.217 2.303-3.59 3.734-6.193 3.734-3.86 0-7-3.14-7-7s3.14-7 7-7c3.789 0 6.885 3.027 6.997 6.789l-1.143-1.143c-0.195-0.195-0.512-0.195-0.707 0s-0.195 0.512 0 0.707l2 2c0.098 0.098 0.226 0.146 0.354 0.146s0.256-0.049 0.354-0.146l2-2c0.195-0.195 0.195-0.512 0-0.707z"})}),ro=fe.div`
display: block;
margin-top: ${1}em;
* + * {
margin-left: ${1}em;
}
`,oo=e=>{const[t,r]=pe(!1);return ue(ce,{children:[le("b",{children:e.l10n.pgettext("runner#9|⚠ Errors|Submit error","The form is outdated.")}),le("br",{}),e.onReload?e.l10n.pgettext("runner#9|⚠ Errors|Outdated error","It seems the form is changed by the owner while you were filling in the form. Your data cannot be processed, but you can try to reload the new version of the form while maintaining the data you've filled in. Click the reload button to try this. Please check your data after reloading and then submit again."):e.l10n.pgettext("runner#9|⚠ Errors|Outdated error","It seems the form is changed by the owner while you were filling in the form. Your data cannot be processed. Try reloading the form."),ue(ro,{children:[e.onReload&&le(Kt,{styles:{baseColor:Nt(e.styles.inputs.errorColor,(e=>e.makeBlackOrWhite())),mode:"outline"},label:e.l10n.pgettext("runner#1|🆗 Buttons","Reload"),icon:to,disabled:t,onClick:()=>{r(!0),e.onReload()}}),le(Kt,{styles:{baseColor:Nt(e.styles.inputs.errorColor,(e=>e.makeBlackOrWhite())),mode:"outline"},label:e.l10n.pgettext("runner#1|🆗 Buttons","Discard"),icon:Wr,onClick:e.onDiscard})]})]})},no=fe.div`
display: block;
margin-top: ${1}em;
* + * {
margin-left: ${1}em;
}
`,io=e=>ue(ce,{children:[le("b",{children:e.l10n.pgettext("runner#9|⚠ Errors|Submit error","Your data is rejected.")}),le("br",{}),e.l10n.pgettext("runner#9|⚠ Errors|Rejected error","Unfortunately, your data is marked as invalid and therefore rejected. If you believe this is a mistake, please contact the form owner. We're sorry for the inconvenience."),le(no,{children:le(Kt,{styles:{baseColor:Nt(e.styles.inputs.errorColor,(e=>e.makeBlackOrWhite())),mode:"outline"},label:e.l10n.pgettext("runner#1|🆗 Buttons","Discard"),icon:Wr,onClick:e.onDiscard})})]}),ao=fe.div`
display: block;
margin-top: ${1}em;
* + * {
margin-left: ${1}em;
}
`,so=e=>ue(ce,{children:[le("b",{children:e.l10n.pgettext("runner#9|⚠ Errors|Submit error","Something went wrong while submitting your conversation.")}),le("br",{}),e.l10n.pgettext("runner#9|⚠ Errors|Connection error","Please check your connection and try again (for the techies: The error console of your browser might contain more technical information about what went wrong)."),ue(ao,{children:[le(Kt,{styles:{baseColor:Nt(e.styles.inputs.errorColor,(e=>e.makeBlackOrWhite())),mode:"outline"},label:e.l10n.pgettext("runner#1|🆗 Buttons","Retry"),icon:to,onClick:e.onRetry}),le(Kt,{styles:{baseColor:Nt(e.styles.inputs.errorColor,(e=>e.makeBlackOrWhite())),mode:"outline"},label:e.l10n.pgettext("runner#1|🆗 Buttons","Discard"),icon:Wr,onClick:e.onDiscard})]})]}),lo=fe.div`
display: block;
margin-top: ${1}em;
`,co=e=>ue(ce,{children:[le("b",{children:e.l10n.pgettext("runner#9|⚠ Errors|Pausing error","Something went wrong while pausing your conversation.")}),le("br",{}),e.l10n.pgettext("runner#9|⚠ Errors|Connection error","Please check your connection and try again (for the techies: The error console of your browser might contain more technical information about what went wrong)."),le(lo,{children:le(Kt,{styles:{baseColor:Nt(e.styles.inputs.errorColor,(e=>e.makeBlackOrWhite())),mode:"outline"},label:e.l10n.pgettext("runner:autoscroll","Discard"),icon:Wr,onClick:e.onDiscard})})]}),uo=fe.div`
display: block;
color: ${e=>e.$styles.font.color};
transition: color 0.15s ease-in-out;
align-self: center;
font-size: 0.85em;
user-select: none;
height: 46px;
`,po=e=>le(uo,{$styles:e.styles,children:e.l10n.pgettext("runner#3|🩺 Status information","⏳ One moment please...")}),ho=fe.div`
position: fixed;
left: 32px;
right: 32px;
top: 32px;
display: flex;
justify-content: center;
opacity: ${e=>e.$visible?1:0};
pointer-events: ${e=>e.$visible?"auto":"none"};
transform: ${e=>e.$visible?"translateY(0)":"translateY(-100px)"};
transition:
opacity 0.3s ease-out,
transform 0.3s ease-out;
z-index: 2;
> div {
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.25);
cursor: pointer;
background-color: ${e=>Nt(e.$styles.inputs.errorColor,(e=>e.manipulate((e=>e.alpha(.85)))))};
color: ${e=>Nt(e.$styles.inputs.errorColor,(e=>e.makeBlackOrWhite()))};
transition:
background-color 0.15s ease-in-out,
color 0.15s ease-in-out;
padding: 0.7em;
border-radius: 0.5em;
user-select: none;
}
`,vo=e=>le(ho,{onClick:e.onClick,$styles:e.styles,$visible:!!(e.error||e.failed>0),children:le("div",{children:e.error||e.l10n.npgettext("runner#9|⚠ Errors|Input error","%1 item requires your attention! Click to fix.","%1 items require your attention! Click to fix.",e.failed||1)})}),go=(e,t,r,o,n,i)=>{const s={offset:0,size:0,height:o.height};let l=0,c=0,u=0;if(v(r,(r=>{"horizontal"===t.direction&&(l+=r.width,"top"!==t.verticalAlignment&&((s.offsets||(s.offsets={}))[r.key]=r.height<e.height?a.floor((e.height-r.height)/("bottom"===t.verticalAlignment?1:2)):0)),"vertical"===t.direction&&(c+=r.height,r.height>s.height&&(s.height=r.height),(!u||r.height<u)&&(u=r.height))})),0!==c||0!==l){if("vertical"===t.direction&&c>0){const o=r[0],n=r[r.length-1],i=t.verticalAlignment;if(r.length>1&&"bottom"!==i&&n&&n.height<e.height&&(s.size=c+(e.height-n.height)/("top"===i?1:2)),"bottom"===i){const t=o.height<e.height?a.floor(e.height-o.height):0,n=e.height-u/2;let i=t-e.scrollTop;const l=r.length>1&&p(r,(e=>!(!(e.isFirst||n>=i)||!(e.isLast||n<i+e.height))||(i+=e.height,!1)))||o;s.offset=t,s.active=l.key}else if("top"===i){let t=0;const n=r.length>1&&p(r,(o=>!(!(o.isFirst||e.scrollTop>=t-o.height/2)||!(o.isLast||e.scrollTop<a.max(t+o.height/2,t+o.height-r[o.index+1].height/2)))||(t+=o.height,!1)))||o;s.active=n.key}else{const t=e.height/2,n=o.height<e.height?a.floor((e.height-o.height)/2):0;let i=n-e.scrollTop;const l=r.length>1&&p(r,(e=>!(!(e.isFirst||t>=i)||!(e.isLast||t<i+e.height))||(i+=e.height,!1)))||o;s.offset=n,s.active=l.key}}else if("horizontal"===t.direction&&l>0){let t=-e.scrollLeft;const o=r[0],n=e.width/2;s.active=(r.length>1&&p(r,(e=>!(!(e.isFirst||n>=t)||!(e.isLast||n<t+e.width))||(t+=e.width,!1)))||o).key}i&&i.current&&N(o,s,!0)||(i&&!i.current&&(i.current=!0),n(s))}},fo=(e,t,r,o)=>{if(e.scrollTo){const n=p(r,(e=>e.key===o));if(n&&n.height>0){const r="bottom"===t.verticalAlignment?1:2,o="horizontal"===t.direction?n.left:0,i="horizontal"===t.direction?0:"top"===t.verticalAlignment||n.height>=e.height?n.top:n.top+n.height/r-e.height/r;return T((()=>e.scrollTo(o,i))),!0}}return!1},bo=(e,t,r,o,n)=>{const i=p(r,(e=>e.key===n));return!!i&&(("previous"!==o||!i.isFirst)&&(("next"!==o||!i.isLast)&&fo(e,t,r,r[i.index+("previous"===o?-1:1)].key)))},mo=(e,t,r,o)=>bo(e,t,r,"previous",o),yo=(e,t,r,o)=>bo(e,t,r,"next",o),$o=e=>{var t,o,i;const a=de(!1),s=de(!1),[l,c]=pe({offset:0,size:0,height:0}),u=de({timestamp:0,left:0,top:0,width:0,height:0,scrollLeft:0,scrollTop:0}),d=de(null===(o=null===(t=e.snapshot)||void 0===t?void 0:t.b)||void 0===o?void 0:o.a),h=de(""),f=de(),[b,m,y,$,w,k]=wr(Object.assign(Object.assign({},e),{onSnapshot:()=>({a:l.active,b:_,d:e.snapshot&&e.snapshot.b&&e.snapshot.b.d,e:n.now}),onSnapshotStart:()=>d.current=_r,onSnapshotEnd:e=>fo(u.current,$,K.current,e||""),onStart:()=>{u.current.scrollTo&&u.current.scrollTo(0,0,!1)},onRestart:()=>{N(),u.current.scrollTo&&u.current.scrollTo(0,0,!1)},onScrollIntoView:e=>{var t;const r=p(null===(t=b.storyline)||void 0===t?void 0:t.nodes,(t=>t.node.id===e));return!!r&&fo(u.current,$,K.current,r.key)}})),C=de($.direction),S=b.status,O=b.view,z="live"!==O||"page"===e.display,P=b.storyline&&"preview"!==O&&(b.storyline.isEvaluating||b.pausing&&b.pausing.isCompleting)||!1,[B,V]=(()=>{const e=de(),t=de(),r=de(0);return[r=>{var o,n,i;const[,a]=pe();return he((()=>{var t;return(null===(t=e.current)||void 0===t?void 0:t.onEffect)&&e.current.onEffect()})),t.current=()=>a({}),e.current&&(e.current.rendered=!0),r.element&&(null===(o=e.current)||void 0===o?void 0:o.children)?le(r.element,Object.assign({},r.props,{children:null===(n=e.current)||void 0===n?void 0:n.children})):le(ce,{children:null===(i=e.current)||void 0===i?void 0:i.children})},o=>{const n=++r.current;return e.current=Object.assign(Object.assign({},o),{id:n,rendered:!1}),he((()=>(e.current&&!e.current.rendered&&t.current&&t.current(),()=>{var r,o;(null===(r=e.current)||void 0===r?void 0:r.id)===n&&((null===(o=e.current)||void 0===o?void 0:o.rendered)&&t.current&&t.current(),e.current=void 0)}))),le(ce,{})}]})(),[F,R,D,A,E,N,_]=(e=>{const[t,r]=pe(e.initialFocus||{}),o=de(),i=de(!0),a=de(),s=de(),l=de(),c=de({});return he((()=>{const t=q((()=>{const r=a.current&&c.current[a.current]||void 0;if(r&&(i.current||a.current!==s.current)&&o.current){if(n.elapsed(e.viewportRef.current.timestamp,!0)<100||!kr(r,e.viewportRef))return;if(M(t),document.hasFocus()){const t=document.activeElement;let n=t&&t.isEqualNode(o.current);e.gainFocus&&i.current&&(n=n||!t||"BODY"===t.tagName),i.current=!1,s.current=a.current,n&&r.focus({preventScroll:!0})}delete c.current[a.current]}else M(t)}),100);return()=>{M(t)}})),[o,(o,n,c)=>u=>{n&&i.current&&(i.current=!1),r(I(t,{[o.key]:n})),n&&(l.current=u.target,a.current=s.current=o.key,e.onFocus&&e.onFocus(o.key)),c&&t[o.key]!==n&&c()},(e,t,r)=>o=>{t&&o?(c.current[e.key]=o,a.current=e.key,r&&r(o)):delete c.current[e.key]},e=>!(e.filterInputs&&(!l.current||"INPUT"!==l.current.tagName&&"TEXTAREA"!==l.current.tagName))&&t[e.key],()=>new Promise((e=>{if(s.current){const t=c.current[s.current];if(t)return t.blur(),void j((()=>e()),100)}e()})),()=>r({}),t]})({gainFocus:"live"===O&&("page"===e.display||$.autoFocus),initialFocus:e.snapshot&&e.snapshot.b&&e.snapshot.b.b,viewportRef:u,onFocus:e=>{l.active!==e&&fo(u.current,$,K.current,e)}}),H=de([]),K=de([]),Y=e=>t=>{if(t){const r=K.current.length;K.current.push({index:r,key:e,ref:t,width:0,height:0,get left(){if("horizontal"===$.direction){let e=r,t=0;for(;--e>=0;)t+=K.current[e].width;return t}return 0},get top(){if("vertical"===$.direction){let e=r,t=l.offset;for(;--e>=0;)t+=K.current[e].height;return t}return 0},get isFirst(){return 0===r},get isLast(){return r===K.current.length-1}})}};K.current=[],C.current!==$.direction&&(a.current=!1,C.current=$.direction),!s.current&&a.current&&(s.current=!Pr()),he((()=>{let e=0;if(v(K.current,(e=>{const t=e.ref.getBoundingClientRect();e.width=t.width,e.height=t.height})),go(u.current,$,K.current,l,c,a),d.current){const t=()=>{const r=d.current;if(r){const o=r&&p(K.current,(e=>e.key===r));o&&o.height>0?(fo(u.current,$,K.current,r),d.current=void 0):e=g((()=>t()))}};t()}return()=>{e&&W(e)}}));let X,J,Z=0,G=0,Q=0,ee=0,te=0,re=0,oe="";const ne=$.showSeparateSubmit&&b.isFinishable,ie=(null===(i=b.storyline)||void 0===i?void 0:i.all)||[],ae="epilogue"!==b.preview&&ie.length>0&&ue(jr,{style:{marginTop:"vertical"===$.direction&&l.offset||void 0,minHeight:"vertical"===$.direction&&l.size||void 0},onWheel:e=>{if("horizontal"===$.direction&&$.showPreviousButton&&l.active){(l.offsets&&l.offsets[l.active]||0)>0&&e.deltaY<0&&mo(u.current,$,K.current,l.active)}},$styles:$,$view:O,$isPage:z,$isCalculated:a.current&&s.current,children:[ie.map((t=>{var r,o,n,i,a;const s=b.storyline,c=G++,d=0===c,p=ie.length===G,v=l.active===t.key&&"pausing"!==S,g="finishing"===S||"pausing"===S,C=!v&&($.hidePast&&0===Z||$.hideUpcoming&&(!l.active&&c>0||0!==Z)),B=e.onEdit&&"live"!==O&&t.id&&(()=>e.onEdit("block",t.id))||void 0,F=!d&&(()=>mo(u.current,$,K.current,t.key))||void 0,j=(!p||ne)&&(()=>T((()=>yo(u.current,$,K.current,t.key))))||void 0,q=!$.showSeparateSubmit&&p&&b.isFinishable&&(()=>s.finish())||void 0,M=()=>{var e;return t.props.explanation&&le(Er,{id:null===(e=t.block)||void 0===e?void 0:e.key("explanation"),onClick:B,children:Je(t.props.explanation,t.context)})||void 0},I=c>0&&c-1<H.current.length&&H.current[c-1]||void 0;let N=c<H.current.length&&H.current[c]||void 0;v&&h.current!==t.key?X=t:v||h.current!==t.key||(J=t),(!N||N.node!==t.key||I&&I.last!==N.first)&&(N={node:t.key,first:(null==I?void 0:I.last)||0,last:(null==I?void 0:I.last)||0},H.current.splice(c,H.current.length-c,N));const W=m.fetch((()=>{var e,r;const o=()=>{var e,r;return t.props.name&&x(t.props.nameVisible,!0)&&ue(qr,{onClick:B,children:[$.showEnumerators&&t.enumerator&&ue(Mr,{$view:O,children:[t.enumerator,"."]}),t.block?le("label",{htmlFor:null===(e=t.block)||void 0===e?void 0:e.key(),children:Je(t.props.name,t.context)}):le(ce,{children:Je(t.props.name,t.context)}),!$.hideRequiredIndicator&&(null===(r=t.block)||void 0===r?void 0:r.required)&&!t.block.hideRequiredIndicatorFromName&&le(Wt,{$errorColor:$.inputs.errorColor})]})||void 0},n=()=>t.props.description&&le(Ir,{onClick:B,children:Je(t.props.description,t.context)})||void 0;return N.last=N.first,(null===(e=t.block)||void 0===e?void 0:e.render)&&(null===(r=t.block)||void 0===r?void 0:r.render({l10n:y,styles:$,overlay:V,view:O,attachments:w,index:c,get id(){var e;return(null===(e=t.block)||void 0===e?void 0:e.key())||""},get name(){return o()},get description(){return n()},get explanation(){return t.props.explanation&&Je(t.props.explanation,t.context)||void 0},get placeholder(){return L(t.props.placeholder||"",t.context)||""},get label(){return Je(t.props.placeholder||t.props.name||"...",t.context,!1)},get tabIndex(){return++N.last},isActivated:v,get isFailed(){return"preview"!==O&&t.isFailed&&void 0!==A(t)||!1},get ariaDescribedBy(){var e;return t.props.explanation&&(null===(e=t.block)||void 0===e?void 0:e.key("explanation"))||void 0},get ariaDescription(){return M()},isPage:z,focus:R(t,!0,(()=>k("focus",t))),blur:R(t,!1,(()=>k("blur",t))),autoFocus:D(t,v),markdownifyToJSX:(e,r)=>Je(e,t.context,r),markdownifyToURL:e=>U(e,t.context),markdownifyToImage:e=>U(e,t.context,void 0,["image/jpeg","image/png","image/svg","image/gif"])||`data:image/svg+xml;base64,${_t($.color||"#000")}`,markdownifyToString:(e,r)=>L(e,t.context,void 0,r)},"finishing"!==S&&"pausing"!==S&&"evaluating"!==S&&t.isPassed&&j&&(()=>E().then(j))||q&&(()=>{f.current&&kr(f.current,u)&&f.current.focus({preventScroll:!0})}),F))||ue(ce,{children:[o(),n()]})}),t,S,v,N.first);return v&&(Z=G),Z&&!v||"preview"!==O&&t.collectsData&&(!t.hasDataCollected||t.isFailed)&&(Z||(null===(r=t.block)||void 0===r?void 0:r.required))||Q++,t.collectsData&&(ee++,(!Z||v&&t.hasDataCollected)&&!t.isFailed&&te++,!Z&&"preview"!==O&&t.isFailed&&(re++,oe||(oe=t.key))),W&&ue(Ar,{identifier:null===(o=t.block)||void 0===o?void 0:o.type.identifier,element:Y(t.key),l10n:y,styles:$,view:O,isPage:z,bookmark:t.bookmark.name,isActivated:v,isLocked:g,isHidden:C,width:"horizontal"===$.direction&&u.current.width||void 0,top:l.offsets&&l.offsets[t.key],showBanner:(d||p&&q)&&v||!1,onActivate:()=>fo(u.current,$,K.current,t.key),onPrevious:F,children:[W,!(null===(n=t.block)||void 0===n?void 0:n.hideAriaDescription)&&M(),(!(null===(i=t.block)||void 0===i?void 0:i.hideButtons)||P||q&&b.isFinishable||!$.navigation&&b.isPausable)&&le(Ur,{styles:$,isActivated:v,children:P?le(po,{l10n:y,styles:$}):ue(ce,{children:[(!q&&!(null===(a=t.block)||void 0===a?void 0:a.autoSubmit)||q&&b.isFinishable)&&le(Kt,{styles:q||t.isPassed&&p&&!$.showSeparateSubmit?$.finishButton:$.buttons,disabled:"finishing"===S||"pausing"===S||!t.isPassed||q&&("preview"===O||"live"===O&&!e.onSubmit&&s.hasDataCollected),icon:q||t.isPassed&&p&&!$.showSeparateSubmit?Kr:"horizontal"===$.direction?Gr:Qr,label:q||t.isPassed&&p&&!$.showSeparateSubmit?"finishing"===S?y.pgettext("runner#3|🩺 Status information","Submitting..."):y.pgettext("runner#1|🆗 Buttons","Submit"):y.pgettext("runner#1|🆗 Buttons","Next"),onAutoFocus:(!t.block||t.block.autoFocus)&&D(t,v,(e=>{q&&(f.current=e)}))||(e=>{q&&e&&(f.current=e)}),onClick:q||j,onTab:!q&&j||void 0,onCancel:(!t.block||t.block.autoFocus||q)&&F||void 0}),!$.navigation&&b.isPausable&&le(Kt,{styles:Object.assign(Object.assign({},$.buttons),{mode:"outline"}),icon:eo,onClick:b.pause}),(q||p&&!$.showSeparateSubmit)&&"preview"===O&&le(Xr,{l10n:y,styles:$})]})})]},t.key)})),b.pausing||l.active===_r?le(Hr,{controller:b.pausing,view:O,l10n:y,styles:$,isPage:z,onElement:Y,onAutoFocus:D}):ne&&le(Zr,{view:O,l10n:y,styles:$,isPage:z,status:S,active:l.active,onElement:Y,width:"horizontal"===$.direction&&u.current.width||void 0,offset:l.offsets&&l.offsets[Jr],onActivate:()=>fo(u.current,$,K.current,Jr),onSubmit:"live"===O&&!e.onSubmit&&b.storyline&&b.storyline.hasDataCollected?void 0:()=>b.storyline.finish(),onTab:()=>((e,t,r)=>{r.length>0&&fo(e,t,r,r[0].key)})(u.current,$,K.current),onPrevious:()=>mo(u.current,$,K.current,Jr),onAutoFocus:D})]})||void 0;ne&&(G++,l.active===Jr&&(Z=Q=G)),Z||(re=0,te=0,Q=0),J&&(k("unstage",J),h.current=""),X&&(k("stage",X),h.current=X.key);const se="pausing"!==S&&Z>1&&(()=>l.active&&mo(u.current,$,K.current,l.active))||void 0,ve="pausing"!==S&&Z<G&&(()=>l.active&&yo(u.current,$,K.current,l.active))||void 0;return{frameRef:F,status:S,view:O,isPage:z,title:b.title,l10n:y,styles:$,overlayProvider:B,height:z||e.customStyle&&e.customStyle.height&&"auto"!==e.customStyle.height?void 0:"vertical"===$.direction&&ae?l.height+($.navigation?80:0):"auto",disableScrolling:"horizontal"===$.direction&&!b.prologue&&!b.epilogue&&l.active&&l.offsets&&(l.offsets[l.active]||0)>0||!1,prologue:b.prologue&&Object.assign(Object.assign({},b.prologue),{l10n:y,styles:$,view:O,isPage:z,viewportRef:u,start:"prologue"===b.preview?b.resetPreview:b.start,edit:"live"!==O&&e.onEdit&&(()=>e.onEdit("prologue"))||void 0}),blocks:ae&&ue(ce,{children:[le(vo,{l10n:y,styles:$,failed:re,error:"error"===S?le(so,{l10n:y,styles:$,onRetry:()=>b.storyline.finish(),onDiscard:()=>b.discard()}):"error-outdated"===S?le(oo,{l10n:y,styles:$,onReload:e.onReload&&(()=>Ne(void 0,void 0,void 0,(function*(){b.reload(yield Promise.resolve(e.onReload())),b.discard()}))),onDiscard:()=>b.discard()}):"error-rejected"===S?le(io,{l10n:y,styles:$,onDiscard:()=>b.discard()}):"error-paused"===S?le(co,{l10n:y,styles:$,onDiscard:()=>b.discard()}):void 0,onClick:"error"!==S&&"error-outdated"!==S&&"error-rejected"!==S&&"error-paused"!==S&&(()=>fo(u.current,$,K.current,oe))||void 0}),ae]}),epilogue:b.epilogue&&Object.assign(Object.assign({},b.epilogue),{l10n:y,styles:$,view:O,isPage:z,repeat:b.restart,edit:"live"!==O&&e.onEdit&&(()=>{var t;return e.onEdit("epilogue",null===(t=b.epilogue)||void 0===t?void 0:t.branch)})||void 0}),isEvaluating:P,navigation:$.navigation&&ae?{view:O,l10n:y,styles:$,total:G,progress:Q,answerable:ee,answered:te,isFinishing:"finishing"===S,isPausing:"pausing"===S,isEvaluating:P,previous:se,next:ve,pausable:b.isPausable,pause:b.pause}:void 0,onResize:()=>b.update(),onScroll:e=>{(u.current.width===e.width&&u.current.height!==e.height||u.current.width!==e.width&&u.current.height===e.height)&&l.active&&A({key:l.active,filterInputs:!0})&&(r(e,"width",u.current.width),r(e,"height",u.current.height)),u.current.width===e.width&&u.current.height===e.height||b.update(),u.current.scrollLeft===e.scrollLeft&&u.current.scrollTop===e.scrollTop||go(e,$,K.current,l,c,a),u.current=e},onKey:e=>{if("finishing"!==S&&"pausing"!==S&&"evaluating"!==S)switch(e){case"previous":se&&se();break;case"next":ve&&ve()}}}};class wo{static get id(){return""+ ++this.counter}static init(){return this.initialized||(this.initialized=!0,navigator.userAgent.toLowerCase().indexOf("firefox")>-1?_((()=>{this.ready=!0,this.load()})):this.ready=!0),!this.ready}static load(){var e;if(!this.init()&&H(this.requests)>0){const t=p(this.requests,(e=>!(e.context&&!e.context.current)));if(t){const r=p(this.requests,(e=>e.loading||!1));if(r&&r.id!==t.id)return;const o=t.ref.current,n=t.url?{custom:{families:[t.font],urls:[t.url]}}:{google:{families:[t.font]}};t.loading=!0,function(e,t){return function(){function r(e,t,r){return e.call.apply(e.bind,arguments)}function o(e,t,r){if(!e)throw Error();if(2<arguments.length){var o=Array.prototype.slice.call(arguments,2);return function(){var r=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(r,o),e.apply(t,r)}}return function(){return e.apply(t,arguments)}}function n(e,t,i){return(n=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?r:o).apply(null,arguments)}var i=Date.now||function(){return+new Date};function a(e,t){this.a=e,this.o=t||e,this.c=this.o.document}var s=!!e.FontFace;function l(e,t,r,o){if(t=e.c.createElement(t),r)for(var n in r)r.hasOwnProperty(n)&&("style"==n?t.style.cssText=r[n]:t.setAttribute(n,r[n]));return o&&t.appendChild(e.c.createTextNode(o)),t}function c(e,t,r){(e=e.c.getElementsByTagName(t)[0])||(e=document.documentElement),e.insertBefore(r,e.lastChild)}function u(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,t,r){t=t||[],r=r||[];for(var o=e.className.split(/\s+/),n=0;n<t.length;n+=1){for(var i=!1,a=0;a<o.length;a+=1)if(t[n]===o[a]){i=!0;break}i||o.push(t[n])}for(t=[],n=0;n<o.length;n+=1){for(i=!1,a=0;a<r.length;a+=1)if(o[n]===r[a]){i=!0;break}i||t.push(o[n])}e.className=t.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function p(e,t){for(var r=e.className.split(/\s+/),o=0,n=r.length;o<n;o++)if(r[o]==t)return!0;return!1}function h(e,t,r){function o(){u&&n&&i&&(u(a),u=null)}t=l(e,"link",{rel:"stylesheet",href:t,media:"all"});var n=!1,i=!0,a=null,u=r||null;s?(t.onload=function(){n=!0,o()},t.onerror=function(){n=!0,a=Error("Stylesheet failed to load"),o()}):setTimeout((function(){n=!0,o()}),0),c(e,"head",t)}function v(e,t,r,o){var n=e.c.getElementsByTagName("head")[0];if(n){var i=l(e,"script",{src:t}),a=!1;return i.onload=i.onreadystatechange=function(){a||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(a=!0,r&&r(null),i.onload=i.onreadystatechange=null,"HEAD"==i.parentNode.tagName&&n.removeChild(i))},n.appendChild(i),setTimeout((function(){a||(a=!0,r&&r(Error("Script load timeout")))}),o||5e3),i}return null}function g(){this.a=0,this.c=null}function f(e){return e.a++,function(){e.a--,m(e)}}function b(e,t){e.c=t,m(e)}function m(e){0==e.a&&e.c&&(e.c(),e.c=null)}function y(e){this.a=e||"-"}function $(e,t){this.c=e,this.f=4,this.a="n";var r=(t||"n4").match(/^([nio])([1-9])$/i);r&&(this.a=r[1],this.f=parseInt(r[2],10))}function w(e){var t=[];e=e.split(/,\s*/);for(var r=0;r<e.length;r++){var o=e[r].replace(/['"]/g,"");-1!=o.indexOf(" ")||/^\d/.test(o)?t.push("'"+o+"'"):t.push(o)}return t.join(",")}function k(e){return e.a+e.f}function x(e){var t="normal";return"o"===e.a?t="oblique":"i"===e.a&&(t="italic"),t}function C(e){var t=4,r="n",o=null;return e&&((o=e.match(/(normal|oblique|italic)/i))&&o[1]&&(r=o[1].substr(0,1).toLowerCase()),(o=e.match(/([1-9]00|normal|bold)/i))&&o[1]&&(/bold/i.test(o[1])?t=7:/[1-9]00/.test(o[1])&&(t=parseInt(o[1].substr(0,1),10)))),r+t}function S(e,t){this.c=e,this.f=e.o.document.documentElement,this.h=t,this.a=new y("-"),this.j=!1!==t.events,this.g=!1!==t.classes}function O(e){if(e.g){var t=p(e.f,e.a.c("wf","active")),r=[],o=[e.a.c("wf","loading")];t||r.push(e.a.c("wf","inactive")),d(e.f,r,o)}z(e,"inactive")}function z(e,t,r){e.j&&e.h[t]&&(r?e.h[t](r.c,k(r)):e.h[t]())}function P(){this.c={}}function B(e,t){this.c=e,this.f=t,this.a=l(this.c,"span",{"aria-hidden":"true"},this.f)}function V(e){c(e.c,"body",e.a)}function F(e){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+w(e.c)+";font-style:"+x(e)+";font-weight:"+e.f+"00;"}function R(e,t,r,o,n,i){this.g=e,this.j=t,this.a=o,this.c=r,this.f=n||3e3,this.h=i||void 0}function j(e,t,r,o,n,i,a){this.v=e,this.B=t,this.c=r,this.a=o,this.s=a||"BESbswy",this.f={},this.w=n||3e3,this.u=i||null,this.m=this.j=this.h=this.g=null,this.g=new B(this.c,this.s),this.h=new B(this.c,this.s),this.j=new B(this.c,this.s),this.m=new B(this.c,this.s),e=F(e=new $(this.a.c+",serif",k(this.a))),this.g.a.style.cssText=e,e=F(e=new $(this.a.c+",sans-serif",k(this.a))),this.h.a.style.cssText=e,e=F(e=new $("serif",k(this.a))),this.j.a.style.cssText=e,e=F(e=new $("sans-serif",k(this.a))),this.m.a.style.cssText=e,V(this.g),V(this.h),V(this.j),V(this.m)}y.prototype.c=function(e){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r].replace(/[\W_]+/g,"").toLowerCase());return t.join(this.a)},R.prototype.start=function(){var e=this.c.o.document,t=this,r=i(),o=new Promise((function(o,n){!function a(){i()-r>=t.f?n():e.fonts.load(function(e){return x(e)+" "+e.f+"00 300px "+w(e.c)}(t.a),t.h).then((function(e){1<=e.length?o():setTimeout(a,25)}),(function(){n()}))}()})),n=null,a=new Promise((function(e,r){n=setTimeout(r,t.f)}));Promise.race([a,o]).then((function(){n&&(clearTimeout(n),n=null),t.g(t.a)}),(function(){t.j(t.a)}))};var D={D:"serif",C:"sans-serif"},T=null;function A(){if(null===T){var t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(e.navigator.userAgent);T=!!t&&(536>parseInt(t[1],10)||536===parseInt(t[1],10)&&11>=parseInt(t[2],10))}return T}function q(e,t,r){for(var o in D)if(D.hasOwnProperty(o)&&t===e.f[D[o]]&&r===e.f[D[o]])return!0;return!1}function M(e){var t,r=e.g.a.offsetWidth,o=e.h.a.offsetWidth;(t=r===e.f.serif&&o===e.f["sans-serif"])||(t=A()&&q(e,r,o)),t?i()-e.A>=e.w?A()&&q(e,r,o)&&(null===e.u||e.u.hasOwnProperty(e.a.c))?I(e,e.v):I(e,e.B):function(e){setTimeout(n((function(){M(this)}),e),50)}(e):I(e,e.v)}function I(e,t){setTimeout(n((function(){u(this.g.a),u(this.h.a),u(this.j.a),u(this.m.a),t(this.a)}),e),0)}function E(e,t,r){this.c=e,this.a=t,this.f=0,this.m=this.j=!1,this.s=r}j.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=i(),M(this)};var L=null;function U(e){0==--e.f&&e.j&&(e.m?((e=e.a).g&&d(e.f,[e.a.c("wf","active")],[e.a.c("wf","loading"),e.a.c("wf","inactive")]),z(e,"active")):O(e.a))}function N(e){this.j=e,this.a=new P,this.h=0,this.f=this.g=!0}function W(t,r,o,i,a){var s=0==--t.h;(t.f||t.g)&&setTimeout((function(){var t=a||null,l=i||{};if(0===o.length&&s)O(r.a);else{r.f+=o.length,s&&(r.j=s);var c,u=[];for(c=0;c<o.length;c++){var p=o[c],h=l[p.c],v=r.a,g=p;if(v.g&&d(v.f,[v.a.c("wf",g.c,k(g).toString(),"loading")]),z(v,"fontloading",g),v=null,null===L)if(e.FontFace){g=/Gecko.*Firefox\/(\d+)/.exec(e.navigator.userAgent);var f=/OS X.*Version\/10\..*Safari/.exec(e.navigator.userAgent)&&/Apple/.exec(e.navigator.vendor);L=g?42<parseInt(g[1],10):!f}else L=!1;v=L?new R(n(r.g,r),n(r.h,r),r.c,p,r.s,h):new j(n(r.g,r),n(r.h,r),r.c,p,r.s,t,h),u.push(v)}for(c=0;c<u.length;c++)u[c].start()}}),0)}function _(e,t){this.c=e,this.a=t}function H(e,t){this.c=e,this.a=t}function K(e,t){this.c=e||Y,this.a=[],this.f=[],this.g=t||""}E.prototype.g=function(e){var t=this.a;t.g&&d(t.f,[t.a.c("wf",e.c,k(e).toString(),"active")],[t.a.c("wf",e.c,k(e).toString(),"loading"),t.a.c("wf",e.c,k(e).toString(),"inactive")]),z(t,"fontactive",e),this.m=!0,U(this)},E.prototype.h=function(e){var t=this.a;if(t.g){var r=p(t.f,t.a.c("wf",e.c,k(e).toString(),"active")),o=[],n=[t.a.c("wf",e.c,k(e).toString(),"loading")];r||o.push(t.a.c("wf",e.c,k(e).toString(),"inactive")),d(t.f,o,n)}z(t,"fontinactive",e),U(this)},N.prototype.load=function(e){this.c=new a(this.j,e.context||this.j),this.g=!1!==e.events,this.f=!1!==e.classes,function(e,t,r){var o=[],n=r.timeout;!function(e){e.g&&d(e.f,[e.a.c("wf","loading")]),z(e,"loading")}(t);o=function(e,t,r){var o,n=[];for(o in t)if(t.hasOwnProperty(o)){var i=e.c[o];i&&n.push(i(t[o],r))}return n}(e.a,r,e.c);var i=new E(e.c,t,n);for(e.h=o.length,t=0,r=o.length;t<r;t++)o[t].load((function(t,r,o){W(e,i,t,r,o)}))}(this,new S(this.c,e),e)},_.prototype.load=function(e){function t(){if(i["__mti_fntLst"+o]){var r,n=i["__mti_fntLst"+o](),a=[];if(n)for(var s=0;s<n.length;s++){var l=n[s].fontfamily;null!=n[s].fontStyle&&null!=n[s].fontWeight?(r=n[s].fontStyle+n[s].fontWeight,a.push(new $(l,r))):a.push(new $(l))}e(a)}else setTimeout((function(){t()}),50)}var r=this,o=r.a.projectId,n=r.a.version;if(o){var i=r.c.o;v(this.c,(r.a.api||"https://fast.fonts.net/jsapi")+"/"+o+".js"+(n?"?v="+n:""),(function(n){n?e([]):(i["__MonotypeConfiguration__"+o]=function(){return r.a},t())})).id="__MonotypeAPIScript__"+o}else e([])},H.prototype.load=function(e){var t,r,o=this.a.urls||[],n=this.a.families||[],i=this.a.testStrings||{},a=new g;for(t=0,r=o.length;t<r;t++)h(this.c,o[t],f(a));var s=[];for(t=0,r=n.length;t<r;t++)if((o=n[t].split(":"))[1])for(var l=o[1].split(","),c=0;c<l.length;c+=1)s.push(new $(o[0],l[c]));else s.push(new $(o[0]));b(a,(function(){e(s,i)}))};var Y="https://fonts.googleapis.com/css";function X(e){this.f=e,this.a=[],this.c={}}var J={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},Z={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},G={i:"i",italic:"i",n:"n",normal:"n"},Q=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;function ee(e,t){this.c=e,this.a=t}var te={Arimo:!0,Cousine:!0,Tinos:!0};function re(e,t){this.c=e,this.a=t}function oe(e,t){this.c=e,this.f=t,this.a=[]}ee.prototype.load=function(e){var t=new g,r=this.c,o=new K(this.a.api,this.a.text),n=this.a.families;!function(e,t){for(var r=t.length,o=0;o<r;o++){var n=t[o].split(":");3==n.length&&e.f.push(n.pop());var i="";2==n.length&&""!=n[1]&&(i=":"),e.a.push(n.join(i))}}(o,n);var i=new X(n);!function(e){for(var t=e.f.length,r=0;r<t;r++){var o=e.f[r].split(":"),n=o[0].replace(/\+/g," "),i=["n4"];if(2<=o.length){var a;if(a=[],s=o[1])for(var s,l=(s=s.split(",")).length,c=0;c<l;c++){var u;if((u=s[c]).match(/^[\w-]+$/))if(null==(d=Q.exec(u.toLowerCase())))u="";else{if(u=null==(u=d[2])||""==u?"n":G[u],null==(d=d[1])||""==d)d="4";else var d=Z[d]||(isNaN(d)?"4":d.substr(0,1));u=[u,d].join("")}else u="";u&&a.push(u)}0<a.length&&(i=a),3==o.length&&(a=[],0<(o=(o=o[2])?o.split(","):a).length&&(o=J[o[0]])&&(e.c[n]=o))}for(e.c[n]||(o=J[n])&&(e.c[n]=o),o=0;o<i.length;o+=1)e.a.push(new $(n,i[o]))}}(i),h(r,function(e){if(0==e.a.length)throw Error("No fonts to load!");if(-1!=e.c.indexOf("kit="))return e.c;for(var t=e.a.length,r=[],o=0;o<t;o++)r.push(e.a[o].replace(/ /g,"+"));return t=e.c+"?family="+r.join("%7C"),0<e.f.length&&(t+="&subset="+e.f.join(",")),0<e.g.length&&(t+="&text="+encodeURIComponent(e.g)),t}(o),f(t)),b(t,(function(){e(i.a,i.c,te)}))},re.prototype.load=function(e){var t=this.a.id,r=this.c.o;t?v(this.c,(this.a.api||"https://use.typekit.net")+"/"+t+".js",(function(t){if(t)e([]);else if(r.Typekit&&r.Typekit.config&&r.Typekit.config.fn){t=r.Typekit.config.fn;for(var o=[],n=0;n<t.length;n+=2)for(var i=t[n],a=t[n+1],s=0;s<a.length;s++)o.push(new $(i,a[s]));try{r.Typekit.load({events:!1,classes:!1,async:!0})}catch(e){}e(o)}}),2e3):e([])},oe.prototype.load=function(e){var t=this.f.id,r=this.c.o,o=this;t?(r.__webfontfontdeckmodule__||(r.__webfontfontdeckmodule__={}),r.__webfontfontdeckmodule__[t]=function(t,r){for(var n=0,i=r.fonts.length;n<i;++n){var a=r.fonts[n];o.a.push(new $(a.name,C("font-weight:"+a.weight+";font-style:"+a.style)))}e(o.a)},v(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+function(e){return e.o.location.hostname||e.a.location.hostname}(this.c)+"/"+t+".js",(function(t){t&&e([])}))):e([])};var ne=new N(e);ne.a.c.custom=function(e,t){return new H(t,e)},ne.a.c.fontdeck=function(e,t){return new oe(t,e)},ne.a.c.monotype=function(e,t){return new _(t,e)},ne.a.c.typekit=function(e,t){return new re(t,e)},ne.a.c.google=function(e,t){return new ee(t,e)};var ie={load:n(ne.load,ne)};"function"==typeof define&&define.amd?define((function(){return ie})):void 0!==t&&t.exports?t.exports=ie:(e.WebFont=ie,e.WebFontConfig&&ne.load(e.WebFontConfig))}(),t.exports}("undefined"==typeof window&&{}||window,"undefined"==typeof module&&{exports:{}}||module).load(Object.assign(Object.assign({},n),{classes:!1,fontactive:e=>this.done(t,o,e),inactive:()=>this.done(t,o,t.fallback||""),context:null===(e=t.context)||void 0===e?void 0:e.current.contentWindow}))}else g((()=>this.load()))}}static done(e,t,r){e.ref.current===t?(delete this.requests[e.id],e.set.current(r)):e.loading=!1,this.load()}static request(e,t,r,o,n){if(!t.current||this.isStandardFont(t.current))return delete this.requests[e.current],void o.current(t.current);let i=t.current,a="";if(0===i.indexOf("https://")||0===i.indexOf("/")){const e=i.lastIndexOf("#");if(-1!==e){let t=i.substr(e+1);a=i.substr(0,e),-1!==t.indexOf("&")&&(t=t.substr(0,t.indexOf("&"))),-1!==t.indexOf("|")&&(t=t.substr(0,t.indexOf("|")));try{i=decodeURIComponent(t.replace(/\+/g," "))}catch(e){i="",a=""}}else i=""}if(i){const s=this.requests[e.current];s?(s.font=i,s.url=a,s.set=o):this.requests[e.current]={id:e.current,ref:t,font:i,url:a,context:r,set:o,fallback:n},this.load()}else delete this.requests[e.current],o.current(n||"")}static isStandardFont(e){switch(e.toLowerCase()){case"arial":case"helvetica":case"times new roman":case"times":case"courier new":case"courier":case"sans-serif":return!0}return!1}}wo.counter=0,wo.initialized=!1,wo.ready=!1,wo.requests={};const ko=le("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",children:le("path",{d:"M14 20c0.128 0 0.256-0.049 0.354-0.146 0.195-0.195 0.195-0.512 0-0.707l-8.646-8.646 8.646-8.646c0.195-0.195 0.195-0.512 0-0.707s-0.512-0.195-0.707 0l-9 9c-0.195 0.195-0.195 0.512 0 0.707l9 9c0.098 0.098 0.226 0.146 0.354 0.146z"})}),xo=le("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",children:le("path",{d:"M5 20c-0.128 0-0.256-0.049-0.354-0.146-0.195-0.195-0.195-0.512 0-0.707l8.646-8.646-8.646-8.646c-0.195-0.195-0.195-0.512 0-0.707s0.512-0.195 0.707 0l9 9c0.195 0.195 0.195 0.512 0 0.707l-9 9c-0.098 0.098-0.226 0.146-0.354 0.146z"})}),Co=le("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",children:le("path",{d:"M0 15c0 0.128 0.049 0.256 0.146 0.354 0.195 0.195 0.512 0.195 0.707 0l8.646-8.646 8.646 8.646c0.195 0.195 0.512 0.195 0.707 0s0.195-0.512 0-0.707l-9-9c-0.195-0.195-0.512-0.195-0.707 0l-9 9c-0.098 0.098-0.146 0.226-0.146 0.354z"})}),So=le("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",children:le("path",{d:"M0 6c0-0.128 0.049-0.256 0.146-0.354 0.195-0.195 0.512-0.195 0.707 0l8.646 8.646 8.646-8.646c0.195-0.195 0.512-0.195 0.707 0s0.195 0.512 0 0.707l-9 9c-0.195 0.195-0.512 0.195-0.707 0l-9-9c-0.098-0.098-0.146-0.226-0.146-0.354z"})}),Oo=fe.div`
background-color: ${e=>Nt(e.$color,(e=>e.manipulate((e=>e.alpha(.1)))))};
transition: background-color 0.15s ease-in-out;
border-radius: 0.5em;
width: 100%;
height: 8px;
border-radius: 4px;
margin-top: 8px;
margin-bottom: 8px;
`,zo=fe.div`
background-color: ${e=>e.$color};
transition:
width 0.3s ease,
background-color 0.15s ease-in-out;
width: ${e=>e.$percentage>0?e.$percentage+"%":"0"};
height: 8px;
border-radius: 4px;
`,Po=e=>{const t=e.total>0?100/e.total*e.progress:0;return le(Oo,{$color:e.color,children:le(zo,{role:"progressbar",$percentage:t,$color:e.color,"aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100})})},Bo=fe.nav`
position: fixed;
left: ${e=>e.$isPage||"horizontal"===e.$styles.direction?0:`${e.$styles.showEnumerators?Yt:5}px`};
bottom: 0;
right: ${e=>e.$isPage||"horizontal"===e.$styles.direction?0:(e.$styles.showScrollbar?0:5)+"px"};
background-color: ${e=>{var t;return null===(t=e.$styles.navigation)||void 0===t?void 0:t.backgroundColor}};
font-family: ${e=>e.$fontFamily};
font-size: 16px;
font-variant-ligatures: none;
transition: background-color 0.15s ease-in-out;
user-select: none;
> div {
width: 100%;
height: ${80}px;
max-width: ${e=>e.$isPage&&"1108px"};
margin-left: ${e=>e.$isPage&&"auto"};
margin-right: ${e=>e.$isPage&&"auto"};
display: flex;
justify-content: space-between;
align-items: center;
> div:first-child {
width: 50%;
padding: 16px;
@media (${e=>"live"===e.$view?"max-device-width":"max-width"}: ${Jt}px) {
flex-grow: 2;
}
> div {
font-size: 12px;
line-height: 16px;
color: ${e=>{var t;return null===(t=e.$styles.navigation)||void 0===t?void 0:t.textColor}};
transition: color 0.15s ease-in-out;
&:first-child {
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&:last-child {
font-weight: normal;
> a {
text-decoration: none;
color: inherit !important;
&:hover {
text-decoration: underline;
}
}
}
}
}
> div:last-child {
padding-right: 8px;
white-space: nowrap;
> * {
margin-right: 8px;
}
}
}
`,Vo=e=>{var t,r;const o=de(0),n={baseColor:(null===(t=e.styles.navigation)||void 0===t?void 0:t.textColor)||"black",mode:"outline",roundness:e.styles.buttons.roundness,scale:2};return e.isPausing||e.isEvaluating||(o.current=e.progress),le(Bo,{$styles:e.styles,$view:e.view,$isPage:e.isPage,$fontFamily:e.fontFamily,children:ue("div",{children:[ue("div",{children:[e.styles.showProgressbar&&ue(ce,{children:[le("div",{children:e.isFinishing?e.l10n.pgettext("runner#3|🩺 Status information","Submitting..."):e.isEvaluating?e.l10n.pgettext("runner#3|🩺 Status information","⏳ One moment please..."):e.isPausing?e.l10n.pgettext("runner#3|🩺 Status information","Pausing..."):"preview"===e.view?e.l10n.pgettext("runner:autoscroll","Preview mode (shows all without logic)"):0===e.answerable?e.l10n.pgettext("runner#3|🩺 Status information","Nothing to answer"):e.l10n.pgettext("runner#3|🩺 Status information","%1 of %2 answered",`${e.answered}`,`${e.answerable}`)}),le(Po,{total:e.total,progress:e.isFinishing?e.total:e.isPausing||e.isEvaluating?o.current:e.progress,color:(null===(r=e.styles.navigation)||void 0===r?void 0:r.progressbarColor)||"black"})]}),!e.styles.noBranding&&"preview"!==e.view&&le("div",{children:le("a",{href:"https://tripetto.com/your-tripetto-experience/?utm_source=tripetto_runner_autoscroll&utm_medium=tripetto_runners&utm_campaign=tripetto_branding&utm_content=form",target:"_blank",children:e.l10n.pgettext("runner:autoscroll","Powered by Tripetto")})})]}),ue("div",{children:[le(Kt,{styles:n,icon:"horizontal"===e.styles.direction?ko:Co,onClick:e.previous}),e.pausable&&le(Kt,{styles:n,icon:eo,onClick:e.pause}),le(Kt,{styles:n,icon:"horizontal"===e.styles.direction?xo:So,onClick:e.next})]})]})})},Fo=fe((e=>{const t=e.frameRef||de(),[r,o]=pe(),[n,i]=((e,t,r)=>{const[o,n]=pe((()=>e?wo.isStandardFont(e)?e:void 0:"")),i=de(""),a=de(""),s=de(n);return i.current||(i.current=wo.id),s.current=n,he((()=>{a.current!==e&&(a.current=e,o!==e&&wo.request(i,a,t,s,r))})),["string"!=typeof o,o]})(e.font,t,"sans-serif");return he((()=>{const n=t.current,i=()=>{var t,i,a,s;if(!r){const r=n.contentDocument;if(null===(t=n.contentWindow)||void 0===t||t.addEventListener("resize",(()=>{e.resizeRef&&e.resizeRef.current&&e.resizeRef.current()})),e.onTouch){const t=e.onTouch;null===(i=n.contentWindow)||void 0===i||i.addEventListener("mousedown",(()=>t())),null===(a=n.contentWindow)||void 0===a||a.addEventListener("touchstart",(()=>t())),null===(s=n.contentWindow)||void 0===s||s.addEventListener("wheel",(()=>t()))}r&&o(r)}};if(!r){const e=n.contentDocument;if(e&&"complete"===e.readyState)return i();n.addEventListener("load",i)}return()=>{n.removeEventListener("load",i)}}),[]),le("iframe",{ref:t,title:e.title,style:Object.assign(Object.assign({},e.style),{opacity:n?"0":void 0,boxShadow:n?"none":void 0}),className:e.className,children:r&&!n&&ke("function"==typeof e.children?e.children(r,i):e.children,r.body)})})).withConfig({shouldForwardProp:e=>{switch(e){case"children":case"frameRef":case"resizeRef":case"title":case"style":case"className":case"font":case"onTouch":return!0}return!1}})`
background-color: transparent !important;
border: none !important;
position: ${e=>"live"===e.$view&&e.$isPage?"fixed":"relative"};
left: ${e=>"live"===e.$view?e.$isPage||"horizontal"===e.$styles.direction?0:`-${e.$styles.showEnumerators?Yt:5}px`:void 0};
top: ${e=>"live"===e.$view?0:void 0};
width: ${e=>"live"!==e.$view||e.$isPage||"vertical"!==e.$styles.direction?"100%":`calc(100% + ${(e.$styles.showEnumerators?Yt:5)+(e.$styles.showScrollbar?0:5)}px);`};
height: ${e=>"live"!==e.$view||e.$isPage?"100%":0};
margin-right: ${e=>"live"===e.$view&&!e.$isPage&&"vertical"===e.$styles.direction&&`-${(e.$styles.showEnumerators?Yt:5)+(e.$styles.showScrollbar?0:5)}px`||void 0};
@media (${e=>"live"===e.$view?"max-device-width":"max-width"}: ${Jt}px) {
left: ${e=>"live"===e.$view?e.$isPage||"horizontal"===e.$styles.direction?0:"-5px":void 0};
width: ${e=>"live"!==e.$view||e.$isPage||"vertical"!==e.$styles.direction?"100%":`calc(100% + ${e.$styles.showScrollbar?5:0}px);`};
margin-right: ${e=>"live"===e.$view&&!e.$isPage&&"vertical"===e.$styles.direction&&`-${5+(e.$styles.showScrollbar?0:5)}px`||void 0};
}
`,Ro=be`
body {
overflow: hidden;
background-color: transparent;
${e=>e.$customCSS&&me`
${P.replace(e.$customCSS,"tripetto-block-","@tripetto/block-")}
`}
}
`,jo=fe.div`
position: absolute;
left: ${e=>"live"!==e.$view||e.$isPage||"vertical"!==e.$styles.direction?0:`${e.$styles.showEnumerators?Yt:5}px`};
right: ${e=>"live"!==e.$view||e.$isPage||"vertical"!==e.$styles.direction||e.$styles.showScrollbar?0:"5px"};
top: 0;
bottom: 0;
background-color: ${e=>Nt(e.$styles.background.color)};
background-image: ${e=>e.$styles.background.url&&e.$styles.background.opacity>0&&`${e.$styles.background.opacity<1&&`linear-gradient(${Nt(e.$styles.background.color,(t=>t.manipulate((t=>t.alpha(1-e.$styles.background.opacity)))))},${Nt(e.$styles.background.color,(t=>t.manipulate((t=>t.alpha(1-e.$styles.background.opacity)))))}),`||""}url("${e.$styles.background.url}")`||void 0};
background-size: ${e=>e.$styles.background.url&&"repeat"!==e.$styles.background.positioning&&e.$styles.background.positioning||void 0};
background-repeat: ${e=>e.$styles.background.url&&"repeat"===e.$styles.background.positioning?"repeat":"no-repeat"};
background-position: center center;
transition: background 0.15s ease-in-out;
`,Do=fe.div`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: ${e=>e.$navigation?"80px":0};
font-family: ${e=>e.$fontFamily};
font-size: ${e=>e.$styles.font.size}px;
font-variant-ligatures: none;
line-height: 1.5em;
outline: 0;
overflow-x: ${e=>"horizontal"===e.$styles.direction?"auto":"hidden"};
overflow-y: ${e=>e.$autoHeight||e.$disableScrolling?"hidden":"auto"};
touch-action: ${e=>e.$styles.disableScrolling?"none":"pan-y"};
scroll-behavior: smooth;
scrollbar-width: ${e=>e.$styles.showScrollbar||"preview"===e.$view?void 0:"none"};
-ms-overflow-style: ${e=>e.$styles.showScrollbar||"preview"===e.$view?void 0:"none"};
-webkit-overflow-scrolling: touch;
-webkit-tap-highlight-color: transparent;
&::-webkit-scrollbar {
display: ${e=>e.$styles.showScrollbar||"preview"===e.$view?void 0:"none"};
}
> div {
max-width: ${e=>"vertical"===e.$styles.direction&&e.$isPage&&"1140px"};
min-height: ${e=>"live"!==e.$view||e.$isPage?"100%":void 0};
margin-left: ${e=>"vertical"===e.$styles.direction&&e.$isPage&&"auto"};
margin-right: ${e=>"vertical"===e.$styles.direction&&e.$isPage&&"auto"};
display: flex;
}
* {
font-family: ${e=>e.$fontFamily};
font-variant-ligatures: none;
box-sizing: border-box;
outline: none;
}
a {
text-decoration: underline;
color: inherit !important;
}
${Bo} {
left: ${e=>"live"!==e.$view||e.$isPage||"vertical"!==e.$styles.direction?void 0:`${e.$styles.showEnumerators?Yt:5}px`};
right: ${e=>"live"!==e.$view||e.$isPage||"vertical"!==e.$styles.direction||e.$styles.showScrollbar?void 0:"5px"};
}
@media (prefers-reduced-motion: reduce) {
scroll-behavior: auto;
}
@media (${e=>"live"===e.$view?"max-device-width":"max-width"}: ${Jt}px) {
font-size: ${e=>e.$styles.font.sizeSmall}px;
}
`,To=fe.div`
font-family: ${e=>e.$fontFamily};
font-size: ${e=>e.$styles.font.size}px;
font-variant-ligatures: none;
line-height: 1.5em;
outline: 0;
* {
font-family: ${e=>e.$fontFamily};
font-variant-ligatures: none;
box-sizing: border-box;
outline: none;
}
a {
text-decoration: underline;
color: inherit !important;
}
@media (prefers-reduced-motion: reduce) {
scroll-behavior: auto;
}
@media (${e=>"live"===e.$view?"max-device-width":"max-width"}: ${Jt}px) {
font-size: ${e=>e.$styles.font.sizeSmall}px;
}
`,Ao=e=>{const t=de();return he((()=>{const r=(e=>{for(;xr[Or];)Or++;return e(!1),xr[Or]={update:e,index:Or}})((r=>{t.current&&e.onChange(t.current.getBoundingClientRect().height,r)}));return()=>(e=>{Or=e.index,delete xr[e.index]})(r)})),le("div",{ref:t,children:e.children})},qo=e=>{const[t,r]=pe(0),o=de(),i=de(0),s=de(),l=de(),c=de(),u=s.current=()=>{var t,r,i;const s=null===(t=o.current)||void 0===t?void 0:t.getBoundingClientRect();e.onScroll({timestamp:n.precise,left:(null==s?void 0:s.left)||0,top:(null==s?void 0:s.top)||0,width:(null==s?void 0:s.width)||0,height:(null==s?void 0:s.height)||0,scrollLeft:(null===(r=o.current)||void 0===r?void 0:r.scrollLeft)||0,scrollTop:(null===(i=o.current)||void 0===i?void 0:i.scrollTop)||0,scrollTo:(e,t,r=!0)=>{if(o.current)if(t=t>0?a.round(t):0,e=e>0?a.round(e):0,o.current.style.scrollBehavior=r?"":"auto",!1!==l.current&&o.current.scrollTo)o.current.scrollTo({left:e,top:t,behavior:r?"smooth":"auto"});else if(c.current&&c.current(),r){const r=o.current,i=n.precise,s=~~r.scrollLeft,l=~~r.scrollTop,u=~~(e-s),d=~~(t-l),p=400,h=()=>{const o=requestAnimationFrame((()=>{const o=a.range(n.precise-i,0,p),c=o/p,v=-u*c*(c-2),g=-d*c*(c-2);r.scrollLeft=s+v,r.scrollTop=l+g,o!==p?h():(r.scrollLeft=e,r.scrollTop=t)}));c.current=()=>cancelAnimationFrame(o)};h()}else o.current.scrollLeft=e,o.current.scrollTop=t}})};return he((()=>{e.frameRef.current&&"live"===e.view&&(e.isPage||e.styles.autoFocus)&&e.frameRef.current.focus()}),[t]),he((()=>{if("boolean"!=typeof l.current&&o.current&&(l.current="smooth"===getComputedStyle(o.current).scrollBehavior),!i.current&&"horizontal"===e.styles.direction&&(e.styles.showScrollbar||"preview"===e.view)&&o.current&&o.current.clientHeight>0&&o.current.offsetHeight>o.current.clientHeight&&(i.current=a.max(o.current.offsetHeight-o.current.clientHeight,0),r(t+i.current)),u(),o.current&&e.styles.disableScrolling){const e=o.current,t=e=>(e.preventDefault(),e.stopPropagation(),!1);return e.addEventListener("wheel",t,{passive:!1}),()=>{e.removeEventListener("wheel",t)}}})),le(Fo,{title:e.title,style:Object.assign(Object.assign({},e.customStyle),{height:e.customStyle&&e.customStyle.height&&"auto"!==e.customStyle.height?e.customStyle.height:"auto"===e.height?t+(e.navigation?80:0):e.height}),className:e.className,onTouch:e.onTouch,frameRef:e.frameRef,resizeRef:s,font:e.styles.font&&e.styles.font.family,$view:e.view,$isPage:e.isPage,$styles:e.styles,children:(n,s)=>le(ye,{target:n.head,children:ue(ce,{children:[le(Ro,{$customCSS:e.customCSS}),le(jo,{$view:e.view,$isPage:e.isPage,$styles:e.styles}),le(Do,{ref:o,tabIndex:0,onScroll:u,onKeyDown:t=>{var r,o,i;"PageUp"===t.key&&(t.preventDefault(),e.onKey("previous")),"PageDown"===t.key&&(t.preventDefault(),e.onKey("next")),"INPUT"!==(null===(r=n.activeElement)||void 0===r?void 0:r.tagName)&&"TEXTAREA"!==(null===(o=n.activeElement)||void 0===o?void 0:o.tagName)&&("ArrowUp"===t.key&&"vertical"===e.styles.direction||"ArrowLeft"===t.key&&"horizontal"===e.styles.direction?(t.preventDefault(),e.onKey("previous")):"ArrowDown"===t.key&&"vertical"===e.styles.direction||"ArrowRight"===t.key&&"horizontal"===e.styles.direction?(t.preventDefault(),e.onKey("next")):" "===t.key&&"BUTTON"!==(null===(i=n.activeElement)||void 0===i?void 0:i.tagName)&&(t.preventDefault(),t.shiftKey?e.onKey("previous"):e.onKey("next")))},$view:e.view,$isPage:e.isPage,$autoHeight:"auto"===e.height,$disableScrolling:e.disableScrolling,$styles:e.styles,$fontFamily:s,$navigation:e.navigation,children:le(Ao,{onChange:(o,n)=>{((o=a.ceil(o)+("horizontal"===e.styles.direction&&(e.styles.showScrollbar||"preview"===e.view)&&i.current||0))!==t||n)&&(r(o),e.onResize())},children:e.children})}),e.navigation&&le(Vo,Object.assign({},e.navigation,{isPage:e.isPage,fontFamily:s})),le(e.overlayProvider,{element:To,props:{$styles:e.styles,$view:e.view,$fontFamily:s}})]})})})},Mo=e=>le(jr,{$styles:e.styles,$view:e.view,$center:!0,$isMessage:!0,$size:15,children:ue(Ar,{styles:e.styles,view:e.view,isPage:!0,isMessage:!0,children:[le(qr,{$alignment:"center",children:e.l10n.pgettext("runner:autoscroll","👋 Hi there!")}),le(Ir,{$alignment:"center",children:e.l10n.pgettext("runner:autoscroll","Please add a block first to get the magic going.")})]})}),Io=e=>le(jr,{$styles:e.styles,$view:e.view,$center:e.isPage,$isPage:e.isPage,$isMessage:!0,children:ue(Ar,{styles:e.styles,view:e.view,isPage:e.isPage,isMessage:!0,children:[le(qr,{$alignment:e.isPage?"center":"left",children:e.l10n.pgettext("runner#2|💬 Messages|Conversation closed","👋 Hi there!")}),le(Ir,{$alignment:e.isPage?"center":"left",children:e.l10n.pgettext("runner#2|💬 Messages|Conversation closed","Nothing to talk about. The conversation is closed 🤐")})]})}),Eo=e=>le(jr,{$styles:e.styles,$view:e.view,$isPage:e.isPage,$center:e.isPage,$isMessage:!0,children:ue(Ar,{styles:e.styles,view:e.view,isPage:e.isPage,isMessage:!0,children:[le(qr,{$alignment:e.isPage?"center":"left",children:e.l10n.pgettext("runner#2|💬 Messages|Conversation paused","⏸ Paused")}),le(Ir,{$alignment:e.isPage?"center":"left",children:e.l10n.pgettext("runner#2|💬 Messages|Conversation paused","The conversation is now paused.")})]})}),Lo=fe.div`
width: 100%;
display: flex;
align-items: flex-start;
justify-content: ${e=>e.$aligment};
`,Uo=fe.img`
margin: 0;
padding: 0;
border: none;
max-width: 100%;
height: auto;
border-style: none;
`,No=e=>{const[t,r]=zr(e.src);return he((()=>()=>r())),le(Lo,{onClick:e.onClick,$aligment:e.alignment||"left",children:le(Uo,{src:e.src,style:{width:e.width},onLoad:t,onError:t})})},Wo=fe.div`
position: relative;
margin: 0;
padding: 0 0 56.25% 0;
width: 100%;
max-width: 100%;
height: 0;
border: none;
> iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: none;
}
`,_o=e=>{const t=(e=>{const t=e.match(/youtu(?:.*\/v\/|.*v=|\.be\/)([A-Za-z0-9_-]{11})/);return t&&2===t.length&&t[1]||""})(e.src),r=(e=>{const t=e.match(/\/\/(?:www\.)?vimeo\.com\/(?:channels\/staffpicks\/)?([-\w]+)/i);return t&&2===t.length&&t[1]||""})(e.src),o=de(null),n=de();return he((()=>{const i="preview"!==e.view&&e.play;let a=0;if((t||r)&&u(i)&&(u(n.current)?i!==n.current:i)){const s=e=>{var i,s;null===(s=null===(i=o.current)||void 0===i?void 0:i.contentWindow)||void 0===s||s.postMessage(JSON.stringify(r?{method:e?"play":"pause"}:{event:"command",func:e?"playVideo":"pauseVideo"}),t?"https://www.youtube-nocookie.com":"https://player.vimeo.com"),a=0,n.current=e};void 0===n.current?e.play&&(a=j((()=>s(!0)),1e3)):s(i)}return()=>{0!==a&&R(a)}})),t||r?le(Wo,{children:le("iframe",{ref:o,src:t?`https://www.youtube-nocookie.com/embed/${t}?controls=0&enablejsapi=1`:`https://player.vimeo.com/video/${r}?api=1&dnt=1`,referrerPolicy:"strict-origin-when-cross-origin",allow:"autoplay; fullscreen; accelerometer; encrypted-media; gyroscope; picture-in-picture"})}):le(ce,{})},Ho=e=>le(jr,{$styles:e.styles,$view:e.view,$isPage:e.isPage,$center:!0,$isMessage:!0,children:ue(Ar,{styles:e.styles,view:e.view,isPage:e.isPage,isMessage:!0,children:[e.image&&le(No,{src:e.image,isPage:e.isPage,alignment:"center",onClick:e.edit}),e.title&&le(qr,{onClick:e.edit,$alignment:"center",children:Je(e.title)}),e.description&&le(Ir,{onClick:e.edit,$alignment:"center",children:Je(e.description)}),e.video&&le(_o,{src:e.video,view:e.view}),le(Ur,{styles:e.styles,alignment:"center",children:le(Kt,{styles:e.styles.buttons,icon:xo,label:e.button||e.l10n.pgettext("runner#1|🆗 Buttons","Start"),onClick:e.start,onAutoFocus:t=>{"live"===e.view&&(e.styles.autoFocus||e.isPage)&&t&&kr(t,e.viewportRef)&&t.focus({preventScroll:!0})}})}),le(Rr,{l10n:e.l10n,styles:e.styles,view:e.view,alignment:"center"})]})}),Ko=fe.h3`
margin: 0;
padding: 0;
font-size: 1.5em;
line-height: 1.1em;
text-align: ${e=>e.$alignment||"left"};
user-select: none;
`,Yo=le("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",children:le("path",{d:"M17.51 4.49c-1.605-1.605-3.74-2.49-6.010-2.49s-4.405 0.884-6.010 2.49-2.49 3.74-2.49 6.010v1.293l-2.146-2.146c-0.195-0.195-0.512-0.195-0.707 0s-0.195 0.512 0 0.707l3 3c0.098 0.098 0.226 0.146 0.354 0.146s0.256-0.049 0.354-0.146l3-3c0.195-0.195 0.195-0.512 0-0.707s-0.512-0.195-0.707 0l-2.146 2.146v-1.293c0-4.136 3.364-7.5 7.5-7.5s7.5 3.364 7.5 7.5-3.364 7.5-7.5 7.5c-0.276 0-0.5 0.224-0.5 0.5s0.224 0.5 0.5 0.5c2.27 0 4.405-0.884 6.010-2.49s2.49-3.74 2.49-6.010c0-2.27-0.884-4.405-2.49-6.010z"})}),Xo=ue("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",children:[le("path",{d:"M14.5 20h-13c-0.827 0-1.5-0.673-1.5-1.5v-16c0-0.827 0.673-1.5 1.5-1.5h13c0.827 0 1.5 0.673 1.5 1.5v2c0 0.276-0.224 0.5-0.5 0.5s-0.5-0.224-0.5-0.5v-2c0-0.276-0.224-0.5-0.5-0.5h-13c-0.276 0-0.5 0.224-0.5 0.5v16c0 0.276 0.224 0.5 0.5 0.5h13c0.276 0 0.5-0.224 0.5-0.5v-4c0-0.276 0.224-0.5 0.5-0.5s0.5 0.224 0.5 0.5v4c0 0.827-0.673 1.5-1.5 1.5z"}),le("path",{d:"M10.5 5h-7c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h7c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z"}),le("path",{d:"M12.5 7h-9c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h9c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z"}),le("path",{d:"M11.5 9h-8c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h8c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z"}),le("path",{d:"M8.5 11h-5c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h5c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z"}),le("path",{d:"M8.5 17c-0.134 0-0.265-0.054-0.36-0.153-0.124-0.128-0.17-0.313-0.121-0.484l1-3.5c0.023-0.082 0.067-0.156 0.127-0.216l7.5-7.5c0.195-0.195 0.512-0.195 0.707 0l2.5 2.5c0.194 0.194 0.195 0.508 0.003 0.704l-7.5 7.641c-0.065 0.066-0.147 0.113-0.238 0.135l-3.5 0.859c-0.039 0.010-0.079 0.014-0.119 0.014zM9.945 13.262l-0.728 2.547 2.525-0.62 7.053-7.186-1.796-1.796-7.055 7.055z"}),le("path",{d:"M6.5 17h-3c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h3c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z"})]}),Jo=e=>"live"===e.view&&e.getRedirect&&e.getRedirect()?le(ce,{}):ue(jr,{$styles:e.styles,$view:e.view,$isPage:e.isPage,$center:!0,$isMessage:!0,children:[le(Ar,{styles:e.styles,view:e.view,isPage:e.isPage,isMessage:!0,children:"live"!==e.view&&e.redirectUrl?ue(ce,{children:[le(qr,{onClick:e.edit,$alignment:"center",children:"preview"===e.view?e.l10n.pgettext("runner:autoscroll","🌍 Redirect preview"):e.l10n.pgettext("runner:autoscroll","🎉 Test completed")}),ue(Ir,{onClick:e.edit,$alignment:"center",children:[e.l10n.pgettext("runner:autoscroll","In a live environment the form will redirect to:"),le("br",{}),le("a",{href:U(e.redirectUrl||"",e.context)||"#",rel:"noopener",target:"_blank",children:U(e.redirectUrl||"",e.context)||e.l10n.pgettext("runner:autoscroll","The supplied URL is invalid!")})]}),"test"===e.view&&le(Ur,{styles:e.styles,alignment:"center",children:le(Kt,{styles:Object.assign(Object.assign({},e.styles.buttons),{mode:"outline"}),label:e.l10n.pgettext("runner:autoscroll","Test again"),icon:Yo,disabled:!e.repeat,onClick:e.repeat})})]}):ue(ce,{children:[e.image&&le(No,{src:U(e.image,e.context,void 0,["image/jpeg","image/png","image/svg","image/gif"]),isPage:e.isPage,alignment:"center",onClick:e.edit}),le(qr,{onClick:e.edit,$alignment:"center",children:Je(e.title||"test"===e.view&&e.l10n.pgettext("runner:autoscroll","🎉 Test completed")||e.l10n.pgettext("runner#2|💬 Messages|Conversation ended","🎉 It's a wrap!"),e.context)}),e.description?le(Ir,{onClick:e.edit,$alignment:"center",children:Je(e.description,e.context)}):!e.title&&"test"===e.view&&le(Ir,{onClick:e.edit,$alignment:"center",children:e.l10n.pgettext("runner:autoscroll","Did you know you can customize this closing message?")}),e.video&&le(_o,{src:U(e.video,e.context),view:e.view,play:!0}),(e.button||e.repeatable||"test"===e.view)&&ue(Ur,{styles:e.styles,alignment:"center",children:[e.button&&le(Kt,{styles:Object.assign(Object.assign({},e.styles.buttons),{mode:"fill"}),label:L(e.button.label,e.context),hyperlink:{url:U(e.button.url,e.context),target:"preview"===e.view||"test"===e.view?"blank":e.button.target}}),(e.repeatable||"test"===e.view)&&ue(ce,{children:[le(Kt,{styles:Object.assign(Object.assign({},e.styles.buttons),{mode:"outline"}),label:e.repeatable?e.l10n.pgettext("runner#1|🆗 Buttons","Start again"):e.l10n.pgettext("runner:autoscroll","Test again"),icon:Yo,disabled:!e.repeat,onClick:e.repeat}),e.edit&&!e.image&&!e.title&&!e.description&&!e.video&&!e.button&&!u(e.repeatable)&&le(Kt,{styles:Object.assign(Object.assign({},e.styles.buttons),{mode:"outline"}),label:e.l10n.pgettext("runner:autoscroll","Customize"),icon:Xo,onClick:e.edit})]})]})]})}),"live"===e.view&&!e.styles.noBranding&&ue(Ar,{styles:e.styles,view:e.view,isPage:e.isPage,isMessage:!0,children:[le(Ko,{$alignment:"center",children:e.l10n.pgettext("runner:autoscroll","Want to make a form like this for free?")}),le(Ir,{$alignment:"center",children:e.l10n.pgettext("runner:autoscroll","Tripetto is for making elegantly personal form and survey experiences with response boosting conversational powers.")}),le(Ur,{styles:e.styles,alignment:"center",children:le(Kt,{styles:Object.assign(Object.assign({},e.styles.buttons),{mode:"fill"}),label:e.l10n.pgettext("runner:autoscroll","Create one now!"),hyperlink:{url:"https://tripetto.com/your-tripetto-experience/?utm_source=tripetto_runner_autoscroll&utm_medium=tripetto_runners&utm_campaign=tripetto_branding&utm_content=closing",target:"blank"}})})]})]});function Zo(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function Go(e,t){switch(t){case"radians":return e;case"gradians":return e*(Math.PI/200);default:return e*(Math.PI/180)}}function Qo(e,t){switch(t){case"radians":return e;case"gradians":return e*(200/Math.PI);default:return e*(180/Math.PI)}}function en(e){if(e>0){if(e>=.5){const t=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7];let r=t[0];e--;for(let o=1;o<9;o++)r+=t[o]/(e+o);const o=e+7.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r}{const t=en(1-e);return w(t)?Math.PI/(Math.sin(Math.PI*e)*t):void 0}}}function tn(e){if(e>=0){if(0===e)return 1;if(e<1)return en(e+1);let t=0;for(let r=1;r<=e;r++){if(!w(t))return;t+=Math.log(r)}return Math.exp(t)}}function rn(e,t,r,o){if(m(e)){const t=function(e,t){switch(e){case"π":return Math.PI;case"e":return Math.E;case"γ":return.5772156649015329;case"c":return 299792458;case"random":return Math.random();case"timestamp":return Date.now()/1e3;case"year":return(new Date).getFullYear();case"month":return(new Date).getMonth()+1;case"day":return(new Date).getDate();case"day-of-week":return(new Date).getDay();case"hour":return(new Date).getHours();case"minute":return(new Date).getMinutes();case"second":return(new Date).getSeconds();case"millisecond":return(new Date).getMilliseconds();case"timezone":return 60*(new Date).getTimezoneOffset()*1e3;case"branch":return t.index}}(e,r);if(w(t))return t;const n=o(e);return n&&n.hasValue&&(n.slot instanceof K.Number||n.slot instanceof K.Numeric||n.slot instanceof K.Date)?n.slot.toValue(n.value):void 0}return w(e)?e:t}function on(e,t){return w(e)?t(e):void 0}function nn(e,t,r,o,i,s,l){let c=0;switch(r.opcode){case"abs":c=on(rn(r.value,o,e,i),(e=>Math.abs(e)));break;case"acos":c=on(rn(r.value,o,e,i),(e=>Qo(Math.acos(e),r.angleUnits)));break;case"acosh":c=on(rn(r.value,o,e,i),(e=>Math.acosh(e)));break;case"age":c=(()=>{const t=h(r.value)&&i(r.value);if(t&&t.hasValue&&t.slot instanceof K.Date){const o=rn(r.reference,n.UTC,e,i),s=t.slot.toValue(t.value);if(w(o)){const e=t.slot.toValue(o);switch(r.ageIn){case"milliseconds":return e-s;case"seconds":return a.floor((e-s)/1e3);case"minutes":return a.floor((e-s)/6e4);case"hours":return a.floor((e-s)/36e5);case"days":return a.floor((e-s)/864e5);case"months":return function(e,t){const r=new Date(a.min(e,t)),o=new Date(a.max(e,t));return(12*(o.getFullYear()-r.getFullYear())+(o.getMonth()-r.getMonth())-(o.getDate()-r.getDate()<0?1:0))*(e>t?-1:1)}(s,e);default:return function(e,t){const r=new Date(a.min(e,t)),o=new Date(a.max(e,t)),n=o.getMonth()-r.getMonth();let i=o.getFullYear()-r.getFullYear();return(n<0||0===n&&o.getDate()<r.getDate())&&i--,i*(e>t?-1:1)}(s,e)}}}})(),r.ageAbs&&w(c)&&(c=Math.abs(c));break;case"asin":c=on(rn(r.value,o,e,i),(e=>Qo(Math.asin(e),r.angleUnits)));break;case"asinh":c=on(rn(r.value,o,e,i),(e=>Math.asinh(e)));break;case"atan":c=on(rn(r.value,o,e,i),(e=>Qo(Math.atan(e),r.angleUnits)));break;case"atanh":c=on(rn(r.value,o,e,i),(e=>Math.atanh(e)));break;case"boolean":c=(()=>{const t=h(r.value)&&i(r.value);if(t&&t.slot instanceof K.Boolean)return rn(t.hasValue&&!0===t.value?r.outa:r.outb,o,e,i)})();break;case"calc":const t=l&&l(r.id);r.operations&&r.operations.length>0&&(c=o,v(r.operations,(t=>{w(c)&&(c=nn(e,t.operator,t,c,i,s,l))}))),t&&t.set(c);break;case"cast":c=(()=>{const e=h(r.value)&&i(r.value);return e&&e.hasValue?X(e.string):0})();break;case"ceil":c=on(rn(r.value,o,e,i),(e=>a.ceil(e)));break;case"chars":c=(()=>{const e=h(r.value)&&i(r.value);return e&&e.hasValue?e.string.length:0})();break;case"clamp":c=on(rn(r.value,o,e,i),(t=>{const n=rn(r.min,o,e,i),s=rn(r.max,o,e,i);return t=w(n)?a.max(t,n):t,w(s)?a.min(t,s):t}));break;case"cos":c=on(rn(r.value,o,e,i),(e=>Math.cos(Go(e,r.angleUnits))));break;case"cosh":c=on(rn(r.value,o,e,i),(e=>Math.cosh(e)));break;case"count":c=(()=>{const e=h(r.value)&&i(r.value)||void 0;return e?e.refs.length:0})();break;case"date":case"datetime":c=(()=>{const t=e=>{if(w(e)){const t=new Date(e);return"datetime"===r.opcode?(t.setUTCSeconds(0),t.setUTCMilliseconds(0)):(t.setUTCHours(0),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0)),t.getTime()}},s=n.UTC,l=t(rn(r.value,s,e,i)),c=t(rn(r.cona,s,e,i));let u=!1;switch(r.compareMode){case"equal":u=l===c;break;case"before":u=w(l)&&w(c)&&l<c;break;case"after":u=w(l)&&w(c)&&l>c;break;case"between":const t=rn(r.conb,s,e,i);u=w(l)&&w(c)&&w(t)&&l>=a.min(c,t)&&l<=a.max(c,t);break;case"defined":u=w(l)}return rn(u?r.outa:r.outb,o,e,i)})();break;case"day-of-month":case"day-of-week":case"hour":case"millisecond":case"minute":case"month":case"second":case"year":c=(()=>{const e=h(r.value)&&i(r.value);if(e&&e.hasValue&&e.slot instanceof K.Date){const t=e.slot.toDate(e.value);switch(r.opcode){case"year":return t.getUTCFullYear();case"month":return t.getUTCMonth()+1;case"day-of-month":return t.getUTCDate();case"day-of-week":return t.getUTCDay();case"hour":return t.getUTCHours();case"minute":return t.getUTCMinutes();case"second":return t.getUTCSeconds();case"millisecond":return t.getUTCMilliseconds()}}})();break;case"equation":c=(()=>{const t=rn(r.value,o,e,i),n=rn(r.cona,o,e,i);let s=!1;switch(r.compareMode){case"equal":s=t===n;break;case"below":s=w(t)&&w(n)&&t<n;break;case"above":s=w(t)&&w(n)&&t>n;break;case"between":const l=rn(r.conb,o,e,i);s=w(t)&&w(n)&&w(l)&&t>=a.min(n,l)&&t<=a.max(n,l);break;case"defined":s=w(t)}return rn(s?r.outa:r.outb,o,e,i)})();break;case"evaluate":c=(()=>{let t=!1;const n=h(r.value)&&i(r.value);if(n&&n.hasValue){const e=r.ignoreCase?P.lowercase(n.string):n.string,o=(a=s(h(r.cona)?r.cona:""),r.ignoreCase?P.lowercase(a):a);switch(r.compareMode){case"equal":t=e===o;break;case"contains":t=o&&-1!==e.indexOf(o)||!1;break;case"starts":t=o&&0===e.indexOf(o)||!1;break;case"ends":t=o&&e.length>=o.length&&e.lastIndexOf(o)===e.length-o.length||!1;break;case"defined":t=""!==e}}var a;return rn(t?r.outa:r.outb,o,e,i)})();break;case"exp":c=on(rn(r.exponent,o,e,i),(e=>Math.exp(e)));break;case"fact":c=on(rn(r.value,o,e,i),tn);break;case"floor":c=on(rn(r.value,o,e,i),(e=>a.floor(e)));break;case"gamma":c=on(rn(r.value,o,e,i),en);break;case"lines":c=(()=>{const e=h(r.value)&&i(r.value);return e&&e.hasValue&&e.string&&e.string.split("\n").length||0})();break;case"ln":c=on(rn(r.value,o,e,i),(e=>Math.log(e)));break;case"log":c=on(rn(r.value,o,e,i),(e=>Math.log10(e)));break;case"max":c=on(rn(r.value,o,e,i),(t=>{const n=rn(r.max,o,e,i);return w(n)?a.max(t,n):t}));break;case"min":c=on(rn(r.value,o,e,i),(t=>{const n=rn(r.min,o,e,i);return w(n)?a.min(t,n):t}));break;case"mod":c=on(rn(r.value,o,e,i),(t=>{const n=rn(r.divisor,o,e,i);return w(n)&&0!==n?t%n:void 0}));break;case"number":c=rn(r.value,o,e,i);break;case"occurrences":c=(()=>{const e=h(r.value)&&i(r.value);if(e&&e.hasValue){if("regex"!==r.compareMode){const t=h(r.cona)&&(r.ignoreCase?P.lowercase(r.cona):r.cona)||"",o=r.ignoreCase?P.lowercase(e.string):e.string;return t&&o?o.split(t).length-1:0}try{const t=h(r.cona)&&r.cona||"",o=t.indexOf("/"),n=t.lastIndexOf("/");return 0===o&&n>o&&(e=>{try{return(e.match(new RegExp(t.substring(1,n),t.substr(n+1)))||[]).length}catch(e){return 0}})(e.string)||0}catch(e){return 0}}return 0})();break;case"percentage":c=on(rn(r.value,o,e,i),(t=>{const n=rn(r.percentage,o,e,i);return w(n)?t/100*n:void 0}));break;case"pow":c=on(rn(r.value,o,e,i),(t=>{const n=rn(r.exponent,o,e,i);return w(n)?Math.pow(t,n):void 0}));break;case"round":c=on(rn(r.value,o,e,i),(e=>a.round(e)));break;case"score":c=(()=>{const e=h(r.value)&&i(r.value)||void 0;if(e&&r.scores){let t=0;return v(e.refs,(e=>{t+=r.scores[e]||0})),t}})();break;case"sgn":c=on(rn(r.value,o,e,i),(e=>Math.sign(e)));break;case"sin":c=on(rn(r.value,o,e,i),(e=>Math.sin(Go(e,r.angleUnits))));break;case"sinh":c=on(rn(r.value,o,e,i),(e=>Math.sinh(e)));break;case"sqrt":c=on(rn(r.value,o,e,i),(e=>Math.sqrt(e)));break;case"square":c=on(rn(r.value,o,e,i),(e=>e*e));break;case"sum":c=(()=>{const e=h(r.value)&&i(r.value)||void 0;return e?X(e.value):void 0})();break;case"tan":c=on(rn(r.value,o,e,i),(e=>Math.tan(Go(e,r.angleUnits))));break;case"tanh":c=on(rn(r.value,o,e,i),(e=>Math.tanh(e)));break;case"trunc":c=on(rn(r.value,o,e,i),(e=>Math.trunc(e)));break;case"words":c=(()=>{const e=h(r.value)&&i(r.value);return e&&e.hasValue?e.string.split(" ").filter((e=>""!==e)).length:0})();break;default:return}switch(t){case"+":return w(o)||w(c)?(o||0)+(c||0):void 0;case"-":return w(o)||w(c)?(o||0)-(c||0):void 0;case"*":return w(o)&&w(c)?o*c:void 0;case"/":return w(o)&&w(c)&&0!==c?o/c:void 0;case"=":return c}}function an(e,t,r,o,n,i,a){let s=r&&r.hasValue?r.slot.toValue(r.value):void 0;if(!r||w(s)){const o=H(t);if(o>0){r||(s=0);for(let l=0;l<o;l++){const o=t[l],c=0!==l||r?o.operator:"=";if(s=nn(e,c,o,s,n,i,a),!w(s)&&("*"===c||"/"===c))break}}}return o&&o.set(s),s}let sn=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Numeric){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};Zo([S],sn.prototype,"verify",null),sn=Zo([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-calculator"})],sn);let ln=class extends Y{constructor(){super(...arguments),this.calculatorSlot=F(this.valueOf("calculator"))}do(){an(this.context,this.props.operations||[],void 0,this.calculatorSlot,(e=>this.variableFor(e)),(e=>this.parseVariables(e)),(e=>this.valueOf(e,"dynamic")))}};function cn(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}ln=Zo([C({type:"headless",legacyBlock:!0,identifier:"@tripetto/block-calculator"})],ln);let un=class extends z{evaluateDevice(){if(window){const e="live"===this.view&&window.screen&&a.min(window.screen.width,window.screen.height)||a.min(window.innerWidth,window.innerHeight);return e<400?"phone"===this.props.deviceType:e<800?"tablet"===this.props.deviceType:"desktop"===this.props.deviceType}return!1}};function dn(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}cn([S],un.prototype,"evaluateDevice",null),un=cn([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-device"})],un);let pn=class extends z{getMatchString(){const e=$(this.props.value);if(B(e)){const t=this.variableFor(e);return t&&t.hasValue?t.string:""}return this.parseVariables(e,"",!0)}getNumber(e,t){if(m(t)&&(e instanceof K.Number||e instanceof K.Numeric)){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}getDate(e,t){if(m(t)&&e instanceof K.Date){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value,e.supportsTime?"minutes":void 0):void 0}return e.toValue(w(t)?t:n.UTC,e.supportsTime?"minutes":void 0)}validate(){if(this.props.variable){const e=this.variableFor(this.props.variable);if(e)if(e.slot instanceof K.String||e.slot instanceof K.Text){const t=this.props.ignoreCase?P.lowercase(this.getMatchString()):this.getMatchString(),r=this.props.ignoreCase?P.lowercase(e.string):e.string;switch(this.props.mode){case"equal":return r===t;case"not-equal":return r!==t;case"contains":return t&&-1!==r.indexOf(t)||!1;case"not-contains":return t&&-1===r.indexOf(t)||!1;case"starts":return t&&0===r.indexOf(t)||!1;case"ends":return t&&r.length>=t.length&&r.lastIndexOf(t)===r.length-t.length||!1;case"defined":return""!==r;case"undefined":return""===r}}else if(e.slot instanceof K.Number||e.slot instanceof K.Numeric){const t=this.getNumber(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&k(e.value)<t;case"above":return w(t)&&e.hasValue&&k(e.value)>t;case"between":case"not-between":const r=this.getNumber(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&k(e.value)>=a.min(t,r)&&k(e.value)<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}else if(e.slot instanceof K.Date){const t=this.getDate(e.slot,this.props.value),r=e.hasValue?e.slot.toValue(e.value,e.slot.supportsTime?"minutes":void 0):void 0;switch(this.props.mode){case"equal":return r===t;case"not-equal":return r!==t;case"before":return w(t)&&w(r)&&r<t;case"after":return w(t)&&w(r)&&r>t;case"between":case"not-between":const o=this.getDate(e.slot,this.props.to);return w(t)&&w(o)&&(w(r)&&r>=a.min(t,o)&&r<=a.max(t,o))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}else if(e.slot instanceof K.Boolean)switch(this.props.mode){case"true":return e.hasValue&&x(e.value);case"false":return e.hasValue&&!x(e.value);case"equal":case"not-equal":const t=h(this.props.value)&&this.variableFor(this.props.value)||void 0;return t&&(e.hasValue?x(e.value):void 0)===(t.hasValue?x(t.value):void 0)||!1;case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};function hn(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}dn([S],pn.prototype,"validate",null),pn=dn([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-evaluate"})],pn);let vn=class extends z{getMatchString(){if(B(this.props.value)){const e=this.variableFor(this.props.value);return e&&e.hasValue?e.string:""}return this.parseVariables(this.props.value||"","",!0)}isEqual(){const e=this.valueOf();if(e){const t=this.props.ignoreCase?P.lowercase(this.getMatchString()):this.getMatchString(),r=this.props.ignoreCase?P.lowercase(e.string):e.string;switch(this.props.mode){case"equals":return r===t;case"not-equals":return r!==t;case"contains":return t&&-1!==r.indexOf(t)||!1;case"not-contains":return t&&-1===r.indexOf(t)||!1;case"starts":return t&&0===r.indexOf(t)||!1;case"ends":return t&&r.length>=t.length&&r.lastIndexOf(t)===r.length-t.length||!1;case"defined":return""!==r;case"undefined":return""===r;case"regex":try{const t=this.props.regex||"",r=t.indexOf("/"),o=t.lastIndexOf("/");return 0===r&&o>r&&(e=>{try{return new RegExp(t.substring(1,o),t.substr(o+1)).test(e)===!this.props.invert}catch(e){return!1}})(e.string)}catch(e){return!1}}}return!1}};hn([S],vn.prototype,"isEqual",null),vn=hn([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-hidden-field:string",alias:"@tripetto/block-hidden-field-string"})],vn);let gn=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Number){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}compare(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode)}}return!1}};hn([S],gn.prototype,"compare",null),gn=hn([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-hidden-field:number",alias:"@tripetto/block-hidden-field-number"})],gn);let fn=class extends z{compare(){const e=this.valueOf();return e&&e.value===this.props.orientation||!1}};hn([S],fn.prototype,"compare",null),fn=hn([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-hidden-field:orientation",alias:"@tripetto/block-hidden-field-orientation"})],fn);let bn=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Date){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value,"minutes"):void 0}return w(t)?e.toValue(t,"minutes"):void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value),r=e.hasValue?e.slot.toValue(e.value,"minutes"):void 0;switch(this.props.mode){case"equal":return r===t;case"not-equal":return r!==t;case"before":return w(t)&&w(r)&&r<t;case"after":return w(t)&&w(r)&&r>t;case"between":case"not-between":const o=this.getValue(e.slot,this.props.to);return w(t)&&w(o)&&(w(r)&&r>=a.min(t,o)&&r<=a.max(t,o))===("between"===this.props.mode)}}return!1}};hn([S],bn.prototype,"verify",null),bn=hn([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-hidden-field:date"})],bn);let mn=class extends Y{constructor(){super(...arguments),this.fieldSlot=F(this.valueOf("value"))}do(){if(!this.fieldSlot.hasValue||"value"===this.props.fieldType||0===this.props.fieldType.indexOf("custom-variable:"))switch(this.props.fieldType){case"value":const e=this.parseVariables(this.props.fieldValue||"","",!0);this.fieldSlot.hasValue&&!e||(this.fieldSlot.value=e);break;case"uuid":this.fieldSlot.value=t.SHA2_256("10000000-1000-4000-8000-100000000000".replace(/1|0/g,(()=>(0|16*Math.random()).toString(16))));break;case"timestamp":this.fieldSlot.value=n.UTC;break;case"variable":let r;if(this.props.fieldVariable)try{let e=window;for(;!r&&e;)r=J(e,this.props.fieldVariable),e=e!==window.parent&&window.parent||void 0}catch(e){console.log(`@tripetto/block-hidden-field: Access to variable '${this.props.fieldVariable}' is prohibited!`)}"string"==typeof r?this.fieldSlot.value=r:this.fieldSlot.clear();break;case"language":this.fieldSlot.value=navigator.language||"";break;case"querystring":this.fieldSlot.value=(this.props.fieldQueryStringParameter?new URLSearchParams(document.location.search.substring(1)).get(this.props.fieldQueryStringParameter):document.location.search.substring(1))||"";break;case"cookie":if(this.props.fieldCookie){const e=document.cookie.match(RegExp(`(?:^|;\\s*)${this.props.fieldCookie.replace(/([.*+?\^${}()|\[\]\/\\])/g,"\\$1")}=([^;]*)`));this.fieldSlot.value=e&&e[1]||""}else this.fieldSlot.value=document.cookie||"";break;case"localStorage":const o=this.props.fieldLocalStorage&&localStorage.getItem(this.props.fieldLocalStorage);this.fieldSlot.value="string"==typeof o?o:"";break;case"sessionStorage":const i=this.props.fieldSessionStorage&&sessionStorage.getItem(this.props.fieldSessionStorage);this.fieldSlot.value="string"==typeof i?i:"";break;case"user-agent":this.fieldSlot.value=navigator.userAgent||"";break;case"title":this.fieldSlot.value=document.title||"";break;case"url":try{this.fieldSlot.value=document.URL||window.parent.location.href||""}catch(e){this.fieldSlot.clear(),console.log("@tripetto/block-hidden-field: Access to document URL is prohibited!")}break;case"referrer":this.fieldSlot.value=document.referrer||"";break;case"screenOrientation":window.screen&&window.screen.orientation&&window.screen.orientation.type?this.fieldSlot.value="portrait-primary"===window.screen.orientation.type||"portrait-secondary"===window.screen.orientation.type?"portrait":"landscape":this.fieldSlot.value=window.screen&&window.screen.height>window.screen.width?"portrait":"landscape";break;case"screenWidth":this.fieldSlot.value=window.screen&&window.screen.width||0;break;case"screenHeight":this.fieldSlot.value=window.screen&&window.screen.height||0;break;case"devicePixelRatio":this.fieldSlot.value=window.devicePixelRatio||1;break;default:if(0===this.props.fieldType.indexOf("custom-variable:")){let e;try{let t=window;for(;!e&&t;)e=J(t,"TRIPETTO_CUSTOM_VARIABLES"),t=t!==window.parent&&window.parent||void 0}catch(t){e=void 0}Z(e)?this.fieldSlot.value=$(J(e,this.props.fieldType.replace("custom-variable:",""))):this.fieldSlot.clear()}}}};function yn(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}mn=hn([C({type:"headless",legacyBlock:!0,identifier:"@tripetto/block-hidden-field"})],mn);const $n=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;let wn=class extends z{willMail(){const e=this.valueOf("recipient");return this.props.willMail?e&&e.hasValue&&$n.test(e.string)||!1:!e||""===e.string}};yn([S],wn.prototype,"willMail",null),wn=yn([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-mailer"})],wn);let kn=class extends Y{constructor(){super(...arguments),this.recipientSlot=F(this.valueOf("recipient")),this.subjectSlot=F(this.valueOf("subject")),this.messageSlot=F(this.valueOf("message")),this.senderSlot=this.valueOf("sender"),this.dataSlot=this.valueOf("data")}do(){var e,t;if(this.recipientSlot.value=(this.props.recipient&&"fixed"!==this.props.recipient?null===(e=this.variableFor(this.props.recipient))||void 0===e?void 0:e.string:this.props.recipientFixed)||"",this.subjectSlot.value=this.parseVariables(this.node.name||"","-"),this.messageSlot.value=this.parseVariables(this.node.description||"","-",!0),this.senderSlot){const e=(this.props.sender&&"fixed"!==this.props.sender?null===(t=this.variableFor(this.props.sender))||void 0===t?void 0:t.string:this.props.senderFixed)||"";this.senderSlot.value=$n.test(e)&&e||""}this.dataSlot&&this.props.includeData&&(this.dataSlot.value=!0)}validate(){return!this.recipientSlot.string||$n.test(this.recipientSlot.string)}};function xn(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}yn([O],kn.prototype,"validate",null),kn=yn([C({type:"headless",legacyBlock:!0,identifier:"@tripetto/block-mailer"})],kn);let Cn=class extends z{validate(){if(this.props.variable){const e=this.variableFor(this.props.variable);if(e)try{const t=this.props.regex||"",r=t.indexOf("/"),o=t.lastIndexOf("/");return 0===r&&o>r&&(e=>{try{return new RegExp(t.substring(1,o),t.substr(o+1)).test(e)===!this.props.invert}catch(e){return!1}})(e.string)}catch(e){return!1}}return!1}};xn([S],Cn.prototype,"validate",null),Cn=xn([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-regex"})],Cn),e("@tripetto/block-setter"),G();let Sn=class extends Y{querystring(e,t){const r=new URLSearchParams(document.location.search.substring(1)).get(e);return m(r)?r:t}do(){v(this.props.values,(e=>{if(e.variable&&(Q(e.value)||u(e.lock))){const t=this.mutableValueOf(e.variable);if(t&&!t.slot.protected){const r=t.isLocked;if(Q(e.value)&&(!t.isSealed||!r||u(e.lock)))if(r&&t.unlock(),e.value===(t.slot instanceof K.Boolean&&0))t.clear();else if(void 0!==e.mode||t.allowPrefill)if(t.slot instanceof K.String||t.slot instanceof K.Text){if(e.querystring){const r=t.slot.toValue(this.querystring(m(e.value)&&e.value||""));"concatenate"===e.mode?t.concatenate(r,e,e.separator):t.set(r)}else if(h(e.value)&&B(e.value)){const r=this.variableFor(e.value);r&&r.hasValue?"concatenate"===e.mode?t.concatenate(r.string,e,e.separator):t.set(r.string,r.reference):"concatenate"!==e.mode&&t.clear()}else if(m(e.value)){const r=this.parseVariables(e.value,"",!0);"concatenate"===e.mode?t.concatenate(r,e,e.separator):t.set(r,e.reference)}}else if(t.slot instanceof K.Number||t.slot instanceof K.Numeric){const r=r=>{if(w(r)){const o=t.hasValue&&(t.slot instanceof K.Number||t.slot instanceof K.Numeric)?t.slot.toValue(t.value):0;switch(e.mode){case"+":t.operation(o+r,e);break;case"-":t.operation(o-r,e);break;case"*":t.operation(o*r,e);break;case"/":t.operation(0!==r?o/r:void 0,e);break;default:t.set(r)}}else"+"!==e.mode&&"-"!==e.mode&&t.clear()};if(e.querystring)r(t.slot.toValue(this.querystring(m(e.value)&&e.value||"")));else if(!0===e.value)r(an(this.context,e.operations||[],void 0,void 0,(e=>this.variableFor(e)),(e=>this.parseVariables(e))));else if(m(e.value)){const t=this.variableFor(e.value);r(t&&(t.slot instanceof K.Number||t.slot instanceof K.Numeric)&&t.hasValue?t.slot.toValue(t.value):void 0)}else w(e.value)&&r(e.value)}else if(t.slot instanceof K.Boolean){const r=r=>{const o=t.hasValue&&t.slot instanceof K.Boolean?t.slot.toValue(t.value):void 0;switch(e.mode){case"OR":t.operation(!(!o&&!r),e);break;case"NOR":t.operation(!0!==o&&!0!==r,e);break;case"AND":t.operation(!0===o&&!0===r,e);break;case"NAND":t.operation(!0!==o||!0!==r,e);break;case"XOR":t.operation(o!==r,e);break;case"XNOR":t.operation(o===r,e);break;default:t.set(r)}};if(e.querystring)r(t.slot.toValue(this.querystring(m(e.value)&&e.value||"","false")));else if(m(e.value)){const t=this.variableFor(e.value);r(t&&t.slot instanceof K.Boolean&&t.hasValue?t.slot.toValue(t.value):void 0)}else u(e.value)&&r(e.value)}else if(t.slot instanceof K.Date)if(e.querystring)t.set(t.slot.toValue(this.querystring(m(e.value)&&e.value||"")));else if(!0===e.value)t.set(n.UTC);else if(m(e.value)){const r=this.variableFor(e.value);t.set(r&&r.slot instanceof K.Date&&r.hasValue?r.slot.toValue(r.value):void 0)}else w(e.value)&&t.set(e.value);(u(e.lock)||r)&&(!u(e.lock)||e.lock?t.lock():t.unlock())}}}))}};function On(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}Sn=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}([C({type:"headless",legacyBlock:!0,identifier:"@tripetto/block-setter"})],Sn);let zn=class extends z{verify(){const e=this.valueOf();if(e)switch(this.props.mode){case"true":return e.hasValue&&x(e.value);case"false":return e.hasValue&&!x(e.value);case"equal":case"not-equal":const t=h(this.props.value)&&this.variableFor(this.props.value)||void 0;return t&&(e.hasValue?x(e.value):void 0)===(t.hasValue?x(t.value):void 0)||!1;case"defined":return e.hasValue;case"undefined":return!e.hasValue}return!1}};On([S],zn.prototype,"verify",null),zn=On([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-variable:boolean"})],zn);let Pn=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Date){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return e.toValue(w(t)?t:n.UTC)}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value),r=e.hasValue?e.slot.toValue(e.value):void 0;switch(this.props.mode){case"equal":return r===t;case"not-equal":return r!==t;case"before":return w(t)&&w(r)&&r<t;case"after":return w(t)&&w(r)&&r>t;case"between":case"not-between":const o=this.getValue(e.slot,this.props.to);return w(t)&&w(o)&&(w(r)&&r>=a.min(t,o)&&r<=a.max(t,o))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};On([S],Pn.prototype,"verify",null),Pn=On([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-variable:date"})],Pn);let Bn=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Numeric){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};On([S],Bn.prototype,"verify",null),Bn=On([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-variable:numeric"})],Bn);let Vn=class extends z{getMatchString(){if(B(this.props.match)){const e=this.variableFor(this.props.match);return e&&e.hasValue?e.string:""}return this.parseVariables(this.props.match||"","",!0)}isEqual(){const e=this.valueOf();if(e){const t=this.props.ignoreCase?P.lowercase(this.getMatchString()):this.getMatchString(),r=this.props.ignoreCase?P.lowercase(e.string):e.string;switch(this.props.mode){case"exact":return r===t;case"not-exact":return r!==t;case"contains":return t&&-1!==r.indexOf(t)||!1;case"not-contains":return t&&-1===r.indexOf(t)||!1;case"starts":return t&&0===r.indexOf(t)||!1;case"ends":return t&&r.length>=t.length&&r.lastIndexOf(t)===r.length-t.length||!1;case"defined":return""!==r;case"undefined":return""===r}}return!1}};On([S],Vn.prototype,"isEqual",null),Vn=On([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-variable:text"})],Vn),e("@tripetto/block-variable"),G();let Fn=class extends Y{constructor(){super(...arguments),this.variableSlot=F(this.valueOf("variable","static",{modifier:e=>this.props.calculator&&this.props.operations&&e.slot instanceof K.Numeric&&{value:an(this.context,this.props.operations,e,void 0,(e=>this.variableFor(e)),(e=>this.parseVariables(e)))}||void 0}))}do(){this.variableSlot.reset(h(this.props.prefill)?this.parseVariables(this.props.prefill,"",!0):this.props.prefill)}};function Rn(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}Fn=On([C({type:"headless",legacyBlock:!0,identifier:"@tripetto/block-variable"})],Fn);let jn=class extends z{isChecked(){const e=this.valueOf();return!!e&&e.value===this.props.checked}};Rn([S],jn.prototype,"isChecked",null),jn=Rn([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-checkbox",alias:"checkbox"})],jn);let Dn=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Numeric){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};Rn([S],Dn.prototype,"verify",null),Dn=Rn([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-checkbox:score"})],Dn);let Tn=class extends V{constructor(){super(...arguments),this.scoreSlot=this.valueOf("score","feature"),this.checkboxSlot=F(this.valueOf("checked","static",{confirm:!0,onChange:e=>{this.scoreSlot&&e.slot instanceof K.Boolean&&this.scoreSlot.set(e.hasValue?k(!0===e.value?this.props.scoreForTrue:this.props.scoreForFalse):void 0)}})),this.required=this.checkboxSlot.slot.required||!1}get value(){return this.checkboxSlot.value}set value(e){this.checkboxSlot.value=e}toggle(){this.checkboxSlot.value=!this.checkboxSlot.value}validate(){return!this.required||!0===this.checkboxSlot.value}};Rn([O],Tn.prototype,"validate",null);const An=fe.div`
display: block;
width: 100%;
margin: 0;
padding: 0;
`,qn=fe.label`
box-sizing: border-box;
appearance: none;
outline: none;
font-size: 1em;
line-height: 1.6em;
padding-left: calc(${e=>8/7*e.$scale+.375}em + ${e=>2*e.$borderSize}px);
margin: 0;
position: relative;
display: inline-flex;
min-height: ${e=>(8/7+.19)*e.$scale}em;
user-select: none;
opacity: ${e=>e.$disabled?".4":void 0};
transition: opacity 0.15s ease-in-out;
> input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
> span {
box-sizing: content-box;
color: ${e=>Nt(e.$error?e.$errorColor:e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.makeUnclear("#000")))};
}
> span:last-child {
position: absolute;
width: ${e=>8/7*e.$scale}em;
height: ${e=>8/7*e.$scale}em;
top: 0.095em;
left: 0;
background-color: ${e=>Nt(e.$error&&"transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor?e.$errorColor:e.$backgroundColor)};
border: ${e=>`${e.$borderSize}px solid ${Nt(e.$error?e.$errorColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)}`};
border-radius: ${e=>w(e.$roundness)?`${a.min(e.$roundness,4)}px`:4/14*e.$scale+"em"};
transition:
background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out,
box-shadow 0.15s ease-in-out,
opacity 0.15s ease-in-out;
&:after {
width: ${e=>3/14*e.$scale}em;
height: ${e=>.5*e.$scale}em;
left: ${e=>6/14*e.$scale}em;
top: ${e=>2/14*e.$scale}em;
border-style: solid;
border-width: 0 ${e=>2/14*e.$scale}em ${e=>2/14*e.$scale}em 0;
border-color: ${e=>Nt(e.$error?e.$errorColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(t=>t.makeBlackOrWhite("transparent"!==e.$backgroundColor&&(e.$error||"transparent"===e.$borderColor))))};
transform: rotate(45deg) scale(0.1);
transition:
transform 0.15s linear,
opacity 0s linear 0.15s;
content: "";
position: absolute;
opacity: 0;
}
}
&:hover {
> input:not(:disabled) + span + span {
box-shadow: ${e=>("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$error?e.$errorColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.2)))))}`||void 0};
}
}
> input {
&:not(:disabled) {
&:active + span {
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.makeUnclear("#000")))};
}
&:active + span + span {
background-color: ${e=>Nt(e.$backgroundColor)};
border: ${e=>e.$borderSize}px solid
${e=>Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)};
box-shadow: ${e=>("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.1rem ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.2)))))}`||void 0};
&:after {
border-color: ${e=>Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(t=>t.makeBlackOrWhite("transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor)))};
}
}
&:focus + span {
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.makeUnclear("#000")))};
}
&:focus + span + span {
background-color: ${e=>Nt(e.$backgroundColor)};
border: ${e=>e.$borderSize}px solid
${e=>Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)};
box-shadow: ${e=>("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.5)))))}`||void 0};
&:after {
border-color: ${e=>Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(t=>t.makeBlackOrWhite("transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor)))};
}
}
}
&:checked + span + span {
&:after {
transform: rotate(45deg);
opacity: 1;
transition:
transform 0.15s linear,
opacity 0s linear;
}
}
}
`,Mn=e=>{const t=e.value,r=de(0),[o,n]=pe("object"!=typeof t&&t||!1),[i,a]="object"==typeof t?[0!==r.current?o:t.value,e=>{R(r.current),n(e),r.current=j((()=>{r.current=0,t.value=e}),vr)}]:[o,n],s=t=>{a(t),e.onChange&&e.onChange(t)},l=e.disabled||e.readOnly||"object"==typeof t&&(t.isFrozen||t.isLocked)||!1;return he((()=>()=>{R(r.current)}),[]),"object"==typeof t&&t.confirm(),le(An,{children:ue(qn,{$disabled:l,$backgroundColor:e.styles.backgroundColor||"transparent",$borderColor:"transparent"===e.styles.borderColor&&"transparent"===e.styles.backgroundColor&&Nt(e.styles.textColor,(e=>e.makeUnclear("#000")))||Nt(e.styles.borderColor)!==Nt(e.styles.backgroundColor)&&e.styles.borderColor||"transparent",$borderSize:e.styles.borderSize||1,$roundness:e.styles.roundness,$textColor:e.styles.textColor,$errorColor:e.styles.errorColor,$error:e.error||!1,$scale:e.styles.scale||1,children:[le("input",{ref:e.onAutoFocus,type:"checkbox",checked:i,tabIndex:e.tabIndex,"aria-describedby":e.ariaDescribedBy,disabled:l,onChange:e=>s(e.target.checked),onFocus:e.onFocus,onBlur:e.onBlur,onKeyDown:t=>{"Enter"===t.key?(t.preventDefault(),t.shiftKey&&e.onSubmit?e.onSubmit():s(!i)):"Escape"===t.key?t.currentTarget.blur():"Tab"===t.key&&(t.shiftKey?e.onCancel&&(t.preventDefault(),e.onCancel()):(e.tabSubmit||"boolean"!=typeof e.tabSubmit)&&e.onSubmit&&(t.preventDefault(),e.onSubmit()))}}),ue("span",{children:[e.label||"...",e.required&&!e.styles.hideRequiredIndicator&&le(Wt,{$errorColor:e.styles.errorColor}),e.description&&ue("small",{children:[le("br",{}),e.description]})]}),le("span",{})]})})};let In=class extends Tn{constructor(){super(...arguments),this.hideRequiredIndicatorFromName=!0}render(e,t,r){return ue(ce,{children:[e.placeholder&&e.name,e.description,le(Mn,{styles:e.styles.checkboxes,value:this.checkboxSlot,required:this.required,error:e.isFailed,label:e.label,tabIndex:e.tabIndex,ariaDescribedBy:e.ariaDescribedBy,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};function En(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}In=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-checkbox",alias:"checkbox"})],In);let Ln=class extends z{isChecked(){const e=this.valueOf();return e&&e.value===this.props.checked||!1}};En([S],Ln.prototype,"isChecked",null),Ln=En([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-checkboxes"})],Ln);let Un=class extends z{allUnchecked(){const e=this.slots;return!e||!e.each((e=>{const t=this.valueOf(e);return t&&t.value||!1}))}};En([S],Un.prototype,"allUnchecked",null),Un=En([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-checkboxes:unchecked"})],Un);let Nn=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Number){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode)}}return!1}};En([S],Nn.prototype,"verify",null),Nn=En([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-checkboxes:counter"})],Nn);let Wn=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Numeric){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};En([S],Wn.prototype,"verify",null),Wn=En([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-checkboxes:score"})],Wn);let _n=class extends V{constructor(){super(...arguments),this.counterSlot=this.valueOf("counter"),this.concatenationSlot=this.valueOf("concatenation","feature"),this.scoreSlot=this.valueOf("score","feature")}get required(){return this.props.required||!1}transform(){const e=ee(te(this.props.checkboxes,(e=>({id:e.id,label:e.value||e.name||"",exclusive:e.exclusive,valueRef:this.valueOf(e.id)}))),(e=>{var t;return!0===(null===(t=e.valueRef)||void 0===t?void 0:t.value)})).sort(((e,t)=>{var r,o;return((null===(r=t.valueRef)||void 0===r?void 0:r.time)||0)-((null===(o=e.valueRef)||void 0===o?void 0:o.time)||0)})),t=e.length&&e[0];if(t&&e.forEach((e=>{e.id!==t.id&&(t.exclusive||e.exclusive)&&(e.valueRef.value=!1)})),this.props.max){const t=this.props.max;let r=0;e.forEach((e=>{var o;!0===(null===(o=e.valueRef)||void 0===o?void 0:o.value)&&(r++,r>t&&(e.valueRef.value=!1))}))}if(this.counterSlot){const t=ee(e,(e=>{var t;return!0===(null===(t=e.valueRef)||void 0===t?void 0:t.value)})).length;this.counterSlot.set(t)}if(this.concatenationSlot){const e=[];let t="",r=0;if(v(this.props.checkboxes,(o=>{var n;const i=o.value||o.name||"";if(i&&!0===(null===(n=this.valueOf(o.id))||void 0===n?void 0:n.value))switch(this.props.formatSeparator){case"space":t+=(""===t?"":" ")+i;break;case"list":t+=(""===t?"":"\n")+i;break;case"bullets":t+=(""===t?"":"\n")+"- "+i;break;case"numbers":t+=(""===t?"":"\n")+`${++r}. ${i}`;break;case"conjunction":case"disjunction":e.push(i);break;case"custom":t+=(""===t?"":this.props.formatSeparatorCustom||"")+i;break;default:t+=(""===t?"":", ")+i}})),"conjunction"===this.props.formatSeparator||"disjunction"===this.props.formatSeparator)try{const r=new Intl.ListFormat(this.context.l10n.current||"en",{type:this.props.formatSeparator});t=r.format(e)}catch(r){t=P.iterateToString(e,", ")}this.concatenationSlot.set(t)}}score(e){this.scoreSlot&&w(e.score)&&this.scoreSlot.set(re(this.props.checkboxes,((e,t)=>{var r;return e+(!0===(null===(r=this.valueOf(t.id))||void 0===r?void 0:r.value)&&t.score||0)}),0))}checkboxSlot(e){return this.valueOf(e.id,"dynamic",{confirm:!0,onChange:()=>{this.transform(),this.score(e)},onContext:(t,r)=>{var o;this.scoreSlot&&(null===(o=r.contextualValueOf(this.scoreSlot))||void 0===o||o.set(!0===t.value?e.score||0:void 0))}})}isChecked(e){const t=this.checkboxSlot(e);return(null==t?void 0:t.value)||!1}check(e,t){const r=this.checkboxSlot(e);return!!r&&(r.value=t,r.value)}toggle(e){const t=this.checkboxSlot(e);t&&(t.value=!t.value)}checkboxes(e){var t;let r=0;const o=this,n=(null===(t=this.props.checkboxes)||void 0===t?void 0:t.map((t=>{const n=this.checkboxSlot(t);return this.props.max&&!0===(null==n?void 0:n.value)&&r++,{id:t.id,score:t.score,exclusive:t.exclusive,label:e.markdownifyToJSX(t.name,!1),description:t.description&&e.markdownifyToJSX(t.description,!0)||void 0,value:n,tabIndex:e.tabIndex,get disabled(){return o.props.max&&r>=o.props.max&&!0!==(null==n?void 0:n.value)||!1}}})))||[];if(this.props.randomize&&n.length>1){if(!this.randomized||this.randomized.length!==n.length||p(this.randomized,(e=>{var t;return(null===(t=n[e.index])||void 0===t?void 0:t.id)!==e.id}))){this.randomized=n.map(((e,t)=>({index:t,id:e.id})));let e=this.randomized.length;for(;--e;){const t=Math.floor(Math.random()*e),r=this.randomized[e];this.randomized[e]=this.randomized[t],this.randomized[t]=r}}return this.randomized.map((e=>n[e.index]))}return this.randomized&&(this.randomized=void 0),n}validate(){if(this.props.min||this.props.max){const e=ee(this.props.checkboxes,(e=>{var t;return!0===(null===(t=this.checkboxSlot(e))||void 0===t?void 0:t.value)})).length;if(this.props.min&&e<this.props.min||this.props.max&&e>this.props.max)return!1}return!this.props.required||!!p(this.props.checkboxes,(e=>{var t;return!0===(null===(t=this.valueOf(e.id))||void 0===t?void 0:t.value)}))}};En([O],_n.prototype,"validate",null);const Hn=e=>le(ce,{children:e.checkboxes.map(((t,r)=>("preview"===e.view||t.label)&&le(Mn,{styles:e.styles,label:t.label,description:t.description,required:t.required,disabled:t.disabled,readOnly:t.readOnly,error:t.error,tabIndex:t.tabIndex||e.tabIndex,tabSubmit:r+1===e.checkboxes.length,value:t.value,ariaDescribedBy:e.ariaDescribedBy,onChange:t.onChange,onAutoFocus:0===r&&e.onAutoFocus||void 0,onFocus:e.onFocus,onBlur:e.onBlur,onSubmit:e.onSubmit,onCancel:0===r&&e.onCancel||void 0},t.id||r)))});let Kn=class extends _n{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(Hn,{styles:e.styles.checkboxes,view:e.view,checkboxes:this.checkboxes(e),ariaDescribedBy:e.ariaDescribedBy,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};function Yn(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}Kn=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-checkboxes"})],Kn);let Xn=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Date){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return e.toValue(w(t)?t:n.UTC)}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value),r=e.hasValue?e.slot.toValue(e.value):void 0;switch(this.props.mode){case"equal":return r===t;case"not-equal":return r!==t;case"before":return w(t)&&w(r)&&r<t;case"after":return w(t)&&w(r)&&r>t;case"between":case"not-between":const o=this.getValue(e.slot,this.props.to);return w(t)&&w(o)&&(w(r)&&r>=a.min(t,o)&&r<=a.max(t,o))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};Yn([S],Xn.prototype,"verify",null),Xn=Yn([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-date"})],Xn);let Jn=class extends V{constructor(){super(...arguments),this.dateSlot=F(this.valueOf("date")),this.toSlot=this.valueOf("to"),this.required=this.dateSlot.slot.required||!1}get fromError(){return!this.dateSlot.hasValue||!1}get toError(){return!this.toSlot||!this.toSlot.hasValue||this.toSlot.value<this.dateSlot.value}get toPlaceholder(){return L(this.props.placeholder||"",this.context)||""}validate(){return!this.props.range||this.toSlot&&this.dateSlot.hasValue===this.toSlot.hasValue&&this.toSlot.value>=this.dateSlot.value||!1}};Yn([O],Jn.prototype,"validate",null);const Zn=fe.input`
appearance: none;
outline: none;
box-sizing: border-box;
display: block;
width: 100%;
height: ${e=>e.$height?`${e.$height}px`:void 0};
font-size: 1em;
line-height: 1.5em;
background-color: ${e=>Nt(e.$error&&"transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor?e.$errorColor:e.$backgroundColor)};
background-image: ${e=>e.$error?`url("data:image/svg+xml;base64,${_t(Nt(e.$errorColor,(t=>t.makeBlackOrWhite("transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor))))}")`:""};
background-repeat: no-repeat;
background-size: ${8/7}em;
background-position: right 0.6em center;
border: ${e=>`${"transparent"===e.$backgroundColor&&"transparent"===e.$borderColor?0:e.$borderSize}px solid ${Nt(e.$error?e.$errorColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)}`};
color: ${e=>Nt(e.$error?"transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor?Nt(e.$errorColor,(e=>e.makeBlackOrWhite())):e.$errorColor:e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
border-radius: ${e=>w(e.$roundness)?`${e.$roundness}px`:"0.5em"};
padding: ${e=>"transparent"===e.$backgroundColor&&"transparent"===e.$borderColor?"0":.375*e.$scale+"em 0.75em"};
padding-right: ${e=>e.$error&&8/7+.75+"em"||void 0};
margin: 0;
opacity: 0.65;
transition:
color 0.15s ease-in-out,
background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out,
box-shadow 0.15s ease-in-out,
opacity 0.15s ease-in-out;
&::placeholder {
color: ${e=>Nt(e.$error?"transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor?Nt(e.$errorColor,(e=>e.makeBlackOrWhite())):e.$errorColor:e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
opacity: 0.5;
transition: color 0.15s ease-in-out opacity 0.15s ease-in-out;
}
&:not(:disabled):not([readonly]) {
opacity: 1;
&:hover {
box-shadow: ${e=>e.$placeholder&&("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$error?e.$errorColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.2)))))}`||void 0};
}
${e=>!e.$placeholder&&me`
background-color: ${Nt(e.$backgroundColor)};
background-image: none;
border-color: ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)};
color: ${Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
box-shadow: ${("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.5)))))}`||void 0};
&::placeholder {
color: ${Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
opacity: 0.3;
}
`}
}
&::-webkit-clear-button,
&::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
height: 1px;
display: none;
}
`;function Gn(e,t="datetime"){if(!e)return"";if(e instanceof Date&&(e=e.getTime()),0!==e){const r=!0===e?new Date:new Date(e);return`${r.getUTCFullYear()}-${P.padLeft(r.getUTCMonth()+1,"0",2)}-${P.padLeft(r.getUTCDate(),"0",2)}`+("datetime"===t?`T${P.padLeft(r.getUTCHours(),"0",2)}:${P.padLeft(r.getUTCMinutes(),"0",2)}`:"")}return""}function Qn(e){if(e){const t=P.uppercase(P.sanitize(e)).replace(" ","T").split("T");if(t.length>0){const e=P.replaceMultiple(t[0],["/","\\"],"-").split("-"),r=t.length>1?P.replace(t[1],".",":").split(":"):["0","0"];if(3===e.length&&r.length>=2)return new Date(`${P.padLeft(k(e[0]),"0",4)}-${P.padLeft(k(e[1]),"0",2)}-${P.padLeft(k(e[2]),"0",2)}T${P.padLeft(k(r[0]),"0",2)}:${P.padLeft(k(r[1]),"0",2)}:00.000Z`)}}return new Date(0)}const ei=e=>{var t,r;const o=e.value instanceof Date?e.value.getTime():e.value,i=de({duration:0,handle:0}),[s,c]=pe("text"),[u,d]=pe(0),[p,h]=pe(!1),[v,g]=pe("object"==typeof o?Gn(o.slot.toValue(o.pristine),e.mode||"date"):"number"==typeof o?Gn(o,e.mode||"date"):""),[f,b]="object"!=typeof o||o instanceof Date?[v,g]:[p?v:o.hasValue?Gn(o.slot.toValue(o.pristine),e.mode||"date"):"",e=>{R(i.current.handle),g(e);const t=a.range(2*i.current.duration,gr,fr);i.current.handle=j((()=>{const t=n.precise;i.current.handle=0,i.current.update=()=>{i.current.duration=n.elapsed(t,!0),i.current.update=void 0},o.pristine=""!==e?Qn(e).getTime():void 0}),t)}],[m,y]=pe(!!f),$=de(!1),w=()=>e.readOnly||"object"==typeof o&&(o.isFrozen||o.isLocked)||!1,k={$backgroundColor:e.styles.backgroundColor||"transparent",$borderColor:e.styles.borderColor||"transparent",$borderSize:e.styles.borderSize||1,$roundness:e.styles.roundness,$textColor:e.styles.textColor,$errorColor:e.styles.errorColor,$errorVisible:m,$error:e.error||!1,$scale:e.styles.scale||1,$placeholder:!0,$height:u};return he((()=>()=>{R(i.current.handle)}),[]),i.current.update&&i.current.update(),ue(ce,{children:[("text"===s||w())&&le(Zn,Object.assign({id:e.id,ref:e.onAutoFocus,type:"text",tabIndex:e.tabIndex,placeholder:e.placeholder,required:e.required||!1,disabled:e.disabled||!1,readOnly:w(),value:f&&("datetime"===e.mode?((null===(t=e.l10n)||void 0===t?void 0:t.locale)||l.Locales).dateTimeFull(Qn(f).getTime(),!0):((null===(r=e.l10n)||void 0===r?void 0:r.locale)||l.Locales).dateFull(Qn(f).getTime(),!0))||"",autoComplete:"off",inputMode:"none","aria-describedby":e.ariaDescribedBy,onChange:()=>{},onFocus:t=>{w()||($.current=!0,d(t.target.getBoundingClientRect().height),c("datetime"===e.mode?"datetime-local":"date")),dr(h,b,e.onFocus)(t)},onBlur:t=>{w()||pr(h,b,e.onBlur)(t)}},k)),"text"!==s&&!w()&&le(Zn,Object.assign({id:e.id,ref:e=>{$.current&&e&&($.current=!1,e.focus())},type:s,placeholder:"yyyy-MM-ddThh:mm",tabIndex:e.tabIndex,required:!0,disabled:e.disabled||!1,defaultValue:f,autoComplete:"off","aria-describedby":e.ariaDescribedBy,min:Gn("object"==typeof o&&o.slot.minimum||void 0)||void 0,max:Gn("object"==typeof o&&o.slot.maximum||void 0)||void 0,onChange:t=>{if(b(t.target.value),y(!0),e.onChange){const r=e.onChange(Qn(t.target.value));r instanceof Date&&ur(b,Gn(r,e.mode||"date"))}},onFocus:t=>{dr(h,b,e.onFocus)(t)},onBlur:t=>{c("text"),"object"==typeof o&&o.hasValue&&g(Gn(o.slot.toValue(o.pristine),e.mode||"date")),pr(h,b,e.onBlur)(t)},onKeyDown:t=>{"Enter"===t.key&&e.onSubmit?(t.preventDefault(),e.onSubmit()):"Escape"===t.key?t.currentTarget.blur():"Tab"===t.key&&(t.shiftKey?e.onCancel&&(t.preventDefault(),e.onCancel()):e.onSubmit&&(t.preventDefault(),e.onSubmit()))}},k))]})};let ti=class extends Jn{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(ei,{id:e.id,mode:this.props.time?"datetime":"date",styles:e.styles.inputs,l10n:e.l10n,value:this.dateSlot,required:this.required,error:e.isFailed&&(!this.props.range||this.fromError),tabIndex:e.tabIndex,placeholder:e.placeholder,ariaDescribedBy:e.ariaDescribedBy,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:(!this.props.range||!this.toSlot)&&t||void 0,onCancel:r}),this.props.range&&this.toSlot&&le(ei,{mode:this.props.time?"datetime":"date",styles:e.styles.inputs,l10n:e.l10n,value:this.toSlot,required:this.required,error:e.isFailed&&(!this.props.range||this.toError),tabIndex:e.tabIndex,placeholder:this.toPlaceholder,ariaDescribedBy:e.ariaDescribedBy,onFocus:e.focus,onBlur:e.blur,onSubmit:t})]})}};function ri(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}ti=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-date"})],ti);let oi=class extends z{isSelected(){const e=this.valueOf();return e&&(e.reference===this.props.option||!this.props.option&&!e.reference)||!1}};ri([S],oi.prototype,"isSelected",null),oi=ri([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-dropdown"})],oi);let ni=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Numeric){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};ri([S],ni.prototype,"verify",null),ni=ri([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-dropdown:score"})],ni);let ii=class extends V{constructor(){super(...arguments),this.scoreSlot=this.valueOf("score","feature"),this.dropdownSlot=F(this.valueOf("option","static",{confirm:!0,modifier:e=>{if(e.value){if(!e.reference){const t=p(this.props.options,(t=>t.value===e.value))||p(this.props.options,(t=>t.id===e.value))||p(this.props.options,(t=>t.name===e.value))||p(this.props.options,(t=>t.name.toLowerCase()===e.value.toLowerCase()));return{value:t&&(t.value||t.name),reference:t&&t.id,display:null==t?void 0:t.name}}if(!p(this.props.options,(t=>t.id===e.reference)))return{value:void 0,reference:void 0,display:void 0}}},onChange:e=>{if(this.scoreSlot){const t=p(this.props.options,(t=>t.id===e.reference));this.scoreSlot.set(t&&((null==t?void 0:t.score)||0))}}})),this.required=this.dropdownSlot.slot.required||!1}get options(){var e;const t=(null===(e=this.props.options)||void 0===e?void 0:e.map((e=>Object.assign(Object.assign({},e),{name:L(e.name,this.context)}))))||[];if(this.props.randomize&&t.length>1){if(!this.randomized||this.randomized.length!==t.length||p(this.randomized,(e=>{var r;return(null===(r=t[e.index])||void 0===r?void 0:r.id)!==e.id}))){this.randomized=t.map(((e,t)=>({index:t,id:e.id})));let e=this.randomized.length;for(;--e;){const t=Math.floor(Math.random()*e),r=this.randomized[e];this.randomized[e]=this.randomized[t],this.randomized[t]=r}}return this.randomized.map((e=>t[e.index]))}return this.randomized&&(this.randomized=void 0),t}get value(){const e=p(this.props.options,(e=>e.id===this.dropdownSlot.reference));if(!e&&!this.node.placeholder){const e=p(this.props.options,(e=>!!e.name));return this.dropdownSlot.default(e&&(e.value||e.name),e&&e.id),e&&e.id||""}return e&&e.id||""}set value(e){this.select(p(this.props.options,(t=>t.id===e)))}select(e){return this.dropdownSlot.set(e&&(e.value||e.name),e&&e.id,null==e?void 0:e.name),e&&e.id||""}};const ai=e=>btoa(`<?xml version="1.0" encoding="utf-8"?>\n <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20">\n <path d="M15.5 7.5c-0.128 0-0.256-0.049-0.354-0.146l-5.646-5.646-5.646 5.646c-0.195 0.195-0.512 0.195-0.707 0s-0.195-0.512 0-0.707l6-6c0.195-0.195 0.512-0.195 0.707 0l6 6c0.195 0.195 0.195 0.512 0 0.707-0.098 0.098-0.226 0.146-0.354 0.146z" fill="${e}"></path>\n <path d="M9.5 19.5c-0.128 0-0.256-0.049-0.354-0.146l-6-6c-0.195-0.195-0.195-0.512 0-0.707s0.512-0.195 0.707 0l5.646 5.646 5.646-5.646c0.195-0.195 0.512-0.195 0.707 0s0.195 0.512 0 0.707l-6 6c-0.098 0.098-0.226 0.146-0.354 0.146z" fill="${e}"></path>\n </svg>`),si=fe.select`
appearance: none;
outline: none;
box-sizing: border-box;
display: block;
width: 100%;
font-size: 1em;
line-height: 1.5em;
background-color: ${e=>Nt(e.$error&&"transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor?e.$errorColor:e.$backgroundColor)};
background-image: ${e=>`url("data:image/svg+xml;base64,${ai(Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite()))))}")`+(e.$error?`,url("data:image/svg+xml;base64,${_t(Nt(e.$errorColor,(t=>t.makeBlackOrWhite("transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor))))}")`:"")};
background-repeat: no-repeat;
background-size: 1em, ${8/7}em;
background-position:
right 0.375em center,
right 1.75em center;
border: ${e=>`${"transparent"===e.$backgroundColor&&"transparent"===e.$borderColor?0:e.$borderSize}px solid ${Nt(e.$error?e.$errorColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)}`};
border-radius: ${e=>w(e.$roundness)?`${e.$roundness}px`:"0.5em"};
color: ${e=>Nt(e.$error?"transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor?Nt(e.$errorColor,(e=>e.makeBlackOrWhite())):e.$errorColor:e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())),(t=>t.manipulate((e=>e.alpha(.5)),e.$placeholder&&!e.$error)))};
padding: ${e=>"transparent"===e.$backgroundColor&&"transparent"===e.$borderColor?"0 1.75em 0 0":`${.375*e.$scale}em 1.75em ${.375*e.$scale}em 0.75em`};
padding-right: ${e=>e.$error?"3.267857142857143em":void 0};
margin: 0;
opacity: 0.65;
transition:
background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out,
box-shadow 0.15s ease-in-out,
opacity 0.15s ease-in-out;
&::-ms-expand {
display: none;
}
> option {
background-color: ${e=>Nt(e.$backgroundColor)};
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
}
&:not(:disabled) {
opacity: 1;
&:hover {
box-shadow: ${e=>("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$error?e.$errorColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.2)))))}`||void 0};
}
&:focus {
background-color: ${e=>Nt(e.$backgroundColor)};
background-image: ${e=>!e.$errorVisible&&`url("data:image/svg+xml;base64,${ai(Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite()))))}")`||void 0};
border-color: ${e=>Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)};
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())),(t=>t.manipulate((e=>e.alpha(.5)),e.$placeholder)))};
box-shadow: ${e=>("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.5)))))}`||void 0};
}
}
`,li=fe.option`
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())),(e=>e.manipulate((e=>e.alpha(.5)))))} !important;
`,ci=(e,t,r)=>{const o=p(t.options,(e=>e.id===r));if(!o&&!t.placeholder&&t.options.length>0){const r=p(t.options,(e=>!!e.name));r&&e.default(r.value||r.name,r.id,r.name)}else e.reference!==(null==o?void 0:o.id)&&e.set(o&&(o.value||o.name),null==o?void 0:o.id,null==o?void 0:o.name);return o&&o.id||""},ui=e=>{const t=e.value,r=de(0),[o,n]=pe("object"!=typeof t&&t||""),[i,a]="object"==typeof t?[0!==r.current?o:ci(t,e,t.reference),o=>{R(r.current),n(o),r.current=j((()=>{r.current=0,ci(t,e,o)}),vr)}]:[o,n],[s,l]=pe(!!i);return he((()=>()=>{R(r.current)}),[]),ue(si,{id:e.id,ref:e.onAutoFocus,tabIndex:e.tabIndex,required:e.required||!1,disabled:e.disabled||e.readOnly||"object"==typeof t&&(t.isFrozen||t.isLocked)||!1,value:i,"aria-describedby":e.ariaDescribedBy,onChange:t=>{a(t.target.value),l(!0),e.onChange&&e.onChange(t.target.value)},onFocus:e.onFocus,onBlur:e.onBlur,onKeyDown:t=>{t.shiftKey&&"Enter"===t.key&&e.onSubmit?(t.preventDefault(),e.onSubmit()):"Escape"===t.key?t.currentTarget.blur():"Tab"===t.key&&(t.shiftKey?e.onCancel&&(t.preventDefault(),e.onCancel()):e.onSubmit&&(t.preventDefault(),e.onSubmit()))},$backgroundColor:e.styles.backgroundColor||"transparent",$borderColor:e.styles.borderColor||"transparent",$borderSize:e.styles.borderSize||1,$roundness:e.styles.roundness,$textColor:e.styles.textColor,$errorColor:e.styles.errorColor,$errorVisible:s,$error:e.error||!1,$scale:e.styles.scale||1,$placeholder:e.placeholder&&""===i||!1,children:[e.placeholder&&le(li,{value:"",$backgroundColor:e.styles.backgroundColor||"transparent",$borderColor:e.styles.borderColor||"transparent",$textColor:e.styles.textColor,$errorColor:e.styles.errorColor,$error:e.error||!1,children:e.placeholder}),e.options.map(((e,t)=>e.name&&e.id&&le("option",{value:e.id,children:e.name},t)))]})};let di=class extends ii{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(ui,{id:e.id,styles:e.styles.inputs,options:this.options,value:this.dropdownSlot,required:this.required,error:e.isFailed,tabIndex:e.tabIndex,placeholder:e.placeholder,ariaDescribedBy:e.ariaDescribedBy,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};di=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-dropdown"})],di);let pi=class extends V{stopHere(){return!1}};!function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);i>3&&a&&Object.defineProperty(t,r,a)}([O],pi.prototype,"stopHere",null);const hi=fe.div`
color: ${e=>e.$color};
transition: color 0.15s ease-in-out;
> h2 {
font-size: 1.6em;
line-height: 1.3em;
}
`;let vi=class extends pi{constructor(){super(...arguments),this.hideButtons=!0}render(e){return(e.name||e.description)&&ue(hi,{$color:e.styles.inputs.errorColor,children:[e.name,e.description]})}};function gi(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}vi=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-error"})],vi);let fi=class extends z{isUploaded(){const e=this.valueOf();return!(!e||!e.value)===this.props.isUploaded}};gi([S],fi.prototype,"isUploaded",null),fi=gi([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-file-upload"})],fi);let bi=class extends V{constructor(){super(...arguments),this.fileSlot=F(this.valueOf("file")),this.required=this.fileSlot.slot.required||!1}get isUploading(){return this.fileSlot.isAwaiting}get isImage(){return this.fileSlot.hasValue&&this.hasImageExtension(this.fileSlot.value)}get limit(){return this.props.limit&&this.props.limit>0?this.props.limit:10}get allowedExtensions(){return ee(this.props.extensions&&P.replace(this.props.extensions.toLowerCase()," ","").split(",")||[],(e=>e.length>=2&&"."===e.charAt(0)))}getExtension(e){const t=e.lastIndexOf(".");return-1!==t&&t>0?e.substr(t).toLowerCase():""}hasImageExtension(e){return e&&[".jpg",".jpeg",".png",".gif",".webp"].indexOf(this.getExtension(e))>-1||!1}hasValidFileSize(e){if(this.props.limit){const t=1024*this.props.limit*1024;return e.size<=t}return!0}hasValidFileExtension(e){const t=this.getExtension(e.name),r=this.allowedExtensions;return!(r.length>0)||r.indexOf(t)>-1}convertToBase64(e,t,r){const o=new FileReader;r&&(o.onprogress=e=>r(e.loaded/e.total*100)),o.onload=()=>{t(o.result)},o.readAsDataURL(e)}upload(e,t,r){return this.cache=void 0,this.fileSlot.clear(),new Promise(((o,n)=>{if(1!==e.length)return n("invalid-amount");const i=e[0];return this.hasValidFileExtension(i)?this.hasValidFileSize(i)?(this.fileSlot.await(),void(t?t.put(i,r).then((e=>{this.fileSlot.set(i.name,e),this.isImage?this.convertToBase64(i,(e=>{this.cache=e,o()})):o()})).catch((e=>{this.fileSlot.clear(),n(e)})):this.convertToBase64(i,(e=>{this.fileSlot.set(i.name,e),o()}),r))):n("invalid-size"):n("invalid-extension")}))}download(e){return new Promise(((t,r)=>{this.cache?t(this.cache):this.fileSlot.reference?e?e.get(this.fileSlot.reference).then((e=>this.convertToBase64(e,(e=>t(e))))).catch((()=>{this.fileSlot.clear(),r()})):t(this.fileSlot.reference):r()}))}delete(e){return new Promise(((t,r)=>{this.fileSlot.reference&&e?(this.fileSlot.await(),e.delete(this.fileSlot.reference).then((()=>{this.cache=void 0,this.fileSlot.clear(),t()})).catch((()=>{this.fileSlot.cancelAwait(),r()}))):(this.cache=void 0,this.fileSlot.clear(),t())}))}};const mi=ue("svg",{viewBox:"0 0 10240 10240",children:[le("path",{d:"M1280 640l5230 0c352,0 656,126 905,375l1170 1170c249,249 375,553 375,905l0 6510 -7680 0 0 -3761 640 1278 0 1843 6400 0 0 -5440c0,-176 -144,-320 -320,-320l-1600 0 0 -1600c0,-176 -144,-320 -320,-320l-4160 0 0 1562 -640 321 0 -2523zm5760 960l0 960 960 0 -960 -960z"}),le("path",{d:"M1155 3583l3035 -1520c158,-79 350,-14 429,143l1636 3266c79,158 15,350 -143,429l-3266 1636c-157,79 -350,14 -429,-143l-670 -1337c55,15 112,23 172,23l556 0 371 741 2693 -1349 -1349 -2693 -1480 741 -1110 0c-154,0 -304,22 -445,63zm168 1626l-43 -85 0 -4c0,-163 157,-320 320,-320l234 0 2 5c-235,31 -430,190 -513,404z"}),le("path",{d:"M1919 5760c-176,0 -319,-144 -319,-320 0,-177 143,-320 320,-320l1280 0c176,0 320,-144 320,-320 0,-176 -144,-320 -320,-320l-1600 0c-341,0 -640,301 -640,640l0 1108c-97,-56 -186,-125 -265,-203 -240,-241 -375,-565 -375,-905 0,-705 575,-1280 1280,-1280l1600 0c529,0 960,431 960,960 0,528 -430,959 -958,960l-1283 0z"})]}),yi=ue("svg",{className:"icon",viewBox:"0 0 10240 10240",children:[le("path",{d:"M640 5760l640 0c248,0 461,132 572,354l607 1212c111,222 324,354 572,354l4178 0c248,0 461,-132 572,-354l607 -1212c111,-222 324,-354 572,-354l640 0 0 3520c0,176 -144,320 -320,320l-8320 0c-176,0 -320,-144 -320,-320l0 -3520z"}),le("path",{d:"M7887 6400l-160 320 -5214 0 -160 -320 5534 0zm-320 640l-72 143c-57,114 -159,177 -286,177l-4178 0c-127,0 -229,-63 -286,-177l-72 -143 4894 0z"}),le("path",{d:"M6853 4293l-1507 1506c-124,124 -328,124 -452,0l-1507 -1506c-124,-125 -187,-277 -187,-453l0 -1159c0,-66 38,-122 99,-147 61,-26 127,-13 174,34l1007 1007 0 -2135c0,-88 72,-160 160,-160l960 0c88,0 160,72 160,160l0 2135 1007 -1007c47,-47 113,-60 174,-34 61,25 99,81 99,147l0 1159c0,176 -63,328 -187,453z"})]}),$i=fe.div`
outline: none;
box-sizing: border-box;
display: block;
width: 100%;
height: ${e=>14*e.$scale+"em"};
position: relative;
overflow: hidden;
font-size: 1em;
line-height: 1.5em;
background-color: ${e=>Nt(e.$backgroundColor)};
background-image: ${e=>e.$error?`url("data:image/svg+xml;base64,${_t(Nt(e.$errorColor,(t=>t.makeBlackOrWhite("transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor))))}")`:void 0};
background-repeat: no-repeat;
background-size: ${8/7}em;
background-position: right 0.375em top 0.375em;
border: ${e=>`${"transparent"===e.$backgroundColor&&"transparent"===e.$borderColor?0:e.$borderSize}px solid ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)}`};
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
border-radius: ${e=>w(e.$roundness)?`${e.$roundness}px`:"0.5em"};
padding: ${e=>"transparent"===e.$backgroundColor&&"transparent"===e.$borderColor?"0":.375*e.$scale+"em 0.75em"};
margin: 0;
opacity: ${e=>e.$disabled?.65:1};
transition:
color 0.15s ease-in-out,
background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out,
box-shadow 0.15s ease-in-out,
opacity 0.15s ease-in-out;
cursor: default;
svg {
fill: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
transition: fill 0.15s ease-in-out;
}
> div,
> label {
position: absolute;
left: 0.75em;
right: 0.75em;
top: 0.75em;
bottom: 0.75em;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
&:hover {
box-shadow: ${e=>!e.$disabled&&("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.2)))))}`||void 0};
}
&:focus {
background-color: ${e=>!e.$disabled&&Nt(e.$backgroundColor)||void 0};
background-image: ${e=>e.$errorVisible?void 0:"none"};
border-color: ${e=>!e.$disabled&&Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)||void 0};
color: ${e=>!e.$disabled&&Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))||void 0};
box-shadow: ${e=>!e.$disabled&&("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.5)))))}`||void 0};
}
`,wi=fe.label`
cursor: pointer;
* {
pointer-events: none;
}
> svg {
display: block;
height: ${e=>5*e.$scale+"em"};
margin-bottom: 0.375em;
}
> input {
width: 1px;
height: 1px;
opacity: 0;
overflow: hidden;
position: absolute;
z-index: -1;
}
> span {
display: block;
text-align: center;
}
> small {
display: block;
text-align: center;
}
`,ki=fe.div`
> div {
display: block;
text-align: center;
}
> div:first-child {
font-weight: bold;
}
> div:last-of-type {
margin-bottom: 0.375em;
}
`,xi=fe.div`
> div {
display: inline-block;
width: 80%;
max-width: 300px;
height: 16px;
background-color: ${e=>Nt(e.$color,(e=>e.manipulate((e=>e.alpha(.25)))))};
border-radius: 4px;
overflow: hidden;
margin-bottom: 0.375em;
> div {
width: 0%;
height: 16px;
background-color: ${e=>Nt(e.$color)};
background-image: linear-gradient(
45deg,
${e=>Nt(e.$color,(e=>e.makeBlackOrWhite().manipulate((e=>e.alpha(.25)))))} 25%,
transparent 25%,
transparent 50%,
${e=>Nt(e.$color,(e=>e.makeBlackOrWhite().manipulate((e=>e.alpha(.25)))))} 50%,
${e=>Nt(e.$color,(e=>e.makeBlackOrWhite().manipulate((e=>e.alpha(.25)))))} 75%,
transparent 75%,
transparent
);
background-size: 1rem 1rem;
transition: width 0.5s ease-out;
}
}
> span {
display: block;
text-align: center;
}
`,Ci=fe.div`
> img,
> svg {
display: block;
height: ${e=>6*e.$scale+"em"};
margin: 0.375em;
}
> div {
display: block;
text-align: center;
white-space: nowrap;
text-overflow: ellipsis;
}
> div:last-of-type {
margin-bottom: 0.75em;
}
`,Si=e=>{const[t,r]=pe({loading:e.controller.isImage,base64data:""});return he((()=>{e.controller.isImage&&(t.loading||r({loading:!0,base64data:""}),e.controller.download(e.service).then((e=>r({loading:!1,base64data:e}))).catch((()=>r({loading:!1,base64data:""}))))}),[e.controller.fileSlot.reference]),t.loading?le(ce,{children:e.loading}):t.base64data&&(e.host?le(e.host,{children:le("img",{src:t.base64data})}):le("img",{src:t.base64data}))||le(ce,{children:e.error})},Oi=e=>{const[t,r]=pe(!1),[o,n]=pe(!1),[i,s]=pe(-1),[l,c]=pe(""),[u,d]=pe(!1),p=de(),h=e.disabled||e.controller.fileSlot.isFrozen||e.controller.fileSlot.isLocked||!1,v=e.styles.textColor?e.styles.textColor:e.styles.borderColor&&"transparent"!==e.styles.borderColor?e.styles.borderColor:Nt(e.styles.backgroundColor||"transparent",(e=>e.makeBlackOrWhite())),g=t=>{h||(s(0),d(!0),e.controller.upload(t,e.service,(e=>s(a.floor(e)))).then((()=>s(-1))).catch((e=>{c(e),s(-1)})))},f=()=>{e.controller.fileSlot.hasValue&&!l&&-1===i&&(n(!0),d(!0),e.controller.delete(e.service).then((()=>n(!1))).catch((()=>n(!1))))};return ue($i,{ref:e.onAutoFocus,tabIndex:e.tabIndex||0,onFocus:e.onFocus,onBlur:e.onBlur,onKeyDown:t=>{"Enter"===t.key?t.shiftKey?e.onSubmit&&(t.preventDefault(),e.onSubmit()):l||-1!==i||(e.controller.fileSlot.hasValue&&e.onSubmit?(t.preventDefault(),e.onSubmit()):p.current&&(t.preventDefault(),p.current.click())):"Escape"===t.key?t.currentTarget.blur():"Tab"===t.key?t.shiftKey?e.onCancel&&(t.preventDefault(),e.onCancel()):e.onSubmit&&(t.preventDefault(),e.onSubmit()):"Delete"===t.key&&e.controller.fileSlot.hasValue&&!l&&-1===i&&(t.preventDefault(),f())},$backgroundColor:e.styles.backgroundColor||"transparent",$borderColor:e.styles.borderColor||"transparent",$borderSize:e.styles.borderSize||1,$roundness:e.styles.roundness,$textColor:e.styles.textColor,$errorColor:e.styles.errorColor,$errorVisible:u,$error:e.error||!1,$scale:e.styles.scale||1,$disabled:h,children:[!e.controller.fileSlot.hasValue&&!l&&-1===i&&ue(wi,{onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),h||-1!==i||r(!0)},onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),r(!1)},onDrop:e=>{if(e.preventDefault(),e.stopPropagation(),r(!1),!h&&-1===i){const t=e.dataTransfer.files;t&&g(t)}},$scale:e.styles.scale||1,children:[yi,le("input",{ref:e=>p.current=e,type:"file",multiple:!1,tabIndex:-1,disabled:h,"aria-describedby":e.ariaDescribedBy,onChange:e=>{e.target&&e.target.files&&g(e.target.files)}}),le("span",{children:e.labels(t?"dragging":"explanation","")}),e.controller.limit>0&&le("small",{children:e.labels("limit",`${e.controller.limit}Mb`)}),e.controller.allowedExtensions.length>0&&le("small",{children:e.labels("extensions",P.iterateToString(e.controller.allowedExtensions,", "))})]}),!l&&-1!==i&&ue(xi,{onDragOver:e=>{e.preventDefault()},onDrop:e=>{e.preventDefault()},$color:v,children:[le("div",{children:le("div",{style:{width:`${a.range(i,0,100)}%`}})}),le("span",{children:e.labels("progress",`${a.range(i,0,100)}%`)})]}),l&&ue(ki,{onDragOver:e=>{e.preventDefault()},onDrop:e=>{e.preventDefault()},children:[le("div",{children:e.labels("invalid-file","")}),le("div",{children:"invalid-amount"===l?e.labels("invalid-amount",""):"invalid-extension"===l?e.labels("invalid-extension",""):"invalid-size"===l?e.labels("invalid-size",""):e.labels("error",l)}),le(Kt,{styles:{baseColor:v,mode:"outline"},tabIndex:e.tabIndex||0,label:e.labels("retry",""),onClick:()=>c("")})]}),e.controller.fileSlot.hasValue&&!l&&-1===i&&ue(Ci,{onDragOver:e=>{e.preventDefault()},onDrop:e=>{e.preventDefault()},$scale:e.styles.scale||1,children:[e.controller.isImage?le(Si,{controller:e.controller,service:e.service,loading:mi,error:mi}):mi,le("div",{children:e.controller.fileSlot.string}),le(Kt,{styles:{baseColor:v,mode:"outline"},tabIndex:e.tabIndex||0,label:e.labels("delete",""),disabled:o,onClick:f})]})]})};let zi=class extends bi{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(Oi,{styles:e.styles.fileUpload,controller:this,service:e.attachments,error:e.isFailed,tabIndex:e.tabIndex,ariaDescribedBy:e.ariaDescribedBy,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r,labels:(t,r)=>{switch(t){case"explanation":return e.l10n.pgettext("runner#6|📂 File upload","Choose or drag a file here");case"dragging":return e.l10n.pgettext("runner#6|📂 File upload","Drop your file now");case"limit":return e.l10n.pgettext("runner#6|📂 File upload","Size limit: %1",r);case"extensions":return e.l10n.pgettext("runner#6|📂 File upload","Allowed extensions: %1",r);case"retry":return e.l10n.pgettext("runner#6|📂 File upload","Try again");case"progress":return e.l10n.pgettext("runner#6|📂 File upload","Uploading (%1)",r);case"delete":return e.l10n.pgettext("runner#6|📂 File upload","Delete");case"invalid-file":return e.l10n.pgettext("runner#6|📂 File upload","This file can't be used.");case"invalid-amount":return e.l10n.pgettext("runner#6|📂 File upload","Too many files selected.");case"invalid-extension":return e.l10n.pgettext("runner#6|📂 File upload","Extension is not allowed.");case"invalid-size":return e.l10n.pgettext("runner#6|📂 File upload","File size is too large.");case"error":return e.l10n.pgettext("runner#6|📂 File upload","Something went wrong while uploading%1.",r&&` (${r})`||"")}}})]})}};function Pi(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}zi=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-file-upload",alias:"file-upload"})],zi);let Bi=class extends z{isSelected(){const e=this.valueOf();return e&&e.reference===this.props.column||!1}};Pi([S],Bi.prototype,"isSelected",null),Bi=Pi([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-matrix"})],Bi);let Vi=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Numeric){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};Pi([S],Vi.prototype,"verify",null),Vi=Pi([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-matrix:score"})],Vi);let Fi=class extends V{constructor(){super(...arguments),this.scoreSlot=this.valueOf("score","feature"),this.required=!(!this.props.required&&!p(this.props.rows,(e=>this.isRowRequired(e))))}rowSlot(e){return this.valueOf(e.id,"dynamic",{modifier:e=>{if(e.value){if(!e.reference){const t=p(this.props.columns,(t=>t.value===e.value))||p(this.props.columns,(t=>t.id===e.value))||p(this.props.columns,(t=>t.label===e.value))||p(this.props.columns,(t=>t.label.toLowerCase()===e.value.toLowerCase()));return{value:t&&(t.value||t.label),reference:t&&t.id,display:null==t?void 0:t.label}}if(!p(this.props.columns,(t=>t.id===e.reference)))return{value:void 0,reference:void 0,display:void 0}}},onChange:()=>{this.scoreSlot&&this.scoreSlot.set(re(this.props.rows,((e,t)=>{var r;return e+((null===(r=p(this.props.columns,(e=>{var r;return e.id===(null===(r=this.valueOf(t.id))||void 0===r?void 0:r.reference)})))||void 0===r?void 0:r.score)||0)}),0))}})}isRowRequired(e){var t;return(null===(t=this.rowSlot(e))||void 0===t?void 0:t.slot.required)||!1}isColumnSelected(e,t){var r;return(null===(r=this.rowSlot(e))||void 0===r?void 0:r.reference)===t.id}getSelectedColumn(e){return p(this.props.columns,(t=>this.isColumnSelected(e,t)))}selectColumn(e,t){var r;null===(r=this.rowSlot(e))||void 0===r||r.set(t&&(t.value||t.label),t&&t.id,null==t?void 0:t.label)}columns(e){var t;return(null===(t=this.props.columns)||void 0===t?void 0:t.map((t=>Object.assign(Object.assign({},t),{name:L(t.label,this.context,void 0,!1,y.Formatting|y.Hyperlinks),label:e.markdownifyToJSX(t.label,!1)}))))||[]}rows(e){var t;return(null===(t=this.props.rows)||void 0===t?void 0:t.map((t=>{const r=this.rowSlot(t),o=!(this.props.required||!r||!r.slot.required);return Object.assign(Object.assign({},t),{label:e.markdownifyToJSX(t.name,!1),explanation:t.explanation&&e.markdownifyToJSX(t.explanation,!0)||void 0,required:o,value:r,tabIndex:e.tabIndex})})))||[]}validate(){return!p(this.props.rows,(e=>{const t=this.rowSlot(e);return!(!this.props.required&&!(null==t?void 0:t.slot.required)||(null==t?void 0:t.reference))}))}};Pi([O],Fi.prototype,"validate",null);const Ri=fe.div`
display: block;
width: 100%;
margin: 0;
padding: 0;
`,ji=fe.label`
box-sizing: border-box;
appearance: none;
outline: none;
font-size: 1em;
line-height: 1.6em;
padding-left: calc(${e=>8/7*e.$scale+.375}em + ${e=>2*e.$borderSize}px);
margin: 0;
position: relative;
display: inline-flex;
min-height: ${e=>(8/7+.19)*e.$scale}em;
user-select: none;
opacity: ${e=>e.$disabled?".4":void 0};
transition: opacity 0.15s ease-in-out;
> input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
> span {
box-sizing: content-box;
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.makeUnclear("#000")))};
}
> span:last-child {
position: absolute;
width: ${e=>8/7*e.$scale}em;
min-width: ${e=>8/7*e.$scale}em;
height: ${e=>8/7*e.$scale}em;
min-height: ${e=>8/7*e.$scale}em;
top: ${e=>e.$label?"0.095em":"0em"};
left: 0;
background-color: ${e=>Nt(e.$backgroundColor)};
border: ${e=>`${e.$borderSize}px solid ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)}`};
border-radius: 50%;
transition:
background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out,
box-shadow 0.15s ease-in-out,
opacity 0.15s ease-in-out;
&:after {
width: ${e=>12/14*e.$scale}em;
height: ${e=>12/14*e.$scale}em;
left: ${e=>2/14*e.$scale}em;
top: ${e=>2/14*e.$scale}em;
border-radius: 50%;
background-color: ${e=>Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(t=>t.makeBlackOrWhite("transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor)))};
transform: scale(0.1);
transition:
transform 0.15s linear,
opacity 0s linear 0.15s;
content: "";
position: absolute;
opacity: 0;
}
}
&:hover {
> input:not(:disabled) + span + span {
box-shadow: ${e=>("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.2)))))}`||void 0};
}
}
> input {
&:not(:disabled) {
&:active + span {
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.makeUnclear("#000")))};
}
&:active + span + span {
background-color: ${e=>Nt(e.$backgroundColor)};
border: ${e=>e.$borderSize}px solid
${e=>Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)};
box-shadow: ${e=>("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.1rem ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.2)))))}`||void 0};
&:after {
background-color: ${e=>Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(t=>t.makeBlackOrWhite("transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor)))};
}
}
&:focus + span {
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.makeUnclear("#000")))};
}
&:focus + span + span {
background-color: ${e=>Nt(e.$backgroundColor)};
border: ${e=>e.$borderSize}px solid
${e=>Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)};
box-shadow: ${e=>("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.5)))))}`||void 0};
&:after {
background-color: ${e=>Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(t=>t.makeBlackOrWhite("transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor)))};
}
}
}
&:checked + span + span {
&:after {
transform: none;
opacity: 1;
transition:
transform 0.15s linear,
opacity 0s linear;
}
}
}
`,Di=(e,t,r)=>{const o=p(t.buttons,(e=>e.id===r));return e.reference!==(null==o?void 0:o.id)&&e.set(o&&(o.value||o.name),null==o?void 0:o.id,null==o?void 0:o.name),o&&o.id||""};let Ti=0;const Ai=e=>{const r=e.value,o=de(0),[n,i]=pe("object"!=typeof r&&r||""),[a,s]="object"==typeof r?[0!==o.current?n:Di(r,e,r.reference),t=>{R(o.current),i(t),o.current=j((()=>{o.current=0,Di(r,e,t)}),vr)}]:[n,i],[l]=pe((()=>t.SHA2_256("Radiobuttons"+Ti++))),c=t=>{s(t),e.onChange&&e.onChange(t)},u=e.disabled||e.readOnly||"object"==typeof r&&(r.isFrozen||r.isLocked)||!1,d={$disabled:u,$color:e.styles.backgroundColor,$backgroundColor:e.styles.backgroundColor||"transparent",$borderColor:"transparent"===e.styles.borderColor&&"transparent"===e.styles.backgroundColor&&Nt(e.styles.textColor,(e=>e.makeUnclear("#000")))||Nt(e.styles.borderColor)!==Nt(e.styles.backgroundColor)&&e.styles.borderColor||"transparent",$borderSize:e.styles.borderSize||1,$textColor:e.styles.textColor,$scale:e.styles.scale||1,$label:!0};return he((()=>()=>{R(o.current)}),[]),le(ce,{children:e.buttons.map(((t,r)=>t.id&&("preview"===e.view||t.label||t.name||t.description)&&le(Ri,{children:ue(ji,Object.assign({},d,{children:[le("input",{ref:(a?a===t.id:0===r)&&e.onAutoFocus||void 0,type:"radio",name:l,checked:a===t.id,tabIndex:t.tabIndex||e.tabIndex,"aria-describedby":e.ariaDescribedBy,disabled:u,onChange:()=>c(t.id),onClick:()=>{e.allowUnselect&&a===t.id&&c("")},onFocus:e.onFocus,onBlur:e.onBlur,onKeyDown:r=>{if((e.allowUnselect||a!==t.id)&&("Enter"===r.key||" "===r.key)&&!r.shiftKey)return r.preventDefault(),void c(a===t.id?"":t.id);"Enter"===r.key&&r.shiftKey&&e.onSubmit?e.onSubmit():"Escape"===r.key?r.currentTarget.blur():"Tab"===r.key&&(r.shiftKey?e.onCancel&&(r.preventDefault(),e.onCancel()):e.onSubmit&&(r.preventDefault(),e.onSubmit()))}}),ue("span",{children:[t.label||t.name||"...",t.description&&ue("small",{children:[le("br",{}),t.description]})]}),le("span",{})]}))},t.id||r)))})},qi=fe.div`
overflow-x: auto;
scroll-behavior: smooth;
scrollbar-width: none;
-ms-overflow-style: none;
-webkit-overflow-scrolling: touch;
-webkit-tap-highlight-color: transparent;
&::-webkit-scrollbar {
display: none;
}
`,Mi=fe.table`
display: table;
width: 100%;
border-collapse: collapse;
font-size: 1em;
line-height: 1.5em;
> thead > tr {
> th {
text-align: center;
vertical-align: bottom;
font-weight: normal;
color: ${e=>e.$textColor};
background-color: ${e=>Nt(e.$textColor,(e=>e.manipulate((e=>e.alpha(.2)))))};
border-bottom: 1px solid ${e=>Nt(e.$textColor,(e=>e.manipulate((e=>e.alpha(.2)))))};
cursor: default;
padding-top: 0.5em;
padding-bottom: 0.5em;
&:first-child {
background-color: transparent;
}
}
> th + th {
padding-left: 8px;
padding-right: 8px;
}
}
> tbody {
> tr {
> th {
text-align: left;
font-weight: normal;
padding-right: 8px;
padding-top: 0.5em;
padding-bottom: 0.5em;
color: ${e=>e.$textColor};
border-bottom: 1px solid ${e=>Nt(e.$textColor,(e=>e.manipulate((e=>e.alpha(.2)))))};
cursor: default;
min-width: 50%;
> small {
opacity: 0.8;
}
}
> td {
position: relative;
border-bottom: 1px solid ${e=>Nt(e.$textColor,(e=>e.manipulate((e=>e.alpha(.15)))))};
> label {
display: flex;
justify-content: center;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
padding-left: 0;
> span:nth-child(2) {
position: absolute;
}
> span:last-child {
position: relative;
align-self: center;
}
}
}
}
> tr:last-child {
> th,
> td {
border-bottom: none;
}
}
}
`;let Ii=0;const Ei=e=>{const[r]=pe((()=>t.SHA2_256("Matrix"+Ii++))),o=de(0),n=de({}),[,i]=pe({}),a={$disabled:e.disabled||e.readOnly||!1,$color:e.styles.backgroundColor,$backgroundColor:e.styles.backgroundColor!==e.styles.borderColor&&e.styles.backgroundColor||"transparent",$borderColor:"transparent"===e.styles.borderColor&&"transparent"===e.styles.backgroundColor&&Nt(e.styles.textColor,(e=>e.makeUnclear("#000")))||Nt(e.styles.borderColor)!==Nt(e.styles.backgroundColor)&&e.styles.borderColor||"transparent",$borderSize:e.styles.borderSize||1,$textColor:e.styles.textColor,$errorColor:e.styles.errorColor,$scale:e.styles.scale||1,$label:!1},s=(t,r)=>{"object"==typeof t.value&&(R(o.current),n.current[t.id]=r?r.id:"",i({}),o.current=j((()=>{o.current=0,v(n.current,((t,r)=>{const o=p(e.rows,(e=>e.id===r));if(delete n.current[r],o&&"object"==typeof o.value){const r=t&&p(e.columns,(e=>e.id===t))||void 0;o.value.set(r&&(r.value||r.name),null==r?void 0:r.id,null==r?void 0:r.name)}}),{keys:!0})}),vr)),t.onChange&&t.onChange(r&&r.id||"")};return he((()=>()=>{R(o.current)}),[]),le(qi,{children:ue(Mi,Object.assign({},a,{children:[le("thead",{children:ue("tr",{children:[le("th",{scope:"col"}),e.columns.map(((e,t)=>le("th",{scope:"col",children:e.label||e.name||"..."},t)))]})}),le("tbody",{children:e.rows.map(((t,o)=>ue("tr",{children:[ue("th",{scope:"row",children:[t.label||"...",(t.required||e.required)&&!e.styles.hideRequiredIndicator&&le(Wt,{$errorColor:e.styles.errorColor}),t.explanation&&ue("small",{children:[le("br",{}),t.explanation]})]}),e.columns.map(((i,l)=>{const c=("object"==typeof t.value?$(n.current[t.id],t.value.reference||""):t.value)===i.id;return le("td",{children:ue(ji,Object.assign({},a,{children:[le("input",{ref:0===o&&0===l&&e.onAutoFocus||void 0,type:"radio",name:r+o,checked:c,tabIndex:t.tabIndex||e.tabIndex,"aria-describedby":e.ariaDescribedBy,disabled:e.disabled||e.readOnly||"object"==typeof t.value&&(t.value.isFrozen||t.value.isLocked)||!1,onChange:()=>s(t,i),onClick:()=>{e.allowUnselect&&c&&s(t,void 0)},onFocus:e.onFocus,onBlur:e.onBlur,onKeyDown:r=>{if((e.allowUnselect||!c)&&("Enter"===r.key||" "===r.key)&&!r.shiftKey)return r.preventDefault(),void s(t,!c&&i||void 0);"Enter"===r.key&&r.shiftKey&&e.onSubmit?e.onSubmit():"Escape"===r.key?r.currentTarget.blur():"Tab"===r.key&&(r.shiftKey?e.onCancel&&0===o&&(r.preventDefault(),e.onCancel()):e.onSubmit&&o+1===e.rows.length&&(r.preventDefault(),e.onSubmit()))}}),le("span",{}),le("span",{})]}))},o+"-"+l)}))]},o)))})]}))})};let Li=class extends Fi{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(Ei,{styles:e.styles.matrix,columns:this.columns(e),rows:this.rows(e),ariaDescribedBy:e.ariaDescribedBy,allowUnselect:!0,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};function Ui(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}Li=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-matrix"})],Li);let Ni=class extends z{isSelected(){const e=this.valueOf();return e&&e.value===this.props.selected||!1}};Ui([S],Ni.prototype,"isSelected",null),Ni=Ui([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-multi-select"})],Ni);let Wi=class extends z{noneSelected(){const e=this.slots;return!e||!e.each((e=>{const t=this.valueOf(e);return t&&t.value||!1}))}};Ui([S],Wi.prototype,"noneSelected",null),Wi=Ui([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-multi-select:none"})],Wi);let _i=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Number){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode)}}return!1}};Ui([S],_i.prototype,"verify",null),_i=Ui([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-multi-select:counter"})],_i);let Hi=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Numeric){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};Ui([S],Hi.prototype,"verify",null),Hi=Ui([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-multi-select:score"})],Hi);let Ki=class extends V{constructor(){super(...arguments),this.counterSlot=this.valueOf("counter","meta"),this.concatenationSlot=this.valueOf("concatenation","feature"),this.scoreSlot=this.valueOf("score","feature")}get required(){return this.props.required||!1}transform(){const e=ee(te(this.props.options,(e=>({id:e.id,label:e.value||e.name||"",exclusive:e.exclusive,valueRef:this.valueOf(e.id)}))),(e=>{var t;return!0===(null===(t=e.valueRef)||void 0===t?void 0:t.value)})).sort(((e,t)=>{var r,o;return((null===(r=t.valueRef)||void 0===r?void 0:r.time)||0)-((null===(o=e.valueRef)||void 0===o?void 0:o.time)||0)})),t=e.length&&e[0];if(t&&e.forEach((e=>{e.id!==t.id&&(t.exclusive||e.exclusive)&&(e.valueRef.value=!1)})),this.props.max){const t=this.props.max;let r=0;e.forEach((e=>{var o;!0===(null===(o=e.valueRef)||void 0===o?void 0:o.value)&&(r++,r>t&&(e.valueRef.value=!1))}))}if(this.counterSlot){const t=ee(e,(e=>{var t;return!0===(null===(t=e.valueRef)||void 0===t?void 0:t.value)})).length;this.counterSlot.set(t)}if(this.concatenationSlot){const e=[];let t="",r=0;if(v(this.props.options,(o=>{var n;const i=o.value||o.name||"";if(i&&!0===(null===(n=this.valueOf(o.id))||void 0===n?void 0:n.value))switch(this.props.formatSeparator){case"space":t+=(""===t?"":" ")+i;break;case"list":t+=(""===t?"":"\n")+i;break;case"bullets":t+=(""===t?"":"\n")+"- "+i;break;case"numbers":t+=(""===t?"":"\n")+`${++r}. ${i}`;break;case"conjunction":case"disjunction":e.push(i);break;case"custom":t+=(""===t?"":this.props.formatSeparatorCustom||"")+i;break;default:t+=(""===t?"":", ")+i}})),"conjunction"===this.props.formatSeparator||"disjunction"===this.props.formatSeparator)try{const r=new Intl.ListFormat(this.context.l10n.current||"en",{type:this.props.formatSeparator});t=r.format(e)}catch(r){t=P.iterateToString(e,", ")}this.concatenationSlot.set(t)}}score(e){this.scoreSlot&&w(e.score)&&this.scoreSlot.set(re(this.props.options,((e,t)=>{var r;return e+(!0===(null===(r=this.valueOf(t.id))||void 0===r?void 0:r.value)&&t.score||0)}),0))}optionSlot(e){return this.valueOf(e.id,"dynamic",{confirm:"shallow",onChange:()=>{this.transform(),this.score(e)},onContext:(t,r)=>{var o;this.scoreSlot&&(null===(o=r.contextualValueOf(this.scoreSlot))||void 0===o||o.set(!0===t.value?e.score||0:void 0))}})}isSelected(e){const t=this.optionSlot(e);return!0===(null==t?void 0:t.value)||!1}select(e,t){const r=this.optionSlot(e);return!!r&&(r.value=t,r.value)}toggle(e){const t=this.optionSlot(e);t&&(t.value=!t.value)}options(e){var t;let r=0;const o=this,n=(null===(t=this.props.options)||void 0===t?void 0:t.map((t=>{const n=this.optionSlot(t);return this.props.max&&!0===(null==n?void 0:n.value)&&r++,{id:t.id,name:e.markdownifyToString(t.name),label:e.markdownifyToJSX(t.name,!1),description:t.description&&e.markdownifyToJSX(t.description,!0)||void 0,value:n,score:t.score,exclusive:t.exclusive,get disabled(){return o.props.max&&r>=o.props.max&&!0!==(null==n?void 0:n.value)||!1}}})))||[];if(this.props.randomize&&n.length>1){if(!this.randomized||this.randomized.length!==n.length||p(this.randomized,(e=>{var t;return(null===(t=n[e.index])||void 0===t?void 0:t.id)!==e.id}))){this.randomized=n.map(((e,t)=>({index:t,id:e.id})));let e=this.randomized.length;for(;--e;){const t=Math.floor(Math.random()*e),r=this.randomized[e];this.randomized[e]=this.randomized[t],this.randomized[t]=r}}return this.randomized.map((e=>n[e.index]))}return this.randomized&&(this.randomized=void 0),n}validate(){if(this.props.min||this.props.max){const e=ee(this.props.options,(e=>{var t;return!0===(null===(t=this.optionSlot(e))||void 0===t?void 0:t.value)})).length;if(this.props.min&&e<this.props.min||this.props.max&&e>this.props.max)return!1}return!this.props.required||!!p(this.props.options,(e=>{var t;return!0===(null===(t=this.valueOf(e.id))||void 0===t?void 0:t.value)}))}};Ui([O],Ki.prototype,"validate",null);const Yi=fe.div`
box-sizing: border-box;
display: block;
width: 100%;
font-size: 1em;
line-height: 1.5em;
background-color: ${e=>Nt(e.$error&&"transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor?e.$errorColor:e.$backgroundColor)};
background-image: ${e=>`url("data:image/svg+xml;base64,${ai(Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite()))))}")`+(e.$error?`,url("data:image/svg+xml;base64,${_t(Nt(e.$errorColor,(t=>t.makeBlackOrWhite("transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor))))}")`:"")};
background-repeat: no-repeat;
background-size: 1em, ${8/7}em;
background-position:
right 0.375em center,
right 1.75em center;
border: ${e=>`${"transparent"===e.$backgroundColor&&"transparent"===e.$borderColor?0:e.$borderSize}px solid ${Nt(e.$error?e.$errorColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)}`};
border-radius: ${e=>w(e.$roundness)?`${e.$roundness}px`:"0.5em"};
padding: ${e=>"transparent"===e.$backgroundColor&&"transparent"===e.$borderColor?"0 1.75em 0 0":`${.375*e.$scale/2}em ${e.$error?1.75+8/7+.375:1.75}em ${.375*e.$scale/2}em ${5/14*e.$scale}em`};
margin: 0;
opacity: 0.65;
transition:
background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out,
box-shadow 0.15s ease-in-out,
opacity 0.15s ease-in-out;
cursor: default;
> div:first-child {
display: flex;
align-items: center;
flex-wrap: wrap;
flex-direction: row;
}
&:not(:disabled) {
opacity: 1;
${e=>e.$focus?`\n background-color: ${Nt(e.$backgroundColor)};\n background-image: ${!e.$errorVisible&&`url("data:image/svg+xml;base64,${ai(Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite()))))}")`||void 0};\n border-color: ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)};\n box-shadow: ${("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.5)))))}`||void 0};\n `:`\n &:hover {\n box-shadow: ${("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$error?e.$errorColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.2)))))}`||void 0};\n }\n `}
}
`,Xi=fe.input`
flex: 1 1 0%;
min-width: 60px;
background-color: transparent;
border: 0;
outline: 0;
padding: 0;
font-size: 1em;
line-height: 1.5em;
color: ${e=>Nt(e.$error?"transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor?Nt(e.$errorColor,(e=>e.makeBlackOrWhite())):e.$errorColor:e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
appearance: none;
overflow: hidden;
padding: 0;
margin: ${e=>.375*e.$scale/2+"em 0"};
opacity: ${e=>e.$visible?"1":"0"};
&:first-child {
margin-left: 0.375em;
}
&::placeholder {
color: ${e=>Nt(e.$error?"transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor?Nt(e.$errorColor,(e=>e.makeBlackOrWhite())):e.$errorColor:e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
opacity: 0.5;
transition: color 0.15s ease-in-out opacity 0.15s ease-in-out;
}
&:focus {
&::placeholder {
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
opacity: 0.3;
}
}
&::-webkit-search-cancel-button {
display: none;
}
`,Ji=fe.div`
margin: ${e=>`${.375*e.$scale/2}em 0.375em ${.375*e.$scale/2}em 0`};
padding-left: 0.5em;
cursor: default;
background-color: ${e=>e.$filled?Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite()))):void 0};
border: ${e=>e.$filled?void 0:`1px solid ${Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))}`};
border-radius: ${e=>0!==e.$roundness?`${e.$roundness||5}px`:"0px"};
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())),(t=>e.$filled?t.makeBlackOrWhite():t))};
display: flex;
align-items: stretch;
max-width: 50%;
> div {
font-size: 0.8em;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
> button {
appearance: none;
background-color: transparent;
border: none;
outline: 0;
width: 1.6em;
min-width: 1.6em;
background-image: ${e=>{return`url("data:image/svg+xml;base64,${t=Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())),(t=>e.$filled?t.makeBlackOrWhite():t)),btoa(`<?xml version="1.0" encoding="utf-8"?>\n <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20">\n <path d="M10.707 10.5l5.646-5.646c0.195-0.195 0.195-0.512 0-0.707s-0.512-0.195-0.707 0l-5.646 5.646-5.646-5.646c-0.195-0.195-0.512-0.195-0.707 0s-0.195 0.512 0 0.707l5.646 5.646-5.646 5.646c-0.195 0.195-0.195 0.512 0 0.707 0.098 0.098 0.226 0.146 0.354 0.146s0.256-0.049 0.354-0.146l5.646-5.646 5.646 5.646c0.098 0.098 0.226 0.146 0.354 0.146s0.256-0.049 0.354-0.146c0.195-0.195 0.195-0.512 0-0.707l-5.646-5.646z" fill="${t}"></path>\n </svg>`)}")`;var t}};
background-repeat: no-repeat;
background-size: 1em;
background-position: center;
opacity: ${e=>e.$readOnly?"0.4":"0.7"};
&:hover {
opacity: ${e=>e.$readOnly?"0.4":"1"};
}
}
`,Zi=fe.div`
position: fixed;
display: block;
top: 0;
left: 0;
z-index: 2147483638;
cursor: default;
box-sizing: border-box;
padding: ${e=>`calc(0.2rem + ${"transparent"===e.$backgroundColor&&"transparent"===e.$borderColor?0:e.$borderSize}px) 0`};
> div {
background-color: ${e=>Nt("transparent"!==e.$backgroundColor?e.$backgroundColor:"#fff")};
border-radius: ${e=>w(e.$roundness)?`${e.$roundness}px`:"0.5em"};
border: ${e=>`${("transparent"===e.$backgroundColor&&"transparent"===e.$borderColor?0:e.$borderSize)||1}px solid ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(t=>t.makeUnclear(e.$textColor||"#000")))}`};
overflow: auto;
scroll-behavior: auto;
scrollbar-width: none;
-webkit-overflow-scrolling: touch;
-webkit-tap-highlight-color: transparent;
-ms-overflow-style: none;
&::-webkit-scrollbar {
display: none;
}
}
`,Gi=fe.div`
display: flex;
flex-direction: column;
font-size: 1em;
line-height: 1.5em;
width: 100%;
padding: 0.375em 0.75em;
padding-right: 4em;
opacity: ${e=>e.$disabled?"0.5":"1"};
background-color: ${e=>e.$selected&&!e.$disabled?Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite()))):"transparent"};
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())),(t=>e.$selected&&!e.$disabled?t.makeBlackOrWhite():t))};
> div:nth-child(2) {
font-size: 0.8em;
line-height: 1.3em;
}
`,Qi=e=>{const t=ee(e.options,(e=>{var t;return!(!0!==(null===(t=e.value)||void 0===t?void 0:t.value)||!e.name)})),[r,i]=pe(!1),[s,l]=pe(""),[c,u]=pe(""),[d,h]=pe(),[g,f]=pe(t.length>0),b=de({position:0,time:0}),m=de(!1),y=de(),$=de(null),w=de(null),k=de(null),x=r&&ee(e.options,(e=>{var t;return!0!==(null===(t=e.value)||void 0===t?void 0:t.value)&&e.name&&!e.disabled&&(!s||-1!==e.name.toLowerCase().indexOf(s.toLowerCase()))||!1}))||[],C={$backgroundColor:e.styles.backgroundColor||"transparent",$borderColor:e.styles.borderColor||"transparent",$borderSize:e.styles.borderSize||1,$roundness:e.styles.roundness,$textColor:e.styles.textColor,$errorColor:e.styles.errorColor,$errorVisible:g,$error:e.error||!1,$scale:e.styles.scale||1,$placeholder:e.placeholder&&0===t.length&&(!r||!s)||!1,$focus:r},S=()=>{var e,t;b.current={position:(null===(t=null===(e=w.current)||void 0===e?void 0:e.firstElementChild)||void 0===t?void 0:t.scrollTop)||0,time:n.now}};return!r&&c&&(u(""),m.current=!1),!r&&d&&h(void 0),ue(Yi,Object.assign({ref:$,onMouseDown:e=>{const t=e.target.tagName.toLowerCase();!r||"button"===t||"input"===t&&s?"input"!==t&&(e.preventDefault(),e.stopPropagation(),y.current&&y.current.focus()):(e.preventDefault(),e.stopPropagation(),y.current&&y.current.blur())},role:"combobox","aria-haspopup":"listbox","aria-owns":r&&`${e.id}-options`||void 0,"aria-controls":e.id,"aria-expanded":r,"aria-describedby":e.ariaDescribedBy},C,{children:[ue("div",{children:[t.map(((t,r)=>{var o,n;return ue(Ji,Object.assign({$filled:"outline"!==e.styles.pills,$readOnly:t.disabled||(null===(o=t.value)||void 0===o?void 0:o.isFrozen)||(null===(n=t.value)||void 0===n?void 0:n.isLocked)||!1},C,{children:[le("div",{children:t.label||t.name}),le("button",{onClick:()=>{var e,r;!t.value||t.disabled||(null===(e=t.value)||void 0===e?void 0:e.isFrozen)||(null===(r=t.value)||void 0===r?void 0:r.isLocked)||(t.value.value=!1,S(),f(!0))}})]}),t.id||r)})),le(Xi,Object.assign({ref:r=>{e.onAutoFocus&&0===t.length&&e.onAutoFocus(r),y.current=r},id:e.id,type:"search",autoComplete:"off",spellCheck:"false",inputMode:"text",value:r&&s||"",placeholder:!t.length&&e.placeholder||"",onChange:e=>l(e.target.value||""),onFocus:dr(i,l,e.onFocus),onBlur:pr(i,l,e.onBlur),onKeyDown:r=>{var n,i;if("Enter"===r.key&&c){r.preventDefault();let i=0;const a=p(x,(e=>(i++,e.id===c)));!a||a.disabled||!a.value||a.value.isFrozen||a.value.isLocked||e.maxSelected&&!(t.length<e.maxSelected)||(a.value.value=!0,S(),u((null===(n=o(x,i))||void 0===n?void 0:n.id)||""),f(!0))}else if("Escape"===r.key)r.currentTarget.blur();else if("Tab"===r.key)r.currentTarget.blur(),r.shiftKey?e.onCancel&&(r.preventDefault(),e.onCancel()):e.onSubmit&&(r.preventDefault(),e.onSubmit());else if("ArrowDown"===r.key||"ArrowUp"===r.key||"ArrowLeft"===r.key||"ArrowRight"===r.key){if(m.current=!0,c){let e=!1,t="";if(("ArrowDown"===r.key||"ArrowRight"===r.key?oe:v)(x,(r=>{r.id===c?e=!0:e||(t=r.id)})),e&&t)return void u(t)}u((null===(i=o(x,"ArrowUp"===r.key||"ArrowLeft"===r.key?x.length-1:0))||void 0===i?void 0:i.id)||"")}else if("Backspace"===r.key&&!s&&t.length>0){const e=t[t.length-1];e.value&&(e.value.value=!1,S(),f(!0))}},$visible:!!(r||!t.length&&e.placeholder)},C))]}),r&&x.length>0&&le(e.overlay,{onEffect:()=>{var e;const t=()=>{var e,t;if($.current&&w.current){const r=$.current.getBoundingClientRect(),o=w.current.getBoundingClientRect(),n=(null===(e=w.current.firstElementChild)||void 0===e?void 0:e.getBoundingClientRect())||o,i=($.current.ownerDocument.documentElement.clientHeight||window.innerHeight)-r.bottom,s=((null===(t=w.current.firstElementChild)||void 0===t?void 0:t.scrollHeight)||0)>i&&r.top>i,l={left:o.left+(r.left-o.left),top:o.top+(s?r.top-o.height-o.top+C.$borderSize-1:r.bottom-o.top-C.$borderSize+1),width:r.width,height:a.max((s?r.top:i)-a.max(o.height-n.height,0),120)};N(d,l,!0)||h(l)}};if(d||t(),n.elapsed(b.current.time)<300&&(null===(e=w.current)||void 0===e?void 0:e.firstElementChild)&&w.current.firstElementChild.scrollTo(0,b.current.position),k.current&&(k.current.scrollIntoView({behavior:"auto",block:"nearest"}),m.current=!1),$.current){const e="ResizeObserver"in window&&new ResizeObserver((()=>t())),r=$.current.getBoundingClientRect(),o=r.top,n=r.width,i=()=>{if($.current){const e=$.current.getBoundingClientRect();e.top!==o||e.width!==n?t():a=requestAnimationFrame(i)}};let a=requestAnimationFrame(i);return e&&e.observe($.current),()=>{e&&e.disconnect(),cancelAnimationFrame(a)}}},children:le(Zi,Object.assign({ref:w,id:`${e.id}-options`,style:{transform:`translate(${(null==d?void 0:d.left)||0}px,${(null==d?void 0:d.top)||0}px)`,maxWidth:"full"!==e.styles.overlayWidth?null==d?void 0:d.width:void 0,width:"full"===e.styles.overlayWidth?null==d?void 0:d.width:void 0,opacity:d?1:0}},C,{children:le("div",{style:{maxHeight:null==d?void 0:d.height},children:x.map(((r,n)=>{var i,a;return ue(Gi,Object.assign({ref:m.current&&c===r.id&&k||void 0,"data-id":r.id,role:"option","aria-selected":c===r.id,onMouseMove:()=>u(r.id),onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:()=>{var i;!r.value||r.disabled||r.value.isFrozen||r.value.isLocked||e.maxSelected&&!(t.length<e.maxSelected)||(r.value.value=!0,S(),u((null===(i=o(x,n+1))||void 0===i?void 0:i.id)||""),f(!0))},$disabled:r.disabled||(null===(i=r.value)||void 0===i?void 0:i.isFrozen)||(null===(a=r.value)||void 0===a?void 0:a.isLocked)||e.maxSelected&&t.length>=e.maxSelected||!1,$selected:c===r.id},C,{children:[le("div",{children:r.label||r.name}),r.description&&le("div",{children:r.description})]}),r.id||n)}))},`${e.id}-list`)}),`${e.id}-options`)})]}))};let ea=class extends Ki{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(Qi,{id:e.id,overlay:e.overlay,styles:e.styles.inputs,options:this.options(e),required:this.required,error:e.isFailed,tabIndex:e.tabIndex,placeholder:e.placeholder,ariaDescribedBy:e.ariaDescribedBy,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};function ta(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}ea=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-multi-select"})],ea);let ra=class extends z{isChosen(){const e=this.valueOf(this.props.choice)||this.valueOf("choice");return!!e&&(u(e.value)?e.value:e.reference===this.props.choice)}};ta([S],ra.prototype,"isChosen",null),ra=ta([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-multiple-choice",alias:"multiple-choice"})],ra);let oa=class extends z{isUndefined(){const e=this.valueOf("choice");if(e)return!e.value;{const e=this.slots;return!e||!e.each((e=>{const t=this.valueOf(e);return t&&t.value||!1}))}}};ta([S],oa.prototype,"isUndefined",null),oa=ta([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-multiple-choice:undefined"})],oa);let na=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Number){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode)}}return!1}};ta([S],na.prototype,"verify",null),na=ta([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-multiple-choice:counter"})],na);let ia=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Numeric){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};ta([S],ia.prototype,"verify",null),ia=ta([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-multiple-choice:score"})],ia);let aa=class extends V{constructor(){super(...arguments),this.counterSlot=this.valueOf("counter"),this.concatenationSlot=this.valueOf("concatenation","feature"),this.scoreSlot=this.valueOf("score","feature"),this.singleChoiceSlot=this.valueOf("choice","static",{modifier:e=>{if(e.value){if(!e.reference){const t=p(this.props.choices,(t=>t.value===e.value))||p(this.props.choices,(t=>t.id===e.value))||p(this.props.choices,(t=>t.name===e.value))||p(this.props.choices,(t=>t.name.toLowerCase()===e.value.toLowerCase()));return{value:t&&(t.value||t.name),reference:t&&t.id,display:null==t?void 0:t.name}}if(!p(this.props.choices,(t=>t.id===e.reference)))return{value:void 0,reference:void 0,display:void 0}}},onChange:e=>{if(this.scoreSlot){const t=p(this.props.choices,(t=>t.id===e.reference));this.scoreSlot.set(t&&((null==t?void 0:t.score)||0))}}})}get required(){return this.props.required||!1}transform(){if(this.props.multiple){const e=ee(te(this.props.choices,(e=>({id:e.id,exclusive:e.exclusive,valueRef:this.choiceSlot(e)}))),(e=>{var t;return!0===(null===(t=e.valueRef)||void 0===t?void 0:t.value)})).sort(((e,t)=>{var r,o;return((null===(r=t.valueRef)||void 0===r?void 0:r.time)||0)-((null===(o=e.valueRef)||void 0===o?void 0:o.time)||0)})),t=e.length&&e[0];if(t&&e.forEach((e=>{e.id!==t.id&&(t.exclusive||e.exclusive)&&(e.valueRef.value=!1)})),this.props.max){const t=this.props.max;let r=0;e.forEach((e=>{var o;!0===(null===(o=e.valueRef)||void 0===o?void 0:o.value)&&(r++,r>t&&(e.valueRef.value=!1))}))}if(this.counterSlot){const t=ee(e,(e=>{var t;return!0===(null===(t=e.valueRef)||void 0===t?void 0:t.value)})).length;this.counterSlot.set(t)}if(this.concatenationSlot){const e=[];let t="",r=0;if(v(this.props.choices,(o=>{var n;const i=o.value||o.name||"";if(i&&!0===(null===(n=this.valueOf(o.id))||void 0===n?void 0:n.value))switch(this.props.formatSeparator){case"space":t+=(""===t?"":" ")+i;break;case"list":t+=(""===t?"":"\n")+i;break;case"bullets":t+=(""===t?"":"\n")+"- "+i;break;case"numbers":t+=(""===t?"":"\n")+`${++r}. ${i}`;break;case"conjunction":case"disjunction":e.push(i);break;case"custom":t+=(""===t?"":this.props.formatSeparatorCustom||"")+i;break;default:t+=(""===t?"":", ")+i}})),"conjunction"===this.props.formatSeparator||"disjunction"===this.props.formatSeparator)try{const r=new Intl.ListFormat(this.context.l10n.current||"en",{type:this.props.formatSeparator});t=r.format(e)}catch(r){t=P.iterateToString(e,", ")}this.concatenationSlot.set(t)}}}score(e){this.scoreSlot&&w(e.score)&&this.scoreSlot.set(re(this.props.choices,((e,t)=>{var r;return e+(!0===(null===(r=this.valueOf(t.id))||void 0===r?void 0:r.value)&&t.score||0)}),0))}choiceSlot(e){return this.props.multiple&&this.valueOf(e.id,"dynamic",{confirm:!0,onChange:()=>{this.transform(),this.score(e)},onContext:(t,r)=>{var o;this.scoreSlot&&(null===(o=r.contextualValueOf(this.scoreSlot))||void 0===o||o.set(!0===t.value?e.score||0:void 0))}})||void 0}choices(e){var t;let r=0;const o=this,n=(null===(t=this.props.choices)||void 0===t?void 0:t.map((t=>{const n=this.choiceSlot(t),i=this.context;return this.props.multiple&&this.props.max&&!0===(null==n?void 0:n.value)&&r++,{id:t.id,get name(){return L(t.name,i,void 0,!1,y.Formatting|y.Hyperlinks)},get label(){return e.markdownifyToJSX(t.name,!1)},get description(){return t.description&&e.markdownifyToJSX(t.description,!0)||void 0},get descriptionString(){return t.description&&L(t.description,i,void 0,!0,y.Formatting|y.Hyperlinks)||void 0},url:t.url&&U(t.url,this.context)||void 0,target:t.target,value:t.value,score:t.score,exclusive:t.exclusive,color:t.color,slot:n,tabIndex:e.tabIndex,get disabled(){return o.props.max&&r>=o.props.max&&!0!==(null==n?void 0:n.value)||!1}}})))||[];if(this.props.randomize&&n.length>1){if(!this.randomized||this.randomized.length!==n.length||p(this.randomized,(e=>{var t;return(null===(t=n[e.index])||void 0===t?void 0:t.id)!==e.id}))){this.randomized=n.map(((e,t)=>({index:t,id:e.id})));let e=this.randomized.length;for(;--e;){const t=Math.floor(Math.random()*e),r=this.randomized[e];this.randomized[e]=this.randomized[t],this.randomized[t]=r}}return this.randomized.map((e=>n[e.index]))}return this.randomized&&(this.randomized=void 0),n}validate(){var e;if(this.props.multiple&&(this.props.min||this.props.max)){const e=ee(this.props.choices,(e=>{var t;return!0===(null===(t=this.choiceSlot(e))||void 0===t?void 0:t.value)})).length;if(this.props.min&&e<this.props.min||this.props.max&&e>this.props.max)return!1}return!this.props.required||(this.props.multiple?!!p(this.props.choices,(e=>{var t;return!0===(null===(t=this.choiceSlot(e))||void 0===t?void 0:t.value)})):(null===(e=this.singleChoiceSlot)||void 0===e?void 0:e.hasValue)||!1)}};ta([O],aa.prototype,"validate",null);const sa=ue("svg",{viewBox:"0 0 20 20",children:[le("path",{d:"M19.5 0h-5c-0.276 0-0.5 0.224-0.5 0.5s0.224 0.5 0.5 0.5h3.833l-11.186 11.146c-0.196 0.195-0.196 0.511-0.001 0.707 0.098 0.098 0.226 0.147 0.354 0.147s0.255-0.049 0.353-0.146l11.147-11.107v3.753c0 0.276 0.224 0.5 0.5 0.5s0.5-0.224 0.5-0.5v-5c0-0.276-0.224-0.5-0.5-0.5z"}),le("path",{d:"M16.5 20h-15c-0.827 0-1.5-0.673-1.5-1.5v-15c0-0.827 0.673-1.5 1.5-1.5h10c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5h-10c-0.276 0-0.5 0.224-0.5 0.5v15c0 0.276 0.224 0.5 0.5 0.5h15c0.276 0 0.5-0.224 0.5-0.5v-10c0-0.276 0.224-0.5 0.5-0.5s0.5 0.224 0.5 0.5v10c0 0.827-0.673 1.5-1.5 1.5z"})]}),la=fe.div`
display: table;
width: ${e=>"equal"===e.$alignment?"auto":"100%"};
> * {
display: ${e=>"vertical"===e.$alignment||"equal"===e.$alignment||"full"===e.$alignment?"block":"inline-block"};
width: ${e=>("equal"===e.$alignment||"full"===e.$alignment?"100%":"columns"===e.$alignment&&"calc(50% - 4px)")||void 0};
margin-top: 8px;
margin-right: ${e=>("columns"===e.$alignment||"horizontal"===e.$alignment)&&`${e.$margin||8}px`||void 0};
&:nth-child(even) {
margin-right: ${e=>"columns"===e.$alignment?"0px":void 0};
}
&:last-child {
margin-right: ${e=>"horizontal"===e.$alignment?"0px":void 0};
}
> span {
display: ${e=>"full"===e.$alignment?"flex":void 0};
justify-content: ${e=>"full"===e.$alignment?"center":void 0};
text-align: ${e=>"full"===e.$alignment?"center":void 0};
overflow: hidden;
}
}
`,ca=(e,t,r)=>{const o=p(t,(e=>e.id===r));return e.reference!==(null==o?void 0:o.id)&&e.set(o&&(o.value||o.name),null==o?void 0:o.id,null==o?void 0:o.name),o&&o.id||""},ua=e=>{const t=e.value,r=de(0),n=de({}),[i,a]=pe("object"!=typeof t&&t||""),[s,l]="object"==typeof t?[0!==r.current?i:ca(t,e.buttons,t.reference),o=>{R(r.current),a(o),r.current=j((()=>{r.current=0,ca(t,e.buttons,o),e.autoSubmit&&o&&hr(u)}),vr)}]:[i,a],[,c]=pe({}),u=de({id:0,cb:e.onSubmit}),d=o=>{if(o.url)return;const i=o.slot?x(n.current[o.id],o.slot.value):s===o.id;if(o.slot)R(r.current),n.current[o.id]=!i,c({}),r.current=j((()=>{r.current=0,v(n.current,((t,r)=>{const o=p(e.buttons,(e=>e.id===r));delete n.current[r],o&&o.slot&&(o.slot.value=t)}),{keys:!0})}),vr);else{const r=i&&!e.required?"":o.id;u.current.id&&(clearTimeout(u.current.id),u.current.id=0),l(r),e.onChange&&e.onChange(r),"object"!=typeof t&&e.autoSubmit&&r&&hr(u)}o.onChange&&o.onChange(!(o.slot||!e.required)||!i)};return he((()=>()=>{R(r.current)}),[]),u.current.cb=e.onSubmit,le(la,{$alignment:e.alignment||"vertical",$margin:e.styles.margin,children:e.buttons.map(((r,i)=>{const a=r.slot?x(n.current[r.id],r.slot.value):s===r.id;return r.slot&&r.slot.confirm(),("preview"===e.view||r.name||r.description)&&le(Kt,{styles:{baseColor:r.color||e.styles.color,mode:a?"fill":"outline",hover:"outline",outlineSize:e.styles.outlineSize,roundness:e.styles.roundness,scale:e.styles.scale},hyperlink:r.url&&{url:r.url,target:r.target||"blank"}||void 0,label:r.label||r.name||"...",description:r.description,icon:r.url&&"self"!==r.target&&sa||void 0,iconPosition:"right",tabIndex:r.tabIndex||e.tabIndex,ariaDescribedBy:e.ariaDescribedBy,disabled:r.disabled||e.disabled||e.readOnly||"object"==typeof t&&(t.isFrozen||t.isLocked)||r.slot&&(r.slot.isFrozen||r.slot.isLocked)||!1,onAutoFocus:(r.slot||!s?0===i:a)&&e.onAutoFocus||void 0,onFocus:e.onFocus,onBlur:e.onBlur,onKeyDown:t=>{if(t.shiftKey&&"Enter"===t.key&&e.onSubmit)t.preventDefault(),e.onSubmit();else if("Escape"===t.key)t.currentTarget.blur();else if("Tab"===t.key)t.shiftKey?e.onCancel&&0===i&&(t.preventDefault(),e.onCancel()):e.onSubmit&&i+1===e.buttons.length&&(t.preventDefault(),e.onSubmit());else{const r=1===t.key.length&&t.key.charCodeAt(0)||0,n=(r<=57?r-48:0)||(r<=90?r-64:0)||(r<=122?r-96:0);if(n>0&&n<=26){const t=o(e.buttons,n-1);t&&d(t)}}},onClick:()=>d(r)},r.id||i)}))})};let da=class extends aa{constructor(){super(...arguments),this.hideButtons=!(this.props.multiple||!p(this.props.choices,(e=>!!e.name&&!e.url))),this.autoSubmit=this.hideButtons}render(e,t,r){return ue(ce,{children:[this.props.imageURL&&this.props.imageAboveText&&le(No,{src:e.markdownifyToImage(this.props.imageURL),width:this.props.imageWidth,isPage:e.isPage}),e.name,this.props.caption&&le(Ko,{children:e.markdownifyToJSX(this.props.caption)}),e.description,this.props.imageURL&&!this.props.imageAboveText&&le(No,{src:e.markdownifyToImage(this.props.imageURL),width:this.props.imageWidth,isPage:e.isPage}),le(ua,{styles:e.styles.multipleChoice,view:e.view,buttons:this.choices(e),alignment:("equal"===this.props.alignment||"full"===this.props.alignment||"columns"===this.props.alignment?this.props.alignment:this.props.alignment&&"horizontal")||"vertical",value:!this.props.multiple&&this.valueOf("choice")||void 0,required:this.required,ariaDescribedBy:e.ariaDescribedBy,autoSubmit:this.autoSubmit,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};function pa(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}da=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-multiple-choice",alias:"multiple-choice",autoRender:!0})],da);let ha=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Numeric){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};pa([S],ha.prototype,"verify",null),ha=pa([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-number"})],ha),e("@tripetto/block-number"),G();let va=class extends V{constructor(){super(...arguments),this.calculatorSlot=this.valueOf("calculator","feature"),this.numberSlot=F(this.valueOf("number","static",{prefill:w(this.props.prefill)&&{value:this.props.prefill}||void 0,onChange:e=>{this.calculatorSlot&&e.slot instanceof K.Numeric&&an(this.context,this.props.operations||[],e,this.calculatorSlot,(e=>this.variableFor(e)),(e=>this.parseVariables(e)))}})),this.required=this.numberSlot.slot.required||!1}};const ga=e=>{var t;const r=e.value,o=de({duration:0,handle:0}),[i,s]=pe("text"),[c,u]=pe(!1),[d,p]=pe("object"==typeof r?$(r.pristine):"number"==typeof r?r.toString():""),[h,v]="object"==typeof r?[c?d:r.hasValue?r.slot.formatString(r.slot.digits?P.padLeft(r.value,"0",r.slot.digits,!1,!0):((null===(t=e.l10n)||void 0===t?void 0:t.locale)||l.Locales).number(r.value,r.slot.precision,!!r.slot.separator),1!==r.value):"",e=>{R(o.current.handle),p(e);const t=a.range(2*o.current.duration,gr,fr);o.current.handle=j((()=>{const t=n.precise;o.current.handle=0,o.current.update=()=>{o.current.duration=n.elapsed(t,!0),o.current.update=void 0},r.pristine=""!==e?r.slot.toValue(e):void 0,r.pristine=e||void 0}),t)}]:[d,p],[g,f]=pe(!!h),b=de(0),m=c&&"object"==typeof r?X(d):0,y=e.error||c&&"object"==typeof r&&(w(r.slot.minimum)&&m<r.slot.minimum||w(r.slot.maximum)&&m>r.slot.maximum)||!1;return he((()=>()=>{R(o.current.handle)}),[]),o.current.update&&o.current.update(),le(br,{id:e.id,ref:e.onAutoFocus,type:i,tabIndex:e.tabIndex,placeholder:e.placeholder,required:e.required||!1,disabled:e.disabled||!1,readOnly:e.readOnly||"object"==typeof r&&(r.isFrozen||r.isLocked)||!1,maxLength:e.maxLength,value:h,autoComplete:"off",step:"number"===i?"object"==typeof r&&r.slot.precision&&`0.${P.fill("0",r.slot.precision-1)}1`||"1":void 0,inputMode:e.precision||"object"==typeof r&&r.slot.precision?"decimal":"numeric","aria-describedby":e.ariaDescribedBy,onChange:t=>{v(t.target.value),f(!0),e.onChange&&ur(v,e.onChange(t.target.value))},onFocus:t=>{if(b.current&&(cancelAnimationFrame(b.current),b.current=0),"text"===i){const e=t.target;requestAnimationFrame((()=>{e.focus()})),s("number")}dr(u,v,e.onFocus)(t)},onBlur:t=>{b.current=requestAnimationFrame((()=>{b.current=0,"number"===i&&s("text"),"object"==typeof r&&r.hasValue&&p($(r.pristine)),pr(u,v,e.onBlur)(t)}))},onKeyDown:t=>{"Enter"===t.key&&e.onSubmit?(t.preventDefault(),e.onSubmit()):"Escape"===t.key?t.currentTarget.blur():"Tab"===t.key&&(t.shiftKey?e.onCancel&&(t.preventDefault(),e.onCancel()):e.onSubmit&&(t.preventDefault(),e.onSubmit()))},$backgroundColor:e.styles.backgroundColor||"transparent",$borderColor:e.styles.borderColor||"transparent",$borderSize:e.styles.borderSize||1,$roundness:e.styles.roundness,$textColor:e.styles.textColor,$errorColor:e.styles.errorColor,$errorVisible:g,$error:y,$scale:e.styles.scale||1})};let fa=class extends va{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(ga,{id:e.id,styles:e.styles.inputs,l10n:e.l10n,value:this.numberSlot,required:this.required,error:e.isFailed,tabIndex:e.tabIndex,placeholder:e.placeholder,ariaDescribedBy:e.ariaDescribedBy,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};fa=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-number"})],fa);let ba=class extends V{},ma=class extends ba{constructor(){super(...arguments),this.autoFocus=!0}render(e){return ue(ce,{children:[this.props.imageURL&&this.props.imageAboveText&&le(No,{src:e.markdownifyToImage(this.props.imageURL),width:this.props.imageWidth,isPage:e.isPage}),e.name,this.props.caption&&le(Ko,{children:e.markdownifyToJSX(this.props.caption)}),e.description,this.props.imageURL&&!this.props.imageAboveText&&le(No,{src:e.markdownifyToImage(this.props.imageURL),width:this.props.imageWidth,isPage:e.isPage}),this.props.video&&le(_o,{src:e.markdownifyToURL(this.props.video),play:e.isActivated,view:e.view})]})}};function ya(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}ma=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-paragraph",alias:"paragraph"})],ma);let $a=class extends z{constructor(){super(...arguments),this.cache={}}isPassword(){const e=this.valueOf();return!!(this.props.passphrase&&e&&e.value)&&(u(this.cache[e.value])?this.cache[e.value]:this.cache[e.value]=ne.decrypt(this.props.passphrase,e.value+this.condition.id,256,atob)===this.condition.id)===!this.props.invert}};ya([S],$a.prototype,"isPassword",null),$a=ya([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-password"})],$a);let wa=class extends V{constructor(){super(...arguments),this.passwordSlot=F(this.valueOf("password")),this.required=this.passwordSlot.slot.required||!1}};const ka=e=>mr(Object.assign({type:"password",autoComplete:"new-password"},e));let xa=class extends wa{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(ka,{id:e.id,styles:e.styles.inputs,value:this.passwordSlot,required:this.required,error:e.isFailed,tabIndex:e.tabIndex,placeholder:e.placeholder,ariaDescribedBy:e.ariaDescribedBy,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};function Ca(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}xa=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-password"})],xa);let Sa=class extends z{verify(){const e=this.valueOf();if(e)switch(this.props.mode){case"defined":return""!==e.string;case"undefined":return""===e.string}return!1}};Ca([S],Sa.prototype,"verify",null),Sa=Ca([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-phone-number"})],Sa);const Oa=/^(?:(?:\(?(?:00|\+)([1-4]\d\d|[1-9]\d?)\)?)?[\-\.\ \\\/]?)?((?:\(?\d{1,}\)?[\-\.\ \\\/]?){0,})(?:[\-\.\ \\\/]?(?:#|ext\.?|extension|x)[\-\.\ \\\/]?(\d+))?$/i;let za=class extends V{constructor(){super(...arguments),this.phoneNumberSlot=F(this.valueOf("phone-number")),this.required=this.phoneNumberSlot.slot.required||!1}validate(){return!this.phoneNumberSlot.string||Oa.test(this.phoneNumberSlot.value)}};Ca([O],za.prototype,"validate",null);const Pa=e=>mr(Object.assign(Object.assign({type:"tel",inputMode:"tel",autoComplete:"tel"},e),{placeholder:e.placeholder||"+1 (201) 555-5555"}));let Ba=class extends za{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(Pa,{id:e.id,styles:e.styles.inputs,value:this.phoneNumberSlot,required:this.required,error:e.isFailed,tabIndex:e.tabIndex,placeholder:e.placeholder,ariaDescribedBy:e.ariaDescribedBy,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};function Va(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}Ba=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-phone-number"})],Ba);let Fa=class extends z{isChosen(){const e=this.valueOf(this.props.choice)||this.valueOf("choice");return!!e&&(u(e.value)?e.value:e.reference===this.props.choice)}};Va([S],Fa.prototype,"isChosen",null),Fa=Va([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-picture-choice",alias:"picture-choice"})],Fa);let Ra=class extends z{isUndefined(){const e=this.valueOf("choice");if(e)return!e.value;{const e=this.slots;return!e||!e.each((e=>{const t=this.valueOf(e);return t&&t.value||!1}))}}};Va([S],Ra.prototype,"isUndefined",null),Ra=Va([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-picture-choice:undefined"})],Ra);let ja=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Number){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode)}}return!1}};Va([S],ja.prototype,"verify",null),ja=Va([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-picture-choice:counter"})],ja);let Da=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Numeric){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};Va([S],Da.prototype,"verify",null),Da=Va([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-picture-choice:score"})],Da);class Ta extends V{constructor(){super(...arguments),this.counterSlot=this.valueOf("counter"),this.concatenationSlot=this.valueOf("concatenation","feature"),this.scoreSlot=this.valueOf("score","feature"),this.singleChoiceSlot=this.valueOf("choice","static",{modifier:e=>{if(e.value){if(!e.reference){const t=p(this.props.choices,(t=>t.value===e.value))||p(this.props.choices,(t=>t.id===e.value))||p(this.props.choices,(t=>t.name===e.value))||p(this.props.choices,(t=>t.name.toLowerCase()===e.value.toLowerCase()));return{value:t&&(t.value||t.name),reference:t&&t.id,display:null==t?void 0:t.name}}if(!p(this.props.choices,(t=>t.id===e.reference)))return{value:void 0,reference:void 0,display:void 0}}},onChange:e=>{if(this.scoreSlot){const t=p(this.props.choices,(t=>t.id===e.reference));this.scoreSlot.set(t&&((null==t?void 0:t.score)||0))}}})}get required(){return this.props.required||!1}transform(){if(this.props.multiple){const e=ee(te(this.props.choices,(e=>({id:e.id,exclusive:e.exclusive,valueRef:this.choiceSlot(e)}))),(e=>{var t;return!0===(null===(t=e.valueRef)||void 0===t?void 0:t.value)})).sort(((e,t)=>{var r,o;return((null===(r=t.valueRef)||void 0===r?void 0:r.time)||0)-((null===(o=e.valueRef)||void 0===o?void 0:o.time)||0)})),t=e.length&&e[0];if(t&&e.forEach((e=>{e.id!==t.id&&(t.exclusive||e.exclusive)&&(e.valueRef.value=!1)})),this.props.max){const t=this.props.max;let r=0;e.forEach((e=>{var o;!0===(null===(o=e.valueRef)||void 0===o?void 0:o.value)&&(r++,r>t&&(e.valueRef.value=!1))}))}if(this.counterSlot){const t=ee(e,(e=>{var t;return!0===(null===(t=e.valueRef)||void 0===t?void 0:t.value)})).length;this.counterSlot.set(t)}if(this.concatenationSlot){const e=[];let t="",r=0;if(v(this.props.choices,(o=>{var n;const i=o.value||o.name||"";if(i&&!0===(null===(n=this.valueOf(o.id))||void 0===n?void 0:n.value))switch(this.props.formatSeparator){case"space":t+=(""===t?"":" ")+i;break;case"list":t+=(""===t?"":"\n")+i;break;case"bullets":t+=(""===t?"":"\n")+"- "+i;break;case"numbers":t+=(""===t?"":"\n")+`${++r}. ${i}`;break;case"conjunction":case"disjunction":e.push(i);break;case"custom":t+=(""===t?"":this.props.formatSeparatorCustom||"")+i;break;default:t+=(""===t?"":", ")+i}})),"conjunction"===this.props.formatSeparator||"disjunction"===this.props.formatSeparator)try{const r=new Intl.ListFormat(this.context.l10n.current||"en",{type:this.props.formatSeparator});t=r.format(e)}catch(r){t=P.iterateToString(e,", ")}this.concatenationSlot.set(t)}}}score(e){this.scoreSlot&&w(e.score)&&this.scoreSlot.set(re(this.props.choices,((e,t)=>{var r;return e+(!0===(null===(r=this.valueOf(t.id))||void 0===r?void 0:r.value)&&t.score||0)}),0))}choiceSlot(e){return this.props.multiple&&this.valueOf(e.id,"dynamic",{confirm:!0,onChange:()=>{this.transform(),this.score(e)},onContext:(t,r)=>{var o;this.scoreSlot&&(null===(o=r.contextualValueOf(this.scoreSlot))||void 0===o||o.set(!0===t.value?e.score||0:void 0))}})||void 0}choices(e){var t;let r=0;const o=this,n=(null===(t=this.props.choices)||void 0===t?void 0:t.map((t=>{const n=this.choiceSlot(t);return this.props.multiple&&this.props.max&&!0===(null==n?void 0:n.value)&&r++,{id:t.id,name:L(t.name,this.context,void 0,!1,y.Formatting|y.Hyperlinks),nameVisible:t.nameVisible,label:e.markdownifyToJSX(t.name,!1),description:t.description&&e.markdownifyToJSX(t.description,!0)||void 0,image:t.image&&U(t.image,this.context,void 0,["image/jpeg","image/png","image/svg","image/gif"])||void 0,emoji:t.emoji,url:t.url&&U(t.url,this.context)||void 0,target:t.target,value:t.value,score:t.score,exclusive:t.exclusive,color:t.color,slot:n,tabIndex:e.tabIndex,get disabled(){return o.props.max&&r>=o.props.max&&!0!==(null==n?void 0:n.value)||!1}}})))||[];if(this.props.randomize&&n.length>1){if(!this.randomized||this.randomized.length!==n.length||p(this.randomized,(e=>{var t;return(null===(t=n[e.index])||void 0===t?void 0:t.id)!==e.id}))){this.randomized=n.map(((e,t)=>({index:t,id:e.id})));let e=this.randomized.length;for(;--e;){const t=Math.floor(Math.random()*e),r=this.randomized[e];this.randomized[e]=this.randomized[t],this.randomized[t]=r}}return this.randomized.map((e=>n[e.index]))}return this.randomized&&(this.randomized=void 0),n}validate(){var e;if(this.props.multiple&&(this.props.min||this.props.max)){const e=ee(this.props.choices,(e=>{var t;return!0===(null===(t=this.choiceSlot(e))||void 0===t?void 0:t.value)})).length;if(this.props.min&&e<this.props.min||this.props.max&&e>this.props.max)return!1}return!this.props.required||(this.props.multiple?!!p(this.props.choices,(e=>{var t;return!0===(null===(t=this.choiceSlot(e))||void 0===t?void 0:t.value)})):(null===(e=this.singleChoiceSlot)||void 0===e?void 0:e.hasValue)||!1)}}Va([O],Ta.prototype,"validate",null);const Aa=fe.div`
display: flex;
width: 100%;
flex-direction: row;
flex-wrap: wrap;
align-items: stretch;
> * {
margin-top: 8px;
margin-right: 8px;
display: flex;
flex-direction: column;
align-items: center;
}
`,qa=(e,t,r)=>{const o=p(t,(e=>e.id===r));return e.reference!==(null==o?void 0:o.id)&&e.set(o&&(o.value||o.name),null==o?void 0:o.id,null==o?void 0:o.name),o&&o.id||""},Ma=e=>{const t=e.value,r=de(0),n=de({}),[i,a]=pe("object"!=typeof t&&t||""),[s,l]="object"==typeof t?[0!==r.current?i:qa(t,e.options,t.reference),o=>{R(r.current),a(o),r.current=j((()=>{r.current=0,qa(t,e.options,o),e.autoSubmit&&o&&hr(u)}),vr)}]:[i,a],[,c]=pe({}),u=de({id:0,cb:e.onSubmit}),d=o=>{if(o.url)return;const i=o.slot?x(n.current[o.id],o.slot.value):s===o.id;if(o.slot)R(r.current),n.current[o.id]=!i,c({}),r.current=j((()=>{r.current=0,v(n.current,((t,r)=>{const o=p(e.options,(e=>e.id===r));delete n.current[r],o&&o.slot&&(o.slot.value=t)}),{keys:!0})}),vr);else{const r=i&&!e.required?"":o.id;u.current.id&&(clearTimeout(u.current.id),u.current.id=0),l(r),e.onChange&&e.onChange(r),"object"!=typeof t&&e.autoSubmit&&r&&hr(u)}o.onChange&&o.onChange(!(o.slot||!e.required)||!i)};return he((()=>()=>{R(r.current)}),[]),u.current.cb=e.onSubmit,le(Aa,{children:e.options.map(((r,i)=>{const a=r.slot?x(n.current[r.id],r.slot.value):s===r.id;return r.slot&&r.slot.confirm(),("preview"===e.view||r.image||r.emoji||r.nameVisible&&r.name||r.description)&&le(Kt,{styles:{baseColor:r.color||e.styles.color,mode:a?"fill":"outline",hover:"outline",outlineSize:e.styles.outlineSize,roundness:e.styles.roundness,scale:e.styles.scale},hyperlink:r.url&&{url:r.url,target:r.target||"blank"}||void 0,image:r.image||!r.emoji&&`data:image/svg+xml;base64,${l=Nt(e.styles.color,(e=>e.makeBlackOrWhite(a).manipulate((e=>e.alpha(.2))))),btoa(`<?xml version="1.0" encoding="utf-8"?>\n <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20">\n <path d="M13.5 9c-1.378 0-2.5-1.122-2.5-2.5s1.122-2.5 2.5-2.5 2.5 1.122 2.5 2.5-1.122 2.5-2.5 2.5zM13.5 5c-0.827 0-1.5 0.673-1.5 1.5s0.673 1.5 1.5 1.5 1.5-0.673 1.5-1.5-0.673-1.5-1.5-1.5z" fill="${l}"></path>\n <path d="M18.5 0h-17c-0.827 0-1.5 0.673-1.5 1.5v17c0 0.827 0.673 1.5 1.5 1.5h17c0.827 0 1.5-0.673 1.5-1.5v-17c0-0.827-0.673-1.5-1.5-1.5zM1 18.5v-4.807l4.197-4.617c0.085-0.093 0.196-0.145 0.314-0.147s0.231 0.048 0.318 0.139l9.5 9.932h-13.83c-0.276 0-0.5-0.224-0.5-0.5zM19 18.5c0 0.276-0.224 0.5-0.5 0.5h-1.786l-10.161-10.623c-0.281-0.294-0.655-0.452-1.053-0.447s-0.768 0.173-1.042 0.474l-3.457 3.803v-10.707c0-0.276 0.224-0.5 0.5-0.5h17c0.276 0 0.5 0.224 0.5 0.5v17z" fill="${l}"></path>\n </svg>`)}`||void 0,emoji:r.emoji,label:r.nameVisible&&(r.label||r.name)||void 0,description:r.description,size:e.size,tabIndex:r.tabIndex||e.tabIndex,ariaDescribedBy:e.ariaDescribedBy,disabled:r.disabled||e.disabled||e.readOnly||"object"==typeof t&&(t.isFrozen||t.isLocked)||r.slot&&(r.slot.isFrozen||r.slot.isLocked)||!1,onAutoFocus:(r.slot||!s?0===i:a)&&e.onAutoFocus||void 0,onFocus:e.onFocus,onBlur:e.onBlur,onKeyDown:t=>{if(t.shiftKey&&"Enter"===t.key&&e.onSubmit)t.preventDefault(),e.onSubmit();else if("Escape"===t.key)t.currentTarget.blur();else if("Tab"===t.key)t.shiftKey?e.onCancel&&0===i&&(t.preventDefault(),e.onCancel()):e.onSubmit&&i+1===e.options.length&&(t.preventDefault(),e.onSubmit());else{const r=1===t.key.length&&t.key.charCodeAt(0)||0,n=(r<=57?r-48:0)||(r<=90?r-64:0)||(r<=122?r-96:0);if(n>0&&n<=26){const t=o(e.options,n-1);t&&d(t)}}},onClick:()=>d(r)},r.id||i);var l}))})};let Ia=class extends Ta{constructor(){super(...arguments),this.hideButtons=!(this.props.multiple||!p(this.props.choices,(e=>!!e.name&&!e.url))),this.autoSubmit=this.hideButtons}render(e,t,r){return ue(ce,{children:[this.props.imageURL&&this.props.imageAboveText&&le(No,{src:e.markdownifyToImage(this.props.imageURL),width:this.props.imageWidth,isPage:e.isPage}),e.name,this.props.caption&&le(Ko,{children:e.markdownifyToJSX(this.props.caption)}),e.description,this.props.imageURL&&!this.props.imageAboveText&&le(No,{src:e.markdownifyToImage(this.props.imageURL),width:this.props.imageWidth,isPage:e.isPage}),le(Ma,{styles:e.styles.pictureChoice,view:e.view,options:this.choices(e),size:this.props.size,value:!this.props.multiple&&this.valueOf("choice")||void 0,required:this.required,ariaDescribedBy:e.ariaDescribedBy,autoSubmit:this.autoSubmit,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};function Ea(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}Ia=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-picture-choice",autoRender:!0})],Ia);let La=class extends z{isSelected(){const e=this.valueOf();return e&&e.reference===this.props.button||!1}};Ea([S],La.prototype,"isSelected",null),La=Ea([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-radiobuttons"})],La);let Ua=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Numeric){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};Ea([S],Ua.prototype,"verify",null),Ua=Ea([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-radiobuttons:score"})],Ua);let Na=class extends V{constructor(){super(...arguments),this.scoreSlot=this.valueOf("score","feature"),this.radioSlot=F(this.valueOf("button","static",{modifier:e=>{if(e.value){if(!e.reference){const t=p(this.props.buttons,(t=>t.value===e.value))||p(this.props.buttons,(t=>t.id===e.value))||p(this.props.buttons,(t=>t.name===e.value))||p(this.props.buttons,(t=>t.name.toLowerCase()===e.value.toLowerCase()));return{value:t&&(t.value||t.name),reference:t&&t.id,display:null==t?void 0:t.name}}if(!p(this.props.buttons,(t=>t.id===e.reference)))return{value:void 0,reference:void 0,display:void 0}}},onChange:e=>{if(this.scoreSlot){const t=p(this.props.buttons,(t=>t.id===e.reference));this.scoreSlot.set(t&&((null==t?void 0:t.score)||0))}}})),this.required=this.radioSlot.slot.required||!1}get value(){const e=p(this.props.buttons,(e=>e.id===this.radioSlot.reference));return!e&&this.required&&this.props.buttons&&this.props.buttons.length>0?this.select(this.props.buttons[0]):e&&e.id||""}set value(e){const t=p(this.props.buttons,(t=>t.id===e));t&&this.select(t)}buttons(e){var t;const r=(null===(t=this.props.buttons)||void 0===t?void 0:t.map((t=>Object.assign(Object.assign({},t),{name:L(t.name,this.context,void 0,!1,y.Formatting|y.Hyperlinks),label:e.markdownifyToJSX(t.name,!1),description:t.description&&e.markdownifyToJSX(t.description,!0)||void 0}))))||[];if(this.props.randomize&&r.length>1){if(!this.randomized||this.randomized.length!==r.length||p(this.randomized,(e=>{var t;return(null===(t=r[e.index])||void 0===t?void 0:t.id)!==e.id}))){this.randomized=r.map(((e,t)=>({index:t,id:e.id})));let e=this.randomized.length;for(;--e;){const t=Math.floor(Math.random()*e),r=this.randomized[e];this.randomized[e]=this.randomized[t],this.randomized[t]=r}}return this.randomized.map((e=>r[e.index]))}return this.randomized&&(this.randomized=void 0),r}isSelected(e){return this.value===e.id}select(e){return this.radioSlot.set(e.value||e.name,e.id,e.name),e.id}},Wa=class extends Na{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(Ai,{styles:e.styles.radiobuttons,view:e.view,buttons:this.buttons(e),value:this.radioSlot,tabIndex:e.tabIndex,ariaDescribedBy:e.ariaDescribedBy,allowUnselect:!1,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};function _a(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}Wa=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-radiobuttons"})],Wa);let Ha=class extends z{isSelected(){const e=this.valueOf();return e&&e.reference===this.props.option||!1}};_a([S],Ha.prototype,"isSelected",null),Ha=_a([C({type:"condition",identifier:"@tripetto/block-ranking"})],Ha);let Ka=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Numeric){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};_a([S],Ka.prototype,"verify",null),Ka=_a([C({type:"condition",identifier:"@tripetto/block-ranking:score"})],Ka);let Ya=class extends V{constructor(){super(...arguments),this.concatenationSlot=this.valueOf("concatenation","feature"),this.scoreSlot=this.valueOf("score","feature")}get required(){return this.props.required||!1}get slots(){const e=[],t=e=>this.valueOf(`position:${e}`,"dynamic",{confirm:!0,onChange:t=>{this.transform(),this.score(e,t.reference)}});let r=1,o=t(r);for(;o;)e.push(o),r++,o=t(r);return e}transform(){if(this.concatenationSlot){const e=[];let t="",r=0;if(v(this.slots,(o=>{const n=o.value||"";if(n)switch(this.props.formatSeparator){case"space":t+=(""===t?"":" ")+n;break;case"list":t+=(""===t?"":"\n")+n;break;case"bullets":t+=(""===t?"":"\n")+"- "+n;break;case"numbers":t+=(""===t?"":"\n")+`${++r}. ${n}`;break;case"conjunction":case"disjunction":e.push(n);break;case"custom":t+=(""===t?"":this.props.formatSeparatorCustom||"")+n;break;default:t+=(""===t?"":", ")+n}})),"conjunction"===this.props.formatSeparator||"disjunction"===this.props.formatSeparator)try{const r=new Intl.ListFormat(this.context.l10n.current||"en",{type:this.props.formatSeparator});t=r.format(e)}catch(r){t=P.iterateToString(e,", ")}this.concatenationSlot.set(t)}}score(e,t){var r;const o=this.valueOf(`score:${e}`,"feature",{onChange:()=>{let e;if(this.scoreSlot){let t=1,r=this.valueOf(`score:${t}`,"feature");for(;r;)r.hasValue&&(e=(e||0)+r.value),t++,r=this.valueOf(`score:${t}`,"feature");this.scoreSlot.set(e)}}});o&&o.set(t?(null===(r=p(this.props.options,(e=>e.id===t)))||void 0===r?void 0:r.score)||0:void 0)}options(e){var t;const r=(null===(t=this.props.options)||void 0===t?void 0:t.map((t=>({id:t.id,name:L(t.name,this.context,void 0,!1,y.Formatting|y.Hyperlinks),label:e.markdownifyToJSX(t.name,!1),description:t.description&&e.markdownifyToJSX(t.description,!0)||void 0,value:t.value,score:t.score}))))||[];if(this.props.randomize&&r.length>1){if(!this.randomized||this.randomized.length!==r.length||p(this.randomized,(e=>{var t;return(null===(t=r[e.index])||void 0===t?void 0:t.id)!==e.id}))){this.randomized=r.map(((e,t)=>({index:t,id:e.id})));let e=this.randomized.length;for(;--e;){const t=Math.floor(Math.random()*e),r=this.randomized[e];this.randomized[e]=this.randomized[t],this.randomized[t]=r}}return this.randomized.map((e=>r[e.index]))}return this.randomized&&(this.randomized=void 0),r}};const Xa=ue("svg",{viewBox:"0 0 20 20",children:[le("path",{d:"M18.5 5h-10c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h10c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z"}),le("path",{d:"M18.5 9h-10c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h10c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z"}),le("path",{d:"M18.5 13h-10c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h10c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z"}),le("path",{d:"M18.5 17h-10c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h10c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z"}),le("path",{d:"M5.146 13.646l-1.146 1.146v-8.586l1.146 1.146c0.098 0.098 0.226 0.146 0.354 0.146s0.256-0.049 0.354-0.146c0.195-0.195 0.195-0.512 0-0.707l-2-2c-0.195-0.195-0.512-0.195-0.707 0l-2 2c-0.195 0.195-0.195 0.512 0 0.707s0.512 0.195 0.707 0l1.146-1.146v8.586l-1.146-1.146c-0.195-0.195-0.512-0.195-0.707 0s-0.195 0.512 0 0.707l2 2c0.098 0.098 0.226 0.146 0.354 0.146s0.256-0.049 0.354-0.146l2-2c0.195-0.195 0.195-0.512 0-0.707s-0.512-0.195-0.707 0z"})]}),Ja=fe.div`
display: table;
width: auto;
> * {
display: block;
width: 100%;
margin-top: 8px !important;
> span {
overflow: hidden;
}
}
`,Za=fe.button`
appearance: none;
position: relative;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: flex-start;
justify-content: space-between;
font-size: 1em;
line-height: 1.5em;
outline: none;
user-select: none;
box-sizing: border-box;
background-color: ${e=>"fill"===e.$mode&&Nt(e.$baseColor)||"transparent"};
border: ${e=>`${e.$outlineSize}px solid ${Nt(e.$baseColor,(t=>t.manipulate((e=>e.darken(.1)),"fill"===e.$mode)))}`};
color: ${e=>Nt(e.$baseColor,(t=>t.makeBlackOrWhite("fill"===e.$mode)))};
text-align: left;
border-radius: ${e=>w(e.$roundness)?`${e.$roundness}px`:"0.5em"};
padding: ${e=>`${.375*e.$scale}em 2.75em ${.375*e.$scale}em ${.375*e.$scale}em`};
margin: 0;
opacity: ${e=>"outline"===e.$mode?.2:.4};
transition:
color 0.15s ease-in-out,
background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out,
box-shadow 0.15s ease-in-out,
opacity 0.15s ease-in-out,
transform 0.15s ease-out;
> select {
display: block;
flex-shrink: 0;
font-size: 0.8em;
background-color: ${e=>"fill"===e.$mode?Nt(e.$baseColor,(e=>e.makeBlackOrWhite(!0))):e.$baseColor};
color: ${e=>"fill"===e.$mode?e.$baseColor:Nt(e.$baseColor,(e=>e.makeBlackOrWhite(!0)))};
border: ${e=>`0.3em solid ${"fill"===e.$mode?Nt(e.$baseColor,(e=>e.makeBlackOrWhite(!0))):e.$baseColor}`};
border-radius: ${e=>0!==e.$roundness?`${e.$roundness||5}px`:"0px"};
margin-right: 0.75em;
}
> span {
display: table-cell;
flex-grow: 1;
> small {
display: block;
font-size: 0.8em;
opacity: 0.8;
}
}
> div {
position: absolute;
top: 0;
right: 0;
width: 3em;
bottom: 0;
display: flex;
align-items: center;
justify-content: flex-end;
touch-action: none;
padding-right: 0.75em;
> svg {
width: 1.3em;
height: 1.3em;
pointer-events: none;
path {
fill: ${e=>Nt(e.$baseColor,(t=>t.makeBlackOrWhite("fill"===e.$mode)))};
transition: fill 0.15s ease-in-out;
}
}
}
&:not(:disabled) {
cursor: grab;
opacity: 1;
&:hover {
background-color: ${e=>"fill"===e.$hover&&Nt(e.$baseColor,(t=>t.manipulate((e=>e.darken(.05)),"fill"===e.$mode)))||void 0};
border-color: ${e=>"fill"===e.$hover&&Nt(e.$baseColor,(t=>t.manipulate((e=>e.darken(.1)),"fill"===e.$mode)))||void 0};
color: ${e=>"outline"===e.$mode&&"fill"===e.$hover&&Nt(e.$baseColor,(e=>e.makeBlackOrWhite()))||void 0};
box-shadow: 0 0 0 0.2rem ${e=>Nt(e.$baseColor,(e=>e.manipulate((e=>e.alpha(.2)))))};
svg {
path {
fill: ${e=>"outline"===e.$mode&&"fill"===e.$hover&&Nt(e.$baseColor,(e=>e.makeBlackOrWhite()))||void 0};
}
}
}
&:focus {
box-shadow: 0 0 0 0.2rem ${e=>Nt(e.$baseColor,(e=>e.manipulate((e=>e.alpha(.5)))))};
}
&:active {
box-shadow: 0 0 0 0.2rem ${e=>Nt(e.$baseColor,(e=>e.manipulate((e=>e.alpha(.5)))))};
background-color: ${e=>"fill"===e.$hover&&Nt(e.$baseColor,(e=>e.manipulate((e=>e.darken(.15)))))};
}
}
`,Ga=e=>{const t=de([]),r=de({}),[n,i]=pe({}),s=e=>r=>{const o=t.current[e];o.ref&&"number"!=typeof o.moveId&&r.isPrimary&&"SELECT"!==r.target.tagName&&"A"!==r.target.tagName&&("mouse"===r.pointerType||"DIV"===r.target.tagName)&&(o.moveHeight=o.ref.nextElementSibling?o.ref.nextElementSibling.getBoundingClientRect().top-o.ref.getBoundingClientRect().top:o.ref.previousElementSibling?o.ref.getBoundingClientRect().bottom-o.ref.previousElementSibling.getBoundingClientRect().bottom:0,o.moveHeight>0&&(r.preventDefault(),r.stopPropagation(),o.moveId=r.pointerId,o.moveX=r.clientX,o.moveY=o.moveDirection=r.clientY,o.ref.setPointerCapture(o.moveId),o.ref.focus(),i({})))},l=e=>r=>{const o=t.current[e];if(r.isPrimary&&"number"==typeof o.moveId&&o.ref){const n=o.ref.getBoundingClientRect(),a=r.clientY-(o.moveDirection||0);r.preventDefault(),r.stopPropagation(),o.moveDirection=r.clientY,o.ref.style.transform=o.moveTransform=`translate3d(${r.clientX-(o.moveX||0)}px,${r.clientY-(o.moveY||0)}px,0)`;for(let r=0;r<t.current.length;r++)if(r!==e){const i=t.current[r];if(i.ref){const t=i.ref.getBoundingClientRect();a>0&&n.bottom>t.top+t.height/2?i.moveTransform=r>e?`translateY(-${o.moveHeight||0}px)`:"":a<0&&n.top<t.top+t.height/2&&(i.moveTransform=r<e?`translateY(${o.moveHeight||0}px)`:"")}}i({})}},c=e=>r=>{var o,n;const a=t.current[e];if(r.isPrimary&&"number"==typeof a.moveId){const s=null===(o=a.ref)||void 0===o?void 0:o.getBoundingClientRect();let l=-1;r.preventDefault(),r.stopPropagation(),null===(n=a.ref)||void 0===n||n.releasePointerCapture(a.moveId),a.moveId=void 0;for(let r=0;r<t.current.length;r++){const o=t.current[r];if(o.moveTransform=void 0,(-1===l||r>e)&&r!==e&&o.ref&&s){const t=o.ref.getBoundingClientRect();(r<e&&s.top<t.top+t.height/2||r>e&&s.bottom>t.top+t.height/2)&&(l=r)}}-1!==l?d(e,l):i({disable:!0})}},u=r=>o=>{"SELECT"!==o.target.tagName&&("Escape"===o.key?o.currentTarget.blur():"Tab"===o.key?(o.currentTarget.blur(),o.shiftKey?e.onCancel&&0===r&&(o.preventDefault(),e.onCancel()):e.onSubmit&&!o.shiftKey&&r===t.current.length-1&&(o.preventDefault(),e.onSubmit())):"ArrowDown"===o.key||"ArrowUp"===o.key?(o.preventDefault(),o.stopPropagation(),("ArrowDown"===o.key&&r<t.current.length-1||"ArrowUp"===o.key&&r>0)&&d(r,"ArrowDown"===o.key?r+1:r-1)):o.keyCode>=49&&o.keyCode<=57&&d(r,o.keyCode-49))},d=(r,n)=>{if(-1===n&&e.slots&&(n=a.min(e.slots.length,t.current.length)),r>=0&&r<t.current.length&&n>=0&&r!==n&&(t.current.splice(n,0,t.current.splice(r,1)[0]),e.slots)){let r=0;for(;r<e.slots.length&&e.slots[r].reference;)r++;n<e.slots.length&&n-1===r&&r++;for(let n=0;n<r;n++){const r=o(t.current,n);e.slots[n].set((null==r?void 0:r.value)||(null==r?void 0:r.name),null==r?void 0:r.id,null==r?void 0:r.name)}}i({disable:!0})};if(t.current.length!==e.options.length||p(e.slots,(e=>r.current[e.key]!==e.reference))){const o=[],n=ee(t.current.splice(0,t.current.length),(t=>!!p(e.options,(e=>e.id===t.id))));v(e.slots,(i=>{if(i.reference&&!p(o,(e=>e===i.reference))){const a=p(e.options,(e=>e.id===i.reference));if(a){r.current[i.key]=i.reference,o.push(i.reference),t.current.push(a);for(let e=0;e<n.length;e++)if(n[e].id===a.id){n.splice(e,1);break}}else r.current[i.key]=void 0,i.set(void 0,void 0,void 0)}else r.current[i.key]=void 0,i.reference&&i.set(void 0,void 0,void 0)})),t.current.push(...n),v(e.options,(e=>{p(t.current,(t=>t.id===e.id))||t.current.push(e)}))}if(e.slots&&p(e.slots,(e=>!e.reference)))for(let r=0;r<e.slots.length;r++){const n=o(t.current,r);e.slots[r].set((null==n?void 0:n.value)||(null==n?void 0:n.name),null==n?void 0:n.id,null==n?void 0:n.name)}const h=e.slots&&e.slots.length<t.current.length||!1;return le(Ja,{$margin:e.styles.margin,children:t.current.map(((r,i)=>{var a;const p=o(e.slots,i),v=(null==p?void 0:p.reference)===r.id,g=(null==p?void 0:p.isFrozen)||(null==p?void 0:p.isLocked)||e.disabled;return ue(Za,{ref:t=>{t&&(r.ref=t),!i&&e.onAutoFocus&&e.onAutoFocus(t)},type:"button",style:r.moveTransform&&{zIndex:"number"==typeof r.moveId?214748364:void 0,transition:"number"==typeof r.moveId?"none":void 0,transform:r.moveTransform,cursor:"grabbing"}||n.disable&&{transition:"none"}||void 0,disabled:g,tabIndex:e.tabIndex,"aria-describedby":e.ariaDescribedBy,onFocus:e.onFocus,onBlur:e.onBlur,onPointerDown:s(i),onPointerMove:l(i),onPointerUp:c(i),onPointerCancel:c(i),onKeyDown:u(i),$baseColor:e.styles.color,$mode:v&&((null===(a=e.slots)||void 0===a?void 0:a.length)||0)<t.current.length?"fill":"outline",$hover:"outline",$outlineSize:e.styles.outlineSize||1,$roundness:e.styles.roundness,$scale:e.styles.scale||1,children:[ue("select",{tabIndex:-1,value:!h||v?i:-1,onChange:e=>d(i,k(e.currentTarget.value,-1)),title:r.name,children:[(e.slots||t.current).map(((e,t)=>le("option",{value:t,children:t+1},t))),h&&le("option",{value:-1,children:"-"})||void 0]}),ue("span",{children:[r.label||r.name||"...",r.description&&le("small",{children:r.description})]}),le("div",{children:Xa})]},r.id)}))})};let Qa=class extends Ya{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(Ga,{styles:e.styles.multipleChoice,slots:this.slots,options:this.options(e),tabIndex:e.tabIndex,ariaDescribedBy:e.ariaDescribedBy,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};function es(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}Qa=Ue([C({namespace:Le,type:"node",identifier:"@tripetto/block-ranking"})],Qa);let ts=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Number){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}compare(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};es([S],ts.prototype,"compare",null),ts=es([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-rating:compare"})],ts);let rs=class extends z{stars(){const e=this.valueOf("rating");return e&&e.value===this.props.stars||!1}};es([S],rs.prototype,"stars",null),rs=es([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-rating",alias:"rating"})],rs);let os=class extends V{constructor(){super(...arguments),this.ratingSlot=F(this.valueOf("rating")),this.required=this.ratingSlot.slot.required||!1,this.steps=this.props.steps||5,this.shape=this.props.shape||"stars"}};const ns=le("svg",{viewBox:"0 0 20 20",children:le("path",{d:"m15.094 17.79-5.0784-2.6559-5.0669 2.6778 0.95658-5.6506-4.1125-3.9914 5.6696-0.83638 2.5252-5.1447 2.5475 5.1337 5.6732 0.81184-4.0952 4.0092z",strokeLinejoin:"round"})}),is=le("svg",{viewBox:"0 0 20 20",children:le("path",{d:"m5.75 2.539c-2.343 0-4.25 1.907-4.25 4.25 0 3.04 2.35 5.802 4.321 7.585 1.76 1.592 3.544 2.708 4.179 3.087 0.635-0.379 2.419-1.495 4.179-3.087 1.971-1.782 4.321-4.545 4.321-7.585 0-2.343-1.907-4.25-4.25-4.25-1.703 0-3.357 1.401-3.776 2.658-0.068 0.204-0.259 0.64132-0.474 0.64132s-0.406-0.43732-0.474-0.64132c-0.419-1.257-2.073-2.658-3.776-2.658z",strokeLinejoin:"round"})}),as=le("svg",{viewBox:"0 0 20 20",children:le("path",{d:"m4.6945 17.966h-3c-0.276 0-0.5-0.224-0.5-0.5v-9c0-0.276 0.224-0.5 0.5-0.5h3c0.276 0 0.5 0.224 0.5 0.5v9c0 0.276-0.224 0.5-0.5 0.5zm13.839-7.726c-0.151 0.304-0.304 0.414-0.37 0.414-0.276 0-0.5 0.224-0.5 0.5s0.224 0.5 0.5 0.5c0.042 0 0.072 0 0.117 0.078 0.066 0.117 0.104 0.32 0.104 0.558 0 0.445-0.126 0.974-0.328 1.382-0.198 0.399-0.399 0.544-0.487 0.544-0.276 0-0.5 0.224-0.5 0.5 0 0.177 0.092 0.333 0.231 0.422 0.031 0.317-0.117 1.165-0.501 1.718-0.145 0.209-0.298 0.329-0.418 0.329-0.276 0-0.5 0.224-0.5 0.5 0 0.88-0.972 1.281-1.875 1.281-2.513 0-3.217-0.376-4.032-0.812-0.762-0.407-1.2175-0.865-3.3805-1.134v-8.187c2.101-0.689 3.7515-1.877 5.4115-3.373 1.593-1.436 2.639-2.988 2.994-4.426 0.272 0.087 0.579 0.271 0.776 0.618 0.334 0.59 0.584 2.096-1.493 5.557-0.093 0.154-0.095 0.347-6e-3 0.504s0.255 0.254 0.435 0.254h3.483c0.199 0 0.327 0.07 0.43 0.234 0.117 0.187 0.181 0.477 0.181 0.815 0 0.424-0.102 0.882-0.272 1.225z",strokeLinejoin:"round"})}),ss=le("svg",{viewBox:"0 0 20 20",children:le("path",{d:"m4.5945 2.034h-3c-0.276 0-0.5 0.224-0.5 0.5v9c0 0.276 0.224 0.5 0.5 0.5h3c0.276 0 0.50307-0.22402 0.5-0.5v-9c0-0.276-0.224-0.5-0.5-0.5zm14.039 7.726c-0.151-0.304-0.304-0.414-0.37-0.414-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5c0.042 0 0.072 0 0.117-0.078 0.066-0.117 0.104-0.32 0.104-0.558 0-0.445-0.126-0.974-0.328-1.382-0.198-0.399-0.399-0.544-0.487-0.544-0.276 0-0.5-0.224-0.5-0.5 0-0.177 0.092-0.333 0.231-0.422 0.031-0.317-0.117-1.165-0.501-1.718-0.145-0.209-0.298-0.329-0.418-0.329-0.276 0-0.5-0.224-0.5-0.5 0-0.88-0.972-1.281-1.875-1.281-2.513 0-3.217 0.376-4.032 0.812-0.762 0.407-1.618 0.865-3.781 1.134v8.187c2.101 0.689 4.152 1.877 5.812 3.373 1.593 1.436 2.639 2.988 2.994 4.426 0.272-0.087 0.579-0.271 0.776-0.618 0.334-0.59 0.584-2.096-1.493-5.557-0.093-0.154-0.095-0.347-6e-3 -0.504s0.255-0.254 0.435-0.254h3.483c0.199 0 0.327-0.07 0.43-0.234 0.117-0.187 0.181-0.477 0.181-0.815 0-0.424-0.102-0.882-0.272-1.225z",strokeLinejoin:"round"})}),ls=ue("svg",{viewBox:"0 0 20 20",children:[le("path",{d:"m9.5 1.3c-2.481 0-4.5 2.019-4.5 4.5s2.019 4.5 4.5 4.5 4.5-2.019 4.5-4.5-2.019-4.5-4.5-4.5z"}),le("path",{d:"m9.5 11.9c-3.487 0-6.06 0.953-7.441 2.756-1.035 1.351-1.058 2.732-1.059 2.746 0 0.274 0.224 0.498 0.5 0.498h16c0.276 0 0.5-0.224 0.5-0.5 0-0.012-0.023-1.393-1.059-2.744-1.382-1.803-3.955-2.756-7.441-2.756z"})]}),cs=fe.div`
display: block;
width: 100%;
`,us=fe.button`
appearance: none;
box-sizing: border-box;
background: none;
border: none;
outline: none;
width: ${e=>2*e.$scale+"em"};
height: ${e=>2*e.$scale+"em"};
margin: 0;
padding: 0;
margin-bottom: ${e=>e.$showLabels&&"1em"};
display: inline-block;
opacity: 0.2;
cursor: default;
transition:
width 0.15s ease-in-out,
height 0.15s ease-in-out,
opacity 0.15 ease-in-out;
> svg {
path {
fill: ${e=>e.$checked&&Nt(e.$color)||e.$hover&&Nt(e.$color,(e=>e.manipulate((e=>e.alpha(.3)))))||"none"};
stroke: ${e=>Nt(e.$color)};
stroke-width: 1px;
transition:
fill 0.15s ease-in-out,
stroke 0.15s ease-in-out;
}
}
> small {
display: block;
font-size: 0.8em;
line-height: 1em;
text-align: center;
margin: 0;
padding: 0;
color: ${e=>Nt(e.$color)};
}
animation: ${e=>e.$checked?me`
${$e`
50% {
transform: scale(1.1);
}
100% {
transform: none;
}
`} .5s linear
`:void 0};
&:not(:disabled) {
opacity: 1;
cursor: pointer;
&:focus {
> svg {
path {
stroke-width: ${e=>e.$checked?"2px":void 0};
fill: ${e=>!e.$checked&&Nt(e.$color,(e=>e.manipulate((e=>e.alpha(.3)))))||void 0};
stroke: ${e=>e.$checked&&Nt(e.$color,(e=>e.manipulate((e=>e.alpha(.3)))))||void 0};
}
}
}
}
`,ds=e=>{switch(e){case"stars":return ns;case"hearts":return is;case"thumbs-up":return as;case"thumbs-down":return ss;case"persons":return ls}},ps=(e,t)=>t?e.value=t:(e.clear(),0),hs=e=>{const t=e.value,r=de(0),[o,n]=pe("object"!=typeof t&&t||0),[i,s]="object"==typeof t?[0!==r.current?o:ps(t,t.value),(o,i)=>{R(r.current),n(o),r.current=j((()=>{r.current=0,ps(t,o),i&&e.autoSubmit&&o&&hr(d)}),vr)}]:[o,n],[l,c]=pe(0),u=[],d=de({id:0,cb:e.onSubmit}),p=a.max(1,e.steps),h=e.disabled||e.readOnly||"object"==typeof t&&(t.isFrozen||t.isLocked)||!1,v=(t,r)=>{e.disabled||e.readOnly||(t=a.range(t,0,p),d.current.id&&(clearTimeout(d.current.id),d.current.id=0),s(t,r),e.onChange&&e.onChange(t),r&&e.autoSubmit&&t&&hr(d))};he((()=>()=>{R(r.current)}),[]);for(let t=1;t<=p;t++)u.push(ue(us,{ref:t===(i||1)&&e.onAutoFocus||void 0,disabled:h,tabIndex:e.tabIndex,"aria-describedby":e.ariaDescribedBy,onMouseOver:()=>c(t),onMouseOut:()=>c(0),onClick:()=>v(1!==i||e.required?t:0,!0),onFocus:e.onFocus,onBlur:e.onBlur,onKeyDown:r=>{if(r.shiftKey&&"Enter"===r.key&&e.onSubmit)r.preventDefault(),e.onSubmit();else if("Enter"===r.key||" "===r.key)r.preventDefault(),v(1!==i||e.required?t:0,!0);else if("Escape"===r.key)r.currentTarget.blur();else if("Tab"===r.key)r.shiftKey?e.onCancel&&1===t&&(r.preventDefault(),e.onCancel()):e.onSubmit&&t===p&&(r.preventDefault(),e.onSubmit());else if("-"===r.key)i>0&&v(i-1,!1);else if("+"===r.key)i<p&&v(i+1,!1);else{const e=1===r.key.length?r.key.charCodeAt(0)-48:-1;e>=0&&e<=9&&v(i===e?e-1:e,!0)}},$color:e.styles.color,$scale:e.styles.scale||1,$hover:!h&&l>=t,$checked:t<=i,$showLabels:e.showLabels||!1,children:[ds(e.shape||"stars"),e.showLabels&&le("small",{children:t})]},t));return d.current.cb=e.onSubmit,le(cs,{children:u})};let vs=class extends os{constructor(){super(...arguments),this.autoSubmit=!0}render(e,t,r){return ue(ce,{children:[this.props.imageURL&&this.props.imageAboveText&&le(No,{src:e.markdownifyToImage(this.props.imageURL),width:this.props.imageWidth,isPage:e.isPage}),e.name,e.description,this.props.imageURL&&!this.props.imageAboveText&&le(No,{src:e.markdownifyToImage(this.props.imageURL),width:this.props.imageWidth,isPage:e.isPage}),le(hs,{styles:e.styles.rating,value:this.ratingSlot,required:this.required,tabIndex:e.tabIndex,ariaDescribedBy:e.ariaDescribedBy,autoSubmit:this.autoSubmit,shape:this.shape,steps:this.steps,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};function gs(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}vs=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-rating",alias:"rating"})],vs);let fs=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Number){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}compare(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};gs([S],fs.prototype,"compare",null),fs=gs([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-scale:compare"})],fs);let bs=class extends z{match(){const e=this.valueOf();return e&&this.props.option===e.reference||!1}};gs([S],bs.prototype,"match",null),bs=gs([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-scale:match"})],bs);let ms=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Numeric){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};gs([S],ms.prototype,"verify",null),ms=gs([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-scale:score"})],ms);class ys extends V{constructor(){super(...arguments),this.scoreSlot=this.valueOf("score","feature"),this.scaleSlot=F(this.valueOf("scale","static",{modifier:e=>{if("options"===this.props.mode&&e.value){if(!e.reference){const t=p(this.props.options,(t=>t.value===e.value))||p(this.props.options,(t=>t.id===e.value))||p(this.props.options,(t=>t.name===e.value))||p(this.props.options,(t=>t.name.toLowerCase()===e.string.toLowerCase()));return{value:t&&(t.value||t.name),reference:t&&t.id}}if(!p(this.props.options,(t=>t.id===e.reference)))return{value:void 0,reference:void 0}}},onChange:e=>{if(this.scoreSlot){const t=p(this.props.options,(t=>t.id===e.reference));this.scoreSlot.set(t&&((null==t?void 0:t.score)||0))}}})),this.required=this.scaleSlot.slot.required||!1}get from(){return a.range(a.min(k(this.props.from,0),k(this.props.to,10)),-25,25)}get to(){return a.range(a.max(k(this.props.from,0),k(this.props.to,10)),-25,25)}get stepSize(){return a.max(k(this.props.stepSize,0),1)}get options(){var e;return"options"===this.props.mode?(null===(e=this.props.options)||void 0===e?void 0:e.map((e=>Object.assign(Object.assign({},e),{name:L(e.name,this.context)}))))||[]:{from:this.from,to:this.to,stepSize:this.stepSize}}}const $s=fe.div`
display: block;
width: 100%;
> div {
max-width: calc(100% + 0.4rem);
overflow-x: scroll;
-ms-overflow-style: none;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
padding: 0.2rem;
margin -0.2rem;
&::-webkit-scrollbar {
display: none;
}
> div {
display: inline-block;
white-space: nowrap;
min-width: ${e=>e.$justify?"100%":void 0};
@media (max-device-width: 500px) {
min-width: 100%;
}
@media (max-width: 500px) {
min-width: 100%;
}
> div {
display: flex;
flex-wrap: nowrap;
> button {
flex-grow: ${e=>e.$justify?"1":void 0};
min-width: ${e=>e.$justify?void 0:"3em"};
@media (max-device-width: 500px) {
min-width: auto;
flex-grow: 1;
padding-left: 0.55em;
padding-right: 0.55em;
}
@media (max-width: 500px) {
min-width: auto;
flex-grow: 1;
padding-left: 0.55em;
padding-right: 0.55em;
}
> span > span {
display: flex;
align-content: center;
justify-content: center;
}
}
}
}
}
`,ws=fe.div`
display: flex;
flex-direction: row;
padding-top: 0.1em;
> small {
flex: 1 1 0%;
font-size: 0.8em;
color: ${e=>e.$labelColor};
&:first-child {
text-align: left;
}
&:nth-child(2) {
text-align: center;
}
&:last-child {
text-align: right;
}
}
`,ks=(e,t,r)=>{if(ie(t)){const o=p(t,(e=>e.id===r));return e.reference!==(null==o?void 0:o.id)&&e.set(o&&(o.value||o.name),null==o?void 0:o.id,null==o?void 0:o.name),o&&o.id||""}if(w(r)&&t){const o=a.range(r,a.min(t.from,t.to),a.max(t.from,t.to));return e.set(o),o}e.clear()},xs=e=>{const t=e.value,r=de(0),[o,n]=pe("object"!=typeof t&&t||void 0),[i,s]="object"==typeof t?[0!==r.current?o:ks(t,e.options,ie(e.options)?t.reference:w(t.pristine)?t.pristine:void 0),(o,i)=>{R(r.current),n(o),r.current=j((()=>{r.current=0,ks(t,e.options,o),i&&e.autoSubmit&&void 0!==o&&hr(l)}),vr)}]:[o,n],l=de({id:0,cb:e.onSubmit}),c=(t,r)=>{l.current.id&&(clearTimeout(l.current.id),l.current.id=0),s(t,r),e.onChange&&e.onChange(t),r&&e.autoSubmit&&void 0!==t&&hr(l)};let u=[];const d=(t,r)=>o=>{if(o.shiftKey&&"Enter"===o.key&&e.onSubmit)o.preventDefault(),e.onSubmit();else if("Escape"===o.key)o.currentTarget.blur();else if("Tab"===o.key)o.shiftKey?e.onCancel&&0===t&&(o.preventDefault(),e.onCancel()):e.onSubmit&&t+1===u.length&&(o.preventDefault(),e.onSubmit());else if(r)if("-"===o.key||"+"===o.key)r(o.key);else{const e=1===o.key.length?o.key.charCodeAt(0)-48:-1;e>=0&&e<=9&&r(e)}};if(he((()=>()=>{R(r.current)}),[]),l.current.cb=e.onSubmit,ie(e.options)){const r="preview"===e.view?e.options:e.options.filter((e=>!!e.name)),o=r.length;u=r.map(((r,n)=>le(Kt,{styles:{baseColor:e.styles.color,mode:i===r.id?"fill":"outline",hover:"outline",outlineSize:e.styles.outlineSize,roundness:e.styles.roundness,scale:e.styles.scale,group:o>1?0===n?"start":n+1===o?"end":"middle":void 0},label:r.name||"...",tabIndex:e.tabIndex,ariaDescribedBy:e.ariaDescribedBy,disabled:e.disabled||e.readOnly||"object"==typeof t&&(t.isFrozen||t.isLocked)||!1,onAutoFocus:(!i&&0===n||i===r.id)&&e.onAutoFocus||void 0,onFocus:e.onFocus,onBlur:e.onBlur,onKeyDown:d(n),onClick:()=>c(e.required||i!==r.id?r.id:void 0,!0)},n)))}else if(e.options){const r=a.min(e.options.from,e.options.to),o=a.max(e.options.from,e.options.to),n=a.max(e.options.stepSize||0,1);for(let a=r;a<=o;a+=n)u.push(le(Kt,{styles:{baseColor:e.styles.color,mode:i===a?"fill":"outline",hover:"outline",outlineSize:e.styles.outlineSize,roundness:e.styles.roundness,scale:e.styles.scale,group:o>r&&r+n<=o?a===r?"start":a+n>o?"end":"middle":void 0},label:$(a),tabIndex:e.tabIndex,ariaDescribedBy:e.ariaDescribedBy,disabled:e.disabled||e.readOnly||"object"==typeof t&&(t.isFrozen||t.isLocked)||!1,onAutoFocus:a===(w(i)?i:r)&&e.onAutoFocus||void 0,onFocus:e.onFocus,onBlur:e.onBlur,onKeyDown:d(a-r,(e=>{"-"===e||"+"===e?w(i)?("-"===e&&i>r||"+"===e&&i<o)&&c(i+("-"===e?-1:1),!1):c(a,!1):e>=r&&e<=o&&c(i!==e?e:void 0,!0)})),onClick:()=>c(e.required||i!==a?a:void 0,!0)},a))}return le($s,{$justify:e.justify,children:le("div",{children:ue("div",{children:[le("div",{children:u}),u.length>0&&(e.labelLeft||e.labelCenter&&u.length>2||e.labelRight&&u.length>1)&&ue(ws,{$labelColor:e.styles.labelColor,children:[le("small",{children:e.labelLeft||""}),le("small",{children:u.length>2&&e.labelCenter||""}),le("small",{children:u.length>1&&e.labelRight||""})]})]})})})};let Cs=class extends ys{constructor(){super(...arguments),this.hideButtons=!0,this.autoSubmit=!0}render(e,t,r){return ue(ce,{children:[e.name,e.description,le(xs,{styles:e.styles.scale,view:e.view,options:this.options,value:this.scaleSlot,required:this.required,tabIndex:e.tabIndex,ariaDescribedBy:e.ariaDescribedBy,labelLeft:this.props.labelLeft&&e.markdownifyToJSX(this.props.labelLeft,!1),labelCenter:this.props.labelCenter&&e.markdownifyToJSX(this.props.labelCenter,!1),labelRight:this.props.labelRight&&e.markdownifyToJSX(this.props.labelRight,!1),justify:this.props.justify,autoSubmit:this.autoSubmit,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};function Ss(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}Cs=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-scale"})],Cs);let Os=class extends z{isSigned(){const e=this.valueOf();return!(!e||!e.value)===this.props.isSigned}};Ss([S],Os.prototype,"isSigned",null),Os=Ss([C({type:"condition",identifier:"@tripetto/block-signature"})],Os);class zs extends V{constructor(){super(...arguments),this.signatureSlot=F(this.valueOf("signature")),this.required=this.signatureSlot.slot.required||!1}get isSigning(){return this.signatureSlot.isAwaiting}get size(){return this.props.size||"md"}get color(){return this.props.color||void 0}convertToBase64(e,t,r){const o=new FileReader;r&&(o.onprogress=e=>r(e.loaded/e.total*100)),o.onload=()=>{t(o.result)},o.readAsDataURL(e)}upload(e,t,r){return this.cache=void 0,this.signatureSlot.clear(),new Promise(((o,n)=>{if(1!==e.length)return n("");const i=e[0];this.signatureSlot.await(),t?t.put(i,r).then((e=>{this.signatureSlot.set(i.name,e),this.convertToBase64(i,(e=>{this.cache=e,o()}))})).catch((e=>{this.signatureSlot.clear(),n(e)})):this.convertToBase64(i,(e=>{this.signatureSlot.set(i.name,e),o()}),r)}))}download(e){return new Promise(((t,r)=>{this.cache?t(this.cache):this.signatureSlot.reference?e?e.get(this.signatureSlot.reference).then((e=>this.convertToBase64(e,(e=>t(e))))).catch((()=>{this.signatureSlot.clear(),r()})):t(this.signatureSlot.reference):r()}))}delete(e){return new Promise(((t,r)=>{this.signatureSlot.reference&&e?(this.signatureSlot.await(),e.delete(this.signatureSlot.reference).then((()=>{this.cache=void 0,this.signatureSlot.clear(),t()})).catch((()=>{this.signatureSlot.cancelAwait(),r()}))):(this.cache=void 0,this.signatureSlot.clear(),t())}))}}const Ps=le("svg",{viewBox:"0 0 20 20",children:le("path",{d:"M19.521 0.564l-0.086-0.086c-0.283-0.283-0.659-0.438-1.061-0.438s-0.778 0.156-1.061 0.438l-5.314 5.314-0.146-0.146c-0.195-0.195-0.512-0.195-0.707 0l-1.147 1.147c-0.498-0.488-1.202-0.768-1.936-0.768-0.625 0-1.226 0.203-1.693 0.571-0.031 0.025-3.149 2.469-6.029 3.429-0.204 0.068-0.342 0.259-0.342 0.474 0 2.538 0.988 4.923 2.782 6.717s4.18 2.782 6.717 2.782c0.215 0 0.406-0.138 0.474-0.342 0.96-2.88 3.404-5.997 3.429-6.029 0.83-1.051 0.74-2.673-0.197-3.629l1.147-1.147c0.195-0.195 0.195-0.512 0-0.707l-0.146-0.146 5.314-5.314c0.585-0.585 0.585-1.536-0-2.121zM8.063 7.025c0.48 0 0.934 0.179 1.247 0.492l0.336 0.336c0 0 0 0 0 0l2.836 2.836c0.596 0.596 0.658 1.659 0.136 2.321-0.015 0.019-0.078 0.099-0.177 0.23l-5.679-5.684c0.13-0.098 0.208-0.16 0.227-0.174 0.291-0.23 0.672-0.356 1.073-0.356zM9.148 18.993c-0.745-0.031-1.466-0.158-2.15-0.369 0.967-1.87 2.837-3.751 2.856-3.77 0.195-0.195 0.195-0.512 0-0.707s-0.512-0.195-0.707 0c-0.084 0.084-2.065 2.077-3.091 4.124-0.807-0.359-1.548-0.84-2.199-1.42l2.997-2.997c0.195-0.195 0.195-0.512 0-0.707s-0.512-0.195-0.707 0l-2.997 2.997c-0.58-0.652-1.061-1.392-1.42-2.199 2.047-1.025 4.040-3.007 4.124-3.091 0.195-0.195 0.195-0.512 0-0.707s-0.512-0.195-0.707 0c-0.019 0.019-1.897 1.887-3.77 2.856-0.211-0.684-0.338-1.405-0.369-2.15 1.905-0.7 3.803-1.91 4.936-2.701l5.904 5.91c-0.791 1.133-2 3.030-2.699 4.933zM12.5 9.293l-1.793-1.793 0.793-0.793 1.793 1.793-0.793 0.793zM18.814 1.979l-5.314 5.314-0.793-0.793 5.314-5.314c0.094-0.094 0.219-0.145 0.354-0.145s0.26 0.052 0.354 0.145l0.086 0.086c0.195 0.195 0.195 0.512 0 0.707z"})}),Bs=fe.div`
outline: none;
box-sizing: border-box;
display: block;
width: 100%;
height: ${e=>("sm"===e.$size?9:"lg"===e.$size?19:14)*e.$scale+"em"};
position: relative;
overflow: hidden;
font-size: 1em;
line-height: 1.5em;
background-color: ${e=>Nt(e.$backgroundColor)};
background-image: ${e=>e.$error?`url("data:image/svg+xml;base64,${_t(Nt(e.$errorColor,(t=>t.makeBlackOrWhite("transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor))))}")`:void 0};
background-repeat: no-repeat;
background-size: ${8/7}em;
background-position: right 0.375em top 0.375em;
border: ${e=>`${"transparent"===e.$backgroundColor&&"transparent"===e.$borderColor?0:e.$borderSize}px solid ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)}`};
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
border-radius: ${e=>w(e.$roundness)?`${e.$roundness}px`:"0.5em"};
margin: 0;
opacity: ${e=>e.$disabled?.65:1};
transition:
color 0.15s ease-in-out,
background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out,
box-shadow 0.15s ease-in-out,
opacity 0.15s ease-in-out;
cursor: default;
&:hover {
box-shadow: ${e=>!e.$disabled&&("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.2)))))}`||void 0};
}
&:focus {
background-color: ${e=>!e.$disabled&&Nt(e.$backgroundColor)||void 0};
border-color: ${e=>!e.$disabled&&Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)||void 0};
color: ${e=>!e.$disabled&&Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))||void 0};
box-shadow: ${e=>!e.$disabled&&("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.5)))))}`||void 0};
}
> canvas {
position: absolute;
left: 0;
top: 0;
width: 1px;
height: 1px;
touch-action: none;
&:first-of-type {
pointer-events: none;
opacity: 0;
}
&:last-of-type {
cursor: ${e=>{return`url("data:image/svg+xml;base64,${t=Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite()))),btoa(`<?xml version="1.0" encoding="UTF-8"?>\n <svg width="32" height="32" version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">\n <path d="m31.325 0.67378c-0.44812-0.44812-1.0483-0.67378-1.7877-0.67378-1.2051 0-2.8248 0.63057-4.8349 1.8789-0.64338-0.68019-1.8677-1.7237-3.4105-1.8485-1.2307-0.099227-2.3927 0.38571-3.4521 1.4452-2.2486 2.2486-3.3561 4.995-4.0891 6.8115-0.24967 0.61777-0.55855 1.386-0.7122 1.5444-0.05281 0.05281-0.21126 0.21126-0.48653-0.02081-0.31369-0.29608-0.80822-0.28968-1.1139 0.016-0.31209 0.31209-0.31209 0.81942 0 1.1315 0.13124 0.13124 0.46893 0.38571 0.89944 0.50574 0.17285 0.04801 0.34569 0.07202 0.51534 0.07202 0.20326 0 0.40171-0.03521 0.59056-0.10403-0.21926 0.22566-0.43852 0.45132-0.65778 0.68018-5.6287 5.8784-11.939 13.945-12.775 18.952-0.043212 0.25447 0.040011 0.51534 0.22406 0.69779 0.15204 0.15204 0.3553 0.23366 0.56655 0.23366 0.043212 0 0.088024-0.0032 0.13124-0.0112 2.0934-0.3489 4.8525-1.6741 8.2022-3.9371 2.964-2.0021 6.2513-4.6541 9.5066-7.6677 3.1753-2.94 6.0721-5.9888 8.3783-8.82 1.7221-2.1142 3.9339-5.1342 4.6957-7.5092 0.48173-1.5028 0.3505-2.6391-0.39051-3.3801zm-12.352 1.9317c0.7202-0.7202 1.434-1.0419 2.1846-0.98267 0.89784 0.070419 1.6853 0.66898 2.1846 1.1523-0.39531 0.27528-0.80182 0.56816-1.2211 0.88344-2.279 1.7109-4.8653 3.9819-7.442 6.5314 0.17125-0.3489 0.34569-0.78101 0.55855-1.306 0.68339-1.6965 1.7173-4.2604 3.7354-6.2785zm-14.113 21.779 2.756 2.756c-2.1846 1.4276-4.1355 2.4423-5.7136 2.956 0.51534-1.5796 1.5332-3.5306 2.9576-5.712zm12.696-5.1758c-3.0024 2.7784-5.9376 5.1662-8.5895 7.0195l-3.1929-3.1929c2.1142-3.028 4.9149-6.4146 8.1702-9.8139 3.7802-3.9483 7.514-7.21 10.502-9.2617l3.5914 3.5914c-2.2902 3.3385-6.0593 7.5637-10.481 11.658zm12.635-15.643c-0.23686 0.7394-0.66898 1.6212-1.2659 2.6103l-3.1064-3.1064c1.5652-0.94586 2.8488-1.4692 3.7194-1.4692 0.44972 0 0.60496 0.15524 0.65618 0.20486 0.3713 0.3713 0.15844 1.2627-0.0016 1.7605z" stroke-width="1.6004" fill="${t}" />\n </svg>`)}") 1 32, auto`;var t}};
pointer-events: ${e=>!e.$disabled&&e.$allowSign?"auto":"none"};
opacity: ${e=>e.$disabled||e.$processing?.3:1};
transition: opacity 0.3s;
filter: blur(0.5px);
}
}
> div {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
opacity: ${e=>e.$disabled||e.$allowSign?0:1};
pointer-events: ${e=>e.$disabled||e.$allowSign?"none":"auto"};
transition: opacity 0.3s;
display: flex;
align-items: center;
justify-content: center;
}
`,Vs=fe.div`
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
> div {
display: inline-block;
width: 80%;
max-width: 300px;
height: 16px;
background-color: ${e=>Nt(e.$color,(e=>e.manipulate((e=>e.alpha(.25)))))};
border-radius: 4px;
overflow: hidden;
margin-bottom: 0.375em;
> div {
width: 0%;
height: 16px;
background-color: ${e=>Nt(e.$color)};
background-image: linear-gradient(
45deg,
${e=>Nt(e.$color,(e=>e.makeBlackOrWhite().manipulate((e=>e.alpha(.25)))))} 25%,
transparent 25%,
transparent 50%,
${e=>Nt(e.$color,(e=>e.makeBlackOrWhite().manipulate((e=>e.alpha(.25)))))} 50%,
${e=>Nt(e.$color,(e=>e.makeBlackOrWhite().manipulate((e=>e.alpha(.25)))))} 75%,
transparent 75%,
transparent
);
background-size: 1rem 1rem;
transition: width 0.5s ease-out;
}
}
> span {
display: block;
text-align: center;
white-space: nowrap;
}
`,Fs=fe.div`
position: absolute;
right: 10px;
top: 10px;
display: flex;
align-items: center;
> span {
display: block;
margin-right: 10px;
white-space: nowrap;
}
`,Rs=e=>{var t;const r=de(),o=de(),[i,s]=pe(-1),[c,u]=pe(!1),[d,p]=pe(!1),h=de(),v=de(!1),g=de(!1),f=de(""),b=e.disabled||e.controller.signatureSlot.isFrozen||e.controller.signatureSlot.isLocked||!1,m=e.styles.textColor?e.styles.textColor:e.styles.borderColor&&"transparent"!==e.styles.borderColor?e.styles.borderColor:Nt(e.styles.backgroundColor||"transparent",(e=>e.makeBlackOrWhite()));f.current=e.color||m;const y=()=>{const e=r.current;if(e&&e.width>0&&e.height>0){const t=e.getContext("2d");if(t){const r=t.getImageData(0,0,e.width,e.height),o=Ut(f.current);for(let e=0;e<r.data.length;e+=4)0!==r.data[e+3]&&(r.data[e]=o.red(),r.data[e+1]=o.green(),r.data[e+2]=o.blue());t.putImageData(r,0,0)}}};return he((()=>{var e;if(!r.current)return;const t=null===(e=r.current.parentElement)||void 0===e?void 0:e.getBoundingClientRect();if(!t)return;let i=!1,l=0;const c=r.current,u=c.getContext("2d",{willReadFrequently:!0}),d="ResizeObserver"in window&&new ResizeObserver((()=>{const e=getComputedStyle(c.parentElement),t=k(e.width),r=k(e.height);if(t>0&&r>0&&(2*t!==c.width||2*r!==c.height)){const e=c.width>0&&c.height>0&&(null==u?void 0:u.getImageData(0,0,c.width,c.height))||void 0;c.style.width=`${t}px`,c.style.height=`${r}px`,c.width=2*t,c.height=2*r,e&&(null==u||u.putImageData(e,0,0))}}));if(c.style.width=`${t.width}px`,c.style.height=`${t.height}px`,c.width=2*t.width,c.height=2*t.height,!u)return;const p=e=>{var t;const r=e.target.getBoundingClientRect();l&&(clearTimeout(l),l=0),!v.current||c.width<1||c.height<1?i=!1:(u.lineWidth=6,u.lineJoin=u.lineCap="round",u.imageSmoothingQuality="high",u.strokeStyle=Nt(f.current),u.beginPath(),u.moveTo(2*(e.clientX-r.x),2*(e.clientY-r.y)),i=!0,null===(t=c.parentElement)||void 0===t||t.focus())},b=e=>{if(e.target&&i&&v.current){const t=e.target.getBoundingClientRect();l&&(clearTimeout(l),l=0);const r=2*(e.clientX-t.x),o=2*(e.clientY-t.y);u.lineTo(r,o),u.stroke()}e.preventDefault(),e.stopPropagation()},m=()=>{i=!1,l&&clearTimeout(l),l=setTimeout((()=>{const e=o.current;if(s(0),e&&c.width>0&&c.height>0){const t=e.getContext("2d");if(t){const r=u.getImageData(0,0,c.width,c.height);let o=-1,i=-1,l=0,d=0;for(let e=0;e<r.data.length;e+=4)if(0!==r.data[e+3]){const t=e/4%c.width,n=a.floor(e/4/c.width);r.data[e]=0,r.data[e+1]=0,r.data[e+2]=0,(-1===o||t<o)&&(o=t),(-1===i||n<i)&&(i=n),t>l&&(l=t),n>d&&(d=n)}const p=l-o,v=d-i;if(o>=0&&i>=0&&p>0&&v>0){const r=u.getImageData(o,i,p,v);for(let e=0;e<r.data.length;e+=4)0!==r.data[e+3]&&(r.data[e]=0,r.data[e+1]=0,r.data[e+2]=0);e.width=a.min(p+50,c.width),e.height=a.min(v+50,c.height),t.clearRect(0,0,e.width,e.height),t.putImageData(r,(e.width-p)/2,(e.height-v)/2),g.current=!0,e.toBlob((e=>{if(e&&h.current){const t=new DataTransfer;t.items.add(new File([e],`signature-${n.format("yyyyMMddHHmmss")}.png`,{type:"image/png",lastModified:(new Date).getTime()})),h.current.controller.upload(t.files,h.current.service,(e=>s(a.floor(e)))).then((()=>s(-1))).catch((()=>s(-1)))}}),"image/png")}else s(-1)}}l=0}),1500)};return c.addEventListener("pointerdown",p),c.addEventListener("pointermove",b),c.addEventListener("pointerup",m),d&&c.parentElement&&d.observe(c.parentElement),()=>{d&&d.disconnect(),c.removeEventListener("pointerdown",p),c.removeEventListener("pointermove",b),c.removeEventListener("pointerup",m)}}),[]),he((()=>{!e.controller.signatureSlot.hasValue||-1!==i||d||g.current||(p(!0),e.controller.download(e.service).then((e=>{if(e){const t=new Image;t.onload=()=>{const e=r.current;if(e){const r=e.getContext("2d");r&&(r.clearRect(0,0,e.width,e.height),r.drawImage(t,a.min(50,a.max(e.width-t.width,0)),a.max(e.height-t.height,0)/2),y())}},t.src=e}p(!1)})).catch((()=>p(!1))))}),[e.controller.signatureSlot.reference]),he((()=>y()),[f.current]),h.current=e,v.current=!d&&!c&&-1===i&&!e.controller.signatureSlot.hasValue,ue(Bs,{ref:e.onAutoFocus,tabIndex:e.tabIndex||0,onFocus:e.onFocus,onBlur:e.onBlur,$backgroundColor:e.styles.backgroundColor||"transparent",$borderColor:e.styles.borderColor||"transparent",$borderSize:e.styles.borderSize||1,$roundness:e.styles.roundness,$textColor:e.styles.textColor,$errorColor:e.styles.errorColor,$error:e.error||!1,$scale:e.styles.scale||1,$disabled:b,$allowSign:v.current,$size:e.size||"md",$processing:-1!==i,children:[le("canvas",{ref:e=>o.current=e,width:"1",height:"1"}),le("canvas",{ref:e=>r.current=e,width:"1",height:"1"}),le("div",{children:-1!==i?ue(Vs,{$color:m,children:[le("div",{children:le("div",{style:{width:`${a.range(i,0,100)}%`}})}),le("span",{children:e.labels("processing",`${a.range(i,0,100)}%`)})]}):ue(Fs,{children:[e.controller.signatureSlot.hasValue&&(e.controller.signatureSlot.time||0)>0&&le("span",{children:e.labels("signed",((null===(t=e.l10n)||void 0===t?void 0:t.locale)||l.Locales).dateLong(e.controller.signatureSlot.time))})||void 0,le(Kt,{styles:{baseColor:m,mode:"outline"},tabIndex:e.tabIndex||0,label:e.labels("clear",""),icon:Ps,disabled:c,onClick:()=>{e.controller.signatureSlot.hasValue&&-1===i&&(u(!0),e.controller.delete(e.service).then((()=>{var e;const t=r.current;t&&(null===(e=t.getContext("2d"))||void 0===e||e.clearRect(0,0,t.width,t.height)),u(!1)})).catch((()=>u(!1))))}})]})})]})};let js=class extends zs{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(Rs,{styles:e.styles.fileUpload,l10n:e.l10n,controller:this,service:e.attachments,error:e.isFailed,size:this.size,color:this.color,tabIndex:e.tabIndex,ariaDescribedBy:e.ariaDescribedBy,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r,labels:(t,r)=>{switch(t){case"processing":return e.l10n.pgettext("runner#6|✍️ Signature","Processing signature (%1)",r);case"signed":return e.l10n.pgettext("runner#6|✍️ Signature","Signed on %1",r);case"clear":return e.l10n.pgettext("runner#6|✍️ Signature","Clear")}}})]})}};js=Ue([C({namespace:Le,type:"node",identifier:"@tripetto/block-signature"})],js);class Ds extends V{}const Ts=fe.div`
padding-left: 2.2em;
background-image: ${e=>`url("data:image/svg+xml;base64,${btoa(`<?xml version="1.0" encoding="utf-8"?>\n <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 10240 10240">\n <path d="M6400 8320l1920 0c353,0 640,-287 640,-640l0 -1920c0,-353 -287,-640 -640,-640l-960 0c0,-499 0,-1464 1310,-1587 165,-16 290,-153 290,-319l0 -966c0,-91 -34,-169 -100,-232 -66,-63 -145,-92 -236,-88 -2864,146 -2864,2164 -2864,3192l0 2560c0,353 287,640 640,640z" fill="${e.$color}" />\n <path d="M1920 8320l1920 0c353,0 640,-287 640,-640l0 -1920c0,-353 -287,-640 -640,-640l-960 0c0,-499 0,-1464 1310,-1587 165,-16 290,-153 290,-319l0 -966c0,-91 -34,-169 -100,-232 -66,-63 -145,-92 -236,-88 -2864,146 -2864,2164 -2864,3192l0 2560c0,353 287,640 640,640z" fill="${e.$color}" />\n </svg>`)}")`};
background-repeat: no-repeat;
background-size: 1.6em 1.6em;
background-position: top left;
> h2 {
font-weight: normal;
}
`;let As=class extends Ds{constructor(){super(...arguments),this.autoFocus=!0}render(e){return ue(Ts,{$color:e.styles.font.color,children:[this.props.imageURL&&this.props.imageAboveText&&le(No,{src:e.markdownifyToImage(this.props.imageURL),width:this.props.imageWidth,isPage:e.isPage}),e.name,e.description,this.props.imageURL&&!this.props.imageAboveText&&le(No,{src:e.markdownifyToImage(this.props.imageURL),width:this.props.imageWidth,isPage:e.isPage})]})}};As=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-statement",alias:"statement"})],As);class qs extends V{stopHere(){return!1}}!function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);i>3&&a&&Object.defineProperty(t,r,a)}([O],qs.prototype,"stopHere",null);let Ms=class extends qs{constructor(){super(...arguments),this.hideButtons=!0}render(e){return(e.name||e.description||this.props.imageURL)&&ue(ce,{children:[this.props.imageURL&&this.props.imageAboveText&&le(No,{src:e.markdownifyToImage(this.props.imageURL),width:this.props.imageWidth,isPage:e.isPage}),e.name,e.description,this.props.imageURL&&!this.props.imageAboveText&&le(No,{src:e.markdownifyToImage(this.props.imageURL),width:this.props.imageWidth,isPage:e.isPage})]})}};function Is(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}Ms=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-stop"})],Ms);let Es=class extends z{getMatchString(){if(B(this.props.match)){const e=this.variableFor(this.props.match);return e&&e.hasValue?e.string:""}return this.parseVariables(this.props.match||"")}isEqual(){const e=this.valueOf();if(e){const t=this.props.ignoreCase?P.lowercase(this.getMatchString()):this.getMatchString(),r=this.props.ignoreCase?P.lowercase(e.string):e.string;switch(this.props.mode){case"exact":return r===t;case"not-exact":return r!==t;case"contains":return t&&-1!==r.indexOf(t)||!1;case"not-contains":return t&&-1===r.indexOf(t)||!1;case"starts":return t&&0===r.indexOf(t)||!1;case"ends":return t&&r.length>=t.length&&r.lastIndexOf(t)===r.length-t.length||!1;case"defined":return""!==r;case"undefined":return""===r}}return!1}};Is([S],Es.prototype,"isEqual",null),Es=Is([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-text"})],Es);let Ls=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Numeric){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};Is([S],Ls.prototype,"verify",null),Ls=Is([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-text:score"})],Ls);let Us=class extends V{constructor(){super(...arguments),this.scoreSlot=this.valueOf("score","feature"),this.textSlot=F(this.valueOf("value","static",{prefill:m(this.props.prefill)&&{value:this.props.prefill}||void 0,modifier:e=>{var t;if(this.props.useSuggestions)return{value:e.value,reference:e.value&&(null===(t=p(this.props.suggestions,(t=>t.name===e.value)))||void 0===t?void 0:t.id)||void 0}},onChange:e=>{if(this.scoreSlot){const t=this.props.useSuggestions&&p(this.props.suggestions,(t=>t.name===e.value))||void 0;this.scoreSlot.set(t&&((null==t?void 0:t.score)||0))}}})),this.required=this.textSlot.slot.required||!1,this.maxLength=this.textSlot.slot.maxLength,this.autoComplete=this.props.autoComplete}get suggestions(){var e;return this.props.useSuggestions&&(null===(e=this.props.suggestions)||void 0===e?void 0:e.map((e=>e.name)))||void 0}validate(){return!this.props.minLength||!this.textSlot.value.length||this.textSlot.value.length>=this.props.minLength}};Is([O],Us.prototype,"validate",null);let Ns=0;const Ws=e=>{const[r]=pe((()=>t.SHA2_256("Text"+Ns++)));return ue(ce,{children:[le(mr,Object.assign({list:e.suggestions&&r,type:"text",inputMode:"tel"===e.autoComplete?"tel":"text"},e)),e.suggestions&&le("datalist",{id:r,children:e.suggestions.map(((e,t)=>e&&le("option",{value:e},t)))})]})};let _s=class extends Us{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(Ws,{id:e.id,styles:e.styles.inputs,value:this.textSlot,required:this.required,error:e.isFailed,tabIndex:e.tabIndex,placeholder:e.placeholder,maxLength:this.maxLength,autoComplete:this.autoComplete,suggestions:this.suggestions,ariaDescribedBy:e.ariaDescribedBy,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};function Hs(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}_s=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-text"})],_s);let Ks=class extends z{getMatchString(){if(B(this.props.match)){const e=this.variableFor(this.props.match);return e&&e.hasValue?e.string:""}return this.parseVariables(this.props.match||"","",!0)}isEqual(){const e=this.valueOf();if(e){const t=this.props.ignoreCase?P.lowercase(this.getMatchString()):this.getMatchString(),r=this.props.ignoreCase?P.lowercase(e.string):e.string;switch(this.props.mode){case"exact":return r===t;case"not-exact":return r!==t;case"contains":return t&&-1!==r.indexOf(t)||!1;case"not-contains":return t&&-1===r.indexOf(t)||!1;case"starts":return t&&0===r.indexOf(t)||!1;case"ends":return t&&r.length>=t.length&&r.lastIndexOf(t)===r.length-t.length||!1;case"defined":return""!==r;case"undefined":return""===r}}return!1}};Hs([S],Ks.prototype,"isEqual",null),Ks=Hs([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-textarea"})],Ks);let Ys=class extends V{constructor(){super(...arguments),this.textareaSlot=F(this.valueOf("value","static",{prefill:m(this.props.prefill)&&{value:this.props.prefill}||void 0})),this.required=this.textareaSlot.slot.required||!1,this.maxLength=this.textareaSlot.slot.maxLength}validate(){return!this.props.minLength||!this.textareaSlot.value.length||this.textareaSlot.value.length>=this.props.minLength}};Hs([O],Ys.prototype,"validate",null);const Xs=fe.textarea`
appearance: none;
resize: none;
outline: none;
box-sizing: border-box;
display: block;
width: 100%;
font-size: 1em;
line-height: 1.5em;
background-color: ${e=>Nt(e.$error&&"transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor?e.$errorColor:e.$backgroundColor)};
background-image: ${e=>e.$error?`url("data:image/svg+xml;base64,${_t(Nt(e.$errorColor,(t=>t.makeBlackOrWhite("transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor))))}")`:void 0};
background-repeat: no-repeat;
background-size: ${8/7}em;
background-position: right 0.375em top 0.375em;
border: ${e=>`${"transparent"===e.$backgroundColor&&"transparent"===e.$borderColor?0:e.$borderSize}px solid ${Nt(e.$error?e.$errorColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)}`};
color: ${e=>Nt(e.$error?"transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor?Nt(e.$errorColor,(e=>e.makeBlackOrWhite())):e.$errorColor:e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
border-radius: ${e=>w(e.$roundness)?`${e.$roundness}px`:"0.5em"};
padding: ${e=>"transparent"===e.$backgroundColor&&"transparent"===e.$borderColor?"0":.375*e.$scale+"em 0.75em"};
padding-right: ${e=>e.$error&&8/7+.75+"em"||void 0};
margin: 0;
opacity: 0.65;
transition:
color 0.15s ease-in-out,
background-color 0.15s ease-in-out,
border-color 0.15s ease-in-out,
box-shadow 0.15s ease-in-out,
opacity 0.15s ease-in-out;
overflow-y: auto;
overflow-x: hidden;
scroll-behavior: smooth;
-ms-overflow-style: none;
-webkit-overflow-scrolling: touch;
-webkit-tap-highlight-color: transparent;
&::-webkit-scrollbar {
display: none;
}
&::placeholder {
color: ${e=>Nt(e.$error?"transparent"!==e.$backgroundColor&&"transparent"===e.$borderColor?Nt(e.$errorColor,(e=>e.makeBlackOrWhite())):e.$errorColor:e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
opacity: 0.5;
transition: color 0.15s ease-in-out opacity 0.15s ease-in-out;
}
&:not(:disabled):not([readonly]) {
opacity: 1;
&:hover {
box-shadow: ${e=>("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$error?e.$errorColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.2)))))}`||void 0};
}
&:focus {
background-color: ${e=>Nt(e.$backgroundColor)};
background-image: ${e=>e.$errorVisible?void 0:"none"};
border-color: ${e=>Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor)};
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
box-shadow: ${e=>("transparent"!==e.$backgroundColor||"transparent"!==e.$borderColor)&&`0 0 0 0.2rem ${Nt(e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:e.$backgroundColor,(e=>e.manipulate((e=>e.alpha(.5)))))}`||void 0};
&::placeholder {
color: ${e=>Nt(e.$textColor?e.$textColor:e.$borderColor&&"transparent"!==e.$borderColor?e.$borderColor:Nt(e.$backgroundColor,(e=>e.makeBlackOrWhite())))};
opacity: 0.3;
}
}
}
`,Js=e=>{const t=e.value,r=de({duration:0,handle:0}),[o,i]=pe(!1),[s,l]=pe("object"==typeof t?$(t.pristine):t||""),[c,u]="object"==typeof t?[o?s:t.string,e=>{R(r.current.handle),l(e);const o=a.range(2*r.current.duration,gr,fr);r.current.handle=j((()=>{const o=n.precise;r.current.handle=0,r.current.update=()=>{r.current.duration=n.elapsed(o,!0),r.current.update=void 0},t.pristine=e||void 0}),o)}]:[s,l],[d,p]=pe(!!c),[h,v]=pe("auto"),g=de(),f=de();return he((()=>{if(f.current&&(o||(f.current.value=c),e.autoSize)){"number"!=typeof g.current&&(g.current=f.current.getBoundingClientRect().height);const e=f.current.style.height;f.current.style.height="auto";const t=Math.max(g.current,f.current.scrollHeight);v(t>10?t+"px":"auto"),f.current.style.height=e}}),[c]),he((()=>()=>{R(r.current.handle)}),[]),r.current.update&&r.current.update(),le(Xs,{id:e.id,ref:t=>{e.onAutoFocus&&e.onAutoFocus(t),f.current=t},tabIndex:e.tabIndex,placeholder:e.placeholder,required:e.required||!1,disabled:e.disabled||!1,readOnly:e.readOnly||"object"==typeof t&&(t.isFrozen||t.isLocked)||!1,rows:e.rows||2,maxLength:e.maxLength||void 0,defaultValue:c,autoComplete:"off",inputMode:"text","aria-describedby":e.ariaDescribedBy,style:{height:h,overflowY:e.autoSize?"hidden":void 0},onChange:t=>{u(t.target.value),p(!0),e.onChange&&ur(u,e.onChange(t.target.value))},onFocus:dr(i,u,e.onFocus),onBlur:pr(i,u,e.onBlur),onKeyDown:t=>{t.shiftKey&&"Enter"===t.key&&e.onSubmit?(t.preventDefault(),e.onSubmit()):"Escape"===t.key?t.currentTarget.blur():"Tab"===t.key&&(t.shiftKey?e.onCancel&&(t.preventDefault(),e.onCancel()):e.onSubmit&&(t.preventDefault(),e.onSubmit()))},$backgroundColor:e.styles.backgroundColor||"transparent",$borderColor:e.styles.borderColor||"transparent",$borderSize:e.styles.borderSize||1,$roundness:e.styles.roundness,$textColor:e.styles.textColor,$errorColor:e.styles.errorColor,$errorVisible:d,$error:e.error||!1,$scale:e.styles.scale||1})};let Zs=class extends Ys{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(Js,{id:e.id,styles:e.styles.inputs,value:this.textareaSlot,required:this.required,error:e.isFailed,autoSize:!0,tabIndex:e.tabIndex,placeholder:e.placeholder,maxLength:this.maxLength,ariaDescribedBy:e.ariaDescribedBy,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};function Gs(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}Zs=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-textarea"})],Zs);let Qs=class extends z{verify(){const e=this.valueOf();if(e)switch(this.props.mode){case"defined":return""!==e.string;case"undefined":return""===e.string}return!1}};Gs([S],Qs.prototype,"verify",null),Qs=Gs([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-url"})],Qs);const el=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/i;let tl=class extends V{constructor(){super(...arguments),this.urlSlot=F(this.valueOf("url")),this.required=this.urlSlot.slot.required||!1}validate(){return!this.urlSlot.string||el.test(this.urlSlot.value)}};Gs([O],tl.prototype,"validate",null);const rl=e=>mr(Object.assign(Object.assign({type:"url",inputMode:"url"},e),{placeholder:e.placeholder||"https://"}));let ol=class extends tl{render(e,t,r){return ue(ce,{children:[e.name,e.description,le(rl,{id:e.id,styles:e.styles.inputs,value:this.urlSlot,required:this.required,error:e.isFailed,tabIndex:e.tabIndex,placeholder:e.placeholder,ariaDescribedBy:e.ariaDescribedBy,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};function nl(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}ol=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-url"})],ol);let il=class extends z{isNo(){const e=this.valueOf();return!!e&&"no"===e.reference}};nl([S],il.prototype,"isNo",null),il=nl([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-yes-no:no",alias:"yes-no:no"})],il);let al=class extends z{isYes(){const e=this.valueOf();return!!e&&"yes"===e.reference}};nl([S],al.prototype,"isYes",null),al=nl([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-yes-no:yes",alias:"yes-no:yes"})],al);let sl=class extends z{getValue(e,t){if(m(t)&&e instanceof K.Numeric){const r=this.variableFor(t);return r&&r.hasValue?e.toValue(r.value):void 0}return w(t)?t:void 0}verify(){const e=this.valueOf();if(e){const t=this.getValue(e.slot,this.props.value);switch(this.props.mode){case"equal":return(e.hasValue?e.value:void 0)===t;case"not-equal":return(e.hasValue?e.value:void 0)!==t;case"below":return w(t)&&e.hasValue&&e.value<t;case"above":return w(t)&&e.hasValue&&e.value>t;case"between":case"not-between":const r=this.getValue(e.slot,this.props.to);return w(t)&&w(r)&&(e.hasValue&&e.value>=a.min(t,r)&&e.value<=a.max(t,r))===("between"===this.props.mode);case"defined":return e.hasValue;case"undefined":return!e.hasValue}}return!1}};nl([S],sl.prototype,"verify",null),sl=nl([C({type:"condition",legacyBlock:!0,identifier:"@tripetto/block-yes-no:score"})],sl);class ll extends V{constructor(){super(...arguments),this.scoreSlot=this.valueOf("score","feature"),this.answerSlot=F(this.valueOf("answer","static",{modifier:e=>{let t=e.reference;if("yes"!==t&&"no"!==t)if(e.string){const r=[this.props.aliasYes||"",this.parseVariables(this.props.altYes||""),"Yes"],o=[this.props.aliasNo||"",this.parseVariables(this.props.altNo||""),"No"];p(r,(t=>t===e.string))?t="yes":p(o,(t=>t===e.string))?t="no":p(r,(t=>t.toLowerCase()===e.string.toLowerCase()))?t="yes":p(o,(t=>t.toLowerCase()===e.string.toLowerCase()))&&(t="no")}else t=void 0;return{value:"yes"===t?this.props.aliasYes||this.parseVariables(this.props.altYes||"")||"Yes":"no"===t?this.props.aliasNo||this.parseVariables(this.props.altNo||"")||"No":void 0,reference:t,display:e.display}},onChange:e=>{this.scoreSlot&&this.scoreSlot.set(e.hasValue?k("yes"===e.reference?this.props.scoreForTrue:this.props.scoreForFalse):void 0)}})),this.required=this.answerSlot.slot.required||!1}toggle(e){const t=this.answerSlot.reference===e?void 0:e;this.answerSlot.set("",t)}}const cl=le("svg",{viewBox:"0 0 10240 10240",children:le("path",{d:"M3840 5760l3934 -3934c124,-124 328,-124 452,0l1148 1148c124,124 124,328 0,452l-5308 5308c-124,124 -328,124 -452,0l-2748 -2748c-124,-124 -124,-328 0,-452l1148 -1148c124,-124 328,-124 452,0l1374 1374z"})}),ul=le("svg",{viewBox:"0 0 10240 10240",children:le("path",{d:"M7906 1506l828 828c124,124 124,328 0,452l-2334 2334 2334 2334c124,124 124,328 0,452l-828 828c-124,124 -328,124 -452,0l-2334 -2334 -2334 2334c-124,124 -328,124 -452,0l-828 -828c-124,-124 -124,-328 0,-452l2334 -2334 -2334 -2334c-124,-124 -124,-328 0,-452l828 -828c124,-124 328,-124 452,0l2334 2334 2334 -2334c124,-124 328,-124 452,0z"})}),dl=fe.div`
display: block;
width: 100%;
> * {
display: ${e=>"vertical"===e.$alignment?"block":void 0};
}
> * + * {
margin-top: ${e=>"vertical"===e.$alignment&&`${e.$margin||8}px`||void 0};
}
`,pl=e=>{switch(e){case"yes":return cl;case"no":return ul}},hl=(e,t,r)=>{if("yes"===t||"no"===t){if(e.reference!==t){const o="yes"===t?r.yes.label:r.no.label;e.set(o,t,o)}return t}return e.clear(),""},vl=e=>{const t=e.value,r=de(0),[o,n]=pe("object"!=typeof t&&t||""),[i,a]="object"==typeof t?[0!==r.current?o:hl(t,t.reference,e),o=>{R(r.current),n(o),r.current=j((()=>{r.current=0,hl(t,o,e),e.autoSubmit&&o&&hr(s)}),vr)}]:[o,n],s=de({id:0,cb:e.onSubmit}),l=r=>{s.current.id&&(clearTimeout(s.current.id),s.current.id=0),a(r||""),e.onChange&&e.onChange(r||""),"object"!=typeof t&&e.autoSubmit&&r&&hr(s)},c=(t,r)=>{"y"===t.key||"Y"===t.key||t.key===e.yes.label.charAt(0).toLowerCase()||t.key===e.yes.label.charAt(0).toUpperCase()?(t.preventDefault(),l("yes")):"n"===t.key||"N"===t.key||t.key===e.no.label.charAt(0).toLowerCase()||t.key===e.no.label.charAt(0).toUpperCase()?(t.preventDefault(),l("no")):t.shiftKey&&"Enter"===t.key&&e.onSubmit?(t.preventDefault(),e.onSubmit()):"Escape"===t.key?t.currentTarget.blur():"Tab"===t.key&&(t.shiftKey?"yes"===r&&e.onCancel&&(t.preventDefault(),e.onCancel()):"no"===r&&e.onSubmit&&(t.preventDefault(),e.onSubmit()))};return he((()=>()=>{R(r.current)}),[]),s.current.cb=e.onSubmit,ue(dl,{$alignment:e.styles.alignment,$margin:e.styles.margin,children:[le(Kt,{styles:{baseColor:e.yes.color||e.styles.yesColor,mode:"yes"===i?"fill":"outline",hover:"outline",outlineSize:e.styles.outlineSize,roundness:e.styles.roundness,scale:e.styles.scale,group:"vertical"!==e.styles.alignment?"start":void 0},label:e.yes.label,icon:e.yes.icon&&pl(e.yes.icon),iconPosition:"left",tabIndex:e.tabIndex,ariaDescribedBy:e.ariaDescribedBy,disabled:e.disabled||e.readOnly||"object"==typeof t&&(t.isFrozen||t.isLocked)||!1,onAutoFocus:(!i||"yes"===i)&&e.onAutoFocus||void 0,onFocus:e.onFocus,onBlur:e.onBlur,onKeyDown:e=>c(e,"yes"),onClick:()=>l((e.required||"yes"!==i)&&"yes")}),le(Kt,{styles:{baseColor:e.no.color||e.styles.noColor,mode:"no"===i?"fill":"outline",hover:"outline",outlineSize:e.styles.outlineSize,roundness:e.styles.roundness,scale:e.styles.scale,group:"vertical"!==e.styles.alignment?"end":void 0},label:e.no.label,icon:e.no.icon&&pl(e.no.icon),iconPosition:"right",tabIndex:e.tabIndex,ariaDescribedBy:e.ariaDescribedBy,disabled:e.disabled||e.readOnly||"object"==typeof t&&(t.isFrozen||t.isLocked)||!1,onAutoFocus:"no"===i&&e.onAutoFocus||void 0,onFocus:e.onFocus,onBlur:e.onBlur,onKeyDown:e=>c(e,"no"),onClick:()=>l((e.required||"no"!==i)&&"no")})]})};let gl=class extends ll{constructor(){super(...arguments),this.hideButtons=!0,this.autoSubmit=!0}render(e,t,r){return ue(ce,{children:[this.props.imageURL&&this.props.imageAboveText&&le(No,{src:e.markdownifyToImage(this.props.imageURL),width:this.props.imageWidth,isPage:e.isPage}),e.name,e.description,this.props.imageURL&&!this.props.imageAboveText&&le(No,{src:e.markdownifyToImage(this.props.imageURL),width:this.props.imageWidth,isPage:e.isPage}),le(vl,{styles:e.styles.yesNo,value:this.answerSlot,yes:{label:e.markdownifyToString(this.props.altYes||"")||e.l10n.pgettext("runner#6|🔷 Yes/No","Yes"),color:this.props.colorYes},no:{label:e.markdownifyToString(this.props.altNo||"")||e.l10n.pgettext("runner#6|🔷 Yes/No","No"),color:this.props.colorNo},required:this.required,tabIndex:e.tabIndex,ariaDescribedBy:e.ariaDescribedBy,autoSubmit:this.autoSubmit,onAutoFocus:e.autoFocus,onFocus:e.focus,onBlur:e.blur,onSubmit:t,onCancel:r})]})}};gl=Ue([C({namespace:Le,legacyBlock:!0,type:"node",identifier:"@tripetto/block-yes-no",alias:"yes-no"})],gl);const fl=e=>{const{status:t,frameRef:r,view:o,isPage:n,title:i,height:a,disableScrolling:s,prologue:l,blocks:c,epilogue:u,l10n:d,styles:p,navigation:h,overlayProvider:v,onResize:g,onScroll:f,onKey:b}=$o(e);return le(ge,{children:le(qo,{frameRef:r,styles:p,overlayProvider:v,view:o,isPage:n,title:i,height:a,disableScrolling:s,navigation:h,onResize:g,onScroll:f,onKey:b,onTouch:e.onTouch,className:e.className,customStyle:e.customStyle,customCSS:e.customCSS,children:l&&le(Ho,Object.assign({},l))||c||u&&le(Jo,Object.assign({},u))||"live"!==o&&("empty"===t||"preview"===t)&&le(Mo,{l10n:d,styles:p,view:o})||"paused"===t&&le(Eo,{l10n:d,styles:p,view:o,isPage:n})||le(Io,{l10n:d,styles:p,view:o,isPage:n})})})};let bl=0;const ml=e=>{var t,r,o,n,i;const a=de(),s=de(),c=de(),u=de(),d=de(),p={sections:[],builder:{name:"",version:""}},h=de(),v=de(),g=de(),f=de(),b="test"!==e.view&&"preview"!==e.view,m=de(),y=e.controller||m,[,$]=pe({}),w=de(),k=de(),x=e=>{e(),"mounted"===w.current?k.current({}):w.current="dirty"};k.current=$,v.current||(v.current=!0,f.current=!!e.builder,ae(e.definition)?(a.current=!1,null===(t=e.definition.then((e=>x((()=>a.current=e||p)))))||void 0===t||t.catch((()=>x((()=>a.current=p))))):a.current=e.definition||p,ae(e.snapshot)?(s.current=!1,null===(r=e.snapshot.then((e=>x((()=>s.current=e)))))||void 0===r||r.catch((()=>x((()=>s.current=void 0))))):s.current=e.snapshot||void 0,ae(e.styles)?(c.current=!1,null===(o=e.styles.then((e=>x((()=>c.current=e)))))||void 0===o||o.catch((()=>x((()=>c.current=void 0))))):c.current=e.styles||void 0,ae(e.l10n)?(u.current=!1,null===(n=e.l10n.then((e=>x((()=>u.current=e)))))||void 0===n||n.catch((()=>x((()=>u.current=void 0))))):u.current=e.l10n||void 0,ae(e.license)?(d.current=!1,null===(i=e.license.then((e=>x((()=>d.current=e)))))||void 0===i||i.catch((()=>x((()=>d.current=void 0))))):d.current=e.license||void 0);const C=de(),S=de({locales:{},translations:{}}),O=t=>Ne(void 0,void 0,void 0,(function*(){var r;const o=(null===(r=y.current)||void 0===r?void 0:r.definition)||a.current;if(C.current.reset("auto"!==t.language&&t.language||o&&o.language||e.language||navigator.language),e.translations||e.locale){const r=t.locale||"auto",o=S.current.locales[r]?S.current.locales[r].locale:A(e.locale)?e.locale(r):e.locale,n=S.current.translations[C.current.current]?S.current.translations[C.current.current].translation:(A(e.translations)?e.translations(C.current.current,"@tripetto/runner-autoscroll","9.0.2"):e.translations)||void 0,[i,a]=yield Promise.all([Promise.resolve(o),Promise.resolve(n)]);S.current.locales[r]={locale:i},S.current.translations[C.current.current]={translation:a},i&&C.current.locale.load(i),a&&C.current.load(a,!1)}t.translations&&C.current.load(t.translations,!1,"overwrite")})),z=de({data:void 0,save:()=>{if(y.current&&localStorage){const e=`@tripetto/runner-autoscroll-${y.current.fingerprint}`,t=y.current.snapshot;t?localStorage.setItem(e,JSON.stringify(t)):localStorage.removeItem(e)}}});return C.current||!1===a.current||!1===u.current||(C.current=l.Namespace.create(`${Le}:${bl++}`),O(u.current||{}).then((()=>x((()=>h.current=!0)))).catch((()=>x((()=>h.current=!0))))),e.persistent&&b&&!1!==a.current&&"undefined"!=typeof window&&localStorage&&(z.current.data=JSON.parse(localStorage.getItem(`@tripetto/runner-autoscroll-${se(a.current||p)}`)||"null")||void 0),he((()=>{const t="dirty"===w.current,r=e.persistent&&b&&"undefined"!=typeof window&&localStorage;let o=0;return w.current="mounted",r&&window.addEventListener("unload",z.current.save),e.builder&&!g.current&&new Promise((t=>{const r=()=>{var n,i;o=0,(null===(n=e.builder)||void 0===n?void 0:n.current)?t(null===(i=e.builder)||void 0===i?void 0:i.current):o=requestAnimationFrame(r)};r()})).then((e=>{g.current||(g.current=e,x((()=>{a.current=e.definition,f.current=!1})),e.hook("OnChange","synchronous",(e=>{y.current&&(y.current.definition=e.definition)})),e.hook("OnEdit","synchronous",(e=>{var t;null===(t=y.current)||void 0===t||t.doPreview(e.data)})))})),t&&$({}),()=>{r&&window.removeEventListener("unload",z.current.save),0!==o&&cancelAnimationFrame(o)}})),y.current&&(e.view&&(y.current.view=e.view),ae(e.definition)||!e.definition||N(e.definition,y.current.definition,!0)||(y.current.definition=a.current=e.definition),ae(e.styles)||!e.styles||N(e.styles,y.current.styles,!0)||(y.current.styles=c.current=e.styles),ae(e.l10n)||!e.l10n||N(e.l10n,y.current.l10n,!0)||(y.current.l10n=u.current=e.l10n)),le(ce,{children:!h.current||!1===a.current||!1===s.current||!1===c.current||!1===d.current||!1===u.current||f.current?e.loader:le(fl,Object.assign({},e,{controller:y,definition:a.current||p,snapshot:s.current||z.current.data,styles:c.current,license:d.current,l10nNamespace:C.current,l10n:u.current,onL10n:O,onEdit:e.builder?(t,r)=>{var o;if(null===(o=e.builder)||void 0===o?void 0:o.current)switch(t){case"prologue":e.builder.current.edit("prologue");break;case"epilogue":e.builder.current.edit("epilogue",r);break;case"block":r&&e.builder.current.edit("node",r)}e.onEdit&&e.onEdit(t,r)}:e.onEdit}))})},yl=e=>new Promise((t=>{const r=e.element||document.body.appendChild(document.createElement("div")),o="function"==typeof xe?e=>{const t=xe(r);return t.render(e),()=>t.unmount()}:e=>(we.render(e,r),()=>we.unmountComponentAtNode(r)),n=o(le(ml,Object.assign({},e,{display:e.display||document.body.isEqualNode(r)&&"page"||void 0,builder:e.builder&&{current:e.builder}||void 0,onController:e=>{t({get definition(){return e.current.definition},set definition(t){e.current.definition=t},get instance(){return e.current.instance},get fingerprint(){return e.current.fingerprint},get styles(){return e.current.styles},set styles(t){e.current.styles=t},get l10n(){return e.current.l10n},set l10n(t){e.current.l10n=t},get view(){return e.current.view},set view(t){e.current.view=t},get snapshot(){return e.current.snapshot},get isRunning(){return e.current.isRunning},get isFinishing(){return e.current.isFinishing},get isPausing(){return e.current.isPausing},get isLicensed(){return e.current.isLicensed},get allowStart(){return e.current.allowStart},get allowRestart(){return e.current.allowRestart},get allowPause(){return e.current.allowPause},get allowStop(){return e.current.allowStop},start:()=>e.current.start(),restart:()=>e.current.restart(),pause:()=>e.current.pause(),stop:()=>e.current.stop(),doPreview:t=>e.current.doPreview(t),destroy:()=>{n()}})}})))}));G();var $l=Object.freeze({__proto__:null,AutoscrollRunner:ml,AutoscrollUI:fl,ButtonFabric:Kt,CheckboxFabric:Mn,CheckboxesFabric:Hn,DateTimeFabric:ei,DropdownFabric:ui,EmailFabric:yr,FileFabric:Oi,FileThumbnailFabric:Si,InputFabric:mr,MatrixFabric:Ei,MultiSelectFabric:Qi,MultipleChoiceFabric:ua,NumberFabric:ga,PasswordFabric:ka,PhoneNumberFabric:Pa,PictureChoiceFabric:Ma,RadiobuttonsFabric:Ai,RatingFabric:hs,RequiredIndicatorFabric:Wt,ScaleFabric:xs,TextFabric:Ws,TextareaFabric:Js,URLFabric:rl,YesNoFabric:vl,color:Nt,css:me,keyframes:$e,namespace:Le,run:yl,styled:fe});export{ml as AutoscrollRunner,fl as AutoscrollUI,Kt as ButtonFabric,Mn as CheckboxFabric,Hn as CheckboxesFabric,ei as DateTimeFabric,ui as DropdownFabric,yr as EmailFabric,Oi as FileFabric,Si as FileThumbnailFabric,mr as InputFabric,Ei as MatrixFabric,Qi as MultiSelectFabric,ua as MultipleChoiceFabric,ga as NumberFabric,ka as PasswordFabric,Pa as PhoneNumberFabric,Ma as PictureChoiceFabric,Ai as RadiobuttonsFabric,hs as RatingFabric,Wt as RequiredIndicatorFabric,xs as ScaleFabric,Ws as TextFabric,Js as TextareaFabric,$l as TripettoAutoscroll,rl as URLFabric,vl as YesNoFabric,Nt as color,$l as default,Le as namespace,yl as run};