diff --git a/.changelogs/add-aircraft-thumb.yml b/.changelogs/add-aircraft-thumb.yml deleted file mode 100644 index 6b7a76bf2e..0000000000 --- a/.changelogs/add-aircraft-thumb.yml +++ /dev/null @@ -1,3 +0,0 @@ -significance: patch -type: changed -entry: Added product images for Aircraft and Memberlite. diff --git a/.changelogs/fix_quiz_error_handling.yml b/.changelogs/fix_quiz_error_handling.yml deleted file mode 100644 index 8ea3a637c3..0000000000 --- a/.changelogs/fix_quiz_error_handling.yml +++ /dev/null @@ -1,4 +0,0 @@ -significance: patch -type: fixed -comment: -entry: Adds error handling when taking a quiz in case of temporary server error or internet issue. diff --git a/.changelogs/fix_reviews.yml b/.changelogs/fix_reviews.yml deleted file mode 100644 index 1638f10cf4..0000000000 --- a/.changelogs/fix_reviews.yml +++ /dev/null @@ -1,4 +0,0 @@ -significance: patch -type: security -comment: -entry: Reviews handler now checks nonces and user limits. Thanks, Francesco Carlucci at Wordfence. diff --git a/.changelogs/rest-1.0.0.yml b/.changelogs/rest-1.0.0.yml deleted file mode 100644 index 6a8c2ced9f..0000000000 --- a/.changelogs/rest-1.0.0.yml +++ /dev/null @@ -1,3 +0,0 @@ -significance: patch -type: changed -entry: Updates LifterLMS Rest to [v1.0.0](https://make.lifterlms.com/2024/01/22/lifterlms-rest-api-version-1-0-0/). diff --git a/CHANGELOG.md b/CHANGELOG.md index a29fb01cfe..67882533e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,27 @@ LifterLMS Changelog =================== +v7.5.2 - 2024-02-16 +------------------- + +##### Updates and Enhancements + ++ Added product images for Aircraft and Memberlite. ++ Updates LifterLMS Rest to [v1.0.0](https://make.lifterlms.com/2024/01/22/lifterlms-rest-api-version-1-0-0/). + +##### Bug Fixes + ++ Adds error handling when taking a quiz in case of temporary server error or internet issue. + +##### Security Fixes + ++ Reviews handler now checks nonces and user limits. Thanks, Francesco Carlucci at Wordfence. + +##### Updated Templates + ++ [templates/emails/footer.php](https://github.com/gocodebox/lifterlms/blob/7.5.2/templates/emails/footer.php) + + v7.5.1 - 2024-01-24 ------------------- diff --git a/assets/js/llms-admin-addons.asset.php b/assets/js/llms-admin-addons.asset.php index 645cab0856..b543d011ec 100644 --- a/assets/js/llms-admin-addons.asset.php +++ b/assets/js/llms-admin-addons.asset.php @@ -1 +1 @@ - array('jquery', 'wp-i18n', 'wp-polyfill'), 'version' => 'c40a998b308a098a86fa'); + array('jquery', 'wp-i18n', 'wp-polyfill'), 'version' => '4cc6924959219ec66721'); diff --git a/assets/js/llms-admin-addons.js b/assets/js/llms-admin-addons.js index 2efca75203..4eb377656b 100644 --- a/assets/js/llms-admin-addons.js +++ b/assets/js/llms-admin-addons.js @@ -1,3 +1,3 @@ -!function(){"use strict";var t={n:function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,{a:e}),e},d:function(n,e){for(var c in e)t.o(e,c)&&!t.o(n,c)&&Object.defineProperty(n,c,{enumerable:!0,get:e[c]})},o:function(t,n){return Object.prototype.hasOwnProperty.call(t,n)}},n=window.wp.i18n,e=window.jQuery,c=t.n(e);!function(){const t={update:0,install:0,activate:0,deactivate:0};c()(".llms-bulk-close").on("click",(function(t){t.preventDefault(),c()("input.llms-bulk-check").filter(":checked").prop("checked",!1).trigger("change")})),c()("input.llms-bulk-check").on("change",(function(){const e=c()(this).attr("data-action");c()(this).is(":checked")?t[e]++:t[e]--,function(){const e=c()("#llms-addons-bulk-actions");t.update||t.install||t.activate||t.deactivate?e.addClass("active"):e.removeClass("active"),c().each(t,(function(t,c){const i=e.find(".llms-bulk-desc."+t);let o="";c?( +(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var c in n)e.o(n,c)&&!e.o(t,c)&&Object.defineProperty(t,c,{enumerable:!0,get:n[c]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.i18n,n=window.jQuery;var c=e.n(n);!function(){const e={update:0,install:0,activate:0,deactivate:0};c()(".llms-bulk-close").on("click",(function(e){e.preventDefault(),c()("input.llms-bulk-check").filter(":checked").prop("checked",!1).trigger("change")})),c()("input.llms-bulk-check").on("change",(function(){const n=c()(this).attr("data-action");c()(this).is(":checked")?e[n]++:e[n]--,function(){const n=c()("#llms-addons-bulk-actions");e.update||e.install||e.activate||e.deactivate?n.addClass("active"):n.removeClass("active"),c().each(e,(function(e,c){const l=n.find(".llms-bulk-desc."+e);let a="";c?( // Translators: %d = Number of add-ons to perform the specified action against. -o=(0,n.sprintf)((0,n._n)("%d add-on","%d add-ons",c,"lifterlms"),c),i.show()):i.hide(),i.find("span").text(o)}))}()})),c()("#llms-active-keys-toggle").on("click",(function(){c()("#llms-key-field-form").toggle()}))}()}(); \ No newline at end of file +a=(0,t.sprintf)((0,t._n)("%d add-on","%d add-ons",c,"lifterlms"),c),l.show()):l.hide(),l.find("span").text(a)}))}()})),c()("#llms-active-keys-toggle").on("click",(function(){c()("#llms-key-field-form").toggle()}))}()})(); \ No newline at end of file diff --git a/assets/js/llms-admin-award-certificate.asset.php b/assets/js/llms-admin-award-certificate.asset.php index 4f1af32657..f39b3f7d9d 100644 --- a/assets/js/llms-admin-award-certificate.asset.php +++ b/assets/js/llms-admin-award-certificate.asset.php @@ -1 +1 @@ - array('llms-components', 'llms-utils', 'wp-components', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => 'ee1d01791767e3200592'); + array('llms-components', 'llms-utils', 'wp-components', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '422e3e8089432a2ff721'); diff --git a/assets/js/llms-admin-award-certificate.js b/assets/js/llms-admin-award-certificate.js index 2e44d2dcff..bc2a3a1372 100644 --- a/assets/js/llms-admin-award-certificate.js +++ b/assets/js/llms-admin-award-certificate.js @@ -1 +1 @@ -!function(){"use strict";var e=window.wp.element,t=window.wp.url,l=window.wp.data;window.wp.editor;var n=window.wp.i18n,a=window.wp.components,r=window.llms.components,i=window.wp.coreData,o=window.llms.utils;function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const l={post_type:"llms_my_certificate"};return e&&(l.sid=e),(0,t.addQueryArgs)(`${(0,o.getAdminUrl)()}/post-new.php`,l)}const d="llms-award-certificate-wrapper",c={},m={},u=function(){let e=document.querySelector(".page-title-action");return e&&(c.top="-3px",c.position="relative"),e||(e=document.getElementById("llms-new-award-button"),c.marginBottom="20px",c.display="inline-block",m.studentId=parseInt((0,t.getQueryArg)(window.location,"student_id")),m.selectStudent=!1),e&&(m.buttonLabel=e.textContent),e}();(function(){if(!u)return!1;const e=document.createElement("span");return e.id=d,Object.entries(c).forEach((t=>{let[l,n]=t;e.style[l]=n})),u.style.display="none",u.after(e),!0})()&&(0,e.render)((0,e.createElement)((function(d){let{modalTitle:c=(0,n.__)("Award a New Certificate","lifterlms"),buttonLabel:m=(0,n.__)("Award","lifterlms"),isDisabled:u=!1,enableScratch:p=!0,selectStudent:w=!0,selectTemplate:f=!0,studentId:_=null,templateId:y=null}=d;const[h,g]=(0,e.useState)(!1),[b,E]=(0,e.useState)(!1),[C,v]=(0,e.useState)(_),[x,S]=(0,e.useState)(y),A=()=>g(!1),B=C&&x;return(0,e.createElement)(e.Fragment,null,h&&(0,e.createElement)(a.Modal,{title:c,style:{maxWidth:"420px"},onRequestClose:A},(0,e.createElement)("p",null,function(e,t){let l="";return e&&t?l=(0,n.__)("Create a new certificate award from the selected template for the selected student.","lifterlms"):e&&!t?l=(0,n.__)("Create a new certificate award from this template for the selected student.","lifterlms"):!e&&t&&(l=(0,n.__)("Create a new certificate award from the selected template for this student.","lifterlms")),l}(w,f)),w&&(0,e.createElement)(r.UserSearchControl,{isClearable:!0,label:(0,n.__)("Award to","lifterlms"),selectedValue:_?[_]:[],onUpdate:e=>{const t=(null==e?void 0:e.id)||null;v(t)}}),f&&(0,e.createElement)(r.PostSearchControl,{isClearable:!0,postType:"llms_certificate",label:(0,n.__)("Template","lifterlms"),placeholder:(0,n.__)("Search for a certificate template…","lifterlms"),selectedValue:y?[y]:[],onUpdate:e=>{const t=(null==e?void 0:e.id)||null;S(t)}}),(0,e.createElement)("div",{style:{textAlign:"right",padding:"24px 32px 0",margin:"24px -32px 0",borderTop:"1px solid #ddd"}},(0,e.createElement)(a.Button,{style:{marginRight:"5px"},disabled:!B,isBusy:b,variant:"primary",onClick:()=>{E(!0),function(e,t){const{saveEntityRecord:n}=(0,l.dispatch)(i.store);return n("postType","llms_my_certificate",{author:e,certificate_template:t,status:"draft"})}(C,x).then((e=>{let{id:l}=e;var n;window.location=(n=l,(0,t.addQueryArgs)(`${(0,o.getAdminUrl)()}/post.php`,{post:n,action:"edit",newAwardMsg:1}))}))}},(0,n.__)("Create Draft")),p&&(0,e.createElement)(a.Button,{style:{marginRight:"5px"},variant:"secondary",href:s(C)},(0,n.__)("Start from Scratch","lifterlms")),(0,e.createElement)(a.Button,{variant:"tertiary",onClick:A},(0,n.__)("Cancel","lifterlms")))),(0,e.createElement)(a.Button,{disabled:u,variant:"secondary",onClick:()=>g(!0)},m))}),m),document.getElementById(d))}(); \ No newline at end of file +(()=>{"use strict";const e=window.wp.element,t=window.wp.url,l=window.wp.data;window.wp.editor;const n=window.wp.i18n,a=window.wp.components,r=window.llms.components,i=window.wp.coreData,o=window.llms.utils;function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const l={post_type:"llms_my_certificate"};return e&&(l.sid=e),(0,t.addQueryArgs)(`${(0,o.getAdminUrl)()}/post-new.php`,l)}const d="llms-award-certificate-wrapper",c={},m={},u=function(){let e=document.querySelector(".page-title-action");return e&&(c.top="-3px",c.position="relative"),e||(e=document.getElementById("llms-new-award-button"),c.marginBottom="20px",c.display="inline-block",m.studentId=parseInt((0,t.getQueryArg)(window.location,"student_id")),m.selectStudent=!1),e&&(m.buttonLabel=e.textContent),e}();(function(){if(!u)return!1;const e=document.createElement("span");return e.id=d,Object.entries(c).forEach((t=>{let[l,n]=t;e.style[l]=n})),u.style.display="none",u.after(e),!0})()&&(0,e.render)((0,e.createElement)((function(d){let{modalTitle:c=(0,n.__)("Award a New Certificate","lifterlms"),buttonLabel:m=(0,n.__)("Award","lifterlms"),isDisabled:u=!1,enableScratch:p=!0,selectStudent:w=!0,selectTemplate:f=!0,studentId:_=null,templateId:y=null}=d;const[h,g]=(0,e.useState)(!1),[b,E]=(0,e.useState)(!1),[C,x]=(0,e.useState)(_),[S,v]=(0,e.useState)(y),A=()=>g(!1),B=C&&S;return(0,e.createElement)(e.Fragment,null,h&&(0,e.createElement)(a.Modal,{title:c,style:{maxWidth:"420px"},onRequestClose:A},(0,e.createElement)("p",null,function(e,t){let l="";return e&&t?l=(0,n.__)("Create a new certificate award from the selected template for the selected student.","lifterlms"):e&&!t?l=(0,n.__)("Create a new certificate award from this template for the selected student.","lifterlms"):!e&&t&&(l=(0,n.__)("Create a new certificate award from the selected template for this student.","lifterlms")),l}(w,f)),w&&(0,e.createElement)(r.UserSearchControl,{isClearable:!0,label:(0,n.__)("Award to","lifterlms"),selectedValue:_?[_]:[],onUpdate:e=>{const t=(null==e?void 0:e.id)||null;x(t)}}),f&&(0,e.createElement)(r.PostSearchControl,{isClearable:!0,postType:"llms_certificate",label:(0,n.__)("Template","lifterlms"),placeholder:(0,n.__)("Search for a certificate template…","lifterlms"),selectedValue:y?[y]:[],onUpdate:e=>{const t=(null==e?void 0:e.id)||null;v(t)}}),(0,e.createElement)("div",{style:{textAlign:"right",padding:"24px 32px 0",margin:"24px -32px 0",borderTop:"1px solid #ddd"}},(0,e.createElement)(a.Button,{style:{marginRight:"5px"},disabled:!B,isBusy:b,variant:"primary",onClick:()=>{E(!0),function(e,t){const{saveEntityRecord:n}=(0,l.dispatch)(i.store);return n("postType","llms_my_certificate",{author:e,certificate_template:t,status:"draft"})}(C,S).then((e=>{let{id:l}=e;var n;window.location=(n=l,(0,t.addQueryArgs)(`${(0,o.getAdminUrl)()}/post.php`,{post:n,action:"edit",newAwardMsg:1}))}))}},(0,n.__)("Create Draft")),p&&(0,e.createElement)(a.Button,{style:{marginRight:"5px"},variant:"secondary",href:s(C)},(0,n.__)("Start from Scratch","lifterlms")),(0,e.createElement)(a.Button,{variant:"tertiary",onClick:A},(0,n.__)("Cancel","lifterlms")))),(0,e.createElement)(a.Button,{disabled:u,variant:"secondary",onClick:()=>g(!0)},m))}),m),document.getElementById(d))})(); \ No newline at end of file diff --git a/assets/js/llms-admin-certificate-editor.asset.php b/assets/js/llms-admin-certificate-editor.asset.php index 21e27b05f0..2ed1b50fbb 100644 --- a/assets/js/llms-admin-certificate-editor.asset.php +++ b/assets/js/llms-admin-certificate-editor.asset.php @@ -1 +1 @@ - array('llms-components', 'llms-icons', 'llms-utils', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-rich-text', 'wp-url'), 'version' => '508e70a98acc650c04bc'); + array('llms-components', 'llms-icons', 'llms-utils', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-rich-text', 'wp-url'), 'version' => '60767b838123827faba1'); diff --git a/assets/js/llms-admin-certificate-editor.js b/assets/js/llms-admin-certificate-editor.js index 685480ac90..d95c7f61b2 100644 --- a/assets/js/llms-admin-certificate-editor.js +++ b/assets/js/llms-admin-certificate-editor.js @@ -1,4 +1,4 @@ -!function(){"use strict";var e={n:function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,{a:r}),r},d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.wp.plugins,r=window.wp.coreData,n=window.wp.data,i=window.wp.blocks,a=window.wp.domReady,o=e.n(a),l=window.wp.editor,s=window.wp.blockEditor;let c=!1;function u(){const{getCurrentPostAttribute:e,getEditedPostAttribute:t,getCurrentPostType:a}=(0,n.select)(l.store),o=t("certificate_background"),u=t("certificate_margins"),d=t("certificate_width"),f=t("certificate_height"),m=t("certificate_unit"),p=t("certificate_orientation"),h=e("content"),g=t("content"),y=document.querySelector(".block-editor-block-list__layout.is-root-container");if(y){const e="portrait"===p?d:f,t="portrait"===p?f:d,i=u.map((e=>`${e}%`)).join(" ");y.style.backgroundImage=`url( '${function(){const e=function(){const{getEditedPostAttribute:e}=(0,n.select)(l.store),{getMedia:t}=(0,n.select)(r.store),i=e("featured_media");return i?t(i):{}}(),{default_image:t}=window.llms.certificates;if(void 0===e)return null;const{source_url:i}=e;return i||t}()}' )`,y.style.backgroundSize=`${e}${m} ${t}${m}`,y.style.backgroundRepeat="no-repeat",y.style.marginLeft="auto",y.style.marginRight="auto",y.style.padding=i,y.style.width=`${e}${m}`,y.style.minHeight=`${t}${m}`,y.style.boxSizing="border-box"}const b=document.querySelector(".editor-styles-wrapper");if(b&&(b.style.backgroundColor=o),"llms_my_certificate"===a()){!function(e,t){const{isSavingPost:r}=(0,n.select)(l.store),a=r();if(a)c=!0;else if(!a&&c){c=!1;const r=/(\{[A-Za-z_].*\})|(\[llms-user .+]|())/g,a=e.match(r),o=t.match(r);null==o||!o.length||null!=a&&a.length||function(e){const{replaceBlocks:t}=(0,n.dispatch)(s.store),{savePost:r}=(0,n.dispatch)(l.store),{getBlocks:a}=(0,n.select)(s.store);t(a().map((e=>{let{clientId:t}=e;return t})),(0,i.rawHandler)({HTML:e})),r()}(e)}}(h,g);const e=document.querySelector(".edit-post-visual-editor__post-title-wrapper");e&&(e.style.display=function(){const{getInserterItems:e}=(0,n.select)(s.store),{isDisabled:t}=e().find((e=>{let{name:t}=e;return"llms/certificate-title"===t}));return t}()?"none":"initial")}}o()((()=>{!function(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(".editor-styles-wrapper .wp-block { max-width: 100% !important; }")),e.appendChild(document.createTextNode(".editor-styles-wrapper [data-block], .wp-block { margin-top: 0 !important; margin-bottom: 0 !important }")),document.head.appendChild(e)}(),(0,n.subscribe)(u)}));var d=window.wp.hooks,f=window.wp.i18n;const m=(0,n.subscribe)((()=>{const{getCurrentPostType:e}=(0,n.select)(l.store),t=e();var r;null!==t&&(r="llms_my_certificate"===t,m(),r&&(0,d.addFilter)("i18n.gettext_default","llms/certificates",(function(e){return"Move to trash"===e?(0,f.__)("Delete permanently","lifterlms"):e})))}));var p=window.wp.element,h=window.wp.components,g=window.wp.richText,y=window.llms.components,b=window.llms.icons;function v(e){let{closeModal:t,onChange:r,value:n}=e;const{merge_codes:i}=window.llms.certificates;return Object.entries(i).map(((e,i)=>{let[a,o]=e;return(0,p.createElement)("tr",{key:i},(0,p.createElement)("td",{style:{textAlign:"left"}},o),(0,p.createElement)("td",null,(0,p.createElement)(y.CopyButton,{buttonText:a,copyText:a,onCopy:t,isLink:!0})),(0,p.createElement)("td",null,(0,p.createElement)(h.Button,{isSecondary:!0,isSmall:!0,onClick:()=>{t(),r((0,g.insert)(n,a))}},(0,f.__)("Insert","lifterlms"))))}))}(0,g.registerFormatType)("llms/certificate-merge-codes",{title:(0,f.__)("LifterLMS Certificate Merge Codes","lifterlms"),tagName:"span",className:"llms-cert-mc-wrap",edit:function(e){const[t,r]=(0,p.useState)(!1),n=()=>r(!1),{value:i,onChange:a}=e;return(0,p.createElement)(p.Fragment,null,(0,p.createElement)(s.RichTextToolbarButton,{icon:(0,p.createElement)(b.Icon,{icon:b.lifterlms}),title:(0,f.__)("Merge Codes","lifterlms"),onClick:()=>r(!0)}),t&&(0,p.createElement)(h.Modal,{className:"llms-certificate-merge-codes-modal",title:(0,f.__)("LifterLMS Certificate Merge Codes","lifterlms"),onRequestClose:n},(0,p.createElement)("div",{className:"llms-certificate-merge-codes-modal--main"},(0,p.createElement)("table",{className:"llms-table zebra",style:{width:"480px"}},(0,p.createElement)("thead",null,(0,p.createElement)("tr",null,(0,p.createElement)("th",{style:{textAlign:"left"}},(0,f.__)("Name","lifterlms")),(0,p.createElement)("th",null,(0,f.__)("Merge code","lifterlms")),(0,p.createElement)("th",null,(0,f.__)("Insert","lifterlms")))),(0,p.createElement)("tbody",null,(0,p.createElement)(v,{closeModal:n,onChange:a,value:i}))))))}});const w=(0,n.subscribe)((()=>{const e=new URLSearchParams(window.location.search);if(1!==parseInt(e.get("llms-migrate-legacy-certificate")))return _(!1);0!==k().length&&_(!0)}));function _(e){w(),e&&function(){const e=k().filter((e=>{let{name:t}=e;return"core/freeform"===t}));if(0===e.length)return;const{replaceBlocks:t}=(0,n.dispatch)(s.store),{savePost:r}=(0,n.dispatch)(l.store);e.forEach((e=>{t(e.clientId,(0,i.rawHandler)({HTML:(0,i.serialize)(e)}))})),r()}()}function k(){const{getBlocks:e}=(0,n.select)(s.store);return e()}(0,d.addFilter)("blocks.registerBlockType","llms/certificate-editor/columns-block",(function(e,t){return"core/columns"===t&&(e.variations=e.variations.map((e=>{const{attributes:t={}}=e;return e.attributes={...t,isStackedOnMobile:!1},e}))),e}));var C=window.wp.notices,x=window.wp.url;o()((()=>{if("1"!==(0,x.getQueryArg)(window.location.href,"newAwardMsg"))return;const{createSuccessNotice:e}=(0,n.dispatch)(C.store);e((0,f.__)("The certificate award has been created as a draft.","lifterlms"))}));var E=window.wp.compose,S=window.wp.editPost;function P(e,t){const{editPost:r}=(0,n.dispatch)(l.store),i={};i[`certificate_${e}`]=t,r(i)}function T(){let e=(0,s.useSetting)("color.palette");return e.length||(e=window.llms.certificates.colors),e.map((e=>{const{color:t}=e;return{...e,color:t.startsWith("#")?t.toLowerCase():t}}))}function A(e){let{background:t}=e;const[r,n]=(0,p.useState)(t);return(0,p.createElement)(h.BaseControl,{label:(0,f.__)("Background Color","lifterlms"),id:"llms-certificate-control--background-color"},(0,p.createElement)(h.ColorPalette,{colors:T(),onChange:e=>{n(e),P("background",e)},value:r,clearable:!1}))}var $=window.React;function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?F(K,--Y):0,X--,10===Z&&(X=1,V--),Z}function re(){return Z=Y2||oe(Z)>3?"":" "}function de(e,t){for(;--t&&re()&&!(Z<48||Z>102||Z>57&&Z<65||Z>70&&Z<97););return ae(e,ie()+(t<6&&32==ne()&&32==re()))}function fe(e){for(;re();)switch(Z){case e:return Y;case 34:case 39:34!==e&&39!==e&&fe(Z);break;case 40:41===e&&fe(e);break;case 92:re()}return Y}function me(e,t){for(;re()&&e+Z!==57&&(e+Z!==84||47!==ne()););return"/*"+ae(t,Y-1)+"*"+N(47===e?e:re())}function pe(e){for(;!oe(ne());)re();return ae(e,Y)}var he="-ms-",ge="-moz-",ye="-webkit-",be="comm",ve="rule",we="decl",_e="@keyframes";function ke(e,t){for(var r="",n=W(e),i=0;i6)switch(F(e,t+1)){case 109:if(45!==F(e,t+4))break;case 102:return U(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1"+ge+(108==F(e,t+3)?"$3":"$2-$3"))+e;case 115:return~j(e,"stretch")?xe(U(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==F(e,t+1))break;case 6444:switch(F(e,H(e)-3-(~j(e,"!important")&&10))){case 107:return U(e,":",":"+ye)+e;case 101:return U(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ye+(45===F(e,14)?"inline-":"")+"box$3$1"+ye+"$2$3$1"+he+"$2box$3")+e}break;case 5936:switch(F(e,t+11)){case 114:return ye+e+he+U(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ye+e+he+U(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ye+e+he+U(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ye+e+he+e+e}return e}function Ee(e){return se(Se("",null,null,null,[""],e=le(e),0,[0],e))}function Se(e,t,r,n,i,a,o,l,s){for(var c=0,u=0,d=o,f=0,m=0,p=0,h=1,g=1,y=1,b=0,v="",w=i,_=a,k=n,C=v;g;)switch(p=b,b=re()){case 40:if(108!=p&&58==C.charCodeAt(d-1)){-1!=j(C+=U(ce(b),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:C+=ce(b);break;case 9:case 10:case 13:case 32:C+=ue(p);break;case 92:C+=de(ie()-1,7);continue;case 47:switch(ne()){case 42:case 47:G(Te(me(re(),ie()),t,r),s);break;default:C+="/"}break;case 123*h:l[c++]=H(C)*y;case 125*h:case 59:case 0:switch(b){case 0:case 125:g=0;case 59+u:m>0&&H(C)-d&&G(m>32?Ae(C+";",n,r,d-1):Ae(U(C," ","")+";",n,r,d-2),s);break;case 59:C+=";";default:if(G(k=Pe(C,t,r,c,u,i,l,v,w=[],_=[],d),a),123===b)if(0===u)Se(C,t,k,k,w,a,d,l,_);else switch(f){case 100:case 109:case 115:Se(e,k,k,n&&G(Pe(e,k,k,0,0,i,l,v,i,w=[],d),_),i,_,d,l,n?w:_);break;default:Se(C,k,k,k,[""],_,0,l,_)}}c=u=m=0,h=y=1,v=C="",d=o;break;case 58:d=1+H(C),m=p;default:if(h<1)if(123==b)--h;else if(125==b&&0==h++&&125==te())continue;switch(C+=N(b),b*h){case 38:y=u>0?1:(C+="\f",-1);break;case 44:l[c++]=(H(C)-1)*y,y=1;break;case 64:45===ne()&&(C+=ce(re())),f=ne(),u=d=H(v=C+=pe(ie())),b++;break;case 45:45===p&&2==H(C)&&(h=0)}}return a}function Pe(e,t,r,n,i,a,o,l,s,c,u){for(var d=i-1,f=0===i?a:[""],m=W(f),p=0,h=0,g=0;p0?f[y]+" "+b:U(b,/&\f/g,f[y])))&&(s[g++]=v);return J(e,t,r,0===i?ve:l,s,c,u)}function Te(e,t,r){return J(e,t,r,be,N(Z),D(e,2,-2),0)}function Ae(e,t,r,n){return J(e,t,r,we,D(e,0,n),D(e,n+1,-1),n)}var $e=function(e,t,r){for(var n=0,i=0;n=i,i=ne(),38===n&&12===i&&(t[r]=1),!oe(i);)re();return ae(e,Y)},Ie=new WeakMap,Me=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Ie.get(r))&&!n){Ie.set(e,!0);for(var i=[],a=function(e,t){return se(function(e,t){var r=-1,n=44;do{switch(oe(n)){case 0:38===n&&12===ne()&&(t[r]=1),e[r]+=$e(Y-1,t,r);break;case 2:e[r]+=ce(n);break;case 4:if(44===n){e[++r]=58===ne()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=N(n)}}while(n=re());return e}(le(e),t))}(t,i),o=r.props,l=0,s=0;l-1&&!e.return)switch(e.type){case we:e.return=xe(e.value,e.length);break;case _e:return ke([ee(e,{value:U(e.value,"@","@"+ye)})],n);case ve:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return ke([ee(e,{props:[U(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return ke([ee(e,{props:[U(t,/:(plac\w+)/,":-webkit-input-$1")]}),ee(e,{props:[U(t,/:(plac\w+)/,":-moz-$1")]}),ee(e,{props:[U(t,/:(plac\w+)/,he+"input-$1")]})],n)}return""}))}}],Re=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var n,i,a=e.stylisPlugins||Oe,o={},l=[];n=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)},Ne={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Be=/[A-Z]|^ms/g,qe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ue=function(e){return 45===e.charCodeAt(1)},je=function(e){return null!=e&&"boolean"!=typeof e},Fe=M((function(e){return Ue(e)?e:e.replace(Be,"-$&").toLowerCase()})),De=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(qe,(function(e,t,r){return We={name:t,styles:r,next:We},t}))}return 1===Ne[e]||Ue(e)||"number"!=typeof t||0===t?t:t+"px"};function He(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return We={name:r.name,styles:r.styles,next:We},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)We={name:n.name,styles:n.styles,next:We},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i96?tt:rt},it=function(e,t,r){var n;if(t){var i=t.shouldForwardProp;n=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!=typeof n&&r&&(n=e.__emotion_forwardProp),n},at=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return et(t,r,n),Qe((function(){return function(e,t,r){et(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}(t,r,n)})),null},ot=function e(t,r){var n,i,a=t.__emotion_real===t,o=a&&t.__emotion_base||t;void 0!==r&&(n=r.label,i=r.target);var l=it(t,r,a),s=l||nt(o),c=!s("as");return function(){var u=arguments,d=a&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==n&&d.push("label:"+n+";"),null==u[0]||void 0===u[0].raw)d.push.apply(d,u);else{d.push(u[0][0]);for(var f=u.length,m=1;m{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.plugins,r=window.wp.coreData,n=window.wp.data,i=window.wp.blocks,a=window.wp.domReady;var o=e.n(a);const l=window.wp.editor,s=window.wp.blockEditor;let c=!1;function u(){const{getCurrentPostAttribute:e,getEditedPostAttribute:t,getCurrentPostType:a}=(0,n.select)(l.store),o=t("certificate_background"),u=t("certificate_margins"),d=t("certificate_width"),m=t("certificate_height"),f=t("certificate_unit"),p=t("certificate_orientation"),h=e("content"),g=t("content"),y=document.querySelector(".block-editor-block-list__layout.is-root-container");if(y){const e="portrait"===p?d:m,t="portrait"===p?m:d,i=u.map((e=>`${e}%`)).join(" ");y.style.backgroundImage=`url( '${function(){const e=function(){const{getEditedPostAttribute:e}=(0,n.select)(l.store),{getMedia:t}=(0,n.select)(r.store),i=e("featured_media");return i?t(i):{}}(),{default_image:t}=window.llms.certificates;if(void 0===e)return null;const{source_url:i}=e;return i||t}()}' )`,y.style.backgroundSize=`${e}${f} ${t}${f}`,y.style.backgroundRepeat="no-repeat",y.style.marginLeft="auto",y.style.marginRight="auto",y.style.padding=i,y.style.width=`${e}${f}`,y.style.minHeight=`${t}${f}`,y.style.boxSizing="border-box"}const b=document.querySelector(".editor-styles-wrapper");if(b&&(b.style.backgroundColor=o),"llms_my_certificate"===a()){!function(e,t){const{isSavingPost:r}=(0,n.select)(l.store),a=r();if(a)c=!0;else if(!a&&c){c=!1;const r=/(\{[A-Za-z_].*\})|(\[llms-user .+]|())/g,a=e.match(r),o=t.match(r);null==o||!o.length||null!=a&&a.length||function(e){const{replaceBlocks:t}=(0,n.dispatch)(s.store),{savePost:r}=(0,n.dispatch)(l.store),{getBlocks:a}=(0,n.select)(s.store);t(a().map((e=>{let{clientId:t}=e;return t})),(0,i.rawHandler)({HTML:e})),r()}(e)}}(h,g);const e=document.querySelector(".edit-post-visual-editor__post-title-wrapper");e&&(e.style.display=function(){const{getInserterItems:e}=(0,n.select)(s.store),{isDisabled:t}=e().find((e=>{let{name:t}=e;return"llms/certificate-title"===t}));return t}()?"none":"initial")}}o()((()=>{!function(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(".editor-styles-wrapper .wp-block { max-width: 100% !important; }")),e.appendChild(document.createTextNode(".editor-styles-wrapper [data-block], .wp-block { margin-top: 0 !important; margin-bottom: 0 !important }")),document.head.appendChild(e)}(),(0,n.subscribe)(u)}));const d=window.wp.hooks,m=window.wp.i18n,f=(0,n.subscribe)((()=>{const{getCurrentPostType:e}=(0,n.select)(l.store),t=e();var r;null!==t&&(r="llms_my_certificate"===t,f(),r&&(0,d.addFilter)("i18n.gettext_default","llms/certificates",(function(e){return"Move to trash"===e?(0,m.__)("Delete permanently","lifterlms"):e})))})),p=window.wp.element,h=window.wp.components,g=window.wp.richText,y=window.llms.components,b=window.llms.icons;function w(e){let{closeModal:t,onChange:r,value:n}=e;const{merge_codes:i}=window.llms.certificates;return Object.entries(i).map(((e,i)=>{let[a,o]=e;return(0,p.createElement)("tr",{key:i},(0,p.createElement)("td",{style:{textAlign:"left"}},o),(0,p.createElement)("td",null,(0,p.createElement)(y.CopyButton,{buttonText:a,copyText:a,onCopy:t,isLink:!0})),(0,p.createElement)("td",null,(0,p.createElement)(h.Button,{isSecondary:!0,isSmall:!0,onClick:()=>{t(),r((0,g.insert)(n,a))}},(0,m.__)("Insert","lifterlms"))))}))}(0,g.registerFormatType)("llms/certificate-merge-codes",{title:(0,m.__)("LifterLMS Certificate Merge Codes","lifterlms"),tagName:"span",className:"llms-cert-mc-wrap",edit:function(e){const[t,r]=(0,p.useState)(!1),n=()=>r(!1),{value:i,onChange:a}=e;return(0,p.createElement)(p.Fragment,null,(0,p.createElement)(s.RichTextToolbarButton,{icon:(0,p.createElement)(b.Icon,{icon:b.lifterlms}),title:(0,m.__)("Merge Codes","lifterlms"),onClick:()=>r(!0)}),t&&(0,p.createElement)(h.Modal,{className:"llms-certificate-merge-codes-modal",title:(0,m.__)("LifterLMS Certificate Merge Codes","lifterlms"),onRequestClose:n},(0,p.createElement)("div",{className:"llms-certificate-merge-codes-modal--main"},(0,p.createElement)("table",{className:"llms-table zebra",style:{width:"480px"}},(0,p.createElement)("thead",null,(0,p.createElement)("tr",null,(0,p.createElement)("th",{style:{textAlign:"left"}},(0,m.__)("Name","lifterlms")),(0,p.createElement)("th",null,(0,m.__)("Merge code","lifterlms")),(0,p.createElement)("th",null,(0,m.__)("Insert","lifterlms")))),(0,p.createElement)("tbody",null,(0,p.createElement)(w,{closeModal:n,onChange:a,value:i}))))))}});const v=(0,n.subscribe)((()=>{const e=new URLSearchParams(window.location.search);if(1!==parseInt(e.get("llms-migrate-legacy-certificate")))return _(!1);0!==k().length&&_(!0)}));function _(e){v(),e&&function(){const e=k().filter((e=>{let{name:t}=e;return"core/freeform"===t}));if(0===e.length)return;const{replaceBlocks:t}=(0,n.dispatch)(s.store),{savePost:r}=(0,n.dispatch)(l.store);e.forEach((e=>{t(e.clientId,(0,i.rawHandler)({HTML:(0,i.serialize)(e)}))})),r()}()}function k(){const{getBlocks:e}=(0,n.select)(s.store);return e()}(0,d.addFilter)("blocks.registerBlockType","llms/certificate-editor/columns-block",(function(e,t){return"core/columns"===t&&(e.variations=e.variations.map((e=>{const{attributes:t={}}=e;return e.attributes={...t,isStackedOnMobile:!1},e}))),e}));const C=window.wp.notices,x=window.wp.url;o()((()=>{if("1"!==(0,x.getQueryArg)(window.location.href,"newAwardMsg"))return;const{createSuccessNotice:e}=(0,n.dispatch)(C.store);e((0,m.__)("The certificate award has been created as a draft.","lifterlms"))}));const E=window.wp.compose,S=window.wp.editPost;function P(e,t){const{editPost:r}=(0,n.dispatch)(l.store),i={};i[`certificate_${e}`]=t,r(i)}function T(){let e=(0,s.useSetting)("color.palette");return e.length||(e=window.llms.certificates.colors),e.map((e=>{const{color:t}=e;return{...e,color:t.startsWith("#")?t.toLowerCase():t}}))}function A(e){let{background:t}=e;const[r,n]=(0,p.useState)(t);return(0,p.createElement)(h.BaseControl,{label:(0,m.__)("Background Color","lifterlms"),id:"llms-certificate-control--background-color"},(0,p.createElement)(h.ColorPalette,{colors:T(),onChange:e=>{n(e),P("background",e)},value:r,clearable:!1}))}const $=window.React;function I(){return I=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?F(K,--Y):0,X--,10===Z&&(X=1,V--),Z}function re(){return Z=Y2||oe(Z)>3?"":" "}function de(e,t){for(;--t&&re()&&!(Z<48||Z>102||Z>57&&Z<65||Z>70&&Z<97););return ae(e,ie()+(t<6&&32==ne()&&32==re()))}function me(e){for(;re();)switch(Z){case e:return Y;case 34:case 39:34!==e&&39!==e&&me(Z);break;case 40:41===e&&me(e);break;case 92:re()}return Y}function fe(e,t){for(;re()&&e+Z!==57&&(e+Z!==84||47!==ne()););return"/*"+ae(t,Y-1)+"*"+N(47===e?e:re())}function pe(e){for(;!oe(ne());)re();return ae(e,Y)}var he="-ms-",ge="-moz-",ye="-webkit-",be="comm",we="rule",ve="decl",_e="@keyframes";function ke(e,t){for(var r="",n=W(e),i=0;i6)switch(F(e,t+1)){case 109:if(45!==F(e,t+4))break;case 102:return U(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1"+ge+(108==F(e,t+3)?"$3":"$2-$3"))+e;case 115:return~j(e,"stretch")?xe(U(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==F(e,t+1))break;case 6444:switch(F(e,H(e)-3-(~j(e,"!important")&&10))){case 107:return U(e,":",":"+ye)+e;case 101:return U(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ye+(45===F(e,14)?"inline-":"")+"box$3$1"+ye+"$2$3$1"+he+"$2box$3")+e}break;case 5936:switch(F(e,t+11)){case 114:return ye+e+he+U(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ye+e+he+U(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ye+e+he+U(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ye+e+he+e+e}return e}function Ee(e){return se(Se("",null,null,null,[""],e=le(e),0,[0],e))}function Se(e,t,r,n,i,a,o,l,s){for(var c=0,u=0,d=o,m=0,f=0,p=0,h=1,g=1,y=1,b=0,w="",v=i,_=a,k=n,C=w;g;)switch(p=b,b=re()){case 40:if(108!=p&&58==C.charCodeAt(d-1)){-1!=j(C+=U(ce(b),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:C+=ce(b);break;case 9:case 10:case 13:case 32:C+=ue(p);break;case 92:C+=de(ie()-1,7);continue;case 47:switch(ne()){case 42:case 47:G(Te(fe(re(),ie()),t,r),s);break;default:C+="/"}break;case 123*h:l[c++]=H(C)*y;case 125*h:case 59:case 0:switch(b){case 0:case 125:g=0;case 59+u:f>0&&H(C)-d&&G(f>32?Ae(C+";",n,r,d-1):Ae(U(C," ","")+";",n,r,d-2),s);break;case 59:C+=";";default:if(G(k=Pe(C,t,r,c,u,i,l,w,v=[],_=[],d),a),123===b)if(0===u)Se(C,t,k,k,v,a,d,l,_);else switch(m){case 100:case 109:case 115:Se(e,k,k,n&&G(Pe(e,k,k,0,0,i,l,w,i,v=[],d),_),i,_,d,l,n?v:_);break;default:Se(C,k,k,k,[""],_,0,l,_)}}c=u=f=0,h=y=1,w=C="",d=o;break;case 58:d=1+H(C),f=p;default:if(h<1)if(123==b)--h;else if(125==b&&0==h++&&125==te())continue;switch(C+=N(b),b*h){case 38:y=u>0?1:(C+="\f",-1);break;case 44:l[c++]=(H(C)-1)*y,y=1;break;case 64:45===ne()&&(C+=ce(re())),m=ne(),u=d=H(w=C+=pe(ie())),b++;break;case 45:45===p&&2==H(C)&&(h=0)}}return a}function Pe(e,t,r,n,i,a,o,l,s,c,u){for(var d=i-1,m=0===i?a:[""],f=W(m),p=0,h=0,g=0;p0?m[y]+" "+b:U(b,/&\f/g,m[y])))&&(s[g++]=w);return J(e,t,r,0===i?we:l,s,c,u)}function Te(e,t,r){return J(e,t,r,be,N(Z),D(e,2,-2),0)}function Ae(e,t,r,n){return J(e,t,r,ve,D(e,0,n),D(e,n+1,-1),n)}var $e=function(e,t,r){for(var n=0,i=0;n=i,i=ne(),38===n&&12===i&&(t[r]=1),!oe(i);)re();return ae(e,Y)},Ie=new WeakMap,Me=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Ie.get(r))&&!n){Ie.set(e,!0);for(var i=[],a=function(e,t){return se(function(e,t){var r=-1,n=44;do{switch(oe(n)){case 0:38===n&&12===ne()&&(t[r]=1),e[r]+=$e(Y-1,t,r);break;case 2:e[r]+=ce(n);break;case 4:if(44===n){e[++r]=58===ne()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=N(n)}}while(n=re());return e}(le(e),t))}(t,i),o=r.props,l=0,s=0;l-1&&!e.return)switch(e.type){case ve:e.return=xe(e.value,e.length);break;case _e:return ke([ee(e,{value:U(e.value,"@","@"+ye)})],n);case we:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return ke([ee(e,{props:[U(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return ke([ee(e,{props:[U(t,/:(plac\w+)/,":-webkit-input-$1")]}),ee(e,{props:[U(t,/:(plac\w+)/,":-moz-$1")]}),ee(e,{props:[U(t,/:(plac\w+)/,he+"input-$1")]})],n)}return""}))}}];const Re=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var n,i,a=e.stylisPlugins||Oe,o={},l=[];n=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)},Ne={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var Be=/[A-Z]|^ms/g,qe=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ue=function(e){return 45===e.charCodeAt(1)},je=function(e){return null!=e&&"boolean"!=typeof e},Fe=M((function(e){return Ue(e)?e:e.replace(Be,"-$&").toLowerCase()})),De=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(qe,(function(e,t,r){return We={name:t,styles:r,next:We},t}))}return 1===Ne[e]||Ue(e)||"number"!=typeof t||0===t?t:t+"px"};function He(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return We={name:r.name,styles:r.styles,next:We},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)We={name:n.name,styles:n.styles,next:We},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i96?tt:rt},it=function(e,t,r){var n;if(t){var i=t.shouldForwardProp;n=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!=typeof n&&r&&(n=e.__emotion_forwardProp),n},at=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return et(t,r,n),Qe((function(){return function(e,t,r){et(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}(t,r,n)})),null};var ot=function e(t,r){var n,i,a=t.__emotion_real===t,o=a&&t.__emotion_base||t;void 0!==r&&(n=r.label,i=r.target);var l=it(t,r,a),s=l||nt(o),c=!s("as");return function(){var u=arguments,d=a&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==n&&d.push("label:"+n+";"),null==u[0]||void 0===u[0].raw)d.push.apply(d,u);else{d.push(u[0][0]);for(var m=u.length,f=1;f{n(e,r,a)}}),(0,p.createElement)("em",{style:{display:"block",marginLeft:"4px",marginTop:"-8px"}},function(e){return[(0,f.__)("Top","lifterlms"),(0,f.__)("Right","lifterlms"),(0,f.__)("Bottom","lifterlms"),(0,f.__)("Left","lifterlms")][e]}(r)))}function ut(e){let{margins:t}=e;const r=(e,r,n)=>{const i=[...t];i[r]=e,n(e),P("margins",i)};return(0,p.createElement)(h.BaseControl,{label:(0,f.__)("Inner Margins","lifterlms"),id:"llms-certificate-margins-control"},(0,p.createElement)("div",{style:{display:"flex"}},t.map(((e,t)=>(0,p.createElement)(ct,{key:t,margin:e,index:t,editMargins:r})))))}function dt(e){let{orientation:t}=e;const{orientations:r}=window.llms.certificates,n=Object.entries(r).map((e=>{let[t,r]=e;return{value:t,label:r}}));return(0,p.createElement)(y.ButtonGroupControl,{id:"llms-certificate-orientation-control",label:(0,f.__)("Orientation","lifterlms"),selected:t,options:n,onClick:e=>P("orientation",e)})}function ft(e){let{sequentialId:t}=e;const[r,n]=(0,p.useState)(t);let{minSequentialId:i}=window.llms.certificates;return i||(i=t,window.llms.certificates.minSequentialId=i),(0,p.createElement)(h.TextControl,{id:"llms-certificate-title-control",label:(0,f.__)("Next Sequential ID","lifterlms"),value:r,type:"number",step:"1",min:i,onChange:e=>{n(e),P("sequential_id",e)},help:(0,f.__)("Used for the {sequential_id} merge code when generating a certificate from this template.","lifterlms")})}function mt(e){let{name:t,width:r,height:n,unit:i}=e;const{units:a}=window.llms.certificates,{symbol:o}=a[i]||{};return(0,f.sprintf)("%1$s (%2$s%4$s x %3$s%4$s)",t,r,n,o)}function pt(e){let{width:t,height:r,unit:n}=e;const[i,a]=(0,p.useState)(t),[o,l]=(0,p.useState)(r),[s,c]=(0,p.useState)(n);return(0,p.createElement)("div",{style:{display:"flex"}},(0,p.createElement)("div",{style:{flex:1}},(0,p.createElement)(h.TextControl,{id:"llms-certificate-control--size--custom-width",label:(0,f.__)("Custom Size Width","lifterlms"),placeholder:(0,f.__)("Width","lifterlms"),type:"number",value:i,hideLabelFromVision:!0,onChange:e=>{a(e),P("width",e)}})),(0,p.createElement)("div",{style:{flex:1}},(0,p.createElement)(h.TextControl,{id:"llms-certificate-control--size--custom-height",label:(0,f.__)("Custom Size Height","lifterlms"),placeholder:(0,f.__)("Height","lifterlms"),type:"number",value:o,hideLabelFromVision:!0,onChange:e=>{l(e),P("height",e)}})),(0,p.createElement)("div",{style:{flex:2}},(0,p.createElement)(h.SelectControl,{id:"llms-certificate-control--size--custom-unit",label:(0,f.__)("Custom Size Dimension","lifterlms"),hideLabelFromVision:!0,value:s,onChange:e=>{c(e),P("unit",e)},options:[{value:"in",label:(0,f.__)("in (Inches)","lifterlms")},{value:"mm",label:(0,f.__)("mm (Millimeters)","lifterlms")}]})))}function ht(e){let{size:t,width:r,height:n,unit:i}=e;const{sizes:a}=window.llms.certificates,o=Object.entries(a).map((e=>{let[t,r]=e;return{value:t,label:mt(r)}})),[l,s]=(0,p.useState)(t);return o.push({value:"CUSTOM",label:(0,f._x)("Custom","certificate sizing option","lifterlms")}),(0,p.createElement)(p.Fragment,null,(0,p.createElement)(h.SelectControl,{id:"llms-certificate-control--size",label:(0,f.__)("Size","lifterlms"),value:l,options:o,onChange:e=>{if(s(e),P("size",e),"CUSTOM"!==e){const t=a[e];P("unit",t.unit),P("width",t.width),P("height",t.height)}}}),"CUSTOM"===l&&(0,p.createElement)(pt,{editCertificate:P,width:r,height:n,unit:i}))}function gt(e){let{children:t}=e;const{getCurrentPostType:r}=(0,n.useSelect)(l.store),{getInserterItems:i}=(0,n.useSelect)(s.store);if("llms_certificate"!==r())return null;const{isDisabled:a}=i().find((e=>{let{name:t}=e;return"llms/certificate-title"===t}));return a?null:t}function yt(e){let{title:t}=e;return(0,p.createElement)(h.TextControl,{id:"llms-certificate-title-control",label:(0,f.__)("Title","lifterlms"),value:t,onChange:e=>P("title",e),help:(0,f.__)("Used as the title for certificates generated from this template.","lifterlms")})}const bt=(0,n.withSelect)((e=>{const{getEditedPostAttribute:t}=e(l.store);return{type:t("type"),title:t("certificate_title"),sequentialId:t("certificate_sequential_id"),background:t("certificate_background"),height:t("certificate_height"),margins:t("certificate_margins"),orientation:t("certificate_orientation"),size:t("certificate_size"),unit:t("certificate_unit"),width:t("certificate_width")}}));var vt=(0,E.compose)([bt])((function(e){let{type:t,title:r,sequentialId:n,background:i,height:a,margins:o,orientation:l,size:s,unit:c,width:u}=e;return(0,p.createElement)(S.PluginDocumentSettingPanel,{className:"llms-certificate-doc-settings",name:"llms-certificate-doc-settings",title:(0,f.__)("Settings","lifterlms"),opened:!0},(0,p.createElement)(gt,null,(0,p.createElement)(yt,{title:r}),(0,p.createElement)("br",null)),(0,p.createElement)(ht,{size:s,width:u,height:a,unit:c}),(0,p.createElement)("br",null),(0,p.createElement)(dt,{orientation:l}),(0,p.createElement)("br",null),(0,p.createElement)(ut,{margins:o,unit:c}),(0,p.createElement)("br",null),(0,p.createElement)(A,{background:i}),"llms_certificate"===t&&(0,p.createElement)(p.Fragment,null,(0,p.createElement)("br",null),(0,p.createElement)(ft,{sequentialId:n})))}));function wt(e){let{postType:t,children:r}=e;return t&&"llms_certificate"===t?r:null}var _t=window.llms.utils;function kt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t={post_type:"llms_my_certificate"};return e&&(t.sid=e),(0,x.addQueryArgs)(`${(0,_t.getAdminUrl)()}/post-new.php`,t)}function Ct(e){let{modalTitle:t=(0,f.__)("Award a New Certificate","lifterlms"),buttonLabel:i=(0,f.__)("Award","lifterlms"),isDisabled:a=!1,enableScratch:o=!0,selectStudent:l=!0,selectTemplate:s=!0,studentId:c=null,templateId:u=null}=e;const[d,m]=(0,p.useState)(!1),[g,b]=(0,p.useState)(!1),[v,w]=(0,p.useState)(c),[_,k]=(0,p.useState)(u),C=()=>m(!1),E=v&&_;return(0,p.createElement)(p.Fragment,null,d&&(0,p.createElement)(h.Modal,{title:t,style:{maxWidth:"420px"},onRequestClose:C},(0,p.createElement)("p",null,function(e,t){let r="";return e&&t?r=(0,f.__)("Create a new certificate award from the selected template for the selected student.","lifterlms"):e&&!t?r=(0,f.__)("Create a new certificate award from this template for the selected student.","lifterlms"):!e&&t&&(r=(0,f.__)("Create a new certificate award from the selected template for this student.","lifterlms")),r}(l,s)),l&&(0,p.createElement)(y.UserSearchControl,{isClearable:!0,label:(0,f.__)("Award to","lifterlms"),selectedValue:c?[c]:[],onUpdate:e=>{const t=(null==e?void 0:e.id)||null;w(t)}}),s&&(0,p.createElement)(y.PostSearchControl,{isClearable:!0,postType:"llms_certificate",label:(0,f.__)("Template","lifterlms"),placeholder:(0,f.__)("Search for a certificate template…","lifterlms"),selectedValue:u?[u]:[],onUpdate:e=>{const t=(null==e?void 0:e.id)||null;k(t)}}),(0,p.createElement)("div",{style:{textAlign:"right",padding:"24px 32px 0",margin:"24px -32px 0",borderTop:"1px solid #ddd"}},(0,p.createElement)(h.Button,{style:{marginRight:"5px"},disabled:!E,isBusy:g,variant:"primary",onClick:()=>{b(!0),function(e,t){const{saveEntityRecord:i}=(0,n.dispatch)(r.store);return i("postType","llms_my_certificate",{author:e,certificate_template:t,status:"draft"})}(v,_).then((e=>{let{id:t}=e;var r;window.location=(r=t,(0,x.addQueryArgs)(`${(0,_t.getAdminUrl)()}/post.php`,{post:r,action:"edit",newAwardMsg:1}))}))}},(0,f.__)("Create Draft")),o&&(0,p.createElement)(h.Button,{style:{marginRight:"5px"},variant:"secondary",href:kt(v)},(0,f.__)("Start from Scratch","lifterlms")),(0,p.createElement)(h.Button,{variant:"tertiary",onClick:C},(0,f.__)("Cancel","lifterlms")))),(0,p.createElement)(h.Button,{disabled:a,variant:"secondary",onClick:()=>m(!0)},i))}function xt(e){let{postId:t,postType:r,isSaving:n,isPublished:i}=e;return(0,p.createElement)(wt,{postType:r},(0,p.createElement)(Ct,{enableScratch:!1,selectTemplate:!1,templateId:t,isDisabled:n||!i}))}function Et(e){let{children:t}=e;const{getCurrentPost:r}=(0,n.useSelect)(l.store),i=r(),{type:a,certificate_template:o}=i;return a&&("llms_certificate"===a||"llms_my_certificate"===a&&0===o)?t:null}function St(e){let{isSaving:t,isPublished:r}=e;const[a,o]=(0,p.useState)(!1),c=()=>o(!1);let u=(0,f.__)("Are you sure you wish to replace the certificate content with the original default layout? This action cannot be undone!","lifterlms");return r&&(u=(0,f.__)("Are you sure you wish to unpublish the certificate and replace it's content with the original default layout? This action cannot be undone!","lifterlms")),(0,p.createElement)(Et,null,a&&(0,p.createElement)(h.Modal,{title:(0,f.__)("Confirm template reset","lifterlms"),style:{maxWidth:"360px"},onRequestClose:c},(0,p.createElement)("p",null,u),(0,p.createElement)("div",{style:{textAlign:"right"}},(0,p.createElement)(h.Button,{variant:"tertiary",onClick:c},(0,f.__)("Cancel","lifterlms"))," ",(0,p.createElement)(h.Button,{variant:"primary",onClick:()=>function(e,t){const{getBlocks:r,getTemplate:a}=(0,n.select)(s.store),{replaceBlocks:o,insertBlocks:c}=(0,n.dispatch)(s.store),{editPost:u,savePost:f}=(0,n.dispatch)(l.store),m=r().map((e=>{let{clientId:t}=e;return t})),p=(0,i.synchronizeBlocksWithTemplate)([],a());!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t){const{getCurrentPostType:e}=(0,n.select)(l.store);t=e()}const{editPost:r}=(0,n.dispatch)(l.store),i={};"llms_certificate"===t?i.certificate_title=e:"llms_my_certificate"===t&&(i.title=e),r(i)}(""),t&&u({status:"draft"}),(0,d.doAction)("llms.resetCertificateTemplate.before",p),m.length?o(m,p):c(p),(0,d.doAction)("llms.resetCertificateTemplate.after",p),f(),e()}(c,r)},(0,f.__)("Reset template","lifterlms")))),(0,p.createElement)(h.Button,{onClick:()=>o(!0),disabled:t,isDestructive:!0},(0,f.__)("Reset template","lifterlms")))}var Pt=(0,E.compose)([(0,n.withSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:r,getCurrentPostId:n,getCurrentPostType:i}=e(l.store);return{isPublished:r(),isSaving:t(),postId:n(),postType:i()}}))])((function(e){let{isPublished:t,isSaving:r,postId:n,postType:i}=e;return(0,p.createElement)(S.PluginPostStatusInfo,null,(0,p.createElement)("div",null,(0,p.createElement)(xt,{postId:n,postType:i,isPublished:t,isSaving:r})," ",(0,p.createElement)(St,{isPublished:t,isSaving:r,postType:i})))}));const Tt=lt(h.PanelRow)` +`;function ct(e){let{margin:t,index:r,editMargins:n}=e;const[i,a]=(0,p.useState)(t),o=["top","right","bottom","left"][r];return(0,p.createElement)("div",{style:{flex:1}},(0,p.createElement)(st,{id:`llms-certificate-control--margin--${o}`,value:i,type:"number",onChange:e=>{n(e,r,a)}}),(0,p.createElement)("em",{style:{display:"block",marginLeft:"4px",marginTop:"-8px"}},function(e){return[(0,m.__)("Top","lifterlms"),(0,m.__)("Right","lifterlms"),(0,m.__)("Bottom","lifterlms"),(0,m.__)("Left","lifterlms")][e]}(r)))}function ut(e){let{margins:t}=e;const r=(e,r,n)=>{const i=[...t];i[r]=e,n(e),P("margins",i)};return(0,p.createElement)(h.BaseControl,{label:(0,m.__)("Inner Margins","lifterlms"),id:"llms-certificate-margins-control"},(0,p.createElement)("div",{style:{display:"flex"}},t.map(((e,t)=>(0,p.createElement)(ct,{key:t,margin:e,index:t,editMargins:r})))))}function dt(e){let{orientation:t}=e;const{orientations:r}=window.llms.certificates,n=Object.entries(r).map((e=>{let[t,r]=e;return{value:t,label:r}}));return(0,p.createElement)(y.ButtonGroupControl,{id:"llms-certificate-orientation-control",label:(0,m.__)("Orientation","lifterlms"),selected:t,options:n,onClick:e=>P("orientation",e)})}function mt(e){let{sequentialId:t}=e;const[r,n]=(0,p.useState)(t);let{minSequentialId:i}=window.llms.certificates;return i||(i=t,window.llms.certificates.minSequentialId=i),(0,p.createElement)(h.TextControl,{id:"llms-certificate-title-control",label:(0,m.__)("Next Sequential ID","lifterlms"),value:r,type:"number",step:"1",min:i,onChange:e=>{n(e),P("sequential_id",e)},help:(0,m.__)("Used for the {sequential_id} merge code when generating a certificate from this template.","lifterlms")})}function ft(e){let{name:t,width:r,height:n,unit:i}=e;const{units:a}=window.llms.certificates,{symbol:o}=a[i]||{};return(0,m.sprintf)("%1$s (%2$s%4$s x %3$s%4$s)",t,r,n,o)}function pt(e){let{width:t,height:r,unit:n}=e;const[i,a]=(0,p.useState)(t),[o,l]=(0,p.useState)(r),[s,c]=(0,p.useState)(n);return(0,p.createElement)("div",{style:{display:"flex"}},(0,p.createElement)("div",{style:{flex:1}},(0,p.createElement)(h.TextControl,{id:"llms-certificate-control--size--custom-width",label:(0,m.__)("Custom Size Width","lifterlms"),placeholder:(0,m.__)("Width","lifterlms"),type:"number",value:i,hideLabelFromVision:!0,onChange:e=>{a(e),P("width",e)}})),(0,p.createElement)("div",{style:{flex:1}},(0,p.createElement)(h.TextControl,{id:"llms-certificate-control--size--custom-height",label:(0,m.__)("Custom Size Height","lifterlms"),placeholder:(0,m.__)("Height","lifterlms"),type:"number",value:o,hideLabelFromVision:!0,onChange:e=>{l(e),P("height",e)}})),(0,p.createElement)("div",{style:{flex:2}},(0,p.createElement)(h.SelectControl,{id:"llms-certificate-control--size--custom-unit",label:(0,m.__)("Custom Size Dimension","lifterlms"),hideLabelFromVision:!0,value:s,onChange:e=>{c(e),P("unit",e)},options:[{value:"in",label:(0,m.__)("in (Inches)","lifterlms")},{value:"mm",label:(0,m.__)("mm (Millimeters)","lifterlms")}]})))}function ht(e){let{size:t,width:r,height:n,unit:i}=e;const{sizes:a}=window.llms.certificates,o=Object.entries(a).map((e=>{let[t,r]=e;return{value:t,label:ft(r)}})),[l,s]=(0,p.useState)(t);return o.push({value:"CUSTOM",label:(0,m._x)("Custom","certificate sizing option","lifterlms")}),(0,p.createElement)(p.Fragment,null,(0,p.createElement)(h.SelectControl,{id:"llms-certificate-control--size",label:(0,m.__)("Size","lifterlms"),value:l,options:o,onChange:e=>{if(s(e),P("size",e),"CUSTOM"!==e){const t=a[e];P("unit",t.unit),P("width",t.width),P("height",t.height)}}}),"CUSTOM"===l&&(0,p.createElement)(pt,{editCertificate:P,width:r,height:n,unit:i}))}function gt(e){let{children:t}=e;const{getCurrentPostType:r}=(0,n.useSelect)(l.store),{getInserterItems:i}=(0,n.useSelect)(s.store);if("llms_certificate"!==r())return null;const{isDisabled:a}=i().find((e=>{let{name:t}=e;return"llms/certificate-title"===t}));return a?null:t}function yt(e){let{title:t}=e;return(0,p.createElement)(h.TextControl,{id:"llms-certificate-title-control",label:(0,m.__)("Title","lifterlms"),value:t,onChange:e=>P("title",e),help:(0,m.__)("Used as the title for certificates generated from this template.","lifterlms")})}const bt=(0,n.withSelect)((e=>{const{getEditedPostAttribute:t}=e(l.store);return{type:t("type"),title:t("certificate_title"),sequentialId:t("certificate_sequential_id"),background:t("certificate_background"),height:t("certificate_height"),margins:t("certificate_margins"),orientation:t("certificate_orientation"),size:t("certificate_size"),unit:t("certificate_unit"),width:t("certificate_width")}})),wt=(0,E.compose)([bt])((function(e){let{type:t,title:r,sequentialId:n,background:i,height:a,margins:o,orientation:l,size:s,unit:c,width:u}=e;return(0,p.createElement)(S.PluginDocumentSettingPanel,{className:"llms-certificate-doc-settings",name:"llms-certificate-doc-settings",title:(0,m.__)("Settings","lifterlms"),opened:!0},(0,p.createElement)(gt,null,(0,p.createElement)(yt,{title:r}),(0,p.createElement)("br",null)),(0,p.createElement)(ht,{size:s,width:u,height:a,unit:c}),(0,p.createElement)("br",null),(0,p.createElement)(dt,{orientation:l}),(0,p.createElement)("br",null),(0,p.createElement)(ut,{margins:o,unit:c}),(0,p.createElement)("br",null),(0,p.createElement)(A,{background:i}),"llms_certificate"===t&&(0,p.createElement)(p.Fragment,null,(0,p.createElement)("br",null),(0,p.createElement)(mt,{sequentialId:n})))}));function vt(e){let{postType:t,children:r}=e;return t&&"llms_certificate"===t?r:null}const _t=window.llms.utils;function kt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t={post_type:"llms_my_certificate"};return e&&(t.sid=e),(0,x.addQueryArgs)(`${(0,_t.getAdminUrl)()}/post-new.php`,t)}function Ct(e){let{modalTitle:t=(0,m.__)("Award a New Certificate","lifterlms"),buttonLabel:i=(0,m.__)("Award","lifterlms"),isDisabled:a=!1,enableScratch:o=!0,selectStudent:l=!0,selectTemplate:s=!0,studentId:c=null,templateId:u=null}=e;const[d,f]=(0,p.useState)(!1),[g,b]=(0,p.useState)(!1),[w,v]=(0,p.useState)(c),[_,k]=(0,p.useState)(u),C=()=>f(!1),E=w&&_;return(0,p.createElement)(p.Fragment,null,d&&(0,p.createElement)(h.Modal,{title:t,style:{maxWidth:"420px"},onRequestClose:C},(0,p.createElement)("p",null,function(e,t){let r="";return e&&t?r=(0,m.__)("Create a new certificate award from the selected template for the selected student.","lifterlms"):e&&!t?r=(0,m.__)("Create a new certificate award from this template for the selected student.","lifterlms"):!e&&t&&(r=(0,m.__)("Create a new certificate award from the selected template for this student.","lifterlms")),r}(l,s)),l&&(0,p.createElement)(y.UserSearchControl,{isClearable:!0,label:(0,m.__)("Award to","lifterlms"),selectedValue:c?[c]:[],onUpdate:e=>{const t=(null==e?void 0:e.id)||null;v(t)}}),s&&(0,p.createElement)(y.PostSearchControl,{isClearable:!0,postType:"llms_certificate",label:(0,m.__)("Template","lifterlms"),placeholder:(0,m.__)("Search for a certificate template…","lifterlms"),selectedValue:u?[u]:[],onUpdate:e=>{const t=(null==e?void 0:e.id)||null;k(t)}}),(0,p.createElement)("div",{style:{textAlign:"right",padding:"24px 32px 0",margin:"24px -32px 0",borderTop:"1px solid #ddd"}},(0,p.createElement)(h.Button,{style:{marginRight:"5px"},disabled:!E,isBusy:g,variant:"primary",onClick:()=>{b(!0),function(e,t){const{saveEntityRecord:i}=(0,n.dispatch)(r.store);return i("postType","llms_my_certificate",{author:e,certificate_template:t,status:"draft"})}(w,_).then((e=>{let{id:t}=e;var r;window.location=(r=t,(0,x.addQueryArgs)(`${(0,_t.getAdminUrl)()}/post.php`,{post:r,action:"edit",newAwardMsg:1}))}))}},(0,m.__)("Create Draft")),o&&(0,p.createElement)(h.Button,{style:{marginRight:"5px"},variant:"secondary",href:kt(w)},(0,m.__)("Start from Scratch","lifterlms")),(0,p.createElement)(h.Button,{variant:"tertiary",onClick:C},(0,m.__)("Cancel","lifterlms")))),(0,p.createElement)(h.Button,{disabled:a,variant:"secondary",onClick:()=>f(!0)},i))}function xt(e){let{postId:t,postType:r,isSaving:n,isPublished:i}=e;return(0,p.createElement)(vt,{postType:r},(0,p.createElement)(Ct,{enableScratch:!1,selectTemplate:!1,templateId:t,isDisabled:n||!i}))}function Et(e){let{children:t}=e;const{getCurrentPost:r}=(0,n.useSelect)(l.store),i=r(),{type:a,certificate_template:o}=i;return a&&("llms_certificate"===a||"llms_my_certificate"===a&&0===o)?t:null}function St(e){let{isSaving:t,isPublished:r}=e;const[a,o]=(0,p.useState)(!1),c=()=>o(!1);let u=(0,m.__)("Are you sure you wish to replace the certificate content with the original default layout? This action cannot be undone!","lifterlms");return r&&(u=(0,m.__)("Are you sure you wish to unpublish the certificate and replace it's content with the original default layout? This action cannot be undone!","lifterlms")),(0,p.createElement)(Et,null,a&&(0,p.createElement)(h.Modal,{title:(0,m.__)("Confirm template reset","lifterlms"),style:{maxWidth:"360px"},onRequestClose:c},(0,p.createElement)("p",null,u),(0,p.createElement)("div",{style:{textAlign:"right"}},(0,p.createElement)(h.Button,{variant:"tertiary",onClick:c},(0,m.__)("Cancel","lifterlms"))," ",(0,p.createElement)(h.Button,{variant:"primary",onClick:()=>function(e,t){const{getBlocks:r,getTemplate:a}=(0,n.select)(s.store),{replaceBlocks:o,insertBlocks:c}=(0,n.dispatch)(s.store),{editPost:u,savePost:m}=(0,n.dispatch)(l.store),f=r().map((e=>{let{clientId:t}=e;return t})),p=(0,i.synchronizeBlocksWithTemplate)([],a());!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t){const{getCurrentPostType:e}=(0,n.select)(l.store);t=e()}const{editPost:r}=(0,n.dispatch)(l.store),i={};"llms_certificate"===t?i.certificate_title=e:"llms_my_certificate"===t&&(i.title=e),r(i)}(""),t&&u({status:"draft"}),(0,d.doAction)("llms.resetCertificateTemplate.before",p),f.length?o(f,p):c(p),(0,d.doAction)("llms.resetCertificateTemplate.after",p),m(),e()}(c,r)},(0,m.__)("Reset template","lifterlms")))),(0,p.createElement)(h.Button,{onClick:()=>o(!0),disabled:t,isDestructive:!0},(0,m.__)("Reset template","lifterlms")))}const Pt=(0,E.compose)([(0,n.withSelect)((e=>{const{isSavingPost:t,isCurrentPostPublished:r,getCurrentPostId:n,getCurrentPostType:i}=e(l.store);return{isPublished:r(),isSaving:t(),postId:n(),postType:i()}}))])((function(e){let{isPublished:t,isSaving:r,postId:n,postType:i}=e;return(0,p.createElement)(S.PluginPostStatusInfo,null,(0,p.createElement)("div",null,(0,p.createElement)(xt,{postId:n,postType:i,isPublished:t,isSaving:r})," ",(0,p.createElement)(St,{isPublished:t,isSaving:r,postType:i})))})),Tt=lt(h.PanelRow)` width: 100%; -`;function At(e){let{userId:t}=e;const i=(0,n.useSelect)((e=>{const{getEntityRecord:n}=e(r.store),i=n("root","user",t);return null==i?void 0:i.name}),[t]);return i?(0,p.createElement)(h.ExternalLink,{href:(0,x.addQueryArgs)("admin.php",{page:"llms-reporting",tab:"students",stab:"certificates",student_id:t})},i):(0,p.createElement)("span",null,(0,f.__)("Loading…","lifterlms"))}const $t=(0,n.withSelect)((e=>{const{getEditedPostAttribute:t,isEditedPostNew:r}=e(l.store);return{isNew:r(),type:t("type"),userId:t("author")}}));var It=(0,E.compose)([$t])((function(e){let{type:t,userId:r,isNew:i}=e;if("llms_my_certificate"!==t)return null;const a=(0,x.getQueryArg)(window.location.href,"sid");return r=a||r,(0,p.createElement)(S.PluginPostStatusInfo,null,(0,p.createElement)(Tt,null,(0,p.createElement)("span",{style:{display:"block",width:"45%"}},(0,f.__)("Student","lifterlms")),(!i||a)&&(0,p.createElement)(At,{userId:r}),i&&!a&&(0,p.createElement)(y.UserSearchControl,{selectedValue:r,onUpdate:e=>{let{id:t}=e;const{editPost:r}=(0,n.dispatch)(l.store);r({author:t})}})))}));(0,t.registerPlugin)("llms-certificate-doc-settings",{render:vt,icon:""}),(0,t.registerPlugin)("llms-certificate-user",{render:It}),(0,t.registerPlugin)("llms-certificate-post-status-info",{render:Pt})}(); \ No newline at end of file +`;function At(e){let{userId:t}=e;const i=(0,n.useSelect)((e=>{const{getEntityRecord:n}=e(r.store),i=n("root","user",t);return null==i?void 0:i.name}),[t]);return i?(0,p.createElement)(h.ExternalLink,{href:(0,x.addQueryArgs)("admin.php",{page:"llms-reporting",tab:"students",stab:"certificates",student_id:t})},i):(0,p.createElement)("span",null,(0,m.__)("Loading…","lifterlms"))}const $t=(0,n.withSelect)((e=>{const{getEditedPostAttribute:t,isEditedPostNew:r}=e(l.store);return{isNew:r(),type:t("type"),userId:t("author")}})),It=(0,E.compose)([$t])((function(e){let{type:t,userId:r,isNew:i}=e;if("llms_my_certificate"!==t)return null;const a=(0,x.getQueryArg)(window.location.href,"sid");return r=a||r,(0,p.createElement)(S.PluginPostStatusInfo,null,(0,p.createElement)(Tt,null,(0,p.createElement)("span",{style:{display:"block",width:"45%"}},(0,m.__)("Student","lifterlms")),(!i||a)&&(0,p.createElement)(At,{userId:r}),i&&!a&&(0,p.createElement)(y.UserSearchControl,{selectedValue:r,onUpdate:e=>{let{id:t}=e;const{editPost:r}=(0,n.dispatch)(l.store);r({author:t})}})))}));(0,t.registerPlugin)("llms-certificate-doc-settings",{render:wt,icon:""}),(0,t.registerPlugin)("llms-certificate-user",{render:It}),(0,t.registerPlugin)("llms-certificate-post-status-info",{render:Pt})})(); \ No newline at end of file diff --git a/assets/js/llms-components.asset.php b/assets/js/llms-components.asset.php index 25b964e4d8..9348cda78f 100644 --- a/assets/js/llms-components.asset.php +++ b/assets/js/llms-components.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '49c9ba89c39f92930703'); + array('lodash', 'react', 'react-dom', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '464fe9fba4695f2489fc'); diff --git a/assets/js/llms-components.js b/assets/js/llms-components.js index 299346b031..39bec16eec 100644 --- a/assets/js/llms-components.js +++ b/assets/js/llms-components.js @@ -1,4 +1,4 @@ -!function(){"use strict";var e={679:function(e,t,n){var r=n(296),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=Object.defineProperty,c=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var o=f(n);o&&o!==m&&e(t,o,r)}var a=c(n);p&&(a=a.concat(p(n)));for(var s=l(t),h=l(n),v=0;v{}),className:i=null,id:a=null,selected:s="",options:l=[]}=e;const[u,c]=(0,r.useState)(s);return i=i?` ${i}`:"",(0,r.createElement)(o.BaseControl,{label:t,className:`llms-button-group-control${i}`,id:a},(0,r.createElement)(o.ButtonGroup,{style:{display:"flex"}},l.map((e=>{let{label:t,value:i,icon:a=null}=e;return(0,r.createElement)(o.Button,{style:{padding:"6px 8px"},key:i,isPrimary:i===u,isSecondary:i!==u,icon:a,onClick:()=>{c(i),n(i)}},t)}))))}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const e=(0,l.useCopyToClipboard)(n,i);return(0,r.createElement)(o.Button,a({},c,{ref:e}),t)}),null),!p&&(0,r.createElement)((()=>(0,r.createElement)(o.ClipboardButton,a({},c,{text:n,onCopy:i}),t)),null))}var c=window.React,p=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?b(M,--P):0,C--,10===E&&(C=1,x--),E}function A(){return E=P2||F(E)>3?"":" "}function $(e,t){for(;--t&&A()&&!(E<48||E>102||E>57&&E<65||E>70&&E<97););return D(e,L()+(t<6&&32==T()&&32==A()))}function U(e){for(;A();)switch(E){case e:return P;case 34:case 39:34!==e&&39!==e&&U(E);break;case 40:41===e&&U(e);break;case 92:A()}return P}function z(e,t){for(;A()&&e+E!==57&&(e+E!==84||47!==T()););return"/*"+D(t,P-1)+"*"+f(47===e?e:A())}function B(e){for(;!F(T());)A();return D(e,P)}var W="-ms-",G="-moz-",Y="-webkit-",q="comm",X="rule",K="decl",Q="@keyframes";function Z(e,t){for(var n="",r=O(e),o=0;o6)switch(b(e,t+1)){case 109:if(45!==b(e,t+4))break;case 102:return v(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1"+G+(108==b(e,t+3)?"$3":"$2-$3"))+e;case 115:return~g(e,"stretch")?ee(v(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==b(e,t+1))break;case 6444:switch(b(e,w(e)-3-(~g(e,"!important")&&10))){case 107:return v(e,":",":"+Y)+e;case 101:return v(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Y+(45===b(e,14)?"inline-":"")+"box$3$1"+Y+"$2$3$1"+W+"$2box$3")+e}break;case 5936:switch(b(e,t+11)){case 114:return Y+e+W+v(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Y+e+W+v(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Y+e+W+v(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Y+e+W+e+e}return e}function te(e){return _(ne("",null,null,null,[""],e=N(e),0,[0],e))}function ne(e,t,n,r,o,i,a,s,l){for(var u=0,c=0,p=a,d=0,m=0,h=0,b=1,y=1,O=1,x=0,C="",k=o,P=i,E=r,M=C;y;)switch(h=x,x=A()){case 40:if(108!=h&&58==M.charCodeAt(p-1)){-1!=g(M+=v(H(x),"&","&\f"),"&\f")&&(O=-1);break}case 34:case 39:case 91:M+=H(x);break;case 9:case 10:case 13:case 32:M+=j(h);break;case 92:M+=$(L()-1,7);continue;case 47:switch(T()){case 42:case 47:S(oe(z(A(),L()),t,n),l);break;default:M+="/"}break;case 123*b:s[u++]=w(M)*O;case 125*b:case 59:case 0:switch(x){case 0:case 125:y=0;case 59+c:m>0&&w(M)-p&&S(m>32?ie(M+";",r,n,p-1):ie(v(M," ","")+";",r,n,p-2),l);break;case 59:M+=";";default:if(S(E=re(M,t,n,u,c,o,s,C,k=[],P=[],p),i),123===x)if(0===c)ne(M,t,E,E,k,i,p,s,P);else switch(d){case 100:case 109:case 115:ne(e,E,E,r&&S(re(e,E,E,0,0,o,s,C,o,k=[],p),P),o,P,p,s,r?k:P);break;default:ne(M,E,E,E,[""],P,0,s,P)}}u=c=m=0,b=O=1,C=M="",p=a;break;case 58:p=1+w(M),m=h;default:if(b<1)if(123==x)--b;else if(125==x&&0==b++&&125==R())continue;switch(M+=f(x),x*b){case 38:O=c>0?1:(M+="\f",-1);break;case 44:s[u++]=(w(M)-1)*O,O=1;break;case 64:45===T()&&(M+=H(A())),d=T(),c=p=w(C=M+=B(L())),x++;break;case 45:45===h&&2==w(M)&&(b=0)}}return i}function re(e,t,n,r,o,i,a,s,l,u,c){for(var p=o-1,f=0===o?i:[""],m=O(f),g=0,b=0,w=0;g0?f[S]+" "+x:v(x,/&\f/g,f[S])))&&(l[w++]=C);return I(e,t,n,0===o?X:s,l,u,c)}function oe(e,t,n){return I(e,t,n,q,f(E),y(e,2,-2),0)}function ie(e,t,n,r){return I(e,t,n,K,y(e,0,r),y(e,r+1,-1),r)}var ae=function(e,t,n){for(var r=0,o=0;r=o,o=T(),38===r&&12===o&&(t[n]=1),!F(o);)A();return D(e,P)},se=new WeakMap,le=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||se.get(n))&&!r){se.set(e,!0);for(var o=[],i=function(e,t){return _(function(e,t){var n=-1,r=44;do{switch(F(r)){case 0:38===r&&12===T()&&(t[n]=1),e[n]+=ae(P-1,t,n);break;case 2:e[n]+=H(r);break;case 4:if(44===r){e[++n]=58===T()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=f(r)}}while(r=A());return e}(N(e),t))}(t,o),a=n.props,s=0,l=0;s-1&&!e.return)switch(e.type){case K:e.return=ee(e.value,e.length);break;case Q:return Z([V(e,{value:v(e.value,"@","@"+Y)})],r);case X:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return Z([V(e,{props:[v(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Z([V(e,{props:[v(t,/:(plac\w+)/,":-webkit-input-$1")]}),V(e,{props:[v(t,/:(plac\w+)/,":-moz-$1")]}),V(e,{props:[v(t,/:(plac\w+)/,W+"input-$1")]})],r)}return""}))}}],pe=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,o,i=e.stylisPlugins||ce,a={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},ve={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ge=function(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}},be=/[A-Z]|^ms/g,ye=/_EMO_([^_]+?)_([^]*?)_EMO_/g,we=function(e){return 45===e.charCodeAt(1)},Oe=function(e){return null!=e&&"boolean"!=typeof e},Se=ge((function(e){return we(e)?e:e.replace(be,"-$&").toLowerCase()})),xe=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(ye,(function(e,t,n){return ke={name:t,styles:n,next:ke},t}))}return 1===ve[e]||we(e)||"number"!=typeof t||0===t?t:t+"px"};function Ce(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return ke={name:n.name,styles:n.styles,next:ke},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)ke={name:r.name,styles:r.styles,next:ke},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function We(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1}function ht(e){return mt(e)?window.pageYOffset:e.scrollTop}function vt(e,t){mt(e)?window.scrollTo(0,t):e.scrollTop=t}function gt(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function bt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ut,o=ht(e),i=t-o,a=10,s=0;function l(){var t=gt(s+=a,o,i,n);vt(e,t),s=m)return{placement:"bottom",maxHeight:t};if(C>=m&&!a)return i&&bt(l,k,E),{placement:"bottom",maxHeight:t};if(!a&&C>=r||a&&S>=r)return i&&bt(l,k,E),{placement:"bottom",maxHeight:a?S-y:C-y};if("auto"===o||a){var M=t,I=a?O:x;return I>=r&&(M=Math.min(I-y-s.controlHeight,t)),{placement:"top",maxHeight:M}}if("bottom"===o)return i&&vt(l,k),{placement:"bottom",maxHeight:t};break;case"top":if(O>=m)return{placement:"top",maxHeight:t};if(x>=m&&!a)return i&&bt(l,P,E),{placement:"top",maxHeight:t};if(!a&&x>=r||a&&O>=r){var V=t;return(!a&&x>=r||a&&O>=r)&&(V=a?O-w:x-w),i&&bt(l,P,E),{placement:"top",maxHeight:V}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return u}var Et=function(e){return"auto"===e?"bottom":e},Mt=(0,c.createContext)({getPortalPlacement:null}),It=function(e){Je(n,e);var t=st(n);function n(){var e;Xe(this,n);for(var r=arguments.length,o=new Array(r),i=0;i1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return"option ".concat(r,i?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,i=void 0===o?"":o,a=e.selectValue,s=e.isDisabled,l=e.isSelected,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&a)return"value ".concat(i," focused, ").concat(u(a,n),".");if("menu"===t){var c=s?" disabled":"",p="".concat(l?"selected":"focused").concat(c);return"option ".concat(i," ").concat(p,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},cn=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,o=e.focusableOptions,i=e.isFocused,a=e.selectValue,s=e.selectProps,l=e.id,u=s.ariaLiveMessages,p=s.getOptionLabel,d=s.inputValue,f=s.isMulti,m=s.isOptionDisabled,h=s.isSearchable,v=s.menuIsOpen,g=s.options,b=s.screenReaderStatus,y=s.tabSelectsValue,w=s["aria-label"],O=s["aria-live"],S=(0,c.useMemo)((function(){return ot(ot({},un),u||{})}),[u]),x=(0,c.useMemo)((function(){var e,n="";if(t&&S.onChange){var r=t.option,o=t.options,i=t.removedValue,s=t.removedValues,l=t.value,u=i||r||(e=l,Array.isArray(e)?null:e),c=u?p(u):"",d=o||s||void 0,f=d?d.map(p):[],h=ot({isDisabled:u&&m(u,a),label:c,labels:f},t);n=S.onChange(h)}return n}),[t,S,m,a,p]),C=(0,c.useMemo)((function(){var e="",t=n||r,o=!!(n&&a&&a.includes(n));if(t&&S.onFocus){var i={focused:t,label:p(t),isDisabled:m(t,a),isSelected:o,options:g,context:t===n?"menu":"value",selectValue:a};e=S.onFocus(i)}return e}),[n,r,p,m,S,g,a]),k=(0,c.useMemo)((function(){var e="";if(v&&g.length&&S.onFilter){var t=b({count:o.length});e=S.onFilter({inputValue:d,resultsMessage:t})}return e}),[o,d,v,S,g,b]),P=(0,c.useMemo)((function(){var e="";if(S.guidance){var t=r?"value":v?"menu":"input";e=S.guidance({"aria-label":w,context:t,isDisabled:n&&m(n,a),isMulti:f,isSearchable:h,tabSelectsValue:y})}return e}),[w,n,r,f,m,h,v,S,a,y]),E="".concat(C," ").concat(k," ").concat(P),M=_e(c.Fragment,null,_e("span",{id:"aria-selection"},x),_e("span",{id:"aria-context"},E)),I="initial-input-focus"===(null==t?void 0:t.action);return _e(c.Fragment,null,_e(ln,{id:l},I&&M),_e(ln,{"aria-live":O,"aria-atomic":"false","aria-relevant":"additions text"},i&&!I&&M))},pn=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],dn=new RegExp("["+pn.map((function(e){return e.letters})).join("")+"]","g"),fn={},mn=0;mn1?t-1:0),r=1;r0,h=p-d-c,v=!1;h>t&&a.current&&(r&&r(e),a.current=!1),m&&s.current&&(i&&i(e),s.current=!1),m&&t>h?(n&&!a.current&&n(e),f.scrollTop=p,v=!0,a.current=!0):!m&&-t>c&&(o&&!s.current&&o(e),f.scrollTop=0,v=!0,s.current=!0),v&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[n,r,o,i]),d=(0,c.useCallback)((function(e){p(e,e.deltaY)}),[p]),f=(0,c.useCallback)((function(e){l.current=e.changedTouches[0].clientY}),[]),m=(0,c.useCallback)((function(e){var t=l.current-e.changedTouches[0].clientY;p(e,t)}),[p]),h=(0,c.useCallback)((function(e){if(e){var t=!!xt&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",f,t),e.addEventListener("touchmove",m,t)}}),[m,f,d]),v=(0,c.useCallback)((function(e){e&&(e.removeEventListener("wheel",d,!1),e.removeEventListener("touchstart",f,!1),e.removeEventListener("touchmove",m,!1))}),[m,f,d]);return(0,c.useEffect)((function(){if(t){var e=u.current;return h(e),function(){v(e)}}}),[t,h,v]),function(e){u.current=e}}({isEnabled:void 0===r||r,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),i=function(e){var t=e.isEnabled,n=e.accountForScrollbars,r=void 0===n||n,o=(0,c.useRef)({}),i=(0,c.useRef)(null),a=(0,c.useCallback)((function(e){if(In){var t=document.body,n=t&&t.style;if(r&&xn.forEach((function(e){var t=n&&n[e];o.current[e]=t})),r&&Vn<1){var i=parseInt(o.current.paddingRight,10)||0,a=document.body?document.body.clientWidth:0,s=window.innerWidth-a+i||0;Object.keys(Cn).forEach((function(e){var t=Cn[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(s,"px"))}t&&Mn()&&(t.addEventListener("touchmove",kn,Rn),e&&(e.addEventListener("touchstart",En,Rn),e.addEventListener("touchmove",Pn,Rn))),Vn+=1}}),[r]),s=(0,c.useCallback)((function(e){if(In){var t=document.body,n=t&&t.style;Vn=Math.max(Vn-1,0),r&&Vn<1&&xn.forEach((function(e){var t=o.current[e];n&&(n[e]=t)})),t&&Mn()&&(t.removeEventListener("touchmove",kn,Rn),e&&(e.removeEventListener("touchstart",En,Rn),e.removeEventListener("touchmove",Pn,Rn)))}}),[r]);return(0,c.useEffect)((function(){if(t){var e=i.current;return a(e),function(){s(e)}}}),[t,a,s]),function(e){i.current=e}}({isEnabled:n});return _e(c.Fragment,null,n&&_e("div",{onClick:An,css:Tn}),t((function(e){o(e),i(e)})))}var Dn={clearIndicator:Gt,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,r=e.theme,o=r.colors,i=r.borderRadius,a=r.spacing;return{label:"control",alignItems:"center",backgroundColor:t?o.neutral5:o.neutral0,borderColor:t?o.neutral10:n?o.primary:o.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(o.primary):void 0,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?o.primary:o.neutral30}}},dropdownIndicator:Wt,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing.baseUnit,o=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r,width:1}},input:function(e){var t=e.isDisabled,n=e.value,r=e.theme,o=r.spacing,i=r.colors;return ot({margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,visibility:t?"hidden":"visible",color:i.neutral80,transform:n?"translateZ(0)":""},Jt)},loadingIndicator:function(e){var t=e.isFocused,n=e.size,r=e.theme,o=r.colors,i=r.spacing.baseUnit;return{label:"loadingIndicator",color:t?o.neutral60:o.neutral20,display:"flex",padding:2*i,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:At,menu:function(e){var t,n=e.placement,r=e.theme,o=r.borderRadius,i=r.spacing,a=r.colors;return et(t={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),et(t,"backgroundColor",a.neutral0),et(t,"borderRadius",o),et(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),et(t,"marginBottom",i.menuGutter),et(t,"marginTop",i.menuGutter),et(t,"position","absolute"),et(t,"width","100%"),et(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:r/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,r=t.colors,o=e.cropWithEllipsis;return{borderRadius:n/2,color:r.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius,o=t.colors;return{alignItems:"center",borderRadius:r/2,backgroundColor:e.isFocused?o.dangerLight:void 0,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}}},noOptionsMessage:Rt,option:function(e){var t=e.isDisabled,n=e.isFocused,r=e.isSelected,o=e.theme,i=o.spacing,a=o.colors;return{label:"option",backgroundColor:r?a.primary:n?a.primary25:"transparent",color:t?a.neutral20:r?a.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*i.baseUnit,"px ").concat(3*i.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:t?void 0:r?a.primary:a.primary50}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,gridArea:"1 / 1 / 2 / 3",marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2}},singleValue:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,o=n.colors;return{label:"singleValue",color:t?o.neutral40:o.neutral80,gridArea:"1 / 1 / 2 / 3",marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},valueContainer:function(e){var t=e.theme.spacing,n=e.isMulti,r=e.hasValue,o=e.selectProps.controlShouldRenderValue;return{alignItems:"center",display:n&&r&&o?"flex":"grid",flex:1,flexWrap:"wrap",padding:"".concat(t.baseUnit/2,"px ").concat(2*t.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}},Fn={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},Nn={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:yt(),captureMenuScroll:!yt(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=ot({ignoreCase:!0,ignoreAccents:!0,stringify:wn,trim:!0,matchFrom:"any"},undefined),r=n.ignoreCase,o=n.ignoreAccents,i=n.stringify,a=n.trim,s=n.matchFrom,l=a?yn(t):t,u=a?yn(i(e)):i(e);return r&&(l=l.toLowerCase(),u=u.toLowerCase()),o&&(l=bn(l),u=gn(u)),"start"===s?u.substr(0,l.length)===l:u.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0};function Hn(e,t,n,r){return{type:"option",data:t,isDisabled:Wn(e,t,n),isSelected:Gn(e,t,n),label:zn(e,t),value:Bn(e,t),index:r}}function jn(e,t){return e.options.map((function(n,r){if("options"in n){var o=n.options.map((function(n,r){return Hn(e,n,t,r)})).filter((function(t){return Un(e,t)}));return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=Hn(e,n,t,r);return Un(e,i)?i:void 0})).filter(Ct)}function $n(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,rn(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function Un(e,t){var n=e.inputValue,r=void 0===n?"":n,o=t.data,i=t.isSelected,a=t.label,s=t.value;return(!qn(e)||!i)&&Yn(e,{label:a,value:s,data:o},r)}var zn=function(e,t){return e.getOptionLabel(t)},Bn=function(e,t){return e.getOptionValue(t)};function Wn(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function Gn(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var r=Bn(e,t);return n.some((function(t){return Bn(e,t)===r}))}function Yn(e,t,n){return!e.filterOption||e.filterOption(t,n)}var qn=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},Xn=1,Kn=function(e){Je(n,e);var t=st(n);function n(e){var r;return Xe(this,n),(r=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.instancePrefix="",r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,o=n.onChange,i=n.name;t.name=i,r.ariaOnChange(e,t),o(e,t)},r.setValue=function(e,t,n){var o=r.props,i=o.closeMenuOnSelect,a=o.isMulti,s=o.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:s}),i&&(r.setState({inputIsHiddenAfterUpdate:!a}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,o=t.isMulti,i=t.name,a=r.state.selectValue,s=o&&r.isOptionSelected(e,a),l=r.isOptionDisabled(e,a);if(s){var u=r.getOptionValue(e);r.setValue(a.filter((function(e){return r.getOptionValue(e)!==u})),"deselect-option",e)}else{if(l)return void r.ariaOnChange(e,{action:"select-option",option:e,name:i});o?r.setValue([].concat(rn(a),[e]),"select-option",e):r.setValue(e,"select-option")}n&&r.blurInput()},r.removeValue=function(e){var t=r.props.isMulti,n=r.state.selectValue,o=r.getOptionValue(e),i=n.filter((function(e){return r.getOptionValue(e)!==o})),a=kt(t,i,i[0]||null);r.onChange(a,{action:"remove-value",removedValue:e}),r.focusInput()},r.clearValue=function(){var e=r.state.selectValue;r.onChange(kt(r.props.isMulti,[],null),{action:"clear",removedValues:e})},r.popValue=function(){var e=r.props.isMulti,t=r.state.selectValue,n=t[t.length-1],o=t.slice(0,t.length-1),i=kt(e,o,o[0]||null);r.onChange(i,{action:"pop-value",removedValue:n})},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n5||i>5}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=r.props.inputValue,n=e.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(n,{action:"input-change",prevInputValue:t}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){r.props.onFocus&&r.props.onFocus(e),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(e){var t=r.props.inputValue;r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(e),r.onInputChange("",{action:"input-blur",prevInputValue:t}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))},r.onOptionHover=function(e){r.blockOptionHover||r.state.focusedOption===e||r.setState({focusedOption:e})},r.shouldHideSelectedOptions=function(){return qn(r.props)},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,o=t.backspaceRemovesValue,i=t.escapeClearsValue,a=t.inputValue,s=t.isClearable,l=t.isDisabled,u=t.menuIsOpen,c=t.onKeyDown,p=t.tabSelectsValue,d=t.openMenuOnFocus,f=r.state,m=f.focusedOption,h=f.focusedValue,v=f.selectValue;if(!(l||"function"==typeof c&&(c(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||a)return;r.focusValue("previous");break;case"ArrowRight":if(!n||a)return;r.focusValue("next");break;case"Delete":case"Backspace":if(a)return;if(h)r.removeValue(h);else{if(!o)return;n?r.popValue():s&&r.clearValue()}break;case"Tab":if(r.isComposing)return;if(e.shiftKey||!u||!p||!m||d&&r.isOptionSelected(m,v))return;r.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(u){if(!m)return;if(r.isComposing)return;r.selectOption(m);break}return;case"Escape":u?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:a}),r.onMenuClose()):s&&i&&r.clearValue();break;case" ":if(a)return;if(!u){r.openMenu("first");break}if(!m)return;r.selectOption(m);break;case"ArrowUp":u?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":u?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!u)return;r.focusOption("pageup");break;case"PageDown":if(!u)return;r.focusOption("pagedown");break;case"Home":if(!u)return;r.focusOption("first");break;case"End":if(!u)return;r.focusOption("last");break;default:return}e.preventDefault()}},r.instancePrefix="react-select-"+(r.props.instanceId||++Xn),r.state.selectValue=dt(e.value),r}return Qe(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentDidUpdate",value:function(e){var t,n,r,o,i,a=this.props,s=a.isDisabled,l=a.menuIsOpen,u=this.state.isFocused;(u&&!s&&e.isDisabled||u&&l&&!e.menuIsOpen)&&this.focusInput(),u&&s&&!e.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,r=t.getBoundingClientRect(),o=n.getBoundingClientRect(),i=n.offsetHeight/3,o.bottom+i>r.bottom?vt(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+i,t.scrollHeight)):o.top-i-1&&(a=s)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:i[a]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,r=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=n.indexOf(r);r||(o=-1);var i=n.length-1,a=-1;if(n.length){switch(e){case"previous":a=0===o?0:-1===o?i:o-1;break;case"next":o>-1&&o0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var o=0,i=r.indexOf(n);n||(i=-1),"up"===e?o=i>0?i-1:r.length-1:"down"===e?o=(i+1)%r.length:"pageup"===e?(o=i-t)<0&&(o=0):"pagedown"===e?(o=i+t)>r.length-1&&(o=r.length-1):"last"===e&&(o=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[o],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Fn):ot(ot({},Fn),this.props.theme):Fn}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getValue,o=this.selectOption,i=this.setValue,a=this.props,s=a.isMulti,l=a.isRtl,u=a.options;return{clearValue:e,cx:t,getStyles:n,getValue:r,hasValue:this.hasValue(),isMulti:s,isRtl:l,options:u,selectOption:o,selectProps:a,setValue:i,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return Wn(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return Gn(this.props,e,t)}},{key:"filterOption",value:function(e,t){return Yn(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,o=e.inputValue,i=e.tabIndex,s=e.form,l=e.menuIsOpen,u=this.getComponents().Input,p=this.state,d=p.inputIsHidden,f=p.ariaSelection,m=this.commonProps,h=r||this.getElementId("input"),v=ot(ot(ot({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],role:"combobox"},l&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==f?void 0:f.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?c.createElement(u,a({},m,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:h,innerRef:this.getInputRef,isDisabled:t,isHidden:d,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:i,form:s,type:"text",value:o},v)):c.createElement(Sn,a({id:h,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ut,onFocus:this.onInputFocus,disabled:t,tabIndex:i,inputMode:"none",form:s,value:""},v))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,r=t.MultiValueContainer,o=t.MultiValueLabel,i=t.MultiValueRemove,s=t.SingleValue,l=t.Placeholder,u=this.commonProps,p=this.props,d=p.controlShouldRenderValue,f=p.isDisabled,m=p.isMulti,h=p.inputValue,v=p.placeholder,g=this.state,b=g.selectValue,y=g.focusedValue,w=g.isFocused;if(!this.hasValue()||!d)return h?null:c.createElement(l,a({},u,{key:"placeholder",isDisabled:f,isFocused:w,innerProps:{id:this.getElementId("placeholder")}}),v);if(m)return b.map((function(t,s){var l=t===y,p="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return c.createElement(n,a({},u,{components:{Container:r,Label:o,Remove:i},isFocused:l,isDisabled:f,key:p,index:s,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))}));if(h)return null;var O=b[0];return c.createElement(s,a({},u,{data:O,isDisabled:f}),this.formatOptionLabel(O,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,i=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||o)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return c.createElement(e,a({},t,{innerProps:s,isFocused:i}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,i=this.state.isFocused;return e&&o?c.createElement(e,a({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:i})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,o=this.props.isDisabled,i=this.state.isFocused;return c.createElement(n,a({},r,{isDisabled:o,isFocused:i}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return c.createElement(e,a({},t,{innerProps:o,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,r=t.GroupHeading,o=t.Menu,i=t.MenuList,s=t.MenuPortal,l=t.LoadingMessage,u=t.NoOptionsMessage,p=t.Option,d=this.commonProps,f=this.state.focusedOption,m=this.props,h=m.captureMenuScroll,v=m.inputValue,g=m.isLoading,b=m.loadingMessage,y=m.minMenuHeight,w=m.maxMenuHeight,O=m.menuIsOpen,S=m.menuPlacement,x=m.menuPosition,C=m.menuPortalTarget,k=m.menuShouldBlockScroll,P=m.menuShouldScrollIntoView,E=m.noOptionsMessage,M=m.onMenuScrollToTop,I=m.onMenuScrollToBottom;if(!O)return null;var V,R=function(t,n){var r=t.type,o=t.data,i=t.isDisabled,s=t.isSelected,l=t.label,u=t.value,m=f===o,h=i?void 0:function(){return e.onOptionHover(o)},v=i?void 0:function(){return e.selectOption(o)},g="".concat(e.getElementId("option"),"-").concat(n),b={id:g,onClick:v,onMouseMove:h,onMouseOver:h,tabIndex:-1};return c.createElement(p,a({},d,{innerProps:b,data:o,isDisabled:i,isSelected:s,key:g,label:l,type:r,value:u,isFocused:m,innerRef:m?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())V=this.getCategorizedOptions().map((function(t){if("group"===t.type){var o=t.data,i=t.options,s=t.index,l="".concat(e.getElementId("group"),"-").concat(s),u="".concat(l,"-heading");return c.createElement(n,a({},d,{key:l,data:o,options:i,Heading:r,headingProps:{id:u,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return R(e,"".concat(s,"-").concat(e.index))})))}if("option"===t.type)return R(t,"".concat(t.index))}));else if(g){var A=b({inputValue:v});if(null===A)return null;V=c.createElement(l,d,A)}else{var T=E({inputValue:v});if(null===T)return null;V=c.createElement(u,d,T)}var L={minMenuHeight:y,maxMenuHeight:w,menuPlacement:S,menuPosition:x,menuShouldScrollIntoView:P},D=c.createElement(It,a({},d,L),(function(t){var n=t.ref,r=t.placerProps,s=r.placement,l=r.maxHeight;return c.createElement(o,a({},d,L,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove,id:e.getElementId("listbox")},isLoading:g,placement:s}),c.createElement(Ln,{captureEnabled:h,onTopArrive:M,onBottomArrive:I,lockEnabled:k},(function(t){return c.createElement(i,a({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},isLoading:g,maxHeight:l,focusedOption:f}),V)})))}));return C||"fixed"===x?c.createElement(s,a({},d,{appendTo:C,controlElement:this.controlRef,menuPlacement:S,menuPosition:x}),D):D}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,o=t.isMulti,i=t.name,a=this.state.selectValue;if(i&&!r){if(o){if(n){var s=a.map((function(t){return e.getOptionValue(t)})).join(n);return c.createElement("input",{name:i,type:"hidden",value:s})}var l=a.length>0?a.map((function(t,n){return c.createElement("input",{key:"i-".concat(n),name:i,type:"hidden",value:e.getOptionValue(t)})})):c.createElement("input",{name:i,type:"hidden"});return c.createElement("div",null,l)}var u=a[0]?this.getOptionValue(a[0]):"";return c.createElement("input",{name:i,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,r=t.focusedOption,o=t.focusedValue,i=t.isFocused,s=t.selectValue,l=this.getFocusableOptions();return c.createElement(cn,a({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:r,focusedValue:o,isFocused:i,selectValue:s,focusableOptions:l}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,o=e.ValueContainer,i=this.props,s=i.className,l=i.id,u=i.isDisabled,p=i.menuIsOpen,d=this.state.isFocused,f=this.commonProps=this.getCommonProps();return c.createElement(r,a({},f,{className:s,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:u,isFocused:d}),this.renderLiveRegion(),c.createElement(t,a({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:u,isFocused:d,menuIsOpen:p}),c.createElement(o,a({},f,{isDisabled:u}),this.renderPlaceholderOrValue(),this.renderInput()),c.createElement(n,a({},f,{isDisabled:u}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,i=t.ariaSelection,a=t.isFocused,s=t.prevWasFocused,l=e.options,u=e.value,c=e.menuIsOpen,p=e.inputValue,d=e.isMulti,f=dt(u),m={};if(n&&(u!==n.value||l!==n.options||c!==n.menuIsOpen||p!==n.inputValue)){var h=c?function(e,t){return $n(jn(e,t))}(e,f):[],v=r?function(e,t){var n=e.focusedValue,r=e.selectValue.indexOf(n);if(r>-1){if(t.indexOf(n)>-1)return n;if(r-1?n:t[0]}(t,h);m={selectValue:f,focusedOption:g,focusedValue:v,clearFocusValueOnUpdate:!1}}var b=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},y=i,w=a&&s;return a&&!w&&(y={value:kt(d,f,f[0]||null),options:f,action:"initial-input-focus"},w=!s),"initial-input-focus"===(null==i?void 0:i.action)&&(y=null),ot(ot(ot({},m),b),{},{prevProps:e,ariaSelection:y,prevWasFocused:w})}}]),n}(c.Component);Kn.defaultProps=Nn;var Qn=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"],Zn=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"],Jn=(0,c.forwardRef)((function(e,t){var n=function(e){var t=e.defaultOptions,n=void 0!==t&&t,r=e.cacheOptions,o=void 0!==r&&r,i=e.loadOptions;e.options;var a=e.isLoading,s=void 0!==a&&a,l=e.onInputChange,u=e.filterOption,p=void 0===u?null:u,d=Be(e,Zn),f=d.inputValue,m=(0,c.useRef)(void 0),h=(0,c.useRef)(!1),v=Ye((0,c.useState)(Array.isArray(n)?n:void 0),2),g=v[0],b=v[1],y=Ye((0,c.useState)(void 0!==f?f:""),2),w=y[0],O=y[1],S=Ye((0,c.useState)(!0===n),2),x=S[0],C=S[1],k=Ye((0,c.useState)(void 0),2),P=k[0],E=k[1],M=Ye((0,c.useState)([]),2),I=M[0],V=M[1],R=Ye((0,c.useState)(!1),2),A=R[0],T=R[1],L=Ye((0,c.useState)({}),2),D=L[0],F=L[1],N=Ye((0,c.useState)(void 0),2),_=N[0],H=N[1],j=Ye((0,c.useState)(void 0),2),$=j[0],U=j[1];o!==$&&(F({}),U(o)),n!==_&&(b(Array.isArray(n)?n:void 0),H(n)),(0,c.useEffect)((function(){return h.current=!0,function(){h.current=!1}}),[]);var z=(0,c.useCallback)((function(e,t){if(!i)return t();var n=i(e,t);n&&"function"==typeof n.then&&n.then(t,(function(){return t()}))}),[i]);(0,c.useEffect)((function(){!0===n&&z(w,(function(e){h.current&&(b(e||[]),C(!!m.current))}))}),[]);var B=(0,c.useCallback)((function(e,t){var n=function(e,t,n){if(n){var r=n(e,t);if("string"==typeof r)return r}return e}(e,t,l);if(!n)return m.current=void 0,O(""),E(""),V([]),C(!1),void T(!1);if(o&&D[n])O(n),E(n),V(D[n]),C(!1),T(!1);else{var r=m.current={};O(n),C(!0),T(!P),z(n,(function(e){h&&r===m.current&&(m.current=void 0,C(!1),E(n),V(e||[]),T(!1),F(e?ot(ot({},D),{},et({},n,e)):D))}))}}),[o,z,P,D,l]),W=A?[]:w&&P?I:g||[];return ot(ot({},d),{},{options:W,isLoading:x||s,onInputChange:B,filterOption:p})}(e),r=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,r=e.defaultMenuIsOpen,o=void 0!==r&&r,i=e.defaultValue,a=void 0===i?null:i,s=e.inputValue,l=e.menuIsOpen,u=e.onChange,p=e.onInputChange,d=e.onMenuClose,f=e.onMenuOpen,m=e.value,h=Be(e,Qn),v=Ye((0,c.useState)(void 0!==s?s:n),2),g=v[0],b=v[1],y=Ye((0,c.useState)(void 0!==l?l:o),2),w=y[0],O=y[1],S=Ye((0,c.useState)(void 0!==m?m:a),2),x=S[0],C=S[1],k=(0,c.useCallback)((function(e,t){"function"==typeof u&&u(e,t),C(e)}),[u]),P=(0,c.useCallback)((function(e,t){var n;"function"==typeof p&&(n=p(e,t)),b(void 0!==n?n:e)}),[p]),E=(0,c.useCallback)((function(){"function"==typeof f&&f(),O(!0)}),[f]),M=(0,c.useCallback)((function(){"function"==typeof d&&d(),O(!1)}),[d]),I=void 0!==s?s:g,V=void 0!==l?l:w,R=void 0!==m?m:x;return ot(ot({},h),{},{inputValue:I,menuIsOpen:V,onChange:k,onInputChange:P,onMenuClose:M,onMenuOpen:E,value:R})}(n);return c.createElement(Kn,a({ref:t},r))})),er=Jn;function tr(e,t,n,r){var o,i=!1,a=0;function s(){o&&clearTimeout(o)}function l(){for(var l=arguments.length,u=new Array(l),c=0;ce?f():!0!==t&&(o=setTimeout(r?m:f,void 0===r?e-d:e)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),l.cancel=function(){s(),i=!0},l}var nr=window.lodash,rr=window.wp.apiFetch,or=n.n(rr),ir=window.wp.url,ar=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,sr=ge((function(e){return ar.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),lr=function(e){return"theme"!==e},ur=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?sr:lr},cr=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},pr=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return fe(t,n,r),Ie((function(){return me(t,n,r)})),null},dr=function e(t,n){var r,o,i=t.__emotion_real===t,s=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,o=n.target);var l=cr(t,n,i),u=l||ur(s),p=!u("as");return function(){var d=arguments,f=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&f.push("label:"+r+";"),null==d[0]||void 0===d[0].raw)f.push.apply(f,d);else{f.push(d[0][0]);for(var m=d.length,h=1;h{"use strict";var e={679:(e,t,n)=>{var r=n(296),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=Object.defineProperty,c=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var o=f(n);o&&o!==m&&e(t,o,r)}var a=c(n);p&&(a=a.concat(p(n)));for(var s=l(t),h=l(n),v=0;v{var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,c=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,v=n?Symbol.for("react.lazy"):60116,g=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,y=n?Symbol.for("react.responder"):60118,w=n?Symbol.for("react.scope"):60119;function O(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case p:case i:case s:case a:case f:return e;default:switch(e=e&&e.$$typeof){case u:case d:case v:case h:case l:return e;default:return t}}case o:return t}}}function S(e){return O(e)===p}t.AsyncMode=c,t.ConcurrentMode=p,t.ContextConsumer=u,t.ContextProvider=l,t.Element=r,t.ForwardRef=d,t.Fragment=i,t.Lazy=v,t.Memo=h,t.Portal=o,t.Profiler=s,t.StrictMode=a,t.Suspense=f,t.isAsyncMode=function(e){return S(e)||O(e)===c},t.isConcurrentMode=S,t.isContextConsumer=function(e){return O(e)===u},t.isContextProvider=function(e){return O(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return O(e)===d},t.isFragment=function(e){return O(e)===i},t.isLazy=function(e){return O(e)===v},t.isMemo=function(e){return O(e)===h},t.isPortal=function(e){return O(e)===o},t.isProfiler=function(e){return O(e)===s},t.isStrictMode=function(e){return O(e)===a},t.isSuspense=function(e){return O(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===s||e===a||e===f||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===h||e.$$typeof===l||e.$$typeof===u||e.$$typeof===d||e.$$typeof===b||e.$$typeof===y||e.$$typeof===w||e.$$typeof===g)},t.typeOf=O},296:(e,t,n)=>{e.exports=n(103)}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={};n.r(e),n.d(e,{get:()=>Er,start:()=>Mr,stop:()=>Ir});var t={};n.r(t),n.d(t,{BaseSearchControl:()=>br,ButtonGroupControl:()=>i,CopyButton:()=>u,PostSearchControl:()=>yr,Spinner:()=>e,UserSearchControl:()=>wr});const r=window.wp.element,o=window.wp.components;function i(e){let{label:t,onClick:n=(()=>{}),className:i=null,id:a=null,selected:s="",options:l=[]}=e;const[u,c]=(0,r.useState)(s);return i=i?` ${i}`:"",(0,r.createElement)(o.BaseControl,{label:t,className:`llms-button-group-control${i}`,id:a},(0,r.createElement)(o.ButtonGroup,{style:{display:"flex"}},l.map((e=>{let{label:t,value:i,icon:a=null}=e;return(0,r.createElement)(o.Button,{style:{padding:"6px 8px"},key:i,isPrimary:i===u,isSecondary:i!==u,icon:a,onClick:()=>{c(i),n(i)}},t)}))))}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const e=(0,l.useCopyToClipboard)(n,i);return(0,r.createElement)(o.Button,a({},c,{ref:e}),t)}),null),!p&&(0,r.createElement)((()=>(0,r.createElement)(o.ClipboardButton,a({},c,{text:n,onCopy:i}),t)),null))}const c=window.React;var p=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?b(M,--P):0,C--,10===E&&(C=1,x--),E}function A(){return E=P2||F(E)>3?"":" "}function $(e,t){for(;--t&&A()&&!(E<48||E>102||E>57&&E<65||E>70&&E<97););return D(e,L()+(t<6&&32==T()&&32==A()))}function U(e){for(;A();)switch(E){case e:return P;case 34:case 39:34!==e&&39!==e&&U(E);break;case 40:41===e&&U(e);break;case 92:A()}return P}function z(e,t){for(;A()&&e+E!==57&&(e+E!==84||47!==T()););return"/*"+D(t,P-1)+"*"+f(47===e?e:A())}function B(e){for(;!F(T());)A();return D(e,P)}var W="-ms-",G="-moz-",Y="-webkit-",q="comm",X="rule",K="decl",Q="@keyframes";function Z(e,t){for(var n="",r=O(e),o=0;o6)switch(b(e,t+1)){case 109:if(45!==b(e,t+4))break;case 102:return v(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1"+G+(108==b(e,t+3)?"$3":"$2-$3"))+e;case 115:return~g(e,"stretch")?ee(v(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==b(e,t+1))break;case 6444:switch(b(e,w(e)-3-(~g(e,"!important")&&10))){case 107:return v(e,":",":"+Y)+e;case 101:return v(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Y+(45===b(e,14)?"inline-":"")+"box$3$1"+Y+"$2$3$1"+W+"$2box$3")+e}break;case 5936:switch(b(e,t+11)){case 114:return Y+e+W+v(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Y+e+W+v(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Y+e+W+v(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Y+e+W+e+e}return e}function te(e){return _(ne("",null,null,null,[""],e=N(e),0,[0],e))}function ne(e,t,n,r,o,i,a,s,l){for(var u=0,c=0,p=a,d=0,m=0,h=0,b=1,y=1,O=1,x=0,C="",k=o,P=i,E=r,M=C;y;)switch(h=x,x=A()){case 40:if(108!=h&&58==M.charCodeAt(p-1)){-1!=g(M+=v(H(x),"&","&\f"),"&\f")&&(O=-1);break}case 34:case 39:case 91:M+=H(x);break;case 9:case 10:case 13:case 32:M+=j(h);break;case 92:M+=$(L()-1,7);continue;case 47:switch(T()){case 42:case 47:S(oe(z(A(),L()),t,n),l);break;default:M+="/"}break;case 123*b:s[u++]=w(M)*O;case 125*b:case 59:case 0:switch(x){case 0:case 125:y=0;case 59+c:m>0&&w(M)-p&&S(m>32?ie(M+";",r,n,p-1):ie(v(M," ","")+";",r,n,p-2),l);break;case 59:M+=";";default:if(S(E=re(M,t,n,u,c,o,s,C,k=[],P=[],p),i),123===x)if(0===c)ne(M,t,E,E,k,i,p,s,P);else switch(d){case 100:case 109:case 115:ne(e,E,E,r&&S(re(e,E,E,0,0,o,s,C,o,k=[],p),P),o,P,p,s,r?k:P);break;default:ne(M,E,E,E,[""],P,0,s,P)}}u=c=m=0,b=O=1,C=M="",p=a;break;case 58:p=1+w(M),m=h;default:if(b<1)if(123==x)--b;else if(125==x&&0==b++&&125==R())continue;switch(M+=f(x),x*b){case 38:O=c>0?1:(M+="\f",-1);break;case 44:s[u++]=(w(M)-1)*O,O=1;break;case 64:45===T()&&(M+=H(A())),d=T(),c=p=w(C=M+=B(L())),x++;break;case 45:45===h&&2==w(M)&&(b=0)}}return i}function re(e,t,n,r,o,i,a,s,l,u,c){for(var p=o-1,f=0===o?i:[""],m=O(f),g=0,b=0,w=0;g0?f[S]+" "+x:v(x,/&\f/g,f[S])))&&(l[w++]=C);return I(e,t,n,0===o?X:s,l,u,c)}function oe(e,t,n){return I(e,t,n,q,f(E),y(e,2,-2),0)}function ie(e,t,n,r){return I(e,t,n,K,y(e,0,r),y(e,r+1,-1),r)}var ae=function(e,t,n){for(var r=0,o=0;r=o,o=T(),38===r&&12===o&&(t[n]=1),!F(o);)A();return D(e,P)},se=new WeakMap,le=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||se.get(n))&&!r){se.set(e,!0);for(var o=[],i=function(e,t){return _(function(e,t){var n=-1,r=44;do{switch(F(r)){case 0:38===r&&12===T()&&(t[n]=1),e[n]+=ae(P-1,t,n);break;case 2:e[n]+=H(r);break;case 4:if(44===r){e[++n]=58===T()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=f(r)}}while(r=A());return e}(N(e),t))}(t,o),a=n.props,s=0,l=0;s-1&&!e.return)switch(e.type){case K:e.return=ee(e.value,e.length);break;case Q:return Z([V(e,{value:v(e.value,"@","@"+Y)})],r);case X:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return Z([V(e,{props:[v(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Z([V(e,{props:[v(t,/:(plac\w+)/,":-webkit-input-$1")]}),V(e,{props:[v(t,/:(plac\w+)/,":-moz-$1")]}),V(e,{props:[v(t,/:(plac\w+)/,W+"input-$1")]})],r)}return""}))}}];const pe=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r,o,i=e.stylisPlugins||ce,a={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},ve={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},ge=function(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}};var be=/[A-Z]|^ms/g,ye=/_EMO_([^_]+?)_([^]*?)_EMO_/g,we=function(e){return 45===e.charCodeAt(1)},Oe=function(e){return null!=e&&"boolean"!=typeof e},Se=ge((function(e){return we(e)?e:e.replace(be,"-$&").toLowerCase()})),xe=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(ye,(function(e,t,n){return ke={name:t,styles:n,next:ke},t}))}return 1===ve[e]||we(e)||"number"!=typeof t||0===t?t:t+"px"};function Ce(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return ke={name:n.name,styles:n.styles,next:ke},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)ke={name:r.name,styles:r.styles,next:ke},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function We(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1}function ht(e){return mt(e)?window.pageYOffset:e.scrollTop}function vt(e,t){mt(e)?window.scrollTo(0,t):e.scrollTop=t}function gt(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function bt(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ut,o=ht(e),i=t-o,a=10,s=0;function l(){var t=gt(s+=a,o,i,n);vt(e,t),s=m)return{placement:"bottom",maxHeight:t};if(C>=m&&!a)return i&&bt(l,k,E),{placement:"bottom",maxHeight:t};if(!a&&C>=r||a&&S>=r)return i&&bt(l,k,E),{placement:"bottom",maxHeight:a?S-y:C-y};if("auto"===o||a){var M=t,I=a?O:x;return I>=r&&(M=Math.min(I-y-s.controlHeight,t)),{placement:"top",maxHeight:M}}if("bottom"===o)return i&&vt(l,k),{placement:"bottom",maxHeight:t};break;case"top":if(O>=m)return{placement:"top",maxHeight:t};if(x>=m&&!a)return i&&bt(l,P,E),{placement:"top",maxHeight:t};if(!a&&x>=r||a&&O>=r){var V=t;return(!a&&x>=r||a&&O>=r)&&(V=a?O-w:x-w),i&&bt(l,P,E),{placement:"top",maxHeight:V}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(o,'".'))}return u}var Et=function(e){return"auto"===e?"bottom":e},Mt=(0,c.createContext)({getPortalPlacement:null}),It=function(e){Je(n,e);var t=st(n);function n(){var e;Xe(this,n);for(var r=arguments.length,o=new Array(r),i=0;i1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return"option ".concat(r,i?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,o=e.label,i=void 0===o?"":o,a=e.selectValue,s=e.isDisabled,l=e.isSelected,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&a)return"value ".concat(i," focused, ").concat(u(a,n),".");if("menu"===t){var c=s?" disabled":"",p="".concat(l?"selected":"focused").concat(c);return"option ".concat(i," ").concat(p,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},cn=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,o=e.focusableOptions,i=e.isFocused,a=e.selectValue,s=e.selectProps,l=e.id,u=s.ariaLiveMessages,p=s.getOptionLabel,d=s.inputValue,f=s.isMulti,m=s.isOptionDisabled,h=s.isSearchable,v=s.menuIsOpen,g=s.options,b=s.screenReaderStatus,y=s.tabSelectsValue,w=s["aria-label"],O=s["aria-live"],S=(0,c.useMemo)((function(){return ot(ot({},un),u||{})}),[u]),x=(0,c.useMemo)((function(){var e,n="";if(t&&S.onChange){var r=t.option,o=t.options,i=t.removedValue,s=t.removedValues,l=t.value,u=i||r||(e=l,Array.isArray(e)?null:e),c=u?p(u):"",d=o||s||void 0,f=d?d.map(p):[],h=ot({isDisabled:u&&m(u,a),label:c,labels:f},t);n=S.onChange(h)}return n}),[t,S,m,a,p]),C=(0,c.useMemo)((function(){var e="",t=n||r,o=!!(n&&a&&a.includes(n));if(t&&S.onFocus){var i={focused:t,label:p(t),isDisabled:m(t,a),isSelected:o,options:g,context:t===n?"menu":"value",selectValue:a};e=S.onFocus(i)}return e}),[n,r,p,m,S,g,a]),k=(0,c.useMemo)((function(){var e="";if(v&&g.length&&S.onFilter){var t=b({count:o.length});e=S.onFilter({inputValue:d,resultsMessage:t})}return e}),[o,d,v,S,g,b]),P=(0,c.useMemo)((function(){var e="";if(S.guidance){var t=r?"value":v?"menu":"input";e=S.guidance({"aria-label":w,context:t,isDisabled:n&&m(n,a),isMulti:f,isSearchable:h,tabSelectsValue:y})}return e}),[w,n,r,f,m,h,v,S,a,y]),E="".concat(C," ").concat(k," ").concat(P),M=_e(c.Fragment,null,_e("span",{id:"aria-selection"},x),_e("span",{id:"aria-context"},E)),I="initial-input-focus"===(null==t?void 0:t.action);return _e(c.Fragment,null,_e(ln,{id:l},I&&M),_e(ln,{"aria-live":O,"aria-atomic":"false","aria-relevant":"additions text"},i&&!I&&M))},pn=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],dn=new RegExp("["+pn.map((function(e){return e.letters})).join("")+"]","g"),fn={},mn=0;mn1?t-1:0),r=1;r0,h=p-d-c,v=!1;h>t&&a.current&&(r&&r(e),a.current=!1),m&&s.current&&(i&&i(e),s.current=!1),m&&t>h?(n&&!a.current&&n(e),f.scrollTop=p,v=!0,a.current=!0):!m&&-t>c&&(o&&!s.current&&o(e),f.scrollTop=0,v=!0,s.current=!0),v&&function(e){e.preventDefault(),e.stopPropagation()}(e)}}),[n,r,o,i]),d=(0,c.useCallback)((function(e){p(e,e.deltaY)}),[p]),f=(0,c.useCallback)((function(e){l.current=e.changedTouches[0].clientY}),[]),m=(0,c.useCallback)((function(e){var t=l.current-e.changedTouches[0].clientY;p(e,t)}),[p]),h=(0,c.useCallback)((function(e){if(e){var t=!!xt&&{passive:!1};e.addEventListener("wheel",d,t),e.addEventListener("touchstart",f,t),e.addEventListener("touchmove",m,t)}}),[m,f,d]),v=(0,c.useCallback)((function(e){e&&(e.removeEventListener("wheel",d,!1),e.removeEventListener("touchstart",f,!1),e.removeEventListener("touchmove",m,!1))}),[m,f,d]);return(0,c.useEffect)((function(){if(t){var e=u.current;return h(e),function(){v(e)}}}),[t,h,v]),function(e){u.current=e}}({isEnabled:void 0===r||r,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),i=function(e){var t=e.isEnabled,n=e.accountForScrollbars,r=void 0===n||n,o=(0,c.useRef)({}),i=(0,c.useRef)(null),a=(0,c.useCallback)((function(e){if(In){var t=document.body,n=t&&t.style;if(r&&xn.forEach((function(e){var t=n&&n[e];o.current[e]=t})),r&&Vn<1){var i=parseInt(o.current.paddingRight,10)||0,a=document.body?document.body.clientWidth:0,s=window.innerWidth-a+i||0;Object.keys(Cn).forEach((function(e){var t=Cn[e];n&&(n[e]=t)})),n&&(n.paddingRight="".concat(s,"px"))}t&&Mn()&&(t.addEventListener("touchmove",kn,Rn),e&&(e.addEventListener("touchstart",En,Rn),e.addEventListener("touchmove",Pn,Rn))),Vn+=1}}),[r]),s=(0,c.useCallback)((function(e){if(In){var t=document.body,n=t&&t.style;Vn=Math.max(Vn-1,0),r&&Vn<1&&xn.forEach((function(e){var t=o.current[e];n&&(n[e]=t)})),t&&Mn()&&(t.removeEventListener("touchmove",kn,Rn),e&&(e.removeEventListener("touchstart",En,Rn),e.removeEventListener("touchmove",Pn,Rn)))}}),[r]);return(0,c.useEffect)((function(){if(t){var e=i.current;return a(e),function(){s(e)}}}),[t,a,s]),function(e){i.current=e}}({isEnabled:n});return _e(c.Fragment,null,n&&_e("div",{onClick:An,css:Tn}),t((function(e){o(e),i(e)})))}var Dn={clearIndicator:Gt,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused,r=e.theme,o=r.colors,i=r.borderRadius,a=r.spacing;return{label:"control",alignItems:"center",backgroundColor:t?o.neutral5:o.neutral0,borderColor:t?o.neutral10:n?o.primary:o.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(o.primary):void 0,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?o.primary:o.neutral30}}},dropdownIndicator:Wt,group:function(e){var t=e.theme.spacing;return{paddingBottom:2*t.baseUnit,paddingTop:2*t.baseUnit}},groupHeading:function(e){var t=e.theme.spacing;return{label:"group",color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*t.baseUnit,paddingRight:3*t.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing.baseUnit,o=n.colors;return{label:"indicatorSeparator",alignSelf:"stretch",backgroundColor:t?o.neutral10:o.neutral20,marginBottom:2*r,marginTop:2*r,width:1}},input:function(e){var t=e.isDisabled,n=e.value,r=e.theme,o=r.spacing,i=r.colors;return ot({margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,visibility:t?"hidden":"visible",color:i.neutral80,transform:n?"translateZ(0)":""},Jt)},loadingIndicator:function(e){var t=e.isFocused,n=e.size,r=e.theme,o=r.colors,i=r.spacing.baseUnit;return{label:"loadingIndicator",color:t?o.neutral60:o.neutral20,display:"flex",padding:2*i,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:At,menu:function(e){var t,n=e.placement,r=e.theme,o=r.borderRadius,i=r.spacing,a=r.colors;return et(t={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),et(t,"backgroundColor",a.neutral0),et(t,"borderRadius",o),et(t,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),et(t,"marginBottom",i.menuGutter),et(t,"marginTop",i.menuGutter),et(t,"position","absolute"),et(t,"width","100%"),et(t,"zIndex",1),t},menuList:function(e){var t=e.maxHeight,n=e.theme.spacing.baseUnit;return{maxHeight:t,overflowY:"auto",paddingBottom:n,paddingTop:n,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius;return{label:"multiValue",backgroundColor:t.colors.neutral10,borderRadius:r/2,display:"flex",margin:n.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.theme,n=t.borderRadius,r=t.colors,o=e.cropWithEllipsis;return{borderRadius:n/2,color:r.neutral80,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"}},multiValueRemove:function(e){var t=e.theme,n=t.spacing,r=t.borderRadius,o=t.colors;return{alignItems:"center",borderRadius:r/2,backgroundColor:e.isFocused?o.dangerLight:void 0,display:"flex",paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}}},noOptionsMessage:Rt,option:function(e){var t=e.isDisabled,n=e.isFocused,r=e.isSelected,o=e.theme,i=o.spacing,a=o.colors;return{label:"option",backgroundColor:r?a.primary:n?a.primary25:"transparent",color:t?a.neutral20:r?a.neutral0:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:"".concat(2*i.baseUnit,"px ").concat(3*i.baseUnit,"px"),width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:t?void 0:r?a.primary:a.primary50}}},placeholder:function(e){var t=e.theme,n=t.spacing;return{label:"placeholder",color:t.colors.neutral50,gridArea:"1 / 1 / 2 / 3",marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2}},singleValue:function(e){var t=e.isDisabled,n=e.theme,r=n.spacing,o=n.colors;return{label:"singleValue",color:t?o.neutral40:o.neutral80,gridArea:"1 / 1 / 2 / 3",marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},valueContainer:function(e){var t=e.theme.spacing,n=e.isMulti,r=e.hasValue,o=e.selectProps.controlShouldRenderValue;return{alignItems:"center",display:n&&r&&o?"flex":"grid",flex:1,flexWrap:"wrap",padding:"".concat(t.baseUnit/2,"px ").concat(2*t.baseUnit,"px"),WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"}}},Fn={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},Nn={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:yt(),captureMenuScroll:!yt(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=ot({ignoreCase:!0,ignoreAccents:!0,stringify:wn,trim:!0,matchFrom:"any"},undefined),r=n.ignoreCase,o=n.ignoreAccents,i=n.stringify,a=n.trim,s=n.matchFrom,l=a?yn(t):t,u=a?yn(i(e)):i(e);return r&&(l=l.toLowerCase(),u=u.toLowerCase()),o&&(l=bn(l),u=gn(u)),"start"===s?u.substr(0,l.length)===l:u.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0};function Hn(e,t,n,r){return{type:"option",data:t,isDisabled:Wn(e,t,n),isSelected:Gn(e,t,n),label:zn(e,t),value:Bn(e,t),index:r}}function jn(e,t){return e.options.map((function(n,r){if("options"in n){var o=n.options.map((function(n,r){return Hn(e,n,t,r)})).filter((function(t){return Un(e,t)}));return o.length>0?{type:"group",data:n,options:o,index:r}:void 0}var i=Hn(e,n,t,r);return Un(e,i)?i:void 0})).filter(Ct)}function $n(e){return e.reduce((function(e,t){return"group"===t.type?e.push.apply(e,rn(t.options.map((function(e){return e.data})))):e.push(t.data),e}),[])}function Un(e,t){var n=e.inputValue,r=void 0===n?"":n,o=t.data,i=t.isSelected,a=t.label,s=t.value;return(!qn(e)||!i)&&Yn(e,{label:a,value:s,data:o},r)}var zn=function(e,t){return e.getOptionLabel(t)},Bn=function(e,t){return e.getOptionValue(t)};function Wn(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function Gn(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var r=Bn(e,t);return n.some((function(t){return Bn(e,t)===r}))}function Yn(e,t,n){return!e.filterOption||e.filterOption(t,n)}var qn=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},Xn=1,Kn=function(e){Je(n,e);var t=st(n);function n(e){var r;return Xe(this,n),(r=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.instancePrefix="",r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,o=n.onChange,i=n.name;t.name=i,r.ariaOnChange(e,t),o(e,t)},r.setValue=function(e,t,n){var o=r.props,i=o.closeMenuOnSelect,a=o.isMulti,s=o.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:s}),i&&(r.setState({inputIsHiddenAfterUpdate:!a}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,o=t.isMulti,i=t.name,a=r.state.selectValue,s=o&&r.isOptionSelected(e,a),l=r.isOptionDisabled(e,a);if(s){var u=r.getOptionValue(e);r.setValue(a.filter((function(e){return r.getOptionValue(e)!==u})),"deselect-option",e)}else{if(l)return void r.ariaOnChange(e,{action:"select-option",option:e,name:i});o?r.setValue([].concat(rn(a),[e]),"select-option",e):r.setValue(e,"select-option")}n&&r.blurInput()},r.removeValue=function(e){var t=r.props.isMulti,n=r.state.selectValue,o=r.getOptionValue(e),i=n.filter((function(e){return r.getOptionValue(e)!==o})),a=kt(t,i,i[0]||null);r.onChange(a,{action:"remove-value",removedValue:e}),r.focusInput()},r.clearValue=function(){var e=r.state.selectValue;r.onChange(kt(r.props.isMulti,[],null),{action:"clear",removedValues:e})},r.popValue=function(){var e=r.props.isMulti,t=r.state.selectValue,n=t[t.length-1],o=t.slice(0,t.length-1),i=kt(e,o,o[0]||null);r.onChange(i,{action:"pop-value",removedValue:n})},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n5||i>5}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=r.props.inputValue,n=e.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(n,{action:"input-change",prevInputValue:t}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){r.props.onFocus&&r.props.onFocus(e),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(e){var t=r.props.inputValue;r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(e),r.onInputChange("",{action:"input-blur",prevInputValue:t}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))},r.onOptionHover=function(e){r.blockOptionHover||r.state.focusedOption===e||r.setState({focusedOption:e})},r.shouldHideSelectedOptions=function(){return qn(r.props)},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,o=t.backspaceRemovesValue,i=t.escapeClearsValue,a=t.inputValue,s=t.isClearable,l=t.isDisabled,u=t.menuIsOpen,c=t.onKeyDown,p=t.tabSelectsValue,d=t.openMenuOnFocus,f=r.state,m=f.focusedOption,h=f.focusedValue,v=f.selectValue;if(!(l||"function"==typeof c&&(c(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||a)return;r.focusValue("previous");break;case"ArrowRight":if(!n||a)return;r.focusValue("next");break;case"Delete":case"Backspace":if(a)return;if(h)r.removeValue(h);else{if(!o)return;n?r.popValue():s&&r.clearValue()}break;case"Tab":if(r.isComposing)return;if(e.shiftKey||!u||!p||!m||d&&r.isOptionSelected(m,v))return;r.selectOption(m);break;case"Enter":if(229===e.keyCode)break;if(u){if(!m)return;if(r.isComposing)return;r.selectOption(m);break}return;case"Escape":u?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:a}),r.onMenuClose()):s&&i&&r.clearValue();break;case" ":if(a)return;if(!u){r.openMenu("first");break}if(!m)return;r.selectOption(m);break;case"ArrowUp":u?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":u?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!u)return;r.focusOption("pageup");break;case"PageDown":if(!u)return;r.focusOption("pagedown");break;case"Home":if(!u)return;r.focusOption("first");break;case"End":if(!u)return;r.focusOption("last");break;default:return}e.preventDefault()}},r.instancePrefix="react-select-"+(r.props.instanceId||++Xn),r.state.selectValue=dt(e.value),r}return Qe(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentDidUpdate",value:function(e){var t,n,r,o,i,a=this.props,s=a.isDisabled,l=a.menuIsOpen,u=this.state.isFocused;(u&&!s&&e.isDisabled||u&&l&&!e.menuIsOpen)&&this.focusInput(),u&&s&&!e.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,r=t.getBoundingClientRect(),o=n.getBoundingClientRect(),i=n.offsetHeight/3,o.bottom+i>r.bottom?vt(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+i,t.scrollHeight)):o.top-i-1&&(a=s)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:i[a]},(function(){return t.onMenuOpen()}))}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,r=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=n.indexOf(r);r||(o=-1);var i=n.length-1,a=-1;if(n.length){switch(e){case"previous":a=0===o?0:-1===o?i:o-1;break;case"next":o>-1&&o0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var o=0,i=r.indexOf(n);n||(i=-1),"up"===e?o=i>0?i-1:r.length-1:"down"===e?o=(i+1)%r.length:"pageup"===e?(o=i-t)<0&&(o=0):"pagedown"===e?(o=i+t)>r.length-1&&(o=r.length-1):"last"===e&&(o=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[o],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(Fn):ot(ot({},Fn),this.props.theme):Fn}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getValue,o=this.selectOption,i=this.setValue,a=this.props,s=a.isMulti,l=a.isRtl,u=a.options;return{clearValue:e,cx:t,getStyles:n,getValue:r,hasValue:this.hasValue(),isMulti:s,isRtl:l,options:u,selectOption:o,selectProps:a,setValue:i,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return Wn(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return Gn(this.props,e,t)}},{key:"filterOption",value:function(e,t){return Yn(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,o=e.inputValue,i=e.tabIndex,s=e.form,l=e.menuIsOpen,u=this.getComponents().Input,p=this.state,d=p.inputIsHidden,f=p.ariaSelection,m=this.commonProps,h=r||this.getElementId("input"),v=ot(ot(ot({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],role:"combobox"},l&&{"aria-controls":this.getElementId("listbox"),"aria-owns":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==f?void 0:f.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?c.createElement(u,a({},m,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:h,innerRef:this.getInputRef,isDisabled:t,isHidden:d,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:i,form:s,type:"text",value:o},v)):c.createElement(Sn,a({id:h,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ut,onFocus:this.onInputFocus,disabled:t,tabIndex:i,inputMode:"none",form:s,value:""},v))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,r=t.MultiValueContainer,o=t.MultiValueLabel,i=t.MultiValueRemove,s=t.SingleValue,l=t.Placeholder,u=this.commonProps,p=this.props,d=p.controlShouldRenderValue,f=p.isDisabled,m=p.isMulti,h=p.inputValue,v=p.placeholder,g=this.state,b=g.selectValue,y=g.focusedValue,w=g.isFocused;if(!this.hasValue()||!d)return h?null:c.createElement(l,a({},u,{key:"placeholder",isDisabled:f,isFocused:w,innerProps:{id:this.getElementId("placeholder")}}),v);if(m)return b.map((function(t,s){var l=t===y,p="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return c.createElement(n,a({},u,{components:{Container:r,Label:o,Remove:i},isFocused:l,isDisabled:f,key:p,index:s,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))}));if(h)return null;var O=b[0];return c.createElement(s,a({},u,{data:O,isDisabled:f}),this.formatOptionLabel(O,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,i=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||o)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return c.createElement(e,a({},t,{innerProps:s,isFocused:i}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,o=n.isLoading,i=this.state.isFocused;return e&&o?c.createElement(e,a({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:i})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,o=this.props.isDisabled,i=this.state.isFocused;return c.createElement(n,a({},r,{isDisabled:o,isFocused:i}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return c.createElement(e,a({},t,{innerProps:o,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,r=t.GroupHeading,o=t.Menu,i=t.MenuList,s=t.MenuPortal,l=t.LoadingMessage,u=t.NoOptionsMessage,p=t.Option,d=this.commonProps,f=this.state.focusedOption,m=this.props,h=m.captureMenuScroll,v=m.inputValue,g=m.isLoading,b=m.loadingMessage,y=m.minMenuHeight,w=m.maxMenuHeight,O=m.menuIsOpen,S=m.menuPlacement,x=m.menuPosition,C=m.menuPortalTarget,k=m.menuShouldBlockScroll,P=m.menuShouldScrollIntoView,E=m.noOptionsMessage,M=m.onMenuScrollToTop,I=m.onMenuScrollToBottom;if(!O)return null;var V,R=function(t,n){var r=t.type,o=t.data,i=t.isDisabled,s=t.isSelected,l=t.label,u=t.value,m=f===o,h=i?void 0:function(){return e.onOptionHover(o)},v=i?void 0:function(){return e.selectOption(o)},g="".concat(e.getElementId("option"),"-").concat(n),b={id:g,onClick:v,onMouseMove:h,onMouseOver:h,tabIndex:-1};return c.createElement(p,a({},d,{innerProps:b,data:o,isDisabled:i,isSelected:s,key:g,label:l,type:r,value:u,isFocused:m,innerRef:m?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())V=this.getCategorizedOptions().map((function(t){if("group"===t.type){var o=t.data,i=t.options,s=t.index,l="".concat(e.getElementId("group"),"-").concat(s),u="".concat(l,"-heading");return c.createElement(n,a({},d,{key:l,data:o,options:i,Heading:r,headingProps:{id:u,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map((function(e){return R(e,"".concat(s,"-").concat(e.index))})))}if("option"===t.type)return R(t,"".concat(t.index))}));else if(g){var A=b({inputValue:v});if(null===A)return null;V=c.createElement(l,d,A)}else{var T=E({inputValue:v});if(null===T)return null;V=c.createElement(u,d,T)}var L={minMenuHeight:y,maxMenuHeight:w,menuPlacement:S,menuPosition:x,menuShouldScrollIntoView:P},D=c.createElement(It,a({},d,L),(function(t){var n=t.ref,r=t.placerProps,s=r.placement,l=r.maxHeight;return c.createElement(o,a({},d,L,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove,id:e.getElementId("listbox")},isLoading:g,placement:s}),c.createElement(Ln,{captureEnabled:h,onTopArrive:M,onBottomArrive:I,lockEnabled:k},(function(t){return c.createElement(i,a({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},isLoading:g,maxHeight:l,focusedOption:f}),V)})))}));return C||"fixed"===x?c.createElement(s,a({},d,{appendTo:C,controlElement:this.controlRef,menuPlacement:S,menuPosition:x}),D):D}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,o=t.isMulti,i=t.name,a=this.state.selectValue;if(i&&!r){if(o){if(n){var s=a.map((function(t){return e.getOptionValue(t)})).join(n);return c.createElement("input",{name:i,type:"hidden",value:s})}var l=a.length>0?a.map((function(t,n){return c.createElement("input",{key:"i-".concat(n),name:i,type:"hidden",value:e.getOptionValue(t)})})):c.createElement("input",{name:i,type:"hidden"});return c.createElement("div",null,l)}var u=a[0]?this.getOptionValue(a[0]):"";return c.createElement("input",{name:i,type:"hidden",value:u})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,r=t.focusedOption,o=t.focusedValue,i=t.isFocused,s=t.selectValue,l=this.getFocusableOptions();return c.createElement(cn,a({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:r,focusedValue:o,isFocused:i,selectValue:s,focusableOptions:l}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,o=e.ValueContainer,i=this.props,s=i.className,l=i.id,u=i.isDisabled,p=i.menuIsOpen,d=this.state.isFocused,f=this.commonProps=this.getCommonProps();return c.createElement(r,a({},f,{className:s,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:u,isFocused:d}),this.renderLiveRegion(),c.createElement(t,a({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:u,isFocused:d,menuIsOpen:p}),c.createElement(o,a({},f,{isDisabled:u}),this.renderPlaceholderOrValue(),this.renderInput()),c.createElement(n,a({},f,{isDisabled:u}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r=t.clearFocusValueOnUpdate,o=t.inputIsHiddenAfterUpdate,i=t.ariaSelection,a=t.isFocused,s=t.prevWasFocused,l=e.options,u=e.value,c=e.menuIsOpen,p=e.inputValue,d=e.isMulti,f=dt(u),m={};if(n&&(u!==n.value||l!==n.options||c!==n.menuIsOpen||p!==n.inputValue)){var h=c?function(e,t){return $n(jn(e,t))}(e,f):[],v=r?function(e,t){var n=e.focusedValue,r=e.selectValue.indexOf(n);if(r>-1){if(t.indexOf(n)>-1)return n;if(r-1?n:t[0]}(t,h);m={selectValue:f,focusedOption:g,focusedValue:v,clearFocusValueOnUpdate:!1}}var b=null!=o&&e!==n?{inputIsHidden:o,inputIsHiddenAfterUpdate:void 0}:{},y=i,w=a&&s;return a&&!w&&(y={value:kt(d,f,f[0]||null),options:f,action:"initial-input-focus"},w=!s),"initial-input-focus"===(null==i?void 0:i.action)&&(y=null),ot(ot(ot({},m),b),{},{prevProps:e,ariaSelection:y,prevWasFocused:w})}}]),n}(c.Component);Kn.defaultProps=Nn;var Qn=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"],Zn=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"],Jn=(0,c.forwardRef)((function(e,t){var n=function(e){var t=e.defaultOptions,n=void 0!==t&&t,r=e.cacheOptions,o=void 0!==r&&r,i=e.loadOptions;e.options;var a=e.isLoading,s=void 0!==a&&a,l=e.onInputChange,u=e.filterOption,p=void 0===u?null:u,d=Be(e,Zn),f=d.inputValue,m=(0,c.useRef)(void 0),h=(0,c.useRef)(!1),v=Ye((0,c.useState)(Array.isArray(n)?n:void 0),2),g=v[0],b=v[1],y=Ye((0,c.useState)(void 0!==f?f:""),2),w=y[0],O=y[1],S=Ye((0,c.useState)(!0===n),2),x=S[0],C=S[1],k=Ye((0,c.useState)(void 0),2),P=k[0],E=k[1],M=Ye((0,c.useState)([]),2),I=M[0],V=M[1],R=Ye((0,c.useState)(!1),2),A=R[0],T=R[1],L=Ye((0,c.useState)({}),2),D=L[0],F=L[1],N=Ye((0,c.useState)(void 0),2),_=N[0],H=N[1],j=Ye((0,c.useState)(void 0),2),$=j[0],U=j[1];o!==$&&(F({}),U(o)),n!==_&&(b(Array.isArray(n)?n:void 0),H(n)),(0,c.useEffect)((function(){return h.current=!0,function(){h.current=!1}}),[]);var z=(0,c.useCallback)((function(e,t){if(!i)return t();var n=i(e,t);n&&"function"==typeof n.then&&n.then(t,(function(){return t()}))}),[i]);(0,c.useEffect)((function(){!0===n&&z(w,(function(e){h.current&&(b(e||[]),C(!!m.current))}))}),[]);var B=(0,c.useCallback)((function(e,t){var n=function(e,t,n){if(n){var r=n(e,t);if("string"==typeof r)return r}return e}(e,t,l);if(!n)return m.current=void 0,O(""),E(""),V([]),C(!1),void T(!1);if(o&&D[n])O(n),E(n),V(D[n]),C(!1),T(!1);else{var r=m.current={};O(n),C(!0),T(!P),z(n,(function(e){h&&r===m.current&&(m.current=void 0,C(!1),E(n),V(e||[]),T(!1),F(e?ot(ot({},D),{},et({},n,e)):D))}))}}),[o,z,P,D,l]),W=A?[]:w&&P?I:g||[];return ot(ot({},d),{},{options:W,isLoading:x||s,onInputChange:B,filterOption:p})}(e),r=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,r=e.defaultMenuIsOpen,o=void 0!==r&&r,i=e.defaultValue,a=void 0===i?null:i,s=e.inputValue,l=e.menuIsOpen,u=e.onChange,p=e.onInputChange,d=e.onMenuClose,f=e.onMenuOpen,m=e.value,h=Be(e,Qn),v=Ye((0,c.useState)(void 0!==s?s:n),2),g=v[0],b=v[1],y=Ye((0,c.useState)(void 0!==l?l:o),2),w=y[0],O=y[1],S=Ye((0,c.useState)(void 0!==m?m:a),2),x=S[0],C=S[1],k=(0,c.useCallback)((function(e,t){"function"==typeof u&&u(e,t),C(e)}),[u]),P=(0,c.useCallback)((function(e,t){var n;"function"==typeof p&&(n=p(e,t)),b(void 0!==n?n:e)}),[p]),E=(0,c.useCallback)((function(){"function"==typeof f&&f(),O(!0)}),[f]),M=(0,c.useCallback)((function(){"function"==typeof d&&d(),O(!1)}),[d]),I=void 0!==s?s:g,V=void 0!==l?l:w,R=void 0!==m?m:x;return ot(ot({},h),{},{inputValue:I,menuIsOpen:V,onChange:k,onInputChange:P,onMenuClose:M,onMenuOpen:E,value:R})}(n);return c.createElement(Kn,a({ref:t},r))}));const er=Jn;function tr(e,t,n,r){var o,i=!1,a=0;function s(){o&&clearTimeout(o)}function l(){for(var l=arguments.length,u=new Array(l),c=0;ce?f():!0!==t&&(o=setTimeout(r?m:f,void 0===r?e-d:e)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),l.cancel=function(){s(),i=!0},l}const nr=window.lodash,rr=window.wp.apiFetch;var or=n.n(rr);const ir=window.wp.url;var ar=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,sr=ge((function(e){return ar.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),lr=function(e){return"theme"!==e},ur=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?sr:lr},cr=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},pr=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return fe(t,n,r),Ie((function(){return me(t,n,r)})),null};var dr=function e(t,n){var r,o,i=t.__emotion_real===t,s=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,o=n.target);var l=cr(t,n,i),u=l||ur(s),p=!u("as");return function(){var d=arguments,f=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&f.push("label:"+r+";"),null==d[0]||void 0===d[0].raw)f.push.apply(f,d);else{f.push(d[0][0]);for(var m=d.length,h=1;h{let{name:t,id:n}=e;return(0,s.sprintf)( // Translators: %1$s = User's name; %2$s = User's id. -(0,s._x)("%1$s (ID# %2$d)","User search result label","lifterlms"),t,n)}),(0,r.createElement)(br,a({searchPath:t,className:n,placeholder:o,formatSearchResultLabel:i,additionalSearchArgs:l},u))}const Or="llms-spinning",Sr="default";function xr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sr;const n=document.createElement("div"),r=(0,s.__)("Loading…","lifterlms");return n.innerHTML=`${r}`,n.classList.add(Or),e.appendChild(n),n}function Cr(e){if((e="string"==typeof e?document.querySelectorAll(e):e)instanceof NodeList)return Array.from(e);const t=[];return e instanceof Element?t.push(e):"undefined"!=typeof jQuery&&e instanceof jQuery&&e.toArray().forEach((e=>t.push(e))),t}function kr(e){const t=e.querySelectorAll(".llms-spinning");return t.length?Array.from(t).find((t=>e===t.parentNode)):null}function Pr(){const e="llms-spinner-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.textContent="\n\t.llms-spinning {\n\t\tbackground: rgba( 250, 250, 250, 0.7 );\n\t\tbottom: 0;\n\t\tdisplay: none;\n\t\tleft: 0;\n\t\tposition: absolute;\n\t\tright: 0;\n\t\ttop: 0;\n\t\tz-index: 2;\n\t}\n\n\t.llms-spinner {\n\t\tanimation: llms-spinning 1.5s linear infinite;\n\t\tbox-sizing: border-box;\n\t\tborder: 4px solid #313131;\n\t\tborder-radius: 50%;\n\t\theight: 40px;\n\t\tleft: 50%;\n\t\tmargin-left: -20px;\n\t\tmargin-top: -20px;\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\twidth: 40px;\n\n\t}\n\n\t.llms-spinner.small {\n\t\tborder-width: 2px;\n\t\theight: 20px;\n\t\tmargin-left: -10px;\n\t\tmargin-top: -10px;\n\t\twidth: 20px;\n\t}\n\n\t@keyframes llms-spinning {\n\t\t0% {\n\t\t\ttransform: rotate( 0deg )\n\t\t}\n\t\t50% {\n\t\t\tborder-radius: 5%;\n\t\t}\n\t\t100% {\n\t\t\ttransform: rotate( 220deg) \n\t\t}\n\t}\n".replace(/\n/g,"").replace(/\t/g," ").replace(/\s\s+/g," "),t.id=e,document.head.appendChild(t)}}function Er(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sr,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];Pr();const r=Cr(e);if(!r.length)return null;const o=r[0],i=kr(o)||xr(o,t);return n&&"undefined"!=typeof jQuery?jQuery(i):i}function Mr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sr;Cr(e).forEach((e=>{const n=Er(e,t,!1);n&&(n.style.display="block")}))}function Ir(e){Cr(e).forEach((e=>{const t=Er(e,Sr,!1);t&&(t.style.display="none")}))}window.llms=window.llms||{};const{components:Vr={}}=window.llms;window.llms.components={...Vr,...t}}()}(); \ No newline at end of file +(0,s._x)("%1$s (ID# %2$d)","User search result label","lifterlms"),t,n)}),(0,r.createElement)(br,a({searchPath:t,className:n,placeholder:o,formatSearchResultLabel:i,additionalSearchArgs:l},u))}const Or="llms-spinning",Sr="default";function xr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sr;const n=document.createElement("div"),r=(0,s.__)("Loading…","lifterlms");return n.innerHTML=`${r}`,n.classList.add(Or),e.appendChild(n),n}function Cr(e){if((e="string"==typeof e?document.querySelectorAll(e):e)instanceof NodeList)return Array.from(e);const t=[];return e instanceof Element?t.push(e):"undefined"!=typeof jQuery&&e instanceof jQuery&&e.toArray().forEach((e=>t.push(e))),t}function kr(e){const t=e.querySelectorAll(".llms-spinning");return t.length?Array.from(t).find((t=>e===t.parentNode)):null}function Pr(){const e="llms-spinner-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.textContent="\n\t.llms-spinning {\n\t\tbackground: rgba( 250, 250, 250, 0.7 );\n\t\tbottom: 0;\n\t\tdisplay: none;\n\t\tleft: 0;\n\t\tposition: absolute;\n\t\tright: 0;\n\t\ttop: 0;\n\t\tz-index: 2;\n\t}\n\n\t.llms-spinner {\n\t\tanimation: llms-spinning 1.5s linear infinite;\n\t\tbox-sizing: border-box;\n\t\tborder: 4px solid #313131;\n\t\tborder-radius: 50%;\n\t\theight: 40px;\n\t\tleft: 50%;\n\t\tmargin-left: -20px;\n\t\tmargin-top: -20px;\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\twidth: 40px;\n\n\t}\n\n\t.llms-spinner.small {\n\t\tborder-width: 2px;\n\t\theight: 20px;\n\t\tmargin-left: -10px;\n\t\tmargin-top: -10px;\n\t\twidth: 20px;\n\t}\n\n\t@keyframes llms-spinning {\n\t\t0% {\n\t\t\ttransform: rotate( 0deg )\n\t\t}\n\t\t50% {\n\t\t\tborder-radius: 5%;\n\t\t}\n\t\t100% {\n\t\t\ttransform: rotate( 220deg) \n\t\t}\n\t}\n".replace(/\n/g,"").replace(/\t/g," ").replace(/\s\s+/g," "),t.id=e,document.head.appendChild(t)}}function Er(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sr,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];Pr();const r=Cr(e);if(!r.length)return null;const o=r[0],i=kr(o)||xr(o,t);return n&&"undefined"!=typeof jQuery?jQuery(i):i}function Mr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Sr;Cr(e).forEach((e=>{const n=Er(e,t,!1);n&&(n.style.display="block")}))}function Ir(e){Cr(e).forEach((e=>{const t=Er(e,Sr,!1);t&&(t.style.display="none")}))}window.llms=window.llms||{};const{components:Vr={}}=window.llms;window.llms.components={...Vr,...t}})()})(); \ No newline at end of file diff --git a/assets/js/llms-icons.asset.php b/assets/js/llms-icons.asset.php index a1cf4493cf..00e26066de 100644 --- a/assets/js/llms-icons.asset.php +++ b/assets/js/llms-icons.asset.php @@ -1 +1 @@ - array('wp-element', 'wp-polyfill', 'wp-primitives'), 'version' => 'f1d3771f4f5321a592cb'); + array('wp-element', 'wp-polyfill', 'wp-primitives'), 'version' => '310db75371592a3a41ad'); diff --git a/assets/js/llms-icons.js b/assets/js/llms-icons.js index f28b3da1c0..e2dcdf8be7 100644 --- a/assets/js/llms-icons.js +++ b/assets/js/llms-icons.js @@ -1 +1 @@ -!function(){"use strict";var e={d:function(c,t){for(var l in t)e.o(t,l)&&!e.o(c,l)&&Object.defineProperty(c,l,{enumerable:!0,get:t[l]})},o:function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},c={};e.r(c),e.d(c,{Icon:function(){return l},lifterlms:function(){return o}});var t=window.wp.element,l=function(e){let{icon:c,size:l=24,...n}=e;return(0,t.cloneElement)(c,{width:l,height:l,...n})},n=window.wp.primitives,o=(0,t.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 85 85",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:1.41421}},(0,t.createElement)(n.G,{id:"lifterlms-icon"},(0,t.createElement)(n.Path,{d:"M29.061,50.631l-2.258,-1.29l-6.066,10.452c-5.483,-7.613 -6.58,-17.873 -2.322,-26.712l0.064,-0.065c0.258,-0.581 0.581,-1.097 0.839,-1.613c4.323,-7.485 11.873,-12.067 19.873,-12.905c1.42,-1.935 2.969,-3.614 4.711,-5.226c-11.421,-0.645 -22.843,5.032 -28.972,15.615c-7.872,13.679 -4.258,30.841 7.872,40.263l6.065,-18.003c0.065,-0.128 0.13,-0.323 0.194,-0.516m36.908,-16.712c3.227,7.421 3.033,16.195 -1.291,23.681c-0.257,0.516 -0.58,1.031 -0.903,1.548l-0.064,0.066c-5.549,8.129 -14.97,12.323 -24.326,11.355l6.066,-10.453l-2.259,-1.291c-0.129,0.13 -0.258,0.259 -0.387,0.389l-12.518,14.259c14.196,5.808 30.907,0.323 38.779,-13.357c6.13,-10.581 5.356,-23.293 -0.967,-32.842c-0.517,2.257 -1.162,4.516 -2.13,6.645"}),(0,t.createElement)(n.Path,{d:"M44.999,50.243c-1.614,2.13 -4.194,3.228 -6.968,3.485c-0.839,0.065 -1.614,-0.387 -2.001,-1.161c-1.162,-2.517 -1.548,-5.291 -0.451,-7.743l-12.648,-7.291c-0.838,-0.516 -1.225,-1.356 -0.967,-2.258c0.193,-0.904 0.967,-1.55 1.871,-1.55l12.84,-0.451c0.968,-3.936 2.581,-7.678 4.904,-11.163c3.678,-5.484 8.904,-9.549 15.034,-12.001c1.485,-0.581 2.968,-1.096 4.453,-1.484c1.096,-0.258 2.193,0.388 2.451,1.421c0.452,1.482 0.775,3.031 1.033,4.579c0.903,6.582 -0.065,13.163 -2.903,19.099c-1.807,3.743 -4.324,6.97 -7.228,9.808l6.001,11.292c0.452,0.839 0.323,1.807 -0.387,2.452c-0.645,0.645 -1.614,0.71 -2.387,0.258l-12.647,-7.292Zm9.549,-27.035c1.936,1.162 2.581,3.614 1.485,5.549c-1.098,1.936 -3.613,2.582 -5.55,1.485c-1.935,-1.098 -2.58,-3.614 -1.484,-5.55c1.162,-1.935 3.614,-2.581 5.549,-1.484"}),(0,t.createElement)(n.Path,{d:"M26.093,72.118l13.679,-15.551c-0.516,0.065 -1.032,0.129 -1.549,0.194c-2.064,0.129 -4,-0.968 -4.902,-2.903c-0.259,-0.452 -0.453,-0.904 -0.646,-1.42l-6.582,19.68Z"})));window.llms=window.llms||{},window.llms.icons=c}(); \ No newline at end of file +(()=>{"use strict";var e={d:(c,l)=>{for(var t in l)e.o(l,t)&&!e.o(c,t)&&Object.defineProperty(c,t,{enumerable:!0,get:l[t]})},o:(e,c)=>Object.prototype.hasOwnProperty.call(e,c),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},c={};e.r(c),e.d(c,{Icon:()=>t,lifterlms:()=>n});const l=window.wp.element,t=function(e){let{icon:c,size:t=24,...o}=e;return(0,l.cloneElement)(c,{width:t,height:t,...o})},o=window.wp.primitives,n=(0,l.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 85 85",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:1.41421}},(0,l.createElement)(o.G,{id:"lifterlms-icon"},(0,l.createElement)(o.Path,{d:"M29.061,50.631l-2.258,-1.29l-6.066,10.452c-5.483,-7.613 -6.58,-17.873 -2.322,-26.712l0.064,-0.065c0.258,-0.581 0.581,-1.097 0.839,-1.613c4.323,-7.485 11.873,-12.067 19.873,-12.905c1.42,-1.935 2.969,-3.614 4.711,-5.226c-11.421,-0.645 -22.843,5.032 -28.972,15.615c-7.872,13.679 -4.258,30.841 7.872,40.263l6.065,-18.003c0.065,-0.128 0.13,-0.323 0.194,-0.516m36.908,-16.712c3.227,7.421 3.033,16.195 -1.291,23.681c-0.257,0.516 -0.58,1.031 -0.903,1.548l-0.064,0.066c-5.549,8.129 -14.97,12.323 -24.326,11.355l6.066,-10.453l-2.259,-1.291c-0.129,0.13 -0.258,0.259 -0.387,0.389l-12.518,14.259c14.196,5.808 30.907,0.323 38.779,-13.357c6.13,-10.581 5.356,-23.293 -0.967,-32.842c-0.517,2.257 -1.162,4.516 -2.13,6.645"}),(0,l.createElement)(o.Path,{d:"M44.999,50.243c-1.614,2.13 -4.194,3.228 -6.968,3.485c-0.839,0.065 -1.614,-0.387 -2.001,-1.161c-1.162,-2.517 -1.548,-5.291 -0.451,-7.743l-12.648,-7.291c-0.838,-0.516 -1.225,-1.356 -0.967,-2.258c0.193,-0.904 0.967,-1.55 1.871,-1.55l12.84,-0.451c0.968,-3.936 2.581,-7.678 4.904,-11.163c3.678,-5.484 8.904,-9.549 15.034,-12.001c1.485,-0.581 2.968,-1.096 4.453,-1.484c1.096,-0.258 2.193,0.388 2.451,1.421c0.452,1.482 0.775,3.031 1.033,4.579c0.903,6.582 -0.065,13.163 -2.903,19.099c-1.807,3.743 -4.324,6.97 -7.228,9.808l6.001,11.292c0.452,0.839 0.323,1.807 -0.387,2.452c-0.645,0.645 -1.614,0.71 -2.387,0.258l-12.647,-7.292Zm9.549,-27.035c1.936,1.162 2.581,3.614 1.485,5.549c-1.098,1.936 -3.613,2.582 -5.55,1.485c-1.935,-1.098 -2.58,-3.614 -1.484,-5.55c1.162,-1.935 3.614,-2.581 5.549,-1.484"}),(0,l.createElement)(o.Path,{d:"M26.093,72.118l13.679,-15.551c-0.516,0.065 -1.032,0.129 -1.549,0.194c-2.064,0.129 -4,-0.968 -4.902,-2.903c-0.259,-0.452 -0.453,-0.904 -0.646,-1.42l-6.582,19.68Z"})));window.llms=window.llms||{},window.llms.icons=c})(); \ No newline at end of file diff --git a/assets/js/llms-quill-wordcount.asset.php b/assets/js/llms-quill-wordcount.asset.php index 7be725e3af..984db409fb 100644 --- a/assets/js/llms-quill-wordcount.asset.php +++ b/assets/js/llms-quill-wordcount.asset.php @@ -1 +1 @@ - array('wp-polyfill'), 'version' => 'bd12f5021e591cbfde2d'); + array('wp-polyfill'), 'version' => '16fa5ed33ce84c945b96'); diff --git a/assets/js/llms-quill-wordcount.js b/assets/js/llms-quill-wordcount.js index 7c584bdec2..9f7e7610de 100644 --- a/assets/js/llms-quill-wordcount.js +++ b/assets/js/llms-quill-wordcount.js @@ -1 +1 @@ -!function(){var n={850:function(n){n.exports=(()=>{"use strict";var n={314:(n,t,e)=>{e.r(t),e.d(t,{default:()=>a,wordsCount:()=>u,wordsSplit:()=>l,wordsDetect:()=>i});var r=[",",",",".","。",":",":",";",";","[","]","【","]","】","{","{","}","}","(","(",")",")","<","《",">","》","$","¥","!","!","?","?","~","~","'","’",'"',"“","”","*","/","\\","&","%","@","#","^","、","、","、","、"],o={words:[],count:0},i=function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n)return o;var e=String(n);if(""===e.trim())return o;var i=t.punctuationAsBreaker?" ":"",u=t.disableDefaultPunctuation?[]:r,l=t.punctuation||[];u.concat(l).forEach((function(n){var t=new RegExp("\\"+n,"g");e=e.replace(t,i)})),e=(e=(e=(e=e.replace(/[\uFF00-\uFFEF\u2000-\u206F]/g,"")).replace(/\s+/," ")).split(" ")).filter((function(n){return n.trim()}));var a=new RegExp("(\\d+)|[a-zA-ZÀ-ÿĀ-ſƀ-ɏɐ-ʯḀ-ỿЀ-ӿԀ-ԯഀ-ൿ]+|[⺀-⻿⼀-⿟ -〿㇀-㇯㈀-㋿㌀-㏿㐀-㿿䀀-䶿一-俿倀-忿怀-濿瀀-翿耀-迿退-鿿豈-﫿぀-ゟ゠-ヿㇰ-ㇿ㆐-㆟ᄀ-ᇿ㄰-㆏ꥠ-꥿가-꿿뀀-뿿쀀-쿿퀀-힯ힰ-퟿]","g"),c=[];return e.forEach((function(n){var t,e=[];do{(t=a.exec(n))&&e.push(t[0])}while(t);0===e.length?c.push(n):c=c.concat(e)})),{words:c,count:c.length}},u=function(n){return i(n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).count},l=function(n){return i(n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).words};const a=u}},t={};function e(r){if(t[r])return t[r].exports;var o=t[r]={exports:{}};return n[r](o,o.exports,e),o.exports}return e.d=(n,t)=>{for(var r in t)e.o(t,r)&&!e.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:t[r]})},e.o=(n,t)=>Object.prototype.hasOwnProperty.call(n,t),e.r=n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},e(314)})()}},t={};function e(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return n[r].call(i.exports,i,i.exports,e),i.exports}e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,{a:t}),t},e.d=function(n,t){for(var r in t)e.o(t,r)&&!e.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:t[r]})},e.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},function(){"use strict";var n=e(850),t=e.n(n);function r(n){return(new Intl.NumberFormat).format(n)}function o(n,t,e){const o=document.createElement("i");return o.className=`ql-wordcount-${n}`,o.style.opacity="0.5",o.style.marginRight="10px",o.innerHTML=`${t}: ${r(e)}`,o}function i(n){const{l10n:t,min:e,max:r}=n,i=document.createElement("div");return i.className="ql-wordcount ql-toolbar ql-snow",i.style.marginTop="-1px",i.style.fontSize="85%",e&&i.appendChild(o("min",t.min,e)),r&&i.appendChild(o("max",t.max,r)),i}function u(n,t){const{min:e,max:r,colorWarning:o,colorError:i}=t;let u="initial";return e&&nr?u=i:r&&n>=.9*r&&(u=o),u}function l(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n={min:null,max:null,colorWarning:"#ff922b",colorError:"#e5554e",onChange:()=>{},l10n:{},...n},n.l10n={singular:"word",plural:"words",min:"Minimum",max:"Maximum",...n.l10n},n}function a(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=l(e);const o=i(e),a=document.createElement("span");a.className="ql-wordcount-counter",a.style.float="right",o.appendChild(a);const c=()=>{const o=t()(n.getText());a.style.color=u(o,e);const i=1===o?e.l10n.singular:e.l10n.plural;a.innerHTML=r(o)+" "+i,e.onChange(n,e,o)};c(),n.container.parentNode.insertBefore(o,n.container.nextSibling),n.on("text-change",c)}!function(){const{Quill:n}=window;void 0!==n&&n.register("modules/wordcount",a)}()}()}(); \ No newline at end of file +(()=>{var n={850:function(n){n.exports=(()=>{"use strict";var n={314:(n,e,t)=>{t.r(e),t.d(e,{default:()=>u,wordsCount:()=>l,wordsSplit:()=>a,wordsDetect:()=>i});var r=[",",",",".","。",":",":",";",";","[","]","【","]","】","{","{","}","}","(","(",")",")","<","《",">","》","$","¥","!","!","?","?","~","~","'","’",'"',"“","”","*","/","\\","&","%","@","#","^","、","、","、","、"],o={words:[],count:0},i=function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n)return o;var t=String(n);if(""===t.trim())return o;var i=e.punctuationAsBreaker?" ":"",l=e.disableDefaultPunctuation?[]:r,a=e.punctuation||[];l.concat(a).forEach((function(n){var e=new RegExp("\\"+n,"g");t=t.replace(e,i)})),t=(t=(t=(t=t.replace(/[\uFF00-\uFFEF\u2000-\u206F]/g,"")).replace(/\s+/," ")).split(" ")).filter((function(n){return n.trim()}));var u=new RegExp("(\\d+)|[a-zA-ZÀ-ÿĀ-ſƀ-ɏɐ-ʯḀ-ỿЀ-ӿԀ-ԯഀ-ൿ]+|[⺀-⻿⼀-⿟ -〿㇀-㇯㈀-㋿㌀-㏿㐀-㿿䀀-䶿一-俿倀-忿怀-濿瀀-翿耀-迿退-鿿豈-﫿぀-ゟ゠-ヿㇰ-ㇿ㆐-㆟ᄀ-ᇿ㄰-㆏ꥠ-꥿가-꿿뀀-뿿쀀-쿿퀀-힯ힰ-퟿]","g"),c=[];return t.forEach((function(n){var e,t=[];do{(e=u.exec(n))&&t.push(e[0])}while(e);0===t.length?c.push(n):c=c.concat(t)})),{words:c,count:c.length}},l=function(n){return i(n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).count},a=function(n){return i(n,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).words};const u=l}},e={};function t(r){if(e[r])return e[r].exports;var o=e[r]={exports:{}};return n[r](o,o.exports,t),o.exports}return t.d=(n,e)=>{for(var r in e)t.o(e,r)&&!t.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),t.r=n=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t(314)})()}},e={};function t(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return n[r].call(i.exports,i,i.exports,t),i.exports}t.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return t.d(e,{a:e}),e},t.d=(n,e)=>{for(var r in e)t.o(e,r)&&!t.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),(()=>{"use strict";var n=t(850),e=t.n(n);function r(n){return(new Intl.NumberFormat).format(n)}function o(n,e,t){const o=document.createElement("i");return o.className=`ql-wordcount-${n}`,o.style.opacity="0.5",o.style.marginRight="10px",o.innerHTML=`${e}: ${r(t)}`,o}function i(n){const{l10n:e,min:t,max:r}=n,i=document.createElement("div");return i.className="ql-wordcount ql-toolbar ql-snow",i.style.marginTop="-1px",i.style.fontSize="85%",t&&i.appendChild(o("min",e.min,t)),r&&i.appendChild(o("max",e.max,r)),i}function l(n,e){const{min:t,max:r,colorWarning:o,colorError:i}=e;let l="initial";return t&&nr?l=i:r&&n>=.9*r&&(l=o),l}function a(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n={min:null,max:null,colorWarning:"#ff922b",colorError:"#e5554e",onChange:()=>{},l10n:{},...n},n.l10n={singular:"word",plural:"words",min:"Minimum",max:"Maximum",...n.l10n},n}function u(n){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=a(t);const o=i(t),u=document.createElement("span");u.className="ql-wordcount-counter",u.style.float="right",o.appendChild(u);const c=()=>{const o=e()(n.getText());u.style.color=l(o,t);const i=1===o?t.l10n.singular:t.l10n.plural;u.innerHTML=r(o)+" "+i,t.onChange(n,t,o)};c(),n.container.parentNode.insertBefore(o,n.container.nextSibling),n.on("text-change",c)}!function(){const{Quill:n}=window;void 0!==n&&n.register("modules/wordcount",u)}()})()})(); \ No newline at end of file diff --git a/assets/js/llms-quiz.min.js b/assets/js/llms-quiz.min.js index 7a8e569903..597c95192d 100644 --- a/assets/js/llms-quiz.min.js +++ b/assets/js/llms-quiz.min.js @@ -1,2 +1,2 @@ -!function(c){var t={$buttons:null,$container:null,$ui:null,attempt_key:null,current_question:0,total_questions:0,questions:{},validators:{},status:null,bind:function(){var e=this;c("#llms_start_quiz").on("click",function(t){t.preventDefault(),e.start_quiz()}),c(".llms-donut").each(function(){LLMS.Donut(c(this))}),c("#llms-quiz-attempt-select").on("change",function(){var t=c(this).val();t&&(window.location.href=t)}),c(window).on("beforeunload",function(){if(e.status)return LLMS.l10n.translate("Are you sure you wish to quit this quiz attempt?")}),c(window).on("unload",function(){e.status&&e.complete_quiz()}),c(document).on("llms-post-append-question",e.post_append_question),this.register_validator("content",this.validate),this.register_validator("choice",this.validate_choice),this.register_validator("picture_choice",this.validate_choice),this.register_validator("true_false",this.validate_choice)},add_error:function(t){this.$container.find(".llms-error").remove();var e=c('

'+t+'

');e.on("click","a",function(t){t.preventDefault(),e.fadeOut("200"),setTimeout(function(){e.remove()},210)}),this.$container.append(e)},answer_question:function(e){var t,s=this,i=this.$container.find(".llms-question-wrapper"),n=i.attr("data-type");if(this.validators[n]){if(!(t=this.validators[n](i))||!0!==t.valid||!t.answer)return s.add_error(t.valid);LLMS.Ajax.call({data:{action:"quiz_answer_question",answer:t.answer,attempt_key:s.attempt_key,question_id:i.attr("data-id"),question_type:i.attr("data-type")},beforeSend:function(){var t=e.hasClass("llms-button-quiz-complete")?LLMS.l10n.translate("Grading Quiz..."):LLMS.l10n.translate("Loading Question...");s.toggle_loader("show",t),s.update_progress_bar("increment")},success:function(t){s.toggle_loader("hide"),t.data&&t.data.html?t.data.question_id&&s.questions["q-"+t.data.question_id]?s.load_question(s.questions["q-"+t.data.question_id]):s.load_question(t.data.html):t.data&&t.data.redirect?s.redirect(t.data.redirect):t.message?s.$container.append("

"+t.message+"

"):(t=LLMS.l10n.translate("An unknown error occurred. Please try again."),s.$container.append("

"+t+"

"))}})}else console.log("No validator registered for question type "+n)},complete_quiz:function(){var e=this;LLMS.Ajax.call({data:{action:"quiz_end",attempt_key:e.attempt_key},beforeSend:function(){e.toggle_loader("show","Grading Quiz...")},success:function(t){e.toggle_loader("hide"),t.data&&t.data.redirect?e.redirect(t.data.redirect):t.message?e.$container.append("

"+t.message+"

"):(t=LLMS.l10n.translate("An unknown error occurred. Please try again."),e.$container.append("

"+t+"

"))}})},get_question_index:function(t){return Object.keys(this.questions).indexOf("q-"+t)},redirect:function(t){this.toggle_loader("show","Grading Quiz..."),this.status=null,window.location.href=t},previous_question:function(){var t=this,e=(t.toggle_loader("show",LLMS.l10n.translate("Loading Question...")),t.update_progress_bar("decrement"),Object.keys(t.questions)),s=e.indexOf("q-"+t.current_question),i=e[0];1<=s&&(i=e[s-1]),setTimeout(function(){t.toggle_loader("hide"),t.load_question(t.questions[i])},100)},register_validator:function(t,e){this.validators[t]=e},start_quiz:function(){var e=this;this.load_ui_elements(),this.$ui=c("#llms-quiz-ui"),this.$buttons=c("#llms-quiz-nav button"),this.$container=c("#llms-quiz-question-wrapper"),c("#llms-next-question, #llms-complete-quiz").on("click",function(t){t.preventDefault(),e.answer_question(c(this))}),c("#llms-prev-question").on("click",function(t){t.preventDefault(),e.previous_question()}),LLMS.Ajax.call({data:{action:"quiz_start",attempt_key:c("#llms-attempt-key").val(),lesson_id:c("#llms-lesson-id").val(),quiz_id:c("#llms-quiz-id").val()},beforeSend:function(){e.status=!0,c("#llms-quiz-wrapper, #quiz-start-button").remove(),c("html, body").stop().animate({scrollTop:0},500),e.toggle_loader("show",LLMS.l10n.translate("Loading Quiz..."))},error:function(t,e,s){console.log(t,e,s)},success:function(t){e.toggle_loader("hide"),t.data&&t.data.html?(t.data.time_limit&&e.start_quiz_timer(t.data.time_limit),e.attempt_key=t.data.attempt_key,e.total_questions=t.data.total,e.load_question(t.data.html)):t.message?e.$container.append("

"+t.message+"

"):(t=LLMS.l10n.translate("An unknown error occurred. Please try again."),e.$container.append("

"+t+"

"))}}),LLMS.is_touch_device()||(this.$ui.on("mouseenter","li.llms-choice label",function(){c(this).addClass("hovered")}),this.$ui.on("mouseleave","li.llms-choice label",function(){c(this).removeClass("hovered")}))},start_quiz_timer:function(t){var e,s,i,n,a=c('
'),l=LLMS.l10n.translate("Time Remaining"),o=(a.append(''+l+""),a.append('
'),c("#llms-quiz-header").append(a),this),r=(new Date).getTime()+60*t*1e3,u=60*t*1e3,d=document.getElementById("llms-tiles");setTimeout(function(){o.complete_quiz()},1e3+u),this.getCountdown(t,r,u,e,s,i,n,d),setInterval(function(){o.getCountdown(t,r,u,e,s,i,n,d)},1e3)},trigger:function(t){"answer_question"===t&&(this.get_question_index(this.current_question)===this.total_questions?c("#llms-complete-quiz"):c("#llms-next-question")).trigger("click")},load_question:function(t){var t=c(t),e=t.attr("data-id");this.questions["q-"+e]||(this.questions["q-"+e]=t),this.update_progress(e),this.current_question=e,c(document).trigger("llms-pre-append-question",t),this.$container.append(t),c(document).trigger("llms-post-append-question",t)},load_ui_elements:function(){var t=c('
'),e=c('
');($footer=c('