Plugin Directory

Changeset 3110100


Ignore:
Timestamp:
06/30/2024 09:37:45 PM (20 months ago)
Author:
mewz
Message:

Release v2.0.2

Location:
attribute-stock-for-woocommerce/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • attribute-stock-for-woocommerce/trunk/assets/dist/admin/stock-edit.js

    r3106385 r3110100  
    60986098function MatchRule_svelte_get_each_context(ctx, list, i) {
    60996099    const child_ctx = ctx.slice();
    6100     child_ctx[42] = list[i];
    6101     child_ctx[44] = list;
    6102     child_ctx[45] = i;
    6103     const constants_0 = `${/*data*/ child_ctx[8].name}[${/*index*/ child_ctx[3]}][attributes][${/*row*/ child_ctx[42][0]}]`;
    6104     child_ctx[43] = constants_0;
     6100    child_ctx[43] = list[i];
     6101    child_ctx[45] = list;
     6102    child_ctx[46] = i;
     6103    const constants_0 = `${/*data*/ child_ctx[8].name}[${/*index*/ child_ctx[3]}][attributes][${/*row*/ child_ctx[43][0]}]`;
     6104    child_ctx[44] = constants_0;
    61056105    return child_ctx;
    61066106}
     
    61086108function get_each_context_1(ctx, list, i) {
    61096109    const child_ctx = ctx.slice();
    6110     child_ctx[46] = list[i];
    6111     child_ctx[48] = i;
     6110    child_ctx[47] = list[i];
     6111    child_ctx[49] = i;
    61126112    return child_ctx;
    61136113}
    61146114
    6115 // (496:3) {#if ruleCount > 1}
     6115// (499:3) {#if ruleCount > 1}
    61166116function MatchRule_svelte_create_if_block_2(ctx) {
    61176117    let span0;
     
    61506150}
    61516151
    6152 // (503:9) {#if label.name}
     6152// (506:9) {#if label.name}
    61536153function MatchRule_svelte_create_if_block_1(ctx) {
    61546154    let span;
    6155     let t_value = /*label*/ ctx[46].name + "";
     6155    let t_value = /*label*/ ctx[47].name + "";
    61566156    let t;
    61576157
     
    61676167        },
    61686168        p(ctx, dirty) {
    6169             if (dirty[0] & /*attributes, multiplier*/ 3 && t_value !== (t_value = /*label*/ ctx[46].name + "")) set_data(t, t_value);
     6169            if (dirty[0] & /*attributes, multiplier*/ 3 && t_value !== (t_value = /*label*/ ctx[47].name + "")) set_data(t, t_value);
    61706170        },
    61716171        d(detaching) {
     
    61776177}
    61786178
    6179 // (501:3) {#each buildRuleLabels(attributes, multiplier) as label, i (i + label.type)}
     6179// (504:3) {#each buildRuleLabels(attributes, multiplier) as label, i (i + label.type)}
    61806180function create_each_block_1(key_1, ctx) {
    61816181    let span1;
    61826182    let t0;
    61836183    let span0;
    6184     let t1_value = (/*label*/ ctx[46].value || '') + "";
     6184    let t1_value = (/*label*/ ctx[47].value || '') + "";
    61856185    let t1;
    61866186    let t2;
     
    61886188    let span1_title_value;
    61896189    let span1_rel_value;
    6190     let if_block = /*label*/ ctx[46].name && MatchRule_svelte_create_if_block_1(ctx);
     6190    let if_block = /*label*/ ctx[47].name && MatchRule_svelte_create_if_block_1(ctx);
    61916191
    61926192    return {
     
    62026202            dom_attr(span0, "class", "value");
    62036203
    6204             dom_attr(span1, "class", span1_class_value = "toolbar-label toolbar-label-" + /*label*/ ctx[46].type + (/*label*/ ctx[46].class
    6205             ? ' ' + /*label*/ ctx[46].class
     6204            dom_attr(span1, "class", span1_class_value = "toolbar-label toolbar-label-" + /*label*/ ctx[47].type + (/*label*/ ctx[47].class
     6205            ? ' ' + /*label*/ ctx[47].class
    62066206            : ''));
    62076207
    6208             dom_attr(span1, "title", span1_title_value = /*label*/ ctx[46].title);
    6209             dom_attr(span1, "rel", span1_rel_value = /*label*/ ctx[46].title ? 'tiptip' : null);
     6208            dom_attr(span1, "title", span1_title_value = /*label*/ ctx[47].title);
     6209            dom_attr(span1, "rel", span1_rel_value = /*label*/ ctx[47].title ? 'tiptip' : null);
    62106210            this.first = span1;
    62116211        },
     
    62216221            ctx = new_ctx;
    62226222
    6223             if (/*label*/ ctx[46].name) {
     6223            if (/*label*/ ctx[47].name) {
    62246224                if (if_block) {
    62256225                    if_block.p(ctx, dirty);
     
    62346234            }
    62356235
    6236             if (dirty[0] & /*attributes, multiplier*/ 3 && t1_value !== (t1_value = (/*label*/ ctx[46].value || '') + "")) set_data(t1, t1_value);
    6237 
    6238             if (dirty[0] & /*attributes, multiplier*/ 3 && span1_class_value !== (span1_class_value = "toolbar-label toolbar-label-" + /*label*/ ctx[46].type + (/*label*/ ctx[46].class
    6239             ? ' ' + /*label*/ ctx[46].class
     6236            if (dirty[0] & /*attributes, multiplier*/ 3 && t1_value !== (t1_value = (/*label*/ ctx[47].value || '') + "")) set_data(t1, t1_value);
     6237
     6238            if (dirty[0] & /*attributes, multiplier*/ 3 && span1_class_value !== (span1_class_value = "toolbar-label toolbar-label-" + /*label*/ ctx[47].type + (/*label*/ ctx[47].class
     6239            ? ' ' + /*label*/ ctx[47].class
    62406240            : ''))) {
    62416241                dom_attr(span1, "class", span1_class_value);
    62426242            }
    62436243
    6244             if (dirty[0] & /*attributes, multiplier*/ 3 && span1_title_value !== (span1_title_value = /*label*/ ctx[46].title)) {
     6244            if (dirty[0] & /*attributes, multiplier*/ 3 && span1_title_value !== (span1_title_value = /*label*/ ctx[47].title)) {
    62456245                dom_attr(span1, "title", span1_title_value);
    62466246            }
    62476247
    6248             if (dirty[0] & /*attributes, multiplier*/ 3 && span1_rel_value !== (span1_rel_value = /*label*/ ctx[46].title ? 'tiptip' : null)) {
     6248            if (dirty[0] & /*attributes, multiplier*/ 3 && span1_rel_value !== (span1_rel_value = /*label*/ ctx[47].title ? 'tiptip' : null)) {
    62496249                dom_attr(span1, "rel", span1_rel_value);
    62506250            }
     
    62606260}
    62616261
    6262 // (526:5) {#each attributes as row, rowIndex (row)}
     6262// (529:5) {#each attributes as row, rowIndex (row)}
    62636263function MatchRule_svelte_create_each_block(key_1, ctx) {
    62646264    let div4;
     
    62846284
    62856285    function change_handler(...args) {
    6286         return /*change_handler*/ ctx[25](/*row*/ ctx[42], /*each_value*/ ctx[44], /*rowIndex*/ ctx[45], ...args);
     6286        return /*change_handler*/ ctx[26](/*row*/ ctx[43], /*each_value*/ ctx[45], /*rowIndex*/ ctx[46], ...args);
    62876287    }
    62886288
    62896289    select20 = new Select2_svelte({
    62906290            props: {
    6291                 data: /*getAttributeOptions*/ ctx[12](/*row*/ ctx[42][0]),
     6291                data: /*getAttributeOptions*/ ctx[12](/*row*/ ctx[43][0]),
    62926292                placeholder: {
    62936293                    id: '',
     
    63016301
    63026302    function change_handler_1(...args) {
    6303         return /*change_handler_1*/ ctx[26](/*row*/ ctx[42], /*each_value*/ ctx[44], /*rowIndex*/ ctx[45], ...args);
     6303        return /*change_handler_1*/ ctx[27](/*row*/ ctx[43], /*each_value*/ ctx[45], /*rowIndex*/ ctx[46], ...args);
    63046304    }
    63056305
    63066306    select21 = new Select2_svelte({
    63076307            props: {
    6308                 name: "" + (/*name*/ ctx[43] + "[]"),
     6308                name: "" + (/*name*/ ctx[44] + "[]"),
    63096309                multiple: true,
    6310                 data: /*getTermOptions*/ ctx[13](/*row*/ ctx[42]),
    6311                 placeholder: /*row*/ ctx[42][0]
    6312                 ? /*i18n*/ ctx[9].anyOption.replace('%s', /*data*/ ctx[8].attributes[/*row*/ ctx[42][0]].label)
     6310                data: /*getTermOptions*/ ctx[13](/*row*/ ctx[43]),
     6311                placeholder: /*row*/ ctx[43][0]
     6312                ? /*i18n*/ ctx[9].anyOption.replace('%s', /*data*/ ctx[8].attributes[/*row*/ ctx[43][0]].label)
    63136313                : /*i18n*/ ctx[9].termPlaceholder,
    6314                 disabled: !/*row*/ ctx[42][0],
     6314                disabled: !/*row*/ ctx[43][0],
    63156315                options: {
    63166316                    init: true,
     
    63246324
    63256325    function click_handler_2() {
    6326         return /*click_handler_2*/ ctx[27](/*rowIndex*/ ctx[45]);
     6326        return /*click_handler_2*/ ctx[28](/*rowIndex*/ ctx[46]);
    63276327    }
    63286328
     
    63466346            dom_attr(div0, "class", "select-attribute");
    63476347            dom_attr(input, "type", "hidden");
    6348             dom_attr(input, "name", input_name_value = /*name*/ ctx[43]);
     6348            dom_attr(input, "name", input_name_value = /*name*/ ctx[44]);
    63496349            input.value = "";
    63506350            dom_attr(div1, "class", "select-terms");
     
    63526352            dom_attr(button, "class", "icon-button row-remove-button");
    63536353            dom_attr(button, "title", button_title_value = /*i18n*/ ctx[9].removeAttribute);
    6354             button.disabled = button_disabled_value = /*attributes*/ ctx[0].length === 1 && !/*row*/ ctx[42].attribute;
     6354            button.disabled = button_disabled_value = /*attributes*/ ctx[0].length === 1 && !/*row*/ ctx[43].attribute;
    63556355            dom_attr(div2, "class", "attribute-row-actions");
    63566356            dom_attr(div3, "class", "attribute-row-inner");
     
    63826382            ctx = new_ctx;
    63836383            const select20_changes = {};
    6384             if (dirty[0] & /*attributes*/ 1) select20_changes.data = /*getAttributeOptions*/ ctx[12](/*row*/ ctx[42][0]);
     6384            if (dirty[0] & /*attributes*/ 1) select20_changes.data = /*getAttributeOptions*/ ctx[12](/*row*/ ctx[43][0]);
    63856385            select20.$set(select20_changes);
    63866386
    6387             if (!current || dirty[0] & /*index, attributes*/ 9 && input_name_value !== (input_name_value = /*name*/ ctx[43])) {
     6387            if (!current || dirty[0] & /*index, attributes*/ 9 && input_name_value !== (input_name_value = /*name*/ ctx[44])) {
    63886388                dom_attr(input, "name", input_name_value);
    63896389            }
    63906390
    63916391            const select21_changes = {};
    6392             if (dirty[0] & /*index, attributes*/ 9) select21_changes.name = "" + (/*name*/ ctx[43] + "[]");
    6393             if (dirty[0] & /*attributes*/ 1) select21_changes.data = /*getTermOptions*/ ctx[13](/*row*/ ctx[42]);
    6394 
    6395             if (dirty[0] & /*attributes*/ 1) select21_changes.placeholder = /*row*/ ctx[42][0]
    6396             ? /*i18n*/ ctx[9].anyOption.replace('%s', /*data*/ ctx[8].attributes[/*row*/ ctx[42][0]].label)
     6392            if (dirty[0] & /*index, attributes*/ 9) select21_changes.name = "" + (/*name*/ ctx[44] + "[]");
     6393            if (dirty[0] & /*attributes*/ 1) select21_changes.data = /*getTermOptions*/ ctx[13](/*row*/ ctx[43]);
     6394
     6395            if (dirty[0] & /*attributes*/ 1) select21_changes.placeholder = /*row*/ ctx[43][0]
     6396            ? /*i18n*/ ctx[9].anyOption.replace('%s', /*data*/ ctx[8].attributes[/*row*/ ctx[43][0]].label)
    63976397            : /*i18n*/ ctx[9].termPlaceholder;
    63986398
    6399             if (dirty[0] & /*attributes*/ 1) select21_changes.disabled = !/*row*/ ctx[42][0];
     6399            if (dirty[0] & /*attributes*/ 1) select21_changes.disabled = !/*row*/ ctx[43][0];
    64006400            select21.$set(select21_changes);
    64016401
    6402             if (!current || dirty[0] & /*attributes*/ 1 && button_disabled_value !== (button_disabled_value = /*attributes*/ ctx[0].length === 1 && !/*row*/ ctx[42].attribute)) {
     6402            if (!current || dirty[0] & /*attributes*/ 1 && button_disabled_value !== (button_disabled_value = /*attributes*/ ctx[0].length === 1 && !/*row*/ ctx[43].attribute)) {
    64036403                button.disabled = button_disabled_value;
    64046404            }
     
    64446444}
    64456445
    6446 // (570:4) {#if attributes.length < totalAttributes}
     6446// (573:4) {#if attributes.length < totalAttributes}
    64476447function MatchRule_svelte_create_if_block(ctx) {
    64486448    let div;
     
    64686468
    64696469            if (!mounted) {
    6470                 dispose = dom_listen(button, "click", /*click_handler_3*/ ctx[28]);
     6470                dispose = dom_listen(button, "click", /*click_handler_3*/ ctx[29]);
    64716471                mounted = true;
    64726472            }
     
    65576557    let if_block0 = /*ruleCount*/ ctx[5] > 1 && MatchRule_svelte_create_if_block_2(ctx);
    65586558    let each_value_1 = each_ensure_array_like(/*buildRuleLabels*/ ctx[14](/*attributes*/ ctx[0], /*multiplier*/ ctx[1]));
    6559     const get_key = ctx => /*i*/ ctx[48] + /*label*/ ctx[46].type;
     6559    const get_key = ctx => /*i*/ ctx[49] + /*label*/ ctx[47].type;
    65606560
    65616561    for (let i = 0; i < each_value_1.length; i += 1) {
     
    65666566
    65676567    let each_value = each_ensure_array_like(/*attributes*/ ctx[0]);
    6568     const get_key_1 = ctx => /*row*/ ctx[42];
     6568    const get_key_1 = ctx => /*row*/ ctx[43];
    65696569
    65706570    for (let i = 0; i < each_value.length; i += 1) {
     
    66996699            dom_append(div4, input);
    67006700            set_input_value(input, /*multiplier*/ ctx[1]);
    6701             /*div8_binding*/ ctx[30](div8);
     6701            /*div8_binding*/ ctx[31](div8);
    67026702            current = true;
    67036703
     
    67106710                        enabled: /*draggable*/ ctx[4]
    67116711                    })),
    6712                     dom_listen(button1, "click", /*click_handler*/ ctx[23]),
    6713                     dom_listen(button2, "click", /*click_handler_1*/ ctx[24]),
     6712                    dom_listen(button1, "click", /*click_handler*/ ctx[24]),
     6713                    dom_listen(button2, "click", /*click_handler_1*/ ctx[25]),
    67146714                    dom_listen(div1, "click", /*onToolbarClick*/ ctx[18]),
    6715                     dom_listen(input, "input", /*input_input_handler*/ ctx[29]),
     6715                    dom_listen(input, "input", /*input_input_handler*/ ctx[30]),
    67166716                    action_destroyer(collapse_action = collapse.call(null, div7, { open: /*open*/ ctx[2], duration: .17 }))
    67176717                ];
     
    68646864
    68656865            if (if_block1) if_block1.d();
    6866             /*div8_binding*/ ctx[30](null);
     6866            /*div8_binding*/ ctx[31](null);
    68676867            if (detaching && div8_outro) div8_outro.end();
    68686868            mounted = false;
     
    68956895    let { attributes } = $$props;
    68966896    let { multiplier = '' } = $$props;
     6897    let { mounted = false } = $$props;
    68976898    let { open = true } = $$props;
    68986899    let { draggable = true } = $$props;
     
    70317032        }
    70327033
    7033         setTimeout(
    7034             () => {
    7035                 const select = ruleEl.querySelector('.attribute-row:last-child .select-attribute select');
    7036                 if (select) jQuery(select).focus();
    7037             },
    7038             150
    7039         );
     7034        if (mounted) {
     7035            setTimeout(
     7036                () => {
     7037                    const select = ruleEl.querySelector('.attribute-row:last-child .select-attribute select');
     7038                    if (select) jQuery(select).focus();
     7039                },
     7040                150
     7041            );
     7042        }
    70407043    }
    70417044
     
    73487351        if ('attributes' in $$props) $$invalidate(0, attributes = $$props.attributes);
    73497352        if ('multiplier' in $$props) $$invalidate(1, multiplier = $$props.multiplier);
     7353        if ('mounted' in $$props) $$invalidate(23, mounted = $$props.mounted);
    73507354        if ('open' in $$props) $$invalidate(2, open = $$props.open);
    73517355        if ('draggable' in $$props) $$invalidate(4, draggable = $$props.draggable);
     
    73917395        dragEnd,
    73927396        getMultiplierPlaceholder,
     7397        mounted,
    73937398        click_handler,
    73947399        click_handler_1,
     
    74167421                attributes: 0,
    74177422                multiplier: 1,
     7423                mounted: 23,
    74187424                open: 2,
    74197425                draggable: 4,
     
    74387444function MatchRules_svelte_get_each_context(ctx, list, i) {
    74397445    const child_ctx = ctx.slice();
    7440     child_ctx[24] = list[i];
    7441     child_ctx[25] = list;
    7442     child_ctx[26] = i;
     7446    child_ctx[26] = list[i];
     7447    child_ctx[27] = list;
     7448    child_ctx[28] = i;
    74437449    return child_ctx;
    74447450}
    74457451
    7446 // (167:3) {#if removedRules.length}
     7452// (171:3) {#if removedRules.length}
    74477453function MatchRules_svelte_create_if_block_1(ctx) {
    74487454    let button;
     
    74627468
    74637469            if (!mounted) {
    7464                 dispose = dom_listen(button, "click", /*restoreRule*/ ctx[10]);
     7470                dispose = dom_listen(button, "click", /*restoreRule*/ ctx[11]);
    74657471                mounted = true;
    74667472            }
     
    74827488}
    74837489
    7484 // (178:2) {#each rules as rule, ruleIndex (rule)}
     7490// (182:2) {#each rules as rule, ruleIndex (rule)}
    74857491function MatchRules_svelte_create_each_block(key_1, ctx) {
    74867492    let first;
    74877493    let matchrule;
     7494    let updating_mounted;
    74887495    let updating_attributes;
    74897496    let updating_multiplier;
     
    74917498    let current;
    74927499
     7500    function matchrule_mounted_binding(value) {
     7501        /*matchrule_mounted_binding*/ ctx[14](value);
     7502    }
     7503
    74937504    function matchrule_attributes_binding(value) {
    7494         /*matchrule_attributes_binding*/ ctx[13](value, /*rule*/ ctx[24]);
     7505        /*matchrule_attributes_binding*/ ctx[15](value, /*rule*/ ctx[26]);
    74957506    }
    74967507
    74977508    function matchrule_multiplier_binding(value) {
    7498         /*matchrule_multiplier_binding*/ ctx[14](value, /*rule*/ ctx[24]);
     7509        /*matchrule_multiplier_binding*/ ctx[16](value, /*rule*/ ctx[26]);
    74997510    }
    75007511
    75017512    function matchrule_open_binding(value) {
    7502         /*matchrule_open_binding*/ ctx[15](value, /*rule*/ ctx[24]);
     7513        /*matchrule_open_binding*/ ctx[17](value, /*rule*/ ctx[26]);
    75037514    }
    75047515
    75057516    let matchrule_props = {
    7506         index: /*ruleIndex*/ ctx[26],
    7507         draggable: !/*dragging*/ ctx[5],
     7517        index: /*ruleIndex*/ ctx[28],
     7518        draggable: !/*dragging*/ ctx[6],
    75087519        ruleCount: /*rules*/ ctx[0].length
    75097520    };
    75107521
    7511     if (/*rule*/ ctx[24].attributes !== void 0) {
    7512         matchrule_props.attributes = /*rule*/ ctx[24].attributes;
    7513     }
    7514 
    7515     if (/*rule*/ ctx[24].multiplier !== void 0) {
    7516         matchrule_props.multiplier = /*rule*/ ctx[24].multiplier;
    7517     }
    7518 
    7519     if (/*rule*/ ctx[24].open !== void 0) {
    7520         matchrule_props.open = /*rule*/ ctx[24].open;
     7522    if (/*mounted*/ ctx[5] !== void 0) {
     7523        matchrule_props.mounted = /*mounted*/ ctx[5];
     7524    }
     7525
     7526    if (/*rule*/ ctx[26].attributes !== void 0) {
     7527        matchrule_props.attributes = /*rule*/ ctx[26].attributes;
     7528    }
     7529
     7530    if (/*rule*/ ctx[26].multiplier !== void 0) {
     7531        matchrule_props.multiplier = /*rule*/ ctx[26].multiplier;
     7532    }
     7533
     7534    if (/*rule*/ ctx[26].open !== void 0) {
     7535        matchrule_props.open = /*rule*/ ctx[26].open;
    75217536    }
    75227537
    75237538    matchrule = new MatchRule_svelte({ props: matchrule_props });
     7539    binding_callbacks.push(() => bind(matchrule, 'mounted', matchrule_mounted_binding));
    75247540    binding_callbacks.push(() => bind(matchrule, 'attributes', matchrule_attributes_binding));
    75257541    binding_callbacks.push(() => bind(matchrule, 'multiplier', matchrule_multiplier_binding));
    75267542    binding_callbacks.push(() => bind(matchrule, 'open', matchrule_open_binding));
    7527     matchrule.$on("action", /*onRuleAction*/ ctx[9]);
    7528     matchrule.$on("dragging", /*onRuleDragging*/ ctx[8]);
     7543    matchrule.$on("action", /*onRuleAction*/ ctx[10]);
     7544    matchrule.$on("dragging", /*onRuleDragging*/ ctx[9]);
    75297545
    75307546    return {
     
    75447560            ctx = new_ctx;
    75457561            const matchrule_changes = {};
    7546             if (dirty & /*rules*/ 1) matchrule_changes.index = /*ruleIndex*/ ctx[26];
    7547             if (dirty & /*dragging*/ 32) matchrule_changes.draggable = !/*dragging*/ ctx[5];
     7562            if (dirty & /*rules*/ 1) matchrule_changes.index = /*ruleIndex*/ ctx[28];
     7563            if (dirty & /*dragging*/ 64) matchrule_changes.draggable = !/*dragging*/ ctx[6];
    75487564            if (dirty & /*rules*/ 1) matchrule_changes.ruleCount = /*rules*/ ctx[0].length;
     7565
     7566            if (!updating_mounted && dirty & /*mounted*/ 32) {
     7567                updating_mounted = true;
     7568                matchrule_changes.mounted = /*mounted*/ ctx[5];
     7569                add_flush_callback(() => updating_mounted = false);
     7570            }
    75497571
    75507572            if (!updating_attributes && dirty & /*rules*/ 1) {
    75517573                updating_attributes = true;
    7552                 matchrule_changes.attributes = /*rule*/ ctx[24].attributes;
     7574                matchrule_changes.attributes = /*rule*/ ctx[26].attributes;
    75537575                add_flush_callback(() => updating_attributes = false);
    75547576            }
     
    75567578            if (!updating_multiplier && dirty & /*rules*/ 1) {
    75577579                updating_multiplier = true;
    7558                 matchrule_changes.multiplier = /*rule*/ ctx[24].multiplier;
     7580                matchrule_changes.multiplier = /*rule*/ ctx[26].multiplier;
    75597581                add_flush_callback(() => updating_multiplier = false);
    75607582            }
     
    75627584            if (!updating_open && dirty & /*rules*/ 1) {
    75637585                updating_open = true;
    7564                 matchrule_changes.open = /*rule*/ ctx[24].open;
     7586                matchrule_changes.open = /*rule*/ ctx[26].open;
    75657587                add_flush_callback(() => updating_open = false);
    75667588            }
     
    75877609}
    75887610
    7589 // (194:1) {#if !changed}
     7611// (199:1) {#if !changed}
    75907612function MatchRules_svelte_create_if_block(ctx) {
    75917613    let input;
     
    76407662    let if_block0 = /*removedRules*/ ctx[4].length && MatchRules_svelte_create_if_block_1(ctx);
    76417663    let each_value = each_ensure_array_like(/*rules*/ ctx[0]);
    7642     const get_key = ctx => /*rule*/ ctx[24];
     7664    const get_key = ctx => /*rule*/ ctx[26];
    76437665
    76447666    for (let i = 0; i < each_value.length; i += 1) {
     
    76487670    }
    76497671
    7650     let if_block1 = !/*changed*/ ctx[6] && MatchRules_svelte_create_if_block(ctx);
     7672    let if_block1 = !/*changed*/ ctx[7] && MatchRules_svelte_create_if_block(ctx);
    76517673
    76527674    return {
     
    76857707            dom_attr(div3, "class", "match-rules-list");
    76867708            dom_attr(div4, "class", "mewz-wcas-attribute-rules");
    7687             toggle_class(div4, "dragging", /*dragging*/ ctx[5]);
    7688             toggle_class(div4, "released", /*dragging*/ ctx[5] && /*dragging*/ ctx[5].released);
     7709            toggle_class(div4, "dragging", /*dragging*/ ctx[6]);
     7710            toggle_class(div4, "released", /*dragging*/ ctx[6] && /*dragging*/ ctx[6].released);
    76897711        },
    76907712        m(target, anchor) {
     
    77117733            }
    77127734
    7713             /*div3_binding*/ ctx[16](div3);
     7735            /*div3_binding*/ ctx[18](div3);
    77147736            dom_append(div4, t6);
    77157737            if (if_block1) if_block1.m(div4, null);
    7716             /*div4_binding*/ ctx[17](div4);
     7738            /*div4_binding*/ ctx[19](div4);
    77177739            current = true;
    77187740
    77197741            if (!mounted) {
    77207742                dispose = [
    7721                     dom_listen(button0, "click", /*click_handler*/ ctx[12]),
    7722                     dom_listen(button1, "click", /*toggleAllOpen*/ ctx[11])
     7743                    dom_listen(button0, "click", /*click_handler*/ ctx[13]),
     7744                    dom_listen(button1, "click", /*toggleAllOpen*/ ctx[12])
    77237745                ];
    77247746
     
    77547776            }
    77557777
    7756             if (dirty & /*rules, dragging, onRuleAction, onRuleDragging*/ 801) {
     7778            if (dirty & /*rules, dragging, mounted, onRuleAction, onRuleDragging*/ 1633) {
    77577779                each_value = each_ensure_array_like(/*rules*/ ctx[0]);
    77587780                transitions_group_outros();
     
    77617783            }
    77627784
    7763             if (!/*changed*/ ctx[6]) {
     7785            if (!/*changed*/ ctx[7]) {
    77647786                if (if_block1) {
    77657787                   
     
    77747796            }
    77757797
    7776             if (!current || dirty & /*dragging*/ 32) {
    7777                 toggle_class(div4, "dragging", /*dragging*/ ctx[5]);
    7778             }
    7779 
    7780             if (!current || dirty & /*dragging*/ 32) {
    7781                 toggle_class(div4, "released", /*dragging*/ ctx[5] && /*dragging*/ ctx[5].released);
     7798            if (!current || dirty & /*dragging*/ 64) {
     7799                toggle_class(div4, "dragging", /*dragging*/ ctx[6]);
     7800            }
     7801
     7802            if (!current || dirty & /*dragging*/ 64) {
     7803                toggle_class(div4, "released", /*dragging*/ ctx[6] && /*dragging*/ ctx[6].released);
    77827804            }
    77837805        },
     
    78097831            }
    78107832
    7811             /*div3_binding*/ ctx[16](null);
     7833            /*div3_binding*/ ctx[18](null);
    78127834            if (if_block1) if_block1.d();
    7813             /*div4_binding*/ ctx[17](null);
     7835            /*div4_binding*/ ctx[19](null);
    78147836            mounted = false;
    78157837            utils_run_all(dispose);
     
    78387860    let rules = [];
    78397861    let removedRules = [];
     7862    let mounted = false;
    78407863    let dragging = false;
    78417864    let changed = false;
     
    78707893    onMount(() => {
    78717894        initTooltips('.mewz-wcas-attribute-rules .main-toolbar .woocommerce-help-tip');
    7872         detectFieldChanges(container, data.name + '[', v => $$invalidate(6, changed = v));
     7895        detectFieldChanges(container, data.name + '[', v => $$invalidate(7, changed = v));
     7896        $$invalidate(5, mounted = true);
    78737897    });
    78747898
     
    78877911    function onRuleDragging(e) {
    78887912        const [i, value] = e.detail;
    7889         $$invalidate(5, dragging = value);
     7913        $$invalidate(6, dragging = value);
    78907914    }
    78917915
     
    79567980    const click_handler = () => newRule();
    79577981
     7982    function matchrule_mounted_binding(value) {
     7983        mounted = value;
     7984        $$invalidate(5, mounted);
     7985    }
     7986
    79587987    function matchrule_attributes_binding(value, rule) {
    79597988        if ($$self.$$.not_equal(rule.attributes, value)) {
     
    79928021
    79938022    $$self.$$set = $$new_props => {
    7994         $$invalidate(23, $$props = utils_assign(utils_assign({}, $$props), exclude_internal_props($$new_props)));
     8023        $$invalidate(25, $$props = utils_assign(utils_assign({}, $$props), exclude_internal_props($$new_props)));
    79958024    };
    79968025
     
    80098038        rulesListEl,
    80108039        removedRules,
     8040        mounted,
    80118041        dragging,
    80128042        changed,
     
    80178047        toggleAllOpen,
    80188048        click_handler,
     8049        matchrule_mounted_binding,
    80198050        matchrule_attributes_binding,
    80208051        matchrule_multiplier_binding,
  • attribute-stock-for-woocommerce/trunk/assets/dist/admin/stock-edit.min.js

    r3106385 r3110100  
    1 (()=>{"use strict";(()=>{let t=!1;function e(e){e&&!t||jQuery(document.body).trigger("wc-enhanced-select-init")}function n(t){jQuery(t).tipTip({fadeIn:50,fadeOut:50,delay:200})}function o(t,e,n){const o=t.closest("form");o?setTimeout((()=>{const t=i(o,e);o.addEventListener("submit",(()=>{const s=i(o,e)!==t;n(s)}))}),300):n(!0)}function i(t,e){const n=new FormData(t),o=[];for(const t of n.entries())t[0].startsWith(e)&&o.push(t[0],t[1]);return JSON.stringify(o)}jQuery(document.body).one("wc-enhanced-select-init",(()=>{t=!0}));const s=jQuery;function r(){const t=s("#mewz_wcas_internal"),e=t.prop("checked")||t.prop("disabled");s("#mewz_wcas_product_image").prop("disabled",e)}const l=jQuery,a=window.mewzWcas&&mewzWcas.headerActions||{},c=jQuery;let u;function d(t,e){const n=u.querySelector(`.wc-tabs > .${t}_tab a`);n&&(e?n.dataset.indicator=e:delete n.dataset.indicator)}function p(t){const e=c(`#${t}_panel`);e.on("change input",(()=>{f(t,e)})),f(t,e)}function f(t,e){const n=e.find(":input:not(:disabled, .select2-search__field)");let o=0;n.each((function(){const t=c(this),e="checkbox"===t.attr("type")?t.prop("checked"):t.val();Array.isArray(e)?o+=e.length:e&&o++})),d(t,o)}function h(){}const m=t=>t;function $(t,e){for(const n in e)t[n]=e[n];return t}function g(t){return t()}function b(){return Object.create(null)}function v(t){t.forEach(g)}function y(t){return"function"==typeof t}function w(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function _(t,e){return t!=t?e==e:t!==e}function x(t){const e={};for(const n in t)"$"!==n[0]&&(e[n]=t[n]);return e}function k(t){return t&&y(t.destroy)?t.destroy:h}const E="undefined"!=typeof window;let L=E?()=>window.performance.now():()=>Date.now(),T=E?t=>requestAnimationFrame(t):h;const z=new Set;function A(t){z.forEach((e=>{e.c(t)||(z.delete(e),e.f())})),0!==z.size&&T(A)}function M(t){let e;return 0===z.size&&T(A),{promise:new Promise((n=>{z.add(e={c:t,f:n})})),abort(){z.delete(e)}}}const O="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;class C{_listeners="WeakMap"in O?new WeakMap:void 0;_observer=void 0;options;constructor(t){this.options=t}observe(t,e){return this._listeners.set(t,e),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){return this._observer??(this._observer=new ResizeObserver((t=>{for(const e of t)C.entries.set(e.target,e),this._listeners.get(e.target)?.(e)})))}}C.entries="WeakMap"in O?new WeakMap:void 0;let I=!1;function S(t,e){t.appendChild(e)}function j(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function W(t){const e=R("style");return e.textContent="/* empty */",function(t,e){S(t.head||t,e),e.sheet}(j(t),e),e.sheet}function N(t,e,n){t.insertBefore(e,n||null)}function P(t){t.parentNode&&t.parentNode.removeChild(t)}function R(t){return document.createElement(t)}function q(t){return document.createTextNode(t)}function F(){return q(" ")}function Y(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function X(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function B(t){return""===t?null:+t}function D(t,e){e=""+e,t.data!==e&&(t.data=e)}function H(t,e){t.value=null==e?"":e}function Q(t,e,n){t.classList.toggle(e,!!n)}function J(t,e,{bubbles:n=!1,cancelable:o=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:o})}const U=new Map;let V,G=0;function K(t,e,n,o,i,s,r,l=0){const a=16.666/o;let c="{\n";for(let t=0;t<=1;t+=a){const o=e+(n-e)*s(t);c+=100*t+`%{${r(o,1-o)}}\n`}const u=c+`100% {${r(n,1-n)}}\n}`,d=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${l}`,p=j(t),{stylesheet:f,rules:h}=U.get(p)||function(t,e){const n={stylesheet:W(e),rules:{}};return U.set(t,n),n}(p,t);h[d]||(h[d]=!0,f.insertRule(`@keyframes ${d} ${u}`,f.cssRules.length));const m=t.style.animation||"";return t.style.animation=`${m?`${m}, `:""}${d} ${o}ms linear ${i}ms 1 both`,G+=1,d}function Z(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),i=n.length-o.length;i&&(t.style.animation=o.join(", "),G-=i,G||T((()=>{G||(U.forEach((t=>{const{ownerNode:e}=t.stylesheet;e&&P(e)})),U.clear())})))}function tt(t){V=t}function et(){if(!V)throw new Error("Function called outside component initialization");return V}function nt(t){et().$$.on_mount.push(t)}function ot(){const t=et();return(e,n,{cancelable:o=!1}={})=>{const i=t.$$.callbacks[e];if(i){const s=J(e,n,{cancelable:o});return i.slice().forEach((e=>{e.call(t,s)})),!s.defaultPrevented}return!0}}function it(t,e){return et().$$.context.set(t,e),e}function st(t){return et().$$.context.get(t)}const rt=[],lt=[];let at=[];const ct=[],ut=Promise.resolve();let dt=!1;function pt(t){at.push(t)}function ft(t){ct.push(t)}const ht=new Set;let mt,$t=0;function gt(){if(0!==$t)return;const t=V;do{try{for(;$t<rt.length;){const t=rt[$t];$t++,tt(t),bt(t.$$)}}catch(t){throw rt.length=0,$t=0,t}for(tt(null),rt.length=0,$t=0;lt.length;)lt.pop()();for(let t=0;t<at.length;t+=1){const e=at[t];ht.has(e)||(ht.add(e),e())}at.length=0}while(rt.length);for(;ct.length;)ct.pop()();dt=!1,ht.clear(),tt(t)}function bt(t){if(null!==t.fragment){t.update(),v(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(pt)}}function vt(){return mt||(mt=Promise.resolve(),mt.then((()=>{mt=null}))),mt}function yt(t,e,n){t.dispatchEvent(J(`${e?"intro":"outro"}${n}`))}const wt=new Set;let _t;function xt(){_t={r:0,c:[],p:_t}}function kt(){_t.r||v(_t.c),_t=_t.p}function Et(t,e){t&&t.i&&(wt.delete(t),t.i(e))}function Lt(t,e,n,o){if(t&&t.o){if(wt.has(t))return;wt.add(t),_t.c.push((()=>{wt.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}const Tt={duration:0};function zt(t,e,n,o){let i,s=e(t,n,{direction:"both"}),r=o?0:1,l=null,a=null,c=null;function u(){c&&Z(t,c)}function d(t,e){const n=t.b-r;return e*=Math.abs(n),{a:r,b:t.b,d:n,duration:e,start:t.start,end:t.start+e,group:t.group}}function p(e){const{delay:n=0,duration:o=300,easing:p=m,tick:f=h,css:$}=s||Tt,g={start:L()+n,b:e};e||(g.group=_t,_t.r+=1),"inert"in t&&(e?void 0!==i&&(t.inert=i):(i=t.inert,t.inert=!0)),l||a?a=g:($&&(u(),c=K(t,r,e,o,n,p,$)),e&&f(0,1),l=d(g,o),pt((()=>yt(t,e,"start"))),M((e=>{if(a&&e>a.start&&(l=d(a,o),a=null,yt(t,l.b,"start"),$&&(u(),c=K(t,r,l.b,l.duration,0,p,s.css))),l)if(e>=l.end)f(r=l.b,1-r),yt(t,l.b,"end"),a||(l.b?u():--l.group.r||v(l.group.c)),l=null;else if(e>=l.start){const t=e-l.start;r=l.a+l.d*p(t/l.duration),f(r,1-r)}return!(!l&&!a)})))}return{run(t){y(s)?vt().then((()=>{s=s({direction:t?"in":"out"}),p(t)})):p(t)},end(){u(),l=a=null}}}function At(t){return void 0!==t?.length?t:Array.from(t)}function Mt(t,e){t.d(1),e.delete(t.key)}function Ot(t,e){Lt(t,1,1,(()=>{e.delete(t.key)}))}function Ct(t,e,n,o,i,s,r,l,a,c,u,d){let p=t.length,f=s.length,h=p;const m={};for(;h--;)m[t[h].key]=h;const $=[],g=new Map,b=new Map,y=[];for(h=f;h--;){const t=d(i,s,h),l=n(t);let a=r.get(l);a?o&&y.push((()=>a.p(t,e))):(a=c(l,t),a.c()),g.set(l,$[h]=a),l in m&&b.set(l,Math.abs(h-m[l]))}const w=new Set,_=new Set;function x(t){Et(t,1),t.m(l,u),r.set(t.key,t),u=t.first,f--}for(;p&&f;){const e=$[f-1],n=t[p-1],o=e.key,i=n.key;e===n?(u=e.first,p--,f--):g.has(i)?!r.has(o)||w.has(o)?x(e):_.has(i)?p--:b.get(o)>b.get(i)?(_.add(o),x(e)):(w.add(i),p--):(a(n,r),p--)}for(;p--;){const e=t[p];g.has(e.key)||a(e,r)}for(;f;)x($[f-1]);return v(y),$}let It;function St(t,e,n){const o=t.$$.props[e];void 0!==o&&(t.$$.bound[o]=n,n(t.$$.ctx[o]))}function jt(t){t&&t.c()}function Wt(t,e,n){const{fragment:o,after_update:i}=t.$$;o&&o.m(e,n),pt((()=>{const e=t.$$.on_mount.map(g).filter(y);t.$$.on_destroy?t.$$.on_destroy.push(...e):v(e),t.$$.on_mount=[]})),i.forEach(pt)}function Nt(t,e){const n=t.$$;null!==n.fragment&&(function(t){const e=[],n=[];at.forEach((o=>-1===t.indexOf(o)?e.push(o):n.push(o))),n.forEach((t=>t())),at=e}(n.after_update),v(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Pt(t,e,n,o,i,s,r=null,l=[-1]){const a=V;tt(t);const c=t.$$={fragment:null,ctx:[],props:s,update:h,not_equal:i,bound:b(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:b(),dirty:l,skip_bound:!1,root:e.target||a.$$.root};r&&r(c.root);let u=!1;if(c.ctx=n?n(t,e.props||{},((e,n,...o)=>{const s=o.length?o[0]:n;return c.ctx&&i(c.ctx[e],c.ctx[e]=s)&&(!c.skip_bound&&c.bound[e]&&c.bound[e](s),u&&function(t,e){-1===t.$$.dirty[0]&&(rt.push(t),dt||(dt=!0,ut.then(gt)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}(t,e)),n})):[],c.update(),u=!0,v(c.before_update),c.fragment=!!o&&o(c.ctx),e.target){if(e.hydrate){I=!0;const t=(d=e.target,Array.from(d.childNodes));c.fragment&&c.fragment.l(t),t.forEach(P)}else c.fragment&&c.fragment.c();e.intro&&Et(t.$$.fragment),Wt(t,e.target,e.anchor),I=!1,gt()}var d;tt(a)}function Rt(t,e,n,o){const i=n[t]?.type;if(e="Boolean"===i&&"boolean"!=typeof e?null!=e:e,!o||!n[t])return e;if("toAttribute"===o)switch(i){case"Object":case"Array":return null==e?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return null==e?null:e;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),"function"==typeof HTMLElement&&(It=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;constructor(t,e,n){super(),this.$$ctor=t,this.$$s=e,n&&this.attachShadow({mode:"open"})}addEventListener(t,e,n){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,n)}removeEventListener(t,e,n){if(super.removeEventListener(t,e,n),this.$$c){const t=this.$$l_u.get(e);t&&(t(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn||this.$$c)return;function t(t){return()=>{let e;return{c:function(){e=R("slot"),"default"!==t&&X(e,"name",t)},m:function(t,n){N(t,e,n)},d:function(t){t&&P(e)}}}}const e={},n=function(t){const e={};return t.childNodes.forEach((t=>{e[t.slot||"default"]=!0})),e}(this);for(const i of this.$$s)i in n&&(e[i]=[t(i)]);for(const s of this.attributes){const r=this.$$g_p(s.name);r in this.$$d||(this.$$d[r]=Rt(r,s.value,this.$$p_d,"toProp"))}for(const l in this.$$p_d)l in this.$$d||void 0===this[l]||(this.$$d[l]=this[l],delete this[l]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$scope:{ctx:[]}}});const o=()=>{this.$$r=!0;for(const t in this.$$p_d)if(this.$$d[t]=this.$$c.$$.ctx[this.$$c.$$.props[t]],this.$$p_d[t].reflect){const e=Rt(t,this.$$d[t],this.$$p_d,"toAttribute");null==e?this.removeAttribute(this.$$p_d[t].attribute||t):this.setAttribute(this.$$p_d[t].attribute||t,e)}this.$$r=!1};this.$$c.$$.after_update.push(o),o();for(const a in this.$$l)for(const c of this.$$l[a]){const u=this.$$c.$on(a,c);this.$$l_u.set(c,u)}this.$$l={}}}attributeChangedCallback(t,e,n){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Rt(t,n,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(t){return Object.keys(this.$$p_d).find((e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t))||t}});class qt{$$=void 0;$$set=void 0;$destroy(){Nt(this,1),this.$destroy=h}$on(t,e){if(!y(e))return h;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function Ft(t){const e=t-1;return e*e*e+1}function Yt(t,{delay:e=0,duration:n=200,easing:o=Ft,side:i="bottom"}){if(n<=0)return!1;const s=getComputedStyle(t),r=t.offsetHeight;if(r<=0)return!1;let l;switch(i){case"top":l=[s.marginTop,s.marginBottom];break;case"bottom":l=[s.marginBottom,s.marginTop];break;case"left":l=[s.marginLeft,s.marginRight];break;case"right":l=[s.marginRight,s.marginLeft];break;default:return!1}l[0]=parseFloat(l[0])||0,l[1]=parseFloat(l[1])||0;const a=r+l[0]+l[1];return{delay:e,duration:n,easing:o,css:function(t,e){const n=l[0]-a*e;return`margin-${i}: ${n}px; opacity: ${t}; z-index: 0;`}}}function Xt(t){let e;return{c(){e=R("select"),X(e,"name",t[0]),e.multiple=t[1],e.disabled=t[2]},m(n,o){N(n,e,o),t[8](e)},p(t,[n]){1&n&&X(e,"name",t[0]),2&n&&(e.multiple=t[1]),4&n&&(e.disabled=t[2])},i:h,o:h,d(n){n&&P(e),t[8](null)}}}function Bt(t,n,o){let{handler:i}=n,{name:s=null}=n,{data:r=[]}=n,{multiple:l=!1}=n,{disabled:a=!1}=n,{placeholder:c=null}=n,{options:u={}}=n;const d=ot();let p,f=!1;var h;return nt((()=>{if(o(4,i=jQuery(p)),i.addClass("wc-enhanced-select"),i.data("data",r),i.data("placeholder",c),i.data("width","resolve"),u&&i.data(u),!1!==u.init&&e(!0!==u.init),i.on("change",(t=>{d("change",{handler:i,event:t})})),i.on("select2:close",(()=>{i.data("select2").$container.removeClass("select2-container--above"),i.data("select2").$dropdown.find("> .select2-dropdown").removeClass("select2-dropdown--above")})),l||i.on("select2:open",(()=>{const t=i.data("select2").$dropdown.find(".select2-search__field");t.one("blur",(()=>{setTimeout((()=>t.focus()),10)}))})),u.fixPosition){let t=!1;i.on("select2:open",(()=>{t||(i.selectWoo("close"),t=!0,i.selectWoo("open"),t=!1)}))}setTimeout((()=>{f=!0}))})),h=()=>{i.selectWoo("destroy"),i.remove()},et().$$.on_destroy.push(h),t.$$set=t=>{"handler"in t&&o(4,i=t.handler),"name"in t&&o(0,s=t.name),"data"in t&&o(5,r=t.data),"multiple"in t&&o(1,l=t.multiple),"disabled"in t&&o(2,a=t.disabled),"placeholder"in t&&o(6,c=t.placeholder),"options"in t&&o(7,u=t.options)},t.$$.update=()=>{var e;32&t.$$.dirty&&function(t){if(!f)return;if(u.replaceData||!t||!i.data("data")||t.length!==i.data("data").length||t.length&&t[0].id!==i.data("data")[0].id)return i.empty().trigger("change.select2"),i.data("data",t),void i.selectWoo();let e=!1;i.find("option").each(((n,o)=>{if(!t[n])return!1;const i=jQuery(o),s=!0===t[n].selected,r=!0===t[n].disabled;i.prop("selected")!==s&&(i.prop("selected",s),e=!0),i.prop("disabled")!==r&&(i.prop("disabled",r),e=!0)})),e&&(i.trigger("change.select2"),i.selectWoo())}(r),64&t.$$.dirty&&(e=c,f&&(i.data("placeholder",e),i.selectWoo())),128&t.$$.dirty&&function(t){f&&t&&(i.data(t),i.selectWoo())}(u)},[s,l,a,p,i,r,c,u,function(t){lt[t?"unshift":"push"]((()=>{p=t,o(3,p)}))}]}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");const Dt=class extends qt{constructor(t){super(),Pt(this,t,Bt,Xt,_,{handler:4,name:0,data:5,multiple:1,disabled:2,placeholder:6,options:7})}};function Ht(t,e,n){const o=t.slice();return o[13]=e[n],o[15]=n,o}function Qt(t){let e,n=t[13].image+"";return{c(){e=R("div"),X(e,"class","component-image")},m(t,o){N(t,e,o),e.innerHTML=n},p(t,o){4&o&&n!==(n=t[13].image+"")&&(e.innerHTML=n)},d(t){t&&P(e)}}}function Jt(t){let e,n,o=t[13].sku+"";return{c(){e=R("div"),n=q(o),X(e,"class","component-sku")},m(t,o){N(t,e,o),S(e,n)},p(t,e){4&e&&o!==(o=t[13].sku+"")&&D(n,o)},d(t){t&&P(e)}}}function Ut(t){let e,n,o;return{c(){e=R("div"),n=R("span"),X(n,"class","component-disabled"),X(n,"title",o=t[5].disabled),X(e,"class","component-status")},m(t,o){N(t,e,o),S(e,n)},p:h,d(t){t&&P(e)}}}function Vt(t,e){let n,o,i,s,r,l,a,c,u,d,p,f,h,m,$,g,b,y,w,_,x,k=e[13].title+"",E=e[13].image&&Qt(e),L=e[13].sku&&Jt(e),T=!e[13].enabled&&Ut(e);function z(){return e[9](e[13])}return{key:t,first:null,c(){n=R("div"),E&&E.c(),o=F(),i=R("div"),s=q(k),r=F(),L&&L.c(),l=F(),T&&T.c(),a=F(),c=R("div"),u=R("input"),h=F(),m=R("div"),$=R("button"),b=F(),X(i,"class","component-title"),X(u,"type","number"),X(u,"name",d=e[4].name+"["+e[1]+"]["+e[13].id+"]"),u.value=p=e[0][e[13].id],X(u,"step","any"),X(u,"min","0"),X(u,"placeholder",e[6]),X(u,"title",f=e[5][e[1]].quantityTip),X(c,"class","component-quantity"),X($,"type","button"),X($,"class","remove-component-button"),X($,"title",g=e[5].remove),X(m,"class","component-actions"),X(n,"class","component-item"),Q(n,"disabled",!e[13].enabled),this.first=n},m(t,e){N(t,n,e),E&&E.m(n,null),S(n,o),S(n,i),S(i,s),S(n,r),L&&L.m(n,null),S(n,l),T&&T.m(n,null),S(n,a),S(n,c),S(c,u),S(n,h),S(n,m),S(m,$),S(n,b),w=!0,_||(x=[Y(u,"change",Zt),Y($,"click",z),Y(n,"introend",Kt)],_=!0)},p(t,i){(e=t)[13].image?E?E.p(e,i):(E=Qt(e),E.c(),E.m(n,o)):E&&(E.d(1),E=null),(!w||4&i)&&k!==(k=e[13].title+"")&&D(s,k),e[13].sku?L?L.p(e,i):(L=Jt(e),L.c(),L.m(n,l)):L&&(L.d(1),L=null),e[13].enabled?T&&(T.d(1),T=null):T?T.p(e,i):(T=Ut(e),T.c(),T.m(n,a)),(!w||6&i&&d!==(d=e[4].name+"["+e[1]+"]["+e[13].id+"]"))&&X(u,"name",d),(!w||5&i&&p!==(p=e[0][e[13].id])&&u.value!==p)&&(u.value=p),(!w||2&i&&f!==(f=e[5][e[1]].quantityTip))&&X(u,"title",f),(!w||4&i)&&Q(n,"disabled",!e[13].enabled)},i(t){w||(t&&pt((()=>{w&&(y||(y=zt(n,Yt,{duration:170},!0)),y.run(1))})),w=!0)},o(t){t&&(y||(y=zt(n,Yt,{duration:170},!1)),y.run(0)),w=!1},d(t){t&&P(n),E&&E.d(),L&&L.d(),T&&T.d(),t&&y&&y.end(),_=!1,v(x)}}}function Gt(t){let e,n,o,i,s,r,l,a,c,u,d,p,f,h,m,$=t[5][t[1]].label+"",g=[],b=new Map;a=new Dt({props:{multiple:!0,data:t[3],placeholder:t[5][t[1]].addPlaceholder,options:{width:"auto"}}}),a.$on("change",t[7]);let v=At(t[2]);const y=t=>t[13].id;for(let e=0;e<v.length;e+=1){let n=Ht(t,v,e),o=y(n);b.set(o,g[e]=Vt(o,n))}return{c(){e=R("p"),n=R("label"),o=q($),i=F(),s=R("span"),l=F(),jt(a.$$.fragment),u=F(),d=R("div"),p=R("div"),f=R("div");for(let t=0;t<g.length;t+=1)g[t].c();X(n,"for",""),X(s,"class","woocommerce-help-tip"),X(s,"title",r=t[5][t[1]].fieldTip),X(e,"class",c="form-field mewz_wcas_"+t[1]+"_components_field"),X(f,"class","component-list-inner"),X(p,"class",h="component-list "+t[1]+"-component-list"),X(d,"class","mewz-wcas-components-section"),Q(d,"empty",!t[2].length)},m(t,r){N(t,e,r),S(e,n),S(n,o),S(e,i),S(e,s),S(e,l),Wt(a,e,null),N(t,u,r),N(t,d,r),S(d,p),S(p,f);for(let t=0;t<g.length;t+=1)g[t]&&g[t].m(f,null);m=!0},p(t,[n]){(!m||2&n)&&$!==($=t[5][t[1]].label+"")&&D(o,$),(!m||2&n&&r!==(r=t[5][t[1]].fieldTip))&&X(s,"title",r);const i={};8&n&&(i.data=t[3]),2&n&&(i.placeholder=t[5][t[1]].addPlaceholder),a.$set(i),(!m||2&n&&c!==(c="form-field mewz_wcas_"+t[1]+"_components_field"))&&X(e,"class",c),375&n&&(v=At(t[2]),xt(),g=Ct(g,n,y,1,t,v,b,f,Ot,Vt,null,Ht),kt()),(!m||2&n&&h!==(h="component-list "+t[1]+"-component-list"))&&X(p,"class",h),(!m||4&n)&&Q(d,"empty",!t[2].length)},i(t){if(!m){Et(a.$$.fragment,t);for(let t=0;t<v.length;t+=1)Et(g[t]);m=!0}},o(t){Lt(a.$$.fragment,t);for(let t=0;t<g.length;t+=1)Lt(g[t]);m=!1},d(t){t&&(P(e),P(u),P(d)),Nt(a);for(let t=0;t<g.length;t+=1)g[t].d()}}}function Kt(t){t.target.scrollIntoView({behavior:"smooth",block:"nearest"})}function Zt(t){+t.target.value<=0&&(t.target.value="")}function te(t,e,n){let o,i,{type:s}=e,{components:r}=e;const l=st("data"),{i18n:a}=l,c=ot(),u=1..toLocaleString(l.locale,{minimumFractionDigits:2});function d(t){delete r[t],n(0,r)}return t.$$set=t=>{"type"in t&&n(1,s=t.type),"components"in t&&n(0,r=t.components)},t.$$.update=()=>{1&t.$$.dirty&&n(3,o=function(t){const e=[];for(const n of l.stockList){let o=n.title;n.sku&&(o+=` [${n.sku}]`),n.enabled||(o=`🛇 ${o}`);const i={id:n.id,text:o};n.id in t&&(i.disabled=!0),e.push(i)}return e}(r)),1&t.$$.dirty&&n(2,i=l.stockList.filter((t=>t.id in r)))},[r,s,i,o,l,a,u,function(t){const e=t.detail.handler,o=e.val();var i;o&&o.length&&((i=+o[0])in r||(n(0,r[i]=["",""],r),c("added",{type:s,id:i})),setTimeout((()=>e.focus())))},d,t=>d(t.id)]}const ee=class extends qt{constructor(t){super(),Pt(this,t,te,Gt,w,{type:1,components:0})}};function ne(t){let e;return{c(){e=R("input"),X(e,"type","hidden"),X(e,"name","mewz_wcas_noupdate[components]"),e.value="1"},m(t,n){N(t,e,n)},d(t){t&&P(e)}}}function oe(t){let e,n,o,i,s,r,l,a,c,u=!t[1]&&ne();function d(e){t[3](e)}let p={type:"parent"};function f(e){t[4](e)}void 0!==t[0].parent&&(p.components=t[0].parent),o=new ee({props:p}),lt.push((()=>St(o,"components",d))),o.$on("added",t[2]);let h={type:"child"};return void 0!==t[0].child&&(h.components=t[0].child),l=new ee({props:h}),lt.push((()=>St(l,"components",f))),l.$on("added",t[2]),{c(){u&&u.c(),e=F(),n=R("div"),jt(o.$$.fragment),s=F(),r=R("div"),jt(l.$$.fragment),X(n,"class","options_group"),X(r,"class","options_group")},m(t,i){u&&u.m(t,i),N(t,e,i),N(t,n,i),Wt(o,n,null),N(t,s,i),N(t,r,i),Wt(l,r,null),c=!0},p(t,[n]){t[1]?u&&(u.d(1),u=null):u||(u=ne(),u.c(),u.m(e.parentNode,e));const s={};!i&&1&n&&(i=!0,s.components=t[0].parent,ft((()=>i=!1))),o.$set(s);const r={};!a&&1&n&&(a=!0,r.components=t[0].child,ft((()=>a=!1))),l.$set(r)},i(t){c||(Et(o.$$.fragment,t),Et(l.$$.fragment,t),c=!0)},o(t){Lt(o.$$.fragment,t),Lt(l.$$.fragment,t),c=!1},d(t){t&&(P(e),P(n),P(s),P(r)),u&&u.d(t),Nt(o),Nt(l)}}}function ie(t,e,i){const s=e.data,r=s.components;it("data",s);let l=!1;s.stockItems={};for(const t of s.stockList)s.stockItems[t.id]=t;return nt((()=>{setTimeout((()=>{n("#components_panel .woocommerce-help-tip"),o(document.getElementById("components_panel"),s.name+"[",(t=>i(1,l=t)))}))})),t.$$set=t=>{i(6,e=$($({},e),x(t)))},t.$$.update=()=>{1&t.$$.dirty&&mewzWcas.setTabIndicator("components",Object.values(r.child).length)},e=x(e),[r,l,function(t){const{type:e,id:n}=t.detail;delete r["parent"===e?"child":"parent"][n]},function(e){t.$$.not_equal(r.parent,e)&&(r.parent=e,i(0,r))},function(e){t.$$.not_equal(r.child,e)&&(r.child=e,i(0,r))}]}function se(t,{delay:e=0,duration:n=400,easing:o=Ft,axis:i="y"}={}){const s=getComputedStyle(t),r=+s.opacity,l="y"===i?"height":"width",a=parseFloat(s[l]),c="y"===i?["top","bottom"]:["left","right"],u=c.map((t=>`${t[0].toUpperCase()}${t.slice(1)}`)),d=parseFloat(s[`padding${u[0]}`]),p=parseFloat(s[`padding${u[1]}`]),f=parseFloat(s[`margin${u[0]}`]),h=parseFloat(s[`margin${u[1]}`]),m=parseFloat(s[`border${u[0]}Width`]),$=parseFloat(s[`border${u[1]}Width`]);return{delay:e,duration:n,easing:o,css:t=>`overflow: hidden;opacity: ${Math.min(20*t,1)*r};${l}: ${t*a}px;padding-${c[0]}: ${t*d}px;padding-${c[1]}: ${t*p}px;margin-${c[0]}: ${t*f}px;margin-${c[1]}: ${t*h}px;border-${c[0]}-width: ${t*m}px;border-${c[1]}-width: ${t*$}px;`}}function re(t,e){e=Object.assign({open:!0,duration:.2,easing:"ease"},e);const n=()=>{};let o=n,i=n;const s=t.addEventListener("transitionend",(()=>{o(),o=n,i=n}));async function r(){return new Promise(requestAnimationFrame)}function l(){return`height ${e.duration}s ${e.easing}`}return t.style.transition=l(),t.style.height=e.open?"auto":"0px",e.open?t.style.overflow="visible":t.style.overflow="hidden",{update:function(n){(e=Object.assign(e,n)).open?async function(){t.style.height=t.scrollHeight+"px";try{await async function(){return new Promise(((t,e)=>{o=t,i=e}))}(),t.style.height="auto",t.style.overflow="visible"}catch(t){}}():async function(){"auto"===t.style.height?(t.style.transition="none",await r(),t.style.height=t.scrollHeight+"px",t.style.transition=l(),await r(),t.style.overflow="hidden",t.style.height="0px"):(i(),t.style.overflow="hidden",t.style.height="0px")}()},destroy:function(){t.removeEventListener("transitionend",s)}}}function le(t,{dragStart:e,dragMove:n,dragEnd:o,exclude:i,enabled:s=!0}){function r(t){if(!s||i&&t.target.closest(i))return;const r=ae(t);r&&(t.preventDefault(),function(t,e,{dragStart:n,dragMove:o,dragEnd:i}){let s,r=t,l=e.clientX,a=e.clientY,c=l+window.scrollX,u=a+window.scrollY,d=0,p=0;function f(t){const e=ae(t);e&&(r=t,l=e.clientX,a=e.clientY,d=l+window.scrollX-c,p=a+window.scrollY-u,o&&o({event:t,pointer:e,x:l,y:top,startX:c,startY:u,moveX:d,moveY:p}))}function h(t){const e=ae(t,s);e&&(r=t,"mouseup"===t.type?(window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",h)):(window.removeEventListener("touchmove",f),window.removeEventListener("touchend",h)),window.removeEventListener("scroll",m),i&&i({event:t,pointer:e,x:l,y:top,startX:c,startY:u,moveX:d,moveY:p}))}function m(){d=l+window.scrollX-c,p=a+window.scrollY-u,o({event:r,pointer:e,x:l,y:top,startX:c,startY:u,moveX:d,moveY:p})}"mousedown"===t.type?(window.addEventListener("mousemove",f),window.addEventListener("mouseup",h)):(s=e.identifier,window.addEventListener("touchmove",f),window.addEventListener("touchend",h)),window.addEventListener("scroll",m),n&&n({event:t,pointer:e,x:l,y:top,startX:c,startY:u})}(t,r,{dragStart:e,dragMove:n,dragEnd:o}))}return t.addEventListener("mousedown",r),t.addEventListener("touchstart",r,{passive:!1}),{update(t){i=t.exclude,s=t.enabled},destroy(){t.removeEventListener("mousedown",r),t.removeEventListener("touchstart",r)}}}function ae(t,e){return t instanceof MouseEvent?0===t.button?t:null:void 0===e?1===t.touches.length?t.touches[0]:null:function(t,e){for(const n of t)if(n.identifier===e)return n;return null}(t.changedTouches,e)}function ce(t,e,n){const o=t.slice();o[42]=e[n],o[44]=e,o[45]=n;const i=`${o[8].name}[${o[3]}][attributes][${o[42][0]}]`;return o[43]=i,o}function ue(t,e,n){const o=t.slice();return o[46]=e[n],o[48]=n,o}function de(t){let e,n,o,i,s=t[9].ruleTitle.replace("%s",t[3]+1)+"";return{c(){e=R("span"),n=q(s),o=F(),i=R("span"),i.textContent="—",X(e,"class","toolbar-label toolbar-label-title"),X(i,"class","sep")},m(t,s){N(t,e,s),S(e,n),N(t,o,s),N(t,i,s)},p(t,e){8&e[0]&&s!==(s=t[9].ruleTitle.replace("%s",t[3]+1)+"")&&D(n,s)},d(t){t&&(P(e),P(o),P(i))}}}function pe(t){let e,n,o=t[46].name+"";return{c(){e=R("span"),n=q(o),X(e,"class","name")},m(t,o){N(t,e,o),S(e,n)},p(t,e){3&e[0]&&o!==(o=t[46].name+"")&&D(n,o)},d(t){t&&P(e)}}}function fe(t,e){let n,o,i,s,r,l,a,c,u=(e[46].value||"")+"",d=e[46].name&&pe(e);return{key:t,first:null,c(){n=R("span"),d&&d.c(),o=F(),i=R("span"),s=q(u),r=F(),X(i,"class","value"),X(n,"class",l="toolbar-label toolbar-label-"+e[46].type+(e[46].class?" "+e[46].class:"")),X(n,"title",a=e[46].title),X(n,"rel",c=e[46].title?"tiptip":null),this.first=n},m(t,e){N(t,n,e),d&&d.m(n,null),S(n,o),S(n,i),S(i,s),S(n,r)},p(t,i){(e=t)[46].name?d?d.p(e,i):(d=pe(e),d.c(),d.m(n,o)):d&&(d.d(1),d=null),3&i[0]&&u!==(u=(e[46].value||"")+"")&&D(s,u),3&i[0]&&l!==(l="toolbar-label toolbar-label-"+e[46].type+(e[46].class?" "+e[46].class:""))&&X(n,"class",l),3&i[0]&&a!==(a=e[46].title)&&X(n,"title",a),3&i[0]&&c!==(c=e[46].title?"tiptip":null)&&X(n,"rel",c)},d(t){t&&P(n),d&&d.d()}}}function he(t,e){let n,o,i,s,r,l,a,c,u,d,p,f,h,m,$,g,b,v,y,w;function _(){return e[27](e[45])}return s=new Dt({props:{data:e[12](e[42][0]),placeholder:{id:"",text:e[9].attributePlaceholder},options:{init:!0,fixPosition:!0}}}),s.$on("change",(function(...t){return e[25](e[42],e[44],e[45],...t)})),d=new Dt({props:{name:e[43]+"[]",multiple:!0,data:e[13](e[42]),placeholder:e[42][0]?e[9].anyOption.replace("%s",e[8].attributes[e[42][0]].label):e[9].termPlaceholder,disabled:!e[42][0],options:{init:!0,width:"auto",fixPosition:!0}}}),d.$on("change",(function(...t){return e[26](e[42],e[44],e[45],...t)})),{key:t,first:null,c(){n=R("div"),o=R("div"),i=R("div"),jt(s.$$.fragment),r=F(),l=R("div"),a=R("input"),u=F(),jt(d.$$.fragment),p=F(),f=R("div"),h=R("button"),g=F(),X(i,"class","select-attribute"),X(a,"type","hidden"),X(a,"name",c=e[43]),a.value="",X(l,"class","select-terms"),X(h,"type","button"),X(h,"class","icon-button row-remove-button"),X(h,"title",m=e[9].removeAttribute),h.disabled=$=1===e[0].length&&!e[42].attribute,X(f,"class","attribute-row-actions"),X(o,"class","attribute-row-inner"),X(n,"class","attribute-row"),this.first=n},m(t,e){N(t,n,e),S(n,o),S(o,i),Wt(s,i,null),S(o,r),S(o,l),S(l,a),S(l,u),Wt(d,l,null),S(o,p),S(o,f),S(f,h),S(n,g),v=!0,y||(w=Y(h,"click",_),y=!0)},p(t,n){e=t;const o={};1&n[0]&&(o.data=e[12](e[42][0])),s.$set(o),(!v||9&n[0]&&c!==(c=e[43]))&&X(a,"name",c);const i={};9&n[0]&&(i.name=e[43]+"[]"),1&n[0]&&(i.data=e[13](e[42])),1&n[0]&&(i.placeholder=e[42][0]?e[9].anyOption.replace("%s",e[8].attributes[e[42][0]].label):e[9].termPlaceholder),1&n[0]&&(i.disabled=!e[42][0]),d.$set(i),(!v||1&n[0]&&$!==($=1===e[0].length&&!e[42].attribute))&&(h.disabled=$)},i(t){v||(Et(s.$$.fragment,t),Et(d.$$.fragment,t),t&&pt((()=>{v&&(b||(b=zt(n,Yt,{duration:130},!0)),b.run(1))})),v=!0)},o(t){Lt(s.$$.fragment,t),Lt(d.$$.fragment,t),t&&(b||(b=zt(n,Yt,{duration:130},!1)),b.run(0)),v=!1},d(t){t&&P(n),Nt(s),Nt(d),t&&b&&b.end(),y=!1,w()}}}function me(t){let e,n,o,i,s,r;return{c(){e=R("div"),n=R("button"),n.textContent="Add attribute",X(n,"type","button"),X(n,"class","row-add-button"),X(e,"class","attribute-list-actions")},m(o,l){N(o,e,l),S(e,n),i=!0,s||(r=Y(n,"click",t[28]),s=!0)},p:h,i(t){i||(t&&pt((()=>{i&&(o||(o=zt(e,se,{duration:100},!0)),o.run(1))})),i=!0)},o(t){t&&(o||(o=zt(e,se,{duration:100},!1)),o.run(0)),i=!1},d(t){t&&P(e),t&&o&&o.end(),s=!1,r()}}}function $e(t){let e,n,o,i,s,r,l,a,c,u,d,p,f,$,g,b,w,_,x,E,T,z,A,O,C,I,j,W,D,J,U,V,G,tt,et,nt,ot,it,st,rt,lt,at,ct,ut=[],dt=new Map,ft=[],ht=new Map,mt=t[9].multiplierLabel+"",$t=t[5]>1&&de(t),gt=At(t[14](t[0],t[1]));const bt=t=>t[48]+t[46].type;for(let e=0;e<gt.length;e+=1){let n=ue(t,gt,e),o=bt(n);dt.set(o,ut[e]=fe(o,n))}let wt=At(t[0]);const zt=t=>t[42];for(let e=0;e<wt.length;e+=1){let n=ce(t,wt,e),o=zt(n);ht.set(o,ft[e]=he(o,n))}let It=t[0].length<t[10]&&me(t);return{c(){e=R("div"),n=R("div"),o=R("div"),$t&&$t.c(),i=F();for(let t=0;t<ut.length;t+=1)ut[t].c();s=F(),r=R("span"),l=R("span"),a=F(),c=R("button"),p=F(),f=R("button"),g=F(),b=R("button"),_=F(),x=R("div"),E=R("div"),T=R("div"),z=R("div");for(let t=0;t<ft.length;t+=1)ft[t].c();A=F(),It&&It.c(),O=F(),C=R("div"),I=R("div"),j=R("label"),W=q(mt),D=F(),J=R("span"),V=F(),G=R("input"),X(o,"class","toolbar-labels"),X(l,"class","toolbar-action icon-button expand-button"),X(c,"type","button"),X(c,"class","toolbar-action icon-button drag-button"),X(c,"title",u=t[9].dragTip),X(f,"type","button"),X(f,"class","toolbar-action icon-button duplicate-button"),X(f,"title",$=t[9].duplicateRule),X(b,"type","button"),X(b,"class","toolbar-action icon-button remove-button"),X(b,"title",w=t[9].removeRule),X(r,"class","match-rule-toolbar-actions"),X(n,"class","match-rule-toolbar"),X(z,"class","attribute-rows"),X(T,"class","attribute-list"),X(J,"class","woocommerce-help-tip"),X(J,"title",U=t[9].multiplierTip),X(G,"type","number"),X(G,"name",tt=t[17](t[3],"multiplier")),X(G,"step","any"),X(G,"min","-1"),X(G,"placeholder",et=t[22](t[0])),X(G,"lang",nt=t[8].locale),X(I,"class","option option-multiplier"),X(C,"class","match-rule-options"),X(E,"class","match-rule-body-inner"),X(x,"class","match-rule-body"),X(e,"class","mewz-wcas-match-rule"),X(e,"style",it=ge(t[7])),Q(e,"zero-multiplier",null!=t[1]&&""!==t[1]&&0==+t[1]),Q(e,"stop-rule",+t[1]<0),Q(e,"open",t[2]),Q(e,"dragging",t[7]),Q(e,"released",t[7]&&t[7].released)},m(u,h){N(u,e,h),S(e,n),S(n,o),$t&&$t.m(o,null),S(o,i);for(let t=0;t<ut.length;t+=1)ut[t]&&ut[t].m(o,null);S(n,s),S(n,r),S(r,l),S(r,a),S(r,c),S(r,p),S(r,f),S(r,g),S(r,b),S(e,_),S(e,x),S(x,E),S(E,T),S(T,z);for(let t=0;t<ft.length;t+=1)ft[t]&&ft[t].m(z,null);S(T,A),It&&It.m(T,null),S(E,O),S(E,C),S(C,I),S(I,j),S(j,W),S(j,D),S(j,J),S(I,V),S(I,G),H(G,t[1]),t[30](e),lt=!0,at||(ct=[k(d=le.call(null,c,{dragStart:t[19],dragMove:t[20],dragEnd:t[21],enabled:t[4]})),Y(f,"click",t[23]),Y(b,"click",t[24]),Y(n,"click",t[18]),Y(G,"input",t[29]),k(ot=re.call(null,x,{open:t[2],duration:.17}))],at=!0)},p(t,n){t[5]>1?$t?$t.p(t,n):($t=de(t),$t.c(),$t.m(o,i)):$t&&($t.d(1),$t=null),16387&n[0]&&(gt=At(t[14](t[0],t[1])),ut=Ct(ut,n,bt,1,t,gt,dt,o,Mt,fe,null,ue)),d&&y(d.update)&&16&n[0]&&d.update.call(null,{dragStart:t[19],dragMove:t[20],dragEnd:t[21],enabled:t[4]}),78601&n[0]&&(wt=At(t[0]),xt(),ft=Ct(ft,n,zt,1,t,wt,ht,z,Ot,he,null,ce),kt()),t[0].length<t[10]?It?(It.p(t,n),1&n[0]&&Et(It,1)):(It=me(t),It.c(),Et(It,1),It.m(T,null)):It&&(xt(),Lt(It,1,1,(()=>{It=null})),kt()),(!lt||8&n[0]&&tt!==(tt=t[17](t[3],"multiplier")))&&X(G,"name",tt),(!lt||1&n[0]&&et!==(et=t[22](t[0])))&&X(G,"placeholder",et),2&n[0]&&B(G.value)!==t[1]&&H(G,t[1]),ot&&y(ot.update)&&4&n[0]&&ot.update.call(null,{open:t[2],duration:.17}),(!lt||128&n[0]&&it!==(it=ge(t[7])))&&X(e,"style",it),(!lt||2&n[0])&&Q(e,"zero-multiplier",null!=t[1]&&""!==t[1]&&0==+t[1]),(!lt||2&n[0])&&Q(e,"stop-rule",+t[1]<0),(!lt||4&n[0])&&Q(e,"open",t[2]),(!lt||128&n[0])&&Q(e,"dragging",t[7]),(!lt||128&n[0])&&Q(e,"released",t[7]&&t[7].released)},i(t){if(!lt){for(let t=0;t<wt.length;t+=1)Et(ft[t]);Et(It),t&&pt((()=>{lt&&(rt&&rt.end(1),st=function(t,e,n){const o={direction:"in"};let i,s,r=e(t,{duration:170},o),l=!1,a=0;function c(){i&&Z(t,i)}function u(){const{delay:e=0,duration:n=300,easing:o=m,tick:u=h,css:d}=r||Tt;d&&(i=K(t,0,1,n,e,o,d,a++)),u(0,1);const p=L()+e,f=p+n;s&&s.abort(),l=!0,pt((()=>yt(t,!0,"start"))),s=M((e=>{if(l){if(e>=f)return u(1,0),yt(t,!0,"end"),c(),l=!1;if(e>=p){const t=o((e-p)/n);u(t,1-t)}}return l}))}let d=!1;return{start(){d||(d=!0,Z(t),y(r)?(r=r(o),vt().then(u)):u())},invalidate(){d=!1},end(){l&&(c(),l=!1)}}}(e,Yt),st.start())})),lt=!0}},o(t){for(let t=0;t<ft.length;t+=1)Lt(ft[t]);Lt(It),st&&st.invalidate(),t&&(rt=function(t,e,n){const o={direction:"out"};let i,s=e(t,{duration:170},o),r=!0;const l=_t;let a;function c(){const{delay:e=0,duration:n=300,easing:o=m,tick:c=h,css:u}=s||Tt;u&&(i=K(t,1,0,n,e,o,u));const d=L()+e,p=d+n;pt((()=>yt(t,!1,"start"))),"inert"in t&&(a=t.inert,t.inert=!0),M((e=>{if(r){if(e>=p)return c(0,1),yt(t,!1,"end"),--l.r||v(l.c),!1;if(e>=d){const t=o((e-d)/n);c(1-t,t)}}return r}))}return l.r+=1,y(s)?vt().then((()=>{s=s(o),c()})):c(),{end(e){e&&"inert"in t&&(t.inert=a),e&&s.tick&&s.tick(1,0),r&&(i&&Z(t,i),r=!1)}}}(e,Yt)),lt=!1},d(n){n&&P(e),$t&&$t.d();for(let t=0;t<ut.length;t+=1)ut[t].d();for(let t=0;t<ft.length;t+=1)ft[t].d();It&&It.d(),t[30](null),n&&rt&&rt.end(),at=!1,v(ct)}}}function ge(t){if(t)return`transform: translateY(${t.offset}px);`}function be(t,e,o){let i,{index:s}=e,{attributes:r}=e,{multiplier:l=""}=e,{open:a=!0}=e,{draggable:c=!0}=e,{ruleCount:u=1}=e;const d=st("data"),p=d.i18n,f=Object.keys(d.attributes).length,h=ot(),m=x(1,!0);let $,g=!1;function b(){const t=[0,[]];r?(r.push(t),o(0,r)):o(0,r=[t]),setTimeout((()=>{const t=$.querySelector(".attribute-row:last-child .select-attribute select");t&&jQuery(t).focus()}),150)}function v(t){r.splice(t,1),r.length?o(0,r):b()}function y(t){if(!t||t.target===$){g.released&&$.removeEventListener("transitionend",y);for(const t of g.list)t.el.style.transform="";h("dragging",[s,!1]),g.targetIndex!==s&&h("action",["shift",s,g.targetIndex]),o(7,g=!1)}}function w(){const t=$.parentNode.querySelectorAll(".mewz-wcas-match-rule"),e=[];let n=0;for(const o of t){const t=o.offsetHeight;e.push({el:o,height:t,mid:n+Math.round(t/2),offset:0}),n+=t}return e}function _(t){const e={};for(const n of t)e[n[0]]=n[1];for(const[t]of d.attributeOptions){const n=e[t];if(!n)continue;const o=d.attributes[t];if(1===n.length){for(const t of o.terms)if(t[0]===n[0]&&null!=t[2])return+t[2]}else{let t=[1/0,0],e=!1;for(const i of o.terms){if(n.length&&!n.includes(i[0]))continue;if(null==i[2]){e=!0;continue}const o=+i[2];o<t[0]&&(t[0]=o),o>t[1]&&(t[1]=o)}if(t[0]!==1/0)return e&&t[0]>1&&(t[0]=1),t[0]===t[1]?t[0]:t}}return null}function x(t,e){const n=e&&t<10?{minimumFractionDigits:2}:{maximumSignificantDigits:20,maximumFractionDigits:20};return t.toLocaleString(d.locale,n)}return nt((()=>{n(".mewz-wcas-match-rule .woocommerce-help-tip")})),t.$$set=t=>{"index"in t&&o(3,s=t.index),"attributes"in t&&o(0,r=t.attributes),"multiplier"in t&&o(1,l=t.multiplier),"open"in t&&o(2,a=t.open),"draggable"in t&&o(4,c=t.draggable),"ruleCount"in t&&o(5,u=t.ruleCount)},t.$$.update=()=>{1&t.$$.dirty[0]&&(r.length||b()),1&t.$$.dirty[0]&&(i=function(t){const e={};for(const n of t)n[0]&&(e[n[0]]=!0);return e}(r))},[r,l,a,s,c,u,$,g,d,p,f,h,function(t){const e=[{id:"",text:""}];for(const[n,o]of d.attributeOptions){const s={id:n,text:o};n===t?s.selected=!0:i[n]&&(s.disabled=!0),e.push(s)}return e},function(t){if(!t[0])return[];const e=d.attributes[t[0]].terms,n=[],o={};for(const e of t[1])o[e]=!0;for(const[t,i]of e){const e={id:t,text:i};o[t]&&(e.selected=!0),n.push(e)}return n},function(t,e){const o=[];for(const[e,n]of t){if(!e||!n)continue;const t=[];if(n.length)for(const o of d.attributes[e].terms)if(n.includes(o[0])&&(t.push(o[1]),t.length===n.length))break;o.push({type:"attribute",name:d.attributes[e].label,value:t.length?t.join(", "):p.any})}if(o.length||o.push({type:"attribute",value:"..."}),null!=e&&""!==e&&1!=+e)+e<0?(o.push({type:"stop",title:p.stopRuleTip}),setTimeout((()=>n('.mewz-wcas-match-rule [rel="tiptip"]')))):o.push({type:"multiplier",value:`×${x(+e)}`});else if(1!=+e){const e=_(t);if(null!=e){let t;t=Array.isArray(e)?`×${x(e[0])}–${x(e[1])}`:`×${x(e)}`,o.push({type:"multiplier",class:"inherited",title:p.multiplierInherited,value:t})}}return o},b,v,function(t,e){return`${d.name}[${t}][${e}]`},function(t){g||t&&t.target.closest("button")||o(2,a=!a)},function(t){g||(o(7,g={height:$.offsetHeight,start:$.offsetTop,offset:0,end:$.parentNode.offsetHeight,list:w(),targetIndex:s,animatedIndex:s,released:!1}),h("dragging",[s,{released:!1}]))},function(t){g&&!g.released&&(o(7,g.offset=Math.max(-g.start,t.moveY),g),o(7,g.offset=Math.min(g.offset,g.end-g.start-g.height),g),o(7,g.targetIndex=function(){let t=s;const e=g.start+g.offset;for(let n=0;n<g.list.length;n++){const o=g.list[n].mid;if(n<s){if(e<o)return n}else n>s&&e+g.height>o&&(t=n)}return t}(),g),function(){if(g.targetIndex===g.animatedIndex)return;const t=g.targetIndex;for(let e=0;e<g.list.length;e++){const n=g.list[e];let o=0;t<s?e>=t&&e<s&&(o=g.height):t>s&&e<=t&&e>s&&(o=-g.height),n.offset!==o&&(n.el.style.transform=`translateY(${o}px)`,n.offset=o,null==n.animating&&n.el.addEventListener("transitionend",(()=>{n.animating=!1})),n.animating=!0)}o(7,g.animatedIndex=t,g)}())},function(){if(!g||g.released)return;const t=function(){const t=g.targetIndex;let e=0;if(t<s)for(let n=t;n<s;n++)e-=g.list[n].height;else if(t>s)for(let n=t;n>s;n--)e+=g.list[n].height;return e}();g.offset===t?g.targetIndex===s?(h("dragging",[s,!1]),o(7,g=!1)):g.list.some((t=>!0===t.animating))?(setTimeout(y,200),h("dragging",[s,{released:!0}])):y():($.addEventListener("transitionend",y),o(7,g.offset=t,g),o(7,g.released=!0,g),h("dragging",[s,{released:!0}]))},function(t){const e=_(t);return null==e?m:Array.isArray(e)?x(e[0])+" – "+x(e[1]):x(e,!0)},()=>h("action",["duplicate",s]),()=>h("action",["remove",s]),(t,e,n,i)=>o(0,e[n][0]=+i.detail.handler.val(),r),(t,e,n,i)=>o(0,e[n][1]=i.detail.handler.val().map(Number),r),t=>v(t),()=>b(),function(){l=B(this.value),o(1,l)},function(t){lt[t?"unshift":"push"]((()=>{$=t,o(6,$)}))}]}const ve=class extends qt{constructor(t){super(),Pt(this,t,be,$e,w,{index:3,attributes:0,multiplier:1,open:2,draggable:4,ruleCount:5},null,[-1,-1])}};function ye(t,e,n){const o=t.slice();return o[24]=e[n],o[25]=e,o[26]=n,o}function we(t){let e,n,o,i;return{c(){e=R("button"),X(e,"type","button"),X(e,"class","button restore-button"),X(e,"title",n=t[1].i18n.restoreRule)},m(n,s){N(n,e,s),o||(i=Y(e,"click",t[10]),o=!0)},p(t,o){2&o&&n!==(n=t[1].i18n.restoreRule)&&X(e,"title",n)},d(t){t&&P(e),o=!1,i()}}}function _e(t,e){let n,o,i,s,r,l;function a(t){e[13](t,e[24])}function c(t){e[14](t,e[24])}function u(t){e[15](t,e[24])}let d={index:e[26],draggable:!e[5],ruleCount:e[0].length};return void 0!==e[24].attributes&&(d.attributes=e[24].attributes),void 0!==e[24].multiplier&&(d.multiplier=e[24].multiplier),void 0!==e[24].open&&(d.open=e[24].open),o=new ve({props:d}),lt.push((()=>St(o,"attributes",a))),lt.push((()=>St(o,"multiplier",c))),lt.push((()=>St(o,"open",u))),o.$on("action",e[9]),o.$on("dragging",e[8]),{key:t,first:null,c(){n=q(""),jt(o.$$.fragment),this.first=n},m(t,e){N(t,n,e),Wt(o,t,e),l=!0},p(t,n){e=t;const l={};1&n&&(l.index=e[26]),32&n&&(l.draggable=!e[5]),1&n&&(l.ruleCount=e[0].length),!i&&1&n&&(i=!0,l.attributes=e[24].attributes,ft((()=>i=!1))),!s&&1&n&&(s=!0,l.multiplier=e[24].multiplier,ft((()=>s=!1))),!r&&1&n&&(r=!0,l.open=e[24].open,ft((()=>r=!1))),o.$set(l)},i(t){l||(Et(o.$$.fragment,t),l=!0)},o(t){Lt(o.$$.fragment,t),l=!1},d(t){t&&P(n),Nt(o,t)}}}function xe(t){let e;return{c(){e=R("input"),X(e,"type","hidden"),X(e,"name","mewz_wcas_noupdate[rules]"),e.value="1"},m(t,n){N(t,e,n)},d(t){t&&P(e)}}}function ke(t){let e,n,o,i,s,r,l,a,c,u,d,p,f,h,m,$,g,b,y,w,_=t[1].i18n.newRule+"",x=(Ee(t[0])?t[1].i18n.closeAll:t[1].i18n.expandAll)+"",k=[],E=new Map,L=t[4].length&&we(t),T=At(t[0]);const z=t=>t[24];for(let e=0;e<T.length;e+=1){let n=ye(t,T,e),o=z(n);E.set(o,k[e]=_e(o,n))}let A=!t[6]&&xe();return{c(){e=R("div"),n=R("div"),o=R("div"),i=R("button"),s=q(_),r=F(),l=R("span"),c=F(),u=R("div"),L&&L.c(),d=F(),p=R("button"),f=q(x),m=F(),$=R("div");for(let t=0;t<k.length;t+=1)k[t].c();g=F(),A&&A.c(),X(i,"type","button"),X(i,"class","button add-button"),X(l,"class","woocommerce-help-tip"),X(l,"title",a=t[1].i18n.newRuleTip),X(o,"class","toolbar-left"),X(p,"type","button"),X(p,"class",h="button toggle-button "+(Ee(t[0])?"collapse":"expand")),X(u,"class","toolbar-right"),X(n,"class","main-toolbar"),X($,"class","match-rules-list"),X(e,"class","mewz-wcas-attribute-rules"),Q(e,"dragging",t[5]),Q(e,"released",t[5]&&t[5].released)},m(a,h){N(a,e,h),S(e,n),S(n,o),S(o,i),S(i,s),S(o,r),S(o,l),S(n,c),S(n,u),L&&L.m(u,null),S(u,d),S(u,p),S(p,f),S(e,m),S(e,$);for(let t=0;t<k.length;t+=1)k[t]&&k[t].m($,null);t[16]($),S(e,g),A&&A.m(e,null),t[17](e),b=!0,y||(w=[Y(i,"click",t[12]),Y(p,"click",t[11])],y=!0)},p(t,[n]){(!b||2&n)&&_!==(_=t[1].i18n.newRule+"")&&D(s,_),(!b||2&n&&a!==(a=t[1].i18n.newRuleTip))&&X(l,"title",a),t[4].length?L?L.p(t,n):(L=we(t),L.c(),L.m(u,d)):L&&(L.d(1),L=null),(!b||3&n)&&x!==(x=(Ee(t[0])?t[1].i18n.closeAll:t[1].i18n.expandAll)+"")&&D(f,x),(!b||1&n&&h!==(h="button toggle-button "+(Ee(t[0])?"collapse":"expand")))&&X(p,"class",h),801&n&&(T=At(t[0]),xt(),k=Ct(k,n,z,1,t,T,E,$,Ot,_e,null,ye),kt()),t[6]?A&&(A.d(1),A=null):A||(A=xe(),A.c(),A.m(e,null)),(!b||32&n)&&Q(e,"dragging",t[5]),(!b||32&n)&&Q(e,"released",t[5]&&t[5].released)},i(t){if(!b){for(let t=0;t<T.length;t+=1)Et(k[t]);b=!0}},o(t){for(let t=0;t<k.length;t+=1)Lt(k[t]);b=!1},d(n){n&&P(e),L&&L.d();for(let t=0;t<k.length;t+=1)k[t].d();t[16](null),A&&A.d(),t[17](null),y=!1,v(w)}}}function Ee(t){return t.every((t=>t.open))}function Le(t){for(const e of t.attributes)if(e[0])return!0;return!1}function Te(t,e,i){const s=e.data;let r,l;it("data",s);let a=[],c=[],u=!1,d=!1;const p=s.rules;if(p.length){if(1===p.length)p[0].open=!0;else for(let t of p)t.open=!1;a=p}else h();const f=[];for(let t in s.attributes){const e=s.attributes[t];f.push([+t,e.label])}function h(){const t={attributes:[],multiplier:"",open:!0};return a.push(t),i(0,a),t}return s.attributeOptions=f.sort(((t,e)=>t[1].localeCompare(e[1]))),nt((()=>{n(".mewz-wcas-attribute-rules .main-toolbar .woocommerce-help-tip"),o(r,s.name+"[",(t=>i(6,d=t)))})),t.$$set=t=>{i(23,e=$($({},e),x(t)))},t.$$.update=()=>{1&t.$$.dirty&&mewzWcas.setTabIndicator("attributes",a.filter(Le).length)},e=x(e),[a,s,r,l,c,u,d,h,function(t){const[e,n]=t.detail;i(5,u=n)},function(t){const[e,n,o]=t.detail;"duplicate"===e?function(t){const e=JSON.parse(JSON.stringify(a[t]));e.open=!0,a.splice(t+1,0,e),i(0,a)}(n):"remove"===e?function(t){const e=a.splice(t,1)[0];e&&(Le(e)&&(e.lastIndex=t,c.push(e),i(4,c)),a.length?i(0,a):h())}(n):"shift"===e&&function(t,e){const n=a.splice(t,1)[0];a.splice(e,0,n),i(0,a)}(n,o)},function(){const t=c.pop();t&&(1!==a.length||Le(a[0])?a.splice(t.lastIndex,0,t):i(0,a[0]=t,a),delete t.lastIndex,i(4,c),i(0,a))},function(){const t=Ee(a);a.forEach((e=>e.open=!t)),i(0,a)},()=>h(),function(e,n){t.$$.not_equal(n.attributes,e)&&(n.attributes=e,i(0,a))},function(e,n){t.$$.not_equal(n.multiplier,e)&&(n.multiplier=e,i(0,a))},function(e,n){t.$$.not_equal(n.open,e)&&(n.open=e,i(0,a))},function(t){lt[t?"unshift":"push"]((()=>{l=t,i(3,l)}))},function(t){lt[t?"unshift":"push"]((()=>{r=t,i(2,r)}))}]}s("#post").on("submit",(function(){const t=s("#mewz-wcas-stock-status");t.find(".spinner").addClass("is-active"),t.find("#submit").prop("disabled",!0)})),s("#mewz_wcas_internal").on("change",r),r(),setTimeout(e),a.html&&l(a.html).insertAfter(".wrap > .page-title-action"),u=document.getElementById("post"),mewzWcas.setTabIndicator=d,p("settings"),p("filters"),new class extends qt{constructor(t){super(),Pt(this,t,ie,oe,w,{})}}({target:document.getElementById("components_panel"),props:{data:mewzWcas.components}}),new class extends qt{constructor(t){super(),Pt(this,t,Te,ke,w,{})}}({target:document.getElementById("attributes_panel"),props:{data:mewzWcas.matchRules}})})()})();
     1(()=>{"use strict";(()=>{let t=!1;function e(e){e&&!t||jQuery(document.body).trigger("wc-enhanced-select-init")}function n(t){jQuery(t).tipTip({fadeIn:50,fadeOut:50,delay:200})}function o(t,e,n){const o=t.closest("form");o?setTimeout((()=>{const t=i(o,e);o.addEventListener("submit",(()=>{const s=i(o,e)!==t;n(s)}))}),300):n(!0)}function i(t,e){const n=new FormData(t),o=[];for(const t of n.entries())t[0].startsWith(e)&&o.push(t[0],t[1]);return JSON.stringify(o)}jQuery(document.body).one("wc-enhanced-select-init",(()=>{t=!0}));const s=jQuery;function r(){const t=s("#mewz_wcas_internal"),e=t.prop("checked")||t.prop("disabled");s("#mewz_wcas_product_image").prop("disabled",e)}const l=jQuery,a=window.mewzWcas&&mewzWcas.headerActions||{},c=jQuery;let u;function d(t,e){const n=u.querySelector(`.wc-tabs > .${t}_tab a`);n&&(e?n.dataset.indicator=e:delete n.dataset.indicator)}function p(t){const e=c(`#${t}_panel`);e.on("change input",(()=>{f(t,e)})),f(t,e)}function f(t,e){const n=e.find(":input:not(:disabled, .select2-search__field)");let o=0;n.each((function(){const t=c(this),e="checkbox"===t.attr("type")?t.prop("checked"):t.val();Array.isArray(e)?o+=e.length:e&&o++})),d(t,o)}function h(){}const m=t=>t;function $(t,e){for(const n in e)t[n]=e[n];return t}function g(t){return t()}function b(){return Object.create(null)}function v(t){t.forEach(g)}function y(t){return"function"==typeof t}function w(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function _(t,e){return t!=t?e==e:t!==e}function x(t){const e={};for(const n in t)"$"!==n[0]&&(e[n]=t[n]);return e}function k(t){return t&&y(t.destroy)?t.destroy:h}const E="undefined"!=typeof window;let L=E?()=>window.performance.now():()=>Date.now(),T=E?t=>requestAnimationFrame(t):h;const z=new Set;function A(t){z.forEach((e=>{e.c(t)||(z.delete(e),e.f())})),0!==z.size&&T(A)}function M(t){let e;return 0===z.size&&T(A),{promise:new Promise((n=>{z.add(e={c:t,f:n})})),abort(){z.delete(e)}}}const O="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;class C{_listeners="WeakMap"in O?new WeakMap:void 0;_observer=void 0;options;constructor(t){this.options=t}observe(t,e){return this._listeners.set(t,e),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){return this._observer??(this._observer=new ResizeObserver((t=>{for(const e of t)C.entries.set(e.target,e),this._listeners.get(e.target)?.(e)})))}}C.entries="WeakMap"in O?new WeakMap:void 0;let I=!1;function S(t,e){t.appendChild(e)}function j(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function W(t){const e=R("style");return e.textContent="/* empty */",function(t,e){S(t.head||t,e),e.sheet}(j(t),e),e.sheet}function N(t,e,n){t.insertBefore(e,n||null)}function P(t){t.parentNode&&t.parentNode.removeChild(t)}function R(t){return document.createElement(t)}function q(t){return document.createTextNode(t)}function F(){return q(" ")}function Y(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function X(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function B(t){return""===t?null:+t}function D(t,e){e=""+e,t.data!==e&&(t.data=e)}function H(t,e){t.value=null==e?"":e}function Q(t,e,n){t.classList.toggle(e,!!n)}function J(t,e,{bubbles:n=!1,cancelable:o=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:o})}const U=new Map;let V,G=0;function K(t,e,n,o,i,s,r,l=0){const a=16.666/o;let c="{\n";for(let t=0;t<=1;t+=a){const o=e+(n-e)*s(t);c+=100*t+`%{${r(o,1-o)}}\n`}const u=c+`100% {${r(n,1-n)}}\n}`,d=`__svelte_${function(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}(u)}_${l}`,p=j(t),{stylesheet:f,rules:h}=U.get(p)||function(t,e){const n={stylesheet:W(e),rules:{}};return U.set(t,n),n}(p,t);h[d]||(h[d]=!0,f.insertRule(`@keyframes ${d} ${u}`,f.cssRules.length));const m=t.style.animation||"";return t.style.animation=`${m?`${m}, `:""}${d} ${o}ms linear ${i}ms 1 both`,G+=1,d}function Z(t,e){const n=(t.style.animation||"").split(", "),o=n.filter(e?t=>t.indexOf(e)<0:t=>-1===t.indexOf("__svelte")),i=n.length-o.length;i&&(t.style.animation=o.join(", "),G-=i,G||T((()=>{G||(U.forEach((t=>{const{ownerNode:e}=t.stylesheet;e&&P(e)})),U.clear())})))}function tt(t){V=t}function et(){if(!V)throw new Error("Function called outside component initialization");return V}function nt(t){et().$$.on_mount.push(t)}function ot(){const t=et();return(e,n,{cancelable:o=!1}={})=>{const i=t.$$.callbacks[e];if(i){const s=J(e,n,{cancelable:o});return i.slice().forEach((e=>{e.call(t,s)})),!s.defaultPrevented}return!0}}function it(t,e){return et().$$.context.set(t,e),e}function st(t){return et().$$.context.get(t)}const rt=[],lt=[];let at=[];const ct=[],ut=Promise.resolve();let dt=!1;function pt(t){at.push(t)}function ft(t){ct.push(t)}const ht=new Set;let mt,$t=0;function gt(){if(0!==$t)return;const t=V;do{try{for(;$t<rt.length;){const t=rt[$t];$t++,tt(t),bt(t.$$)}}catch(t){throw rt.length=0,$t=0,t}for(tt(null),rt.length=0,$t=0;lt.length;)lt.pop()();for(let t=0;t<at.length;t+=1){const e=at[t];ht.has(e)||(ht.add(e),e())}at.length=0}while(rt.length);for(;ct.length;)ct.pop()();dt=!1,ht.clear(),tt(t)}function bt(t){if(null!==t.fragment){t.update(),v(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(pt)}}function vt(){return mt||(mt=Promise.resolve(),mt.then((()=>{mt=null}))),mt}function yt(t,e,n){t.dispatchEvent(J(`${e?"intro":"outro"}${n}`))}const wt=new Set;let _t;function xt(){_t={r:0,c:[],p:_t}}function kt(){_t.r||v(_t.c),_t=_t.p}function Et(t,e){t&&t.i&&(wt.delete(t),t.i(e))}function Lt(t,e,n,o){if(t&&t.o){if(wt.has(t))return;wt.add(t),_t.c.push((()=>{wt.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}const Tt={duration:0};function zt(t,e,n,o){let i,s=e(t,n,{direction:"both"}),r=o?0:1,l=null,a=null,c=null;function u(){c&&Z(t,c)}function d(t,e){const n=t.b-r;return e*=Math.abs(n),{a:r,b:t.b,d:n,duration:e,start:t.start,end:t.start+e,group:t.group}}function p(e){const{delay:n=0,duration:o=300,easing:p=m,tick:f=h,css:$}=s||Tt,g={start:L()+n,b:e};e||(g.group=_t,_t.r+=1),"inert"in t&&(e?void 0!==i&&(t.inert=i):(i=t.inert,t.inert=!0)),l||a?a=g:($&&(u(),c=K(t,r,e,o,n,p,$)),e&&f(0,1),l=d(g,o),pt((()=>yt(t,e,"start"))),M((e=>{if(a&&e>a.start&&(l=d(a,o),a=null,yt(t,l.b,"start"),$&&(u(),c=K(t,r,l.b,l.duration,0,p,s.css))),l)if(e>=l.end)f(r=l.b,1-r),yt(t,l.b,"end"),a||(l.b?u():--l.group.r||v(l.group.c)),l=null;else if(e>=l.start){const t=e-l.start;r=l.a+l.d*p(t/l.duration),f(r,1-r)}return!(!l&&!a)})))}return{run(t){y(s)?vt().then((()=>{s=s({direction:t?"in":"out"}),p(t)})):p(t)},end(){u(),l=a=null}}}function At(t){return void 0!==t?.length?t:Array.from(t)}function Mt(t,e){t.d(1),e.delete(t.key)}function Ot(t,e){Lt(t,1,1,(()=>{e.delete(t.key)}))}function Ct(t,e,n,o,i,s,r,l,a,c,u,d){let p=t.length,f=s.length,h=p;const m={};for(;h--;)m[t[h].key]=h;const $=[],g=new Map,b=new Map,y=[];for(h=f;h--;){const t=d(i,s,h),l=n(t);let a=r.get(l);a?o&&y.push((()=>a.p(t,e))):(a=c(l,t),a.c()),g.set(l,$[h]=a),l in m&&b.set(l,Math.abs(h-m[l]))}const w=new Set,_=new Set;function x(t){Et(t,1),t.m(l,u),r.set(t.key,t),u=t.first,f--}for(;p&&f;){const e=$[f-1],n=t[p-1],o=e.key,i=n.key;e===n?(u=e.first,p--,f--):g.has(i)?!r.has(o)||w.has(o)?x(e):_.has(i)?p--:b.get(o)>b.get(i)?(_.add(o),x(e)):(w.add(i),p--):(a(n,r),p--)}for(;p--;){const e=t[p];g.has(e.key)||a(e,r)}for(;f;)x($[f-1]);return v(y),$}let It;function St(t,e,n){const o=t.$$.props[e];void 0!==o&&(t.$$.bound[o]=n,n(t.$$.ctx[o]))}function jt(t){t&&t.c()}function Wt(t,e,n){const{fragment:o,after_update:i}=t.$$;o&&o.m(e,n),pt((()=>{const e=t.$$.on_mount.map(g).filter(y);t.$$.on_destroy?t.$$.on_destroy.push(...e):v(e),t.$$.on_mount=[]})),i.forEach(pt)}function Nt(t,e){const n=t.$$;null!==n.fragment&&(function(t){const e=[],n=[];at.forEach((o=>-1===t.indexOf(o)?e.push(o):n.push(o))),n.forEach((t=>t())),at=e}(n.after_update),v(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Pt(t,e,n,o,i,s,r=null,l=[-1]){const a=V;tt(t);const c=t.$$={fragment:null,ctx:[],props:s,update:h,not_equal:i,bound:b(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:b(),dirty:l,skip_bound:!1,root:e.target||a.$$.root};r&&r(c.root);let u=!1;if(c.ctx=n?n(t,e.props||{},((e,n,...o)=>{const s=o.length?o[0]:n;return c.ctx&&i(c.ctx[e],c.ctx[e]=s)&&(!c.skip_bound&&c.bound[e]&&c.bound[e](s),u&&function(t,e){-1===t.$$.dirty[0]&&(rt.push(t),dt||(dt=!0,ut.then(gt)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}(t,e)),n})):[],c.update(),u=!0,v(c.before_update),c.fragment=!!o&&o(c.ctx),e.target){if(e.hydrate){I=!0;const t=(d=e.target,Array.from(d.childNodes));c.fragment&&c.fragment.l(t),t.forEach(P)}else c.fragment&&c.fragment.c();e.intro&&Et(t.$$.fragment),Wt(t,e.target,e.anchor),I=!1,gt()}var d;tt(a)}function Rt(t,e,n,o){const i=n[t]?.type;if(e="Boolean"===i&&"boolean"!=typeof e?null!=e:e,!o||!n[t])return e;if("toAttribute"===o)switch(i){case"Object":case"Array":return null==e?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return null==e?null:e;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),"function"==typeof HTMLElement&&(It=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;constructor(t,e,n){super(),this.$$ctor=t,this.$$s=e,n&&this.attachShadow({mode:"open"})}addEventListener(t,e,n){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const n=this.$$c.$on(t,e);this.$$l_u.set(e,n)}super.addEventListener(t,e,n)}removeEventListener(t,e,n){if(super.removeEventListener(t,e,n),this.$$c){const t=this.$$l_u.get(e);t&&(t(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn||this.$$c)return;function t(t){return()=>{let e;return{c:function(){e=R("slot"),"default"!==t&&X(e,"name",t)},m:function(t,n){N(t,e,n)},d:function(t){t&&P(e)}}}}const e={},n=function(t){const e={};return t.childNodes.forEach((t=>{e[t.slot||"default"]=!0})),e}(this);for(const i of this.$$s)i in n&&(e[i]=[t(i)]);for(const s of this.attributes){const r=this.$$g_p(s.name);r in this.$$d||(this.$$d[r]=Rt(r,s.value,this.$$p_d,"toProp"))}for(const l in this.$$p_d)l in this.$$d||void 0===this[l]||(this.$$d[l]=this[l],delete this[l]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$scope:{ctx:[]}}});const o=()=>{this.$$r=!0;for(const t in this.$$p_d)if(this.$$d[t]=this.$$c.$$.ctx[this.$$c.$$.props[t]],this.$$p_d[t].reflect){const e=Rt(t,this.$$d[t],this.$$p_d,"toAttribute");null==e?this.removeAttribute(this.$$p_d[t].attribute||t):this.setAttribute(this.$$p_d[t].attribute||t,e)}this.$$r=!1};this.$$c.$$.after_update.push(o),o();for(const a in this.$$l)for(const c of this.$$l[a]){const u=this.$$c.$on(a,c);this.$$l_u.set(c,u)}this.$$l={}}}attributeChangedCallback(t,e,n){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Rt(t,n,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(t){return Object.keys(this.$$p_d).find((e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t))||t}});class qt{$$=void 0;$$set=void 0;$destroy(){Nt(this,1),this.$destroy=h}$on(t,e){if(!y(e))return h;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function Ft(t){const e=t-1;return e*e*e+1}function Yt(t,{delay:e=0,duration:n=200,easing:o=Ft,side:i="bottom"}){if(n<=0)return!1;const s=getComputedStyle(t),r=t.offsetHeight;if(r<=0)return!1;let l;switch(i){case"top":l=[s.marginTop,s.marginBottom];break;case"bottom":l=[s.marginBottom,s.marginTop];break;case"left":l=[s.marginLeft,s.marginRight];break;case"right":l=[s.marginRight,s.marginLeft];break;default:return!1}l[0]=parseFloat(l[0])||0,l[1]=parseFloat(l[1])||0;const a=r+l[0]+l[1];return{delay:e,duration:n,easing:o,css:function(t,e){const n=l[0]-a*e;return`margin-${i}: ${n}px; opacity: ${t}; z-index: 0;`}}}function Xt(t){let e;return{c(){e=R("select"),X(e,"name",t[0]),e.multiple=t[1],e.disabled=t[2]},m(n,o){N(n,e,o),t[8](e)},p(t,[n]){1&n&&X(e,"name",t[0]),2&n&&(e.multiple=t[1]),4&n&&(e.disabled=t[2])},i:h,o:h,d(n){n&&P(e),t[8](null)}}}function Bt(t,n,o){let{handler:i}=n,{name:s=null}=n,{data:r=[]}=n,{multiple:l=!1}=n,{disabled:a=!1}=n,{placeholder:c=null}=n,{options:u={}}=n;const d=ot();let p,f=!1;var h;return nt((()=>{if(o(4,i=jQuery(p)),i.addClass("wc-enhanced-select"),i.data("data",r),i.data("placeholder",c),i.data("width","resolve"),u&&i.data(u),!1!==u.init&&e(!0!==u.init),i.on("change",(t=>{d("change",{handler:i,event:t})})),i.on("select2:close",(()=>{i.data("select2").$container.removeClass("select2-container--above"),i.data("select2").$dropdown.find("> .select2-dropdown").removeClass("select2-dropdown--above")})),l||i.on("select2:open",(()=>{const t=i.data("select2").$dropdown.find(".select2-search__field");t.one("blur",(()=>{setTimeout((()=>t.focus()),10)}))})),u.fixPosition){let t=!1;i.on("select2:open",(()=>{t||(i.selectWoo("close"),t=!0,i.selectWoo("open"),t=!1)}))}setTimeout((()=>{f=!0}))})),h=()=>{i.selectWoo("destroy"),i.remove()},et().$$.on_destroy.push(h),t.$$set=t=>{"handler"in t&&o(4,i=t.handler),"name"in t&&o(0,s=t.name),"data"in t&&o(5,r=t.data),"multiple"in t&&o(1,l=t.multiple),"disabled"in t&&o(2,a=t.disabled),"placeholder"in t&&o(6,c=t.placeholder),"options"in t&&o(7,u=t.options)},t.$$.update=()=>{var e;32&t.$$.dirty&&function(t){if(!f)return;if(u.replaceData||!t||!i.data("data")||t.length!==i.data("data").length||t.length&&t[0].id!==i.data("data")[0].id)return i.empty().trigger("change.select2"),i.data("data",t),void i.selectWoo();let e=!1;i.find("option").each(((n,o)=>{if(!t[n])return!1;const i=jQuery(o),s=!0===t[n].selected,r=!0===t[n].disabled;i.prop("selected")!==s&&(i.prop("selected",s),e=!0),i.prop("disabled")!==r&&(i.prop("disabled",r),e=!0)})),e&&(i.trigger("change.select2"),i.selectWoo())}(r),64&t.$$.dirty&&(e=c,f&&(i.data("placeholder",e),i.selectWoo())),128&t.$$.dirty&&function(t){f&&t&&(i.data(t),i.selectWoo())}(u)},[s,l,a,p,i,r,c,u,function(t){lt[t?"unshift":"push"]((()=>{p=t,o(3,p)}))}]}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");const Dt=class extends qt{constructor(t){super(),Pt(this,t,Bt,Xt,_,{handler:4,name:0,data:5,multiple:1,disabled:2,placeholder:6,options:7})}};function Ht(t,e,n){const o=t.slice();return o[13]=e[n],o[15]=n,o}function Qt(t){let e,n=t[13].image+"";return{c(){e=R("div"),X(e,"class","component-image")},m(t,o){N(t,e,o),e.innerHTML=n},p(t,o){4&o&&n!==(n=t[13].image+"")&&(e.innerHTML=n)},d(t){t&&P(e)}}}function Jt(t){let e,n,o=t[13].sku+"";return{c(){e=R("div"),n=q(o),X(e,"class","component-sku")},m(t,o){N(t,e,o),S(e,n)},p(t,e){4&e&&o!==(o=t[13].sku+"")&&D(n,o)},d(t){t&&P(e)}}}function Ut(t){let e,n,o;return{c(){e=R("div"),n=R("span"),X(n,"class","component-disabled"),X(n,"title",o=t[5].disabled),X(e,"class","component-status")},m(t,o){N(t,e,o),S(e,n)},p:h,d(t){t&&P(e)}}}function Vt(t,e){let n,o,i,s,r,l,a,c,u,d,p,f,h,m,$,g,b,y,w,_,x,k=e[13].title+"",E=e[13].image&&Qt(e),L=e[13].sku&&Jt(e),T=!e[13].enabled&&Ut(e);function z(){return e[9](e[13])}return{key:t,first:null,c(){n=R("div"),E&&E.c(),o=F(),i=R("div"),s=q(k),r=F(),L&&L.c(),l=F(),T&&T.c(),a=F(),c=R("div"),u=R("input"),h=F(),m=R("div"),$=R("button"),b=F(),X(i,"class","component-title"),X(u,"type","number"),X(u,"name",d=e[4].name+"["+e[1]+"]["+e[13].id+"]"),u.value=p=e[0][e[13].id],X(u,"step","any"),X(u,"min","0"),X(u,"placeholder",e[6]),X(u,"title",f=e[5][e[1]].quantityTip),X(c,"class","component-quantity"),X($,"type","button"),X($,"class","remove-component-button"),X($,"title",g=e[5].remove),X(m,"class","component-actions"),X(n,"class","component-item"),Q(n,"disabled",!e[13].enabled),this.first=n},m(t,e){N(t,n,e),E&&E.m(n,null),S(n,o),S(n,i),S(i,s),S(n,r),L&&L.m(n,null),S(n,l),T&&T.m(n,null),S(n,a),S(n,c),S(c,u),S(n,h),S(n,m),S(m,$),S(n,b),w=!0,_||(x=[Y(u,"change",Zt),Y($,"click",z),Y(n,"introend",Kt)],_=!0)},p(t,i){(e=t)[13].image?E?E.p(e,i):(E=Qt(e),E.c(),E.m(n,o)):E&&(E.d(1),E=null),(!w||4&i)&&k!==(k=e[13].title+"")&&D(s,k),e[13].sku?L?L.p(e,i):(L=Jt(e),L.c(),L.m(n,l)):L&&(L.d(1),L=null),e[13].enabled?T&&(T.d(1),T=null):T?T.p(e,i):(T=Ut(e),T.c(),T.m(n,a)),(!w||6&i&&d!==(d=e[4].name+"["+e[1]+"]["+e[13].id+"]"))&&X(u,"name",d),(!w||5&i&&p!==(p=e[0][e[13].id])&&u.value!==p)&&(u.value=p),(!w||2&i&&f!==(f=e[5][e[1]].quantityTip))&&X(u,"title",f),(!w||4&i)&&Q(n,"disabled",!e[13].enabled)},i(t){w||(t&&pt((()=>{w&&(y||(y=zt(n,Yt,{duration:170},!0)),y.run(1))})),w=!0)},o(t){t&&(y||(y=zt(n,Yt,{duration:170},!1)),y.run(0)),w=!1},d(t){t&&P(n),E&&E.d(),L&&L.d(),T&&T.d(),t&&y&&y.end(),_=!1,v(x)}}}function Gt(t){let e,n,o,i,s,r,l,a,c,u,d,p,f,h,m,$=t[5][t[1]].label+"",g=[],b=new Map;a=new Dt({props:{multiple:!0,data:t[3],placeholder:t[5][t[1]].addPlaceholder,options:{width:"auto"}}}),a.$on("change",t[7]);let v=At(t[2]);const y=t=>t[13].id;for(let e=0;e<v.length;e+=1){let n=Ht(t,v,e),o=y(n);b.set(o,g[e]=Vt(o,n))}return{c(){e=R("p"),n=R("label"),o=q($),i=F(),s=R("span"),l=F(),jt(a.$$.fragment),u=F(),d=R("div"),p=R("div"),f=R("div");for(let t=0;t<g.length;t+=1)g[t].c();X(n,"for",""),X(s,"class","woocommerce-help-tip"),X(s,"title",r=t[5][t[1]].fieldTip),X(e,"class",c="form-field mewz_wcas_"+t[1]+"_components_field"),X(f,"class","component-list-inner"),X(p,"class",h="component-list "+t[1]+"-component-list"),X(d,"class","mewz-wcas-components-section"),Q(d,"empty",!t[2].length)},m(t,r){N(t,e,r),S(e,n),S(n,o),S(e,i),S(e,s),S(e,l),Wt(a,e,null),N(t,u,r),N(t,d,r),S(d,p),S(p,f);for(let t=0;t<g.length;t+=1)g[t]&&g[t].m(f,null);m=!0},p(t,[n]){(!m||2&n)&&$!==($=t[5][t[1]].label+"")&&D(o,$),(!m||2&n&&r!==(r=t[5][t[1]].fieldTip))&&X(s,"title",r);const i={};8&n&&(i.data=t[3]),2&n&&(i.placeholder=t[5][t[1]].addPlaceholder),a.$set(i),(!m||2&n&&c!==(c="form-field mewz_wcas_"+t[1]+"_components_field"))&&X(e,"class",c),375&n&&(v=At(t[2]),xt(),g=Ct(g,n,y,1,t,v,b,f,Ot,Vt,null,Ht),kt()),(!m||2&n&&h!==(h="component-list "+t[1]+"-component-list"))&&X(p,"class",h),(!m||4&n)&&Q(d,"empty",!t[2].length)},i(t){if(!m){Et(a.$$.fragment,t);for(let t=0;t<v.length;t+=1)Et(g[t]);m=!0}},o(t){Lt(a.$$.fragment,t);for(let t=0;t<g.length;t+=1)Lt(g[t]);m=!1},d(t){t&&(P(e),P(u),P(d)),Nt(a);for(let t=0;t<g.length;t+=1)g[t].d()}}}function Kt(t){t.target.scrollIntoView({behavior:"smooth",block:"nearest"})}function Zt(t){+t.target.value<=0&&(t.target.value="")}function te(t,e,n){let o,i,{type:s}=e,{components:r}=e;const l=st("data"),{i18n:a}=l,c=ot(),u=1..toLocaleString(l.locale,{minimumFractionDigits:2});function d(t){delete r[t],n(0,r)}return t.$$set=t=>{"type"in t&&n(1,s=t.type),"components"in t&&n(0,r=t.components)},t.$$.update=()=>{1&t.$$.dirty&&n(3,o=function(t){const e=[];for(const n of l.stockList){let o=n.title;n.sku&&(o+=` [${n.sku}]`),n.enabled||(o=`🛇 ${o}`);const i={id:n.id,text:o};n.id in t&&(i.disabled=!0),e.push(i)}return e}(r)),1&t.$$.dirty&&n(2,i=l.stockList.filter((t=>t.id in r)))},[r,s,i,o,l,a,u,function(t){const e=t.detail.handler,o=e.val();var i;o&&o.length&&((i=+o[0])in r||(n(0,r[i]=["",""],r),c("added",{type:s,id:i})),setTimeout((()=>e.focus())))},d,t=>d(t.id)]}const ee=class extends qt{constructor(t){super(),Pt(this,t,te,Gt,w,{type:1,components:0})}};function ne(t){let e;return{c(){e=R("input"),X(e,"type","hidden"),X(e,"name","mewz_wcas_noupdate[components]"),e.value="1"},m(t,n){N(t,e,n)},d(t){t&&P(e)}}}function oe(t){let e,n,o,i,s,r,l,a,c,u=!t[1]&&ne();function d(e){t[3](e)}let p={type:"parent"};function f(e){t[4](e)}void 0!==t[0].parent&&(p.components=t[0].parent),o=new ee({props:p}),lt.push((()=>St(o,"components",d))),o.$on("added",t[2]);let h={type:"child"};return void 0!==t[0].child&&(h.components=t[0].child),l=new ee({props:h}),lt.push((()=>St(l,"components",f))),l.$on("added",t[2]),{c(){u&&u.c(),e=F(),n=R("div"),jt(o.$$.fragment),s=F(),r=R("div"),jt(l.$$.fragment),X(n,"class","options_group"),X(r,"class","options_group")},m(t,i){u&&u.m(t,i),N(t,e,i),N(t,n,i),Wt(o,n,null),N(t,s,i),N(t,r,i),Wt(l,r,null),c=!0},p(t,[n]){t[1]?u&&(u.d(1),u=null):u||(u=ne(),u.c(),u.m(e.parentNode,e));const s={};!i&&1&n&&(i=!0,s.components=t[0].parent,ft((()=>i=!1))),o.$set(s);const r={};!a&&1&n&&(a=!0,r.components=t[0].child,ft((()=>a=!1))),l.$set(r)},i(t){c||(Et(o.$$.fragment,t),Et(l.$$.fragment,t),c=!0)},o(t){Lt(o.$$.fragment,t),Lt(l.$$.fragment,t),c=!1},d(t){t&&(P(e),P(n),P(s),P(r)),u&&u.d(t),Nt(o),Nt(l)}}}function ie(t,e,i){const s=e.data,r=s.components;it("data",s);let l=!1;s.stockItems={};for(const t of s.stockList)s.stockItems[t.id]=t;return nt((()=>{setTimeout((()=>{n("#components_panel .woocommerce-help-tip"),o(document.getElementById("components_panel"),s.name+"[",(t=>i(1,l=t)))}))})),t.$$set=t=>{i(6,e=$($({},e),x(t)))},t.$$.update=()=>{1&t.$$.dirty&&mewzWcas.setTabIndicator("components",Object.values(r.child).length)},e=x(e),[r,l,function(t){const{type:e,id:n}=t.detail;delete r["parent"===e?"child":"parent"][n]},function(e){t.$$.not_equal(r.parent,e)&&(r.parent=e,i(0,r))},function(e){t.$$.not_equal(r.child,e)&&(r.child=e,i(0,r))}]}function se(t,{delay:e=0,duration:n=400,easing:o=Ft,axis:i="y"}={}){const s=getComputedStyle(t),r=+s.opacity,l="y"===i?"height":"width",a=parseFloat(s[l]),c="y"===i?["top","bottom"]:["left","right"],u=c.map((t=>`${t[0].toUpperCase()}${t.slice(1)}`)),d=parseFloat(s[`padding${u[0]}`]),p=parseFloat(s[`padding${u[1]}`]),f=parseFloat(s[`margin${u[0]}`]),h=parseFloat(s[`margin${u[1]}`]),m=parseFloat(s[`border${u[0]}Width`]),$=parseFloat(s[`border${u[1]}Width`]);return{delay:e,duration:n,easing:o,css:t=>`overflow: hidden;opacity: ${Math.min(20*t,1)*r};${l}: ${t*a}px;padding-${c[0]}: ${t*d}px;padding-${c[1]}: ${t*p}px;margin-${c[0]}: ${t*f}px;margin-${c[1]}: ${t*h}px;border-${c[0]}-width: ${t*m}px;border-${c[1]}-width: ${t*$}px;`}}function re(t,e){e=Object.assign({open:!0,duration:.2,easing:"ease"},e);const n=()=>{};let o=n,i=n;const s=t.addEventListener("transitionend",(()=>{o(),o=n,i=n}));async function r(){return new Promise(requestAnimationFrame)}function l(){return`height ${e.duration}s ${e.easing}`}return t.style.transition=l(),t.style.height=e.open?"auto":"0px",e.open?t.style.overflow="visible":t.style.overflow="hidden",{update:function(n){(e=Object.assign(e,n)).open?async function(){t.style.height=t.scrollHeight+"px";try{await async function(){return new Promise(((t,e)=>{o=t,i=e}))}(),t.style.height="auto",t.style.overflow="visible"}catch(t){}}():async function(){"auto"===t.style.height?(t.style.transition="none",await r(),t.style.height=t.scrollHeight+"px",t.style.transition=l(),await r(),t.style.overflow="hidden",t.style.height="0px"):(i(),t.style.overflow="hidden",t.style.height="0px")}()},destroy:function(){t.removeEventListener("transitionend",s)}}}function le(t,{dragStart:e,dragMove:n,dragEnd:o,exclude:i,enabled:s=!0}){function r(t){if(!s||i&&t.target.closest(i))return;const r=ae(t);r&&(t.preventDefault(),function(t,e,{dragStart:n,dragMove:o,dragEnd:i}){let s,r=t,l=e.clientX,a=e.clientY,c=l+window.scrollX,u=a+window.scrollY,d=0,p=0;function f(t){const e=ae(t);e&&(r=t,l=e.clientX,a=e.clientY,d=l+window.scrollX-c,p=a+window.scrollY-u,o&&o({event:t,pointer:e,x:l,y:top,startX:c,startY:u,moveX:d,moveY:p}))}function h(t){const e=ae(t,s);e&&(r=t,"mouseup"===t.type?(window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",h)):(window.removeEventListener("touchmove",f),window.removeEventListener("touchend",h)),window.removeEventListener("scroll",m),i&&i({event:t,pointer:e,x:l,y:top,startX:c,startY:u,moveX:d,moveY:p}))}function m(){d=l+window.scrollX-c,p=a+window.scrollY-u,o({event:r,pointer:e,x:l,y:top,startX:c,startY:u,moveX:d,moveY:p})}"mousedown"===t.type?(window.addEventListener("mousemove",f),window.addEventListener("mouseup",h)):(s=e.identifier,window.addEventListener("touchmove",f),window.addEventListener("touchend",h)),window.addEventListener("scroll",m),n&&n({event:t,pointer:e,x:l,y:top,startX:c,startY:u})}(t,r,{dragStart:e,dragMove:n,dragEnd:o}))}return t.addEventListener("mousedown",r),t.addEventListener("touchstart",r,{passive:!1}),{update(t){i=t.exclude,s=t.enabled},destroy(){t.removeEventListener("mousedown",r),t.removeEventListener("touchstart",r)}}}function ae(t,e){return t instanceof MouseEvent?0===t.button?t:null:void 0===e?1===t.touches.length?t.touches[0]:null:function(t,e){for(const n of t)if(n.identifier===e)return n;return null}(t.changedTouches,e)}function ce(t,e,n){const o=t.slice();o[43]=e[n],o[45]=e,o[46]=n;const i=`${o[8].name}[${o[3]}][attributes][${o[43][0]}]`;return o[44]=i,o}function ue(t,e,n){const o=t.slice();return o[47]=e[n],o[49]=n,o}function de(t){let e,n,o,i,s=t[9].ruleTitle.replace("%s",t[3]+1)+"";return{c(){e=R("span"),n=q(s),o=F(),i=R("span"),i.textContent="—",X(e,"class","toolbar-label toolbar-label-title"),X(i,"class","sep")},m(t,s){N(t,e,s),S(e,n),N(t,o,s),N(t,i,s)},p(t,e){8&e[0]&&s!==(s=t[9].ruleTitle.replace("%s",t[3]+1)+"")&&D(n,s)},d(t){t&&(P(e),P(o),P(i))}}}function pe(t){let e,n,o=t[47].name+"";return{c(){e=R("span"),n=q(o),X(e,"class","name")},m(t,o){N(t,e,o),S(e,n)},p(t,e){3&e[0]&&o!==(o=t[47].name+"")&&D(n,o)},d(t){t&&P(e)}}}function fe(t,e){let n,o,i,s,r,l,a,c,u=(e[47].value||"")+"",d=e[47].name&&pe(e);return{key:t,first:null,c(){n=R("span"),d&&d.c(),o=F(),i=R("span"),s=q(u),r=F(),X(i,"class","value"),X(n,"class",l="toolbar-label toolbar-label-"+e[47].type+(e[47].class?" "+e[47].class:"")),X(n,"title",a=e[47].title),X(n,"rel",c=e[47].title?"tiptip":null),this.first=n},m(t,e){N(t,n,e),d&&d.m(n,null),S(n,o),S(n,i),S(i,s),S(n,r)},p(t,i){(e=t)[47].name?d?d.p(e,i):(d=pe(e),d.c(),d.m(n,o)):d&&(d.d(1),d=null),3&i[0]&&u!==(u=(e[47].value||"")+"")&&D(s,u),3&i[0]&&l!==(l="toolbar-label toolbar-label-"+e[47].type+(e[47].class?" "+e[47].class:""))&&X(n,"class",l),3&i[0]&&a!==(a=e[47].title)&&X(n,"title",a),3&i[0]&&c!==(c=e[47].title?"tiptip":null)&&X(n,"rel",c)},d(t){t&&P(n),d&&d.d()}}}function he(t,e){let n,o,i,s,r,l,a,c,u,d,p,f,h,m,$,g,b,v,y,w;function _(){return e[28](e[46])}return s=new Dt({props:{data:e[12](e[43][0]),placeholder:{id:"",text:e[9].attributePlaceholder},options:{init:!0,fixPosition:!0}}}),s.$on("change",(function(...t){return e[26](e[43],e[45],e[46],...t)})),d=new Dt({props:{name:e[44]+"[]",multiple:!0,data:e[13](e[43]),placeholder:e[43][0]?e[9].anyOption.replace("%s",e[8].attributes[e[43][0]].label):e[9].termPlaceholder,disabled:!e[43][0],options:{init:!0,width:"auto",fixPosition:!0}}}),d.$on("change",(function(...t){return e[27](e[43],e[45],e[46],...t)})),{key:t,first:null,c(){n=R("div"),o=R("div"),i=R("div"),jt(s.$$.fragment),r=F(),l=R("div"),a=R("input"),u=F(),jt(d.$$.fragment),p=F(),f=R("div"),h=R("button"),g=F(),X(i,"class","select-attribute"),X(a,"type","hidden"),X(a,"name",c=e[44]),a.value="",X(l,"class","select-terms"),X(h,"type","button"),X(h,"class","icon-button row-remove-button"),X(h,"title",m=e[9].removeAttribute),h.disabled=$=1===e[0].length&&!e[43].attribute,X(f,"class","attribute-row-actions"),X(o,"class","attribute-row-inner"),X(n,"class","attribute-row"),this.first=n},m(t,e){N(t,n,e),S(n,o),S(o,i),Wt(s,i,null),S(o,r),S(o,l),S(l,a),S(l,u),Wt(d,l,null),S(o,p),S(o,f),S(f,h),S(n,g),v=!0,y||(w=Y(h,"click",_),y=!0)},p(t,n){e=t;const o={};1&n[0]&&(o.data=e[12](e[43][0])),s.$set(o),(!v||9&n[0]&&c!==(c=e[44]))&&X(a,"name",c);const i={};9&n[0]&&(i.name=e[44]+"[]"),1&n[0]&&(i.data=e[13](e[43])),1&n[0]&&(i.placeholder=e[43][0]?e[9].anyOption.replace("%s",e[8].attributes[e[43][0]].label):e[9].termPlaceholder),1&n[0]&&(i.disabled=!e[43][0]),d.$set(i),(!v||1&n[0]&&$!==($=1===e[0].length&&!e[43].attribute))&&(h.disabled=$)},i(t){v||(Et(s.$$.fragment,t),Et(d.$$.fragment,t),t&&pt((()=>{v&&(b||(b=zt(n,Yt,{duration:130},!0)),b.run(1))})),v=!0)},o(t){Lt(s.$$.fragment,t),Lt(d.$$.fragment,t),t&&(b||(b=zt(n,Yt,{duration:130},!1)),b.run(0)),v=!1},d(t){t&&P(n),Nt(s),Nt(d),t&&b&&b.end(),y=!1,w()}}}function me(t){let e,n,o,i,s,r;return{c(){e=R("div"),n=R("button"),n.textContent="Add attribute",X(n,"type","button"),X(n,"class","row-add-button"),X(e,"class","attribute-list-actions")},m(o,l){N(o,e,l),S(e,n),i=!0,s||(r=Y(n,"click",t[29]),s=!0)},p:h,i(t){i||(t&&pt((()=>{i&&(o||(o=zt(e,se,{duration:100},!0)),o.run(1))})),i=!0)},o(t){t&&(o||(o=zt(e,se,{duration:100},!1)),o.run(0)),i=!1},d(t){t&&P(e),t&&o&&o.end(),s=!1,r()}}}function $e(t){let e,n,o,i,s,r,l,a,c,u,d,p,f,$,g,b,w,_,x,E,T,z,A,O,C,I,j,W,D,J,U,V,G,tt,et,nt,ot,it,st,rt,lt,at,ct,ut=[],dt=new Map,ft=[],ht=new Map,mt=t[9].multiplierLabel+"",$t=t[5]>1&&de(t),gt=At(t[14](t[0],t[1]));const bt=t=>t[49]+t[47].type;for(let e=0;e<gt.length;e+=1){let n=ue(t,gt,e),o=bt(n);dt.set(o,ut[e]=fe(o,n))}let wt=At(t[0]);const zt=t=>t[43];for(let e=0;e<wt.length;e+=1){let n=ce(t,wt,e),o=zt(n);ht.set(o,ft[e]=he(o,n))}let It=t[0].length<t[10]&&me(t);return{c(){e=R("div"),n=R("div"),o=R("div"),$t&&$t.c(),i=F();for(let t=0;t<ut.length;t+=1)ut[t].c();s=F(),r=R("span"),l=R("span"),a=F(),c=R("button"),p=F(),f=R("button"),g=F(),b=R("button"),_=F(),x=R("div"),E=R("div"),T=R("div"),z=R("div");for(let t=0;t<ft.length;t+=1)ft[t].c();A=F(),It&&It.c(),O=F(),C=R("div"),I=R("div"),j=R("label"),W=q(mt),D=F(),J=R("span"),V=F(),G=R("input"),X(o,"class","toolbar-labels"),X(l,"class","toolbar-action icon-button expand-button"),X(c,"type","button"),X(c,"class","toolbar-action icon-button drag-button"),X(c,"title",u=t[9].dragTip),X(f,"type","button"),X(f,"class","toolbar-action icon-button duplicate-button"),X(f,"title",$=t[9].duplicateRule),X(b,"type","button"),X(b,"class","toolbar-action icon-button remove-button"),X(b,"title",w=t[9].removeRule),X(r,"class","match-rule-toolbar-actions"),X(n,"class","match-rule-toolbar"),X(z,"class","attribute-rows"),X(T,"class","attribute-list"),X(J,"class","woocommerce-help-tip"),X(J,"title",U=t[9].multiplierTip),X(G,"type","number"),X(G,"name",tt=t[17](t[3],"multiplier")),X(G,"step","any"),X(G,"min","-1"),X(G,"placeholder",et=t[22](t[0])),X(G,"lang",nt=t[8].locale),X(I,"class","option option-multiplier"),X(C,"class","match-rule-options"),X(E,"class","match-rule-body-inner"),X(x,"class","match-rule-body"),X(e,"class","mewz-wcas-match-rule"),X(e,"style",it=ge(t[7])),Q(e,"zero-multiplier",null!=t[1]&&""!==t[1]&&0==+t[1]),Q(e,"stop-rule",+t[1]<0),Q(e,"open",t[2]),Q(e,"dragging",t[7]),Q(e,"released",t[7]&&t[7].released)},m(u,h){N(u,e,h),S(e,n),S(n,o),$t&&$t.m(o,null),S(o,i);for(let t=0;t<ut.length;t+=1)ut[t]&&ut[t].m(o,null);S(n,s),S(n,r),S(r,l),S(r,a),S(r,c),S(r,p),S(r,f),S(r,g),S(r,b),S(e,_),S(e,x),S(x,E),S(E,T),S(T,z);for(let t=0;t<ft.length;t+=1)ft[t]&&ft[t].m(z,null);S(T,A),It&&It.m(T,null),S(E,O),S(E,C),S(C,I),S(I,j),S(j,W),S(j,D),S(j,J),S(I,V),S(I,G),H(G,t[1]),t[31](e),lt=!0,at||(ct=[k(d=le.call(null,c,{dragStart:t[19],dragMove:t[20],dragEnd:t[21],enabled:t[4]})),Y(f,"click",t[24]),Y(b,"click",t[25]),Y(n,"click",t[18]),Y(G,"input",t[30]),k(ot=re.call(null,x,{open:t[2],duration:.17}))],at=!0)},p(t,n){t[5]>1?$t?$t.p(t,n):($t=de(t),$t.c(),$t.m(o,i)):$t&&($t.d(1),$t=null),16387&n[0]&&(gt=At(t[14](t[0],t[1])),ut=Ct(ut,n,bt,1,t,gt,dt,o,Mt,fe,null,ue)),d&&y(d.update)&&16&n[0]&&d.update.call(null,{dragStart:t[19],dragMove:t[20],dragEnd:t[21],enabled:t[4]}),78601&n[0]&&(wt=At(t[0]),xt(),ft=Ct(ft,n,zt,1,t,wt,ht,z,Ot,he,null,ce),kt()),t[0].length<t[10]?It?(It.p(t,n),1&n[0]&&Et(It,1)):(It=me(t),It.c(),Et(It,1),It.m(T,null)):It&&(xt(),Lt(It,1,1,(()=>{It=null})),kt()),(!lt||8&n[0]&&tt!==(tt=t[17](t[3],"multiplier")))&&X(G,"name",tt),(!lt||1&n[0]&&et!==(et=t[22](t[0])))&&X(G,"placeholder",et),2&n[0]&&B(G.value)!==t[1]&&H(G,t[1]),ot&&y(ot.update)&&4&n[0]&&ot.update.call(null,{open:t[2],duration:.17}),(!lt||128&n[0]&&it!==(it=ge(t[7])))&&X(e,"style",it),(!lt||2&n[0])&&Q(e,"zero-multiplier",null!=t[1]&&""!==t[1]&&0==+t[1]),(!lt||2&n[0])&&Q(e,"stop-rule",+t[1]<0),(!lt||4&n[0])&&Q(e,"open",t[2]),(!lt||128&n[0])&&Q(e,"dragging",t[7]),(!lt||128&n[0])&&Q(e,"released",t[7]&&t[7].released)},i(t){if(!lt){for(let t=0;t<wt.length;t+=1)Et(ft[t]);Et(It),t&&pt((()=>{lt&&(rt&&rt.end(1),st=function(t,e,n){const o={direction:"in"};let i,s,r=e(t,{duration:170},o),l=!1,a=0;function c(){i&&Z(t,i)}function u(){const{delay:e=0,duration:n=300,easing:o=m,tick:u=h,css:d}=r||Tt;d&&(i=K(t,0,1,n,e,o,d,a++)),u(0,1);const p=L()+e,f=p+n;s&&s.abort(),l=!0,pt((()=>yt(t,!0,"start"))),s=M((e=>{if(l){if(e>=f)return u(1,0),yt(t,!0,"end"),c(),l=!1;if(e>=p){const t=o((e-p)/n);u(t,1-t)}}return l}))}let d=!1;return{start(){d||(d=!0,Z(t),y(r)?(r=r(o),vt().then(u)):u())},invalidate(){d=!1},end(){l&&(c(),l=!1)}}}(e,Yt),st.start())})),lt=!0}},o(t){for(let t=0;t<ft.length;t+=1)Lt(ft[t]);Lt(It),st&&st.invalidate(),t&&(rt=function(t,e,n){const o={direction:"out"};let i,s=e(t,{duration:170},o),r=!0;const l=_t;let a;function c(){const{delay:e=0,duration:n=300,easing:o=m,tick:c=h,css:u}=s||Tt;u&&(i=K(t,1,0,n,e,o,u));const d=L()+e,p=d+n;pt((()=>yt(t,!1,"start"))),"inert"in t&&(a=t.inert,t.inert=!0),M((e=>{if(r){if(e>=p)return c(0,1),yt(t,!1,"end"),--l.r||v(l.c),!1;if(e>=d){const t=o((e-d)/n);c(1-t,t)}}return r}))}return l.r+=1,y(s)?vt().then((()=>{s=s(o),c()})):c(),{end(e){e&&"inert"in t&&(t.inert=a),e&&s.tick&&s.tick(1,0),r&&(i&&Z(t,i),r=!1)}}}(e,Yt)),lt=!1},d(n){n&&P(e),$t&&$t.d();for(let t=0;t<ut.length;t+=1)ut[t].d();for(let t=0;t<ft.length;t+=1)ft[t].d();It&&It.d(),t[31](null),n&&rt&&rt.end(),at=!1,v(ct)}}}function ge(t){if(t)return`transform: translateY(${t.offset}px);`}function be(t,e,o){let i,{index:s}=e,{attributes:r}=e,{multiplier:l=""}=e,{mounted:a=!1}=e,{open:c=!0}=e,{draggable:u=!0}=e,{ruleCount:d=1}=e;const p=st("data"),f=p.i18n,h=Object.keys(p.attributes).length,m=ot(),$=k(1,!0);let g,b=!1;function v(){const t=[0,[]];r?(r.push(t),o(0,r)):o(0,r=[t]),a&&setTimeout((()=>{const t=g.querySelector(".attribute-row:last-child .select-attribute select");t&&jQuery(t).focus()}),150)}function y(t){r.splice(t,1),r.length?o(0,r):v()}function w(t){if(!t||t.target===g){b.released&&g.removeEventListener("transitionend",w);for(const t of b.list)t.el.style.transform="";m("dragging",[s,!1]),b.targetIndex!==s&&m("action",["shift",s,b.targetIndex]),o(7,b=!1)}}function _(){const t=g.parentNode.querySelectorAll(".mewz-wcas-match-rule"),e=[];let n=0;for(const o of t){const t=o.offsetHeight;e.push({el:o,height:t,mid:n+Math.round(t/2),offset:0}),n+=t}return e}function x(t){const e={};for(const n of t)e[n[0]]=n[1];for(const[t]of p.attributeOptions){const n=e[t];if(!n)continue;const o=p.attributes[t];if(1===n.length){for(const t of o.terms)if(t[0]===n[0]&&null!=t[2])return+t[2]}else{let t=[1/0,0],e=!1;for(const i of o.terms){if(n.length&&!n.includes(i[0]))continue;if(null==i[2]){e=!0;continue}const o=+i[2];o<t[0]&&(t[0]=o),o>t[1]&&(t[1]=o)}if(t[0]!==1/0)return e&&t[0]>1&&(t[0]=1),t[0]===t[1]?t[0]:t}}return null}function k(t,e){const n=e&&t<10?{minimumFractionDigits:2}:{maximumSignificantDigits:20,maximumFractionDigits:20};return t.toLocaleString(p.locale,n)}return nt((()=>{n(".mewz-wcas-match-rule .woocommerce-help-tip")})),t.$$set=t=>{"index"in t&&o(3,s=t.index),"attributes"in t&&o(0,r=t.attributes),"multiplier"in t&&o(1,l=t.multiplier),"mounted"in t&&o(23,a=t.mounted),"open"in t&&o(2,c=t.open),"draggable"in t&&o(4,u=t.draggable),"ruleCount"in t&&o(5,d=t.ruleCount)},t.$$.update=()=>{1&t.$$.dirty[0]&&(r.length||v()),1&t.$$.dirty[0]&&(i=function(t){const e={};for(const n of t)n[0]&&(e[n[0]]=!0);return e}(r))},[r,l,c,s,u,d,g,b,p,f,h,m,function(t){const e=[{id:"",text:""}];for(const[n,o]of p.attributeOptions){const s={id:n,text:o};n===t?s.selected=!0:i[n]&&(s.disabled=!0),e.push(s)}return e},function(t){if(!t[0])return[];const e=p.attributes[t[0]].terms,n=[],o={};for(const e of t[1])o[e]=!0;for(const[t,i]of e){const e={id:t,text:i};o[t]&&(e.selected=!0),n.push(e)}return n},function(t,e){const o=[];for(const[e,n]of t){if(!e||!n)continue;const t=[];if(n.length)for(const o of p.attributes[e].terms)if(n.includes(o[0])&&(t.push(o[1]),t.length===n.length))break;o.push({type:"attribute",name:p.attributes[e].label,value:t.length?t.join(", "):f.any})}if(o.length||o.push({type:"attribute",value:"..."}),null!=e&&""!==e&&1!=+e)+e<0?(o.push({type:"stop",title:f.stopRuleTip}),setTimeout((()=>n('.mewz-wcas-match-rule [rel="tiptip"]')))):o.push({type:"multiplier",value:`×${k(+e)}`});else if(1!=+e){const e=x(t);if(null!=e){let t;t=Array.isArray(e)?`×${k(e[0])}–${k(e[1])}`:`×${k(e)}`,o.push({type:"multiplier",class:"inherited",title:f.multiplierInherited,value:t})}}return o},v,y,function(t,e){return`${p.name}[${t}][${e}]`},function(t){b||t&&t.target.closest("button")||o(2,c=!c)},function(t){b||(o(7,b={height:g.offsetHeight,start:g.offsetTop,offset:0,end:g.parentNode.offsetHeight,list:_(),targetIndex:s,animatedIndex:s,released:!1}),m("dragging",[s,{released:!1}]))},function(t){b&&!b.released&&(o(7,b.offset=Math.max(-b.start,t.moveY),b),o(7,b.offset=Math.min(b.offset,b.end-b.start-b.height),b),o(7,b.targetIndex=function(){let t=s;const e=b.start+b.offset;for(let n=0;n<b.list.length;n++){const o=b.list[n].mid;if(n<s){if(e<o)return n}else n>s&&e+b.height>o&&(t=n)}return t}(),b),function(){if(b.targetIndex===b.animatedIndex)return;const t=b.targetIndex;for(let e=0;e<b.list.length;e++){const n=b.list[e];let o=0;t<s?e>=t&&e<s&&(o=b.height):t>s&&e<=t&&e>s&&(o=-b.height),n.offset!==o&&(n.el.style.transform=`translateY(${o}px)`,n.offset=o,null==n.animating&&n.el.addEventListener("transitionend",(()=>{n.animating=!1})),n.animating=!0)}o(7,b.animatedIndex=t,b)}())},function(){if(!b||b.released)return;const t=function(){const t=b.targetIndex;let e=0;if(t<s)for(let n=t;n<s;n++)e-=b.list[n].height;else if(t>s)for(let n=t;n>s;n--)e+=b.list[n].height;return e}();b.offset===t?b.targetIndex===s?(m("dragging",[s,!1]),o(7,b=!1)):b.list.some((t=>!0===t.animating))?(setTimeout(w,200),m("dragging",[s,{released:!0}])):w():(g.addEventListener("transitionend",w),o(7,b.offset=t,b),o(7,b.released=!0,b),m("dragging",[s,{released:!0}]))},function(t){const e=x(t);return null==e?$:Array.isArray(e)?k(e[0])+" – "+k(e[1]):k(e,!0)},a,()=>m("action",["duplicate",s]),()=>m("action",["remove",s]),(t,e,n,i)=>o(0,e[n][0]=+i.detail.handler.val(),r),(t,e,n,i)=>o(0,e[n][1]=i.detail.handler.val().map(Number),r),t=>y(t),()=>v(),function(){l=B(this.value),o(1,l)},function(t){lt[t?"unshift":"push"]((()=>{g=t,o(6,g)}))}]}const ve=class extends qt{constructor(t){super(),Pt(this,t,be,$e,w,{index:3,attributes:0,multiplier:1,mounted:23,open:2,draggable:4,ruleCount:5},null,[-1,-1])}};function ye(t,e,n){const o=t.slice();return o[26]=e[n],o[27]=e,o[28]=n,o}function we(t){let e,n,o,i;return{c(){e=R("button"),X(e,"type","button"),X(e,"class","button restore-button"),X(e,"title",n=t[1].i18n.restoreRule)},m(n,s){N(n,e,s),o||(i=Y(e,"click",t[11]),o=!0)},p(t,o){2&o&&n!==(n=t[1].i18n.restoreRule)&&X(e,"title",n)},d(t){t&&P(e),o=!1,i()}}}function _e(t,e){let n,o,i,s,r,l,a;function c(t){e[14](t)}function u(t){e[15](t,e[26])}function d(t){e[16](t,e[26])}function p(t){e[17](t,e[26])}let f={index:e[28],draggable:!e[6],ruleCount:e[0].length};return void 0!==e[5]&&(f.mounted=e[5]),void 0!==e[26].attributes&&(f.attributes=e[26].attributes),void 0!==e[26].multiplier&&(f.multiplier=e[26].multiplier),void 0!==e[26].open&&(f.open=e[26].open),o=new ve({props:f}),lt.push((()=>St(o,"mounted",c))),lt.push((()=>St(o,"attributes",u))),lt.push((()=>St(o,"multiplier",d))),lt.push((()=>St(o,"open",p))),o.$on("action",e[10]),o.$on("dragging",e[9]),{key:t,first:null,c(){n=q(""),jt(o.$$.fragment),this.first=n},m(t,e){N(t,n,e),Wt(o,t,e),a=!0},p(t,n){e=t;const a={};1&n&&(a.index=e[28]),64&n&&(a.draggable=!e[6]),1&n&&(a.ruleCount=e[0].length),!i&&32&n&&(i=!0,a.mounted=e[5],ft((()=>i=!1))),!s&&1&n&&(s=!0,a.attributes=e[26].attributes,ft((()=>s=!1))),!r&&1&n&&(r=!0,a.multiplier=e[26].multiplier,ft((()=>r=!1))),!l&&1&n&&(l=!0,a.open=e[26].open,ft((()=>l=!1))),o.$set(a)},i(t){a||(Et(o.$$.fragment,t),a=!0)},o(t){Lt(o.$$.fragment,t),a=!1},d(t){t&&P(n),Nt(o,t)}}}function xe(t){let e;return{c(){e=R("input"),X(e,"type","hidden"),X(e,"name","mewz_wcas_noupdate[rules]"),e.value="1"},m(t,n){N(t,e,n)},d(t){t&&P(e)}}}function ke(t){let e,n,o,i,s,r,l,a,c,u,d,p,f,h,m,$,g,b,y,w,_=t[1].i18n.newRule+"",x=(Ee(t[0])?t[1].i18n.closeAll:t[1].i18n.expandAll)+"",k=[],E=new Map,L=t[4].length&&we(t),T=At(t[0]);const z=t=>t[26];for(let e=0;e<T.length;e+=1){let n=ye(t,T,e),o=z(n);E.set(o,k[e]=_e(o,n))}let A=!t[7]&&xe();return{c(){e=R("div"),n=R("div"),o=R("div"),i=R("button"),s=q(_),r=F(),l=R("span"),c=F(),u=R("div"),L&&L.c(),d=F(),p=R("button"),f=q(x),m=F(),$=R("div");for(let t=0;t<k.length;t+=1)k[t].c();g=F(),A&&A.c(),X(i,"type","button"),X(i,"class","button add-button"),X(l,"class","woocommerce-help-tip"),X(l,"title",a=t[1].i18n.newRuleTip),X(o,"class","toolbar-left"),X(p,"type","button"),X(p,"class",h="button toggle-button "+(Ee(t[0])?"collapse":"expand")),X(u,"class","toolbar-right"),X(n,"class","main-toolbar"),X($,"class","match-rules-list"),X(e,"class","mewz-wcas-attribute-rules"),Q(e,"dragging",t[6]),Q(e,"released",t[6]&&t[6].released)},m(a,h){N(a,e,h),S(e,n),S(n,o),S(o,i),S(i,s),S(o,r),S(o,l),S(n,c),S(n,u),L&&L.m(u,null),S(u,d),S(u,p),S(p,f),S(e,m),S(e,$);for(let t=0;t<k.length;t+=1)k[t]&&k[t].m($,null);t[18]($),S(e,g),A&&A.m(e,null),t[19](e),b=!0,y||(w=[Y(i,"click",t[13]),Y(p,"click",t[12])],y=!0)},p(t,[n]){(!b||2&n)&&_!==(_=t[1].i18n.newRule+"")&&D(s,_),(!b||2&n&&a!==(a=t[1].i18n.newRuleTip))&&X(l,"title",a),t[4].length?L?L.p(t,n):(L=we(t),L.c(),L.m(u,d)):L&&(L.d(1),L=null),(!b||3&n)&&x!==(x=(Ee(t[0])?t[1].i18n.closeAll:t[1].i18n.expandAll)+"")&&D(f,x),(!b||1&n&&h!==(h="button toggle-button "+(Ee(t[0])?"collapse":"expand")))&&X(p,"class",h),1633&n&&(T=At(t[0]),xt(),k=Ct(k,n,z,1,t,T,E,$,Ot,_e,null,ye),kt()),t[7]?A&&(A.d(1),A=null):A||(A=xe(),A.c(),A.m(e,null)),(!b||64&n)&&Q(e,"dragging",t[6]),(!b||64&n)&&Q(e,"released",t[6]&&t[6].released)},i(t){if(!b){for(let t=0;t<T.length;t+=1)Et(k[t]);b=!0}},o(t){for(let t=0;t<k.length;t+=1)Lt(k[t]);b=!1},d(n){n&&P(e),L&&L.d();for(let t=0;t<k.length;t+=1)k[t].d();t[18](null),A&&A.d(),t[19](null),y=!1,v(w)}}}function Ee(t){return t.every((t=>t.open))}function Le(t){for(const e of t.attributes)if(e[0])return!0;return!1}function Te(t,e,i){const s=e.data;let r,l;it("data",s);let a=[],c=[],u=!1,d=!1,p=!1;const f=s.rules;if(f.length){if(1===f.length)f[0].open=!0;else for(let t of f)t.open=!1;a=f}else m();const h=[];for(let t in s.attributes){const e=s.attributes[t];h.push([+t,e.label])}function m(){const t={attributes:[],multiplier:"",open:!0};return a.push(t),i(0,a),t}return s.attributeOptions=h.sort(((t,e)=>t[1].localeCompare(e[1]))),nt((()=>{n(".mewz-wcas-attribute-rules .main-toolbar .woocommerce-help-tip"),o(r,s.name+"[",(t=>i(7,p=t))),i(5,u=!0)})),t.$$set=t=>{i(25,e=$($({},e),x(t)))},t.$$.update=()=>{1&t.$$.dirty&&mewzWcas.setTabIndicator("attributes",a.filter(Le).length)},e=x(e),[a,s,r,l,c,u,d,p,m,function(t){const[e,n]=t.detail;i(6,d=n)},function(t){const[e,n,o]=t.detail;"duplicate"===e?function(t){const e=JSON.parse(JSON.stringify(a[t]));e.open=!0,a.splice(t+1,0,e),i(0,a)}(n):"remove"===e?function(t){const e=a.splice(t,1)[0];e&&(Le(e)&&(e.lastIndex=t,c.push(e),i(4,c)),a.length?i(0,a):m())}(n):"shift"===e&&function(t,e){const n=a.splice(t,1)[0];a.splice(e,0,n),i(0,a)}(n,o)},function(){const t=c.pop();t&&(1!==a.length||Le(a[0])?a.splice(t.lastIndex,0,t):i(0,a[0]=t,a),delete t.lastIndex,i(4,c),i(0,a))},function(){const t=Ee(a);a.forEach((e=>e.open=!t)),i(0,a)},()=>m(),function(t){u=t,i(5,u)},function(e,n){t.$$.not_equal(n.attributes,e)&&(n.attributes=e,i(0,a))},function(e,n){t.$$.not_equal(n.multiplier,e)&&(n.multiplier=e,i(0,a))},function(e,n){t.$$.not_equal(n.open,e)&&(n.open=e,i(0,a))},function(t){lt[t?"unshift":"push"]((()=>{l=t,i(3,l)}))},function(t){lt[t?"unshift":"push"]((()=>{r=t,i(2,r)}))}]}s("#post").on("submit",(function(){const t=s("#mewz-wcas-stock-status");t.find(".spinner").addClass("is-active"),t.find("#submit").prop("disabled",!0)})),s("#mewz_wcas_internal").on("change",r),r(),setTimeout(e),a.html&&l(a.html).insertAfter(".wrap > .page-title-action"),u=document.getElementById("post"),mewzWcas.setTabIndicator=d,p("settings"),p("filters"),new class extends qt{constructor(t){super(),Pt(this,t,ie,oe,w,{})}}({target:document.getElementById("components_panel"),props:{data:mewzWcas.components}}),new class extends qt{constructor(t){super(),Pt(this,t,Te,ke,w,{})}}({target:document.getElementById("attributes_panel"),props:{data:mewzWcas.matchRules}})})()})();
  • attribute-stock-for-woocommerce/trunk/attribute-stock-for-woocommerce.php

    r3108898 r3110100  
    44 * Plugin URI:  https://codecanyon.net/item/woocommerce-attribute-stock/25796765
    55 * Description: Take your stock to the next level. Set up complex stock configurations with ease. Shared stock, variable quantities, the possibilities are endless.
    6  * Version:     2.0.1
     6 * Version:     2.0.2
    77 * Author:      Mewz
    88 * Author URI:  https://mewz.dev/
     
    2323}
    2424
    25 const MEWZ_WCAS_VERSION = '2.0.1';
     25const MEWZ_WCAS_VERSION = '2.0.2';
    2626const MEWZ_WCAS_NAME = 'WooCommerce Attribute Stock';
    2727const MEWZ_WCAS_SLUG = 'woocommerce-attribute-stock';
  • attribute-stock-for-woocommerce/trunk/languages/woocommerce-attribute-stock.pot

    r3108900 r3110100  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: WooCommerce Attribute Stock 2.0.1\n"
     5"Project-Id-Version: WooCommerce Attribute Stock 2.0.2\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-attribute-stock\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-06-27T19:52:08+02:00\n"
     12"POT-Creation-Date: 2024-06-30T23:28:11+02:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.10.0\n"
     
    522522msgstr ""
    523523
    524 #: src/Aspects/Front/CartItems.php:243
     524#: src/Aspects/Front/CartItems.php:253
    525525msgid "%d (Shared)"
    526526msgstr ""
  • attribute-stock-for-woocommerce/trunk/readme.txt

    r3108898 r3110100  
    55Tested up to: 6.5
    66Requires PHP: 7.4
    7 Stable tag: 2.0.1
     7Stable tag: 2.0.2
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    4343Admin dashboard for easy management of attribute stock items. Set SKUs, stock images, product filters, and more.
    4444
     45**Powerful Customization**
     46Extensive flexibility to set up almost any type of stock configuration using match rules, product filters, component stock, and more.
     47
    4548**"Any" Variations**
    4649Use simple variations for your products. Stock will be accurately tracked without the need to specify every combination of attribute term options.
     
    5861Almost anything that can't already be configured can be added or changed with powerful actions and filters.
    5962
    60 \* *Please note that WordPress Multisite and multi-store synchronisation is not currently supported or planned.*
     63\* *Please note that WordPress Multisite and multi-store synchronization is not currently supported or planned.*
    6164
    6265### 🧩 Usage Examples
    6366
    64 #### Example #1 – Variable stock
     67#### Example #1 – Variable Stock ([Demo](https://wcas-demo.mewz.dev/wp-admin/post.php?post=69&action=edit))
    6568
    66 Let's say you sell tea by weight. You can simply set your total tea stock at the product level and specify a **stock multiplier** on each product variation ([demo](https://wcas-demo.mewz.dev/wp-admin/post.php?post=69&action=edit)). The respective amount will be deducted from your total stock for each purchase. If you need to share variable stock across more than one product listing, you can use **attribute stock items** instead.
     69Let's say you sell tea in packs of different weights. You can simply set your total tea stock at the product level and specify a **stock multiplier** on each product variation. The respective amount will be deducted from your total stock for each purchase. If you need to share variable stock across more than one product listing, you can use **attribute stock items** instead.
    6770
    68 #### Example #2 – Multiple attributes
     71#### Example #2 – Multiple Attributes ([Demo](https://wcas-demo.mewz.dev/wp-admin/post.php?post=127&action=edit))
    6972
    70 Often your stock will have more than one attribute, such as t-shirts with different **sizes** and **colors**. In this case it's trivial to create **attribute stock items** with rules to match any combination of attributes ([demo](https://wcas-demo.mewz.dev/wp-admin/post.php?post=127&action=edit)).
     73Often your stock will have more than one attribute, such as t-shirts with different **sizes** and **colors**. In this case it's trivial to create **attribute stock items** with rules to match any combination of attributes across any number of products.
    7174
    72 #### Example #3 – Product bundles
     75#### Example #3 – Product Bundles ([Demo](https://wcas-demo.mewz.dev/wp-admin/post.php?post=369&action=edit))
    7376
    74 Sometimes you'll want to sell several **simple products** as well as a **bundle** of these products for a discount. Since attributes can be assigned at the product-level as well as the variation-level, you can easily create stock that's shared between a simple product and a variation of another product ([demo](https://wcas-demo.mewz.dev/wp-admin/post.php?post=369&action=edit)).
     77Sometimes you'll want to sell several **individual products** as well as a **bundle** of these products for a discount. Since attributes can be added to products as variation or non-variation attributes, you can easily create stock items that are shared between all types of products.
    7578
    76 #### Example #4 – Components
     79#### Example #4 – Component Stock ([Demo](https://wcas-demo.mewz.dev/wp-admin/edit.php?s=candle&post_type=attribute_stock))
    7780
    78 In some cases you might need to track stock items made from other stock items. For example, let's say you design and sell hand-painted candles. By setting your plain candle stock as a component of your painted candle stock, you can track and sell each separately while allowing your painted candles to use the additional stock quantity of your plain candles ([demo](https://wcas-demo.mewz.dev/wp-admin/edit.php?s=candle&post_type=attribute_stock)).
     81In some cases you might need to track stock items made from other stock items. For example, let's say you design and sell hand-painted candles. By setting your plain candle stock as a component of your painted candle stock, you can track and sell each separately while allowing your painted candles to use the additional stock quantity of your plain candles.
     82
     83Component stock is a powerful feature that can be used for many other advanced stock requirements such as batches and even stock from multiple suppliers. Learn more about how it works in our documentation below.
    7984
    8085### 📖 Documentation
     
    8287Want to learn more about WooCommerce Attribute Stock? Head over to the [online documentation](https://wcas-docs.mewz.dev/).
    8388
    84 Be sure to take a look at the [FAQ / Troubleshooting](https://wcas-docs.mewz.dev/faq-troubleshooting.html) section if you're running into any issues.
     89Be sure to take a look at the [FAQ & Troubleshooting](https://wcas-docs.mewz.dev/faq-troubleshooting.html) section if you're running into any issues.
    8590
    8691== Installation ==
     
    97102
    98103= Do you offer customer support? =
    99 Yes. Email support is offered via [CodeCanyon](https://codecanyon.net/item/woocommerce-attribute-stock/25796765) after purchasing the full version. We will also respond to questions on the WordPress support forum, but response time may be delayed.
     104Email support is offered via [CodeCanyon](https://codecanyon.net/item/woocommerce-attribute-stock/25796765) after purchasing the full version. We will also respond to questions on the WordPress support forum, but response time may be delayed.
    100105
    101106= How can I get the full version? =
     
    103108
    104109== Changelog ==
     110
     111= 2.0.2 (2024-06-30) =
     112- Fixed a bug with product stock multiplier checking when adding to cart in certain cases.
     113- Fixed some stock validation bugs when using cart/checkout blocks.
     114- Fixed stock item match rules being initially focused on page load.
    105115
    106116= 2.0.1 (2024-06-27) =
  • attribute-stock-for-woocommerce/trunk/vendor/composer/installed.php

    r3108900 r3110100  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => 'd9251c21cf1bf2a18680b7df7720220eb8bfead3',
     6        'reference' => '2a9d568c24abae2e6b0f664d27a34745ad79b152',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    3232            'pretty_version' => 'dev-master',
    3333            'version' => 'dev-master',
    34             'reference' => 'd9251c21cf1bf2a18680b7df7720220eb8bfead3',
     34            'reference' => '2a9d568c24abae2e6b0f664d27a34745ad79b152',
    3535            'type' => 'wordpress-plugin',
    3636            'install_path' => __DIR__ . '/../../',
  • attribute-stock-for-woocommerce/trunk/vendor/mewz/framework/languages/mewz-framework.pot

    r3108900 r3110100  
    88"Content-Type: text/plain; charset=UTF-8\n"
    99"Content-Transfer-Encoding: 8bit\n"
    10 "POT-Creation-Date: 2024-06-27T19:52:09+02:00\n"
     10"POT-Creation-Date: 2024-06-30T23:28:12+02:00\n"
    1111"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1212"X-Generator: WP-CLI 2.10.0\n"
Note: See TracChangeset for help on using the changeset viewer.